dsh-open-artifact 0.8.1 → 0.8.2

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 (77) hide show
  1. package/lib/client.js +2 -2
  2. package/lib/index.js +41 -4
  3. package/package.json +1 -1
  4. package/skills/open-artifact/SKILL.md +1 -1
  5. package/vendor/artifact-types/data/scripts/cli.mjs +1 -1
  6. package/vendor/artifact-types/data/scripts/editors/data/assets/{index-CZiM2XTm.js → index-B041Zu27.js} +1 -1
  7. package/vendor/artifact-types/data/scripts/editors/data/index.html +1 -1
  8. package/vendor/artifact-types/{design/scripts/editors/design/assets/index-jhwXmpbV.js → data/scripts/editors/design/assets/index-D6-vjsn9.js} +1 -1
  9. package/vendor/artifact-types/data/scripts/editors/design/index.html +1 -1
  10. package/vendor/artifact-types/{design/scripts/editors/design-system/assets/index-7LPrsXBY.js → data/scripts/editors/design-system/assets/index-BoT2v4hc.js} +1 -1
  11. package/vendor/artifact-types/data/scripts/editors/design-system/index.html +1 -1
  12. package/vendor/artifact-types/{design/scripts/editors/slides/assets/index-y09Z-wXP.js → data/scripts/editors/slides/assets/index-b9M479Ro.js} +2 -2
  13. package/vendor/artifact-types/data/scripts/editors/slides/assets/{src-C48N4IXt.js → src-CxNLgI5_.js} +1 -1
  14. package/vendor/artifact-types/data/scripts/editors/slides/index.html +1 -1
  15. package/vendor/artifact-types/{design/scripts/editors/whiteboard/assets/index-DbekE4ru.js → data/scripts/editors/whiteboard/assets/index-TrzGo_VR.js} +1 -1
  16. package/vendor/artifact-types/data/scripts/editors/whiteboard/index.html +1 -1
  17. package/vendor/artifact-types/design/scripts/cli.mjs +1 -1
  18. package/vendor/artifact-types/{slides/scripts/editors/data/assets/index-CZiM2XTm.js → design/scripts/editors/data/assets/index-B041Zu27.js} +1 -1
  19. package/vendor/artifact-types/design/scripts/editors/data/index.html +1 -1
  20. package/vendor/artifact-types/{data/scripts/editors/design/assets/index-jhwXmpbV.js → design/scripts/editors/design/assets/index-D6-vjsn9.js} +1 -1
  21. package/vendor/artifact-types/design/scripts/editors/design/index.html +1 -1
  22. package/vendor/artifact-types/{design-system/scripts/editors/design-system/assets/index-7LPrsXBY.js → design/scripts/editors/design-system/assets/index-BoT2v4hc.js} +1 -1
  23. package/vendor/artifact-types/design/scripts/editors/design-system/index.html +1 -1
  24. package/vendor/artifact-types/{slides/scripts/editors/slides/assets/index-y09Z-wXP.js → design/scripts/editors/slides/assets/index-b9M479Ro.js} +2 -2
  25. package/vendor/artifact-types/{slides/scripts/editors/slides/assets/src-C48N4IXt.js → design/scripts/editors/slides/assets/src-CxNLgI5_.js} +1 -1
  26. package/vendor/artifact-types/design/scripts/editors/slides/index.html +1 -1
  27. package/vendor/artifact-types/{design-system/scripts/editors/whiteboard/assets/index-DbekE4ru.js → design/scripts/editors/whiteboard/assets/index-TrzGo_VR.js} +1 -1
  28. package/vendor/artifact-types/design/scripts/editors/whiteboard/index.html +1 -1
  29. package/vendor/artifact-types/design-system/scripts/cli.mjs +1 -1
  30. package/vendor/artifact-types/{design/scripts/editors/data/assets/index-CZiM2XTm.js → design-system/scripts/editors/data/assets/index-B041Zu27.js} +1 -1
  31. package/vendor/artifact-types/design-system/scripts/editors/data/index.html +1 -1
  32. package/vendor/artifact-types/{slides/scripts/editors/design/assets/index-jhwXmpbV.js → design-system/scripts/editors/design/assets/index-D6-vjsn9.js} +1 -1
  33. package/vendor/artifact-types/design-system/scripts/editors/design/index.html +1 -1
  34. package/vendor/artifact-types/{data/scripts/editors/design-system/assets/index-7LPrsXBY.js → design-system/scripts/editors/design-system/assets/index-BoT2v4hc.js} +1 -1
  35. package/vendor/artifact-types/design-system/scripts/editors/design-system/index.html +1 -1
  36. package/vendor/artifact-types/design-system/scripts/editors/slides/assets/{index-y09Z-wXP.js → index-b9M479Ro.js} +2 -2
  37. package/vendor/artifact-types/{design/scripts/editors/slides/assets/src-C48N4IXt.js → design-system/scripts/editors/slides/assets/src-CxNLgI5_.js} +1 -1
  38. package/vendor/artifact-types/design-system/scripts/editors/slides/index.html +1 -1
  39. package/vendor/artifact-types/{data/scripts/editors/whiteboard/assets/index-DbekE4ru.js → design-system/scripts/editors/whiteboard/assets/index-TrzGo_VR.js} +1 -1
  40. package/vendor/artifact-types/design-system/scripts/editors/whiteboard/index.html +1 -1
  41. package/vendor/artifact-types/slides/scripts/cli.mjs +1 -1
  42. package/vendor/artifact-types/{design-system/scripts/editors/data/assets/index-CZiM2XTm.js → slides/scripts/editors/data/assets/index-B041Zu27.js} +1 -1
  43. package/vendor/artifact-types/slides/scripts/editors/data/index.html +1 -1
  44. package/vendor/artifact-types/{design-system/scripts/editors/design/assets/index-jhwXmpbV.js → slides/scripts/editors/design/assets/index-D6-vjsn9.js} +1 -1
  45. package/vendor/artifact-types/slides/scripts/editors/design/index.html +1 -1
  46. package/vendor/artifact-types/slides/scripts/editors/design-system/assets/{index-7LPrsXBY.js → index-BoT2v4hc.js} +1 -1
  47. package/vendor/artifact-types/slides/scripts/editors/design-system/index.html +1 -1
  48. package/vendor/artifact-types/{data/scripts/editors/slides/assets/index-y09Z-wXP.js → slides/scripts/editors/slides/assets/index-b9M479Ro.js} +2 -2
  49. package/vendor/artifact-types/{design-system/scripts/editors/slides/assets/src-C48N4IXt.js → slides/scripts/editors/slides/assets/src-CxNLgI5_.js} +1 -1
  50. package/vendor/artifact-types/slides/scripts/editors/slides/index.html +1 -1
  51. package/vendor/artifact-types/slides/scripts/editors/whiteboard/assets/{index-DbekE4ru.js → index-TrzGo_VR.js} +1 -1
  52. package/vendor/artifact-types/slides/scripts/editors/whiteboard/index.html +1 -1
  53. package/vendor/artifact-types/whiteboard/scripts/cli.mjs +1 -1
  54. package/vendor/artifact-types/whiteboard/scripts/editors/data/assets/index-B041Zu27.js +126 -0
  55. package/vendor/artifact-types/whiteboard/scripts/editors/data/index.html +1 -1
  56. package/vendor/artifact-types/whiteboard/scripts/editors/design/assets/index-D6-vjsn9.js +215 -0
  57. package/vendor/artifact-types/whiteboard/scripts/editors/design/index.html +1 -1
  58. package/vendor/artifact-types/whiteboard/scripts/editors/design-system/assets/index-BoT2v4hc.js +139 -0
  59. package/vendor/artifact-types/whiteboard/scripts/editors/design-system/index.html +1 -1
  60. package/vendor/artifact-types/whiteboard/scripts/editors/slides/assets/index-b9M479Ro.js +569 -0
  61. package/vendor/artifact-types/whiteboard/scripts/editors/slides/assets/src-CxNLgI5_.js +1 -0
  62. package/vendor/artifact-types/whiteboard/scripts/editors/slides/index.html +1 -1
  63. package/vendor/artifact-types/whiteboard/scripts/editors/whiteboard/assets/index-TrzGo_VR.js +141 -0
  64. package/vendor/artifact-types/whiteboard/scripts/editors/whiteboard/index.html +1 -1
  65. package/vendor/frame-host/client/comments.js +1 -1
  66. package/vendor/frame-host/frame-host.mjs +1 -1
  67. package/vendor/home/assets/{index-CPvXdSVh.js → index-aY1m8xEm.js} +1 -1
  68. package/vendor/home/index.html +1 -1
  69. package/vendor/open-artifact.mjs +56 -38
  70. package/vendor/shell/assets/{index-DE0jNtst.js → index-ElpFysv2.js} +1 -1
  71. package/vendor/shell/index.html +1 -1
  72. package/vendor/artifact-types/whiteboard/scripts/editors/data/assets/index-CZiM2XTm.js +0 -126
  73. package/vendor/artifact-types/whiteboard/scripts/editors/design/assets/index-jhwXmpbV.js +0 -215
  74. package/vendor/artifact-types/whiteboard/scripts/editors/design-system/assets/index-7LPrsXBY.js +0 -139
  75. package/vendor/artifact-types/whiteboard/scripts/editors/slides/assets/index-y09Z-wXP.js +0 -569
  76. package/vendor/artifact-types/whiteboard/scripts/editors/slides/assets/src-C48N4IXt.js +0 -1
  77. package/vendor/artifact-types/whiteboard/scripts/editors/whiteboard/assets/index-DbekE4ru.js +0 -141
@@ -6,7 +6,7 @@ function _x(o,l){for(var a=0;a<l.length;a++){const r=l[a];if(typeof r!="string"&
6
6
  `+_[i].replace(" at new "," at ");return e.displayName&&re.includes("<anonymous>")&&(re=re.replace("<anonymous>",e.displayName)),re}while(1<=i&&0<=s);break}}}finally{ke=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?_e(n):""}function xe(e,t){switch(e.tag){case 26:case 27:case 5:return _e(e.type);case 16:return _e("Lazy");case 13:return e.child!==t&&t!==null?_e("Suspense Fallback"):_e("Suspense");case 19:return _e("SuspenseList");case 0:case 15:return Pe(e.type,!1);case 11:return Pe(e.type.render,!1);case 1:return Pe(e.type,!0);case 31:return _e("Activity");default:return""}}function Ue(e){try{var t="",n=null;do t+=xe(e,n),n=e,e=e.return;while(e);return t}catch(i){return`
7
7
  Error generating stack: `+i.message+`
8
8
  `+i.stack}}var Te=Object.prototype.hasOwnProperty,Ee=o.unstable_scheduleCallback,we=o.unstable_cancelCallback,Qe=o.unstable_shouldYield,Ae=o.unstable_requestPaint,fe=o.unstable_now,me=o.unstable_getCurrentPriorityLevel,de=o.unstable_ImmediatePriority,ae=o.unstable_UserBlockingPriority,ye=o.unstable_NormalPriority,Le=o.unstable_LowPriority,Lt=o.unstable_IdlePriority,$t=o.log,Tt=o.unstable_setDisableYieldValue,Se=null,Ie=null;function tt(e){if(typeof $t=="function"&&Tt(e),Ie&&typeof Ie.setStrictMode=="function")try{Ie.setStrictMode(Se,e)}catch{}}var pt=Math.clz32?Math.clz32:Sn,bn=Math.log,Hn=Math.LN2;function Sn(e){return e>>>=0,e===0?32:31-(bn(e)/Hn|0)|0}var At=256,jn=262144,Ge=4194304;function xt(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function It(e,t,n){var i=e.pendingLanes;if(i===0)return 0;var s=0,u=e.suspendedLanes,p=e.pingedLanes;e=e.warmLanes;var x=i&134217727;return x!==0?(i=x&~u,i!==0?s=xt(i):(p&=x,p!==0?s=xt(p):n||(n=x&~e,n!==0&&(s=xt(n))))):(x=i&~u,x!==0?s=xt(x):p!==0?s=xt(p):n||(n=i&~e,n!==0&&(s=xt(n)))),s===0?0:t!==0&&t!==s&&(t&u)===0&&(u=s&-s,n=t&-t,u>=n||u===32&&(n&4194048)!==0)?t:s}function Mt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Vn(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function en(){var e=Ge;return Ge<<=1,(Ge&62914560)===0&&(Ge=4194304),e}function Ao(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function xn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Il(e,t,n,i,s,u){var p=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var x=e.entanglements,_=e.expirationTimes,X=e.hiddenUpdates;for(n=p&~n;0<n;){var re=31-pt(n),ce=1<<re;x[re]=0,_[re]=-1;var Z=X[re];if(Z!==null)for(X[re]=null,re=0;re<Z.length;re++){var te=Z[re];te!==null&&(te.lane&=-536870913)}n&=~ce}i!==0&&kn(e,i,0),u!==0&&s===0&&e.tag!==0&&(e.suspendedLanes|=u&~(p&~t))}function kn(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-pt(t);e.entangledLanes|=t,e.entanglements[i]=e.entanglements[i]|1073741824|n&261930}function Mo(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var i=31-pt(n),s=1<<i;s&t|e[i]&t&&(e[i]|=t),n&=~s}}function Do(e,t){var n=t&-t;return n=(n&42)!==0?1:No(n),(n&(e.suspendedLanes|t))!==0?0:n}function No(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function dl(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Pa(){var e=P.p;return e!==0?e:(e=window.event,e===void 0?32:Ym(e.type))}function Va(e,t){var n=P.p;try{return P.p=e,t()}finally{P.p=n}}var zo=Math.random().toString(36).slice(2),qt="__reactFiber$"+zo,tn="__reactProps$"+zo,ql="__reactContainer$"+zo,$s="__reactEvents$"+zo,T0="__reactListeners$"+zo,E0="__reactHandles$"+zo,op="__reactResources$"+zo,ki="__reactMarker$"+zo;function eu(e){delete e[qt],delete e[tn],delete e[$s],delete e[T0],delete e[E0]}function Pl(e){var t=e[qt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ql]||n[qt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Rm(e);e!==null;){if(n=e[qt])return n;e=Rm(e)}return t}e=n,n=e.parentNode}return null}function Vl(e){if(e=e[qt]||e[ql]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ui(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(r(33))}function Gl(e){var t=e[op];return t||(t=e[op]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Bt(e){e[ki]=!0}var lp=new Set,ip={};function pl(e,t){Xl(e,t),Xl(e+"Capture",t)}function Xl(e,t){for(ip[e]=t,e=0;e<t.length;e++)lp.add(t[e])}var R0=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]*$"),ap={},rp={};function C0(e){return Te.call(rp,e)?!0:Te.call(ap,e)?!1:R0.test(e)?rp[e]=!0:(ap[e]=!0,!1)}function Ga(e,t,n){if(C0(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var i=t.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function Xa(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function Wn(e,t,n,i){if(i===null)e.removeAttribute(n);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+i)}}function Tn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function sp(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function O0(e,t,n){var i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var s=i.get,u=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(p){n=""+p,u.call(this,p)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return n},setValue:function(p){n=""+p},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function tu(e){if(!e._valueTracker){var t=sp(e)?"checked":"value";e._valueTracker=O0(e,t,""+e[t])}}function up(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),i="";return e&&(i=sp(e)?e.checked?"true":"false":e.value),e=i,e!==n?(t.setValue(e),!0):!1}function Ka(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var w0=/[\n"\\]/g;function En(e){return e.replace(w0,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function nu(e,t,n,i,s,u,p,x){e.name="",p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"?e.type=p:e.removeAttribute("type"),t!=null?p==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Tn(t)):e.value!==""+Tn(t)&&(e.value=""+Tn(t)):p!=="submit"&&p!=="reset"||e.removeAttribute("value"),t!=null?ou(e,p,Tn(t)):n!=null?ou(e,p,Tn(n)):i!=null&&e.removeAttribute("value"),s==null&&u!=null&&(e.defaultChecked=!!u),s!=null&&(e.checked=s&&typeof s!="function"&&typeof s!="symbol"),x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.name=""+Tn(x):e.removeAttribute("name")}function cp(e,t,n,i,s,u,p,x){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.type=u),t!=null||n!=null){if(!(u!=="submit"&&u!=="reset"||t!=null)){tu(e);return}n=n!=null?""+Tn(n):"",t=t!=null?""+Tn(t):n,x||t===e.value||(e.value=t),e.defaultValue=t}i=i??s,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=x?e.checked:!!i,e.defaultChecked=!!i,p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"&&(e.name=p),tu(e)}function ou(e,t,n){t==="number"&&Ka(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Kl(e,t,n,i){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&i&&(e[n].defaultSelected=!0)}else{for(n=""+Tn(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,i&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function fp(e,t,n){if(t!=null&&(t=""+Tn(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Tn(n):""}function dp(e,t,n,i){if(t==null){if(i!=null){if(n!=null)throw Error(r(92));if(K(i)){if(1<i.length)throw Error(r(93));i=i[0]}n=i}n==null&&(n=""),t=n}n=Tn(t),e.defaultValue=n,i=e.textContent,i===n&&i!==""&&i!==null&&(e.value=i),tu(e)}function Ql(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var A0=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 pp(e,t,n){var i=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?i?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":i?e.setProperty(t,n):typeof n!="number"||n===0||A0.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function hp(e,t,n){if(t!=null&&typeof t!="object")throw Error(r(62));if(e=e.style,n!=null){for(var i in n)!n.hasOwnProperty(i)||t!=null&&t.hasOwnProperty(i)||(i.indexOf("--")===0?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="");for(var s in t)i=t[s],t.hasOwnProperty(s)&&n[s]!==i&&pp(e,s,i)}else for(var u in t)t.hasOwnProperty(u)&&pp(e,u,t[u])}function lu(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var M0=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"]]),D0=/^[\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 Qa(e){return D0.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function $n(){}var iu=null;function au(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Fl=null,Zl=null;function gp(e){var t=Vl(e);if(t&&(e=t.stateNode)){var n=e[tn]||null;e:switch(e=t.stateNode,t.type){case"input":if(nu(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+En(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var i=n[t];if(i!==e&&i.form===e.form){var s=i[tn]||null;if(!s)throw Error(r(90));nu(i,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name)}}for(t=0;t<n.length;t++)i=n[t],i.form===e.form&&up(i)}break e;case"textarea":fp(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Kl(e,!!n.multiple,t,!1)}}}var ru=!1;function mp(e,t,n){if(ru)return e(t,n);ru=!0;try{var i=e(t);return i}finally{if(ru=!1,(Fl!==null||Zl!==null)&&(jr(),Fl&&(t=Fl,e=Zl,Zl=Fl=null,gp(t),e)))for(t=0;t<e.length;t++)gp(e[t])}}function Li(e,t){var n=e.stateNode;if(n===null)return null;var i=n[tn]||null;if(i===null)return null;n=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(r(231,t,typeof n));return n}var eo=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),su=!1;if(eo)try{var Bi={};Object.defineProperty(Bi,"passive",{get:function(){su=!0}}),window.addEventListener("test",Bi,Bi),window.removeEventListener("test",Bi,Bi)}catch{su=!1}var _o=null,uu=null,Fa=null;function yp(){if(Fa)return Fa;var e,t=uu,n=t.length,i,s="value"in _o?_o.value:_o.textContent,u=s.length;for(e=0;e<n&&t[e]===s[e];e++);var p=n-e;for(i=1;i<=p&&t[n-i]===s[u-i];i++);return Fa=s.slice(e,1<i?1-i:void 0)}function Za(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Ja(){return!0}function vp(){return!1}function nn(e){function t(n,i,s,u,p){this._reactName=n,this._targetInst=s,this.type=i,this.nativeEvent=u,this.target=p,this.currentTarget=null;for(var x in e)e.hasOwnProperty(x)&&(n=e[x],this[x]=n?n(u):u[x]);return this.isDefaultPrevented=(u.defaultPrevented!=null?u.defaultPrevented:u.returnValue===!1)?Ja:vp,this.isPropagationStopped=vp,this}return b(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Ja)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ja)},persist:function(){},isPersistent:Ja}),t}var hl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Wa=nn(hl),Yi=b({},hl,{view:0,detail:0}),N0=nn(Yi),cu,fu,Ii,$a=b({},Yi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:pu,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Ii&&(Ii&&e.type==="mousemove"?(cu=e.screenX-Ii.screenX,fu=e.screenY-Ii.screenY):fu=cu=0,Ii=e),cu)},movementY:function(e){return"movementY"in e?e.movementY:fu}}),bp=nn($a),z0=b({},$a,{dataTransfer:0}),_0=nn(z0),H0=b({},Yi,{relatedTarget:0}),du=nn(H0),j0=b({},hl,{animationName:0,elapsedTime:0,pseudoElement:0}),k0=nn(j0),U0=b({},hl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),L0=nn(U0),B0=b({},hl,{data:0}),Sp=nn(B0),Y0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},I0={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"},q0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function P0(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=q0[e])?!!t[e]:!1}function pu(){return P0}var V0=b({},Yi,{key:function(e){if(e.key){var t=Y0[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Za(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?I0[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:pu,charCode:function(e){return e.type==="keypress"?Za(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Za(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),G0=nn(V0),X0=b({},$a,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),xp=nn(X0),K0=b({},Yi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:pu}),Q0=nn(K0),F0=b({},hl,{propertyName:0,elapsedTime:0,pseudoElement:0}),Z0=nn(F0),J0=b({},$a,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),W0=nn(J0),$0=b({},hl,{newState:0,oldState:0}),eS=nn($0),tS=[9,13,27,32],hu=eo&&"CompositionEvent"in window,qi=null;eo&&"documentMode"in document&&(qi=document.documentMode);var nS=eo&&"TextEvent"in window&&!qi,Tp=eo&&(!hu||qi&&8<qi&&11>=qi),Ep=" ",Rp=!1;function Cp(e,t){switch(e){case"keyup":return tS.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Op(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Jl=!1;function oS(e,t){switch(e){case"compositionend":return Op(t);case"keypress":return t.which!==32?null:(Rp=!0,Ep);case"textInput":return e=t.data,e===Ep&&Rp?null:e;default:return null}}function lS(e,t){if(Jl)return e==="compositionend"||!hu&&Cp(e,t)?(e=yp(),Fa=uu=_o=null,Jl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Tp&&t.locale!=="ko"?null:t.data;default:return null}}var iS={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 wp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!iS[e.type]:t==="textarea"}function Ap(e,t,n,i){Fl?Zl?Zl.push(i):Zl=[i]:Fl=i,t=qr(t,"onChange"),0<t.length&&(n=new Wa("onChange","change",null,n,i),e.push({event:n,listeners:t}))}var Pi=null,Vi=null;function aS(e){cm(e,0)}function er(e){var t=Ui(e);if(up(t))return e}function Mp(e,t){if(e==="change")return t}var Dp=!1;if(eo){var gu;if(eo){var mu="oninput"in document;if(!mu){var Np=document.createElement("div");Np.setAttribute("oninput","return;"),mu=typeof Np.oninput=="function"}gu=mu}else gu=!1;Dp=gu&&(!document.documentMode||9<document.documentMode)}function zp(){Pi&&(Pi.detachEvent("onpropertychange",_p),Vi=Pi=null)}function _p(e){if(e.propertyName==="value"&&er(Vi)){var t=[];Ap(t,Vi,e,au(e)),mp(aS,t)}}function rS(e,t,n){e==="focusin"?(zp(),Pi=t,Vi=n,Pi.attachEvent("onpropertychange",_p)):e==="focusout"&&zp()}function sS(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return er(Vi)}function uS(e,t){if(e==="click")return er(t)}function cS(e,t){if(e==="input"||e==="change")return er(t)}function fS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var cn=typeof Object.is=="function"?Object.is:fS;function Gi(e,t){if(cn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(i=0;i<n.length;i++){var s=n[i];if(!Te.call(t,s)||!cn(e[s],t[s]))return!1}return!0}function Hp(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function jp(e,t){var n=Hp(e);e=0;for(var i;n;){if(n.nodeType===3){if(i=e+n.textContent.length,e<=t&&i>=t)return{node:n,offset:t-e};e=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Hp(n)}}function kp(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?kp(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Up(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ka(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ka(e.document)}return t}function yu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var dS=eo&&"documentMode"in document&&11>=document.documentMode,Wl=null,vu=null,Xi=null,bu=!1;function Lp(e,t,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;bu||Wl==null||Wl!==Ka(i)||(i=Wl,"selectionStart"in i&&yu(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),Xi&&Gi(Xi,i)||(Xi=i,i=qr(vu,"onSelect"),0<i.length&&(t=new Wa("onSelect","select",null,t,n),e.push({event:t,listeners:i}),t.target=Wl)))}function gl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var $l={animationend:gl("Animation","AnimationEnd"),animationiteration:gl("Animation","AnimationIteration"),animationstart:gl("Animation","AnimationStart"),transitionrun:gl("Transition","TransitionRun"),transitionstart:gl("Transition","TransitionStart"),transitioncancel:gl("Transition","TransitionCancel"),transitionend:gl("Transition","TransitionEnd")},Su={},Bp={};eo&&(Bp=document.createElement("div").style,"AnimationEvent"in window||(delete $l.animationend.animation,delete $l.animationiteration.animation,delete $l.animationstart.animation),"TransitionEvent"in window||delete $l.transitionend.transition);function ml(e){if(Su[e])return Su[e];if(!$l[e])return e;var t=$l[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Bp)return Su[e]=t[n];return e}var Yp=ml("animationend"),Ip=ml("animationiteration"),qp=ml("animationstart"),pS=ml("transitionrun"),hS=ml("transitionstart"),gS=ml("transitioncancel"),Pp=ml("transitionend"),Vp=new Map,xu="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(" ");xu.push("scrollEnd");function Un(e,t){Vp.set(e,t),pl(t,[e])}var tr=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Rn=[],ei=0,Tu=0;function nr(){for(var e=ei,t=Tu=ei=0;t<e;){var n=Rn[t];Rn[t++]=null;var i=Rn[t];Rn[t++]=null;var s=Rn[t];Rn[t++]=null;var u=Rn[t];if(Rn[t++]=null,i!==null&&s!==null){var p=i.pending;p===null?s.next=s:(s.next=p.next,p.next=s),i.pending=s}u!==0&&Gp(n,s,u)}}function or(e,t,n,i){Rn[ei++]=e,Rn[ei++]=t,Rn[ei++]=n,Rn[ei++]=i,Tu|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function Eu(e,t,n,i){return or(e,t,n,i),lr(e)}function yl(e,t){return or(e,null,null,t),lr(e)}function Gp(e,t,n){e.lanes|=n;var i=e.alternate;i!==null&&(i.lanes|=n);for(var s=!1,u=e.return;u!==null;)u.childLanes|=n,i=u.alternate,i!==null&&(i.childLanes|=n),u.tag===22&&(e=u.stateNode,e===null||e._visibility&1||(s=!0)),e=u,u=u.return;return e.tag===3?(u=e.stateNode,s&&t!==null&&(s=31-pt(n),e=u.hiddenUpdates,i=e[s],i===null?e[s]=[t]:i.push(t),t.lane=n|536870912),u):null}function lr(e){if(50<ha)throw ha=0,zc=null,Error(r(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ti={};function mS(e,t,n,i){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function fn(e,t,n,i){return new mS(e,t,n,i)}function Ru(e){return e=e.prototype,!(!e||!e.isReactComponent)}function to(e,t){var n=e.alternate;return n===null?(n=fn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Xp(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ir(e,t,n,i,s,u){var p=0;if(i=e,typeof e=="function")Ru(e)&&(p=1);else if(typeof e=="string")p=xx(e,n,V.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case W:return e=fn(31,n,t,s),e.elementType=W,e.lanes=u,e;case C:return vl(n.children,s,u,t);case O:p=8,s|=24;break;case w:return e=fn(12,n,t,s|2),e.elementType=w,e.lanes=u,e;case H:return e=fn(13,n,t,s),e.elementType=H,e.lanes=u,e;case U:return e=fn(19,n,t,s),e.elementType=U,e.lanes=u,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case A:p=10;break e;case D:p=9;break e;case M:p=11;break e;case j:p=14;break e;case k:p=16,i=null;break e}p=29,n=Error(r(130,e===null?"null":typeof e,"")),i=null}return t=fn(p,n,t,s),t.elementType=e,t.type=i,t.lanes=u,t}function vl(e,t,n,i){return e=fn(7,e,i,t),e.lanes=n,e}function Cu(e,t,n){return e=fn(6,e,null,t),e.lanes=n,e}function Kp(e){var t=fn(18,null,null,0);return t.stateNode=e,t}function Ou(e,t,n){return t=fn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Qp=new WeakMap;function Cn(e,t){if(typeof e=="object"&&e!==null){var n=Qp.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Ue(t)},Qp.set(e,t),t)}return{value:e,source:t,stack:Ue(t)}}var ni=[],oi=0,ar=null,Ki=0,On=[],wn=0,Ho=null,Gn=1,Xn="";function no(e,t){ni[oi++]=Ki,ni[oi++]=ar,ar=e,Ki=t}function Fp(e,t,n){On[wn++]=Gn,On[wn++]=Xn,On[wn++]=Ho,Ho=e;var i=Gn;e=Xn;var s=32-pt(i)-1;i&=~(1<<s),n+=1;var u=32-pt(t)+s;if(30<u){var p=s-s%5;u=(i&(1<<p)-1).toString(32),i>>=p,s-=p,Gn=1<<32-pt(t)+s|n<<s|i,Xn=u+e}else Gn=1<<u|n<<s|i,Xn=e}function wu(e){e.return!==null&&(no(e,1),Fp(e,1,0))}function Au(e){for(;e===ar;)ar=ni[--oi],ni[oi]=null,Ki=ni[--oi],ni[oi]=null;for(;e===Ho;)Ho=On[--wn],On[wn]=null,Xn=On[--wn],On[wn]=null,Gn=On[--wn],On[wn]=null}function Zp(e,t){On[wn++]=Gn,On[wn++]=Xn,On[wn++]=Ho,Gn=t.id,Xn=t.overflow,Ho=e}var Pt=null,gt=null,et=!1,jo=null,An=!1,Mu=Error(r(519));function ko(e){var t=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Qi(Cn(t,e)),Mu}function Jp(e){var t=e.stateNode,n=e.type,i=e.memoizedProps;switch(t[qt]=e,t[tn]=i,n){case"dialog":Ze("cancel",t),Ze("close",t);break;case"iframe":case"object":case"embed":Ze("load",t);break;case"video":case"audio":for(n=0;n<ma.length;n++)Ze(ma[n],t);break;case"source":Ze("error",t);break;case"img":case"image":case"link":Ze("error",t),Ze("load",t);break;case"details":Ze("toggle",t);break;case"input":Ze("invalid",t),cp(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":Ze("invalid",t);break;case"textarea":Ze("invalid",t),dp(t,i.value,i.defaultValue,i.children)}n=i.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||i.suppressHydrationWarning===!0||hm(t.textContent,n)?(i.popover!=null&&(Ze("beforetoggle",t),Ze("toggle",t)),i.onScroll!=null&&Ze("scroll",t),i.onScrollEnd!=null&&Ze("scrollend",t),i.onClick!=null&&(t.onclick=$n),t=!0):t=!1,t||ko(e,!0)}function Wp(e){for(Pt=e.return;Pt;)switch(Pt.tag){case 5:case 31:case 13:An=!1;return;case 27:case 3:An=!0;return;default:Pt=Pt.return}}function li(e){if(e!==Pt)return!1;if(!et)return Wp(e),et=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Kc(e.type,e.memoizedProps)),n=!n),n&&gt&&ko(e),Wp(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));gt=Em(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));gt=Em(e)}else t===27?(t=gt,Zo(e.type)?(e=Wc,Wc=null,gt=e):gt=t):gt=Pt?Dn(e.stateNode.nextSibling):null;return!0}function bl(){gt=Pt=null,et=!1}function Du(){var e=jo;return e!==null&&(rn===null?rn=e:rn.push.apply(rn,e),jo=null),e}function Qi(e){jo===null?jo=[e]:jo.push(e)}var Nu=R(null),Sl=null,oo=null;function Uo(e,t,n){J(Nu,t._currentValue),t._currentValue=n}function lo(e){e._currentValue=Nu.current,B(Nu)}function zu(e,t,n){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===n)break;e=e.return}}function _u(e,t,n,i){var s=e.child;for(s!==null&&(s.return=e);s!==null;){var u=s.dependencies;if(u!==null){var p=s.child;u=u.firstContext;e:for(;u!==null;){var x=u;u=s;for(var _=0;_<t.length;_++)if(x.context===t[_]){u.lanes|=n,x=u.alternate,x!==null&&(x.lanes|=n),zu(u.return,n,e),i||(p=null);break e}u=x.next}}else if(s.tag===18){if(p=s.return,p===null)throw Error(r(341));p.lanes|=n,u=p.alternate,u!==null&&(u.lanes|=n),zu(p,n,e),p=null}else p=s.child;if(p!==null)p.return=s;else for(p=s;p!==null;){if(p===e){p=null;break}if(s=p.sibling,s!==null){s.return=p.return,p=s;break}p=p.return}s=p}}function ii(e,t,n,i){e=null;for(var s=t,u=!1;s!==null;){if(!u){if((s.flags&524288)!==0)u=!0;else if((s.flags&262144)!==0)break}if(s.tag===10){var p=s.alternate;if(p===null)throw Error(r(387));if(p=p.memoizedProps,p!==null){var x=s.type;cn(s.pendingProps.value,p.value)||(e!==null?e.push(x):e=[x])}}else if(s===he.current){if(p=s.alternate,p===null)throw Error(r(387));p.memoizedState.memoizedState!==s.memoizedState.memoizedState&&(e!==null?e.push(xa):e=[xa])}s=s.return}e!==null&&_u(t,e,n,i),t.flags|=262144}function rr(e){for(e=e.firstContext;e!==null;){if(!cn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function xl(e){Sl=e,oo=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Vt(e){return $p(Sl,e)}function sr(e,t){return Sl===null&&xl(e),$p(e,t)}function $p(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},oo===null){if(e===null)throw Error(r(308));oo=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else oo=oo.next=t;return n}var yS=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,i){e.push(i)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},vS=o.unstable_scheduleCallback,bS=o.unstable_NormalPriority,Dt={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Hu(){return{controller:new yS,data:new Map,refCount:0}}function Fi(e){e.refCount--,e.refCount===0&&vS(bS,function(){e.controller.abort()})}var Zi=null,ju=0,ai=0,ri=null;function SS(e,t){if(Zi===null){var n=Zi=[];ju=0,ai=Lc(),ri={status:"pending",value:void 0,then:function(i){n.push(i)}}}return ju++,t.then(eh,eh),t}function eh(){if(--ju===0&&Zi!==null){ri!==null&&(ri.status="fulfilled");var e=Zi;Zi=null,ai=0,ri=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function xS(e,t){var n=[],i={status:"pending",value:null,reason:null,then:function(s){n.push(s)}};return e.then(function(){i.status="fulfilled",i.value=t;for(var s=0;s<n.length;s++)(0,n[s])(t)},function(s){for(i.status="rejected",i.reason=s,s=0;s<n.length;s++)(0,n[s])(void 0)}),i}var th=N.S;N.S=function(e,t){Lg=fe(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&SS(e,t),th!==null&&th(e,t)};var Tl=R(null);function ku(){var e=Tl.current;return e!==null?e:ht.pooledCache}function ur(e,t){t===null?J(Tl,Tl.current):J(Tl,t.pool)}function nh(){var e=ku();return e===null?null:{parent:Dt._currentValue,pool:e}}var si=Error(r(460)),Uu=Error(r(474)),cr=Error(r(542)),fr={then:function(){}};function oh(e){return e=e.status,e==="fulfilled"||e==="rejected"}function lh(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then($n,$n),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,ah(e),e;default:if(typeof t.status=="string")t.then($n,$n);else{if(e=ht,e!==null&&100<e.shellSuspendCounter)throw Error(r(482));e=t,e.status="pending",e.then(function(i){if(t.status==="pending"){var s=t;s.status="fulfilled",s.value=i}},function(i){if(t.status==="pending"){var s=t;s.status="rejected",s.reason=i}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,ah(e),e}throw Rl=t,si}}function El(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Rl=n,si):n}}var Rl=null;function ih(){if(Rl===null)throw Error(r(459));var e=Rl;return Rl=null,e}function ah(e){if(e===si||e===cr)throw Error(r(483))}var ui=null,Ji=0;function dr(e){var t=Ji;return Ji+=1,ui===null&&(ui=[]),lh(ui,e,t)}function Wi(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function pr(e,t){throw t.$$typeof===S?Error(r(525)):(e=Object.prototype.toString.call(t),Error(r(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function rh(e){function t(q,L){if(e){var G=q.deletions;G===null?(q.deletions=[L],q.flags|=16):G.push(L)}}function n(q,L){if(!e)return null;for(;L!==null;)t(q,L),L=L.sibling;return null}function i(q){for(var L=new Map;q!==null;)q.key!==null?L.set(q.key,q):L.set(q.index,q),q=q.sibling;return L}function s(q,L){return q=to(q,L),q.index=0,q.sibling=null,q}function u(q,L,G){return q.index=G,e?(G=q.alternate,G!==null?(G=G.index,G<L?(q.flags|=67108866,L):G):(q.flags|=67108866,L)):(q.flags|=1048576,L)}function p(q){return e&&q.alternate===null&&(q.flags|=67108866),q}function x(q,L,G,se){return L===null||L.tag!==6?(L=Cu(G,q.mode,se),L.return=q,L):(L=s(L,G),L.return=q,L)}function _(q,L,G,se){var Ne=G.type;return Ne===C?re(q,L,G.props.children,se,G.key):L!==null&&(L.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===k&&El(Ne)===L.type)?(L=s(L,G.props),Wi(L,G),L.return=q,L):(L=ir(G.type,G.key,G.props,null,q.mode,se),Wi(L,G),L.return=q,L)}function X(q,L,G,se){return L===null||L.tag!==4||L.stateNode.containerInfo!==G.containerInfo||L.stateNode.implementation!==G.implementation?(L=Ou(G,q.mode,se),L.return=q,L):(L=s(L,G.children||[]),L.return=q,L)}function re(q,L,G,se,Ne){return L===null||L.tag!==7?(L=vl(G,q.mode,se,Ne),L.return=q,L):(L=s(L,G),L.return=q,L)}function ce(q,L,G){if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return L=Cu(""+L,q.mode,G),L.return=q,L;if(typeof L=="object"&&L!==null){switch(L.$$typeof){case E:return G=ir(L.type,L.key,L.props,null,q.mode,G),Wi(G,L),G.return=q,G;case T:return L=Ou(L,q.mode,G),L.return=q,L;case k:return L=El(L),ce(q,L,G)}if(K(L)||Y(L))return L=vl(L,q.mode,G,null),L.return=q,L;if(typeof L.then=="function")return ce(q,dr(L),G);if(L.$$typeof===A)return ce(q,sr(q,L),G);pr(q,L)}return null}function Z(q,L,G,se){var Ne=L!==null?L.key:null;if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return Ne!==null?null:x(q,L,""+G,se);if(typeof G=="object"&&G!==null){switch(G.$$typeof){case E:return G.key===Ne?_(q,L,G,se):null;case T:return G.key===Ne?X(q,L,G,se):null;case k:return G=El(G),Z(q,L,G,se)}if(K(G)||Y(G))return Ne!==null?null:re(q,L,G,se,null);if(typeof G.then=="function")return Z(q,L,dr(G),se);if(G.$$typeof===A)return Z(q,L,sr(q,G),se);pr(q,G)}return null}function te(q,L,G,se,Ne){if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return q=q.get(G)||null,x(L,q,""+se,Ne);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case E:return q=q.get(se.key===null?G:se.key)||null,_(L,q,se,Ne);case T:return q=q.get(se.key===null?G:se.key)||null,X(L,q,se,Ne);case k:return se=El(se),te(q,L,G,se,Ne)}if(K(se)||Y(se))return q=q.get(G)||null,re(L,q,se,Ne,null);if(typeof se.then=="function")return te(q,L,G,dr(se),Ne);if(se.$$typeof===A)return te(q,L,G,sr(L,se),Ne);pr(L,se)}return null}function Ce(q,L,G,se){for(var Ne=null,nt=null,Me=L,Ve=L=0,$e=null;Me!==null&&Ve<G.length;Ve++){Me.index>Ve?($e=Me,Me=null):$e=Me.sibling;var ot=Z(q,Me,G[Ve],se);if(ot===null){Me===null&&(Me=$e);break}e&&Me&&ot.alternate===null&&t(q,Me),L=u(ot,L,Ve),nt===null?Ne=ot:nt.sibling=ot,nt=ot,Me=$e}if(Ve===G.length)return n(q,Me),et&&no(q,Ve),Ne;if(Me===null){for(;Ve<G.length;Ve++)Me=ce(q,G[Ve],se),Me!==null&&(L=u(Me,L,Ve),nt===null?Ne=Me:nt.sibling=Me,nt=Me);return et&&no(q,Ve),Ne}for(Me=i(Me);Ve<G.length;Ve++)$e=te(Me,q,Ve,G[Ve],se),$e!==null&&(e&&$e.alternate!==null&&Me.delete($e.key===null?Ve:$e.key),L=u($e,L,Ve),nt===null?Ne=$e:nt.sibling=$e,nt=$e);return e&&Me.forEach(function(tl){return t(q,tl)}),et&&no(q,Ve),Ne}function je(q,L,G,se){if(G==null)throw Error(r(151));for(var Ne=null,nt=null,Me=L,Ve=L=0,$e=null,ot=G.next();Me!==null&&!ot.done;Ve++,ot=G.next()){Me.index>Ve?($e=Me,Me=null):$e=Me.sibling;var tl=Z(q,Me,ot.value,se);if(tl===null){Me===null&&(Me=$e);break}e&&Me&&tl.alternate===null&&t(q,Me),L=u(tl,L,Ve),nt===null?Ne=tl:nt.sibling=tl,nt=tl,Me=$e}if(ot.done)return n(q,Me),et&&no(q,Ve),Ne;if(Me===null){for(;!ot.done;Ve++,ot=G.next())ot=ce(q,ot.value,se),ot!==null&&(L=u(ot,L,Ve),nt===null?Ne=ot:nt.sibling=ot,nt=ot);return et&&no(q,Ve),Ne}for(Me=i(Me);!ot.done;Ve++,ot=G.next())ot=te(Me,q,Ve,ot.value,se),ot!==null&&(e&&ot.alternate!==null&&Me.delete(ot.key===null?Ve:ot.key),L=u(ot,L,Ve),nt===null?Ne=ot:nt.sibling=ot,nt=ot);return e&&Me.forEach(function(zx){return t(q,zx)}),et&&no(q,Ve),Ne}function ct(q,L,G,se){if(typeof G=="object"&&G!==null&&G.type===C&&G.key===null&&(G=G.props.children),typeof G=="object"&&G!==null){switch(G.$$typeof){case E:e:{for(var Ne=G.key;L!==null;){if(L.key===Ne){if(Ne=G.type,Ne===C){if(L.tag===7){n(q,L.sibling),se=s(L,G.props.children),se.return=q,q=se;break e}}else if(L.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===k&&El(Ne)===L.type){n(q,L.sibling),se=s(L,G.props),Wi(se,G),se.return=q,q=se;break e}n(q,L);break}else t(q,L);L=L.sibling}G.type===C?(se=vl(G.props.children,q.mode,se,G.key),se.return=q,q=se):(se=ir(G.type,G.key,G.props,null,q.mode,se),Wi(se,G),se.return=q,q=se)}return p(q);case T:e:{for(Ne=G.key;L!==null;){if(L.key===Ne)if(L.tag===4&&L.stateNode.containerInfo===G.containerInfo&&L.stateNode.implementation===G.implementation){n(q,L.sibling),se=s(L,G.children||[]),se.return=q,q=se;break e}else{n(q,L);break}else t(q,L);L=L.sibling}se=Ou(G,q.mode,se),se.return=q,q=se}return p(q);case k:return G=El(G),ct(q,L,G,se)}if(K(G))return Ce(q,L,G,se);if(Y(G)){if(Ne=Y(G),typeof Ne!="function")throw Error(r(150));return G=Ne.call(G),je(q,L,G,se)}if(typeof G.then=="function")return ct(q,L,dr(G),se);if(G.$$typeof===A)return ct(q,L,sr(q,G),se);pr(q,G)}return typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint"?(G=""+G,L!==null&&L.tag===6?(n(q,L.sibling),se=s(L,G),se.return=q,q=se):(n(q,L),se=Cu(G,q.mode,se),se.return=q,q=se),p(q)):n(q,L)}return function(q,L,G,se){try{Ji=0;var Ne=ct(q,L,G,se);return ui=null,Ne}catch(Me){if(Me===si||Me===cr)throw Me;var nt=fn(29,Me,null,q.mode);return nt.lanes=se,nt.return=q,nt}}}var Cl=rh(!0),sh=rh(!1),Lo=!1;function Lu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Bu(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Bo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Yo(e,t,n){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(lt&2)!==0){var s=i.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),i.pending=t,t=lr(e),Gp(e,null,n),t}return or(e,i,t,n),lr(e)}function $i(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,Mo(e,n)}}function Yu(e,t){var n=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var s=null,u=null;if(n=n.firstBaseUpdate,n!==null){do{var p={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};u===null?s=u=p:u=u.next=p,n=n.next}while(n!==null);u===null?s=u=t:u=u.next=t}else s=u=t;n={baseState:i.baseState,firstBaseUpdate:s,lastBaseUpdate:u,shared:i.shared,callbacks:i.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Iu=!1;function ea(){if(Iu){var e=ri;if(e!==null)throw e}}function ta(e,t,n,i){Iu=!1;var s=e.updateQueue;Lo=!1;var u=s.firstBaseUpdate,p=s.lastBaseUpdate,x=s.shared.pending;if(x!==null){s.shared.pending=null;var _=x,X=_.next;_.next=null,p===null?u=X:p.next=X,p=_;var re=e.alternate;re!==null&&(re=re.updateQueue,x=re.lastBaseUpdate,x!==p&&(x===null?re.firstBaseUpdate=X:x.next=X,re.lastBaseUpdate=_))}if(u!==null){var ce=s.baseState;p=0,re=X=_=null,x=u;do{var Z=x.lane&-536870913,te=Z!==x.lane;if(te?(We&Z)===Z:(i&Z)===Z){Z!==0&&Z===ai&&(Iu=!0),re!==null&&(re=re.next={lane:0,tag:x.tag,payload:x.payload,callback:null,next:null});e:{var Ce=e,je=x;Z=t;var ct=n;switch(je.tag){case 1:if(Ce=je.payload,typeof Ce=="function"){ce=Ce.call(ct,ce,Z);break e}ce=Ce;break e;case 3:Ce.flags=Ce.flags&-65537|128;case 0:if(Ce=je.payload,Z=typeof Ce=="function"?Ce.call(ct,ce,Z):Ce,Z==null)break e;ce=b({},ce,Z);break e;case 2:Lo=!0}}Z=x.callback,Z!==null&&(e.flags|=64,te&&(e.flags|=8192),te=s.callbacks,te===null?s.callbacks=[Z]:te.push(Z))}else te={lane:Z,tag:x.tag,payload:x.payload,callback:x.callback,next:null},re===null?(X=re=te,_=ce):re=re.next=te,p|=Z;if(x=x.next,x===null){if(x=s.shared.pending,x===null)break;te=x,x=te.next,te.next=null,s.lastBaseUpdate=te,s.shared.pending=null}}while(!0);re===null&&(_=ce),s.baseState=_,s.firstBaseUpdate=X,s.lastBaseUpdate=re,u===null&&(s.shared.lanes=0),Go|=p,e.lanes=p,e.memoizedState=ce}}function uh(e,t){if(typeof e!="function")throw Error(r(191,e));e.call(t)}function ch(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)uh(n[e],t)}var ci=R(null),hr=R(0);function fh(e,t){e=ho,J(hr,e),J(ci,t),ho=e|t.baseLanes}function qu(){J(hr,ho),J(ci,ci.current)}function Pu(){ho=hr.current,B(ci),B(hr)}var dn=R(null),Mn=null;function Io(e){var t=e.alternate;J(Ot,Ot.current&1),J(dn,e),Mn===null&&(t===null||ci.current!==null||t.memoizedState!==null)&&(Mn=e)}function Vu(e){J(Ot,Ot.current),J(dn,e),Mn===null&&(Mn=e)}function dh(e){e.tag===22?(J(Ot,Ot.current),J(dn,e),Mn===null&&(Mn=e)):qo()}function qo(){J(Ot,Ot.current),J(dn,dn.current)}function pn(e){B(dn),Mn===e&&(Mn=null),B(Ot)}var Ot=R(0);function gr(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Zc(n)||Jc(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var io=0,qe=null,st=null,Nt=null,mr=!1,fi=!1,Ol=!1,yr=0,na=0,di=null,TS=0;function Et(){throw Error(r(321))}function Gu(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!cn(e[n],t[n]))return!1;return!0}function Xu(e,t,n,i,s,u){return io=u,qe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,N.H=e===null||e.memoizedState===null?Fh:rc,Ol=!1,u=n(i,s),Ol=!1,fi&&(u=hh(t,n,i,s)),ph(e),u}function ph(e){N.H=ia;var t=st!==null&&st.next!==null;if(io=0,Nt=st=qe=null,mr=!1,na=0,di=null,t)throw Error(r(300));e===null||zt||(e=e.dependencies,e!==null&&rr(e)&&(zt=!0))}function hh(e,t,n,i){qe=e;var s=0;do{if(fi&&(di=null),na=0,fi=!1,25<=s)throw Error(r(301));if(s+=1,Nt=st=null,e.updateQueue!=null){var u=e.updateQueue;u.lastEffect=null,u.events=null,u.stores=null,u.memoCache!=null&&(u.memoCache.index=0)}N.H=Zh,u=t(n,i)}while(fi);return u}function ES(){var e=N.H,t=e.useState()[0];return t=typeof t.then=="function"?oa(t):t,e=e.useState()[0],(st!==null?st.memoizedState:null)!==e&&(qe.flags|=1024),t}function Ku(){var e=yr!==0;return yr=0,e}function Qu(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Fu(e){if(mr){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}mr=!1}io=0,Nt=st=qe=null,fi=!1,na=yr=0,di=null}function Wt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Nt===null?qe.memoizedState=Nt=e:Nt=Nt.next=e,Nt}function wt(){if(st===null){var e=qe.alternate;e=e!==null?e.memoizedState:null}else e=st.next;var t=Nt===null?qe.memoizedState:Nt.next;if(t!==null)Nt=t,st=e;else{if(e===null)throw qe.alternate===null?Error(r(467)):Error(r(310));st=e,e={memoizedState:st.memoizedState,baseState:st.baseState,baseQueue:st.baseQueue,queue:st.queue,next:null},Nt===null?qe.memoizedState=Nt=e:Nt=Nt.next=e}return Nt}function vr(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function oa(e){var t=na;return na+=1,di===null&&(di=[]),e=lh(di,e,t),t=qe,(Nt===null?t.memoizedState:Nt.next)===null&&(t=t.alternate,N.H=t===null||t.memoizedState===null?Fh:rc),e}function br(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return oa(e);if(e.$$typeof===A)return Vt(e)}throw Error(r(438,String(e)))}function Zu(e){var t=null,n=qe.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var i=qe.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(t={data:i.data.map(function(s){return s.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=vr(),qe.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),i=0;i<e;i++)n[i]=$;return t.index++,n}function ao(e,t){return typeof t=="function"?t(e):t}function Sr(e){var t=wt();return Ju(t,st,e)}function Ju(e,t,n){var i=e.queue;if(i===null)throw Error(r(311));i.lastRenderedReducer=n;var s=e.baseQueue,u=i.pending;if(u!==null){if(s!==null){var p=s.next;s.next=u.next,u.next=p}t.baseQueue=s=u,i.pending=null}if(u=e.baseState,s===null)e.memoizedState=u;else{t=s.next;var x=p=null,_=null,X=t,re=!1;do{var ce=X.lane&-536870913;if(ce!==X.lane?(We&ce)===ce:(io&ce)===ce){var Z=X.revertLane;if(Z===0)_!==null&&(_=_.next={lane:0,revertLane:0,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null}),ce===ai&&(re=!0);else if((io&Z)===Z){X=X.next,Z===ai&&(re=!0);continue}else ce={lane:0,revertLane:X.revertLane,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},_===null?(x=_=ce,p=u):_=_.next=ce,qe.lanes|=Z,Go|=Z;ce=X.action,Ol&&n(u,ce),u=X.hasEagerState?X.eagerState:n(u,ce)}else Z={lane:ce,revertLane:X.revertLane,gesture:X.gesture,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},_===null?(x=_=Z,p=u):_=_.next=Z,qe.lanes|=ce,Go|=ce;X=X.next}while(X!==null&&X!==t);if(_===null?p=u:_.next=x,!cn(u,e.memoizedState)&&(zt=!0,re&&(n=ri,n!==null)))throw n;e.memoizedState=u,e.baseState=p,e.baseQueue=_,i.lastRenderedState=u}return s===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function Wu(e){var t=wt(),n=t.queue;if(n===null)throw Error(r(311));n.lastRenderedReducer=e;var i=n.dispatch,s=n.pending,u=t.memoizedState;if(s!==null){n.pending=null;var p=s=s.next;do u=e(u,p.action),p=p.next;while(p!==s);cn(u,t.memoizedState)||(zt=!0),t.memoizedState=u,t.baseQueue===null&&(t.baseState=u),n.lastRenderedState=u}return[u,i]}function gh(e,t,n){var i=qe,s=wt(),u=et;if(u){if(n===void 0)throw Error(r(407));n=n()}else n=t();var p=!cn((st||s).memoizedState,n);if(p&&(s.memoizedState=n,zt=!0),s=s.queue,tc(vh.bind(null,i,s,e),[e]),s.getSnapshot!==t||p||Nt!==null&&Nt.memoizedState.tag&1){if(i.flags|=2048,pi(9,{destroy:void 0},yh.bind(null,i,s,n,t),null),ht===null)throw Error(r(349));u||(io&127)!==0||mh(i,t,n)}return n}function mh(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=qe.updateQueue,t===null?(t=vr(),qe.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function yh(e,t,n,i){t.value=n,t.getSnapshot=i,bh(t)&&Sh(e)}function vh(e,t,n){return n(function(){bh(t)&&Sh(e)})}function bh(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!cn(e,n)}catch{return!0}}function Sh(e){var t=yl(e,2);t!==null&&sn(t,e,2)}function $u(e){var t=Wt();if(typeof e=="function"){var n=e;if(e=n(),Ol){tt(!0);try{n()}finally{tt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ao,lastRenderedState:e},t}function xh(e,t,n,i){return e.baseState=n,Ju(e,st,typeof i=="function"?i:ao)}function RS(e,t,n,i,s){if(Er(e))throw Error(r(485));if(e=t.action,e!==null){var u={payload:s,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(p){u.listeners.push(p)}};N.T!==null?n(!0):u.isTransition=!1,i(u),n=t.pending,n===null?(u.next=t.pending=u,Th(t,u)):(u.next=n.next,t.pending=n.next=u)}}function Th(e,t){var n=t.action,i=t.payload,s=e.state;if(t.isTransition){var u=N.T,p={};N.T=p;try{var x=n(s,i),_=N.S;_!==null&&_(p,x),Eh(e,t,x)}catch(X){ec(e,t,X)}finally{u!==null&&p.types!==null&&(u.types=p.types),N.T=u}}else try{u=n(s,i),Eh(e,t,u)}catch(X){ec(e,t,X)}}function Eh(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(i){Rh(e,t,i)},function(i){return ec(e,t,i)}):Rh(e,t,n)}function Rh(e,t,n){t.status="fulfilled",t.value=n,Ch(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Th(e,n)))}function ec(e,t,n){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do t.status="rejected",t.reason=n,Ch(t),t=t.next;while(t!==i)}e.action=null}function Ch(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Oh(e,t){return t}function wh(e,t){if(et){var n=ht.formState;if(n!==null){e:{var i=qe;if(et){if(gt){t:{for(var s=gt,u=An;s.nodeType!==8;){if(!u){s=null;break t}if(s=Dn(s.nextSibling),s===null){s=null;break t}}u=s.data,s=u==="F!"||u==="F"?s:null}if(s){gt=Dn(s.nextSibling),i=s.data==="F!";break e}}ko(i)}i=!1}i&&(t=n[0])}}return n=Wt(),n.memoizedState=n.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oh,lastRenderedState:t},n.queue=i,n=Xh.bind(null,qe,i),i.dispatch=n,i=$u(!1),u=ac.bind(null,qe,!1,i.queue),i=Wt(),s={state:t,dispatch:null,action:e,pending:null},i.queue=s,n=RS.bind(null,qe,s,u,n),s.dispatch=n,i.memoizedState=e,[t,n,!1]}function Ah(e){var t=wt();return Mh(t,st,e)}function Mh(e,t,n){if(t=Ju(e,t,Oh)[0],e=Sr(ao)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var i=oa(t)}catch(p){throw p===si?cr:p}else i=t;t=wt();var s=t.queue,u=s.dispatch;return n!==t.memoizedState&&(qe.flags|=2048,pi(9,{destroy:void 0},CS.bind(null,s,n),null)),[i,u,e]}function CS(e,t){e.action=t}function Dh(e){var t=wt(),n=st;if(n!==null)return Mh(t,n,e);wt(),t=t.memoizedState,n=wt();var i=n.queue.dispatch;return n.memoizedState=e,[t,i,!1]}function pi(e,t,n,i){return e={tag:e,create:n,deps:i,inst:t,next:null},t=qe.updateQueue,t===null&&(t=vr(),qe.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(i=n.next,n.next=e,e.next=i,t.lastEffect=e),e}function Nh(){return wt().memoizedState}function xr(e,t,n,i){var s=Wt();qe.flags|=e,s.memoizedState=pi(1|t,{destroy:void 0},n,i===void 0?null:i)}function Tr(e,t,n,i){var s=wt();i=i===void 0?null:i;var u=s.memoizedState.inst;st!==null&&i!==null&&Gu(i,st.memoizedState.deps)?s.memoizedState=pi(t,u,n,i):(qe.flags|=e,s.memoizedState=pi(1|t,u,n,i))}function zh(e,t){xr(8390656,8,e,t)}function tc(e,t){Tr(2048,8,e,t)}function OS(e){qe.flags|=4;var t=qe.updateQueue;if(t===null)t=vr(),qe.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function _h(e){var t=wt().memoizedState;return OS({ref:t,nextImpl:e}),function(){if((lt&2)!==0)throw Error(r(440));return t.impl.apply(void 0,arguments)}}function Hh(e,t){return Tr(4,2,e,t)}function jh(e,t){return Tr(4,4,e,t)}function kh(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Uh(e,t,n){n=n!=null?n.concat([e]):null,Tr(4,4,kh.bind(null,t,e),n)}function nc(){}function Lh(e,t){var n=wt();t=t===void 0?null:t;var i=n.memoizedState;return t!==null&&Gu(t,i[1])?i[0]:(n.memoizedState=[e,t],e)}function Bh(e,t){var n=wt();t=t===void 0?null:t;var i=n.memoizedState;if(t!==null&&Gu(t,i[1]))return i[0];if(i=e(),Ol){tt(!0);try{e()}finally{tt(!1)}}return n.memoizedState=[i,t],i}function oc(e,t,n){return n===void 0||(io&1073741824)!==0&&(We&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=Yg(),qe.lanes|=e,Go|=e,n)}function Yh(e,t,n,i){return cn(n,t)?n:ci.current!==null?(e=oc(e,n,i),cn(e,t)||(zt=!0),e):(io&42)===0||(io&1073741824)!==0&&(We&261930)===0?(zt=!0,e.memoizedState=n):(e=Yg(),qe.lanes|=e,Go|=e,t)}function Ih(e,t,n,i,s){var u=P.p;P.p=u!==0&&8>u?u:8;var p=N.T,x={};N.T=x,ac(e,!1,t,n);try{var _=s(),X=N.S;if(X!==null&&X(x,_),_!==null&&typeof _=="object"&&typeof _.then=="function"){var re=xS(_,i);la(e,t,re,mn(e))}else la(e,t,i,mn(e))}catch(ce){la(e,t,{then:function(){},status:"rejected",reason:ce},mn())}finally{P.p=u,p!==null&&x.types!==null&&(p.types=x.types),N.T=p}}function wS(){}function lc(e,t,n,i){if(e.tag!==5)throw Error(r(476));var s=qh(e).queue;Ih(e,s,t,I,n===null?wS:function(){return Ph(e),n(i)})}function qh(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:I,baseState:I,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ao,lastRenderedState:I},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ao,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ph(e){var t=qh(e);t.next===null&&(t=e.alternate.memoizedState),la(e,t.next.queue,{},mn())}function ic(){return Vt(xa)}function Vh(){return wt().memoizedState}function Gh(){return wt().memoizedState}function AS(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=mn();e=Bo(n);var i=Yo(t,e,n);i!==null&&(sn(i,t,n),$i(i,t,n)),t={cache:Hu()},e.payload=t;return}t=t.return}}function MS(e,t,n){var i=mn();n={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Er(e)?Kh(t,n):(n=Eu(e,t,n,i),n!==null&&(sn(n,e,i),Qh(n,t,i)))}function Xh(e,t,n){var i=mn();la(e,t,n,i)}function la(e,t,n,i){var s={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Er(e))Kh(t,s);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var p=t.lastRenderedState,x=u(p,n);if(s.hasEagerState=!0,s.eagerState=x,cn(x,p))return or(e,t,s,0),ht===null&&nr(),!1}catch{}if(n=Eu(e,t,s,i),n!==null)return sn(n,e,i),Qh(n,t,i),!0}return!1}function ac(e,t,n,i){if(i={lane:2,revertLane:Lc(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Er(e)){if(t)throw Error(r(479))}else t=Eu(e,n,i,2),t!==null&&sn(t,e,2)}function Er(e){var t=e.alternate;return e===qe||t!==null&&t===qe}function Kh(e,t){fi=mr=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Qh(e,t,n){if((n&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,Mo(e,n)}}var ia={readContext:Vt,use:br,useCallback:Et,useContext:Et,useEffect:Et,useImperativeHandle:Et,useLayoutEffect:Et,useInsertionEffect:Et,useMemo:Et,useReducer:Et,useRef:Et,useState:Et,useDebugValue:Et,useDeferredValue:Et,useTransition:Et,useSyncExternalStore:Et,useId:Et,useHostTransitionStatus:Et,useFormState:Et,useActionState:Et,useOptimistic:Et,useMemoCache:Et,useCacheRefresh:Et};ia.useEffectEvent=Et;var Fh={readContext:Vt,use:br,useCallback:function(e,t){return Wt().memoizedState=[e,t===void 0?null:t],e},useContext:Vt,useEffect:zh,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,xr(4194308,4,kh.bind(null,t,e),n)},useLayoutEffect:function(e,t){return xr(4194308,4,e,t)},useInsertionEffect:function(e,t){xr(4,2,e,t)},useMemo:function(e,t){var n=Wt();t=t===void 0?null:t;var i=e();if(Ol){tt(!0);try{e()}finally{tt(!1)}}return n.memoizedState=[i,t],i},useReducer:function(e,t,n){var i=Wt();if(n!==void 0){var s=n(t);if(Ol){tt(!0);try{n(t)}finally{tt(!1)}}}else s=t;return i.memoizedState=i.baseState=s,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:s},i.queue=e,e=e.dispatch=MS.bind(null,qe,e),[i.memoizedState,e]},useRef:function(e){var t=Wt();return e={current:e},t.memoizedState=e},useState:function(e){e=$u(e);var t=e.queue,n=Xh.bind(null,qe,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:nc,useDeferredValue:function(e,t){var n=Wt();return oc(n,e,t)},useTransition:function(){var e=$u(!1);return e=Ih.bind(null,qe,e.queue,!0,!1),Wt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var i=qe,s=Wt();if(et){if(n===void 0)throw Error(r(407));n=n()}else{if(n=t(),ht===null)throw Error(r(349));(We&127)!==0||mh(i,t,n)}s.memoizedState=n;var u={value:n,getSnapshot:t};return s.queue=u,zh(vh.bind(null,i,u,e),[e]),i.flags|=2048,pi(9,{destroy:void 0},yh.bind(null,i,u,n,t),null),n},useId:function(){var e=Wt(),t=ht.identifierPrefix;if(et){var n=Xn,i=Gn;n=(i&~(1<<32-pt(i)-1)).toString(32)+n,t="_"+t+"R_"+n,n=yr++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=TS++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:ic,useFormState:wh,useActionState:wh,useOptimistic:function(e){var t=Wt();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=ac.bind(null,qe,!0,n),n.dispatch=t,[e,t]},useMemoCache:Zu,useCacheRefresh:function(){return Wt().memoizedState=AS.bind(null,qe)},useEffectEvent:function(e){var t=Wt(),n={impl:e};return t.memoizedState=n,function(){if((lt&2)!==0)throw Error(r(440));return n.impl.apply(void 0,arguments)}}},rc={readContext:Vt,use:br,useCallback:Lh,useContext:Vt,useEffect:tc,useImperativeHandle:Uh,useInsertionEffect:Hh,useLayoutEffect:jh,useMemo:Bh,useReducer:Sr,useRef:Nh,useState:function(){return Sr(ao)},useDebugValue:nc,useDeferredValue:function(e,t){var n=wt();return Yh(n,st.memoizedState,e,t)},useTransition:function(){var e=Sr(ao)[0],t=wt().memoizedState;return[typeof e=="boolean"?e:oa(e),t]},useSyncExternalStore:gh,useId:Vh,useHostTransitionStatus:ic,useFormState:Ah,useActionState:Ah,useOptimistic:function(e,t){var n=wt();return xh(n,st,e,t)},useMemoCache:Zu,useCacheRefresh:Gh};rc.useEffectEvent=_h;var Zh={readContext:Vt,use:br,useCallback:Lh,useContext:Vt,useEffect:tc,useImperativeHandle:Uh,useInsertionEffect:Hh,useLayoutEffect:jh,useMemo:Bh,useReducer:Wu,useRef:Nh,useState:function(){return Wu(ao)},useDebugValue:nc,useDeferredValue:function(e,t){var n=wt();return st===null?oc(n,e,t):Yh(n,st.memoizedState,e,t)},useTransition:function(){var e=Wu(ao)[0],t=wt().memoizedState;return[typeof e=="boolean"?e:oa(e),t]},useSyncExternalStore:gh,useId:Vh,useHostTransitionStatus:ic,useFormState:Dh,useActionState:Dh,useOptimistic:function(e,t){var n=wt();return st!==null?xh(n,st,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Zu,useCacheRefresh:Gh};Zh.useEffectEvent=_h;function sc(e,t,n,i){t=e.memoizedState,n=n(i,t),n=n==null?t:b({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var uc={enqueueSetState:function(e,t,n){e=e._reactInternals;var i=mn(),s=Bo(i);s.payload=t,n!=null&&(s.callback=n),t=Yo(e,s,i),t!==null&&(sn(t,e,i),$i(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var i=mn(),s=Bo(i);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=Yo(e,s,i),t!==null&&(sn(t,e,i),$i(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=mn(),i=Bo(n);i.tag=2,t!=null&&(i.callback=t),t=Yo(e,i,n),t!==null&&(sn(t,e,n),$i(t,e,n))}};function Jh(e,t,n,i,s,u,p){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,u,p):t.prototype&&t.prototype.isPureReactComponent?!Gi(n,i)||!Gi(s,u):!0}function Wh(e,t,n,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,i),t.state!==e&&uc.enqueueReplaceState(t,t.state,null)}function wl(e,t){var n=t;if("ref"in t){n={};for(var i in t)i!=="ref"&&(n[i]=t[i])}if(e=e.defaultProps){n===t&&(n=b({},n));for(var s in e)n[s]===void 0&&(n[s]=e[s])}return n}function $h(e){tr(e)}function eg(e){console.error(e)}function tg(e){tr(e)}function Rr(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function ng(e,t,n){try{var i=e.onCaughtError;i(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(s){setTimeout(function(){throw s})}}function cc(e,t,n){return n=Bo(n),n.tag=3,n.payload={element:null},n.callback=function(){Rr(e,t)},n}function og(e){return e=Bo(e),e.tag=3,e}function lg(e,t,n,i){var s=n.type.getDerivedStateFromError;if(typeof s=="function"){var u=i.value;e.payload=function(){return s(u)},e.callback=function(){ng(t,n,i)}}var p=n.stateNode;p!==null&&typeof p.componentDidCatch=="function"&&(e.callback=function(){ng(t,n,i),typeof s!="function"&&(Xo===null?Xo=new Set([this]):Xo.add(this));var x=i.stack;this.componentDidCatch(i.value,{componentStack:x!==null?x:""})})}function DS(e,t,n,i,s){if(n.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=n.alternate,t!==null&&ii(t,n,s,!0),n=dn.current,n!==null){switch(n.tag){case 31:case 13:return Mn===null?kr():n.alternate===null&&Rt===0&&(Rt=3),n.flags&=-257,n.flags|=65536,n.lanes=s,i===fr?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([i]):t.add(i),jc(e,i,s)),!1;case 22:return n.flags|=65536,i===fr?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([i]):n.add(i)),jc(e,i,s)),!1}throw Error(r(435,n.tag))}return jc(e,i,s),kr(),!1}if(et)return t=dn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=s,i!==Mu&&(e=Error(r(422),{cause:i}),Qi(Cn(e,n)))):(i!==Mu&&(t=Error(r(423),{cause:i}),Qi(Cn(t,n))),e=e.current.alternate,e.flags|=65536,s&=-s,e.lanes|=s,i=Cn(i,n),s=cc(e.stateNode,i,s),Yu(e,s),Rt!==4&&(Rt=2)),!1;var u=Error(r(520),{cause:i});if(u=Cn(u,n),pa===null?pa=[u]:pa.push(u),Rt!==4&&(Rt=2),t===null)return!0;i=Cn(i,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=s&-s,n.lanes|=e,e=cc(n.stateNode,i,e),Yu(n,e),!1;case 1:if(t=n.type,u=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||u!==null&&typeof u.componentDidCatch=="function"&&(Xo===null||!Xo.has(u))))return n.flags|=65536,s&=-s,n.lanes|=s,s=og(s),lg(s,e,n,i),Yu(n,s),!1}n=n.return}while(n!==null);return!1}var fc=Error(r(461)),zt=!1;function Gt(e,t,n,i){t.child=e===null?sh(t,null,n,i):Cl(t,e.child,n,i)}function ig(e,t,n,i,s){n=n.render;var u=t.ref;if("ref"in i){var p={};for(var x in i)x!=="ref"&&(p[x]=i[x])}else p=i;return xl(t),i=Xu(e,t,n,p,u,s),x=Ku(),e!==null&&!zt?(Qu(e,t,s),ro(e,t,s)):(et&&x&&wu(t),t.flags|=1,Gt(e,t,i,s),t.child)}function ag(e,t,n,i,s){if(e===null){var u=n.type;return typeof u=="function"&&!Ru(u)&&u.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=u,rg(e,t,u,i,s)):(e=ir(n.type,null,i,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(u=e.child,!bc(e,s)){var p=u.memoizedProps;if(n=n.compare,n=n!==null?n:Gi,n(p,i)&&e.ref===t.ref)return ro(e,t,s)}return t.flags|=1,e=to(u,i),e.ref=t.ref,e.return=t,t.child=e}function rg(e,t,n,i,s){if(e!==null){var u=e.memoizedProps;if(Gi(u,i)&&e.ref===t.ref)if(zt=!1,t.pendingProps=i=u,bc(e,s))(e.flags&131072)!==0&&(zt=!0);else return t.lanes=e.lanes,ro(e,t,s)}return dc(e,t,n,i,s)}function sg(e,t,n,i){var s=i.children,u=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((t.flags&128)!==0){if(u=u!==null?u.baseLanes|n:n,e!==null){for(i=t.child=e.child,s=0;i!==null;)s=s|i.lanes|i.childLanes,i=i.sibling;i=s&~u}else i=0,t.child=null;return ug(e,t,u,n,i)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ur(t,u!==null?u.cachePool:null),u!==null?fh(t,u):qu(),dh(t);else return i=t.lanes=536870912,ug(e,t,u!==null?u.baseLanes|n:n,n,i)}else u!==null?(ur(t,u.cachePool),fh(t,u),qo(),t.memoizedState=null):(e!==null&&ur(t,null),qu(),qo());return Gt(e,t,s,n),t.child}function aa(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function ug(e,t,n,i,s){var u=ku();return u=u===null?null:{parent:Dt._currentValue,pool:u},t.memoizedState={baseLanes:n,cachePool:u},e!==null&&ur(t,null),qu(),dh(t),e!==null&&ii(e,t,i,!0),t.childLanes=s,null}function Cr(e,t){return t=wr({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function cg(e,t,n){return Cl(t,e.child,null,n),e=Cr(t,t.pendingProps),e.flags|=2,pn(t),t.memoizedState=null,e}function NS(e,t,n){var i=t.pendingProps,s=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(et){if(i.mode==="hidden")return e=Cr(t,i),t.lanes=536870912,aa(null,e);if(Vu(t),(e=gt)?(e=Tm(e,An),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ho!==null?{id:Gn,overflow:Xn}:null,retryLane:536870912,hydrationErrors:null},n=Kp(e),n.return=t,t.child=n,Pt=t,gt=null)):e=null,e===null)throw ko(t);return t.lanes=536870912,null}return Cr(t,i)}var u=e.memoizedState;if(u!==null){var p=u.dehydrated;if(Vu(t),s)if(t.flags&256)t.flags&=-257,t=cg(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(r(558));else if(zt||ii(e,t,n,!1),s=(n&e.childLanes)!==0,zt||s){if(i=ht,i!==null&&(p=Do(i,n),p!==0&&p!==u.retryLane))throw u.retryLane=p,yl(e,p),sn(i,e,p),fc;kr(),t=cg(e,t,n)}else e=u.treeContext,gt=Dn(p.nextSibling),Pt=t,et=!0,jo=null,An=!1,e!==null&&Zp(t,e),t=Cr(t,i),t.flags|=4096;return t}return e=to(e.child,{mode:i.mode,children:i.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Or(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(r(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function dc(e,t,n,i,s){return xl(t),n=Xu(e,t,n,i,void 0,s),i=Ku(),e!==null&&!zt?(Qu(e,t,s),ro(e,t,s)):(et&&i&&wu(t),t.flags|=1,Gt(e,t,n,s),t.child)}function fg(e,t,n,i,s,u){return xl(t),t.updateQueue=null,n=hh(t,i,n,s),ph(e),i=Ku(),e!==null&&!zt?(Qu(e,t,u),ro(e,t,u)):(et&&i&&wu(t),t.flags|=1,Gt(e,t,n,u),t.child)}function dg(e,t,n,i,s){if(xl(t),t.stateNode===null){var u=ti,p=n.contextType;typeof p=="object"&&p!==null&&(u=Vt(p)),u=new n(i,u),t.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=uc,t.stateNode=u,u._reactInternals=t,u=t.stateNode,u.props=i,u.state=t.memoizedState,u.refs={},Lu(t),p=n.contextType,u.context=typeof p=="object"&&p!==null?Vt(p):ti,u.state=t.memoizedState,p=n.getDerivedStateFromProps,typeof p=="function"&&(sc(t,n,p,i),u.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof u.getSnapshotBeforeUpdate=="function"||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(p=u.state,typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),p!==u.state&&uc.enqueueReplaceState(u,u.state,null),ta(t,i,u,s),ea(),u.state=t.memoizedState),typeof u.componentDidMount=="function"&&(t.flags|=4194308),i=!0}else if(e===null){u=t.stateNode;var x=t.memoizedProps,_=wl(n,x);u.props=_;var X=u.context,re=n.contextType;p=ti,typeof re=="object"&&re!==null&&(p=Vt(re));var ce=n.getDerivedStateFromProps;re=typeof ce=="function"||typeof u.getSnapshotBeforeUpdate=="function",x=t.pendingProps!==x,re||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(x||X!==p)&&Wh(t,u,i,p),Lo=!1;var Z=t.memoizedState;u.state=Z,ta(t,i,u,s),ea(),X=t.memoizedState,x||Z!==X||Lo?(typeof ce=="function"&&(sc(t,n,ce,i),X=t.memoizedState),(_=Lo||Jh(t,n,_,i,Z,X,p))?(re||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount()),typeof u.componentDidMount=="function"&&(t.flags|=4194308)):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=X),u.props=i,u.state=X,u.context=p,i=_):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{u=t.stateNode,Bu(e,t),p=t.memoizedProps,re=wl(n,p),u.props=re,ce=t.pendingProps,Z=u.context,X=n.contextType,_=ti,typeof X=="object"&&X!==null&&(_=Vt(X)),x=n.getDerivedStateFromProps,(X=typeof x=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(p!==ce||Z!==_)&&Wh(t,u,i,_),Lo=!1,Z=t.memoizedState,u.state=Z,ta(t,i,u,s),ea();var te=t.memoizedState;p!==ce||Z!==te||Lo||e!==null&&e.dependencies!==null&&rr(e.dependencies)?(typeof x=="function"&&(sc(t,n,x,i),te=t.memoizedState),(re=Lo||Jh(t,n,re,i,Z,te,_)||e!==null&&e.dependencies!==null&&rr(e.dependencies))?(X||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(i,te,_),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(i,te,_)),typeof u.componentDidUpdate=="function"&&(t.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof u.componentDidUpdate!="function"||p===e.memoizedProps&&Z===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||p===e.memoizedProps&&Z===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=te),u.props=i,u.state=te,u.context=_,i=re):(typeof u.componentDidUpdate!="function"||p===e.memoizedProps&&Z===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||p===e.memoizedProps&&Z===e.memoizedState||(t.flags|=1024),i=!1)}return u=i,Or(e,t),i=(t.flags&128)!==0,u||i?(u=t.stateNode,n=i&&typeof n.getDerivedStateFromError!="function"?null:u.render(),t.flags|=1,e!==null&&i?(t.child=Cl(t,e.child,null,s),t.child=Cl(t,null,n,s)):Gt(e,t,n,s),t.memoizedState=u.state,e=t.child):e=ro(e,t,s),e}function pg(e,t,n,i){return bl(),t.flags|=256,Gt(e,t,n,i),t.child}var pc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function hc(e){return{baseLanes:e,cachePool:nh()}}function gc(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=gn),e}function hg(e,t,n){var i=t.pendingProps,s=!1,u=(t.flags&128)!==0,p;if((p=u)||(p=e!==null&&e.memoizedState===null?!1:(Ot.current&2)!==0),p&&(s=!0,t.flags&=-129),p=(t.flags&32)!==0,t.flags&=-33,e===null){if(et){if(s?Io(t):qo(),(e=gt)?(e=Tm(e,An),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ho!==null?{id:Gn,overflow:Xn}:null,retryLane:536870912,hydrationErrors:null},n=Kp(e),n.return=t,t.child=n,Pt=t,gt=null)):e=null,e===null)throw ko(t);return Jc(e)?t.lanes=32:t.lanes=536870912,null}var x=i.children;return i=i.fallback,s?(qo(),s=t.mode,x=wr({mode:"hidden",children:x},s),i=vl(i,s,n,null),x.return=t,i.return=t,x.sibling=i,t.child=x,i=t.child,i.memoizedState=hc(n),i.childLanes=gc(e,p,n),t.memoizedState=pc,aa(null,i)):(Io(t),mc(t,x))}var _=e.memoizedState;if(_!==null&&(x=_.dehydrated,x!==null)){if(u)t.flags&256?(Io(t),t.flags&=-257,t=yc(e,t,n)):t.memoizedState!==null?(qo(),t.child=e.child,t.flags|=128,t=null):(qo(),x=i.fallback,s=t.mode,i=wr({mode:"visible",children:i.children},s),x=vl(x,s,n,null),x.flags|=2,i.return=t,x.return=t,i.sibling=x,t.child=i,Cl(t,e.child,null,n),i=t.child,i.memoizedState=hc(n),i.childLanes=gc(e,p,n),t.memoizedState=pc,t=aa(null,i));else if(Io(t),Jc(x)){if(p=x.nextSibling&&x.nextSibling.dataset,p)var X=p.dgst;p=X,i=Error(r(419)),i.stack="",i.digest=p,Qi({value:i,source:null,stack:null}),t=yc(e,t,n)}else if(zt||ii(e,t,n,!1),p=(n&e.childLanes)!==0,zt||p){if(p=ht,p!==null&&(i=Do(p,n),i!==0&&i!==_.retryLane))throw _.retryLane=i,yl(e,i),sn(p,e,i),fc;Zc(x)||kr(),t=yc(e,t,n)}else Zc(x)?(t.flags|=192,t.child=e.child,t=null):(e=_.treeContext,gt=Dn(x.nextSibling),Pt=t,et=!0,jo=null,An=!1,e!==null&&Zp(t,e),t=mc(t,i.children),t.flags|=4096);return t}return s?(qo(),x=i.fallback,s=t.mode,_=e.child,X=_.sibling,i=to(_,{mode:"hidden",children:i.children}),i.subtreeFlags=_.subtreeFlags&65011712,X!==null?x=to(X,x):(x=vl(x,s,n,null),x.flags|=2),x.return=t,i.return=t,i.sibling=x,t.child=i,aa(null,i),i=t.child,x=e.child.memoizedState,x===null?x=hc(n):(s=x.cachePool,s!==null?(_=Dt._currentValue,s=s.parent!==_?{parent:_,pool:_}:s):s=nh(),x={baseLanes:x.baseLanes|n,cachePool:s}),i.memoizedState=x,i.childLanes=gc(e,p,n),t.memoizedState=pc,aa(e.child,i)):(Io(t),n=e.child,e=n.sibling,n=to(n,{mode:"visible",children:i.children}),n.return=t,n.sibling=null,e!==null&&(p=t.deletions,p===null?(t.deletions=[e],t.flags|=16):p.push(e)),t.child=n,t.memoizedState=null,n)}function mc(e,t){return t=wr({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function wr(e,t){return e=fn(22,e,null,t),e.lanes=0,e}function yc(e,t,n){return Cl(t,e.child,null,n),e=mc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function gg(e,t,n){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),zu(e.return,t,n)}function vc(e,t,n,i,s,u){var p=e.memoizedState;p===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:s,treeForkCount:u}:(p.isBackwards=t,p.rendering=null,p.renderingStartTime=0,p.last=i,p.tail=n,p.tailMode=s,p.treeForkCount=u)}function mg(e,t,n){var i=t.pendingProps,s=i.revealOrder,u=i.tail;i=i.children;var p=Ot.current,x=(p&2)!==0;if(x?(p=p&1|2,t.flags|=128):p&=1,J(Ot,p),Gt(e,t,i,n),i=et?Ki:0,!x&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&gg(e,n,t);else if(e.tag===19)gg(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&gr(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),vc(t,!1,s,n,u,i);break;case"backwards":case"unstable_legacy-backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&gr(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}vc(t,!0,n,null,u,i);break;case"together":vc(t,!1,null,null,void 0,i);break;default:t.memoizedState=null}return t.child}function ro(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Go|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(ii(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(r(153));if(t.child!==null){for(e=t.child,n=to(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=to(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function bc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&rr(e)))}function zS(e,t,n){switch(t.tag){case 3:ue(t,t.stateNode.containerInfo),Uo(t,Dt,e.memoizedState.cache),bl();break;case 27:case 5:Re(t);break;case 4:ue(t,t.stateNode.containerInfo);break;case 10:Uo(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Vu(t),null;break;case 13:var i=t.memoizedState;if(i!==null)return i.dehydrated!==null?(Io(t),t.flags|=128,null):(n&t.child.childLanes)!==0?hg(e,t,n):(Io(t),e=ro(e,t,n),e!==null?e.sibling:null);Io(t);break;case 19:var s=(e.flags&128)!==0;if(i=(n&t.childLanes)!==0,i||(ii(e,t,n,!1),i=(n&t.childLanes)!==0),s){if(i)return mg(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),J(Ot,Ot.current),i)break;return null;case 22:return t.lanes=0,sg(e,t,n,t.pendingProps);case 24:Uo(t,Dt,e.memoizedState.cache)}return ro(e,t,n)}function yg(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)zt=!0;else{if(!bc(e,n)&&(t.flags&128)===0)return zt=!1,zS(e,t,n);zt=(e.flags&131072)!==0}else zt=!1,et&&(t.flags&1048576)!==0&&Fp(t,Ki,t.index);switch(t.lanes=0,t.tag){case 16:e:{var i=t.pendingProps;if(e=El(t.elementType),t.type=e,typeof e=="function")Ru(e)?(i=wl(e,i),t.tag=1,t=dg(null,t,e,i,n)):(t.tag=0,t=dc(null,t,e,i,n));else{if(e!=null){var s=e.$$typeof;if(s===M){t.tag=11,t=ig(null,t,e,i,n);break e}else if(s===j){t.tag=14,t=ag(null,t,e,i,n);break e}}throw t=le(e)||e,Error(r(306,t,""))}}return t;case 0:return dc(e,t,t.type,t.pendingProps,n);case 1:return i=t.type,s=wl(i,t.pendingProps),dg(e,t,i,s,n);case 3:e:{if(ue(t,t.stateNode.containerInfo),e===null)throw Error(r(387));i=t.pendingProps;var u=t.memoizedState;s=u.element,Bu(e,t),ta(t,i,null,n);var p=t.memoizedState;if(i=p.cache,Uo(t,Dt,i),i!==u.cache&&_u(t,[Dt],n,!0),ea(),i=p.element,u.isDehydrated)if(u={element:i,isDehydrated:!1,cache:p.cache},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){t=pg(e,t,i,n);break e}else if(i!==s){s=Cn(Error(r(424)),t),Qi(s),t=pg(e,t,i,n);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,gt=Dn(e.firstChild),Pt=t,et=!0,jo=null,An=!0,n=sh(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(bl(),i===s){t=ro(e,t,n);break e}Gt(e,t,i,n)}t=t.child}return t;case 26:return Or(e,t),e===null?(n=Am(t.type,null,t.pendingProps,null))?t.memoizedState=n:et||(n=t.type,e=t.pendingProps,i=Pr(ie.current).createElement(n),i[qt]=t,i[tn]=e,Xt(i,n,e),Bt(i),t.stateNode=i):t.memoizedState=Am(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Re(t),e===null&&et&&(i=t.stateNode=Cm(t.type,t.pendingProps,ie.current),Pt=t,An=!0,s=gt,Zo(t.type)?(Wc=s,gt=Dn(i.firstChild)):gt=s),Gt(e,t,t.pendingProps.children,n),Or(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&et&&((s=i=gt)&&(i=sx(i,t.type,t.pendingProps,An),i!==null?(t.stateNode=i,Pt=t,gt=Dn(i.firstChild),An=!1,s=!0):s=!1),s||ko(t)),Re(t),s=t.type,u=t.pendingProps,p=e!==null?e.memoizedProps:null,i=u.children,Kc(s,u)?i=null:p!==null&&Kc(s,p)&&(t.flags|=32),t.memoizedState!==null&&(s=Xu(e,t,ES,null,null,n),xa._currentValue=s),Or(e,t),Gt(e,t,i,n),t.child;case 6:return e===null&&et&&((e=n=gt)&&(n=ux(n,t.pendingProps,An),n!==null?(t.stateNode=n,Pt=t,gt=null,e=!0):e=!1),e||ko(t)),null;case 13:return hg(e,t,n);case 4:return ue(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Cl(t,null,i,n):Gt(e,t,i,n),t.child;case 11:return ig(e,t,t.type,t.pendingProps,n);case 7:return Gt(e,t,t.pendingProps,n),t.child;case 8:return Gt(e,t,t.pendingProps.children,n),t.child;case 12:return Gt(e,t,t.pendingProps.children,n),t.child;case 10:return i=t.pendingProps,Uo(t,t.type,i.value),Gt(e,t,i.children,n),t.child;case 9:return s=t.type._context,i=t.pendingProps.children,xl(t),s=Vt(s),i=i(s),t.flags|=1,Gt(e,t,i,n),t.child;case 14:return ag(e,t,t.type,t.pendingProps,n);case 15:return rg(e,t,t.type,t.pendingProps,n);case 19:return mg(e,t,n);case 31:return NS(e,t,n);case 22:return sg(e,t,n,t.pendingProps);case 24:return xl(t),i=Vt(Dt),e===null?(s=ku(),s===null&&(s=ht,u=Hu(),s.pooledCache=u,u.refCount++,u!==null&&(s.pooledCacheLanes|=n),s=u),t.memoizedState={parent:i,cache:s},Lu(t),Uo(t,Dt,s)):((e.lanes&n)!==0&&(Bu(e,t),ta(t,null,null,n),ea()),s=e.memoizedState,u=t.memoizedState,s.parent!==i?(s={parent:i,cache:i},t.memoizedState=s,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=s),Uo(t,Dt,i)):(i=u.cache,Uo(t,Dt,i),i!==s.cache&&_u(t,[Dt],n,!0))),Gt(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(r(156,t.tag))}function so(e){e.flags|=4}function Sc(e,t,n,i,s){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(s&335544128)===s)if(e.stateNode.complete)e.flags|=8192;else if(Vg())e.flags|=8192;else throw Rl=fr,Uu}else e.flags&=-16777217}function vg(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!_m(t))if(Vg())e.flags|=8192;else throw Rl=fr,Uu}function Ar(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?en():536870912,e.lanes|=t,yi|=t)}function ra(e,t){if(!et)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function mt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,i=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,i|=s.subtreeFlags&65011712,i|=s.flags&65011712,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,i|=s.subtreeFlags,i|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=i,e.childLanes=n,t}function _S(e,t,n){var i=t.pendingProps;switch(Au(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return mt(t),null;case 1:return mt(t),null;case 3:return n=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),lo(Dt),pe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(li(t)?so(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Du())),mt(t),null;case 26:var s=t.type,u=t.memoizedState;return e===null?(so(t),u!==null?(mt(t),vg(t,u)):(mt(t),Sc(t,s,null,i,n))):u?u!==e.memoizedState?(so(t),mt(t),vg(t,u)):(mt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==i&&so(t),mt(t),Sc(t,s,e,i,n)),null;case 27:if(ze(t),n=ie.current,s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&so(t);else{if(!i){if(t.stateNode===null)throw Error(r(166));return mt(t),null}e=V.current,li(t)?Jp(t):(e=Cm(s,i,n),t.stateNode=e,so(t))}return mt(t),null;case 5:if(ze(t),s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&so(t);else{if(!i){if(t.stateNode===null)throw Error(r(166));return mt(t),null}if(u=V.current,li(t))Jp(t);else{var p=Pr(ie.current);switch(u){case 1:u=p.createElementNS("http://www.w3.org/2000/svg",s);break;case 2:u=p.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;default:switch(s){case"svg":u=p.createElementNS("http://www.w3.org/2000/svg",s);break;case"math":u=p.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;case"script":u=p.createElement("div"),u.innerHTML="<script><\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof i.is=="string"?p.createElement("select",{is:i.is}):p.createElement("select"),i.multiple?u.multiple=!0:i.size&&(u.size=i.size);break;default:u=typeof i.is=="string"?p.createElement(s,{is:i.is}):p.createElement(s)}}u[qt]=t,u[tn]=i;e:for(p=t.child;p!==null;){if(p.tag===5||p.tag===6)u.appendChild(p.stateNode);else if(p.tag!==4&&p.tag!==27&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===t)break e;for(;p.sibling===null;){if(p.return===null||p.return===t)break e;p=p.return}p.sibling.return=p.return,p=p.sibling}t.stateNode=u;e:switch(Xt(u,s,i),s){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&so(t)}}return mt(t),Sc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&so(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(r(166));if(e=ie.current,li(t)){if(e=t.stateNode,n=t.memoizedProps,i=null,s=Pt,s!==null)switch(s.tag){case 27:case 5:i=s.memoizedProps}e[qt]=t,e=!!(e.nodeValue===n||i!==null&&i.suppressHydrationWarning===!0||hm(e.nodeValue,n)),e||ko(t,!0)}else e=Pr(e).createTextNode(i),e[qt]=t,t.stateNode=e}return mt(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(i=li(t),n!==null){if(e===null){if(!i)throw Error(r(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(557));e[qt]=t}else bl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;mt(t),e=!1}else n=Du(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(pn(t),t):(pn(t),null);if((t.flags&128)!==0)throw Error(r(558))}return mt(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(s=li(t),i!==null&&i.dehydrated!==null){if(e===null){if(!s)throw Error(r(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));s[qt]=t}else bl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;mt(t),s=!1}else s=Du(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),s=!0;if(!s)return t.flags&256?(pn(t),t):(pn(t),null)}return pn(t),(t.flags&128)!==0?(t.lanes=n,t):(n=i!==null,e=e!==null&&e.memoizedState!==null,n&&(i=t.child,s=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(s=i.alternate.memoizedState.cachePool.pool),u=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),u!==s&&(i.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Ar(t,t.updateQueue),mt(t),null);case 4:return pe(),e===null&&qc(t.stateNode.containerInfo),mt(t),null;case 10:return lo(t.type),mt(t),null;case 19:if(B(Ot),i=t.memoizedState,i===null)return mt(t),null;if(s=(t.flags&128)!==0,u=i.rendering,u===null)if(s)ra(i,!1);else{if(Rt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=gr(e),u!==null){for(t.flags|=128,ra(i,!1),e=u.updateQueue,t.updateQueue=e,Ar(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Xp(n,e),n=n.sibling;return J(Ot,Ot.current&1|2),et&&no(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&fe()>_r&&(t.flags|=128,s=!0,ra(i,!1),t.lanes=4194304)}else{if(!s)if(e=gr(u),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,t.updateQueue=e,Ar(t,e),ra(i,!0),i.tail===null&&i.tailMode==="hidden"&&!u.alternate&&!et)return mt(t),null}else 2*fe()-i.renderingStartTime>_r&&n!==536870912&&(t.flags|=128,s=!0,ra(i,!1),t.lanes=4194304);i.isBackwards?(u.sibling=t.child,t.child=u):(e=i.last,e!==null?e.sibling=u:t.child=u,i.last=u)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=fe(),e.sibling=null,n=Ot.current,J(Ot,s?n&1|2:n&1),et&&no(t,i.treeForkCount),e):(mt(t),null);case 22:case 23:return pn(t),Pu(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?(n&536870912)!==0&&(t.flags&128)===0&&(mt(t),t.subtreeFlags&6&&(t.flags|=8192)):mt(t),n=t.updateQueue,n!==null&&Ar(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==n&&(t.flags|=2048),e!==null&&B(Tl),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),lo(Dt),mt(t),null;case 25:return null;case 30:return null}throw Error(r(156,t.tag))}function HS(e,t){switch(Au(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return lo(Dt),pe(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ze(t),null;case 31:if(t.memoizedState!==null){if(pn(t),t.alternate===null)throw Error(r(340));bl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(pn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));bl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return B(Ot),null;case 4:return pe(),null;case 10:return lo(t.type),null;case 22:case 23:return pn(t),Pu(),e!==null&&B(Tl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return lo(Dt),null;case 25:return null;default:return null}}function bg(e,t){switch(Au(t),t.tag){case 3:lo(Dt),pe();break;case 26:case 27:case 5:ze(t);break;case 4:pe();break;case 31:t.memoizedState!==null&&pn(t);break;case 13:pn(t);break;case 19:B(Ot);break;case 10:lo(t.type);break;case 22:case 23:pn(t),Pu(),e!==null&&B(Tl);break;case 24:lo(Dt)}}function sa(e,t){try{var n=t.updateQueue,i=n!==null?n.lastEffect:null;if(i!==null){var s=i.next;n=s;do{if((n.tag&e)===e){i=void 0;var u=n.create,p=n.inst;i=u(),p.destroy=i}n=n.next}while(n!==s)}}catch(x){rt(t,t.return,x)}}function Po(e,t,n){try{var i=t.updateQueue,s=i!==null?i.lastEffect:null;if(s!==null){var u=s.next;i=u;do{if((i.tag&e)===e){var p=i.inst,x=p.destroy;if(x!==void 0){p.destroy=void 0,s=t;var _=n,X=x;try{X()}catch(re){rt(s,_,re)}}}i=i.next}while(i!==u)}}catch(re){rt(t,t.return,re)}}function Sg(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{ch(t,n)}catch(i){rt(e,e.return,i)}}}function xg(e,t,n){n.props=wl(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(i){rt(e,t,i)}}function ua(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:i=e.stateNode;break;default:i=e.stateNode}typeof n=="function"?e.refCleanup=n(i):n.current=i}}catch(s){rt(e,t,s)}}function Kn(e,t){var n=e.ref,i=e.refCleanup;if(n!==null)if(typeof i=="function")try{i()}catch(s){rt(e,t,s)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(s){rt(e,t,s)}else n.current=null}function Tg(e){var t=e.type,n=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&i.focus();break e;case"img":n.src?i.src=n.src:n.srcSet&&(i.srcset=n.srcSet)}}catch(s){rt(e,e.return,s)}}function xc(e,t,n){try{var i=e.stateNode;nx(i,e.type,n,t),i[tn]=t}catch(s){rt(e,e.return,s)}}function Eg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zo(e.type)||e.tag===4}function Tc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Eg(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Zo(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ec(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=$n));else if(i!==4&&(i===27&&Zo(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Ec(e,t,n),e=e.sibling;e!==null;)Ec(e,t,n),e=e.sibling}function Mr(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(i!==4&&(i===27&&Zo(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Mr(e,t,n),e=e.sibling;e!==null;)Mr(e,t,n),e=e.sibling}function Rg(e){var t=e.stateNode,n=e.memoizedProps;try{for(var i=e.type,s=t.attributes;s.length;)t.removeAttributeNode(s[0]);Xt(t,i,n),t[qt]=e,t[tn]=n}catch(u){rt(e,e.return,u)}}var uo=!1,_t=!1,Rc=!1,Cg=typeof WeakSet=="function"?WeakSet:Set,Yt=null;function jS(e,t){if(e=e.containerInfo,Gc=Zr,e=Up(e),yu(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var s=i.anchorOffset,u=i.focusNode;i=i.focusOffset;try{n.nodeType,u.nodeType}catch{n=null;break e}var p=0,x=-1,_=-1,X=0,re=0,ce=e,Z=null;t:for(;;){for(var te;ce!==n||s!==0&&ce.nodeType!==3||(x=p+s),ce!==u||i!==0&&ce.nodeType!==3||(_=p+i),ce.nodeType===3&&(p+=ce.nodeValue.length),(te=ce.firstChild)!==null;)Z=ce,ce=te;for(;;){if(ce===e)break t;if(Z===n&&++X===s&&(x=p),Z===u&&++re===i&&(_=p),(te=ce.nextSibling)!==null)break;ce=Z,Z=ce.parentNode}ce=te}n=x===-1||_===-1?null:{start:x,end:_}}else n=null}n=n||{start:0,end:0}}else n=null;for(Xc={focusedElem:e,selectionRange:n},Zr=!1,Yt=t;Yt!==null;)if(t=Yt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Yt=e;else for(;Yt!==null;){switch(t=Yt,u=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)s=e[n],s.ref.impl=s.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&u!==null){e=void 0,n=t,s=u.memoizedProps,u=u.memoizedState,i=n.stateNode;try{var Ce=wl(n.type,s);e=i.getSnapshotBeforeUpdate(Ce,u),i.__reactInternalSnapshotBeforeUpdate=e}catch(je){rt(n,n.return,je)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Fc(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Fc(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(r(163))}if(e=t.sibling,e!==null){e.return=t.return,Yt=e;break}Yt=t.return}}function Og(e,t,n){var i=n.flags;switch(n.tag){case 0:case 11:case 15:fo(e,n),i&4&&sa(5,n);break;case 1:if(fo(e,n),i&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(p){rt(n,n.return,p)}else{var s=wl(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(s,t,e.__reactInternalSnapshotBeforeUpdate)}catch(p){rt(n,n.return,p)}}i&64&&Sg(n),i&512&&ua(n,n.return);break;case 3:if(fo(e,n),i&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{ch(e,t)}catch(p){rt(n,n.return,p)}}break;case 27:t===null&&i&4&&Rg(n);case 26:case 5:fo(e,n),t===null&&i&4&&Tg(n),i&512&&ua(n,n.return);break;case 12:fo(e,n);break;case 31:fo(e,n),i&4&&Mg(e,n);break;case 13:fo(e,n),i&4&&Dg(e,n),i&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=VS.bind(null,n),cx(e,n))));break;case 22:if(i=n.memoizedState!==null||uo,!i){t=t!==null&&t.memoizedState!==null||_t,s=uo;var u=_t;uo=i,(_t=t)&&!u?po(e,n,(n.subtreeFlags&8772)!==0):fo(e,n),uo=s,_t=u}break;case 30:break;default:fo(e,n)}}function wg(e){var t=e.alternate;t!==null&&(e.alternate=null,wg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&eu(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var vt=null,on=!1;function co(e,t,n){for(n=n.child;n!==null;)Ag(e,t,n),n=n.sibling}function Ag(e,t,n){if(Ie&&typeof Ie.onCommitFiberUnmount=="function")try{Ie.onCommitFiberUnmount(Se,n)}catch{}switch(n.tag){case 26:_t||Kn(n,t),co(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:_t||Kn(n,t);var i=vt,s=on;Zo(n.type)&&(vt=n.stateNode,on=!1),co(e,t,n),va(n.stateNode),vt=i,on=s;break;case 5:_t||Kn(n,t);case 6:if(i=vt,s=on,vt=null,co(e,t,n),vt=i,on=s,vt!==null)if(on)try{(vt.nodeType===9?vt.body:vt.nodeName==="HTML"?vt.ownerDocument.body:vt).removeChild(n.stateNode)}catch(u){rt(n,t,u)}else try{vt.removeChild(n.stateNode)}catch(u){rt(n,t,u)}break;case 18:vt!==null&&(on?(e=vt,Sm(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Ci(e)):Sm(vt,n.stateNode));break;case 4:i=vt,s=on,vt=n.stateNode.containerInfo,on=!0,co(e,t,n),vt=i,on=s;break;case 0:case 11:case 14:case 15:Po(2,n,t),_t||Po(4,n,t),co(e,t,n);break;case 1:_t||(Kn(n,t),i=n.stateNode,typeof i.componentWillUnmount=="function"&&xg(n,t,i)),co(e,t,n);break;case 21:co(e,t,n);break;case 22:_t=(i=_t)||n.memoizedState!==null,co(e,t,n),_t=i;break;default:co(e,t,n)}}function Mg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ci(e)}catch(n){rt(t,t.return,n)}}}function Dg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ci(e)}catch(n){rt(t,t.return,n)}}function kS(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Cg),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Cg),t;default:throw Error(r(435,e.tag))}}function Dr(e,t){var n=kS(e);t.forEach(function(i){if(!n.has(i)){n.add(i);var s=GS.bind(null,e,i);i.then(s,s)}})}function ln(e,t){var n=t.deletions;if(n!==null)for(var i=0;i<n.length;i++){var s=n[i],u=e,p=t,x=p;e:for(;x!==null;){switch(x.tag){case 27:if(Zo(x.type)){vt=x.stateNode,on=!1;break e}break;case 5:vt=x.stateNode,on=!1;break e;case 3:case 4:vt=x.stateNode.containerInfo,on=!0;break e}x=x.return}if(vt===null)throw Error(r(160));Ag(u,p,s),vt=null,on=!1,u=s.alternate,u!==null&&(u.return=null),s.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Ng(t,e),t=t.sibling}var Ln=null;function Ng(e,t){var n=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ln(t,e),an(e),i&4&&(Po(3,e,e.return),sa(3,e),Po(5,e,e.return));break;case 1:ln(t,e),an(e),i&512&&(_t||n===null||Kn(n,n.return)),i&64&&uo&&(e=e.updateQueue,e!==null&&(i=e.callbacks,i!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?i:n.concat(i))));break;case 26:var s=Ln;if(ln(t,e),an(e),i&512&&(_t||n===null||Kn(n,n.return)),i&4){var u=n!==null?n.memoizedState:null;if(i=e.memoizedState,n===null)if(i===null)if(e.stateNode===null){e:{i=e.type,n=e.memoizedProps,s=s.ownerDocument||s;t:switch(i){case"title":u=s.getElementsByTagName("title")[0],(!u||u[ki]||u[qt]||u.namespaceURI==="http://www.w3.org/2000/svg"||u.hasAttribute("itemprop"))&&(u=s.createElement(i),s.head.insertBefore(u,s.querySelector("head > title"))),Xt(u,i,n),u[qt]=e,Bt(u),i=u;break e;case"link":var p=Nm("link","href",s).get(i+(n.href||""));if(p){for(var x=0;x<p.length;x++)if(u=p[x],u.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&u.getAttribute("rel")===(n.rel==null?null:n.rel)&&u.getAttribute("title")===(n.title==null?null:n.title)&&u.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){p.splice(x,1);break t}}u=s.createElement(i),Xt(u,i,n),s.head.appendChild(u);break;case"meta":if(p=Nm("meta","content",s).get(i+(n.content||""))){for(x=0;x<p.length;x++)if(u=p[x],u.getAttribute("content")===(n.content==null?null:""+n.content)&&u.getAttribute("name")===(n.name==null?null:n.name)&&u.getAttribute("property")===(n.property==null?null:n.property)&&u.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&u.getAttribute("charset")===(n.charSet==null?null:n.charSet)){p.splice(x,1);break t}}u=s.createElement(i),Xt(u,i,n),s.head.appendChild(u);break;default:throw Error(r(468,i))}u[qt]=e,Bt(u),i=u}e.stateNode=i}else zm(s,e.type,e.stateNode);else e.stateNode=Dm(s,i,e.memoizedProps);else u!==i?(u===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):u.count--,i===null?zm(s,e.type,e.stateNode):Dm(s,i,e.memoizedProps)):i===null&&e.stateNode!==null&&xc(e,e.memoizedProps,n.memoizedProps)}break;case 27:ln(t,e),an(e),i&512&&(_t||n===null||Kn(n,n.return)),n!==null&&i&4&&xc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(ln(t,e),an(e),i&512&&(_t||n===null||Kn(n,n.return)),e.flags&32){s=e.stateNode;try{Ql(s,"")}catch(Ce){rt(e,e.return,Ce)}}i&4&&e.stateNode!=null&&(s=e.memoizedProps,xc(e,s,n!==null?n.memoizedProps:s)),i&1024&&(Rc=!0);break;case 6:if(ln(t,e),an(e),i&4){if(e.stateNode===null)throw Error(r(162));i=e.memoizedProps,n=e.stateNode;try{n.nodeValue=i}catch(Ce){rt(e,e.return,Ce)}}break;case 3:if(Xr=null,s=Ln,Ln=Vr(t.containerInfo),ln(t,e),Ln=s,an(e),i&4&&n!==null&&n.memoizedState.isDehydrated)try{Ci(t.containerInfo)}catch(Ce){rt(e,e.return,Ce)}Rc&&(Rc=!1,zg(e));break;case 4:i=Ln,Ln=Vr(e.stateNode.containerInfo),ln(t,e),an(e),Ln=i;break;case 12:ln(t,e),an(e);break;case 31:ln(t,e),an(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Dr(e,i)));break;case 13:ln(t,e),an(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(zr=fe()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Dr(e,i)));break;case 22:s=e.memoizedState!==null;var _=n!==null&&n.memoizedState!==null,X=uo,re=_t;if(uo=X||s,_t=re||_,ln(t,e),_t=re,uo=X,an(e),i&8192)e:for(t=e.stateNode,t._visibility=s?t._visibility&-2:t._visibility|1,s&&(n===null||_||uo||_t||Al(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){_=n=t;try{if(u=_.stateNode,s)p=u.style,typeof p.setProperty=="function"?p.setProperty("display","none","important"):p.display="none";else{x=_.stateNode;var ce=_.memoizedProps.style,Z=ce!=null&&ce.hasOwnProperty("display")?ce.display:null;x.style.display=Z==null||typeof Z=="boolean"?"":(""+Z).trim()}}catch(Ce){rt(_,_.return,Ce)}}}else if(t.tag===6){if(n===null){_=t;try{_.stateNode.nodeValue=s?"":_.memoizedProps}catch(Ce){rt(_,_.return,Ce)}}}else if(t.tag===18){if(n===null){_=t;try{var te=_.stateNode;s?xm(te,!0):xm(_.stateNode,!1)}catch(Ce){rt(_,_.return,Ce)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}i&4&&(i=e.updateQueue,i!==null&&(n=i.retryQueue,n!==null&&(i.retryQueue=null,Dr(e,n))));break;case 19:ln(t,e),an(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Dr(e,i)));break;case 30:break;case 21:break;default:ln(t,e),an(e)}}function an(e){var t=e.flags;if(t&2){try{for(var n,i=e.return;i!==null;){if(Eg(i)){n=i;break}i=i.return}if(n==null)throw Error(r(160));switch(n.tag){case 27:var s=n.stateNode,u=Tc(e);Mr(e,u,s);break;case 5:var p=n.stateNode;n.flags&32&&(Ql(p,""),n.flags&=-33);var x=Tc(e);Mr(e,x,p);break;case 3:case 4:var _=n.stateNode.containerInfo,X=Tc(e);Ec(e,X,_);break;default:throw Error(r(161))}}catch(re){rt(e,e.return,re)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function zg(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;zg(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function fo(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Og(e,t.alternate,t),t=t.sibling}function Al(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Po(4,t,t.return),Al(t);break;case 1:Kn(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&xg(t,t.return,n),Al(t);break;case 27:va(t.stateNode);case 26:case 5:Kn(t,t.return),Al(t);break;case 22:t.memoizedState===null&&Al(t);break;case 30:Al(t);break;default:Al(t)}e=e.sibling}}function po(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var i=t.alternate,s=e,u=t,p=u.flags;switch(u.tag){case 0:case 11:case 15:po(s,u,n),sa(4,u);break;case 1:if(po(s,u,n),i=u,s=i.stateNode,typeof s.componentDidMount=="function")try{s.componentDidMount()}catch(X){rt(i,i.return,X)}if(i=u,s=i.updateQueue,s!==null){var x=i.stateNode;try{var _=s.shared.hiddenCallbacks;if(_!==null)for(s.shared.hiddenCallbacks=null,s=0;s<_.length;s++)uh(_[s],x)}catch(X){rt(i,i.return,X)}}n&&p&64&&Sg(u),ua(u,u.return);break;case 27:Rg(u);case 26:case 5:po(s,u,n),n&&i===null&&p&4&&Tg(u),ua(u,u.return);break;case 12:po(s,u,n);break;case 31:po(s,u,n),n&&p&4&&Mg(s,u);break;case 13:po(s,u,n),n&&p&4&&Dg(s,u);break;case 22:u.memoizedState===null&&po(s,u,n),ua(u,u.return);break;case 30:break;default:po(s,u,n)}t=t.sibling}}function Cc(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Fi(n))}function Oc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Fi(e))}function Bn(e,t,n,i){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)_g(e,t,n,i),t=t.sibling}function _g(e,t,n,i){var s=t.flags;switch(t.tag){case 0:case 11:case 15:Bn(e,t,n,i),s&2048&&sa(9,t);break;case 1:Bn(e,t,n,i);break;case 3:Bn(e,t,n,i),s&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Fi(e)));break;case 12:if(s&2048){Bn(e,t,n,i),e=t.stateNode;try{var u=t.memoizedProps,p=u.id,x=u.onPostCommit;typeof x=="function"&&x(p,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(_){rt(t,t.return,_)}}else Bn(e,t,n,i);break;case 31:Bn(e,t,n,i);break;case 13:Bn(e,t,n,i);break;case 23:break;case 22:u=t.stateNode,p=t.alternate,t.memoizedState!==null?u._visibility&2?Bn(e,t,n,i):ca(e,t):u._visibility&2?Bn(e,t,n,i):(u._visibility|=2,hi(e,t,n,i,(t.subtreeFlags&10256)!==0||!1)),s&2048&&Cc(p,t);break;case 24:Bn(e,t,n,i),s&2048&&Oc(t.alternate,t);break;default:Bn(e,t,n,i)}}function hi(e,t,n,i,s){for(s=s&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var u=e,p=t,x=n,_=i,X=p.flags;switch(p.tag){case 0:case 11:case 15:hi(u,p,x,_,s),sa(8,p);break;case 23:break;case 22:var re=p.stateNode;p.memoizedState!==null?re._visibility&2?hi(u,p,x,_,s):ca(u,p):(re._visibility|=2,hi(u,p,x,_,s)),s&&X&2048&&Cc(p.alternate,p);break;case 24:hi(u,p,x,_,s),s&&X&2048&&Oc(p.alternate,p);break;default:hi(u,p,x,_,s)}t=t.sibling}}function ca(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,i=t,s=i.flags;switch(i.tag){case 22:ca(n,i),s&2048&&Cc(i.alternate,i);break;case 24:ca(n,i),s&2048&&Oc(i.alternate,i);break;default:ca(n,i)}t=t.sibling}}var fa=8192;function gi(e,t,n){if(e.subtreeFlags&fa)for(e=e.child;e!==null;)Hg(e,t,n),e=e.sibling}function Hg(e,t,n){switch(e.tag){case 26:gi(e,t,n),e.flags&fa&&e.memoizedState!==null&&Tx(n,Ln,e.memoizedState,e.memoizedProps);break;case 5:gi(e,t,n);break;case 3:case 4:var i=Ln;Ln=Vr(e.stateNode.containerInfo),gi(e,t,n),Ln=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=fa,fa=16777216,gi(e,t,n),fa=i):gi(e,t,n));break;default:gi(e,t,n)}}function jg(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function da(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var i=t[n];Yt=i,Ug(i,e)}jg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)kg(e),e=e.sibling}function kg(e){switch(e.tag){case 0:case 11:case 15:da(e),e.flags&2048&&Po(9,e,e.return);break;case 3:da(e);break;case 12:da(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Nr(e)):da(e);break;default:da(e)}}function Nr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var i=t[n];Yt=i,Ug(i,e)}jg(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Po(8,t,t.return),Nr(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Nr(t));break;default:Nr(t)}e=e.sibling}}function Ug(e,t){for(;Yt!==null;){var n=Yt;switch(n.tag){case 0:case 11:case 15:Po(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var i=n.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:Fi(n.memoizedState.cache)}if(i=n.child,i!==null)i.return=n,Yt=i;else e:for(n=e;Yt!==null;){i=Yt;var s=i.sibling,u=i.return;if(wg(i),i===n){Yt=null;break e}if(s!==null){s.return=u,Yt=s;break e}Yt=u}}}var US={getCacheForType:function(e){var t=Vt(Dt),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Vt(Dt).controller.signal}},LS=typeof WeakMap=="function"?WeakMap:Map,lt=0,ht=null,Fe=null,We=0,at=0,hn=null,Vo=!1,mi=!1,wc=!1,ho=0,Rt=0,Go=0,Ml=0,Ac=0,gn=0,yi=0,pa=null,rn=null,Mc=!1,zr=0,Lg=0,_r=1/0,Hr=null,Xo=null,kt=0,Ko=null,vi=null,go=0,Dc=0,Nc=null,Bg=null,ha=0,zc=null;function mn(){return(lt&2)!==0&&We!==0?We&-We:N.T!==null?Lc():Pa()}function Yg(){if(gn===0)if((We&536870912)===0||et){var e=jn;jn<<=1,(jn&3932160)===0&&(jn=262144),gn=e}else gn=536870912;return e=dn.current,e!==null&&(e.flags|=32),gn}function sn(e,t,n){(e===ht&&(at===2||at===9)||e.cancelPendingCommit!==null)&&(bi(e,0),Qo(e,We,gn,!1)),xn(e,n),((lt&2)===0||e!==ht)&&(e===ht&&((lt&2)===0&&(Ml|=n),Rt===4&&Qo(e,We,gn,!1)),Qn(e))}function Ig(e,t,n){if((lt&6)!==0)throw Error(r(327));var i=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Mt(e,t),s=i?IS(e,t):Hc(e,t,!0),u=i;do{if(s===0){mi&&!i&&Qo(e,t,0,!1);break}else{if(n=e.current.alternate,u&&!BS(n)){s=Hc(e,t,!1),u=!1;continue}if(s===2){if(u=t,e.errorRecoveryDisabledLanes&u)var p=0;else p=e.pendingLanes&-536870913,p=p!==0?p:p&536870912?536870912:0;if(p!==0){t=p;e:{var x=e;s=pa;var _=x.current.memoizedState.isDehydrated;if(_&&(bi(x,p).flags|=256),p=Hc(x,p,!1),p!==2){if(wc&&!_){x.errorRecoveryDisabledLanes|=u,Ml|=u,s=4;break e}u=rn,rn=s,u!==null&&(rn===null?rn=u:rn.push.apply(rn,u))}s=p}if(u=!1,s!==2)continue}}if(s===1){bi(e,0),Qo(e,t,0,!0);break}e:{switch(i=e,u=s,u){case 0:case 1:throw Error(r(345));case 4:if((t&4194048)!==t)break;case 6:Qo(i,t,gn,!Vo);break e;case 2:rn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((t&62914560)===t&&(s=zr+300-fe(),10<s)){if(Qo(i,t,gn,!Vo),It(i,0,!0)!==0)break e;go=t,i.timeoutHandle=vm(qg.bind(null,i,n,rn,Hr,Mc,t,gn,Ml,yi,Vo,u,"Throttled",-0,0),s);break e}qg(i,n,rn,Hr,Mc,t,gn,Ml,yi,Vo,u,null,-0,0)}}break}while(!0);Qn(e)}function qg(e,t,n,i,s,u,p,x,_,X,re,ce,Z,te){if(e.timeoutHandle=-1,ce=t.subtreeFlags,ce&8192||(ce&16785408)===16785408){ce={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:$n},Hg(t,u,ce);var Ce=(u&62914560)===u?zr-fe():(u&4194048)===u?Lg-fe():0;if(Ce=Ex(ce,Ce),Ce!==null){go=u,e.cancelPendingCommit=Ce(Zg.bind(null,e,t,u,n,i,s,p,x,_,re,ce,null,Z,te)),Qo(e,u,p,!X);return}}Zg(e,t,u,n,i,s,p,x,_)}function BS(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var i=0;i<n.length;i++){var s=n[i],u=s.getSnapshot;s=s.value;try{if(!cn(u(),s))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Qo(e,t,n,i){t&=~Ac,t&=~Ml,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var s=t;0<s;){var u=31-pt(s),p=1<<u;i[u]=-1,s&=~p}n!==0&&kn(e,n,t)}function jr(){return(lt&6)===0?(ga(0),!1):!0}function _c(){if(Fe!==null){if(at===0)var e=Fe.return;else e=Fe,oo=Sl=null,Fu(e),ui=null,Ji=0,e=Fe;for(;e!==null;)bg(e.alternate,e),e=e.return;Fe=null}}function bi(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,ix(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),go=0,_c(),ht=e,Fe=n=to(e.current,null),We=t,at=0,hn=null,Vo=!1,mi=Mt(e,t),wc=!1,yi=gn=Ac=Ml=Go=Rt=0,rn=pa=null,Mc=!1,(t&8)!==0&&(t|=t&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=t;0<i;){var s=31-pt(i),u=1<<s;t|=e[s],i&=~u}return ho=t,nr(),n}function Pg(e,t){qe=null,N.H=ia,t===si||t===cr?(t=ih(),at=3):t===Uu?(t=ih(),at=4):at=t===fc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,hn=t,Fe===null&&(Rt=1,Rr(e,Cn(t,e.current)))}function Vg(){var e=dn.current;return e===null?!0:(We&4194048)===We?Mn===null:(We&62914560)===We||(We&536870912)!==0?e===Mn:!1}function Gg(){var e=N.H;return N.H=ia,e===null?ia:e}function Xg(){var e=N.A;return N.A=US,e}function kr(){Rt=4,Vo||(We&4194048)!==We&&dn.current!==null||(mi=!0),(Go&134217727)===0&&(Ml&134217727)===0||ht===null||Qo(ht,We,gn,!1)}function Hc(e,t,n){var i=lt;lt|=2;var s=Gg(),u=Xg();(ht!==e||We!==t)&&(Hr=null,bi(e,t)),t=!1;var p=Rt;e:do try{if(at!==0&&Fe!==null){var x=Fe,_=hn;switch(at){case 8:_c(),p=6;break e;case 3:case 2:case 9:case 6:dn.current===null&&(t=!0);var X=at;if(at=0,hn=null,Si(e,x,_,X),n&&mi){p=0;break e}break;default:X=at,at=0,hn=null,Si(e,x,_,X)}}YS(),p=Rt;break}catch(re){Pg(e,re)}while(!0);return t&&e.shellSuspendCounter++,oo=Sl=null,lt=i,N.H=s,N.A=u,Fe===null&&(ht=null,We=0,nr()),p}function YS(){for(;Fe!==null;)Kg(Fe)}function IS(e,t){var n=lt;lt|=2;var i=Gg(),s=Xg();ht!==e||We!==t?(Hr=null,_r=fe()+500,bi(e,t)):mi=Mt(e,t);e:do try{if(at!==0&&Fe!==null){t=Fe;var u=hn;t:switch(at){case 1:at=0,hn=null,Si(e,t,u,1);break;case 2:case 9:if(oh(u)){at=0,hn=null,Qg(t);break}t=function(){at!==2&&at!==9||ht!==e||(at=7),Qn(e)},u.then(t,t);break e;case 3:at=7;break e;case 4:at=5;break e;case 7:oh(u)?(at=0,hn=null,Qg(t)):(at=0,hn=null,Si(e,t,u,7));break;case 5:var p=null;switch(Fe.tag){case 26:p=Fe.memoizedState;case 5:case 27:var x=Fe;if(p?_m(p):x.stateNode.complete){at=0,hn=null;var _=x.sibling;if(_!==null)Fe=_;else{var X=x.return;X!==null?(Fe=X,Ur(X)):Fe=null}break t}}at=0,hn=null,Si(e,t,u,5);break;case 6:at=0,hn=null,Si(e,t,u,6);break;case 8:_c(),Rt=6;break e;default:throw Error(r(462))}}qS();break}catch(re){Pg(e,re)}while(!0);return oo=Sl=null,N.H=i,N.A=s,lt=n,Fe!==null?0:(ht=null,We=0,nr(),Rt)}function qS(){for(;Fe!==null&&!Qe();)Kg(Fe)}function Kg(e){var t=yg(e.alternate,e,ho);e.memoizedProps=e.pendingProps,t===null?Ur(e):Fe=t}function Qg(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=fg(n,t,t.pendingProps,t.type,void 0,We);break;case 11:t=fg(n,t,t.pendingProps,t.type.render,t.ref,We);break;case 5:Fu(t);default:bg(n,t),t=Fe=Xp(t,ho),t=yg(n,t,ho)}e.memoizedProps=e.pendingProps,t===null?Ur(e):Fe=t}function Si(e,t,n,i){oo=Sl=null,Fu(t),ui=null,Ji=0;var s=t.return;try{if(DS(e,s,t,n,We)){Rt=1,Rr(e,Cn(n,e.current)),Fe=null;return}}catch(u){if(s!==null)throw Fe=s,u;Rt=1,Rr(e,Cn(n,e.current)),Fe=null;return}t.flags&32768?(et||i===1?e=!0:mi||(We&536870912)!==0?e=!1:(Vo=e=!0,(i===2||i===9||i===3||i===6)&&(i=dn.current,i!==null&&i.tag===13&&(i.flags|=16384))),Fg(t,e)):Ur(t)}function Ur(e){var t=e;do{if((t.flags&32768)!==0){Fg(t,Vo);return}e=t.return;var n=_S(t.alternate,t,ho);if(n!==null){Fe=n;return}if(t=t.sibling,t!==null){Fe=t;return}Fe=t=e}while(t!==null);Rt===0&&(Rt=5)}function Fg(e,t){do{var n=HS(e.alternate,e);if(n!==null){n.flags&=32767,Fe=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Fe=e;return}Fe=e=n}while(e!==null);Rt=6,Fe=null}function Zg(e,t,n,i,s,u,p,x,_){e.cancelPendingCommit=null;do Lr();while(kt!==0);if((lt&6)!==0)throw Error(r(327));if(t!==null){if(t===e.current)throw Error(r(177));if(u=t.lanes|t.childLanes,u|=Tu,Il(e,n,u,p,x,_),e===ht&&(Fe=ht=null,We=0),vi=t,Ko=e,go=n,Dc=u,Nc=s,Bg=i,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,XS(ye,function(){return tm(),null})):(e.callbackNode=null,e.callbackPriority=0),i=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||i){i=N.T,N.T=null,s=P.p,P.p=2,p=lt,lt|=4;try{jS(e,t,n)}finally{lt=p,P.p=s,N.T=i}}kt=1,Jg(),Wg(),$g()}}function Jg(){if(kt===1){kt=0;var e=Ko,t=vi,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=N.T,N.T=null;var i=P.p;P.p=2;var s=lt;lt|=4;try{Ng(t,e);var u=Xc,p=Up(e.containerInfo),x=u.focusedElem,_=u.selectionRange;if(p!==x&&x&&x.ownerDocument&&kp(x.ownerDocument.documentElement,x)){if(_!==null&&yu(x)){var X=_.start,re=_.end;if(re===void 0&&(re=X),"selectionStart"in x)x.selectionStart=X,x.selectionEnd=Math.min(re,x.value.length);else{var ce=x.ownerDocument||document,Z=ce&&ce.defaultView||window;if(Z.getSelection){var te=Z.getSelection(),Ce=x.textContent.length,je=Math.min(_.start,Ce),ct=_.end===void 0?je:Math.min(_.end,Ce);!te.extend&&je>ct&&(p=ct,ct=je,je=p);var q=jp(x,je),L=jp(x,ct);if(q&&L&&(te.rangeCount!==1||te.anchorNode!==q.node||te.anchorOffset!==q.offset||te.focusNode!==L.node||te.focusOffset!==L.offset)){var G=ce.createRange();G.setStart(q.node,q.offset),te.removeAllRanges(),je>ct?(te.addRange(G),te.extend(L.node,L.offset)):(G.setEnd(L.node,L.offset),te.addRange(G))}}}}for(ce=[],te=x;te=te.parentNode;)te.nodeType===1&&ce.push({element:te,left:te.scrollLeft,top:te.scrollTop});for(typeof x.focus=="function"&&x.focus(),x=0;x<ce.length;x++){var se=ce[x];se.element.scrollLeft=se.left,se.element.scrollTop=se.top}}Zr=!!Gc,Xc=Gc=null}finally{lt=s,P.p=i,N.T=n}}e.current=t,kt=2}}function Wg(){if(kt===2){kt=0;var e=Ko,t=vi,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=N.T,N.T=null;var i=P.p;P.p=2;var s=lt;lt|=4;try{Og(e,t.alternate,t)}finally{lt=s,P.p=i,N.T=n}}kt=3}}function $g(){if(kt===4||kt===3){kt=0,Ae();var e=Ko,t=vi,n=go,i=Bg;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?kt=5:(kt=0,vi=Ko=null,em(e,e.pendingLanes));var s=e.pendingLanes;if(s===0&&(Xo=null),dl(n),t=t.stateNode,Ie&&typeof Ie.onCommitFiberRoot=="function")try{Ie.onCommitFiberRoot(Se,t,void 0,(t.current.flags&128)===128)}catch{}if(i!==null){t=N.T,s=P.p,P.p=2,N.T=null;try{for(var u=e.onRecoverableError,p=0;p<i.length;p++){var x=i[p];u(x.value,{componentStack:x.stack})}}finally{N.T=t,P.p=s}}(go&3)!==0&&Lr(),Qn(e),s=e.pendingLanes,(n&261930)!==0&&(s&42)!==0?e===zc?ha++:(ha=0,zc=e):ha=0,ga(0)}}function em(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Fi(t)))}function Lr(){return Jg(),Wg(),$g(),tm()}function tm(){if(kt!==5)return!1;var e=Ko,t=Dc;Dc=0;var n=dl(go),i=N.T,s=P.p;try{P.p=32>n?32:n,N.T=null,n=Nc,Nc=null;var u=Ko,p=go;if(kt=0,vi=Ko=null,go=0,(lt&6)!==0)throw Error(r(331));var x=lt;if(lt|=4,kg(u.current),_g(u,u.current,p,n),lt=x,ga(0,!1),Ie&&typeof Ie.onPostCommitFiberRoot=="function")try{Ie.onPostCommitFiberRoot(Se,u)}catch{}return!0}finally{P.p=s,N.T=i,em(e,t)}}function nm(e,t,n){t=Cn(n,t),t=cc(e.stateNode,t,2),e=Yo(e,t,2),e!==null&&(xn(e,2),Qn(e))}function rt(e,t,n){if(e.tag===3)nm(e,e,n);else for(;t!==null;){if(t.tag===3){nm(t,e,n);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Xo===null||!Xo.has(i))){e=Cn(n,e),n=og(2),i=Yo(t,n,2),i!==null&&(lg(n,i,t,e),xn(i,2),Qn(i));break}}t=t.return}}function jc(e,t,n){var i=e.pingCache;if(i===null){i=e.pingCache=new LS;var s=new Set;i.set(t,s)}else s=i.get(t),s===void 0&&(s=new Set,i.set(t,s));s.has(n)||(wc=!0,s.add(n),e=PS.bind(null,e,t,n),t.then(e,e))}function PS(e,t,n){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ht===e&&(We&n)===n&&(Rt===4||Rt===3&&(We&62914560)===We&&300>fe()-zr?(lt&2)===0&&bi(e,0):Ac|=n,yi===We&&(yi=0)),Qn(e)}function om(e,t){t===0&&(t=en()),e=yl(e,t),e!==null&&(xn(e,t),Qn(e))}function VS(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),om(e,n)}function GS(e,t){var n=0;switch(e.tag){case 31:case 13:var i=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(r(314))}i!==null&&i.delete(t),om(e,n)}function XS(e,t){return Ee(e,t)}var Br=null,xi=null,kc=!1,Yr=!1,Uc=!1,Fo=0;function Qn(e){e!==xi&&e.next===null&&(xi===null?Br=xi=e:xi=xi.next=e),Yr=!0,kc||(kc=!0,QS())}function ga(e,t){if(!Uc&&Yr){Uc=!0;do for(var n=!1,i=Br;i!==null;){if(e!==0){var s=i.pendingLanes;if(s===0)var u=0;else{var p=i.suspendedLanes,x=i.pingedLanes;u=(1<<31-pt(42|e)+1)-1,u&=s&~(p&~x),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(n=!0,rm(i,u))}else u=We,u=It(i,i===ht?u:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(u&3)===0||Mt(i,u)||(n=!0,rm(i,u));i=i.next}while(n);Uc=!1}}function KS(){lm()}function lm(){Yr=kc=!1;var e=0;Fo!==0&&lx()&&(e=Fo);for(var t=fe(),n=null,i=Br;i!==null;){var s=i.next,u=im(i,t);u===0?(i.next=null,n===null?Br=s:n.next=s,s===null&&(xi=n)):(n=i,(e!==0||(u&3)!==0)&&(Yr=!0)),i=s}kt!==0&&kt!==5||ga(e),Fo!==0&&(Fo=0)}function im(e,t){for(var n=e.suspendedLanes,i=e.pingedLanes,s=e.expirationTimes,u=e.pendingLanes&-62914561;0<u;){var p=31-pt(u),x=1<<p,_=s[p];_===-1?((x&n)===0||(x&i)!==0)&&(s[p]=Vn(x,t)):_<=t&&(e.expiredLanes|=x),u&=~x}if(t=ht,n=We,n=It(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,n===0||e===t&&(at===2||at===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&we(i),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||Mt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(i!==null&&we(i),dl(n)){case 2:case 8:n=ae;break;case 32:n=ye;break;case 268435456:n=Lt;break;default:n=ye}return i=am.bind(null,e),n=Ee(n,i),e.callbackPriority=t,e.callbackNode=n,t}return i!==null&&i!==null&&we(i),e.callbackPriority=2,e.callbackNode=null,2}function am(e,t){if(kt!==0&&kt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Lr()&&e.callbackNode!==n)return null;var i=We;return i=It(e,e===ht?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(Ig(e,i,t),im(e,fe()),e.callbackNode!=null&&e.callbackNode===n?am.bind(null,e):null)}function rm(e,t){if(Lr())return null;Ig(e,t,!0)}function QS(){ax(function(){(lt&6)!==0?Ee(de,KS):lm()})}function Lc(){if(Fo===0){var e=ai;e===0&&(e=At,At<<=1,(At&261888)===0&&(At=256)),Fo=e}return Fo}function sm(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Qa(""+e)}function um(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function FS(e,t,n,i,s){if(t==="submit"&&n&&n.stateNode===s){var u=sm((s[tn]||null).action),p=i.submitter;p&&(t=(t=p[tn]||null)?sm(t.formAction):p.getAttribute("formAction"),t!==null&&(u=t,p=null));var x=new Wa("action","action",null,i,s);e.push({event:x,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(Fo!==0){var _=p?um(s,p):new FormData(s);lc(n,{pending:!0,data:_,method:s.method,action:u},null,_)}}else typeof u=="function"&&(x.preventDefault(),_=p?um(s,p):new FormData(s),lc(n,{pending:!0,data:_,method:s.method,action:u},u,_))},currentTarget:s}]})}}for(var Bc=0;Bc<xu.length;Bc++){var Yc=xu[Bc],ZS=Yc.toLowerCase(),JS=Yc[0].toUpperCase()+Yc.slice(1);Un(ZS,"on"+JS)}Un(Yp,"onAnimationEnd"),Un(Ip,"onAnimationIteration"),Un(qp,"onAnimationStart"),Un("dblclick","onDoubleClick"),Un("focusin","onFocus"),Un("focusout","onBlur"),Un(pS,"onTransitionRun"),Un(hS,"onTransitionStart"),Un(gS,"onTransitionCancel"),Un(Pp,"onTransitionEnd"),Xl("onMouseEnter",["mouseout","mouseover"]),Xl("onMouseLeave",["mouseout","mouseover"]),Xl("onPointerEnter",["pointerout","pointerover"]),Xl("onPointerLeave",["pointerout","pointerover"]),pl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),pl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),pl("onBeforeInput",["compositionend","keypress","textInput","paste"]),pl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),pl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),pl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ma="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(" "),WS=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ma));function cm(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var i=e[n],s=i.event;i=i.listeners;e:{var u=void 0;if(t)for(var p=i.length-1;0<=p;p--){var x=i[p],_=x.instance,X=x.currentTarget;if(x=x.listener,_!==u&&s.isPropagationStopped())break e;u=x,s.currentTarget=X;try{u(s)}catch(re){tr(re)}s.currentTarget=null,u=_}else for(p=0;p<i.length;p++){if(x=i[p],_=x.instance,X=x.currentTarget,x=x.listener,_!==u&&s.isPropagationStopped())break e;u=x,s.currentTarget=X;try{u(s)}catch(re){tr(re)}s.currentTarget=null,u=_}}}}function Ze(e,t){var n=t[$s];n===void 0&&(n=t[$s]=new Set);var i=e+"__bubble";n.has(i)||(fm(t,e,2,!1),n.add(i))}function Ic(e,t,n){var i=0;t&&(i|=4),fm(n,e,i,t)}var Ir="_reactListening"+Math.random().toString(36).slice(2);function qc(e){if(!e[Ir]){e[Ir]=!0,lp.forEach(function(n){n!=="selectionchange"&&(WS.has(n)||Ic(n,!1,e),Ic(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ir]||(t[Ir]=!0,Ic("selectionchange",!1,t))}}function fm(e,t,n,i){switch(Ym(t)){case 2:var s=Ox;break;case 8:s=wx;break;default:s=of}n=s.bind(null,t,n,e),s=void 0,!su||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),i?s!==void 0?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):s!==void 0?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}function Pc(e,t,n,i,s){var u=i;if((t&1)===0&&(t&2)===0&&i!==null)e:for(;;){if(i===null)return;var p=i.tag;if(p===3||p===4){var x=i.stateNode.containerInfo;if(x===s)break;if(p===4)for(p=i.return;p!==null;){var _=p.tag;if((_===3||_===4)&&p.stateNode.containerInfo===s)return;p=p.return}for(;x!==null;){if(p=Pl(x),p===null)return;if(_=p.tag,_===5||_===6||_===26||_===27){i=u=p;continue e}x=x.parentNode}}i=i.return}mp(function(){var X=u,re=au(n),ce=[];e:{var Z=Vp.get(e);if(Z!==void 0){var te=Wa,Ce=e;switch(e){case"keypress":if(Za(n)===0)break e;case"keydown":case"keyup":te=G0;break;case"focusin":Ce="focus",te=du;break;case"focusout":Ce="blur",te=du;break;case"beforeblur":case"afterblur":te=du;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":te=bp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":te=_0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":te=Q0;break;case Yp:case Ip:case qp:te=k0;break;case Pp:te=Z0;break;case"scroll":case"scrollend":te=N0;break;case"wheel":te=W0;break;case"copy":case"cut":case"paste":te=L0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":te=xp;break;case"toggle":case"beforetoggle":te=eS}var je=(t&4)!==0,ct=!je&&(e==="scroll"||e==="scrollend"),q=je?Z!==null?Z+"Capture":null:Z;je=[];for(var L=X,G;L!==null;){var se=L;if(G=se.stateNode,se=se.tag,se!==5&&se!==26&&se!==27||G===null||q===null||(se=Li(L,q),se!=null&&je.push(ya(L,se,G))),ct)break;L=L.return}0<je.length&&(Z=new te(Z,Ce,null,n,re),ce.push({event:Z,listeners:je}))}}if((t&7)===0){e:{if(Z=e==="mouseover"||e==="pointerover",te=e==="mouseout"||e==="pointerout",Z&&n!==iu&&(Ce=n.relatedTarget||n.fromElement)&&(Pl(Ce)||Ce[ql]))break e;if((te||Z)&&(Z=re.window===re?re:(Z=re.ownerDocument)?Z.defaultView||Z.parentWindow:window,te?(Ce=n.relatedTarget||n.toElement,te=X,Ce=Ce?Pl(Ce):null,Ce!==null&&(ct=f(Ce),je=Ce.tag,Ce!==ct||je!==5&&je!==27&&je!==6)&&(Ce=null)):(te=null,Ce=X),te!==Ce)){if(je=bp,se="onMouseLeave",q="onMouseEnter",L="mouse",(e==="pointerout"||e==="pointerover")&&(je=xp,se="onPointerLeave",q="onPointerEnter",L="pointer"),ct=te==null?Z:Ui(te),G=Ce==null?Z:Ui(Ce),Z=new je(se,L+"leave",te,n,re),Z.target=ct,Z.relatedTarget=G,se=null,Pl(re)===X&&(je=new je(q,L+"enter",Ce,n,re),je.target=G,je.relatedTarget=ct,se=je),ct=se,te&&Ce)t:{for(je=$S,q=te,L=Ce,G=0,se=q;se;se=je(se))G++;se=0;for(var Ne=L;Ne;Ne=je(Ne))se++;for(;0<G-se;)q=je(q),G--;for(;0<se-G;)L=je(L),se--;for(;G--;){if(q===L||L!==null&&q===L.alternate){je=q;break t}q=je(q),L=je(L)}je=null}else je=null;te!==null&&dm(ce,Z,te,je,!1),Ce!==null&&ct!==null&&dm(ce,ct,Ce,je,!0)}}e:{if(Z=X?Ui(X):window,te=Z.nodeName&&Z.nodeName.toLowerCase(),te==="select"||te==="input"&&Z.type==="file")var nt=Mp;else if(wp(Z))if(Dp)nt=cS;else{nt=sS;var Me=rS}else te=Z.nodeName,!te||te.toLowerCase()!=="input"||Z.type!=="checkbox"&&Z.type!=="radio"?X&&lu(X.elementType)&&(nt=Mp):nt=uS;if(nt&&(nt=nt(e,X))){Ap(ce,nt,n,re);break e}Me&&Me(e,Z,X),e==="focusout"&&X&&Z.type==="number"&&X.memoizedProps.value!=null&&ou(Z,"number",Z.value)}switch(Me=X?Ui(X):window,e){case"focusin":(wp(Me)||Me.contentEditable==="true")&&(Wl=Me,vu=X,Xi=null);break;case"focusout":Xi=vu=Wl=null;break;case"mousedown":bu=!0;break;case"contextmenu":case"mouseup":case"dragend":bu=!1,Lp(ce,n,re);break;case"selectionchange":if(dS)break;case"keydown":case"keyup":Lp(ce,n,re)}var Ve;if(hu)e:{switch(e){case"compositionstart":var $e="onCompositionStart";break e;case"compositionend":$e="onCompositionEnd";break e;case"compositionupdate":$e="onCompositionUpdate";break e}$e=void 0}else Jl?Cp(e,n)&&($e="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&($e="onCompositionStart");$e&&(Tp&&n.locale!=="ko"&&(Jl||$e!=="onCompositionStart"?$e==="onCompositionEnd"&&Jl&&(Ve=yp()):(_o=re,uu="value"in _o?_o.value:_o.textContent,Jl=!0)),Me=qr(X,$e),0<Me.length&&($e=new Sp($e,e,null,n,re),ce.push({event:$e,listeners:Me}),Ve?$e.data=Ve:(Ve=Op(n),Ve!==null&&($e.data=Ve)))),(Ve=nS?oS(e,n):lS(e,n))&&($e=qr(X,"onBeforeInput"),0<$e.length&&(Me=new Sp("onBeforeInput","beforeinput",null,n,re),ce.push({event:Me,listeners:$e}),Me.data=Ve)),FS(ce,e,X,n,re)}cm(ce,t)})}function ya(e,t,n){return{instance:e,listener:t,currentTarget:n}}function qr(e,t){for(var n=t+"Capture",i=[];e!==null;){var s=e,u=s.stateNode;if(s=s.tag,s!==5&&s!==26&&s!==27||u===null||(s=Li(e,n),s!=null&&i.unshift(ya(e,s,u)),s=Li(e,t),s!=null&&i.push(ya(e,s,u))),e.tag===3)return i;e=e.return}return[]}function $S(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function dm(e,t,n,i,s){for(var u=t._reactName,p=[];n!==null&&n!==i;){var x=n,_=x.alternate,X=x.stateNode;if(x=x.tag,_!==null&&_===i)break;x!==5&&x!==26&&x!==27||X===null||(_=X,s?(X=Li(n,u),X!=null&&p.unshift(ya(n,X,_))):s||(X=Li(n,u),X!=null&&p.push(ya(n,X,_)))),n=n.return}p.length!==0&&e.push({event:t,listeners:p})}var ex=/\r\n?/g,tx=/\u0000|\uFFFD/g;function pm(e){return(typeof e=="string"?e:""+e).replace(ex,`
9
- `).replace(tx,"")}function hm(e,t){return t=pm(t),pm(e)===t}function ut(e,t,n,i,s,u){switch(n){case"children":typeof i=="string"?t==="body"||t==="textarea"&&i===""||Ql(e,i):(typeof i=="number"||typeof i=="bigint")&&t!=="body"&&Ql(e,""+i);break;case"className":Xa(e,"class",i);break;case"tabIndex":Xa(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":Xa(e,n,i);break;case"style":hp(e,i,u);break;case"data":if(t!=="object"){Xa(e,"data",i);break}case"src":case"href":if(i===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(n);break}i=Qa(""+i),e.setAttribute(n,i);break;case"action":case"formAction":if(typeof i=="function"){e.setAttribute(n,"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 u=="function"&&(n==="formAction"?(t!=="input"&&ut(e,t,"name",s.name,s,null),ut(e,t,"formEncType",s.formEncType,s,null),ut(e,t,"formMethod",s.formMethod,s,null),ut(e,t,"formTarget",s.formTarget,s,null)):(ut(e,t,"encType",s.encType,s,null),ut(e,t,"method",s.method,s,null),ut(e,t,"target",s.target,s,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(n);break}i=Qa(""+i),e.setAttribute(n,i);break;case"onClick":i!=null&&(e.onclick=$n);break;case"onScroll":i!=null&&Ze("scroll",e);break;case"onScrollEnd":i!=null&&Ze("scrollend",e);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(r(61));if(n=i.__html,n!=null){if(s.children!=null)throw Error(r(60));e.innerHTML=n}}break;case"multiple":e.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":e.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){e.removeAttribute("xlink:href");break}n=Qa(""+i),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(n,""+i):e.removeAttribute(n);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":i&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":i===!0?e.setAttribute(n,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(n,i):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?e.setAttribute(n,i):e.removeAttribute(n);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?e.removeAttribute(n):e.setAttribute(n,i);break;case"popover":Ze("beforetoggle",e),Ze("toggle",e),Ga(e,"popover",i);break;case"xlinkActuate":Wn(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":Wn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":Wn(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":Wn(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":Wn(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":Wn(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":Wn(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":Wn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":Wn(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":Ga(e,"is",i);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=M0.get(n)||n,Ga(e,n,i))}}function Vc(e,t,n,i,s,u){switch(n){case"style":hp(e,i,u);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(r(61));if(n=i.__html,n!=null){if(s.children!=null)throw Error(r(60));e.innerHTML=n}}break;case"children":typeof i=="string"?Ql(e,i):(typeof i=="number"||typeof i=="bigint")&&Ql(e,""+i);break;case"onScroll":i!=null&&Ze("scroll",e);break;case"onScrollEnd":i!=null&&Ze("scrollend",e);break;case"onClick":i!=null&&(e.onclick=$n);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ip.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(s=n.endsWith("Capture"),t=n.slice(2,s?n.length-7:void 0),u=e[tn]||null,u=u!=null?u[n]:null,typeof u=="function"&&e.removeEventListener(t,u,s),typeof i=="function")){typeof u!="function"&&u!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,i,s);break e}n in e?e[n]=i:i===!0?e.setAttribute(n,""):Ga(e,n,i)}}}function Xt(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ze("error",e),Ze("load",e);var i=!1,s=!1,u;for(u in n)if(n.hasOwnProperty(u)){var p=n[u];if(p!=null)switch(u){case"src":i=!0;break;case"srcSet":s=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,t));default:ut(e,t,u,p,n,null)}}s&&ut(e,t,"srcSet",n.srcSet,n,null),i&&ut(e,t,"src",n.src,n,null);return;case"input":Ze("invalid",e);var x=u=p=s=null,_=null,X=null;for(i in n)if(n.hasOwnProperty(i)){var re=n[i];if(re!=null)switch(i){case"name":s=re;break;case"type":p=re;break;case"checked":_=re;break;case"defaultChecked":X=re;break;case"value":u=re;break;case"defaultValue":x=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(r(137,t));break;default:ut(e,t,i,re,n,null)}}cp(e,u,x,_,X,p,s,!1);return;case"select":Ze("invalid",e),i=p=u=null;for(s in n)if(n.hasOwnProperty(s)&&(x=n[s],x!=null))switch(s){case"value":u=x;break;case"defaultValue":p=x;break;case"multiple":i=x;default:ut(e,t,s,x,n,null)}t=u,n=p,e.multiple=!!i,t!=null?Kl(e,!!i,t,!1):n!=null&&Kl(e,!!i,n,!0);return;case"textarea":Ze("invalid",e),u=s=i=null;for(p in n)if(n.hasOwnProperty(p)&&(x=n[p],x!=null))switch(p){case"value":i=x;break;case"defaultValue":s=x;break;case"children":u=x;break;case"dangerouslySetInnerHTML":if(x!=null)throw Error(r(91));break;default:ut(e,t,p,x,n,null)}dp(e,i,s,u);return;case"option":for(_ in n)n.hasOwnProperty(_)&&(i=n[_],i!=null)&&(_==="selected"?e.selected=i&&typeof i!="function"&&typeof i!="symbol":ut(e,t,_,i,n,null));return;case"dialog":Ze("beforetoggle",e),Ze("toggle",e),Ze("cancel",e),Ze("close",e);break;case"iframe":case"object":Ze("load",e);break;case"video":case"audio":for(i=0;i<ma.length;i++)Ze(ma[i],e);break;case"image":Ze("error",e),Ze("load",e);break;case"details":Ze("toggle",e);break;case"embed":case"source":case"link":Ze("error",e),Ze("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(X in n)if(n.hasOwnProperty(X)&&(i=n[X],i!=null))switch(X){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,t));default:ut(e,t,X,i,n,null)}return;default:if(lu(t)){for(re in n)n.hasOwnProperty(re)&&(i=n[re],i!==void 0&&Vc(e,t,re,i,n,void 0));return}}for(x in n)n.hasOwnProperty(x)&&(i=n[x],i!=null&&ut(e,t,x,i,n,null))}function nx(e,t,n,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var s=null,u=null,p=null,x=null,_=null,X=null,re=null;for(te in n){var ce=n[te];if(n.hasOwnProperty(te)&&ce!=null)switch(te){case"checked":break;case"value":break;case"defaultValue":_=ce;default:i.hasOwnProperty(te)||ut(e,t,te,null,i,ce)}}for(var Z in i){var te=i[Z];if(ce=n[Z],i.hasOwnProperty(Z)&&(te!=null||ce!=null))switch(Z){case"type":u=te;break;case"name":s=te;break;case"checked":X=te;break;case"defaultChecked":re=te;break;case"value":p=te;break;case"defaultValue":x=te;break;case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(r(137,t));break;default:te!==ce&&ut(e,t,Z,te,i,ce)}}nu(e,p,x,_,X,re,u,s);return;case"select":te=p=x=Z=null;for(u in n)if(_=n[u],n.hasOwnProperty(u)&&_!=null)switch(u){case"value":break;case"multiple":te=_;default:i.hasOwnProperty(u)||ut(e,t,u,null,i,_)}for(s in i)if(u=i[s],_=n[s],i.hasOwnProperty(s)&&(u!=null||_!=null))switch(s){case"value":Z=u;break;case"defaultValue":x=u;break;case"multiple":p=u;default:u!==_&&ut(e,t,s,u,i,_)}t=x,n=p,i=te,Z!=null?Kl(e,!!n,Z,!1):!!i!=!!n&&(t!=null?Kl(e,!!n,t,!0):Kl(e,!!n,n?[]:"",!1));return;case"textarea":te=Z=null;for(x in n)if(s=n[x],n.hasOwnProperty(x)&&s!=null&&!i.hasOwnProperty(x))switch(x){case"value":break;case"children":break;default:ut(e,t,x,null,i,s)}for(p in i)if(s=i[p],u=n[p],i.hasOwnProperty(p)&&(s!=null||u!=null))switch(p){case"value":Z=s;break;case"defaultValue":te=s;break;case"children":break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(r(91));break;default:s!==u&&ut(e,t,p,s,i,u)}fp(e,Z,te);return;case"option":for(var Ce in n)Z=n[Ce],n.hasOwnProperty(Ce)&&Z!=null&&!i.hasOwnProperty(Ce)&&(Ce==="selected"?e.selected=!1:ut(e,t,Ce,null,i,Z));for(_ in i)Z=i[_],te=n[_],i.hasOwnProperty(_)&&Z!==te&&(Z!=null||te!=null)&&(_==="selected"?e.selected=Z&&typeof Z!="function"&&typeof Z!="symbol":ut(e,t,_,Z,i,te));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 je in n)Z=n[je],n.hasOwnProperty(je)&&Z!=null&&!i.hasOwnProperty(je)&&ut(e,t,je,null,i,Z);for(X in i)if(Z=i[X],te=n[X],i.hasOwnProperty(X)&&Z!==te&&(Z!=null||te!=null))switch(X){case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(r(137,t));break;default:ut(e,t,X,Z,i,te)}return;default:if(lu(t)){for(var ct in n)Z=n[ct],n.hasOwnProperty(ct)&&Z!==void 0&&!i.hasOwnProperty(ct)&&Vc(e,t,ct,void 0,i,Z);for(re in i)Z=i[re],te=n[re],!i.hasOwnProperty(re)||Z===te||Z===void 0&&te===void 0||Vc(e,t,re,Z,i,te);return}}for(var q in n)Z=n[q],n.hasOwnProperty(q)&&Z!=null&&!i.hasOwnProperty(q)&&ut(e,t,q,null,i,Z);for(ce in i)Z=i[ce],te=n[ce],!i.hasOwnProperty(ce)||Z===te||Z==null&&te==null||ut(e,t,ce,Z,i,te)}function gm(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function ox(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),i=0;i<n.length;i++){var s=n[i],u=s.transferSize,p=s.initiatorType,x=s.duration;if(u&&x&&gm(p)){for(p=0,x=s.responseEnd,i+=1;i<n.length;i++){var _=n[i],X=_.startTime;if(X>x)break;var re=_.transferSize,ce=_.initiatorType;re&&gm(ce)&&(_=_.responseEnd,p+=re*(_<x?1:(x-X)/(_-X)))}if(--i,t+=8*(u+p)/(s.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Gc=null,Xc=null;function Pr(e){return e.nodeType===9?e:e.ownerDocument}function mm(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function ym(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Kc(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Qc=null;function lx(){var e=window.event;return e&&e.type==="popstate"?e===Qc?!1:(Qc=e,!0):(Qc=null,!1)}var vm=typeof setTimeout=="function"?setTimeout:void 0,ix=typeof clearTimeout=="function"?clearTimeout:void 0,bm=typeof Promise=="function"?Promise:void 0,ax=typeof queueMicrotask=="function"?queueMicrotask:typeof bm<"u"?function(e){return bm.resolve(null).then(e).catch(rx)}:vm;function rx(e){setTimeout(function(){throw e})}function Zo(e){return e==="head"}function Sm(e,t){var n=t,i=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"||n==="/&"){if(i===0){e.removeChild(s),Ci(t);return}i--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")i++;else if(n==="html")va(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,va(n);for(var u=n.firstChild;u;){var p=u.nextSibling,x=u.nodeName;u[ki]||x==="SCRIPT"||x==="STYLE"||x==="LINK"&&u.rel.toLowerCase()==="stylesheet"||n.removeChild(u),u=p}}else n==="body"&&va(e.ownerDocument.body);n=s}while(n);Ci(t)}function xm(e,t){var n=e;e=0;do{var i=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=i}while(n)}function Fc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Fc(n),eu(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function sx(e,t,n,i){for(;e.nodeType===1;){var s=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(i){if(!e[ki])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(u=e.getAttribute("rel"),u==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(u!==s.rel||e.getAttribute("href")!==(s.href==null||s.href===""?null:s.href)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin)||e.getAttribute("title")!==(s.title==null?null:s.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(u=e.getAttribute("src"),(u!==(s.src==null?null:s.src)||e.getAttribute("type")!==(s.type==null?null:s.type)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin))&&u&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var u=s.name==null?null:""+s.name;if(s.type==="hidden"&&e.getAttribute("name")===u)return e}else return e;if(e=Dn(e.nextSibling),e===null)break}return null}function ux(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Dn(e.nextSibling),e===null))return null;return e}function Tm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Dn(e.nextSibling),e===null))return null;return e}function Zc(e){return e.data==="$?"||e.data==="$~"}function Jc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function cx(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var i=function(){t(),n.removeEventListener("DOMContentLoaded",i)};n.addEventListener("DOMContentLoaded",i),e._reactRetry=i}}function Dn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Wc=null;function Em(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Dn(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function Rm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function Cm(e,t,n){switch(t=Pr(n),e){case"html":if(e=t.documentElement,!e)throw Error(r(452));return e;case"head":if(e=t.head,!e)throw Error(r(453));return e;case"body":if(e=t.body,!e)throw Error(r(454));return e;default:throw Error(r(451))}}function va(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);eu(e)}var Nn=new Map,Om=new Set;function Vr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var mo=P.d;P.d={f:fx,r:dx,D:px,C:hx,L:gx,m:mx,X:vx,S:yx,M:bx};function fx(){var e=mo.f(),t=jr();return e||t}function dx(e){var t=Vl(e);t!==null&&t.tag===5&&t.type==="form"?Ph(t):mo.r(e)}var Ti=typeof document>"u"?null:document;function wm(e,t,n){var i=Ti;if(i&&typeof t=="string"&&t){var s=En(t);s='link[rel="'+e+'"][href="'+s+'"]',typeof n=="string"&&(s+='[crossorigin="'+n+'"]'),Om.has(s)||(Om.add(s),e={rel:e,crossOrigin:n,href:t},i.querySelector(s)===null&&(t=i.createElement("link"),Xt(t,"link",e),Bt(t),i.head.appendChild(t)))}}function px(e){mo.D(e),wm("dns-prefetch",e,null)}function hx(e,t){mo.C(e,t),wm("preconnect",e,t)}function gx(e,t,n){mo.L(e,t,n);var i=Ti;if(i&&e&&t){var s='link[rel="preload"][as="'+En(t)+'"]';t==="image"&&n&&n.imageSrcSet?(s+='[imagesrcset="'+En(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(s+='[imagesizes="'+En(n.imageSizes)+'"]')):s+='[href="'+En(e)+'"]';var u=s;switch(t){case"style":u=Ei(e);break;case"script":u=Ri(e)}Nn.has(u)||(e=b({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Nn.set(u,e),i.querySelector(s)!==null||t==="style"&&i.querySelector(ba(u))||t==="script"&&i.querySelector(Sa(u))||(t=i.createElement("link"),Xt(t,"link",e),Bt(t),i.head.appendChild(t)))}}function mx(e,t){mo.m(e,t);var n=Ti;if(n&&e){var i=t&&typeof t.as=="string"?t.as:"script",s='link[rel="modulepreload"][as="'+En(i)+'"][href="'+En(e)+'"]',u=s;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=Ri(e)}if(!Nn.has(u)&&(e=b({rel:"modulepreload",href:e},t),Nn.set(u,e),n.querySelector(s)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Sa(u)))return}i=n.createElement("link"),Xt(i,"link",e),Bt(i),n.head.appendChild(i)}}}function yx(e,t,n){mo.S(e,t,n);var i=Ti;if(i&&e){var s=Gl(i).hoistableStyles,u=Ei(e);t=t||"default";var p=s.get(u);if(!p){var x={loading:0,preload:null};if(p=i.querySelector(ba(u)))x.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Nn.get(u))&&$c(e,n);var _=p=i.createElement("link");Bt(_),Xt(_,"link",e),_._p=new Promise(function(X,re){_.onload=X,_.onerror=re}),_.addEventListener("load",function(){x.loading|=1}),_.addEventListener("error",function(){x.loading|=2}),x.loading|=4,Gr(p,t,i)}p={type:"stylesheet",instance:p,count:1,state:x},s.set(u,p)}}}function vx(e,t){mo.X(e,t);var n=Ti;if(n&&e){var i=Gl(n).hoistableScripts,s=Ri(e),u=i.get(s);u||(u=n.querySelector(Sa(s)),u||(e=b({src:e,async:!0},t),(t=Nn.get(s))&&ef(e,t),u=n.createElement("script"),Bt(u),Xt(u,"link",e),n.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},i.set(s,u))}}function bx(e,t){mo.M(e,t);var n=Ti;if(n&&e){var i=Gl(n).hoistableScripts,s=Ri(e),u=i.get(s);u||(u=n.querySelector(Sa(s)),u||(e=b({src:e,async:!0,type:"module"},t),(t=Nn.get(s))&&ef(e,t),u=n.createElement("script"),Bt(u),Xt(u,"link",e),n.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},i.set(s,u))}}function Am(e,t,n,i){var s=(s=ie.current)?Vr(s):null;if(!s)throw Error(r(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Ei(n.href),n=Gl(s).hoistableStyles,i=n.get(t),i||(i={type:"style",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Ei(n.href);var u=Gl(s).hoistableStyles,p=u.get(e);if(p||(s=s.ownerDocument||s,p={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,p),(u=s.querySelector(ba(e)))&&!u._p&&(p.instance=u,p.state.loading=5),Nn.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Nn.set(e,n),u||Sx(s,e,n,p.state))),t&&i===null)throw Error(r(528,""));return p}if(t&&i!==null)throw Error(r(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Ri(n),n=Gl(s).hoistableScripts,i=n.get(t),i||(i={type:"script",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,e))}}function Ei(e){return'href="'+En(e)+'"'}function ba(e){return'link[rel="stylesheet"]['+e+"]"}function Mm(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function Sx(e,t,n,i){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?i.loading=1:(t=e.createElement("link"),i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2}),Xt(t,"link",n),Bt(t),e.head.appendChild(t))}function Ri(e){return'[src="'+En(e)+'"]'}function Sa(e){return"script[async]"+e}function Dm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+En(n.href)+'"]');if(i)return t.instance=i,Bt(i),i;var s=b({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),Bt(i),Xt(i,"style",s),Gr(i,n.precedence,e),t.instance=i;case"stylesheet":s=Ei(n.href);var u=e.querySelector(ba(s));if(u)return t.state.loading|=4,t.instance=u,Bt(u),u;i=Mm(n),(s=Nn.get(s))&&$c(i,s),u=(e.ownerDocument||e).createElement("link"),Bt(u);var p=u;return p._p=new Promise(function(x,_){p.onload=x,p.onerror=_}),Xt(u,"link",i),t.state.loading|=4,Gr(u,n.precedence,e),t.instance=u;case"script":return u=Ri(n.src),(s=e.querySelector(Sa(u)))?(t.instance=s,Bt(s),s):(i=n,(s=Nn.get(u))&&(i=b({},n),ef(i,s)),e=e.ownerDocument||e,s=e.createElement("script"),Bt(s),Xt(s,"link",i),e.head.appendChild(s),t.instance=s);case"void":return null;default:throw Error(r(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(i=t.instance,t.state.loading|=4,Gr(i,n.precedence,e));return t.instance}function Gr(e,t,n){for(var i=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),s=i.length?i[i.length-1]:null,u=s,p=0;p<i.length;p++){var x=i[p];if(x.dataset.precedence===t)u=x;else if(u!==s)break}u?u.parentNode.insertBefore(e,u.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function $c(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function ef(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Xr=null;function Nm(e,t,n){if(Xr===null){var i=new Map,s=Xr=new Map;s.set(n,i)}else s=Xr,i=s.get(n),i||(i=new Map,s.set(n,i));if(i.has(e))return i;for(i.set(e,null),n=n.getElementsByTagName(e),s=0;s<n.length;s++){var u=n[s];if(!(u[ki]||u[qt]||e==="link"&&u.getAttribute("rel")==="stylesheet")&&u.namespaceURI!=="http://www.w3.org/2000/svg"){var p=u.getAttribute(t)||"";p=e+p;var x=i.get(p);x?x.push(u):i.set(p,[u])}}return i}function zm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function xx(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function _m(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Tx(e,t,n,i){if(n.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var s=Ei(i.href),u=t.querySelector(ba(s));if(u){t=u._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Kr.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=u,Bt(u);return}u=t.ownerDocument||t,i=Mm(i),(s=Nn.get(s))&&$c(i,s),u=u.createElement("link"),Bt(u);var p=u;p._p=new Promise(function(x,_){p.onload=x,p.onerror=_}),Xt(u,"link",i),n.instance=u}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Kr.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var tf=0;function Ex(e,t){return e.stylesheets&&e.count===0&&Fr(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var i=setTimeout(function(){if(e.stylesheets&&Fr(e,e.stylesheets),e.unsuspend){var u=e.unsuspend;e.unsuspend=null,u()}},6e4+t);0<e.imgBytes&&tf===0&&(tf=62500*ox());var s=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Fr(e,e.stylesheets),e.unsuspend)){var u=e.unsuspend;e.unsuspend=null,u()}},(e.imgBytes>tf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(s)}}:null}function Kr(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Fr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Qr=null;function Fr(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Qr=new Map,t.forEach(Rx,e),Qr=null,Kr.call(e))}function Rx(e,t){if(!(t.state.loading&4)){var n=Qr.get(e);if(n)var i=n.get(null);else{n=new Map,Qr.set(e,n);for(var s=e.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u<s.length;u++){var p=s[u];(p.nodeName==="LINK"||p.getAttribute("media")!=="not all")&&(n.set(p.dataset.precedence,p),i=p)}i&&n.set(null,i)}s=t.instance,p=s.getAttribute("data-precedence"),u=n.get(p)||i,u===i&&n.set(null,s),n.set(p,s),this.count++,i=Kr.bind(this),s.addEventListener("load",i),s.addEventListener("error",i),u?u.parentNode.insertBefore(s,u.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(s,e.firstChild)),t.state.loading|=4}}var xa={$$typeof:A,Provider:null,Consumer:null,_currentValue:I,_currentValue2:I,_threadCount:0};function Cx(e,t,n,i,s,u,p,x,_){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ao(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ao(0),this.hiddenUpdates=Ao(null),this.identifierPrefix=i,this.onUncaughtError=s,this.onCaughtError=u,this.onRecoverableError=p,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=_,this.incompleteTransitions=new Map}function Hm(e,t,n,i,s,u,p,x,_,X,re,ce){return e=new Cx(e,t,n,p,_,X,re,ce,x),t=1,u===!0&&(t|=24),u=fn(3,null,null,t),e.current=u,u.stateNode=e,t=Hu(),t.refCount++,e.pooledCache=t,t.refCount++,u.memoizedState={element:i,isDehydrated:n,cache:t},Lu(u),e}function jm(e){return e?(e=ti,e):ti}function km(e,t,n,i,s,u){s=jm(s),i.context===null?i.context=s:i.pendingContext=s,i=Bo(t),i.payload={element:n},u=u===void 0?null:u,u!==null&&(i.callback=u),n=Yo(e,i,t),n!==null&&(sn(n,e,t),$i(n,e,t))}function Um(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function nf(e,t){Um(e,t),(e=e.alternate)&&Um(e,t)}function Lm(e){if(e.tag===13||e.tag===31){var t=yl(e,67108864);t!==null&&sn(t,e,67108864),nf(e,67108864)}}function Bm(e){if(e.tag===13||e.tag===31){var t=mn();t=No(t);var n=yl(e,t);n!==null&&sn(n,e,t),nf(e,t)}}var Zr=!0;function Ox(e,t,n,i){var s=N.T;N.T=null;var u=P.p;try{P.p=2,of(e,t,n,i)}finally{P.p=u,N.T=s}}function wx(e,t,n,i){var s=N.T;N.T=null;var u=P.p;try{P.p=8,of(e,t,n,i)}finally{P.p=u,N.T=s}}function of(e,t,n,i){if(Zr){var s=lf(i);if(s===null)Pc(e,t,i,Jr,n),Im(e,i);else if(Mx(s,e,t,n,i))i.stopPropagation();else if(Im(e,i),t&4&&-1<Ax.indexOf(e)){for(;s!==null;){var u=Vl(s);if(u!==null)switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var p=xt(u.pendingLanes);if(p!==0){var x=u;for(x.pendingLanes|=2,x.entangledLanes|=2;p;){var _=1<<31-pt(p);x.entanglements[1]|=_,p&=~_}Qn(u),(lt&6)===0&&(_r=fe()+500,ga(0))}}break;case 31:case 13:x=yl(u,2),x!==null&&sn(x,u,2),jr(),nf(u,2)}if(u=lf(i),u===null&&Pc(e,t,i,Jr,n),u===s)break;s=u}s!==null&&i.stopPropagation()}else Pc(e,t,i,null,n)}}function lf(e){return e=au(e),af(e)}var Jr=null;function af(e){if(Jr=null,e=Pl(e),e!==null){var t=f(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=d(t),e!==null)return e;e=null}else if(n===31){if(e=m(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Jr=e,null}function Ym(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(me()){case de:return 2;case ae:return 8;case ye:case Le:return 32;case Lt:return 268435456;default:return 32}default:return 32}}var rf=!1,Jo=null,Wo=null,$o=null,Ta=new Map,Ea=new Map,el=[],Ax="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 Im(e,t){switch(e){case"focusin":case"focusout":Jo=null;break;case"dragenter":case"dragleave":Wo=null;break;case"mouseover":case"mouseout":$o=null;break;case"pointerover":case"pointerout":Ta.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ea.delete(t.pointerId)}}function Ra(e,t,n,i,s,u){return e===null||e.nativeEvent!==u?(e={blockedOn:t,domEventName:n,eventSystemFlags:i,nativeEvent:u,targetContainers:[s]},t!==null&&(t=Vl(t),t!==null&&Lm(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function Mx(e,t,n,i,s){switch(t){case"focusin":return Jo=Ra(Jo,e,t,n,i,s),!0;case"dragenter":return Wo=Ra(Wo,e,t,n,i,s),!0;case"mouseover":return $o=Ra($o,e,t,n,i,s),!0;case"pointerover":var u=s.pointerId;return Ta.set(u,Ra(Ta.get(u)||null,e,t,n,i,s)),!0;case"gotpointercapture":return u=s.pointerId,Ea.set(u,Ra(Ea.get(u)||null,e,t,n,i,s)),!0}return!1}function qm(e){var t=Pl(e.target);if(t!==null){var n=f(t);if(n!==null){if(t=n.tag,t===13){if(t=d(n),t!==null){e.blockedOn=t,Va(e.priority,function(){Bm(n)});return}}else if(t===31){if(t=m(n),t!==null){e.blockedOn=t,Va(e.priority,function(){Bm(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Wr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=lf(e.nativeEvent);if(n===null){n=e.nativeEvent;var i=new n.constructor(n.type,n);iu=i,n.target.dispatchEvent(i),iu=null}else return t=Vl(n),t!==null&&Lm(t),e.blockedOn=n,!1;t.shift()}return!0}function Pm(e,t,n){Wr(e)&&n.delete(t)}function Dx(){rf=!1,Jo!==null&&Wr(Jo)&&(Jo=null),Wo!==null&&Wr(Wo)&&(Wo=null),$o!==null&&Wr($o)&&($o=null),Ta.forEach(Pm),Ea.forEach(Pm)}function $r(e,t){e.blockedOn===t&&(e.blockedOn=null,rf||(rf=!0,o.unstable_scheduleCallback(o.unstable_NormalPriority,Dx)))}var es=null;function Vm(e){es!==e&&(es=e,o.unstable_scheduleCallback(o.unstable_NormalPriority,function(){es===e&&(es=null);for(var t=0;t<e.length;t+=3){var n=e[t],i=e[t+1],s=e[t+2];if(typeof i!="function"){if(af(i||n)===null)continue;break}var u=Vl(n);u!==null&&(e.splice(t,3),t-=3,lc(u,{pending:!0,data:s,method:n.method,action:i},i,s))}}))}function Ci(e){function t(_){return $r(_,e)}Jo!==null&&$r(Jo,e),Wo!==null&&$r(Wo,e),$o!==null&&$r($o,e),Ta.forEach(t),Ea.forEach(t);for(var n=0;n<el.length;n++){var i=el[n];i.blockedOn===e&&(i.blockedOn=null)}for(;0<el.length&&(n=el[0],n.blockedOn===null);)qm(n),n.blockedOn===null&&el.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(i=0;i<n.length;i+=3){var s=n[i],u=n[i+1],p=s[tn]||null;if(typeof u=="function")p||Vm(n);else if(p){var x=null;if(u&&u.hasAttribute("formAction")){if(s=u,p=u[tn]||null)x=p.formAction;else if(af(s)!==null)continue}else x=p.action;typeof x=="function"?n[i+1]=x:(n.splice(i,3),i-=3),Vm(n)}}}function Gm(){function e(u){u.canIntercept&&u.info==="react-transition"&&u.intercept({handler:function(){return new Promise(function(p){return s=p})},focusReset:"manual",scroll:"manual"})}function t(){s!==null&&(s(),s=null),i||setTimeout(n,20)}function n(){if(!i&&!navigation.transition){var u=navigation.currentEntry;u&&u.url!=null&&navigation.navigate(u.url,{state:u.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var i=!1,s=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){i=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),s!==null&&(s(),s=null)}}}function sf(e){this._internalRoot=e}ts.prototype.render=sf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(r(409));var n=t.current,i=mn();km(n,i,e,t,null,null)},ts.prototype.unmount=sf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;km(e.current,2,null,e,null,null),jr(),t[ql]=null}};function ts(e){this._internalRoot=e}ts.prototype.unstable_scheduleHydration=function(e){if(e){var t=Pa();e={blockedOn:null,target:e,priority:t};for(var n=0;n<el.length&&t!==0&&t<el[n].priority;n++);el.splice(n,0,e),n===0&&qm(e)}};var Xm=l.version;if(Xm!=="19.2.4")throw Error(r(527,Xm,"19.2.4"));P.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(r(188)):(e=Object.keys(e).join(","),Error(r(268,e)));return e=g(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var Nx={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:N,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ns=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ns.isDisabled&&ns.supportsFiber)try{Se=ns.inject(Nx),Ie=ns}catch{}}return Oa.createRoot=function(e,t){if(!c(e))throw Error(r(299));var n=!1,i="",s=$h,u=eg,p=tg;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onUncaughtError!==void 0&&(s=t.onUncaughtError),t.onCaughtError!==void 0&&(u=t.onCaughtError),t.onRecoverableError!==void 0&&(p=t.onRecoverableError)),t=Hm(e,1,!1,null,null,n,i,null,s,u,p,Gm),e[ql]=t.current,qc(e),new sf(t)},Oa.hydrateRoot=function(e,t,n){if(!c(e))throw Error(r(299));var i=!1,s="",u=$h,p=eg,x=tg,_=null;return n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onUncaughtError!==void 0&&(u=n.onUncaughtError),n.onCaughtError!==void 0&&(p=n.onCaughtError),n.onRecoverableError!==void 0&&(x=n.onRecoverableError),n.formState!==void 0&&(_=n.formState)),t=Hm(e,1,!0,t,n??null,i,s,_,u,p,x,Gm),t.context=jm(null),n=t.current,i=mn(),i=No(i),s=Bo(i),s.callback=null,Yo(n,s,i),n=i,t.current.lanes=n,xn(t,n),Qn(t),e[ql]=t.current,qc(e),new ts(t)},Oa.version="19.2.4",Oa}var ny;function Px(){if(ny)return ff.exports;ny=1;function o(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(o)}catch(l){console.error(l)}}return o(),ff.exports=qx(),ff.exports}var Vx=Px();function fv(o){var l,a,r="";if(typeof o=="string"||typeof o=="number")r+=o;else if(typeof o=="object")if(Array.isArray(o)){var c=o.length;for(l=0;l<c;l++)o[l]&&(a=fv(o[l]))&&(r&&(r+=" "),r+=a)}else for(a in o)o[a]&&(r&&(r+=" "),r+=a);return r}function Gx(){for(var o,l,a=0,r="",c=arguments.length;a<c;a++)(o=arguments[a])&&(l=fv(o))&&(r&&(r+=" "),r+=l);return r}function Oo(...o){return Gx(o)}const oy={};function Zt(o,l){const a=v.useRef(oy);return a.current===oy&&(a.current=o(l)),a}const kf=[];let Uf;function Xx(){return Uf}function Kx(o){kf.push(o)}function Ds(o){const l=(a,r)=>{const c=Zt(Qx).current;let f;try{Uf=c;for(const d of kf)d.before(c);f=o(a,r);for(const d of kf)d.after(c);c.didInitialize=!0}finally{Uf=void 0}return f};return l.displayName=o.displayName||o.name,l}function dv(o){return v.forwardRef(Ds(o))}function Qx(){return{didInitialize:!1}}function ad(){}const Eo=Object.freeze([]),Ct=Object.freeze({}),Fx=()=>{},be=typeof document<"u"?v.useLayoutEffect:Fx;function Zx(o,l){return function(r,...c){const f=new URL(o);return f.searchParams.set("code",r.toString()),c.forEach(d=>f.searchParams.append("args[]",d)),`${l} error #${r}; visit ${f} for the full message.`}}const Qt=Zx("https://base-ui.com/production-error","Base UI"),pv=v.createContext(void 0);function Ns(o){const l=v.useContext(pv);if(l===void 0&&!o)throw new Error(Qt(72));return l}function zs(o){v.useEffect(o,Eo)}const wa=0;class yn{static create(){return new yn}currentId=wa;start(l,a){this.clear(),this.currentId=setTimeout(()=>{this.currentId=wa,a()},l)}isStarted(){return this.currentId!==wa}clear=()=>{this.currentId!==wa&&(clearTimeout(this.currentId),this.currentId=wa)};disposeEffect=()=>this.clear}function Jt(){const o=Zt(yn.create).current;return zs(o.disposeEffect),o}function Jx(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:Wx,platform:$x,maxTouchPoints:eT}=Jx(),_s=Wx.toLowerCase(),Ha=$x.toLowerCase(),Hs=/^i(os$|p)/.test(Ha)||Ha==="macintel"&&eT>1,ly="android",Lf=Ha===ly||_s.includes(ly),rd=!Hs&&Ha.startsWith("mac");Ha.startsWith("win");const tT=rd||Hs,ul=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none");!ul&&_s.includes("firefox");!ul&&_s.includes("chrom");const nT=tT,sd=/jsdom|happydom/.test(_s);function Fn(o){o.preventDefault(),o.stopPropagation()}function oT(o){return"nativeEvent"in o}function ud(o){return o.pointerType===""&&o.isTrusted?!0:Lf&&o.pointerType?o.type==="click"&&o.buttons===1:o.detail===0&&!o.pointerType}function cd(o){return sd?!1:!Lf&&o.width===0&&o.height===0||Lf&&o.width===1&&o.height===1&&o.pressure===0&&o.detail===0&&o.pointerType==="mouse"||o.width<1&&o.height<1&&o.pressure===0&&o.detail===0&&o.pointerType==="touch"}function ll(o,l){const a=["mouse","pen"];return l||a.push("",void 0),a.includes(o)}function lT(o){const l=o.type;return l==="click"||l==="mousedown"||l==="keydown"||l==="keyup"}function js(){return typeof window<"u"}function Kt(o){return fd(o)?(o.nodeName||"").toLowerCase():"#document"}function yt(o){var l;return(o==null||(l=o.ownerDocument)==null?void 0:l.defaultView)||window}function wo(o){var l;return(l=(fd(o)?o.ownerDocument:o.document)||window.document)==null?void 0:l.documentElement}function fd(o){return js()?o instanceof Node||o instanceof yt(o).Node:!1}function Je(o){return js()?o instanceof Element||o instanceof yt(o).Element:!1}function dt(o){return js()?o instanceof HTMLElement||o instanceof yt(o).HTMLElement:!1}function Di(o){return!js()||typeof ShadowRoot>"u"?!1:o instanceof ShadowRoot||o instanceof yt(o).ShadowRoot}function Ba(o){const{overflow:l,overflowX:a,overflowY:r,display:c}=vn(o);return/auto|scroll|overlay|hidden|clip/.test(l+r+a)&&c!=="inline"&&c!=="contents"}function iT(o){return/^(table|td|th)$/.test(Kt(o))}function ks(o){try{if(o.matches(":popover-open"))return!0}catch{}try{return o.matches(":modal")}catch{return!1}}const aT=/transform|translate|scale|rotate|perspective|filter/,rT=/paint|layout|strict|content/,Dl=o=>!!o&&o!=="none";let gf;function dd(o){const l=Je(o)?vn(o):o;return Dl(l.transform)||Dl(l.translate)||Dl(l.scale)||Dl(l.rotate)||Dl(l.perspective)||!pd()&&(Dl(l.backdropFilter)||Dl(l.filter))||aT.test(l.willChange||"")||rT.test(l.contain||"")}function sT(o){let l=Ro(o);for(;dt(l)&&!bo(l);){if(dd(l))return l;if(ks(l))return null;l=Ro(l)}return null}function pd(){return gf==null&&(gf=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),gf}function bo(o){return/^(html|body|#document)$/.test(Kt(o))}function vn(o){return yt(o).getComputedStyle(o)}function Us(o){return Je(o)?{scrollLeft:o.scrollLeft,scrollTop:o.scrollTop}:{scrollLeft:o.scrollX,scrollTop:o.scrollY}}function Ro(o){if(Kt(o)==="html")return o;const l=o.assignedSlot||o.parentNode||Di(o)&&o.host||wo(o);return Di(l)?l.host:l}function hv(o){const l=Ro(o);return bo(l)?(o.ownerDocument||o).body:dt(l)&&Ba(l)?l:hv(l)}function ja(o,l,a){var r;l===void 0&&(l=[]),a===void 0&&(a=!0);const c=hv(o),f=c===((r=o.ownerDocument)==null?void 0:r.body),d=yt(c);if(f){const m=Bf(d);return l.concat(d,d.visualViewport||[],Ba(c)?c:[],m&&a?ja(m):[])}else return l.concat(c,ja(c,[],a))}function Bf(o){return o.parent&&Object.getPrototypeOf(o.parent)?o.frameElement:null}function Ht(o){let l=o.activeElement;for(;l?.shadowRoot?.activeElement!=null;)l=l.shadowRoot.activeElement;return l}function De(o,l){if(!o||!l)return!1;const a=l.getRootNode?.();if(o.contains(l))return!0;if(a&&Di(a)){let r=l;for(;r;){if(o===r)return!0;r=r.parentNode||r.host}}return!1}function bt(o){return"composedPath"in o?o.composedPath()[0]??o.target:o.target}const Yf="data-base-ui-focusable",gv="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Ls="ArrowLeft",Bs="ArrowRight",mv="ArrowUp",hd="ArrowDown",yv="data-starting-style",uT="data-ending-style",cT={[yv]:""},fT={[uT]:""},Ys={transitionStatus(o){return o==="starting"?cT:o==="ending"?fT:null}},dT="data-open",pT="data-closed",hT="data-anchor-hidden",vv="data-popup-open",gT="data-pressed",mT={[vv]:""},yT={[vv]:"",[gT]:""},vT={[dT]:""},bT={[pT]:""},ST={[hT]:""},xT={open(o){return o?mT:null}},iy={open(o){return o?yT:null}},gd={open(o){return o?vT:bT},anchorHidden(o){return o?ST:null}},md={...gd,...Ys},If="data-trigger-disabled";function bs(o,l){if(!Je(o))return!1;const a=o;if(l.hasElement(a))return!a.hasAttribute(If);for(const[,r]of l.entries())if(De(r,a))return!r.hasAttribute(If);return!1}function mf(o,l){if(l==null)return!1;if("composedPath"in o)return o.composedPath().includes(l);const a=o;return a.target!=null&&l.contains(a.target)}function TT(o){return o.matches("html,body")}function Is(o){return dt(o)&&o.matches(gv)}function ET(o){return o?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${gv}`)!=null}function qf(o){return o?o.getAttribute("role")==="combobox"&&Is(o):!1}function Ss(o){if(!o||sd)return!0;try{return o.matches(":focus-visible")}catch{return!0}}function Pf(o){return o?o.hasAttribute(Yf)?o:o.querySelector(`[${Yf}]`)||o:null}function RT(o,l){return l!=null&&!ll(l)?0:typeof o=="function"?o():o}function zl(o,l,a){const r=RT(o,a);return typeof r=="number"?r:r?.[l]}function ay(o){return typeof o=="function"?o():o}function bv(o,l){return l||o==="click"||o==="mousedown"}function CT(o){return o?.includes("mouse")&&o!=="mousedown"}const qs="none",_i="trigger-press",Ut="trigger-hover",Oi="trigger-focus",yd="outside-press",Sv="item-press",OT="close-press",Ni="focus-out",Ps="escape-key",Vf="list-navigation",wT="cancel-open",Da="sibling-open",xv="disabled",ry="missing",sy="initial",vd="imperative-action";function Ke(o,l,a,r){let c=!1,f=!1;const d=r??Ct;return{reason:o,event:l??new Event("base-ui"),cancel(){c=!0},allowPropagation(){f=!0},get isCanceled(){return c},get isPropagationAllowed(){return f},trigger:a,...d}}const Tv=v.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new yn,currentIdRef:{current:null},currentContextRef:{current:null}});function AT(o,l){o.current=l.current}function MT(o){const{children:l,delay:a,timeoutMs:r=0}=o,c=v.useRef(a),f=v.useRef(a),d=v.useRef(null),m=v.useRef(null),h=Jt();return be(()=>{if(f.current=a,!d.current){c.current=a;return}c.current={open:zl(c.current,"open"),close:zl(a,"close")}},[a,d,c,f]),z.jsx(Tv.Provider,{value:v.useMemo(()=>({hasProvider:!0,delayRef:c,initialDelayRef:f,currentIdRef:d,timeoutMs:r,currentContextRef:m,timeout:h}),[r,h]),children:l})}function DT(o,l={open:!1}){const{open:a}=l,r="rootStore"in o?o.rootStore:o,c=r.useState("floatingId"),f=v.useContext(Tv),{currentIdRef:d,delayRef:m,timeoutMs:h,initialDelayRef:g,currentContextRef:y,hasProvider:b,timeout:S}=f,[E,T]=v.useState(!1),C=v.useRef(a);return be(()=>{C.current=a},[a]),be(()=>{function O(){y.current?.setIsInstantPhase(!1),d.current=null,y.current=null,m.current=g.current,S.clear()}if(d.current&&!a&&d.current===c){if(T(!1),h){const w=c;return S.start(h,()=>{r.select("open")||d.current&&d.current!==w||O()}),()=>{(C.current||d.current!==w)&&S.clear()}}O()}},[a,c,d,m,h,g,y,S,r]),be(()=>{if(!a)return;const O=y.current,w=d.current;S.clear(),y.current={onOpenChange:r.setOpen,setIsInstantPhase:T},d.current=c,m.current={open:0,close:zl(g.current,"close")},w!==null&&w!==c?(T(!0),O?.setIsInstantPhase(!0),O?.onOpenChange(!1,Ke(qs))):(T(!1),O?.setIsInstantPhase(!1))},[a,c,r,d,m,g,y,S]),be(()=>()=>{if(d.current===c){if(y.current=null,!C.current)return;d.current=null,AT(m,g),S.clear()}},[y,d,m,c,g,S]),v.useMemo(()=>({activeIdRef:d,hasProvider:b,delayRef:m,isInstantPhase:E}),[d,b,m,E])}function Ye(o,l,a,r){return o.addEventListener(l,a,r),()=>{o.removeEventListener(l,a,r)}}function In(...o){return()=>{for(let l=0;l<o.length;l+=1){const a=o[l];a&&a()}}}function _l(o,l,a,r){const c=Zt(Ev).current;return zT(c,o,l,a,r)&&Rv(c,[o,l,a,r]),c.callback}function NT(o){const l=Zt(Ev).current;return _T(l,o)&&Rv(l,o),l.callback}function Ev(){return{callback:null,cleanup:null,refs:[]}}function zT(o,l,a,r,c){return o.refs[0]!==l||o.refs[1]!==a||o.refs[2]!==r||o.refs[3]!==c}function _T(o,l){return o.refs.length!==l.length||o.refs.some((a,r)=>a!==l[r])}function Rv(o,l){if(o.refs=l,l.every(a=>a==null)){o.callback=null;return}o.callback=a=>{if(o.cleanup&&(o.cleanup(),o.cleanup=null),a!=null){const r=Array(l.length).fill(null);for(let c=0;c<l.length;c+=1){const f=l[c];if(f!=null)switch(typeof f){case"function":{const d=f(a);typeof d=="function"&&(r[c]=d);break}case"object":{f.current=a;break}}}o.cleanup=()=>{for(let c=0;c<l.length;c+=1){const f=l[c];if(f!=null)switch(typeof f){case"function":{const d=r[c];typeof d=="function"?d():f(null);break}case"object":{f.current=null;break}}}}}}}function jt(o){const l=Zt(HT,o).current;return l.next=o,be(l.effect),l}function HT(o){const l={current:o,next:o,effect:()=>{l.current=l.next}};return l}const bd={...Lx},yf=bd.useInsertionEffect,jT=yf&&yf!==bd.useLayoutEffect?yf:o=>o();function Oe(o){const l=Zt(kT).current;return l.next=o,jT(l.effect),l.trampoline}function kT(){const o={next:void 0,callback:UT,trampoline:(...l)=>o.callback?.(...l),effect:()=>{o.callback=o.next}};return o}function UT(){}const os=null;class LT{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=l=>{this.isScheduled=!1;const a=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let c=0;c<a.length;c+=1)a[c]?.(l)};request(l){const a=this.nextId;return this.nextId+=1,this.callbacks.push(l),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),a}cancel(l){const a=l-this.startId;a<0||a>=this.callbacks.length||this.callbacks[a]!==null&&(this.callbacks[a]=null,this.callbacksCount-=1)}}let ls=new LT;class Zn{static create(){return new Zn}static request(l){return ls.request(l)}static cancel(l){return ls.cancel(l)}currentId=os;request(l){this.cancel(),this.currentId=ls.request(()=>{this.currentId=os,l()})}cancel=()=>{this.currentId!==os&&(ls.cancel(this.currentId),this.currentId=os)};disposeEffect=()=>this.cancel}function ka(){const o=Zt(Zn.create).current;return zs(o.disposeEffect),o}function Xe(o){return o?.ownerDocument||document}const BT={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},Cv={...BT,position:"fixed",top:0,left:0},Hl=v.forwardRef(function(l,a){const[r,c]=v.useState();be(()=>{nT&&ul&&c("button")},[]);const f={tabIndex:0,role:r};return z.jsx("span",{...l,ref:a,style:Cv,"aria-hidden":r?void 0:!0,...f,"data-base-ui-focus-guard":""})}),zi=Math.min,So=Math.max,xs=Math.round,is=Math.floor,xo=o=>({x:o,y:o}),YT={left:"right",right:"left",bottom:"top",top:"bottom"};function Ov(o,l,a){return So(o,zi(l,a))}function al(o,l){return typeof o=="function"?o(l):o}function _n(o){return o.split("-")[0]}function Co(o){return o.split("-")[1]}function Sd(o){return o==="x"?"y":"x"}function xd(o){return o==="y"?"height":"width"}function zn(o){const l=o[0];return l==="t"||l==="b"?"y":"x"}function Td(o){return Sd(zn(o))}function IT(o,l,a){a===void 0&&(a=!1);const r=Co(o),c=Td(o),f=xd(c);let d=c==="x"?r===(a?"end":"start")?"right":"left":r==="start"?"bottom":"top";return l.reference[f]>l.floating[f]&&(d=Ts(d)),[d,Ts(d)]}function qT(o){const l=Ts(o);return[Gf(o),l,Gf(l)]}function Gf(o){return o.includes("start")?o.replace("start","end"):o.replace("end","start")}const uy=["left","right"],cy=["right","left"],PT=["top","bottom"],VT=["bottom","top"];function GT(o,l,a){switch(o){case"top":case"bottom":return a?l?cy:uy:l?uy:cy;case"left":case"right":return l?PT:VT;default:return[]}}function XT(o,l,a,r){const c=Co(o);let f=GT(_n(o),a==="start",r);return c&&(f=f.map(d=>d+"-"+c),l&&(f=f.concat(f.map(Gf)))),f}function Ts(o){const l=_n(o);return YT[l]+o.slice(l.length)}function KT(o){var l,a,r,c;return{top:(l=o.top)!=null?l:0,right:(a=o.right)!=null?a:0,bottom:(r=o.bottom)!=null?r:0,left:(c=o.left)!=null?c:0}}function wv(o){return typeof o!="number"?KT(o):{top:o,right:o,bottom:o,left:o}}function Es(o){const{x:l,y:a,width:r,height:c}=o;return{width:r,height:c,top:a,left:l,right:l+r,bottom:a+c,x:l,y:a}}function za(o,l){return l<0||l>=o.length}function gs(o,l){return vo(o.current,{disabledIndices:l})}function Xf(o,l){return vo(o.current,{decrement:!0,startingIndex:o.current.length,disabledIndices:l})}function vo(o,{startingIndex:l=-1,decrement:a=!1,disabledIndices:r,amount:c=1}={}){let f=l;do f+=a?-c:c;while(f>=0&&f<=o.length-1&&wi(o,f,r));return f}function wi(o,l,a){if(typeof a=="function"?a(l):a?.includes(l)??!1)return!0;const c=o[l];return c?!Vs(c)||c.matches(":disabled")?!0:!a&&(c.hasAttribute("disabled")||c.getAttribute("aria-disabled")==="true"):!1}function QT(o){return o.visibility==="hidden"||o.visibility==="collapse"}function Vs(o,l=o?vn(o):null){return!o||!o.isConnected||!l||QT(l)?!1:typeof o.checkVisibility=="function"?o.checkVisibility():l.display!=="none"&&l.display!=="contents"}const FT='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function ZT(o){const l=o.assignedSlot;if(l)return l;if(o.parentElement)return o.parentElement;const a=o.getRootNode();return Di(a)?a.host:null}function Kf(o){for(const l of Array.from(o.children))if(Kt(l)==="summary")return l;return null}function JT(o,l){const a=Kf(l);return!!a&&(o===a||De(a,o))}function Av(o){const l=o?Kt(o):"";return o!=null&&o.matches(FT)&&(l!=="summary"||o.parentElement!=null&&Kt(o.parentElement)==="details"&&Kf(o.parentElement)===o)&&(l!=="details"||Kf(o)==null)&&(l!=="input"||o.type!=="hidden")}function Mv(o){if(!Av(o)||!o.isConnected||o.matches(":disabled"))return!1;for(let l=o;l;l=ZT(l)){const a=l!==o,r=Kt(l)==="slot";if(l.hasAttribute("inert")||a&&Kt(l)==="details"&&!l.open&&!JT(o,l)||l.hasAttribute("hidden")||!r&&!WT(l,a))return!1}return!0}function WT(o,l){const a=vn(o);return l?a.display!=="none":Vs(o,a)}function Dv(o){const l=o.tabIndex;if(l<0){const a=Kt(o);if(a==="details"||a==="audio"||a==="video"||dt(o)&&o.isContentEditable)return 0}return l}function vf(o){if(Kt(o)!=="input")return null;const l=o;return l.type==="radio"&&l.name!==""?l:null}function $T(o,l){const a=vf(o);if(!a)return!0;const r=l.find(c=>{const f=vf(c);return f?.name===a.name&&f.form===a.form&&f.checked});return r?r===a:l.find(c=>{const f=vf(c);return f?.name===a.name&&f.form===a.form})===a}function Nv(o){if(dt(o)&&Kt(o)==="slot"){const l=o.assignedElements({flatten:!0});if(l.length>0)return l}return dt(o)&&o.shadowRoot?Array.from(o.shadowRoot.children):Array.from(o.children)}function zv(o,l){Nv(o).forEach(a=>{Av(a)&&l.push(a),zv(a,l)})}function _v(o,l,a){Nv(o).forEach(r=>{dt(r)&&r.matches(l)&&a.push(r),_v(r,l,a)})}function Ed(o){return Mv(o)&&Dv(o)>=0}function Hv(o){const l=[];return zv(o,l),l.filter(Mv)}function Ya(o){const l=Hv(o);return l.filter(a=>Dv(a)>=0&&$T(a,l))}function jv(o,l){const a=Ya(o),r=a.length;if(r===0)return;const c=Ht(Xe(o)),f=a.indexOf(c),d=f===-1?l===1?0:r-1:f+l;return a[d]}function Rd(o){return jv(Xe(o).body,1)||o}function kv(o){return jv(Xe(o).body,-1)||o}function Uv(o,l){if(!o)return null;const a=Ya(Xe(o).body),r=a.length;if(r===0)return null;const c=a.indexOf(o);if(c===-1)return null;const f=(c+l+r)%r;return a[f]}function eE(o){return Uv(o,1)}function tE(o){return Uv(o,-1)}function Ai(o,l){const a=l||o.currentTarget,r=o.relatedTarget;return!r||!De(a,r)}function nE(o){Ya(o).forEach(a=>{a.dataset.tabindex=a.getAttribute("tabindex")||"",a.setAttribute("tabindex","-1")})}function fy(o){const l=[];_v(o,"[data-tabindex]",l),l.forEach(a=>{const r=a.dataset.tabindex;delete a.dataset.tabindex,r?a.setAttribute("tabindex",r):a.removeAttribute("tabindex")})}function rl(o,l,a=!0){return o.filter(c=>c.parentId===l).flatMap(c=>[...!a||c.context?.open?[c]:[],...rl(o,c.id,a)])}function dy(o,l){let a=[],r=o.find(c=>c.id===l)?.parentId;for(;r;){const c=o.find(f=>f.id===r);r=c?.parentId,c&&(a=a.concat(c))}return a}function Ua(o){return`data-base-ui-${o}`}let as=0;function ms(o,l={}){const{preventScroll:a=!1,sync:r=!1,shouldFocus:c}=l;cancelAnimationFrame(as);function f(){c&&!c()||o?.focus({preventScroll:a})}if(r)return f(),ad;const d=requestAnimationFrame(f);return as=d,()=>{as===d&&(cancelAnimationFrame(d),as=0)}}const bf={inert:new WeakMap,"aria-hidden":new WeakMap},py="data-base-ui-inert",Qf={inert:new WeakSet,"aria-hidden":new WeakSet};let Aa=new WeakMap,Sf=0;function oE(o){return Qf[o]}function Lv(o){return o?Di(o)?o.host:Lv(o.parentNode):null}const hy=(o,l)=>l.map(a=>{if(o.contains(a))return a;const r=Lv(a);return o.contains(r)?r:null}).filter(a=>a!=null),gy=o=>{const l=new Set;return o.forEach(a=>{let r=a;for(;r&&!l.has(r);)l.add(r),r=r.parentNode}),l},my=(o,l,a)=>{const r=[],c=f=>{!f||a.has(f)||Array.from(f.children).forEach(d=>{Kt(d)!=="script"&&(l.has(d)?c(d):r.push(d))})};return c(o),r};function lE(o,l,a,r,{mark:c=!0}){let f=null;r?f="inert":a&&(f="aria-hidden");let d=null,m=null;const h=hy(l,o),g=c?my(l,gy(h),new Set(h)):[],y=[],b=[];if(f){const S=bf[f],E=oE(f);m=E,d=S;const T=hy(l,Array.from(l.querySelectorAll("[aria-live]"))),C=h.concat(T);my(l,gy(C),new Set(C)).forEach(w=>{const D=w.getAttribute(f),A=D!==null&&D!=="false",M=(S.get(w)||0)+1;S.set(w,M),y.push(w),M===1&&A&&E.add(w),A||w.setAttribute(f,f==="inert"?"":"true")})}return c&&g.forEach(S=>{const E=(Aa.get(S)||0)+1;Aa.set(S,E),b.push(S),E===1&&S.setAttribute(py,"")}),Sf+=1,()=>{d&&y.forEach(S=>{const T=(d.get(S)||0)-1;d.set(S,T),T||(!m?.has(S)&&f&&S.removeAttribute(f),m?.delete(S))}),c&&b.forEach(S=>{const E=(Aa.get(S)||0)-1;Aa.set(S,E),E||S.removeAttribute(py)}),Sf-=1,Sf||(bf.inert=new WeakMap,bf["aria-hidden"]=new WeakMap,Qf.inert=new WeakSet,Qf["aria-hidden"]=new WeakSet,Aa=new WeakMap)}}function yy(o,l={}){const{ariaHidden:a=!1,inert:r=!1,mark:c=!0}=l,f=Xe(o[0]).body;return lE(o,f,a,r,{mark:c})}var qn=cv();let vy=0;function iE(o,l="mui"){const[a,r]=v.useState(o),c=o||a;return v.useEffect(()=>{a==null&&(vy+=1,r(`${l}-${vy}`))},[a,l]),c}const by=bd.useId;function jl(o,l){if(by!==void 0){const a=by();return o??(l?`${l}-${a}`:a)}return iE(o,l)}const aE=parseInt(v.version,10);function Cd(o){return aE>=o}function Sy(o){if(!v.isValidElement(o))return null;const l=o,a=l.props;return(Cd(19)?a?.ref:l.ref)??null}function Ff(o,l){if(o&&!l)return o;if(!o&&l)return l;if(o||l)return{...o,...l}}function rE(o,l){const a={};for(const r in o){const c=o[r];if(l?.hasOwnProperty(r)){const f=l[r](c);f!=null&&Object.assign(a,f);continue}c===!0?a[`data-${r.toLowerCase()}`]="":c&&(a[`data-${r.toLowerCase()}`]=c.toString())}return a}function sE(o,l){return typeof o=="function"?o(l):o}function uE(o,l){return typeof o=="function"?o(l):o}const Od={};function To(o,l,a,r,c){if(!a&&!r&&!c&&!o)return Rs(l);let f=Rs(o);return l&&(f=Na(f,l)),a&&(f=Na(f,a)),r&&(f=Na(f,r)),c&&(f=Na(f,c)),f}function cE(o){if(o.length===0)return Od;if(o.length===1)return Rs(o[0]);let l=Rs(o[0]);for(let a=1;a<o.length;a+=1)l=Na(l,o[a]);return l}function Rs(o){return wd(o)?{...Yv(o,Od)}:fE(o)}function Na(o,l){return wd(l)?Yv(l,o):dE(o,l)}function fE(o){const l={...o};for(const a in l){const r=l[a];Bv(a,r)&&(l[a]=Iv(r))}return l}function dE(o,l){if(!l)return o;for(const a in l){const r=l[a];switch(a){case"style":{o[a]=Ff(o.style,r);break}case"className":{o[a]=qv(o.className,r);break}default:Bv(a,r)?o[a]=pE(o[a],r):o[a]=r}}return o}function Bv(o,l){const a=o.charCodeAt(0),r=o.charCodeAt(1),c=o.charCodeAt(2);return a===111&&r===110&&c>=65&&c<=90&&(typeof l=="function"||typeof l>"u")}function wd(o){return typeof o=="function"}function Yv(o,l){return wd(o)?o(l):o??Od}function pE(o,l){return l?o?(...a)=>{const r=a[0];if(Pv(r)){const f=r;Cs(f);const d=l(...a);return f.baseUIHandlerPrevented||o?.(...a),d}const c=l(...a);return o?.(...a),c}:Iv(l):o}function Iv(o){return o&&((...l)=>{const a=l[0];return Pv(a)&&Cs(a),o(...l)})}function Cs(o){return o.preventBaseUIHandler=()=>{o.baseUIHandlerPrevented=!0},o}function qv(o,l){return l?o?l+" "+o:l:o}function Pv(o){return o!=null&&typeof o=="object"&&"nativeEvent"in o}function St(o,l,a={}){let r=l.render;a.enabled!==!1&&(r=yE(r));const c=hE(l,a,r);if(a.enabled===!1)return null;const f=a.state??Ct;return vE(o,r,c,f)}function hE(o,l,a){const{className:r,style:c}=o,{state:f=Ct,ref:d,props:m,stateAttributesMapping:h,enabled:g=!0}=l,y=g?sE(r,f):void 0,b=g?uE(c,f):void 0,S=g?rE(f,h):Ct,E=g&&m?gE(m):void 0,T=g?Ff(S,E)??{}:Ct;return typeof document<"u"&&(g?Array.isArray(d)?T.ref=NT([T.ref,Sy(a),...d]):T.ref=_l(T.ref,Sy(a),d):_l(null,null)),g?(y!==void 0&&(T.className=qv(T.className,y)),b!==void 0&&(T.style=Ff(T.style,b)),T):Ct}function gE(o){return Array.isArray(o)?cE(o):To(void 0,o)}const mE=Symbol.for("react.lazy");function yE(o){if(o?.$$typeof!==mE)return o;const l=v.Children.toArray(o)[0];return v.isValidElement(l)?l:o}function vE(o,l,a,r){if(l){if(typeof l=="function")return l(a,r);const c=To(a,l.props);return c.ref=a.ref,v.cloneElement(l,c)}if(o&&typeof o=="string")return bE(o,a);throw new Error(Qt(8))}function bE(o,l){return o==="button"?v.createElement("button",{type:"button",...l,key:l.key}):o==="img"?v.createElement("img",{alt:"",...l,key:l.key}):v.createElement(o,l)}const SE=500,xE=500,TE={style:{transition:"none"}},EE="data-base-ui-click-trigger",RE="data-base-ui-swipe-ignore",CE="data-swipe-ignore",OE=`[${RE}]`,wE=`[${CE}]`,AE={fallbackAxisSide:"none"},Vv={fallbackAxisSide:"end"},ME={clipPath:"inset(50%)",position:"fixed",top:0,left:0},Gv=v.createContext(null),Xv=()=>v.useContext(Gv),DE=Ua("portal");function Kv(o={}){const{ref:l,container:a,componentProps:r=Ct,elementProps:c}=o,f=jl(),m=Xv()?.portalNode,[h,g]=v.useState(null),[y,b]=v.useState(null),S=Oe(O=>{O!==null&&b(O)}),E=v.useRef(null);be(()=>{if(a===null){E.current&&(E.current=null,b(null),g(null));return}const O=(a&&(fd(a)?a:a.current))??m??document.body;if(O==null){E.current&&(E.current=null,b(null),g(null));return}E.current!==O&&(E.current=O,b(null),g(O))},[a,m]);const T=St("div",r,{ref:[l,S],props:[{id:f,[DE]:""},c]}),C=h&&T?qn.createPortal(T,h):null;return{node:y,nodeId:v.isValidElement(T)?T.props.id:void 0,subtree:C}}const Qv=v.forwardRef(function(l,a){const{render:r,className:c,style:f,children:d,container:m,portalOwnerRole:h,...g}=l,{node:y,nodeId:b,subtree:S}=Kv({container:m,ref:a,componentProps:l,elementProps:g}),E=v.useRef(null),T=v.useRef(null),C=v.useRef(null),O=v.useRef(null),[w,D]=v.useState(null),A=v.useRef(!1),M=w?.modal,H=w?.open,U=!!w&&!w.modal&&w.open&&!!y;v.useEffect(()=>{if(!y||M)return;function k(W){y&&W.relatedTarget&&Ai(W)&&(W.type==="focusin"?A.current&&(fy(y),A.current=!1):(nE(y),A.current=!0))}return In(Ye(y,"focusin",k,!0),Ye(y,"focusout",k,!0))},[y,M]),be(()=>{!y||H!==!0||!A.current||(fy(y),A.current=!1)},[H,y]);const j=v.useMemo(()=>({beforeOutsideRef:E,afterOutsideRef:T,beforeInsideRef:C,afterInsideRef:O,portalNode:y,setFocusManagerState:D}),[y]);return z.jsxs(v.Fragment,{children:[S,z.jsxs(Gv.Provider,{value:j,children:[U&&y&&z.jsx(Hl,{"data-type":"outside",ref:E,onFocus:k=>{if(Ai(k,y))C.current?.focus();else{const W=w?w.domReference:null;kv(W)?.focus()}}}),U&&y&&z.jsx("span",{role:h,"aria-owns":b,style:ME}),y&&qn.createPortal(d,y),U&&y&&z.jsx(Hl,{"data-type":"outside",ref:T,onFocus:k=>{if(Ai(k,y))O.current?.focus();else{const W=w?w.domReference:null;Rd(W)?.focus(),w?.closeOnFocusOut&&w?.onOpenChange(!1,Ke(Ni,k.nativeEvent))}}})]})]})});function Fv(){const o=new Map;return{emit(l,a){o.get(l)?.forEach(r=>r(a))},on(l,a){o.has(l)||o.set(l,new Set),o.get(l).add(a)},off(l,a){o.get(l)?.delete(a)}}}class Ad{nodesRef={current:[]};events=Fv();addNode(l){this.nodesRef.current.push(l)}removeNode(l){const a=this.nodesRef.current.findIndex(r=>r===l);a!==-1&&this.nodesRef.current.splice(a,1)}}const Zv=v.createContext(null),Jv=v.createContext(null),Ll=()=>v.useContext(Zv)?.id||null,cl=o=>{const l=v.useContext(Jv);return o??l};function Wv(o){const l=jl(),a=cl(o),r=Ll();return be(()=>{if(!l)return;const c={id:l,parentId:r};return a?.addNode(c),()=>{a?.removeNode(c)}},[a,l,r]),l}function NE(o){const{children:l,id:a}=o,r=Ll();return z.jsx(Zv.Provider,{value:v.useMemo(()=>({id:a,parentId:r}),[a,r]),children:l})}function zE(o){const{children:l,externalTree:a}=o,r=Zt(()=>a??new Ad).current;return z.jsx(Jv.Provider,{value:r,children:l})}function yo(o){return o==null?o:"current"in o?o.current:o}function _E(o,l){const a=yt(bt(o));return o instanceof a.KeyboardEvent?"keyboard":o instanceof a.FocusEvent?l||"keyboard":"pointerType"in o?o.pointerType||"keyboard":"touches"in o?"touch":o instanceof a.MouseEvent?l||(o.detail===0?"keyboard":"mouse"):""}const xy=20;let ol=[];function Md(){ol=ol.filter(o=>o.deref()?.isConnected)}function Ty(o){Md(),o&&Kt(o)!=="body"&&(ol.push(new WeakRef(o)),ol.length>xy&&(ol=ol.slice(-xy)))}function Ey(){return Md(),ol[ol.length-1]?.deref()}function HE(o){return o?Ed(o)?o:Ya(o)[0]||o:null}function Ry(o){if(o.hasAttribute("tabindex")&&!o.hasAttribute("data-tabindex")||!o.getAttribute("role")?.includes("dialog"))return;const a=Hv(o).filter(c=>{const f=c.getAttribute("data-tabindex")||"";return Ed(c)||c.hasAttribute("data-tabindex")&&!f.startsWith("-")}),r=o.getAttribute("tabindex");a.length===0?r!=="0"&&(o.setAttribute("tabindex","0"),o.setAttribute("data-tabindex","0")):(r!=="-1"||o.hasAttribute("data-tabindex")&&o.getAttribute("data-tabindex")!=="-1")&&(o.setAttribute("tabindex","-1"),o.setAttribute("data-tabindex","-1"))}function $v(o){const{context:l,children:a,disabled:r=!1,initialFocus:c=!0,returnFocus:f=!0,restoreFocus:d=!1,modal:m=!0,closeOnFocusOut:h=!0,openInteractionType:g="",nextFocusableElement:y,previousFocusableElement:b,beforeContentFocusGuardRef:S,externalTree:E,getInsideElements:T}=o,C="rootStore"in l?l.rootStore:l,O=C.useState("open"),w=C.useState("domReferenceElement"),D=C.useState("floatingElement"),{events:A,dataRef:M}=C.context,H=Oe(()=>M.current.floatingContext?.nodeId),U=c===!1,j=qf(w)&&U,k=jt(c),W=jt(f),$=jt(g),F=jt(O),Y=cl(E),ee=Xv(),le=v.useRef(!1),K=v.useRef(!1),N=v.useRef(!1),P=v.useRef(null),I=v.useRef(""),Q=v.useRef(""),ne=v.useRef(null),R=v.useRef(null),B=_l(ne,S,ee?.beforeInsideRef),J=_l(R,ee?.afterInsideRef),V=Jt(),oe=Jt(),ie=ka(),he=ee!=null,ue=Pf(D),pe=Oe((ve=ue)=>ve?Ya(ve):[]),Re=Oe(()=>T?.().filter(ve=>ve!=null)??[]);v.useEffect(()=>{if(r||!m)return;function ve(_e){_e.key==="Tab"&&De(ue,Ht(Xe(ue)))&&pe().length===0&&!j&&Fn(_e)}const ge=Xe(ue);return Ye(ge,"keydown",ve)},[r,ue,m,j,pe]),v.useEffect(()=>{if(r||!O)return;const ve=Xe(ue);function ge(){N.current=!1}function _e(Pe){const xe=bt(Pe),Ue=Re(),Te=De(D,xe)||De(w,xe)||De(ee?.portalNode,xe)||Ue.some(Ee=>Ee===xe||De(Ee,xe));N.current=!Te,Q.current=Pe.pointerType||"keyboard",xe?.closest(`[${EE}]`)&&(K.current=!0,oe.start(0,()=>{K.current=!1}))}function ke(){Q.current="keyboard"}return In(Ye(ve,"pointerdown",_e,!0),Ye(ve,"pointerup",ge,!0),Ye(ve,"pointercancel",ge,!0),Ye(ve,"keydown",ke,!0),ge)},[r,D,w,ue,O,ee,oe,Re]),v.useEffect(()=>{if(r||!h)return;const ve=Xe(ue);function ge(){K.current=!0,oe.start(0,()=>{K.current=!1})}function _e(Ue){const Te=bt(Ue);Ed(Te)&&(P.current=Te)}function ke(Ue){const Te=Ue.relatedTarget,Ee=Ue.currentTarget,we=bt(Ue);m&&Te==null&&we!=null&&De(D,we)&&Ty(we),queueMicrotask(()=>{const Qe=H(),Ae=C.context.triggerElements,fe=Re(),me=Te?.hasAttribute(Ua("focus-guard"))&&[ne.current,R.current,ee?.beforeInsideRef.current,ee?.afterInsideRef.current,ee?.beforeOutsideRef.current,ee?.afterOutsideRef.current,yo(b),yo(y)].includes(Te),de=!(De(w,Te)||De(D,Te)||De(Te,D)||De(ee?.portalNode,Te)||fe.some(ae=>ae===Te||De(ae,Te))||Ae.hasMatchingElement(ae=>De(ae,Te))||me||Y&&(rl(Y.nodesRef.current,Qe).find(ae=>De(ae.context?.elements.floating,Te)||De(ae.context?.elements.domReference,Te))||dy(Y.nodesRef.current,Qe).find(ae=>[ae.context?.elements.floating,Pf(ae.context?.elements.floating)].includes(Te)||ae.context?.elements.domReference===Te)));if(Ee===w&&ue&&Ry(ue),d&&Ee!==w&&!Vs(we)&&Ht(ve)===ve.body){if(dt(ue)&&(ue.focus(),d==="popup")){ie.request(()=>{ue.focus()});return}const ae=pe(),ye=P.current,Le=(ye&&ae.includes(ye)?ye:null)||ae[ae.length-1]||ue;dt(Le)&&Le.focus()}if(M.current.insideReactTree){M.current.insideReactTree=!1;return}(j||!m)&&Te&&de&&!K.current&&(j||Te!==Ey())&&(le.current=!0,C.setOpen(!1,Ke(Ni,Ue)))})}function Pe(){N.current||(M.current.insideReactTree=!0,V.start(0,()=>{M.current.insideReactTree=!1}))}const xe=dt(w)?w:null;if(!(!D&&!xe))return In(xe&&Ye(xe,"focusout",ke),xe&&Ye(xe,"pointerdown",ge),D&&Ye(D,"focusin",_e),D&&Ye(D,"focusout",ke),D&&ee&&Ye(D,"focusout",Pe,!0))},[r,w,D,ue,m,Y,ee,C,h,d,pe,j,H,M,V,oe,ie,y,b,Re]),v.useEffect(()=>{if(r||!D||!O)return;const ve=Array.from(ee?.portalNode?.querySelectorAll(`[${Ua("portal")}]`)||[]),_e=(Y?dy(Y.nodesRef.current,H()):[]).find(Ee=>qf(Ee.context?.elements.domReference||null))?.context?.elements.domReference,Pe=[...[D,...ve,ne.current,R.current,ee?.beforeOutsideRef.current,ee?.afterOutsideRef.current,...Re()],_e,yo(b),yo(y),j?w:null].filter(Ee=>Ee!=null),xe=yy(Pe,{ariaHidden:m||j,mark:!1}),Ue=[D,...ve].filter(Ee=>Ee!=null),Te=yy(Ue);return()=>{Te(),xe()}},[O,r,w,D,m,ee,j,Y,H,y,b,Re]),be(()=>{if(!O||r||!dt(ue))return;I.current="",Q.current="";const ve=Xe(ue),ge=Ht(ve);queueMicrotask(()=>{const _e=k.current,ke=typeof _e=="function"?_e($.current||""):_e;if(ke===void 0||ke===!1||De(ue,ge))return;let xe=null;const Ue=()=>(xe==null&&(xe=pe(ue)),xe[0]||ue);let Te;ke===!0||ke===null?Te=Ue():Te=yo(ke),Te=Te||Ue();const Ee=De(ue,Ht(ve));ms(Te,{preventScroll:Te===ue,shouldFocus(){if(!F.current)return!1;if(Ee)return!0;const we=Ht(ve);return!(we!==Te&&De(ue,we))}})})},[r,O,ue,pe,k,$,F]),be(()=>{if(r||!ue)return;const ve=Xe(ue),ge=Ht(ve),_e=$.current==null;Ty(ge);function ke(xe){if(xe.open||(I.current=_E(xe.nativeEvent,Q.current)),xe.reason===Ut&&xe.nativeEvent.type==="mouseleave"&&(le.current=!0),xe.reason===yd)if(xe.nested)le.current=!1;else if(ud(xe.nativeEvent)||cd(xe.nativeEvent))le.current=!1;else{let Ue=!1;Xe(ue).createElement("div").focus({get preventScroll(){return Ue=!0,!1}}),Ue?le.current=!1:le.current=!0}}A.on("openchange",ke);function Pe(xe){const Ue=W.current;let Te=typeof Ue=="function"?Ue(xe):Ue;if(Te===void 0||Te===!1)return null;Te===null&&(Te=!0);const Ee=w?.isConnected?w:null,we=ge?.isConnected&&Kt(ge)!=="body"?ge:null;let Qe=_e?we||Ee:Ee||we;return Qe||(Qe=Ey()||null),typeof Te=="boolean"?Qe:yo(Te)||Qe||null}return()=>{A.off("openchange",ke);const xe=Ht(ve),Ue=Re(),Te=De(D,xe)||Ue.some(Ae=>Ae===xe||De(Ae,xe))||Y&&rl(Y.nodesRef.current,H(),!1).some(Ae=>De(Ae.context?.elements.floating,xe)),Ee=W.current,we=I.current,Qe=Pe(we);queueMicrotask(()=>{const Ae=HE(Qe),fe=typeof Ee!="boolean";if(Ee&&!le.current&&dt(Ae)&&(!(!fe&&Ae!==xe&&xe!==ve.body)||Te)){const me={preventScroll:!0};we==="keyboard"&&(me.focusVisible=!0),Ae.focus(me)}le.current=!1})}},[r,D,ue,W,$,A,Y,w,H,Re]),be(()=>{if(!ul||O||!D)return;const ve=Ht(Xe(D));!dt(ve)||!Is(ve)||De(D,ve)&&ve.blur()},[O,D]),be(()=>{if(!(r||!ee))return ee.setFocusManagerState({modal:m,closeOnFocusOut:h,open:O,onOpenChange:C.setOpen,domReference:w}),()=>{ee.setFocusManagerState(null)}},[r,ee,m,O,C,h,w]),be(()=>{if(!(r||!ue))return Ry(ue),()=>{queueMicrotask(Md)}},[r,ue]);const ze=!r&&(m?!j:!0)&&(he||m);return z.jsxs(v.Fragment,{children:[ze&&z.jsx(Hl,{"data-type":"inside",ref:B,onFocus:ve=>{if(m){const ge=pe();ms(ge[ge.length-1])}else ee?.portalNode&&(le.current=!1,Ai(ve,ee.portalNode)?Rd(w)?.focus():yo(b??ee.beforeOutsideRef)?.focus())}}),a,ze&&z.jsx(Hl,{"data-type":"inside",ref:J,onFocus:ve=>{m?ms(pe()[0]):ee?.portalNode&&(h&&(le.current=!0),Ai(ve,ee.portalNode)?kv(w)?.focus():yo(y??ee.afterOutsideRef)?.focus())}})]})}function jE(o,l={}){const{enabled:a=!0,event:r="click",toggle:c=!0,ignoreMouse:f=!1,stickIfOpen:d=!0,touchOpenDelay:m=0,reason:h=_i}=l,g="rootStore"in o?o.rootStore:o,y=g.context.dataRef,b=v.useRef(void 0),S=ka(),E=Jt(),T=v.useMemo(()=>{function C(w,D,A,M){const H=Ke(h,D,A);w&&M==="touch"&&m>0?E.start(m,()=>{g.setOpen(!0,H)}):g.setOpen(w,H)}function O(w,D,A){const M=y.current.openEvent,H=g.select("domReferenceElement")!==D;return w&&H||!w||!c?!0:M&&d?!A(M.type):!1}return{onPointerDown(w){b.current=ll(w.pointerType,!0)&&cd(w.nativeEvent)?"virtual":w.pointerType},onMouseDown(w){const D=b.current,A=w.nativeEvent,M=g.select("open");if(w.button!==0||r==="click"||ll(D,!0)&&f)return;const H=O(M,w.currentTarget,k=>k==="click"||k==="mousedown"),U=bt(A);if(Is(U)){C(H,A,U,D);return}const j=w.currentTarget;S.request(()=>{C(H,A,j,D)})},onClick(w){if(r==="mousedown-only")return;const D=b.current;if(r==="mousedown"&&D){b.current=void 0;return}if(ll(D,!0)&&f)return;const A=g.select("open"),M=O(A,w.currentTarget,H=>H==="click"||H==="mousedown"||H==="keydown"||H==="keyup");C(M,w.nativeEvent,w.currentTarget,D)},onKeyDown(){b.current=void 0}}},[y,r,f,h,g,d,c,S,E,m]);return v.useMemo(()=>a?{reference:T}:Ct,[a,T])}function kE(o,l){let a=null,r=null,c=!1;return{contextElement:o||void 0,getBoundingClientRect(){const f=o?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},d=l.axis==="x"||l.axis==="both",m=l.axis==="y"||l.axis==="both",h=["mouseenter","mousemove"].includes(l.dataRef.current.openEvent?.type||"")&&l.pointerType!=="touch";let g=f.width,y=f.height,b=f.x,S=f.y;return a==null&&l.x&&d&&(a=f.x-l.x),r==null&&l.y&&m&&(r=f.y-l.y),b-=a||0,S-=r||0,g=0,y=0,!c||h?(g=l.axis==="y"?f.width:0,y=l.axis==="x"?f.height:0,b=d&&l.x!=null?l.x:b,S=m&&l.y!=null?l.y:S):c&&!h&&(y=l.axis==="x"?f.height:y,g=l.axis==="y"?f.width:g),c=!0,{width:g,height:y,x:b,y:S,top:S,right:b+g,bottom:S+y,left:b}}}}function Cy(o){return o!=null&&o.clientX!=null}function UE(o,l={}){const{enabled:a=!0,axis:r="both"}=l,c="rootStore"in o?o.rootStore:o,f=c.useState("open"),d=c.useState("floatingElement"),m=c.useState("domReferenceElement"),h=c.context.dataRef,g=v.useRef(!1),y=v.useRef(null),[b,S]=v.useState(),[E,T]=v.useState([]),C=Oe(M=>{c.set("positionReference",M)}),O=Oe((M,H,U)=>{g.current||h.current.openEvent&&!Cy(h.current.openEvent)||c.set("positionReference",kE(U??m,{x:M,y:H,axis:r,dataRef:h,pointerType:b}))}),w=Oe(M=>{f?y.current||(O(M.clientX,M.clientY,M.currentTarget),T([])):O(M.clientX,M.clientY,M.currentTarget)}),D=ll(b)?d:f;v.useEffect(()=>{if(!a){C(m);return}if(!D)return;function M(){y.current?.(),y.current=null}const H=yt(d);function U(j){const k=bt(j);De(d,k)?M():O(j.clientX,j.clientY)}return!h.current.openEvent||Cy(h.current.openEvent)?y.current=Ye(H,"mousemove",U):C(m),M},[D,a,d,h,m,c,O,C,E]),v.useEffect(()=>()=>{c.set("positionReference",null)},[c]),v.useEffect(()=>{a&&!d&&(g.current=!1)},[a,d]),v.useEffect(()=>{!a&&f&&(g.current=!0)},[a,f]);const A=v.useMemo(()=>{function M(H){S(H.pointerType)}return{onPointerDown:M,onPointerEnter:M,onMouseMove:w,onMouseEnter:w}},[w]);return v.useMemo(()=>a?{reference:A,trigger:A}:{},[a,A])}function LE(){return!1}function BE(o){return{escapeKey:typeof o=="boolean"?o:o?.escapeKey??!1,outsidePress:typeof o=="boolean"?o:o?.outsidePress??!0}}function Dd(o,l={}){const{enabled:a=!0,escapeKey:r=!0,outsidePress:c=!0,outsidePressEvent:f="sloppy",referencePress:d=LE,bubbles:m,externalTree:h}=l,g="rootStore"in o?o.rootStore:o,y=g.useState("open"),b=g.useState("floatingElement"),{dataRef:S,events:E}=g.context,T=cl(h),C=Oe(typeof c=="function"?c:()=>!1),O=typeof c=="function"?C:c,w=O!==!1,D=Oe(()=>f),{escapeKey:A,outsidePress:M}=BE(m),H=v.useRef(!1),U=v.useRef(!1),j=v.useRef(!1),k=v.useRef(!1),W=v.useRef(!1),$=v.useRef(""),F=v.useRef(null),Y=Jt(),ee=Jt(),le=Oe(()=>{ee.clear(),S.current.insideReactTree=!1}),K=Oe(V=>{const oe=S.current.floatingContext?.nodeId;return(T?rl(T.nodesRef.current,oe):[]).some(he=>he.context?.open&&!he.context.dataRef.current[V])}),N=Oe(V=>mf(V,g.select("floatingElement"))||mf(V,g.select("domReferenceElement"))),P=Oe(V=>{d()&&g.setOpen(!1,Ke(_i,V.nativeEvent))}),I=Oe(V=>{if(!y||!a||!r||V.key!=="Escape"||W.current||!A&&K("__escapeKeyBubbles"))return;const oe=oT(V)?V.nativeEvent:V,ie=Ke(Ps,oe);g.setOpen(!1,ie),ie.isCanceled||V.preventDefault(),!A&&!ie.isPropagationAllowed&&V.stopPropagation()}),Q=Oe(()=>{S.current.insideReactTree=!0,ee.start(0,le)}),ne=Oe(V=>{if(!y||!a||V.button!==0)return;const oe=bt(V.nativeEvent);De(g.select("floatingElement"),oe)&&(H.current||(H.current=!0,U.current=!1))}),R=Oe(V=>{!y||!a||(V.defaultPrevented||V.nativeEvent.defaultPrevented)&&H.current&&(U.current=!0)});v.useEffect(()=>{function V(oe){oe.open||(k.current=!1)}return E.on("openchange",V),()=>{E.off("openchange",V)}},[E]),v.useEffect(()=>{if(!y||!a)return y||(k.current=!1),le;S.current.__escapeKeyBubbles=A,S.current.__outsidePressBubbles=M;const V=new yn,oe=new yn,ie=Xe(b);function he(){V.clear(),W.current=!0}function ue(){V.start(ul?5:0,()=>{W.current=!1})}function pe(){j.current=!0,oe.start(0,()=>{j.current=!1})}function Re(){H.current=!1,U.current=!1}function ze(){const de=$.current,ae=de==="pen"||!de?"mouse":de,ye=D(),Le=typeof ye=="function"?ye():ye;return typeof Le=="string"?Le:Le[ae]}function ve(de){const ae=ze();return ae==="intentional"&&de.type!=="click"||ae==="sloppy"&&de.type==="click"}function ge(de){const ae=S.current.floatingContext?.nodeId,ye=T&&rl(T.nodesRef.current,ae).some(Le=>mf(de,Le.context?.elements.floating));return N(de)||ye}function _e(de){if(ve(de)){de.type!=="click"&&!N(de)&&(oe.clear(),j.current=!1),le();return}if(S.current.insideReactTree){le();return}const ae=bt(de),ye=`[${Ua("inert")}]`,Le=Je(ae)?ae.getRootNode():null,Lt=Array.from((Di(Le)?Le:Xe(g.select("floatingElement"))).querySelectorAll(ye)),$t=g.context.triggerElements;if(ae&&($t.hasElement(ae)||$t.hasMatchingElement(Se=>De(Se,ae))))return;let Tt=Je(ae)?ae:null;for(;Tt&&!bo(Tt);){const Se=Ro(Tt);if(bo(Se)||!Je(Se))break;Tt=Se}if(!(Lt.length&&Je(ae)&&!TT(ae)&&!De(ae,g.select("floatingElement"))&&Lt.every(Se=>!De(Tt,Se)))){if(dt(ae)&&!("touches"in de)){const Se=bo(ae),Ie=vn(ae),tt=/auto|scroll/,pt=Se||tt.test(Ie.overflowX),bn=Se||tt.test(Ie.overflowY),Hn=pt&&ae.clientWidth>0&&ae.scrollWidth>ae.clientWidth,Sn=bn&&ae.clientHeight>0&&ae.scrollHeight>ae.clientHeight,At=Ie.direction==="rtl",jn=Sn&&(At?de.offsetX<=ae.offsetWidth-ae.clientWidth:de.offsetX>ae.clientWidth),Ge=Hn&&de.offsetY>ae.clientHeight;if(jn||Ge)return}if(!ge(de)){if(ze()==="intentional"){if(de.detail!==0&&!ud(de)&&!k.current)return;if(j.current){oe.clear(),j.current=!1;return}}typeof O=="function"&&!O(de)||K("__outsidePressBubbles")||(g.setOpen(!1,Ke(yd,de)),le())}}}function ke(de){ze()!=="sloppy"||de.pointerType==="touch"||!g.select("open")||!a||N(de)||_e(de)}function Pe(de){if(ze()!=="sloppy"||!g.select("open")||!a||N(de))return;const ae=de.touches[0];ae&&(F.current={startTime:Date.now(),startX:ae.clientX,startY:ae.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},Y.start(1e3,()=>{F.current&&(F.current.dismissOnTouchEnd=!1,F.current.dismissOnMouseDown=!1)}))}function xe(de,ae){const ye=bt(de);if(!ye)return;const Le=Ye(ye,de.type,()=>{ae(de),Le()})}function Ue(de){$.current="touch",xe(de,Pe)}function Te(de){Y.clear(),de.type==="pointerdown"&&(de.button===0&&(k.current=!0),$.current=de.pointerType),!(de.type==="mousedown"&&F.current&&!F.current.dismissOnMouseDown)&&xe(de,ae=>{ae.type==="pointerdown"?ke(ae):_e(ae)})}function Ee(de){if(de.type==="pointercancel"&&(k.current=!1),!H.current)return;const ae=U.current;if(Re(),ze()==="intentional"){if(de.type==="pointercancel"){ae&&pe();return}if(!ge(de)){if(ae){pe();return}typeof O=="function"&&!O(de)||(oe.clear(),j.current=!0,le())}}}function we(de){if(ze()!=="sloppy"||!F.current||N(de))return;const ae=de.touches[0];if(!ae)return;const ye=Math.abs(ae.clientX-F.current.startX),Le=Math.abs(ae.clientY-F.current.startY),Lt=Math.sqrt(ye*ye+Le*Le);Lt>5&&(F.current.dismissOnTouchEnd=!0),Lt>10&&(_e(de),Y.clear(),F.current=null)}function Qe(de){xe(de,we)}function Ae(de){ze()!=="sloppy"||!F.current||N(de)||(F.current.dismissOnTouchEnd&&_e(de),Y.clear(),F.current=null)}function fe(de){xe(de,Ae)}const me=In(r&&In(Ye(ie,"keydown",I),Ye(ie,"compositionstart",he),Ye(ie,"compositionend",ue)),w&&In(Ye(ie,"click",Te,!0),Ye(ie,"pointerdown",Te,!0),Ye(ie,"pointerup",Ee,!0),Ye(ie,"pointercancel",Ee,!0),Ye(ie,"mousedown",Te,!0),Ye(ie,"mouseup",Ee,!0),Ye(ie,"touchstart",Ue,{capture:!0,passive:!0}),Ye(ie,"touchmove",Qe,{capture:!0,passive:!0}),Ye(ie,"touchend",fe,{capture:!0,passive:!0})));return()=>{me(),V.clear(),oe.clear(),Re(),j.current=!1,le()}},[S,b,r,w,O,y,a,A,M,I,le,D,K,N,T,g,Y]);const B=v.useMemo(()=>({onKeyDown:I,onPointerDown:P,onClick:P}),[I,P]),J=v.useMemo(()=>({onKeyDown:I,onPointerDown:R,onMouseDown:R,onClickCapture:Q,onMouseDownCapture(V){Q(),ne(V)},onPointerDownCapture(V){Q(),ne(V)},onMouseUpCapture:Q,onTouchEndCapture:Q,onTouchMoveCapture:Q}),[I,Q,ne,R]);return v.useMemo(()=>a?{reference:B,floating:J,trigger:B}:{},[a,B,J])}function Oy(o,l,a){let{reference:r,floating:c}=o;const f=zn(l),d=Td(l),m=xd(d),h=_n(l),g=f==="y",y=r.x+r.width/2-c.width/2,b=r.y+r.height/2-c.height/2,S=r[m]/2-c[m]/2;let E;switch(h){case"top":E={x:y,y:r.y-c.height};break;case"bottom":E={x:y,y:r.y+r.height};break;case"right":E={x:r.x+r.width,y:b};break;case"left":E={x:r.x-c.width,y:b};break;default:E={x:r.x,y:r.y}}const T=Co(l);return T&&(E[d]+=S*(T==="end"?1:-1)*(a&&g?-1:1)),E}async function YE(o,l){var a;l===void 0&&(l={});const{x:r,y:c,platform:f,rects:d,elements:m,strategy:h}=o,{boundary:g="clippingAncestors",rootBoundary:y="viewport",elementContext:b="floating",altBoundary:S=!1,padding:E=0}=al(l,o),T=wv(E),O=m[S?b==="floating"?"reference":"floating":b],w=Es(await f.getClippingRect({element:(a=await(f.isElement==null?void 0:f.isElement(O)))==null||a?O:O.contextElement||await(f.getDocumentElement==null?void 0:f.getDocumentElement(m.floating)),boundary:g,rootBoundary:y,strategy:h})),D=b==="floating"?{x:r,y:c,width:d.floating.width,height:d.floating.height}:d.reference,A=await(f.getOffsetParent==null?void 0:f.getOffsetParent(m.floating)),M=await(f.isElement==null?void 0:f.isElement(A))&&await(f.getScale==null?void 0:f.getScale(A))||{x:1,y:1},H=Es(f.convertOffsetParentRelativeRectToViewportRelativeRect?await f.convertOffsetParentRelativeRectToViewportRelativeRect({elements:m,rect:D,offsetParent:A,strategy:h}):D);return{top:(w.top-H.top+T.top)/M.y,bottom:(H.bottom-w.bottom+T.bottom)/M.y,left:(w.left-H.left+T.left)/M.x,right:(H.right-w.right+T.right)/M.x}}const IE=50,qE=async(o,l,a)=>{const{placement:r="bottom",strategy:c="absolute",middleware:f=[],platform:d}=a,m=d.detectOverflow?d:{...d,detectOverflow:YE},h=await(d.isRTL==null?void 0:d.isRTL(l));let g=await d.getElementRects({reference:o,floating:l,strategy:c}),{x:y,y:b}=Oy(g,r,h),S=r,E=0;const T={};for(let C=0;C<f.length;C++){const O=f[C];if(!O)continue;const{name:w,fn:D}=O,{x:A,y:M,data:H,reset:U}=await D({x:y,y:b,initialPlacement:r,placement:S,strategy:c,middlewareData:T,rects:g,platform:m,elements:{reference:o,floating:l}});y=A??y,b=M??b,T[w]={...T[w],...H},U&&E<IE&&(E++,typeof U=="object"&&(U.placement&&(S=U.placement),U.rects&&(g=U.rects===!0?await d.getElementRects({reference:o,floating:l,strategy:c}):U.rects),{x:y,y:b}=Oy(g,S,h)),C=-1)}return{x:y,y:b,placement:S,strategy:c,middlewareData:T}},PE=function(o){return o===void 0&&(o={}),{name:"flip",options:o,async fn(l){var a,r;const{placement:c,middlewareData:f,rects:d,initialPlacement:m,platform:h,elements:g}=l,{mainAxis:y=!0,crossAxis:b=!0,fallbackPlacements:S,fallbackStrategy:E="bestFit",fallbackAxisSideDirection:T="none",flipAlignment:C=!0,...O}=al(o,l);if((a=f.arrow)!=null&&a.alignmentOffset)return{};const w=_n(c),D=zn(m),A=_n(m)===m,M=await(h.isRTL==null?void 0:h.isRTL(g.floating)),H=S||(A||!C?[Ts(m)]:qT(m)),U=T!=="none";!S&&U&&H.push(...XT(m,C,T,M));const j=[m,...H],k=await h.detectOverflow(l,O),W=[];let $=((r=f.flip)==null?void 0:r.overflows)||[];if(y&&W.push(k[w]),b){const le=IT(c,d,M);W.push(k[le[0]],k[le[1]])}if($=[...$,{placement:c,overflows:W}],!W.every(le=>le<=0)){var F,Y;const le=(((F=f.flip)==null?void 0:F.index)||0)+1,K=j[le];if(K&&(!(b==="alignment"?D!==zn(K):!1)||$.every(I=>zn(I.placement)===D?I.overflows[0]>0:!0)))return{data:{index:le,overflows:$},reset:{placement:K}};let N=(Y=$.filter(P=>P.overflows[0]<=0).sort((P,I)=>P.overflows[1]-I.overflows[1])[0])==null?void 0:Y.placement;if(!N)switch(E){case"bestFit":{var ee;const P=(ee=$.filter(I=>{if(U){const Q=zn(I.placement);return Q===D||Q==="y"}return!0}).map(I=>[I.placement,I.overflows.filter(Q=>Q>0).reduce((Q,ne)=>Q+ne,0)]).sort((I,Q)=>I[1]-Q[1])[0])==null?void 0:ee[0];P&&(N=P);break}case"initialPlacement":N=m;break}if(c!==N)return{reset:{placement:N}}}return{}}}},eb=new Set(["left","top"]);async function VE(o,l){const{placement:a,platform:r,elements:c}=o,f=await(r.isRTL==null?void 0:r.isRTL(c.floating)),d=_n(a),m=Co(a),h=zn(a)==="y",g=eb.has(d)?-1:1,y=f&&h?-1:1,b=al(l,o);let{mainAxis:S,crossAxis:E,alignmentAxis:T}=typeof b=="number"?{mainAxis:b,crossAxis:0,alignmentAxis:null}:{mainAxis:b.mainAxis||0,crossAxis:b.crossAxis||0,alignmentAxis:b.alignmentAxis};return m&&typeof T=="number"&&(E=m==="end"?T*-1:T),h?{x:E*y,y:S*g}:{x:S*g,y:E*y}}const GE=function(o){return o===void 0&&(o=0),{name:"offset",options:o,async fn(l){var a,r;const{x:c,y:f,placement:d,middlewareData:m}=l,h=await VE(l,o);return d===((a=m.offset)==null?void 0:a.placement)&&(r=m.arrow)!=null&&r.alignmentOffset?{}:{x:c+h.x,y:f+h.y,data:{...h,placement:d}}}}},XE=function(o){return o===void 0&&(o={}),{name:"shift",options:o,async fn(l){const{x:a,y:r,placement:c,platform:f}=l,{mainAxis:d=!0,crossAxis:m=!1,limiter:h={fn:D=>{let{x:A,y:M}=D;return{x:A,y:M}}},...g}=al(o,l),y={x:a,y:r},b=await f.detectOverflow(l,g),S=zn(c),E=Sd(S);let T=y[E],C=y[S];const O=(D,A)=>Ov(A+b[D==="y"?"top":"left"],A,A-b[D==="y"?"bottom":"right"]);d&&(T=O(E,T)),m&&(C=O(S,C));const w=h.fn({...l,[E]:T,[S]:C});return{...w,data:{x:w.x-a,y:w.y-r,enabled:{[E]:d,[S]:m}}}}}},KE=function(o){return o===void 0&&(o={}),{options:o,fn(l){var a,r;const{x:c,y:f,placement:d,rects:m,middlewareData:h}=l,{offset:g=0,mainAxis:y=!0,crossAxis:b=!0}=al(o,l),S={x:c,y:f},E=zn(d),T=Sd(E);let C=S[T],O=S[E];const w=al(g,l),D=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:(a=w.mainAxis)!=null?a:0,crossAxis:(r=w.crossAxis)!=null?r:0};if(y){const H=T==="y"?"height":"width",U=m.reference[T]-m.floating[H]+D.mainAxis,j=m.reference[T]+m.reference[H]-D.mainAxis;C<U?C=U:C>j&&(C=j)}if(b){var A,M;const H=T==="y"?"width":"height",U=eb.has(_n(d)),j=m.reference[E]-m.floating[H]+(U&&((A=h.offset)==null?void 0:A[E])||0)+(U?0:D.crossAxis),k=m.reference[E]+m.reference[H]+(U?0:((M=h.offset)==null?void 0:M[E])||0)-(U?D.crossAxis:0);O<j?O=j:O>k&&(O=k)}return{[T]:C,[E]:O}}}},QE=function(o){return o===void 0&&(o={}),{name:"size",options:o,async fn(l){const{placement:a,rects:r,platform:c,elements:f}=l,{apply:d=()=>{},...m}=al(o,l),h=await c.detectOverflow(l,m),g=_n(a),y=Co(a),b=zn(a)==="y",{width:S,height:E}=r.floating;let T,C;g==="top"||g==="bottom"?(T=g,C=y===(await(c.isRTL==null?void 0:c.isRTL(f.floating))?"start":"end")?"left":"right"):(C=g,T=y==="end"?"top":"bottom");const O=E-h.top-h.bottom,w=S-h.left-h.right,D=zi(E-h[T],O),A=zi(S-h[C],w),M=l.middlewareData.shift,H=!M;let U=D,j=A;M!=null&&M.enabled.x&&(j=w),M!=null&&M.enabled.y&&(U=O),H&&!y&&(b?j=S-2*So(h.left,h.right):U=E-2*So(h.top,h.bottom)),await d({...l,availableWidth:j,availableHeight:U});const k=await c.getDimensions(f.floating);return S!==k.width||E!==k.height?{reset:{rects:!0}}:{}}}};function tb(o){const l=vn(o);let a=parseFloat(l.width)||0,r=parseFloat(l.height)||0;const c=dt(o),f=c?o.offsetWidth:a,d=c?o.offsetHeight:r,m=xs(a)!==f||xs(r)!==d;return m&&(a=f,r=d),{width:a,height:r,$:m}}function Nd(o){return Je(o)?o:o.contextElement}function Mi(o){const l=Nd(o);if(!dt(l))return xo(1);const a=l.getBoundingClientRect(),{width:r,height:c,$:f}=tb(l);let d=(f?xs(a.width):a.width)/r,m=(f?xs(a.height):a.height)/c;return(!d||!Number.isFinite(d))&&(d=1),(!m||!Number.isFinite(m))&&(m=1),{x:d,y:m}}const FE=xo(0);function nb(o){const l=yt(o);return!pd()||!l.visualViewport?FE:{x:l.visualViewport.offsetLeft,y:l.visualViewport.offsetTop}}function ZE(o,l,a){return l===void 0&&(l=!1),!!a&&l&&a===yt(o)}function kl(o,l,a,r){l===void 0&&(l=!1),a===void 0&&(a=!1);const c=o.getBoundingClientRect(),f=Nd(o);let d=xo(1);l&&(r?Je(r)&&(d=Mi(r)):d=Mi(o));const m=ZE(f,a,r)?nb(f):xo(0);let h=(c.left+m.x)/d.x,g=(c.top+m.y)/d.y,y=c.width/d.x,b=c.height/d.y;if(f&&r){const S=yt(f),E=Je(r)?yt(r):r;let T=S,C=Bf(T);for(;C&&E!==T;){const O=Mi(C),w=C.getBoundingClientRect(),D=vn(C),A=w.left+(C.clientLeft+parseFloat(D.paddingLeft))*O.x,M=w.top+(C.clientTop+parseFloat(D.paddingTop))*O.y;h*=O.x,g*=O.y,y*=O.x,b*=O.y,h+=A,g+=M,T=yt(C),C=Bf(T)}}return Es({width:y,height:b,x:h,y:g})}function Gs(o,l){const a=Us(o).scrollLeft;return l?l.left+a:kl(wo(o)).left+a}function ob(o,l){const a=o.getBoundingClientRect(),r=a.left+l.scrollLeft-Gs(o,a),c=a.top+l.scrollTop;return{x:r,y:c}}function JE(o){let{elements:l,rect:a,offsetParent:r,strategy:c}=o;const f=c==="fixed",d=wo(r),m=l?ks(l.floating):!1;if(r===d||m&&f)return a;let h={scrollLeft:0,scrollTop:0},g=xo(1);const y=xo(0),b=dt(r);if((b||!f)&&((Kt(r)!=="body"||Ba(d))&&(h=Us(r)),b)){const E=kl(r);g=Mi(r),y.x=E.x+r.clientLeft,y.y=E.y+r.clientTop}const S=d&&!b&&!f?ob(d,h):xo(0);return{width:a.width*g.x,height:a.height*g.y,x:a.x*g.x-h.scrollLeft*g.x+y.x+S.x,y:a.y*g.y-h.scrollTop*g.y+y.y+S.y}}function WE(o){return o.getClientRects?Array.from(o.getClientRects()):[]}function $E(o){const l=Us(o),a=o.ownerDocument.body,r=So(o.scrollWidth,o.clientWidth,a.scrollWidth,a.clientWidth),c=So(o.scrollHeight,o.clientHeight,a.scrollHeight,a.clientHeight);let f=-l.scrollLeft+Gs(o);const d=-l.scrollTop;return vn(a).direction==="rtl"&&(f+=So(o.clientWidth,a.clientWidth)-r),{width:r,height:c,x:f,y:d}}const e1=25;function t1(o,l,a){a===void 0&&(a="viewport");const r=a==="layoutViewport",c=yt(o),f=wo(o),d=c.visualViewport;let m=f.clientWidth,h=f.clientHeight,g=0,y=0;if(d){const S=!pd()||l==="fixed";r?S||(g=-d.offsetLeft,y=-d.offsetTop):(m=d.width,h=d.height,S&&(g=d.offsetLeft,y=d.offsetTop))}if(Gs(f)<=0){const S=f.ownerDocument,E=S.body,T=getComputedStyle(E),C=S.compatMode==="CSS1Compat"&&parseFloat(T.marginLeft)+parseFloat(T.marginRight)||0,O=Math.abs(f.clientWidth-E.clientWidth-C),w=getComputedStyle(f).scrollbarGutter==="stable both-edges"?O/2:O;w<=e1&&(m-=w)}return{width:m,height:h,x:g,y}}function n1(o,l){const a=kl(o,!0,l==="fixed"),r=a.top+o.clientTop,c=a.left+o.clientLeft,f=Mi(o),d=o.clientWidth*f.x,m=o.clientHeight*f.y,h=c*f.x,g=r*f.y;return{width:d,height:m,x:h,y:g}}function wy(o,l,a){let r;if(l==="viewport"||l==="layoutViewport")r=t1(o,a,l);else if(l==="document")r=$E(wo(o));else if(Je(l))r=n1(l,a);else{const c=nb(o);r={x:l.x-c.x,y:l.y-c.y,width:l.width,height:l.height}}return Es(r)}function o1(o,l){const a=l.get(o);if(a)return a;let r=ja(o,[],!1).filter(m=>Je(m)&&Kt(m)!=="body"),c=null;const f=vn(o).position==="fixed";let d=f?Ro(o):o;for(;Je(d)&&!bo(d);){const m=vn(d),h=dd(d),g=c?c.position:f?"fixed":"";!h&&(g==="fixed"||g==="absolute"&&m.position==="static")?r=r.filter(b=>b!==d):c=m,d=Ro(d)}return l.set(o,r),r}function l1(o){let{element:l,boundary:a,rootBoundary:r,strategy:c}=o;const d=[...a==="clippingAncestors"?ks(l)?[]:o1(l,this._c):[].concat(a),r],m=wy(l,d[0],c);let h=m.top,g=m.right,y=m.bottom,b=m.left;for(let S=1;S<d.length;S++){const E=wy(l,d[S],c);h=So(E.top,h),g=zi(E.right,g),y=zi(E.bottom,y),b=So(E.left,b)}return{width:g-b,height:y-h,x:b,y:h}}function i1(o){const{width:l,height:a}=tb(o);return{width:l,height:a}}function a1(o,l,a){const r=dt(l),c=wo(l),f=a==="fixed",d=kl(o,!0,f,l);let m={scrollLeft:0,scrollTop:0};const h=xo(0);if((r||!f)&&((Kt(l)!=="body"||Ba(c))&&(m=Us(l)),r)){const S=kl(l,!0,f,l);h.x=S.x+l.clientLeft,h.y=S.y+l.clientTop}!r&&c&&(h.x=Gs(c));const g=c&&!r&&!f?ob(c,m):xo(0),y=d.left+m.scrollLeft-h.x-g.x,b=d.top+m.scrollTop-h.y-g.y;return{x:y,y:b,width:d.width,height:d.height}}function xf(o){return vn(o).position==="static"}function Ay(o,l){if(!dt(o)||vn(o).position==="fixed")return null;if(l)return l(o);let a=o.offsetParent;return wo(o)===a&&(a=a.ownerDocument.body),a}function lb(o,l){const a=yt(o);if(ks(o))return a;if(!dt(o)){let c=Ro(o);for(;c&&!bo(c);){if(Je(c)&&!xf(c))return c;c=Ro(c)}return a}let r=Ay(o,l);for(;r&&iT(r)&&xf(r);)r=Ay(r,l);return r&&bo(r)&&xf(r)&&!dd(r)?a:r||sT(o)||a}const r1=async function(o){const l=this.getOffsetParent||lb,a=this.getDimensions,r=await a(o.floating);return{reference:a1(o.reference,await l(o.floating),o.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function s1(o){return vn(o).direction==="rtl"}const u1={convertOffsetParentRelativeRectToViewportRelativeRect:JE,getDocumentElement:wo,getClippingRect:l1,getOffsetParent:lb,getElementRects:r1,getClientRects:WE,getDimensions:i1,getScale:Mi,isElement:Je,isRTL:s1};function ib(o,l){return o.x===l.x&&o.y===l.y&&o.width===l.width&&o.height===l.height}function c1(o,l,a){let r=null,c;const f=wo(o);function d(){var y;clearTimeout(c),(y=r)==null||y.disconnect(),r=null}function m(y,b){y===void 0&&(y=!1),b===void 0&&(b=1),d();const S=o.getBoundingClientRect(),{left:E,top:T,width:C,height:O}=S;if(y||l(),!C||!O)return;const w=is(T),D=is(f.clientWidth-(E+C)),A=is(f.clientHeight-(T+O)),M=is(E),U={rootMargin:-w+"px "+-D+"px "+-A+"px "+-M+"px",threshold:So(0,zi(1,b))||1};let j=!0;function k(W){const $=W[0].intersectionRatio;if(!ib(S,o.getBoundingClientRect()))return m();if($!==b){if(!j)return m();$?m(!1,$):c=setTimeout(()=>{m(!1,1e-7)},1e3)}j=!1}try{r=new IntersectionObserver(k,{...U,root:f.ownerDocument})}catch{r=new IntersectionObserver(k,U)}r.observe(o)}const h=yt(o),g=()=>m(a);return h.addEventListener("resize",g),m(!0),()=>{h.removeEventListener("resize",g),d()}}function My(o,l,a,r){r===void 0&&(r={});const{ancestorScroll:c=!0,ancestorResize:f=!0,elementResize:d=typeof ResizeObserver=="function",layoutShift:m=typeof IntersectionObserver=="function",animationFrame:h=!1}=r,g=Nd(o),y=c||f?[...g?ja(g):[],...l?ja(l):[]]:[];y.forEach(w=>{c&&w.addEventListener("scroll",a),f&&w.addEventListener("resize",a)});const b=g&&m?c1(g,a,f):null;let S=-1,E=null;d&&(E=new ResizeObserver(w=>{let[D]=w;D&&D.target===g&&E&&l&&(E.unobserve(l),cancelAnimationFrame(S),S=requestAnimationFrame(()=>{var A;(A=E)==null||A.observe(l)})),a()}),g&&!h&&E.observe(g),l&&E.observe(l));let T,C=h?kl(o):null;h&&O();function O(){const w=kl(o);C&&!ib(C,w)&&a(),C=w,T=requestAnimationFrame(O)}return a(),()=>{var w;y.forEach(D=>{c&&D.removeEventListener("scroll",a),f&&D.removeEventListener("resize",a)}),b?.(),(w=E)==null||w.disconnect(),E=null,h&&cancelAnimationFrame(T)}}const f1=GE,d1=XE,p1=PE,h1=QE,g1=KE,m1=(o,l,a)=>{const r=new Map,c=a??{},f={...u1,...c.platform,_c:r};return qE(o,l,{...c,platform:f})};var y1=typeof document<"u",v1=function(){},ys=y1?v.useLayoutEffect:v1;function Os(o,l){if(o===l)return!0;if(typeof o!=typeof l)return!1;if(typeof o=="function"&&o.toString()===l.toString())return!0;let a,r,c;if(o&&l&&typeof o=="object"){if(Array.isArray(o)){if(a=o.length,a!==l.length)return!1;for(r=a;r--!==0;)if(!Os(o[r],l[r]))return!1;return!0}if(c=Object.keys(o),a=c.length,a!==Object.keys(l).length)return!1;for(r=a;r--!==0;)if(!{}.hasOwnProperty.call(l,c[r]))return!1;for(r=a;r--!==0;){const f=c[r];if(!(f==="_owner"&&o.$$typeof)&&!Os(o[f],l[f]))return!1}return!0}return o!==o&&l!==l}function ab(o){return typeof window>"u"?1:(o.ownerDocument.defaultView||window).devicePixelRatio||1}function Dy(o,l){const a=ab(o);return Math.round(l*a)/a}function Tf(o){const l=v.useRef(o);return ys(()=>{l.current=o}),l}function b1(o){o===void 0&&(o={});const{placement:l="bottom",strategy:a="absolute",middleware:r=[],platform:c,elements:{reference:f,floating:d}={},transform:m=!0,whileElementsMounted:h,open:g}=o,[y,b]=v.useState({x:0,y:0,strategy:a,placement:l,middlewareData:{},isPositioned:!1}),[S,E]=v.useState(r);Os(S,r)||E(r);const[T,C]=v.useState(null),[O,w]=v.useState(null),D=v.useCallback(I=>{I!==U.current&&(U.current=I,C(I))},[]),A=v.useCallback(I=>{I!==j.current&&(j.current=I,w(I))},[]),M=f||T,H=d||O,U=v.useRef(null),j=v.useRef(null),k=v.useRef(y),W=h!=null,$=Tf(h),F=Tf(c),Y=Tf(g),ee=v.useCallback(()=>{if(!U.current||!j.current)return;const I={placement:l,strategy:a,middleware:S};F.current&&(I.platform=F.current),m1(U.current,j.current,I).then(Q=>{const ne={...Q,isPositioned:Y.current!==!1};le.current&&!Os(k.current,ne)&&(k.current=ne,qn.flushSync(()=>{b(ne)}))})},[S,l,a,F,Y]);ys(()=>{g===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,b(I=>({...I,isPositioned:!1})))},[g]);const le=v.useRef(!1);ys(()=>(le.current=!0,()=>{le.current=!1}),[]),ys(()=>{if(M&&(U.current=M),H&&(j.current=H),M&&H){if($.current)return $.current(M,H,ee);ee()}},[M,H,ee,$,W]);const K=v.useMemo(()=>({reference:U,floating:j,setReference:D,setFloating:A}),[D,A]),N=v.useMemo(()=>({reference:M,floating:H}),[M,H]),P=v.useMemo(()=>{const I={position:a,left:0,top:0};if(!N.floating)return I;const Q=Dy(N.floating,y.x),ne=Dy(N.floating,y.y);return m?{...I,transform:"translate("+Q+"px, "+ne+"px)",...ab(N.floating)>=1.5&&{willChange:"transform"}}:{position:a,left:Q,top:ne}},[a,m,N.floating,y.x,y.y]);return v.useMemo(()=>({...y,update:ee,refs:K,elements:N,floatingStyles:P}),[y,ee,K,N,P])}const S1=(o,l)=>{const a=f1(o);return{name:a.name,fn:a.fn,options:[o,l]}},x1=(o,l)=>{const a=d1(o);return{name:a.name,fn:a.fn,options:[o,l]}},T1=(o,l)=>({fn:g1(o).fn,options:[o,l]}),E1=(o,l)=>{const a=p1(o);return{name:a.name,fn:a.fn,options:[o,l]}},R1=(o,l)=>{const a=h1(o);return{name:a.name,fn:a.fn,options:[o,l]}};var Ef={exports:{}},Rf={};var Ny;function C1(){if(Ny)return Rf;Ny=1;var o=La();function l(b,S){return b===S&&(b!==0||1/b===1/S)||b!==b&&S!==S}var a=typeof Object.is=="function"?Object.is:l,r=o.useState,c=o.useEffect,f=o.useLayoutEffect,d=o.useDebugValue;function m(b,S){var E=S(),T=r({inst:{value:E,getSnapshot:S}}),C=T[0].inst,O=T[1];return f(function(){C.value=E,C.getSnapshot=S,h(C)&&O({inst:C})},[b,E,S]),c(function(){return h(C)&&O({inst:C}),b(function(){h(C)&&O({inst:C})})},[b]),d(E),E}function h(b){var S=b.getSnapshot;b=b.value;try{var E=S();return!a(b,E)}catch{return!0}}function g(b,S){return S()}var y=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?g:m;return Rf.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:y,Rf}var zy;function rb(){return zy||(zy=1,Ef.exports=C1()),Ef.exports}var zd=rb(),Cf={exports:{}},Of={};var _y;function O1(){if(_y)return Of;_y=1;var o=La(),l=rb();function a(g,y){return g===y&&(g!==0||1/g===1/y)||g!==g&&y!==y}var r=typeof Object.is=="function"?Object.is:a,c=l.useSyncExternalStore,f=o.useRef,d=o.useEffect,m=o.useMemo,h=o.useDebugValue;return Of.useSyncExternalStoreWithSelector=function(g,y,b,S,E){var T=f(null);if(T.current===null){var C={hasValue:!1,value:null};T.current=C}else C=T.current;T=m(function(){function w(U){if(!D){if(D=!0,A=U,U=S(U),E!==void 0&&C.hasValue){var j=C.value;if(E(j,U))return M=j}return M=U}if(j=M,r(A,U))return j;var k=S(U);return E!==void 0&&E(j,k)?(A=U,j):(A=U,M=k)}var D=!1,A,M,H=b===void 0?null:b;return[function(){return w(y())},H===null?void 0:function(){return w(H())}]},[y,b,S,E]);var O=c(g,T[0],T[1]);return d(function(){C.hasValue=!0,C.value=O},[O]),h(O),O},Of}var Hy;function w1(){return Hy||(Hy=1,Cf.exports=O1()),Cf.exports}var A1=w1();const M1=Cd(19),D1=M1?z1:_1;function sb(o,l,a,r,c){return D1(o,l,a,r,c)}function N1(o,l,a,r,c){const f=v.useCallback(()=>l(o.getSnapshot(),a,r,c),[o,l,a,r,c]);return zd.useSyncExternalStore(o.subscribe,f,f)}Kx({before(o){o.syncIndex=0,o.didInitialize||(o.syncTick=1,o.syncHooks=[],o.didChangeStore=!0,o.getSnapshot=()=>{let l=!1;for(let a=0;a<o.syncHooks.length;a+=1){const r=o.syncHooks[a],c=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,c)||(l=!0,r.value=c)}return l&&(o.syncTick+=1),o.syncTick})},after(o){o.syncHooks.length>0&&(o.didChangeStore&&(o.didChangeStore=!1,o.subscribe=l=>{const a=new Set;for(const c of o.syncHooks)a.add(c.store);const r=[];for(const c of a)r.push(c.subscribe(l));return()=>{for(const c of r)c()}}),zd.useSyncExternalStore(o.subscribe,o.getSnapshot,o.getSnapshot))}});function z1(o,l,a,r,c){const f=Xx();if(!f)return N1(o,l,a,r,c);const d=f.syncIndex;f.syncIndex+=1;let m;return f.didInitialize?(m=f.syncHooks[d],(m.store!==o||m.selector!==l||!Object.is(m.a1,a)||!Object.is(m.a2,r)||!Object.is(m.a3,c))&&(m.store!==o&&(f.didChangeStore=!0),m.store=o,m.selector=l,m.a1=a,m.a2=r,m.a3=c,m.value=l(o.getSnapshot(),a,r,c))):(m={store:o,selector:l,a1:a,a2:r,a3:c,value:l(o.getSnapshot(),a,r,c)},f.syncHooks.push(m)),m.value}function _1(o,l,a,r,c){return A1.useSyncExternalStoreWithSelector(o.subscribe,o.getSnapshot,o.getSnapshot,f=>l(f,a,r,c))}class H1{static create(l){return new this(l)}constructor(l){this.state=l,this.listeners=new Set,this.updateTick=0}subscribe=l=>(this.listeners.add(l),()=>{this.listeners.delete(l)});getSnapshot=()=>this.state;setState(l){if(this.state===l)return;this.state=l,this.updateTick+=1;const a=this.updateTick;for(const r of this.listeners){if(a!==this.updateTick)return;r(l)}}update(l){for(const a in l)if(!Object.is(this.state[a],l[a])){this.setState({...this.state,...l});return}}set(l,a){Object.is(this.state[l],a)||this.setState({...this.state,[l]:a})}notifyAll(){const l={...this.state};this.setState(l)}use(l,a,r,c){return sb(this,l,a,r,c)}}class Ia extends H1{constructor(l,a={},r){super(l),this.context=a,this.selectors=r}useSyncedValue(l,a){v.useDebugValue(l);const r=this;be(()=>{r.state[l]!==a&&r.set(l,a)},[r,l,a])}useSyncedValueWithCleanup(l,a){const r=this;be(()=>(r.state[l]!==a&&r.set(l,a),()=>{r.set(l,void 0)}),[r,l,a])}useSyncedValues(l){const a=this,r=Object.values(l);be(()=>{a.update(l)},[a,...r])}useControlledProp(l,a){v.useDebugValue(l);const r=this,c=a!==void 0;be(()=>{c&&!Object.is(r.state[l],a)&&r.setState({...r.state,[l]:a})},[r,l,a,c])}select(l,a,r,c){const f=this.selectors[l];return f(this.state,a,r,c)}useState(l,a,r,c){return v.useDebugValue(l),sb(this,this.selectors[l],a,r,c)}useContextCallback(l,a){v.useDebugValue(l);const r=Oe(a??ad);this.context[l]=r}useStateSetter(l){const a=v.useRef(void 0);return a.current===void 0&&(a.current=r=>{this.set(l,r)}),a.current}observe(l,a){let r;typeof l=="function"?r=l:r=this.selectors[l];let c=r(this.state);return a(c,c,this),this.subscribe(f=>{const d=r(f);if(!Object.is(c,d)){const m=c;c=d,a(d,m,this)}})}}const j1={open:o=>o.open,transitionStatus:o=>o.transitionStatus,domReferenceElement:o=>o.domReferenceElement,referenceElement:o=>o.positionReference??o.referenceElement,floatingElement:o=>o.floatingElement,floatingId:o=>o.floatingId};class ub extends Ia{constructor(l){const{syncOnly:a,nested:r,onOpenChange:c,triggerElements:f,...d}=l;super({...d,positionReference:d.referenceElement,domReferenceElement:d.referenceElement},{onOpenChange:c,dataRef:{current:{}},events:Fv(),nested:r,triggerElements:f},j1),this.syncOnly=a}syncOpenEvent=(l,a)=>{(!l||!this.state.open||a!=null&&lT(a))&&(this.context.dataRef.current.openEvent=l?a:void 0)};dispatchOpenChange=(l,a)=>{this.syncOpenEvent(l,a.event);const r={open:l,reason:a.reason,nativeEvent:a.event,nested:this.context.nested,triggerElement:a.trigger};this.context.events.emit("openchange",r)};setOpen=(l,a)=>{if(this.syncOnly){this.context.onOpenChange?.(l,a);return}this.dispatchOpenChange(l,a),this.context.onOpenChange?.(l,a)}}function cb(o){const{popupStore:l,treatPopupAsFloatingElement:a=!1,floatingRootContext:r,floatingId:c,nested:f,onOpenChange:d}=o,m=l.useState("open"),h=l.useState("activeTriggerElement"),g=l.useState(a?"popupElement":"positionerElement"),y=l.context.triggerElements,b=d,S=v.useRef(null);r===void 0&&S.current===null&&(S.current=new ub({open:m,transitionStatus:void 0,referenceElement:h,floatingElement:g,triggerElements:y,onOpenChange:b,floatingId:c,syncOnly:!0,nested:f}));const E=r??S.current;return l.useSyncedValue("floatingId",c),be(()=>{const T={open:m,floatingId:c,referenceElement:h,floatingElement:g};Je(h)&&(T.domReferenceElement=h),E.state.positionReference===E.state.referenceElement&&(T.positionReference=h),E.update(T)},[m,c,h,g,E]),E.context.onOpenChange=b,E.context.nested=f,E}function fb(o,l=!1,a=!1,r=!1){const[c,f]=v.useState(o&&l?"idle":void 0),[d,m]=v.useState(o&&!r);return o&&!d&&(m(!0),f("starting")),!o&&d&&c!=="ending"&&!a&&f("ending"),!o&&!d&&c==="ending"&&f(void 0),be(()=>{if(!o&&d&&c!=="ending"&&a){const h=Zn.request(()=>{f("ending")});return()=>{Zn.cancel(h)}}},[o,d,c,a]),be(()=>{if(!o||l)return;const h=Zn.request(()=>{f(void 0)});return()=>{Zn.cancel(h)}},[l,o]),be(()=>{if(!o||!l)return;o&&d&&c!=="idle"&&f("starting");const h=Zn.request(()=>{f("idle")});return()=>{Zn.cancel(h)}},[l,o,d,c]),{mounted:d,setMounted:m,transitionStatus:c}}let rs=null;function k1(o){if(!rs){const l=[];rs=l,queueMicrotask(()=>{rs=null,qn.flushSync(()=>{for(const a of l)a()})})}rs.push(o)}function _d(o,l=!1,a=!1){const r=ka();return Oe((c,f=null)=>{r.cancel();const d=yo(o);if(d==null)return;const m=d,h=()=>{if(!a){qn.flushSync(c);return}k1(()=>{f?.aborted||c()})};if(typeof m.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){c();return}function g(){Promise.all(m.getAnimations().map(y=>y.finished)).then(()=>{f?.aborted||h()},()=>{if(f?.aborted)return;if(m.getAnimations().some(b=>b.pending||b.playState!=="finished")){g();return}h()})}if(l){const y=yv;if(!m.hasAttribute(y)){r.request(g);return}const b=new MutationObserver(()=>{m.hasAttribute(y)||(b.disconnect(),g())});b.observe(m,{attributes:!0,attributeFilter:[y]}),f?.addEventListener("abort",()=>b.disconnect(),{once:!0});return}r.request(g)})}function Hi(o){const{enabled:l=!0,open:a,ref:r,batch:c=!1,onComplete:f}=o,d=Oe(f),m=_d(r,a,c);v.useEffect(()=>{if(!l)return;const h=new AbortController;return m(d,h.signal),()=>{h.abort()}},[l,a,d,m])}const Hd={tabIndex:-1,[Yf]:""};function U1(o){return l=>l==="touch"?o.current:!0}function db(o,l=!1){const a=jl(),r=Ll()!=null,c=Zt(()=>o(a,r)).current;return cb({popupStore:c,treatPopupAsFloatingElement:l,floatingRootContext:c.state.floatingRootContext,floatingId:a,nested:r,onOpenChange:c.setOpen}),c}function jd({handle:o,store:l}){return be(()=>o.attachStore(l),[o,l]),null}function jy(o){const l=o.context.triggerElements.size;o.select("open")&&o.state.triggerCount!==l&&o.set("triggerCount",l)}function L1(o,l){const a=v.useRef(null);return Oe(r=>{const c=a.current;if(c!==null){if(c.element===r&&c.store===l&&c.id===o)return;a.current=null;const f=c.store;f.context.triggerElements.getById(c.id)===c.element&&(f.context.triggerElements.delete(c.id),jy(f))}r!==null&&o!==void 0&&(a.current={store:l,id:o,element:r},l.context.triggerElements.add(o,r),jy(l))})}function kd(o,l,a,r=!1){let c=o.preventUnmountingOnClose;l?c=!1:r&&(c=!0);const f=a?.id??null;let d=o.activeTriggerId,m=o.activeTriggerElement;return(f||l)&&(d=f,m=a??null),{open:l,preventUnmountingOnClose:c,activeTriggerId:d,activeTriggerElement:m}}function pb(o){let l=!1;return o.preventUnmountOnClose=()=>{l=!0},()=>l}function B1(o,l,a,r={}){const c=a.reason,f=c===Ut,d=l&&c===Oi,m=!l&&(c===_i||c===Ps),h=pb(a);if(o.context.onOpenChange?.(l,a),a.isCanceled)return;r.onBeforeDispatch?.(),o.state.floatingRootContext.dispatchOpenChange(l,a);const g=()=>{const y=kd(o.state,l,a.trigger,h()),b={...r.extraState,...y};d?b.instantType="focus":m?b.instantType="dismiss":f&&(b.instantType=void 0),o.update(b)};f?qn.flushSync(g):g()}function hb(o,l,a,r){const c=a.useState("isMountedByTrigger",o),f=L1(o,a),d=Oe(h=>{const g=a.select("open"),y=a.select("activeTriggerId");if(y===o){const b={activeTriggerElement:h,...g?r:null};a.update(b);return}if(y==null&&g){const b={activeTriggerId:o??null,activeTriggerElement:h,...r};a.update(b)}}),m=Oe(h=>{f(h),h&&d(h)});return be(()=>(m(l.current),()=>m(null)),[m,l,a,o]),be(()=>{if(c){const h={activeTriggerElement:l.current,...r};a.update(h)}},[c,a,l,...Object.values(r)]),{registerTrigger:m,isMountedByThisTrigger:c}}function Ud(o,l={}){const{closeOnActiveTriggerUnmount:a=!1}=l,r=v.useRef(null),c=o.useState("open"),f=o.useState("triggerCount"),d=o.useState("activeTriggerId"),m=o.useState("activeTriggerElement");be(()=>{if(!c){r.current=null,o.state.triggerCount!==0&&o.set("triggerCount",0);return}const h=o.context.triggerElements.size,g={};o.state.triggerCount!==h&&(g.triggerCount=h);const y=o.select("activeTriggerId");let b=null;if(y){const S=o.context.triggerElements.getById(y);if(S)r.current=y,S!==o.state.activeTriggerElement&&(g.activeTriggerElement=S);else{for(const[E,T]of o.context.triggerElements.entries())if(T===o.state.activeTriggerElement){g.activeTriggerId=E,g.activeTriggerElement=T,r.current=E;break}g.activeTriggerId===void 0&&(r.current===y?b=y:r.current=null)}}else r.current=null;if(!b&&!y&&h===1){const S=o.context.triggerElements.entries().next();if(!S.done){const[E,T]=S.value;g.activeTriggerId=E,g.activeTriggerElement=T,r.current=E}}(g.triggerCount!==void 0||g.activeTriggerId!==void 0||g.activeTriggerElement!==void 0)&&o.update(g),b&&a&&queueMicrotask(()=>{if(o.select("open")&&o.select("activeTriggerId")===b&&!o.context.triggerElements.getById(b)){const S=Ke(qs);o.setOpen(!1,S),S.isCanceled||o.update({activeTriggerId:null,activeTriggerElement:null})}})},[c,o,f,d,m,a])}function Ld(o,l,a,r){const{mounted:c,setMounted:f,transitionStatus:d}=fb(o,!1,!1,r),m=l.useState("preventUnmountingOnClose"),h=o?!1:m;l.useSyncedValues({mounted:c,transitionStatus:d,preventUnmountingOnClose:h});const g=Oe(()=>{f(!1),l.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),a?.(),l.context.onOpenChangeComplete?.(!1)});return Hi({enabled:c&&!o&&!h,open:o,ref:l.context.popupRef,onComplete(){o||g()}}),{forceUnmount:g,transitionStatus:d}}function Bd(o,l){o.useSyncedValues(l),be(()=>()=>{o.update({activeTriggerProps:Ct,inactiveTriggerProps:Ct,popupProps:Ct})},[o])}function Y1(o,l){be(()=>{!l&&o.state.openMethod!==null&&o.set("openMethod",null)},[l,o]),be(()=>()=>{o.state.openMethod!==null&&o.set("openMethod",null)},[o])}class Yd{constructor(){this.idMap=new Map}add(l,a){this.idMap.set(l,a)}delete(l){this.idMap.delete(l)}hasElement(l){for(const a of this.idMap.values())if(a===l)return!0;return!1}hasMatchingElement(l){for(const a of this.idMap.values())if(l(a))return!0;return!1}getById(l){return this.idMap.get(l)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}function Id(o,l,a=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new ub({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:o,floatingId:l,syncOnly:!0,nested:a,onOpenChange:void 0}),floatingId:l,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Ct,inactiveTriggerProps:Ct,popupProps:Ct}}const _a=o=>o.triggerIdProp??o.activeTriggerId,qd=o=>o.openProp??o.open,ky=o=>(o.popupElement?.id??o.floatingId)||void 0;function gb(o,l){return l!==void 0&&qd(o)&&_a(o)===l}function I1(o,l){return gb(o,l)?!0:l!==void 0&&qd(o)&&_a(o)==null&&o.triggerCount===1}const Pd={open:qd,mounted:o=>o.mounted,transitionStatus:o=>o.transitionStatus,floatingRootContext:o=>o.floatingRootContext,triggerCount:o=>o.triggerCount,preventUnmountingOnClose:o=>o.preventUnmountingOnClose,payload:o=>o.payload,activeTriggerId:_a,activeTriggerElement:o=>o.mounted?o.activeTriggerElement:null,popupId:ky,isTriggerActive:(o,l)=>l!==void 0&&_a(o)===l,isOpenedByTrigger:(o,l)=>gb(o,l),isMountedByTrigger:(o,l)=>l!==void 0&&_a(o)===l&&o.mounted,triggerProps:(o,l)=>l?o.activeTriggerProps:o.inactiveTriggerProps,triggerPopupId:(o,l)=>I1(o,l)?ky(o):void 0,popupProps:o=>o.popupProps,popupElement:o=>o.popupElement,positionerElement:o=>o.positionerElement};function mb(o){const l=v.useCallback(r=>o===void 0?ad:o.subscribeStore(r),[o]),a=v.useCallback(()=>o===void 0?void 0:o.store,[o]);return zd.useSyncExternalStore(l,a,()=>o?.serverStore)}function q1(o){return P1(o,o.rootContext)}function P1(o,l){const{nodeId:a,externalTree:r}=o,c=l.useState("referenceElement"),f=l.useState("floatingElement"),d=l.useState("domReferenceElement"),m=l.useState("open"),h=l.useState("floatingId"),[g,y]=v.useState(null),[b,S]=v.useState(void 0),[E,T]=v.useState(void 0),C=v.useRef(null),O=cl(r),w=v.useMemo(()=>({reference:c,floating:f,domReference:d}),[c,f,d]),D=b1({...o,elements:{...w,...g&&{reference:g}}}),A=Je(b)?b:null,M=E===void 0?l.state.floatingElement:E;l.useSyncedValue("referenceElement",b??null),l.useSyncedValue("domReferenceElement",b===void 0?d:A),l.useSyncedValue("floatingElement",M);const H=v.useCallback(F=>{const Y=Je(F)?{getBoundingClientRect:()=>F.getBoundingClientRect(),getClientRects:()=>F.getClientRects(),contextElement:F}:F;y(Y),D.refs.setReference(Y)},[D.refs]),U=v.useCallback(F=>{(Je(F)||F===null)&&(C.current=F,S(F)),(Je(D.refs.reference.current)||D.refs.reference.current===null||F!==null&&!Je(F))&&D.refs.setReference(F)},[D.refs,S]),j=v.useCallback(F=>{T(F),D.refs.setFloating(F)},[D.refs]),k=v.useMemo(()=>({...D.refs,setReference:U,setFloating:j,setPositionReference:H,domReference:C}),[D.refs,U,j,H]),W=v.useMemo(()=>({...D.elements,domReference:d}),[D.elements,d]),$=v.useMemo(()=>({...D,dataRef:l.context.dataRef,open:m,onOpenChange:l.setOpen,events:l.context.events,floatingId:h,refs:k,elements:W,nodeId:a,rootStore:l}),[D,k,W,a,l,m,h]);return be(()=>{d&&(C.current=d)},[d]),be(()=>{l.context.dataRef.current.floatingContext=$;const F=O?.nodesRef.current.find(Y=>Y.id===a);F&&(F.context=$)}),v.useMemo(()=>({...D,context:$,refs:k,elements:W,rootStore:l}),[D,k,W,$,l])}const wf=rd&&ul;function yb(o,l={}){const{enabled:a=!0,delay:r}=l,c="rootStore"in o?o.rootStore:o,{events:f,dataRef:d}=c.context,m=v.useRef(!1),h=v.useRef(null),g=v.useRef(!0),y=Jt();v.useEffect(()=>{const S=c.select("domReferenceElement");if(!a)return;const E=yt(S);function T(){const w=c.select("domReferenceElement");!c.select("open")&&dt(w)&&w===Ht(Xe(w))&&(m.current=!0,h.current=w)}function C(){g.current=!0}function O(){g.current=!1}return In(Ye(E,"blur",T),wf&&Ye(E,"keydown",C,!0),wf&&Ye(E,"pointerdown",O,!0))},[c,a]),v.useEffect(()=>{if(!a)return;function S(E){if(E.reason===_i||E.reason===Ps){const T=c.select("domReferenceElement");Je(T)&&(h.current=T,m.current=!0)}}return f.on("openchange",S),()=>{f.off("openchange",S)}},[f,a,c]);const b=v.useMemo(()=>{function S(){m.current=!1,h.current=null}return{onMouseLeave(){S()},onFocus(E){const T=E.currentTarget;if(m.current){if(h.current===T)return;S()}const C=bt(E.nativeEvent);if(Je(C)){if(wf&&!E.relatedTarget){if(!g.current&&!Is(C))return}else if(!Ss(C))return}const O=bs(E.relatedTarget,c.context.triggerElements),{nativeEvent:w,currentTarget:D}=E,A=typeof r=="function"?r():r;if(c.select("open")&&O||A===0||A===void 0){c.setOpen(!0,Ke(Oi,w,D));return}y.start(A,()=>{m.current||c.setOpen(!0,Ke(Oi,w,D))})},onBlur(E){S();const T=E.relatedTarget,C=E.nativeEvent,O=Je(T)&&T.hasAttribute(Ua("focus-guard"))&&T.getAttribute("data-type")==="outside";y.start(0,()=>{const w=c.select("domReferenceElement"),D=Ht(Xe(w));!T&&D===w||De(d.current.floatingContext?.refs.floating.current,D)||De(w,D)||O||bs(T??D,c.context.triggerElements)||c.setOpen(!1,Ke(Oi,C))})}}},[d,r,c,y]);return v.useMemo(()=>a?{reference:b,trigger:b}:{},[a,b])}class Vd{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new yn,this.restTimeout=new yn,this.handleCloseOptions=void 0}static create(){return new Vd}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}const ws=new WeakMap;function As(o){if(!o.performedPointerEventsMutation)return;const l=o.pointerEventsScopeElement;l&&ws.get(l)===o&&(o.pointerEventsScopeElement?.style.removeProperty("pointer-events"),o.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),o.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),ws.delete(l)),o.performedPointerEventsMutation=!1,o.pointerEventsScopeElement=null,o.pointerEventsReferenceElement=null,o.pointerEventsFloatingElement=null}function vb(o,l){const{scopeElement:a,referenceElement:r,floatingElement:c}=l,f=ws.get(a);f&&f!==o&&As(f),As(o),o.performedPointerEventsMutation=!0,o.pointerEventsScopeElement=a,o.pointerEventsReferenceElement=r,o.pointerEventsFloatingElement=c,ws.set(a,o),a.style.pointerEvents="none",r.style.pointerEvents="auto",c.style.pointerEvents="auto"}function Gd(o){const l=o.context.dataRef.current,a=Zt(()=>l.hoverInteractionState??Vd.create()).current;return l.hoverInteractionState||(l.hoverInteractionState=a),zs(l.hoverInteractionState.disposeEffect),l.hoverInteractionState}function bb(o,l={}){const{enabled:a=!0,closeDelay:r=0,nodeId:c}=l,f="rootStore"in o?o.rootStore:o,d=f.useState("open"),m=f.useState("floatingElement"),h=f.useState("domReferenceElement"),{dataRef:g}=f.context,y=cl(),b=Ll(),S=Gd(f),E=Jt(),T=Oe(()=>bv(g.current.openEvent?.type,S.interactedInside)),C=Oe(()=>CT(g.current.openEvent?.type)),O=Oe(()=>{As(S)});be(()=>{d||(S.pointerType=void 0,S.restTimeoutPending=!1,S.interactedInside=!1,O())},[d,S,O]),v.useEffect(()=>O,[O]),be(()=>{if(a&&d&&S.handleCloseOptions?.blockPointerEvents&&C()&&Je(h)&&m){const w=h,D=m,A=Xe(m),M=y?.nodesRef.current.find(k=>k.id===b)?.context?.elements.floating;M&&(M.style.pointerEvents="");const H=S.pointerEventsScopeElement!==D?S.pointerEventsScopeElement:null,U=M!==D?M:null,j=S.handleCloseOptions?.getScope?.()??H??U??w.closest("[data-rootownerid]")??A.body;return vb(S,{scopeElement:j,referenceElement:w,floatingElement:D}),()=>{O()}}},[a,d,h,m,S,C,y,b,O]),v.useEffect(()=>{if(!a)return;function w(){return!!(y&&b&&rl(y.nodesRef.current,b).length>0)}function D(k){const W=zl(r,"close",S.pointerType),$=()=>{f.setOpen(!1,Ke(Ut,k)),y?.events.emit("floating.closed",k)};W?S.openChangeTimeout.start(W,$):(S.openChangeTimeout.clear(),$())}function A(k){const W=bt(k);if(!ET(W)){S.interactedInside=!1;return}S.interactedInside=W?.closest("[aria-haspopup]")!=null}function M(){S.openChangeTimeout.clear(),E.clear(),y?.events.off("floating.closed",U),O()}function H(k){if(w()&&y){y.events.on("floating.closed",U);return}if(bs(k.relatedTarget,f.context.triggerElements))return;const W=g.current.floatingContext?.nodeId??c,$=k.relatedTarget;if(!(y&&W&&Je($)&&rl(y.nodesRef.current,W,!1).some(Y=>De(Y.context?.elements.floating,$)))){if(S.handler){S.handler(k);return}O(),C()&&!T()&&D(k)}}function U(k){!y||!b||w()||E.start(0,()=>{y.events.off("floating.closed",U),f.setOpen(!1,Ke(Ut,k)),y.events.emit("floating.closed",k)})}const j=m;return In(j&&Ye(j,"mouseenter",M),j&&Ye(j,"mouseleave",H),j&&Ye(j,"pointerdown",A,!0),()=>{y?.events.off("floating.closed",U)})},[a,m,f,g,r,c,C,T,O,S,y,b,E])}const V1={current:null};function Sb(o,l={}){const{enabled:a=!0,delay:r=0,handleClose:c=null,mouseOnly:f=!1,restMs:d=0,move:m=!0,triggerElementRef:h=V1,externalTree:g,isActiveTrigger:y=!0,getHandleCloseContext:b,isClosing:S,shouldOpen:E,guardStaleOpen:T=!1}=l,C="rootStore"in o?o.rootStore:o,{dataRef:O,events:w}=C.context,D=cl(g),A=Gd(C),M=v.useRef(!1),H=jt(c),U=jt(r),j=jt(d),k=jt(a),W=jt(E),$=jt(S),F=Oe(()=>bv(O.current.openEvent?.type,A.interactedInside)),Y=Oe(()=>W.current?.()!==!1),ee=Oe((N,P,I)=>{const Q=C.context.triggerElements;if(Q.hasElement(P))return!N||!De(N,P);if(!Je(I))return!1;const ne=I;return Q.hasMatchingElement(R=>De(R,ne))&&(!N||!De(N,ne))}),le=Oe(()=>{if(!A.handler)return;Xe(C.select("domReferenceElement")).removeEventListener("mousemove",A.handler),A.handler=void 0}),K=Oe(()=>{As(A)});return y&&(A.handleCloseOptions=c?.__options),v.useEffect(()=>le,[le]),v.useEffect(()=>{if(!a)return;function N(P){P.open?M.current=!1:(M.current=P.reason===Ut,le(),A.openChangeTimeout.clear(),A.restTimeout.clear(),A.blockMouseMove=!0,A.restTimeoutPending=!1)}return w.on("openchange",N),()=>{w.off("openchange",N)}},[a,w,A,le]),v.useEffect(()=>{if(!a)return;function N(B,J=!0){const V=zl(U.current,"close",A.pointerType);V?A.openChangeTimeout.start(V,()=>{C.setOpen(!1,Ke(Ut,B)),D?.events.emit("floating.closed",B)}):J&&(A.openChangeTimeout.clear(),C.setOpen(!1,Ke(Ut,B)),D?.events.emit("floating.closed",B))}const P=h.current??(y?C.select("domReferenceElement"):null);if(!Je(P))return;function I(B){if(A.openChangeTimeout.clear(),A.blockMouseMove=!1,f&&!ll(A.pointerType))return;const J=ay(j.current),V=zl(U.current,"open",A.pointerType),oe=bt(B),ie=B.currentTarget??null,he=C.select("domReferenceElement");let ue=ie;if(Je(oe)&&!C.context.triggerElements.hasElement(oe)){for(const xe of C.context.triggerElements.elements())if(De(xe,oe)){ue=xe;break}}Je(ie)&&Je(he)&&!C.context.triggerElements.hasElement(ie)&&De(ie,he)&&(ue=he);const pe=ue==null?!1:ee(he,ue,oe),Re=C.select("open"),ze=$.current?.()??C.select("transitionStatus")==="ending",ve=!Re&&ze&&M.current,ge=!pe&&Je(ue)&&Je(he)&&De(he,ue)&&ve,_e=J>0&&!V,ke=pe&&(Re||ve)||ge,Pe=!Re||pe;if(ke){Y()&&C.setOpen(!0,Ke(Ut,B,ue));return}_e||(V?A.openChangeTimeout.start(V,()=>{Pe&&Y()&&C.setOpen(!0,Ke(Ut,B,ue))}):Pe&&Y()&&C.setOpen(!0,Ke(Ut,B,ue)))}function Q(B){if(F()){K();return}le();const J=C.select("domReferenceElement"),V=Xe(J);A.restTimeout.clear(),A.restTimeoutPending=!1;const oe=O.current.floatingContext??b?.();if(bs(B.relatedTarget,C.context.triggerElements))return;if(H.current&&oe){C.select("open")||A.openChangeTimeout.clear();const he=h.current;A.handler=H.current({...oe,tree:D,x:B.clientX,y:B.clientY,onClose(){K(),le(),k.current&&!F()&&he===C.select("domReferenceElement")&&N(B,!0)}}),V.addEventListener("mousemove",A.handler),A.handler(B);return}(A.pointerType!=="touch"||!De(C.select("floatingElement"),B.relatedTarget))&&N(B)}function ne(B){De(P,B.relatedTarget)||(A.openChangeTimeout.clear(),A.restTimeout.clear(),A.restTimeoutPending=!1)}const R=T?Ye(P,"mouseout",ne):void 0;return m?In(Ye(P,"mousemove",I,{once:!0}),Ye(P,"mouseenter",I),Ye(P,"mouseleave",Q),R):In(Ye(P,"mouseenter",I),Ye(P,"mouseleave",Q),R)},[le,K,O,U,C,a,H,A,y,ee,F,f,m,j,h,D,k,b,$,Y,T]),v.useMemo(()=>{if(!a)return;function N(P){A.pointerType=P.pointerType}return{onPointerDown:N,onPointerEnter:N,onMouseMove(P){const{nativeEvent:I}=P,Q=P.currentTarget,ne=C.select("domReferenceElement"),R=C.select("open"),B=ee(ne,Q,P.target);if(f&&!ll(A.pointerType))return;if(R&&B&&A.handleCloseOptions?.blockPointerEvents){const oe=C.select("floatingElement");if(oe){const ie=A.handleCloseOptions?.getScope?.()??Q.ownerDocument.body;vb(A,{scopeElement:ie,referenceElement:Q,floatingElement:oe})}}const J=ay(j.current);if(R&&!B||J===0||!B&&A.restTimeoutPending&&P.movementX**2+P.movementY**2<2)return;A.restTimeout.clear();function V(){if(A.restTimeoutPending=!1,F())return;const oe=C.select("open");!A.blockMouseMove&&(!oe||B)&&Y()&&C.setOpen(!0,Ke(Ut,I,Q))}A.pointerType==="touch"?qn.flushSync(()=>{V()}):B&&R?V():(A.restTimeoutPending=!0,A.restTimeout.start(J,V))}}},[a,A,F,ee,f,C,j,Y])}const G1="Escape";function Uy(o){return ul&&o.movementX===0&&o.movementY===0}function Xs(o,l,a){switch(o){case"vertical":return l;case"horizontal":return a;default:return l||a}}function ss(o,l){return Xs(l,o===mv||o===hd,o===Ls||o===Bs)}function Af(o,l,a){return Xs(l,o===hd,a?o===Ls:o===Bs)||o==="Enter"||o===" "||o===""}function X1(o,l,a){return Xs(l,a?o===Ls:o===Bs,o===hd)}function K1(o,l,a,r){const c=a?o===Bs:o===Ls,f=o===mv;return l==="both"||l==="horizontal"&&r?o===G1:Xs(l,c,f)}function Q1(o,l){const{listRef:a,activeIndex:r,onNavigate:c=()=>{},enabled:f=!0,selectedIndex:d=null,allowEscape:m=!1,loopFocus:h=!1,nested:g=!1,rtl:y=!1,virtual:b=!1,focusItemOnOpen:S="auto",focusItemOnHover:E=!0,openOnArrowKeyDown:T=!0,disabledIndices:C=void 0,orientation:O="vertical",parentOrientation:w,id:D,resetOnPointerLeave:A=!0,externalTree:M,grid:H}=l,U=H!=null,j="rootStore"in o?o.rootStore:o,k=j.useState("open"),W=j.useState("floatingElement"),$=j.useState("domReferenceElement"),F=j.context.dataRef,Y=Pf(W),ee=qf($),le=jt(Y),K=Ll(),N=cl(M),P=v.useRef(S),I=v.useRef(d??-1),Q=v.useRef(null),ne=v.useRef(!0),R=Oe(fe=>{c(I.current===-1?null:I.current,fe)}),B=v.useRef(!!W),J=v.useRef(k),V=v.useRef(!1),oe=v.useRef(!1),ie=v.useRef(null),he=jt(C),ue=jt(k),pe=jt(d),Re=jt(A),ze=ka(),ve=ka(),ge=Oe(()=>{function fe(ye){b?N?.events.emit("virtualfocus",ye):ie.current=ms(ye,{sync:V.current,preventScroll:!0})}const me=a.current[I.current],de=oe.current;me&&fe(me),(V.current?ye=>ye():ye=>ze.request(ye))(()=>{const ye=a.current[I.current]||me;if(!ye)return;me||fe(ye),Te&&(de||!ne.current)&&ye.scrollIntoView?.({block:"nearest",inline:"nearest"})})});be(()=>{F.current.orientation=O},[F,O]),be(()=>{f&&(k&&W?(I.current=d??-1,P.current&&d!=null&&(oe.current=!0,R())):B.current&&(I.current=-1,R()))},[f,k,W,d,R]),be(()=>{if(f){if(!k){V.current=!1;return}if(W)if(r==null){if(V.current=!1,pe.current!=null)return;if(B.current&&(I.current=-1,ge()),(!J.current||!B.current)&&P.current&&(Q.current!=null||P.current===!0&&Q.current==null)){let fe=0;const me=()=>{a.current[0]==null?(fe<2&&(fe?ae=>ve.request(ae):queueMicrotask)(me),fe+=1):(I.current=Q.current==null||Af(Q.current,O,y)||g?gs(a):Xf(a),Q.current=null,R())};me()}}else za(a.current,r)||(I.current=r,ge(),oe.current=!1)}},[f,k,W,r,pe,g,a,O,y,R,ge,ve]),be(()=>{if(!f||W||!N||b||!B.current)return;const fe=N.nodesRef.current,me=fe.find(ye=>ye.id===K)?.context?.elements.floating,de=Ht(Xe($??me??null)),ae=fe.some(ye=>ye.context&&De(ye.context.elements.floating,de));me&&!ae&&ne.current&&me.focus({preventScroll:!0})},[f,W,$,N,K,b]),be(()=>{J.current=k,B.current=!!W}),be(()=>{k||(Q.current=null,P.current=S)},[k,S]);const _e=r!=null,ke=Oe(fe=>{if(!ue.current)return;const me=a.current.indexOf(fe.currentTarget);me!==-1&&(I.current!==me||r!==me)&&(I.current=me,R(fe))}),Pe=Oe(()=>w??N?.nodesRef.current.find(fe=>fe.id===K)?.context?.dataRef?.current.orientation),xe=Oe(()=>gs(a,he.current)),Ue=Oe(fe=>{if(ne.current=!1,V.current=!0,fe.which===229||!ue.current&&fe.currentTarget===le.current)return;if(g&&K1(fe.key,O,y,U)){ss(fe.key,Pe())||Fn(fe),j.setOpen(!1,Ke(Vf,fe.nativeEvent)),dt($)&&(b?N?.events.emit("virtualfocus",$):$.focus());return}const me=I.current,de=gs(a,C),ae=Xf(a,C);if(ee||(fe.key==="Home"&&(Fn(fe),I.current=de,R(fe)),fe.key==="End"&&(Fn(fe),I.current=ae,R(fe))),H!=null){const ye=H(fe,I.current,a,O,h,y,C,de,ae);if(ye!=null&&(I.current=ye,R(fe)),O==="both")return}if(ss(fe.key,O)){if(Fn(fe),k&&!b&&Ht(fe.currentTarget.ownerDocument)===fe.currentTarget){I.current=Af(fe.key,O,y)?de:ae,R(fe);return}Af(fe.key,O,y)?h?me>=ae?m&&me!==a.current.length?I.current=-1:(V.current=!1,I.current=de):I.current=vo(a.current,{startingIndex:me,disabledIndices:C}):I.current=Math.min(ae,vo(a.current,{startingIndex:me,disabledIndices:C})):h?me<=de?m&&me!==-1?I.current=a.current.length:(V.current=!1,I.current=ae):I.current=vo(a.current,{startingIndex:me,decrement:!0,disabledIndices:C}):I.current=Math.max(de,vo(a.current,{startingIndex:me,decrement:!0,disabledIndices:C})),za(a.current,I.current)&&(I.current=-1),R(fe)}}),Te=v.useMemo(()=>({onFocus(me){V.current=!0,ke(me)},onClick:({currentTarget:me})=>me.focus({preventScroll:!0}),onMouseMove(me){Uy(me)||(V.current=!0,oe.current=!1,E&&ke(me))},onPointerLeave(me){if(!ue.current||!ne.current||me.pointerType==="touch")return;V.current=!0;const de=me.relatedTarget;if(!(!E||a.current.includes(de))&&Re.current&&(ie.current?.(),ie.current=null,I.current=-1,R(me),!b)){const ae=le.current,ye=Ht(Xe(ae));ae&&De(ae,ye)&&ae.focus({preventScroll:!0})}}}),[ke,ue,le,E,a,R,Re,b]),Ee=v.useMemo(()=>b&&k&&_e&&{"aria-activedescendant":`${D}-${r}`},[b,k,_e,D,r]),we=v.useMemo(()=>({...ee?{}:Ee,onKeyDown(fe){if(fe.key==="Tab"&&fe.shiftKey&&k&&!b){const me=bt(fe.nativeEvent);if(me&&!De(le.current,me))return;Fn(fe),j.setOpen(!1,Ke(Ni,fe.nativeEvent)),dt($)&&$.focus();return}Ue(fe)},onPointerMove(fe){Uy(fe)||(ne.current=!0)}}),[Ee,Ue,le,ee,j,k,b,$]),Qe=v.useMemo(()=>{function fe(ae){j.setOpen(!0,Ke(Vf,ae.nativeEvent,ae.currentTarget))}function me(ae){S==="auto"&&ud(ae.nativeEvent)&&(P.current=!b)}function de(ae){P.current=S,S==="auto"&&cd(ae.nativeEvent)&&(P.current=!0)}return{onKeyDown(ae){const ye=j.select("open");ne.current=!1;const Le=ae.key.startsWith("Arrow"),Lt=X1(ae.key,Pe(),y),$t=ss(ae.key,O),Tt=(g?Lt:$t)||ae.key==="Enter"||ae.key.trim()==="";if(b&&ye)return Ue(ae);if(!(!ye&&!T&&Le)){if(Tt){const Se=ss(ae.key,Pe());Q.current=g&&Se?null:ae.key}if(g){Lt&&(Fn(ae),ye?(I.current=xe(),R(ae)):fe(ae));return}$t&&(pe.current!=null&&(I.current=pe.current),Fn(ae),!ye&&T?fe(ae):Ue(ae),ye&&R(ae))}},onFocus(ae){j.select("open")&&!b&&(I.current=-1,R(ae))},onPointerDown:de,onPointerEnter:de,onMouseDown:me,onClick:me}},[Ue,S,xe,g,R,j,T,O,Pe,y,pe,b]),Ae=v.useMemo(()=>({...Ee,...Qe}),[Ee,Qe]);return v.useMemo(()=>f?{reference:Ae,floating:we,item:Te,trigger:Qe}:{},[f,Ae,we,Qe,Te])}function F1(o,l){const{listRef:a,elementsRef:r,activeIndex:c,onMatch:f,disabledIndices:d,onTyping:m,enabled:h=!0,resetMs:g=750,selectedIndex:y=null}=l,b="rootStore"in o?o.rootStore:o,S=b.useState("open"),E=Jt(),T=v.useRef(""),C=v.useRef(y??c??-1),O=v.useRef(null),w=Oe(M=>{function H(le){return r?.current[le]}function U(le){const K=H(le);return K&&!Vs(K)||K?.matches(":disabled")?!1:d==null||!wi(Eo,le,d)}function j(le,K,N=0){if(le.length===0)return-1;const P=(N%le.length+le.length)%le.length,I=K.toLowerCase();for(let Q=0;Q<le.length;Q+=1){const ne=(P+Q)%le.length;if(!(!le[ne]?.toLowerCase().startsWith(I)||!U(ne)))return ne}return-1}const k=a.current;if(T.current.length>0&&M.key===" "&&(Fn(M),m?.(!0)),T.current.length>0&&T.current[0]!==" "&&j(k,T.current)===-1&&M.key!==" "&&m?.(!1),k==null||M.key.length!==1||M.ctrlKey||M.metaKey||M.altKey)return;S&&M.key!==" "&&(Fn(M),m?.(!0));const W=T.current==="";W&&(C.current=y??c??-1),k.every((le,K)=>le&&U(K)?le[0]?.toLowerCase()!==le[1]?.toLowerCase():!0)&&T.current===M.key&&(T.current="",C.current=O.current),T.current+=M.key,E.start(g,()=>{T.current="",C.current=O.current,m?.(!1)});const Y=((W?y??c??-1:C.current)??0)+1,ee=j(k,T.current,Y);ee!==-1?(f?.(ee),O.current=ee):M.key!==" "&&(T.current="",m?.(!1))}),D=Oe(M=>{const H=M.relatedTarget,U=b.select("domReferenceElement"),j=b.select("floatingElement");De(U,H)||De(j,H)||(E.clear(),T.current="",C.current=O.current,m?.(!1))});be(()=>{!S&&y!==null||(E.clear(),O.current=null,T.current!==""&&(T.current=""))},[S,y,E]);const A=v.useMemo(()=>({onKeyDown:w,onBlur:D}),[w,D]);return v.useMemo(()=>h?{reference:A,floating:A}:{},[h,A])}const Ly=.1,Z1=Ly*Ly,ft=.5;function us(o,l,a,r,c,f){return r>=l!=f>=l&&o<=(c-a)*(l-r)/(f-r)+a}function cs(o,l,a,r,c,f,d,m,h,g){let y=!1;return us(o,l,a,r,c,f)&&(y=!y),us(o,l,c,f,d,m)&&(y=!y),us(o,l,d,m,h,g)&&(y=!y),us(o,l,h,g,a,r)&&(y=!y),y}function J1(o,l,a){return o>=a.x&&o<=a.x+a.width&&l>=a.y&&l<=a.y+a.height}function fs(o,l,a,r,c,f){const d=Math.min(a,c),m=Math.max(a,c),h=Math.min(r,f),g=Math.max(r,f);return o>=d&&o<=m&&l>=h&&l<=g}function xb(o={}){const{blockPointerEvents:l=!1}=o,a=new yn,r=({x:c,y:f,placement:d,elements:m,onClose:h,nodeId:g,tree:y})=>{const b=d?.split("-")[0];let S=!1,E=null,T=null,C=typeof performance<"u"?performance.now():0;function O(D,A){const M=performance.now(),H=M-C;if(E===null||T===null||H===0)return E=D,T=A,C=M,!1;const U=D-E,j=A-T,k=U*U+j*j,W=H*H*Z1;return E=D,T=A,C=M,k<W}function w(){a.clear(),h()}return function(A){a.clear();const M=m.domReference,H=m.floating;if(!M||!H||b==null||c==null||f==null)return;const{clientX:U,clientY:j}=A,k=bt(A),W=A.type==="mouseleave",$=De(H,k),F=De(M,k);if($&&(S=!0,!W))return;if(F&&(S=!1,!W)){S=!0;return}if(W&&Je(A.relatedTarget)&&De(H,A.relatedTarget))return;function Y(){return!!(y&&rl(y.nodesRef.current,g).length>0)}function ee(){Y()||w()}if(Y())return;const le=M.getBoundingClientRect(),K=H.getBoundingClientRect(),N=c>K.right-K.width/2,P=f>K.bottom-K.height/2,I=K.width>le.width,Q=K.height>le.height,ne=(I?le:K).left,R=(I?le:K).right,B=(Q?le:K).top,J=(Q?le:K).bottom;if(b==="top"&&f>=le.bottom-1||b==="bottom"&&f<=le.top+1||b==="left"&&c>=le.right-1||b==="right"&&c<=le.left+1){ee();return}let V=!1;switch(b){case"top":V=fs(U,j,ne,le.top+1,R,K.bottom-1);break;case"bottom":V=fs(U,j,ne,K.top+1,R,le.bottom-1);break;case"left":V=fs(U,j,K.right-1,J,le.left+1,B);break;case"right":V=fs(U,j,le.right-1,J,K.left+1,B);break}if(V)return;if(S&&!J1(U,j,le)){ee();return}if(!W&&O(U,j)){ee();return}let oe=!1;switch(b){case"top":{const ie=I?ft/2:ft*4,he=I||N?c+ie:c-ie,ue=I?c-ie:N?c+ie:c-ie,pe=f+ft+1,Re=N||I?K.bottom-ft:K.top,ze=N?I?K.bottom-ft:K.top:K.bottom-ft;oe=cs(U,j,he,pe,ue,pe,K.left,Re,K.right,ze);break}case"bottom":{const ie=I?ft/2:ft*4,he=I||N?c+ie:c-ie,ue=I?c-ie:N?c+ie:c-ie,pe=f-ft,Re=N||I?K.top+ft:K.bottom,ze=N?I?K.top+ft:K.bottom:K.top+ft;oe=cs(U,j,he,pe,ue,pe,K.left,Re,K.right,ze);break}case"left":{const ie=Q?ft/2:ft*4,he=Q||P?f+ie:f-ie,ue=Q?f-ie:P?f+ie:f-ie,pe=c+ft+1,Re=P||Q?K.right-ft:K.left,ze=P?Q?K.right-ft:K.left:K.right-ft;oe=cs(U,j,Re,K.top,ze,K.bottom,pe,he,pe,ue);break}case"right":{const ie=Q?ft/2:ft*4,he=Q||P?f+ie:f-ie,ue=Q?f-ie:P?f+ie:f-ie,pe=c-ft,Re=P||Q?K.left+ft:K.right,ze=P?Q?K.left+ft:K.right:K.left+ft;oe=cs(U,j,pe,he,pe,ue,Re,K.top,ze,K.bottom);break}}oe?S||a.start(40,ee):ee()}};return r.__options={...o,blockPointerEvents:l},r}const W1={...Pd,disabled:o=>o.disabled,instantType:o=>o.instantType,isInstantPhase:o=>o.isInstantPhase,trackCursorAxis:o=>o.trackCursorAxis,disableHoverablePopup:o=>o.disableHoverablePopup,lastOpenChangeReason:o=>o.openChangeReason,closeOnClick:o=>o.closeOnClick,closeDelay:o=>o.closeDelay,adaptiveOrigin:o=>o.adaptiveOrigin};class $1 extends Ia{constructor(l,a,r){const c=new Yd;super(eR(l,c,a,r),tR(c),W1)}setOpen=(l,a)=>{B1(this,l,a,{extraState:{openChangeReason:a.reason}})};cancelPendingOpen(l){this.state.floatingRootContext.dispatchOpenChange(!1,Ke(_i,l))}}function eR(o,l,a,r=!1){return{...Id(l,a,r),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...o}}function tR(o){return{popupRef:v.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:o}}const nR=Ds(function(l){const{disabled:a=!1,defaultOpen:r=!1,open:c,disableHoverablePopup:f=!1,trackCursorAxis:d="none",actionsRef:m,onOpenChange:h,onOpenChangeComplete:g,handle:y,triggerId:b,defaultTriggerId:S=null,children:E}=l,T=db((F,Y)=>new $1({open:r,openProp:c,activeTriggerId:S,triggerIdProp:b},F,Y));T.useControlledProp("openProp",c),T.useControlledProp("triggerIdProp",b),T.useContextCallback("onOpenChange",h),T.useContextCallback("onOpenChangeComplete",g);const C=T.useState("open"),O=!a&&C,w=T.useState("activeTriggerId"),D=T.useState("mounted"),A=T.useState("payload");T.useSyncedValues({trackCursorAxis:d,disableHoverablePopup:f,disabled:a}),Ud(T,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:M,transitionStatus:H}=Ld(O,T),U=T.useState("isInstantPhase"),j=T.useState("instantType"),k=T.useState("lastOpenChangeReason"),W=v.useRef(null);be(()=>{C&&a&&T.setOpen(!1,Ke(xv))},[C,a,T]),be(()=>{H==="ending"&&k===qs||H!=="ending"&&U?(j!=="delay"&&(W.current=j),T.set("instantType","delay")):W.current!==null&&(T.set("instantType",W.current),W.current=null)},[H,U,k,j,T]),be(()=>{O&&w==null&&T.set("payload",void 0)},[T,w,O]),v.useImperativeHandle(m,()=>({unmount:M,close:()=>T.setOpen(!1,Ke(vd))}),[M,T]);const $=O||D||!a&&d!=="none";return z.jsxs(pv.Provider,{value:T,children:[y&&z.jsx(jd,{handle:y,store:T}),$&&z.jsx(oR,{store:T,disabled:a,trackCursorAxis:d}),typeof E=="function"?E({payload:A}):E]})});function oR({store:o,disabled:l,trackCursorAxis:a}){const r=o.useState("floatingRootContext"),c=Dd(r,{enabled:!l,referencePress:()=>o.select("closeOnClick")}),f=UE(r,{enabled:!l&&a!=="none",axis:a==="none"?void 0:a}),d=v.useMemo(()=>To(f.reference,c.reference),[f.reference,c.reference]);return Bd(o,{activeTriggerProps:d,inactiveTriggerProps:d,popupProps:c.floating??Ct}),null}function Bl(o){return jl(o,"base-ui")}const Tb=v.createContext(void 0);function lR(){return v.useContext(Tb)}const iR=600,Eb="data-base-ui-tooltip-trigger";function By(o){if("composedPath"in o){const a=o.composedPath();for(let r=0;r<a.length;r+=1){const c=a[r];if(Je(c))return c}}const l=o.target;return Je(l)?l:null}function aR(o){let l=o;for(;l;){const a=l.closest(`[${Eb}]`);if(a)return a;const r=l.getRootNode();l="host"in r&&Je(r.host)?r.host:null}return null}const rR=dv(function(l,a){const{render:r,className:c,style:f,handle:d,payload:m,disabled:h,delay:g,closeOnClick:y=!0,closeDelay:b,id:S,...E}=l,T=Ns(!0),O=mb(d)??T;if(!O)throw new Error(Qt(82));const w=Bl(S),D=O.useState("isTriggerActive",w),A=O.useState("isOpenedByTrigger",w),M=O.useState("floatingRootContext"),H=v.useRef(null),U=b??0,{registerTrigger:j,isMountedByThisTrigger:k}=hb(w,H,O,{payload:m,closeOnClick:y,closeDelay:U}),W=lR(),{activeIdRef:$,delayRef:F,isInstantPhase:Y,hasProvider:ee}=DT(M,{open:A}),le=Gd(M);O.useSyncedValue("isInstantPhase",Y);const K=O.useState("disabled"),N=h??K,P=jt(N),I=O.useState("trackCursorAxis"),Q=O.useState("disableHoverablePopup"),ne=v.useRef(!1),R=Jt(),B=v.useRef(void 0);function J(){return ee&&$.current!=null?0:g??W??iR}function V(ge){const _e=H.current;if(!_e||!ge)return!1;const ke=aR(ge);return ke!==null&&ke!==_e&&De(_e,ke)}function oe(ge){const _e=V(ge);return ne.current=_e,_e&&(le.openChangeTimeout.clear(),le.restTimeout.clear(),le.restTimeoutPending=!1,R.clear()),_e}const ie=Sb(M,{enabled:!N,mouseOnly:!0,move:!1,handleClose:!Q&&I!=="both"?xb():null,restMs:J,delay(){return b==null&&ee?{close:zl(F.current,"close")}:{close:U}},triggerElementRef:H,isActiveTrigger:D,isClosing:()=>O.select("transitionStatus")==="ending",shouldOpen(){return!ne.current}}),he=yb(M,{enabled:!N}).reference,ue=ge=>{const _e=ne.current,ke=By(ge),Pe=oe(ke),xe=H.current,Ue=xe&&ke&&De(xe,ke);if(Pe&&O.select("open")&&O.select("lastOpenChangeReason")===Ut){O.setOpen(!1,Ke(Ut,ge));return}if(_e&&!Pe&&Ue&&!P.current&&!O.select("open")&&xe&&ll(B.current)){const Te=()=>{!ne.current&&!P.current&&!O.select("open")&&O.setOpen(!0,Ke(Ut,ge,xe))},Ee=J();Ee===0?(R.clear(),Te()):R.start(Ee,Te)}},pe=O.useState("triggerProps",k);return St("button",l,{state:{open:A},ref:[a,j,H],props:[ie,he,k||I!=="none"?pe:void 0,{onMouseOver(ge){ue(ge.nativeEvent)},onFocus(ge){V(By(ge.nativeEvent))&&ge.preventBaseUIHandler()},onMouseLeave(){ne.current=!1,R.clear(),B.current=void 0},onPointerEnter(ge){B.current=ge.pointerType},onPointerDown(ge){B.current=ge.pointerType,O.set("closeOnClick",y),y&&!O.select("open")&&O.cancelPendingOpen(ge.nativeEvent)},onClick(ge){y&&!O.select("open")&&O.cancelPendingOpen(ge.nativeEvent)},id:w,[If]:N?"":void 0,[Eb]:N?void 0:""},E],stateAttributesMapping:xT})}),Rb=v.createContext(void 0);function sR(){const o=v.useContext(Rb);if(o===void 0)throw new Error(Qt(70));return o}const Cb=v.forwardRef(function(l,a){const{children:r,container:c,className:f,render:d,style:m,...h}=l,{node:g,subtree:y}=Kv({container:c,ref:a,componentProps:l,elementProps:h});return!y&&!g?null:z.jsxs(v.Fragment,{children:[y,g&&qn.createPortal(r,g)]})}),uR=v.forwardRef(function(l,a){const{keepMounted:r=!1,...c}=l;return Ns().useState("mounted")||r?z.jsx(Rb.Provider,{value:r,children:z.jsx(Cb,{ref:a,...c})}):null}),Ob=v.createContext(void 0);function cR(){const o=v.useContext(Ob);if(o===void 0)throw new Error(Qt(71));return o}const fR=v.createContext(void 0);function Xd(){return v.useContext(fR)?.direction??"ltr"}const dR=o=>({name:"arrow",options:o,async fn(l){const{x:a,y:r,placement:c,rects:f,platform:d,elements:m,middlewareData:h}=l,{element:g,padding:y=0,offsetParent:b="real"}=al(o,l)||{};if(g==null)return{};const S=wv(y),E={x:a,y:r},T=Td(c),C=xd(T),O=await d.getDimensions(g),w=T==="y",D=w?"top":"left",A=w?"bottom":"right",M=w?"clientHeight":"clientWidth",H=f.reference[C]+f.reference[T]-E[T]-f.floating[C],U=E[T]-f.reference[T],j=b==="real"?await d.getOffsetParent?.(g):m.floating;let k=m.floating[M]||f.floating[C];(!k||!await d.isElement?.(j))&&(k=m.floating[M]||f.floating[C]);const W=H/2-U/2,$=k/2-O[C]/2-1,F=Math.min(S[D],$),Y=Math.min(S[A],$),ee=F,le=k-O[C]-Y,K=k/2-O[C]/2+W,N=Ov(ee,K,le),P=!h.arrow&&Co(c)!=null&&K!==N&&f.reference[C]/2-(K<ee?F:Y)-O[C]/2<0,I=P?K<ee?K-ee:K-le:0;return{[T]:E[T]+I,data:{[T]:N,centerOffset:K-N-I,...P&&{alignmentOffset:I}},reset:P}}}),pR=(o,l)=>{const{name:a,fn:r}=dR(o);return{name:a,fn:r,options:[o,l]}},hR={name:"hide",async fn(o){const{width:l,height:a,x:r,y:c}=o.rects.reference,f=l===0&&a===0&&r===0&&c===0,d=await o.platform.detectOverflow(o,{elementContext:"reference"});return{data:{referenceHidden:d.top-a>=0||d.right-l>=0||d.bottom-a>=0||d.left-l>=0||f}}}},gR={sideX:"left",sideY:"top"},mR="--available-width",yR="--available-height",vR="--anchor-width",bR="--anchor-height",SR="--transform-origin",Yy=mR,Iy=yR;function wb(o,l,a){const r=o==="inline-start"||o==="inline-end";return{top:"top",right:r?a?"inline-start":"inline-end":"right",bottom:"bottom",left:r?a?"inline-end":"inline-start":"left"}[l]}function qy(o,l,a){const{rects:r,placement:c}=o;return{side:wb(l,_n(c),a),align:Co(c)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Ab(o){return xR(o,q1)}function xR(o,l){const{anchor:a,positionMethod:r="absolute",side:c="bottom",sideOffset:f=0,align:d="center",alignOffset:m=0,collisionBoundary:h,collisionPadding:g=5,sticky:y=!1,arrowPadding:b=5,disableAnchorTracking:S=!1,inline:E,keepMounted:T=!1,floatingRootContext:C,mounted:O,collisionAvoidance:w,shift:D,nodeId:A,adaptiveOrigin:M,lazyFlip:H=!1,externalTree:U}=o,[j,k]=v.useState(null);!O&&j!==null&&k(null);const W=w.side||"flip",$=w.align||"flip",F=w.fallbackAxisSide||"end",Y=D?.crossAxis??!1,ee=D?.rootBoundary,le=typeof a=="function"?a:void 0,K=Oe(le),N=le?K:a,P=jt(a),I=jt(O),ne=Xd()==="rtl",R=j||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":ne?"left":"right","inline-start":ne?"right":"left"}[c],B=d==="center"?R:`${R}-${d}`;let J=g;typeof J=="number"?J={top:J,right:J,bottom:J,left:J}:J&&(J={top:J.top||0,right:J.right||0,bottom:J.bottom||0,left:J.left||0});const V=1,oe=c==="bottom"?V:0,ie=c==="top"?V:0,he=c==="right"?V:0,ue=c==="left"?V:0,pe={boundary:h==="clipping-ancestors"?"clippingAncestors":h,padding:J},Re=v.useRef(null),ze=jt(f),ve=jt(m),ge=typeof f!="function"?f:0,_e=typeof m!="function"?m:0,ke=[];E&&ke.push(E),ke.push(S1(Ge=>{const xt=qy(Ge,c,ne),It=typeof ze.current=="function"?ze.current(xt):ze.current,Mt=typeof ve.current=="function"?ve.current(xt):ve.current;return{mainAxis:It,crossAxis:Mt,alignmentAxis:Mt}},[ge,_e,ne,c]));const Pe=$==="none"&&W!=="shift",xe=!Pe&&(y||Y||W==="shift"),Ue=W==="none"?null:E1({...pe,padding:{top:J.top+V+oe,right:J.right+V+ue,bottom:J.bottom+V+ie,left:J.left+V+he},mainAxis:!Y&&W==="flip",crossAxis:$==="flip"?"alignment":!1,fallbackAxisSideDirection:F}),Te=Pe?null:x1({...pe,rootBoundary:ee,mainAxis:$!=="none",crossAxis:xe,limiter:y||Y?void 0:T1(Ge=>{if(!Re.current)return{};const{width:xt,height:It}=Re.current.getBoundingClientRect(),Mt=zn(_n(Ge.placement)),Vn=Mt==="y"?xt:It,en=Mt==="y"?J.left+J.right:J.top+J.bottom;return{offset:Vn/2+en/2}})},[pe,y,Y,ee,J,$]);W==="shift"||$==="shift"||d==="center"?ke.push(Te,Ue):ke.push(Ue,Te),ke.push(R1({...pe,apply({elements:{floating:Ge},availableWidth:xt,availableHeight:It,rects:Mt}){if(!I.current)return;const Vn=Ge.style;Vn.setProperty(Yy,`${xt}px`),Vn.setProperty(Iy,`${It}px`);const en=yt(Ge).devicePixelRatio||1,{x:Ao,y:xn,width:Il,height:kn}=Mt.reference,Mo=(Math.round((Ao+Il)*en)-Math.round(Ao*en))/en,Do=(Math.round((xn+kn)*en)-Math.round(xn*en))/en;Vn.setProperty(vR,`${Mo}px`),Vn.setProperty(bR,`${Do}px`)}}),pR(Ge=>({element:Re.current||Xe(Ge.elements.floating).createElement("div"),padding:Re.current?b:0,offsetParent:"floating"}),[b]),{name:"transformOrigin",fn(Ge){const{elements:{floating:xt},middlewareData:It,placement:Mt,platform:Vn,rects:en,y:Ao}=Ge,xn=_n(Mt),Il=Co(Mt),kn=zn(xn)==="y",Mo=Re.current,Do=typeof f=="function"?f(qy(Ge,c,ne)):f;let No;if(!Mo&&Il&&Math.abs(kn?It.shift?.x||0:It.shift?.y||0)<=1)No=Il==="start"===(kn&&Vn.isRTL?.(xt)===!0)?"100%":"0%";else{const Pa=kn?It.arrow?.x||0:It.arrow?.y||0,Va=kn?Mo?.clientWidth||0:Mo?.clientHeight||0;No=`${Pa+Va/2}px`}let dl=xn==="top"||xn==="left"?`calc(100% + ${Do}px)`:`${-Do}px`;return xe&&kn&&Math.abs(It.shift?.y||0)>Do&&(dl=`${en.reference.y+en.reference.height/2-Ao}px`),xt.style.setProperty(SR,kn?`${No} ${dl}`:`${dl} ${No}`),{}}},hR,M),be(()=>{!O&&C&&C.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[O,C]);const Ee=v.useMemo(()=>({ancestorScroll:!S,elementResize:!S&&typeof ResizeObserver<"u",layoutShift:!S&&typeof IntersectionObserver<"u"}),[S]),{refs:we,elements:Qe,x:Ae,y:fe,middlewareData:me,update:de,placement:ae,context:ye,isPositioned:Le,floatingStyles:Lt}=l({rootContext:C,open:T?O:void 0,placement:B,middleware:ke,strategy:r,whileElementsMounted:T?void 0:(...Ge)=>My(...Ge,Ee),nodeId:A,externalTree:U}),{sideX:$t,sideY:Tt}=me.adaptiveOrigin||gR,Se=Le?r:"fixed",Ie=v.useMemo(()=>{let Ge;return Le?M?Ge={position:Se,[$t]:Ae,[Tt]:fe}:Ge={...Lt,position:Se}:Ge={position:Se,top:0,left:0},Ge[Yy]="100vw",Ge[Iy]="100vh",Le||(Ge.opacity=0),Ge},[M,Se,$t,Ae,Tt,fe,Lt,Le]),tt=v.useRef(null);be(()=>{if(!O)return;const Ge=P.current,xt=typeof Ge=="function"?Ge():Ge,Mt=(Py(xt)?xt.current:xt)||null||null;Mt!==tt.current&&(we.setPositionReference(Mt),tt.current=Mt)},[O,we,N,P]),v.useEffect(()=>{if(!O)return;const Ge=P.current;typeof Ge!="function"&&Py(Ge)&&Ge.current!==tt.current&&(we.setPositionReference(Ge.current),tt.current=Ge.current)},[O,we,N,P]),v.useEffect(()=>{if(T&&O&&Qe.reference&&Qe.floating)return My(Qe.reference,Qe.floating,de,Ee)},[T,O,Qe,de,Ee]);const pt=_n(ae),bn=wb(c,pt,ne),Hn=Co(ae)||"center",Sn=!!me.hide?.referenceHidden;be(()=>{H&&O&&Le&&pt!==R&&k(pt)},[H,O,Le,pt,R]);const At=v.useMemo(()=>({position:"absolute",top:me.arrow?.y,left:me.arrow?.x}),[me.arrow]),jn=me.arrow?.centerOffset!==0;return v.useMemo(()=>({positionerStyles:Ie,arrowStyles:At,arrowRef:Re,arrowUncentered:jn,side:bn,align:Hn,physicalSide:pt,anchorHidden:Sn,refs:we,context:ye,isPositioned:Le,update:de}),[Ie,At,Re,jn,bn,Hn,pt,Sn,we,ye,Le,de])}function Py(o){return o!=null&&"current"in o}function Kd(o){return o==="starting"?TE:Ct}function Mb(o,l,{styles:a,transitionStatus:r,props:c,refs:f,hidden:d,inert:m=!1}){const h={...a};return m&&(h.pointerEvents="none"),St("div",o,{state:l,ref:f,props:[{role:"presentation",hidden:d,style:h},Kd(r),c],stateAttributesMapping:gd})}const TR=v.forwardRef(function(l,a){const{render:r,className:c,anchor:f,positionMethod:d="absolute",side:m="top",align:h="center",sideOffset:g=0,alignOffset:y=0,collisionBoundary:b="clipping-ancestors",collisionPadding:S=5,arrowPadding:E=5,sticky:T=!1,disableAnchorTracking:C=!1,collisionAvoidance:O=Vv,style:w,...D}=l,A=Ns(),M=sR(),H=A.useState("open"),U=A.useState("mounted"),j=A.useState("trackCursorAxis"),k=A.useState("disableHoverablePopup"),W=A.useState("floatingRootContext"),$=A.useState("instantType"),F=A.useState("transitionStatus"),Y=A.useState("adaptiveOrigin"),ee=Ab({anchor:f,positionMethod:d,floatingRootContext:W,mounted:U,side:m,sideOffset:g,align:h,alignOffset:y,collisionBoundary:b,collisionPadding:S,sticky:T,arrowPadding:E,disableAnchorTracking:C,keepMounted:M,collisionAvoidance:O,adaptiveOrigin:Y}),le=v.useMemo(()=>({open:H,side:ee.side,align:ee.align,anchorHidden:ee.anchorHidden,instant:j!=="none"?"tracking-cursor":$}),[H,ee.side,ee.align,ee.anchorHidden,j,$]),K=Mb(l,le,{styles:ee.positionerStyles,transitionStatus:F,props:D,refs:[a,A.useStateSetter("positionerElement")],hidden:!U,inert:!H||j==="both"||k});return z.jsx(Ob.Provider,{value:ee,children:K})}),ER=v.forwardRef(function(l,a){const{render:r,className:c,style:f,...d}=l,m=Ns(),{side:h,align:g}=cR(),y=m.useState("open"),b=m.useState("instantType"),S=m.useState("transitionStatus"),E=m.useState("popupProps"),T=m.useState("floatingRootContext"),C=m.useState("disabled"),O=m.useState("closeDelay");Hi({open:y,ref:m.context.popupRef,onComplete(){y&&m.context.onOpenChangeComplete?.(!0)}}),bb(T,{enabled:!C,closeDelay:O});const w=m.useStateSetter("popupElement");return St("div",l,{state:{open:y,side:h,align:g,instant:b,transitionStatus:S},ref:[a,m.context.popupRef,w],props:[Hd,E,Kd(S),d],stateAttributesMapping:md})}),RR=function(l){const{delay:a,closeDelay:r,timeout:c=400}=l,f=v.useMemo(()=>({open:a,close:r}),[a,r]);return z.jsx(Tb.Provider,{value:a,children:z.jsx(MT,{delay:f,timeoutMs:c,children:l.children})})};function Ks(o){return Cd(19)?o:o?"true":void 0}function Db({label:o,shortcut:l,side:a="bottom",children:r}){return z.jsxs(nR,{children:[z.jsx(rR,{render:r}),z.jsx(uR,{children:z.jsx(TR,{side:a,sideOffset:6,className:"z-[1000]",children:z.jsxs(ER,{className:"rounded-md bg-fg px-2 py-1 text-xs text-surface shadow-popup data-[starting-style]:opacity-0 data-[ending-style]:opacity-0 transition-opacity",children:[o,l?z.jsx("span",{className:"ml-2 opacity-60",children:l}):null]})})})]})}function CR({children:o}){return z.jsx(RR,{delay:500,closeDelay:0,children:o})}function OR(o){return o.repeat&&(o.key==="Enter"||o.key===" ")}function Ms(o){OR(o)&&o.target===o.currentTarget&&o.preventDefault()}function Nb(o){return o?l=>{Ms(l),o(l)}:Ms}const wR=200,AR=2e3;function MR(o,l,a){let r=null,c=!1;const f=()=>{c||(c=!0,o.removeEventListener("keydown",d,!0),o.removeEventListener("keyup",d,!0),o.clearTimeout(m),r!==null&&o.clearTimeout(r))},d=h=>{const g=h.key==="Enter"||h.key===" ";if(h.type==="keyup"){h.key===" "&&!a(h.target)&&h.preventDefault(),h.key===l&&r===null&&(r=o.setTimeout(f,wR));return}g&&!a(h.target)&&(h.preventDefault(),h.stopImmediatePropagation())},m=o.setTimeout(f,AR);return o.addEventListener("keydown",d,!0),o.addEventListener("keyup",d,!0),f}const DR={primary:"bg-accent text-accent-fg hover:brightness-110 active:brightness-95",secondary:"bg-surface text-fg border border-line hover:bg-hover",ghost:"bg-transparent text-fg hover:bg-hover",danger:"bg-danger text-white hover:brightness-110"},NR={sm:"h-6 px-2 text-xs gap-1",md:"h-7 px-2.5 text-[13px] gap-1.5",lg:"h-8 px-3 text-[13px] gap-2"},sl=v.forwardRef(function({variant:l="secondary",size:a="md",icon:r,className:c,children:f,type:d="button",onKeyDown:m,...h},g){return z.jsxs("button",{ref:g,type:d,className:Oo("inline-flex shrink-0 select-none items-center justify-center whitespace-nowrap rounded-control font-medium transition-[background,filter]","focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-accent","disabled:pointer-events-none disabled:opacity-45",DR[l],NR[a],c),...h,onKeyDown:Nb(m),children:[r,f]})}),zR={sm:"size-6",md:"size-7",lg:"size-8"},_R=v.forwardRef(function({label:l,icon:a,shortcut:r,active:c,size:f="md",noTooltip:d,className:m,type:h="button",onKeyDown:g,...y},b){const S=z.jsx("button",{ref:b,type:h,"aria-label":l,"aria-pressed":c===void 0?void 0:c,className:Oo("inline-flex shrink-0 items-center justify-center rounded-control text-fg-muted transition-colors","hover:bg-hover hover:text-fg focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-accent","disabled:pointer-events-none disabled:opacity-40",c&&"bg-accent-soft text-accent hover:bg-accent-soft hover:text-accent",zR[f],m),...y,onKeyDown:Nb(g),children:a});return d?S:z.jsx(Db,{label:l,shortcut:r,children:S})}),zb=v.createContext(void 0);function _b(o){const l=v.useContext(zb);if(l===void 0&&!o)throw new Error(Qt(33));return l}const Hb=v.createContext(void 0);function ji(o){const l=v.useContext(Hb);if(l===void 0&&!o)throw new Error(Qt(36));return l}const HR=v.createContext(void 0);function Qd(o=!0){const l=v.useContext(HR);if(l===void 0&&!o)throw new Error(Qt(25));return l}function jR({controlled:o,default:l,name:a,state:r="value"}){const{current:c}=v.useRef(o!==void 0),[f,d]=v.useState(l),m=c&&o!==void 0?o:f,h=v.useCallback(g=>{c||d(g)},[]);return[m,h]}const jb=v.createContext(void 0);function Qs(o=!1){const l=v.useContext(jb);if(l===void 0&&!o)throw new Error(Qt(16));return l}function kR(o){const{focusableWhenDisabled:l,disabled:a,composite:r=!1,tabIndex:c=0,isNativeButton:f}=o,d=r&&l!==!1,m=r&&l===!1;return{props:v.useMemo(()=>{const g={onKeyDown(y){a&&l&&y.key!=="Tab"&&y.preventDefault()}};return r||(g.tabIndex=c,!f&&a&&(g.tabIndex=l?c:-1)),(f&&(l||d)||!f&&a)&&(g["aria-disabled"]=a),f&&(!l||m)&&(g.disabled=a),g},[r,a,l,d,m,f,c])}}function vs(o,l,{detail:a=0}={}){o.dispatchEvent(new(yt(o)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:a,shiftKey:l.shiftKey,ctrlKey:l.ctrlKey,altKey:l.altKey,metaKey:l.metaKey}))}function qa(o={}){const{disabled:l=!1,focusableWhenDisabled:a,tabIndex:r=0,native:c=!0,composite:f}=o,d=v.useRef(null),m=Qs(!0),h=f??m!==void 0,{props:g}=kR({focusableWhenDisabled:a,disabled:l,composite:h,tabIndex:r,isNativeButton:c}),y=v.useCallback(()=>{const E=d.current;Mf(E)&&h&&l&&g.disabled===void 0&&E.disabled&&(E.disabled=!1)},[l,g.disabled,h]);be(y,[y]);const b=v.useCallback((E={})=>{const{onClick:T,onMouseDown:C,onKeyUp:O,onKeyDown:w,onPointerDown:D,...A}=E;return To({onClick(M){if(l){M.preventDefault();return}T?.(M)},onMouseDown(M){l||C?.(M)},onKeyDown(M){if(l||(Cs(M),w?.(M),M.baseUIHandlerPrevented))return;const H=M.target===M.currentTarget,U=M.currentTarget,j=Mf(U),k=!c&&UR(U),W=H&&(c?j:!k),$=M.key==="Enter",F=M.key===" ",Y=U.getAttribute("role"),ee=Y?.startsWith("menuitem")||Y==="option"||Y==="gridcell";if(H&&h&&F){if(M.defaultPrevented&&ee)return;M.preventDefault(),(!c||j)&&(M.preventBaseUIHandler(),vs(U,M));return}if(!W||c||!F&&!$){H&&k&&F&&M.preventDefault();return}M.defaultPrevented||(M.preventDefault(),$&&(M.preventBaseUIHandler(),vs(U,M)))},onKeyUp(M){if(!l){if(Cs(M),O?.(M),M.target===M.currentTarget&&c&&h&&Mf(M.currentTarget)&&M.key===" "){M.preventDefault();return}M.baseUIHandlerPrevented||M.target===M.currentTarget&&!c&&!h&&!M.defaultPrevented&&M.key===" "&&(M.preventBaseUIHandler(),vs(M.currentTarget,M))}},onPointerDown(M){if(l){M.preventDefault();return}D?.(M)}},c?{type:"button"}:{role:"button"},g,A)},[l,g,h,c]),S=Oe(E=>{d.current=E,y()});return{getButtonProps:b,buttonRef:S}}function Mf(o){return dt(o)&&o.tagName==="BUTTON"}function UR(o){return dt(o)&&o.tagName==="A"&&!!o.href}function LR(o){const{closeOnClick:l,highlighted:a,id:r,nodeId:c,store:f,typingRef:d,itemRef:m,itemMetadata:h}=o,{events:g}=f.useState("floatingTreeRoot"),y=f.useState("open"),b=Qd(!0),S=b!==void 0;return v.useMemo(()=>({id:r,role:"menuitem",tabIndex:y&&a?0:-1,onKeyDown(E){E.key===" "&&d?.current&&E.preventDefault()},onMouseMove(E){c&&g.emit("itemhover",{nodeId:c,target:E.currentTarget})},onClick(E){l&&g.emit("close",{domEvent:E,reason:Sv})},onMouseUp(E){if(b){const T=b.initialCursorPointRef.current;if(b.initialCursorPointRef.current=null,S&&T&&Math.abs(E.clientX-T.x)<=1&&Math.abs(E.clientY-T.y)<=1||S&&!rd&&E.button===2)return}m.current&&f.context.allowMouseUpTriggerRef.current&&(!S||E.button===2)&&h.type==="regular-item"&&vs(m.current,E,{detail:1})}}),[l,a,r,g,c,y,f,d,m,b,S,h])}const BR={type:"regular-item"};function YR(o){const{closeOnClick:l,disabled:a,highlighted:r,id:c,store:f,typingRef:d=f.context.typingRef,nativeButton:m,itemMetadata:h,nodeId:g}=o,y=v.useRef(null),{getButtonProps:b,buttonRef:S}=qa({disabled:a,focusableWhenDisabled:!0,native:m,composite:!0}),E=LR({closeOnClick:l,highlighted:r,id:c,nodeId:g,store:f,typingRef:d,itemRef:y,itemMetadata:h}),T=v.useCallback(O=>To(E,{onMouseEnter(){h.type==="submenu-trigger"&&h.setActive()}},O,b),[E,b,h]),C=_l(y,S);return v.useMemo(()=>({getItemProps:T,itemRef:C}),[T,C])}const kb=v.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function IR(){return v.useContext(kb)}function Fd(o={}){const{guess:l,label:a,metadata:r,textRef:c,index:f}=o,{register:d,unregister:m,subscribeMapChange:h,nextIndexRef:g}=IR(),y=v.useRef(-1),[b,S]=v.useState(f==null&&l?()=>{if(y.current===-1){const O=g.current;g.current+=1,y.current=O}return y.current}:-1),E=f??b,T=v.useRef(null),C=v.useCallback(O=>{const w=T.current;w&&m(w),T.current=O,O&&d(O,{metadata:r??null,index:f??null,label:a,textRef:c})},[f,d,m,r,a,c]);return be(()=>{if(f==null)return h(O=>{const w=T.current?O.get(T.current)?.index:null;w!=null&&S(w)})},[f,h]),{ref:C,index:E}}const qR=v.forwardRef(function(l,a){const{render:r,className:c,id:f,label:d,nativeButton:m=!1,disabled:h=!1,closeOnClick:g=!0,style:y,...b}=l,S=Fd({guess:!0,label:d}),E=_b(!0),T=Bl(f),{store:C}=ji(),O=C.useState("disabled"),w=h||O,D=C.useState("isActive",S.index),A=C.useState("itemProps"),{getItemProps:M,itemRef:H}=YR({closeOnClick:g,disabled:w,highlighted:D,id:T,store:C,nativeButton:m,nodeId:E?.context.nodeId,itemMetadata:BR});return St("div",l,{state:{disabled:w,highlighted:D},props:[A,b,M],ref:[H,a,S.ref]})}),PR=v.createContext(void 0);function VR(o){return v.useContext(PR)}const Zf="ArrowUp",Jf="ArrowDown",Wf="ArrowLeft",$f="ArrowRight",ed="Home",td="End",Zd=new Set([Zf,Jf,Wf,$f,ed,td]),GR="Shift",XR=[GR,"Control","Alt","Meta"];function KR(o){return dt(o)&&o.tagName==="INPUT"}function Vy(o){return!!(KR(o)&&o.selectionStart!=null||dt(o)&&o.tagName==="TEXTAREA")}function Gy(o,l,a,r){if(!o||!l||!l.scrollTo)return;let c=o.scrollLeft,f=o.scrollTop;const d=o.clientWidth<o.scrollWidth,m=o.clientHeight<o.scrollHeight;if(d&&r!=="vertical"){const h=Xy(o,l,"left"),g=ds(o),y=ds(l);a==="ltr"&&(h+l.offsetWidth+y.scrollMarginRight>o.scrollLeft+o.clientWidth-g.scrollPaddingRight?c=h+l.offsetWidth+y.scrollMarginRight-o.clientWidth+g.scrollPaddingRight:h-y.scrollMarginLeft<o.scrollLeft+g.scrollPaddingLeft&&(c=h-y.scrollMarginLeft-g.scrollPaddingLeft)),a==="rtl"&&(h-y.scrollMarginLeft<o.scrollLeft+g.scrollPaddingLeft?c=h-y.scrollMarginLeft-g.scrollPaddingLeft:h+l.offsetWidth+y.scrollMarginRight>o.scrollLeft+o.clientWidth-g.scrollPaddingRight&&(c=h+l.offsetWidth+y.scrollMarginRight-o.clientWidth+g.scrollPaddingRight))}if(m&&r!=="horizontal"){const h=Xy(o,l,"top"),g=ds(o),y=ds(l);h-y.scrollMarginTop<o.scrollTop+g.scrollPaddingTop?f=h-y.scrollMarginTop-g.scrollPaddingTop:h+l.offsetHeight+y.scrollMarginBottom>o.scrollTop+o.clientHeight-g.scrollPaddingBottom&&(f=h+l.offsetHeight+y.scrollMarginBottom-o.clientHeight+g.scrollPaddingBottom)}o.scrollTo({left:c,top:f,behavior:"auto"})}function Xy(o,l,a){const r=a==="left"?"offsetLeft":"offsetTop";let c=0;for(;l.offsetParent&&(c+=l[r],l.offsetParent!==o);)l=l.offsetParent;return c}function ds(o){const l=getComputedStyle(o);return{scrollMarginTop:parseFloat(l.scrollMarginTop)||0,scrollMarginRight:parseFloat(l.scrollMarginRight)||0,scrollMarginBottom:parseFloat(l.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(l.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(l.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(l.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(l.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(l.scrollPaddingLeft)||0}}const QR=v.forwardRef(function(l,a){const{render:r,className:c,style:f,finalFocus:d,...m}=l,{store:h}=ji(),{side:g,align:y}=_b(),b=VR()!=null,S=h.useState("open"),E=h.useState("transitionStatus"),T=h.useState("popupProps"),C=h.useState("mounted"),O=h.useState("instantType"),w=h.useState("activeTriggerElement"),D=h.useState("parent"),A=h.useState("lastOpenChangeReason"),M=h.useState("rootId"),H=h.useState("floatingRootContext"),U=h.useState("floatingTreeRoot"),j=h.useState("closeDelay"),k=h.useState("hoverEnabled"),W=h.useState("disabled"),$=h.useState("openMethod"),F=D.type==="context-menu";Hi({open:S,ref:h.context.popupRef,onComplete(){S&&h.context.onOpenChangeComplete?.(!0)}}),v.useEffect(()=>{function N(P){h.setOpen(!1,Ke(P.reason,P.domEvent))}return U.events.on("close",N),()=>{U.events.off("close",N)}},[U.events,h]),bb(H,{enabled:k&&!W&&!F&&D.type!=="menubar",closeDelay:j});const Y=h.useStateSetter("popupElement"),ee={transitionStatus:E,side:g,align:y,open:S,nested:D.type==="menu",instant:O},le=St("div",l,{state:ee,ref:[a,h.context.popupRef,Y],stateAttributesMapping:md,props:[T,{onKeyDown(N){b&&Zd.has(N.key)&&N.stopPropagation()}},Kd(E),m,{"data-rootownerid":M}]});let K=D.type===void 0||F;return(w||D.type==="menubar"&&A!==yd)&&(K=!0),z.jsx($v,{context:H,openInteractionType:$,modal:F,disabled:!C,returnFocus:d===void 0?K:d,initialFocus:D.type!=="menu",restoreFocus:!0,externalTree:D.type!=="menubar"?U:void 0,previousFocusableElement:w,nextFocusableElement:D.type===void 0?h.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:D.type===void 0?h.context.beforeContentFocusGuardRef:void 0,children:le})}),Ub=v.createContext(void 0);function FR(){const o=v.useContext(Ub);if(o===void 0)throw new Error(Qt(32));return o}const ZR=v.forwardRef(function(l,a){const{keepMounted:r=!1,...c}=l,{store:f,parent:d}=ji();if(!(f.useState("mounted")||r))return null;const g=d.type==="menu"||d.type==="menubar"?"group":void 0;return z.jsx(Ub.Provider,{value:r,children:z.jsx(Qv,{ref:a,...c,portalOwnerRole:g})})});function Jd(o){const{children:l,elementsRef:a,labelsRef:r,onMapChange:c}=o,f=Oe(c),[,d]=v.useState(!1),m=Zt(WR).current,h=Zt(JR).current,g=v.useRef(0),y=v.useRef(!0),b=v.useRef(null),S=v.useRef(null),E=Oe(()=>{y.current||(y.current=!0,d(H=>!H))}),T=Oe((H,U)=>{h.set(H,U),E()}),C=Oe(H=>{h.delete(H),E()}),O=Oe(H=>{const U=new Map;return a.current.length=0,r&&(r.current.length=0),H.forEach(j=>{U.set(j.element,{...j.registration.metadata??{},index:j.index}),a.current[j.index]=j.element,r&&(r.current[j.index]=j.registration.label!==void 0?j.registration.label:j.registration.textRef?.current?.textContent??j.element.textContent)}),g.current=a.current.length,U});function w(H){if(S.current?.disconnect(),S.current=null,typeof MutationObserver!="function"||H.length<2)return;const U=new MutationObserver(k=>{if(!tC(k))return;let W=null;for(const $ of H)if($.isConnected){if(W&&Lb(W,$)>0){U.disconnect(),E();return}W=$}});S.current=U;const j=new Set;for(let k=1;k<H.length;k+=1){const W=eC(H[k-1],H[k]);W&&j.add(W)}j.forEach(k=>U.observe(k,{childList:!0}))}const D=Oe(()=>{const[H,U]=$R(h),j=O(H),k=b.current,W=!k||k.length!==H.length||H.some(($,F)=>{const Y=k[F];return $.index!==Y.index||$.element!==Y.element||$.registration.index!==Y.registration.index||$.registration.metadata!==Y.registration.metadata});w(U),b.current=H,y.current=!1,W&&(m.forEach($=>$(j)),f(j))});be(()=>(!y.current&&b.current&&O(b.current),()=>{a.current=[],r&&(r.current=[])}),[a,r,O]),be(()=>{y.current&&D()}),be(()=>()=>{S.current?.disconnect(),y.current=!0},[]);const A=Oe(H=>(m.add(H),()=>{m.delete(H)})),M=v.useMemo(()=>({register:T,unregister:C,subscribeMapChange:A,nextIndexRef:g}),[T,C,A,g]);return z.jsx(kb.Provider,{value:M,children:l})}function JR(){return new Map}function WR(){return new Set}function $R(o){const l=new Set,a=[],r=[];o.forEach((f,d)=>{if(!d.isConnected)return;const m=f.index,h={index:m??-1,element:d,registration:f};m===null?r.push(h):m>=0&&(l.add(m),a.push(h))});let c=0;return r.sort((f,d)=>Lb(f.element,d.element)),r.forEach(f=>{for(;l.has(c);)c+=1;f.index=c,a.push(f),c+=1}),l.size>0&&a.sort((f,d)=>f.index-d.index),[a,r.map(f=>f.element)]}function eC(o,l){let a=o.parentElement;for(;a&&!a.contains(l);)a=a.parentElement;return a}function tC(o){for(const l of o)for(let a=0;a<l.removedNodes.length;a+=1)if(l.removedNodes[a].isConnected)return!0;return!1}function Lb(o,l){return o.compareDocumentPosition(l)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}const Bb=v.forwardRef(function(l,a){const{cutout:r,...c}=l;let f;if(r){const d=r.getBoundingClientRect();f=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${d.left}px ${d.top}px,${d.left}px ${d.bottom}px,${d.right}px ${d.bottom}px,${d.right}px ${d.top}px,${d.left}px ${d.top}px)`}return z.jsx("div",{ref:a,role:"presentation","data-base-ui-inert":"",...c,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:f}})});let Ky={},Qy={},Fy="";function Fs(o,l){return Ba(o)?o:l}function Zy(o,l,a){return/hidden|clip/.test(o.getComputedStyle(Fs(l,a)).overflowY)}function nC(o){if(typeof document>"u")return!1;const l=Xe(o);return yt(l).innerWidth-l.documentElement.clientWidth>0}function oC(o){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const a=Xe(o),r=a.documentElement,c=a.body,f=Fs(r,c),d=f.style.overflowY,m=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",f.style.overflowY="scroll";const h=f.offsetWidth;f.style.overflowY="hidden";const g=f.offsetWidth;return f.style.overflowY=d,r.style.scrollbarGutter=m,h===g}function lC(o){const l=Xe(o),a=l.documentElement,r=l.body,c=Fs(a,r),f={overflowY:c.style.overflowY,overflowX:c.style.overflowX};return Object.assign(c.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(c.style,f)}}function iC(o){const l=Xe(o),a=l.documentElement,r=l.body,c=yt(a);let f=0,d=0,m=!1;const h=Zn.create();if(ul&&(c.visualViewport?.scale??1)!==1)return()=>{};function g(){const E=c.getComputedStyle(a),T=c.getComputedStyle(r),w=(E.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";f=a.scrollTop,d=a.scrollLeft,Ky={scrollbarGutter:a.style.scrollbarGutter,overflowY:a.style.overflowY,overflowX:a.style.overflowX},Fy=a.style.scrollBehavior,Qy={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const D=a.scrollHeight>a.clientHeight,A=a.scrollWidth>a.clientWidth,M=E.overflowY==="scroll"||T.overflowY==="scroll",H=E.overflowX==="scroll"||T.overflowX==="scroll",U=Math.max(0,c.innerWidth-r.clientWidth),j=Math.max(0,c.innerHeight-r.clientHeight),k=parseFloat(T.marginTop)+parseFloat(T.marginBottom),W=parseFloat(T.marginLeft)+parseFloat(T.marginRight),$=Fs(a,r);if(m=oC(o),m){a.style.scrollbarGutter=w,$.style.overflowY="hidden",$.style.overflowX="hidden";return}Object.assign(a.style,{scrollbarGutter:w,overflowY:"hidden",overflowX:"hidden"}),(D||M)&&(a.style.overflowY="scroll"),(A||H)&&(a.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:k||j?`calc(100dvh - ${k+j}px)`:"100dvh",width:W||U?`calc(100vw - ${W+U}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),r.scrollTop=f,r.scrollLeft=d,a.setAttribute("data-base-ui-scroll-locked",""),a.style.scrollBehavior="unset"}function y(){Object.assign(a.style,Ky),Object.assign(r.style,Qy),m||(a.scrollTop=f,a.scrollLeft=d,a.removeAttribute("data-base-ui-scroll-locked"),a.style.scrollBehavior=Fy)}function b(){y(),h.request(g)}g();const S=Ye(c,"resize",b);return()=>{h.cancel(),y(),typeof c.removeEventListener=="function"&&S()}}class aC{lockCount=0;restore=null;timeoutLock=yn.create();timeoutUnlock=yn.create();acquire(l){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(l)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(l){if(this.lockCount===0||this.restore!==null)return;const a=Xe(l),r=a.documentElement,c=a.body,f=yt(r);if(Zy(f,r,c)){const m=new f.MutationObserver(()=>{Zy(f,r,c)||(m.disconnect(),this.restore=null,this.lock(l))}),h={attributes:!0};m.observe(r,h),m.observe(c,h),this.restore=()=>m.disconnect();return}const d=Hs||!nC(l);this.restore=d?lC(l):iC(l)}}const rC=new aC;function Yb(o=!0,l=null){be(()=>{if(o)return rC.acquire(l)},[o,l])}const sC=20;function uC(o,l,a,r){const[c,f]=v.useState(!1);be(()=>{if(!o||!l||a==null){f(!1);return}const d=Xe(a).documentElement.clientWidth,m=a.offsetWidth;f(d>0&&m>0&&m>=d-sC)},[o,l,a]),Yb(o&&(!l||c),r)}const cC=v.forwardRef(function(l,a){const{anchor:r,positionMethod:c="absolute",className:f,render:d,side:m,align:h,sideOffset:g=0,alignOffset:y=0,collisionBoundary:b="clipping-ancestors",collisionPadding:S=5,arrowPadding:E=5,sticky:T=!1,disableAnchorTracking:C=!1,collisionAvoidance:O=AE,style:w,...D}=l,{store:A}=ji(),M=FR(),H=Qd(!0),U=A.useState("parent"),j=A.useState("floatingRootContext"),k=A.useState("floatingTreeRoot"),W=A.useState("mounted"),$=A.useState("open"),F=A.useState("modal"),Y=A.useState("openMethod"),ee=A.useState("activeTriggerElement"),le=A.useState("transitionStatus"),K=A.useState("positionerElement"),N=A.useState("instantType"),P=A.useState("adaptiveOrigin"),I=A.useState("lastOpenChangeReason"),Q=A.useState("floatingNodeId"),ne=A.useState("floatingParentNodeId"),R=j.useState("domReferenceElement"),B=v.useRef(null),J=_d(K);let V=r,oe=g,ie=y,he=h,ue=O;U.type==="context-menu"&&(V=r??U.context?.anchor,he=he??"start",!m&&he!=="center"&&(ie=l.alignOffset??2,oe=l.sideOffset??-5));let pe=m,Re=he;U.type==="menu"?(pe=pe??"inline-end",Re=Re??"start",ue=l.collisionAvoidance??Vv):U.type==="menubar"&&(pe=pe??(U.context.orientation==="vertical"?"inline-end":"bottom"),Re=Re??"start");const ze=U.type==="context-menu",ve=Ab({anchor:V,floatingRootContext:j,positionMethod:H?"fixed":c,mounted:W,side:pe,sideOffset:oe,align:Re,alignOffset:ie,arrowPadding:ze?0:E,collisionBoundary:b,collisionPadding:S,sticky:T,nodeId:Q,keepMounted:M,disableAnchorTracking:C,collisionAvoidance:ue,shift:ze?{crossAxis:!("side"in ue&&ue.side==="flip"),rootBoundary:"layoutViewport"}:void 0,externalTree:k,adaptiveOrigin:P});v.useEffect(()=>{function Ee(we){we.open&&(we.parentNodeId===Q&&A.set("hoverEnabled",!1),we.nodeId!==Q&&we.parentNodeId===A.select("floatingParentNodeId")&&A.setOpen(!1,Ke(Da)))}return k.events.on("menuopenchange",Ee),()=>{k.events.off("menuopenchange",Ee)}},[A,k.events,Q]),v.useEffect(()=>{if(A.select("floatingParentNodeId")==null)return;function Ee(we){if(we.open||we.nodeId!==A.select("floatingParentNodeId"))return;const Qe=we.reason??Da;A.setOpen(!1,Ke(Qe))}return k.events.on("menuopenchange",Ee),()=>{k.events.off("menuopenchange",Ee)}},[k.events,A]);const ge=Jt();v.useEffect(()=>{$||ge.clear()},[$,ge]),v.useEffect(()=>{function Ee(we){if(!(!$||we.nodeId!==A.select("floatingParentNodeId")))if(we.target&&ee&&ee!==we.target){const Qe=A.select("closeDelay");Qe>0?ge.isStarted()||ge.start(Qe,()=>{A.setOpen(!1,Ke(Da))}):A.setOpen(!1,Ke(Da))}else ge.clear()}return k.events.on("itemhover",Ee),()=>{k.events.off("itemhover",Ee)}},[k.events,$,ee,A,ge]),v.useEffect(()=>{const Ee={open:$,nodeId:Q,parentNodeId:ne,reason:A.select("lastOpenChangeReason")};k.events.emit("menuopenchange",Ee)},[k.events,$,A,Q,ne]),be(()=>{const Ee=R,we=B.current;if(Ee&&(B.current=Ee),we&&Ee&&Ee!==we){A.set("instantType",void 0);const Qe=new AbortController;return J(()=>{A.set("instantType","trigger-change")},Qe.signal),()=>{Qe.abort()}}},[R,J,A]);const _e={open:$,side:ve.side,align:ve.align,anchorHidden:ve.anchorHidden,nested:U.type==="menu",instant:N},ke=U.type==="menubar"&&U.context.modal;uC($&&(ke||F&&I!==Ut),Y==="touch",K,ee);const xe=Mb(l,_e,{styles:ve.positionerStyles,transitionStatus:le,props:D,refs:[a,A.useStateSetter("positionerElement")],hidden:!W,inert:!$}),Ue=W&&U.type!=="menu"&&(U.type!=="menubar"&&F&&I!==Ut||U.type==="menubar"&&U.context.modal);let Te=null;return U.type==="menubar"?Te=U.context.contentElement:U.type===void 0&&(Te=ee),z.jsxs(zb.Provider,{value:ve,children:[Ue&&z.jsx(Bb,{ref:U.type==="context-menu"||U.type==="nested-context-menu"?U.context.internalBackdropRef:null,inert:Ks(!$),cutout:Te}),z.jsx(NE,{id:Q,children:z.jsx(Jd,{elementsRef:A.context.itemDomElements,labelsRef:A.context.itemLabels,children:xe})})]})}),fC=v.createContext(null);function Ib(o){return v.useContext(fC)}function dC(o){const l=v.useRef(""),a=v.useCallback(c=>{c.defaultPrevented||(l.current=c.pointerType,o(c,c.pointerType))},[o]);return{onClick:v.useCallback(c=>{if(c.detail===0){o(c,"keyboard");return}"pointerType"in c?o(c,c.pointerType):o(c,l.current),l.current=""},[o]),onPointerDown:a}}function pC(o,l){const a=v.useRef(o),r=Oe(l);be(()=>{a.current!==o&&r(a.current),a.current=o},[o,r])}function hC(o,l){const a=Oe((f,d)=>{(typeof o=="function"?o():o)||l(d||(Hs?"touch":""))}),{onClick:r,onPointerDown:c}=dC(a);return v.useMemo(()=>({onClick:r,onPointerDown:c}),[r,c])}function gC(o){const[l,a]=v.useState(null),r=hC(o,a);return pC(o,c=>{c&&!o&&a(null)}),v.useMemo(()=>({openMethod:l,triggerProps:r}),[l,r])}const mC={...Pd,disabled:o=>o.parent.type==="menubar"&&o.parent.context.disabled||o.disabled,modal:o=>(o.parent.type===void 0||o.parent.type==="context-menu")&&(o.modal??!0),openMethod:o=>o.openMethod,allowMouseEnter:o=>o.allowMouseEnter,highlightItemOnHover:o=>o.highlightItemOnHover,parent:o=>o.parent,rootId:o=>o.parent.type==="menu"?o.parent.store.select("rootId"):o.parent.type!==void 0?o.parent.context.rootId:o.rootId,activeIndex:o=>o.activeIndex,isActive:(o,l)=>o.activeIndex===l,hoverEnabled:o=>o.hoverEnabled,instantType:o=>o.instantType,lastOpenChangeReason:o=>o.openChangeReason,floatingTreeRoot:o=>o.parent.type==="menu"?o.parent.store.select("floatingTreeRoot"):o.floatingTreeRoot,floatingNodeId:o=>o.floatingNodeId,floatingParentNodeId:o=>o.floatingParentNodeId,itemProps:o=>o.itemProps,closeDelay:o=>o.closeDelay,adaptiveOrigin:o=>o.adaptiveOrigin,keyboardEventRelay:o=>{if(o.keyboardEventRelay)return o.keyboardEventRelay;if(o.parent.type==="menu")return o.parent.store.select("keyboardEventRelay")}};class yC extends Ia{constructor(l,a,r=!1){const c=new Yd,f=bC(c,a,r,l);super(f,vC(c),mC),this.unsubscribeParentListener=this.observe("parent",d=>{if(this.unsubscribeParentListener?.(),d.type==="menu"){let m=d.store.select("rootId"),h=d.store.select("floatingTreeRoot"),g=d.store.select("keyboardEventRelay");this.unsubscribeParentListener=d.store.subscribe(()=>{const y=d.store.select("rootId"),b=d.store.select("floatingTreeRoot"),S=d.store.select("keyboardEventRelay");m===y&&h===b&&g===S||(m=y,h=b,g=S,this.notifyAll())}),this.context.allowMouseUpTriggerRef=d.store.context.allowMouseUpTriggerRef;return}d.type!==void 0&&(this.context.allowMouseUpTriggerRef=d.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(l,a){this.state.floatingRootContext.context.events.emit("setOpen",{open:l,eventDetails:a})}unsubscribeParentListener=null}function vC(o){return{positionerRef:v.createRef(),popupRef:v.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:v.createRef(),beforeContentFocusGuardRef:v.createRef(),onOpenChangeComplete:void 0,triggerElements:o}}function bC(o,l,a=!1,r){return{...Id(o,l,a),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new Ad,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Ct,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}const SC=v.createContext(void 0);function xC(){return v.useContext(SC)}const TC=Ds(function(l){const{children:a,open:r,onOpenChange:c,onOpenChangeComplete:f,defaultOpen:d=!1,disabled:m=!1,modal:h,loopFocus:g=!0,orientation:y="vertical",actionsRef:b,closeParentOnEsc:S=!1,handle:E,triggerId:T,defaultTriggerId:C=null,highlightItemOnHover:O=!0}=l,w=Qd(!0),D=ji(!0),A=Ib(!0),M=xC(),H=v.useMemo(()=>M&&D?{type:"menu",store:D.store}:A?{type:"menubar",context:A}:w&&!D?{type:"context-menu",context:w}:{type:void 0},[w,D,A,M]),U=jl(),j=jl(),k=Ll(),W=H.type==="menu"?H.store:void 0,$=(r??d)&&W?.state.transitionStatus==="starting",F=Zt(()=>$?W?.state.instantType:void 0).current,Y=EC({open:d,openProp:r,activeTriggerId:C,triggerIdProp:T,parent:H,disabled:m,highlightItemOnHover:O,modal:H.type===void 0?h:void 0,rootId:U,instantType:F},j,k!=null);Y.useControlledProp("openProp",r),Y.useControlledProp("triggerIdProp",T),Y.useContextCallback("onOpenChangeComplete",f);const ee=Y.useState("floatingTreeRoot"),le=Wv(ee),K=Y.useState("open"),N=Y.useState("activeTriggerElement"),P=Y.useState("positionerElement"),I=Y.useState("hoverEnabled"),Q=Y.useState("disabled"),ne=Y.useState("lastOpenChangeReason"),R=Y.useState("parent"),B=Y.useState("activeIndex"),J=Y.useState("payload"),V=Y.useState("floatingParentNodeId"),oe=v.useRef(null),ie=v.useRef(R.type!=="context-menu"),he=Jt(),ue=v.useRef(!0),pe=Jt(),Re=V!=null,{openMethod:ze,triggerProps:ve}=gC(K);Y.useSyncedValues({disabled:m,highlightItemOnHover:O,modal:R.type===void 0?h:void 0,openMethod:ze,rootId:U}),Ud(Y);const{forceUnmount:ge,transitionStatus:_e}=Ld(K,Y,()=>{Y.set("allowMouseEnter",!1)},$),ke=_d(Y.context.popupRef);v.useEffect(()=>{if(F===void 0)return;const Se=()=>{Y.state.instantType===F&&Y.set("instantType",void 0)};if(!K){Se();return}if(_e!==void 0)return;if(Y.context.popupRef.current==null){Se();return}const Ie=new AbortController;return ke(Se,Ie.signal),()=>{Ie.abort()}},[F,K,_e,ke,Y]),be(()=>{w&&!D?Y.update({parent:{type:"context-menu",context:w},floatingNodeId:le,floatingParentNodeId:k}):D&&Y.update({floatingNodeId:le,floatingParentNodeId:k})},[w,D,le,k,Y]),v.useEffect(()=>{if(K||(oe.current=null),R.type==="context-menu"){if(!K){he.clear(),ie.current=!1;return}he.start(500,()=>{ie.current=!0})}},[he,K,R.type]),be(()=>{!K&&!I&&Y.set("hoverEnabled",!0)},[K,I,Y]);const Pe=Oe((Se,Ie)=>{const tt=Ie.reason;if(!Se&&!Y.select("open")||K===Se&&Ie.trigger===N&&ne===tt)return;const pt=pb(Ie);if(!Se&&Ie.trigger==null&&(Ie.trigger=N??void 0),c?.(Se,Ie),Ie.isCanceled)return;Y.state.floatingRootContext.dispatchOpenChange(Se,Ie);const bn=Ie.event;if(Se===!1&&bn?.type==="click"&&bn.pointerType==="touch"&&!ue.current)return;Se&&tt===Oi?(ue.current=!1,pe.start(300,()=>{ue.current=!0})):(ue.current=!0,pe.clear());const Hn=(tt===_i||tt===Sv)&&bn.detail===0,Sn=!Se&&(tt===Ps||tt==null);oe.current=Ie.event;const At=kd(Y.state,Se,Ie.trigger,pt());At.openChangeReason=tt,R.type==="menubar"&&(tt===Oi||tt===Ni||tt===Ut||tt===Vf||tt===Da)?At.instantType="group":Hn||Sn?At.instantType=Hn?"click":"dismiss":At.instantType=void 0,Y.update(At)}),xe=cb({popupStore:Y,floatingRootContext:Y.state.floatingRootContext,floatingId:j,nested:k!=null,onOpenChange:Pe}),Ue=xe.context.events;be(()=>{const Se=({open:Ie,eventDetails:tt})=>Pe(Ie,tt);return Ue.on("setOpen",Se),()=>{Ue?.off("setOpen",Se)}},[Ue,Pe]);const Te=v.useCallback(()=>{Y.setOpen(!1,Ke(vd))},[Y]);v.useImperativeHandle(b,()=>({unmount:ge,close:Te}),[ge,Te]);let Ee;R.type==="context-menu"&&(Ee=R.context),v.useImperativeHandle(Ee?.positionerRef,()=>P,[P]),v.useImperativeHandle(Ee?.actionsRef,()=>({setOpen:Pe}),[Pe]);const we=Dd(xe,{enabled:!Q,bubbles:{escapeKey:S&&R.type==="menu"},outsidePress(){return R.type!=="context-menu"||oe.current?.type==="contextmenu"?!0:ie.current},externalTree:Re?ee:void 0}),Qe=Xd(),Ae=v.useCallback(Se=>{Y.select("activeIndex")!==Se&&Y.set("activeIndex",Se)},[Y]),fe=Q1(xe,{enabled:!Q,listRef:Y.context.itemDomElements,activeIndex:B,nested:R.type!==void 0,loopFocus:g,orientation:y,parentOrientation:R.type==="menubar"?R.context.orientation:void 0,rtl:Qe==="rtl",disabledIndices:Eo,onNavigate:Ae,openOnArrowKeyDown:R.type!=="context-menu",externalTree:Re?ee:void 0,focusItemOnHover:O}),me=v.useCallback(Se=>{Y.context.typingRef.current=Se},[Y]),de=F1(xe,{enabled:!Q,listRef:Y.context.itemLabels,elementsRef:Y.context.itemDomElements,activeIndex:B,resetMs:SE,onMatch:Se=>{K&&Se!==B&&Y.set("activeIndex",Se)},onTyping:me}),ae=v.useMemo(()=>{const Se=To(de.reference,fe.reference,we.reference,{onMouseMove(){Y.set("allowMouseEnter",!0)}},ve);return Se["aria-haspopup"]="menu",Se["aria-expanded"]=K,Se},[Y,de.reference,fe.reference,we.reference,ve,K]),ye=v.useMemo(()=>{const Se=To(fe.trigger,we.trigger,ve);return Se["aria-haspopup"]="menu",Se["aria-expanded"]=!1,Se},[fe.trigger,we.trigger,ve]);Zt(()=>(Y.update({inactiveTriggerProps:ye}),null));const Le=v.useMemo(()=>To(Hd,{id:j,role:"menu","aria-orientation":y==="horizontal"?"horizontal":void 0,"aria-labelledby":N?.id,onMouseMove(){Y.set("allowMouseEnter",!0),R.type==="menu"&&Y.set("hoverEnabled",!1)},onClick(){Y.select("hoverEnabled")&&Y.set("hoverEnabled",!1)},onKeyDown(Se){const Ie=Y.select("keyboardEventRelay");Ie&&!Se.isPropagationStopped()&&Ie(Se)}},de.floating,fe.floating,we.floating),[N,j,y,R.type,Y,de.floating,fe.floating,we.floating]),Lt=fe.item??Ct;Bd(Y,{floatingRootContext:xe,activeTriggerProps:ae,inactiveTriggerProps:ye,popupProps:Le,itemProps:Lt});const $t=v.useMemo(()=>({store:Y,parent:H}),[Y,H]),Tt=z.jsxs(Hb.Provider,{value:$t,children:[E&&z.jsx(jd,{handle:E,store:Y}),typeof a=="function"?a({payload:J}):a]});return R.type===void 0||R.type==="context-menu"?z.jsx(zE,{externalTree:ee,children:Tt}):Tt});function EC(o,l,a){return Zt(()=>new yC(o,l,a)).current}const ps=5;function RC(o,l){const a=CC(l);return o.clientX>=a.left-ps&&o.clientX<=a.right+ps&&o.clientY>=a.top-ps&&o.clientY<=a.bottom+ps}function CC(o){const l=o.getBoundingClientRect(),a=yt(o);if(sd)return l;const r=a.getComputedStyle(o,"::before"),c=a.getComputedStyle(o,"::after");if(!(r.content!=="none"||c.content!=="none"))return l;const d=parseFloat(r.width)||0,m=parseFloat(r.height)||0,h=parseFloat(c.width)||0,g=parseFloat(c.height)||0,y=Math.max(l.width,d,h),b=Math.max(l.height,m,g),S=y-l.width,E=b-l.height;return{left:l.left-S/2,right:l.right+S/2,top:l.top-E/2,bottom:l.bottom+E/2}}function qb(o={}){const{highlightItemOnHover:l,highlightedIndex:a,onHighlightedIndexChange:r}=Qs(),{ref:c,index:f}=Fd(o),d=a===f,m=v.useRef(null),h=_l(c,m);return{compositeProps:{tabIndex:d?0:-1,onFocus(){r(f)},onMouseMove(){const y=m.current;if(!l||!y)return;const b=y.hasAttribute("disabled")||y.ariaDisabled==="true";!d&&!b&&y.focus()}},compositeRef:h,index:f}}function OC(o){const{render:l,className:a,style:r,state:c=Ct,props:f=Eo,refs:d=Eo,metadata:m,stateAttributesMapping:h,tag:g="div",...y}=o,{compositeProps:b,compositeRef:S}=qb({metadata:m});return St(g,o,{state:c,ref:[S,...d],props:[b,...f,y],stateAttributesMapping:h})}function Pb(o){if(dt(o)&&o.hasAttribute("data-rootownerid"))return o.getAttribute("data-rootownerid");if(!bo(o))return Pb(Ro(o))}function wC(o,l){const a=v.useRef(null);function r(f){qn.flushSync(()=>{o.setOpen(!1,Ke(Ni,f.nativeEvent,f.currentTarget))}),tE(a.current)?.focus()}function c(f){const d=o.select("positionerElement");if(d&&Ai(f,d))o.context.beforeContentFocusGuardRef.current?.focus();else{qn.flushSync(()=>{o.setOpen(!1,Ke(Ni,f.nativeEvent,f.currentTarget))});let m=eE(o.context.triggerFocusTargetRef.current||l.current);for(;m!==null&&De(d,m);){const h=m;if(m=Rd(m),m===h)break}m?.focus()}}return{preFocusGuardRef:a,handlePreFocusGuardFocus:r,handleFocusTargetFocus:c}}function AC(o){const{enabled:l=!0,mouseDownAction:a,open:r}=o,c=v.useRef(!1);return v.useMemo(()=>l?{onMouseDown:f=>{(a==="open"&&!r||a==="close"&&r)&&(c.current=!0,Xe(f.currentTarget).addEventListener("click",()=>{c.current=!1},{once:!0}))},onClick:f=>{c.current&&(c.current=!1,f.preventBaseUIHandler())}}:Ct,[l,a,r])}const MC=dv(function(l,a){const{render:r,className:c,style:f,disabled:d=!1,nativeButton:m=!0,id:h,openOnHover:g,delay:y=100,closeDelay:b=0,handle:S,payload:E,...T}=l,C=ji(!0),w=mb(S)??C?.store;if(!w)throw new Error(Qt(85));const D=Bl(h),A=w.useState("isTriggerActive",D),M=w.useState("floatingRootContext"),H=w.useState("isOpenedByTrigger",D),U=w.useState("triggerPopupId",D),j=v.useRef(null),k=NC(),W=Qs(!0),$=cl(),F=v.useMemo(()=>$??new Ad,[$]),Y=Wv(F),ee=Ll(),{registerTrigger:le,isMountedByThisTrigger:K}=hb(D,j,w,{payload:E,closeDelay:b,parent:k,floatingTreeRoot:F,floatingNodeId:Y,floatingParentNodeId:ee,keyboardEventRelay:W?.relayKeyboardEvent}),N=k.type==="menubar",P=w.useState("disabled"),I=d||P||N&&k.context.disabled,{getButtonProps:Q,buttonRef:ne}=qa({disabled:I,native:m});v.useEffect(()=>{!H&&k.type===void 0&&(w.context.allowMouseUpTriggerRef.current=!1)},[w,H,k.type]);const R=v.useRef(null),B=Jt(),J=Oe(Ee=>{if(!R.current)return;B.clear(),w.context.allowMouseUpTriggerRef.current=!1;const we=Ee.target;De(R.current,we)||De(w.select("positionerElement"),we)||we===R.current||we!=null&&Pb(we)===w.select("rootId")||RC(Ee,R.current)||F.events.emit("close",{domEvent:Ee,reason:wT})});v.useEffect(()=>{H&&w.select("lastOpenChangeReason")===Ut&&Xe(R.current).addEventListener("mouseup",J,{once:!0})},[H,J,w]);const V=N&&k.context.hasSubmenuOpen,ie=Sb(M,{enabled:(g??V)&&!I&&(!N||V&&!K),handleClose:xb({blockPointerEvents:!N}),mouseOnly:!0,move:!1,restMs:k.type===void 0?y:void 0,delay:{close:b},triggerElementRef:j,externalTree:F,isActiveTrigger:A,isClosing:()=>w.select("transitionStatus")==="ending"}),he=DC(H,w.select("lastOpenChangeReason")),ue=jE(M,{enabled:!I,event:H&&N?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:k.type===void 0?he:!1}),pe=yb(M,{enabled:!I&&V}),Re=AC({open:H,enabled:N,mouseDownAction:"open"}),ze=v.useMemo(()=>To(pe.reference,ue.reference),[pe.reference,ue.reference]),ve=w.useState("triggerProps",K),{preFocusGuardRef:ge,handlePreFocusGuardFocus:_e,handleFocusTargetFocus:ke}=wC(w,j),Pe={disabled:I,open:H},xe=[R,a,ne,le,j],Ue=[ze,ie??Ct,ve,{"aria-haspopup":"menu","aria-controls":U,id:D,onMouseDown:Ee=>{if(w.select("open"))return;B.start(200,()=>{w.context.allowMouseUpTriggerRef.current=!0}),Xe(Ee.currentTarget).addEventListener("mouseup",J,{once:!0})}},N?{role:"menuitem"}:{},Re,T,Q],Te=St("button",l,{enabled:!N,stateAttributesMapping:iy,state:Pe,ref:xe,props:Ue});return N?z.jsx(OC,{tag:"button",render:r,className:c,style:f,state:Pe,refs:xe,props:Ue,stateAttributesMapping:iy}):H?z.jsxs(v.Fragment,{children:[z.jsx(Hl,{ref:ge,onFocus:_e},`${D}-pre-focus-guard`),z.jsx(v.Fragment,{children:Te},D),z.jsx(Hl,{ref:w.context.triggerFocusTargetRef,onFocus:ke},`${D}-post-focus-guard`)]}):z.jsx(v.Fragment,{children:Te},D)});function DC(o,l){const a=Jt(),[r,c]=v.useState(!1);return be(()=>{o&&l===Ut?(c(!0),a.start(xE,()=>{c(!1)})):o||(a.clear(),c(!1))},[o,l,a]),r}function NC(){const o=Ib();return v.useMemo(()=>o?{type:"menubar",context:o}:{type:void 0},[o])}const zC=v.forwardRef(function(l,a){const{className:r,render:c,orientation:f="horizontal",style:d,...m}=l;return St("div",l,{state:{orientation:f},ref:a,props:[{role:"separator","aria-orientation":f},m]})});function _C(o){return o==null||o.hasAttribute("disabled")||o.getAttribute("aria-disabled")==="true"}const HC=o=>o?.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();function jC(o,l,a=[]){if(l==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:HC(o),size:24,node:l,...a.length>0?{aliases:a}:{}}}const kC=o=>{let l="",a=!1;for(const r of o){if(r==="-"||r==="_"||r<=" "){a=l.length>0;continue}l.length===0?l+=r.toLowerCase():l+=a?r.toUpperCase():r,a=!1}return l};const UC=o=>{const l=kC(o);return l.charAt(0).toUpperCase()+l.slice(1)};const nd=(...o)=>o.filter((l,a,r)=>!!l&&l.trim()!==""&&r.indexOf(l)===a).join(" ").trim();const Nl={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};function Df(o){return o!=null}function LC(o,l={}){const a=l.attributeNames??{},r=S=>a[S]??S,c=o.size??o.width??Nl.width,f=o.size??o.height??Nl.height,d=o.aliases?.filter(S=>typeof S=="string"&&S.trim()!=="").map(S=>`lucide-${S}`)??[],m=[...o.name?[`lucide-${o.name}`]:[],...d],h=l.className?.split(" ").filter(Boolean)??[],g=l.includeDefaultClasses===!1?nd(...h):nd("lucide",...m,...h),y=l.absoluteStrokeWidth?Number(l.strokeWidth??Nl["stroke-width"])*Number(o.size??o.width??Nl.width)/Number(l.size??l.width??Nl.width):l.strokeWidth??Nl["stroke-width"];return["svg",{...Object.entries(Nl).reduce((S,[E,T])=>(S[r(E)]=T,S),{}),..."color"in l&&l.color&&{[r("stroke")]:l.color},..."size"in l&&Df(l.size)&&{[r("width")]:l.size,[r("height")]:l.size},..."width"in l&&Df(l.width)&&{[r("width")]:l.width},..."height"in l&&Df(l.height)&&{[r("height")]:l.height},[r("stroke-width")]:y,...g&&{[r("class")]:g},[r("viewBox")]:`0 0 ${c} ${f}`,...l.hasA11yProp===!1?{[r("aria-hidden")]:"true"}:{},..."attributes"in l&&l.attributes},o.node.map(S=>{const[E,T,C]=S,O=l.nonScalingStroke?{[r("vector-effect")]:"non-scaling-stroke",...T}:T;return C?[E,O,C]:[E,O]})]}function BC(o,l={}){return LC(o,{...l,attributeNames:{...l.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}const YC=o=>{for(const l in o)if(l.startsWith("aria-")||l==="role"||l==="title")return!0;return!1},IC=v.createContext({}),qC=()=>v.useContext(IC),PC=v.forwardRef(({color:o,size:l,width:a,height:r,strokeWidth:c,absoluteStrokeWidth:f,nonScalingStroke:d,className:m="",children:h,iconNode:g=[],icon:y={node:g,aliases:[],size:24},...b},S)=>{const{size:E=24,strokeWidth:T=2,absoluteStrokeWidth:C=!1,nonScalingStroke:O=!1,color:w="currentColor",className:D=""}=qC()??{},A=!!h||YC(b),[M,H,U=[]]=BC(y,{color:o??w,width:a??l??E,height:r??l??E,strokeWidth:c??T,absoluteStrokeWidth:f??C,nonScalingStroke:d??O,className:nd(D,m),hasA11yProp:A,attributes:b});return v.createElement(M,{ref:S,...H},[...U.map(([j,k])=>v.createElement(j,k)),...Array.isArray(h)?h:[h]])});function Pn(o,l=[],a=[]){const r=typeof o=="string"?jC(o,l,a):o,c=v.forwardRef(({className:f,...d},m)=>v.createElement(PC,{ref:m,icon:r,className:f,...d}));return r.name&&(c.displayName=UC(r.name)),c}const Vb={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};Vb.node;const VC=Pn(Vb);const Gb={name:"ellipsis",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],aliases:["more-horizontal"]};Gb.node;const GC=Pn(Gb);const Xb={name:"message-square",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]};Xb.node;const XC=Pn(Xb);const Kb={name:"pencil",size:24,node:[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]};Kb.node;const KC=Pn(Kb);const Qb={name:"pin-off",size:24,node:[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89",key:"znwnzq"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11",key:"c9qhm2"}]]};Qb.node;const QC=Pn(Qb);const Fb={name:"pin",size:24,node:[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]};Fb.node;const Jy=Pn(Fb);const Zb={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};Zb.node;const Jb=Pn(Zb);const Wb={name:"shapes",size:24,node:[["path",{d:"M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z",key:"1bo67w"}],["rect",{x:"3",y:"14",width:"7",height:"7",rx:"1",key:"1bkyp8"}],["circle",{cx:"17.5",cy:"17.5",r:"3.5",key:"w3z12y"}]]};Wb.node;const FC=Pn(Wb);const $b={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};$b.node;const ZC=Pn($b);const e0={name:"triangle-alert",size:24,node:[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["alert-triangle"]};e0.node;const Wd=Pn(e0);const t0={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};t0.node;const n0=Pn(t0),JC="rounded-lg bg-surface p-1 text-[13px] text-fg shadow-popup outline-none origin-[var(--transform-origin)] transition-[opacity,transform] duration-100 data-[starting-style]:opacity-0 data-[starting-style]:scale-95 data-[ending-style]:opacity-0",WC="flex h-7 min-w-40 cursor-default select-none items-center gap-2 rounded-md px-2 outline-none data-[highlighted]:bg-hover data-[disabled]:opacity-40";function $C({trigger:o,children:l,side:a="bottom",align:r="start",open:c,onOpenChange:f}){return z.jsxs(TC,{open:c,onOpenChange:f?d=>f(d):void 0,children:[z.jsx(MC,{render:o,onKeyDown:Ms}),z.jsx(ZR,{children:z.jsx(cC,{side:a,align:r,sideOffset:6,className:"z-[1000]",children:z.jsx(QR,{className:JC,children:l})})})]})}function hs({children:o,onSelect:l,icon:a,shortcut:r,disabled:c,danger:f}){return z.jsxs(qR,{className:Oo(WC,f&&"text-danger"),disabled:c,onClick:l,onKeyDown:Ms,children:[z.jsx("span",{className:"flex size-4 items-center justify-center text-fg-muted",children:a}),z.jsx("span",{className:"flex-1",children:o}),r?z.jsx("span",{className:"ml-4 text-xs text-fg-subtle",children:r}):null]})}function eO(){return z.jsx(zC,{className:"mx-1 my-1 h-px bg-line"})}const o0=v.createContext(void 0);function Yl(o){const l=v.useContext(o0);if(!o&&l===void 0)throw new Error(Qt(27));return l}const tO=v.forwardRef(function(l,a){const{render:r,className:c,style:f,forceRender:d=!1,...m}=l,h=Yl(),g=h.useState("open"),y=h.useState("nested"),b=h.useState("mounted"),S=h.useState("transitionStatus");return St("div",l,{state:{open:g,transitionStatus:S},ref:[h.context.backdropRef,a],stateAttributesMapping:md,props:[{role:"presentation",hidden:!b,style:{userSelect:"none",WebkitUserSelect:"none"}},m],enabled:d||!y})}),nO=v.forwardRef(function(l,a){const{render:r,className:c,style:f,disabled:d=!1,nativeButton:m=!0,...h}=l,g=Yl(),y=g.useState("open"),{getButtonProps:b,buttonRef:S}=qa({disabled:d,native:m}),E={disabled:d};function T(C){y&&g.setOpen(!1,Ke(OT,C.nativeEvent))}return St("button",l,{state:E,ref:[a,S],props:[{onClick:T},h,b]})}),oO=v.forwardRef(function(l,a){const{render:r,className:c,style:f,id:d,...m}=l,h=Yl(),g=Bl(d);return h.useSyncedValueWithCleanup("descriptionElementId",g),St("p",l,{ref:a,props:[{id:g},m]})}),l0=v.createContext(void 0);function lO(){const o=v.useContext(l0);if(o===void 0)throw new Error(Qt(26));return o}const iO="--nested-dialogs",aO="data-nested-dialog-open",rO={...gd,...Ys,nestedDialogOpen(o){return o?{[aO]:""}:null}},sO=v.forwardRef(function(l,a){const{render:r,className:c,style:f,finalFocus:d,initialFocus:m,...h}=l,g=Yl(),y=g.useState("descriptionElementId"),b=g.useState("disablePointerDismissal"),S=g.useState("floatingRootContext"),E=g.useState("popupProps"),T=g.useState("modal"),C=g.useState("mounted"),O=g.useState("nested"),w=g.useState("nestedOpenDialogCount"),D=g.useState("open"),A=g.useState("openMethod"),M=g.useState("titleElementId"),H=g.useState("transitionStatus"),U=g.useState("role"),j=S.useState("floatingId");lO(),Hi({open:D,ref:g.context.popupRef,onComplete(){D&&g.context.onOpenChangeComplete?.(!0)}});const k=m===void 0?U1(g.context.popupRef):m,W=w>0,$=g.useStateSetter("popupElement"),Y=St("div",l,{state:{open:D,nested:O,transitionStatus:H,nestedDialogOpen:W},props:[E,{id:j,"aria-labelledby":M,"aria-describedby":y,role:U,...Hd,hidden:!C,onKeyDown(ee){Zd.has(ee.key)&&ee.stopPropagation()},style:{[iO]:w}},h],ref:[a,g.context.popupRef,$],stateAttributesMapping:rO});return z.jsx($v,{context:S,openInteractionType:A,disabled:!C,closeOnFocusOut:!b,initialFocus:k,returnFocus:d,modal:T!==!1,restoreFocus:"popup",children:Y})}),uO=v.forwardRef(function(l,a){const{keepMounted:r=!1,...c}=l,f=Yl(),d=f.useState("mounted"),m=f.useState("modal"),h=f.useState("open");return d||r?z.jsx(l0.Provider,{value:r,children:z.jsxs(Qv,{ref:a,...c,children:[d&&m===!0&&z.jsx(Bb,{ref:f.context.internalBackdropRef,inert:Ks(!h)}),l.children]})}):null});function cO({store:o,parentContext:l,isDrawer:a}){const r=o.useState("open"),c=o.useState("disablePointerDismissal"),f=o.useState("modal"),d=o.useState("popupElement"),m=o.useState("floatingRootContext"),[h,g]=v.useState(0),[y,b]=v.useState(0),S=h===0,E=Dd(m,{outsidePressEvent(){return o.context.internalBackdropRef.current||o.context.backdropRef.current?"intentional":{mouse:f==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(T){if(!o.context.outsidePressEnabledRef.current||"button"in T&&T.button!==0)return!1;if("touches"in T){if(T.type==="touchend"){if(T.changedTouches.length!==1||T.touches.length!==0)return!1}else if(T.touches.length!==1)return!1}const C=bt(T);if(S&&!c){if(f){const O=o.context.internalBackdropRef.current,w=o.context.backdropRef.current;return O||w?O===C||w===C||De(C,d)&&!C?.hasAttribute("data-base-ui-portal"):!0}return!0}return!1},escapeKey:S});return Yb(r&&f===!0,d),o.useContextCallback("onNestedDialogOpen",(T,C)=>{g(T),b(C)}),be(()=>(l?.onNestedDialogOpen&&(r?l.onNestedDialogOpen(h+1,y+(a?1:0)):l.onNestedDialogOpen(0,0)),()=>{l?.onNestedDialogOpen&&r&&l.onNestedDialogOpen(0,0)}),[a,r,h,y,l]),Bd(o,{activeTriggerProps:E.reference,inactiveTriggerProps:E.trigger,popupProps:E.floating,nestedOpenDialogCount:h,nestedOpenDrawerCount:y}),null}const fO={...Pd,modal:o=>o.modal,nested:o=>o.nested,nestedOpenDialogCount:o=>o.nestedOpenDialogCount,nestedOpenDrawerCount:o=>o.nestedOpenDrawerCount,disablePointerDismissal:o=>o.disablePointerDismissal,openMethod:o=>o.openMethod,descriptionElementId:o=>o.descriptionElementId,titleElementId:o=>o.titleElementId,viewportElement:o=>o.viewportElement,role:o=>o.role};class dO extends Ia{constructor(l,a,r){const c=new Yd,f=pO(l,c,a,r);super(f,hO(c),fO)}setOpen=(l,a)=>{a.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!l&&a.trigger==null&&this.state.activeTriggerId!=null&&(a.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(l,a),!a.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(l,a),this.update(kd(this.state,l,a.trigger)))}}function pO(o,l,a,r=!1){return{...Id(l,a,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...o}}function hO(o){return{popupRef:v.createRef(),backdropRef:v.createRef(),internalBackdropRef:v.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:o,onOpenChange:void 0,onOpenChangeComplete:void 0}}function gO(o,l){const{children:a,open:r,defaultOpen:c=!1,onOpenChange:f,onOpenChangeComplete:d,disablePointerDismissal:m=!1,modal:h=!0,actionsRef:g,handle:y,triggerId:b,defaultTriggerId:S=null}=l,E=o==="drawer",T=h,C=m,O="dialog",w=Yl(!0),D=w!=null,A={modal:T,disablePointerDismissal:C,nested:D,role:O},M=db(($,F)=>new dO({open:c,openProp:r,activeTriggerId:S,triggerIdProp:b,...A},$,F),!0);M.useControlledProp("openProp",r),M.useControlledProp("triggerIdProp",b),M.useSyncedValues(A),M.useContextCallback("onOpenChange",f),M.useContextCallback("onOpenChangeComplete",d);const H=M.useState("open"),U=M.useState("mounted"),j=M.useState("payload");Y1(M,H),Ud(M);const{forceUnmount:k}=Ld(H,M);v.useImperativeHandle(g,()=>({unmount:k,close:()=>M.setOpen(!1,Ke(vd))}),[k,M]);const W=H||U;return z.jsxs(o0.Provider,{value:M,children:[y&&z.jsx(jd,{handle:y,store:M}),W&&z.jsx(cO,{store:M,parentContext:w?.context,isDrawer:E}),typeof a=="function"?a({payload:j}):a]})}const mO=Ds(function(l){return gO("dialog",l)}),yO=v.forwardRef(function(l,a){const{render:r,className:c,style:f,id:d,...m}=l,h=Yl(),g=Bl(d);return h.useSyncedValueWithCleanup("titleElementId",g),St("h2",l,{ref:a,props:[{id:g},m]})});function i0({open:o,onOpenChange:l,title:a,description:r,children:c,footer:f,className:d}){return z.jsx(mO,{open:o,onOpenChange:m=>l(m),children:z.jsxs(uO,{children:[z.jsx(tO,{className:"fixed inset-0 z-[900] bg-black/30 transition-opacity data-[starting-style]:opacity-0 data-[ending-style]:opacity-0"}),z.jsxs(sO,{className:Oo("fixed left-1/2 top-1/2 z-[901] w-[min(28rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 rounded-xl bg-surface p-5 text-fg shadow-popup outline-none","transition-[opacity,transform] data-[starting-style]:scale-95 data-[starting-style]:opacity-0 data-[ending-style]:opacity-0",d),children:[z.jsxs("div",{className:"mb-3 flex items-start gap-3",children:[z.jsxs("div",{className:"flex-1",children:[z.jsx(yO,{className:"text-[15px] font-semibold",children:a}),r?z.jsx(oO,{className:"mt-1 text-fg-muted",children:r}):null]}),z.jsx(nO,{"aria-label":"Close",className:"rounded-md p-1 text-fg-muted hover:bg-hover",children:z.jsx(n0,{className:"size-4"})})]}),c,f?z.jsx("div",{className:"mt-4 flex justify-end gap-2",children:f}):null]})]})})}const $d="data-composite-item-active";function vO(o){const{loopFocus:l=!0,orientation:a="both",grid:r,onLoop:c,direction:f,highlightedIndex:d,onHighlightedIndexChange:m,rootRef:h,enableHomeAndEndKeys:g=!1,stopEventPropagation:y,disabledIndices:b,modifierKeys:S=Eo}=o,[E,T]=v.useState(0),C=r!=null,O=v.useRef(null),w=_l(O,h),D=v.useRef([]),A=v.useRef(!1),M=v.useRef(null),H=d??E,U=Oe((F,Y=!1)=>{if(M.current=D.current[F]??null,(m??T)(F),Y){const ee=D.current[F];Gy(O.current,ee,f,a)}}),j=Oe(F=>{if(F.size===0)return;if(A.current){const K=D.current,N=K.indexOf(M.current);if(N===-1){const P=K[H];!P||wi(K,H,b)?U(bO(K,b)):M.current=P}else N!==H&&U(N);return}A.current=!0;const Y=Array.from(F.keys()),ee=Y.find(K=>K?.hasAttribute($d))??null,le=ee?F.get(ee)?.index??-1:-1;if(le!==-1)U(le);else if(wi(Y,H,b)){const K=vo(Y,{disabledIndices:b});za(Y,K)||U(K)}Gy(O.current,ee,f,a)});be(()=>{if(b==null||d!=null||!A.current)return;const F=D.current;if(wi(F,H,b)){const Y=vo(F,{disabledIndices:b});za(F,Y)||U(Y)}},[b,d,H,D,U]);const k=Oe((F,Y,ee)=>c?c(F,Y,ee,D):ee),W=Oe(F=>{const Y=F.key===ed||F.key===td;if(!Zd.has(F.key)||!g&&Y||SO(F,S)||!O.current)return;const le=f==="rtl",K=le?Wf:$f,N=le?$f:Wf,P=a==="vertical"?Jf:K,I=a==="vertical"?Zf:N,Q=bt(F.nativeEvent);if(Q!=null&&Vy(Q)&&!_C(Q)){const oe=Q.selectionStart,ie=Q.selectionEnd,he=Q.value;if(oe==null||F.shiftKey||oe!==ie||F.key!==I&&oe<he.length||F.key!==P&&oe>0)return}let ne=H;const R=gs(D,b),B=Xf(D,b);r!=null&&(ne=r({disabledIndices:b,elementsRef:D,event:F,highlightedIndex:H,loopFocus:l,maxIndex:B,minIndex:R,onLoop:k,orientation:a,rtl:le}));const J=a!=="vertical"&&F.key===K||a!=="horizontal"&&F.key===Jf,V=a!=="vertical"&&F.key===N||a!=="horizontal"&&F.key===Zf;g&&(F.key===ed?ne=R:F.key===td&&(ne=B)),ne===H&&(J||V)&&(l&&ne===B&&J?(ne=R,c&&(ne=c(F,H,ne,D))):l&&ne===R&&V?(ne=B,c&&(ne=c(F,H,ne,D))):ne=vo(D.current,{startingIndex:ne,decrement:V,disabledIndices:b})),ne!==H&&!za(D.current,ne)&&(y&&F.stopPropagation(),(C||Y||J||V)&&F.preventDefault(),U(ne,!0),queueMicrotask(()=>{D.current[ne]?.focus()}))});return{props:{ref:w,onFocus(F){const Y=O.current,ee=bt(F.nativeEvent);!Y||ee==null||!Vy(ee)||ee.setSelectionRange(0,ee.value.length)},onKeyDown:W},highlightedIndex:H,onHighlightedIndexChange:U,elementsRef:D,onMapChange:j,relayKeyboardEvent:W}}function bO(o,l){let a=-1;for(let r=0;r<o.length;r+=1){const c=o[r];if(!(!c||wi(o,r,l))){if(c.hasAttribute($d))return r;a===-1&&(a=r)}}return Math.max(a,0)}function SO(o,l){for(const a of XR)if(!l.includes(a)&&o.getModifierState(a))return!0;return!1}function xO(o){const{render:l,className:a,style:r,refs:c=Eo,props:f=Eo,state:d=Ct,stateAttributesMapping:m,highlightedIndex:h,onHighlightedIndexChange:g,orientation:y,grid:b,loopFocus:S,onLoop:E,enableHomeAndEndKeys:T,onMapChange:C,stopEventPropagation:O=!0,rootRef:w,disabledIndices:D,modifierKeys:A,highlightItemOnHover:M=!1,tag:H="div",...U}=o,j=Xd(),{props:k,highlightedIndex:W,onHighlightedIndexChange:$,elementsRef:F,onMapChange:Y,relayKeyboardEvent:ee}=vO({grid:b,loopFocus:S,onLoop:E,orientation:y,highlightedIndex:h,onHighlightedIndexChange:g,rootRef:w,stopEventPropagation:O,enableHomeAndEndKeys:T,direction:j,disabledIndices:D,modifierKeys:A}),le=St(H,o,{state:d,ref:c,props:[k,...f,U],stateAttributesMapping:m}),K=v.useMemo(()=>({highlightedIndex:W,onHighlightedIndexChange:$,highlightItemOnHover:M,relayKeyboardEvent:ee}),[W,$,M,ee]);return z.jsx(jb.Provider,{value:K,children:z.jsx(Jd,{elementsRef:F,onMapChange:N=>{C?.(N),Y(N)},children:le})})}const TO="h-7 w-full min-w-0 rounded-control border border-line bg-surface-2 px-2 text-[13px] text-fg outline-none placeholder:text-fg-subtle focus:border-accent focus:bg-surface",od=v.forwardRef(function({className:l,...a},r){return z.jsx("input",{ref:r,className:Oo(TO,l),...a})}),a0=v.createContext(void 0);function ep(){const o=v.useContext(a0);if(o===void 0)throw new Error(Qt(64));return o}const EO="data-activation-direction",Zs={tabActivationDirection:o=>({[EO]:o})},RO=v.forwardRef(function(l,a){const{className:r,defaultValue:c=0,onValueChange:f,orientation:d="horizontal",render:m,value:h,style:g,...y}=l,b=l.defaultValue!==void 0,S=v.useRef([]),[E,T]=v.useState(()=>new Map),[C,O]=jR({controlled:h,default:c,name:"Tabs",state:"value"}),w=h!==void 0,[D,A]=v.useState(()=>new Map),M=v.useRef(void 0),H=v.useCallback(ue=>ld(D,ue),[D]),[U,j]=v.useState(()=>({previousValue:C,tabActivationDirection:"none"})),{previousValue:k,tabActivationDirection:W}=U;let $=W,F=!1;k!==C&&($=Wy(k,C,d,D),F=k!=null&&C!=null&&H(C)==null);const Y=F?k:C,ee=k!==Y||W!==$;be(()=>{ee&&j({previousValue:Y,tabActivationDirection:$})},[Y,ee,$]);const le=Oe((ue,pe)=>{const Re=Wy(C,ue,d,D);pe.activationDirection=Re,f?.(ue,pe),!pe.isCanceled&&O(ue)}),K=Oe((ue,pe)=>{f?.(ue,Ke(pe,void 0,void 0,{activationDirection:"none"}))}),N=Oe((ue,pe)=>(T(Re=>{const ze=new Map(Re);return ze.set(ue,pe),ze}),()=>{T(Re=>{if(Re.get(ue)!==pe)return Re;const ze=new Map(Re);return ze.delete(ue),ze})})),P=v.useCallback(ue=>E.get(ue),[E]),I=v.useCallback(ue=>{for(const pe of D.values())if(ue===pe.value)return pe.id},[D]),Q=v.useMemo(()=>({getTabElementBySelectedValue:H,getTabIdByPanelValue:I,getTabPanelIdByValue:P,onValueChange:le,orientation:d,registerMountedTabPanel:N,setTabMap:A,tabActivationDirection:$,value:C}),[H,I,P,le,d,N,A,$,C]),ne=v.useMemo(()=>{for(const ue of D.values())if(ue.value===C)return ue},[D,C]),R=v.useMemo(()=>{for(const ue of D.values())if(!ue.disabled)return ue.value},[D]),B=v.useRef(!b),J=v.useRef(c),V=v.useRef(b),oe=v.useRef(!1);be(()=>{if(w)return;function ue(ve,ge){O(ve),j({previousValue:ve,tabActivationDirection:"none"}),K(ve,ge),B.current=!1}if(D.size===0){oe.current&&C!==null&&!M.current?.isConnected&&ue(null,ry);return}oe.current=!0,M.current=D.keys().next().value;const pe=ne?.disabled,Re=ne==null&&C!==null;if(!pe&&C===J.current&&(V.current=!1),V.current&&pe&&C===J.current)return;const ze=B.current;if(pe||Re){const ve=R??null;if(C===ve){B.current=!1;return}let ge=ry;ze?ge=sy:pe&&(ge=xv),ue(ve,ge);return}ze&&ne!=null&&(K(C,sy),B.current=!1)},[R,w,K,ne,O,D,C]);const he=St("div",l,{state:{orientation:d,tabActivationDirection:$},ref:a,props:y,stateAttributesMapping:Zs});return z.jsx(a0.Provider,{value:Q,children:z.jsx(Jd,{elementsRef:S,children:he})})});function ld(o,l){for(const[a,r]of o.entries())if(l===r.value)return a;return null}function Wy(o,l,a,r){if(o==null||l==null)return"none";const[c,f,d]=a==="horizontal"?["left","left","right"]:["top","up","down"],m=ld(r,o),h=ld(r,l);if(m==null||h==null)return m!==h&&(typeof o=="number"||typeof o=="string")&&typeof o==typeof l?l>o?d:f:"none";const g=m.getBoundingClientRect()[c],y=h.getBoundingClientRect()[c];return y<g?f:y>g?d:"none"}const r0=v.createContext(void 0);function CO(){const o=v.useContext(r0);if(o===void 0)throw new Error(Qt(65));return o}const OO=v.forwardRef(function(l,a){const{className:r,disabled:c=!1,render:f,value:d,id:m,nativeButton:h=!0,style:g,...y}=l,{value:b,getTabPanelIdByValue:S,onValueChange:E,orientation:T,tabActivationDirection:C}=ep(),{activateOnFocus:O,registerTabResizeObserverElement:w,tabsListElement:D}=CO(),{highlightedIndex:A,onHighlightedIndexChange:M}=Qs(),H=Bl(m),U=v.useMemo(()=>({disabled:c,id:H,value:d}),[c,H,d]),{compositeProps:j,compositeRef:k,index:W}=qb({metadata:U}),$=d===b,F=v.useRef(!1),Y=v.useRef(null),ee=Oe(oe=>{Y.current?.(),Y.current=oe?w(oe):null});be(()=>{if(F.current){F.current=!1;return}if(!($&&W>-1&&A!==W))return;const oe=D;if(oe!=null){const ie=Ht(Xe(oe));if(ie&&De(oe,ie))return}c||M(W)},[$,W,A,M,c,D]);const{getButtonProps:le,buttonRef:K}=qa({disabled:c,native:h,focusableWhenDisabled:!0}),N=S(d),P=v.useRef(!1),I=v.useRef(!1);function Q(oe){E(d,Ke(qs,oe.nativeEvent,void 0,{activationDirection:"none"}))}function ne(oe){$||c||Q(oe)}function R(oe){$||c||O&&(!P.current||I.current)&&Q(oe)}function B(oe){if($||c)return;P.current=!0,I.current=oe.button===0;const ie=Xe(oe.currentTarget);function he(){P.current=!1,I.current=!1,ie.removeEventListener("pointerup",he),ie.removeEventListener("pointercancel",he)}ie.addEventListener("pointerup",he),ie.addEventListener("pointercancel",he)}return St("button",l,{state:{disabled:c,active:$,orientation:T,tabActivationDirection:C},ref:[a,K,k,ee],props:[j,{role:"tab","aria-controls":N,"aria-selected":$,id:H,onClick:ne,onFocus:R,onPointerDown:B,[$d]:$?"":void 0,onKeyDownCapture(){F.current=!0}},y,le],stateAttributesMapping:Zs})});function wO(o,l){const a=yt(o).getComputedStyle(o).transform;let r=0,c=0,f=1;if(a&&a!=="none"){const d=a.match(/matrix(?:3d)?\(([^)]+)\)/);if(d){const m=d[1].split(", ").map(parseFloat);m.length===6?(r=m[4],c=m[5],f=Math.sqrt(m[0]*m[0]+m[1]*m[1])):m.length===16&&(r=m[12],c=m[13],f=m[0])}}return{x:r,y:c,scale:f}}const AO="data-index",MO={...Zs,...Ys},DO=v.forwardRef(function(l,a){const{className:r,value:c,render:f,keepMounted:d=!1,style:m,...h}=l,{value:g,getTabIdByPanelValue:y,orientation:b,tabActivationDirection:S,registerMountedTabPanel:E}=ep(),T=Bl(),{ref:C,index:O}=Fd(),w=c===g,{mounted:D,transitionStatus:A,setMounted:M}=fb(w),H=!D,U=y(c),j={hidden:H,orientation:b,tabActivationDirection:S,transitionStatus:A},k=v.useRef(null),W=St("div",l,{state:j,ref:[a,C,k],props:[{"aria-labelledby":U,hidden:H,id:T,role:"tabpanel",tabIndex:w?0:-1,inert:Ks(!w),[AO]:O},h],stateAttributesMapping:MO});return Hi({open:w,ref:k,onComplete(){w||M(!1)}}),be(()=>{if(!(T==null||H&&!d))return E(c,T)},[H,d,c,T,E]),d||D?W:null}),NO=v.forwardRef(function(l,a){const{activateOnFocus:r=!1,className:c,loopFocus:f=!0,render:d,style:m,...h}=l,{orientation:g,setTabMap:y,tabActivationDirection:b}=ep(),[S,E]=v.useState(0),[T,C]=v.useState(null),O=v.useRef(new Set),w=v.useRef(new Set),D=v.useRef(null);be(()=>{if(typeof ResizeObserver>"u")return;const k=new ResizeObserver(()=>{O.current.forEach(W=>{W()})});return D.current=k,T&&k.observe(T),w.current.forEach(W=>{k.observe(W)}),()=>{k.disconnect(),D.current=null}},[T]);const A=Oe(k=>(O.current.add(k),()=>{O.current.delete(k)})),M=Oe(k=>(w.current.add(k),D.current?.observe(k),()=>{w.current.delete(k),D.current?.unobserve(k)})),H={orientation:g,tabActivationDirection:b},U={"aria-orientation":g==="vertical"?"vertical":void 0,role:"tablist"},j=v.useMemo(()=>({activateOnFocus:r,registerIndicatorUpdateListener:A,registerTabResizeObserverElement:M,tabsListElement:T}),[r,A,M,T]);return z.jsx(r0.Provider,{value:j,children:z.jsx(xO,{render:d,className:c,style:m,state:H,refs:[a,C],props:[U,h],stateAttributesMapping:Zs,highlightedIndex:S,enableHomeAndEndKeys:!0,loopFocus:f,orientation:g,onHighlightedIndexChange:E,onMapChange:y,disabledIndices:Eo})})}),s0=v.createContext(void 0);function Js(){const o=v.useContext(s0);if(!o)throw new Error(Qt(73));return o}let $y=0;function u0(o){return $y+=1,`${o}-${Math.random().toString(36).slice(2,6)}-${$y}`}function Nf(o,l){if(typeof o=="string")return{description:o};if(typeof o=="function"){const a=o(l);return typeof a=="string"?{description:a}:a}return o}function zf(o){const l=new Map;let a=0,r=0;return o.forEach((c,f)=>{const d=c.transitionStatus==="ending";l.set(c.id,{value:c,domIndex:f,visibleIndex:d?-1:a,offsetY:r}),r+=c.height||0,d||(a+=1)}),l}function _f(o,l){let a=0;return o.map(r=>{if(r.transitionStatus==="ending")return r;const c=a>=l;return a+=1,r.limited===c?r:{...r,limited:c}})}const Yn={toasts:o=>o.toasts,isEmpty:o=>o.toasts.length===0,toast:(o,l)=>o.toastMetadata.get(l)?.value,toastIndex:(o,l)=>o.toastMetadata.get(l)?.domIndex??-1,toastOffsetY:(o,l)=>o.toastMetadata.get(l)?.offsetY??0,toastVisibleIndex:(o,l)=>o.toastMetadata.get(l)?.visibleIndex??-1,focused:o=>o.focused,expanded:o=>o.hovering||o.focused,expandedOrOutOfFocus:o=>o.hovering||o.focused||!o.isWindowFocused,prevFocusElement:o=>o.prevFocusElement};class zO extends Ia{timers=new Map;areTimersPaused=!1;constructor(l){super({...l,toastMetadata:zf(l.toasts)},{},Yn)}setViewport=l=>{this.set("viewport",l)};syncProviderProps(l,a){const r=this.state.limit!==a;if(this.state.timeout===l&&!r)return;const c={timeout:l,limit:a};if(r){const f=_f(this.state.toasts,a);c.toasts=f,c.toastMetadata=zf(f)}this.update(c)}disposeEffect=()=>()=>{this.timers.forEach(l=>{l.timeout?.clear()}),this.timers.clear()};removeToast(l,a=!1){const r=Yn.toastIndex(this.state,l);if(r===-1)return;const c=this.state.toasts[r];a||c?.onRemove?.();const f=[...this.state.toasts];f.splice(r,1),this.setToasts(f)}addToast=l=>{const{timeout:a,limit:r}=this.state,c=l.id||u0("toast");if(l.id){const h=Yn.toast(this.state,l.id);if(h)if(h.transitionStatus==="ending")this.removeToast(l.id,!0);else{const{id:g,transitionStatus:y,...b}=l;return this.updateToastInternal(l.id,b,!0,!0),l.id}}const f={...l,id:c,updateKey:0,transitionStatus:"starting"},d=[f,...this.state.toasts];this.setToasts(_f(d,r));const m=f.timeout??a;return f.type!=="loading"&&m>0&&this.scheduleTimer(c,m,()=>this.closeToast(c)),Yn.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),c};updateToast=(l,a)=>{const r=Yn.toast(this.state,l);!r||r.transitionStatus==="ending"||this.updateToastInternal(l,typeof a=="function"?a(r):a,!1,!0)};updateToastInternal=(l,a,r=!1,c=!1)=>{const{timeout:f,toasts:d}=this.state,m=Yn.toast(this.state,l);if(!m||m.transitionStatus==="ending")return;const h={...m,...a,...c&&{updateKey:m.updateKey+1}};this.setToasts(d.map(O=>O.id===l?h:O));const g=h.timeout??f,y=m.timeout??f,b=Object.hasOwn(a,"timeout"),S=h.transitionStatus!=="ending"&&h.type!=="loading"&&g>0,E=this.timers.has(l),T=y!==g,C=m.type==="loading";if(!S&&E){this.clearTimer(l);return}S&&(!E||T||b||C||r)&&(this.clearTimer(l),this.scheduleTimer(l,g,()=>this.closeToast(l)),Yn.expandedOrOutOfFocus(this.state)&&this.pauseTimers())};closeToast=l=>{const a=l===void 0,{limit:r,toasts:c}=this.state;let f;if(a)f=c,this.clearTimers();else{const h=Yn.toast(this.state,l);if(!h)return;f=[h],this.clearTimer(l)}const d=c.map(h=>a||h.id===l?{...h,transitionStatus:"ending",height:0}:h),m=_f(d,r);this.setToasts(m,!m.some(h=>h.transitionStatus!=="ending")),f.forEach(h=>{h.transitionStatus!=="ending"&&h.onClose?.()}),this.handleFocusManagement(l)};promiseToast=(l,a)=>{const r=Nf(a.loading),c=this.addToast({...r,type:"loading"}),f=l.then(d=>{const m=Nf(a.success,d);return this.updateToast(c,{...m,type:"success",timeout:m.timeout}),d}).catch(d=>{const m=Nf(a.error,d);return this.updateToast(c,{...m,type:"error",timeout:m.timeout}),Promise.reject(d)});return{}.hasOwnProperty.call(a,"setPromise")&&a.setPromise(f),f};pauseTimers(){this.areTimersPaused||(this.areTimersPaused=!0,this.timers.forEach(l=>{l.timeout&&(l.timeout.clear(),l.remaining=Math.max(l.remaining-(Date.now()-l.start),0))}))}resumeTimers(){this.areTimersPaused&&(this.areTimersPaused=!1,this.timers.forEach((l,a)=>{l.remaining=l.remaining>0?l.remaining:l.delay,l.timeout??=yn.create(),l.timeout.start(l.remaining,()=>{this.handleTimerFired(a),l.callback()}),l.start=Date.now()}))}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=l=>{if(l.pointerType!=="touch")return;const a=bt(l);De(this.state.viewport,a)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))};scheduleTimer(l,a,r){const c=Date.now(),d=!Yn.expandedOrOutOfFocus(this.state)?yn.create():void 0;d?.start(a,()=>{this.handleTimerFired(l),r()}),this.timers.set(l,{timeout:d,start:c,delay:a,remaining:a,callback:r})}clearTimers(){this.timers.forEach(l=>{l.timeout?.clear()}),this.timers.clear(),this.areTimersPaused=!1}clearTimer(l){this.timers.get(l)?.timeout?.clear(),this.timers.delete(l),this.resetPausedStateIfNoTimersRemain()}handleTimerFired(l){this.timers.delete(l),this.resetPausedStateIfNoTimersRemain()}resetPausedStateIfNoTimersRemain(){this.timers.size===0&&(this.areTimersPaused=!1)}setToasts(l,a=l.length===0){const r={toasts:l,toastMetadata:zf(l)};a&&(r.hovering=!1,r.focused=!1),this.update(r)}handleFocusManagement(l){const a=Ht(Xe(this.state.viewport));if(!this.state.viewport||!De(this.state.viewport,a)||!Ss(a))return;if(l===void 0){this.restoreFocusToPrevElement();return}const r=Yn.toasts(this.state),c=Yn.toastIndex(this.state,l),f=(m,h)=>{for(let g=m;g>=0&&g<r.length;g+=h)if(r[g].transitionStatus!=="ending")return r[g];return null},d=f(c+1,1)??f(c-1,-1);d?d.ref?.current?.focus():this.restoreFocusToPrevElement()}}const _O=function(l){const{children:a,timeout:r=5e3,limit:c=3,toastManager:f}=l,d=Zt(()=>new zO({timeout:r,limit:c,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return zs(d.disposeEffect),v.useEffect(function(){return f?f[" subscribe"](({action:g,options:y})=>{const b=y.id;g==="promise"&&y.promise?d.promiseToast(y.promise,y):g==="update"&&b?d.updateToast(b,y.updates):g==="close"?d.closeToast(b):d.addToast(y)}):void 0},[d,f]),z.jsxs(s0.Provider,{value:d,children:[z.jsx(HO,{store:d,timeout:r,limit:c}),a]})};function HO(o){const{store:l,timeout:a,limit:r}=o;return be(()=>{l.syncProviderProps(a,r)},[l,a,r]),null}const jO="--toast-frontmost-height",kO=v.forwardRef(function(l,a){const{render:r,className:c,style:f,children:d,...m}=l,h=Js(),g=Jt(),y=v.useRef(!1),b=v.useRef(!1),S=v.useRef(!1),E=h.useState("isEmpty"),T=h.useState("toasts"),C=h.useState("focused"),O=h.useState("expanded"),w=h.useState("prevFocusElement"),D=T[0]?.height,A=T.some(Q=>Q.transitionStatus==="ending"),M=T.filter(Q=>Q.priority==="high");v.useEffect(()=>{const Q=h.state.viewport;if(!Q||E)return;const ne=yt(Q),R=Xe(Q);function B(oe){oe.key==="F6"&&bt(oe)!==Q&&(oe.preventDefault(),h.set("prevFocusElement",Ht(R)),Q?.focus({preventScroll:!0}),h.pauseTimers(),h.set("focused",!0))}function J(oe){bt(oe)===ne&&(h.set("isWindowFocused",!1),h.pauseTimers())}function V(oe){if(oe.relatedTarget)return;const ie=bt(oe),he=Ht(Xe(Q));(ie===ne||!De(Q,ie)||!Ss(he))&&h.resumeTimers(),g.start(0,()=>h.set("isWindowFocused",!0))}return In(Ye(ne,"keydown",B),Ye(ne,"blur",J,!0),Ye(ne,"focus",V,!0),Ye(R,"pointerdown",h.handleDocumentPointerDown,!0))},[h,g,E]);function H(Q){y.current=!0;const ne=Q.relatedTarget===h.state.viewport?T.find(R=>R.transitionStatus!=="ending"&&!R.limited):void 0;ne?ne.ref?.current?.focus():h.restoreFocusToPrevElement()}function U(Q){Q.key==="Tab"&&Q.shiftKey&&bt(Q.nativeEvent)===h.state.viewport&&(Q.preventDefault(),h.restoreFocusToPrevElement())}function j(){h.state.toasts.some(ne=>ne.transitionStatus==="ending")||S.current||!b.current||(h.state.isWindowFocused&&h.resumeTimers(),h.set("hovering",!1),b.current=!1)}v.useEffect(j,[A,h]);function k(){h.pauseTimers(),h.set("hovering",!0),b.current=!1}function W(){h.state.isWindowFocused&&h.resumeTimers()}function $(){b.current=!0,j()}function F(Q){Q.pointerType==="touch"&&(S.current=!0)}function Y(Q){Q.pointerType==="touch"&&(S.current=!1,j())}function ee(){if(y.current){y.current=!1;return}C||Ss(Ht(Xe(h.state.viewport)))&&(h.set("focused",!0),h.pauseTimers())}function le(Q){!C||De(h.state.viewport,Q.relatedTarget)||(h.set("focused",!1),W())}const K={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:k,onMouseMove:k,onMouseLeave:$,onFocus:ee,onBlur:le,onKeyDown:U,onClick:ee,onPointerDown:F,onPointerUp:Y,onPointerCancel:Y,style:{[jO]:D?`${D}px`:void 0}},N={expanded:O},P=!E&&w&&z.jsx(Hl,{onFocus:H}),I=St("div",l,{ref:[a,h.setViewport],state:N,props:[K,m,{children:z.jsxs(v.Fragment,{children:[P,d,P]})}]});return z.jsxs(v.Fragment,{children:[P,I,!C&&M.length>0&&z.jsx("div",{style:Cv,children:M.map(Q=>z.jsxs("div",{role:"alert","aria-atomic":!0,children:[z.jsx("div",{children:Q.title}),z.jsx("div",{children:Q.description})]},Q.id))})]})}),c0=v.createContext(void 0);function tp(){const o=v.useContext(c0);if(!o)throw new Error(Qt(66));return o}function Hf(o,l,a){switch(o){case"up":return-a;case"down":return a;case"left":return-l;case"right":return l;default:return 0}}const UO="--toast-index",LO="--toast-offset-y",BO="--toast-height",YO="--toast-swipe-movement-x",IO="--toast-swipe-movement-y",qO="data-swipe-direction",PO={...Ys,swipeDirection(o){return o?{[qO]:o}:null}},ev=40,VO=10,tv=.5,GO=1,XO=`${OE},${wE}`,KO=v.forwardRef(function(l,a){const{toast:r,render:c,className:f,swipeDirection:d=["down","right"],style:m,...h}=l,g=r.positionerProps?.anchor!==void 0;let y=[];g||(y=Array.isArray(d)?d:[d]);const b=y.length>0,S=Js(),[E,T]=v.useState(void 0),[C,O]=v.useState(!1),[w,D]=v.useState(!1),[A,M]=v.useState({x:0,y:0}),[H,U]=v.useState({x:0,y:0,scale:1}),[j,k]=v.useState(),[W,$]=v.useState(),[F,Y]=v.useState(null),ee=v.useRef(null),le=v.useRef(void 0),K=v.useRef({x:0,y:0}),N=v.useRef({x:0,y:0,scale:1}),P=v.useRef(void 0),I=v.useRef(0),Q=v.useRef(!1),ne=v.useRef({x:0,y:0}),R=v.useRef(!1),B=v.useRef({x:0,y:0}),J=v.useRef(null),V=v.useRef(null),oe=S.useState("toastIndex",r.id),ie=S.useState("toastVisibleIndex",r.id),he=S.useState("toastOffsetY",r.id),ue=S.useState("focused"),pe=S.useState("expanded");Hi({open:r.transitionStatus!=="ending",ref:ee,onComplete(){r.transitionStatus==="ending"&&S.removeToast(r.id)}});const Re=Oe((Ae=!1)=>{const fe=ee.current;if(!fe)return;const me=fe.style.height;fe.style.height="auto";const de=fe.offsetHeight;fe.style.height=me;function ae(){S.updateToastInternal(r.id,{ref:ee,height:de,transitionStatus:void 0})}Ae?qn.flushSync(ae):ae()});be(()=>{const Ae=le.current;r.transitionStatus!=="starting"&&Ae===r.id||(Ae!==void 0&&(T(void 0),U({x:0,y:0,scale:1}),ze({x:0,y:0})),le.current=r.id,Re())},[Re,r.id,r.transitionStatus]);function ze(Ae){B.current=Ae,M(Ae)}be(()=>()=>{V.current?.abort()},[]);function ve(Ae,fe){const me=ye=>ye>0?ye**tv:-(Math.abs(ye)**tv),de=Ae>0&&!y.includes("right")||Ae<0&&!y.includes("left"),ae=fe>0&&!y.includes("down")||fe<0&&!y.includes("up");return{x:de?me(Ae):Ae,y:ae?me(fe):fe}}const ge=Oe(Ae=>{if(Ae.pointerId!==J.current)return;J.current=null,V.current?.abort(),V.current=null,O(!1),D(!1),Y(null);const fe=N.current;if(Ae.type==="pointercancel"||Q.current){ze({x:fe.x,y:fe.y}),T(void 0);return}const me=B.current,de=me.x-fe.x,ae=me.y-fe.y;let ye;for(const Le of y)if(Hf(Le,de,ae)>ev){ye=Le;break}ye?(T(ye),S.closeToast(r.id)):(ze({x:fe.x,y:fe.y}),T(void 0))});function _e(Ae){if(Ae.button!==0||(Ae.pointerType==="touch"&&S.pauseTimers(),bt(Ae.nativeEvent)?.closest(`button,a,input,textarea,[role="button"],${XO}`)))return;Q.current=!1,P.current=void 0,I.current=0,J.current=Ae.pointerId,K.current={x:Ae.clientX,y:Ae.clientY},ne.current=K.current;const de=Ae.currentTarget,ae=wO(de);N.current=ae,U(ae),ze({x:ae.x,y:ae.y}),S.set("hovering",!0),O(!0),D(!1),Y(null),R.current=!0,V.current?.abort();const ye=new AbortController;V.current=ye;const Le=Xe(de);Le.addEventListener("pointerup",ge,{signal:ye.signal}),Le.addEventListener("pointercancel",ge,{signal:ye.signal}),de.setPointerCapture?.(Ae.pointerId)}function ke(Ae){if(Ae.pointerId!==J.current)return;Ae.preventDefault(),R.current&&(K.current={x:Ae.clientX,y:Ae.clientY},R.current=!1);const{clientY:fe,clientX:me,movementX:de,movementY:ae}=Ae;(ae<0&&fe>ne.current.y||ae>0&&fe<ne.current.y)&&(ne.current={x:ne.current.x,y:fe}),(de<0&&me>ne.current.x||de>0&&me<ne.current.x)&&(ne.current={x:me,y:ne.current.y});const ye=me-K.current.x,Le=fe-K.current.y,Lt=fe-ne.current.y,$t=me-ne.current.x;let Tt=F;if(!w&&Math.sqrt(ye*ye+Le*Le)>=GO){D(!0);const At=y.includes("left")||y.includes("right"),jn=y.includes("up")||y.includes("down");if(At&&jn){const Ge=Math.abs(ye),xt=Math.abs(Le);Tt=Ge>xt?"horizontal":"vertical",Y(Tt)}}let Se;if(!P.current)Tt==="vertical"?Le>0?Se="down":Le<0&&(Se="up"):Tt==="horizontal"?ye>0?Se="right":ye<0&&(Se="left"):Math.abs(ye)>=Math.abs(Le)?Se=ye>0?"right":"left":Se=Le>0?"down":"up",Se&&y.includes(Se)&&(P.current=Se,I.current=Hf(Se,ye,Le),T(Se));else{const Sn=P.current,At=Hf(Sn,$t,Lt);At>ev?(Q.current=!1,T(Sn)):!(y.includes("left")&&y.includes("right"))&&!(y.includes("up")&&y.includes("down"))&&I.current-At>=VO&&(Q.current=!0)}const Ie=ve(ye,Le);let tt=N.current.x,pt=N.current.y;const bn=y.includes("left")||y.includes("right"),Hn=y.includes("up")||y.includes("down");Tt!=="vertical"&&bn&&(tt+=Ie.x),Tt!=="horizontal"&&Hn&&(pt+=Ie.y),ze({x:tt,y:pt})}function Pe(Ae){if(Ae.key==="Escape"){if(!ee.current||!De(ee.current,Ht(Xe(ee.current))))return;S.closeToast(r.id)}}v.useEffect(()=>{const Ae=ee.current;if(!b||!Ae)return;function fe(me){J.current===null||!De(Ae,bt(me))||me.preventDefault()}return Ye(Ae,"touchmove",fe,{passive:!1})},[b]);function xe(){const Ae=A.x-H.x,fe=A.y-H.y;return{transition:C?"none":void 0,transform:C?`translateX(${A.x}px) translateY(${A.y}px) scale(${H.scale})`:void 0,[YO]:`${Ae}px`,[IO]:`${fe}px`}}const Ue=r.priority==="high",Te={role:Ue?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":j,"aria-describedby":W,"aria-hidden":Ue&&!ue?!0:void 0,onPointerDown:b?_e:void 0,onPointerMove:b?ke:void 0,onPointerUp:b?ge:void 0,onPointerCancel:b?ge:void 0,onKeyDown:Pe,inert:Ks(r.limited),style:{...xe(),[UO]:r.transitionStatus==="ending"?oe:ie,[LO]:`${he}px`,[BO]:r.height?`${r.height}px`:void 0}},Ee=v.useMemo(()=>({toast:r,setTitleId:k,setDescriptionId:$,recalculateHeight:Re,visibleIndex:ie,expanded:pe}),[r,k,$,Re,ie,pe]),we={transitionStatus:r.transitionStatus,expanded:pe,limited:r.limited||!1,type:r.type,swiping:C,swipeDirection:E},Qe=St("div",l,{ref:[a,ee],state:we,stateAttributesMapping:PO,props:[Te,h]});return z.jsx(c0.Provider,{value:Ee,children:Qe})}),QO=v.forwardRef(function(l,a){const{render:r,className:c,style:f,...d}=l,{visibleIndex:m,expanded:h,recalculateHeight:g}=tp(),y=v.useRef(null);be(()=>{g();const E=y.current;if(!E||typeof ResizeObserver!="function"||typeof MutationObserver!="function")return;const T=new ResizeObserver(()=>g(!0)),C=new MutationObserver(()=>g(!0));return T.observe(E),C.observe(E,{childList:!0,subtree:!0,characterData:!0}),()=>{T.disconnect(),C.disconnect()}},[g]);const b=m>0;return St("div",l,{ref:[a,y],state:{expanded:h,behind:b},props:d})});function f0(o){return o==null||typeof o=="boolean"||o===""?!1:Array.isArray(o)?o.some(f0):!0}function FO(o){return v.isValidElement(o)&&f0(o.props.children)}function d0(o,l,a){const{toast:r,setTitleId:c,setDescriptionId:f}=tp(),d=a==="title"?c:f,m=l??(a==="title"?r.title:r.description);return{id:jl(o),children:m,type:r.type,setId:d}}function p0(o,l,a){const r=FO(o);return be(()=>{if(r)return a(l),()=>{a(c=>c===l?void 0:c)}},[r,l,a]),r?o:null}const ZO=v.forwardRef(function(l,a){const{render:r,className:c,style:f,id:d,children:m,...h}=l,{id:g,children:y,type:b,setId:S}=d0(d,m,"description"),T=St("p",l,{ref:a,state:{type:b},props:{...h,id:g,children:y}});return p0(T,g,S)}),JO=v.forwardRef(function(l,a){const{render:r,className:c,style:f,id:d,children:m,...h}=l,{id:g,children:y,type:b,setId:S}=d0(d,m,"title"),T=St("h2",l,{ref:a,state:{type:b},props:{...h,id:g,children:y}});return p0(T,g,S)}),WO=v.forwardRef(function(l,a){const{render:r,className:c,style:f,disabled:d,nativeButton:m=!0,...h}=l,g=Js(),{toast:y,expanded:b}=tp(),[S,E]=v.useState(!1),{getButtonProps:T,buttonRef:C}=qa({disabled:d,native:m}),O={type:y.type};return St("button",l,{ref:[a,C],state:O,props:[{"aria-hidden":!b&&!S,onClick(){g.closeToast(y.id)},onFocus(){E(!0)},onBlur(){E(!1)}},h,T]})}),$O=v.forwardRef(function(l,a){return z.jsx(Cb,{ref:a,...l})});function ew(){const o=Js(),l=o.useState("toasts");return v.useMemo(()=>({toasts:l,add:o.addToast,close:o.closeToast,update:o.updateToast,promise:o.promiseToast}),[l,o])}function tw(){const o=new Set;function l(a){o.forEach(r=>r(a))}return{" subscribe":function(r){return o.add(r),()=>{o.delete(r)}},add(a){const r=a.id||u0("toast"),c={...a,id:r,transitionStatus:"starting"};return l({action:"add",options:c}),r},close(a){l({action:"close",options:{id:a}})},update(a,r){l({action:"update",options:{id:a,updates:r}})},promise(a,r){let c=a;return l({action:"promise",options:{...r,promise:a,setPromise(f){c=f}}}),c}}}function nw({value:o,onChange:l,items:a,className:r,trailing:c}){return z.jsxs(RO,{value:o,onValueChange:f=>l(f),className:Oo("flex min-h-0 flex-col",r),children:[z.jsxs("div",{className:"flex h-9 shrink-0 items-center gap-1 border-b border-line px-2",children:[z.jsx(NO,{className:"relative flex items-center gap-1",children:a.map(f=>z.jsx(OO,{value:f.value,className:"h-7 rounded-md px-2 text-[13px] font-medium text-fg-muted outline-none hover:text-fg data-[active]:bg-hover data-[active]:text-fg focus-visible:outline-2 focus-visible:outline-accent",children:f.label},f.value))}),z.jsx("div",{className:"ml-auto flex items-center gap-1",children:c})]}),a.map(f=>z.jsx(DO,{value:f.value,className:"min-h-0 flex-1 overflow-auto outline-none",children:f.content},f.value))]})}function h0({icon:o,title:l,children:a}){return z.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-8 text-center text-fg-muted",children:[o?z.jsx("div",{className:"text-fg-subtle",children:o}):null,z.jsx("div",{className:"text-[15px] font-semibold text-fg",children:l}),a?z.jsx("div",{className:"max-w-sm",children:a}):null]})}const g0=tw();function ow(o){if(o.repeat||o.key!=="Enter"&&o.key!==" ")return;const l=o.currentTarget.closest("[data-toast]")??o.currentTarget,a=l.ownerDocument.defaultView;a&&MR(a,o.key,r=>r instanceof a.Node&&l.contains(r))}function lw(){const{toasts:o}=ew();return o.map(l=>z.jsxs(KO,{toast:l,"data-toast":"",className:"pointer-events-auto flex w-80 items-start gap-3 rounded-lg bg-surface p-3 text-fg shadow-popup transition-[opacity,transform] data-[starting-style]:translate-y-2 data-[starting-style]:opacity-0 data-[ending-style]:opacity-0",children:[z.jsxs(QO,{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[z.jsx(JO,{className:"text-[13px] font-semibold"}),z.jsx(ZO,{className:"text-xs text-fg-muted"})]}),z.jsx(WO,{"aria-label":"Dismiss",onKeyDown:ow,className:"rounded p-0.5 text-fg-muted hover:bg-hover",children:z.jsx(n0,{className:"size-3.5"})})]},l.id))}function iw({children:o}){return z.jsxs(_O,{toastManager:g0,timeout:4e3,children:[o,z.jsx($O,{children:z.jsx(kO,{className:"pointer-events-none fixed bottom-4 right-4 z-[1100] flex flex-col gap-2",children:z.jsx(lw,{})})})]})}const aw=["a[href]","button","iframe","input","select","textarea","summary","audio[controls]","video[controls]","[contenteditable]:not([contenteditable='false'])","[tabindex]"].join(", "),rw="audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])";function sw(o){return!(o.tabIndex>=0||!o.hasAttribute("tabindex")&&o.matches(rw))||o.getAttribute("aria-hidden")==="true"||o.matches(":disabled")?!1:typeof o.checkVisibility!="function"||o.checkVisibility({visibilityProperty:!0})}function uw(o){return Array.from(o.querySelectorAll(aw)).filter(sw)}function cw(o){const l=a=>!/visible|hidden|clip/.test(a);return o.scrollWidth>o.clientWidth+1&&l(o.overflowX)||o.scrollHeight>o.clientHeight+1&&l(o.overflowY)}function fw(o){const[l,a]=v.useState(!1);return v.useLayoutEffect(()=>{const r=o.current,c=r?.ownerDocument.defaultView;if(!r||!c)return;const f=()=>{const y=c.getComputedStyle(r);a(cw({scrollWidth:r.scrollWidth,clientWidth:r.clientWidth,scrollHeight:r.scrollHeight,clientHeight:r.clientHeight,overflowX:y.overflowX,overflowY:y.overflowY}))};if(f(),typeof c.ResizeObserver!="function")return;const d=new c.ResizeObserver(f),m=new Set,h=y=>{if(y.nodeType!==1)return;const b=y;if(c.getComputedStyle(b).display==="contents"){b.childNodes.forEach(h);return}m.has(b)||(m.add(b),d.observe(b))};d.observe(r),r.childNodes.forEach(h);const g=new c.MutationObserver(y=>{for(const b of y)b.addedNodes.forEach(h);for(const b of m)r.contains(b)||(d.unobserve(b),m.delete(b));f()});return g.observe(r,{childList:!0,subtree:!0,characterData:!0}),()=>{d.disconnect(),g.disconnect()}},[o]),l}v.forwardRef(function({label:l,className:a,...r},c){const f=v.useRef(null),d=v.useCallback(E=>{f.current=E,typeof c=="function"?c(E):c&&(c.current=E)},[c]),m=fw(f),[h,g]=v.useState(!1),[y,b]=v.useState(null);v.useLayoutEffect(()=>{const E=f.current,T=E?.ownerDocument.defaultView;if(!m||!E||!T)return;const C=()=>{g(uw(E).length===0),b(E.closest('[role="dialog"], [role="alertdialog"]')?.getAttribute("aria-labelledby")??null)};C();const O=new T.MutationObserver(C);return O.observe(E,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["tabindex","disabled","hidden","href","contenteditable"]}),()=>O.disconnect()},[m]);const S=m&&h;return z.jsx("div",{ref:d,...S?{role:"group",tabIndex:0,"aria-labelledby":l===void 0?y??void 0:void 0,"aria-label":l??(y===null?"Panel content":void 0)}:{},className:Oo(S&&"focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-accent",a),...r})});const dw={blur:{label:"Blur",unit:"px",min:0,max:200,step:1,identity:0,initial:4},brightness:{label:"Brightness",unit:"%",min:0,max:500,step:1,identity:100,initial:120},contrast:{label:"Contrast",unit:"%",min:0,max:500,step:1,identity:100,initial:120},grayscale:{label:"Grayscale",unit:"%",min:0,max:100,step:1,identity:0,initial:100},saturate:{label:"Saturate",unit:"%",min:0,max:500,step:1,identity:100,initial:150},"hue-rotate":{label:"Hue rotate",unit:"deg",min:-360,max:360,step:1,identity:0,initial:90},invert:{label:"Invert",unit:"%",min:0,max:100,step:1,identity:0,initial:100},sepia:{label:"Sepia",unit:"%",min:0,max:100,step:1,identity:0,initial:100},opacity:{label:"Opacity",unit:"%",min:0,max:100,step:1,identity:100,initial:50}};[...Object.keys(dw)];const pw={cancel:"Cancel",close:"Close",copy:"Copy",copied:"Copied",copyLink:"Copy link",loading:"Loading…",justNow:"just now",never:"never",agent:"Agent",delete:"Delete",rename:"Rename",duplicate:"Duplicate",pin:"Pin",unpin:"Unpin",open:"Open",save:"Save",updated:"Updated {when}",pinned:"Pinned",unpinned:"Unpinned",duplicated:"Duplicated",couldNotPin:"Could not pin: {error}",couldNotUnpin:"Could not unpin: {error}",couldNotRename:"Could not rename: {error}",couldNotDuplicate:"Could not duplicate: {error}",couldNotDelete:"Could not delete: {error}",statusNone:"No session",statusWorking:"Working",statusIdle:"Idle",statusWaiting:"Waiting",statusOffline:"Offline",working:"{agent} is working…",artifactOptions:"Artifact options",artifactName:"Artifact name",comments:"Comments",doneCommenting:"Done commenting",openComment:"1 open comment",openComments:"{count} open comments",commentOptions:"Comment options",showAllComments:"Show all comments",hideComments:"Hide comments",share:"Share",sharedOnNetwork:"Shared with your network",onlyThisComputer:"Only this computer",ask:"Ask {agent}",hideAsk:"Hide",openHarnessSession:"Open the {harness} session",messageAgent:"Message {agent} about this artifact",switchArtifact:"Switch artifact",inThisSession:"In this session",recent:"Recent",allArtifacts:"All artifacts",export:"Export",openSession:"Open session",offline:"offline",versionHistory:"Version history",openInNewTab:"Open in new tab",refresh:"Refresh",storage:"Storage",inThisFolder:"{size} in this folder",copyPath:"Copy path",linkCopied:"Link copied",pathCopied:"Path copied",deleteTitle:'Delete "{title}"?',deleteBody:"It leaves your artifacts. Its folder stays where it is: {root}",shareTitle:"Share this artifact",peopleWithAccess:"People with access",joinedPeople:"People who joined",noneJoined:"Nobody has joined yet. Send someone a link below.",online:"Online",seenAgo:"Seen {when}",guestPaused:"Link off: no access until it is back on",changeRole:"Change {name}'s role",roleLinkOff:"Link off",remove:"Remove",removeGuest:"Remove {name}",removeTitle:"Remove {name}?",removeBody:"They lose access to this artifact. They can join again with a link.",you:"(you)",thisComputer:"This computer",owner:"Owner",generalAccess:"General access",onLan:"Anyone on your network with a link",onlyHereSub:"Nobody else can open the links.",onLanSub:"People on the same Wi-Fi or LAN open it with a link; the link sets their role.",onNetworkAt:"On this network at {addresses}",onTailnet:"Tailscale: {address}, for people on your tailnet from any network (copy it from a link's More menu)",noAddress:"This computer has no local network address.",whereOff:"Only this computer can open these links for now. Copying one opens this to your network.",inviteLinks:"Invite links",roleEditor:"Editor",roleCommenter:"Commenter",roleViewer:"Viewer",linkEditor:"Can edit",linkCommenter:"Can comment",linkViewer:"Can view",noteEditor:"Edit and comment",noteCommenter:"Comment, no edits",noteViewer:"Read only",linkOff:"Off: nobody can join with it",turnOn:"Turn on",more:"More",moreFor:"More: {role}",copyTailnet:"Copy Tailscale link",copyTailnetNote:"For people on your tailnet, off this network ({address})",turnOnLink:"Turn on link",turnOffLink:"Turn off link",turnOffNote:"Whoever joined with it loses access until it is back on",resetLink:"Reset link",resetNote:"A new address; whoever joined with the old one is removed",resetTitle:'Reset the "{role}" link?',resetBody:"The old link stops working and the people who joined with it lose access.",plainHttp:"This is plain HTTP: others on the network can read what passes. A link is the permission: whoever has it gets its role, so send it only to the people meant to have it, and reset a link that went further.",cannotShare:"{type} pages can't be shared on the network yet: only this computer opens it.",shareError:"Could not do that: {error}",sendingTitle:"Sending this to someone?",sendingBody:"Share the link instead of a file and they will always have the latest changes.",invitePeople:"Invite people",allLinksOff:"All the links are off. Invite people to turn one on.",joinsAs:"People who open this link join as {role}. Invite people to give another role.",onlyHereLink:"Only this computer can open the link.",nothingToExport:"Nothing to export yet.",exportOptions:"Asks for options first",archiveLabel:"Whole folder (.zip)",archiveDescription:"Everything here, to back up or move",archiveStarted:"Downloading {name}",archiveHint:"The whole folder in one zip, to back up, move to another computer or send to someone. Unzip it and open it with the same type to carry on; share links and this computer's server state are left out.",archiveTooLarge:"The folder is over what a zip holds (4 GiB or 65,535 files): copy the folder itself instead.",archiveUnsupported:"{type} folders can't be zipped here: copy the folder itself instead.",archiveFailed:"Could not zip the folder: {error}",exportBusy:"Another export is running. Try {label} again in a moment.",exportUnsupported:"{label} can't be exported right now.",exportFailed:"Could not export {label}.",saving:"Saving…",reconnecting:"Reconnecting…",notSaved:"Not saved",notSavedTitle:"The page could not save its last changes.",saveRetry:"Couldn't save — retry",readOnly:"Read-only",readOnlyTitle:"Nothing can be saved here",leaveLosesWork:"Leave? Changes that are not saved yet will be lost.",actionSaveNow:"Save now",actionOpenFind:"Find",actionUndo:"Undo",actionRedo:"Redo",actionEditPage:"Edit page",actionUsePage:"Use this page",actionCommentSelection:"Comment on selection",actionOpenPageList:"Pages",actionHandOffCode:"Hand off to code",whyOlderVersion:"You are viewing an older version",whyAgentWorking:"{agent} is working",whyDraftOpen:"Close the open draft first",whyCommentsOn:"Turn off comment mode first",whyNeedsAgent:"Needs an agent session",whyUnsaved:"Save first",whyOther:"Not available right now",noOwner:"No session owns this artifact",noOwnerNote:"What you send waits for the next session that works on it.",ownerNote:"Messages go to the {harness} session that made this artifact.",agentIdle:"{agent} is idle",agentWaiting:"{agent} is waiting",sessionOffline:"The session is offline",offlineNote:"{agent} sees what you send the next time the {harness} session works.",askPlaceholder:"What should change?",sendToAgent:"Send to {agent}",sending:"Sending…",sent:"Sent.",sentInbox:"{agent} will see it the next time the session works.",notDelivered:"Not delivered.",notSent:"Not sent: {error}",viaDelivered:"delivered",viaInbox:"waiting for the session",viaFailed:"not delivered",emptyTitle:"This artifact is empty",emptyBody:"Nothing of {type} has been written to {root} yet. An agent writes it: send it this.",startSession:"Start a session with {agent}",promptCopied:"Copied: paste it into any agent session that has the Artifact tool.",sentToSession:"Sent to a new session.",problemTitle:"This artifact cannot open here",noPage:"No page.",folder:"Folder: {root}",askToLook:"Ask {agent} to look",problemAsk:"The artifact page could not open: {problem}",noBoot:"No artifact to show. Open one from the home page.",homeTitle:"Open Artifact",homeSub:"The artifacts and types every agent on this computer shares.",artifacts:"Artifacts",types:"Types",newArtifact:"New artifact",moreActions:"More actions",backToSession:"Back to session",noArtifacts:"No artifacts yet. Ask an agent to make one with the Artifact tool, or start one here.",pageOpen:"Open now",typeMissing:"Type not installed",deleted:'Deleted "{title}". Its folder stays.',undo:"Undo",restored:"Restored",couldNotRestore:"Could not restore: {error}",couldNotLoad:"Could not load: {error}",typeRoots:"Type roots: {roots}",noTypes:"No types found.",disabled:"Disabled",shadowedBy:"Overridden by {root}",newOf:"New {type}",create:"Create",title:"Title",folderOptional:"Folder (optional)",folderHint:"Default: a new folder in the home workspace",needTitle:"Give it a title first.",couldNotCreate:"Could not create it: {error}",renameArtifact:"Rename artifact",cannotCreateYet:"Only Design artifacts can be made here for now."},hw={cancel:"取消",close:"关闭",copy:"复制",copied:"已复制",copyLink:"复制链接",loading:"加载中…",justNow:"刚刚",never:"从未",agent:"Agent",delete:"删除",rename:"重命名",duplicate:"复制一份",pin:"置顶",unpin:"取消置顶",open:"打开",save:"保存",updated:"更新于 {when}",pinned:"已置顶",unpinned:"已取消置顶",duplicated:"已复制一份",couldNotPin:"没能置顶:{error}",couldNotUnpin:"没能取消置顶:{error}",couldNotRename:"没能重命名:{error}",couldNotDuplicate:"没能复制:{error}",couldNotDelete:"没能删除:{error}",statusNone:"无会话",statusWorking:"工作中",statusIdle:"空闲",statusWaiting:"等待中",statusOffline:"离线",working:"{agent} 正在工作…",artifactOptions:"作品选项",artifactName:"作品名",comments:"评论",doneCommenting:"结束评论",openComment:"1 条未解决的评论",openComments:"{count} 条未解决的评论",commentOptions:"评论选项",showAllComments:"显示全部评论",hideComments:"隐藏评论",share:"分享",sharedOnNetwork:"已分享到局域网",onlyThisComputer:"仅这台电脑",ask:"问 {agent}",hideAsk:"收起",openHarnessSession:"打开 {harness} 会话",messageAgent:"就这个作品给 {agent} 发消息",switchArtifact:"切换作品",inThisSession:"这个会话里的",recent:"最近",allArtifacts:"所有作品",export:"导出",openSession:"打开会话",offline:"离线",versionHistory:"版本历史",openInNewTab:"在新标签页打开",refresh:"刷新",storage:"存储",inThisFolder:"这个文件夹 {size}",copyPath:"复制路径",linkCopied:"链接已复制",pathCopied:"路径已复制",deleteTitle:"删除「{title}」?",deleteBody:"它会移出作品列表,文件夹保留在原处:{root}",shareTitle:"分享这份内容",peopleWithAccess:"有权访问的人",joinedPeople:"加入的人",noneJoined:"还没有人加入。把下面的链接发给对方。",online:"在线",seenAgo:"{when}来过",guestPaused:"链接已关闭,暂时无法访问",changeRole:"更改「{name}」的角色",roleLinkOff:"链接已关闭",remove:"移出",removeGuest:"移出 {name}",removeTitle:"移出「{name}」?",removeBody:"对方将无法再访问这份内容,之后仍可以用链接重新加入。",you:"(你)",thisComputer:"这台电脑",owner:"所有者",generalAccess:"一般访问权限",onLan:"同一网络里有链接的人",onlyHereSub:"别人打不开这些链接。",onLanSub:"同一 Wi-Fi 或局域网里的人用链接打开,链接决定角色。",onNetworkAt:"在这个网络上:{addresses}",onTailnet:"Tailscale:{address},同一 tailnet 的人在别的网络也能打开(复制在链接的「更多」里)",noAddress:"这台电脑没有局域网地址。",whereOff:"现在只有这台电脑能打开这些链接。复制链接会顺手分享到局域网。",inviteLinks:"邀请链接",roleEditor:"编辑者",roleCommenter:"评论者",roleViewer:"查看者",linkEditor:"可编辑",linkCommenter:"可评论",linkViewer:"可查看",noteEditor:"编辑和评论",noteCommenter:"只能评论",noteViewer:"只读",linkOff:"已关闭:没人能用它加入",turnOn:"开启",more:"更多",moreFor:"更多:{role}",copyTailnet:"复制 Tailscale 链接",copyTailnetNote:"给同一 tailnet 里不在这个网络的人({address})",turnOnLink:"开启链接",turnOffLink:"关闭链接",turnOffNote:"用它加入的人暂时无法访问",resetLink:"重置链接",resetNote:"换一个新地址,用旧链接加入的人会被移出",resetTitle:"重置「{role}」链接?",resetBody:"旧链接会失效,通过它加入的人也会失去访问权限。",plainHttp:"这是明文 HTTP:同一网络的人能看到传输内容。链接就是权限:拿到链接的人就有对应角色,只发给该有的人;传出去了就重置链接。",cannotShare:"{type} 的页面暂时不能分享到网络:只有这台电脑能打开。",shareError:"没做成:{error}",sendingTitle:"要发给别人?",sendingBody:"发链接而不是文件,对方看到的总是最新版本。",invitePeople:"邀请别人",allLinksOff:"所有链接都关着。去邀请页打开一条。",joinsAs:"用这条链接打开的人以{role}身份加入。要给别的角色,去邀请页。",onlyHereLink:"只有这台电脑能打开这个链接。",nothingToExport:"还没有可导出的内容。",exportOptions:"会先询问导出选项",archiveLabel:"整个文件夹(.zip)",archiveDescription:"这里的全部内容,用来备份或搬走",archiveStarted:"开始下载 {name}",archiveHint:"整个文件夹打成了一个 zip,可以备份、换电脑或发给别人。解压后用同一个类型打开就能接着用;分享链接和这台电脑上的服务器状态不在里面。",archiveTooLarge:"文件夹超过了 zip 的上限(4 GiB 或 65535 个文件),请直接复制文件夹。",archiveUnsupported:"{type} 的文件夹在这里打不了包,请直接复制文件夹。",archiveFailed:"没能打包:{error}",exportBusy:"另一个导出正在进行,请稍后再导出 {label}。",exportUnsupported:"现在无法导出 {label}。",exportFailed:"无法导出 {label}。",saving:"正在保存…",reconnecting:"正在重新连接…",notSaved:"未保存",notSavedTitle:"页面没能保存最近的修改。",saveRetry:"保存失败,点击重试",readOnly:"只读",readOnlyTitle:"这里的内容无法保存",leaveLosesWork:"确定离开?尚未保存的修改会丢失。",actionSaveNow:"立即保存",actionOpenFind:"查找",actionUndo:"撤销",actionRedo:"重做",actionEditPage:"编辑页面",actionUsePage:"使用这个页面",actionCommentSelection:"评论选中内容",actionOpenPageList:"页面列表",actionHandOffCode:"交给代码处理",whyOlderVersion:"你正在查看旧版本",whyAgentWorking:"{agent} 正在工作",whyDraftOpen:"请先关闭打开的草稿",whyCommentsOn:"请先退出评论模式",whyNeedsAgent:"需要一个智能体会话",whyUnsaved:"请先保存",whyOther:"暂时不可用",noOwner:"没有会话拥有这个作品",noOwnerNote:"发出的消息会等下一个处理它的会话。",ownerNote:"消息会发给做这个作品的 {harness} 会话。",agentIdle:"{agent} 空闲",agentWaiting:"{agent} 在等待",sessionOffline:"会话离线",offlineNote:"{harness} 会话下次工作时,{agent} 会看到你发的消息。",askPlaceholder:"想改什么?",sendToAgent:"发给 {agent}",sending:"发送中…",sent:"已发送。",sentInbox:"会话下次工作时 {agent} 会看到。",notDelivered:"没送达。",notSent:"没发出去:{error}",viaDelivered:"已送达",viaInbox:"等会话处理",viaFailed:"没送达",emptyTitle:"这个作品还是空的",emptyBody:"{root} 里还没有写入 {type} 的内容。由 Agent 来写:把下面这段发给它。",startSession:"和 {agent} 开个新会话",promptCopied:"已复制:粘贴到任意装了 Artifact 工具的 Agent 会话里。",sentToSession:"已发到新会话。",problemTitle:"这个作品在这里打不开",noPage:"没有页面。",folder:"文件夹:{root}",askToLook:"让 {agent} 看看",problemAsk:"作品页打不开:{problem}",noBoot:"没有要显示的作品。从主页打开一个。",homeTitle:"Open Artifact",homeSub:"本机所有 Agent 共用的作品和类型。",artifacts:"作品",types:"类型",newArtifact:"新建作品",moreActions:"更多操作",backToSession:"回到会话",noArtifacts:"还没有作品。让 Agent 用 Artifact 工具创建一个,或者在这里新建。",pageOpen:"已打开",typeMissing:"类型没有安装",deleted:"已删除「{title}」,文件夹保留。",undo:"撤销",restored:"已恢复",couldNotRestore:"没能恢复:{error}",couldNotLoad:"读取失败:{error}",typeRoots:"类型根目录:{roots}",noTypes:"没有找到类型。",disabled:"已停用",shadowedBy:"被 {root} 覆盖",newOf:"新建 {type}",create:"创建",title:"标题",folderOptional:"文件夹(可不填)",folderHint:"默认:主工作区里新建一个文件夹",needTitle:"先写个标题。",couldNotCreate:"没建成:{error}",renameArtifact:"重命名作品",cannotCreateYet:"目前这里只能新建 Design 作品。"};function gw(o){return o&&/^zh\b/i.test(o)?"zh-CN":"en"}const np=gw(typeof navigator>"u"?void 0:navigator.language);function mw(o,l){return l?o.replace(/\{(\w+)\}/g,(a,r)=>r in l?String(l[r]):a):o}function yw(o,l,a){return mw((o==="zh-CN"?hw[l]:void 0)??pw[l],a)}function He(o,l){return yw(np,o,l)}const un={artifacts:"artifacts",artifact:"artifact",types:"types",events:"events",share:"artifact.share",archive:"artifact.archive",restore:"artifacts.restore",open:"artifacts.open",create:"artifacts.create",update:"artifacts.update",duplicate:"artifacts.duplicate",delete:"artifacts.delete",ask:"artifacts.ask"},vw="[Artifact comment sent to agent]",bw="[Artifact edit request sent to agent]",Sw="[Artifact task finished]";function xw(o){return!!o&&typeof o=="object"&&typeof o.openArtifact=="string"}const Tw=["quickstart","list","publish","read","open","call","adopt","delete","share"],Ew=["get","list","query","set","update","delete","str_replace","batch"],Rw=["read","reply","resolve","reopen","wait"],Cw=["share","export"],Ow={type:"object",properties:{action:{type:"string",enum:Tw,description:"What to do. Omitted: publish."},intent:{type:"string",description:"quickstart: what is being made (design, slides, whiteboard, document, data, other), or a few words about it."},scope:{type:"string",enum:["types","mine","all"],description:"list: the installed types, this session's and this workspace's artifacts (default), or every artifact."},type:{type:"string",description:"list: only artifacts of this type (an id, or open-artifact://type/<id>)."},query:{type:"string",description:"list: only artifacts whose title contains this text."},limit:{type:"integer",description:"list: how many to return (default 50, at most 200)."},cursor:{type:"string",description:"list: the next_cursor of the previous page."},type_url:{type:"string",description:"publish without url: the type to create from (open-artifact://type/<id>, from quickstart). read without url: the type to describe."},title:{type:"string",description:"publish without url: the new artifact's name."},folder:{type:"string",description:"publish without url, or adopt: where the artifact's folder goes (absolute, or relative to the workspace). Default <workspace>/artifacts/<slug>."},url:{type:"string",description:"An artifact: open-artifact://artifact/<id>, as publish returned it."},files:{type:"object",additionalProperties:!0,description:'publish with url: files to write under the artifact root, as {"rel/path": "text"} or {"rel/path": {"content": "...", "encoding": "base64"}}; null deletes.'},if_match:{type:"object",additionalProperties:!0,description:'publish with url: {"rel/path": sha256 | null | "*"}. Write only while the file still has the sha256 you read, does not exist (null), or anyway ("*"). One mismatch writes nothing and returns the current versions.'},check:{type:"boolean",description:"publish with url: run the type's check action after writing; its result comes back as check."},open:{type:"string",enum:["after_first_write","now"],description:"publish without url: after_first_write opens the page in your app once your first write lands; now opens it at once. Where your app cannot show pages by itself the result says so: open view_url in your app's built-in browser, if you have one."},related:{type:"boolean",description:"quickstart: list existing artifacts the recommended type can build on, such as design systems (default true)."},path:{type:"string",description:"read: one file or folder under the root (omitted: the record and the file list)."},paths:{type:"array",items:{type:"string"},description:"read: several files under the root at once."},name:{type:"string",description:"call: the action's name (check, upload, ...; read with url lists them)."},args:{type:"object",additionalProperties:!0,description:"call: the action's arguments. upload: {file: absolute path, name?, group?}."},panel:{type:"string",enum:Cw,description:"open: also open the page's Share panel (share), for the person to share it on the network, or its Export tab (export), for them to download a file."}}},ww={type:"object",properties:{action:{type:"string",enum:Ew},url:{type:"string",description:"The artifact (open-artifact://artifact/<id>)."},collection:{type:"string"},doc_id:{type:"string"},path:{type:"string",description:"collection/doc_id, instead of the two."},data:{type:"object",additionalProperties:!0,description:"set / update: the document's fields."},file_path:{type:"string",description:"set / update: a JSON file holding the fields, instead of data."},if_match:{description:'set / update / delete / str_replace: the sha256 get returned (write only if unchanged), null (only if it does not exist) or "*" (replace whatever is there).'},field:{type:"string",description:"str_replace: the text field, as a dot path (body, notes.text)."},old:{type:"string",description:"str_replace: the passage to replace; it must occur exactly once."},new:{type:"string",description:"str_replace: the passage that replaces it."},where:{type:"array",items:{type:"object",additionalProperties:!0},description:"query: [{field, op, value}], all must hold. op: ==, !=, <, <=, >, >=, in, not-in (up to 30 values), array-contains."},order_by:{type:"object",additionalProperties:!0,description:'query: {field, dir: "asc" | "desc"}.'},limit:{type:"integer",description:"list / query: how many documents (default 100, at most 1000)."},cursor:{type:"string",description:"list / query: the next_cursor of the previous page."},out_file:{type:"string",description:"get / list / query: write the result to this JSON file (absolute, or relative to the workspace) and return only its path and counts."},writes:{type:"array",items:{type:"object",additionalProperties:!0},description:"batch: [{op: set|update|delete|str_replace, path | collection+doc_id, data | file_path, if_match?, field?, old?, new?}], at most 500."}},required:["action","url"]},Aw={type:"object",properties:{action:{type:"string",enum:Rw},url:{type:"string",description:"The artifact (open-artifact://artifact/<id>). wait: optional."},thread_id:{type:"string",description:'reply / resolve / reopen: the thread (after ";thread=" in the message).'},text:{type:"string",description:"reply: the answer."},resolve:{type:"boolean",description:"reply: resolve the thread too."},all:{type:"boolean",description:"read: resolved threads too."},since:{type:"string",description:"read: only threads with a message at or after this time (ISO 8601)."},acknowledge_duplicate:{type:"boolean",description:"reply: send the same text as your last reply in this thread again, on purpose."},timeout_ms:{type:"number",description:"wait: how long (default 600000)."}},required:["action"]},nv={Artifact:Ow,ArtifactData:ww,ArtifactComments:Aw},Mw={Artifact:["Make and change artifacts: typed folders of files that open as live pages the person can view, edit, comment on and export. Actions:","- quickstart {intent}: call first for a new artifact; recommends a type and returns the call that creates it.",'- list {scope: "mine" | "all" | "types", type?, query?}: find existing artifacts, or the installed types.',"- publish {type_url, title, folder?, open?}: create an artifact; the result carries its root folder and the type's instructions. publish {url, files, if_match?, check?}: write files when you have no file tools of your own.","- read {url, path? | paths?}: the artifact's record, files and actions, or some of its files with their sha256. read {type_url}: a type's instructions, before creating.",`- open {url, panel?}: show it to the person in the computer's browser (or the app, when it shows pages), once its content is written. When your app has a built-in browser, open view_url there instead. panel "share" or "export" opens its Share panel or Export tab for them.`,"- call {url, name, args?}: run one of the type's actions (check, upload, ...). A long one answers {task, pending: true}; its result comes later as a message.","- adopt {url | folder}: take over an artifact, or add an existing folder. Only when the person asks.","- share {url}: whether it is shared on the local network, and its links. Only the person changes that, in the page's Share panel.","- delete {url}: forget an artifact; its folder stays. Only when the person asks."].join(`
9
+ `).replace(tx,"")}function hm(e,t){return t=pm(t),pm(e)===t}function ut(e,t,n,i,s,u){switch(n){case"children":typeof i=="string"?t==="body"||t==="textarea"&&i===""||Ql(e,i):(typeof i=="number"||typeof i=="bigint")&&t!=="body"&&Ql(e,""+i);break;case"className":Xa(e,"class",i);break;case"tabIndex":Xa(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":Xa(e,n,i);break;case"style":hp(e,i,u);break;case"data":if(t!=="object"){Xa(e,"data",i);break}case"src":case"href":if(i===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(n);break}i=Qa(""+i),e.setAttribute(n,i);break;case"action":case"formAction":if(typeof i=="function"){e.setAttribute(n,"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 u=="function"&&(n==="formAction"?(t!=="input"&&ut(e,t,"name",s.name,s,null),ut(e,t,"formEncType",s.formEncType,s,null),ut(e,t,"formMethod",s.formMethod,s,null),ut(e,t,"formTarget",s.formTarget,s,null)):(ut(e,t,"encType",s.encType,s,null),ut(e,t,"method",s.method,s,null),ut(e,t,"target",s.target,s,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(n);break}i=Qa(""+i),e.setAttribute(n,i);break;case"onClick":i!=null&&(e.onclick=$n);break;case"onScroll":i!=null&&Ze("scroll",e);break;case"onScrollEnd":i!=null&&Ze("scrollend",e);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(r(61));if(n=i.__html,n!=null){if(s.children!=null)throw Error(r(60));e.innerHTML=n}}break;case"multiple":e.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":e.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){e.removeAttribute("xlink:href");break}n=Qa(""+i),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(n,""+i):e.removeAttribute(n);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":i&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":i===!0?e.setAttribute(n,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(n,i):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?e.setAttribute(n,i):e.removeAttribute(n);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?e.removeAttribute(n):e.setAttribute(n,i);break;case"popover":Ze("beforetoggle",e),Ze("toggle",e),Ga(e,"popover",i);break;case"xlinkActuate":Wn(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":Wn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":Wn(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":Wn(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":Wn(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":Wn(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":Wn(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":Wn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":Wn(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":Ga(e,"is",i);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=M0.get(n)||n,Ga(e,n,i))}}function Vc(e,t,n,i,s,u){switch(n){case"style":hp(e,i,u);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(r(61));if(n=i.__html,n!=null){if(s.children!=null)throw Error(r(60));e.innerHTML=n}}break;case"children":typeof i=="string"?Ql(e,i):(typeof i=="number"||typeof i=="bigint")&&Ql(e,""+i);break;case"onScroll":i!=null&&Ze("scroll",e);break;case"onScrollEnd":i!=null&&Ze("scrollend",e);break;case"onClick":i!=null&&(e.onclick=$n);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ip.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(s=n.endsWith("Capture"),t=n.slice(2,s?n.length-7:void 0),u=e[tn]||null,u=u!=null?u[n]:null,typeof u=="function"&&e.removeEventListener(t,u,s),typeof i=="function")){typeof u!="function"&&u!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,i,s);break e}n in e?e[n]=i:i===!0?e.setAttribute(n,""):Ga(e,n,i)}}}function Xt(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ze("error",e),Ze("load",e);var i=!1,s=!1,u;for(u in n)if(n.hasOwnProperty(u)){var p=n[u];if(p!=null)switch(u){case"src":i=!0;break;case"srcSet":s=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,t));default:ut(e,t,u,p,n,null)}}s&&ut(e,t,"srcSet",n.srcSet,n,null),i&&ut(e,t,"src",n.src,n,null);return;case"input":Ze("invalid",e);var x=u=p=s=null,_=null,X=null;for(i in n)if(n.hasOwnProperty(i)){var re=n[i];if(re!=null)switch(i){case"name":s=re;break;case"type":p=re;break;case"checked":_=re;break;case"defaultChecked":X=re;break;case"value":u=re;break;case"defaultValue":x=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(r(137,t));break;default:ut(e,t,i,re,n,null)}}cp(e,u,x,_,X,p,s,!1);return;case"select":Ze("invalid",e),i=p=u=null;for(s in n)if(n.hasOwnProperty(s)&&(x=n[s],x!=null))switch(s){case"value":u=x;break;case"defaultValue":p=x;break;case"multiple":i=x;default:ut(e,t,s,x,n,null)}t=u,n=p,e.multiple=!!i,t!=null?Kl(e,!!i,t,!1):n!=null&&Kl(e,!!i,n,!0);return;case"textarea":Ze("invalid",e),u=s=i=null;for(p in n)if(n.hasOwnProperty(p)&&(x=n[p],x!=null))switch(p){case"value":i=x;break;case"defaultValue":s=x;break;case"children":u=x;break;case"dangerouslySetInnerHTML":if(x!=null)throw Error(r(91));break;default:ut(e,t,p,x,n,null)}dp(e,i,s,u);return;case"option":for(_ in n)n.hasOwnProperty(_)&&(i=n[_],i!=null)&&(_==="selected"?e.selected=i&&typeof i!="function"&&typeof i!="symbol":ut(e,t,_,i,n,null));return;case"dialog":Ze("beforetoggle",e),Ze("toggle",e),Ze("cancel",e),Ze("close",e);break;case"iframe":case"object":Ze("load",e);break;case"video":case"audio":for(i=0;i<ma.length;i++)Ze(ma[i],e);break;case"image":Ze("error",e),Ze("load",e);break;case"details":Ze("toggle",e);break;case"embed":case"source":case"link":Ze("error",e),Ze("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(X in n)if(n.hasOwnProperty(X)&&(i=n[X],i!=null))switch(X){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,t));default:ut(e,t,X,i,n,null)}return;default:if(lu(t)){for(re in n)n.hasOwnProperty(re)&&(i=n[re],i!==void 0&&Vc(e,t,re,i,n,void 0));return}}for(x in n)n.hasOwnProperty(x)&&(i=n[x],i!=null&&ut(e,t,x,i,n,null))}function nx(e,t,n,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var s=null,u=null,p=null,x=null,_=null,X=null,re=null;for(te in n){var ce=n[te];if(n.hasOwnProperty(te)&&ce!=null)switch(te){case"checked":break;case"value":break;case"defaultValue":_=ce;default:i.hasOwnProperty(te)||ut(e,t,te,null,i,ce)}}for(var Z in i){var te=i[Z];if(ce=n[Z],i.hasOwnProperty(Z)&&(te!=null||ce!=null))switch(Z){case"type":u=te;break;case"name":s=te;break;case"checked":X=te;break;case"defaultChecked":re=te;break;case"value":p=te;break;case"defaultValue":x=te;break;case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(r(137,t));break;default:te!==ce&&ut(e,t,Z,te,i,ce)}}nu(e,p,x,_,X,re,u,s);return;case"select":te=p=x=Z=null;for(u in n)if(_=n[u],n.hasOwnProperty(u)&&_!=null)switch(u){case"value":break;case"multiple":te=_;default:i.hasOwnProperty(u)||ut(e,t,u,null,i,_)}for(s in i)if(u=i[s],_=n[s],i.hasOwnProperty(s)&&(u!=null||_!=null))switch(s){case"value":Z=u;break;case"defaultValue":x=u;break;case"multiple":p=u;default:u!==_&&ut(e,t,s,u,i,_)}t=x,n=p,i=te,Z!=null?Kl(e,!!n,Z,!1):!!i!=!!n&&(t!=null?Kl(e,!!n,t,!0):Kl(e,!!n,n?[]:"",!1));return;case"textarea":te=Z=null;for(x in n)if(s=n[x],n.hasOwnProperty(x)&&s!=null&&!i.hasOwnProperty(x))switch(x){case"value":break;case"children":break;default:ut(e,t,x,null,i,s)}for(p in i)if(s=i[p],u=n[p],i.hasOwnProperty(p)&&(s!=null||u!=null))switch(p){case"value":Z=s;break;case"defaultValue":te=s;break;case"children":break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(r(91));break;default:s!==u&&ut(e,t,p,s,i,u)}fp(e,Z,te);return;case"option":for(var Ce in n)Z=n[Ce],n.hasOwnProperty(Ce)&&Z!=null&&!i.hasOwnProperty(Ce)&&(Ce==="selected"?e.selected=!1:ut(e,t,Ce,null,i,Z));for(_ in i)Z=i[_],te=n[_],i.hasOwnProperty(_)&&Z!==te&&(Z!=null||te!=null)&&(_==="selected"?e.selected=Z&&typeof Z!="function"&&typeof Z!="symbol":ut(e,t,_,Z,i,te));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 je in n)Z=n[je],n.hasOwnProperty(je)&&Z!=null&&!i.hasOwnProperty(je)&&ut(e,t,je,null,i,Z);for(X in i)if(Z=i[X],te=n[X],i.hasOwnProperty(X)&&Z!==te&&(Z!=null||te!=null))switch(X){case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(r(137,t));break;default:ut(e,t,X,Z,i,te)}return;default:if(lu(t)){for(var ct in n)Z=n[ct],n.hasOwnProperty(ct)&&Z!==void 0&&!i.hasOwnProperty(ct)&&Vc(e,t,ct,void 0,i,Z);for(re in i)Z=i[re],te=n[re],!i.hasOwnProperty(re)||Z===te||Z===void 0&&te===void 0||Vc(e,t,re,Z,i,te);return}}for(var q in n)Z=n[q],n.hasOwnProperty(q)&&Z!=null&&!i.hasOwnProperty(q)&&ut(e,t,q,null,i,Z);for(ce in i)Z=i[ce],te=n[ce],!i.hasOwnProperty(ce)||Z===te||Z==null&&te==null||ut(e,t,ce,Z,i,te)}function gm(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function ox(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),i=0;i<n.length;i++){var s=n[i],u=s.transferSize,p=s.initiatorType,x=s.duration;if(u&&x&&gm(p)){for(p=0,x=s.responseEnd,i+=1;i<n.length;i++){var _=n[i],X=_.startTime;if(X>x)break;var re=_.transferSize,ce=_.initiatorType;re&&gm(ce)&&(_=_.responseEnd,p+=re*(_<x?1:(x-X)/(_-X)))}if(--i,t+=8*(u+p)/(s.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Gc=null,Xc=null;function Pr(e){return e.nodeType===9?e:e.ownerDocument}function mm(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function ym(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Kc(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Qc=null;function lx(){var e=window.event;return e&&e.type==="popstate"?e===Qc?!1:(Qc=e,!0):(Qc=null,!1)}var vm=typeof setTimeout=="function"?setTimeout:void 0,ix=typeof clearTimeout=="function"?clearTimeout:void 0,bm=typeof Promise=="function"?Promise:void 0,ax=typeof queueMicrotask=="function"?queueMicrotask:typeof bm<"u"?function(e){return bm.resolve(null).then(e).catch(rx)}:vm;function rx(e){setTimeout(function(){throw e})}function Zo(e){return e==="head"}function Sm(e,t){var n=t,i=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"||n==="/&"){if(i===0){e.removeChild(s),Ci(t);return}i--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")i++;else if(n==="html")va(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,va(n);for(var u=n.firstChild;u;){var p=u.nextSibling,x=u.nodeName;u[ki]||x==="SCRIPT"||x==="STYLE"||x==="LINK"&&u.rel.toLowerCase()==="stylesheet"||n.removeChild(u),u=p}}else n==="body"&&va(e.ownerDocument.body);n=s}while(n);Ci(t)}function xm(e,t){var n=e;e=0;do{var i=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=i}while(n)}function Fc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Fc(n),eu(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function sx(e,t,n,i){for(;e.nodeType===1;){var s=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(i){if(!e[ki])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(u=e.getAttribute("rel"),u==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(u!==s.rel||e.getAttribute("href")!==(s.href==null||s.href===""?null:s.href)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin)||e.getAttribute("title")!==(s.title==null?null:s.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(u=e.getAttribute("src"),(u!==(s.src==null?null:s.src)||e.getAttribute("type")!==(s.type==null?null:s.type)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin))&&u&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var u=s.name==null?null:""+s.name;if(s.type==="hidden"&&e.getAttribute("name")===u)return e}else return e;if(e=Dn(e.nextSibling),e===null)break}return null}function ux(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Dn(e.nextSibling),e===null))return null;return e}function Tm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Dn(e.nextSibling),e===null))return null;return e}function Zc(e){return e.data==="$?"||e.data==="$~"}function Jc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function cx(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var i=function(){t(),n.removeEventListener("DOMContentLoaded",i)};n.addEventListener("DOMContentLoaded",i),e._reactRetry=i}}function Dn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Wc=null;function Em(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Dn(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function Rm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function Cm(e,t,n){switch(t=Pr(n),e){case"html":if(e=t.documentElement,!e)throw Error(r(452));return e;case"head":if(e=t.head,!e)throw Error(r(453));return e;case"body":if(e=t.body,!e)throw Error(r(454));return e;default:throw Error(r(451))}}function va(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);eu(e)}var Nn=new Map,Om=new Set;function Vr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var mo=P.d;P.d={f:fx,r:dx,D:px,C:hx,L:gx,m:mx,X:vx,S:yx,M:bx};function fx(){var e=mo.f(),t=jr();return e||t}function dx(e){var t=Vl(e);t!==null&&t.tag===5&&t.type==="form"?Ph(t):mo.r(e)}var Ti=typeof document>"u"?null:document;function wm(e,t,n){var i=Ti;if(i&&typeof t=="string"&&t){var s=En(t);s='link[rel="'+e+'"][href="'+s+'"]',typeof n=="string"&&(s+='[crossorigin="'+n+'"]'),Om.has(s)||(Om.add(s),e={rel:e,crossOrigin:n,href:t},i.querySelector(s)===null&&(t=i.createElement("link"),Xt(t,"link",e),Bt(t),i.head.appendChild(t)))}}function px(e){mo.D(e),wm("dns-prefetch",e,null)}function hx(e,t){mo.C(e,t),wm("preconnect",e,t)}function gx(e,t,n){mo.L(e,t,n);var i=Ti;if(i&&e&&t){var s='link[rel="preload"][as="'+En(t)+'"]';t==="image"&&n&&n.imageSrcSet?(s+='[imagesrcset="'+En(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(s+='[imagesizes="'+En(n.imageSizes)+'"]')):s+='[href="'+En(e)+'"]';var u=s;switch(t){case"style":u=Ei(e);break;case"script":u=Ri(e)}Nn.has(u)||(e=b({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Nn.set(u,e),i.querySelector(s)!==null||t==="style"&&i.querySelector(ba(u))||t==="script"&&i.querySelector(Sa(u))||(t=i.createElement("link"),Xt(t,"link",e),Bt(t),i.head.appendChild(t)))}}function mx(e,t){mo.m(e,t);var n=Ti;if(n&&e){var i=t&&typeof t.as=="string"?t.as:"script",s='link[rel="modulepreload"][as="'+En(i)+'"][href="'+En(e)+'"]',u=s;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=Ri(e)}if(!Nn.has(u)&&(e=b({rel:"modulepreload",href:e},t),Nn.set(u,e),n.querySelector(s)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Sa(u)))return}i=n.createElement("link"),Xt(i,"link",e),Bt(i),n.head.appendChild(i)}}}function yx(e,t,n){mo.S(e,t,n);var i=Ti;if(i&&e){var s=Gl(i).hoistableStyles,u=Ei(e);t=t||"default";var p=s.get(u);if(!p){var x={loading:0,preload:null};if(p=i.querySelector(ba(u)))x.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Nn.get(u))&&$c(e,n);var _=p=i.createElement("link");Bt(_),Xt(_,"link",e),_._p=new Promise(function(X,re){_.onload=X,_.onerror=re}),_.addEventListener("load",function(){x.loading|=1}),_.addEventListener("error",function(){x.loading|=2}),x.loading|=4,Gr(p,t,i)}p={type:"stylesheet",instance:p,count:1,state:x},s.set(u,p)}}}function vx(e,t){mo.X(e,t);var n=Ti;if(n&&e){var i=Gl(n).hoistableScripts,s=Ri(e),u=i.get(s);u||(u=n.querySelector(Sa(s)),u||(e=b({src:e,async:!0},t),(t=Nn.get(s))&&ef(e,t),u=n.createElement("script"),Bt(u),Xt(u,"link",e),n.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},i.set(s,u))}}function bx(e,t){mo.M(e,t);var n=Ti;if(n&&e){var i=Gl(n).hoistableScripts,s=Ri(e),u=i.get(s);u||(u=n.querySelector(Sa(s)),u||(e=b({src:e,async:!0,type:"module"},t),(t=Nn.get(s))&&ef(e,t),u=n.createElement("script"),Bt(u),Xt(u,"link",e),n.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},i.set(s,u))}}function Am(e,t,n,i){var s=(s=ie.current)?Vr(s):null;if(!s)throw Error(r(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Ei(n.href),n=Gl(s).hoistableStyles,i=n.get(t),i||(i={type:"style",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Ei(n.href);var u=Gl(s).hoistableStyles,p=u.get(e);if(p||(s=s.ownerDocument||s,p={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,p),(u=s.querySelector(ba(e)))&&!u._p&&(p.instance=u,p.state.loading=5),Nn.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Nn.set(e,n),u||Sx(s,e,n,p.state))),t&&i===null)throw Error(r(528,""));return p}if(t&&i!==null)throw Error(r(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Ri(n),n=Gl(s).hoistableScripts,i=n.get(t),i||(i={type:"script",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,e))}}function Ei(e){return'href="'+En(e)+'"'}function ba(e){return'link[rel="stylesheet"]['+e+"]"}function Mm(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function Sx(e,t,n,i){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?i.loading=1:(t=e.createElement("link"),i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2}),Xt(t,"link",n),Bt(t),e.head.appendChild(t))}function Ri(e){return'[src="'+En(e)+'"]'}function Sa(e){return"script[async]"+e}function Dm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+En(n.href)+'"]');if(i)return t.instance=i,Bt(i),i;var s=b({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),Bt(i),Xt(i,"style",s),Gr(i,n.precedence,e),t.instance=i;case"stylesheet":s=Ei(n.href);var u=e.querySelector(ba(s));if(u)return t.state.loading|=4,t.instance=u,Bt(u),u;i=Mm(n),(s=Nn.get(s))&&$c(i,s),u=(e.ownerDocument||e).createElement("link"),Bt(u);var p=u;return p._p=new Promise(function(x,_){p.onload=x,p.onerror=_}),Xt(u,"link",i),t.state.loading|=4,Gr(u,n.precedence,e),t.instance=u;case"script":return u=Ri(n.src),(s=e.querySelector(Sa(u)))?(t.instance=s,Bt(s),s):(i=n,(s=Nn.get(u))&&(i=b({},n),ef(i,s)),e=e.ownerDocument||e,s=e.createElement("script"),Bt(s),Xt(s,"link",i),e.head.appendChild(s),t.instance=s);case"void":return null;default:throw Error(r(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(i=t.instance,t.state.loading|=4,Gr(i,n.precedence,e));return t.instance}function Gr(e,t,n){for(var i=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),s=i.length?i[i.length-1]:null,u=s,p=0;p<i.length;p++){var x=i[p];if(x.dataset.precedence===t)u=x;else if(u!==s)break}u?u.parentNode.insertBefore(e,u.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function $c(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function ef(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Xr=null;function Nm(e,t,n){if(Xr===null){var i=new Map,s=Xr=new Map;s.set(n,i)}else s=Xr,i=s.get(n),i||(i=new Map,s.set(n,i));if(i.has(e))return i;for(i.set(e,null),n=n.getElementsByTagName(e),s=0;s<n.length;s++){var u=n[s];if(!(u[ki]||u[qt]||e==="link"&&u.getAttribute("rel")==="stylesheet")&&u.namespaceURI!=="http://www.w3.org/2000/svg"){var p=u.getAttribute(t)||"";p=e+p;var x=i.get(p);x?x.push(u):i.set(p,[u])}}return i}function zm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function xx(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function _m(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Tx(e,t,n,i){if(n.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var s=Ei(i.href),u=t.querySelector(ba(s));if(u){t=u._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Kr.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=u,Bt(u);return}u=t.ownerDocument||t,i=Mm(i),(s=Nn.get(s))&&$c(i,s),u=u.createElement("link"),Bt(u);var p=u;p._p=new Promise(function(x,_){p.onload=x,p.onerror=_}),Xt(u,"link",i),n.instance=u}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Kr.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var tf=0;function Ex(e,t){return e.stylesheets&&e.count===0&&Fr(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var i=setTimeout(function(){if(e.stylesheets&&Fr(e,e.stylesheets),e.unsuspend){var u=e.unsuspend;e.unsuspend=null,u()}},6e4+t);0<e.imgBytes&&tf===0&&(tf=62500*ox());var s=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Fr(e,e.stylesheets),e.unsuspend)){var u=e.unsuspend;e.unsuspend=null,u()}},(e.imgBytes>tf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(s)}}:null}function Kr(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Fr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Qr=null;function Fr(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Qr=new Map,t.forEach(Rx,e),Qr=null,Kr.call(e))}function Rx(e,t){if(!(t.state.loading&4)){var n=Qr.get(e);if(n)var i=n.get(null);else{n=new Map,Qr.set(e,n);for(var s=e.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u<s.length;u++){var p=s[u];(p.nodeName==="LINK"||p.getAttribute("media")!=="not all")&&(n.set(p.dataset.precedence,p),i=p)}i&&n.set(null,i)}s=t.instance,p=s.getAttribute("data-precedence"),u=n.get(p)||i,u===i&&n.set(null,s),n.set(p,s),this.count++,i=Kr.bind(this),s.addEventListener("load",i),s.addEventListener("error",i),u?u.parentNode.insertBefore(s,u.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(s,e.firstChild)),t.state.loading|=4}}var xa={$$typeof:A,Provider:null,Consumer:null,_currentValue:I,_currentValue2:I,_threadCount:0};function Cx(e,t,n,i,s,u,p,x,_){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ao(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ao(0),this.hiddenUpdates=Ao(null),this.identifierPrefix=i,this.onUncaughtError=s,this.onCaughtError=u,this.onRecoverableError=p,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=_,this.incompleteTransitions=new Map}function Hm(e,t,n,i,s,u,p,x,_,X,re,ce){return e=new Cx(e,t,n,p,_,X,re,ce,x),t=1,u===!0&&(t|=24),u=fn(3,null,null,t),e.current=u,u.stateNode=e,t=Hu(),t.refCount++,e.pooledCache=t,t.refCount++,u.memoizedState={element:i,isDehydrated:n,cache:t},Lu(u),e}function jm(e){return e?(e=ti,e):ti}function km(e,t,n,i,s,u){s=jm(s),i.context===null?i.context=s:i.pendingContext=s,i=Bo(t),i.payload={element:n},u=u===void 0?null:u,u!==null&&(i.callback=u),n=Yo(e,i,t),n!==null&&(sn(n,e,t),$i(n,e,t))}function Um(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function nf(e,t){Um(e,t),(e=e.alternate)&&Um(e,t)}function Lm(e){if(e.tag===13||e.tag===31){var t=yl(e,67108864);t!==null&&sn(t,e,67108864),nf(e,67108864)}}function Bm(e){if(e.tag===13||e.tag===31){var t=mn();t=No(t);var n=yl(e,t);n!==null&&sn(n,e,t),nf(e,t)}}var Zr=!0;function Ox(e,t,n,i){var s=N.T;N.T=null;var u=P.p;try{P.p=2,of(e,t,n,i)}finally{P.p=u,N.T=s}}function wx(e,t,n,i){var s=N.T;N.T=null;var u=P.p;try{P.p=8,of(e,t,n,i)}finally{P.p=u,N.T=s}}function of(e,t,n,i){if(Zr){var s=lf(i);if(s===null)Pc(e,t,i,Jr,n),Im(e,i);else if(Mx(s,e,t,n,i))i.stopPropagation();else if(Im(e,i),t&4&&-1<Ax.indexOf(e)){for(;s!==null;){var u=Vl(s);if(u!==null)switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var p=xt(u.pendingLanes);if(p!==0){var x=u;for(x.pendingLanes|=2,x.entangledLanes|=2;p;){var _=1<<31-pt(p);x.entanglements[1]|=_,p&=~_}Qn(u),(lt&6)===0&&(_r=fe()+500,ga(0))}}break;case 31:case 13:x=yl(u,2),x!==null&&sn(x,u,2),jr(),nf(u,2)}if(u=lf(i),u===null&&Pc(e,t,i,Jr,n),u===s)break;s=u}s!==null&&i.stopPropagation()}else Pc(e,t,i,null,n)}}function lf(e){return e=au(e),af(e)}var Jr=null;function af(e){if(Jr=null,e=Pl(e),e!==null){var t=f(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=d(t),e!==null)return e;e=null}else if(n===31){if(e=m(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Jr=e,null}function Ym(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(me()){case de:return 2;case ae:return 8;case ye:case Le:return 32;case Lt:return 268435456;default:return 32}default:return 32}}var rf=!1,Jo=null,Wo=null,$o=null,Ta=new Map,Ea=new Map,el=[],Ax="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 Im(e,t){switch(e){case"focusin":case"focusout":Jo=null;break;case"dragenter":case"dragleave":Wo=null;break;case"mouseover":case"mouseout":$o=null;break;case"pointerover":case"pointerout":Ta.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ea.delete(t.pointerId)}}function Ra(e,t,n,i,s,u){return e===null||e.nativeEvent!==u?(e={blockedOn:t,domEventName:n,eventSystemFlags:i,nativeEvent:u,targetContainers:[s]},t!==null&&(t=Vl(t),t!==null&&Lm(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function Mx(e,t,n,i,s){switch(t){case"focusin":return Jo=Ra(Jo,e,t,n,i,s),!0;case"dragenter":return Wo=Ra(Wo,e,t,n,i,s),!0;case"mouseover":return $o=Ra($o,e,t,n,i,s),!0;case"pointerover":var u=s.pointerId;return Ta.set(u,Ra(Ta.get(u)||null,e,t,n,i,s)),!0;case"gotpointercapture":return u=s.pointerId,Ea.set(u,Ra(Ea.get(u)||null,e,t,n,i,s)),!0}return!1}function qm(e){var t=Pl(e.target);if(t!==null){var n=f(t);if(n!==null){if(t=n.tag,t===13){if(t=d(n),t!==null){e.blockedOn=t,Va(e.priority,function(){Bm(n)});return}}else if(t===31){if(t=m(n),t!==null){e.blockedOn=t,Va(e.priority,function(){Bm(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Wr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=lf(e.nativeEvent);if(n===null){n=e.nativeEvent;var i=new n.constructor(n.type,n);iu=i,n.target.dispatchEvent(i),iu=null}else return t=Vl(n),t!==null&&Lm(t),e.blockedOn=n,!1;t.shift()}return!0}function Pm(e,t,n){Wr(e)&&n.delete(t)}function Dx(){rf=!1,Jo!==null&&Wr(Jo)&&(Jo=null),Wo!==null&&Wr(Wo)&&(Wo=null),$o!==null&&Wr($o)&&($o=null),Ta.forEach(Pm),Ea.forEach(Pm)}function $r(e,t){e.blockedOn===t&&(e.blockedOn=null,rf||(rf=!0,o.unstable_scheduleCallback(o.unstable_NormalPriority,Dx)))}var es=null;function Vm(e){es!==e&&(es=e,o.unstable_scheduleCallback(o.unstable_NormalPriority,function(){es===e&&(es=null);for(var t=0;t<e.length;t+=3){var n=e[t],i=e[t+1],s=e[t+2];if(typeof i!="function"){if(af(i||n)===null)continue;break}var u=Vl(n);u!==null&&(e.splice(t,3),t-=3,lc(u,{pending:!0,data:s,method:n.method,action:i},i,s))}}))}function Ci(e){function t(_){return $r(_,e)}Jo!==null&&$r(Jo,e),Wo!==null&&$r(Wo,e),$o!==null&&$r($o,e),Ta.forEach(t),Ea.forEach(t);for(var n=0;n<el.length;n++){var i=el[n];i.blockedOn===e&&(i.blockedOn=null)}for(;0<el.length&&(n=el[0],n.blockedOn===null);)qm(n),n.blockedOn===null&&el.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(i=0;i<n.length;i+=3){var s=n[i],u=n[i+1],p=s[tn]||null;if(typeof u=="function")p||Vm(n);else if(p){var x=null;if(u&&u.hasAttribute("formAction")){if(s=u,p=u[tn]||null)x=p.formAction;else if(af(s)!==null)continue}else x=p.action;typeof x=="function"?n[i+1]=x:(n.splice(i,3),i-=3),Vm(n)}}}function Gm(){function e(u){u.canIntercept&&u.info==="react-transition"&&u.intercept({handler:function(){return new Promise(function(p){return s=p})},focusReset:"manual",scroll:"manual"})}function t(){s!==null&&(s(),s=null),i||setTimeout(n,20)}function n(){if(!i&&!navigation.transition){var u=navigation.currentEntry;u&&u.url!=null&&navigation.navigate(u.url,{state:u.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var i=!1,s=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){i=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),s!==null&&(s(),s=null)}}}function sf(e){this._internalRoot=e}ts.prototype.render=sf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(r(409));var n=t.current,i=mn();km(n,i,e,t,null,null)},ts.prototype.unmount=sf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;km(e.current,2,null,e,null,null),jr(),t[ql]=null}};function ts(e){this._internalRoot=e}ts.prototype.unstable_scheduleHydration=function(e){if(e){var t=Pa();e={blockedOn:null,target:e,priority:t};for(var n=0;n<el.length&&t!==0&&t<el[n].priority;n++);el.splice(n,0,e),n===0&&qm(e)}};var Xm=l.version;if(Xm!=="19.2.4")throw Error(r(527,Xm,"19.2.4"));P.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(r(188)):(e=Object.keys(e).join(","),Error(r(268,e)));return e=g(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var Nx={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:N,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ns=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ns.isDisabled&&ns.supportsFiber)try{Se=ns.inject(Nx),Ie=ns}catch{}}return Oa.createRoot=function(e,t){if(!c(e))throw Error(r(299));var n=!1,i="",s=$h,u=eg,p=tg;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onUncaughtError!==void 0&&(s=t.onUncaughtError),t.onCaughtError!==void 0&&(u=t.onCaughtError),t.onRecoverableError!==void 0&&(p=t.onRecoverableError)),t=Hm(e,1,!1,null,null,n,i,null,s,u,p,Gm),e[ql]=t.current,qc(e),new sf(t)},Oa.hydrateRoot=function(e,t,n){if(!c(e))throw Error(r(299));var i=!1,s="",u=$h,p=eg,x=tg,_=null;return n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onUncaughtError!==void 0&&(u=n.onUncaughtError),n.onCaughtError!==void 0&&(p=n.onCaughtError),n.onRecoverableError!==void 0&&(x=n.onRecoverableError),n.formState!==void 0&&(_=n.formState)),t=Hm(e,1,!0,t,n??null,i,s,_,u,p,x,Gm),t.context=jm(null),n=t.current,i=mn(),i=No(i),s=Bo(i),s.callback=null,Yo(n,s,i),n=i,t.current.lanes=n,xn(t,n),Qn(t),e[ql]=t.current,qc(e),new ts(t)},Oa.version="19.2.4",Oa}var ny;function Px(){if(ny)return ff.exports;ny=1;function o(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(o)}catch(l){console.error(l)}}return o(),ff.exports=qx(),ff.exports}var Vx=Px();function fv(o){var l,a,r="";if(typeof o=="string"||typeof o=="number")r+=o;else if(typeof o=="object")if(Array.isArray(o)){var c=o.length;for(l=0;l<c;l++)o[l]&&(a=fv(o[l]))&&(r&&(r+=" "),r+=a)}else for(a in o)o[a]&&(r&&(r+=" "),r+=a);return r}function Gx(){for(var o,l,a=0,r="",c=arguments.length;a<c;a++)(o=arguments[a])&&(l=fv(o))&&(r&&(r+=" "),r+=l);return r}function Oo(...o){return Gx(o)}const oy={};function Zt(o,l){const a=v.useRef(oy);return a.current===oy&&(a.current=o(l)),a}const kf=[];let Uf;function Xx(){return Uf}function Kx(o){kf.push(o)}function Ds(o){const l=(a,r)=>{const c=Zt(Qx).current;let f;try{Uf=c;for(const d of kf)d.before(c);f=o(a,r);for(const d of kf)d.after(c);c.didInitialize=!0}finally{Uf=void 0}return f};return l.displayName=o.displayName||o.name,l}function dv(o){return v.forwardRef(Ds(o))}function Qx(){return{didInitialize:!1}}function ad(){}const Eo=Object.freeze([]),Ct=Object.freeze({}),Fx=()=>{},be=typeof document<"u"?v.useLayoutEffect:Fx;function Zx(o,l){return function(r,...c){const f=new URL(o);return f.searchParams.set("code",r.toString()),c.forEach(d=>f.searchParams.append("args[]",d)),`${l} error #${r}; visit ${f} for the full message.`}}const Qt=Zx("https://base-ui.com/production-error","Base UI"),pv=v.createContext(void 0);function Ns(o){const l=v.useContext(pv);if(l===void 0&&!o)throw new Error(Qt(72));return l}function zs(o){v.useEffect(o,Eo)}const wa=0;class yn{static create(){return new yn}currentId=wa;start(l,a){this.clear(),this.currentId=setTimeout(()=>{this.currentId=wa,a()},l)}isStarted(){return this.currentId!==wa}clear=()=>{this.currentId!==wa&&(clearTimeout(this.currentId),this.currentId=wa)};disposeEffect=()=>this.clear}function Jt(){const o=Zt(yn.create).current;return zs(o.disposeEffect),o}function Jx(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:Wx,platform:$x,maxTouchPoints:eT}=Jx(),_s=Wx.toLowerCase(),Ha=$x.toLowerCase(),Hs=/^i(os$|p)/.test(Ha)||Ha==="macintel"&&eT>1,ly="android",Lf=Ha===ly||_s.includes(ly),rd=!Hs&&Ha.startsWith("mac");Ha.startsWith("win");const tT=rd||Hs,ul=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none");!ul&&_s.includes("firefox");!ul&&_s.includes("chrom");const nT=tT,sd=/jsdom|happydom/.test(_s);function Fn(o){o.preventDefault(),o.stopPropagation()}function oT(o){return"nativeEvent"in o}function ud(o){return o.pointerType===""&&o.isTrusted?!0:Lf&&o.pointerType?o.type==="click"&&o.buttons===1:o.detail===0&&!o.pointerType}function cd(o){return sd?!1:!Lf&&o.width===0&&o.height===0||Lf&&o.width===1&&o.height===1&&o.pressure===0&&o.detail===0&&o.pointerType==="mouse"||o.width<1&&o.height<1&&o.pressure===0&&o.detail===0&&o.pointerType==="touch"}function ll(o,l){const a=["mouse","pen"];return l||a.push("",void 0),a.includes(o)}function lT(o){const l=o.type;return l==="click"||l==="mousedown"||l==="keydown"||l==="keyup"}function js(){return typeof window<"u"}function Kt(o){return fd(o)?(o.nodeName||"").toLowerCase():"#document"}function yt(o){var l;return(o==null||(l=o.ownerDocument)==null?void 0:l.defaultView)||window}function wo(o){var l;return(l=(fd(o)?o.ownerDocument:o.document)||window.document)==null?void 0:l.documentElement}function fd(o){return js()?o instanceof Node||o instanceof yt(o).Node:!1}function Je(o){return js()?o instanceof Element||o instanceof yt(o).Element:!1}function dt(o){return js()?o instanceof HTMLElement||o instanceof yt(o).HTMLElement:!1}function Di(o){return!js()||typeof ShadowRoot>"u"?!1:o instanceof ShadowRoot||o instanceof yt(o).ShadowRoot}function Ba(o){const{overflow:l,overflowX:a,overflowY:r,display:c}=vn(o);return/auto|scroll|overlay|hidden|clip/.test(l+r+a)&&c!=="inline"&&c!=="contents"}function iT(o){return/^(table|td|th)$/.test(Kt(o))}function ks(o){try{if(o.matches(":popover-open"))return!0}catch{}try{return o.matches(":modal")}catch{return!1}}const aT=/transform|translate|scale|rotate|perspective|filter/,rT=/paint|layout|strict|content/,Dl=o=>!!o&&o!=="none";let gf;function dd(o){const l=Je(o)?vn(o):o;return Dl(l.transform)||Dl(l.translate)||Dl(l.scale)||Dl(l.rotate)||Dl(l.perspective)||!pd()&&(Dl(l.backdropFilter)||Dl(l.filter))||aT.test(l.willChange||"")||rT.test(l.contain||"")}function sT(o){let l=Ro(o);for(;dt(l)&&!bo(l);){if(dd(l))return l;if(ks(l))return null;l=Ro(l)}return null}function pd(){return gf==null&&(gf=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),gf}function bo(o){return/^(html|body|#document)$/.test(Kt(o))}function vn(o){return yt(o).getComputedStyle(o)}function Us(o){return Je(o)?{scrollLeft:o.scrollLeft,scrollTop:o.scrollTop}:{scrollLeft:o.scrollX,scrollTop:o.scrollY}}function Ro(o){if(Kt(o)==="html")return o;const l=o.assignedSlot||o.parentNode||Di(o)&&o.host||wo(o);return Di(l)?l.host:l}function hv(o){const l=Ro(o);return bo(l)?(o.ownerDocument||o).body:dt(l)&&Ba(l)?l:hv(l)}function ja(o,l,a){var r;l===void 0&&(l=[]),a===void 0&&(a=!0);const c=hv(o),f=c===((r=o.ownerDocument)==null?void 0:r.body),d=yt(c);if(f){const m=Bf(d);return l.concat(d,d.visualViewport||[],Ba(c)?c:[],m&&a?ja(m):[])}else return l.concat(c,ja(c,[],a))}function Bf(o){return o.parent&&Object.getPrototypeOf(o.parent)?o.frameElement:null}function Ht(o){let l=o.activeElement;for(;l?.shadowRoot?.activeElement!=null;)l=l.shadowRoot.activeElement;return l}function De(o,l){if(!o||!l)return!1;const a=l.getRootNode?.();if(o.contains(l))return!0;if(a&&Di(a)){let r=l;for(;r;){if(o===r)return!0;r=r.parentNode||r.host}}return!1}function bt(o){return"composedPath"in o?o.composedPath()[0]??o.target:o.target}const Yf="data-base-ui-focusable",gv="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Ls="ArrowLeft",Bs="ArrowRight",mv="ArrowUp",hd="ArrowDown",yv="data-starting-style",uT="data-ending-style",cT={[yv]:""},fT={[uT]:""},Ys={transitionStatus(o){return o==="starting"?cT:o==="ending"?fT:null}},dT="data-open",pT="data-closed",hT="data-anchor-hidden",vv="data-popup-open",gT="data-pressed",mT={[vv]:""},yT={[vv]:"",[gT]:""},vT={[dT]:""},bT={[pT]:""},ST={[hT]:""},xT={open(o){return o?mT:null}},iy={open(o){return o?yT:null}},gd={open(o){return o?vT:bT},anchorHidden(o){return o?ST:null}},md={...gd,...Ys},If="data-trigger-disabled";function bs(o,l){if(!Je(o))return!1;const a=o;if(l.hasElement(a))return!a.hasAttribute(If);for(const[,r]of l.entries())if(De(r,a))return!r.hasAttribute(If);return!1}function mf(o,l){if(l==null)return!1;if("composedPath"in o)return o.composedPath().includes(l);const a=o;return a.target!=null&&l.contains(a.target)}function TT(o){return o.matches("html,body")}function Is(o){return dt(o)&&o.matches(gv)}function ET(o){return o?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${gv}`)!=null}function qf(o){return o?o.getAttribute("role")==="combobox"&&Is(o):!1}function Ss(o){if(!o||sd)return!0;try{return o.matches(":focus-visible")}catch{return!0}}function Pf(o){return o?o.hasAttribute(Yf)?o:o.querySelector(`[${Yf}]`)||o:null}function RT(o,l){return l!=null&&!ll(l)?0:typeof o=="function"?o():o}function zl(o,l,a){const r=RT(o,a);return typeof r=="number"?r:r?.[l]}function ay(o){return typeof o=="function"?o():o}function bv(o,l){return l||o==="click"||o==="mousedown"}function CT(o){return o?.includes("mouse")&&o!=="mousedown"}const qs="none",_i="trigger-press",Ut="trigger-hover",Oi="trigger-focus",yd="outside-press",Sv="item-press",OT="close-press",Ni="focus-out",Ps="escape-key",Vf="list-navigation",wT="cancel-open",Da="sibling-open",xv="disabled",ry="missing",sy="initial",vd="imperative-action";function Ke(o,l,a,r){let c=!1,f=!1;const d=r??Ct;return{reason:o,event:l??new Event("base-ui"),cancel(){c=!0},allowPropagation(){f=!0},get isCanceled(){return c},get isPropagationAllowed(){return f},trigger:a,...d}}const Tv=v.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new yn,currentIdRef:{current:null},currentContextRef:{current:null}});function AT(o,l){o.current=l.current}function MT(o){const{children:l,delay:a,timeoutMs:r=0}=o,c=v.useRef(a),f=v.useRef(a),d=v.useRef(null),m=v.useRef(null),h=Jt();return be(()=>{if(f.current=a,!d.current){c.current=a;return}c.current={open:zl(c.current,"open"),close:zl(a,"close")}},[a,d,c,f]),z.jsx(Tv.Provider,{value:v.useMemo(()=>({hasProvider:!0,delayRef:c,initialDelayRef:f,currentIdRef:d,timeoutMs:r,currentContextRef:m,timeout:h}),[r,h]),children:l})}function DT(o,l={open:!1}){const{open:a}=l,r="rootStore"in o?o.rootStore:o,c=r.useState("floatingId"),f=v.useContext(Tv),{currentIdRef:d,delayRef:m,timeoutMs:h,initialDelayRef:g,currentContextRef:y,hasProvider:b,timeout:S}=f,[E,T]=v.useState(!1),C=v.useRef(a);return be(()=>{C.current=a},[a]),be(()=>{function O(){y.current?.setIsInstantPhase(!1),d.current=null,y.current=null,m.current=g.current,S.clear()}if(d.current&&!a&&d.current===c){if(T(!1),h){const w=c;return S.start(h,()=>{r.select("open")||d.current&&d.current!==w||O()}),()=>{(C.current||d.current!==w)&&S.clear()}}O()}},[a,c,d,m,h,g,y,S,r]),be(()=>{if(!a)return;const O=y.current,w=d.current;S.clear(),y.current={onOpenChange:r.setOpen,setIsInstantPhase:T},d.current=c,m.current={open:0,close:zl(g.current,"close")},w!==null&&w!==c?(T(!0),O?.setIsInstantPhase(!0),O?.onOpenChange(!1,Ke(qs))):(T(!1),O?.setIsInstantPhase(!1))},[a,c,r,d,m,g,y,S]),be(()=>()=>{if(d.current===c){if(y.current=null,!C.current)return;d.current=null,AT(m,g),S.clear()}},[y,d,m,c,g,S]),v.useMemo(()=>({activeIdRef:d,hasProvider:b,delayRef:m,isInstantPhase:E}),[d,b,m,E])}function Ye(o,l,a,r){return o.addEventListener(l,a,r),()=>{o.removeEventListener(l,a,r)}}function In(...o){return()=>{for(let l=0;l<o.length;l+=1){const a=o[l];a&&a()}}}function _l(o,l,a,r){const c=Zt(Ev).current;return zT(c,o,l,a,r)&&Rv(c,[o,l,a,r]),c.callback}function NT(o){const l=Zt(Ev).current;return _T(l,o)&&Rv(l,o),l.callback}function Ev(){return{callback:null,cleanup:null,refs:[]}}function zT(o,l,a,r,c){return o.refs[0]!==l||o.refs[1]!==a||o.refs[2]!==r||o.refs[3]!==c}function _T(o,l){return o.refs.length!==l.length||o.refs.some((a,r)=>a!==l[r])}function Rv(o,l){if(o.refs=l,l.every(a=>a==null)){o.callback=null;return}o.callback=a=>{if(o.cleanup&&(o.cleanup(),o.cleanup=null),a!=null){const r=Array(l.length).fill(null);for(let c=0;c<l.length;c+=1){const f=l[c];if(f!=null)switch(typeof f){case"function":{const d=f(a);typeof d=="function"&&(r[c]=d);break}case"object":{f.current=a;break}}}o.cleanup=()=>{for(let c=0;c<l.length;c+=1){const f=l[c];if(f!=null)switch(typeof f){case"function":{const d=r[c];typeof d=="function"?d():f(null);break}case"object":{f.current=null;break}}}}}}}function jt(o){const l=Zt(HT,o).current;return l.next=o,be(l.effect),l}function HT(o){const l={current:o,next:o,effect:()=>{l.current=l.next}};return l}const bd={...Lx},yf=bd.useInsertionEffect,jT=yf&&yf!==bd.useLayoutEffect?yf:o=>o();function Oe(o){const l=Zt(kT).current;return l.next=o,jT(l.effect),l.trampoline}function kT(){const o={next:void 0,callback:UT,trampoline:(...l)=>o.callback?.(...l),effect:()=>{o.callback=o.next}};return o}function UT(){}const os=null;class LT{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=l=>{this.isScheduled=!1;const a=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let c=0;c<a.length;c+=1)a[c]?.(l)};request(l){const a=this.nextId;return this.nextId+=1,this.callbacks.push(l),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),a}cancel(l){const a=l-this.startId;a<0||a>=this.callbacks.length||this.callbacks[a]!==null&&(this.callbacks[a]=null,this.callbacksCount-=1)}}let ls=new LT;class Zn{static create(){return new Zn}static request(l){return ls.request(l)}static cancel(l){return ls.cancel(l)}currentId=os;request(l){this.cancel(),this.currentId=ls.request(()=>{this.currentId=os,l()})}cancel=()=>{this.currentId!==os&&(ls.cancel(this.currentId),this.currentId=os)};disposeEffect=()=>this.cancel}function ka(){const o=Zt(Zn.create).current;return zs(o.disposeEffect),o}function Xe(o){return o?.ownerDocument||document}const BT={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},Cv={...BT,position:"fixed",top:0,left:0},Hl=v.forwardRef(function(l,a){const[r,c]=v.useState();be(()=>{nT&&ul&&c("button")},[]);const f={tabIndex:0,role:r};return z.jsx("span",{...l,ref:a,style:Cv,"aria-hidden":r?void 0:!0,...f,"data-base-ui-focus-guard":""})}),zi=Math.min,So=Math.max,xs=Math.round,is=Math.floor,xo=o=>({x:o,y:o}),YT={left:"right",right:"left",bottom:"top",top:"bottom"};function Ov(o,l,a){return So(o,zi(l,a))}function al(o,l){return typeof o=="function"?o(l):o}function _n(o){return o.split("-")[0]}function Co(o){return o.split("-")[1]}function Sd(o){return o==="x"?"y":"x"}function xd(o){return o==="y"?"height":"width"}function zn(o){const l=o[0];return l==="t"||l==="b"?"y":"x"}function Td(o){return Sd(zn(o))}function IT(o,l,a){a===void 0&&(a=!1);const r=Co(o),c=Td(o),f=xd(c);let d=c==="x"?r===(a?"end":"start")?"right":"left":r==="start"?"bottom":"top";return l.reference[f]>l.floating[f]&&(d=Ts(d)),[d,Ts(d)]}function qT(o){const l=Ts(o);return[Gf(o),l,Gf(l)]}function Gf(o){return o.includes("start")?o.replace("start","end"):o.replace("end","start")}const uy=["left","right"],cy=["right","left"],PT=["top","bottom"],VT=["bottom","top"];function GT(o,l,a){switch(o){case"top":case"bottom":return a?l?cy:uy:l?uy:cy;case"left":case"right":return l?PT:VT;default:return[]}}function XT(o,l,a,r){const c=Co(o);let f=GT(_n(o),a==="start",r);return c&&(f=f.map(d=>d+"-"+c),l&&(f=f.concat(f.map(Gf)))),f}function Ts(o){const l=_n(o);return YT[l]+o.slice(l.length)}function KT(o){var l,a,r,c;return{top:(l=o.top)!=null?l:0,right:(a=o.right)!=null?a:0,bottom:(r=o.bottom)!=null?r:0,left:(c=o.left)!=null?c:0}}function wv(o){return typeof o!="number"?KT(o):{top:o,right:o,bottom:o,left:o}}function Es(o){const{x:l,y:a,width:r,height:c}=o;return{width:r,height:c,top:a,left:l,right:l+r,bottom:a+c,x:l,y:a}}function za(o,l){return l<0||l>=o.length}function gs(o,l){return vo(o.current,{disabledIndices:l})}function Xf(o,l){return vo(o.current,{decrement:!0,startingIndex:o.current.length,disabledIndices:l})}function vo(o,{startingIndex:l=-1,decrement:a=!1,disabledIndices:r,amount:c=1}={}){let f=l;do f+=a?-c:c;while(f>=0&&f<=o.length-1&&wi(o,f,r));return f}function wi(o,l,a){if(typeof a=="function"?a(l):a?.includes(l)??!1)return!0;const c=o[l];return c?!Vs(c)||c.matches(":disabled")?!0:!a&&(c.hasAttribute("disabled")||c.getAttribute("aria-disabled")==="true"):!1}function QT(o){return o.visibility==="hidden"||o.visibility==="collapse"}function Vs(o,l=o?vn(o):null){return!o||!o.isConnected||!l||QT(l)?!1:typeof o.checkVisibility=="function"?o.checkVisibility():l.display!=="none"&&l.display!=="contents"}const FT='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function ZT(o){const l=o.assignedSlot;if(l)return l;if(o.parentElement)return o.parentElement;const a=o.getRootNode();return Di(a)?a.host:null}function Kf(o){for(const l of Array.from(o.children))if(Kt(l)==="summary")return l;return null}function JT(o,l){const a=Kf(l);return!!a&&(o===a||De(a,o))}function Av(o){const l=o?Kt(o):"";return o!=null&&o.matches(FT)&&(l!=="summary"||o.parentElement!=null&&Kt(o.parentElement)==="details"&&Kf(o.parentElement)===o)&&(l!=="details"||Kf(o)==null)&&(l!=="input"||o.type!=="hidden")}function Mv(o){if(!Av(o)||!o.isConnected||o.matches(":disabled"))return!1;for(let l=o;l;l=ZT(l)){const a=l!==o,r=Kt(l)==="slot";if(l.hasAttribute("inert")||a&&Kt(l)==="details"&&!l.open&&!JT(o,l)||l.hasAttribute("hidden")||!r&&!WT(l,a))return!1}return!0}function WT(o,l){const a=vn(o);return l?a.display!=="none":Vs(o,a)}function Dv(o){const l=o.tabIndex;if(l<0){const a=Kt(o);if(a==="details"||a==="audio"||a==="video"||dt(o)&&o.isContentEditable)return 0}return l}function vf(o){if(Kt(o)!=="input")return null;const l=o;return l.type==="radio"&&l.name!==""?l:null}function $T(o,l){const a=vf(o);if(!a)return!0;const r=l.find(c=>{const f=vf(c);return f?.name===a.name&&f.form===a.form&&f.checked});return r?r===a:l.find(c=>{const f=vf(c);return f?.name===a.name&&f.form===a.form})===a}function Nv(o){if(dt(o)&&Kt(o)==="slot"){const l=o.assignedElements({flatten:!0});if(l.length>0)return l}return dt(o)&&o.shadowRoot?Array.from(o.shadowRoot.children):Array.from(o.children)}function zv(o,l){Nv(o).forEach(a=>{Av(a)&&l.push(a),zv(a,l)})}function _v(o,l,a){Nv(o).forEach(r=>{dt(r)&&r.matches(l)&&a.push(r),_v(r,l,a)})}function Ed(o){return Mv(o)&&Dv(o)>=0}function Hv(o){const l=[];return zv(o,l),l.filter(Mv)}function Ya(o){const l=Hv(o);return l.filter(a=>Dv(a)>=0&&$T(a,l))}function jv(o,l){const a=Ya(o),r=a.length;if(r===0)return;const c=Ht(Xe(o)),f=a.indexOf(c),d=f===-1?l===1?0:r-1:f+l;return a[d]}function Rd(o){return jv(Xe(o).body,1)||o}function kv(o){return jv(Xe(o).body,-1)||o}function Uv(o,l){if(!o)return null;const a=Ya(Xe(o).body),r=a.length;if(r===0)return null;const c=a.indexOf(o);if(c===-1)return null;const f=(c+l+r)%r;return a[f]}function eE(o){return Uv(o,1)}function tE(o){return Uv(o,-1)}function Ai(o,l){const a=l||o.currentTarget,r=o.relatedTarget;return!r||!De(a,r)}function nE(o){Ya(o).forEach(a=>{a.dataset.tabindex=a.getAttribute("tabindex")||"",a.setAttribute("tabindex","-1")})}function fy(o){const l=[];_v(o,"[data-tabindex]",l),l.forEach(a=>{const r=a.dataset.tabindex;delete a.dataset.tabindex,r?a.setAttribute("tabindex",r):a.removeAttribute("tabindex")})}function rl(o,l,a=!0){return o.filter(c=>c.parentId===l).flatMap(c=>[...!a||c.context?.open?[c]:[],...rl(o,c.id,a)])}function dy(o,l){let a=[],r=o.find(c=>c.id===l)?.parentId;for(;r;){const c=o.find(f=>f.id===r);r=c?.parentId,c&&(a=a.concat(c))}return a}function Ua(o){return`data-base-ui-${o}`}let as=0;function ms(o,l={}){const{preventScroll:a=!1,sync:r=!1,shouldFocus:c}=l;cancelAnimationFrame(as);function f(){c&&!c()||o?.focus({preventScroll:a})}if(r)return f(),ad;const d=requestAnimationFrame(f);return as=d,()=>{as===d&&(cancelAnimationFrame(d),as=0)}}const bf={inert:new WeakMap,"aria-hidden":new WeakMap},py="data-base-ui-inert",Qf={inert:new WeakSet,"aria-hidden":new WeakSet};let Aa=new WeakMap,Sf=0;function oE(o){return Qf[o]}function Lv(o){return o?Di(o)?o.host:Lv(o.parentNode):null}const hy=(o,l)=>l.map(a=>{if(o.contains(a))return a;const r=Lv(a);return o.contains(r)?r:null}).filter(a=>a!=null),gy=o=>{const l=new Set;return o.forEach(a=>{let r=a;for(;r&&!l.has(r);)l.add(r),r=r.parentNode}),l},my=(o,l,a)=>{const r=[],c=f=>{!f||a.has(f)||Array.from(f.children).forEach(d=>{Kt(d)!=="script"&&(l.has(d)?c(d):r.push(d))})};return c(o),r};function lE(o,l,a,r,{mark:c=!0}){let f=null;r?f="inert":a&&(f="aria-hidden");let d=null,m=null;const h=hy(l,o),g=c?my(l,gy(h),new Set(h)):[],y=[],b=[];if(f){const S=bf[f],E=oE(f);m=E,d=S;const T=hy(l,Array.from(l.querySelectorAll("[aria-live]"))),C=h.concat(T);my(l,gy(C),new Set(C)).forEach(w=>{const D=w.getAttribute(f),A=D!==null&&D!=="false",M=(S.get(w)||0)+1;S.set(w,M),y.push(w),M===1&&A&&E.add(w),A||w.setAttribute(f,f==="inert"?"":"true")})}return c&&g.forEach(S=>{const E=(Aa.get(S)||0)+1;Aa.set(S,E),b.push(S),E===1&&S.setAttribute(py,"")}),Sf+=1,()=>{d&&y.forEach(S=>{const T=(d.get(S)||0)-1;d.set(S,T),T||(!m?.has(S)&&f&&S.removeAttribute(f),m?.delete(S))}),c&&b.forEach(S=>{const E=(Aa.get(S)||0)-1;Aa.set(S,E),E||S.removeAttribute(py)}),Sf-=1,Sf||(bf.inert=new WeakMap,bf["aria-hidden"]=new WeakMap,Qf.inert=new WeakSet,Qf["aria-hidden"]=new WeakSet,Aa=new WeakMap)}}function yy(o,l={}){const{ariaHidden:a=!1,inert:r=!1,mark:c=!0}=l,f=Xe(o[0]).body;return lE(o,f,a,r,{mark:c})}var qn=cv();let vy=0;function iE(o,l="mui"){const[a,r]=v.useState(o),c=o||a;return v.useEffect(()=>{a==null&&(vy+=1,r(`${l}-${vy}`))},[a,l]),c}const by=bd.useId;function jl(o,l){if(by!==void 0){const a=by();return o??(l?`${l}-${a}`:a)}return iE(o,l)}const aE=parseInt(v.version,10);function Cd(o){return aE>=o}function Sy(o){if(!v.isValidElement(o))return null;const l=o,a=l.props;return(Cd(19)?a?.ref:l.ref)??null}function Ff(o,l){if(o&&!l)return o;if(!o&&l)return l;if(o||l)return{...o,...l}}function rE(o,l){const a={};for(const r in o){const c=o[r];if(l?.hasOwnProperty(r)){const f=l[r](c);f!=null&&Object.assign(a,f);continue}c===!0?a[`data-${r.toLowerCase()}`]="":c&&(a[`data-${r.toLowerCase()}`]=c.toString())}return a}function sE(o,l){return typeof o=="function"?o(l):o}function uE(o,l){return typeof o=="function"?o(l):o}const Od={};function To(o,l,a,r,c){if(!a&&!r&&!c&&!o)return Rs(l);let f=Rs(o);return l&&(f=Na(f,l)),a&&(f=Na(f,a)),r&&(f=Na(f,r)),c&&(f=Na(f,c)),f}function cE(o){if(o.length===0)return Od;if(o.length===1)return Rs(o[0]);let l=Rs(o[0]);for(let a=1;a<o.length;a+=1)l=Na(l,o[a]);return l}function Rs(o){return wd(o)?{...Yv(o,Od)}:fE(o)}function Na(o,l){return wd(l)?Yv(l,o):dE(o,l)}function fE(o){const l={...o};for(const a in l){const r=l[a];Bv(a,r)&&(l[a]=Iv(r))}return l}function dE(o,l){if(!l)return o;for(const a in l){const r=l[a];switch(a){case"style":{o[a]=Ff(o.style,r);break}case"className":{o[a]=qv(o.className,r);break}default:Bv(a,r)?o[a]=pE(o[a],r):o[a]=r}}return o}function Bv(o,l){const a=o.charCodeAt(0),r=o.charCodeAt(1),c=o.charCodeAt(2);return a===111&&r===110&&c>=65&&c<=90&&(typeof l=="function"||typeof l>"u")}function wd(o){return typeof o=="function"}function Yv(o,l){return wd(o)?o(l):o??Od}function pE(o,l){return l?o?(...a)=>{const r=a[0];if(Pv(r)){const f=r;Cs(f);const d=l(...a);return f.baseUIHandlerPrevented||o?.(...a),d}const c=l(...a);return o?.(...a),c}:Iv(l):o}function Iv(o){return o&&((...l)=>{const a=l[0];return Pv(a)&&Cs(a),o(...l)})}function Cs(o){return o.preventBaseUIHandler=()=>{o.baseUIHandlerPrevented=!0},o}function qv(o,l){return l?o?l+" "+o:l:o}function Pv(o){return o!=null&&typeof o=="object"&&"nativeEvent"in o}function St(o,l,a={}){let r=l.render;a.enabled!==!1&&(r=yE(r));const c=hE(l,a,r);if(a.enabled===!1)return null;const f=a.state??Ct;return vE(o,r,c,f)}function hE(o,l,a){const{className:r,style:c}=o,{state:f=Ct,ref:d,props:m,stateAttributesMapping:h,enabled:g=!0}=l,y=g?sE(r,f):void 0,b=g?uE(c,f):void 0,S=g?rE(f,h):Ct,E=g&&m?gE(m):void 0,T=g?Ff(S,E)??{}:Ct;return typeof document<"u"&&(g?Array.isArray(d)?T.ref=NT([T.ref,Sy(a),...d]):T.ref=_l(T.ref,Sy(a),d):_l(null,null)),g?(y!==void 0&&(T.className=qv(T.className,y)),b!==void 0&&(T.style=Ff(T.style,b)),T):Ct}function gE(o){return Array.isArray(o)?cE(o):To(void 0,o)}const mE=Symbol.for("react.lazy");function yE(o){if(o?.$$typeof!==mE)return o;const l=v.Children.toArray(o)[0];return v.isValidElement(l)?l:o}function vE(o,l,a,r){if(l){if(typeof l=="function")return l(a,r);const c=To(a,l.props);return c.ref=a.ref,v.cloneElement(l,c)}if(o&&typeof o=="string")return bE(o,a);throw new Error(Qt(8))}function bE(o,l){return o==="button"?v.createElement("button",{type:"button",...l,key:l.key}):o==="img"?v.createElement("img",{alt:"",...l,key:l.key}):v.createElement(o,l)}const SE=500,xE=500,TE={style:{transition:"none"}},EE="data-base-ui-click-trigger",RE="data-base-ui-swipe-ignore",CE="data-swipe-ignore",OE=`[${RE}]`,wE=`[${CE}]`,AE={fallbackAxisSide:"none"},Vv={fallbackAxisSide:"end"},ME={clipPath:"inset(50%)",position:"fixed",top:0,left:0},Gv=v.createContext(null),Xv=()=>v.useContext(Gv),DE=Ua("portal");function Kv(o={}){const{ref:l,container:a,componentProps:r=Ct,elementProps:c}=o,f=jl(),m=Xv()?.portalNode,[h,g]=v.useState(null),[y,b]=v.useState(null),S=Oe(O=>{O!==null&&b(O)}),E=v.useRef(null);be(()=>{if(a===null){E.current&&(E.current=null,b(null),g(null));return}const O=(a&&(fd(a)?a:a.current))??m??document.body;if(O==null){E.current&&(E.current=null,b(null),g(null));return}E.current!==O&&(E.current=O,b(null),g(O))},[a,m]);const T=St("div",r,{ref:[l,S],props:[{id:f,[DE]:""},c]}),C=h&&T?qn.createPortal(T,h):null;return{node:y,nodeId:v.isValidElement(T)?T.props.id:void 0,subtree:C}}const Qv=v.forwardRef(function(l,a){const{render:r,className:c,style:f,children:d,container:m,portalOwnerRole:h,...g}=l,{node:y,nodeId:b,subtree:S}=Kv({container:m,ref:a,componentProps:l,elementProps:g}),E=v.useRef(null),T=v.useRef(null),C=v.useRef(null),O=v.useRef(null),[w,D]=v.useState(null),A=v.useRef(!1),M=w?.modal,H=w?.open,U=!!w&&!w.modal&&w.open&&!!y;v.useEffect(()=>{if(!y||M)return;function k(W){y&&W.relatedTarget&&Ai(W)&&(W.type==="focusin"?A.current&&(fy(y),A.current=!1):(nE(y),A.current=!0))}return In(Ye(y,"focusin",k,!0),Ye(y,"focusout",k,!0))},[y,M]),be(()=>{!y||H!==!0||!A.current||(fy(y),A.current=!1)},[H,y]);const j=v.useMemo(()=>({beforeOutsideRef:E,afterOutsideRef:T,beforeInsideRef:C,afterInsideRef:O,portalNode:y,setFocusManagerState:D}),[y]);return z.jsxs(v.Fragment,{children:[S,z.jsxs(Gv.Provider,{value:j,children:[U&&y&&z.jsx(Hl,{"data-type":"outside",ref:E,onFocus:k=>{if(Ai(k,y))C.current?.focus();else{const W=w?w.domReference:null;kv(W)?.focus()}}}),U&&y&&z.jsx("span",{role:h,"aria-owns":b,style:ME}),y&&qn.createPortal(d,y),U&&y&&z.jsx(Hl,{"data-type":"outside",ref:T,onFocus:k=>{if(Ai(k,y))O.current?.focus();else{const W=w?w.domReference:null;Rd(W)?.focus(),w?.closeOnFocusOut&&w?.onOpenChange(!1,Ke(Ni,k.nativeEvent))}}})]})]})});function Fv(){const o=new Map;return{emit(l,a){o.get(l)?.forEach(r=>r(a))},on(l,a){o.has(l)||o.set(l,new Set),o.get(l).add(a)},off(l,a){o.get(l)?.delete(a)}}}class Ad{nodesRef={current:[]};events=Fv();addNode(l){this.nodesRef.current.push(l)}removeNode(l){const a=this.nodesRef.current.findIndex(r=>r===l);a!==-1&&this.nodesRef.current.splice(a,1)}}const Zv=v.createContext(null),Jv=v.createContext(null),Ll=()=>v.useContext(Zv)?.id||null,cl=o=>{const l=v.useContext(Jv);return o??l};function Wv(o){const l=jl(),a=cl(o),r=Ll();return be(()=>{if(!l)return;const c={id:l,parentId:r};return a?.addNode(c),()=>{a?.removeNode(c)}},[a,l,r]),l}function NE(o){const{children:l,id:a}=o,r=Ll();return z.jsx(Zv.Provider,{value:v.useMemo(()=>({id:a,parentId:r}),[a,r]),children:l})}function zE(o){const{children:l,externalTree:a}=o,r=Zt(()=>a??new Ad).current;return z.jsx(Jv.Provider,{value:r,children:l})}function yo(o){return o==null?o:"current"in o?o.current:o}function _E(o,l){const a=yt(bt(o));return o instanceof a.KeyboardEvent?"keyboard":o instanceof a.FocusEvent?l||"keyboard":"pointerType"in o?o.pointerType||"keyboard":"touches"in o?"touch":o instanceof a.MouseEvent?l||(o.detail===0?"keyboard":"mouse"):""}const xy=20;let ol=[];function Md(){ol=ol.filter(o=>o.deref()?.isConnected)}function Ty(o){Md(),o&&Kt(o)!=="body"&&(ol.push(new WeakRef(o)),ol.length>xy&&(ol=ol.slice(-xy)))}function Ey(){return Md(),ol[ol.length-1]?.deref()}function HE(o){return o?Ed(o)?o:Ya(o)[0]||o:null}function Ry(o){if(o.hasAttribute("tabindex")&&!o.hasAttribute("data-tabindex")||!o.getAttribute("role")?.includes("dialog"))return;const a=Hv(o).filter(c=>{const f=c.getAttribute("data-tabindex")||"";return Ed(c)||c.hasAttribute("data-tabindex")&&!f.startsWith("-")}),r=o.getAttribute("tabindex");a.length===0?r!=="0"&&(o.setAttribute("tabindex","0"),o.setAttribute("data-tabindex","0")):(r!=="-1"||o.hasAttribute("data-tabindex")&&o.getAttribute("data-tabindex")!=="-1")&&(o.setAttribute("tabindex","-1"),o.setAttribute("data-tabindex","-1"))}function $v(o){const{context:l,children:a,disabled:r=!1,initialFocus:c=!0,returnFocus:f=!0,restoreFocus:d=!1,modal:m=!0,closeOnFocusOut:h=!0,openInteractionType:g="",nextFocusableElement:y,previousFocusableElement:b,beforeContentFocusGuardRef:S,externalTree:E,getInsideElements:T}=o,C="rootStore"in l?l.rootStore:l,O=C.useState("open"),w=C.useState("domReferenceElement"),D=C.useState("floatingElement"),{events:A,dataRef:M}=C.context,H=Oe(()=>M.current.floatingContext?.nodeId),U=c===!1,j=qf(w)&&U,k=jt(c),W=jt(f),$=jt(g),F=jt(O),Y=cl(E),ee=Xv(),le=v.useRef(!1),K=v.useRef(!1),N=v.useRef(!1),P=v.useRef(null),I=v.useRef(""),Q=v.useRef(""),ne=v.useRef(null),R=v.useRef(null),B=_l(ne,S,ee?.beforeInsideRef),J=_l(R,ee?.afterInsideRef),V=Jt(),oe=Jt(),ie=ka(),he=ee!=null,ue=Pf(D),pe=Oe((ve=ue)=>ve?Ya(ve):[]),Re=Oe(()=>T?.().filter(ve=>ve!=null)??[]);v.useEffect(()=>{if(r||!m)return;function ve(_e){_e.key==="Tab"&&De(ue,Ht(Xe(ue)))&&pe().length===0&&!j&&Fn(_e)}const ge=Xe(ue);return Ye(ge,"keydown",ve)},[r,ue,m,j,pe]),v.useEffect(()=>{if(r||!O)return;const ve=Xe(ue);function ge(){N.current=!1}function _e(Pe){const xe=bt(Pe),Ue=Re(),Te=De(D,xe)||De(w,xe)||De(ee?.portalNode,xe)||Ue.some(Ee=>Ee===xe||De(Ee,xe));N.current=!Te,Q.current=Pe.pointerType||"keyboard",xe?.closest(`[${EE}]`)&&(K.current=!0,oe.start(0,()=>{K.current=!1}))}function ke(){Q.current="keyboard"}return In(Ye(ve,"pointerdown",_e,!0),Ye(ve,"pointerup",ge,!0),Ye(ve,"pointercancel",ge,!0),Ye(ve,"keydown",ke,!0),ge)},[r,D,w,ue,O,ee,oe,Re]),v.useEffect(()=>{if(r||!h)return;const ve=Xe(ue);function ge(){K.current=!0,oe.start(0,()=>{K.current=!1})}function _e(Ue){const Te=bt(Ue);Ed(Te)&&(P.current=Te)}function ke(Ue){const Te=Ue.relatedTarget,Ee=Ue.currentTarget,we=bt(Ue);m&&Te==null&&we!=null&&De(D,we)&&Ty(we),queueMicrotask(()=>{const Qe=H(),Ae=C.context.triggerElements,fe=Re(),me=Te?.hasAttribute(Ua("focus-guard"))&&[ne.current,R.current,ee?.beforeInsideRef.current,ee?.afterInsideRef.current,ee?.beforeOutsideRef.current,ee?.afterOutsideRef.current,yo(b),yo(y)].includes(Te),de=!(De(w,Te)||De(D,Te)||De(Te,D)||De(ee?.portalNode,Te)||fe.some(ae=>ae===Te||De(ae,Te))||Ae.hasMatchingElement(ae=>De(ae,Te))||me||Y&&(rl(Y.nodesRef.current,Qe).find(ae=>De(ae.context?.elements.floating,Te)||De(ae.context?.elements.domReference,Te))||dy(Y.nodesRef.current,Qe).find(ae=>[ae.context?.elements.floating,Pf(ae.context?.elements.floating)].includes(Te)||ae.context?.elements.domReference===Te)));if(Ee===w&&ue&&Ry(ue),d&&Ee!==w&&!Vs(we)&&Ht(ve)===ve.body){if(dt(ue)&&(ue.focus(),d==="popup")){ie.request(()=>{ue.focus()});return}const ae=pe(),ye=P.current,Le=(ye&&ae.includes(ye)?ye:null)||ae[ae.length-1]||ue;dt(Le)&&Le.focus()}if(M.current.insideReactTree){M.current.insideReactTree=!1;return}(j||!m)&&Te&&de&&!K.current&&(j||Te!==Ey())&&(le.current=!0,C.setOpen(!1,Ke(Ni,Ue)))})}function Pe(){N.current||(M.current.insideReactTree=!0,V.start(0,()=>{M.current.insideReactTree=!1}))}const xe=dt(w)?w:null;if(!(!D&&!xe))return In(xe&&Ye(xe,"focusout",ke),xe&&Ye(xe,"pointerdown",ge),D&&Ye(D,"focusin",_e),D&&Ye(D,"focusout",ke),D&&ee&&Ye(D,"focusout",Pe,!0))},[r,w,D,ue,m,Y,ee,C,h,d,pe,j,H,M,V,oe,ie,y,b,Re]),v.useEffect(()=>{if(r||!D||!O)return;const ve=Array.from(ee?.portalNode?.querySelectorAll(`[${Ua("portal")}]`)||[]),_e=(Y?dy(Y.nodesRef.current,H()):[]).find(Ee=>qf(Ee.context?.elements.domReference||null))?.context?.elements.domReference,Pe=[...[D,...ve,ne.current,R.current,ee?.beforeOutsideRef.current,ee?.afterOutsideRef.current,...Re()],_e,yo(b),yo(y),j?w:null].filter(Ee=>Ee!=null),xe=yy(Pe,{ariaHidden:m||j,mark:!1}),Ue=[D,...ve].filter(Ee=>Ee!=null),Te=yy(Ue);return()=>{Te(),xe()}},[O,r,w,D,m,ee,j,Y,H,y,b,Re]),be(()=>{if(!O||r||!dt(ue))return;I.current="",Q.current="";const ve=Xe(ue),ge=Ht(ve);queueMicrotask(()=>{const _e=k.current,ke=typeof _e=="function"?_e($.current||""):_e;if(ke===void 0||ke===!1||De(ue,ge))return;let xe=null;const Ue=()=>(xe==null&&(xe=pe(ue)),xe[0]||ue);let Te;ke===!0||ke===null?Te=Ue():Te=yo(ke),Te=Te||Ue();const Ee=De(ue,Ht(ve));ms(Te,{preventScroll:Te===ue,shouldFocus(){if(!F.current)return!1;if(Ee)return!0;const we=Ht(ve);return!(we!==Te&&De(ue,we))}})})},[r,O,ue,pe,k,$,F]),be(()=>{if(r||!ue)return;const ve=Xe(ue),ge=Ht(ve),_e=$.current==null;Ty(ge);function ke(xe){if(xe.open||(I.current=_E(xe.nativeEvent,Q.current)),xe.reason===Ut&&xe.nativeEvent.type==="mouseleave"&&(le.current=!0),xe.reason===yd)if(xe.nested)le.current=!1;else if(ud(xe.nativeEvent)||cd(xe.nativeEvent))le.current=!1;else{let Ue=!1;Xe(ue).createElement("div").focus({get preventScroll(){return Ue=!0,!1}}),Ue?le.current=!1:le.current=!0}}A.on("openchange",ke);function Pe(xe){const Ue=W.current;let Te=typeof Ue=="function"?Ue(xe):Ue;if(Te===void 0||Te===!1)return null;Te===null&&(Te=!0);const Ee=w?.isConnected?w:null,we=ge?.isConnected&&Kt(ge)!=="body"?ge:null;let Qe=_e?we||Ee:Ee||we;return Qe||(Qe=Ey()||null),typeof Te=="boolean"?Qe:yo(Te)||Qe||null}return()=>{A.off("openchange",ke);const xe=Ht(ve),Ue=Re(),Te=De(D,xe)||Ue.some(Ae=>Ae===xe||De(Ae,xe))||Y&&rl(Y.nodesRef.current,H(),!1).some(Ae=>De(Ae.context?.elements.floating,xe)),Ee=W.current,we=I.current,Qe=Pe(we);queueMicrotask(()=>{const Ae=HE(Qe),fe=typeof Ee!="boolean";if(Ee&&!le.current&&dt(Ae)&&(!(!fe&&Ae!==xe&&xe!==ve.body)||Te)){const me={preventScroll:!0};we==="keyboard"&&(me.focusVisible=!0),Ae.focus(me)}le.current=!1})}},[r,D,ue,W,$,A,Y,w,H,Re]),be(()=>{if(!ul||O||!D)return;const ve=Ht(Xe(D));!dt(ve)||!Is(ve)||De(D,ve)&&ve.blur()},[O,D]),be(()=>{if(!(r||!ee))return ee.setFocusManagerState({modal:m,closeOnFocusOut:h,open:O,onOpenChange:C.setOpen,domReference:w}),()=>{ee.setFocusManagerState(null)}},[r,ee,m,O,C,h,w]),be(()=>{if(!(r||!ue))return Ry(ue),()=>{queueMicrotask(Md)}},[r,ue]);const ze=!r&&(m?!j:!0)&&(he||m);return z.jsxs(v.Fragment,{children:[ze&&z.jsx(Hl,{"data-type":"inside",ref:B,onFocus:ve=>{if(m){const ge=pe();ms(ge[ge.length-1])}else ee?.portalNode&&(le.current=!1,Ai(ve,ee.portalNode)?Rd(w)?.focus():yo(b??ee.beforeOutsideRef)?.focus())}}),a,ze&&z.jsx(Hl,{"data-type":"inside",ref:J,onFocus:ve=>{m?ms(pe()[0]):ee?.portalNode&&(h&&(le.current=!0),Ai(ve,ee.portalNode)?kv(w)?.focus():yo(y??ee.afterOutsideRef)?.focus())}})]})}function jE(o,l={}){const{enabled:a=!0,event:r="click",toggle:c=!0,ignoreMouse:f=!1,stickIfOpen:d=!0,touchOpenDelay:m=0,reason:h=_i}=l,g="rootStore"in o?o.rootStore:o,y=g.context.dataRef,b=v.useRef(void 0),S=ka(),E=Jt(),T=v.useMemo(()=>{function C(w,D,A,M){const H=Ke(h,D,A);w&&M==="touch"&&m>0?E.start(m,()=>{g.setOpen(!0,H)}):g.setOpen(w,H)}function O(w,D,A){const M=y.current.openEvent,H=g.select("domReferenceElement")!==D;return w&&H||!w||!c?!0:M&&d?!A(M.type):!1}return{onPointerDown(w){b.current=ll(w.pointerType,!0)&&cd(w.nativeEvent)?"virtual":w.pointerType},onMouseDown(w){const D=b.current,A=w.nativeEvent,M=g.select("open");if(w.button!==0||r==="click"||ll(D,!0)&&f)return;const H=O(M,w.currentTarget,k=>k==="click"||k==="mousedown"),U=bt(A);if(Is(U)){C(H,A,U,D);return}const j=w.currentTarget;S.request(()=>{C(H,A,j,D)})},onClick(w){if(r==="mousedown-only")return;const D=b.current;if(r==="mousedown"&&D){b.current=void 0;return}if(ll(D,!0)&&f)return;const A=g.select("open"),M=O(A,w.currentTarget,H=>H==="click"||H==="mousedown"||H==="keydown"||H==="keyup");C(M,w.nativeEvent,w.currentTarget,D)},onKeyDown(){b.current=void 0}}},[y,r,f,h,g,d,c,S,E,m]);return v.useMemo(()=>a?{reference:T}:Ct,[a,T])}function kE(o,l){let a=null,r=null,c=!1;return{contextElement:o||void 0,getBoundingClientRect(){const f=o?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},d=l.axis==="x"||l.axis==="both",m=l.axis==="y"||l.axis==="both",h=["mouseenter","mousemove"].includes(l.dataRef.current.openEvent?.type||"")&&l.pointerType!=="touch";let g=f.width,y=f.height,b=f.x,S=f.y;return a==null&&l.x&&d&&(a=f.x-l.x),r==null&&l.y&&m&&(r=f.y-l.y),b-=a||0,S-=r||0,g=0,y=0,!c||h?(g=l.axis==="y"?f.width:0,y=l.axis==="x"?f.height:0,b=d&&l.x!=null?l.x:b,S=m&&l.y!=null?l.y:S):c&&!h&&(y=l.axis==="x"?f.height:y,g=l.axis==="y"?f.width:g),c=!0,{width:g,height:y,x:b,y:S,top:S,right:b+g,bottom:S+y,left:b}}}}function Cy(o){return o!=null&&o.clientX!=null}function UE(o,l={}){const{enabled:a=!0,axis:r="both"}=l,c="rootStore"in o?o.rootStore:o,f=c.useState("open"),d=c.useState("floatingElement"),m=c.useState("domReferenceElement"),h=c.context.dataRef,g=v.useRef(!1),y=v.useRef(null),[b,S]=v.useState(),[E,T]=v.useState([]),C=Oe(M=>{c.set("positionReference",M)}),O=Oe((M,H,U)=>{g.current||h.current.openEvent&&!Cy(h.current.openEvent)||c.set("positionReference",kE(U??m,{x:M,y:H,axis:r,dataRef:h,pointerType:b}))}),w=Oe(M=>{f?y.current||(O(M.clientX,M.clientY,M.currentTarget),T([])):O(M.clientX,M.clientY,M.currentTarget)}),D=ll(b)?d:f;v.useEffect(()=>{if(!a){C(m);return}if(!D)return;function M(){y.current?.(),y.current=null}const H=yt(d);function U(j){const k=bt(j);De(d,k)?M():O(j.clientX,j.clientY)}return!h.current.openEvent||Cy(h.current.openEvent)?y.current=Ye(H,"mousemove",U):C(m),M},[D,a,d,h,m,c,O,C,E]),v.useEffect(()=>()=>{c.set("positionReference",null)},[c]),v.useEffect(()=>{a&&!d&&(g.current=!1)},[a,d]),v.useEffect(()=>{!a&&f&&(g.current=!0)},[a,f]);const A=v.useMemo(()=>{function M(H){S(H.pointerType)}return{onPointerDown:M,onPointerEnter:M,onMouseMove:w,onMouseEnter:w}},[w]);return v.useMemo(()=>a?{reference:A,trigger:A}:{},[a,A])}function LE(){return!1}function BE(o){return{escapeKey:typeof o=="boolean"?o:o?.escapeKey??!1,outsidePress:typeof o=="boolean"?o:o?.outsidePress??!0}}function Dd(o,l={}){const{enabled:a=!0,escapeKey:r=!0,outsidePress:c=!0,outsidePressEvent:f="sloppy",referencePress:d=LE,bubbles:m,externalTree:h}=l,g="rootStore"in o?o.rootStore:o,y=g.useState("open"),b=g.useState("floatingElement"),{dataRef:S,events:E}=g.context,T=cl(h),C=Oe(typeof c=="function"?c:()=>!1),O=typeof c=="function"?C:c,w=O!==!1,D=Oe(()=>f),{escapeKey:A,outsidePress:M}=BE(m),H=v.useRef(!1),U=v.useRef(!1),j=v.useRef(!1),k=v.useRef(!1),W=v.useRef(!1),$=v.useRef(""),F=v.useRef(null),Y=Jt(),ee=Jt(),le=Oe(()=>{ee.clear(),S.current.insideReactTree=!1}),K=Oe(V=>{const oe=S.current.floatingContext?.nodeId;return(T?rl(T.nodesRef.current,oe):[]).some(he=>he.context?.open&&!he.context.dataRef.current[V])}),N=Oe(V=>mf(V,g.select("floatingElement"))||mf(V,g.select("domReferenceElement"))),P=Oe(V=>{d()&&g.setOpen(!1,Ke(_i,V.nativeEvent))}),I=Oe(V=>{if(!y||!a||!r||V.key!=="Escape"||W.current||!A&&K("__escapeKeyBubbles"))return;const oe=oT(V)?V.nativeEvent:V,ie=Ke(Ps,oe);g.setOpen(!1,ie),ie.isCanceled||V.preventDefault(),!A&&!ie.isPropagationAllowed&&V.stopPropagation()}),Q=Oe(()=>{S.current.insideReactTree=!0,ee.start(0,le)}),ne=Oe(V=>{if(!y||!a||V.button!==0)return;const oe=bt(V.nativeEvent);De(g.select("floatingElement"),oe)&&(H.current||(H.current=!0,U.current=!1))}),R=Oe(V=>{!y||!a||(V.defaultPrevented||V.nativeEvent.defaultPrevented)&&H.current&&(U.current=!0)});v.useEffect(()=>{function V(oe){oe.open||(k.current=!1)}return E.on("openchange",V),()=>{E.off("openchange",V)}},[E]),v.useEffect(()=>{if(!y||!a)return y||(k.current=!1),le;S.current.__escapeKeyBubbles=A,S.current.__outsidePressBubbles=M;const V=new yn,oe=new yn,ie=Xe(b);function he(){V.clear(),W.current=!0}function ue(){V.start(ul?5:0,()=>{W.current=!1})}function pe(){j.current=!0,oe.start(0,()=>{j.current=!1})}function Re(){H.current=!1,U.current=!1}function ze(){const de=$.current,ae=de==="pen"||!de?"mouse":de,ye=D(),Le=typeof ye=="function"?ye():ye;return typeof Le=="string"?Le:Le[ae]}function ve(de){const ae=ze();return ae==="intentional"&&de.type!=="click"||ae==="sloppy"&&de.type==="click"}function ge(de){const ae=S.current.floatingContext?.nodeId,ye=T&&rl(T.nodesRef.current,ae).some(Le=>mf(de,Le.context?.elements.floating));return N(de)||ye}function _e(de){if(ve(de)){de.type!=="click"&&!N(de)&&(oe.clear(),j.current=!1),le();return}if(S.current.insideReactTree){le();return}const ae=bt(de),ye=`[${Ua("inert")}]`,Le=Je(ae)?ae.getRootNode():null,Lt=Array.from((Di(Le)?Le:Xe(g.select("floatingElement"))).querySelectorAll(ye)),$t=g.context.triggerElements;if(ae&&($t.hasElement(ae)||$t.hasMatchingElement(Se=>De(Se,ae))))return;let Tt=Je(ae)?ae:null;for(;Tt&&!bo(Tt);){const Se=Ro(Tt);if(bo(Se)||!Je(Se))break;Tt=Se}if(!(Lt.length&&Je(ae)&&!TT(ae)&&!De(ae,g.select("floatingElement"))&&Lt.every(Se=>!De(Tt,Se)))){if(dt(ae)&&!("touches"in de)){const Se=bo(ae),Ie=vn(ae),tt=/auto|scroll/,pt=Se||tt.test(Ie.overflowX),bn=Se||tt.test(Ie.overflowY),Hn=pt&&ae.clientWidth>0&&ae.scrollWidth>ae.clientWidth,Sn=bn&&ae.clientHeight>0&&ae.scrollHeight>ae.clientHeight,At=Ie.direction==="rtl",jn=Sn&&(At?de.offsetX<=ae.offsetWidth-ae.clientWidth:de.offsetX>ae.clientWidth),Ge=Hn&&de.offsetY>ae.clientHeight;if(jn||Ge)return}if(!ge(de)){if(ze()==="intentional"){if(de.detail!==0&&!ud(de)&&!k.current)return;if(j.current){oe.clear(),j.current=!1;return}}typeof O=="function"&&!O(de)||K("__outsidePressBubbles")||(g.setOpen(!1,Ke(yd,de)),le())}}}function ke(de){ze()!=="sloppy"||de.pointerType==="touch"||!g.select("open")||!a||N(de)||_e(de)}function Pe(de){if(ze()!=="sloppy"||!g.select("open")||!a||N(de))return;const ae=de.touches[0];ae&&(F.current={startTime:Date.now(),startX:ae.clientX,startY:ae.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},Y.start(1e3,()=>{F.current&&(F.current.dismissOnTouchEnd=!1,F.current.dismissOnMouseDown=!1)}))}function xe(de,ae){const ye=bt(de);if(!ye)return;const Le=Ye(ye,de.type,()=>{ae(de),Le()})}function Ue(de){$.current="touch",xe(de,Pe)}function Te(de){Y.clear(),de.type==="pointerdown"&&(de.button===0&&(k.current=!0),$.current=de.pointerType),!(de.type==="mousedown"&&F.current&&!F.current.dismissOnMouseDown)&&xe(de,ae=>{ae.type==="pointerdown"?ke(ae):_e(ae)})}function Ee(de){if(de.type==="pointercancel"&&(k.current=!1),!H.current)return;const ae=U.current;if(Re(),ze()==="intentional"){if(de.type==="pointercancel"){ae&&pe();return}if(!ge(de)){if(ae){pe();return}typeof O=="function"&&!O(de)||(oe.clear(),j.current=!0,le())}}}function we(de){if(ze()!=="sloppy"||!F.current||N(de))return;const ae=de.touches[0];if(!ae)return;const ye=Math.abs(ae.clientX-F.current.startX),Le=Math.abs(ae.clientY-F.current.startY),Lt=Math.sqrt(ye*ye+Le*Le);Lt>5&&(F.current.dismissOnTouchEnd=!0),Lt>10&&(_e(de),Y.clear(),F.current=null)}function Qe(de){xe(de,we)}function Ae(de){ze()!=="sloppy"||!F.current||N(de)||(F.current.dismissOnTouchEnd&&_e(de),Y.clear(),F.current=null)}function fe(de){xe(de,Ae)}const me=In(r&&In(Ye(ie,"keydown",I),Ye(ie,"compositionstart",he),Ye(ie,"compositionend",ue)),w&&In(Ye(ie,"click",Te,!0),Ye(ie,"pointerdown",Te,!0),Ye(ie,"pointerup",Ee,!0),Ye(ie,"pointercancel",Ee,!0),Ye(ie,"mousedown",Te,!0),Ye(ie,"mouseup",Ee,!0),Ye(ie,"touchstart",Ue,{capture:!0,passive:!0}),Ye(ie,"touchmove",Qe,{capture:!0,passive:!0}),Ye(ie,"touchend",fe,{capture:!0,passive:!0})));return()=>{me(),V.clear(),oe.clear(),Re(),j.current=!1,le()}},[S,b,r,w,O,y,a,A,M,I,le,D,K,N,T,g,Y]);const B=v.useMemo(()=>({onKeyDown:I,onPointerDown:P,onClick:P}),[I,P]),J=v.useMemo(()=>({onKeyDown:I,onPointerDown:R,onMouseDown:R,onClickCapture:Q,onMouseDownCapture(V){Q(),ne(V)},onPointerDownCapture(V){Q(),ne(V)},onMouseUpCapture:Q,onTouchEndCapture:Q,onTouchMoveCapture:Q}),[I,Q,ne,R]);return v.useMemo(()=>a?{reference:B,floating:J,trigger:B}:{},[a,B,J])}function Oy(o,l,a){let{reference:r,floating:c}=o;const f=zn(l),d=Td(l),m=xd(d),h=_n(l),g=f==="y",y=r.x+r.width/2-c.width/2,b=r.y+r.height/2-c.height/2,S=r[m]/2-c[m]/2;let E;switch(h){case"top":E={x:y,y:r.y-c.height};break;case"bottom":E={x:y,y:r.y+r.height};break;case"right":E={x:r.x+r.width,y:b};break;case"left":E={x:r.x-c.width,y:b};break;default:E={x:r.x,y:r.y}}const T=Co(l);return T&&(E[d]+=S*(T==="end"?1:-1)*(a&&g?-1:1)),E}async function YE(o,l){var a;l===void 0&&(l={});const{x:r,y:c,platform:f,rects:d,elements:m,strategy:h}=o,{boundary:g="clippingAncestors",rootBoundary:y="viewport",elementContext:b="floating",altBoundary:S=!1,padding:E=0}=al(l,o),T=wv(E),O=m[S?b==="floating"?"reference":"floating":b],w=Es(await f.getClippingRect({element:(a=await(f.isElement==null?void 0:f.isElement(O)))==null||a?O:O.contextElement||await(f.getDocumentElement==null?void 0:f.getDocumentElement(m.floating)),boundary:g,rootBoundary:y,strategy:h})),D=b==="floating"?{x:r,y:c,width:d.floating.width,height:d.floating.height}:d.reference,A=await(f.getOffsetParent==null?void 0:f.getOffsetParent(m.floating)),M=await(f.isElement==null?void 0:f.isElement(A))&&await(f.getScale==null?void 0:f.getScale(A))||{x:1,y:1},H=Es(f.convertOffsetParentRelativeRectToViewportRelativeRect?await f.convertOffsetParentRelativeRectToViewportRelativeRect({elements:m,rect:D,offsetParent:A,strategy:h}):D);return{top:(w.top-H.top+T.top)/M.y,bottom:(H.bottom-w.bottom+T.bottom)/M.y,left:(w.left-H.left+T.left)/M.x,right:(H.right-w.right+T.right)/M.x}}const IE=50,qE=async(o,l,a)=>{const{placement:r="bottom",strategy:c="absolute",middleware:f=[],platform:d}=a,m=d.detectOverflow?d:{...d,detectOverflow:YE},h=await(d.isRTL==null?void 0:d.isRTL(l));let g=await d.getElementRects({reference:o,floating:l,strategy:c}),{x:y,y:b}=Oy(g,r,h),S=r,E=0;const T={};for(let C=0;C<f.length;C++){const O=f[C];if(!O)continue;const{name:w,fn:D}=O,{x:A,y:M,data:H,reset:U}=await D({x:y,y:b,initialPlacement:r,placement:S,strategy:c,middlewareData:T,rects:g,platform:m,elements:{reference:o,floating:l}});y=A??y,b=M??b,T[w]={...T[w],...H},U&&E<IE&&(E++,typeof U=="object"&&(U.placement&&(S=U.placement),U.rects&&(g=U.rects===!0?await d.getElementRects({reference:o,floating:l,strategy:c}):U.rects),{x:y,y:b}=Oy(g,S,h)),C=-1)}return{x:y,y:b,placement:S,strategy:c,middlewareData:T}},PE=function(o){return o===void 0&&(o={}),{name:"flip",options:o,async fn(l){var a,r;const{placement:c,middlewareData:f,rects:d,initialPlacement:m,platform:h,elements:g}=l,{mainAxis:y=!0,crossAxis:b=!0,fallbackPlacements:S,fallbackStrategy:E="bestFit",fallbackAxisSideDirection:T="none",flipAlignment:C=!0,...O}=al(o,l);if((a=f.arrow)!=null&&a.alignmentOffset)return{};const w=_n(c),D=zn(m),A=_n(m)===m,M=await(h.isRTL==null?void 0:h.isRTL(g.floating)),H=S||(A||!C?[Ts(m)]:qT(m)),U=T!=="none";!S&&U&&H.push(...XT(m,C,T,M));const j=[m,...H],k=await h.detectOverflow(l,O),W=[];let $=((r=f.flip)==null?void 0:r.overflows)||[];if(y&&W.push(k[w]),b){const le=IT(c,d,M);W.push(k[le[0]],k[le[1]])}if($=[...$,{placement:c,overflows:W}],!W.every(le=>le<=0)){var F,Y;const le=(((F=f.flip)==null?void 0:F.index)||0)+1,K=j[le];if(K&&(!(b==="alignment"?D!==zn(K):!1)||$.every(I=>zn(I.placement)===D?I.overflows[0]>0:!0)))return{data:{index:le,overflows:$},reset:{placement:K}};let N=(Y=$.filter(P=>P.overflows[0]<=0).sort((P,I)=>P.overflows[1]-I.overflows[1])[0])==null?void 0:Y.placement;if(!N)switch(E){case"bestFit":{var ee;const P=(ee=$.filter(I=>{if(U){const Q=zn(I.placement);return Q===D||Q==="y"}return!0}).map(I=>[I.placement,I.overflows.filter(Q=>Q>0).reduce((Q,ne)=>Q+ne,0)]).sort((I,Q)=>I[1]-Q[1])[0])==null?void 0:ee[0];P&&(N=P);break}case"initialPlacement":N=m;break}if(c!==N)return{reset:{placement:N}}}return{}}}},eb=new Set(["left","top"]);async function VE(o,l){const{placement:a,platform:r,elements:c}=o,f=await(r.isRTL==null?void 0:r.isRTL(c.floating)),d=_n(a),m=Co(a),h=zn(a)==="y",g=eb.has(d)?-1:1,y=f&&h?-1:1,b=al(l,o);let{mainAxis:S,crossAxis:E,alignmentAxis:T}=typeof b=="number"?{mainAxis:b,crossAxis:0,alignmentAxis:null}:{mainAxis:b.mainAxis||0,crossAxis:b.crossAxis||0,alignmentAxis:b.alignmentAxis};return m&&typeof T=="number"&&(E=m==="end"?T*-1:T),h?{x:E*y,y:S*g}:{x:S*g,y:E*y}}const GE=function(o){return o===void 0&&(o=0),{name:"offset",options:o,async fn(l){var a,r;const{x:c,y:f,placement:d,middlewareData:m}=l,h=await VE(l,o);return d===((a=m.offset)==null?void 0:a.placement)&&(r=m.arrow)!=null&&r.alignmentOffset?{}:{x:c+h.x,y:f+h.y,data:{...h,placement:d}}}}},XE=function(o){return o===void 0&&(o={}),{name:"shift",options:o,async fn(l){const{x:a,y:r,placement:c,platform:f}=l,{mainAxis:d=!0,crossAxis:m=!1,limiter:h={fn:D=>{let{x:A,y:M}=D;return{x:A,y:M}}},...g}=al(o,l),y={x:a,y:r},b=await f.detectOverflow(l,g),S=zn(c),E=Sd(S);let T=y[E],C=y[S];const O=(D,A)=>Ov(A+b[D==="y"?"top":"left"],A,A-b[D==="y"?"bottom":"right"]);d&&(T=O(E,T)),m&&(C=O(S,C));const w=h.fn({...l,[E]:T,[S]:C});return{...w,data:{x:w.x-a,y:w.y-r,enabled:{[E]:d,[S]:m}}}}}},KE=function(o){return o===void 0&&(o={}),{options:o,fn(l){var a,r;const{x:c,y:f,placement:d,rects:m,middlewareData:h}=l,{offset:g=0,mainAxis:y=!0,crossAxis:b=!0}=al(o,l),S={x:c,y:f},E=zn(d),T=Sd(E);let C=S[T],O=S[E];const w=al(g,l),D=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:(a=w.mainAxis)!=null?a:0,crossAxis:(r=w.crossAxis)!=null?r:0};if(y){const H=T==="y"?"height":"width",U=m.reference[T]-m.floating[H]+D.mainAxis,j=m.reference[T]+m.reference[H]-D.mainAxis;C<U?C=U:C>j&&(C=j)}if(b){var A,M;const H=T==="y"?"width":"height",U=eb.has(_n(d)),j=m.reference[E]-m.floating[H]+(U&&((A=h.offset)==null?void 0:A[E])||0)+(U?0:D.crossAxis),k=m.reference[E]+m.reference[H]+(U?0:((M=h.offset)==null?void 0:M[E])||0)-(U?D.crossAxis:0);O<j?O=j:O>k&&(O=k)}return{[T]:C,[E]:O}}}},QE=function(o){return o===void 0&&(o={}),{name:"size",options:o,async fn(l){const{placement:a,rects:r,platform:c,elements:f}=l,{apply:d=()=>{},...m}=al(o,l),h=await c.detectOverflow(l,m),g=_n(a),y=Co(a),b=zn(a)==="y",{width:S,height:E}=r.floating;let T,C;g==="top"||g==="bottom"?(T=g,C=y===(await(c.isRTL==null?void 0:c.isRTL(f.floating))?"start":"end")?"left":"right"):(C=g,T=y==="end"?"top":"bottom");const O=E-h.top-h.bottom,w=S-h.left-h.right,D=zi(E-h[T],O),A=zi(S-h[C],w),M=l.middlewareData.shift,H=!M;let U=D,j=A;M!=null&&M.enabled.x&&(j=w),M!=null&&M.enabled.y&&(U=O),H&&!y&&(b?j=S-2*So(h.left,h.right):U=E-2*So(h.top,h.bottom)),await d({...l,availableWidth:j,availableHeight:U});const k=await c.getDimensions(f.floating);return S!==k.width||E!==k.height?{reset:{rects:!0}}:{}}}};function tb(o){const l=vn(o);let a=parseFloat(l.width)||0,r=parseFloat(l.height)||0;const c=dt(o),f=c?o.offsetWidth:a,d=c?o.offsetHeight:r,m=xs(a)!==f||xs(r)!==d;return m&&(a=f,r=d),{width:a,height:r,$:m}}function Nd(o){return Je(o)?o:o.contextElement}function Mi(o){const l=Nd(o);if(!dt(l))return xo(1);const a=l.getBoundingClientRect(),{width:r,height:c,$:f}=tb(l);let d=(f?xs(a.width):a.width)/r,m=(f?xs(a.height):a.height)/c;return(!d||!Number.isFinite(d))&&(d=1),(!m||!Number.isFinite(m))&&(m=1),{x:d,y:m}}const FE=xo(0);function nb(o){const l=yt(o);return!pd()||!l.visualViewport?FE:{x:l.visualViewport.offsetLeft,y:l.visualViewport.offsetTop}}function ZE(o,l,a){return l===void 0&&(l=!1),!!a&&l&&a===yt(o)}function kl(o,l,a,r){l===void 0&&(l=!1),a===void 0&&(a=!1);const c=o.getBoundingClientRect(),f=Nd(o);let d=xo(1);l&&(r?Je(r)&&(d=Mi(r)):d=Mi(o));const m=ZE(f,a,r)?nb(f):xo(0);let h=(c.left+m.x)/d.x,g=(c.top+m.y)/d.y,y=c.width/d.x,b=c.height/d.y;if(f&&r){const S=yt(f),E=Je(r)?yt(r):r;let T=S,C=Bf(T);for(;C&&E!==T;){const O=Mi(C),w=C.getBoundingClientRect(),D=vn(C),A=w.left+(C.clientLeft+parseFloat(D.paddingLeft))*O.x,M=w.top+(C.clientTop+parseFloat(D.paddingTop))*O.y;h*=O.x,g*=O.y,y*=O.x,b*=O.y,h+=A,g+=M,T=yt(C),C=Bf(T)}}return Es({width:y,height:b,x:h,y:g})}function Gs(o,l){const a=Us(o).scrollLeft;return l?l.left+a:kl(wo(o)).left+a}function ob(o,l){const a=o.getBoundingClientRect(),r=a.left+l.scrollLeft-Gs(o,a),c=a.top+l.scrollTop;return{x:r,y:c}}function JE(o){let{elements:l,rect:a,offsetParent:r,strategy:c}=o;const f=c==="fixed",d=wo(r),m=l?ks(l.floating):!1;if(r===d||m&&f)return a;let h={scrollLeft:0,scrollTop:0},g=xo(1);const y=xo(0),b=dt(r);if((b||!f)&&((Kt(r)!=="body"||Ba(d))&&(h=Us(r)),b)){const E=kl(r);g=Mi(r),y.x=E.x+r.clientLeft,y.y=E.y+r.clientTop}const S=d&&!b&&!f?ob(d,h):xo(0);return{width:a.width*g.x,height:a.height*g.y,x:a.x*g.x-h.scrollLeft*g.x+y.x+S.x,y:a.y*g.y-h.scrollTop*g.y+y.y+S.y}}function WE(o){return o.getClientRects?Array.from(o.getClientRects()):[]}function $E(o){const l=Us(o),a=o.ownerDocument.body,r=So(o.scrollWidth,o.clientWidth,a.scrollWidth,a.clientWidth),c=So(o.scrollHeight,o.clientHeight,a.scrollHeight,a.clientHeight);let f=-l.scrollLeft+Gs(o);const d=-l.scrollTop;return vn(a).direction==="rtl"&&(f+=So(o.clientWidth,a.clientWidth)-r),{width:r,height:c,x:f,y:d}}const e1=25;function t1(o,l,a){a===void 0&&(a="viewport");const r=a==="layoutViewport",c=yt(o),f=wo(o),d=c.visualViewport;let m=f.clientWidth,h=f.clientHeight,g=0,y=0;if(d){const S=!pd()||l==="fixed";r?S||(g=-d.offsetLeft,y=-d.offsetTop):(m=d.width,h=d.height,S&&(g=d.offsetLeft,y=d.offsetTop))}if(Gs(f)<=0){const S=f.ownerDocument,E=S.body,T=getComputedStyle(E),C=S.compatMode==="CSS1Compat"&&parseFloat(T.marginLeft)+parseFloat(T.marginRight)||0,O=Math.abs(f.clientWidth-E.clientWidth-C),w=getComputedStyle(f).scrollbarGutter==="stable both-edges"?O/2:O;w<=e1&&(m-=w)}return{width:m,height:h,x:g,y}}function n1(o,l){const a=kl(o,!0,l==="fixed"),r=a.top+o.clientTop,c=a.left+o.clientLeft,f=Mi(o),d=o.clientWidth*f.x,m=o.clientHeight*f.y,h=c*f.x,g=r*f.y;return{width:d,height:m,x:h,y:g}}function wy(o,l,a){let r;if(l==="viewport"||l==="layoutViewport")r=t1(o,a,l);else if(l==="document")r=$E(wo(o));else if(Je(l))r=n1(l,a);else{const c=nb(o);r={x:l.x-c.x,y:l.y-c.y,width:l.width,height:l.height}}return Es(r)}function o1(o,l){const a=l.get(o);if(a)return a;let r=ja(o,[],!1).filter(m=>Je(m)&&Kt(m)!=="body"),c=null;const f=vn(o).position==="fixed";let d=f?Ro(o):o;for(;Je(d)&&!bo(d);){const m=vn(d),h=dd(d),g=c?c.position:f?"fixed":"";!h&&(g==="fixed"||g==="absolute"&&m.position==="static")?r=r.filter(b=>b!==d):c=m,d=Ro(d)}return l.set(o,r),r}function l1(o){let{element:l,boundary:a,rootBoundary:r,strategy:c}=o;const d=[...a==="clippingAncestors"?ks(l)?[]:o1(l,this._c):[].concat(a),r],m=wy(l,d[0],c);let h=m.top,g=m.right,y=m.bottom,b=m.left;for(let S=1;S<d.length;S++){const E=wy(l,d[S],c);h=So(E.top,h),g=zi(E.right,g),y=zi(E.bottom,y),b=So(E.left,b)}return{width:g-b,height:y-h,x:b,y:h}}function i1(o){const{width:l,height:a}=tb(o);return{width:l,height:a}}function a1(o,l,a){const r=dt(l),c=wo(l),f=a==="fixed",d=kl(o,!0,f,l);let m={scrollLeft:0,scrollTop:0};const h=xo(0);if((r||!f)&&((Kt(l)!=="body"||Ba(c))&&(m=Us(l)),r)){const S=kl(l,!0,f,l);h.x=S.x+l.clientLeft,h.y=S.y+l.clientTop}!r&&c&&(h.x=Gs(c));const g=c&&!r&&!f?ob(c,m):xo(0),y=d.left+m.scrollLeft-h.x-g.x,b=d.top+m.scrollTop-h.y-g.y;return{x:y,y:b,width:d.width,height:d.height}}function xf(o){return vn(o).position==="static"}function Ay(o,l){if(!dt(o)||vn(o).position==="fixed")return null;if(l)return l(o);let a=o.offsetParent;return wo(o)===a&&(a=a.ownerDocument.body),a}function lb(o,l){const a=yt(o);if(ks(o))return a;if(!dt(o)){let c=Ro(o);for(;c&&!bo(c);){if(Je(c)&&!xf(c))return c;c=Ro(c)}return a}let r=Ay(o,l);for(;r&&iT(r)&&xf(r);)r=Ay(r,l);return r&&bo(r)&&xf(r)&&!dd(r)?a:r||sT(o)||a}const r1=async function(o){const l=this.getOffsetParent||lb,a=this.getDimensions,r=await a(o.floating);return{reference:a1(o.reference,await l(o.floating),o.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function s1(o){return vn(o).direction==="rtl"}const u1={convertOffsetParentRelativeRectToViewportRelativeRect:JE,getDocumentElement:wo,getClippingRect:l1,getOffsetParent:lb,getElementRects:r1,getClientRects:WE,getDimensions:i1,getScale:Mi,isElement:Je,isRTL:s1};function ib(o,l){return o.x===l.x&&o.y===l.y&&o.width===l.width&&o.height===l.height}function c1(o,l,a){let r=null,c;const f=wo(o);function d(){var y;clearTimeout(c),(y=r)==null||y.disconnect(),r=null}function m(y,b){y===void 0&&(y=!1),b===void 0&&(b=1),d();const S=o.getBoundingClientRect(),{left:E,top:T,width:C,height:O}=S;if(y||l(),!C||!O)return;const w=is(T),D=is(f.clientWidth-(E+C)),A=is(f.clientHeight-(T+O)),M=is(E),U={rootMargin:-w+"px "+-D+"px "+-A+"px "+-M+"px",threshold:So(0,zi(1,b))||1};let j=!0;function k(W){const $=W[0].intersectionRatio;if(!ib(S,o.getBoundingClientRect()))return m();if($!==b){if(!j)return m();$?m(!1,$):c=setTimeout(()=>{m(!1,1e-7)},1e3)}j=!1}try{r=new IntersectionObserver(k,{...U,root:f.ownerDocument})}catch{r=new IntersectionObserver(k,U)}r.observe(o)}const h=yt(o),g=()=>m(a);return h.addEventListener("resize",g),m(!0),()=>{h.removeEventListener("resize",g),d()}}function My(o,l,a,r){r===void 0&&(r={});const{ancestorScroll:c=!0,ancestorResize:f=!0,elementResize:d=typeof ResizeObserver=="function",layoutShift:m=typeof IntersectionObserver=="function",animationFrame:h=!1}=r,g=Nd(o),y=c||f?[...g?ja(g):[],...l?ja(l):[]]:[];y.forEach(w=>{c&&w.addEventListener("scroll",a),f&&w.addEventListener("resize",a)});const b=g&&m?c1(g,a,f):null;let S=-1,E=null;d&&(E=new ResizeObserver(w=>{let[D]=w;D&&D.target===g&&E&&l&&(E.unobserve(l),cancelAnimationFrame(S),S=requestAnimationFrame(()=>{var A;(A=E)==null||A.observe(l)})),a()}),g&&!h&&E.observe(g),l&&E.observe(l));let T,C=h?kl(o):null;h&&O();function O(){const w=kl(o);C&&!ib(C,w)&&a(),C=w,T=requestAnimationFrame(O)}return a(),()=>{var w;y.forEach(D=>{c&&D.removeEventListener("scroll",a),f&&D.removeEventListener("resize",a)}),b?.(),(w=E)==null||w.disconnect(),E=null,h&&cancelAnimationFrame(T)}}const f1=GE,d1=XE,p1=PE,h1=QE,g1=KE,m1=(o,l,a)=>{const r=new Map,c=a??{},f={...u1,...c.platform,_c:r};return qE(o,l,{...c,platform:f})};var y1=typeof document<"u",v1=function(){},ys=y1?v.useLayoutEffect:v1;function Os(o,l){if(o===l)return!0;if(typeof o!=typeof l)return!1;if(typeof o=="function"&&o.toString()===l.toString())return!0;let a,r,c;if(o&&l&&typeof o=="object"){if(Array.isArray(o)){if(a=o.length,a!==l.length)return!1;for(r=a;r--!==0;)if(!Os(o[r],l[r]))return!1;return!0}if(c=Object.keys(o),a=c.length,a!==Object.keys(l).length)return!1;for(r=a;r--!==0;)if(!{}.hasOwnProperty.call(l,c[r]))return!1;for(r=a;r--!==0;){const f=c[r];if(!(f==="_owner"&&o.$$typeof)&&!Os(o[f],l[f]))return!1}return!0}return o!==o&&l!==l}function ab(o){return typeof window>"u"?1:(o.ownerDocument.defaultView||window).devicePixelRatio||1}function Dy(o,l){const a=ab(o);return Math.round(l*a)/a}function Tf(o){const l=v.useRef(o);return ys(()=>{l.current=o}),l}function b1(o){o===void 0&&(o={});const{placement:l="bottom",strategy:a="absolute",middleware:r=[],platform:c,elements:{reference:f,floating:d}={},transform:m=!0,whileElementsMounted:h,open:g}=o,[y,b]=v.useState({x:0,y:0,strategy:a,placement:l,middlewareData:{},isPositioned:!1}),[S,E]=v.useState(r);Os(S,r)||E(r);const[T,C]=v.useState(null),[O,w]=v.useState(null),D=v.useCallback(I=>{I!==U.current&&(U.current=I,C(I))},[]),A=v.useCallback(I=>{I!==j.current&&(j.current=I,w(I))},[]),M=f||T,H=d||O,U=v.useRef(null),j=v.useRef(null),k=v.useRef(y),W=h!=null,$=Tf(h),F=Tf(c),Y=Tf(g),ee=v.useCallback(()=>{if(!U.current||!j.current)return;const I={placement:l,strategy:a,middleware:S};F.current&&(I.platform=F.current),m1(U.current,j.current,I).then(Q=>{const ne={...Q,isPositioned:Y.current!==!1};le.current&&!Os(k.current,ne)&&(k.current=ne,qn.flushSync(()=>{b(ne)}))})},[S,l,a,F,Y]);ys(()=>{g===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,b(I=>({...I,isPositioned:!1})))},[g]);const le=v.useRef(!1);ys(()=>(le.current=!0,()=>{le.current=!1}),[]),ys(()=>{if(M&&(U.current=M),H&&(j.current=H),M&&H){if($.current)return $.current(M,H,ee);ee()}},[M,H,ee,$,W]);const K=v.useMemo(()=>({reference:U,floating:j,setReference:D,setFloating:A}),[D,A]),N=v.useMemo(()=>({reference:M,floating:H}),[M,H]),P=v.useMemo(()=>{const I={position:a,left:0,top:0};if(!N.floating)return I;const Q=Dy(N.floating,y.x),ne=Dy(N.floating,y.y);return m?{...I,transform:"translate("+Q+"px, "+ne+"px)",...ab(N.floating)>=1.5&&{willChange:"transform"}}:{position:a,left:Q,top:ne}},[a,m,N.floating,y.x,y.y]);return v.useMemo(()=>({...y,update:ee,refs:K,elements:N,floatingStyles:P}),[y,ee,K,N,P])}const S1=(o,l)=>{const a=f1(o);return{name:a.name,fn:a.fn,options:[o,l]}},x1=(o,l)=>{const a=d1(o);return{name:a.name,fn:a.fn,options:[o,l]}},T1=(o,l)=>({fn:g1(o).fn,options:[o,l]}),E1=(o,l)=>{const a=p1(o);return{name:a.name,fn:a.fn,options:[o,l]}},R1=(o,l)=>{const a=h1(o);return{name:a.name,fn:a.fn,options:[o,l]}};var Ef={exports:{}},Rf={};var Ny;function C1(){if(Ny)return Rf;Ny=1;var o=La();function l(b,S){return b===S&&(b!==0||1/b===1/S)||b!==b&&S!==S}var a=typeof Object.is=="function"?Object.is:l,r=o.useState,c=o.useEffect,f=o.useLayoutEffect,d=o.useDebugValue;function m(b,S){var E=S(),T=r({inst:{value:E,getSnapshot:S}}),C=T[0].inst,O=T[1];return f(function(){C.value=E,C.getSnapshot=S,h(C)&&O({inst:C})},[b,E,S]),c(function(){return h(C)&&O({inst:C}),b(function(){h(C)&&O({inst:C})})},[b]),d(E),E}function h(b){var S=b.getSnapshot;b=b.value;try{var E=S();return!a(b,E)}catch{return!0}}function g(b,S){return S()}var y=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?g:m;return Rf.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:y,Rf}var zy;function rb(){return zy||(zy=1,Ef.exports=C1()),Ef.exports}var zd=rb(),Cf={exports:{}},Of={};var _y;function O1(){if(_y)return Of;_y=1;var o=La(),l=rb();function a(g,y){return g===y&&(g!==0||1/g===1/y)||g!==g&&y!==y}var r=typeof Object.is=="function"?Object.is:a,c=l.useSyncExternalStore,f=o.useRef,d=o.useEffect,m=o.useMemo,h=o.useDebugValue;return Of.useSyncExternalStoreWithSelector=function(g,y,b,S,E){var T=f(null);if(T.current===null){var C={hasValue:!1,value:null};T.current=C}else C=T.current;T=m(function(){function w(U){if(!D){if(D=!0,A=U,U=S(U),E!==void 0&&C.hasValue){var j=C.value;if(E(j,U))return M=j}return M=U}if(j=M,r(A,U))return j;var k=S(U);return E!==void 0&&E(j,k)?(A=U,j):(A=U,M=k)}var D=!1,A,M,H=b===void 0?null:b;return[function(){return w(y())},H===null?void 0:function(){return w(H())}]},[y,b,S,E]);var O=c(g,T[0],T[1]);return d(function(){C.hasValue=!0,C.value=O},[O]),h(O),O},Of}var Hy;function w1(){return Hy||(Hy=1,Cf.exports=O1()),Cf.exports}var A1=w1();const M1=Cd(19),D1=M1?z1:_1;function sb(o,l,a,r,c){return D1(o,l,a,r,c)}function N1(o,l,a,r,c){const f=v.useCallback(()=>l(o.getSnapshot(),a,r,c),[o,l,a,r,c]);return zd.useSyncExternalStore(o.subscribe,f,f)}Kx({before(o){o.syncIndex=0,o.didInitialize||(o.syncTick=1,o.syncHooks=[],o.didChangeStore=!0,o.getSnapshot=()=>{let l=!1;for(let a=0;a<o.syncHooks.length;a+=1){const r=o.syncHooks[a],c=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,c)||(l=!0,r.value=c)}return l&&(o.syncTick+=1),o.syncTick})},after(o){o.syncHooks.length>0&&(o.didChangeStore&&(o.didChangeStore=!1,o.subscribe=l=>{const a=new Set;for(const c of o.syncHooks)a.add(c.store);const r=[];for(const c of a)r.push(c.subscribe(l));return()=>{for(const c of r)c()}}),zd.useSyncExternalStore(o.subscribe,o.getSnapshot,o.getSnapshot))}});function z1(o,l,a,r,c){const f=Xx();if(!f)return N1(o,l,a,r,c);const d=f.syncIndex;f.syncIndex+=1;let m;return f.didInitialize?(m=f.syncHooks[d],(m.store!==o||m.selector!==l||!Object.is(m.a1,a)||!Object.is(m.a2,r)||!Object.is(m.a3,c))&&(m.store!==o&&(f.didChangeStore=!0),m.store=o,m.selector=l,m.a1=a,m.a2=r,m.a3=c,m.value=l(o.getSnapshot(),a,r,c))):(m={store:o,selector:l,a1:a,a2:r,a3:c,value:l(o.getSnapshot(),a,r,c)},f.syncHooks.push(m)),m.value}function _1(o,l,a,r,c){return A1.useSyncExternalStoreWithSelector(o.subscribe,o.getSnapshot,o.getSnapshot,f=>l(f,a,r,c))}class H1{static create(l){return new this(l)}constructor(l){this.state=l,this.listeners=new Set,this.updateTick=0}subscribe=l=>(this.listeners.add(l),()=>{this.listeners.delete(l)});getSnapshot=()=>this.state;setState(l){if(this.state===l)return;this.state=l,this.updateTick+=1;const a=this.updateTick;for(const r of this.listeners){if(a!==this.updateTick)return;r(l)}}update(l){for(const a in l)if(!Object.is(this.state[a],l[a])){this.setState({...this.state,...l});return}}set(l,a){Object.is(this.state[l],a)||this.setState({...this.state,[l]:a})}notifyAll(){const l={...this.state};this.setState(l)}use(l,a,r,c){return sb(this,l,a,r,c)}}class Ia extends H1{constructor(l,a={},r){super(l),this.context=a,this.selectors=r}useSyncedValue(l,a){v.useDebugValue(l);const r=this;be(()=>{r.state[l]!==a&&r.set(l,a)},[r,l,a])}useSyncedValueWithCleanup(l,a){const r=this;be(()=>(r.state[l]!==a&&r.set(l,a),()=>{r.set(l,void 0)}),[r,l,a])}useSyncedValues(l){const a=this,r=Object.values(l);be(()=>{a.update(l)},[a,...r])}useControlledProp(l,a){v.useDebugValue(l);const r=this,c=a!==void 0;be(()=>{c&&!Object.is(r.state[l],a)&&r.setState({...r.state,[l]:a})},[r,l,a,c])}select(l,a,r,c){const f=this.selectors[l];return f(this.state,a,r,c)}useState(l,a,r,c){return v.useDebugValue(l),sb(this,this.selectors[l],a,r,c)}useContextCallback(l,a){v.useDebugValue(l);const r=Oe(a??ad);this.context[l]=r}useStateSetter(l){const a=v.useRef(void 0);return a.current===void 0&&(a.current=r=>{this.set(l,r)}),a.current}observe(l,a){let r;typeof l=="function"?r=l:r=this.selectors[l];let c=r(this.state);return a(c,c,this),this.subscribe(f=>{const d=r(f);if(!Object.is(c,d)){const m=c;c=d,a(d,m,this)}})}}const j1={open:o=>o.open,transitionStatus:o=>o.transitionStatus,domReferenceElement:o=>o.domReferenceElement,referenceElement:o=>o.positionReference??o.referenceElement,floatingElement:o=>o.floatingElement,floatingId:o=>o.floatingId};class ub extends Ia{constructor(l){const{syncOnly:a,nested:r,onOpenChange:c,triggerElements:f,...d}=l;super({...d,positionReference:d.referenceElement,domReferenceElement:d.referenceElement},{onOpenChange:c,dataRef:{current:{}},events:Fv(),nested:r,triggerElements:f},j1),this.syncOnly=a}syncOpenEvent=(l,a)=>{(!l||!this.state.open||a!=null&&lT(a))&&(this.context.dataRef.current.openEvent=l?a:void 0)};dispatchOpenChange=(l,a)=>{this.syncOpenEvent(l,a.event);const r={open:l,reason:a.reason,nativeEvent:a.event,nested:this.context.nested,triggerElement:a.trigger};this.context.events.emit("openchange",r)};setOpen=(l,a)=>{if(this.syncOnly){this.context.onOpenChange?.(l,a);return}this.dispatchOpenChange(l,a),this.context.onOpenChange?.(l,a)}}function cb(o){const{popupStore:l,treatPopupAsFloatingElement:a=!1,floatingRootContext:r,floatingId:c,nested:f,onOpenChange:d}=o,m=l.useState("open"),h=l.useState("activeTriggerElement"),g=l.useState(a?"popupElement":"positionerElement"),y=l.context.triggerElements,b=d,S=v.useRef(null);r===void 0&&S.current===null&&(S.current=new ub({open:m,transitionStatus:void 0,referenceElement:h,floatingElement:g,triggerElements:y,onOpenChange:b,floatingId:c,syncOnly:!0,nested:f}));const E=r??S.current;return l.useSyncedValue("floatingId",c),be(()=>{const T={open:m,floatingId:c,referenceElement:h,floatingElement:g};Je(h)&&(T.domReferenceElement=h),E.state.positionReference===E.state.referenceElement&&(T.positionReference=h),E.update(T)},[m,c,h,g,E]),E.context.onOpenChange=b,E.context.nested=f,E}function fb(o,l=!1,a=!1,r=!1){const[c,f]=v.useState(o&&l?"idle":void 0),[d,m]=v.useState(o&&!r);return o&&!d&&(m(!0),f("starting")),!o&&d&&c!=="ending"&&!a&&f("ending"),!o&&!d&&c==="ending"&&f(void 0),be(()=>{if(!o&&d&&c!=="ending"&&a){const h=Zn.request(()=>{f("ending")});return()=>{Zn.cancel(h)}}},[o,d,c,a]),be(()=>{if(!o||l)return;const h=Zn.request(()=>{f(void 0)});return()=>{Zn.cancel(h)}},[l,o]),be(()=>{if(!o||!l)return;o&&d&&c!=="idle"&&f("starting");const h=Zn.request(()=>{f("idle")});return()=>{Zn.cancel(h)}},[l,o,d,c]),{mounted:d,setMounted:m,transitionStatus:c}}let rs=null;function k1(o){if(!rs){const l=[];rs=l,queueMicrotask(()=>{rs=null,qn.flushSync(()=>{for(const a of l)a()})})}rs.push(o)}function _d(o,l=!1,a=!1){const r=ka();return Oe((c,f=null)=>{r.cancel();const d=yo(o);if(d==null)return;const m=d,h=()=>{if(!a){qn.flushSync(c);return}k1(()=>{f?.aborted||c()})};if(typeof m.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){c();return}function g(){Promise.all(m.getAnimations().map(y=>y.finished)).then(()=>{f?.aborted||h()},()=>{if(f?.aborted)return;if(m.getAnimations().some(b=>b.pending||b.playState!=="finished")){g();return}h()})}if(l){const y=yv;if(!m.hasAttribute(y)){r.request(g);return}const b=new MutationObserver(()=>{m.hasAttribute(y)||(b.disconnect(),g())});b.observe(m,{attributes:!0,attributeFilter:[y]}),f?.addEventListener("abort",()=>b.disconnect(),{once:!0});return}r.request(g)})}function Hi(o){const{enabled:l=!0,open:a,ref:r,batch:c=!1,onComplete:f}=o,d=Oe(f),m=_d(r,a,c);v.useEffect(()=>{if(!l)return;const h=new AbortController;return m(d,h.signal),()=>{h.abort()}},[l,a,d,m])}const Hd={tabIndex:-1,[Yf]:""};function U1(o){return l=>l==="touch"?o.current:!0}function db(o,l=!1){const a=jl(),r=Ll()!=null,c=Zt(()=>o(a,r)).current;return cb({popupStore:c,treatPopupAsFloatingElement:l,floatingRootContext:c.state.floatingRootContext,floatingId:a,nested:r,onOpenChange:c.setOpen}),c}function jd({handle:o,store:l}){return be(()=>o.attachStore(l),[o,l]),null}function jy(o){const l=o.context.triggerElements.size;o.select("open")&&o.state.triggerCount!==l&&o.set("triggerCount",l)}function L1(o,l){const a=v.useRef(null);return Oe(r=>{const c=a.current;if(c!==null){if(c.element===r&&c.store===l&&c.id===o)return;a.current=null;const f=c.store;f.context.triggerElements.getById(c.id)===c.element&&(f.context.triggerElements.delete(c.id),jy(f))}r!==null&&o!==void 0&&(a.current={store:l,id:o,element:r},l.context.triggerElements.add(o,r),jy(l))})}function kd(o,l,a,r=!1){let c=o.preventUnmountingOnClose;l?c=!1:r&&(c=!0);const f=a?.id??null;let d=o.activeTriggerId,m=o.activeTriggerElement;return(f||l)&&(d=f,m=a??null),{open:l,preventUnmountingOnClose:c,activeTriggerId:d,activeTriggerElement:m}}function pb(o){let l=!1;return o.preventUnmountOnClose=()=>{l=!0},()=>l}function B1(o,l,a,r={}){const c=a.reason,f=c===Ut,d=l&&c===Oi,m=!l&&(c===_i||c===Ps),h=pb(a);if(o.context.onOpenChange?.(l,a),a.isCanceled)return;r.onBeforeDispatch?.(),o.state.floatingRootContext.dispatchOpenChange(l,a);const g=()=>{const y=kd(o.state,l,a.trigger,h()),b={...r.extraState,...y};d?b.instantType="focus":m?b.instantType="dismiss":f&&(b.instantType=void 0),o.update(b)};f?qn.flushSync(g):g()}function hb(o,l,a,r){const c=a.useState("isMountedByTrigger",o),f=L1(o,a),d=Oe(h=>{const g=a.select("open"),y=a.select("activeTriggerId");if(y===o){const b={activeTriggerElement:h,...g?r:null};a.update(b);return}if(y==null&&g){const b={activeTriggerId:o??null,activeTriggerElement:h,...r};a.update(b)}}),m=Oe(h=>{f(h),h&&d(h)});return be(()=>(m(l.current),()=>m(null)),[m,l,a,o]),be(()=>{if(c){const h={activeTriggerElement:l.current,...r};a.update(h)}},[c,a,l,...Object.values(r)]),{registerTrigger:m,isMountedByThisTrigger:c}}function Ud(o,l={}){const{closeOnActiveTriggerUnmount:a=!1}=l,r=v.useRef(null),c=o.useState("open"),f=o.useState("triggerCount"),d=o.useState("activeTriggerId"),m=o.useState("activeTriggerElement");be(()=>{if(!c){r.current=null,o.state.triggerCount!==0&&o.set("triggerCount",0);return}const h=o.context.triggerElements.size,g={};o.state.triggerCount!==h&&(g.triggerCount=h);const y=o.select("activeTriggerId");let b=null;if(y){const S=o.context.triggerElements.getById(y);if(S)r.current=y,S!==o.state.activeTriggerElement&&(g.activeTriggerElement=S);else{for(const[E,T]of o.context.triggerElements.entries())if(T===o.state.activeTriggerElement){g.activeTriggerId=E,g.activeTriggerElement=T,r.current=E;break}g.activeTriggerId===void 0&&(r.current===y?b=y:r.current=null)}}else r.current=null;if(!b&&!y&&h===1){const S=o.context.triggerElements.entries().next();if(!S.done){const[E,T]=S.value;g.activeTriggerId=E,g.activeTriggerElement=T,r.current=E}}(g.triggerCount!==void 0||g.activeTriggerId!==void 0||g.activeTriggerElement!==void 0)&&o.update(g),b&&a&&queueMicrotask(()=>{if(o.select("open")&&o.select("activeTriggerId")===b&&!o.context.triggerElements.getById(b)){const S=Ke(qs);o.setOpen(!1,S),S.isCanceled||o.update({activeTriggerId:null,activeTriggerElement:null})}})},[c,o,f,d,m,a])}function Ld(o,l,a,r){const{mounted:c,setMounted:f,transitionStatus:d}=fb(o,!1,!1,r),m=l.useState("preventUnmountingOnClose"),h=o?!1:m;l.useSyncedValues({mounted:c,transitionStatus:d,preventUnmountingOnClose:h});const g=Oe(()=>{f(!1),l.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),a?.(),l.context.onOpenChangeComplete?.(!1)});return Hi({enabled:c&&!o&&!h,open:o,ref:l.context.popupRef,onComplete(){o||g()}}),{forceUnmount:g,transitionStatus:d}}function Bd(o,l){o.useSyncedValues(l),be(()=>()=>{o.update({activeTriggerProps:Ct,inactiveTriggerProps:Ct,popupProps:Ct})},[o])}function Y1(o,l){be(()=>{!l&&o.state.openMethod!==null&&o.set("openMethod",null)},[l,o]),be(()=>()=>{o.state.openMethod!==null&&o.set("openMethod",null)},[o])}class Yd{constructor(){this.idMap=new Map}add(l,a){this.idMap.set(l,a)}delete(l){this.idMap.delete(l)}hasElement(l){for(const a of this.idMap.values())if(a===l)return!0;return!1}hasMatchingElement(l){for(const a of this.idMap.values())if(l(a))return!0;return!1}getById(l){return this.idMap.get(l)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}function Id(o,l,a=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new ub({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:o,floatingId:l,syncOnly:!0,nested:a,onOpenChange:void 0}),floatingId:l,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Ct,inactiveTriggerProps:Ct,popupProps:Ct}}const _a=o=>o.triggerIdProp??o.activeTriggerId,qd=o=>o.openProp??o.open,ky=o=>(o.popupElement?.id??o.floatingId)||void 0;function gb(o,l){return l!==void 0&&qd(o)&&_a(o)===l}function I1(o,l){return gb(o,l)?!0:l!==void 0&&qd(o)&&_a(o)==null&&o.triggerCount===1}const Pd={open:qd,mounted:o=>o.mounted,transitionStatus:o=>o.transitionStatus,floatingRootContext:o=>o.floatingRootContext,triggerCount:o=>o.triggerCount,preventUnmountingOnClose:o=>o.preventUnmountingOnClose,payload:o=>o.payload,activeTriggerId:_a,activeTriggerElement:o=>o.mounted?o.activeTriggerElement:null,popupId:ky,isTriggerActive:(o,l)=>l!==void 0&&_a(o)===l,isOpenedByTrigger:(o,l)=>gb(o,l),isMountedByTrigger:(o,l)=>l!==void 0&&_a(o)===l&&o.mounted,triggerProps:(o,l)=>l?o.activeTriggerProps:o.inactiveTriggerProps,triggerPopupId:(o,l)=>I1(o,l)?ky(o):void 0,popupProps:o=>o.popupProps,popupElement:o=>o.popupElement,positionerElement:o=>o.positionerElement};function mb(o){const l=v.useCallback(r=>o===void 0?ad:o.subscribeStore(r),[o]),a=v.useCallback(()=>o===void 0?void 0:o.store,[o]);return zd.useSyncExternalStore(l,a,()=>o?.serverStore)}function q1(o){return P1(o,o.rootContext)}function P1(o,l){const{nodeId:a,externalTree:r}=o,c=l.useState("referenceElement"),f=l.useState("floatingElement"),d=l.useState("domReferenceElement"),m=l.useState("open"),h=l.useState("floatingId"),[g,y]=v.useState(null),[b,S]=v.useState(void 0),[E,T]=v.useState(void 0),C=v.useRef(null),O=cl(r),w=v.useMemo(()=>({reference:c,floating:f,domReference:d}),[c,f,d]),D=b1({...o,elements:{...w,...g&&{reference:g}}}),A=Je(b)?b:null,M=E===void 0?l.state.floatingElement:E;l.useSyncedValue("referenceElement",b??null),l.useSyncedValue("domReferenceElement",b===void 0?d:A),l.useSyncedValue("floatingElement",M);const H=v.useCallback(F=>{const Y=Je(F)?{getBoundingClientRect:()=>F.getBoundingClientRect(),getClientRects:()=>F.getClientRects(),contextElement:F}:F;y(Y),D.refs.setReference(Y)},[D.refs]),U=v.useCallback(F=>{(Je(F)||F===null)&&(C.current=F,S(F)),(Je(D.refs.reference.current)||D.refs.reference.current===null||F!==null&&!Je(F))&&D.refs.setReference(F)},[D.refs,S]),j=v.useCallback(F=>{T(F),D.refs.setFloating(F)},[D.refs]),k=v.useMemo(()=>({...D.refs,setReference:U,setFloating:j,setPositionReference:H,domReference:C}),[D.refs,U,j,H]),W=v.useMemo(()=>({...D.elements,domReference:d}),[D.elements,d]),$=v.useMemo(()=>({...D,dataRef:l.context.dataRef,open:m,onOpenChange:l.setOpen,events:l.context.events,floatingId:h,refs:k,elements:W,nodeId:a,rootStore:l}),[D,k,W,a,l,m,h]);return be(()=>{d&&(C.current=d)},[d]),be(()=>{l.context.dataRef.current.floatingContext=$;const F=O?.nodesRef.current.find(Y=>Y.id===a);F&&(F.context=$)}),v.useMemo(()=>({...D,context:$,refs:k,elements:W,rootStore:l}),[D,k,W,$,l])}const wf=rd&&ul;function yb(o,l={}){const{enabled:a=!0,delay:r}=l,c="rootStore"in o?o.rootStore:o,{events:f,dataRef:d}=c.context,m=v.useRef(!1),h=v.useRef(null),g=v.useRef(!0),y=Jt();v.useEffect(()=>{const S=c.select("domReferenceElement");if(!a)return;const E=yt(S);function T(){const w=c.select("domReferenceElement");!c.select("open")&&dt(w)&&w===Ht(Xe(w))&&(m.current=!0,h.current=w)}function C(){g.current=!0}function O(){g.current=!1}return In(Ye(E,"blur",T),wf&&Ye(E,"keydown",C,!0),wf&&Ye(E,"pointerdown",O,!0))},[c,a]),v.useEffect(()=>{if(!a)return;function S(E){if(E.reason===_i||E.reason===Ps){const T=c.select("domReferenceElement");Je(T)&&(h.current=T,m.current=!0)}}return f.on("openchange",S),()=>{f.off("openchange",S)}},[f,a,c]);const b=v.useMemo(()=>{function S(){m.current=!1,h.current=null}return{onMouseLeave(){S()},onFocus(E){const T=E.currentTarget;if(m.current){if(h.current===T)return;S()}const C=bt(E.nativeEvent);if(Je(C)){if(wf&&!E.relatedTarget){if(!g.current&&!Is(C))return}else if(!Ss(C))return}const O=bs(E.relatedTarget,c.context.triggerElements),{nativeEvent:w,currentTarget:D}=E,A=typeof r=="function"?r():r;if(c.select("open")&&O||A===0||A===void 0){c.setOpen(!0,Ke(Oi,w,D));return}y.start(A,()=>{m.current||c.setOpen(!0,Ke(Oi,w,D))})},onBlur(E){S();const T=E.relatedTarget,C=E.nativeEvent,O=Je(T)&&T.hasAttribute(Ua("focus-guard"))&&T.getAttribute("data-type")==="outside";y.start(0,()=>{const w=c.select("domReferenceElement"),D=Ht(Xe(w));!T&&D===w||De(d.current.floatingContext?.refs.floating.current,D)||De(w,D)||O||bs(T??D,c.context.triggerElements)||c.setOpen(!1,Ke(Oi,C))})}}},[d,r,c,y]);return v.useMemo(()=>a?{reference:b,trigger:b}:{},[a,b])}class Vd{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new yn,this.restTimeout=new yn,this.handleCloseOptions=void 0}static create(){return new Vd}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}const ws=new WeakMap;function As(o){if(!o.performedPointerEventsMutation)return;const l=o.pointerEventsScopeElement;l&&ws.get(l)===o&&(o.pointerEventsScopeElement?.style.removeProperty("pointer-events"),o.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),o.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),ws.delete(l)),o.performedPointerEventsMutation=!1,o.pointerEventsScopeElement=null,o.pointerEventsReferenceElement=null,o.pointerEventsFloatingElement=null}function vb(o,l){const{scopeElement:a,referenceElement:r,floatingElement:c}=l,f=ws.get(a);f&&f!==o&&As(f),As(o),o.performedPointerEventsMutation=!0,o.pointerEventsScopeElement=a,o.pointerEventsReferenceElement=r,o.pointerEventsFloatingElement=c,ws.set(a,o),a.style.pointerEvents="none",r.style.pointerEvents="auto",c.style.pointerEvents="auto"}function Gd(o){const l=o.context.dataRef.current,a=Zt(()=>l.hoverInteractionState??Vd.create()).current;return l.hoverInteractionState||(l.hoverInteractionState=a),zs(l.hoverInteractionState.disposeEffect),l.hoverInteractionState}function bb(o,l={}){const{enabled:a=!0,closeDelay:r=0,nodeId:c}=l,f="rootStore"in o?o.rootStore:o,d=f.useState("open"),m=f.useState("floatingElement"),h=f.useState("domReferenceElement"),{dataRef:g}=f.context,y=cl(),b=Ll(),S=Gd(f),E=Jt(),T=Oe(()=>bv(g.current.openEvent?.type,S.interactedInside)),C=Oe(()=>CT(g.current.openEvent?.type)),O=Oe(()=>{As(S)});be(()=>{d||(S.pointerType=void 0,S.restTimeoutPending=!1,S.interactedInside=!1,O())},[d,S,O]),v.useEffect(()=>O,[O]),be(()=>{if(a&&d&&S.handleCloseOptions?.blockPointerEvents&&C()&&Je(h)&&m){const w=h,D=m,A=Xe(m),M=y?.nodesRef.current.find(k=>k.id===b)?.context?.elements.floating;M&&(M.style.pointerEvents="");const H=S.pointerEventsScopeElement!==D?S.pointerEventsScopeElement:null,U=M!==D?M:null,j=S.handleCloseOptions?.getScope?.()??H??U??w.closest("[data-rootownerid]")??A.body;return vb(S,{scopeElement:j,referenceElement:w,floatingElement:D}),()=>{O()}}},[a,d,h,m,S,C,y,b,O]),v.useEffect(()=>{if(!a)return;function w(){return!!(y&&b&&rl(y.nodesRef.current,b).length>0)}function D(k){const W=zl(r,"close",S.pointerType),$=()=>{f.setOpen(!1,Ke(Ut,k)),y?.events.emit("floating.closed",k)};W?S.openChangeTimeout.start(W,$):(S.openChangeTimeout.clear(),$())}function A(k){const W=bt(k);if(!ET(W)){S.interactedInside=!1;return}S.interactedInside=W?.closest("[aria-haspopup]")!=null}function M(){S.openChangeTimeout.clear(),E.clear(),y?.events.off("floating.closed",U),O()}function H(k){if(w()&&y){y.events.on("floating.closed",U);return}if(bs(k.relatedTarget,f.context.triggerElements))return;const W=g.current.floatingContext?.nodeId??c,$=k.relatedTarget;if(!(y&&W&&Je($)&&rl(y.nodesRef.current,W,!1).some(Y=>De(Y.context?.elements.floating,$)))){if(S.handler){S.handler(k);return}O(),C()&&!T()&&D(k)}}function U(k){!y||!b||w()||E.start(0,()=>{y.events.off("floating.closed",U),f.setOpen(!1,Ke(Ut,k)),y.events.emit("floating.closed",k)})}const j=m;return In(j&&Ye(j,"mouseenter",M),j&&Ye(j,"mouseleave",H),j&&Ye(j,"pointerdown",A,!0),()=>{y?.events.off("floating.closed",U)})},[a,m,f,g,r,c,C,T,O,S,y,b,E])}const V1={current:null};function Sb(o,l={}){const{enabled:a=!0,delay:r=0,handleClose:c=null,mouseOnly:f=!1,restMs:d=0,move:m=!0,triggerElementRef:h=V1,externalTree:g,isActiveTrigger:y=!0,getHandleCloseContext:b,isClosing:S,shouldOpen:E,guardStaleOpen:T=!1}=l,C="rootStore"in o?o.rootStore:o,{dataRef:O,events:w}=C.context,D=cl(g),A=Gd(C),M=v.useRef(!1),H=jt(c),U=jt(r),j=jt(d),k=jt(a),W=jt(E),$=jt(S),F=Oe(()=>bv(O.current.openEvent?.type,A.interactedInside)),Y=Oe(()=>W.current?.()!==!1),ee=Oe((N,P,I)=>{const Q=C.context.triggerElements;if(Q.hasElement(P))return!N||!De(N,P);if(!Je(I))return!1;const ne=I;return Q.hasMatchingElement(R=>De(R,ne))&&(!N||!De(N,ne))}),le=Oe(()=>{if(!A.handler)return;Xe(C.select("domReferenceElement")).removeEventListener("mousemove",A.handler),A.handler=void 0}),K=Oe(()=>{As(A)});return y&&(A.handleCloseOptions=c?.__options),v.useEffect(()=>le,[le]),v.useEffect(()=>{if(!a)return;function N(P){P.open?M.current=!1:(M.current=P.reason===Ut,le(),A.openChangeTimeout.clear(),A.restTimeout.clear(),A.blockMouseMove=!0,A.restTimeoutPending=!1)}return w.on("openchange",N),()=>{w.off("openchange",N)}},[a,w,A,le]),v.useEffect(()=>{if(!a)return;function N(B,J=!0){const V=zl(U.current,"close",A.pointerType);V?A.openChangeTimeout.start(V,()=>{C.setOpen(!1,Ke(Ut,B)),D?.events.emit("floating.closed",B)}):J&&(A.openChangeTimeout.clear(),C.setOpen(!1,Ke(Ut,B)),D?.events.emit("floating.closed",B))}const P=h.current??(y?C.select("domReferenceElement"):null);if(!Je(P))return;function I(B){if(A.openChangeTimeout.clear(),A.blockMouseMove=!1,f&&!ll(A.pointerType))return;const J=ay(j.current),V=zl(U.current,"open",A.pointerType),oe=bt(B),ie=B.currentTarget??null,he=C.select("domReferenceElement");let ue=ie;if(Je(oe)&&!C.context.triggerElements.hasElement(oe)){for(const xe of C.context.triggerElements.elements())if(De(xe,oe)){ue=xe;break}}Je(ie)&&Je(he)&&!C.context.triggerElements.hasElement(ie)&&De(ie,he)&&(ue=he);const pe=ue==null?!1:ee(he,ue,oe),Re=C.select("open"),ze=$.current?.()??C.select("transitionStatus")==="ending",ve=!Re&&ze&&M.current,ge=!pe&&Je(ue)&&Je(he)&&De(he,ue)&&ve,_e=J>0&&!V,ke=pe&&(Re||ve)||ge,Pe=!Re||pe;if(ke){Y()&&C.setOpen(!0,Ke(Ut,B,ue));return}_e||(V?A.openChangeTimeout.start(V,()=>{Pe&&Y()&&C.setOpen(!0,Ke(Ut,B,ue))}):Pe&&Y()&&C.setOpen(!0,Ke(Ut,B,ue)))}function Q(B){if(F()){K();return}le();const J=C.select("domReferenceElement"),V=Xe(J);A.restTimeout.clear(),A.restTimeoutPending=!1;const oe=O.current.floatingContext??b?.();if(bs(B.relatedTarget,C.context.triggerElements))return;if(H.current&&oe){C.select("open")||A.openChangeTimeout.clear();const he=h.current;A.handler=H.current({...oe,tree:D,x:B.clientX,y:B.clientY,onClose(){K(),le(),k.current&&!F()&&he===C.select("domReferenceElement")&&N(B,!0)}}),V.addEventListener("mousemove",A.handler),A.handler(B);return}(A.pointerType!=="touch"||!De(C.select("floatingElement"),B.relatedTarget))&&N(B)}function ne(B){De(P,B.relatedTarget)||(A.openChangeTimeout.clear(),A.restTimeout.clear(),A.restTimeoutPending=!1)}const R=T?Ye(P,"mouseout",ne):void 0;return m?In(Ye(P,"mousemove",I,{once:!0}),Ye(P,"mouseenter",I),Ye(P,"mouseleave",Q),R):In(Ye(P,"mouseenter",I),Ye(P,"mouseleave",Q),R)},[le,K,O,U,C,a,H,A,y,ee,F,f,m,j,h,D,k,b,$,Y,T]),v.useMemo(()=>{if(!a)return;function N(P){A.pointerType=P.pointerType}return{onPointerDown:N,onPointerEnter:N,onMouseMove(P){const{nativeEvent:I}=P,Q=P.currentTarget,ne=C.select("domReferenceElement"),R=C.select("open"),B=ee(ne,Q,P.target);if(f&&!ll(A.pointerType))return;if(R&&B&&A.handleCloseOptions?.blockPointerEvents){const oe=C.select("floatingElement");if(oe){const ie=A.handleCloseOptions?.getScope?.()??Q.ownerDocument.body;vb(A,{scopeElement:ie,referenceElement:Q,floatingElement:oe})}}const J=ay(j.current);if(R&&!B||J===0||!B&&A.restTimeoutPending&&P.movementX**2+P.movementY**2<2)return;A.restTimeout.clear();function V(){if(A.restTimeoutPending=!1,F())return;const oe=C.select("open");!A.blockMouseMove&&(!oe||B)&&Y()&&C.setOpen(!0,Ke(Ut,I,Q))}A.pointerType==="touch"?qn.flushSync(()=>{V()}):B&&R?V():(A.restTimeoutPending=!0,A.restTimeout.start(J,V))}}},[a,A,F,ee,f,C,j,Y])}const G1="Escape";function Uy(o){return ul&&o.movementX===0&&o.movementY===0}function Xs(o,l,a){switch(o){case"vertical":return l;case"horizontal":return a;default:return l||a}}function ss(o,l){return Xs(l,o===mv||o===hd,o===Ls||o===Bs)}function Af(o,l,a){return Xs(l,o===hd,a?o===Ls:o===Bs)||o==="Enter"||o===" "||o===""}function X1(o,l,a){return Xs(l,a?o===Ls:o===Bs,o===hd)}function K1(o,l,a,r){const c=a?o===Bs:o===Ls,f=o===mv;return l==="both"||l==="horizontal"&&r?o===G1:Xs(l,c,f)}function Q1(o,l){const{listRef:a,activeIndex:r,onNavigate:c=()=>{},enabled:f=!0,selectedIndex:d=null,allowEscape:m=!1,loopFocus:h=!1,nested:g=!1,rtl:y=!1,virtual:b=!1,focusItemOnOpen:S="auto",focusItemOnHover:E=!0,openOnArrowKeyDown:T=!0,disabledIndices:C=void 0,orientation:O="vertical",parentOrientation:w,id:D,resetOnPointerLeave:A=!0,externalTree:M,grid:H}=l,U=H!=null,j="rootStore"in o?o.rootStore:o,k=j.useState("open"),W=j.useState("floatingElement"),$=j.useState("domReferenceElement"),F=j.context.dataRef,Y=Pf(W),ee=qf($),le=jt(Y),K=Ll(),N=cl(M),P=v.useRef(S),I=v.useRef(d??-1),Q=v.useRef(null),ne=v.useRef(!0),R=Oe(fe=>{c(I.current===-1?null:I.current,fe)}),B=v.useRef(!!W),J=v.useRef(k),V=v.useRef(!1),oe=v.useRef(!1),ie=v.useRef(null),he=jt(C),ue=jt(k),pe=jt(d),Re=jt(A),ze=ka(),ve=ka(),ge=Oe(()=>{function fe(ye){b?N?.events.emit("virtualfocus",ye):ie.current=ms(ye,{sync:V.current,preventScroll:!0})}const me=a.current[I.current],de=oe.current;me&&fe(me),(V.current?ye=>ye():ye=>ze.request(ye))(()=>{const ye=a.current[I.current]||me;if(!ye)return;me||fe(ye),Te&&(de||!ne.current)&&ye.scrollIntoView?.({block:"nearest",inline:"nearest"})})});be(()=>{F.current.orientation=O},[F,O]),be(()=>{f&&(k&&W?(I.current=d??-1,P.current&&d!=null&&(oe.current=!0,R())):B.current&&(I.current=-1,R()))},[f,k,W,d,R]),be(()=>{if(f){if(!k){V.current=!1;return}if(W)if(r==null){if(V.current=!1,pe.current!=null)return;if(B.current&&(I.current=-1,ge()),(!J.current||!B.current)&&P.current&&(Q.current!=null||P.current===!0&&Q.current==null)){let fe=0;const me=()=>{a.current[0]==null?(fe<2&&(fe?ae=>ve.request(ae):queueMicrotask)(me),fe+=1):(I.current=Q.current==null||Af(Q.current,O,y)||g?gs(a):Xf(a),Q.current=null,R())};me()}}else za(a.current,r)||(I.current=r,ge(),oe.current=!1)}},[f,k,W,r,pe,g,a,O,y,R,ge,ve]),be(()=>{if(!f||W||!N||b||!B.current)return;const fe=N.nodesRef.current,me=fe.find(ye=>ye.id===K)?.context?.elements.floating,de=Ht(Xe($??me??null)),ae=fe.some(ye=>ye.context&&De(ye.context.elements.floating,de));me&&!ae&&ne.current&&me.focus({preventScroll:!0})},[f,W,$,N,K,b]),be(()=>{J.current=k,B.current=!!W}),be(()=>{k||(Q.current=null,P.current=S)},[k,S]);const _e=r!=null,ke=Oe(fe=>{if(!ue.current)return;const me=a.current.indexOf(fe.currentTarget);me!==-1&&(I.current!==me||r!==me)&&(I.current=me,R(fe))}),Pe=Oe(()=>w??N?.nodesRef.current.find(fe=>fe.id===K)?.context?.dataRef?.current.orientation),xe=Oe(()=>gs(a,he.current)),Ue=Oe(fe=>{if(ne.current=!1,V.current=!0,fe.which===229||!ue.current&&fe.currentTarget===le.current)return;if(g&&K1(fe.key,O,y,U)){ss(fe.key,Pe())||Fn(fe),j.setOpen(!1,Ke(Vf,fe.nativeEvent)),dt($)&&(b?N?.events.emit("virtualfocus",$):$.focus());return}const me=I.current,de=gs(a,C),ae=Xf(a,C);if(ee||(fe.key==="Home"&&(Fn(fe),I.current=de,R(fe)),fe.key==="End"&&(Fn(fe),I.current=ae,R(fe))),H!=null){const ye=H(fe,I.current,a,O,h,y,C,de,ae);if(ye!=null&&(I.current=ye,R(fe)),O==="both")return}if(ss(fe.key,O)){if(Fn(fe),k&&!b&&Ht(fe.currentTarget.ownerDocument)===fe.currentTarget){I.current=Af(fe.key,O,y)?de:ae,R(fe);return}Af(fe.key,O,y)?h?me>=ae?m&&me!==a.current.length?I.current=-1:(V.current=!1,I.current=de):I.current=vo(a.current,{startingIndex:me,disabledIndices:C}):I.current=Math.min(ae,vo(a.current,{startingIndex:me,disabledIndices:C})):h?me<=de?m&&me!==-1?I.current=a.current.length:(V.current=!1,I.current=ae):I.current=vo(a.current,{startingIndex:me,decrement:!0,disabledIndices:C}):I.current=Math.max(de,vo(a.current,{startingIndex:me,decrement:!0,disabledIndices:C})),za(a.current,I.current)&&(I.current=-1),R(fe)}}),Te=v.useMemo(()=>({onFocus(me){V.current=!0,ke(me)},onClick:({currentTarget:me})=>me.focus({preventScroll:!0}),onMouseMove(me){Uy(me)||(V.current=!0,oe.current=!1,E&&ke(me))},onPointerLeave(me){if(!ue.current||!ne.current||me.pointerType==="touch")return;V.current=!0;const de=me.relatedTarget;if(!(!E||a.current.includes(de))&&Re.current&&(ie.current?.(),ie.current=null,I.current=-1,R(me),!b)){const ae=le.current,ye=Ht(Xe(ae));ae&&De(ae,ye)&&ae.focus({preventScroll:!0})}}}),[ke,ue,le,E,a,R,Re,b]),Ee=v.useMemo(()=>b&&k&&_e&&{"aria-activedescendant":`${D}-${r}`},[b,k,_e,D,r]),we=v.useMemo(()=>({...ee?{}:Ee,onKeyDown(fe){if(fe.key==="Tab"&&fe.shiftKey&&k&&!b){const me=bt(fe.nativeEvent);if(me&&!De(le.current,me))return;Fn(fe),j.setOpen(!1,Ke(Ni,fe.nativeEvent)),dt($)&&$.focus();return}Ue(fe)},onPointerMove(fe){Uy(fe)||(ne.current=!0)}}),[Ee,Ue,le,ee,j,k,b,$]),Qe=v.useMemo(()=>{function fe(ae){j.setOpen(!0,Ke(Vf,ae.nativeEvent,ae.currentTarget))}function me(ae){S==="auto"&&ud(ae.nativeEvent)&&(P.current=!b)}function de(ae){P.current=S,S==="auto"&&cd(ae.nativeEvent)&&(P.current=!0)}return{onKeyDown(ae){const ye=j.select("open");ne.current=!1;const Le=ae.key.startsWith("Arrow"),Lt=X1(ae.key,Pe(),y),$t=ss(ae.key,O),Tt=(g?Lt:$t)||ae.key==="Enter"||ae.key.trim()==="";if(b&&ye)return Ue(ae);if(!(!ye&&!T&&Le)){if(Tt){const Se=ss(ae.key,Pe());Q.current=g&&Se?null:ae.key}if(g){Lt&&(Fn(ae),ye?(I.current=xe(),R(ae)):fe(ae));return}$t&&(pe.current!=null&&(I.current=pe.current),Fn(ae),!ye&&T?fe(ae):Ue(ae),ye&&R(ae))}},onFocus(ae){j.select("open")&&!b&&(I.current=-1,R(ae))},onPointerDown:de,onPointerEnter:de,onMouseDown:me,onClick:me}},[Ue,S,xe,g,R,j,T,O,Pe,y,pe,b]),Ae=v.useMemo(()=>({...Ee,...Qe}),[Ee,Qe]);return v.useMemo(()=>f?{reference:Ae,floating:we,item:Te,trigger:Qe}:{},[f,Ae,we,Qe,Te])}function F1(o,l){const{listRef:a,elementsRef:r,activeIndex:c,onMatch:f,disabledIndices:d,onTyping:m,enabled:h=!0,resetMs:g=750,selectedIndex:y=null}=l,b="rootStore"in o?o.rootStore:o,S=b.useState("open"),E=Jt(),T=v.useRef(""),C=v.useRef(y??c??-1),O=v.useRef(null),w=Oe(M=>{function H(le){return r?.current[le]}function U(le){const K=H(le);return K&&!Vs(K)||K?.matches(":disabled")?!1:d==null||!wi(Eo,le,d)}function j(le,K,N=0){if(le.length===0)return-1;const P=(N%le.length+le.length)%le.length,I=K.toLowerCase();for(let Q=0;Q<le.length;Q+=1){const ne=(P+Q)%le.length;if(!(!le[ne]?.toLowerCase().startsWith(I)||!U(ne)))return ne}return-1}const k=a.current;if(T.current.length>0&&M.key===" "&&(Fn(M),m?.(!0)),T.current.length>0&&T.current[0]!==" "&&j(k,T.current)===-1&&M.key!==" "&&m?.(!1),k==null||M.key.length!==1||M.ctrlKey||M.metaKey||M.altKey)return;S&&M.key!==" "&&(Fn(M),m?.(!0));const W=T.current==="";W&&(C.current=y??c??-1),k.every((le,K)=>le&&U(K)?le[0]?.toLowerCase()!==le[1]?.toLowerCase():!0)&&T.current===M.key&&(T.current="",C.current=O.current),T.current+=M.key,E.start(g,()=>{T.current="",C.current=O.current,m?.(!1)});const Y=((W?y??c??-1:C.current)??0)+1,ee=j(k,T.current,Y);ee!==-1?(f?.(ee),O.current=ee):M.key!==" "&&(T.current="",m?.(!1))}),D=Oe(M=>{const H=M.relatedTarget,U=b.select("domReferenceElement"),j=b.select("floatingElement");De(U,H)||De(j,H)||(E.clear(),T.current="",C.current=O.current,m?.(!1))});be(()=>{!S&&y!==null||(E.clear(),O.current=null,T.current!==""&&(T.current=""))},[S,y,E]);const A=v.useMemo(()=>({onKeyDown:w,onBlur:D}),[w,D]);return v.useMemo(()=>h?{reference:A,floating:A}:{},[h,A])}const Ly=.1,Z1=Ly*Ly,ft=.5;function us(o,l,a,r,c,f){return r>=l!=f>=l&&o<=(c-a)*(l-r)/(f-r)+a}function cs(o,l,a,r,c,f,d,m,h,g){let y=!1;return us(o,l,a,r,c,f)&&(y=!y),us(o,l,c,f,d,m)&&(y=!y),us(o,l,d,m,h,g)&&(y=!y),us(o,l,h,g,a,r)&&(y=!y),y}function J1(o,l,a){return o>=a.x&&o<=a.x+a.width&&l>=a.y&&l<=a.y+a.height}function fs(o,l,a,r,c,f){const d=Math.min(a,c),m=Math.max(a,c),h=Math.min(r,f),g=Math.max(r,f);return o>=d&&o<=m&&l>=h&&l<=g}function xb(o={}){const{blockPointerEvents:l=!1}=o,a=new yn,r=({x:c,y:f,placement:d,elements:m,onClose:h,nodeId:g,tree:y})=>{const b=d?.split("-")[0];let S=!1,E=null,T=null,C=typeof performance<"u"?performance.now():0;function O(D,A){const M=performance.now(),H=M-C;if(E===null||T===null||H===0)return E=D,T=A,C=M,!1;const U=D-E,j=A-T,k=U*U+j*j,W=H*H*Z1;return E=D,T=A,C=M,k<W}function w(){a.clear(),h()}return function(A){a.clear();const M=m.domReference,H=m.floating;if(!M||!H||b==null||c==null||f==null)return;const{clientX:U,clientY:j}=A,k=bt(A),W=A.type==="mouseleave",$=De(H,k),F=De(M,k);if($&&(S=!0,!W))return;if(F&&(S=!1,!W)){S=!0;return}if(W&&Je(A.relatedTarget)&&De(H,A.relatedTarget))return;function Y(){return!!(y&&rl(y.nodesRef.current,g).length>0)}function ee(){Y()||w()}if(Y())return;const le=M.getBoundingClientRect(),K=H.getBoundingClientRect(),N=c>K.right-K.width/2,P=f>K.bottom-K.height/2,I=K.width>le.width,Q=K.height>le.height,ne=(I?le:K).left,R=(I?le:K).right,B=(Q?le:K).top,J=(Q?le:K).bottom;if(b==="top"&&f>=le.bottom-1||b==="bottom"&&f<=le.top+1||b==="left"&&c>=le.right-1||b==="right"&&c<=le.left+1){ee();return}let V=!1;switch(b){case"top":V=fs(U,j,ne,le.top+1,R,K.bottom-1);break;case"bottom":V=fs(U,j,ne,K.top+1,R,le.bottom-1);break;case"left":V=fs(U,j,K.right-1,J,le.left+1,B);break;case"right":V=fs(U,j,le.right-1,J,K.left+1,B);break}if(V)return;if(S&&!J1(U,j,le)){ee();return}if(!W&&O(U,j)){ee();return}let oe=!1;switch(b){case"top":{const ie=I?ft/2:ft*4,he=I||N?c+ie:c-ie,ue=I?c-ie:N?c+ie:c-ie,pe=f+ft+1,Re=N||I?K.bottom-ft:K.top,ze=N?I?K.bottom-ft:K.top:K.bottom-ft;oe=cs(U,j,he,pe,ue,pe,K.left,Re,K.right,ze);break}case"bottom":{const ie=I?ft/2:ft*4,he=I||N?c+ie:c-ie,ue=I?c-ie:N?c+ie:c-ie,pe=f-ft,Re=N||I?K.top+ft:K.bottom,ze=N?I?K.top+ft:K.bottom:K.top+ft;oe=cs(U,j,he,pe,ue,pe,K.left,Re,K.right,ze);break}case"left":{const ie=Q?ft/2:ft*4,he=Q||P?f+ie:f-ie,ue=Q?f-ie:P?f+ie:f-ie,pe=c+ft+1,Re=P||Q?K.right-ft:K.left,ze=P?Q?K.right-ft:K.left:K.right-ft;oe=cs(U,j,Re,K.top,ze,K.bottom,pe,he,pe,ue);break}case"right":{const ie=Q?ft/2:ft*4,he=Q||P?f+ie:f-ie,ue=Q?f-ie:P?f+ie:f-ie,pe=c-ft,Re=P||Q?K.left+ft:K.right,ze=P?Q?K.left+ft:K.right:K.left+ft;oe=cs(U,j,pe,he,pe,ue,Re,K.top,ze,K.bottom);break}}oe?S||a.start(40,ee):ee()}};return r.__options={...o,blockPointerEvents:l},r}const W1={...Pd,disabled:o=>o.disabled,instantType:o=>o.instantType,isInstantPhase:o=>o.isInstantPhase,trackCursorAxis:o=>o.trackCursorAxis,disableHoverablePopup:o=>o.disableHoverablePopup,lastOpenChangeReason:o=>o.openChangeReason,closeOnClick:o=>o.closeOnClick,closeDelay:o=>o.closeDelay,adaptiveOrigin:o=>o.adaptiveOrigin};class $1 extends Ia{constructor(l,a,r){const c=new Yd;super(eR(l,c,a,r),tR(c),W1)}setOpen=(l,a)=>{B1(this,l,a,{extraState:{openChangeReason:a.reason}})};cancelPendingOpen(l){this.state.floatingRootContext.dispatchOpenChange(!1,Ke(_i,l))}}function eR(o,l,a,r=!1){return{...Id(l,a,r),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...o}}function tR(o){return{popupRef:v.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:o}}const nR=Ds(function(l){const{disabled:a=!1,defaultOpen:r=!1,open:c,disableHoverablePopup:f=!1,trackCursorAxis:d="none",actionsRef:m,onOpenChange:h,onOpenChangeComplete:g,handle:y,triggerId:b,defaultTriggerId:S=null,children:E}=l,T=db((F,Y)=>new $1({open:r,openProp:c,activeTriggerId:S,triggerIdProp:b},F,Y));T.useControlledProp("openProp",c),T.useControlledProp("triggerIdProp",b),T.useContextCallback("onOpenChange",h),T.useContextCallback("onOpenChangeComplete",g);const C=T.useState("open"),O=!a&&C,w=T.useState("activeTriggerId"),D=T.useState("mounted"),A=T.useState("payload");T.useSyncedValues({trackCursorAxis:d,disableHoverablePopup:f,disabled:a}),Ud(T,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:M,transitionStatus:H}=Ld(O,T),U=T.useState("isInstantPhase"),j=T.useState("instantType"),k=T.useState("lastOpenChangeReason"),W=v.useRef(null);be(()=>{C&&a&&T.setOpen(!1,Ke(xv))},[C,a,T]),be(()=>{H==="ending"&&k===qs||H!=="ending"&&U?(j!=="delay"&&(W.current=j),T.set("instantType","delay")):W.current!==null&&(T.set("instantType",W.current),W.current=null)},[H,U,k,j,T]),be(()=>{O&&w==null&&T.set("payload",void 0)},[T,w,O]),v.useImperativeHandle(m,()=>({unmount:M,close:()=>T.setOpen(!1,Ke(vd))}),[M,T]);const $=O||D||!a&&d!=="none";return z.jsxs(pv.Provider,{value:T,children:[y&&z.jsx(jd,{handle:y,store:T}),$&&z.jsx(oR,{store:T,disabled:a,trackCursorAxis:d}),typeof E=="function"?E({payload:A}):E]})});function oR({store:o,disabled:l,trackCursorAxis:a}){const r=o.useState("floatingRootContext"),c=Dd(r,{enabled:!l,referencePress:()=>o.select("closeOnClick")}),f=UE(r,{enabled:!l&&a!=="none",axis:a==="none"?void 0:a}),d=v.useMemo(()=>To(f.reference,c.reference),[f.reference,c.reference]);return Bd(o,{activeTriggerProps:d,inactiveTriggerProps:d,popupProps:c.floating??Ct}),null}function Bl(o){return jl(o,"base-ui")}const Tb=v.createContext(void 0);function lR(){return v.useContext(Tb)}const iR=600,Eb="data-base-ui-tooltip-trigger";function By(o){if("composedPath"in o){const a=o.composedPath();for(let r=0;r<a.length;r+=1){const c=a[r];if(Je(c))return c}}const l=o.target;return Je(l)?l:null}function aR(o){let l=o;for(;l;){const a=l.closest(`[${Eb}]`);if(a)return a;const r=l.getRootNode();l="host"in r&&Je(r.host)?r.host:null}return null}const rR=dv(function(l,a){const{render:r,className:c,style:f,handle:d,payload:m,disabled:h,delay:g,closeOnClick:y=!0,closeDelay:b,id:S,...E}=l,T=Ns(!0),O=mb(d)??T;if(!O)throw new Error(Qt(82));const w=Bl(S),D=O.useState("isTriggerActive",w),A=O.useState("isOpenedByTrigger",w),M=O.useState("floatingRootContext"),H=v.useRef(null),U=b??0,{registerTrigger:j,isMountedByThisTrigger:k}=hb(w,H,O,{payload:m,closeOnClick:y,closeDelay:U}),W=lR(),{activeIdRef:$,delayRef:F,isInstantPhase:Y,hasProvider:ee}=DT(M,{open:A}),le=Gd(M);O.useSyncedValue("isInstantPhase",Y);const K=O.useState("disabled"),N=h??K,P=jt(N),I=O.useState("trackCursorAxis"),Q=O.useState("disableHoverablePopup"),ne=v.useRef(!1),R=Jt(),B=v.useRef(void 0);function J(){return ee&&$.current!=null?0:g??W??iR}function V(ge){const _e=H.current;if(!_e||!ge)return!1;const ke=aR(ge);return ke!==null&&ke!==_e&&De(_e,ke)}function oe(ge){const _e=V(ge);return ne.current=_e,_e&&(le.openChangeTimeout.clear(),le.restTimeout.clear(),le.restTimeoutPending=!1,R.clear()),_e}const ie=Sb(M,{enabled:!N,mouseOnly:!0,move:!1,handleClose:!Q&&I!=="both"?xb():null,restMs:J,delay(){return b==null&&ee?{close:zl(F.current,"close")}:{close:U}},triggerElementRef:H,isActiveTrigger:D,isClosing:()=>O.select("transitionStatus")==="ending",shouldOpen(){return!ne.current}}),he=yb(M,{enabled:!N}).reference,ue=ge=>{const _e=ne.current,ke=By(ge),Pe=oe(ke),xe=H.current,Ue=xe&&ke&&De(xe,ke);if(Pe&&O.select("open")&&O.select("lastOpenChangeReason")===Ut){O.setOpen(!1,Ke(Ut,ge));return}if(_e&&!Pe&&Ue&&!P.current&&!O.select("open")&&xe&&ll(B.current)){const Te=()=>{!ne.current&&!P.current&&!O.select("open")&&O.setOpen(!0,Ke(Ut,ge,xe))},Ee=J();Ee===0?(R.clear(),Te()):R.start(Ee,Te)}},pe=O.useState("triggerProps",k);return St("button",l,{state:{open:A},ref:[a,j,H],props:[ie,he,k||I!=="none"?pe:void 0,{onMouseOver(ge){ue(ge.nativeEvent)},onFocus(ge){V(By(ge.nativeEvent))&&ge.preventBaseUIHandler()},onMouseLeave(){ne.current=!1,R.clear(),B.current=void 0},onPointerEnter(ge){B.current=ge.pointerType},onPointerDown(ge){B.current=ge.pointerType,O.set("closeOnClick",y),y&&!O.select("open")&&O.cancelPendingOpen(ge.nativeEvent)},onClick(ge){y&&!O.select("open")&&O.cancelPendingOpen(ge.nativeEvent)},id:w,[If]:N?"":void 0,[Eb]:N?void 0:""},E],stateAttributesMapping:xT})}),Rb=v.createContext(void 0);function sR(){const o=v.useContext(Rb);if(o===void 0)throw new Error(Qt(70));return o}const Cb=v.forwardRef(function(l,a){const{children:r,container:c,className:f,render:d,style:m,...h}=l,{node:g,subtree:y}=Kv({container:c,ref:a,componentProps:l,elementProps:h});return!y&&!g?null:z.jsxs(v.Fragment,{children:[y,g&&qn.createPortal(r,g)]})}),uR=v.forwardRef(function(l,a){const{keepMounted:r=!1,...c}=l;return Ns().useState("mounted")||r?z.jsx(Rb.Provider,{value:r,children:z.jsx(Cb,{ref:a,...c})}):null}),Ob=v.createContext(void 0);function cR(){const o=v.useContext(Ob);if(o===void 0)throw new Error(Qt(71));return o}const fR=v.createContext(void 0);function Xd(){return v.useContext(fR)?.direction??"ltr"}const dR=o=>({name:"arrow",options:o,async fn(l){const{x:a,y:r,placement:c,rects:f,platform:d,elements:m,middlewareData:h}=l,{element:g,padding:y=0,offsetParent:b="real"}=al(o,l)||{};if(g==null)return{};const S=wv(y),E={x:a,y:r},T=Td(c),C=xd(T),O=await d.getDimensions(g),w=T==="y",D=w?"top":"left",A=w?"bottom":"right",M=w?"clientHeight":"clientWidth",H=f.reference[C]+f.reference[T]-E[T]-f.floating[C],U=E[T]-f.reference[T],j=b==="real"?await d.getOffsetParent?.(g):m.floating;let k=m.floating[M]||f.floating[C];(!k||!await d.isElement?.(j))&&(k=m.floating[M]||f.floating[C]);const W=H/2-U/2,$=k/2-O[C]/2-1,F=Math.min(S[D],$),Y=Math.min(S[A],$),ee=F,le=k-O[C]-Y,K=k/2-O[C]/2+W,N=Ov(ee,K,le),P=!h.arrow&&Co(c)!=null&&K!==N&&f.reference[C]/2-(K<ee?F:Y)-O[C]/2<0,I=P?K<ee?K-ee:K-le:0;return{[T]:E[T]+I,data:{[T]:N,centerOffset:K-N-I,...P&&{alignmentOffset:I}},reset:P}}}),pR=(o,l)=>{const{name:a,fn:r}=dR(o);return{name:a,fn:r,options:[o,l]}},hR={name:"hide",async fn(o){const{width:l,height:a,x:r,y:c}=o.rects.reference,f=l===0&&a===0&&r===0&&c===0,d=await o.platform.detectOverflow(o,{elementContext:"reference"});return{data:{referenceHidden:d.top-a>=0||d.right-l>=0||d.bottom-a>=0||d.left-l>=0||f}}}},gR={sideX:"left",sideY:"top"},mR="--available-width",yR="--available-height",vR="--anchor-width",bR="--anchor-height",SR="--transform-origin",Yy=mR,Iy=yR;function wb(o,l,a){const r=o==="inline-start"||o==="inline-end";return{top:"top",right:r?a?"inline-start":"inline-end":"right",bottom:"bottom",left:r?a?"inline-end":"inline-start":"left"}[l]}function qy(o,l,a){const{rects:r,placement:c}=o;return{side:wb(l,_n(c),a),align:Co(c)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Ab(o){return xR(o,q1)}function xR(o,l){const{anchor:a,positionMethod:r="absolute",side:c="bottom",sideOffset:f=0,align:d="center",alignOffset:m=0,collisionBoundary:h,collisionPadding:g=5,sticky:y=!1,arrowPadding:b=5,disableAnchorTracking:S=!1,inline:E,keepMounted:T=!1,floatingRootContext:C,mounted:O,collisionAvoidance:w,shift:D,nodeId:A,adaptiveOrigin:M,lazyFlip:H=!1,externalTree:U}=o,[j,k]=v.useState(null);!O&&j!==null&&k(null);const W=w.side||"flip",$=w.align||"flip",F=w.fallbackAxisSide||"end",Y=D?.crossAxis??!1,ee=D?.rootBoundary,le=typeof a=="function"?a:void 0,K=Oe(le),N=le?K:a,P=jt(a),I=jt(O),ne=Xd()==="rtl",R=j||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":ne?"left":"right","inline-start":ne?"right":"left"}[c],B=d==="center"?R:`${R}-${d}`;let J=g;typeof J=="number"?J={top:J,right:J,bottom:J,left:J}:J&&(J={top:J.top||0,right:J.right||0,bottom:J.bottom||0,left:J.left||0});const V=1,oe=c==="bottom"?V:0,ie=c==="top"?V:0,he=c==="right"?V:0,ue=c==="left"?V:0,pe={boundary:h==="clipping-ancestors"?"clippingAncestors":h,padding:J},Re=v.useRef(null),ze=jt(f),ve=jt(m),ge=typeof f!="function"?f:0,_e=typeof m!="function"?m:0,ke=[];E&&ke.push(E),ke.push(S1(Ge=>{const xt=qy(Ge,c,ne),It=typeof ze.current=="function"?ze.current(xt):ze.current,Mt=typeof ve.current=="function"?ve.current(xt):ve.current;return{mainAxis:It,crossAxis:Mt,alignmentAxis:Mt}},[ge,_e,ne,c]));const Pe=$==="none"&&W!=="shift",xe=!Pe&&(y||Y||W==="shift"),Ue=W==="none"?null:E1({...pe,padding:{top:J.top+V+oe,right:J.right+V+ue,bottom:J.bottom+V+ie,left:J.left+V+he},mainAxis:!Y&&W==="flip",crossAxis:$==="flip"?"alignment":!1,fallbackAxisSideDirection:F}),Te=Pe?null:x1({...pe,rootBoundary:ee,mainAxis:$!=="none",crossAxis:xe,limiter:y||Y?void 0:T1(Ge=>{if(!Re.current)return{};const{width:xt,height:It}=Re.current.getBoundingClientRect(),Mt=zn(_n(Ge.placement)),Vn=Mt==="y"?xt:It,en=Mt==="y"?J.left+J.right:J.top+J.bottom;return{offset:Vn/2+en/2}})},[pe,y,Y,ee,J,$]);W==="shift"||$==="shift"||d==="center"?ke.push(Te,Ue):ke.push(Ue,Te),ke.push(R1({...pe,apply({elements:{floating:Ge},availableWidth:xt,availableHeight:It,rects:Mt}){if(!I.current)return;const Vn=Ge.style;Vn.setProperty(Yy,`${xt}px`),Vn.setProperty(Iy,`${It}px`);const en=yt(Ge).devicePixelRatio||1,{x:Ao,y:xn,width:Il,height:kn}=Mt.reference,Mo=(Math.round((Ao+Il)*en)-Math.round(Ao*en))/en,Do=(Math.round((xn+kn)*en)-Math.round(xn*en))/en;Vn.setProperty(vR,`${Mo}px`),Vn.setProperty(bR,`${Do}px`)}}),pR(Ge=>({element:Re.current||Xe(Ge.elements.floating).createElement("div"),padding:Re.current?b:0,offsetParent:"floating"}),[b]),{name:"transformOrigin",fn(Ge){const{elements:{floating:xt},middlewareData:It,placement:Mt,platform:Vn,rects:en,y:Ao}=Ge,xn=_n(Mt),Il=Co(Mt),kn=zn(xn)==="y",Mo=Re.current,Do=typeof f=="function"?f(qy(Ge,c,ne)):f;let No;if(!Mo&&Il&&Math.abs(kn?It.shift?.x||0:It.shift?.y||0)<=1)No=Il==="start"===(kn&&Vn.isRTL?.(xt)===!0)?"100%":"0%";else{const Pa=kn?It.arrow?.x||0:It.arrow?.y||0,Va=kn?Mo?.clientWidth||0:Mo?.clientHeight||0;No=`${Pa+Va/2}px`}let dl=xn==="top"||xn==="left"?`calc(100% + ${Do}px)`:`${-Do}px`;return xe&&kn&&Math.abs(It.shift?.y||0)>Do&&(dl=`${en.reference.y+en.reference.height/2-Ao}px`),xt.style.setProperty(SR,kn?`${No} ${dl}`:`${dl} ${No}`),{}}},hR,M),be(()=>{!O&&C&&C.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[O,C]);const Ee=v.useMemo(()=>({ancestorScroll:!S,elementResize:!S&&typeof ResizeObserver<"u",layoutShift:!S&&typeof IntersectionObserver<"u"}),[S]),{refs:we,elements:Qe,x:Ae,y:fe,middlewareData:me,update:de,placement:ae,context:ye,isPositioned:Le,floatingStyles:Lt}=l({rootContext:C,open:T?O:void 0,placement:B,middleware:ke,strategy:r,whileElementsMounted:T?void 0:(...Ge)=>My(...Ge,Ee),nodeId:A,externalTree:U}),{sideX:$t,sideY:Tt}=me.adaptiveOrigin||gR,Se=Le?r:"fixed",Ie=v.useMemo(()=>{let Ge;return Le?M?Ge={position:Se,[$t]:Ae,[Tt]:fe}:Ge={...Lt,position:Se}:Ge={position:Se,top:0,left:0},Ge[Yy]="100vw",Ge[Iy]="100vh",Le||(Ge.opacity=0),Ge},[M,Se,$t,Ae,Tt,fe,Lt,Le]),tt=v.useRef(null);be(()=>{if(!O)return;const Ge=P.current,xt=typeof Ge=="function"?Ge():Ge,Mt=(Py(xt)?xt.current:xt)||null||null;Mt!==tt.current&&(we.setPositionReference(Mt),tt.current=Mt)},[O,we,N,P]),v.useEffect(()=>{if(!O)return;const Ge=P.current;typeof Ge!="function"&&Py(Ge)&&Ge.current!==tt.current&&(we.setPositionReference(Ge.current),tt.current=Ge.current)},[O,we,N,P]),v.useEffect(()=>{if(T&&O&&Qe.reference&&Qe.floating)return My(Qe.reference,Qe.floating,de,Ee)},[T,O,Qe,de,Ee]);const pt=_n(ae),bn=wb(c,pt,ne),Hn=Co(ae)||"center",Sn=!!me.hide?.referenceHidden;be(()=>{H&&O&&Le&&pt!==R&&k(pt)},[H,O,Le,pt,R]);const At=v.useMemo(()=>({position:"absolute",top:me.arrow?.y,left:me.arrow?.x}),[me.arrow]),jn=me.arrow?.centerOffset!==0;return v.useMemo(()=>({positionerStyles:Ie,arrowStyles:At,arrowRef:Re,arrowUncentered:jn,side:bn,align:Hn,physicalSide:pt,anchorHidden:Sn,refs:we,context:ye,isPositioned:Le,update:de}),[Ie,At,Re,jn,bn,Hn,pt,Sn,we,ye,Le,de])}function Py(o){return o!=null&&"current"in o}function Kd(o){return o==="starting"?TE:Ct}function Mb(o,l,{styles:a,transitionStatus:r,props:c,refs:f,hidden:d,inert:m=!1}){const h={...a};return m&&(h.pointerEvents="none"),St("div",o,{state:l,ref:f,props:[{role:"presentation",hidden:d,style:h},Kd(r),c],stateAttributesMapping:gd})}const TR=v.forwardRef(function(l,a){const{render:r,className:c,anchor:f,positionMethod:d="absolute",side:m="top",align:h="center",sideOffset:g=0,alignOffset:y=0,collisionBoundary:b="clipping-ancestors",collisionPadding:S=5,arrowPadding:E=5,sticky:T=!1,disableAnchorTracking:C=!1,collisionAvoidance:O=Vv,style:w,...D}=l,A=Ns(),M=sR(),H=A.useState("open"),U=A.useState("mounted"),j=A.useState("trackCursorAxis"),k=A.useState("disableHoverablePopup"),W=A.useState("floatingRootContext"),$=A.useState("instantType"),F=A.useState("transitionStatus"),Y=A.useState("adaptiveOrigin"),ee=Ab({anchor:f,positionMethod:d,floatingRootContext:W,mounted:U,side:m,sideOffset:g,align:h,alignOffset:y,collisionBoundary:b,collisionPadding:S,sticky:T,arrowPadding:E,disableAnchorTracking:C,keepMounted:M,collisionAvoidance:O,adaptiveOrigin:Y}),le=v.useMemo(()=>({open:H,side:ee.side,align:ee.align,anchorHidden:ee.anchorHidden,instant:j!=="none"?"tracking-cursor":$}),[H,ee.side,ee.align,ee.anchorHidden,j,$]),K=Mb(l,le,{styles:ee.positionerStyles,transitionStatus:F,props:D,refs:[a,A.useStateSetter("positionerElement")],hidden:!U,inert:!H||j==="both"||k});return z.jsx(Ob.Provider,{value:ee,children:K})}),ER=v.forwardRef(function(l,a){const{render:r,className:c,style:f,...d}=l,m=Ns(),{side:h,align:g}=cR(),y=m.useState("open"),b=m.useState("instantType"),S=m.useState("transitionStatus"),E=m.useState("popupProps"),T=m.useState("floatingRootContext"),C=m.useState("disabled"),O=m.useState("closeDelay");Hi({open:y,ref:m.context.popupRef,onComplete(){y&&m.context.onOpenChangeComplete?.(!0)}}),bb(T,{enabled:!C,closeDelay:O});const w=m.useStateSetter("popupElement");return St("div",l,{state:{open:y,side:h,align:g,instant:b,transitionStatus:S},ref:[a,m.context.popupRef,w],props:[Hd,E,Kd(S),d],stateAttributesMapping:md})}),RR=function(l){const{delay:a,closeDelay:r,timeout:c=400}=l,f=v.useMemo(()=>({open:a,close:r}),[a,r]);return z.jsx(Tb.Provider,{value:a,children:z.jsx(MT,{delay:f,timeoutMs:c,children:l.children})})};function Ks(o){return Cd(19)?o:o?"true":void 0}function Db({label:o,shortcut:l,side:a="bottom",children:r}){return z.jsxs(nR,{children:[z.jsx(rR,{render:r}),z.jsx(uR,{children:z.jsx(TR,{side:a,sideOffset:6,className:"z-[1000]",children:z.jsxs(ER,{className:"rounded-md bg-fg px-2 py-1 text-xs text-surface shadow-popup data-[starting-style]:opacity-0 data-[ending-style]:opacity-0 transition-opacity",children:[o,l?z.jsx("span",{className:"ml-2 opacity-60",children:l}):null]})})})]})}function CR({children:o}){return z.jsx(RR,{delay:500,closeDelay:0,children:o})}function OR(o){return o.repeat&&(o.key==="Enter"||o.key===" ")}function Ms(o){OR(o)&&o.target===o.currentTarget&&o.preventDefault()}function Nb(o){return o?l=>{Ms(l),o(l)}:Ms}const wR=200,AR=2e3;function MR(o,l,a){let r=null,c=!1;const f=()=>{c||(c=!0,o.removeEventListener("keydown",d,!0),o.removeEventListener("keyup",d,!0),o.clearTimeout(m),r!==null&&o.clearTimeout(r))},d=h=>{const g=h.key==="Enter"||h.key===" ";if(h.type==="keyup"){h.key===" "&&!a(h.target)&&h.preventDefault(),h.key===l&&r===null&&(r=o.setTimeout(f,wR));return}g&&!a(h.target)&&(h.preventDefault(),h.stopImmediatePropagation())},m=o.setTimeout(f,AR);return o.addEventListener("keydown",d,!0),o.addEventListener("keyup",d,!0),f}const DR={primary:"bg-accent text-accent-fg hover:brightness-110 active:brightness-95",secondary:"bg-surface text-fg border border-line hover:bg-hover",ghost:"bg-transparent text-fg hover:bg-hover",danger:"bg-danger text-white hover:brightness-110"},NR={sm:"h-6 px-2 text-xs gap-1",md:"h-7 px-2.5 text-[13px] gap-1.5",lg:"h-8 px-3 text-[13px] gap-2"},sl=v.forwardRef(function({variant:l="secondary",size:a="md",icon:r,className:c,children:f,type:d="button",onKeyDown:m,...h},g){return z.jsxs("button",{ref:g,type:d,className:Oo("inline-flex shrink-0 select-none items-center justify-center whitespace-nowrap rounded-control font-medium transition-[background,filter]","focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-accent","disabled:pointer-events-none disabled:opacity-45",DR[l],NR[a],c),...h,onKeyDown:Nb(m),children:[r,f]})}),zR={sm:"size-6",md:"size-7",lg:"size-8"},_R=v.forwardRef(function({label:l,icon:a,shortcut:r,active:c,size:f="md",noTooltip:d,className:m,type:h="button",onKeyDown:g,...y},b){const S=z.jsx("button",{ref:b,type:h,"aria-label":l,"aria-pressed":c===void 0?void 0:c,className:Oo("inline-flex shrink-0 items-center justify-center rounded-control text-fg-muted transition-colors","hover:bg-hover hover:text-fg focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-accent","disabled:pointer-events-none disabled:opacity-40",c&&"bg-accent-soft text-accent hover:bg-accent-soft hover:text-accent",zR[f],m),...y,onKeyDown:Nb(g),children:a});return d?S:z.jsx(Db,{label:l,shortcut:r,children:S})}),zb=v.createContext(void 0);function _b(o){const l=v.useContext(zb);if(l===void 0&&!o)throw new Error(Qt(33));return l}const Hb=v.createContext(void 0);function ji(o){const l=v.useContext(Hb);if(l===void 0&&!o)throw new Error(Qt(36));return l}const HR=v.createContext(void 0);function Qd(o=!0){const l=v.useContext(HR);if(l===void 0&&!o)throw new Error(Qt(25));return l}function jR({controlled:o,default:l,name:a,state:r="value"}){const{current:c}=v.useRef(o!==void 0),[f,d]=v.useState(l),m=c&&o!==void 0?o:f,h=v.useCallback(g=>{c||d(g)},[]);return[m,h]}const jb=v.createContext(void 0);function Qs(o=!1){const l=v.useContext(jb);if(l===void 0&&!o)throw new Error(Qt(16));return l}function kR(o){const{focusableWhenDisabled:l,disabled:a,composite:r=!1,tabIndex:c=0,isNativeButton:f}=o,d=r&&l!==!1,m=r&&l===!1;return{props:v.useMemo(()=>{const g={onKeyDown(y){a&&l&&y.key!=="Tab"&&y.preventDefault()}};return r||(g.tabIndex=c,!f&&a&&(g.tabIndex=l?c:-1)),(f&&(l||d)||!f&&a)&&(g["aria-disabled"]=a),f&&(!l||m)&&(g.disabled=a),g},[r,a,l,d,m,f,c])}}function vs(o,l,{detail:a=0}={}){o.dispatchEvent(new(yt(o)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:a,shiftKey:l.shiftKey,ctrlKey:l.ctrlKey,altKey:l.altKey,metaKey:l.metaKey}))}function qa(o={}){const{disabled:l=!1,focusableWhenDisabled:a,tabIndex:r=0,native:c=!0,composite:f}=o,d=v.useRef(null),m=Qs(!0),h=f??m!==void 0,{props:g}=kR({focusableWhenDisabled:a,disabled:l,composite:h,tabIndex:r,isNativeButton:c}),y=v.useCallback(()=>{const E=d.current;Mf(E)&&h&&l&&g.disabled===void 0&&E.disabled&&(E.disabled=!1)},[l,g.disabled,h]);be(y,[y]);const b=v.useCallback((E={})=>{const{onClick:T,onMouseDown:C,onKeyUp:O,onKeyDown:w,onPointerDown:D,...A}=E;return To({onClick(M){if(l){M.preventDefault();return}T?.(M)},onMouseDown(M){l||C?.(M)},onKeyDown(M){if(l||(Cs(M),w?.(M),M.baseUIHandlerPrevented))return;const H=M.target===M.currentTarget,U=M.currentTarget,j=Mf(U),k=!c&&UR(U),W=H&&(c?j:!k),$=M.key==="Enter",F=M.key===" ",Y=U.getAttribute("role"),ee=Y?.startsWith("menuitem")||Y==="option"||Y==="gridcell";if(H&&h&&F){if(M.defaultPrevented&&ee)return;M.preventDefault(),(!c||j)&&(M.preventBaseUIHandler(),vs(U,M));return}if(!W||c||!F&&!$){H&&k&&F&&M.preventDefault();return}M.defaultPrevented||(M.preventDefault(),$&&(M.preventBaseUIHandler(),vs(U,M)))},onKeyUp(M){if(!l){if(Cs(M),O?.(M),M.target===M.currentTarget&&c&&h&&Mf(M.currentTarget)&&M.key===" "){M.preventDefault();return}M.baseUIHandlerPrevented||M.target===M.currentTarget&&!c&&!h&&!M.defaultPrevented&&M.key===" "&&(M.preventBaseUIHandler(),vs(M.currentTarget,M))}},onPointerDown(M){if(l){M.preventDefault();return}D?.(M)}},c?{type:"button"}:{role:"button"},g,A)},[l,g,h,c]),S=Oe(E=>{d.current=E,y()});return{getButtonProps:b,buttonRef:S}}function Mf(o){return dt(o)&&o.tagName==="BUTTON"}function UR(o){return dt(o)&&o.tagName==="A"&&!!o.href}function LR(o){const{closeOnClick:l,highlighted:a,id:r,nodeId:c,store:f,typingRef:d,itemRef:m,itemMetadata:h}=o,{events:g}=f.useState("floatingTreeRoot"),y=f.useState("open"),b=Qd(!0),S=b!==void 0;return v.useMemo(()=>({id:r,role:"menuitem",tabIndex:y&&a?0:-1,onKeyDown(E){E.key===" "&&d?.current&&E.preventDefault()},onMouseMove(E){c&&g.emit("itemhover",{nodeId:c,target:E.currentTarget})},onClick(E){l&&g.emit("close",{domEvent:E,reason:Sv})},onMouseUp(E){if(b){const T=b.initialCursorPointRef.current;if(b.initialCursorPointRef.current=null,S&&T&&Math.abs(E.clientX-T.x)<=1&&Math.abs(E.clientY-T.y)<=1||S&&!rd&&E.button===2)return}m.current&&f.context.allowMouseUpTriggerRef.current&&(!S||E.button===2)&&h.type==="regular-item"&&vs(m.current,E,{detail:1})}}),[l,a,r,g,c,y,f,d,m,b,S,h])}const BR={type:"regular-item"};function YR(o){const{closeOnClick:l,disabled:a,highlighted:r,id:c,store:f,typingRef:d=f.context.typingRef,nativeButton:m,itemMetadata:h,nodeId:g}=o,y=v.useRef(null),{getButtonProps:b,buttonRef:S}=qa({disabled:a,focusableWhenDisabled:!0,native:m,composite:!0}),E=LR({closeOnClick:l,highlighted:r,id:c,nodeId:g,store:f,typingRef:d,itemRef:y,itemMetadata:h}),T=v.useCallback(O=>To(E,{onMouseEnter(){h.type==="submenu-trigger"&&h.setActive()}},O,b),[E,b,h]),C=_l(y,S);return v.useMemo(()=>({getItemProps:T,itemRef:C}),[T,C])}const kb=v.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function IR(){return v.useContext(kb)}function Fd(o={}){const{guess:l,label:a,metadata:r,textRef:c,index:f}=o,{register:d,unregister:m,subscribeMapChange:h,nextIndexRef:g}=IR(),y=v.useRef(-1),[b,S]=v.useState(f==null&&l?()=>{if(y.current===-1){const O=g.current;g.current+=1,y.current=O}return y.current}:-1),E=f??b,T=v.useRef(null),C=v.useCallback(O=>{const w=T.current;w&&m(w),T.current=O,O&&d(O,{metadata:r??null,index:f??null,label:a,textRef:c})},[f,d,m,r,a,c]);return be(()=>{if(f==null)return h(O=>{const w=T.current?O.get(T.current)?.index:null;w!=null&&S(w)})},[f,h]),{ref:C,index:E}}const qR=v.forwardRef(function(l,a){const{render:r,className:c,id:f,label:d,nativeButton:m=!1,disabled:h=!1,closeOnClick:g=!0,style:y,...b}=l,S=Fd({guess:!0,label:d}),E=_b(!0),T=Bl(f),{store:C}=ji(),O=C.useState("disabled"),w=h||O,D=C.useState("isActive",S.index),A=C.useState("itemProps"),{getItemProps:M,itemRef:H}=YR({closeOnClick:g,disabled:w,highlighted:D,id:T,store:C,nativeButton:m,nodeId:E?.context.nodeId,itemMetadata:BR});return St("div",l,{state:{disabled:w,highlighted:D},props:[A,b,M],ref:[H,a,S.ref]})}),PR=v.createContext(void 0);function VR(o){return v.useContext(PR)}const Zf="ArrowUp",Jf="ArrowDown",Wf="ArrowLeft",$f="ArrowRight",ed="Home",td="End",Zd=new Set([Zf,Jf,Wf,$f,ed,td]),GR="Shift",XR=[GR,"Control","Alt","Meta"];function KR(o){return dt(o)&&o.tagName==="INPUT"}function Vy(o){return!!(KR(o)&&o.selectionStart!=null||dt(o)&&o.tagName==="TEXTAREA")}function Gy(o,l,a,r){if(!o||!l||!l.scrollTo)return;let c=o.scrollLeft,f=o.scrollTop;const d=o.clientWidth<o.scrollWidth,m=o.clientHeight<o.scrollHeight;if(d&&r!=="vertical"){const h=Xy(o,l,"left"),g=ds(o),y=ds(l);a==="ltr"&&(h+l.offsetWidth+y.scrollMarginRight>o.scrollLeft+o.clientWidth-g.scrollPaddingRight?c=h+l.offsetWidth+y.scrollMarginRight-o.clientWidth+g.scrollPaddingRight:h-y.scrollMarginLeft<o.scrollLeft+g.scrollPaddingLeft&&(c=h-y.scrollMarginLeft-g.scrollPaddingLeft)),a==="rtl"&&(h-y.scrollMarginLeft<o.scrollLeft+g.scrollPaddingLeft?c=h-y.scrollMarginLeft-g.scrollPaddingLeft:h+l.offsetWidth+y.scrollMarginRight>o.scrollLeft+o.clientWidth-g.scrollPaddingRight&&(c=h+l.offsetWidth+y.scrollMarginRight-o.clientWidth+g.scrollPaddingRight))}if(m&&r!=="horizontal"){const h=Xy(o,l,"top"),g=ds(o),y=ds(l);h-y.scrollMarginTop<o.scrollTop+g.scrollPaddingTop?f=h-y.scrollMarginTop-g.scrollPaddingTop:h+l.offsetHeight+y.scrollMarginBottom>o.scrollTop+o.clientHeight-g.scrollPaddingBottom&&(f=h+l.offsetHeight+y.scrollMarginBottom-o.clientHeight+g.scrollPaddingBottom)}o.scrollTo({left:c,top:f,behavior:"auto"})}function Xy(o,l,a){const r=a==="left"?"offsetLeft":"offsetTop";let c=0;for(;l.offsetParent&&(c+=l[r],l.offsetParent!==o);)l=l.offsetParent;return c}function ds(o){const l=getComputedStyle(o);return{scrollMarginTop:parseFloat(l.scrollMarginTop)||0,scrollMarginRight:parseFloat(l.scrollMarginRight)||0,scrollMarginBottom:parseFloat(l.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(l.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(l.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(l.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(l.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(l.scrollPaddingLeft)||0}}const QR=v.forwardRef(function(l,a){const{render:r,className:c,style:f,finalFocus:d,...m}=l,{store:h}=ji(),{side:g,align:y}=_b(),b=VR()!=null,S=h.useState("open"),E=h.useState("transitionStatus"),T=h.useState("popupProps"),C=h.useState("mounted"),O=h.useState("instantType"),w=h.useState("activeTriggerElement"),D=h.useState("parent"),A=h.useState("lastOpenChangeReason"),M=h.useState("rootId"),H=h.useState("floatingRootContext"),U=h.useState("floatingTreeRoot"),j=h.useState("closeDelay"),k=h.useState("hoverEnabled"),W=h.useState("disabled"),$=h.useState("openMethod"),F=D.type==="context-menu";Hi({open:S,ref:h.context.popupRef,onComplete(){S&&h.context.onOpenChangeComplete?.(!0)}}),v.useEffect(()=>{function N(P){h.setOpen(!1,Ke(P.reason,P.domEvent))}return U.events.on("close",N),()=>{U.events.off("close",N)}},[U.events,h]),bb(H,{enabled:k&&!W&&!F&&D.type!=="menubar",closeDelay:j});const Y=h.useStateSetter("popupElement"),ee={transitionStatus:E,side:g,align:y,open:S,nested:D.type==="menu",instant:O},le=St("div",l,{state:ee,ref:[a,h.context.popupRef,Y],stateAttributesMapping:md,props:[T,{onKeyDown(N){b&&Zd.has(N.key)&&N.stopPropagation()}},Kd(E),m,{"data-rootownerid":M}]});let K=D.type===void 0||F;return(w||D.type==="menubar"&&A!==yd)&&(K=!0),z.jsx($v,{context:H,openInteractionType:$,modal:F,disabled:!C,returnFocus:d===void 0?K:d,initialFocus:D.type!=="menu",restoreFocus:!0,externalTree:D.type!=="menubar"?U:void 0,previousFocusableElement:w,nextFocusableElement:D.type===void 0?h.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:D.type===void 0?h.context.beforeContentFocusGuardRef:void 0,children:le})}),Ub=v.createContext(void 0);function FR(){const o=v.useContext(Ub);if(o===void 0)throw new Error(Qt(32));return o}const ZR=v.forwardRef(function(l,a){const{keepMounted:r=!1,...c}=l,{store:f,parent:d}=ji();if(!(f.useState("mounted")||r))return null;const g=d.type==="menu"||d.type==="menubar"?"group":void 0;return z.jsx(Ub.Provider,{value:r,children:z.jsx(Qv,{ref:a,...c,portalOwnerRole:g})})});function Jd(o){const{children:l,elementsRef:a,labelsRef:r,onMapChange:c}=o,f=Oe(c),[,d]=v.useState(!1),m=Zt(WR).current,h=Zt(JR).current,g=v.useRef(0),y=v.useRef(!0),b=v.useRef(null),S=v.useRef(null),E=Oe(()=>{y.current||(y.current=!0,d(H=>!H))}),T=Oe((H,U)=>{h.set(H,U),E()}),C=Oe(H=>{h.delete(H),E()}),O=Oe(H=>{const U=new Map;return a.current.length=0,r&&(r.current.length=0),H.forEach(j=>{U.set(j.element,{...j.registration.metadata??{},index:j.index}),a.current[j.index]=j.element,r&&(r.current[j.index]=j.registration.label!==void 0?j.registration.label:j.registration.textRef?.current?.textContent??j.element.textContent)}),g.current=a.current.length,U});function w(H){if(S.current?.disconnect(),S.current=null,typeof MutationObserver!="function"||H.length<2)return;const U=new MutationObserver(k=>{if(!tC(k))return;let W=null;for(const $ of H)if($.isConnected){if(W&&Lb(W,$)>0){U.disconnect(),E();return}W=$}});S.current=U;const j=new Set;for(let k=1;k<H.length;k+=1){const W=eC(H[k-1],H[k]);W&&j.add(W)}j.forEach(k=>U.observe(k,{childList:!0}))}const D=Oe(()=>{const[H,U]=$R(h),j=O(H),k=b.current,W=!k||k.length!==H.length||H.some(($,F)=>{const Y=k[F];return $.index!==Y.index||$.element!==Y.element||$.registration.index!==Y.registration.index||$.registration.metadata!==Y.registration.metadata});w(U),b.current=H,y.current=!1,W&&(m.forEach($=>$(j)),f(j))});be(()=>(!y.current&&b.current&&O(b.current),()=>{a.current=[],r&&(r.current=[])}),[a,r,O]),be(()=>{y.current&&D()}),be(()=>()=>{S.current?.disconnect(),y.current=!0},[]);const A=Oe(H=>(m.add(H),()=>{m.delete(H)})),M=v.useMemo(()=>({register:T,unregister:C,subscribeMapChange:A,nextIndexRef:g}),[T,C,A,g]);return z.jsx(kb.Provider,{value:M,children:l})}function JR(){return new Map}function WR(){return new Set}function $R(o){const l=new Set,a=[],r=[];o.forEach((f,d)=>{if(!d.isConnected)return;const m=f.index,h={index:m??-1,element:d,registration:f};m===null?r.push(h):m>=0&&(l.add(m),a.push(h))});let c=0;return r.sort((f,d)=>Lb(f.element,d.element)),r.forEach(f=>{for(;l.has(c);)c+=1;f.index=c,a.push(f),c+=1}),l.size>0&&a.sort((f,d)=>f.index-d.index),[a,r.map(f=>f.element)]}function eC(o,l){let a=o.parentElement;for(;a&&!a.contains(l);)a=a.parentElement;return a}function tC(o){for(const l of o)for(let a=0;a<l.removedNodes.length;a+=1)if(l.removedNodes[a].isConnected)return!0;return!1}function Lb(o,l){return o.compareDocumentPosition(l)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}const Bb=v.forwardRef(function(l,a){const{cutout:r,...c}=l;let f;if(r){const d=r.getBoundingClientRect();f=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${d.left}px ${d.top}px,${d.left}px ${d.bottom}px,${d.right}px ${d.bottom}px,${d.right}px ${d.top}px,${d.left}px ${d.top}px)`}return z.jsx("div",{ref:a,role:"presentation","data-base-ui-inert":"",...c,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:f}})});let Ky={},Qy={},Fy="";function Fs(o,l){return Ba(o)?o:l}function Zy(o,l,a){return/hidden|clip/.test(o.getComputedStyle(Fs(l,a)).overflowY)}function nC(o){if(typeof document>"u")return!1;const l=Xe(o);return yt(l).innerWidth-l.documentElement.clientWidth>0}function oC(o){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const a=Xe(o),r=a.documentElement,c=a.body,f=Fs(r,c),d=f.style.overflowY,m=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",f.style.overflowY="scroll";const h=f.offsetWidth;f.style.overflowY="hidden";const g=f.offsetWidth;return f.style.overflowY=d,r.style.scrollbarGutter=m,h===g}function lC(o){const l=Xe(o),a=l.documentElement,r=l.body,c=Fs(a,r),f={overflowY:c.style.overflowY,overflowX:c.style.overflowX};return Object.assign(c.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(c.style,f)}}function iC(o){const l=Xe(o),a=l.documentElement,r=l.body,c=yt(a);let f=0,d=0,m=!1;const h=Zn.create();if(ul&&(c.visualViewport?.scale??1)!==1)return()=>{};function g(){const E=c.getComputedStyle(a),T=c.getComputedStyle(r),w=(E.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";f=a.scrollTop,d=a.scrollLeft,Ky={scrollbarGutter:a.style.scrollbarGutter,overflowY:a.style.overflowY,overflowX:a.style.overflowX},Fy=a.style.scrollBehavior,Qy={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const D=a.scrollHeight>a.clientHeight,A=a.scrollWidth>a.clientWidth,M=E.overflowY==="scroll"||T.overflowY==="scroll",H=E.overflowX==="scroll"||T.overflowX==="scroll",U=Math.max(0,c.innerWidth-r.clientWidth),j=Math.max(0,c.innerHeight-r.clientHeight),k=parseFloat(T.marginTop)+parseFloat(T.marginBottom),W=parseFloat(T.marginLeft)+parseFloat(T.marginRight),$=Fs(a,r);if(m=oC(o),m){a.style.scrollbarGutter=w,$.style.overflowY="hidden",$.style.overflowX="hidden";return}Object.assign(a.style,{scrollbarGutter:w,overflowY:"hidden",overflowX:"hidden"}),(D||M)&&(a.style.overflowY="scroll"),(A||H)&&(a.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:k||j?`calc(100dvh - ${k+j}px)`:"100dvh",width:W||U?`calc(100vw - ${W+U}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),r.scrollTop=f,r.scrollLeft=d,a.setAttribute("data-base-ui-scroll-locked",""),a.style.scrollBehavior="unset"}function y(){Object.assign(a.style,Ky),Object.assign(r.style,Qy),m||(a.scrollTop=f,a.scrollLeft=d,a.removeAttribute("data-base-ui-scroll-locked"),a.style.scrollBehavior=Fy)}function b(){y(),h.request(g)}g();const S=Ye(c,"resize",b);return()=>{h.cancel(),y(),typeof c.removeEventListener=="function"&&S()}}class aC{lockCount=0;restore=null;timeoutLock=yn.create();timeoutUnlock=yn.create();acquire(l){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(l)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(l){if(this.lockCount===0||this.restore!==null)return;const a=Xe(l),r=a.documentElement,c=a.body,f=yt(r);if(Zy(f,r,c)){const m=new f.MutationObserver(()=>{Zy(f,r,c)||(m.disconnect(),this.restore=null,this.lock(l))}),h={attributes:!0};m.observe(r,h),m.observe(c,h),this.restore=()=>m.disconnect();return}const d=Hs||!nC(l);this.restore=d?lC(l):iC(l)}}const rC=new aC;function Yb(o=!0,l=null){be(()=>{if(o)return rC.acquire(l)},[o,l])}const sC=20;function uC(o,l,a,r){const[c,f]=v.useState(!1);be(()=>{if(!o||!l||a==null){f(!1);return}const d=Xe(a).documentElement.clientWidth,m=a.offsetWidth;f(d>0&&m>0&&m>=d-sC)},[o,l,a]),Yb(o&&(!l||c),r)}const cC=v.forwardRef(function(l,a){const{anchor:r,positionMethod:c="absolute",className:f,render:d,side:m,align:h,sideOffset:g=0,alignOffset:y=0,collisionBoundary:b="clipping-ancestors",collisionPadding:S=5,arrowPadding:E=5,sticky:T=!1,disableAnchorTracking:C=!1,collisionAvoidance:O=AE,style:w,...D}=l,{store:A}=ji(),M=FR(),H=Qd(!0),U=A.useState("parent"),j=A.useState("floatingRootContext"),k=A.useState("floatingTreeRoot"),W=A.useState("mounted"),$=A.useState("open"),F=A.useState("modal"),Y=A.useState("openMethod"),ee=A.useState("activeTriggerElement"),le=A.useState("transitionStatus"),K=A.useState("positionerElement"),N=A.useState("instantType"),P=A.useState("adaptiveOrigin"),I=A.useState("lastOpenChangeReason"),Q=A.useState("floatingNodeId"),ne=A.useState("floatingParentNodeId"),R=j.useState("domReferenceElement"),B=v.useRef(null),J=_d(K);let V=r,oe=g,ie=y,he=h,ue=O;U.type==="context-menu"&&(V=r??U.context?.anchor,he=he??"start",!m&&he!=="center"&&(ie=l.alignOffset??2,oe=l.sideOffset??-5));let pe=m,Re=he;U.type==="menu"?(pe=pe??"inline-end",Re=Re??"start",ue=l.collisionAvoidance??Vv):U.type==="menubar"&&(pe=pe??(U.context.orientation==="vertical"?"inline-end":"bottom"),Re=Re??"start");const ze=U.type==="context-menu",ve=Ab({anchor:V,floatingRootContext:j,positionMethod:H?"fixed":c,mounted:W,side:pe,sideOffset:oe,align:Re,alignOffset:ie,arrowPadding:ze?0:E,collisionBoundary:b,collisionPadding:S,sticky:T,nodeId:Q,keepMounted:M,disableAnchorTracking:C,collisionAvoidance:ue,shift:ze?{crossAxis:!("side"in ue&&ue.side==="flip"),rootBoundary:"layoutViewport"}:void 0,externalTree:k,adaptiveOrigin:P});v.useEffect(()=>{function Ee(we){we.open&&(we.parentNodeId===Q&&A.set("hoverEnabled",!1),we.nodeId!==Q&&we.parentNodeId===A.select("floatingParentNodeId")&&A.setOpen(!1,Ke(Da)))}return k.events.on("menuopenchange",Ee),()=>{k.events.off("menuopenchange",Ee)}},[A,k.events,Q]),v.useEffect(()=>{if(A.select("floatingParentNodeId")==null)return;function Ee(we){if(we.open||we.nodeId!==A.select("floatingParentNodeId"))return;const Qe=we.reason??Da;A.setOpen(!1,Ke(Qe))}return k.events.on("menuopenchange",Ee),()=>{k.events.off("menuopenchange",Ee)}},[k.events,A]);const ge=Jt();v.useEffect(()=>{$||ge.clear()},[$,ge]),v.useEffect(()=>{function Ee(we){if(!(!$||we.nodeId!==A.select("floatingParentNodeId")))if(we.target&&ee&&ee!==we.target){const Qe=A.select("closeDelay");Qe>0?ge.isStarted()||ge.start(Qe,()=>{A.setOpen(!1,Ke(Da))}):A.setOpen(!1,Ke(Da))}else ge.clear()}return k.events.on("itemhover",Ee),()=>{k.events.off("itemhover",Ee)}},[k.events,$,ee,A,ge]),v.useEffect(()=>{const Ee={open:$,nodeId:Q,parentNodeId:ne,reason:A.select("lastOpenChangeReason")};k.events.emit("menuopenchange",Ee)},[k.events,$,A,Q,ne]),be(()=>{const Ee=R,we=B.current;if(Ee&&(B.current=Ee),we&&Ee&&Ee!==we){A.set("instantType",void 0);const Qe=new AbortController;return J(()=>{A.set("instantType","trigger-change")},Qe.signal),()=>{Qe.abort()}}},[R,J,A]);const _e={open:$,side:ve.side,align:ve.align,anchorHidden:ve.anchorHidden,nested:U.type==="menu",instant:N},ke=U.type==="menubar"&&U.context.modal;uC($&&(ke||F&&I!==Ut),Y==="touch",K,ee);const xe=Mb(l,_e,{styles:ve.positionerStyles,transitionStatus:le,props:D,refs:[a,A.useStateSetter("positionerElement")],hidden:!W,inert:!$}),Ue=W&&U.type!=="menu"&&(U.type!=="menubar"&&F&&I!==Ut||U.type==="menubar"&&U.context.modal);let Te=null;return U.type==="menubar"?Te=U.context.contentElement:U.type===void 0&&(Te=ee),z.jsxs(zb.Provider,{value:ve,children:[Ue&&z.jsx(Bb,{ref:U.type==="context-menu"||U.type==="nested-context-menu"?U.context.internalBackdropRef:null,inert:Ks(!$),cutout:Te}),z.jsx(NE,{id:Q,children:z.jsx(Jd,{elementsRef:A.context.itemDomElements,labelsRef:A.context.itemLabels,children:xe})})]})}),fC=v.createContext(null);function Ib(o){return v.useContext(fC)}function dC(o){const l=v.useRef(""),a=v.useCallback(c=>{c.defaultPrevented||(l.current=c.pointerType,o(c,c.pointerType))},[o]);return{onClick:v.useCallback(c=>{if(c.detail===0){o(c,"keyboard");return}"pointerType"in c?o(c,c.pointerType):o(c,l.current),l.current=""},[o]),onPointerDown:a}}function pC(o,l){const a=v.useRef(o),r=Oe(l);be(()=>{a.current!==o&&r(a.current),a.current=o},[o,r])}function hC(o,l){const a=Oe((f,d)=>{(typeof o=="function"?o():o)||l(d||(Hs?"touch":""))}),{onClick:r,onPointerDown:c}=dC(a);return v.useMemo(()=>({onClick:r,onPointerDown:c}),[r,c])}function gC(o){const[l,a]=v.useState(null),r=hC(o,a);return pC(o,c=>{c&&!o&&a(null)}),v.useMemo(()=>({openMethod:l,triggerProps:r}),[l,r])}const mC={...Pd,disabled:o=>o.parent.type==="menubar"&&o.parent.context.disabled||o.disabled,modal:o=>(o.parent.type===void 0||o.parent.type==="context-menu")&&(o.modal??!0),openMethod:o=>o.openMethod,allowMouseEnter:o=>o.allowMouseEnter,highlightItemOnHover:o=>o.highlightItemOnHover,parent:o=>o.parent,rootId:o=>o.parent.type==="menu"?o.parent.store.select("rootId"):o.parent.type!==void 0?o.parent.context.rootId:o.rootId,activeIndex:o=>o.activeIndex,isActive:(o,l)=>o.activeIndex===l,hoverEnabled:o=>o.hoverEnabled,instantType:o=>o.instantType,lastOpenChangeReason:o=>o.openChangeReason,floatingTreeRoot:o=>o.parent.type==="menu"?o.parent.store.select("floatingTreeRoot"):o.floatingTreeRoot,floatingNodeId:o=>o.floatingNodeId,floatingParentNodeId:o=>o.floatingParentNodeId,itemProps:o=>o.itemProps,closeDelay:o=>o.closeDelay,adaptiveOrigin:o=>o.adaptiveOrigin,keyboardEventRelay:o=>{if(o.keyboardEventRelay)return o.keyboardEventRelay;if(o.parent.type==="menu")return o.parent.store.select("keyboardEventRelay")}};class yC extends Ia{constructor(l,a,r=!1){const c=new Yd,f=bC(c,a,r,l);super(f,vC(c),mC),this.unsubscribeParentListener=this.observe("parent",d=>{if(this.unsubscribeParentListener?.(),d.type==="menu"){let m=d.store.select("rootId"),h=d.store.select("floatingTreeRoot"),g=d.store.select("keyboardEventRelay");this.unsubscribeParentListener=d.store.subscribe(()=>{const y=d.store.select("rootId"),b=d.store.select("floatingTreeRoot"),S=d.store.select("keyboardEventRelay");m===y&&h===b&&g===S||(m=y,h=b,g=S,this.notifyAll())}),this.context.allowMouseUpTriggerRef=d.store.context.allowMouseUpTriggerRef;return}d.type!==void 0&&(this.context.allowMouseUpTriggerRef=d.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(l,a){this.state.floatingRootContext.context.events.emit("setOpen",{open:l,eventDetails:a})}unsubscribeParentListener=null}function vC(o){return{positionerRef:v.createRef(),popupRef:v.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:v.createRef(),beforeContentFocusGuardRef:v.createRef(),onOpenChangeComplete:void 0,triggerElements:o}}function bC(o,l,a=!1,r){return{...Id(o,l,a),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new Ad,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Ct,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}const SC=v.createContext(void 0);function xC(){return v.useContext(SC)}const TC=Ds(function(l){const{children:a,open:r,onOpenChange:c,onOpenChangeComplete:f,defaultOpen:d=!1,disabled:m=!1,modal:h,loopFocus:g=!0,orientation:y="vertical",actionsRef:b,closeParentOnEsc:S=!1,handle:E,triggerId:T,defaultTriggerId:C=null,highlightItemOnHover:O=!0}=l,w=Qd(!0),D=ji(!0),A=Ib(!0),M=xC(),H=v.useMemo(()=>M&&D?{type:"menu",store:D.store}:A?{type:"menubar",context:A}:w&&!D?{type:"context-menu",context:w}:{type:void 0},[w,D,A,M]),U=jl(),j=jl(),k=Ll(),W=H.type==="menu"?H.store:void 0,$=(r??d)&&W?.state.transitionStatus==="starting",F=Zt(()=>$?W?.state.instantType:void 0).current,Y=EC({open:d,openProp:r,activeTriggerId:C,triggerIdProp:T,parent:H,disabled:m,highlightItemOnHover:O,modal:H.type===void 0?h:void 0,rootId:U,instantType:F},j,k!=null);Y.useControlledProp("openProp",r),Y.useControlledProp("triggerIdProp",T),Y.useContextCallback("onOpenChangeComplete",f);const ee=Y.useState("floatingTreeRoot"),le=Wv(ee),K=Y.useState("open"),N=Y.useState("activeTriggerElement"),P=Y.useState("positionerElement"),I=Y.useState("hoverEnabled"),Q=Y.useState("disabled"),ne=Y.useState("lastOpenChangeReason"),R=Y.useState("parent"),B=Y.useState("activeIndex"),J=Y.useState("payload"),V=Y.useState("floatingParentNodeId"),oe=v.useRef(null),ie=v.useRef(R.type!=="context-menu"),he=Jt(),ue=v.useRef(!0),pe=Jt(),Re=V!=null,{openMethod:ze,triggerProps:ve}=gC(K);Y.useSyncedValues({disabled:m,highlightItemOnHover:O,modal:R.type===void 0?h:void 0,openMethod:ze,rootId:U}),Ud(Y);const{forceUnmount:ge,transitionStatus:_e}=Ld(K,Y,()=>{Y.set("allowMouseEnter",!1)},$),ke=_d(Y.context.popupRef);v.useEffect(()=>{if(F===void 0)return;const Se=()=>{Y.state.instantType===F&&Y.set("instantType",void 0)};if(!K){Se();return}if(_e!==void 0)return;if(Y.context.popupRef.current==null){Se();return}const Ie=new AbortController;return ke(Se,Ie.signal),()=>{Ie.abort()}},[F,K,_e,ke,Y]),be(()=>{w&&!D?Y.update({parent:{type:"context-menu",context:w},floatingNodeId:le,floatingParentNodeId:k}):D&&Y.update({floatingNodeId:le,floatingParentNodeId:k})},[w,D,le,k,Y]),v.useEffect(()=>{if(K||(oe.current=null),R.type==="context-menu"){if(!K){he.clear(),ie.current=!1;return}he.start(500,()=>{ie.current=!0})}},[he,K,R.type]),be(()=>{!K&&!I&&Y.set("hoverEnabled",!0)},[K,I,Y]);const Pe=Oe((Se,Ie)=>{const tt=Ie.reason;if(!Se&&!Y.select("open")||K===Se&&Ie.trigger===N&&ne===tt)return;const pt=pb(Ie);if(!Se&&Ie.trigger==null&&(Ie.trigger=N??void 0),c?.(Se,Ie),Ie.isCanceled)return;Y.state.floatingRootContext.dispatchOpenChange(Se,Ie);const bn=Ie.event;if(Se===!1&&bn?.type==="click"&&bn.pointerType==="touch"&&!ue.current)return;Se&&tt===Oi?(ue.current=!1,pe.start(300,()=>{ue.current=!0})):(ue.current=!0,pe.clear());const Hn=(tt===_i||tt===Sv)&&bn.detail===0,Sn=!Se&&(tt===Ps||tt==null);oe.current=Ie.event;const At=kd(Y.state,Se,Ie.trigger,pt());At.openChangeReason=tt,R.type==="menubar"&&(tt===Oi||tt===Ni||tt===Ut||tt===Vf||tt===Da)?At.instantType="group":Hn||Sn?At.instantType=Hn?"click":"dismiss":At.instantType=void 0,Y.update(At)}),xe=cb({popupStore:Y,floatingRootContext:Y.state.floatingRootContext,floatingId:j,nested:k!=null,onOpenChange:Pe}),Ue=xe.context.events;be(()=>{const Se=({open:Ie,eventDetails:tt})=>Pe(Ie,tt);return Ue.on("setOpen",Se),()=>{Ue?.off("setOpen",Se)}},[Ue,Pe]);const Te=v.useCallback(()=>{Y.setOpen(!1,Ke(vd))},[Y]);v.useImperativeHandle(b,()=>({unmount:ge,close:Te}),[ge,Te]);let Ee;R.type==="context-menu"&&(Ee=R.context),v.useImperativeHandle(Ee?.positionerRef,()=>P,[P]),v.useImperativeHandle(Ee?.actionsRef,()=>({setOpen:Pe}),[Pe]);const we=Dd(xe,{enabled:!Q,bubbles:{escapeKey:S&&R.type==="menu"},outsidePress(){return R.type!=="context-menu"||oe.current?.type==="contextmenu"?!0:ie.current},externalTree:Re?ee:void 0}),Qe=Xd(),Ae=v.useCallback(Se=>{Y.select("activeIndex")!==Se&&Y.set("activeIndex",Se)},[Y]),fe=Q1(xe,{enabled:!Q,listRef:Y.context.itemDomElements,activeIndex:B,nested:R.type!==void 0,loopFocus:g,orientation:y,parentOrientation:R.type==="menubar"?R.context.orientation:void 0,rtl:Qe==="rtl",disabledIndices:Eo,onNavigate:Ae,openOnArrowKeyDown:R.type!=="context-menu",externalTree:Re?ee:void 0,focusItemOnHover:O}),me=v.useCallback(Se=>{Y.context.typingRef.current=Se},[Y]),de=F1(xe,{enabled:!Q,listRef:Y.context.itemLabels,elementsRef:Y.context.itemDomElements,activeIndex:B,resetMs:SE,onMatch:Se=>{K&&Se!==B&&Y.set("activeIndex",Se)},onTyping:me}),ae=v.useMemo(()=>{const Se=To(de.reference,fe.reference,we.reference,{onMouseMove(){Y.set("allowMouseEnter",!0)}},ve);return Se["aria-haspopup"]="menu",Se["aria-expanded"]=K,Se},[Y,de.reference,fe.reference,we.reference,ve,K]),ye=v.useMemo(()=>{const Se=To(fe.trigger,we.trigger,ve);return Se["aria-haspopup"]="menu",Se["aria-expanded"]=!1,Se},[fe.trigger,we.trigger,ve]);Zt(()=>(Y.update({inactiveTriggerProps:ye}),null));const Le=v.useMemo(()=>To(Hd,{id:j,role:"menu","aria-orientation":y==="horizontal"?"horizontal":void 0,"aria-labelledby":N?.id,onMouseMove(){Y.set("allowMouseEnter",!0),R.type==="menu"&&Y.set("hoverEnabled",!1)},onClick(){Y.select("hoverEnabled")&&Y.set("hoverEnabled",!1)},onKeyDown(Se){const Ie=Y.select("keyboardEventRelay");Ie&&!Se.isPropagationStopped()&&Ie(Se)}},de.floating,fe.floating,we.floating),[N,j,y,R.type,Y,de.floating,fe.floating,we.floating]),Lt=fe.item??Ct;Bd(Y,{floatingRootContext:xe,activeTriggerProps:ae,inactiveTriggerProps:ye,popupProps:Le,itemProps:Lt});const $t=v.useMemo(()=>({store:Y,parent:H}),[Y,H]),Tt=z.jsxs(Hb.Provider,{value:$t,children:[E&&z.jsx(jd,{handle:E,store:Y}),typeof a=="function"?a({payload:J}):a]});return R.type===void 0||R.type==="context-menu"?z.jsx(zE,{externalTree:ee,children:Tt}):Tt});function EC(o,l,a){return Zt(()=>new yC(o,l,a)).current}const ps=5;function RC(o,l){const a=CC(l);return o.clientX>=a.left-ps&&o.clientX<=a.right+ps&&o.clientY>=a.top-ps&&o.clientY<=a.bottom+ps}function CC(o){const l=o.getBoundingClientRect(),a=yt(o);if(sd)return l;const r=a.getComputedStyle(o,"::before"),c=a.getComputedStyle(o,"::after");if(!(r.content!=="none"||c.content!=="none"))return l;const d=parseFloat(r.width)||0,m=parseFloat(r.height)||0,h=parseFloat(c.width)||0,g=parseFloat(c.height)||0,y=Math.max(l.width,d,h),b=Math.max(l.height,m,g),S=y-l.width,E=b-l.height;return{left:l.left-S/2,right:l.right+S/2,top:l.top-E/2,bottom:l.bottom+E/2}}function qb(o={}){const{highlightItemOnHover:l,highlightedIndex:a,onHighlightedIndexChange:r}=Qs(),{ref:c,index:f}=Fd(o),d=a===f,m=v.useRef(null),h=_l(c,m);return{compositeProps:{tabIndex:d?0:-1,onFocus(){r(f)},onMouseMove(){const y=m.current;if(!l||!y)return;const b=y.hasAttribute("disabled")||y.ariaDisabled==="true";!d&&!b&&y.focus()}},compositeRef:h,index:f}}function OC(o){const{render:l,className:a,style:r,state:c=Ct,props:f=Eo,refs:d=Eo,metadata:m,stateAttributesMapping:h,tag:g="div",...y}=o,{compositeProps:b,compositeRef:S}=qb({metadata:m});return St(g,o,{state:c,ref:[S,...d],props:[b,...f,y],stateAttributesMapping:h})}function Pb(o){if(dt(o)&&o.hasAttribute("data-rootownerid"))return o.getAttribute("data-rootownerid");if(!bo(o))return Pb(Ro(o))}function wC(o,l){const a=v.useRef(null);function r(f){qn.flushSync(()=>{o.setOpen(!1,Ke(Ni,f.nativeEvent,f.currentTarget))}),tE(a.current)?.focus()}function c(f){const d=o.select("positionerElement");if(d&&Ai(f,d))o.context.beforeContentFocusGuardRef.current?.focus();else{qn.flushSync(()=>{o.setOpen(!1,Ke(Ni,f.nativeEvent,f.currentTarget))});let m=eE(o.context.triggerFocusTargetRef.current||l.current);for(;m!==null&&De(d,m);){const h=m;if(m=Rd(m),m===h)break}m?.focus()}}return{preFocusGuardRef:a,handlePreFocusGuardFocus:r,handleFocusTargetFocus:c}}function AC(o){const{enabled:l=!0,mouseDownAction:a,open:r}=o,c=v.useRef(!1);return v.useMemo(()=>l?{onMouseDown:f=>{(a==="open"&&!r||a==="close"&&r)&&(c.current=!0,Xe(f.currentTarget).addEventListener("click",()=>{c.current=!1},{once:!0}))},onClick:f=>{c.current&&(c.current=!1,f.preventBaseUIHandler())}}:Ct,[l,a,r])}const MC=dv(function(l,a){const{render:r,className:c,style:f,disabled:d=!1,nativeButton:m=!0,id:h,openOnHover:g,delay:y=100,closeDelay:b=0,handle:S,payload:E,...T}=l,C=ji(!0),w=mb(S)??C?.store;if(!w)throw new Error(Qt(85));const D=Bl(h),A=w.useState("isTriggerActive",D),M=w.useState("floatingRootContext"),H=w.useState("isOpenedByTrigger",D),U=w.useState("triggerPopupId",D),j=v.useRef(null),k=NC(),W=Qs(!0),$=cl(),F=v.useMemo(()=>$??new Ad,[$]),Y=Wv(F),ee=Ll(),{registerTrigger:le,isMountedByThisTrigger:K}=hb(D,j,w,{payload:E,closeDelay:b,parent:k,floatingTreeRoot:F,floatingNodeId:Y,floatingParentNodeId:ee,keyboardEventRelay:W?.relayKeyboardEvent}),N=k.type==="menubar",P=w.useState("disabled"),I=d||P||N&&k.context.disabled,{getButtonProps:Q,buttonRef:ne}=qa({disabled:I,native:m});v.useEffect(()=>{!H&&k.type===void 0&&(w.context.allowMouseUpTriggerRef.current=!1)},[w,H,k.type]);const R=v.useRef(null),B=Jt(),J=Oe(Ee=>{if(!R.current)return;B.clear(),w.context.allowMouseUpTriggerRef.current=!1;const we=Ee.target;De(R.current,we)||De(w.select("positionerElement"),we)||we===R.current||we!=null&&Pb(we)===w.select("rootId")||RC(Ee,R.current)||F.events.emit("close",{domEvent:Ee,reason:wT})});v.useEffect(()=>{H&&w.select("lastOpenChangeReason")===Ut&&Xe(R.current).addEventListener("mouseup",J,{once:!0})},[H,J,w]);const V=N&&k.context.hasSubmenuOpen,ie=Sb(M,{enabled:(g??V)&&!I&&(!N||V&&!K),handleClose:xb({blockPointerEvents:!N}),mouseOnly:!0,move:!1,restMs:k.type===void 0?y:void 0,delay:{close:b},triggerElementRef:j,externalTree:F,isActiveTrigger:A,isClosing:()=>w.select("transitionStatus")==="ending"}),he=DC(H,w.select("lastOpenChangeReason")),ue=jE(M,{enabled:!I,event:H&&N?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:k.type===void 0?he:!1}),pe=yb(M,{enabled:!I&&V}),Re=AC({open:H,enabled:N,mouseDownAction:"open"}),ze=v.useMemo(()=>To(pe.reference,ue.reference),[pe.reference,ue.reference]),ve=w.useState("triggerProps",K),{preFocusGuardRef:ge,handlePreFocusGuardFocus:_e,handleFocusTargetFocus:ke}=wC(w,j),Pe={disabled:I,open:H},xe=[R,a,ne,le,j],Ue=[ze,ie??Ct,ve,{"aria-haspopup":"menu","aria-controls":U,id:D,onMouseDown:Ee=>{if(w.select("open"))return;B.start(200,()=>{w.context.allowMouseUpTriggerRef.current=!0}),Xe(Ee.currentTarget).addEventListener("mouseup",J,{once:!0})}},N?{role:"menuitem"}:{},Re,T,Q],Te=St("button",l,{enabled:!N,stateAttributesMapping:iy,state:Pe,ref:xe,props:Ue});return N?z.jsx(OC,{tag:"button",render:r,className:c,style:f,state:Pe,refs:xe,props:Ue,stateAttributesMapping:iy}):H?z.jsxs(v.Fragment,{children:[z.jsx(Hl,{ref:ge,onFocus:_e},`${D}-pre-focus-guard`),z.jsx(v.Fragment,{children:Te},D),z.jsx(Hl,{ref:w.context.triggerFocusTargetRef,onFocus:ke},`${D}-post-focus-guard`)]}):z.jsx(v.Fragment,{children:Te},D)});function DC(o,l){const a=Jt(),[r,c]=v.useState(!1);return be(()=>{o&&l===Ut?(c(!0),a.start(xE,()=>{c(!1)})):o||(a.clear(),c(!1))},[o,l,a]),r}function NC(){const o=Ib();return v.useMemo(()=>o?{type:"menubar",context:o}:{type:void 0},[o])}const zC=v.forwardRef(function(l,a){const{className:r,render:c,orientation:f="horizontal",style:d,...m}=l;return St("div",l,{state:{orientation:f},ref:a,props:[{role:"separator","aria-orientation":f},m]})});function _C(o){return o==null||o.hasAttribute("disabled")||o.getAttribute("aria-disabled")==="true"}const HC=o=>o?.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();function jC(o,l,a=[]){if(l==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:HC(o),size:24,node:l,...a.length>0?{aliases:a}:{}}}const kC=o=>{let l="",a=!1;for(const r of o){if(r==="-"||r==="_"||r<=" "){a=l.length>0;continue}l.length===0?l+=r.toLowerCase():l+=a?r.toUpperCase():r,a=!1}return l};const UC=o=>{const l=kC(o);return l.charAt(0).toUpperCase()+l.slice(1)};const nd=(...o)=>o.filter((l,a,r)=>!!l&&l.trim()!==""&&r.indexOf(l)===a).join(" ").trim();const Nl={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};function Df(o){return o!=null}function LC(o,l={}){const a=l.attributeNames??{},r=S=>a[S]??S,c=o.size??o.width??Nl.width,f=o.size??o.height??Nl.height,d=o.aliases?.filter(S=>typeof S=="string"&&S.trim()!=="").map(S=>`lucide-${S}`)??[],m=[...o.name?[`lucide-${o.name}`]:[],...d],h=l.className?.split(" ").filter(Boolean)??[],g=l.includeDefaultClasses===!1?nd(...h):nd("lucide",...m,...h),y=l.absoluteStrokeWidth?Number(l.strokeWidth??Nl["stroke-width"])*Number(o.size??o.width??Nl.width)/Number(l.size??l.width??Nl.width):l.strokeWidth??Nl["stroke-width"];return["svg",{...Object.entries(Nl).reduce((S,[E,T])=>(S[r(E)]=T,S),{}),..."color"in l&&l.color&&{[r("stroke")]:l.color},..."size"in l&&Df(l.size)&&{[r("width")]:l.size,[r("height")]:l.size},..."width"in l&&Df(l.width)&&{[r("width")]:l.width},..."height"in l&&Df(l.height)&&{[r("height")]:l.height},[r("stroke-width")]:y,...g&&{[r("class")]:g},[r("viewBox")]:`0 0 ${c} ${f}`,...l.hasA11yProp===!1?{[r("aria-hidden")]:"true"}:{},..."attributes"in l&&l.attributes},o.node.map(S=>{const[E,T,C]=S,O=l.nonScalingStroke?{[r("vector-effect")]:"non-scaling-stroke",...T}:T;return C?[E,O,C]:[E,O]})]}function BC(o,l={}){return LC(o,{...l,attributeNames:{...l.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}const YC=o=>{for(const l in o)if(l.startsWith("aria-")||l==="role"||l==="title")return!0;return!1},IC=v.createContext({}),qC=()=>v.useContext(IC),PC=v.forwardRef(({color:o,size:l,width:a,height:r,strokeWidth:c,absoluteStrokeWidth:f,nonScalingStroke:d,className:m="",children:h,iconNode:g=[],icon:y={node:g,aliases:[],size:24},...b},S)=>{const{size:E=24,strokeWidth:T=2,absoluteStrokeWidth:C=!1,nonScalingStroke:O=!1,color:w="currentColor",className:D=""}=qC()??{},A=!!h||YC(b),[M,H,U=[]]=BC(y,{color:o??w,width:a??l??E,height:r??l??E,strokeWidth:c??T,absoluteStrokeWidth:f??C,nonScalingStroke:d??O,className:nd(D,m),hasA11yProp:A,attributes:b});return v.createElement(M,{ref:S,...H},[...U.map(([j,k])=>v.createElement(j,k)),...Array.isArray(h)?h:[h]])});function Pn(o,l=[],a=[]){const r=typeof o=="string"?jC(o,l,a):o,c=v.forwardRef(({className:f,...d},m)=>v.createElement(PC,{ref:m,icon:r,className:f,...d}));return r.name&&(c.displayName=UC(r.name)),c}const Vb={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};Vb.node;const VC=Pn(Vb);const Gb={name:"ellipsis",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],aliases:["more-horizontal"]};Gb.node;const GC=Pn(Gb);const Xb={name:"message-square",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]};Xb.node;const XC=Pn(Xb);const Kb={name:"pencil",size:24,node:[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]};Kb.node;const KC=Pn(Kb);const Qb={name:"pin-off",size:24,node:[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89",key:"znwnzq"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11",key:"c9qhm2"}]]};Qb.node;const QC=Pn(Qb);const Fb={name:"pin",size:24,node:[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]};Fb.node;const Jy=Pn(Fb);const Zb={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};Zb.node;const Jb=Pn(Zb);const Wb={name:"shapes",size:24,node:[["path",{d:"M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z",key:"1bo67w"}],["rect",{x:"3",y:"14",width:"7",height:"7",rx:"1",key:"1bkyp8"}],["circle",{cx:"17.5",cy:"17.5",r:"3.5",key:"w3z12y"}]]};Wb.node;const FC=Pn(Wb);const $b={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};$b.node;const ZC=Pn($b);const e0={name:"triangle-alert",size:24,node:[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["alert-triangle"]};e0.node;const Wd=Pn(e0);const t0={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};t0.node;const n0=Pn(t0),JC="rounded-lg bg-surface p-1 text-[13px] text-fg shadow-popup outline-none origin-[var(--transform-origin)] transition-[opacity,transform] duration-100 data-[starting-style]:opacity-0 data-[starting-style]:scale-95 data-[ending-style]:opacity-0",WC="flex h-7 min-w-40 cursor-default select-none items-center gap-2 rounded-md px-2 outline-none data-[highlighted]:bg-hover data-[disabled]:opacity-40";function $C({trigger:o,children:l,side:a="bottom",align:r="start",open:c,onOpenChange:f}){return z.jsxs(TC,{open:c,onOpenChange:f?d=>f(d):void 0,children:[z.jsx(MC,{render:o,onKeyDown:Ms}),z.jsx(ZR,{children:z.jsx(cC,{side:a,align:r,sideOffset:6,className:"z-[1000]",children:z.jsx(QR,{className:JC,children:l})})})]})}function hs({children:o,onSelect:l,icon:a,shortcut:r,disabled:c,danger:f}){return z.jsxs(qR,{className:Oo(WC,f&&"text-danger"),disabled:c,onClick:l,onKeyDown:Ms,children:[z.jsx("span",{className:"flex size-4 items-center justify-center text-fg-muted",children:a}),z.jsx("span",{className:"flex-1",children:o}),r?z.jsx("span",{className:"ml-4 text-xs text-fg-subtle",children:r}):null]})}function eO(){return z.jsx(zC,{className:"mx-1 my-1 h-px bg-line"})}const o0=v.createContext(void 0);function Yl(o){const l=v.useContext(o0);if(!o&&l===void 0)throw new Error(Qt(27));return l}const tO=v.forwardRef(function(l,a){const{render:r,className:c,style:f,forceRender:d=!1,...m}=l,h=Yl(),g=h.useState("open"),y=h.useState("nested"),b=h.useState("mounted"),S=h.useState("transitionStatus");return St("div",l,{state:{open:g,transitionStatus:S},ref:[h.context.backdropRef,a],stateAttributesMapping:md,props:[{role:"presentation",hidden:!b,style:{userSelect:"none",WebkitUserSelect:"none"}},m],enabled:d||!y})}),nO=v.forwardRef(function(l,a){const{render:r,className:c,style:f,disabled:d=!1,nativeButton:m=!0,...h}=l,g=Yl(),y=g.useState("open"),{getButtonProps:b,buttonRef:S}=qa({disabled:d,native:m}),E={disabled:d};function T(C){y&&g.setOpen(!1,Ke(OT,C.nativeEvent))}return St("button",l,{state:E,ref:[a,S],props:[{onClick:T},h,b]})}),oO=v.forwardRef(function(l,a){const{render:r,className:c,style:f,id:d,...m}=l,h=Yl(),g=Bl(d);return h.useSyncedValueWithCleanup("descriptionElementId",g),St("p",l,{ref:a,props:[{id:g},m]})}),l0=v.createContext(void 0);function lO(){const o=v.useContext(l0);if(o===void 0)throw new Error(Qt(26));return o}const iO="--nested-dialogs",aO="data-nested-dialog-open",rO={...gd,...Ys,nestedDialogOpen(o){return o?{[aO]:""}:null}},sO=v.forwardRef(function(l,a){const{render:r,className:c,style:f,finalFocus:d,initialFocus:m,...h}=l,g=Yl(),y=g.useState("descriptionElementId"),b=g.useState("disablePointerDismissal"),S=g.useState("floatingRootContext"),E=g.useState("popupProps"),T=g.useState("modal"),C=g.useState("mounted"),O=g.useState("nested"),w=g.useState("nestedOpenDialogCount"),D=g.useState("open"),A=g.useState("openMethod"),M=g.useState("titleElementId"),H=g.useState("transitionStatus"),U=g.useState("role"),j=S.useState("floatingId");lO(),Hi({open:D,ref:g.context.popupRef,onComplete(){D&&g.context.onOpenChangeComplete?.(!0)}});const k=m===void 0?U1(g.context.popupRef):m,W=w>0,$=g.useStateSetter("popupElement"),Y=St("div",l,{state:{open:D,nested:O,transitionStatus:H,nestedDialogOpen:W},props:[E,{id:j,"aria-labelledby":M,"aria-describedby":y,role:U,...Hd,hidden:!C,onKeyDown(ee){Zd.has(ee.key)&&ee.stopPropagation()},style:{[iO]:w}},h],ref:[a,g.context.popupRef,$],stateAttributesMapping:rO});return z.jsx($v,{context:S,openInteractionType:A,disabled:!C,closeOnFocusOut:!b,initialFocus:k,returnFocus:d,modal:T!==!1,restoreFocus:"popup",children:Y})}),uO=v.forwardRef(function(l,a){const{keepMounted:r=!1,...c}=l,f=Yl(),d=f.useState("mounted"),m=f.useState("modal"),h=f.useState("open");return d||r?z.jsx(l0.Provider,{value:r,children:z.jsxs(Qv,{ref:a,...c,children:[d&&m===!0&&z.jsx(Bb,{ref:f.context.internalBackdropRef,inert:Ks(!h)}),l.children]})}):null});function cO({store:o,parentContext:l,isDrawer:a}){const r=o.useState("open"),c=o.useState("disablePointerDismissal"),f=o.useState("modal"),d=o.useState("popupElement"),m=o.useState("floatingRootContext"),[h,g]=v.useState(0),[y,b]=v.useState(0),S=h===0,E=Dd(m,{outsidePressEvent(){return o.context.internalBackdropRef.current||o.context.backdropRef.current?"intentional":{mouse:f==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(T){if(!o.context.outsidePressEnabledRef.current||"button"in T&&T.button!==0)return!1;if("touches"in T){if(T.type==="touchend"){if(T.changedTouches.length!==1||T.touches.length!==0)return!1}else if(T.touches.length!==1)return!1}const C=bt(T);if(S&&!c){if(f){const O=o.context.internalBackdropRef.current,w=o.context.backdropRef.current;return O||w?O===C||w===C||De(C,d)&&!C?.hasAttribute("data-base-ui-portal"):!0}return!0}return!1},escapeKey:S});return Yb(r&&f===!0,d),o.useContextCallback("onNestedDialogOpen",(T,C)=>{g(T),b(C)}),be(()=>(l?.onNestedDialogOpen&&(r?l.onNestedDialogOpen(h+1,y+(a?1:0)):l.onNestedDialogOpen(0,0)),()=>{l?.onNestedDialogOpen&&r&&l.onNestedDialogOpen(0,0)}),[a,r,h,y,l]),Bd(o,{activeTriggerProps:E.reference,inactiveTriggerProps:E.trigger,popupProps:E.floating,nestedOpenDialogCount:h,nestedOpenDrawerCount:y}),null}const fO={...Pd,modal:o=>o.modal,nested:o=>o.nested,nestedOpenDialogCount:o=>o.nestedOpenDialogCount,nestedOpenDrawerCount:o=>o.nestedOpenDrawerCount,disablePointerDismissal:o=>o.disablePointerDismissal,openMethod:o=>o.openMethod,descriptionElementId:o=>o.descriptionElementId,titleElementId:o=>o.titleElementId,viewportElement:o=>o.viewportElement,role:o=>o.role};class dO extends Ia{constructor(l,a,r){const c=new Yd,f=pO(l,c,a,r);super(f,hO(c),fO)}setOpen=(l,a)=>{a.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!l&&a.trigger==null&&this.state.activeTriggerId!=null&&(a.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(l,a),!a.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(l,a),this.update(kd(this.state,l,a.trigger)))}}function pO(o,l,a,r=!1){return{...Id(l,a,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...o}}function hO(o){return{popupRef:v.createRef(),backdropRef:v.createRef(),internalBackdropRef:v.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:o,onOpenChange:void 0,onOpenChangeComplete:void 0}}function gO(o,l){const{children:a,open:r,defaultOpen:c=!1,onOpenChange:f,onOpenChangeComplete:d,disablePointerDismissal:m=!1,modal:h=!0,actionsRef:g,handle:y,triggerId:b,defaultTriggerId:S=null}=l,E=o==="drawer",T=h,C=m,O="dialog",w=Yl(!0),D=w!=null,A={modal:T,disablePointerDismissal:C,nested:D,role:O},M=db(($,F)=>new dO({open:c,openProp:r,activeTriggerId:S,triggerIdProp:b,...A},$,F),!0);M.useControlledProp("openProp",r),M.useControlledProp("triggerIdProp",b),M.useSyncedValues(A),M.useContextCallback("onOpenChange",f),M.useContextCallback("onOpenChangeComplete",d);const H=M.useState("open"),U=M.useState("mounted"),j=M.useState("payload");Y1(M,H),Ud(M);const{forceUnmount:k}=Ld(H,M);v.useImperativeHandle(g,()=>({unmount:k,close:()=>M.setOpen(!1,Ke(vd))}),[k,M]);const W=H||U;return z.jsxs(o0.Provider,{value:M,children:[y&&z.jsx(jd,{handle:y,store:M}),W&&z.jsx(cO,{store:M,parentContext:w?.context,isDrawer:E}),typeof a=="function"?a({payload:j}):a]})}const mO=Ds(function(l){return gO("dialog",l)}),yO=v.forwardRef(function(l,a){const{render:r,className:c,style:f,id:d,...m}=l,h=Yl(),g=Bl(d);return h.useSyncedValueWithCleanup("titleElementId",g),St("h2",l,{ref:a,props:[{id:g},m]})});function i0({open:o,onOpenChange:l,title:a,description:r,children:c,footer:f,className:d}){return z.jsx(mO,{open:o,onOpenChange:m=>l(m),children:z.jsxs(uO,{children:[z.jsx(tO,{className:"fixed inset-0 z-[900] bg-black/30 transition-opacity data-[starting-style]:opacity-0 data-[ending-style]:opacity-0"}),z.jsxs(sO,{className:Oo("fixed left-1/2 top-1/2 z-[901] w-[min(28rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 rounded-xl bg-surface p-5 text-fg shadow-popup outline-none","transition-[opacity,transform] data-[starting-style]:scale-95 data-[starting-style]:opacity-0 data-[ending-style]:opacity-0",d),children:[z.jsxs("div",{className:"mb-3 flex items-start gap-3",children:[z.jsxs("div",{className:"flex-1",children:[z.jsx(yO,{className:"text-[15px] font-semibold",children:a}),r?z.jsx(oO,{className:"mt-1 text-fg-muted",children:r}):null]}),z.jsx(nO,{"aria-label":"Close",className:"rounded-md p-1 text-fg-muted hover:bg-hover",children:z.jsx(n0,{className:"size-4"})})]}),c,f?z.jsx("div",{className:"mt-4 flex justify-end gap-2",children:f}):null]})]})})}const $d="data-composite-item-active";function vO(o){const{loopFocus:l=!0,orientation:a="both",grid:r,onLoop:c,direction:f,highlightedIndex:d,onHighlightedIndexChange:m,rootRef:h,enableHomeAndEndKeys:g=!1,stopEventPropagation:y,disabledIndices:b,modifierKeys:S=Eo}=o,[E,T]=v.useState(0),C=r!=null,O=v.useRef(null),w=_l(O,h),D=v.useRef([]),A=v.useRef(!1),M=v.useRef(null),H=d??E,U=Oe((F,Y=!1)=>{if(M.current=D.current[F]??null,(m??T)(F),Y){const ee=D.current[F];Gy(O.current,ee,f,a)}}),j=Oe(F=>{if(F.size===0)return;if(A.current){const K=D.current,N=K.indexOf(M.current);if(N===-1){const P=K[H];!P||wi(K,H,b)?U(bO(K,b)):M.current=P}else N!==H&&U(N);return}A.current=!0;const Y=Array.from(F.keys()),ee=Y.find(K=>K?.hasAttribute($d))??null,le=ee?F.get(ee)?.index??-1:-1;if(le!==-1)U(le);else if(wi(Y,H,b)){const K=vo(Y,{disabledIndices:b});za(Y,K)||U(K)}Gy(O.current,ee,f,a)});be(()=>{if(b==null||d!=null||!A.current)return;const F=D.current;if(wi(F,H,b)){const Y=vo(F,{disabledIndices:b});za(F,Y)||U(Y)}},[b,d,H,D,U]);const k=Oe((F,Y,ee)=>c?c(F,Y,ee,D):ee),W=Oe(F=>{const Y=F.key===ed||F.key===td;if(!Zd.has(F.key)||!g&&Y||SO(F,S)||!O.current)return;const le=f==="rtl",K=le?Wf:$f,N=le?$f:Wf,P=a==="vertical"?Jf:K,I=a==="vertical"?Zf:N,Q=bt(F.nativeEvent);if(Q!=null&&Vy(Q)&&!_C(Q)){const oe=Q.selectionStart,ie=Q.selectionEnd,he=Q.value;if(oe==null||F.shiftKey||oe!==ie||F.key!==I&&oe<he.length||F.key!==P&&oe>0)return}let ne=H;const R=gs(D,b),B=Xf(D,b);r!=null&&(ne=r({disabledIndices:b,elementsRef:D,event:F,highlightedIndex:H,loopFocus:l,maxIndex:B,minIndex:R,onLoop:k,orientation:a,rtl:le}));const J=a!=="vertical"&&F.key===K||a!=="horizontal"&&F.key===Jf,V=a!=="vertical"&&F.key===N||a!=="horizontal"&&F.key===Zf;g&&(F.key===ed?ne=R:F.key===td&&(ne=B)),ne===H&&(J||V)&&(l&&ne===B&&J?(ne=R,c&&(ne=c(F,H,ne,D))):l&&ne===R&&V?(ne=B,c&&(ne=c(F,H,ne,D))):ne=vo(D.current,{startingIndex:ne,decrement:V,disabledIndices:b})),ne!==H&&!za(D.current,ne)&&(y&&F.stopPropagation(),(C||Y||J||V)&&F.preventDefault(),U(ne,!0),queueMicrotask(()=>{D.current[ne]?.focus()}))});return{props:{ref:w,onFocus(F){const Y=O.current,ee=bt(F.nativeEvent);!Y||ee==null||!Vy(ee)||ee.setSelectionRange(0,ee.value.length)},onKeyDown:W},highlightedIndex:H,onHighlightedIndexChange:U,elementsRef:D,onMapChange:j,relayKeyboardEvent:W}}function bO(o,l){let a=-1;for(let r=0;r<o.length;r+=1){const c=o[r];if(!(!c||wi(o,r,l))){if(c.hasAttribute($d))return r;a===-1&&(a=r)}}return Math.max(a,0)}function SO(o,l){for(const a of XR)if(!l.includes(a)&&o.getModifierState(a))return!0;return!1}function xO(o){const{render:l,className:a,style:r,refs:c=Eo,props:f=Eo,state:d=Ct,stateAttributesMapping:m,highlightedIndex:h,onHighlightedIndexChange:g,orientation:y,grid:b,loopFocus:S,onLoop:E,enableHomeAndEndKeys:T,onMapChange:C,stopEventPropagation:O=!0,rootRef:w,disabledIndices:D,modifierKeys:A,highlightItemOnHover:M=!1,tag:H="div",...U}=o,j=Xd(),{props:k,highlightedIndex:W,onHighlightedIndexChange:$,elementsRef:F,onMapChange:Y,relayKeyboardEvent:ee}=vO({grid:b,loopFocus:S,onLoop:E,orientation:y,highlightedIndex:h,onHighlightedIndexChange:g,rootRef:w,stopEventPropagation:O,enableHomeAndEndKeys:T,direction:j,disabledIndices:D,modifierKeys:A}),le=St(H,o,{state:d,ref:c,props:[k,...f,U],stateAttributesMapping:m}),K=v.useMemo(()=>({highlightedIndex:W,onHighlightedIndexChange:$,highlightItemOnHover:M,relayKeyboardEvent:ee}),[W,$,M,ee]);return z.jsx(jb.Provider,{value:K,children:z.jsx(Jd,{elementsRef:F,onMapChange:N=>{C?.(N),Y(N)},children:le})})}const TO="h-7 w-full min-w-0 rounded-control border border-line bg-surface-2 px-2 text-[13px] text-fg outline-none placeholder:text-fg-subtle focus:border-accent focus:bg-surface",od=v.forwardRef(function({className:l,...a},r){return z.jsx("input",{ref:r,className:Oo(TO,l),...a})}),a0=v.createContext(void 0);function ep(){const o=v.useContext(a0);if(o===void 0)throw new Error(Qt(64));return o}const EO="data-activation-direction",Zs={tabActivationDirection:o=>({[EO]:o})},RO=v.forwardRef(function(l,a){const{className:r,defaultValue:c=0,onValueChange:f,orientation:d="horizontal",render:m,value:h,style:g,...y}=l,b=l.defaultValue!==void 0,S=v.useRef([]),[E,T]=v.useState(()=>new Map),[C,O]=jR({controlled:h,default:c,name:"Tabs",state:"value"}),w=h!==void 0,[D,A]=v.useState(()=>new Map),M=v.useRef(void 0),H=v.useCallback(ue=>ld(D,ue),[D]),[U,j]=v.useState(()=>({previousValue:C,tabActivationDirection:"none"})),{previousValue:k,tabActivationDirection:W}=U;let $=W,F=!1;k!==C&&($=Wy(k,C,d,D),F=k!=null&&C!=null&&H(C)==null);const Y=F?k:C,ee=k!==Y||W!==$;be(()=>{ee&&j({previousValue:Y,tabActivationDirection:$})},[Y,ee,$]);const le=Oe((ue,pe)=>{const Re=Wy(C,ue,d,D);pe.activationDirection=Re,f?.(ue,pe),!pe.isCanceled&&O(ue)}),K=Oe((ue,pe)=>{f?.(ue,Ke(pe,void 0,void 0,{activationDirection:"none"}))}),N=Oe((ue,pe)=>(T(Re=>{const ze=new Map(Re);return ze.set(ue,pe),ze}),()=>{T(Re=>{if(Re.get(ue)!==pe)return Re;const ze=new Map(Re);return ze.delete(ue),ze})})),P=v.useCallback(ue=>E.get(ue),[E]),I=v.useCallback(ue=>{for(const pe of D.values())if(ue===pe.value)return pe.id},[D]),Q=v.useMemo(()=>({getTabElementBySelectedValue:H,getTabIdByPanelValue:I,getTabPanelIdByValue:P,onValueChange:le,orientation:d,registerMountedTabPanel:N,setTabMap:A,tabActivationDirection:$,value:C}),[H,I,P,le,d,N,A,$,C]),ne=v.useMemo(()=>{for(const ue of D.values())if(ue.value===C)return ue},[D,C]),R=v.useMemo(()=>{for(const ue of D.values())if(!ue.disabled)return ue.value},[D]),B=v.useRef(!b),J=v.useRef(c),V=v.useRef(b),oe=v.useRef(!1);be(()=>{if(w)return;function ue(ve,ge){O(ve),j({previousValue:ve,tabActivationDirection:"none"}),K(ve,ge),B.current=!1}if(D.size===0){oe.current&&C!==null&&!M.current?.isConnected&&ue(null,ry);return}oe.current=!0,M.current=D.keys().next().value;const pe=ne?.disabled,Re=ne==null&&C!==null;if(!pe&&C===J.current&&(V.current=!1),V.current&&pe&&C===J.current)return;const ze=B.current;if(pe||Re){const ve=R??null;if(C===ve){B.current=!1;return}let ge=ry;ze?ge=sy:pe&&(ge=xv),ue(ve,ge);return}ze&&ne!=null&&(K(C,sy),B.current=!1)},[R,w,K,ne,O,D,C]);const he=St("div",l,{state:{orientation:d,tabActivationDirection:$},ref:a,props:y,stateAttributesMapping:Zs});return z.jsx(a0.Provider,{value:Q,children:z.jsx(Jd,{elementsRef:S,children:he})})});function ld(o,l){for(const[a,r]of o.entries())if(l===r.value)return a;return null}function Wy(o,l,a,r){if(o==null||l==null)return"none";const[c,f,d]=a==="horizontal"?["left","left","right"]:["top","up","down"],m=ld(r,o),h=ld(r,l);if(m==null||h==null)return m!==h&&(typeof o=="number"||typeof o=="string")&&typeof o==typeof l?l>o?d:f:"none";const g=m.getBoundingClientRect()[c],y=h.getBoundingClientRect()[c];return y<g?f:y>g?d:"none"}const r0=v.createContext(void 0);function CO(){const o=v.useContext(r0);if(o===void 0)throw new Error(Qt(65));return o}const OO=v.forwardRef(function(l,a){const{className:r,disabled:c=!1,render:f,value:d,id:m,nativeButton:h=!0,style:g,...y}=l,{value:b,getTabPanelIdByValue:S,onValueChange:E,orientation:T,tabActivationDirection:C}=ep(),{activateOnFocus:O,registerTabResizeObserverElement:w,tabsListElement:D}=CO(),{highlightedIndex:A,onHighlightedIndexChange:M}=Qs(),H=Bl(m),U=v.useMemo(()=>({disabled:c,id:H,value:d}),[c,H,d]),{compositeProps:j,compositeRef:k,index:W}=qb({metadata:U}),$=d===b,F=v.useRef(!1),Y=v.useRef(null),ee=Oe(oe=>{Y.current?.(),Y.current=oe?w(oe):null});be(()=>{if(F.current){F.current=!1;return}if(!($&&W>-1&&A!==W))return;const oe=D;if(oe!=null){const ie=Ht(Xe(oe));if(ie&&De(oe,ie))return}c||M(W)},[$,W,A,M,c,D]);const{getButtonProps:le,buttonRef:K}=qa({disabled:c,native:h,focusableWhenDisabled:!0}),N=S(d),P=v.useRef(!1),I=v.useRef(!1);function Q(oe){E(d,Ke(qs,oe.nativeEvent,void 0,{activationDirection:"none"}))}function ne(oe){$||c||Q(oe)}function R(oe){$||c||O&&(!P.current||I.current)&&Q(oe)}function B(oe){if($||c)return;P.current=!0,I.current=oe.button===0;const ie=Xe(oe.currentTarget);function he(){P.current=!1,I.current=!1,ie.removeEventListener("pointerup",he),ie.removeEventListener("pointercancel",he)}ie.addEventListener("pointerup",he),ie.addEventListener("pointercancel",he)}return St("button",l,{state:{disabled:c,active:$,orientation:T,tabActivationDirection:C},ref:[a,K,k,ee],props:[j,{role:"tab","aria-controls":N,"aria-selected":$,id:H,onClick:ne,onFocus:R,onPointerDown:B,[$d]:$?"":void 0,onKeyDownCapture(){F.current=!0}},y,le],stateAttributesMapping:Zs})});function wO(o,l){const a=yt(o).getComputedStyle(o).transform;let r=0,c=0,f=1;if(a&&a!=="none"){const d=a.match(/matrix(?:3d)?\(([^)]+)\)/);if(d){const m=d[1].split(", ").map(parseFloat);m.length===6?(r=m[4],c=m[5],f=Math.sqrt(m[0]*m[0]+m[1]*m[1])):m.length===16&&(r=m[12],c=m[13],f=m[0])}}return{x:r,y:c,scale:f}}const AO="data-index",MO={...Zs,...Ys},DO=v.forwardRef(function(l,a){const{className:r,value:c,render:f,keepMounted:d=!1,style:m,...h}=l,{value:g,getTabIdByPanelValue:y,orientation:b,tabActivationDirection:S,registerMountedTabPanel:E}=ep(),T=Bl(),{ref:C,index:O}=Fd(),w=c===g,{mounted:D,transitionStatus:A,setMounted:M}=fb(w),H=!D,U=y(c),j={hidden:H,orientation:b,tabActivationDirection:S,transitionStatus:A},k=v.useRef(null),W=St("div",l,{state:j,ref:[a,C,k],props:[{"aria-labelledby":U,hidden:H,id:T,role:"tabpanel",tabIndex:w?0:-1,inert:Ks(!w),[AO]:O},h],stateAttributesMapping:MO});return Hi({open:w,ref:k,onComplete(){w||M(!1)}}),be(()=>{if(!(T==null||H&&!d))return E(c,T)},[H,d,c,T,E]),d||D?W:null}),NO=v.forwardRef(function(l,a){const{activateOnFocus:r=!1,className:c,loopFocus:f=!0,render:d,style:m,...h}=l,{orientation:g,setTabMap:y,tabActivationDirection:b}=ep(),[S,E]=v.useState(0),[T,C]=v.useState(null),O=v.useRef(new Set),w=v.useRef(new Set),D=v.useRef(null);be(()=>{if(typeof ResizeObserver>"u")return;const k=new ResizeObserver(()=>{O.current.forEach(W=>{W()})});return D.current=k,T&&k.observe(T),w.current.forEach(W=>{k.observe(W)}),()=>{k.disconnect(),D.current=null}},[T]);const A=Oe(k=>(O.current.add(k),()=>{O.current.delete(k)})),M=Oe(k=>(w.current.add(k),D.current?.observe(k),()=>{w.current.delete(k),D.current?.unobserve(k)})),H={orientation:g,tabActivationDirection:b},U={"aria-orientation":g==="vertical"?"vertical":void 0,role:"tablist"},j=v.useMemo(()=>({activateOnFocus:r,registerIndicatorUpdateListener:A,registerTabResizeObserverElement:M,tabsListElement:T}),[r,A,M,T]);return z.jsx(r0.Provider,{value:j,children:z.jsx(xO,{render:d,className:c,style:m,state:H,refs:[a,C],props:[U,h],stateAttributesMapping:Zs,highlightedIndex:S,enableHomeAndEndKeys:!0,loopFocus:f,orientation:g,onHighlightedIndexChange:E,onMapChange:y,disabledIndices:Eo})})}),s0=v.createContext(void 0);function Js(){const o=v.useContext(s0);if(!o)throw new Error(Qt(73));return o}let $y=0;function u0(o){return $y+=1,`${o}-${Math.random().toString(36).slice(2,6)}-${$y}`}function Nf(o,l){if(typeof o=="string")return{description:o};if(typeof o=="function"){const a=o(l);return typeof a=="string"?{description:a}:a}return o}function zf(o){const l=new Map;let a=0,r=0;return o.forEach((c,f)=>{const d=c.transitionStatus==="ending";l.set(c.id,{value:c,domIndex:f,visibleIndex:d?-1:a,offsetY:r}),r+=c.height||0,d||(a+=1)}),l}function _f(o,l){let a=0;return o.map(r=>{if(r.transitionStatus==="ending")return r;const c=a>=l;return a+=1,r.limited===c?r:{...r,limited:c}})}const Yn={toasts:o=>o.toasts,isEmpty:o=>o.toasts.length===0,toast:(o,l)=>o.toastMetadata.get(l)?.value,toastIndex:(o,l)=>o.toastMetadata.get(l)?.domIndex??-1,toastOffsetY:(o,l)=>o.toastMetadata.get(l)?.offsetY??0,toastVisibleIndex:(o,l)=>o.toastMetadata.get(l)?.visibleIndex??-1,focused:o=>o.focused,expanded:o=>o.hovering||o.focused,expandedOrOutOfFocus:o=>o.hovering||o.focused||!o.isWindowFocused,prevFocusElement:o=>o.prevFocusElement};class zO extends Ia{timers=new Map;areTimersPaused=!1;constructor(l){super({...l,toastMetadata:zf(l.toasts)},{},Yn)}setViewport=l=>{this.set("viewport",l)};syncProviderProps(l,a){const r=this.state.limit!==a;if(this.state.timeout===l&&!r)return;const c={timeout:l,limit:a};if(r){const f=_f(this.state.toasts,a);c.toasts=f,c.toastMetadata=zf(f)}this.update(c)}disposeEffect=()=>()=>{this.timers.forEach(l=>{l.timeout?.clear()}),this.timers.clear()};removeToast(l,a=!1){const r=Yn.toastIndex(this.state,l);if(r===-1)return;const c=this.state.toasts[r];a||c?.onRemove?.();const f=[...this.state.toasts];f.splice(r,1),this.setToasts(f)}addToast=l=>{const{timeout:a,limit:r}=this.state,c=l.id||u0("toast");if(l.id){const h=Yn.toast(this.state,l.id);if(h)if(h.transitionStatus==="ending")this.removeToast(l.id,!0);else{const{id:g,transitionStatus:y,...b}=l;return this.updateToastInternal(l.id,b,!0,!0),l.id}}const f={...l,id:c,updateKey:0,transitionStatus:"starting"},d=[f,...this.state.toasts];this.setToasts(_f(d,r));const m=f.timeout??a;return f.type!=="loading"&&m>0&&this.scheduleTimer(c,m,()=>this.closeToast(c)),Yn.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),c};updateToast=(l,a)=>{const r=Yn.toast(this.state,l);!r||r.transitionStatus==="ending"||this.updateToastInternal(l,typeof a=="function"?a(r):a,!1,!0)};updateToastInternal=(l,a,r=!1,c=!1)=>{const{timeout:f,toasts:d}=this.state,m=Yn.toast(this.state,l);if(!m||m.transitionStatus==="ending")return;const h={...m,...a,...c&&{updateKey:m.updateKey+1}};this.setToasts(d.map(O=>O.id===l?h:O));const g=h.timeout??f,y=m.timeout??f,b=Object.hasOwn(a,"timeout"),S=h.transitionStatus!=="ending"&&h.type!=="loading"&&g>0,E=this.timers.has(l),T=y!==g,C=m.type==="loading";if(!S&&E){this.clearTimer(l);return}S&&(!E||T||b||C||r)&&(this.clearTimer(l),this.scheduleTimer(l,g,()=>this.closeToast(l)),Yn.expandedOrOutOfFocus(this.state)&&this.pauseTimers())};closeToast=l=>{const a=l===void 0,{limit:r,toasts:c}=this.state;let f;if(a)f=c,this.clearTimers();else{const h=Yn.toast(this.state,l);if(!h)return;f=[h],this.clearTimer(l)}const d=c.map(h=>a||h.id===l?{...h,transitionStatus:"ending",height:0}:h),m=_f(d,r);this.setToasts(m,!m.some(h=>h.transitionStatus!=="ending")),f.forEach(h=>{h.transitionStatus!=="ending"&&h.onClose?.()}),this.handleFocusManagement(l)};promiseToast=(l,a)=>{const r=Nf(a.loading),c=this.addToast({...r,type:"loading"}),f=l.then(d=>{const m=Nf(a.success,d);return this.updateToast(c,{...m,type:"success",timeout:m.timeout}),d}).catch(d=>{const m=Nf(a.error,d);return this.updateToast(c,{...m,type:"error",timeout:m.timeout}),Promise.reject(d)});return{}.hasOwnProperty.call(a,"setPromise")&&a.setPromise(f),f};pauseTimers(){this.areTimersPaused||(this.areTimersPaused=!0,this.timers.forEach(l=>{l.timeout&&(l.timeout.clear(),l.remaining=Math.max(l.remaining-(Date.now()-l.start),0))}))}resumeTimers(){this.areTimersPaused&&(this.areTimersPaused=!1,this.timers.forEach((l,a)=>{l.remaining=l.remaining>0?l.remaining:l.delay,l.timeout??=yn.create(),l.timeout.start(l.remaining,()=>{this.handleTimerFired(a),l.callback()}),l.start=Date.now()}))}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=l=>{if(l.pointerType!=="touch")return;const a=bt(l);De(this.state.viewport,a)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))};scheduleTimer(l,a,r){const c=Date.now(),d=!Yn.expandedOrOutOfFocus(this.state)?yn.create():void 0;d?.start(a,()=>{this.handleTimerFired(l),r()}),this.timers.set(l,{timeout:d,start:c,delay:a,remaining:a,callback:r})}clearTimers(){this.timers.forEach(l=>{l.timeout?.clear()}),this.timers.clear(),this.areTimersPaused=!1}clearTimer(l){this.timers.get(l)?.timeout?.clear(),this.timers.delete(l),this.resetPausedStateIfNoTimersRemain()}handleTimerFired(l){this.timers.delete(l),this.resetPausedStateIfNoTimersRemain()}resetPausedStateIfNoTimersRemain(){this.timers.size===0&&(this.areTimersPaused=!1)}setToasts(l,a=l.length===0){const r={toasts:l,toastMetadata:zf(l)};a&&(r.hovering=!1,r.focused=!1),this.update(r)}handleFocusManagement(l){const a=Ht(Xe(this.state.viewport));if(!this.state.viewport||!De(this.state.viewport,a)||!Ss(a))return;if(l===void 0){this.restoreFocusToPrevElement();return}const r=Yn.toasts(this.state),c=Yn.toastIndex(this.state,l),f=(m,h)=>{for(let g=m;g>=0&&g<r.length;g+=h)if(r[g].transitionStatus!=="ending")return r[g];return null},d=f(c+1,1)??f(c-1,-1);d?d.ref?.current?.focus():this.restoreFocusToPrevElement()}}const _O=function(l){const{children:a,timeout:r=5e3,limit:c=3,toastManager:f}=l,d=Zt(()=>new zO({timeout:r,limit:c,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return zs(d.disposeEffect),v.useEffect(function(){return f?f[" subscribe"](({action:g,options:y})=>{const b=y.id;g==="promise"&&y.promise?d.promiseToast(y.promise,y):g==="update"&&b?d.updateToast(b,y.updates):g==="close"?d.closeToast(b):d.addToast(y)}):void 0},[d,f]),z.jsxs(s0.Provider,{value:d,children:[z.jsx(HO,{store:d,timeout:r,limit:c}),a]})};function HO(o){const{store:l,timeout:a,limit:r}=o;return be(()=>{l.syncProviderProps(a,r)},[l,a,r]),null}const jO="--toast-frontmost-height",kO=v.forwardRef(function(l,a){const{render:r,className:c,style:f,children:d,...m}=l,h=Js(),g=Jt(),y=v.useRef(!1),b=v.useRef(!1),S=v.useRef(!1),E=h.useState("isEmpty"),T=h.useState("toasts"),C=h.useState("focused"),O=h.useState("expanded"),w=h.useState("prevFocusElement"),D=T[0]?.height,A=T.some(Q=>Q.transitionStatus==="ending"),M=T.filter(Q=>Q.priority==="high");v.useEffect(()=>{const Q=h.state.viewport;if(!Q||E)return;const ne=yt(Q),R=Xe(Q);function B(oe){oe.key==="F6"&&bt(oe)!==Q&&(oe.preventDefault(),h.set("prevFocusElement",Ht(R)),Q?.focus({preventScroll:!0}),h.pauseTimers(),h.set("focused",!0))}function J(oe){bt(oe)===ne&&(h.set("isWindowFocused",!1),h.pauseTimers())}function V(oe){if(oe.relatedTarget)return;const ie=bt(oe),he=Ht(Xe(Q));(ie===ne||!De(Q,ie)||!Ss(he))&&h.resumeTimers(),g.start(0,()=>h.set("isWindowFocused",!0))}return In(Ye(ne,"keydown",B),Ye(ne,"blur",J,!0),Ye(ne,"focus",V,!0),Ye(R,"pointerdown",h.handleDocumentPointerDown,!0))},[h,g,E]);function H(Q){y.current=!0;const ne=Q.relatedTarget===h.state.viewport?T.find(R=>R.transitionStatus!=="ending"&&!R.limited):void 0;ne?ne.ref?.current?.focus():h.restoreFocusToPrevElement()}function U(Q){Q.key==="Tab"&&Q.shiftKey&&bt(Q.nativeEvent)===h.state.viewport&&(Q.preventDefault(),h.restoreFocusToPrevElement())}function j(){h.state.toasts.some(ne=>ne.transitionStatus==="ending")||S.current||!b.current||(h.state.isWindowFocused&&h.resumeTimers(),h.set("hovering",!1),b.current=!1)}v.useEffect(j,[A,h]);function k(){h.pauseTimers(),h.set("hovering",!0),b.current=!1}function W(){h.state.isWindowFocused&&h.resumeTimers()}function $(){b.current=!0,j()}function F(Q){Q.pointerType==="touch"&&(S.current=!0)}function Y(Q){Q.pointerType==="touch"&&(S.current=!1,j())}function ee(){if(y.current){y.current=!1;return}C||Ss(Ht(Xe(h.state.viewport)))&&(h.set("focused",!0),h.pauseTimers())}function le(Q){!C||De(h.state.viewport,Q.relatedTarget)||(h.set("focused",!1),W())}const K={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:k,onMouseMove:k,onMouseLeave:$,onFocus:ee,onBlur:le,onKeyDown:U,onClick:ee,onPointerDown:F,onPointerUp:Y,onPointerCancel:Y,style:{[jO]:D?`${D}px`:void 0}},N={expanded:O},P=!E&&w&&z.jsx(Hl,{onFocus:H}),I=St("div",l,{ref:[a,h.setViewport],state:N,props:[K,m,{children:z.jsxs(v.Fragment,{children:[P,d,P]})}]});return z.jsxs(v.Fragment,{children:[P,I,!C&&M.length>0&&z.jsx("div",{style:Cv,children:M.map(Q=>z.jsxs("div",{role:"alert","aria-atomic":!0,children:[z.jsx("div",{children:Q.title}),z.jsx("div",{children:Q.description})]},Q.id))})]})}),c0=v.createContext(void 0);function tp(){const o=v.useContext(c0);if(!o)throw new Error(Qt(66));return o}function Hf(o,l,a){switch(o){case"up":return-a;case"down":return a;case"left":return-l;case"right":return l;default:return 0}}const UO="--toast-index",LO="--toast-offset-y",BO="--toast-height",YO="--toast-swipe-movement-x",IO="--toast-swipe-movement-y",qO="data-swipe-direction",PO={...Ys,swipeDirection(o){return o?{[qO]:o}:null}},ev=40,VO=10,tv=.5,GO=1,XO=`${OE},${wE}`,KO=v.forwardRef(function(l,a){const{toast:r,render:c,className:f,swipeDirection:d=["down","right"],style:m,...h}=l,g=r.positionerProps?.anchor!==void 0;let y=[];g||(y=Array.isArray(d)?d:[d]);const b=y.length>0,S=Js(),[E,T]=v.useState(void 0),[C,O]=v.useState(!1),[w,D]=v.useState(!1),[A,M]=v.useState({x:0,y:0}),[H,U]=v.useState({x:0,y:0,scale:1}),[j,k]=v.useState(),[W,$]=v.useState(),[F,Y]=v.useState(null),ee=v.useRef(null),le=v.useRef(void 0),K=v.useRef({x:0,y:0}),N=v.useRef({x:0,y:0,scale:1}),P=v.useRef(void 0),I=v.useRef(0),Q=v.useRef(!1),ne=v.useRef({x:0,y:0}),R=v.useRef(!1),B=v.useRef({x:0,y:0}),J=v.useRef(null),V=v.useRef(null),oe=S.useState("toastIndex",r.id),ie=S.useState("toastVisibleIndex",r.id),he=S.useState("toastOffsetY",r.id),ue=S.useState("focused"),pe=S.useState("expanded");Hi({open:r.transitionStatus!=="ending",ref:ee,onComplete(){r.transitionStatus==="ending"&&S.removeToast(r.id)}});const Re=Oe((Ae=!1)=>{const fe=ee.current;if(!fe)return;const me=fe.style.height;fe.style.height="auto";const de=fe.offsetHeight;fe.style.height=me;function ae(){S.updateToastInternal(r.id,{ref:ee,height:de,transitionStatus:void 0})}Ae?qn.flushSync(ae):ae()});be(()=>{const Ae=le.current;r.transitionStatus!=="starting"&&Ae===r.id||(Ae!==void 0&&(T(void 0),U({x:0,y:0,scale:1}),ze({x:0,y:0})),le.current=r.id,Re())},[Re,r.id,r.transitionStatus]);function ze(Ae){B.current=Ae,M(Ae)}be(()=>()=>{V.current?.abort()},[]);function ve(Ae,fe){const me=ye=>ye>0?ye**tv:-(Math.abs(ye)**tv),de=Ae>0&&!y.includes("right")||Ae<0&&!y.includes("left"),ae=fe>0&&!y.includes("down")||fe<0&&!y.includes("up");return{x:de?me(Ae):Ae,y:ae?me(fe):fe}}const ge=Oe(Ae=>{if(Ae.pointerId!==J.current)return;J.current=null,V.current?.abort(),V.current=null,O(!1),D(!1),Y(null);const fe=N.current;if(Ae.type==="pointercancel"||Q.current){ze({x:fe.x,y:fe.y}),T(void 0);return}const me=B.current,de=me.x-fe.x,ae=me.y-fe.y;let ye;for(const Le of y)if(Hf(Le,de,ae)>ev){ye=Le;break}ye?(T(ye),S.closeToast(r.id)):(ze({x:fe.x,y:fe.y}),T(void 0))});function _e(Ae){if(Ae.button!==0||(Ae.pointerType==="touch"&&S.pauseTimers(),bt(Ae.nativeEvent)?.closest(`button,a,input,textarea,[role="button"],${XO}`)))return;Q.current=!1,P.current=void 0,I.current=0,J.current=Ae.pointerId,K.current={x:Ae.clientX,y:Ae.clientY},ne.current=K.current;const de=Ae.currentTarget,ae=wO(de);N.current=ae,U(ae),ze({x:ae.x,y:ae.y}),S.set("hovering",!0),O(!0),D(!1),Y(null),R.current=!0,V.current?.abort();const ye=new AbortController;V.current=ye;const Le=Xe(de);Le.addEventListener("pointerup",ge,{signal:ye.signal}),Le.addEventListener("pointercancel",ge,{signal:ye.signal}),de.setPointerCapture?.(Ae.pointerId)}function ke(Ae){if(Ae.pointerId!==J.current)return;Ae.preventDefault(),R.current&&(K.current={x:Ae.clientX,y:Ae.clientY},R.current=!1);const{clientY:fe,clientX:me,movementX:de,movementY:ae}=Ae;(ae<0&&fe>ne.current.y||ae>0&&fe<ne.current.y)&&(ne.current={x:ne.current.x,y:fe}),(de<0&&me>ne.current.x||de>0&&me<ne.current.x)&&(ne.current={x:me,y:ne.current.y});const ye=me-K.current.x,Le=fe-K.current.y,Lt=fe-ne.current.y,$t=me-ne.current.x;let Tt=F;if(!w&&Math.sqrt(ye*ye+Le*Le)>=GO){D(!0);const At=y.includes("left")||y.includes("right"),jn=y.includes("up")||y.includes("down");if(At&&jn){const Ge=Math.abs(ye),xt=Math.abs(Le);Tt=Ge>xt?"horizontal":"vertical",Y(Tt)}}let Se;if(!P.current)Tt==="vertical"?Le>0?Se="down":Le<0&&(Se="up"):Tt==="horizontal"?ye>0?Se="right":ye<0&&(Se="left"):Math.abs(ye)>=Math.abs(Le)?Se=ye>0?"right":"left":Se=Le>0?"down":"up",Se&&y.includes(Se)&&(P.current=Se,I.current=Hf(Se,ye,Le),T(Se));else{const Sn=P.current,At=Hf(Sn,$t,Lt);At>ev?(Q.current=!1,T(Sn)):!(y.includes("left")&&y.includes("right"))&&!(y.includes("up")&&y.includes("down"))&&I.current-At>=VO&&(Q.current=!0)}const Ie=ve(ye,Le);let tt=N.current.x,pt=N.current.y;const bn=y.includes("left")||y.includes("right"),Hn=y.includes("up")||y.includes("down");Tt!=="vertical"&&bn&&(tt+=Ie.x),Tt!=="horizontal"&&Hn&&(pt+=Ie.y),ze({x:tt,y:pt})}function Pe(Ae){if(Ae.key==="Escape"){if(!ee.current||!De(ee.current,Ht(Xe(ee.current))))return;S.closeToast(r.id)}}v.useEffect(()=>{const Ae=ee.current;if(!b||!Ae)return;function fe(me){J.current===null||!De(Ae,bt(me))||me.preventDefault()}return Ye(Ae,"touchmove",fe,{passive:!1})},[b]);function xe(){const Ae=A.x-H.x,fe=A.y-H.y;return{transition:C?"none":void 0,transform:C?`translateX(${A.x}px) translateY(${A.y}px) scale(${H.scale})`:void 0,[YO]:`${Ae}px`,[IO]:`${fe}px`}}const Ue=r.priority==="high",Te={role:Ue?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":j,"aria-describedby":W,"aria-hidden":Ue&&!ue?!0:void 0,onPointerDown:b?_e:void 0,onPointerMove:b?ke:void 0,onPointerUp:b?ge:void 0,onPointerCancel:b?ge:void 0,onKeyDown:Pe,inert:Ks(r.limited),style:{...xe(),[UO]:r.transitionStatus==="ending"?oe:ie,[LO]:`${he}px`,[BO]:r.height?`${r.height}px`:void 0}},Ee=v.useMemo(()=>({toast:r,setTitleId:k,setDescriptionId:$,recalculateHeight:Re,visibleIndex:ie,expanded:pe}),[r,k,$,Re,ie,pe]),we={transitionStatus:r.transitionStatus,expanded:pe,limited:r.limited||!1,type:r.type,swiping:C,swipeDirection:E},Qe=St("div",l,{ref:[a,ee],state:we,stateAttributesMapping:PO,props:[Te,h]});return z.jsx(c0.Provider,{value:Ee,children:Qe})}),QO=v.forwardRef(function(l,a){const{render:r,className:c,style:f,...d}=l,{visibleIndex:m,expanded:h,recalculateHeight:g}=tp(),y=v.useRef(null);be(()=>{g();const E=y.current;if(!E||typeof ResizeObserver!="function"||typeof MutationObserver!="function")return;const T=new ResizeObserver(()=>g(!0)),C=new MutationObserver(()=>g(!0));return T.observe(E),C.observe(E,{childList:!0,subtree:!0,characterData:!0}),()=>{T.disconnect(),C.disconnect()}},[g]);const b=m>0;return St("div",l,{ref:[a,y],state:{expanded:h,behind:b},props:d})});function f0(o){return o==null||typeof o=="boolean"||o===""?!1:Array.isArray(o)?o.some(f0):!0}function FO(o){return v.isValidElement(o)&&f0(o.props.children)}function d0(o,l,a){const{toast:r,setTitleId:c,setDescriptionId:f}=tp(),d=a==="title"?c:f,m=l??(a==="title"?r.title:r.description);return{id:jl(o),children:m,type:r.type,setId:d}}function p0(o,l,a){const r=FO(o);return be(()=>{if(r)return a(l),()=>{a(c=>c===l?void 0:c)}},[r,l,a]),r?o:null}const ZO=v.forwardRef(function(l,a){const{render:r,className:c,style:f,id:d,children:m,...h}=l,{id:g,children:y,type:b,setId:S}=d0(d,m,"description"),T=St("p",l,{ref:a,state:{type:b},props:{...h,id:g,children:y}});return p0(T,g,S)}),JO=v.forwardRef(function(l,a){const{render:r,className:c,style:f,id:d,children:m,...h}=l,{id:g,children:y,type:b,setId:S}=d0(d,m,"title"),T=St("h2",l,{ref:a,state:{type:b},props:{...h,id:g,children:y}});return p0(T,g,S)}),WO=v.forwardRef(function(l,a){const{render:r,className:c,style:f,disabled:d,nativeButton:m=!0,...h}=l,g=Js(),{toast:y,expanded:b}=tp(),[S,E]=v.useState(!1),{getButtonProps:T,buttonRef:C}=qa({disabled:d,native:m}),O={type:y.type};return St("button",l,{ref:[a,C],state:O,props:[{"aria-hidden":!b&&!S,onClick(){g.closeToast(y.id)},onFocus(){E(!0)},onBlur(){E(!1)}},h,T]})}),$O=v.forwardRef(function(l,a){return z.jsx(Cb,{ref:a,...l})});function ew(){const o=Js(),l=o.useState("toasts");return v.useMemo(()=>({toasts:l,add:o.addToast,close:o.closeToast,update:o.updateToast,promise:o.promiseToast}),[l,o])}function tw(){const o=new Set;function l(a){o.forEach(r=>r(a))}return{" subscribe":function(r){return o.add(r),()=>{o.delete(r)}},add(a){const r=a.id||u0("toast"),c={...a,id:r,transitionStatus:"starting"};return l({action:"add",options:c}),r},close(a){l({action:"close",options:{id:a}})},update(a,r){l({action:"update",options:{id:a,updates:r}})},promise(a,r){let c=a;return l({action:"promise",options:{...r,promise:a,setPromise(f){c=f}}}),c}}}function nw({value:o,onChange:l,items:a,className:r,trailing:c}){return z.jsxs(RO,{value:o,onValueChange:f=>l(f),className:Oo("flex min-h-0 flex-col",r),children:[z.jsxs("div",{className:"flex h-9 shrink-0 items-center gap-1 border-b border-line px-2",children:[z.jsx(NO,{className:"relative flex items-center gap-1",children:a.map(f=>z.jsx(OO,{value:f.value,className:"h-7 rounded-md px-2 text-[13px] font-medium text-fg-muted outline-none hover:text-fg data-[active]:bg-hover data-[active]:text-fg focus-visible:outline-2 focus-visible:outline-accent",children:f.label},f.value))}),z.jsx("div",{className:"ml-auto flex items-center gap-1",children:c})]}),a.map(f=>z.jsx(DO,{value:f.value,className:"min-h-0 flex-1 overflow-auto outline-none",children:f.content},f.value))]})}function h0({icon:o,title:l,children:a}){return z.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-8 text-center text-fg-muted",children:[o?z.jsx("div",{className:"text-fg-subtle",children:o}):null,z.jsx("div",{className:"text-[15px] font-semibold text-fg",children:l}),a?z.jsx("div",{className:"max-w-sm",children:a}):null]})}const g0=tw();function ow(o){if(o.repeat||o.key!=="Enter"&&o.key!==" ")return;const l=o.currentTarget.closest("[data-toast]")??o.currentTarget,a=l.ownerDocument.defaultView;a&&MR(a,o.key,r=>r instanceof a.Node&&l.contains(r))}function lw(){const{toasts:o}=ew();return o.map(l=>z.jsxs(KO,{toast:l,"data-toast":"",className:"pointer-events-auto flex w-80 items-start gap-3 rounded-lg bg-surface p-3 text-fg shadow-popup transition-[opacity,transform] data-[starting-style]:translate-y-2 data-[starting-style]:opacity-0 data-[ending-style]:opacity-0",children:[z.jsxs(QO,{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[z.jsx(JO,{className:"text-[13px] font-semibold"}),z.jsx(ZO,{className:"text-xs text-fg-muted"})]}),z.jsx(WO,{"aria-label":"Dismiss",onKeyDown:ow,className:"rounded p-0.5 text-fg-muted hover:bg-hover",children:z.jsx(n0,{className:"size-3.5"})})]},l.id))}function iw({children:o}){return z.jsxs(_O,{toastManager:g0,timeout:4e3,children:[o,z.jsx($O,{children:z.jsx(kO,{className:"pointer-events-none fixed bottom-4 right-4 z-[1100] flex flex-col gap-2",children:z.jsx(lw,{})})})]})}const aw=["a[href]","button","iframe","input","select","textarea","summary","audio[controls]","video[controls]","[contenteditable]:not([contenteditable='false'])","[tabindex]"].join(", "),rw="audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])";function sw(o){return!(o.tabIndex>=0||!o.hasAttribute("tabindex")&&o.matches(rw))||o.getAttribute("aria-hidden")==="true"||o.matches(":disabled")?!1:typeof o.checkVisibility!="function"||o.checkVisibility({visibilityProperty:!0})}function uw(o){return Array.from(o.querySelectorAll(aw)).filter(sw)}function cw(o){const l=a=>!/visible|hidden|clip/.test(a);return o.scrollWidth>o.clientWidth+1&&l(o.overflowX)||o.scrollHeight>o.clientHeight+1&&l(o.overflowY)}function fw(o){const[l,a]=v.useState(!1);return v.useLayoutEffect(()=>{const r=o.current,c=r?.ownerDocument.defaultView;if(!r||!c)return;const f=()=>{const y=c.getComputedStyle(r);a(cw({scrollWidth:r.scrollWidth,clientWidth:r.clientWidth,scrollHeight:r.scrollHeight,clientHeight:r.clientHeight,overflowX:y.overflowX,overflowY:y.overflowY}))};if(f(),typeof c.ResizeObserver!="function")return;const d=new c.ResizeObserver(f),m=new Set,h=y=>{if(y.nodeType!==1)return;const b=y;if(c.getComputedStyle(b).display==="contents"){b.childNodes.forEach(h);return}m.has(b)||(m.add(b),d.observe(b))};d.observe(r),r.childNodes.forEach(h);const g=new c.MutationObserver(y=>{for(const b of y)b.addedNodes.forEach(h);for(const b of m)r.contains(b)||(d.unobserve(b),m.delete(b));f()});return g.observe(r,{childList:!0,subtree:!0,characterData:!0}),()=>{d.disconnect(),g.disconnect()}},[o]),l}v.forwardRef(function({label:l,className:a,...r},c){const f=v.useRef(null),d=v.useCallback(E=>{f.current=E,typeof c=="function"?c(E):c&&(c.current=E)},[c]),m=fw(f),[h,g]=v.useState(!1),[y,b]=v.useState(null);v.useLayoutEffect(()=>{const E=f.current,T=E?.ownerDocument.defaultView;if(!m||!E||!T)return;const C=()=>{g(uw(E).length===0),b(E.closest('[role="dialog"], [role="alertdialog"]')?.getAttribute("aria-labelledby")??null)};C();const O=new T.MutationObserver(C);return O.observe(E,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["tabindex","disabled","hidden","href","contenteditable"]}),()=>O.disconnect()},[m]);const S=m&&h;return z.jsx("div",{ref:d,...S?{role:"group",tabIndex:0,"aria-labelledby":l===void 0?y??void 0:void 0,"aria-label":l??(y===null?"Panel content":void 0)}:{},className:Oo(S&&"focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-accent",a),...r})});const dw={blur:{label:"Blur",unit:"px",min:0,max:200,step:1,identity:0,initial:4},brightness:{label:"Brightness",unit:"%",min:0,max:500,step:1,identity:100,initial:120},contrast:{label:"Contrast",unit:"%",min:0,max:500,step:1,identity:100,initial:120},grayscale:{label:"Grayscale",unit:"%",min:0,max:100,step:1,identity:0,initial:100},saturate:{label:"Saturate",unit:"%",min:0,max:500,step:1,identity:100,initial:150},"hue-rotate":{label:"Hue rotate",unit:"deg",min:-360,max:360,step:1,identity:0,initial:90},invert:{label:"Invert",unit:"%",min:0,max:100,step:1,identity:0,initial:100},sepia:{label:"Sepia",unit:"%",min:0,max:100,step:1,identity:0,initial:100},opacity:{label:"Opacity",unit:"%",min:0,max:100,step:1,identity:100,initial:50}};[...Object.keys(dw)];const pw={cancel:"Cancel",close:"Close",copy:"Copy",copied:"Copied",copyLink:"Copy link",loading:"Loading…",justNow:"just now",never:"never",agent:"Agent",delete:"Delete",rename:"Rename",duplicate:"Duplicate",pin:"Pin",unpin:"Unpin",open:"Open",save:"Save",updated:"Updated {when}",pinned:"Pinned",unpinned:"Unpinned",duplicated:"Duplicated",couldNotPin:"Could not pin: {error}",couldNotUnpin:"Could not unpin: {error}",couldNotRename:"Could not rename: {error}",couldNotDuplicate:"Could not duplicate: {error}",couldNotDelete:"Could not delete: {error}",statusNone:"No session",statusWorking:"Working",statusIdle:"Idle",statusWaiting:"Waiting",statusOffline:"Offline",working:"{agent} is working…",artifactOptions:"Artifact options",artifactName:"Artifact name",comments:"Comments",doneCommenting:"Done commenting",openComment:"1 open comment",openComments:"{count} open comments",commentOptions:"Comment options",showAllComments:"Show all comments",hideComments:"Hide comments",share:"Share",sharedOnNetwork:"Shared with your network",onlyThisComputer:"Only this computer",ask:"Ask {agent}",hideAsk:"Hide",openHarnessSession:"Open the {harness} session",messageAgent:"Message {agent} about this artifact",switchArtifact:"Switch artifact",inThisSession:"In this session",recent:"Recent",allArtifacts:"All artifacts",export:"Export",openSession:"Open session",offline:"offline",versionHistory:"Version history",openInNewTab:"Open in new tab",refresh:"Refresh",storage:"Storage",inThisFolder:"{size} in this folder",copyPath:"Copy path",linkCopied:"Link copied",pathCopied:"Path copied",deleteTitle:'Delete "{title}"?',deleteBody:"It leaves your artifacts. Its folder stays where it is: {root}",shareTitle:"Share this artifact",peopleWithAccess:"People with access",joinedPeople:"People who joined",noneJoined:"Nobody has joined yet. Send someone a link below.",online:"Online",seenAgo:"Seen {when}",guestPaused:"Link off: no access until it is back on",changeRole:"Change {name}'s role",roleLinkOff:"Link off",remove:"Remove",removeGuest:"Remove {name}",removeTitle:"Remove {name}?",removeBody:"They lose access to this artifact. They can join again with a link.",you:"(you)",thisComputer:"This computer",owner:"Owner",generalAccess:"General access",onLan:"Anyone on your network with a link",onlyHereSub:"Nobody else can open the links.",onLanSub:"People on the same Wi-Fi or LAN open it with a link; the link sets their role.",onNetworkAt:"On this network at {addresses}",onTailnet:"Tailscale: {address}, for people on your tailnet from any network (copy it from a link's More menu)",noAddress:"This computer has no local network address.",whereOff:"Only this computer can open these links for now. Copying one opens this to your network.",inviteLinks:"Invite links",roleEditor:"Editor",roleCommenter:"Commenter",roleViewer:"Viewer",linkEditor:"Can edit",linkCommenter:"Can comment",linkViewer:"Can view",noteEditor:"Edit and comment",noteCommenter:"Comment, no edits",noteViewer:"Read only",linkOff:"Off: nobody can join with it",turnOn:"Turn on",more:"More",moreFor:"More: {role}",copyTailnet:"Copy Tailscale link",copyTailnetNote:"For people on your tailnet, off this network ({address})",turnOnLink:"Turn on link",turnOffLink:"Turn off link",turnOffNote:"Whoever joined with it loses access until it is back on",resetLink:"Reset link",resetNote:"A new address; whoever joined with the old one is removed",resetTitle:'Reset the "{role}" link?',resetBody:"The old link stops working and the people who joined with it lose access.",plainHttp:"This is plain HTTP: others on the network can read what passes. A link is the permission: whoever has it gets its role, so send it only to the people meant to have it, and reset a link that went further.",cannotShare:"{type} pages can't be shared on the network yet: only this computer opens it.",shareError:"Could not do that: {error}",sendingTitle:"Sending this to someone?",sendingBody:"Share the link instead of a file and they will always have the latest changes.",invitePeople:"Invite people",allLinksOff:"All the links are off. Invite people to turn one on.",joinsAs:"People who open this link join as {role}. Invite people to give another role.",onlyHereLink:"Only this computer can open the link.",nothingToExport:"Nothing to export yet.",exportOptions:"Asks for options first",archiveLabel:"Whole folder (.zip)",archiveDescription:"Everything here, to back up or move",archiveStarted:"Downloading {name}",archiveHint:"The whole folder in one zip, to back up, move to another computer or send to someone. Unzip it and open it with the same type to carry on; share links and this computer's server state are left out.",archiveTooLarge:"The folder is over what a zip holds (4 GiB or 65,535 files): copy the folder itself instead.",archiveUnsupported:"{type} folders can't be zipped here: copy the folder itself instead.",archiveFailed:"Could not zip the folder: {error}",exportBusy:"Another export is running. Try {label} again in a moment.",exportUnsupported:"{label} can't be exported right now.",exportFailed:"Could not export {label}.",saving:"Saving…",reconnecting:"Reconnecting…",notSaved:"Not saved",notSavedTitle:"The page could not save its last changes.",saveRetry:"Couldn't save — retry",readOnly:"Read-only",readOnlyTitle:"Nothing can be saved here",leaveLosesWork:"Leave? Changes that are not saved yet will be lost.",actionSaveNow:"Save now",actionOpenFind:"Find",actionUndo:"Undo",actionRedo:"Redo",actionEditPage:"Edit page",actionUsePage:"Use this page",actionCommentSelection:"Comment on selection",actionOpenPageList:"Pages",actionHandOffCode:"Hand off to code",whyOlderVersion:"You are viewing an older version",whyAgentWorking:"{agent} is working",whyDraftOpen:"Close the open draft first",whyCommentsOn:"Turn off comment mode first",whyNeedsAgent:"Needs an agent session",whyUnsaved:"Save first",whyOther:"Not available right now",noOwner:"No session owns this artifact",noOwnerNote:"What you send waits for the next session that works on it.",ownerNote:"Messages go to the {harness} session that made this artifact.",agentIdle:"{agent} is idle",agentWaiting:"{agent} is waiting",sessionOffline:"The session is offline",offlineNote:"{agent} sees what you send the next time the {harness} session works.",askPlaceholder:"What should change?",sendToAgent:"Send to {agent}",sending:"Sending…",sent:"Sent.",sentInbox:"{agent} will see it the next time the session works.",notDelivered:"Not delivered.",notSent:"Not sent: {error}",viaDelivered:"delivered",viaInbox:"waiting for the session",viaFailed:"not delivered",emptyTitle:"This artifact is empty",emptyBody:"Nothing of {type} has been written to {root} yet. An agent writes it: send it this.",startSession:"Start a session with {agent}",promptCopied:"Copied: paste it into any agent session that has the Artifact tool.",sentToSession:"Sent to a new session.",problemTitle:"This artifact cannot open here",noPage:"No page.",folder:"Folder: {root}",askToLook:"Ask {agent} to look",problemAsk:"The artifact page could not open: {problem}",noBoot:"No artifact to show. Open one from the home page.",homeTitle:"Open Artifact",homeSub:"The artifacts and types every agent on this computer shares.",artifacts:"Artifacts",types:"Types",newArtifact:"New artifact",moreActions:"More actions",backToSession:"Back to session",noArtifacts:"No artifacts yet. Ask an agent to make one with the Artifact tool, or start one here.",pageOpen:"Open now",typeMissing:"Type not installed",deleted:'Deleted "{title}". Its folder stays.',undo:"Undo",restored:"Restored",couldNotRestore:"Could not restore: {error}",couldNotLoad:"Could not load: {error}",typeRoots:"Type roots: {roots}",noTypes:"No types found.",disabled:"Disabled",shadowedBy:"Overridden by {root}",newOf:"New {type}",create:"Create",title:"Title",folderOptional:"Folder (optional)",folderHint:"Default: a new folder in the home workspace",needTitle:"Give it a title first.",couldNotCreate:"Could not create it: {error}",renameArtifact:"Rename artifact",cannotCreateYet:"Only Design artifacts can be made here for now."},hw={cancel:"取消",close:"关闭",copy:"复制",copied:"已复制",copyLink:"复制链接",loading:"加载中…",justNow:"刚刚",never:"从未",agent:"Agent",delete:"删除",rename:"重命名",duplicate:"复制一份",pin:"置顶",unpin:"取消置顶",open:"打开",save:"保存",updated:"更新于 {when}",pinned:"已置顶",unpinned:"已取消置顶",duplicated:"已复制一份",couldNotPin:"没能置顶:{error}",couldNotUnpin:"没能取消置顶:{error}",couldNotRename:"没能重命名:{error}",couldNotDuplicate:"没能复制:{error}",couldNotDelete:"没能删除:{error}",statusNone:"无会话",statusWorking:"工作中",statusIdle:"空闲",statusWaiting:"等待中",statusOffline:"离线",working:"{agent} 正在工作…",artifactOptions:"作品选项",artifactName:"作品名",comments:"评论",doneCommenting:"结束评论",openComment:"1 条未解决的评论",openComments:"{count} 条未解决的评论",commentOptions:"评论选项",showAllComments:"显示全部评论",hideComments:"隐藏评论",share:"分享",sharedOnNetwork:"已分享到局域网",onlyThisComputer:"仅这台电脑",ask:"问 {agent}",hideAsk:"收起",openHarnessSession:"打开 {harness} 会话",messageAgent:"就这个作品给 {agent} 发消息",switchArtifact:"切换作品",inThisSession:"这个会话里的",recent:"最近",allArtifacts:"所有作品",export:"导出",openSession:"打开会话",offline:"离线",versionHistory:"版本历史",openInNewTab:"在新标签页打开",refresh:"刷新",storage:"存储",inThisFolder:"这个文件夹 {size}",copyPath:"复制路径",linkCopied:"链接已复制",pathCopied:"路径已复制",deleteTitle:"删除「{title}」?",deleteBody:"它会移出作品列表,文件夹保留在原处:{root}",shareTitle:"分享这份内容",peopleWithAccess:"有权访问的人",joinedPeople:"加入的人",noneJoined:"还没有人加入。把下面的链接发给对方。",online:"在线",seenAgo:"{when}来过",guestPaused:"链接已关闭,暂时无法访问",changeRole:"更改「{name}」的角色",roleLinkOff:"链接已关闭",remove:"移出",removeGuest:"移出 {name}",removeTitle:"移出「{name}」?",removeBody:"对方将无法再访问这份内容,之后仍可以用链接重新加入。",you:"(你)",thisComputer:"这台电脑",owner:"所有者",generalAccess:"一般访问权限",onLan:"同一网络里有链接的人",onlyHereSub:"别人打不开这些链接。",onLanSub:"同一 Wi-Fi 或局域网里的人用链接打开,链接决定角色。",onNetworkAt:"在这个网络上:{addresses}",onTailnet:"Tailscale:{address},同一 tailnet 的人在别的网络也能打开(复制在链接的「更多」里)",noAddress:"这台电脑没有局域网地址。",whereOff:"现在只有这台电脑能打开这些链接。复制链接会顺手分享到局域网。",inviteLinks:"邀请链接",roleEditor:"编辑者",roleCommenter:"评论者",roleViewer:"查看者",linkEditor:"可编辑",linkCommenter:"可评论",linkViewer:"可查看",noteEditor:"编辑和评论",noteCommenter:"只能评论",noteViewer:"只读",linkOff:"已关闭:没人能用它加入",turnOn:"开启",more:"更多",moreFor:"更多:{role}",copyTailnet:"复制 Tailscale 链接",copyTailnetNote:"给同一 tailnet 里不在这个网络的人({address})",turnOnLink:"开启链接",turnOffLink:"关闭链接",turnOffNote:"用它加入的人暂时无法访问",resetLink:"重置链接",resetNote:"换一个新地址,用旧链接加入的人会被移出",resetTitle:"重置「{role}」链接?",resetBody:"旧链接会失效,通过它加入的人也会失去访问权限。",plainHttp:"这是明文 HTTP:同一网络的人能看到传输内容。链接就是权限:拿到链接的人就有对应角色,只发给该有的人;传出去了就重置链接。",cannotShare:"{type} 的页面暂时不能分享到网络:只有这台电脑能打开。",shareError:"没做成:{error}",sendingTitle:"要发给别人?",sendingBody:"发链接而不是文件,对方看到的总是最新版本。",invitePeople:"邀请别人",allLinksOff:"所有链接都关着。去邀请页打开一条。",joinsAs:"用这条链接打开的人以{role}身份加入。要给别的角色,去邀请页。",onlyHereLink:"只有这台电脑能打开这个链接。",nothingToExport:"还没有可导出的内容。",exportOptions:"会先询问导出选项",archiveLabel:"整个文件夹(.zip)",archiveDescription:"这里的全部内容,用来备份或搬走",archiveStarted:"开始下载 {name}",archiveHint:"整个文件夹打成了一个 zip,可以备份、换电脑或发给别人。解压后用同一个类型打开就能接着用;分享链接和这台电脑上的服务器状态不在里面。",archiveTooLarge:"文件夹超过了 zip 的上限(4 GiB 或 65535 个文件),请直接复制文件夹。",archiveUnsupported:"{type} 的文件夹在这里打不了包,请直接复制文件夹。",archiveFailed:"没能打包:{error}",exportBusy:"另一个导出正在进行,请稍后再导出 {label}。",exportUnsupported:"现在无法导出 {label}。",exportFailed:"无法导出 {label}。",saving:"正在保存…",reconnecting:"正在重新连接…",notSaved:"未保存",notSavedTitle:"页面没能保存最近的修改。",saveRetry:"保存失败,点击重试",readOnly:"只读",readOnlyTitle:"这里的内容无法保存",leaveLosesWork:"确定离开?尚未保存的修改会丢失。",actionSaveNow:"立即保存",actionOpenFind:"查找",actionUndo:"撤销",actionRedo:"重做",actionEditPage:"编辑页面",actionUsePage:"使用这个页面",actionCommentSelection:"评论选中内容",actionOpenPageList:"页面列表",actionHandOffCode:"交给代码处理",whyOlderVersion:"你正在查看旧版本",whyAgentWorking:"{agent} 正在工作",whyDraftOpen:"请先关闭打开的草稿",whyCommentsOn:"请先退出评论模式",whyNeedsAgent:"需要一个智能体会话",whyUnsaved:"请先保存",whyOther:"暂时不可用",noOwner:"没有会话拥有这个作品",noOwnerNote:"发出的消息会等下一个处理它的会话。",ownerNote:"消息会发给做这个作品的 {harness} 会话。",agentIdle:"{agent} 空闲",agentWaiting:"{agent} 在等待",sessionOffline:"会话离线",offlineNote:"{harness} 会话下次工作时,{agent} 会看到你发的消息。",askPlaceholder:"想改什么?",sendToAgent:"发给 {agent}",sending:"发送中…",sent:"已发送。",sentInbox:"会话下次工作时 {agent} 会看到。",notDelivered:"没送达。",notSent:"没发出去:{error}",viaDelivered:"已送达",viaInbox:"等会话处理",viaFailed:"没送达",emptyTitle:"这个作品还是空的",emptyBody:"{root} 里还没有写入 {type} 的内容。由 Agent 来写:把下面这段发给它。",startSession:"和 {agent} 开个新会话",promptCopied:"已复制:粘贴到任意装了 Artifact 工具的 Agent 会话里。",sentToSession:"已发到新会话。",problemTitle:"这个作品在这里打不开",noPage:"没有页面。",folder:"文件夹:{root}",askToLook:"让 {agent} 看看",problemAsk:"作品页打不开:{problem}",noBoot:"没有要显示的作品。从主页打开一个。",homeTitle:"Open Artifact",homeSub:"本机所有 Agent 共用的作品和类型。",artifacts:"作品",types:"类型",newArtifact:"新建作品",moreActions:"更多操作",backToSession:"回到会话",noArtifacts:"还没有作品。让 Agent 用 Artifact 工具创建一个,或者在这里新建。",pageOpen:"已打开",typeMissing:"类型没有安装",deleted:"已删除「{title}」,文件夹保留。",undo:"撤销",restored:"已恢复",couldNotRestore:"没能恢复:{error}",couldNotLoad:"读取失败:{error}",typeRoots:"类型根目录:{roots}",noTypes:"没有找到类型。",disabled:"已停用",shadowedBy:"被 {root} 覆盖",newOf:"新建 {type}",create:"创建",title:"标题",folderOptional:"文件夹(可不填)",folderHint:"默认:主工作区里新建一个文件夹",needTitle:"先写个标题。",couldNotCreate:"没建成:{error}",renameArtifact:"重命名作品",cannotCreateYet:"目前这里只能新建 Design 作品。"};function gw(o){return o&&/^zh\b/i.test(o)?"zh-CN":"en"}const np=gw(typeof navigator>"u"?void 0:navigator.language);function mw(o,l){return l?o.replace(/\{(\w+)\}/g,(a,r)=>r in l?String(l[r]):a):o}function yw(o,l,a){return mw((o==="zh-CN"?hw[l]:void 0)??pw[l],a)}function He(o,l){return yw(np,o,l)}const un={artifacts:"artifacts",artifact:"artifact",types:"types",events:"events",share:"artifact.share",archive:"artifact.archive",restore:"artifacts.restore",open:"artifacts.open",create:"artifacts.create",update:"artifacts.update",duplicate:"artifacts.duplicate",delete:"artifacts.delete",ask:"artifacts.ask"},vw="[Artifact comment sent to agent]",bw="[Artifact edit request sent to agent]",Sw="[Artifact task finished]";function xw(o){return!!o&&typeof o=="object"&&typeof o.openArtifact=="string"}const Tw=["quickstart","list","publish","read","open","call","adopt","delete","share"],Ew=["get","list","query","set","update","delete","str_replace","batch"],Rw=["read","reply","resolve","reopen","wait"],Cw=["share","export"],Ow={type:"object",properties:{action:{type:"string",enum:Tw,description:"What to do. Omitted: publish."},intent:{type:"string",description:"quickstart: what is being made (design, design-system, slides, whiteboard, document, data, other), or a few words about it."},scope:{type:"string",enum:["types","mine","all"],description:"list: the installed types, this session's and this workspace's artifacts (default), or every artifact."},type:{type:"string",description:"list: only artifacts of this type (an id, or open-artifact://type/<id>)."},query:{type:"string",description:"list: only artifacts whose title contains this text."},limit:{type:"integer",description:"list: how many to return (default 50, at most 200)."},cursor:{type:"string",description:"list: the next_cursor of the previous page."},type_url:{type:"string",description:"publish without url: the type to create from (open-artifact://type/<id>, from quickstart). read without url: the type to describe."},title:{type:"string",description:"publish without url: the new artifact's name."},folder:{type:"string",description:"publish without url, or adopt: where the artifact's folder goes (absolute, or relative to the workspace). Default <workspace>/artifacts/<slug>."},url:{type:"string",description:"An artifact: open-artifact://artifact/<id>, as publish returned it."},files:{type:"object",additionalProperties:!0,description:'publish with url: files to write under the artifact root, as {"rel/path": "text"} or {"rel/path": {"content": "...", "encoding": "base64"}}; null deletes.'},if_match:{type:"object",additionalProperties:!0,description:'publish with url: {"rel/path": sha256 | null | "*"}. Write only while the file still has the sha256 you read, does not exist (null), or anyway ("*"). One mismatch writes nothing and returns the current versions.'},check:{type:"boolean",description:"publish with url: run the type's check action after writing; its result comes back as check."},open:{type:"string",enum:["after_first_write","now"],description:"publish without url: after_first_write opens the page in your app once your first write lands; now opens it at once. Where your app cannot show pages by itself the result says so: open view_url in your app's built-in browser, if you have one."},related:{type:"boolean",description:"quickstart: list existing artifacts the recommended type can build on, such as design systems (default true)."},path:{type:"string",description:"read: one file or folder under the root (omitted: the record and the file list)."},paths:{type:"array",items:{type:"string"},description:"read: several files under the root at once."},name:{type:"string",description:"call: the action's name (check, upload, ...; read with url lists them)."},args:{type:"object",additionalProperties:!0,description:"call: the action's arguments. upload: {file: absolute path, name?, group?}."},panel:{type:"string",enum:Cw,description:"open: also open the page's Share panel (share), for the person to share it on the network, or its Export tab (export), for them to download a file."}}},ww={type:"object",properties:{action:{type:"string",enum:Ew},url:{type:"string",description:"The artifact (open-artifact://artifact/<id>)."},collection:{type:"string"},doc_id:{type:"string"},path:{type:"string",description:"collection/doc_id, instead of the two."},data:{type:"object",additionalProperties:!0,description:"set / update: the document's fields."},file_path:{type:"string",description:"set / update: a JSON file holding the fields, instead of data."},if_match:{description:'set / update / delete / str_replace: the sha256 get returned (write only if unchanged), null (only if it does not exist) or "*" (replace whatever is there).'},field:{type:"string",description:"str_replace: the text field, as a dot path (body, notes.text)."},old:{type:"string",description:"str_replace: the passage to replace; it must occur exactly once."},new:{type:"string",description:"str_replace: the passage that replaces it."},where:{type:"array",items:{type:"object",additionalProperties:!0},description:"query: [{field, op, value}], all must hold. op: ==, !=, <, <=, >, >=, in, not-in (up to 30 values), array-contains."},order_by:{type:"object",additionalProperties:!0,description:'query: {field, dir: "asc" | "desc"}.'},limit:{type:"integer",description:"list / query: how many documents (default 100, at most 1000)."},cursor:{type:"string",description:"list / query: the next_cursor of the previous page."},out_file:{type:"string",description:"get / list / query: write the result to this JSON file (absolute, or relative to the workspace) and return only its path and counts."},writes:{type:"array",items:{type:"object",additionalProperties:!0},description:"batch: [{op: set|update|delete|str_replace, path | collection+doc_id, data | file_path, if_match?, field?, old?, new?}], at most 500."}},required:["action","url"]},Aw={type:"object",properties:{action:{type:"string",enum:Rw},url:{type:"string",description:"The artifact (open-artifact://artifact/<id>). wait: optional."},thread_id:{type:"string",description:'reply / resolve / reopen: the thread (after ";thread=" in the message).'},text:{type:"string",description:"reply: the answer."},resolve:{type:"boolean",description:"reply: resolve the thread too."},all:{type:"boolean",description:"read: resolved threads too."},since:{type:"string",description:"read: only threads with a message at or after this time (ISO 8601)."},acknowledge_duplicate:{type:"boolean",description:"reply: send the same text as your last reply in this thread again, on purpose."},timeout_ms:{type:"number",description:"wait: how long (default 600000)."}},required:["action"]},nv={Artifact:Ow,ArtifactData:ww,ArtifactComments:Aw},Mw={Artifact:["Make and change artifacts: typed folders of files that open as live pages the person can view, edit, comment on and export. Actions:","- quickstart {intent}: call first for a new artifact; recommends a type and returns the call that creates it.",'- list {scope: "mine" | "all" | "types", type?, query?}: find existing artifacts, or the installed types.',"- publish {type_url, title, folder?, open?}: create an artifact; the result carries its root folder and the type's instructions. publish {url, files, if_match?, check?}: write files when you have no file tools of your own.","- read {url, path? | paths?}: the artifact's record, files and actions, or some of its files with their sha256. read {type_url}: a type's instructions, before creating.",`- open {url, panel?}: show it to the person in the computer's browser (or the app, when it shows pages), once its content is written. When your app has a built-in browser, open view_url there instead. panel "share" or "export" opens its Share panel or Export tab for them.`,"- call {url, name, args?}: run one of the type's actions (check, upload, ...). A long one answers {task, pending: true}; its result comes later as a message.","- adopt {url | folder}: take over an artifact, or add an existing folder. Only when the person asks.","- share {url}: whether it is shared on the local network, and its links. Only the person changes that, in the page's Share panel.","- delete {url}: forget an artifact; its folder stays. Only when the person asks."].join(`
10
10
  `),ArtifactData:'Read and write the document store of an artifact whose type keeps one (its instructions say so). get, list and query read documents with their sha256; set, update, delete, str_replace and batch write them. update merges fields, and {"__delete__": true} removes one; str_replace changes one passage of a long text field. Replacing or deleting an existing document needs if_match: the sha256 you read, or "*". Your writes show live on open pages.',ArtifactComments:`Comments the person leaves on their artifact's page, kept in the artifact's own folder on this computer (no outside service). read lists the threads; reply answers one (thread_id is after ";thread=" in the message), with resolve: true when it is done; resolve and reopen change a thread's state. A thread sent to you is the person asking for your answer in it, so replying there is what they asked for. Answer only threads sent to you, in one or two lines. wait blocks until the next message for this session: use it only when nothing else can wake you.`},Dw={Artifact:{title:"Artifact",openWorldHint:!1},ArtifactData:{title:"Artifact data",openWorldHint:!1},ArtifactComments:{title:"Artifact comments",destructiveHint:!1,openWorldHint:!1}};Object.keys(nv).map(o=>({name:o,description:Mw[o],inputSchema:nv[o],annotations:Dw[o]}));const Nw=300,zw=12,ov=["Artifact","ArtifactData","ArtifactComments"];function il(o,l=Nw){const a=String(o??"").replace(/[<>]/g,"").replace(/\s+/g," ").trim();return a.length>l?`${a.slice(0,l-1).trimEnd()}…`:a}function _w(o){const l=il(o,Number.MAX_SAFE_INTEGER),a=l.search(/[.!?。!?](\s|$)/);return a>=0?l.slice(0,a+1):l}function Hw(o){const l=il(o,24);return/^[a-z0-9]{1,5}$/i.test(l)?l.toUpperCase():l}const lv=o=>!o||/[.!?。!?…]$/.test(o)?o:`${o}.`;function jw(o,l=!1){const a=il(o.title,80)||o.id;if(l)return`- ${o.id}: ${a}`;const r=il(o.when)||il(_w(o.description)),c=(o.exports??[]).map(Hw).filter(Boolean),f=[lv(a),lv(r),c.length?`Exports: ${c.join(", ")}.`:""].filter(Boolean);return`- ${o.id}: ${f.join(" ")}`}const kw="Open Artifact lets you make artifacts: typed folders of files (a slide deck, a design canvas, a whiteboard, a data dashboard and more) that open as live pages the person can view, edit, comment on and export. You make and change them with the Artifact, ArtifactData and ArtifactComments tools.",Uw=`<where_output_goes>
11
11
  Decide where your output will live before you make anything.
12
12
  - Something the person will read once and move on from (an answer, an explanation, a summary, a short report) goes in your reply, however long it is. A diagram or chart that explains your answer goes in the reply too, when you can show one there.