@rozenite/storage-plugin 2.0.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/dist/devtools/assets/panel-D5z1BY8U.js +32 -0
  3. package/dist/devtools/assets/panel-DVlWRg6d.css +1 -0
  4. package/dist/devtools/panel.html +2 -2
  5. package/dist/react-native/chunks/index.require.js +1 -3
  6. package/dist/react-native/chunks/secure-storage.require.js +2 -6
  7. package/dist/react-native/chunks/useRozeniteStoragePlugin.require.cjs +1 -1
  8. package/dist/react-native/chunks/useRozeniteStoragePlugin.require.js +266 -295
  9. package/dist/react-native/index.d.ts +14 -2
  10. package/dist/react-native/index.js +2 -10
  11. package/dist/rozenite.json +1 -1
  12. package/package.json +29 -29
  13. package/react-native.ts +11 -36
  14. package/rozenite.config.ts +2 -6
  15. package/sdk.ts +1 -5
  16. package/src/react-native/__tests__/entry-preview-pagination.test.ts +12 -40
  17. package/src/react-native/__tests__/export-snapshot.test.ts +2 -6
  18. package/src/react-native/__tests__/full-entry-request.test.ts +5 -17
  19. package/src/react-native/__tests__/import.test.ts +9 -8
  20. package/src/react-native/__tests__/storage-discovery.test.ts +7 -18
  21. package/src/react-native/__tests__/stress-verification.test.ts +5 -18
  22. package/src/react-native/__tests__/use-storage-agent-tools.test.ts +25 -35
  23. package/src/react-native/adapters/__tests__/mmkv.test.ts +20 -30
  24. package/src/react-native/adapters/async-storage.ts +2 -5
  25. package/src/react-native/adapters/index.ts +2 -8
  26. package/src/react-native/adapters/mmkv.ts +7 -24
  27. package/src/react-native/adapters/secure-storage.ts +2 -6
  28. package/src/react-native/entry-preview-pagination.ts +11 -27
  29. package/src/react-native/export-snapshot.ts +3 -9
  30. package/src/react-native/full-entry-request.ts +3 -8
  31. package/src/react-native/import.ts +10 -21
  32. package/src/react-native/storage-discovery.ts +2 -6
  33. package/src/react-native/storage-view.ts +2 -6
  34. package/src/react-native/useRozeniteStoragePlugin.ts +107 -119
  35. package/src/react-native/useStorageAgentTools.ts +8 -24
  36. package/src/shared/__tests__/entry-preview.test.ts +9 -27
  37. package/src/shared/__tests__/snapshot.test.ts +10 -32
  38. package/src/shared/agent-tools.ts +9 -30
  39. package/src/shared/entry-preview.ts +3 -8
  40. package/src/shared/messaging.ts +15 -11
  41. package/src/shared/snapshot.ts +4 -17
  42. package/src/shared/types.ts +2 -4
  43. package/src/ui/__tests__/binary-value-editor-state.test.ts +6 -16
  44. package/src/ui/__tests__/binary.test.ts +13 -33
  45. package/src/ui/__tests__/large-value-viewer.test.tsx +4 -13
  46. package/src/ui/__tests__/panel.test.tsx +50 -63
  47. package/src/ui/__tests__/storage-groups.test.ts +1 -4
  48. package/src/ui/__tests__/type-conversion.test.ts +8 -24
  49. package/src/ui/__tests__/use-storage-entries.test.tsx +18 -34
  50. package/src/ui/add-entry-dialog.tsx +66 -87
  51. package/src/ui/binary-value-editor-state.ts +6 -24
  52. package/src/ui/binary-value-editor.tsx +6 -18
  53. package/src/ui/binary.ts +6 -19
  54. package/src/ui/edit-entry-dialog.tsx +59 -78
  55. package/src/ui/editor-switcher.tsx +2 -11
  56. package/src/ui/entry-detail-dialog.tsx +9 -16
  57. package/src/ui/format-value.tsx +2 -9
  58. package/src/ui/import-dialog.tsx +12 -24
  59. package/src/ui/large-value-viewer-state.ts +2 -9
  60. package/src/ui/large-value-viewer.tsx +3 -9
  61. package/src/ui/panel.tsx +129 -235
  62. package/src/ui/query-client.tsx +4 -15
  63. package/src/ui/type-conversion.ts +2 -5
  64. package/src/ui/typed-value-editor.tsx +1 -5
  65. package/src/ui/use-storage-entries.ts +6 -21
  66. package/src/ui/utils.ts +1 -4
  67. package/tsconfig.json +4 -7
  68. package/dist/devtools/assets/panel-B6Wp0eie.css +0 -1
  69. package/dist/devtools/assets/panel-D7MFc4HG.js +0 -32
@@ -1,32 +0,0 @@
1
- function yH(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var vH=t=>t.disabled||Array.isArray(t.accessibilityStates)&&t.accessibilityStates.indexOf("disabled")>-1,bH={adjustable:"slider",button:"button",header:"heading",image:"img",imagebutton:null,keyboardkey:null,label:null,link:"link",none:"presentation",search:"search",summary:"region",text:null},Mk=t=>{var e=t.accessibilityRole,n=t.role,r=n||e;if(r){var i=bH[r];if(i!==null)return i||r}},xH={article:"article",banner:"header",blockquote:"blockquote",button:"button",code:"code",complementary:"aside",contentinfo:"footer",deletion:"del",emphasis:"em",figure:"figure",insertion:"ins",form:"form",list:"ul",listitem:"li",main:"main",navigation:"nav",paragraph:"p",region:"section",strong:"strong"},SH={},wH=function(e){e===void 0&&(e=SH);var n=e.role||e.accessibilityRole;if(n==="label")return"label";var r=Mk(e);if(r){if(r==="heading"){var i=e.accessibilityLevel||e["aria-level"];return i!=null?"h"+i:"h1"}return xH[r]}},Ok={isDisabled:vH,propsToAccessibilityComponent:wH,propsToAriaRole:Mk};function ld(t){"@babel/helpers - typeof";return ld=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ld(t)}function CH(t,e){if(ld(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(ld(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function RH(t){var e=CH(t,"string");return ld(e)=="symbol"?e:e+""}function EH(t,e,n){return(e=RH(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function oT(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function mc(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?oT(Object(n),!0).forEach(function(r){EH(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):oT(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function um(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}var ip={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexOrder:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,fontWeight:!0,gridRow:!0,gridRowEnd:!0,gridRowGap:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnGap:!0,gridColumnStart:!0,lineClamp:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0,scale:!0,scaleX:!0,scaleY:!0,scaleZ:!0,shadowOpacity:!0},TH=["ms","Moz","O","Webkit"],AH=(t,e)=>t+e.charAt(0).toUpperCase()+e.substring(1);Object.keys(ip).forEach(t=>{TH.forEach(e=>{ip[AH(e,t)]=ip[t]})});var MH=t=>t==="currentcolor"||t==="currentColor"||t==="inherit"||t.indexOf("var(")===0;function _o(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function kk(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var n=function r(){var i=!1;try{i=this instanceof r}catch{}return i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var o0,sT;function OH(){if(sT)return o0;sT=1;function t(w){if(typeof w=="number")return w>>>0===w&&w>=0&&w<=4294967295?w:null;if(typeof w!="string")return null;const C=g();let R;if(R=C.hex6.exec(w))return parseInt(R[1]+"ff",16)>>>0;const T=S(w);return T??((R=C.rgb.exec(w))?(p(R[1])<<24|p(R[2])<<16|p(R[3])<<8|255)>>>0:(R=C.rgba.exec(w))?R[6]!==void 0?(p(R[6])<<24|p(R[7])<<16|p(R[8])<<8|v(R[9]))>>>0:(p(R[2])<<24|p(R[3])<<16|p(R[4])<<8|v(R[5]))>>>0:(R=C.hex3.exec(w))?parseInt(R[1]+R[1]+R[2]+R[2]+R[3]+R[3]+"ff",16)>>>0:(R=C.hex8.exec(w))?parseInt(R[1],16)>>>0:(R=C.hex4.exec(w))?parseInt(R[1]+R[1]+R[2]+R[2]+R[3]+R[3]+R[4]+R[4],16)>>>0:(R=C.hsl.exec(w))?(n(m(R[1]),b(R[2]),b(R[3]))|255)>>>0:(R=C.hsla.exec(w))?R[6]!==void 0?(n(m(R[6]),b(R[7]),b(R[8]))|v(R[9]))>>>0:(n(m(R[2]),b(R[3]),b(R[4]))|v(R[5]))>>>0:(R=C.hwb.exec(w))?(r(m(R[1]),b(R[2]),b(R[3]))|255)>>>0:null)}function e(w,C,R){return R<0&&(R+=1),R>1&&(R-=1),R<1/6?w+(C-w)*6*R:R<1/2?C:R<2/3?w+(C-w)*(2/3-R)*6:w}function n(w,C,R){const T=R<.5?R*(1+C):R+C-R*C,A=2*R-T,O=e(A,T,w+1/3),P=e(A,T,w),M=e(A,T,w-1/3);return Math.round(O*255)<<24|Math.round(P*255)<<16|Math.round(M*255)<<8}function r(w,C,R){if(C+R>=1){const P=Math.round(C*255/(C+R));return P<<24|P<<16|P<<8}const T=e(0,1,w+1/3)*(1-C-R)+C,A=e(0,1,w)*(1-C-R)+C,O=e(0,1,w-1/3)*(1-C-R)+C;return Math.round(T*255)<<24|Math.round(A*255)<<16|Math.round(O*255)<<8}const i="[-+]?\\d*\\.?\\d+",s=i+"%";function a(...w){return"\\(\\s*("+w.join(")\\s*,?\\s*(")+")\\s*\\)"}function u(...w){return"\\(\\s*("+w.slice(0,w.length-1).join(")\\s*,?\\s*(")+")\\s*/\\s*("+w[w.length-1]+")\\s*\\)"}function f(...w){return"\\(\\s*("+w.join(")\\s*,\\s*(")+")\\s*\\)"}let d;function g(){return d===void 0&&(d={rgb:new RegExp("rgb"+a(i,i,i)),rgba:new RegExp("rgba("+f(i,i,i,i)+"|"+u(i,i,i,i)+")"),hsl:new RegExp("hsl"+a(i,s,s)),hsla:new RegExp("hsla("+f(i,s,s,i)+"|"+u(i,s,s,i)+")"),hwb:new RegExp("hwb"+a(i,s,s)),hex3:/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex4:/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#([0-9a-fA-F]{6})$/,hex8:/^#([0-9a-fA-F]{8})$/}),d}function p(w){const C=parseInt(w,10);return C<0?0:C>255?255:C}function m(w){return(parseFloat(w)%360+360)%360/360}function v(w){const C=parseFloat(w);return C<0?0:C>1?255:Math.round(C*255)}function b(w){const C=parseFloat(w);return C<0?0:C>100?1:C/100}function S(w){switch(w){case"transparent":return 0;case"aliceblue":return 4042850303;case"antiquewhite":return 4209760255;case"aqua":return 16777215;case"aquamarine":return 2147472639;case"azure":return 4043309055;case"beige":return 4126530815;case"bisque":return 4293182719;case"black":return 255;case"blanchedalmond":return 4293643775;case"blue":return 65535;case"blueviolet":return 2318131967;case"brown":return 2771004159;case"burlywood":return 3736635391;case"burntsienna":return 3934150143;case"cadetblue":return 1604231423;case"chartreuse":return 2147418367;case"chocolate":return 3530104575;case"coral":return 4286533887;case"cornflowerblue":return 1687547391;case"cornsilk":return 4294499583;case"crimson":return 3692313855;case"cyan":return 16777215;case"darkblue":return 35839;case"darkcyan":return 9145343;case"darkgoldenrod":return 3095792639;case"darkgray":return 2846468607;case"darkgreen":return 6553855;case"darkgrey":return 2846468607;case"darkkhaki":return 3182914559;case"darkmagenta":return 2332068863;case"darkolivegreen":return 1433087999;case"darkorange":return 4287365375;case"darkorchid":return 2570243327;case"darkred":return 2332033279;case"darksalmon":return 3918953215;case"darkseagreen":return 2411499519;case"darkslateblue":return 1211993087;case"darkslategray":return 793726975;case"darkslategrey":return 793726975;case"darkturquoise":return 13554175;case"darkviolet":return 2483082239;case"deeppink":return 4279538687;case"deepskyblue":return 12582911;case"dimgray":return 1768516095;case"dimgrey":return 1768516095;case"dodgerblue":return 512819199;case"firebrick":return 2988581631;case"floralwhite":return 4294635775;case"forestgreen":return 579543807;case"fuchsia":return 4278255615;case"gainsboro":return 3705462015;case"ghostwhite":return 4177068031;case"gold":return 4292280575;case"goldenrod":return 3668254975;case"gray":return 2155905279;case"green":return 8388863;case"greenyellow":return 2919182335;case"grey":return 2155905279;case"honeydew":return 4043305215;case"hotpink":return 4285117695;case"indianred":return 3445382399;case"indigo":return 1258324735;case"ivory":return 4294963455;case"khaki":return 4041641215;case"lavender":return 3873897215;case"lavenderblush":return 4293981695;case"lawngreen":return 2096890111;case"lemonchiffon":return 4294626815;case"lightblue":return 2916673279;case"lightcoral":return 4034953471;case"lightcyan":return 3774873599;case"lightgoldenrodyellow":return 4210742015;case"lightgray":return 3553874943;case"lightgreen":return 2431553791;case"lightgrey":return 3553874943;case"lightpink":return 4290167295;case"lightsalmon":return 4288707327;case"lightseagreen":return 548580095;case"lightskyblue":return 2278488831;case"lightslategray":return 2005441023;case"lightslategrey":return 2005441023;case"lightsteelblue":return 2965692159;case"lightyellow":return 4294959359;case"lime":return 16711935;case"limegreen":return 852308735;case"linen":return 4210091775;case"magenta":return 4278255615;case"maroon":return 2147483903;case"mediumaquamarine":return 1724754687;case"mediumblue":return 52735;case"mediumorchid":return 3126187007;case"mediumpurple":return 2473647103;case"mediumseagreen":return 1018393087;case"mediumslateblue":return 2070474495;case"mediumspringgreen":return 16423679;case"mediumturquoise":return 1221709055;case"mediumvioletred":return 3340076543;case"midnightblue":return 421097727;case"mintcream":return 4127193855;case"mistyrose":return 4293190143;case"moccasin":return 4293178879;case"navajowhite":return 4292783615;case"navy":return 33023;case"oldlace":return 4260751103;case"olive":return 2155872511;case"olivedrab":return 1804477439;case"orange":return 4289003775;case"orangered":return 4282712319;case"orchid":return 3664828159;case"palegoldenrod":return 4008225535;case"palegreen":return 2566625535;case"paleturquoise":return 2951671551;case"palevioletred":return 3681588223;case"papayawhip":return 4293907967;case"peachpuff":return 4292524543;case"peru":return 3448061951;case"pink":return 4290825215;case"plum":return 3718307327;case"powderblue":return 2967529215;case"purple":return 2147516671;case"rebeccapurple":return 1714657791;case"red":return 4278190335;case"rosybrown":return 3163525119;case"royalblue":return 1097458175;case"saddlebrown":return 2336560127;case"salmon":return 4202722047;case"sandybrown":return 4104413439;case"seagreen":return 780883967;case"seashell":return 4294307583;case"sienna":return 2689740287;case"silver":return 3233857791;case"skyblue":return 2278484991;case"slateblue":return 1784335871;case"slategray":return 1887473919;case"slategrey":return 1887473919;case"snow":return 4294638335;case"springgreen":return 16744447;case"steelblue":return 1182971135;case"tan":return 3535047935;case"teal":return 8421631;case"thistle":return 3636451583;case"tomato":return 4284696575;case"turquoise":return 1088475391;case"violet":return 4001558271;case"wheat":return 4125012991;case"white":return 4294967295;case"whitesmoke":return 4126537215;case"yellow":return 4294902015;case"yellowgreen":return 2597139199}return null}return o0=t,o0}var kH=OH();const IH=_o(kH);var DH=t=>{if(t==null)return t;var e=IH(t);if(e!=null)return e=(e<<24|e>>>8)>>>0,e},kS=function(e,n){if(n===void 0&&(n=1),e!=null){if(typeof e=="string"&&MH(e))return e;var r=DH(e);if(r!=null){var i=r>>16&255,s=r>>8&255,a=r&255,u=(r>>24&255)/255,f=(u*n).toFixed(2);return"rgba("+i+","+s+","+a+","+f+")"}}},PH={backgroundColor:!0,borderColor:!0,borderTopColor:!0,borderRightColor:!0,borderBottomColor:!0,borderLeftColor:!0,color:!0,shadowColor:!0,textDecorationColor:!0,textShadowColor:!0};function ni(t,e){var n=t;return(e==null||!ip[e])&&typeof t=="number"?n=t+"px":e!=null&&PH[e]&&(n=kS(t)),n}var hu=!!(typeof window<"u"&&window.document&&window.document.createElement),zH={},NH=!hu||window.CSS!=null&&window.CSS.supports!=null&&(window.CSS.supports("text-decoration-line","none")||window.CSS.supports("-webkit-text-decoration-line","none")),LH="monospace,monospace",lT='-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif',BH={borderColor:["borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"],borderBlockColor:["borderTopColor","borderBottomColor"],borderInlineColor:["borderRightColor","borderLeftColor"],borderRadius:["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],borderStyle:["borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle"],borderBlockStyle:["borderTopStyle","borderBottomStyle"],borderInlineStyle:["borderRightStyle","borderLeftStyle"],borderWidth:["borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth"],borderBlockWidth:["borderTopWidth","borderBottomWidth"],borderInlineWidth:["borderRightWidth","borderLeftWidth"],insetBlock:["top","bottom"],insetInline:["left","right"],marginBlock:["marginTop","marginBottom"],marginInline:["marginRight","marginLeft"],paddingBlock:["paddingTop","paddingBottom"],paddingInline:["paddingRight","paddingLeft"],overflow:["overflowX","overflowY"],overscrollBehavior:["overscrollBehaviorX","overscrollBehaviorY"],borderBlockStartColor:["borderTopColor"],borderBlockStartStyle:["borderTopStyle"],borderBlockStartWidth:["borderTopWidth"],borderBlockEndColor:["borderBottomColor"],borderBlockEndStyle:["borderBottomStyle"],borderBlockEndWidth:["borderBottomWidth"],borderEndStartRadius:["borderBottomLeftRadius"],borderEndEndRadius:["borderBottomRightRadius"],borderStartStartRadius:["borderTopLeftRadius"],borderStartEndRadius:["borderTopRightRadius"],insetBlockEnd:["bottom"],insetBlockStart:["top"],marginBlockStart:["marginTop"],marginBlockEnd:["marginBottom"],paddingBlockStart:["paddingTop"],paddingBlockEnd:["paddingBottom"]},Ik=(t,e)=>{if(!t)return zH;var n={},r=function(){var u=t[i];if(u==null)return"continue";if(i==="backgroundClip")u==="text"&&(n.backgroundClip=u,n.WebkitBackgroundClip=u);else if(i==="flex")u===-1?(n.flexGrow=0,n.flexShrink=1,n.flexBasis="auto"):n.flex=u;else if(i==="font")n[i]=u.replace("System",lT);else if(i==="fontFamily")if(u.indexOf("System")>-1){var f=u.split(/,\s*/);f[f.indexOf("System")]=lT,n[i]=f.join(",")}else u==="monospace"?n[i]=LH:n[i]=u;else if(i==="textDecorationLine")NH?n.textDecorationLine=u:n.textDecoration=u;else if(i==="writingDirection")n.direction=u;else{var d=ni(t[i],i),g=BH[i];e&&i==="inset"?(t.insetInline==null&&(n.left=d,n.right=d),t.insetBlock==null&&(n.top=d,n.bottom=d)):e&&i==="margin"?(t.marginInline==null&&(n.marginLeft=d,n.marginRight=d),t.marginBlock==null&&(n.marginTop=d,n.marginBottom=d)):e&&i==="padding"?(t.paddingInline==null&&(n.paddingLeft=d,n.paddingRight=d),t.paddingBlock==null&&(n.paddingTop=d,n.paddingBottom=d)):g?g.forEach((p,m)=>{t[p]==null&&(n[p]=d)}):n[i]=d}};for(var i in t)var s=r();return n};function _H(t,e){for(var n=t.length,r=e^n,i=0,s;n>=4;)s=t.charCodeAt(i)&255|(t.charCodeAt(++i)&255)<<8|(t.charCodeAt(++i)&255)<<16|(t.charCodeAt(++i)&255)<<24,s=(s&65535)*1540483477+(((s>>>16)*1540483477&65535)<<16),s^=s>>>24,s=(s&65535)*1540483477+(((s>>>16)*1540483477&65535)<<16),r=(r&65535)*1540483477+(((r>>>16)*1540483477&65535)<<16)^s,n-=4,++i;switch(n){case 3:r^=(t.charCodeAt(i+2)&255)<<16;case 2:r^=(t.charCodeAt(i+1)&255)<<8;case 1:r^=t.charCodeAt(i)&255,r=(r&65535)*1540483477+(((r>>>16)*1540483477&65535)<<16)}return r^=r>>>13,r=(r&65535)*1540483477+(((r>>>16)*1540483477&65535)<<16),r^=r>>>15,r>>>0}var HH=t=>_H(t,1).toString(36),jH=/[A-Z]/g,VH=/^ms-/,s0={};function FH(t){return"-"+t.toLowerCase()}function UH(t){if(t in s0)return s0[t];var e=t.replace(jH,FH);return s0[t]=VH.test(e)?"-"+e:e}var ng={},rg={},ig={},aT;function Dk(){if(aT)return ig;aT=1,Object.defineProperty(ig,"__esModule",{value:!0}),ig.default=t;function t(e){return e.charAt(0).toUpperCase()+e.slice(1)}return ig}var uT;function $H(){if(uT)return rg;uT=1,Object.defineProperty(rg,"__esModule",{value:!0}),rg.default=r;var t=Dk(),e=n(t);function n(i){return i&&i.__esModule?i:{default:i}}function r(i,s,a){var u=i[s];if(u&&a.hasOwnProperty(s))for(var f=(0,e.default)(s),d=0;d<u.length;++d){var g=u[d]+f;a[g]||(a[g]=a[s])}return a}return rg}var og={},cT;function qH(){if(cT)return og;cT=1,Object.defineProperty(og,"__esModule",{value:!0}),og.default=t;function t(e,n,r,i,s){for(var a=0,u=e.length;a<u;++a){var f=e[a](n,r,i,s);if(f)return f}}return og}var sg={},fT;function GH(){if(fT)return sg;fT=1,Object.defineProperty(sg,"__esModule",{value:!0}),sg.default=e;function t(n,r){n.indexOf(r)===-1&&n.push(r)}function e(n,r){if(Array.isArray(r))for(var i=0,s=r.length;i<s;++i)t(n,r[i]);else t(n,r)}return sg}var lg={},dT;function WH(){if(dT)return lg;dT=1,Object.defineProperty(lg,"__esModule",{value:!0}),lg.default=t;function t(e){return e instanceof Object&&!Array.isArray(e)}return lg}var hT;function KH(){if(hT)return ng;hT=1,Object.defineProperty(ng,"__esModule",{value:!0}),ng.default=d;var t=$H(),e=f(t),n=qH(),r=f(n),i=GH(),s=f(i),a=WH(),u=f(a);function f(g){return g&&g.__esModule?g:{default:g}}function d(g){var p=g.prefixMap,m=g.plugins;return function v(b){for(var S in b){var w=b[S];if((0,u.default)(w))b[S]=v(w);else if(Array.isArray(w)){for(var C=[],R=0,T=w.length;R<T;++R){var A=(0,r.default)(m,S,w[R],b,p);(0,s.default)(C,A||w[R])}C.length>0&&(b[S]=C)}else{var O=(0,r.default)(m,S,w,b,p);O&&(b[S]=O),b=(0,e.default)(p,S,b)}}return b}}return ng}var YH=KH();const XH=_o(YH);var ag={};function op(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?op=function(n){return typeof n}:op=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},op(t)}function QH(t){return tj(t)||ej(t)||JH(t)||ZH()}function ZH(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function JH(t,e){if(t){if(typeof t=="string")return Db(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Db(t,e)}}function ej(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function tj(t){if(Array.isArray(t))return Db(t)}function Db(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function gT(t){return t.filter(function(e,n){return t.lastIndexOf(e)===n})}function Pk(t){for(var e=0,n=arguments.length<=1?0:arguments.length-1;e<n;++e){var r=e+1<1||arguments.length<=e+1?void 0:arguments[e+1];for(var i in r){var s=r[i],a=t[i];if(a&&s){if(Array.isArray(a)){t[i]=gT(a.concat(s));continue}if(Array.isArray(s)){t[i]=gT([a].concat(QH(s)));continue}if(op(s)==="object"){t[i]=Pk({},a,s);continue}}t[i]=s}}return t}var nj=/-([a-z])/g,rj=/^Ms/g,l0={};function ij(t){return t[1].toUpperCase()}function zk(t){if(l0.hasOwnProperty(t))return l0[t];var e=t.replace(nj,ij).replace(rj,"ms");return l0[t]=e,e}var oj=/[A-Z]/g,sj=/^ms-/,a0={};function lj(t){return"-"+t.toLowerCase()}function Nk(t){if(a0.hasOwnProperty(t))return a0[t];var e=t.replace(oj,lj);return a0[t]=sj.test(e)?"-"+e:e}const aj=Object.freeze(Object.defineProperty({__proto__:null,default:Nk},Symbol.toStringTag,{value:"Module"}));function cm(t){return Nk(t)}function Lk(t,e){return cm(t)+":"+e}function uj(t){var e="";for(var n in t){var r=t[n];typeof r!="string"&&typeof r!="number"||(e&&(e+=";"),e+=Lk(n,r))}return e}var cj=/^(Webkit|Moz|O|ms)/;function fj(t){return cj.test(t)}var dj=/-webkit-|-moz-|-ms-/;function hj(t){return typeof t=="string"&&dj.test(t)}var ad={borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},pT=["animationIterationCount","boxFlex","boxFlexGroup","boxOrdinalGroup","columnCount","flex","flexGrow","flexPositive","flexShrink","flexNegative","flexOrder","gridColumn","gridColumnEnd","gridColumnStart","gridRow","gridRowEnd","gridRowStart","lineClamp","order"],mT=["Webkit","ms","Moz","O"];function gj(t,e){return t+e.charAt(0).toUpperCase()+e.slice(1)}for(var u0=0,pj=pT.length;u0<pj;++u0){var yT=pT[u0];ad[yT]=!0;for(var c0=0,mj=mT.length;c0<mj;++c0)ad[gj(mT[c0],yT)]=!0}for(var yj in ad)ad[cm(yj)]=!0;function vj(t){return ad.hasOwnProperty(t)}var bj=/^(ms|Webkit|Moz|O)/;function Bk(t){var e=t.replace(bj,"");return e.charAt(0).toLowerCase()+e.slice(1)}function xj(t){return Bk(zk(t))}function Sj(t,e){return e.join(";"+cm(t)+":")}var wj=/(-ms-|-webkit-|-moz-|-o-)/g;function Cj(t){return typeof t=="string"?t.replace(wj,""):t}const Rj=Object.freeze(Object.defineProperty({__proto__:null,assignStyle:Pk,camelCaseProperty:zk,cssifyDeclaration:Lk,cssifyObject:uj,hyphenateProperty:cm,isPrefixedProperty:fj,isPrefixedValue:hj,isUnitlessProperty:vj,normalizeProperty:xj,resolveArrayValue:Sj,unprefixProperty:Bk,unprefixValue:Cj},Symbol.toStringTag,{value:"Module"})),Ej=kk(Rj);var vT;function Tj(){if(vT)return ag;vT=1,Object.defineProperty(ag,"__esModule",{value:!0}),ag.default=r;var t=Ej,e=/cross-fade\(/g,n=["-webkit-",""];function r(i,s){if(typeof s=="string"&&!(0,t.isPrefixedValue)(s)&&s.indexOf("cross-fade(")!==-1)return n.map(function(a){return s.replace(e,a+"cross-fade(")})}return ag}var Aj=Tj();const Mj=_o(Aj);var ug={},f0={},bT;function _k(){return bT||(bT=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;var e=/-webkit-|-moz-|-ms-/;function n(r){return typeof r=="string"&&e.test(r)}})(f0)),f0}var xT;function Oj(){if(xT)return ug;xT=1,Object.defineProperty(ug,"__esModule",{value:!0}),ug.default=i;var t=_k(),e=n(t);function n(s){return s&&s.__esModule?s:{default:s}}var r=["-webkit-",""];function i(s,a){if(typeof a=="string"&&!(0,e.default)(a)&&a.indexOf("image-set(")>-1)return r.map(function(u){return a.replace(/image-set\(/g,u+"image-set(")})}return ug}var kj=Oj();const Ij=_o(kj);var cg={},ST;function Dj(){if(ST)return cg;ST=1,Object.defineProperty(cg,"__esModule",{value:!0}),cg.default=e;var t={marginBlockStart:["WebkitMarginBefore"],marginBlockEnd:["WebkitMarginAfter"],marginInlineStart:["WebkitMarginStart","MozMarginStart"],marginInlineEnd:["WebkitMarginEnd","MozMarginEnd"],paddingBlockStart:["WebkitPaddingBefore"],paddingBlockEnd:["WebkitPaddingAfter"],paddingInlineStart:["WebkitPaddingStart","MozPaddingStart"],paddingInlineEnd:["WebkitPaddingEnd","MozPaddingEnd"],borderBlockStart:["WebkitBorderBefore"],borderBlockStartColor:["WebkitBorderBeforeColor"],borderBlockStartStyle:["WebkitBorderBeforeStyle"],borderBlockStartWidth:["WebkitBorderBeforeWidth"],borderBlockEnd:["WebkitBorderAfter"],borderBlockEndColor:["WebkitBorderAfterColor"],borderBlockEndStyle:["WebkitBorderAfterStyle"],borderBlockEndWidth:["WebkitBorderAfterWidth"],borderInlineStart:["WebkitBorderStart","MozBorderStart"],borderInlineStartColor:["WebkitBorderStartColor","MozBorderStartColor"],borderInlineStartStyle:["WebkitBorderStartStyle","MozBorderStartStyle"],borderInlineStartWidth:["WebkitBorderStartWidth","MozBorderStartWidth"],borderInlineEnd:["WebkitBorderEnd","MozBorderEnd"],borderInlineEndColor:["WebkitBorderEndColor","MozBorderEndColor"],borderInlineEndStyle:["WebkitBorderEndStyle","MozBorderEndStyle"],borderInlineEndWidth:["WebkitBorderEndWidth","MozBorderEndWidth"]};function e(n,r,i){if(Object.prototype.hasOwnProperty.call(t,n))for(var s=t[n],a=0,u=s.length;a<u;++a)i[s[a]]=r}return cg}var Pj=Dj();const zj=_o(Pj);var fg={},wT;function Nj(){if(wT)return fg;wT=1,Object.defineProperty(fg,"__esModule",{value:!0}),fg.default=t;function t(e,n){if(e==="position"&&n==="sticky")return["-webkit-sticky","sticky"]}return fg}var Lj=Nj();const Bj=_o(Lj);var dg={},CT;function _j(){if(CT)return dg;CT=1,Object.defineProperty(dg,"__esModule",{value:!0}),dg.default=r;var t=["-webkit-","-moz-",""],e={maxHeight:!0,maxWidth:!0,width:!0,height:!0,columnWidth:!0,minWidth:!0,minHeight:!0},n={"min-content":!0,"max-content":!0,"fill-available":!0,"fit-content":!0,"contain-floats":!0};function r(i,s){if(e.hasOwnProperty(i)&&n.hasOwnProperty(s))return t.map(function(a){return a+s})}return dg}var Hj=_j();const jj=_o(Hj);var hg={},d0={};const Vj=kk(aj);var RT;function Fj(){return RT||(RT=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var e=Vj,n=r(e);function r(s){return s&&s.__esModule?s:{default:s}}function i(s){return(0,n.default)(s)}})(d0)),d0}var ET;function Uj(){if(ET)return hg;ET=1,Object.defineProperty(hg,"__esModule",{value:!0}),hg.default=g;var t=Fj(),e=a(t),n=_k(),r=a(n),i=Dk(),s=a(i);function a(p){return p&&p.__esModule?p:{default:p}}var u={transition:!0,transitionProperty:!0,WebkitTransition:!0,WebkitTransitionProperty:!0,MozTransition:!0,MozTransitionProperty:!0},f={Webkit:"-webkit-",Moz:"-moz-",ms:"-ms-"};function d(p,m){if((0,r.default)(p))return p;for(var v=p.split(/,(?![^()]*(?:\([^()]*\))?\))/g),b=0,S=v.length;b<S;++b){var w=v[b],C=[w];for(var R in m){var T=(0,e.default)(R);if(w.indexOf(T)>-1&&T!=="order")for(var A=m[R],O=0,P=A.length;O<P;++O)C.unshift(w.replace(T,f[A[O]]+T))}v[b]=C.join(",")}return v.join(",")}function g(p,m,v,b){if(typeof m=="string"&&u.hasOwnProperty(p)){var S=d(m,b),w=S.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter(function(R){return!/-moz-|-ms-/.test(R)}).join(",");if(p.indexOf("Webkit")>-1)return w;var C=S.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter(function(R){return!/-webkit-|-ms-/.test(R)}).join(",");return p.indexOf("Moz")>-1?C:(v["Webkit"+(0,s.default)(p)]=w,v["Moz"+(0,s.default)(p)]=C,S)}}return hg}var $j=Uj();const qj=_o($j);var wn=["Webkit"],Gj=["Moz"],Wj=["Webkit","Moz"],Kn=["Webkit","ms"],Kj=["Webkit","Moz","ms"];const Yj={plugins:[Mj,Ij,zj,Bj,jj,qj],prefixMap:{appearance:Kj,userSelect:Wj,textEmphasisPosition:Kn,textEmphasis:Kn,textEmphasisStyle:Kn,textEmphasisColor:Kn,boxDecorationBreak:Kn,clipPath:wn,maskImage:Kn,maskMode:Kn,maskRepeat:Kn,maskPosition:Kn,maskClip:Kn,maskOrigin:Kn,maskSize:Kn,maskComposite:Kn,mask:Kn,maskBorderSource:Kn,maskBorderMode:Kn,maskBorderSlice:Kn,maskBorderWidth:Kn,maskBorderOutset:Kn,maskBorderRepeat:Kn,maskBorder:Kn,maskType:Kn,textDecorationStyle:wn,textDecorationSkip:wn,textDecorationLine:wn,textDecorationColor:wn,filter:wn,breakAfter:wn,breakBefore:wn,breakInside:wn,columnCount:wn,columnFill:wn,columnGap:wn,columnRule:wn,columnRuleColor:wn,columnRuleStyle:wn,columnRuleWidth:wn,columns:wn,columnSpan:wn,columnWidth:wn,backdropFilter:wn,hyphens:wn,flowInto:wn,flowFrom:wn,regionFragment:wn,textOrientation:wn,tabSize:Gj,fontKerning:wn,textSizeAdjust:wn}};var Xj=XH(Yj),Qj=["animationKeyframes"],TT=new Map,Zj={},Jj=1,eV=3,tV={borderColor:2,borderRadius:2,borderStyle:2,borderWidth:2,display:2,flex:2,inset:2,margin:2,overflow:2,overscrollBehavior:2,padding:2,insetBlock:2.1,insetInline:2.1,marginInline:2.1,marginBlock:2.1,paddingInline:2.1,paddingBlock:2.1,borderBlockStartColor:2.2,borderBlockStartStyle:2.2,borderBlockStartWidth:2.2,borderBlockEndColor:2.2,borderBlockEndStyle:2.2,borderBlockEndWidth:2.2,borderInlineStartColor:2.2,borderInlineStartStyle:2.2,borderInlineStartWidth:2.2,borderInlineEndColor:2.2,borderInlineEndStyle:2.2,borderInlineEndWidth:2.2,borderEndStartRadius:2.2,borderEndEndRadius:2.2,borderStartStartRadius:2.2,borderStartEndRadius:2.2,insetBlockEnd:2.2,insetBlockStart:2.2,insetInlineEnd:2.2,insetInlineStart:2.2,marginBlockStart:2.2,marginBlockEnd:2.2,marginInlineStart:2.2,marginInlineEnd:2.2,paddingBlockStart:2.2,paddingBlockEnd:2.2,paddingInlineStart:2.2,paddingInlineEnd:2.2},Pb="borderTopLeftRadius",zb="borderTopRightRadius",Nb="borderBottomLeftRadius",Lb="borderBottomRightRadius",Bb="borderLeftColor",_b="borderLeftStyle",Hb="borderLeftWidth",jb="borderRightColor",Vb="borderRightStyle",Fb="borderRightWidth",Ub="right",$b="marginLeft",qb="marginRight",Gb="paddingLeft",Wb="paddingRight",Kb="left",wp={[Pb]:zb,[zb]:Pb,[Nb]:Lb,[Lb]:Nb,[Bb]:jb,[_b]:Vb,[Hb]:Fb,[jb]:Bb,[Vb]:_b,[Fb]:Hb,[Kb]:Ub,[$b]:qb,[qb]:$b,[Gb]:Wb,[Wb]:Gb,[Ub]:Kb},qf={borderStartStartRadius:Pb,borderStartEndRadius:zb,borderEndStartRadius:Nb,borderEndEndRadius:Lb,borderInlineStartColor:Bb,borderInlineStartStyle:_b,borderInlineStartWidth:Hb,borderInlineEndColor:jb,borderInlineEndStyle:Vb,borderInlineEndWidth:Fb,insetInlineEnd:Ub,insetInlineStart:Kb,marginInlineStart:$b,marginInlineEnd:qb,paddingInlineStart:Gb,paddingInlineEnd:Wb},Hk=["clear","float","textAlign"];function nV(t){var e={$$css:!0},n=[];function r(i,s,a){var u=oV(a,s),f=s+u,d=TT.get(f),g;if(d!=null)g=d[0],n.push(d[1]);else{var p=i!==s?f:u;g=IS("r",i,p);var m=tV[i]||eV,v=sV(g,s,a),b=[v,m];n.push(b),TT.set(f,[g,b])}return g}return Object.keys(t).sort().forEach(i=>{var s=t[i];if(s!=null){var a;if(Hk.indexOf(i)>-1){var u=r(i,i,"left"),f=r(i,i,"right");s==="start"?a=[u,f]:s==="end"&&(a=[f,u])}var d=qf[i];if(d!=null){var g=r(i,d,s),p=r(i,wp[d],s);a=[g,p]}if(i==="transitionProperty"){for(var m=Array.isArray(s)?s:[s],v=[],b=0;b<m.length;b++){var S=m[b];typeof S=="string"&&qf[S]!=null&&v.push(b)}if(v.length>0){var w=[...m],C=[...m];v.forEach(R=>{var T=w[R];if(typeof T=="string"){var A=qf[T],O=wp[A];w[R]=A,C[R]=O;var P=r(i,i,w),M=r(i,i,C);a=[P,M]}})}}a==null?a=r(i,i,s):e.$$css$localize=!0,e[i]=a}}),[e,n]}function rV(t,e){var n={$$css:!0},r=[],i=t.animationKeyframes,s=um(t,Qj),a=IS("css",e,JSON.stringify(t)),u="."+a,f;if(i!=null){var d=jk(i),g=d[0],p=d[1];f=g.join(","),r.push(...p)}var m=ts(mc(mc({},s),{},{animationName:f}));return r.push(""+u+m),n[a]=a,[n,[[r,Jj]]]}function iV(t,e){var n=t||Zj,r={},i={},s=function(){var d=n[a],g=a,p=d;if(!Object.prototype.hasOwnProperty.call(n,a)||d==null)return"continue";Hk.indexOf(a)>-1&&(d==="start"?p=e?"right":"left":d==="end"&&(p=e?"left":"right"));var m=qf[a];if(m!=null&&(g=e?wp[m]:m),a==="transitionProperty"){var v=Array.isArray(d)?d:[d];v.forEach((b,S)=>{if(typeof b=="string"){var w=qf[b];w!=null&&(v[S]=e?wp[w]:w,p=v.join(" "))}})}r[g]||(i[g]=p),g===a&&(r[g]=!0)};for(var a in n)var u=s();return Ik(i,!0)}function oV(t,e){var n=ni(t,e);return typeof n!="string"?JSON.stringify(n||""):n}function sV(t,e,n){var r=[],i="."+t;switch(e){case"animationKeyframes":{var s=jk(n),a=s[0],u=s[1],f=ts({animationName:a.join(",")});r.push(""+i+f,...u);break}case"placeholderTextColor":{var d=ts({color:n,opacity:1});r.push(i+"::-webkit-input-placeholder"+d,i+"::-moz-placeholder"+d,i+":-ms-input-placeholder"+d,i+"::placeholder"+d);break}case"pointerEvents":{var g=n;if(n==="auto")g="auto!important";else if(n==="none"){g="none!important";var p=ts({pointerEvents:"none"});r.push(i+">* "+p)}else if(n==="box-none"){g="none!important";var m=ts({pointerEvents:"auto"});r.push(i+">* "+m)}else if(n==="box-only"){g="auto!important";var v=ts({pointerEvents:"none"});r.push(i+">* "+v)}var b=ts({pointerEvents:g});r.push(""+i+b);break}case"scrollbarWidth":{n==="none"&&r.push(i+"::-webkit-scrollbar{display:none}");var S=ts({scrollbarWidth:n});r.push(""+i+S);break}default:{var w=ts({[e]:n});r.push(""+i+w);break}}return r}function ts(t){var e=Xj(Ik(t)),n=Object.keys(e).map(r=>{var i=e[r],s=UH(r);return Array.isArray(i)?i.map(a=>s+":"+a).join(";"):s+":"+i}).sort().join(";");return"{"+n+";}"}function IS(t,e,n){var r=HH(e+n);return t+"-"+r}function lV(t){var e=["-webkit-",""],n=IS("r","animation",JSON.stringify(t)),r="{"+Object.keys(t).map(s=>{var a=t[s],u=ts(a);return""+s+u}).join("")+"}",i=e.map(s=>"@"+s+"keyframes "+n+r);return[n,i]}function jk(t){if(typeof t=="number")throw new Error("Invalid CSS keyframes type: "+typeof t);var e=[],n=[],r=Array.isArray(t)?t:[t];return r.forEach(i=>{if(typeof i=="string")e.push(i);else{var s=lV(i),a=s[0],u=s[1];e.push(a),n.push(...u)}}),[e,n]}function h0(t,e,n){if(hu){var r=e??document,i=r.getElementById(t);if(i==null)if(i=document.createElement("style"),i.setAttribute("id",t),typeof n=="string"&&i.appendChild(document.createTextNode(n)),r instanceof ShadowRoot)r.insertBefore(i,r.firstChild);else{var s=r.head;s&&s.insertBefore(i,s.firstChild)}return i.sheet}else return null}var aV=Array.prototype.slice;function g0(t){var e={},n={};if(t!=null){var r;aV.call(t.cssRules).forEach((a,u)=>{var f=a.cssText;if(f.indexOf("stylesheet-group")>-1)r=fV(a),e[r]={start:u,rules:[f]};else{var d=MT(f);d!=null&&(n[d]=!0,e[r].rules.push(f))}})}function i(a,u,f){var d=AT(e),g=d.indexOf(u),p=g+1,m=d[p],v=m!=null&&e[m].start!=null?e[m].start:a.cssRules.length,b=hV(a,f,v);if(b){e[u].start==null&&(e[u].start=v);for(var S=p;S<d.length;S+=1){var w=d[S],C=e[w].start||0;e[w].start=C+1}}return b}var s={getTextContent(){return AT(e).map(a=>{var u=e[a].rules,f=u.shift();return u.sort(),u.unshift(f),u.join(`
3
- `)}).join(`
4
- `)},insert(a,u){var f=Number(u);if(e[f]==null){var d=uV(f);e[f]={start:null,rules:[d]},t!=null&&i(t,f,d)}var g=MT(a);if(g!=null&&n[g]==null&&(n[g]=!0,e[f].rules.push(a),t!=null)){var p=i(t,f,a);p||e[f].rules.pop()}}};return s}function uV(t){return'[stylesheet-group="'+t+'"]{}'}var cV=/["']/g;function fV(t){return Number(t.selectorText.split(cV)[1])}function AT(t){return Object.keys(t).map(Number).sort((e,n)=>e>n?1:-1)}var dV=/\s*([,])\s*/g;function MT(t){var e=t.split("{")[0].trim();return e!==""?e.replace(dV,"$1"):null}function hV(t,e,n){try{return t.insertRule(e,n),!0}catch{return!1}}var gV="react-native-stylesheet",p0=new WeakMap,Ro=[],OT=["html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);}","body{margin:0;}","button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;}","input::-webkit-search-cancel-button,input::-webkit-search-decoration,input::-webkit-search-results-button,input::-webkit-search-results-decoration{display:none;}"];function DS(t,e){e===void 0&&(e=gV);var n;if(hu){var r=t!=null?t.getRootNode():document;if(Ro.length===0)n=g0(h0(e)),OT.forEach(u=>{n.insert(u,0)}),p0.set(r,Ro.length),Ro.push(n);else{var i=p0.get(r);if(i==null){var s=Ro[0],a=s!=null?s.getTextContent():"";n=g0(h0(e,r,a)),p0.set(r,Ro.length),Ro.push(n)}else n=Ro[i]}}else Ro.length===0?(n=g0(h0(e)),OT.forEach(u=>{n.insert(u,0)}),Ro.push(n)):n=Ro[0];return{getTextContent(){return n.getTextContent()},id:e,insert(u,f){Ro.forEach(d=>{d.insert(u,f)})}}}var gg={},kT;function pV(){if(kT)return gg;kT=1,Object.defineProperty(gg,"__esModule",{value:!0}),gg.localizeStyle=r;var t=new WeakMap,e="$$css$localize";function n(i,s){var a={};for(var u in i)if(u!==e){var f=i[u];Array.isArray(f)?a[u]=s?f[1]:f[0]:a[u]=f}return a}function r(i,s){if(i[e]!=null){var a=s?1:0;if(t.has(i)){var u=t.get(i),f=u[a];return f==null&&(f=n(i,s),u[a]=f,t.set(i,u)),f}var d=n(i,s),g=new Array(2);return g[a]=d,t.set(i,g),d}return i}return gg}var m0,IT;function mV(){return IT||(IT=1,m0=pV()),m0}var yV=mV(),vV={},Vk={height:0,width:0},bV=t=>{var e=t.shadowColor,n=t.shadowOffset,r=t.shadowOpacity,i=t.shadowRadius,s=n||Vk,a=s.height,u=s.width,f=ni(u),d=ni(a),g=ni(i||0),p=kS(e||"black",r);if(p!=null&&f!=null&&d!=null&&g!=null)return f+" "+d+" "+g+" "+p},xV=t=>{var e=t.textShadowColor,n=t.textShadowOffset,r=t.textShadowRadius,i=n||Vk,s=i.height,a=i.width,u=r||0,f=ni(a),d=ni(s),g=ni(u),p=ni(e,"textShadowColor");if(p&&(s!==0||a!==0||u!==0)&&f!=null&&d!=null&&g!=null)return f+" "+d+" "+g+" "+p},SV=t=>{if(typeof t=="string")return t;var e=ni(t.offsetX)||0,n=ni(t.offsetY)||0,r=ni(t.blurRadius)||0,i=ni(t.spreadDistance)||0,s=kS(t.color)||"black",a=t.inset?"inset ":"";return""+a+e+" "+n+" "+r+" "+i+" "+s},wV=t=>t.map(SV).join(", "),CV=t=>{var e=Object.keys(t)[0],n=t[e];if(e==="matrix"||e==="matrix3d")return e+"("+n.join(",")+")";var r=ni(n,e);return e+"("+r+")"},RV=t=>t.map(CV).join(" "),EV=t=>t.map(e=>ni(e)).join(" "),TV={borderBottomEndRadius:"borderEndEndRadius",borderBottomStartRadius:"borderEndStartRadius",borderTopEndRadius:"borderStartEndRadius",borderTopStartRadius:"borderStartStartRadius",borderEndColor:"borderInlineEndColor",borderEndStyle:"borderInlineEndStyle",borderEndWidth:"borderInlineEndWidth",borderStartColor:"borderInlineStartColor",borderStartStyle:"borderInlineStartStyle",borderStartWidth:"borderInlineStartWidth",end:"insetInlineEnd",marginEnd:"marginInlineEnd",marginHorizontal:"marginInline",marginStart:"marginInlineStart",marginVertical:"marginBlock",paddingEnd:"paddingInlineEnd",paddingHorizontal:"paddingInline",paddingStart:"paddingInlineStart",paddingVertical:"paddingBlock",start:"insetInlineStart"},AV={elevation:!0,overlayColor:!0,resizeMode:!0,tintColor:!0},Fk=function(e,n){n===void 0&&(n={});var r=e||vV,i={};if(n.shadow,r.shadowColor!=null||r.shadowOffset!=null||r.shadowOpacity!=null||r.shadowRadius!=null){var s=bV(r);s!=null&&(i.boxShadow=s)}if(n.textShadow,r.textShadowColor!=null||r.textShadowOffset!=null||r.textShadowRadius!=null){var a=xV(r);if(a!=null&&i.textShadow==null){var u=r.textShadow,f=u?u+", "+a:a;i.textShadow=f}}for(var d in r)if(!(AV[d]!=null||d==="shadowColor"||d==="shadowOffset"||d==="shadowOpacity"||d==="shadowRadius"||d==="textShadowColor"||d==="textShadowOffset"||d==="textShadowRadius")){var g=r[d],p=TV[d]||d,m=g;if(!(!Object.prototype.hasOwnProperty.call(r,d)||p!==d&&r[p]!=null))if(p==="aspectRatio"&&typeof m=="number")i[p]=m.toString();else if(p==="boxShadow"){Array.isArray(m)&&(m=wV(m));var v=i.boxShadow;i.boxShadow=v?m+", "+v:m}else p==="fontVariant"?(Array.isArray(m)&&m.length>0&&(m=m.join(" ")),i[p]=m):p==="textAlignVertical"?r.verticalAlign==null&&(i.verticalAlign=m==="center"?"middle":m):p==="transform"?(Array.isArray(m)&&(m=RV(m)),i.transform=m):p==="transformOrigin"?(Array.isArray(m)&&(m=EV(m)),i.transformOrigin=m):i[p]=m}return i},Ef={},DT;function MV(){if(DT)return Ef;DT=1,Object.defineProperty(Ef,"__esModule",{value:!0}),Ef.styleq=void 0;var t=new WeakMap,e="$$css";function n(i){var s,a,u;return i!=null&&(s=i.disableCache===!0,a=i.disableMix===!0,u=i.transform),function(){for(var d=[],g="",p=null,m=s?null:t,v=new Array(arguments.length),b=0;b<arguments.length;b++)v[b]=arguments[b];for(;v.length>0;){var S=v.pop();if(!(S==null||S===!1)){if(Array.isArray(S)){for(var w=0;w<S.length;w++)v.push(S[w]);continue}var C=u!=null?u(S):S;if(C.$$css){var R="";if(m!=null&&m.has(C)){var T=m.get(C);T!=null&&(R=T[0],d.push.apply(d,T[1]),m=T[2])}else{var A=[];for(var O in C){var P=C[O];O!==e&&(typeof P=="string"||P===null?d.includes(O)||(d.push(O),m!=null&&A.push(O),typeof P=="string"&&(R+=R?" "+P:P)):console.error("styleq: ".concat(O," typeof ").concat(String(P),' is not "string" or "null".')))}if(m!=null){var M=new WeakMap;m.set(C,[R,A,M]),m=M}}R&&(g=g?R+" "+g:R)}else if(a)p==null&&(p={}),p=Object.assign({},C,p);else{var D=null;for(var L in C){var H=C[L];H!==void 0&&(d.includes(L)||(H!=null&&(p==null&&(p={}),D==null&&(D={}),D[L]=H),d.push(L),m=null))}D!=null&&(p=Object.assign(D,p))}}}var N=[g,p];return N}}var r=n();return Ef.styleq=r,r.factory=n,Ef}var OV=MV(),kV=["writingDirection"],Uk=new WeakMap,Cp=DS(),$k={shadow:!0,textShadow:!0};function IV(t,e){e===void 0&&(e={});var n=e,r=n.writingDirection,i=um(n,kV),s=r==="rtl";return OV.styleq.factory({transform(a){var u=Uk.get(a);return u!=null?yV.localizeStyle(u,s):Fk(a,mc(mc({},$k),i))}})(t)}function qk(t){t.forEach(e=>{var n=e[0],r=e[1];Cp!=null&&n.forEach(i=>{Cp.insert(i,r)})})}function DV(t){var e=nV(Fk(t,$k)),n=e[0],r=e[1];return qk(r),n}function PV(t,e){var n=rV(t,e),r=n[0],i=n[1];return qk(i),r}var Gk={position:"absolute",left:0,right:0,top:0,bottom:0},zV=Wk({x:mc({},Gk)}).x;function Wk(t){return Object.keys(t).forEach(e=>{var n=t[e];if(n!=null&&n.$$css!==!0){var r;e.indexOf("$raw")>-1?r=PV(n,e.split("$raw")[0]):r=DV(n),Uk.set(n,r)}}),t}function NV(t,e){return[t,e]}function LV(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=e.flat(1/0),i={},s=0;s<r.length;s++){var a=r[s];a!=null&&typeof a=="object"&&Object.assign(i,a)}return i}function BV(){return{id:Cp.id,textContent:Cp.getTextContent()}}function rl(t,e){e===void 0&&(e={});var n=e.writingDirection==="rtl",r=IV(t,e);return Array.isArray(r)&&r[1]!=null&&(r[1]=iV(r[1],n)),r}rl.absoluteFill=zV;rl.absoluteFillObject=Gk;rl.create=Wk;rl.compose=NV;rl.flatten=LV;rl.getSheet=BV;rl.hairlineWidth=1;hu&&window.__REACT_DEVTOOLS_GLOBAL_HOOK__&&(window.__REACT_DEVTOOLS_GLOBAL_HOOK__.resolveRNStyle=rl.flatten);var zd=rl,_V=["aria-activedescendant","accessibilityActiveDescendant","aria-atomic","accessibilityAtomic","aria-autocomplete","accessibilityAutoComplete","aria-busy","accessibilityBusy","aria-checked","accessibilityChecked","aria-colcount","accessibilityColumnCount","aria-colindex","accessibilityColumnIndex","aria-colspan","accessibilityColumnSpan","aria-controls","accessibilityControls","aria-current","accessibilityCurrent","aria-describedby","accessibilityDescribedBy","aria-details","accessibilityDetails","aria-disabled","accessibilityDisabled","aria-errormessage","accessibilityErrorMessage","aria-expanded","accessibilityExpanded","aria-flowto","accessibilityFlowTo","aria-haspopup","accessibilityHasPopup","aria-hidden","accessibilityHidden","aria-invalid","accessibilityInvalid","aria-keyshortcuts","accessibilityKeyShortcuts","aria-label","accessibilityLabel","aria-labelledby","accessibilityLabelledBy","aria-level","accessibilityLevel","aria-live","accessibilityLiveRegion","aria-modal","accessibilityModal","aria-multiline","accessibilityMultiline","aria-multiselectable","accessibilityMultiSelectable","aria-orientation","accessibilityOrientation","aria-owns","accessibilityOwns","aria-placeholder","accessibilityPlaceholder","aria-posinset","accessibilityPosInSet","aria-pressed","accessibilityPressed","aria-readonly","accessibilityReadOnly","aria-required","accessibilityRequired","role","accessibilityRole","aria-roledescription","accessibilityRoleDescription","aria-rowcount","accessibilityRowCount","aria-rowindex","accessibilityRowIndex","aria-rowspan","accessibilityRowSpan","aria-selected","accessibilitySelected","aria-setsize","accessibilitySetSize","aria-sort","accessibilitySort","aria-valuemax","accessibilityValueMax","aria-valuemin","accessibilityValueMin","aria-valuenow","accessibilityValueNow","aria-valuetext","accessibilityValueText","dataSet","focusable","id","nativeID","pointerEvents","style","tabIndex","testID"],HV={},jV=Object.prototype.hasOwnProperty,VV=Array.isArray,FV=/[A-Z]/g;function UV(t){return"-"+t.toLowerCase()}function $V(t){return t.replace(FV,UV)}function Xu(t){return VV(t)?t.join(" "):t}var qV=zd.create({auto:{pointerEvents:"auto"},"box-none":{pointerEvents:"box-none"},"box-only":{pointerEvents:"box-only"},none:{pointerEvents:"none"}}),GV=(t,e,n)=>{e||(e=HV);var r=e,i=r["aria-activedescendant"],s=r.accessibilityActiveDescendant,a=r["aria-atomic"],u=r.accessibilityAtomic,f=r["aria-autocomplete"],d=r.accessibilityAutoComplete,g=r["aria-busy"],p=r.accessibilityBusy,m=r["aria-checked"],v=r.accessibilityChecked,b=r["aria-colcount"],S=r.accessibilityColumnCount,w=r["aria-colindex"],C=r.accessibilityColumnIndex,R=r["aria-colspan"],T=r.accessibilityColumnSpan,A=r["aria-controls"],O=r.accessibilityControls,P=r["aria-current"],M=r.accessibilityCurrent,D=r["aria-describedby"],L=r.accessibilityDescribedBy,H=r["aria-details"],N=r.accessibilityDetails,_=r["aria-disabled"],$=r.accessibilityDisabled,F=r["aria-errormessage"],G=r.accessibilityErrorMessage,j=r["aria-expanded"],q=r.accessibilityExpanded,V=r["aria-flowto"],te=r.accessibilityFlowTo,J=r["aria-haspopup"],z=r.accessibilityHasPopup,U=r["aria-hidden"],W=r.accessibilityHidden,X=r["aria-invalid"],ie=r.accessibilityInvalid,ee=r["aria-keyshortcuts"],ue=r.accessibilityKeyShortcuts,Y=r["aria-label"],le=r.accessibilityLabel,xe=r["aria-labelledby"],ve=r.accessibilityLabelledBy,de=r["aria-level"],me=r.accessibilityLevel,Ce=r["aria-live"],Pe=r.accessibilityLiveRegion,ze=r["aria-modal"],Ee=r.accessibilityModal,Ve=r["aria-multiline"],Ie=r.accessibilityMultiline,He=r["aria-multiselectable"],Ge=r.accessibilityMultiSelectable,We=r["aria-orientation"],fe=r.accessibilityOrientation,ne=r["aria-owns"],Q=r.accessibilityOwns,Se=r["aria-placeholder"],ge=r.accessibilityPlaceholder,De=r["aria-posinset"],Te=r.accessibilityPosInSet,_e=r["aria-pressed"],nt=r.accessibilityPressed,Mt=r["aria-readonly"],kt=r.accessibilityReadOnly,It=r["aria-required"],bn=r.accessibilityRequired;r.role,r.accessibilityRole;var at=r["aria-roledescription"],Mn=r.accessibilityRoleDescription,Qt=r["aria-rowcount"],xn=r.accessibilityRowCount,nn=r["aria-rowindex"],Wt=r.accessibilityRowIndex,st=r["aria-rowspan"],pt=r.accessibilityRowSpan,tt=r["aria-selected"],Zt=r.accessibilitySelected,Hn=r["aria-setsize"],jn=r.accessibilitySetSize,Jt=r["aria-sort"],Rn=r.accessibilitySort,Dt=r["aria-valuemax"],Br=r.accessibilityValueMax,or=r["aria-valuemin"],rt=r.accessibilityValueMin,Ut=r["aria-valuenow"],$n=r.accessibilityValueNow,Ln=r["aria-valuetext"],wr=r.accessibilityValueText,rn=r.dataSet,Pt=r.focusable,zt=r.id,Je=r.nativeID,Cr=r.pointerEvents,_c=r.style,xs=r.tabIndex,fl=r.testID,Fe=um(r,_V),Sa=_||$,Zn=Ok.propsToAriaRole(e),Bi=i??s;Bi!=null&&(Fe["aria-activedescendant"]=Bi);var li=a!=null?i:u;li!=null&&(Fe["aria-atomic"]=li);var ai=f??d;ai!=null&&(Fe["aria-autocomplete"]=ai);var Vn=g??p;Vn!=null&&(Fe["aria-busy"]=Vn);var sr=m??v;sr!=null&&(Fe["aria-checked"]=sr);var _r=b??S;_r!=null&&(Fe["aria-colcount"]=_r);var _i=w??C;_i!=null&&(Fe["aria-colindex"]=_i);var mo=R??T;mo!=null&&(Fe["aria-colspan"]=mo);var wa=A??O;wa!=null&&(Fe["aria-controls"]=Xu(wa));var Ca=P??M;Ca!=null&&(Fe["aria-current"]=Ca);var Ss=D??L;Ss!=null&&(Fe["aria-describedby"]=Xu(Ss));var Ra=H??N;Ra!=null&&(Fe["aria-details"]=Ra),Sa===!0&&(Fe["aria-disabled"]=!0,(t==="button"||t==="form"||t==="input"||t==="select"||t==="textarea")&&(Fe.disabled=!0));var yo=F??G;yo!=null&&(Fe["aria-errormessage"]=yo);var ws=j??q;ws!=null&&(Fe["aria-expanded"]=ws);var Zr=V??te;Zr!=null&&(Fe["aria-flowto"]=Xu(Zr));var qn=J??z;qn!=null&&(Fe["aria-haspopup"]=qn);var Hr=U??W;Hr===!0&&(Fe["aria-hidden"]=Hr);var Jr=X??ie;Jr!=null&&(Fe["aria-invalid"]=Jr);var Hi=ee??ue;Hi!=null&&(Fe["aria-keyshortcuts"]=Xu(Hi));var Fo=Y??le;Fo!=null&&(Fe["aria-label"]=Fo);var Cs=xe??ve;Cs!=null&&(Fe["aria-labelledby"]=Xu(Cs));var bu=de??me;bu!=null&&(Fe["aria-level"]=bu);var lr=Ce??Pe;lr!=null&&(Fe["aria-live"]=lr==="none"?"off":lr);var dl=ze??Ee;dl!=null&&(Fe["aria-modal"]=dl);var Ea=Ve??Ie;Ea!=null&&(Fe["aria-multiline"]=Ea);var Rs=He??Ge;Rs!=null&&(Fe["aria-multiselectable"]=Rs);var ui=We??fe;ui!=null&&(Fe["aria-orientation"]=ui);var hl=ne??Q;hl!=null&&(Fe["aria-owns"]=Xu(hl));var Uo=Se??ge;Uo!=null&&(Fe["aria-placeholder"]=Uo);var ji=De??Te;ji!=null&&(Fe["aria-posinset"]=ji);var Es=_e??nt;Es!=null&&(Fe["aria-pressed"]=Es);var gl=Mt??kt;gl!=null&&(Fe["aria-readonly"]=gl,(t==="input"||t==="select"||t==="textarea")&&(Fe.readOnly=!0));var $o=It??bn;$o!=null&&(Fe["aria-required"]=$o,(t==="input"||t==="select"||t==="textarea")&&(Fe.required=bn)),Zn!=null&&(Fe.role=Zn==="none"?"presentation":Zn);var Si=at??Mn;Si!=null&&(Fe["aria-roledescription"]=Si);var pl=Qt??xn;pl!=null&&(Fe["aria-rowcount"]=pl);var ml=nn??Wt;ml!=null&&(Fe["aria-rowindex"]=ml);var vo=st??pt;vo!=null&&(Fe["aria-rowspan"]=vo);var jr=tt??Zt;jr!=null&&(Fe["aria-selected"]=jr);var yl=Hn??jn;yl!=null&&(Fe["aria-setsize"]=yl);var vl=Jt??Rn;vl!=null&&(Fe["aria-sort"]=vl);var bo=Dt??Br;bo!=null&&(Fe["aria-valuemax"]=bo);var xo=or??rt;xo!=null&&(Fe["aria-valuemin"]=xo);var Ts=Ut??$n;Ts!=null&&(Fe["aria-valuenow"]=Ts);var bl=Ln??wr;if(bl!=null&&(Fe["aria-valuetext"]=bl),rn!=null){for(var xl in rn)if(jV.call(rn,xl)){var ke=$V(xl),Ne=rn[xl];Ne!=null&&(Fe["data-"+ke]=Ne)}}xs===0||xs==="0"||xs===-1||xs==="-1"?Fe.tabIndex=xs:(Pt===!1&&(Fe.tabIndex="-1"),t==="a"||t==="button"||t==="input"||t==="select"||t==="textarea"?(Pt===!1||$===!0)&&(Fe.tabIndex="-1"):Zn==="button"||Zn==="checkbox"||Zn==="link"||Zn==="radio"||Zn==="textbox"||Zn==="switch"?Pt!==!1&&(Fe.tabIndex="0"):Pt===!0&&(Fe.tabIndex="0"));var $t=zd([_c,Cr&&qV[Cr]],mc({writingDirection:"ltr"},n)),Bt=$t[0],en=$t[1];Bt&&(Fe.className=Bt),en&&(Fe.style=en);var Jn=zt??Je;return Jn!=null&&(Fe.id=Jn),fl!=null&&(Fe["data-testid"]=fl),Fe.type==null&&t==="button"&&(Fe.type="button"),Fe},y0={exports:{}},yt={};var PT;function WV(){if(PT)return yt;PT=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),a=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),m=Symbol.iterator;function v(z){return z===null||typeof z!="object"?null:(z=m&&z[m]||z["@@iterator"],typeof z=="function"?z:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,w={};function C(z,U,W){this.props=z,this.context=U,this.refs=w,this.updater=W||b}C.prototype.isReactComponent={},C.prototype.setState=function(z,U){if(typeof z!="object"&&typeof z!="function"&&z!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,z,U,"setState")},C.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function R(){}R.prototype=C.prototype;function T(z,U,W){this.props=z,this.context=U,this.refs=w,this.updater=W||b}var A=T.prototype=new R;A.constructor=T,S(A,C.prototype),A.isPureReactComponent=!0;var O=Array.isArray;function P(){}var M={H:null,A:null,T:null,S:null},D=Object.prototype.hasOwnProperty;function L(z,U,W){var X=W.ref;return{$$typeof:t,type:z,key:U,ref:X!==void 0?X:null,props:W}}function H(z,U){return L(z.type,U,z.props)}function N(z){return typeof z=="object"&&z!==null&&z.$$typeof===t}function _(z){var U={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(W){return U[W]})}var $=/\/+/g;function F(z,U){return typeof z=="object"&&z!==null&&z.key!=null?_(""+z.key):U.toString(36)}function G(z){switch(z.status){case"fulfilled":return z.value;case"rejected":throw z.reason;default:switch(typeof z.status=="string"?z.then(P,P):(z.status="pending",z.then(function(U){z.status==="pending"&&(z.status="fulfilled",z.value=U)},function(U){z.status==="pending"&&(z.status="rejected",z.reason=U)})),z.status){case"fulfilled":return z.value;case"rejected":throw z.reason}}throw z}function j(z,U,W,X,ie){var ee=typeof z;(ee==="undefined"||ee==="boolean")&&(z=null);var ue=!1;if(z===null)ue=!0;else switch(ee){case"bigint":case"string":case"number":ue=!0;break;case"object":switch(z.$$typeof){case t:case e:ue=!0;break;case g:return ue=z._init,j(ue(z._payload),U,W,X,ie)}}if(ue)return ie=ie(z),ue=X===""?"."+F(z,0):X,O(ie)?(W="",ue!=null&&(W=ue.replace($,"$&/")+"/"),j(ie,U,W,"",function(xe){return xe})):ie!=null&&(N(ie)&&(ie=H(ie,W+(ie.key==null||z&&z.key===ie.key?"":(""+ie.key).replace($,"$&/")+"/")+ue)),U.push(ie)),1;ue=0;var Y=X===""?".":X+":";if(O(z))for(var le=0;le<z.length;le++)X=z[le],ee=Y+F(X,le),ue+=j(X,U,W,ee,ie);else if(le=v(z),typeof le=="function")for(z=le.call(z),le=0;!(X=z.next()).done;)X=X.value,ee=Y+F(X,le++),ue+=j(X,U,W,ee,ie);else if(ee==="object"){if(typeof z.then=="function")return j(G(z),U,W,X,ie);throw U=String(z),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return ue}function q(z,U,W){if(z==null)return z;var X=[],ie=0;return j(z,X,"","",function(ee){return U.call(W,ee,ie++)}),X}function V(z){if(z._status===-1){var U=z._result;U=U(),U.then(function(W){(z._status===0||z._status===-1)&&(z._status=1,z._result=W)},function(W){(z._status===0||z._status===-1)&&(z._status=2,z._result=W)}),z._status===-1&&(z._status=0,z._result=U)}if(z._status===1)return z._result.default;throw z._result}var te=typeof reportError=="function"?reportError:function(z){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof z=="object"&&z!==null&&typeof z.message=="string"?String(z.message):String(z),error:z});if(!window.dispatchEvent(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",z);return}console.error(z)},J={map:q,forEach:function(z,U,W){q(z,function(){U.apply(this,arguments)},W)},count:function(z){var U=0;return q(z,function(){U++}),U},toArray:function(z){return q(z,function(U){return U})||[]},only:function(z){if(!N(z))throw Error("React.Children.only expected to receive a single React element child.");return z}};return yt.Activity=p,yt.Children=J,yt.Component=C,yt.Fragment=n,yt.Profiler=i,yt.PureComponent=T,yt.StrictMode=r,yt.Suspense=f,yt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,yt.__COMPILER_RUNTIME={__proto__:null,c:function(z){return M.H.useMemoCache(z)}},yt.cache=function(z){return function(){return z.apply(null,arguments)}},yt.cacheSignal=function(){return null},yt.cloneElement=function(z,U,W){if(z==null)throw Error("The argument must be a React element, but you passed "+z+".");var X=S({},z.props),ie=z.key;if(U!=null)for(ee in U.key!==void 0&&(ie=""+U.key),U)!D.call(U,ee)||ee==="key"||ee==="__self"||ee==="__source"||ee==="ref"&&U.ref===void 0||(X[ee]=U[ee]);var ee=arguments.length-2;if(ee===1)X.children=W;else if(1<ee){for(var ue=Array(ee),Y=0;Y<ee;Y++)ue[Y]=arguments[Y+2];X.children=ue}return L(z.type,ie,X)},yt.createContext=function(z){return z={$$typeof:a,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null},z.Provider=z,z.Consumer={$$typeof:s,_context:z},z},yt.createElement=function(z,U,W){var X,ie={},ee=null;if(U!=null)for(X in U.key!==void 0&&(ee=""+U.key),U)D.call(U,X)&&X!=="key"&&X!=="__self"&&X!=="__source"&&(ie[X]=U[X]);var ue=arguments.length-2;if(ue===1)ie.children=W;else if(1<ue){for(var Y=Array(ue),le=0;le<ue;le++)Y[le]=arguments[le+2];ie.children=Y}if(z&&z.defaultProps)for(X in ue=z.defaultProps,ue)ie[X]===void 0&&(ie[X]=ue[X]);return L(z,ee,ie)},yt.createRef=function(){return{current:null}},yt.forwardRef=function(z){return{$$typeof:u,render:z}},yt.isValidElement=N,yt.lazy=function(z){return{$$typeof:g,_payload:{_status:-1,_result:z},_init:V}},yt.memo=function(z,U){return{$$typeof:d,type:z,compare:U===void 0?null:U}},yt.startTransition=function(z){var U=M.T,W={};M.T=W;try{var X=z(),ie=M.S;ie!==null&&ie(W,X),typeof X=="object"&&X!==null&&typeof X.then=="function"&&X.then(P,te)}catch(ee){te(ee)}finally{U!==null&&W.types!==null&&(U.types=W.types),M.T=U}},yt.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},yt.use=function(z){return M.H.use(z)},yt.useActionState=function(z,U,W){return M.H.useActionState(z,U,W)},yt.useCallback=function(z,U){return M.H.useCallback(z,U)},yt.useContext=function(z){return M.H.useContext(z)},yt.useDebugValue=function(){},yt.useDeferredValue=function(z,U){return M.H.useDeferredValue(z,U)},yt.useEffect=function(z,U){return M.H.useEffect(z,U)},yt.useEffectEvent=function(z){return M.H.useEffectEvent(z)},yt.useId=function(){return M.H.useId()},yt.useImperativeHandle=function(z,U,W){return M.H.useImperativeHandle(z,U,W)},yt.useInsertionEffect=function(z,U){return M.H.useInsertionEffect(z,U)},yt.useLayoutEffect=function(z,U){return M.H.useLayoutEffect(z,U)},yt.useMemo=function(z,U){return M.H.useMemo(z,U)},yt.useOptimistic=function(z,U){return M.H.useOptimistic(z,U)},yt.useReducer=function(z,U,W){return M.H.useReducer(z,U,W)},yt.useRef=function(z){return M.H.useRef(z)},yt.useState=function(z){return M.H.useState(z)},yt.useSyncExternalStore=function(z,U,W){return M.H.useSyncExternalStore(z,U,W)},yt.useTransition=function(){return M.H.useTransition()},yt.version="19.2.3",yt}var zT;function Nd(){return zT||(zT=1,y0.exports=WV()),y0.exports}var E=Nd();const Le=_o(E),KV=yH({__proto__:null,default:Le},[E]);var YV=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),NT=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","far","glk","he","iw","khw","ks","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]),LT=new Map;function XV(t){var e=LT.get(t);if(e)return e;var n=!1;if(Intl.Locale)try{var r=new Intl.Locale(t).maximize().script;n=YV.has(r)}catch{var i=t.split("-")[0];n=NT.has(i)}else{var s=t.split("-")[0];n=NT.has(s)}return LT.set(t,n),n}var QV={direction:"ltr",locale:"en-US"},Kk=E.createContext(QV);function Yk(t){return XV(t)?"rtl":"ltr"}function ZV(t){var e=t.direction,n=t.locale,r=t.children,i=e||n;return i?Le.createElement(Kk.Provider,{children:r,value:{direction:n?Yk(n):e,locale:n}}):r}function JV(){return E.useContext(Kk)}var e3=(t,e,n)=>{var r;t&&t.constructor===String&&(r=Ok.propsToAccessibilityComponent(e));var i=r||t,s=GV(i,e,n),a=Le.createElement(i,s),u=s.dir?Le.createElement(ZV,{children:a,direction:s.dir,locale:s.lang}):a;return u},v0={exports:{}},Tf={},b0={exports:{}},x0={};var BT;function t3(){return BT||(BT=1,(function(t){function e(j,q){var V=j.length;j.push(q);e:for(;0<V;){var te=V-1>>>1,J=j[te];if(0<i(J,q))j[te]=q,j[V]=J,V=te;else break e}}function n(j){return j.length===0?null:j[0]}function r(j){if(j.length===0)return null;var q=j[0],V=j.pop();if(V!==q){j[0]=V;e:for(var te=0,J=j.length,z=J>>>1;te<z;){var U=2*(te+1)-1,W=j[U],X=U+1,ie=j[X];if(0>i(W,V))X<J&&0>i(ie,W)?(j[te]=ie,j[X]=V,te=X):(j[te]=W,j[U]=V,te=U);else if(X<J&&0>i(ie,V))j[te]=ie,j[X]=V,te=X;else break e}}return q}function i(j,q){var V=j.sortIndex-q.sortIndex;return V!==0?V:j.id-q.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var a=Date,u=a.now();t.unstable_now=function(){return a.now()-u}}var f=[],d=[],g=1,p=null,m=3,v=!1,b=!1,S=!1,w=!1,C=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function A(j){for(var q=n(d);q!==null;){if(q.callback===null)r(d);else if(q.startTime<=j)r(d),q.sortIndex=q.expirationTime,e(f,q);else break;q=n(d)}}function O(j){if(S=!1,A(j),!b)if(n(f)!==null)b=!0,P||(P=!0,_());else{var q=n(d);q!==null&&G(O,q.startTime-j)}}var P=!1,M=-1,D=5,L=-1;function H(){return w?!0:!(t.unstable_now()-L<D)}function N(){if(w=!1,P){var j=t.unstable_now();L=j;var q=!0;try{e:{b=!1,S&&(S=!1,R(M),M=-1),v=!0;var V=m;try{t:{for(A(j),p=n(f);p!==null&&!(p.expirationTime>j&&H());){var te=p.callback;if(typeof te=="function"){p.callback=null,m=p.priorityLevel;var J=te(p.expirationTime<=j);if(j=t.unstable_now(),typeof J=="function"){p.callback=J,A(j),q=!0;break t}p===n(f)&&r(f),A(j)}else r(f);p=n(f)}if(p!==null)q=!0;else{var z=n(d);z!==null&&G(O,z.startTime-j),q=!1}}break e}finally{p=null,m=V,v=!1}q=void 0}}finally{q?_():P=!1}}}var _;if(typeof T=="function")_=function(){T(N)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,F=$.port2;$.port1.onmessage=N,_=function(){F.postMessage(null)}}else _=function(){C(N,0)};function G(j,q){M=C(function(){j(t.unstable_now())},q)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(j){j.callback=null},t.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<j?Math.floor(1e3/j):5},t.unstable_getCurrentPriorityLevel=function(){return m},t.unstable_next=function(j){switch(m){case 1:case 2:case 3:var q=3;break;default:q=m}var V=m;m=q;try{return j()}finally{m=V}},t.unstable_requestPaint=function(){w=!0},t.unstable_runWithPriority=function(j,q){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var V=m;m=j;try{return q()}finally{m=V}},t.unstable_scheduleCallback=function(j,q,V){var te=t.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?te+V:te):V=te,j){case 1:var J=-1;break;case 2:J=250;break;case 5:J=1073741823;break;case 4:J=1e4;break;default:J=5e3}return J=V+J,j={id:g++,callback:q,priorityLevel:j,startTime:V,expirationTime:J,sortIndex:-1},V>te?(j.sortIndex=V,e(d,j),n(f)===null&&j===n(d)&&(S?(R(M),M=-1):S=!0,G(O,V-te))):(j.sortIndex=J,e(f,j),b||v||(b=!0,P||(P=!0,_()))),j},t.unstable_shouldYield=H,t.unstable_wrapCallback=function(j){var q=m;return function(){var V=m;m=q;try{return j.apply(this,arguments)}finally{m=V}}}})(x0)),x0}var _T;function n3(){return _T||(_T=1,b0.exports=t3()),b0.exports}var S0={exports:{}},Ur={};var HT;function r3(){if(HT)return Ur;HT=1;var t=Nd();function e(f){var d="https://react.dev/errors/"+f;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)d+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+f+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function s(f,d,g){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:p==null?null:""+p,children:f,containerInfo:d,implementation:g}}var a=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(f,d){if(f==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return Ur.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Ur.createPortal=function(f,d){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(e(299));return s(f,d,null,g)},Ur.flushSync=function(f){var d=a.T,g=r.p;try{if(a.T=null,r.p=2,f)return f()}finally{a.T=d,r.p=g,r.d.f()}},Ur.preconnect=function(f,d){typeof f=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,r.d.C(f,d))},Ur.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},Ur.preinit=function(f,d){if(typeof f=="string"&&d&&typeof d.as=="string"){var g=d.as,p=u(g,d.crossOrigin),m=typeof d.integrity=="string"?d.integrity:void 0,v=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;g==="style"?r.d.S(f,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:p,integrity:m,fetchPriority:v}):g==="script"&&r.d.X(f,{crossOrigin:p,integrity:m,fetchPriority:v,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},Ur.preinitModule=function(f,d){if(typeof f=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var g=u(d.as,d.crossOrigin);r.d.M(f,{crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&r.d.M(f)},Ur.preload=function(f,d){if(typeof f=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var g=d.as,p=u(g,d.crossOrigin);r.d.L(f,g,{crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},Ur.preloadModule=function(f,d){if(typeof f=="string")if(d){var g=u(d.as,d.crossOrigin);r.d.m(f,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else r.d.m(f)},Ur.requestFormReset=function(f){r.d.r(f)},Ur.unstable_batchedUpdates=function(f,d){return f(d)},Ur.useFormState=function(f,d,g){return a.H.useFormState(f,d,g)},Ur.useFormStatus=function(){return a.H.useHostTransitionStatus()},Ur.version="19.2.3",Ur}var jT;function Xk(){if(jT)return S0.exports;jT=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),S0.exports=r3(),S0.exports}var VT;function i3(){if(VT)return Tf;VT=1;var t=n3(),e=Nd(),n=Xk();function r(o){var l="https://react.dev/errors/"+o;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)l+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+o+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function s(o){var l=o,c=o;if(o.alternate)for(;l.return;)l=l.return;else{o=l;do l=o,(l.flags&4098)!==0&&(c=l.return),o=l.return;while(o)}return l.tag===3?c:null}function a(o){if(o.tag===13){var l=o.memoizedState;if(l===null&&(o=o.alternate,o!==null&&(l=o.memoizedState)),l!==null)return l.dehydrated}return null}function u(o){if(o.tag===31){var l=o.memoizedState;if(l===null&&(o=o.alternate,o!==null&&(l=o.memoizedState)),l!==null)return l.dehydrated}return null}function f(o){if(s(o)!==o)throw Error(r(188))}function d(o){var l=o.alternate;if(!l){if(l=s(o),l===null)throw Error(r(188));return l!==o?null:o}for(var c=o,h=l;;){var y=c.return;if(y===null)break;var x=y.alternate;if(x===null){if(h=y.return,h!==null){c=h;continue}break}if(y.child===x.child){for(x=y.child;x;){if(x===c)return f(y),o;if(x===h)return f(y),l;x=x.sibling}throw Error(r(188))}if(c.return!==h.return)c=y,h=x;else{for(var k=!1,B=y.child;B;){if(B===c){k=!0,c=y,h=x;break}if(B===h){k=!0,h=y,c=x;break}B=B.sibling}if(!k){for(B=x.child;B;){if(B===c){k=!0,c=x,h=y;break}if(B===h){k=!0,h=x,c=y;break}B=B.sibling}if(!k)throw Error(r(189))}}if(c.alternate!==h)throw Error(r(190))}if(c.tag!==3)throw Error(r(188));return c.stateNode.current===c?o:l}function g(o){var l=o.tag;if(l===5||l===26||l===27||l===6)return o;for(o=o.child;o!==null;){if(l=g(o),l!==null)return l;o=o.sibling}return null}var p=Object.assign,m=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),T=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),L=Symbol.for("react.activity"),H=Symbol.for("react.memo_cache_sentinel"),N=Symbol.iterator;function _(o){return o===null||typeof o!="object"?null:(o=N&&o[N]||o["@@iterator"],typeof o=="function"?o:null)}var $=Symbol.for("react.client.reference");function F(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===$?null:o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case S:return"Fragment";case C:return"Profiler";case w:return"StrictMode";case O:return"Suspense";case P:return"SuspenseList";case L:return"Activity"}if(typeof o=="object")switch(o.$$typeof){case b:return"Portal";case T:return o.displayName||"Context";case R:return(o._context.displayName||"Context")+".Consumer";case A:var l=o.render;return o=o.displayName,o||(o=l.displayName||l.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case M:return l=o.displayName||null,l!==null?l:F(o.type)||"Memo";case D:l=o._payload,o=o._init;try{return F(o(l))}catch{}}return null}var G=Array.isArray,j=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V={pending:!1,data:null,method:null,action:null},te=[],J=-1;function z(o){return{current:o}}function U(o){0>J||(o.current=te[J],te[J]=null,J--)}function W(o,l){J++,te[J]=o.current,o.current=l}var X=z(null),ie=z(null),ee=z(null),ue=z(null);function Y(o,l){switch(W(ee,l),W(ie,o),W(X,null),l.nodeType){case 9:case 11:o=(o=l.documentElement)&&(o=o.namespaceURI)?ME(o):0;break;default:if(o=l.tagName,l=l.namespaceURI)l=ME(l),o=OE(l,o);else switch(o){case"svg":o=1;break;case"math":o=2;break;default:o=0}}U(X),W(X,o)}function le(){U(X),U(ie),U(ee)}function xe(o){o.memoizedState!==null&&W(ue,o);var l=X.current,c=OE(l,o.type);l!==c&&(W(ie,o),W(X,c))}function ve(o){ie.current===o&&(U(X),U(ie)),ue.current===o&&(U(ue),Sf._currentValue=V)}var de,me;function Ce(o){if(de===void 0)try{throw Error()}catch(c){var l=c.stack.trim().match(/\n( *(at )?)/);de=l&&l[1]||"",me=-1<c.stack.indexOf(`
5
- at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
6
- `+de+o+me}var Pe=!1;function ze(o,l){if(!o||Pe)return"";Pe=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={DetermineComponentFrameRoot:function(){try{if(l){var be=function(){throw Error()};if(Object.defineProperty(be.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(be,[])}catch(ce){var ae=ce}Reflect.construct(o,[],be)}else{try{be.call()}catch(ce){ae=ce}o.call(be.prototype)}}else{try{throw Error()}catch(ce){ae=ce}(be=o())&&typeof be.catch=="function"&&be.catch(function(){})}}catch(ce){if(ce&&ae&&typeof ce.stack=="string")return[ce.stack,ae.stack]}return[null,null]}};h.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(h.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(h.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=h.DetermineComponentFrameRoot(),k=x[0],B=x[1];if(k&&B){var K=k.split(`
7
- `),se=B.split(`
8
- `);for(y=h=0;h<K.length&&!K[h].includes("DetermineComponentFrameRoot");)h++;for(;y<se.length&&!se[y].includes("DetermineComponentFrameRoot");)y++;if(h===K.length||y===se.length)for(h=K.length-1,y=se.length-1;1<=h&&0<=y&&K[h]!==se[y];)y--;for(;1<=h&&0<=y;h--,y--)if(K[h]!==se[y]){if(h!==1||y!==1)do if(h--,y--,0>y||K[h]!==se[y]){var he=`
9
- `+K[h].replace(" at new "," at ");return o.displayName&&he.includes("<anonymous>")&&(he=he.replace("<anonymous>",o.displayName)),he}while(1<=h&&0<=y);break}}}finally{Pe=!1,Error.prepareStackTrace=c}return(c=o?o.displayName||o.name:"")?Ce(c):""}function Ee(o,l){switch(o.tag){case 26:case 27:case 5:return Ce(o.type);case 16:return Ce("Lazy");case 13:return o.child!==l&&l!==null?Ce("Suspense Fallback"):Ce("Suspense");case 19:return Ce("SuspenseList");case 0:case 15:return ze(o.type,!1);case 11:return ze(o.type.render,!1);case 1:return ze(o.type,!0);case 31:return Ce("Activity");default:return""}}function Ve(o){try{var l="",c=null;do l+=Ee(o,c),c=o,o=o.return;while(o);return l}catch(h){return`
10
- Error generating stack: `+h.message+`
11
- `+h.stack}}var Ie=Object.prototype.hasOwnProperty,He=t.unstable_scheduleCallback,Ge=t.unstable_cancelCallback,We=t.unstable_shouldYield,fe=t.unstable_requestPaint,ne=t.unstable_now,Q=t.unstable_getCurrentPriorityLevel,Se=t.unstable_ImmediatePriority,ge=t.unstable_UserBlockingPriority,De=t.unstable_NormalPriority,Te=t.unstable_LowPriority,_e=t.unstable_IdlePriority,nt=t.log,Mt=t.unstable_setDisableYieldValue,kt=null,It=null;function bn(o){if(typeof nt=="function"&&Mt(o),It&&typeof It.setStrictMode=="function")try{It.setStrictMode(kt,o)}catch{}}var at=Math.clz32?Math.clz32:xn,Mn=Math.log,Qt=Math.LN2;function xn(o){return o>>>=0,o===0?32:31-(Mn(o)/Qt|0)|0}var nn=256,Wt=262144,st=4194304;function pt(o){var l=o&42;if(l!==0)return l;switch(o&-o){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 o&261888;case 262144:case 524288:case 1048576:case 2097152:return o&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return o&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return o}}function tt(o,l,c){var h=o.pendingLanes;if(h===0)return 0;var y=0,x=o.suspendedLanes,k=o.pingedLanes;o=o.warmLanes;var B=h&134217727;return B!==0?(h=B&~x,h!==0?y=pt(h):(k&=B,k!==0?y=pt(k):c||(c=B&~o,c!==0&&(y=pt(c))))):(B=h&~x,B!==0?y=pt(B):k!==0?y=pt(k):c||(c=h&~o,c!==0&&(y=pt(c)))),y===0?0:l!==0&&l!==y&&(l&x)===0&&(x=y&-y,c=l&-l,x>=c||x===32&&(c&4194048)!==0)?l:y}function Zt(o,l){return(o.pendingLanes&~(o.suspendedLanes&~o.pingedLanes)&l)===0}function Hn(o,l){switch(o){case 1:case 2:case 4:case 8:case 64:return l+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 l+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 jn(){var o=st;return st<<=1,(st&62914560)===0&&(st=4194304),o}function Jt(o){for(var l=[],c=0;31>c;c++)l.push(o);return l}function Rn(o,l){o.pendingLanes|=l,l!==268435456&&(o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0)}function Dt(o,l,c,h,y,x){var k=o.pendingLanes;o.pendingLanes=c,o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0,o.expiredLanes&=c,o.entangledLanes&=c,o.errorRecoveryDisabledLanes&=c,o.shellSuspendCounter=0;var B=o.entanglements,K=o.expirationTimes,se=o.hiddenUpdates;for(c=k&~c;0<c;){var he=31-at(c),be=1<<he;B[he]=0,K[he]=-1;var ae=se[he];if(ae!==null)for(se[he]=null,he=0;he<ae.length;he++){var ce=ae[he];ce!==null&&(ce.lane&=-536870913)}c&=~be}h!==0&&Br(o,h,0),x!==0&&y===0&&o.tag!==0&&(o.suspendedLanes|=x&~(k&~l))}function Br(o,l,c){o.pendingLanes|=l,o.suspendedLanes&=~l;var h=31-at(l);o.entangledLanes|=l,o.entanglements[h]=o.entanglements[h]|1073741824|c&261930}function or(o,l){var c=o.entangledLanes|=l;for(o=o.entanglements;c;){var h=31-at(c),y=1<<h;y&l|o[h]&l&&(o[h]|=l),c&=~y}}function rt(o,l){var c=l&-l;return c=(c&42)!==0?1:Ut(c),(c&(o.suspendedLanes|l))!==0?0:c}function Ut(o){switch(o){case 2:o=1;break;case 8:o=4;break;case 32:o=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:o=128;break;case 268435456:o=134217728;break;default:o=0}return o}function $n(o){return o&=-o,2<o?8<o?(o&134217727)!==0?32:268435456:8:2}function Ln(){var o=q.p;return o!==0?o:(o=window.event,o===void 0?32:ZE(o.type))}function wr(o,l){var c=q.p;try{return q.p=o,l()}finally{q.p=c}}var rn=Math.random().toString(36).slice(2),Pt="__reactFiber$"+rn,zt="__reactProps$"+rn,Je="__reactContainer$"+rn,Cr="__reactEvents$"+rn,_c="__reactListeners$"+rn,xs="__reactHandles$"+rn,fl="__reactResources$"+rn,Fe="__reactMarker$"+rn;function Sa(o){delete o[Pt],delete o[zt],delete o[Cr],delete o[_c],delete o[xs]}function Zn(o){var l=o[Pt];if(l)return l;for(var c=o.parentNode;c;){if(l=c[Je]||c[Pt]){if(c=l.alternate,l.child!==null||c!==null&&c.child!==null)for(o=LE(o);o!==null;){if(c=o[Pt])return c;o=LE(o)}return l}o=c,c=o.parentNode}return null}function Bi(o){if(o=o[Pt]||o[Je]){var l=o.tag;if(l===5||l===6||l===13||l===31||l===26||l===27||l===3)return o}return null}function li(o){var l=o.tag;if(l===5||l===26||l===27||l===6)return o.stateNode;throw Error(r(33))}function ai(o){var l=o[fl];return l||(l=o[fl]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function Vn(o){o[Fe]=!0}var sr=new Set,_r={};function _i(o,l){mo(o,l),mo(o+"Capture",l)}function mo(o,l){for(_r[o]=l,o=0;o<l.length;o++)sr.add(l[o])}var wa=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]*$"),Ca={},Ss={};function Ra(o){return Ie.call(Ss,o)?!0:Ie.call(Ca,o)?!1:wa.test(o)?Ss[o]=!0:(Ca[o]=!0,!1)}function yo(o,l,c){if(Ra(l))if(c===null)o.removeAttribute(l);else{switch(typeof c){case"undefined":case"function":case"symbol":o.removeAttribute(l);return;case"boolean":var h=l.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){o.removeAttribute(l);return}}o.setAttribute(l,""+c)}}function ws(o,l,c){if(c===null)o.removeAttribute(l);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(l);return}o.setAttribute(l,""+c)}}function Zr(o,l,c,h){if(h===null)o.removeAttribute(c);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(c);return}o.setAttributeNS(l,c,""+h)}}function qn(o){switch(typeof o){case"bigint":case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function Hr(o){var l=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function Jr(o,l,c){var h=Object.getOwnPropertyDescriptor(o.constructor.prototype,l);if(!o.hasOwnProperty(l)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var y=h.get,x=h.set;return Object.defineProperty(o,l,{configurable:!0,get:function(){return y.call(this)},set:function(k){c=""+k,x.call(this,k)}}),Object.defineProperty(o,l,{enumerable:h.enumerable}),{getValue:function(){return c},setValue:function(k){c=""+k},stopTracking:function(){o._valueTracker=null,delete o[l]}}}}function Hi(o){if(!o._valueTracker){var l=Hr(o)?"checked":"value";o._valueTracker=Jr(o,l,""+o[l])}}function Fo(o){if(!o)return!1;var l=o._valueTracker;if(!l)return!0;var c=l.getValue(),h="";return o&&(h=Hr(o)?o.checked?"true":"false":o.value),o=h,o!==c?(l.setValue(o),!0):!1}function Cs(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}var bu=/[\n"\\]/g;function lr(o){return o.replace(bu,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function dl(o,l,c,h,y,x,k,B){o.name="",k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?o.type=k:o.removeAttribute("type"),l!=null?k==="number"?(l===0&&o.value===""||o.value!=l)&&(o.value=""+qn(l)):o.value!==""+qn(l)&&(o.value=""+qn(l)):k!=="submit"&&k!=="reset"||o.removeAttribute("value"),l!=null?Rs(o,k,qn(l)):c!=null?Rs(o,k,qn(c)):h!=null&&o.removeAttribute("value"),y==null&&x!=null&&(o.defaultChecked=!!x),y!=null&&(o.checked=y&&typeof y!="function"&&typeof y!="symbol"),B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"?o.name=""+qn(B):o.removeAttribute("name")}function Ea(o,l,c,h,y,x,k,B){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(o.type=x),l!=null||c!=null){if(!(x!=="submit"&&x!=="reset"||l!=null)){Hi(o);return}c=c!=null?""+qn(c):"",l=l!=null?""+qn(l):c,B||l===o.value||(o.value=l),o.defaultValue=l}h=h??y,h=typeof h!="function"&&typeof h!="symbol"&&!!h,o.checked=B?o.checked:!!h,o.defaultChecked=!!h,k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(o.name=k),Hi(o)}function Rs(o,l,c){l==="number"&&Cs(o.ownerDocument)===o||o.defaultValue===""+c||(o.defaultValue=""+c)}function ui(o,l,c,h){if(o=o.options,l){l={};for(var y=0;y<c.length;y++)l["$"+c[y]]=!0;for(c=0;c<o.length;c++)y=l.hasOwnProperty("$"+o[c].value),o[c].selected!==y&&(o[c].selected=y),y&&h&&(o[c].defaultSelected=!0)}else{for(c=""+qn(c),l=null,y=0;y<o.length;y++){if(o[y].value===c){o[y].selected=!0,h&&(o[y].defaultSelected=!0);return}l!==null||o[y].disabled||(l=o[y])}l!==null&&(l.selected=!0)}}function hl(o,l,c){if(l!=null&&(l=""+qn(l),l!==o.value&&(o.value=l),c==null)){o.defaultValue!==l&&(o.defaultValue=l);return}o.defaultValue=c!=null?""+qn(c):""}function Uo(o,l,c,h){if(l==null){if(h!=null){if(c!=null)throw Error(r(92));if(G(h)){if(1<h.length)throw Error(r(93));h=h[0]}c=h}c==null&&(c=""),l=c}c=qn(l),o.defaultValue=c,h=o.textContent,h===c&&h!==""&&h!==null&&(o.value=h),Hi(o)}function ji(o,l){if(l){var c=o.firstChild;if(c&&c===o.lastChild&&c.nodeType===3){c.nodeValue=l;return}}o.textContent=l}var Es=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 gl(o,l,c){var h=l.indexOf("--")===0;c==null||typeof c=="boolean"||c===""?h?o.setProperty(l,""):l==="float"?o.cssFloat="":o[l]="":h?o.setProperty(l,c):typeof c!="number"||c===0||Es.has(l)?l==="float"?o.cssFloat=c:o[l]=(""+c).trim():o[l]=c+"px"}function $o(o,l,c){if(l!=null&&typeof l!="object")throw Error(r(62));if(o=o.style,c!=null){for(var h in c)!c.hasOwnProperty(h)||l!=null&&l.hasOwnProperty(h)||(h.indexOf("--")===0?o.setProperty(h,""):h==="float"?o.cssFloat="":o[h]="");for(var y in l)h=l[y],l.hasOwnProperty(y)&&c[y]!==h&&gl(o,y,h)}else for(var x in l)l.hasOwnProperty(x)&&gl(o,x,l[x])}function Si(o){if(o.indexOf("-")===-1)return!1;switch(o){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 pl=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"]]),ml=/^[\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 vo(o){return ml.test(""+o)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":o}function jr(){}var yl=null;function vl(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var bo=null,xo=null;function Ts(o){var l=Bi(o);if(l&&(o=l.stateNode)){var c=o[zt]||null;e:switch(o=l.stateNode,l.type){case"input":if(dl(o,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name),l=c.name,c.type==="radio"&&l!=null){for(c=o;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll('input[name="'+lr(""+l)+'"][type="radio"]'),l=0;l<c.length;l++){var h=c[l];if(h!==o&&h.form===o.form){var y=h[zt]||null;if(!y)throw Error(r(90));dl(h,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(l=0;l<c.length;l++)h=c[l],h.form===o.form&&Fo(h)}break e;case"textarea":hl(o,c.value,c.defaultValue);break e;case"select":l=c.value,l!=null&&ui(o,!!c.multiple,l,!1)}}}var bl=!1;function xl(o,l,c){if(bl)return o(l,c);bl=!0;try{var h=o(l);return h}finally{if(bl=!1,(bo!==null||xo!==null)&&(zh(),bo&&(l=bo,o=xo,xo=bo=null,Ts(l),o)))for(l=0;l<o.length;l++)Ts(o[l])}}function ke(o,l){var c=o.stateNode;if(c===null)return null;var h=c[zt]||null;if(h===null)return null;c=h[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(o=o.type,h=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!h;break e;default:o=!1}if(o)return null;if(c&&typeof c!="function")throw Error(r(231,l,typeof c));return c}var Ne=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),$t=!1;if(Ne)try{var Bt={};Object.defineProperty(Bt,"passive",{get:function(){$t=!0}}),window.addEventListener("test",Bt,Bt),window.removeEventListener("test",Bt,Bt)}catch{$t=!1}var en=null,Jn=null,dn=null;function Tr(){if(dn)return dn;var o,l=Jn,c=l.length,h,y="value"in en?en.value:en.textContent,x=y.length;for(o=0;o<c&&l[o]===y[o];o++);var k=c-o;for(h=1;h<=k&&l[c-h]===y[x-h];h++);return dn=y.slice(o,1<h?1-h:void 0)}function Vr(o){var l=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&l===13&&(o=13)):o=l,o===10&&(o=13),32<=o||o===13?o:0}function wi(){return!0}function Sl(){return!1}function Fr(o){function l(c,h,y,x,k){this._reactName=c,this._targetInst=y,this.type=h,this.nativeEvent=x,this.target=k,this.currentTarget=null;for(var B in o)o.hasOwnProperty(B)&&(c=o[B],this[B]=c?c(x):x[B]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?wi:Sl,this.isPropagationStopped=Sl,this}return p(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=wi)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=wi)},persist:function(){},isPersistent:wi}),l}var qo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},xu=Fr(qo),Hc=p({},qo,{view:0,detail:0}),pB=Fr(Hc),ly,ay,jc,Zd=p({},Hc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:cy,button:0,buttons:0,relatedTarget:function(o){return o.relatedTarget===void 0?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return"movementX"in o?o.movementX:(o!==jc&&(jc&&o.type==="mousemove"?(ly=o.screenX-jc.screenX,ay=o.screenY-jc.screenY):ay=ly=0,jc=o),ly)},movementY:function(o){return"movementY"in o?o.movementY:ay}}),I1=Fr(Zd),mB=p({},Zd,{dataTransfer:0}),yB=Fr(mB),vB=p({},Hc,{relatedTarget:0}),uy=Fr(vB),bB=p({},qo,{animationName:0,elapsedTime:0,pseudoElement:0}),xB=Fr(bB),SB=p({},qo,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),wB=Fr(SB),CB=p({},qo,{data:0}),D1=Fr(CB),RB={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},EB={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"},TB={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function AB(o){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(o):(o=TB[o])?!!l[o]:!1}function cy(){return AB}var MB=p({},Hc,{key:function(o){if(o.key){var l=RB[o.key]||o.key;if(l!=="Unidentified")return l}return o.type==="keypress"?(o=Vr(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?EB[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:cy,charCode:function(o){return o.type==="keypress"?Vr(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?Vr(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),OB=Fr(MB),kB=p({},Zd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),P1=Fr(kB),IB=p({},Hc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:cy}),DB=Fr(IB),PB=p({},qo,{propertyName:0,elapsedTime:0,pseudoElement:0}),zB=Fr(PB),NB=p({},Zd,{deltaX:function(o){return"deltaX"in o?o.deltaX:"wheelDeltaX"in o?-o.wheelDeltaX:0},deltaY:function(o){return"deltaY"in o?o.deltaY:"wheelDeltaY"in o?-o.wheelDeltaY:"wheelDelta"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),LB=Fr(NB),BB=p({},qo,{newState:0,oldState:0}),_B=Fr(BB),HB=[9,13,27,32],fy=Ne&&"CompositionEvent"in window,Vc=null;Ne&&"documentMode"in document&&(Vc=document.documentMode);var jB=Ne&&"TextEvent"in window&&!Vc,z1=Ne&&(!fy||Vc&&8<Vc&&11>=Vc),N1=" ",L1=!1;function B1(o,l){switch(o){case"keyup":return HB.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _1(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var Su=!1;function VB(o,l){switch(o){case"compositionend":return _1(l);case"keypress":return l.which!==32?null:(L1=!0,N1);case"textInput":return o=l.data,o===N1&&L1?null:o;default:return null}}function FB(o,l){if(Su)return o==="compositionend"||!fy&&B1(o,l)?(o=Tr(),dn=Jn=en=null,Su=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return z1&&l.locale!=="ko"?null:l.data;default:return null}}var UB={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 H1(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l==="input"?!!UB[o.type]:l==="textarea"}function j1(o,l,c,h){bo?xo?xo.push(h):xo=[h]:bo=h,l=Vh(l,"onChange"),0<l.length&&(c=new xu("onChange","change",null,c,h),o.push({event:c,listeners:l}))}var Fc=null,Uc=null;function $B(o){wE(o,0)}function Jd(o){var l=li(o);if(Fo(l))return o}function V1(o,l){if(o==="change")return l}var F1=!1;if(Ne){var dy;if(Ne){var hy="oninput"in document;if(!hy){var U1=document.createElement("div");U1.setAttribute("oninput","return;"),hy=typeof U1.oninput=="function"}dy=hy}else dy=!1;F1=dy&&(!document.documentMode||9<document.documentMode)}function $1(){Fc&&(Fc.detachEvent("onpropertychange",q1),Uc=Fc=null)}function q1(o){if(o.propertyName==="value"&&Jd(Uc)){var l=[];j1(l,Uc,o,vl(o)),xl($B,l)}}function qB(o,l,c){o==="focusin"?($1(),Fc=l,Uc=c,Fc.attachEvent("onpropertychange",q1)):o==="focusout"&&$1()}function GB(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return Jd(Uc)}function WB(o,l){if(o==="click")return Jd(l)}function KB(o,l){if(o==="input"||o==="change")return Jd(l)}function YB(o,l){return o===l&&(o!==0||1/o===1/l)||o!==o&&l!==l}var Ci=typeof Object.is=="function"?Object.is:YB;function $c(o,l){if(Ci(o,l))return!0;if(typeof o!="object"||o===null||typeof l!="object"||l===null)return!1;var c=Object.keys(o),h=Object.keys(l);if(c.length!==h.length)return!1;for(h=0;h<c.length;h++){var y=c[h];if(!Ie.call(l,y)||!Ci(o[y],l[y]))return!1}return!0}function G1(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function W1(o,l){var c=G1(o);o=0;for(var h;c;){if(c.nodeType===3){if(h=o+c.textContent.length,o<=l&&h>=l)return{node:c,offset:l-o};o=h}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=G1(c)}}function K1(o,l){return o&&l?o===l?!0:o&&o.nodeType===3?!1:l&&l.nodeType===3?K1(o,l.parentNode):"contains"in o?o.contains(l):o.compareDocumentPosition?!!(o.compareDocumentPosition(l)&16):!1:!1}function Y1(o){o=o!=null&&o.ownerDocument!=null&&o.ownerDocument.defaultView!=null?o.ownerDocument.defaultView:window;for(var l=Cs(o.document);l instanceof o.HTMLIFrameElement;){try{var c=typeof l.contentWindow.location.href=="string"}catch{c=!1}if(c)o=l.contentWindow;else break;l=Cs(o.document)}return l}function gy(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l&&(l==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||l==="textarea"||o.contentEditable==="true")}var XB=Ne&&"documentMode"in document&&11>=document.documentMode,wu=null,py=null,qc=null,my=!1;function X1(o,l,c){var h=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;my||wu==null||wu!==Cs(h)||(h=wu,"selectionStart"in h&&gy(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),qc&&$c(qc,h)||(qc=h,h=Vh(py,"onSelect"),0<h.length&&(l=new xu("onSelect","select",null,l,c),o.push({event:l,listeners:h}),l.target=wu)))}function Ta(o,l){var c={};return c[o.toLowerCase()]=l.toLowerCase(),c["Webkit"+o]="webkit"+l,c["Moz"+o]="moz"+l,c}var Cu={animationend:Ta("Animation","AnimationEnd"),animationiteration:Ta("Animation","AnimationIteration"),animationstart:Ta("Animation","AnimationStart"),transitionrun:Ta("Transition","TransitionRun"),transitionstart:Ta("Transition","TransitionStart"),transitioncancel:Ta("Transition","TransitionCancel"),transitionend:Ta("Transition","TransitionEnd")},yy={},Q1={};Ne&&(Q1=document.createElement("div").style,"AnimationEvent"in window||(delete Cu.animationend.animation,delete Cu.animationiteration.animation,delete Cu.animationstart.animation),"TransitionEvent"in window||delete Cu.transitionend.transition);function Aa(o){if(yy[o])return yy[o];if(!Cu[o])return o;var l=Cu[o],c;for(c in l)if(l.hasOwnProperty(c)&&c in Q1)return yy[o]=l[c];return o}var Z1=Aa("animationend"),J1=Aa("animationiteration"),eC=Aa("animationstart"),QB=Aa("transitionrun"),ZB=Aa("transitionstart"),JB=Aa("transitioncancel"),tC=Aa("transitionend"),nC=new Map,vy="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(" ");vy.push("scrollEnd");function So(o,l){nC.set(o,l),_i(l,[o])}var eh=typeof reportError=="function"?reportError:function(o){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var l=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof o=="object"&&o!==null&&typeof o.message=="string"?String(o.message):String(o),error:o});if(!window.dispatchEvent(l))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",o);return}console.error(o)},Vi=[],Ru=0,by=0;function th(){for(var o=Ru,l=by=Ru=0;l<o;){var c=Vi[l];Vi[l++]=null;var h=Vi[l];Vi[l++]=null;var y=Vi[l];Vi[l++]=null;var x=Vi[l];if(Vi[l++]=null,h!==null&&y!==null){var k=h.pending;k===null?y.next=y:(y.next=k.next,k.next=y),h.pending=y}x!==0&&rC(c,y,x)}}function nh(o,l,c,h){Vi[Ru++]=o,Vi[Ru++]=l,Vi[Ru++]=c,Vi[Ru++]=h,by|=h,o.lanes|=h,o=o.alternate,o!==null&&(o.lanes|=h)}function xy(o,l,c,h){return nh(o,l,c,h),rh(o)}function Ma(o,l){return nh(o,null,null,l),rh(o)}function rC(o,l,c){o.lanes|=c;var h=o.alternate;h!==null&&(h.lanes|=c);for(var y=!1,x=o.return;x!==null;)x.childLanes|=c,h=x.alternate,h!==null&&(h.childLanes|=c),x.tag===22&&(o=x.stateNode,o===null||o._visibility&1||(y=!0)),o=x,x=x.return;return o.tag===3?(x=o.stateNode,y&&l!==null&&(y=31-at(c),o=x.hiddenUpdates,h=o[y],h===null?o[y]=[l]:h.push(l),l.lane=c|536870912),x):null}function rh(o){if(50<gf)throw gf=0,Ov=null,Error(r(185));for(var l=o.return;l!==null;)o=l,l=o.return;return o.tag===3?o.stateNode:null}var Eu={};function e_(o,l,c,h){this.tag=o,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ri(o,l,c,h){return new e_(o,l,c,h)}function Sy(o){return o=o.prototype,!(!o||!o.isReactComponent)}function As(o,l){var c=o.alternate;return c===null?(c=Ri(o.tag,l,o.key,o.mode),c.elementType=o.elementType,c.type=o.type,c.stateNode=o.stateNode,c.alternate=o,o.alternate=c):(c.pendingProps=l,c.type=o.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=o.flags&65011712,c.childLanes=o.childLanes,c.lanes=o.lanes,c.child=o.child,c.memoizedProps=o.memoizedProps,c.memoizedState=o.memoizedState,c.updateQueue=o.updateQueue,l=o.dependencies,c.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},c.sibling=o.sibling,c.index=o.index,c.ref=o.ref,c.refCleanup=o.refCleanup,c}function iC(o,l){o.flags&=65011714;var c=o.alternate;return c===null?(o.childLanes=0,o.lanes=l,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=c.childLanes,o.lanes=c.lanes,o.child=c.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=c.memoizedProps,o.memoizedState=c.memoizedState,o.updateQueue=c.updateQueue,o.type=c.type,l=c.dependencies,o.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),o}function ih(o,l,c,h,y,x){var k=0;if(h=o,typeof o=="function")Sy(o)&&(k=1);else if(typeof o=="string")k=oH(o,c,X.current)?26:o==="html"||o==="head"||o==="body"?27:5;else e:switch(o){case L:return o=Ri(31,c,l,y),o.elementType=L,o.lanes=x,o;case S:return Oa(c.children,y,x,l);case w:k=8,y|=24;break;case C:return o=Ri(12,c,l,y|2),o.elementType=C,o.lanes=x,o;case O:return o=Ri(13,c,l,y),o.elementType=O,o.lanes=x,o;case P:return o=Ri(19,c,l,y),o.elementType=P,o.lanes=x,o;default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case T:k=10;break e;case R:k=9;break e;case A:k=11;break e;case M:k=14;break e;case D:k=16,h=null;break e}k=29,c=Error(r(130,o===null?"null":typeof o,"")),h=null}return l=Ri(k,c,l,y),l.elementType=o,l.type=h,l.lanes=x,l}function Oa(o,l,c,h){return o=Ri(7,o,h,l),o.lanes=c,o}function wy(o,l,c){return o=Ri(6,o,null,l),o.lanes=c,o}function oC(o){var l=Ri(18,null,null,0);return l.stateNode=o,l}function Cy(o,l,c){return l=Ri(4,o.children!==null?o.children:[],o.key,l),l.lanes=c,l.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},l}var sC=new WeakMap;function Fi(o,l){if(typeof o=="object"&&o!==null){var c=sC.get(o);return c!==void 0?c:(l={value:o,source:l,stack:Ve(l)},sC.set(o,l),l)}return{value:o,source:l,stack:Ve(l)}}var Tu=[],Au=0,oh=null,Gc=0,Ui=[],$i=0,wl=null,Go=1,Wo="";function Ms(o,l){Tu[Au++]=Gc,Tu[Au++]=oh,oh=o,Gc=l}function lC(o,l,c){Ui[$i++]=Go,Ui[$i++]=Wo,Ui[$i++]=wl,wl=o;var h=Go;o=Wo;var y=32-at(h)-1;h&=~(1<<y),c+=1;var x=32-at(l)+y;if(30<x){var k=y-y%5;x=(h&(1<<k)-1).toString(32),h>>=k,y-=k,Go=1<<32-at(l)+y|c<<y|h,Wo=x+o}else Go=1<<x|c<<y|h,Wo=o}function Ry(o){o.return!==null&&(Ms(o,1),lC(o,1,0))}function Ey(o){for(;o===oh;)oh=Tu[--Au],Tu[Au]=null,Gc=Tu[--Au],Tu[Au]=null;for(;o===wl;)wl=Ui[--$i],Ui[$i]=null,Wo=Ui[--$i],Ui[$i]=null,Go=Ui[--$i],Ui[$i]=null}function aC(o,l){Ui[$i++]=Go,Ui[$i++]=Wo,Ui[$i++]=wl,Go=l.id,Wo=l.overflow,wl=o}var Ar=null,On=null,jt=!1,Cl=null,qi=!1,Ty=Error(r(519));function Rl(o){var l=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Wc(Fi(l,o)),Ty}function uC(o){var l=o.stateNode,c=o.type,h=o.memoizedProps;switch(l[Pt]=o,l[zt]=h,c){case"dialog":Lt("cancel",l),Lt("close",l);break;case"iframe":case"object":case"embed":Lt("load",l);break;case"video":case"audio":for(c=0;c<mf.length;c++)Lt(mf[c],l);break;case"source":Lt("error",l);break;case"img":case"image":case"link":Lt("error",l),Lt("load",l);break;case"details":Lt("toggle",l);break;case"input":Lt("invalid",l),Ea(l,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0);break;case"select":Lt("invalid",l);break;case"textarea":Lt("invalid",l),Uo(l,h.value,h.defaultValue,h.children)}c=h.children,typeof c!="string"&&typeof c!="number"&&typeof c!="bigint"||l.textContent===""+c||h.suppressHydrationWarning===!0||TE(l.textContent,c)?(h.popover!=null&&(Lt("beforetoggle",l),Lt("toggle",l)),h.onScroll!=null&&Lt("scroll",l),h.onScrollEnd!=null&&Lt("scrollend",l),h.onClick!=null&&(l.onclick=jr),l=!0):l=!1,l||Rl(o,!0)}function cC(o){for(Ar=o.return;Ar;)switch(Ar.tag){case 5:case 31:case 13:qi=!1;return;case 27:case 3:qi=!0;return;default:Ar=Ar.return}}function Mu(o){if(o!==Ar)return!1;if(!jt)return cC(o),jt=!0,!1;var l=o.tag,c;if((c=l!==3&&l!==27)&&((c=l===5)&&(c=o.type,c=!(c!=="form"&&c!=="button")||$v(o.type,o.memoizedProps)),c=!c),c&&On&&Rl(o),cC(o),l===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));On=NE(o)}else if(l===31){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));On=NE(o)}else l===27?(l=On,_l(o.type)?(o=Yv,Yv=null,On=o):On=l):On=Ar?Wi(o.stateNode.nextSibling):null;return!0}function ka(){On=Ar=null,jt=!1}function Ay(){var o=Cl;return o!==null&&(hi===null?hi=o:hi.push.apply(hi,o),Cl=null),o}function Wc(o){Cl===null?Cl=[o]:Cl.push(o)}var My=z(null),Ia=null,Os=null;function El(o,l,c){W(My,l._currentValue),l._currentValue=c}function ks(o){o._currentValue=My.current,U(My)}function Oy(o,l,c){for(;o!==null;){var h=o.alternate;if((o.childLanes&l)!==l?(o.childLanes|=l,h!==null&&(h.childLanes|=l)):h!==null&&(h.childLanes&l)!==l&&(h.childLanes|=l),o===c)break;o=o.return}}function ky(o,l,c,h){var y=o.child;for(y!==null&&(y.return=o);y!==null;){var x=y.dependencies;if(x!==null){var k=y.child;x=x.firstContext;e:for(;x!==null;){var B=x;x=y;for(var K=0;K<l.length;K++)if(B.context===l[K]){x.lanes|=c,B=x.alternate,B!==null&&(B.lanes|=c),Oy(x.return,c,o),h||(k=null);break e}x=B.next}}else if(y.tag===18){if(k=y.return,k===null)throw Error(r(341));k.lanes|=c,x=k.alternate,x!==null&&(x.lanes|=c),Oy(k,c,o),k=null}else k=y.child;if(k!==null)k.return=y;else for(k=y;k!==null;){if(k===o){k=null;break}if(y=k.sibling,y!==null){y.return=k.return,k=y;break}k=k.return}y=k}}function Ou(o,l,c,h){o=null;for(var y=l,x=!1;y!==null;){if(!x){if((y.flags&524288)!==0)x=!0;else if((y.flags&262144)!==0)break}if(y.tag===10){var k=y.alternate;if(k===null)throw Error(r(387));if(k=k.memoizedProps,k!==null){var B=y.type;Ci(y.pendingProps.value,k.value)||(o!==null?o.push(B):o=[B])}}else if(y===ue.current){if(k=y.alternate,k===null)throw Error(r(387));k.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(o!==null?o.push(Sf):o=[Sf])}y=y.return}o!==null&&ky(l,o,c,h),l.flags|=262144}function sh(o){for(o=o.firstContext;o!==null;){if(!Ci(o.context._currentValue,o.memoizedValue))return!0;o=o.next}return!1}function Da(o){Ia=o,Os=null,o=o.dependencies,o!==null&&(o.firstContext=null)}function Mr(o){return fC(Ia,o)}function lh(o,l){return Ia===null&&Da(o),fC(o,l)}function fC(o,l){var c=l._currentValue;if(l={context:l,memoizedValue:c,next:null},Os===null){if(o===null)throw Error(r(308));Os=l,o.dependencies={lanes:0,firstContext:l},o.flags|=524288}else Os=Os.next=l;return c}var t_=typeof AbortController<"u"?AbortController:function(){var o=[],l=this.signal={aborted:!1,addEventListener:function(c,h){o.push(h)}};this.abort=function(){l.aborted=!0,o.forEach(function(c){return c()})}},n_=t.unstable_scheduleCallback,r_=t.unstable_NormalPriority,ar={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Iy(){return{controller:new t_,data:new Map,refCount:0}}function Kc(o){o.refCount--,o.refCount===0&&n_(r_,function(){o.controller.abort()})}var Yc=null,Dy=0,ku=0,Iu=null;function i_(o,l){if(Yc===null){var c=Yc=[];Dy=0,ku=Nv(),Iu={status:"pending",value:void 0,then:function(h){c.push(h)}}}return Dy++,l.then(dC,dC),l}function dC(){if(--Dy===0&&Yc!==null){Iu!==null&&(Iu.status="fulfilled");var o=Yc;Yc=null,ku=0,Iu=null;for(var l=0;l<o.length;l++)(0,o[l])()}}function o_(o,l){var c=[],h={status:"pending",value:null,reason:null,then:function(y){c.push(y)}};return o.then(function(){h.status="fulfilled",h.value=l;for(var y=0;y<c.length;y++)(0,c[y])(l)},function(y){for(h.status="rejected",h.reason=y,y=0;y<c.length;y++)(0,c[y])(void 0)}),h}var hC=j.S;j.S=function(o,l){XR=ne(),typeof l=="object"&&l!==null&&typeof l.then=="function"&&i_(o,l),hC!==null&&hC(o,l)};var Pa=z(null);function Py(){var o=Pa.current;return o!==null?o:Sn.pooledCache}function ah(o,l){l===null?W(Pa,Pa.current):W(Pa,l.pool)}function gC(){var o=Py();return o===null?null:{parent:ar._currentValue,pool:o}}var Du=Error(r(460)),zy=Error(r(474)),uh=Error(r(542)),ch={then:function(){}};function pC(o){return o=o.status,o==="fulfilled"||o==="rejected"}function mC(o,l,c){switch(c=o[c],c===void 0?o.push(l):c!==l&&(l.then(jr,jr),l=c),l.status){case"fulfilled":return l.value;case"rejected":throw o=l.reason,vC(o),o;default:if(typeof l.status=="string")l.then(jr,jr);else{if(o=Sn,o!==null&&100<o.shellSuspendCounter)throw Error(r(482));o=l,o.status="pending",o.then(function(h){if(l.status==="pending"){var y=l;y.status="fulfilled",y.value=h}},function(h){if(l.status==="pending"){var y=l;y.status="rejected",y.reason=h}})}switch(l.status){case"fulfilled":return l.value;case"rejected":throw o=l.reason,vC(o),o}throw Na=l,Du}}function za(o){try{var l=o._init;return l(o._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(Na=c,Du):c}}var Na=null;function yC(){if(Na===null)throw Error(r(459));var o=Na;return Na=null,o}function vC(o){if(o===Du||o===uh)throw Error(r(483))}var Pu=null,Xc=0;function fh(o){var l=Xc;return Xc+=1,Pu===null&&(Pu=[]),mC(Pu,o,l)}function Qc(o,l){l=l.props.ref,o.ref=l!==void 0?l:null}function dh(o,l){throw l.$$typeof===m?Error(r(525)):(o=Object.prototype.toString.call(l),Error(r(31,o==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":o)))}function bC(o){function l(re,Z){if(o){var oe=re.deletions;oe===null?(re.deletions=[Z],re.flags|=16):oe.push(Z)}}function c(re,Z){if(!o)return null;for(;Z!==null;)l(re,Z),Z=Z.sibling;return null}function h(re){for(var Z=new Map;re!==null;)re.key!==null?Z.set(re.key,re):Z.set(re.index,re),re=re.sibling;return Z}function y(re,Z){return re=As(re,Z),re.index=0,re.sibling=null,re}function x(re,Z,oe){return re.index=oe,o?(oe=re.alternate,oe!==null?(oe=oe.index,oe<Z?(re.flags|=67108866,Z):oe):(re.flags|=67108866,Z)):(re.flags|=1048576,Z)}function k(re){return o&&re.alternate===null&&(re.flags|=67108866),re}function B(re,Z,oe,ye){return Z===null||Z.tag!==6?(Z=wy(oe,re.mode,ye),Z.return=re,Z):(Z=y(Z,oe),Z.return=re,Z)}function K(re,Z,oe,ye){var it=oe.type;return it===S?he(re,Z,oe.props.children,ye,oe.key):Z!==null&&(Z.elementType===it||typeof it=="object"&&it!==null&&it.$$typeof===D&&za(it)===Z.type)?(Z=y(Z,oe.props),Qc(Z,oe),Z.return=re,Z):(Z=ih(oe.type,oe.key,oe.props,null,re.mode,ye),Qc(Z,oe),Z.return=re,Z)}function se(re,Z,oe,ye){return Z===null||Z.tag!==4||Z.stateNode.containerInfo!==oe.containerInfo||Z.stateNode.implementation!==oe.implementation?(Z=Cy(oe,re.mode,ye),Z.return=re,Z):(Z=y(Z,oe.children||[]),Z.return=re,Z)}function he(re,Z,oe,ye,it){return Z===null||Z.tag!==7?(Z=Oa(oe,re.mode,ye,it),Z.return=re,Z):(Z=y(Z,oe),Z.return=re,Z)}function be(re,Z,oe){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return Z=wy(""+Z,re.mode,oe),Z.return=re,Z;if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case v:return oe=ih(Z.type,Z.key,Z.props,null,re.mode,oe),Qc(oe,Z),oe.return=re,oe;case b:return Z=Cy(Z,re.mode,oe),Z.return=re,Z;case D:return Z=za(Z),be(re,Z,oe)}if(G(Z)||_(Z))return Z=Oa(Z,re.mode,oe,null),Z.return=re,Z;if(typeof Z.then=="function")return be(re,fh(Z),oe);if(Z.$$typeof===T)return be(re,lh(re,Z),oe);dh(re,Z)}return null}function ae(re,Z,oe,ye){var it=Z!==null?Z.key:null;if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return it!==null?null:B(re,Z,""+oe,ye);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case v:return oe.key===it?K(re,Z,oe,ye):null;case b:return oe.key===it?se(re,Z,oe,ye):null;case D:return oe=za(oe),ae(re,Z,oe,ye)}if(G(oe)||_(oe))return it!==null?null:he(re,Z,oe,ye,null);if(typeof oe.then=="function")return ae(re,Z,fh(oe),ye);if(oe.$$typeof===T)return ae(re,Z,lh(re,oe),ye);dh(re,oe)}return null}function ce(re,Z,oe,ye,it){if(typeof ye=="string"&&ye!==""||typeof ye=="number"||typeof ye=="bigint")return re=re.get(oe)||null,B(Z,re,""+ye,it);if(typeof ye=="object"&&ye!==null){switch(ye.$$typeof){case v:return re=re.get(ye.key===null?oe:ye.key)||null,K(Z,re,ye,it);case b:return re=re.get(ye.key===null?oe:ye.key)||null,se(Z,re,ye,it);case D:return ye=za(ye),ce(re,Z,oe,ye,it)}if(G(ye)||_(ye))return re=re.get(oe)||null,he(Z,re,ye,it,null);if(typeof ye.then=="function")return ce(re,Z,oe,fh(ye),it);if(ye.$$typeof===T)return ce(re,Z,oe,lh(Z,ye),it);dh(Z,ye)}return null}function qe(re,Z,oe,ye){for(var it=null,Kt=null,Ze=Z,xt=Z=0,Ht=null;Ze!==null&&xt<oe.length;xt++){Ze.index>xt?(Ht=Ze,Ze=null):Ht=Ze.sibling;var Yt=ae(re,Ze,oe[xt],ye);if(Yt===null){Ze===null&&(Ze=Ht);break}o&&Ze&&Yt.alternate===null&&l(re,Ze),Z=x(Yt,Z,xt),Kt===null?it=Yt:Kt.sibling=Yt,Kt=Yt,Ze=Ht}if(xt===oe.length)return c(re,Ze),jt&&Ms(re,xt),it;if(Ze===null){for(;xt<oe.length;xt++)Ze=be(re,oe[xt],ye),Ze!==null&&(Z=x(Ze,Z,xt),Kt===null?it=Ze:Kt.sibling=Ze,Kt=Ze);return jt&&Ms(re,xt),it}for(Ze=h(Ze);xt<oe.length;xt++)Ht=ce(Ze,re,xt,oe[xt],ye),Ht!==null&&(o&&Ht.alternate!==null&&Ze.delete(Ht.key===null?xt:Ht.key),Z=x(Ht,Z,xt),Kt===null?it=Ht:Kt.sibling=Ht,Kt=Ht);return o&&Ze.forEach(function(Ul){return l(re,Ul)}),jt&&Ms(re,xt),it}function lt(re,Z,oe,ye){if(oe==null)throw Error(r(151));for(var it=null,Kt=null,Ze=Z,xt=Z=0,Ht=null,Yt=oe.next();Ze!==null&&!Yt.done;xt++,Yt=oe.next()){Ze.index>xt?(Ht=Ze,Ze=null):Ht=Ze.sibling;var Ul=ae(re,Ze,Yt.value,ye);if(Ul===null){Ze===null&&(Ze=Ht);break}o&&Ze&&Ul.alternate===null&&l(re,Ze),Z=x(Ul,Z,xt),Kt===null?it=Ul:Kt.sibling=Ul,Kt=Ul,Ze=Ht}if(Yt.done)return c(re,Ze),jt&&Ms(re,xt),it;if(Ze===null){for(;!Yt.done;xt++,Yt=oe.next())Yt=be(re,Yt.value,ye),Yt!==null&&(Z=x(Yt,Z,xt),Kt===null?it=Yt:Kt.sibling=Yt,Kt=Yt);return jt&&Ms(re,xt),it}for(Ze=h(Ze);!Yt.done;xt++,Yt=oe.next())Yt=ce(Ze,re,xt,Yt.value,ye),Yt!==null&&(o&&Yt.alternate!==null&&Ze.delete(Yt.key===null?xt:Yt.key),Z=x(Yt,Z,xt),Kt===null?it=Yt:Kt.sibling=Yt,Kt=Yt);return o&&Ze.forEach(function(mH){return l(re,mH)}),jt&&Ms(re,xt),it}function pn(re,Z,oe,ye){if(typeof oe=="object"&&oe!==null&&oe.type===S&&oe.key===null&&(oe=oe.props.children),typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case v:e:{for(var it=oe.key;Z!==null;){if(Z.key===it){if(it=oe.type,it===S){if(Z.tag===7){c(re,Z.sibling),ye=y(Z,oe.props.children),ye.return=re,re=ye;break e}}else if(Z.elementType===it||typeof it=="object"&&it!==null&&it.$$typeof===D&&za(it)===Z.type){c(re,Z.sibling),ye=y(Z,oe.props),Qc(ye,oe),ye.return=re,re=ye;break e}c(re,Z);break}else l(re,Z);Z=Z.sibling}oe.type===S?(ye=Oa(oe.props.children,re.mode,ye,oe.key),ye.return=re,re=ye):(ye=ih(oe.type,oe.key,oe.props,null,re.mode,ye),Qc(ye,oe),ye.return=re,re=ye)}return k(re);case b:e:{for(it=oe.key;Z!==null;){if(Z.key===it)if(Z.tag===4&&Z.stateNode.containerInfo===oe.containerInfo&&Z.stateNode.implementation===oe.implementation){c(re,Z.sibling),ye=y(Z,oe.children||[]),ye.return=re,re=ye;break e}else{c(re,Z);break}else l(re,Z);Z=Z.sibling}ye=Cy(oe,re.mode,ye),ye.return=re,re=ye}return k(re);case D:return oe=za(oe),pn(re,Z,oe,ye)}if(G(oe))return qe(re,Z,oe,ye);if(_(oe)){if(it=_(oe),typeof it!="function")throw Error(r(150));return oe=it.call(oe),lt(re,Z,oe,ye)}if(typeof oe.then=="function")return pn(re,Z,fh(oe),ye);if(oe.$$typeof===T)return pn(re,Z,lh(re,oe),ye);dh(re,oe)}return typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint"?(oe=""+oe,Z!==null&&Z.tag===6?(c(re,Z.sibling),ye=y(Z,oe),ye.return=re,re=ye):(c(re,Z),ye=wy(oe,re.mode,ye),ye.return=re,re=ye),k(re)):c(re,Z)}return function(re,Z,oe,ye){try{Xc=0;var it=pn(re,Z,oe,ye);return Pu=null,it}catch(Ze){if(Ze===Du||Ze===uh)throw Ze;var Kt=Ri(29,Ze,null,re.mode);return Kt.lanes=ye,Kt.return=re,Kt}}}var La=bC(!0),xC=bC(!1),Tl=!1;function Ny(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ly(o,l){o=o.updateQueue,l.updateQueue===o&&(l.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,callbacks:null})}function Al(o){return{lane:o,tag:0,payload:null,callback:null,next:null}}function Ml(o,l,c){var h=o.updateQueue;if(h===null)return null;if(h=h.shared,(tn&2)!==0){var y=h.pending;return y===null?l.next=l:(l.next=y.next,y.next=l),h.pending=l,l=rh(o),rC(o,null,c),l}return nh(o,h,l,c),rh(o)}function Zc(o,l,c){if(l=l.updateQueue,l!==null&&(l=l.shared,(c&4194048)!==0)){var h=l.lanes;h&=o.pendingLanes,c|=h,l.lanes=c,or(o,c)}}function By(o,l){var c=o.updateQueue,h=o.alternate;if(h!==null&&(h=h.updateQueue,c===h)){var y=null,x=null;if(c=c.firstBaseUpdate,c!==null){do{var k={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};x===null?y=x=k:x=x.next=k,c=c.next}while(c!==null);x===null?y=x=l:x=x.next=l}else y=x=l;c={baseState:h.baseState,firstBaseUpdate:y,lastBaseUpdate:x,shared:h.shared,callbacks:h.callbacks},o.updateQueue=c;return}o=c.lastBaseUpdate,o===null?c.firstBaseUpdate=l:o.next=l,c.lastBaseUpdate=l}var _y=!1;function Jc(){if(_y){var o=Iu;if(o!==null)throw o}}function ef(o,l,c,h){_y=!1;var y=o.updateQueue;Tl=!1;var x=y.firstBaseUpdate,k=y.lastBaseUpdate,B=y.shared.pending;if(B!==null){y.shared.pending=null;var K=B,se=K.next;K.next=null,k===null?x=se:k.next=se,k=K;var he=o.alternate;he!==null&&(he=he.updateQueue,B=he.lastBaseUpdate,B!==k&&(B===null?he.firstBaseUpdate=se:B.next=se,he.lastBaseUpdate=K))}if(x!==null){var be=y.baseState;k=0,he=se=K=null,B=x;do{var ae=B.lane&-536870913,ce=ae!==B.lane;if(ce?(_t&ae)===ae:(h&ae)===ae){ae!==0&&ae===ku&&(_y=!0),he!==null&&(he=he.next={lane:0,tag:B.tag,payload:B.payload,callback:null,next:null});e:{var qe=o,lt=B;ae=l;var pn=c;switch(lt.tag){case 1:if(qe=lt.payload,typeof qe=="function"){be=qe.call(pn,be,ae);break e}be=qe;break e;case 3:qe.flags=qe.flags&-65537|128;case 0:if(qe=lt.payload,ae=typeof qe=="function"?qe.call(pn,be,ae):qe,ae==null)break e;be=p({},be,ae);break e;case 2:Tl=!0}}ae=B.callback,ae!==null&&(o.flags|=64,ce&&(o.flags|=8192),ce=y.callbacks,ce===null?y.callbacks=[ae]:ce.push(ae))}else ce={lane:ae,tag:B.tag,payload:B.payload,callback:B.callback,next:null},he===null?(se=he=ce,K=be):he=he.next=ce,k|=ae;if(B=B.next,B===null){if(B=y.shared.pending,B===null)break;ce=B,B=ce.next,ce.next=null,y.lastBaseUpdate=ce,y.shared.pending=null}}while(!0);he===null&&(K=be),y.baseState=K,y.firstBaseUpdate=se,y.lastBaseUpdate=he,x===null&&(y.shared.lanes=0),Pl|=k,o.lanes=k,o.memoizedState=be}}function SC(o,l){if(typeof o!="function")throw Error(r(191,o));o.call(l)}function wC(o,l){var c=o.callbacks;if(c!==null)for(o.callbacks=null,o=0;o<c.length;o++)SC(c[o],l)}var zu=z(null),hh=z(0);function CC(o,l){o=Hs,W(hh,o),W(zu,l),Hs=o|l.baseLanes}function Hy(){W(hh,Hs),W(zu,zu.current)}function jy(){Hs=hh.current,U(zu),U(hh)}var Ei=z(null),Gi=null;function Ol(o){var l=o.alternate;W(er,er.current&1),W(Ei,o),Gi===null&&(l===null||zu.current!==null||l.memoizedState!==null)&&(Gi=o)}function Vy(o){W(er,er.current),W(Ei,o),Gi===null&&(Gi=o)}function RC(o){o.tag===22?(W(er,er.current),W(Ei,o),Gi===null&&(Gi=o)):kl()}function kl(){W(er,er.current),W(Ei,Ei.current)}function Ti(o){U(Ei),Gi===o&&(Gi=null),U(er)}var er=z(0);function gh(o){for(var l=o;l!==null;){if(l.tag===13){var c=l.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||Wv(c)||Kv(c)))return l}else if(l.tag===19&&(l.memoizedProps.revealOrder==="forwards"||l.memoizedProps.revealOrder==="backwards"||l.memoizedProps.revealOrder==="unstable_legacy-backwards"||l.memoizedProps.revealOrder==="together")){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===o)break;for(;l.sibling===null;){if(l.return===null||l.return===o)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var Is=0,vt=null,hn=null,ur=null,ph=!1,Nu=!1,Ba=!1,mh=0,tf=0,Lu=null,s_=0;function Gn(){throw Error(r(321))}function Fy(o,l){if(l===null)return!1;for(var c=0;c<l.length&&c<o.length;c++)if(!Ci(o[c],l[c]))return!1;return!0}function Uy(o,l,c,h,y,x){return Is=x,vt=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,j.H=o===null||o.memoizedState===null?lR:iv,Ba=!1,x=c(h,y),Ba=!1,Nu&&(x=TC(l,c,h,y)),EC(o),x}function EC(o){j.H=of;var l=hn!==null&&hn.next!==null;if(Is=0,ur=hn=vt=null,ph=!1,tf=0,Lu=null,l)throw Error(r(300));o===null||cr||(o=o.dependencies,o!==null&&sh(o)&&(cr=!0))}function TC(o,l,c,h){vt=o;var y=0;do{if(Nu&&(Lu=null),tf=0,Nu=!1,25<=y)throw Error(r(301));if(y+=1,ur=hn=null,o.updateQueue!=null){var x=o.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}j.H=aR,x=l(c,h)}while(Nu);return x}function l_(){var o=j.H,l=o.useState()[0];return l=typeof l.then=="function"?nf(l):l,o=o.useState()[0],(hn!==null?hn.memoizedState:null)!==o&&(vt.flags|=1024),l}function $y(){var o=mh!==0;return mh=0,o}function qy(o,l,c){l.updateQueue=o.updateQueue,l.flags&=-2053,o.lanes&=~c}function Gy(o){if(ph){for(o=o.memoizedState;o!==null;){var l=o.queue;l!==null&&(l.pending=null),o=o.next}ph=!1}Is=0,ur=hn=vt=null,Nu=!1,tf=mh=0,Lu=null}function ei(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ur===null?vt.memoizedState=ur=o:ur=ur.next=o,ur}function tr(){if(hn===null){var o=vt.alternate;o=o!==null?o.memoizedState:null}else o=hn.next;var l=ur===null?vt.memoizedState:ur.next;if(l!==null)ur=l,hn=o;else{if(o===null)throw vt.alternate===null?Error(r(467)):Error(r(310));hn=o,o={memoizedState:hn.memoizedState,baseState:hn.baseState,baseQueue:hn.baseQueue,queue:hn.queue,next:null},ur===null?vt.memoizedState=ur=o:ur=ur.next=o}return ur}function yh(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function nf(o){var l=tf;return tf+=1,Lu===null&&(Lu=[]),o=mC(Lu,o,l),l=vt,(ur===null?l.memoizedState:ur.next)===null&&(l=l.alternate,j.H=l===null||l.memoizedState===null?lR:iv),o}function vh(o){if(o!==null&&typeof o=="object"){if(typeof o.then=="function")return nf(o);if(o.$$typeof===T)return Mr(o)}throw Error(r(438,String(o)))}function Wy(o){var l=null,c=vt.updateQueue;if(c!==null&&(l=c.memoCache),l==null){var h=vt.alternate;h!==null&&(h=h.updateQueue,h!==null&&(h=h.memoCache,h!=null&&(l={data:h.data.map(function(y){return y.slice()}),index:0})))}if(l==null&&(l={data:[],index:0}),c===null&&(c=yh(),vt.updateQueue=c),c.memoCache=l,c=l.data[l.index],c===void 0)for(c=l.data[l.index]=Array(o),h=0;h<o;h++)c[h]=H;return l.index++,c}function Ds(o,l){return typeof l=="function"?l(o):l}function bh(o){var l=tr();return Ky(l,hn,o)}function Ky(o,l,c){var h=o.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=c;var y=o.baseQueue,x=h.pending;if(x!==null){if(y!==null){var k=y.next;y.next=x.next,x.next=k}l.baseQueue=y=x,h.pending=null}if(x=o.baseState,y===null)o.memoizedState=x;else{l=y.next;var B=k=null,K=null,se=l,he=!1;do{var be=se.lane&-536870913;if(be!==se.lane?(_t&be)===be:(Is&be)===be){var ae=se.revertLane;if(ae===0)K!==null&&(K=K.next={lane:0,revertLane:0,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null}),be===ku&&(he=!0);else if((Is&ae)===ae){se=se.next,ae===ku&&(he=!0);continue}else be={lane:0,revertLane:se.revertLane,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},K===null?(B=K=be,k=x):K=K.next=be,vt.lanes|=ae,Pl|=ae;be=se.action,Ba&&c(x,be),x=se.hasEagerState?se.eagerState:c(x,be)}else ae={lane:be,revertLane:se.revertLane,gesture:se.gesture,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},K===null?(B=K=ae,k=x):K=K.next=ae,vt.lanes|=be,Pl|=be;se=se.next}while(se!==null&&se!==l);if(K===null?k=x:K.next=B,!Ci(x,o.memoizedState)&&(cr=!0,he&&(c=Iu,c!==null)))throw c;o.memoizedState=x,o.baseState=k,o.baseQueue=K,h.lastRenderedState=x}return y===null&&(h.lanes=0),[o.memoizedState,h.dispatch]}function Yy(o){var l=tr(),c=l.queue;if(c===null)throw Error(r(311));c.lastRenderedReducer=o;var h=c.dispatch,y=c.pending,x=l.memoizedState;if(y!==null){c.pending=null;var k=y=y.next;do x=o(x,k.action),k=k.next;while(k!==y);Ci(x,l.memoizedState)||(cr=!0),l.memoizedState=x,l.baseQueue===null&&(l.baseState=x),c.lastRenderedState=x}return[x,h]}function AC(o,l,c){var h=vt,y=tr(),x=jt;if(x){if(c===void 0)throw Error(r(407));c=c()}else c=l();var k=!Ci((hn||y).memoizedState,c);if(k&&(y.memoizedState=c,cr=!0),y=y.queue,Zy(kC.bind(null,h,y,o),[o]),y.getSnapshot!==l||k||ur!==null&&ur.memoizedState.tag&1){if(h.flags|=2048,Bu(9,{destroy:void 0},OC.bind(null,h,y,c,l),null),Sn===null)throw Error(r(349));x||(Is&127)!==0||MC(h,l,c)}return c}function MC(o,l,c){o.flags|=16384,o={getSnapshot:l,value:c},l=vt.updateQueue,l===null?(l=yh(),vt.updateQueue=l,l.stores=[o]):(c=l.stores,c===null?l.stores=[o]:c.push(o))}function OC(o,l,c,h){l.value=c,l.getSnapshot=h,IC(l)&&DC(o)}function kC(o,l,c){return c(function(){IC(l)&&DC(o)})}function IC(o){var l=o.getSnapshot;o=o.value;try{var c=l();return!Ci(o,c)}catch{return!0}}function DC(o){var l=Ma(o,2);l!==null&&gi(l,o,2)}function Xy(o){var l=ei();if(typeof o=="function"){var c=o;if(o=c(),Ba){bn(!0);try{c()}finally{bn(!1)}}}return l.memoizedState=l.baseState=o,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ds,lastRenderedState:o},l}function PC(o,l,c,h){return o.baseState=c,Ky(o,hn,typeof h=="function"?h:Ds)}function a_(o,l,c,h,y){if(wh(o))throw Error(r(485));if(o=l.action,o!==null){var x={payload:y,action:o,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(k){x.listeners.push(k)}};j.T!==null?c(!0):x.isTransition=!1,h(x),c=l.pending,c===null?(x.next=l.pending=x,zC(l,x)):(x.next=c.next,l.pending=c.next=x)}}function zC(o,l){var c=l.action,h=l.payload,y=o.state;if(l.isTransition){var x=j.T,k={};j.T=k;try{var B=c(y,h),K=j.S;K!==null&&K(k,B),NC(o,l,B)}catch(se){Qy(o,l,se)}finally{x!==null&&k.types!==null&&(x.types=k.types),j.T=x}}else try{x=c(y,h),NC(o,l,x)}catch(se){Qy(o,l,se)}}function NC(o,l,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(h){LC(o,l,h)},function(h){return Qy(o,l,h)}):LC(o,l,c)}function LC(o,l,c){l.status="fulfilled",l.value=c,BC(l),o.state=c,l=o.pending,l!==null&&(c=l.next,c===l?o.pending=null:(c=c.next,l.next=c,zC(o,c)))}function Qy(o,l,c){var h=o.pending;if(o.pending=null,h!==null){h=h.next;do l.status="rejected",l.reason=c,BC(l),l=l.next;while(l!==h)}o.action=null}function BC(o){o=o.listeners;for(var l=0;l<o.length;l++)(0,o[l])()}function _C(o,l){return l}function HC(o,l){if(jt){var c=Sn.formState;if(c!==null){e:{var h=vt;if(jt){if(On){t:{for(var y=On,x=qi;y.nodeType!==8;){if(!x){y=null;break t}if(y=Wi(y.nextSibling),y===null){y=null;break t}}x=y.data,y=x==="F!"||x==="F"?y:null}if(y){On=Wi(y.nextSibling),h=y.data==="F!";break e}}Rl(h)}h=!1}h&&(l=c[0])}}return c=ei(),c.memoizedState=c.baseState=l,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:_C,lastRenderedState:l},c.queue=h,c=iR.bind(null,vt,h),h.dispatch=c,h=Xy(!1),x=rv.bind(null,vt,!1,h.queue),h=ei(),y={state:l,dispatch:null,action:o,pending:null},h.queue=y,c=a_.bind(null,vt,y,x,c),y.dispatch=c,h.memoizedState=o,[l,c,!1]}function jC(o){var l=tr();return VC(l,hn,o)}function VC(o,l,c){if(l=Ky(o,l,_C)[0],o=bh(Ds)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var h=nf(l)}catch(k){throw k===Du?uh:k}else h=l;l=tr();var y=l.queue,x=y.dispatch;return c!==l.memoizedState&&(vt.flags|=2048,Bu(9,{destroy:void 0},u_.bind(null,y,c),null)),[h,x,o]}function u_(o,l){o.action=l}function FC(o){var l=tr(),c=hn;if(c!==null)return VC(l,c,o);tr(),l=l.memoizedState,c=tr();var h=c.queue.dispatch;return c.memoizedState=o,[l,h,!1]}function Bu(o,l,c,h){return o={tag:o,create:c,deps:h,inst:l,next:null},l=vt.updateQueue,l===null&&(l=yh(),vt.updateQueue=l),c=l.lastEffect,c===null?l.lastEffect=o.next=o:(h=c.next,c.next=o,o.next=h,l.lastEffect=o),o}function UC(){return tr().memoizedState}function xh(o,l,c,h){var y=ei();vt.flags|=o,y.memoizedState=Bu(1|l,{destroy:void 0},c,h===void 0?null:h)}function Sh(o,l,c,h){var y=tr();h=h===void 0?null:h;var x=y.memoizedState.inst;hn!==null&&h!==null&&Fy(h,hn.memoizedState.deps)?y.memoizedState=Bu(l,x,c,h):(vt.flags|=o,y.memoizedState=Bu(1|l,x,c,h))}function $C(o,l){xh(8390656,8,o,l)}function Zy(o,l){Sh(2048,8,o,l)}function c_(o){vt.flags|=4;var l=vt.updateQueue;if(l===null)l=yh(),vt.updateQueue=l,l.events=[o];else{var c=l.events;c===null?l.events=[o]:c.push(o)}}function qC(o){var l=tr().memoizedState;return c_({ref:l,nextImpl:o}),function(){if((tn&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}function GC(o,l){return Sh(4,2,o,l)}function WC(o,l){return Sh(4,4,o,l)}function KC(o,l){if(typeof l=="function"){o=o();var c=l(o);return function(){typeof c=="function"?c():l(null)}}if(l!=null)return o=o(),l.current=o,function(){l.current=null}}function YC(o,l,c){c=c!=null?c.concat([o]):null,Sh(4,4,KC.bind(null,l,o),c)}function Jy(){}function XC(o,l){var c=tr();l=l===void 0?null:l;var h=c.memoizedState;return l!==null&&Fy(l,h[1])?h[0]:(c.memoizedState=[o,l],o)}function QC(o,l){var c=tr();l=l===void 0?null:l;var h=c.memoizedState;if(l!==null&&Fy(l,h[1]))return h[0];if(h=o(),Ba){bn(!0);try{o()}finally{bn(!1)}}return c.memoizedState=[h,l],h}function ev(o,l,c){return c===void 0||(Is&1073741824)!==0&&(_t&261930)===0?o.memoizedState=l:(o.memoizedState=c,o=ZR(),vt.lanes|=o,Pl|=o,c)}function ZC(o,l,c,h){return Ci(c,l)?c:zu.current!==null?(o=ev(o,c,h),Ci(o,l)||(cr=!0),o):(Is&42)===0||(Is&1073741824)!==0&&(_t&261930)===0?(cr=!0,o.memoizedState=c):(o=ZR(),vt.lanes|=o,Pl|=o,l)}function JC(o,l,c,h,y){var x=q.p;q.p=x!==0&&8>x?x:8;var k=j.T,B={};j.T=B,rv(o,!1,l,c);try{var K=y(),se=j.S;if(se!==null&&se(B,K),K!==null&&typeof K=="object"&&typeof K.then=="function"){var he=o_(K,h);rf(o,l,he,Oi(o))}else rf(o,l,h,Oi(o))}catch(be){rf(o,l,{then:function(){},status:"rejected",reason:be},Oi())}finally{q.p=x,k!==null&&B.types!==null&&(k.types=B.types),j.T=k}}function f_(){}function tv(o,l,c,h){if(o.tag!==5)throw Error(r(476));var y=eR(o).queue;JC(o,y,l,V,c===null?f_:function(){return tR(o),c(h)})}function eR(o){var l=o.memoizedState;if(l!==null)return l;l={memoizedState:V,baseState:V,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ds,lastRenderedState:V},next:null};var c={};return l.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ds,lastRenderedState:c},next:null},o.memoizedState=l,o=o.alternate,o!==null&&(o.memoizedState=l),l}function tR(o){var l=eR(o);l.next===null&&(l=o.alternate.memoizedState),rf(o,l.next.queue,{},Oi())}function nv(){return Mr(Sf)}function nR(){return tr().memoizedState}function rR(){return tr().memoizedState}function d_(o){for(var l=o.return;l!==null;){switch(l.tag){case 24:case 3:var c=Oi();o=Al(c);var h=Ml(l,o,c);h!==null&&(gi(h,l,c),Zc(h,l,c)),l={cache:Iy()},o.payload=l;return}l=l.return}}function h_(o,l,c){var h=Oi();c={lane:h,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},wh(o)?oR(l,c):(c=xy(o,l,c,h),c!==null&&(gi(c,o,h),sR(c,l,h)))}function iR(o,l,c){var h=Oi();rf(o,l,c,h)}function rf(o,l,c,h){var y={lane:h,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(wh(o))oR(l,y);else{var x=o.alternate;if(o.lanes===0&&(x===null||x.lanes===0)&&(x=l.lastRenderedReducer,x!==null))try{var k=l.lastRenderedState,B=x(k,c);if(y.hasEagerState=!0,y.eagerState=B,Ci(B,k))return nh(o,l,y,0),Sn===null&&th(),!1}catch{}if(c=xy(o,l,y,h),c!==null)return gi(c,o,h),sR(c,l,h),!0}return!1}function rv(o,l,c,h){if(h={lane:2,revertLane:Nv(),gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},wh(o)){if(l)throw Error(r(479))}else l=xy(o,c,h,2),l!==null&&gi(l,o,2)}function wh(o){var l=o.alternate;return o===vt||l!==null&&l===vt}function oR(o,l){Nu=ph=!0;var c=o.pending;c===null?l.next=l:(l.next=c.next,c.next=l),o.pending=l}function sR(o,l,c){if((c&4194048)!==0){var h=l.lanes;h&=o.pendingLanes,c|=h,l.lanes=c,or(o,c)}}var of={readContext:Mr,use:vh,useCallback:Gn,useContext:Gn,useEffect:Gn,useImperativeHandle:Gn,useLayoutEffect:Gn,useInsertionEffect:Gn,useMemo:Gn,useReducer:Gn,useRef:Gn,useState:Gn,useDebugValue:Gn,useDeferredValue:Gn,useTransition:Gn,useSyncExternalStore:Gn,useId:Gn,useHostTransitionStatus:Gn,useFormState:Gn,useActionState:Gn,useOptimistic:Gn,useMemoCache:Gn,useCacheRefresh:Gn};of.useEffectEvent=Gn;var lR={readContext:Mr,use:vh,useCallback:function(o,l){return ei().memoizedState=[o,l===void 0?null:l],o},useContext:Mr,useEffect:$C,useImperativeHandle:function(o,l,c){c=c!=null?c.concat([o]):null,xh(4194308,4,KC.bind(null,l,o),c)},useLayoutEffect:function(o,l){return xh(4194308,4,o,l)},useInsertionEffect:function(o,l){xh(4,2,o,l)},useMemo:function(o,l){var c=ei();l=l===void 0?null:l;var h=o();if(Ba){bn(!0);try{o()}finally{bn(!1)}}return c.memoizedState=[h,l],h},useReducer:function(o,l,c){var h=ei();if(c!==void 0){var y=c(l);if(Ba){bn(!0);try{c(l)}finally{bn(!1)}}}else y=l;return h.memoizedState=h.baseState=y,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:y},h.queue=o,o=o.dispatch=h_.bind(null,vt,o),[h.memoizedState,o]},useRef:function(o){var l=ei();return o={current:o},l.memoizedState=o},useState:function(o){o=Xy(o);var l=o.queue,c=iR.bind(null,vt,l);return l.dispatch=c,[o.memoizedState,c]},useDebugValue:Jy,useDeferredValue:function(o,l){var c=ei();return ev(c,o,l)},useTransition:function(){var o=Xy(!1);return o=JC.bind(null,vt,o.queue,!0,!1),ei().memoizedState=o,[!1,o]},useSyncExternalStore:function(o,l,c){var h=vt,y=ei();if(jt){if(c===void 0)throw Error(r(407));c=c()}else{if(c=l(),Sn===null)throw Error(r(349));(_t&127)!==0||MC(h,l,c)}y.memoizedState=c;var x={value:c,getSnapshot:l};return y.queue=x,$C(kC.bind(null,h,x,o),[o]),h.flags|=2048,Bu(9,{destroy:void 0},OC.bind(null,h,x,c,l),null),c},useId:function(){var o=ei(),l=Sn.identifierPrefix;if(jt){var c=Wo,h=Go;c=(h&~(1<<32-at(h)-1)).toString(32)+c,l="_"+l+"R_"+c,c=mh++,0<c&&(l+="H"+c.toString(32)),l+="_"}else c=s_++,l="_"+l+"r_"+c.toString(32)+"_";return o.memoizedState=l},useHostTransitionStatus:nv,useFormState:HC,useActionState:HC,useOptimistic:function(o){var l=ei();l.memoizedState=l.baseState=o;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=c,l=rv.bind(null,vt,!0,c),c.dispatch=l,[o,l]},useMemoCache:Wy,useCacheRefresh:function(){return ei().memoizedState=d_.bind(null,vt)},useEffectEvent:function(o){var l=ei(),c={impl:o};return l.memoizedState=c,function(){if((tn&2)!==0)throw Error(r(440));return c.impl.apply(void 0,arguments)}}},iv={readContext:Mr,use:vh,useCallback:XC,useContext:Mr,useEffect:Zy,useImperativeHandle:YC,useInsertionEffect:GC,useLayoutEffect:WC,useMemo:QC,useReducer:bh,useRef:UC,useState:function(){return bh(Ds)},useDebugValue:Jy,useDeferredValue:function(o,l){var c=tr();return ZC(c,hn.memoizedState,o,l)},useTransition:function(){var o=bh(Ds)[0],l=tr().memoizedState;return[typeof o=="boolean"?o:nf(o),l]},useSyncExternalStore:AC,useId:nR,useHostTransitionStatus:nv,useFormState:jC,useActionState:jC,useOptimistic:function(o,l){var c=tr();return PC(c,hn,o,l)},useMemoCache:Wy,useCacheRefresh:rR};iv.useEffectEvent=qC;var aR={readContext:Mr,use:vh,useCallback:XC,useContext:Mr,useEffect:Zy,useImperativeHandle:YC,useInsertionEffect:GC,useLayoutEffect:WC,useMemo:QC,useReducer:Yy,useRef:UC,useState:function(){return Yy(Ds)},useDebugValue:Jy,useDeferredValue:function(o,l){var c=tr();return hn===null?ev(c,o,l):ZC(c,hn.memoizedState,o,l)},useTransition:function(){var o=Yy(Ds)[0],l=tr().memoizedState;return[typeof o=="boolean"?o:nf(o),l]},useSyncExternalStore:AC,useId:nR,useHostTransitionStatus:nv,useFormState:FC,useActionState:FC,useOptimistic:function(o,l){var c=tr();return hn!==null?PC(c,hn,o,l):(c.baseState=o,[o,c.queue.dispatch])},useMemoCache:Wy,useCacheRefresh:rR};aR.useEffectEvent=qC;function ov(o,l,c,h){l=o.memoizedState,c=c(h,l),c=c==null?l:p({},l,c),o.memoizedState=c,o.lanes===0&&(o.updateQueue.baseState=c)}var sv={enqueueSetState:function(o,l,c){o=o._reactInternals;var h=Oi(),y=Al(h);y.payload=l,c!=null&&(y.callback=c),l=Ml(o,y,h),l!==null&&(gi(l,o,h),Zc(l,o,h))},enqueueReplaceState:function(o,l,c){o=o._reactInternals;var h=Oi(),y=Al(h);y.tag=1,y.payload=l,c!=null&&(y.callback=c),l=Ml(o,y,h),l!==null&&(gi(l,o,h),Zc(l,o,h))},enqueueForceUpdate:function(o,l){o=o._reactInternals;var c=Oi(),h=Al(c);h.tag=2,l!=null&&(h.callback=l),l=Ml(o,h,c),l!==null&&(gi(l,o,c),Zc(l,o,c))}};function uR(o,l,c,h,y,x,k){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(h,x,k):l.prototype&&l.prototype.isPureReactComponent?!$c(c,h)||!$c(y,x):!0}function cR(o,l,c,h){o=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(c,h),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(c,h),l.state!==o&&sv.enqueueReplaceState(l,l.state,null)}function _a(o,l){var c=l;if("ref"in l){c={};for(var h in l)h!=="ref"&&(c[h]=l[h])}if(o=o.defaultProps){c===l&&(c=p({},c));for(var y in o)c[y]===void 0&&(c[y]=o[y])}return c}function fR(o){eh(o)}function dR(o){console.error(o)}function hR(o){eh(o)}function Ch(o,l){try{var c=o.onUncaughtError;c(l.value,{componentStack:l.stack})}catch(h){setTimeout(function(){throw h})}}function gR(o,l,c){try{var h=o.onCaughtError;h(c.value,{componentStack:c.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function lv(o,l,c){return c=Al(c),c.tag=3,c.payload={element:null},c.callback=function(){Ch(o,l)},c}function pR(o){return o=Al(o),o.tag=3,o}function mR(o,l,c,h){var y=c.type.getDerivedStateFromError;if(typeof y=="function"){var x=h.value;o.payload=function(){return y(x)},o.callback=function(){gR(l,c,h)}}var k=c.stateNode;k!==null&&typeof k.componentDidCatch=="function"&&(o.callback=function(){gR(l,c,h),typeof y!="function"&&(zl===null?zl=new Set([this]):zl.add(this));var B=h.stack;this.componentDidCatch(h.value,{componentStack:B!==null?B:""})})}function g_(o,l,c,h,y){if(c.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){if(l=c.alternate,l!==null&&Ou(l,c,y,!0),c=Ei.current,c!==null){switch(c.tag){case 31:case 13:return Gi===null?Nh():c.alternate===null&&Wn===0&&(Wn=3),c.flags&=-257,c.flags|=65536,c.lanes=y,h===ch?c.flags|=16384:(l=c.updateQueue,l===null?c.updateQueue=new Set([h]):l.add(h),Dv(o,h,y)),!1;case 22:return c.flags|=65536,h===ch?c.flags|=16384:(l=c.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([h])},c.updateQueue=l):(c=l.retryQueue,c===null?l.retryQueue=new Set([h]):c.add(h)),Dv(o,h,y)),!1}throw Error(r(435,c.tag))}return Dv(o,h,y),Nh(),!1}if(jt)return l=Ei.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=y,h!==Ty&&(o=Error(r(422),{cause:h}),Wc(Fi(o,c)))):(h!==Ty&&(l=Error(r(423),{cause:h}),Wc(Fi(l,c))),o=o.current.alternate,o.flags|=65536,y&=-y,o.lanes|=y,h=Fi(h,c),y=lv(o.stateNode,h,y),By(o,y),Wn!==4&&(Wn=2)),!1;var x=Error(r(520),{cause:h});if(x=Fi(x,c),hf===null?hf=[x]:hf.push(x),Wn!==4&&(Wn=2),l===null)return!0;h=Fi(h,c),c=l;do{switch(c.tag){case 3:return c.flags|=65536,o=y&-y,c.lanes|=o,o=lv(c.stateNode,h,o),By(c,o),!1;case 1:if(l=c.type,x=c.stateNode,(c.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(zl===null||!zl.has(x))))return c.flags|=65536,y&=-y,c.lanes|=y,y=pR(y),mR(y,o,c,h),By(c,y),!1}c=c.return}while(c!==null);return!1}var av=Error(r(461)),cr=!1;function Or(o,l,c,h){l.child=o===null?xC(l,null,c,h):La(l,o.child,c,h)}function yR(o,l,c,h,y){c=c.render;var x=l.ref;if("ref"in h){var k={};for(var B in h)B!=="ref"&&(k[B]=h[B])}else k=h;return Da(l),h=Uy(o,l,c,k,x,y),B=$y(),o!==null&&!cr?(qy(o,l,y),Ps(o,l,y)):(jt&&B&&Ry(l),l.flags|=1,Or(o,l,h,y),l.child)}function vR(o,l,c,h,y){if(o===null){var x=c.type;return typeof x=="function"&&!Sy(x)&&x.defaultProps===void 0&&c.compare===null?(l.tag=15,l.type=x,bR(o,l,x,h,y)):(o=ih(c.type,null,h,l,l.mode,y),o.ref=l.ref,o.return=l,l.child=o)}if(x=o.child,!mv(o,y)){var k=x.memoizedProps;if(c=c.compare,c=c!==null?c:$c,c(k,h)&&o.ref===l.ref)return Ps(o,l,y)}return l.flags|=1,o=As(x,h),o.ref=l.ref,o.return=l,l.child=o}function bR(o,l,c,h,y){if(o!==null){var x=o.memoizedProps;if($c(x,h)&&o.ref===l.ref)if(cr=!1,l.pendingProps=h=x,mv(o,y))(o.flags&131072)!==0&&(cr=!0);else return l.lanes=o.lanes,Ps(o,l,y)}return uv(o,l,c,h,y)}function xR(o,l,c,h){var y=h.children,x=o!==null?o.memoizedState:null;if(o===null&&l.stateNode===null&&(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),h.mode==="hidden"){if((l.flags&128)!==0){if(x=x!==null?x.baseLanes|c:c,o!==null){for(h=l.child=o.child,y=0;h!==null;)y=y|h.lanes|h.childLanes,h=h.sibling;h=y&~x}else h=0,l.child=null;return SR(o,l,x,c,h)}if((c&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},o!==null&&ah(l,x!==null?x.cachePool:null),x!==null?CC(l,x):Hy(),RC(l);else return h=l.lanes=536870912,SR(o,l,x!==null?x.baseLanes|c:c,c,h)}else x!==null?(ah(l,x.cachePool),CC(l,x),kl(),l.memoizedState=null):(o!==null&&ah(l,null),Hy(),kl());return Or(o,l,y,c),l.child}function sf(o,l){return o!==null&&o.tag===22||l.stateNode!==null||(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.sibling}function SR(o,l,c,h,y){var x=Py();return x=x===null?null:{parent:ar._currentValue,pool:x},l.memoizedState={baseLanes:c,cachePool:x},o!==null&&ah(l,null),Hy(),RC(l),o!==null&&Ou(o,l,h,!0),l.childLanes=y,null}function Rh(o,l){return l=Th({mode:l.mode,children:l.children},o.mode),l.ref=o.ref,o.child=l,l.return=o,l}function wR(o,l,c){return La(l,o.child,null,c),o=Rh(l,l.pendingProps),o.flags|=2,Ti(l),l.memoizedState=null,o}function p_(o,l,c){var h=l.pendingProps,y=(l.flags&128)!==0;if(l.flags&=-129,o===null){if(jt){if(h.mode==="hidden")return o=Rh(l,h),l.lanes=536870912,sf(null,o);if(Vy(l),(o=On)?(o=zE(o,qi),o=o!==null&&o.data==="&"?o:null,o!==null&&(l.memoizedState={dehydrated:o,treeContext:wl!==null?{id:Go,overflow:Wo}:null,retryLane:536870912,hydrationErrors:null},c=oC(o),c.return=l,l.child=c,Ar=l,On=null)):o=null,o===null)throw Rl(l);return l.lanes=536870912,null}return Rh(l,h)}var x=o.memoizedState;if(x!==null){var k=x.dehydrated;if(Vy(l),y)if(l.flags&256)l.flags&=-257,l=wR(o,l,c);else if(l.memoizedState!==null)l.child=o.child,l.flags|=128,l=null;else throw Error(r(558));else if(cr||Ou(o,l,c,!1),y=(c&o.childLanes)!==0,cr||y){if(h=Sn,h!==null&&(k=rt(h,c),k!==0&&k!==x.retryLane))throw x.retryLane=k,Ma(o,k),gi(h,o,k),av;Nh(),l=wR(o,l,c)}else o=x.treeContext,On=Wi(k.nextSibling),Ar=l,jt=!0,Cl=null,qi=!1,o!==null&&aC(l,o),l=Rh(l,h),l.flags|=4096;return l}return o=As(o.child,{mode:h.mode,children:h.children}),o.ref=l.ref,l.child=o,o.return=l,o}function Eh(o,l){var c=l.ref;if(c===null)o!==null&&o.ref!==null&&(l.flags|=4194816);else{if(typeof c!="function"&&typeof c!="object")throw Error(r(284));(o===null||o.ref!==c)&&(l.flags|=4194816)}}function uv(o,l,c,h,y){return Da(l),c=Uy(o,l,c,h,void 0,y),h=$y(),o!==null&&!cr?(qy(o,l,y),Ps(o,l,y)):(jt&&h&&Ry(l),l.flags|=1,Or(o,l,c,y),l.child)}function CR(o,l,c,h,y,x){return Da(l),l.updateQueue=null,c=TC(l,h,c,y),EC(o),h=$y(),o!==null&&!cr?(qy(o,l,x),Ps(o,l,x)):(jt&&h&&Ry(l),l.flags|=1,Or(o,l,c,x),l.child)}function RR(o,l,c,h,y){if(Da(l),l.stateNode===null){var x=Eu,k=c.contextType;typeof k=="object"&&k!==null&&(x=Mr(k)),x=new c(h,x),l.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=sv,l.stateNode=x,x._reactInternals=l,x=l.stateNode,x.props=h,x.state=l.memoizedState,x.refs={},Ny(l),k=c.contextType,x.context=typeof k=="object"&&k!==null?Mr(k):Eu,x.state=l.memoizedState,k=c.getDerivedStateFromProps,typeof k=="function"&&(ov(l,c,k,h),x.state=l.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(k=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),k!==x.state&&sv.enqueueReplaceState(x,x.state,null),ef(l,h,x,y),Jc(),x.state=l.memoizedState),typeof x.componentDidMount=="function"&&(l.flags|=4194308),h=!0}else if(o===null){x=l.stateNode;var B=l.memoizedProps,K=_a(c,B);x.props=K;var se=x.context,he=c.contextType;k=Eu,typeof he=="object"&&he!==null&&(k=Mr(he));var be=c.getDerivedStateFromProps;he=typeof be=="function"||typeof x.getSnapshotBeforeUpdate=="function",B=l.pendingProps!==B,he||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(B||se!==k)&&cR(l,x,h,k),Tl=!1;var ae=l.memoizedState;x.state=ae,ef(l,h,x,y),Jc(),se=l.memoizedState,B||ae!==se||Tl?(typeof be=="function"&&(ov(l,c,be,h),se=l.memoizedState),(K=Tl||uR(l,c,K,h,ae,se,k))?(he||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(l.flags|=4194308)):(typeof x.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=h,l.memoizedState=se),x.props=h,x.state=se,x.context=k,h=K):(typeof x.componentDidMount=="function"&&(l.flags|=4194308),h=!1)}else{x=l.stateNode,Ly(o,l),k=l.memoizedProps,he=_a(c,k),x.props=he,be=l.pendingProps,ae=x.context,se=c.contextType,K=Eu,typeof se=="object"&&se!==null&&(K=Mr(se)),B=c.getDerivedStateFromProps,(se=typeof B=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(k!==be||ae!==K)&&cR(l,x,h,K),Tl=!1,ae=l.memoizedState,x.state=ae,ef(l,h,x,y),Jc();var ce=l.memoizedState;k!==be||ae!==ce||Tl||o!==null&&o.dependencies!==null&&sh(o.dependencies)?(typeof B=="function"&&(ov(l,c,B,h),ce=l.memoizedState),(he=Tl||uR(l,c,he,h,ae,ce,K)||o!==null&&o.dependencies!==null&&sh(o.dependencies))?(se||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(h,ce,K),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(h,ce,K)),typeof x.componentDidUpdate=="function"&&(l.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof x.componentDidUpdate!="function"||k===o.memoizedProps&&ae===o.memoizedState||(l.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||k===o.memoizedProps&&ae===o.memoizedState||(l.flags|=1024),l.memoizedProps=h,l.memoizedState=ce),x.props=h,x.state=ce,x.context=K,h=he):(typeof x.componentDidUpdate!="function"||k===o.memoizedProps&&ae===o.memoizedState||(l.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||k===o.memoizedProps&&ae===o.memoizedState||(l.flags|=1024),h=!1)}return x=h,Eh(o,l),h=(l.flags&128)!==0,x||h?(x=l.stateNode,c=h&&typeof c.getDerivedStateFromError!="function"?null:x.render(),l.flags|=1,o!==null&&h?(l.child=La(l,o.child,null,y),l.child=La(l,null,c,y)):Or(o,l,c,y),l.memoizedState=x.state,o=l.child):o=Ps(o,l,y),o}function ER(o,l,c,h){return ka(),l.flags|=256,Or(o,l,c,h),l.child}var cv={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function fv(o){return{baseLanes:o,cachePool:gC()}}function dv(o,l,c){return o=o!==null?o.childLanes&~c:0,l&&(o|=Mi),o}function TR(o,l,c){var h=l.pendingProps,y=!1,x=(l.flags&128)!==0,k;if((k=x)||(k=o!==null&&o.memoizedState===null?!1:(er.current&2)!==0),k&&(y=!0,l.flags&=-129),k=(l.flags&32)!==0,l.flags&=-33,o===null){if(jt){if(y?Ol(l):kl(),(o=On)?(o=zE(o,qi),o=o!==null&&o.data!=="&"?o:null,o!==null&&(l.memoizedState={dehydrated:o,treeContext:wl!==null?{id:Go,overflow:Wo}:null,retryLane:536870912,hydrationErrors:null},c=oC(o),c.return=l,l.child=c,Ar=l,On=null)):o=null,o===null)throw Rl(l);return Kv(o)?l.lanes=32:l.lanes=536870912,null}var B=h.children;return h=h.fallback,y?(kl(),y=l.mode,B=Th({mode:"hidden",children:B},y),h=Oa(h,y,c,null),B.return=l,h.return=l,B.sibling=h,l.child=B,h=l.child,h.memoizedState=fv(c),h.childLanes=dv(o,k,c),l.memoizedState=cv,sf(null,h)):(Ol(l),hv(l,B))}var K=o.memoizedState;if(K!==null&&(B=K.dehydrated,B!==null)){if(x)l.flags&256?(Ol(l),l.flags&=-257,l=gv(o,l,c)):l.memoizedState!==null?(kl(),l.child=o.child,l.flags|=128,l=null):(kl(),B=h.fallback,y=l.mode,h=Th({mode:"visible",children:h.children},y),B=Oa(B,y,c,null),B.flags|=2,h.return=l,B.return=l,h.sibling=B,l.child=h,La(l,o.child,null,c),h=l.child,h.memoizedState=fv(c),h.childLanes=dv(o,k,c),l.memoizedState=cv,l=sf(null,h));else if(Ol(l),Kv(B)){if(k=B.nextSibling&&B.nextSibling.dataset,k)var se=k.dgst;k=se,h=Error(r(419)),h.stack="",h.digest=k,Wc({value:h,source:null,stack:null}),l=gv(o,l,c)}else if(cr||Ou(o,l,c,!1),k=(c&o.childLanes)!==0,cr||k){if(k=Sn,k!==null&&(h=rt(k,c),h!==0&&h!==K.retryLane))throw K.retryLane=h,Ma(o,h),gi(k,o,h),av;Wv(B)||Nh(),l=gv(o,l,c)}else Wv(B)?(l.flags|=192,l.child=o.child,l=null):(o=K.treeContext,On=Wi(B.nextSibling),Ar=l,jt=!0,Cl=null,qi=!1,o!==null&&aC(l,o),l=hv(l,h.children),l.flags|=4096);return l}return y?(kl(),B=h.fallback,y=l.mode,K=o.child,se=K.sibling,h=As(K,{mode:"hidden",children:h.children}),h.subtreeFlags=K.subtreeFlags&65011712,se!==null?B=As(se,B):(B=Oa(B,y,c,null),B.flags|=2),B.return=l,h.return=l,h.sibling=B,l.child=h,sf(null,h),h=l.child,B=o.child.memoizedState,B===null?B=fv(c):(y=B.cachePool,y!==null?(K=ar._currentValue,y=y.parent!==K?{parent:K,pool:K}:y):y=gC(),B={baseLanes:B.baseLanes|c,cachePool:y}),h.memoizedState=B,h.childLanes=dv(o,k,c),l.memoizedState=cv,sf(o.child,h)):(Ol(l),c=o.child,o=c.sibling,c=As(c,{mode:"visible",children:h.children}),c.return=l,c.sibling=null,o!==null&&(k=l.deletions,k===null?(l.deletions=[o],l.flags|=16):k.push(o)),l.child=c,l.memoizedState=null,c)}function hv(o,l){return l=Th({mode:"visible",children:l},o.mode),l.return=o,o.child=l}function Th(o,l){return o=Ri(22,o,null,l),o.lanes=0,o}function gv(o,l,c){return La(l,o.child,null,c),o=hv(l,l.pendingProps.children),o.flags|=2,l.memoizedState=null,o}function AR(o,l,c){o.lanes|=l;var h=o.alternate;h!==null&&(h.lanes|=l),Oy(o.return,l,c)}function pv(o,l,c,h,y,x){var k=o.memoizedState;k===null?o.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:h,tail:c,tailMode:y,treeForkCount:x}:(k.isBackwards=l,k.rendering=null,k.renderingStartTime=0,k.last=h,k.tail=c,k.tailMode=y,k.treeForkCount=x)}function MR(o,l,c){var h=l.pendingProps,y=h.revealOrder,x=h.tail;h=h.children;var k=er.current,B=(k&2)!==0;if(B?(k=k&1|2,l.flags|=128):k&=1,W(er,k),Or(o,l,h,c),h=jt?Gc:0,!B&&o!==null&&(o.flags&128)!==0)e:for(o=l.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&AR(o,c,l);else if(o.tag===19)AR(o,c,l);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===l)break e;for(;o.sibling===null;){if(o.return===null||o.return===l)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}switch(y){case"forwards":for(c=l.child,y=null;c!==null;)o=c.alternate,o!==null&&gh(o)===null&&(y=c),c=c.sibling;c=y,c===null?(y=l.child,l.child=null):(y=c.sibling,c.sibling=null),pv(l,!1,y,c,x,h);break;case"backwards":case"unstable_legacy-backwards":for(c=null,y=l.child,l.child=null;y!==null;){if(o=y.alternate,o!==null&&gh(o)===null){l.child=y;break}o=y.sibling,y.sibling=c,c=y,y=o}pv(l,!0,c,null,x,h);break;case"together":pv(l,!1,null,null,void 0,h);break;default:l.memoizedState=null}return l.child}function Ps(o,l,c){if(o!==null&&(l.dependencies=o.dependencies),Pl|=l.lanes,(c&l.childLanes)===0)if(o!==null){if(Ou(o,l,c,!1),(c&l.childLanes)===0)return null}else return null;if(o!==null&&l.child!==o.child)throw Error(r(153));if(l.child!==null){for(o=l.child,c=As(o,o.pendingProps),l.child=c,c.return=l;o.sibling!==null;)o=o.sibling,c=c.sibling=As(o,o.pendingProps),c.return=l;c.sibling=null}return l.child}function mv(o,l){return(o.lanes&l)!==0?!0:(o=o.dependencies,!!(o!==null&&sh(o)))}function m_(o,l,c){switch(l.tag){case 3:Y(l,l.stateNode.containerInfo),El(l,ar,o.memoizedState.cache),ka();break;case 27:case 5:xe(l);break;case 4:Y(l,l.stateNode.containerInfo);break;case 10:El(l,l.type,l.memoizedProps.value);break;case 31:if(l.memoizedState!==null)return l.flags|=128,Vy(l),null;break;case 13:var h=l.memoizedState;if(h!==null)return h.dehydrated!==null?(Ol(l),l.flags|=128,null):(c&l.child.childLanes)!==0?TR(o,l,c):(Ol(l),o=Ps(o,l,c),o!==null?o.sibling:null);Ol(l);break;case 19:var y=(o.flags&128)!==0;if(h=(c&l.childLanes)!==0,h||(Ou(o,l,c,!1),h=(c&l.childLanes)!==0),y){if(h)return MR(o,l,c);l.flags|=128}if(y=l.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),W(er,er.current),h)break;return null;case 22:return l.lanes=0,xR(o,l,c,l.pendingProps);case 24:El(l,ar,o.memoizedState.cache)}return Ps(o,l,c)}function OR(o,l,c){if(o!==null)if(o.memoizedProps!==l.pendingProps)cr=!0;else{if(!mv(o,c)&&(l.flags&128)===0)return cr=!1,m_(o,l,c);cr=(o.flags&131072)!==0}else cr=!1,jt&&(l.flags&1048576)!==0&&lC(l,Gc,l.index);switch(l.lanes=0,l.tag){case 16:e:{var h=l.pendingProps;if(o=za(l.elementType),l.type=o,typeof o=="function")Sy(o)?(h=_a(o,h),l.tag=1,l=RR(null,l,o,h,c)):(l.tag=0,l=uv(null,l,o,h,c));else{if(o!=null){var y=o.$$typeof;if(y===A){l.tag=11,l=yR(null,l,o,h,c);break e}else if(y===M){l.tag=14,l=vR(null,l,o,h,c);break e}}throw l=F(o)||o,Error(r(306,l,""))}}return l;case 0:return uv(o,l,l.type,l.pendingProps,c);case 1:return h=l.type,y=_a(h,l.pendingProps),RR(o,l,h,y,c);case 3:e:{if(Y(l,l.stateNode.containerInfo),o===null)throw Error(r(387));h=l.pendingProps;var x=l.memoizedState;y=x.element,Ly(o,l),ef(l,h,null,c);var k=l.memoizedState;if(h=k.cache,El(l,ar,h),h!==x.cache&&ky(l,[ar],c,!0),Jc(),h=k.element,x.isDehydrated)if(x={element:h,isDehydrated:!1,cache:k.cache},l.updateQueue.baseState=x,l.memoizedState=x,l.flags&256){l=ER(o,l,h,c);break e}else if(h!==y){y=Fi(Error(r(424)),l),Wc(y),l=ER(o,l,h,c);break e}else for(o=l.stateNode.containerInfo,o.nodeType===9?o=o.body:o=o.nodeName==="HTML"?o.ownerDocument.body:o,On=Wi(o.firstChild),Ar=l,jt=!0,Cl=null,qi=!0,c=xC(l,null,h,c),l.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{if(ka(),h===y){l=Ps(o,l,c);break e}Or(o,l,h,c)}l=l.child}return l;case 26:return Eh(o,l),o===null?(c=jE(l.type,null,l.pendingProps,null))?l.memoizedState=c:jt||(c=l.type,o=l.pendingProps,h=Fh(ee.current).createElement(c),h[Pt]=l,h[zt]=o,kr(h,c,o),Vn(h),l.stateNode=h):l.memoizedState=jE(l.type,o.memoizedProps,l.pendingProps,o.memoizedState),null;case 27:return xe(l),o===null&&jt&&(h=l.stateNode=BE(l.type,l.pendingProps,ee.current),Ar=l,qi=!0,y=On,_l(l.type)?(Yv=y,On=Wi(h.firstChild)):On=y),Or(o,l,l.pendingProps.children,c),Eh(o,l),o===null&&(l.flags|=4194304),l.child;case 5:return o===null&&jt&&((y=h=On)&&(h=G_(h,l.type,l.pendingProps,qi),h!==null?(l.stateNode=h,Ar=l,On=Wi(h.firstChild),qi=!1,y=!0):y=!1),y||Rl(l)),xe(l),y=l.type,x=l.pendingProps,k=o!==null?o.memoizedProps:null,h=x.children,$v(y,x)?h=null:k!==null&&$v(y,k)&&(l.flags|=32),l.memoizedState!==null&&(y=Uy(o,l,l_,null,null,c),Sf._currentValue=y),Eh(o,l),Or(o,l,h,c),l.child;case 6:return o===null&&jt&&((o=c=On)&&(c=W_(c,l.pendingProps,qi),c!==null?(l.stateNode=c,Ar=l,On=null,o=!0):o=!1),o||Rl(l)),null;case 13:return TR(o,l,c);case 4:return Y(l,l.stateNode.containerInfo),h=l.pendingProps,o===null?l.child=La(l,null,h,c):Or(o,l,h,c),l.child;case 11:return yR(o,l,l.type,l.pendingProps,c);case 7:return Or(o,l,l.pendingProps,c),l.child;case 8:return Or(o,l,l.pendingProps.children,c),l.child;case 12:return Or(o,l,l.pendingProps.children,c),l.child;case 10:return h=l.pendingProps,El(l,l.type,h.value),Or(o,l,h.children,c),l.child;case 9:return y=l.type._context,h=l.pendingProps.children,Da(l),y=Mr(y),h=h(y),l.flags|=1,Or(o,l,h,c),l.child;case 14:return vR(o,l,l.type,l.pendingProps,c);case 15:return bR(o,l,l.type,l.pendingProps,c);case 19:return MR(o,l,c);case 31:return p_(o,l,c);case 22:return xR(o,l,c,l.pendingProps);case 24:return Da(l),h=Mr(ar),o===null?(y=Py(),y===null&&(y=Sn,x=Iy(),y.pooledCache=x,x.refCount++,x!==null&&(y.pooledCacheLanes|=c),y=x),l.memoizedState={parent:h,cache:y},Ny(l),El(l,ar,y)):((o.lanes&c)!==0&&(Ly(o,l),ef(l,null,null,c),Jc()),y=o.memoizedState,x=l.memoizedState,y.parent!==h?(y={parent:h,cache:h},l.memoizedState=y,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=y),El(l,ar,h)):(h=x.cache,El(l,ar,h),h!==y.cache&&ky(l,[ar],c,!0))),Or(o,l,l.pendingProps.children,c),l.child;case 29:throw l.pendingProps}throw Error(r(156,l.tag))}function zs(o){o.flags|=4}function yv(o,l,c,h,y){if((l=(o.mode&32)!==0)&&(l=!1),l){if(o.flags|=16777216,(y&335544128)===y)if(o.stateNode.complete)o.flags|=8192;else if(nE())o.flags|=8192;else throw Na=ch,zy}else o.flags&=-16777217}function kR(o,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)o.flags&=-16777217;else if(o.flags|=16777216,!qE(l))if(nE())o.flags|=8192;else throw Na=ch,zy}function Ah(o,l){l!==null&&(o.flags|=4),o.flags&16384&&(l=o.tag!==22?jn():536870912,o.lanes|=l,Vu|=l)}function lf(o,l){if(!jt)switch(o.tailMode){case"hidden":l=o.tail;for(var c=null;l!==null;)l.alternate!==null&&(c=l),l=l.sibling;c===null?o.tail=null:c.sibling=null;break;case"collapsed":c=o.tail;for(var h=null;c!==null;)c.alternate!==null&&(h=c),c=c.sibling;h===null?l||o.tail===null?o.tail=null:o.tail.sibling=null:h.sibling=null}}function kn(o){var l=o.alternate!==null&&o.alternate.child===o.child,c=0,h=0;if(l)for(var y=o.child;y!==null;)c|=y.lanes|y.childLanes,h|=y.subtreeFlags&65011712,h|=y.flags&65011712,y.return=o,y=y.sibling;else for(y=o.child;y!==null;)c|=y.lanes|y.childLanes,h|=y.subtreeFlags,h|=y.flags,y.return=o,y=y.sibling;return o.subtreeFlags|=h,o.childLanes=c,l}function y_(o,l,c){var h=l.pendingProps;switch(Ey(l),l.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return kn(l),null;case 1:return kn(l),null;case 3:return c=l.stateNode,h=null,o!==null&&(h=o.memoizedState.cache),l.memoizedState.cache!==h&&(l.flags|=2048),ks(ar),le(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(o===null||o.child===null)&&(Mu(l)?zs(l):o===null||o.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,Ay())),kn(l),null;case 26:var y=l.type,x=l.memoizedState;return o===null?(zs(l),x!==null?(kn(l),kR(l,x)):(kn(l),yv(l,y,null,h,c))):x?x!==o.memoizedState?(zs(l),kn(l),kR(l,x)):(kn(l),l.flags&=-16777217):(o=o.memoizedProps,o!==h&&zs(l),kn(l),yv(l,y,o,h,c)),null;case 27:if(ve(l),c=ee.current,y=l.type,o!==null&&l.stateNode!=null)o.memoizedProps!==h&&zs(l);else{if(!h){if(l.stateNode===null)throw Error(r(166));return kn(l),null}o=X.current,Mu(l)?uC(l):(o=BE(y,h,c),l.stateNode=o,zs(l))}return kn(l),null;case 5:if(ve(l),y=l.type,o!==null&&l.stateNode!=null)o.memoizedProps!==h&&zs(l);else{if(!h){if(l.stateNode===null)throw Error(r(166));return kn(l),null}if(x=X.current,Mu(l))uC(l);else{var k=Fh(ee.current);switch(x){case 1:x=k.createElementNS("http://www.w3.org/2000/svg",y);break;case 2:x=k.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;default:switch(y){case"svg":x=k.createElementNS("http://www.w3.org/2000/svg",y);break;case"math":x=k.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;case"script":x=k.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof h.is=="string"?k.createElement("select",{is:h.is}):k.createElement("select"),h.multiple?x.multiple=!0:h.size&&(x.size=h.size);break;default:x=typeof h.is=="string"?k.createElement(y,{is:h.is}):k.createElement(y)}}x[Pt]=l,x[zt]=h;e:for(k=l.child;k!==null;){if(k.tag===5||k.tag===6)x.appendChild(k.stateNode);else if(k.tag!==4&&k.tag!==27&&k.child!==null){k.child.return=k,k=k.child;continue}if(k===l)break e;for(;k.sibling===null;){if(k.return===null||k.return===l)break e;k=k.return}k.sibling.return=k.return,k=k.sibling}l.stateNode=x;e:switch(kr(x,y,h),y){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}h&&zs(l)}}return kn(l),yv(l,l.type,o===null?null:o.memoizedProps,l.pendingProps,c),null;case 6:if(o&&l.stateNode!=null)o.memoizedProps!==h&&zs(l);else{if(typeof h!="string"&&l.stateNode===null)throw Error(r(166));if(o=ee.current,Mu(l)){if(o=l.stateNode,c=l.memoizedProps,h=null,y=Ar,y!==null)switch(y.tag){case 27:case 5:h=y.memoizedProps}o[Pt]=l,o=!!(o.nodeValue===c||h!==null&&h.suppressHydrationWarning===!0||TE(o.nodeValue,c)),o||Rl(l,!0)}else o=Fh(o).createTextNode(h),o[Pt]=l,l.stateNode=o}return kn(l),null;case 31:if(c=l.memoizedState,o===null||o.memoizedState!==null){if(h=Mu(l),c!==null){if(o===null){if(!h)throw Error(r(318));if(o=l.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(557));o[Pt]=l}else ka(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;kn(l),o=!1}else c=Ay(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=c),o=!0;if(!o)return l.flags&256?(Ti(l),l):(Ti(l),null);if((l.flags&128)!==0)throw Error(r(558))}return kn(l),null;case 13:if(h=l.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(y=Mu(l),h!==null&&h.dehydrated!==null){if(o===null){if(!y)throw Error(r(318));if(y=l.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(r(317));y[Pt]=l}else ka(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;kn(l),y=!1}else y=Ay(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=y),y=!0;if(!y)return l.flags&256?(Ti(l),l):(Ti(l),null)}return Ti(l),(l.flags&128)!==0?(l.lanes=c,l):(c=h!==null,o=o!==null&&o.memoizedState!==null,c&&(h=l.child,y=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(y=h.alternate.memoizedState.cachePool.pool),x=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(x=h.memoizedState.cachePool.pool),x!==y&&(h.flags|=2048)),c!==o&&c&&(l.child.flags|=8192),Ah(l,l.updateQueue),kn(l),null);case 4:return le(),o===null&&Hv(l.stateNode.containerInfo),kn(l),null;case 10:return ks(l.type),kn(l),null;case 19:if(U(er),h=l.memoizedState,h===null)return kn(l),null;if(y=(l.flags&128)!==0,x=h.rendering,x===null)if(y)lf(h,!1);else{if(Wn!==0||o!==null&&(o.flags&128)!==0)for(o=l.child;o!==null;){if(x=gh(o),x!==null){for(l.flags|=128,lf(h,!1),o=x.updateQueue,l.updateQueue=o,Ah(l,o),l.subtreeFlags=0,o=c,c=l.child;c!==null;)iC(c,o),c=c.sibling;return W(er,er.current&1|2),jt&&Ms(l,h.treeForkCount),l.child}o=o.sibling}h.tail!==null&&ne()>Dh&&(l.flags|=128,y=!0,lf(h,!1),l.lanes=4194304)}else{if(!y)if(o=gh(x),o!==null){if(l.flags|=128,y=!0,o=o.updateQueue,l.updateQueue=o,Ah(l,o),lf(h,!0),h.tail===null&&h.tailMode==="hidden"&&!x.alternate&&!jt)return kn(l),null}else 2*ne()-h.renderingStartTime>Dh&&c!==536870912&&(l.flags|=128,y=!0,lf(h,!1),l.lanes=4194304);h.isBackwards?(x.sibling=l.child,l.child=x):(o=h.last,o!==null?o.sibling=x:l.child=x,h.last=x)}return h.tail!==null?(o=h.tail,h.rendering=o,h.tail=o.sibling,h.renderingStartTime=ne(),o.sibling=null,c=er.current,W(er,y?c&1|2:c&1),jt&&Ms(l,h.treeForkCount),o):(kn(l),null);case 22:case 23:return Ti(l),jy(),h=l.memoizedState!==null,o!==null?o.memoizedState!==null!==h&&(l.flags|=8192):h&&(l.flags|=8192),h?(c&536870912)!==0&&(l.flags&128)===0&&(kn(l),l.subtreeFlags&6&&(l.flags|=8192)):kn(l),c=l.updateQueue,c!==null&&Ah(l,c.retryQueue),c=null,o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(c=o.memoizedState.cachePool.pool),h=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(h=l.memoizedState.cachePool.pool),h!==c&&(l.flags|=2048),o!==null&&U(Pa),null;case 24:return c=null,o!==null&&(c=o.memoizedState.cache),l.memoizedState.cache!==c&&(l.flags|=2048),ks(ar),kn(l),null;case 25:return null;case 30:return null}throw Error(r(156,l.tag))}function v_(o,l){switch(Ey(l),l.tag){case 1:return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 3:return ks(ar),le(),o=l.flags,(o&65536)!==0&&(o&128)===0?(l.flags=o&-65537|128,l):null;case 26:case 27:case 5:return ve(l),null;case 31:if(l.memoizedState!==null){if(Ti(l),l.alternate===null)throw Error(r(340));ka()}return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 13:if(Ti(l),o=l.memoizedState,o!==null&&o.dehydrated!==null){if(l.alternate===null)throw Error(r(340));ka()}return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 19:return U(er),null;case 4:return le(),null;case 10:return ks(l.type),null;case 22:case 23:return Ti(l),jy(),o!==null&&U(Pa),o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 24:return ks(ar),null;case 25:return null;default:return null}}function IR(o,l){switch(Ey(l),l.tag){case 3:ks(ar),le();break;case 26:case 27:case 5:ve(l);break;case 4:le();break;case 31:l.memoizedState!==null&&Ti(l);break;case 13:Ti(l);break;case 19:U(er);break;case 10:ks(l.type);break;case 22:case 23:Ti(l),jy(),o!==null&&U(Pa);break;case 24:ks(ar)}}function af(o,l){try{var c=l.updateQueue,h=c!==null?c.lastEffect:null;if(h!==null){var y=h.next;c=y;do{if((c.tag&o)===o){h=void 0;var x=c.create,k=c.inst;h=x(),k.destroy=h}c=c.next}while(c!==y)}}catch(B){un(l,l.return,B)}}function Il(o,l,c){try{var h=l.updateQueue,y=h!==null?h.lastEffect:null;if(y!==null){var x=y.next;h=x;do{if((h.tag&o)===o){var k=h.inst,B=k.destroy;if(B!==void 0){k.destroy=void 0,y=l;var K=c,se=B;try{se()}catch(he){un(y,K,he)}}}h=h.next}while(h!==x)}}catch(he){un(l,l.return,he)}}function DR(o){var l=o.updateQueue;if(l!==null){var c=o.stateNode;try{wC(l,c)}catch(h){un(o,o.return,h)}}}function PR(o,l,c){c.props=_a(o.type,o.memoizedProps),c.state=o.memoizedState;try{c.componentWillUnmount()}catch(h){un(o,l,h)}}function uf(o,l){try{var c=o.ref;if(c!==null){switch(o.tag){case 26:case 27:case 5:var h=o.stateNode;break;case 30:h=o.stateNode;break;default:h=o.stateNode}typeof c=="function"?o.refCleanup=c(h):c.current=h}}catch(y){un(o,l,y)}}function Ko(o,l){var c=o.ref,h=o.refCleanup;if(c!==null)if(typeof h=="function")try{h()}catch(y){un(o,l,y)}finally{o.refCleanup=null,o=o.alternate,o!=null&&(o.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(y){un(o,l,y)}else c.current=null}function zR(o){var l=o.type,c=o.memoizedProps,h=o.stateNode;try{e:switch(l){case"button":case"input":case"select":case"textarea":c.autoFocus&&h.focus();break e;case"img":c.src?h.src=c.src:c.srcSet&&(h.srcset=c.srcSet)}}catch(y){un(o,o.return,y)}}function vv(o,l,c){try{var h=o.stateNode;j_(h,o.type,c,l),h[zt]=l}catch(y){un(o,o.return,y)}}function NR(o){return o.tag===5||o.tag===3||o.tag===26||o.tag===27&&_l(o.type)||o.tag===4}function bv(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||NR(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.tag===27&&_l(o.type)||o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function xv(o,l,c){var h=o.tag;if(h===5||h===6)o=o.stateNode,l?(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c).insertBefore(o,l):(l=c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,l.appendChild(o),c=c._reactRootContainer,c!=null||l.onclick!==null||(l.onclick=jr));else if(h!==4&&(h===27&&_l(o.type)&&(c=o.stateNode,l=null),o=o.child,o!==null))for(xv(o,l,c),o=o.sibling;o!==null;)xv(o,l,c),o=o.sibling}function Mh(o,l,c){var h=o.tag;if(h===5||h===6)o=o.stateNode,l?c.insertBefore(o,l):c.appendChild(o);else if(h!==4&&(h===27&&_l(o.type)&&(c=o.stateNode),o=o.child,o!==null))for(Mh(o,l,c),o=o.sibling;o!==null;)Mh(o,l,c),o=o.sibling}function LR(o){var l=o.stateNode,c=o.memoizedProps;try{for(var h=o.type,y=l.attributes;y.length;)l.removeAttributeNode(y[0]);kr(l,h,c),l[Pt]=o,l[zt]=c}catch(x){un(o,o.return,x)}}var Ns=!1,fr=!1,Sv=!1,BR=typeof WeakSet=="function"?WeakSet:Set,Rr=null;function b_(o,l){if(o=o.containerInfo,Fv=Yh,o=Y1(o),gy(o)){if("selectionStart"in o)var c={start:o.selectionStart,end:o.selectionEnd};else e:{c=(c=o.ownerDocument)&&c.defaultView||window;var h=c.getSelection&&c.getSelection();if(h&&h.rangeCount!==0){c=h.anchorNode;var y=h.anchorOffset,x=h.focusNode;h=h.focusOffset;try{c.nodeType,x.nodeType}catch{c=null;break e}var k=0,B=-1,K=-1,se=0,he=0,be=o,ae=null;t:for(;;){for(var ce;be!==c||y!==0&&be.nodeType!==3||(B=k+y),be!==x||h!==0&&be.nodeType!==3||(K=k+h),be.nodeType===3&&(k+=be.nodeValue.length),(ce=be.firstChild)!==null;)ae=be,be=ce;for(;;){if(be===o)break t;if(ae===c&&++se===y&&(B=k),ae===x&&++he===h&&(K=k),(ce=be.nextSibling)!==null)break;be=ae,ae=be.parentNode}be=ce}c=B===-1||K===-1?null:{start:B,end:K}}else c=null}c=c||{start:0,end:0}}else c=null;for(Uv={focusedElem:o,selectionRange:c},Yh=!1,Rr=l;Rr!==null;)if(l=Rr,o=l.child,(l.subtreeFlags&1028)!==0&&o!==null)o.return=l,Rr=o;else for(;Rr!==null;){switch(l=Rr,x=l.alternate,o=l.flags,l.tag){case 0:if((o&4)!==0&&(o=l.updateQueue,o=o!==null?o.events:null,o!==null))for(c=0;c<o.length;c++)y=o[c],y.ref.impl=y.nextImpl;break;case 11:case 15:break;case 1:if((o&1024)!==0&&x!==null){o=void 0,c=l,y=x.memoizedProps,x=x.memoizedState,h=c.stateNode;try{var qe=_a(c.type,y);o=h.getSnapshotBeforeUpdate(qe,x),h.__reactInternalSnapshotBeforeUpdate=o}catch(lt){un(c,c.return,lt)}}break;case 3:if((o&1024)!==0){if(o=l.stateNode.containerInfo,c=o.nodeType,c===9)Gv(o);else if(c===1)switch(o.nodeName){case"HEAD":case"HTML":case"BODY":Gv(o);break;default:o.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((o&1024)!==0)throw Error(r(163))}if(o=l.sibling,o!==null){o.return=l.return,Rr=o;break}Rr=l.return}}function _R(o,l,c){var h=c.flags;switch(c.tag){case 0:case 11:case 15:Bs(o,c),h&4&&af(5,c);break;case 1:if(Bs(o,c),h&4)if(o=c.stateNode,l===null)try{o.componentDidMount()}catch(k){un(c,c.return,k)}else{var y=_a(c.type,l.memoizedProps);l=l.memoizedState;try{o.componentDidUpdate(y,l,o.__reactInternalSnapshotBeforeUpdate)}catch(k){un(c,c.return,k)}}h&64&&DR(c),h&512&&uf(c,c.return);break;case 3:if(Bs(o,c),h&64&&(o=c.updateQueue,o!==null)){if(l=null,c.child!==null)switch(c.child.tag){case 27:case 5:l=c.child.stateNode;break;case 1:l=c.child.stateNode}try{wC(o,l)}catch(k){un(c,c.return,k)}}break;case 27:l===null&&h&4&&LR(c);case 26:case 5:Bs(o,c),l===null&&h&4&&zR(c),h&512&&uf(c,c.return);break;case 12:Bs(o,c);break;case 31:Bs(o,c),h&4&&VR(o,c);break;case 13:Bs(o,c),h&4&&FR(o,c),h&64&&(o=c.memoizedState,o!==null&&(o=o.dehydrated,o!==null&&(c=M_.bind(null,c),K_(o,c))));break;case 22:if(h=c.memoizedState!==null||Ns,!h){l=l!==null&&l.memoizedState!==null||fr,y=Ns;var x=fr;Ns=h,(fr=l)&&!x?_s(o,c,(c.subtreeFlags&8772)!==0):Bs(o,c),Ns=y,fr=x}break;case 30:break;default:Bs(o,c)}}function HR(o){var l=o.alternate;l!==null&&(o.alternate=null,HR(l)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(l=o.stateNode,l!==null&&Sa(l)),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}var Bn=null,ci=!1;function Ls(o,l,c){for(c=c.child;c!==null;)jR(o,l,c),c=c.sibling}function jR(o,l,c){if(It&&typeof It.onCommitFiberUnmount=="function")try{It.onCommitFiberUnmount(kt,c)}catch{}switch(c.tag){case 26:fr||Ko(c,l),Ls(o,l,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:fr||Ko(c,l);var h=Bn,y=ci;_l(c.type)&&(Bn=c.stateNode,ci=!1),Ls(o,l,c),vf(c.stateNode),Bn=h,ci=y;break;case 5:fr||Ko(c,l);case 6:if(h=Bn,y=ci,Bn=null,Ls(o,l,c),Bn=h,ci=y,Bn!==null)if(ci)try{(Bn.nodeType===9?Bn.body:Bn.nodeName==="HTML"?Bn.ownerDocument.body:Bn).removeChild(c.stateNode)}catch(x){un(c,l,x)}else try{Bn.removeChild(c.stateNode)}catch(x){un(c,l,x)}break;case 18:Bn!==null&&(ci?(o=Bn,DE(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,c.stateNode),Yu(o)):DE(Bn,c.stateNode));break;case 4:h=Bn,y=ci,Bn=c.stateNode.containerInfo,ci=!0,Ls(o,l,c),Bn=h,ci=y;break;case 0:case 11:case 14:case 15:Il(2,c,l),fr||Il(4,c,l),Ls(o,l,c);break;case 1:fr||(Ko(c,l),h=c.stateNode,typeof h.componentWillUnmount=="function"&&PR(c,l,h)),Ls(o,l,c);break;case 21:Ls(o,l,c);break;case 22:fr=(h=fr)||c.memoizedState!==null,Ls(o,l,c),fr=h;break;default:Ls(o,l,c)}}function VR(o,l){if(l.memoizedState===null&&(o=l.alternate,o!==null&&(o=o.memoizedState,o!==null))){o=o.dehydrated;try{Yu(o)}catch(c){un(l,l.return,c)}}}function FR(o,l){if(l.memoizedState===null&&(o=l.alternate,o!==null&&(o=o.memoizedState,o!==null&&(o=o.dehydrated,o!==null))))try{Yu(o)}catch(c){un(l,l.return,c)}}function x_(o){switch(o.tag){case 31:case 13:case 19:var l=o.stateNode;return l===null&&(l=o.stateNode=new BR),l;case 22:return o=o.stateNode,l=o._retryCache,l===null&&(l=o._retryCache=new BR),l;default:throw Error(r(435,o.tag))}}function Oh(o,l){var c=x_(o);l.forEach(function(h){if(!c.has(h)){c.add(h);var y=O_.bind(null,o,h);h.then(y,y)}})}function fi(o,l){var c=l.deletions;if(c!==null)for(var h=0;h<c.length;h++){var y=c[h],x=o,k=l,B=k;e:for(;B!==null;){switch(B.tag){case 27:if(_l(B.type)){Bn=B.stateNode,ci=!1;break e}break;case 5:Bn=B.stateNode,ci=!1;break e;case 3:case 4:Bn=B.stateNode.containerInfo,ci=!0;break e}B=B.return}if(Bn===null)throw Error(r(160));jR(x,k,y),Bn=null,ci=!1,x=y.alternate,x!==null&&(x.return=null),y.return=null}if(l.subtreeFlags&13886)for(l=l.child;l!==null;)UR(l,o),l=l.sibling}var wo=null;function UR(o,l){var c=o.alternate,h=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:fi(l,o),di(o),h&4&&(Il(3,o,o.return),af(3,o),Il(5,o,o.return));break;case 1:fi(l,o),di(o),h&512&&(fr||c===null||Ko(c,c.return)),h&64&&Ns&&(o=o.updateQueue,o!==null&&(h=o.callbacks,h!==null&&(c=o.shared.hiddenCallbacks,o.shared.hiddenCallbacks=c===null?h:c.concat(h))));break;case 26:var y=wo;if(fi(l,o),di(o),h&512&&(fr||c===null||Ko(c,c.return)),h&4){var x=c!==null?c.memoizedState:null;if(h=o.memoizedState,c===null)if(h===null)if(o.stateNode===null){e:{h=o.type,c=o.memoizedProps,y=y.ownerDocument||y;t:switch(h){case"title":x=y.getElementsByTagName("title")[0],(!x||x[Fe]||x[Pt]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=y.createElement(h),y.head.insertBefore(x,y.querySelector("head > title"))),kr(x,h,c),x[Pt]=o,Vn(x),h=x;break e;case"link":var k=UE("link","href",y).get(h+(c.href||""));if(k){for(var B=0;B<k.length;B++)if(x=k[B],x.getAttribute("href")===(c.href==null||c.href===""?null:c.href)&&x.getAttribute("rel")===(c.rel==null?null:c.rel)&&x.getAttribute("title")===(c.title==null?null:c.title)&&x.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){k.splice(B,1);break t}}x=y.createElement(h),kr(x,h,c),y.head.appendChild(x);break;case"meta":if(k=UE("meta","content",y).get(h+(c.content||""))){for(B=0;B<k.length;B++)if(x=k[B],x.getAttribute("content")===(c.content==null?null:""+c.content)&&x.getAttribute("name")===(c.name==null?null:c.name)&&x.getAttribute("property")===(c.property==null?null:c.property)&&x.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&x.getAttribute("charset")===(c.charSet==null?null:c.charSet)){k.splice(B,1);break t}}x=y.createElement(h),kr(x,h,c),y.head.appendChild(x);break;default:throw Error(r(468,h))}x[Pt]=o,Vn(x),h=x}o.stateNode=h}else $E(y,o.type,o.stateNode);else o.stateNode=FE(y,h,o.memoizedProps);else x!==h?(x===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):x.count--,h===null?$E(y,o.type,o.stateNode):FE(y,h,o.memoizedProps)):h===null&&o.stateNode!==null&&vv(o,o.memoizedProps,c.memoizedProps)}break;case 27:fi(l,o),di(o),h&512&&(fr||c===null||Ko(c,c.return)),c!==null&&h&4&&vv(o,o.memoizedProps,c.memoizedProps);break;case 5:if(fi(l,o),di(o),h&512&&(fr||c===null||Ko(c,c.return)),o.flags&32){y=o.stateNode;try{ji(y,"")}catch(qe){un(o,o.return,qe)}}h&4&&o.stateNode!=null&&(y=o.memoizedProps,vv(o,y,c!==null?c.memoizedProps:y)),h&1024&&(Sv=!0);break;case 6:if(fi(l,o),di(o),h&4){if(o.stateNode===null)throw Error(r(162));h=o.memoizedProps,c=o.stateNode;try{c.nodeValue=h}catch(qe){un(o,o.return,qe)}}break;case 3:if(qh=null,y=wo,wo=Uh(l.containerInfo),fi(l,o),wo=y,di(o),h&4&&c!==null&&c.memoizedState.isDehydrated)try{Yu(l.containerInfo)}catch(qe){un(o,o.return,qe)}Sv&&(Sv=!1,$R(o));break;case 4:h=wo,wo=Uh(o.stateNode.containerInfo),fi(l,o),di(o),wo=h;break;case 12:fi(l,o),di(o);break;case 31:fi(l,o),di(o),h&4&&(h=o.updateQueue,h!==null&&(o.updateQueue=null,Oh(o,h)));break;case 13:fi(l,o),di(o),o.child.flags&8192&&o.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(Ih=ne()),h&4&&(h=o.updateQueue,h!==null&&(o.updateQueue=null,Oh(o,h)));break;case 22:y=o.memoizedState!==null;var K=c!==null&&c.memoizedState!==null,se=Ns,he=fr;if(Ns=se||y,fr=he||K,fi(l,o),fr=he,Ns=se,di(o),h&8192)e:for(l=o.stateNode,l._visibility=y?l._visibility&-2:l._visibility|1,y&&(c===null||K||Ns||fr||Ha(o)),c=null,l=o;;){if(l.tag===5||l.tag===26){if(c===null){K=c=l;try{if(x=K.stateNode,y)k=x.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none";else{B=K.stateNode;var be=K.memoizedProps.style,ae=be!=null&&be.hasOwnProperty("display")?be.display:null;B.style.display=ae==null||typeof ae=="boolean"?"":(""+ae).trim()}}catch(qe){un(K,K.return,qe)}}}else if(l.tag===6){if(c===null){K=l;try{K.stateNode.nodeValue=y?"":K.memoizedProps}catch(qe){un(K,K.return,qe)}}}else if(l.tag===18){if(c===null){K=l;try{var ce=K.stateNode;y?PE(ce,!0):PE(K.stateNode,!1)}catch(qe){un(K,K.return,qe)}}}else if((l.tag!==22&&l.tag!==23||l.memoizedState===null||l===o)&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===o)break e;for(;l.sibling===null;){if(l.return===null||l.return===o)break e;c===l&&(c=null),l=l.return}c===l&&(c=null),l.sibling.return=l.return,l=l.sibling}h&4&&(h=o.updateQueue,h!==null&&(c=h.retryQueue,c!==null&&(h.retryQueue=null,Oh(o,c))));break;case 19:fi(l,o),di(o),h&4&&(h=o.updateQueue,h!==null&&(o.updateQueue=null,Oh(o,h)));break;case 30:break;case 21:break;default:fi(l,o),di(o)}}function di(o){var l=o.flags;if(l&2){try{for(var c,h=o.return;h!==null;){if(NR(h)){c=h;break}h=h.return}if(c==null)throw Error(r(160));switch(c.tag){case 27:var y=c.stateNode,x=bv(o);Mh(o,x,y);break;case 5:var k=c.stateNode;c.flags&32&&(ji(k,""),c.flags&=-33);var B=bv(o);Mh(o,B,k);break;case 3:case 4:var K=c.stateNode.containerInfo,se=bv(o);xv(o,se,K);break;default:throw Error(r(161))}}catch(he){un(o,o.return,he)}o.flags&=-3}l&4096&&(o.flags&=-4097)}function $R(o){if(o.subtreeFlags&1024)for(o=o.child;o!==null;){var l=o;$R(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),o=o.sibling}}function Bs(o,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)_R(o,l.alternate,l),l=l.sibling}function Ha(o){for(o=o.child;o!==null;){var l=o;switch(l.tag){case 0:case 11:case 14:case 15:Il(4,l,l.return),Ha(l);break;case 1:Ko(l,l.return);var c=l.stateNode;typeof c.componentWillUnmount=="function"&&PR(l,l.return,c),Ha(l);break;case 27:vf(l.stateNode);case 26:case 5:Ko(l,l.return),Ha(l);break;case 22:l.memoizedState===null&&Ha(l);break;case 30:Ha(l);break;default:Ha(l)}o=o.sibling}}function _s(o,l,c){for(c=c&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var h=l.alternate,y=o,x=l,k=x.flags;switch(x.tag){case 0:case 11:case 15:_s(y,x,c),af(4,x);break;case 1:if(_s(y,x,c),h=x,y=h.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(se){un(h,h.return,se)}if(h=x,y=h.updateQueue,y!==null){var B=h.stateNode;try{var K=y.shared.hiddenCallbacks;if(K!==null)for(y.shared.hiddenCallbacks=null,y=0;y<K.length;y++)SC(K[y],B)}catch(se){un(h,h.return,se)}}c&&k&64&&DR(x),uf(x,x.return);break;case 27:LR(x);case 26:case 5:_s(y,x,c),c&&h===null&&k&4&&zR(x),uf(x,x.return);break;case 12:_s(y,x,c);break;case 31:_s(y,x,c),c&&k&4&&VR(y,x);break;case 13:_s(y,x,c),c&&k&4&&FR(y,x);break;case 22:x.memoizedState===null&&_s(y,x,c),uf(x,x.return);break;case 30:break;default:_s(y,x,c)}l=l.sibling}}function wv(o,l){var c=null;o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(c=o.memoizedState.cachePool.pool),o=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(o=l.memoizedState.cachePool.pool),o!==c&&(o!=null&&o.refCount++,c!=null&&Kc(c))}function Cv(o,l){o=null,l.alternate!==null&&(o=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==o&&(l.refCount++,o!=null&&Kc(o))}function Co(o,l,c,h){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)qR(o,l,c,h),l=l.sibling}function qR(o,l,c,h){var y=l.flags;switch(l.tag){case 0:case 11:case 15:Co(o,l,c,h),y&2048&&af(9,l);break;case 1:Co(o,l,c,h);break;case 3:Co(o,l,c,h),y&2048&&(o=null,l.alternate!==null&&(o=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==o&&(l.refCount++,o!=null&&Kc(o)));break;case 12:if(y&2048){Co(o,l,c,h),o=l.stateNode;try{var x=l.memoizedProps,k=x.id,B=x.onPostCommit;typeof B=="function"&&B(k,l.alternate===null?"mount":"update",o.passiveEffectDuration,-0)}catch(K){un(l,l.return,K)}}else Co(o,l,c,h);break;case 31:Co(o,l,c,h);break;case 13:Co(o,l,c,h);break;case 23:break;case 22:x=l.stateNode,k=l.alternate,l.memoizedState!==null?x._visibility&2?Co(o,l,c,h):cf(o,l):x._visibility&2?Co(o,l,c,h):(x._visibility|=2,_u(o,l,c,h,(l.subtreeFlags&10256)!==0||!1)),y&2048&&wv(k,l);break;case 24:Co(o,l,c,h),y&2048&&Cv(l.alternate,l);break;default:Co(o,l,c,h)}}function _u(o,l,c,h,y){for(y=y&&((l.subtreeFlags&10256)!==0||!1),l=l.child;l!==null;){var x=o,k=l,B=c,K=h,se=k.flags;switch(k.tag){case 0:case 11:case 15:_u(x,k,B,K,y),af(8,k);break;case 23:break;case 22:var he=k.stateNode;k.memoizedState!==null?he._visibility&2?_u(x,k,B,K,y):cf(x,k):(he._visibility|=2,_u(x,k,B,K,y)),y&&se&2048&&wv(k.alternate,k);break;case 24:_u(x,k,B,K,y),y&&se&2048&&Cv(k.alternate,k);break;default:_u(x,k,B,K,y)}l=l.sibling}}function cf(o,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var c=o,h=l,y=h.flags;switch(h.tag){case 22:cf(c,h),y&2048&&wv(h.alternate,h);break;case 24:cf(c,h),y&2048&&Cv(h.alternate,h);break;default:cf(c,h)}l=l.sibling}}var ff=8192;function Hu(o,l,c){if(o.subtreeFlags&ff)for(o=o.child;o!==null;)GR(o,l,c),o=o.sibling}function GR(o,l,c){switch(o.tag){case 26:Hu(o,l,c),o.flags&ff&&o.memoizedState!==null&&sH(c,wo,o.memoizedState,o.memoizedProps);break;case 5:Hu(o,l,c);break;case 3:case 4:var h=wo;wo=Uh(o.stateNode.containerInfo),Hu(o,l,c),wo=h;break;case 22:o.memoizedState===null&&(h=o.alternate,h!==null&&h.memoizedState!==null?(h=ff,ff=16777216,Hu(o,l,c),ff=h):Hu(o,l,c));break;default:Hu(o,l,c)}}function WR(o){var l=o.alternate;if(l!==null&&(o=l.child,o!==null)){l.child=null;do l=o.sibling,o.sibling=null,o=l;while(o!==null)}}function df(o){var l=o.deletions;if((o.flags&16)!==0){if(l!==null)for(var c=0;c<l.length;c++){var h=l[c];Rr=h,YR(h,o)}WR(o)}if(o.subtreeFlags&10256)for(o=o.child;o!==null;)KR(o),o=o.sibling}function KR(o){switch(o.tag){case 0:case 11:case 15:df(o),o.flags&2048&&Il(9,o,o.return);break;case 3:df(o);break;case 12:df(o);break;case 22:var l=o.stateNode;o.memoizedState!==null&&l._visibility&2&&(o.return===null||o.return.tag!==13)?(l._visibility&=-3,kh(o)):df(o);break;default:df(o)}}function kh(o){var l=o.deletions;if((o.flags&16)!==0){if(l!==null)for(var c=0;c<l.length;c++){var h=l[c];Rr=h,YR(h,o)}WR(o)}for(o=o.child;o!==null;){switch(l=o,l.tag){case 0:case 11:case 15:Il(8,l,l.return),kh(l);break;case 22:c=l.stateNode,c._visibility&2&&(c._visibility&=-3,kh(l));break;default:kh(l)}o=o.sibling}}function YR(o,l){for(;Rr!==null;){var c=Rr;switch(c.tag){case 0:case 11:case 15:Il(8,c,l);break;case 23:case 22:if(c.memoizedState!==null&&c.memoizedState.cachePool!==null){var h=c.memoizedState.cachePool.pool;h!=null&&h.refCount++}break;case 24:Kc(c.memoizedState.cache)}if(h=c.child,h!==null)h.return=c,Rr=h;else e:for(c=o;Rr!==null;){h=Rr;var y=h.sibling,x=h.return;if(HR(h),h===c){Rr=null;break e}if(y!==null){y.return=x,Rr=y;break e}Rr=x}}}var S_={getCacheForType:function(o){var l=Mr(ar),c=l.data.get(o);return c===void 0&&(c=o(),l.data.set(o,c)),c},cacheSignal:function(){return Mr(ar).controller.signal}},w_=typeof WeakMap=="function"?WeakMap:Map,tn=0,Sn=null,Nt=null,_t=0,an=0,Ai=null,Dl=!1,ju=!1,Rv=!1,Hs=0,Wn=0,Pl=0,ja=0,Ev=0,Mi=0,Vu=0,hf=null,hi=null,Tv=!1,Ih=0,XR=0,Dh=1/0,Ph=null,zl=null,gr=0,Nl=null,Fu=null,js=0,Av=0,Mv=null,QR=null,gf=0,Ov=null;function Oi(){return(tn&2)!==0&&_t!==0?_t&-_t:j.T!==null?Nv():Ln()}function ZR(){if(Mi===0)if((_t&536870912)===0||jt){var o=Wt;Wt<<=1,(Wt&3932160)===0&&(Wt=262144),Mi=o}else Mi=536870912;return o=Ei.current,o!==null&&(o.flags|=32),Mi}function gi(o,l,c){(o===Sn&&(an===2||an===9)||o.cancelPendingCommit!==null)&&(Uu(o,0),Ll(o,_t,Mi,!1)),Rn(o,c),((tn&2)===0||o!==Sn)&&(o===Sn&&((tn&2)===0&&(ja|=c),Wn===4&&Ll(o,_t,Mi,!1)),Yo(o))}function JR(o,l,c){if((tn&6)!==0)throw Error(r(327));var h=!c&&(l&127)===0&&(l&o.expiredLanes)===0||Zt(o,l),y=h?E_(o,l):Iv(o,l,!0),x=h;do{if(y===0){ju&&!h&&Ll(o,l,0,!1);break}else{if(c=o.current.alternate,x&&!C_(c)){y=Iv(o,l,!1),x=!1;continue}if(y===2){if(x=l,o.errorRecoveryDisabledLanes&x)var k=0;else k=o.pendingLanes&-536870913,k=k!==0?k:k&536870912?536870912:0;if(k!==0){l=k;e:{var B=o;y=hf;var K=B.current.memoizedState.isDehydrated;if(K&&(Uu(B,k).flags|=256),k=Iv(B,k,!1),k!==2){if(Rv&&!K){B.errorRecoveryDisabledLanes|=x,ja|=x,y=4;break e}x=hi,hi=y,x!==null&&(hi===null?hi=x:hi.push.apply(hi,x))}y=k}if(x=!1,y!==2)continue}}if(y===1){Uu(o,0),Ll(o,l,0,!0);break}e:{switch(h=o,x=y,x){case 0:case 1:throw Error(r(345));case 4:if((l&4194048)!==l)break;case 6:Ll(h,l,Mi,!Dl);break e;case 2:hi=null;break;case 3:case 5:break;default:throw Error(r(329))}if((l&62914560)===l&&(y=Ih+300-ne(),10<y)){if(Ll(h,l,Mi,!Dl),tt(h,0,!0)!==0)break e;js=l,h.timeoutHandle=kE(eE.bind(null,h,c,hi,Ph,Tv,l,Mi,ja,Vu,Dl,x,"Throttled",-0,0),y);break e}eE(h,c,hi,Ph,Tv,l,Mi,ja,Vu,Dl,x,null,-0,0)}}break}while(!0);Yo(o)}function eE(o,l,c,h,y,x,k,B,K,se,he,be,ae,ce){if(o.timeoutHandle=-1,be=l.subtreeFlags,be&8192||(be&16785408)===16785408){be={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:jr},GR(l,x,be);var qe=(x&62914560)===x?Ih-ne():(x&4194048)===x?XR-ne():0;if(qe=lH(be,qe),qe!==null){js=x,o.cancelPendingCommit=qe(aE.bind(null,o,l,x,c,h,y,k,B,K,he,be,null,ae,ce)),Ll(o,x,k,!se);return}}aE(o,l,x,c,h,y,k,B,K)}function C_(o){for(var l=o;;){var c=l.tag;if((c===0||c===11||c===15)&&l.flags&16384&&(c=l.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var h=0;h<c.length;h++){var y=c[h],x=y.getSnapshot;y=y.value;try{if(!Ci(x(),y))return!1}catch{return!1}}if(c=l.child,l.subtreeFlags&16384&&c!==null)c.return=l,l=c;else{if(l===o)break;for(;l.sibling===null;){if(l.return===null||l.return===o)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function Ll(o,l,c,h){l&=~Ev,l&=~ja,o.suspendedLanes|=l,o.pingedLanes&=~l,h&&(o.warmLanes|=l),h=o.expirationTimes;for(var y=l;0<y;){var x=31-at(y),k=1<<x;h[x]=-1,y&=~k}c!==0&&Br(o,c,l)}function zh(){return(tn&6)===0?(pf(0),!1):!0}function kv(){if(Nt!==null){if(an===0)var o=Nt.return;else o=Nt,Os=Ia=null,Gy(o),Pu=null,Xc=0,o=Nt;for(;o!==null;)IR(o.alternate,o),o=o.return;Nt=null}}function Uu(o,l){var c=o.timeoutHandle;c!==-1&&(o.timeoutHandle=-1,U_(c)),c=o.cancelPendingCommit,c!==null&&(o.cancelPendingCommit=null,c()),js=0,kv(),Sn=o,Nt=c=As(o.current,null),_t=l,an=0,Ai=null,Dl=!1,ju=Zt(o,l),Rv=!1,Vu=Mi=Ev=ja=Pl=Wn=0,hi=hf=null,Tv=!1,(l&8)!==0&&(l|=l&32);var h=o.entangledLanes;if(h!==0)for(o=o.entanglements,h&=l;0<h;){var y=31-at(h),x=1<<y;l|=o[y],h&=~x}return Hs=l,th(),c}function tE(o,l){vt=null,j.H=of,l===Du||l===uh?(l=yC(),an=3):l===zy?(l=yC(),an=4):an=l===av?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,Ai=l,Nt===null&&(Wn=1,Ch(o,Fi(l,o.current)))}function nE(){var o=Ei.current;return o===null?!0:(_t&4194048)===_t?Gi===null:(_t&62914560)===_t||(_t&536870912)!==0?o===Gi:!1}function rE(){var o=j.H;return j.H=of,o===null?of:o}function iE(){var o=j.A;return j.A=S_,o}function Nh(){Wn=4,Dl||(_t&4194048)!==_t&&Ei.current!==null||(ju=!0),(Pl&134217727)===0&&(ja&134217727)===0||Sn===null||Ll(Sn,_t,Mi,!1)}function Iv(o,l,c){var h=tn;tn|=2;var y=rE(),x=iE();(Sn!==o||_t!==l)&&(Ph=null,Uu(o,l)),l=!1;var k=Wn;e:do try{if(an!==0&&Nt!==null){var B=Nt,K=Ai;switch(an){case 8:kv(),k=6;break e;case 3:case 2:case 9:case 6:Ei.current===null&&(l=!0);var se=an;if(an=0,Ai=null,$u(o,B,K,se),c&&ju){k=0;break e}break;default:se=an,an=0,Ai=null,$u(o,B,K,se)}}R_(),k=Wn;break}catch(he){tE(o,he)}while(!0);return l&&o.shellSuspendCounter++,Os=Ia=null,tn=h,j.H=y,j.A=x,Nt===null&&(Sn=null,_t=0,th()),k}function R_(){for(;Nt!==null;)oE(Nt)}function E_(o,l){var c=tn;tn|=2;var h=rE(),y=iE();Sn!==o||_t!==l?(Ph=null,Dh=ne()+500,Uu(o,l)):ju=Zt(o,l);e:do try{if(an!==0&&Nt!==null){l=Nt;var x=Ai;t:switch(an){case 1:an=0,Ai=null,$u(o,l,x,1);break;case 2:case 9:if(pC(x)){an=0,Ai=null,sE(l);break}l=function(){an!==2&&an!==9||Sn!==o||(an=7),Yo(o)},x.then(l,l);break e;case 3:an=7;break e;case 4:an=5;break e;case 7:pC(x)?(an=0,Ai=null,sE(l)):(an=0,Ai=null,$u(o,l,x,7));break;case 5:var k=null;switch(Nt.tag){case 26:k=Nt.memoizedState;case 5:case 27:var B=Nt;if(k?qE(k):B.stateNode.complete){an=0,Ai=null;var K=B.sibling;if(K!==null)Nt=K;else{var se=B.return;se!==null?(Nt=se,Lh(se)):Nt=null}break t}}an=0,Ai=null,$u(o,l,x,5);break;case 6:an=0,Ai=null,$u(o,l,x,6);break;case 8:kv(),Wn=6;break e;default:throw Error(r(462))}}T_();break}catch(he){tE(o,he)}while(!0);return Os=Ia=null,j.H=h,j.A=y,tn=c,Nt!==null?0:(Sn=null,_t=0,th(),Wn)}function T_(){for(;Nt!==null&&!We();)oE(Nt)}function oE(o){var l=OR(o.alternate,o,Hs);o.memoizedProps=o.pendingProps,l===null?Lh(o):Nt=l}function sE(o){var l=o,c=l.alternate;switch(l.tag){case 15:case 0:l=CR(c,l,l.pendingProps,l.type,void 0,_t);break;case 11:l=CR(c,l,l.pendingProps,l.type.render,l.ref,_t);break;case 5:Gy(l);default:IR(c,l),l=Nt=iC(l,Hs),l=OR(c,l,Hs)}o.memoizedProps=o.pendingProps,l===null?Lh(o):Nt=l}function $u(o,l,c,h){Os=Ia=null,Gy(l),Pu=null,Xc=0;var y=l.return;try{if(g_(o,y,l,c,_t)){Wn=1,Ch(o,Fi(c,o.current)),Nt=null;return}}catch(x){if(y!==null)throw Nt=y,x;Wn=1,Ch(o,Fi(c,o.current)),Nt=null;return}l.flags&32768?(jt||h===1?o=!0:ju||(_t&536870912)!==0?o=!1:(Dl=o=!0,(h===2||h===9||h===3||h===6)&&(h=Ei.current,h!==null&&h.tag===13&&(h.flags|=16384))),lE(l,o)):Lh(l)}function Lh(o){var l=o;do{if((l.flags&32768)!==0){lE(l,Dl);return}o=l.return;var c=y_(l.alternate,l,Hs);if(c!==null){Nt=c;return}if(l=l.sibling,l!==null){Nt=l;return}Nt=l=o}while(l!==null);Wn===0&&(Wn=5)}function lE(o,l){do{var c=v_(o.alternate,o);if(c!==null){c.flags&=32767,Nt=c;return}if(c=o.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!l&&(o=o.sibling,o!==null)){Nt=o;return}Nt=o=c}while(o!==null);Wn=6,Nt=null}function aE(o,l,c,h,y,x,k,B,K){o.cancelPendingCommit=null;do Bh();while(gr!==0);if((tn&6)!==0)throw Error(r(327));if(l!==null){if(l===o.current)throw Error(r(177));if(x=l.lanes|l.childLanes,x|=by,Dt(o,c,x,k,B,K),o===Sn&&(Nt=Sn=null,_t=0),Fu=l,Nl=o,js=c,Av=x,Mv=y,QR=h,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(o.callbackNode=null,o.callbackPriority=0,k_(De,function(){return hE(),null})):(o.callbackNode=null,o.callbackPriority=0),h=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||h){h=j.T,j.T=null,y=q.p,q.p=2,k=tn,tn|=4;try{b_(o,l,c)}finally{tn=k,q.p=y,j.T=h}}gr=1,uE(),cE(),fE()}}function uE(){if(gr===1){gr=0;var o=Nl,l=Fu,c=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||c){c=j.T,j.T=null;var h=q.p;q.p=2;var y=tn;tn|=4;try{UR(l,o);var x=Uv,k=Y1(o.containerInfo),B=x.focusedElem,K=x.selectionRange;if(k!==B&&B&&B.ownerDocument&&K1(B.ownerDocument.documentElement,B)){if(K!==null&&gy(B)){var se=K.start,he=K.end;if(he===void 0&&(he=se),"selectionStart"in B)B.selectionStart=se,B.selectionEnd=Math.min(he,B.value.length);else{var be=B.ownerDocument||document,ae=be&&be.defaultView||window;if(ae.getSelection){var ce=ae.getSelection(),qe=B.textContent.length,lt=Math.min(K.start,qe),pn=K.end===void 0?lt:Math.min(K.end,qe);!ce.extend&&lt>pn&&(k=pn,pn=lt,lt=k);var re=W1(B,lt),Z=W1(B,pn);if(re&&Z&&(ce.rangeCount!==1||ce.anchorNode!==re.node||ce.anchorOffset!==re.offset||ce.focusNode!==Z.node||ce.focusOffset!==Z.offset)){var oe=be.createRange();oe.setStart(re.node,re.offset),ce.removeAllRanges(),lt>pn?(ce.addRange(oe),ce.extend(Z.node,Z.offset)):(oe.setEnd(Z.node,Z.offset),ce.addRange(oe))}}}}for(be=[],ce=B;ce=ce.parentNode;)ce.nodeType===1&&be.push({element:ce,left:ce.scrollLeft,top:ce.scrollTop});for(typeof B.focus=="function"&&B.focus(),B=0;B<be.length;B++){var ye=be[B];ye.element.scrollLeft=ye.left,ye.element.scrollTop=ye.top}}Yh=!!Fv,Uv=Fv=null}finally{tn=y,q.p=h,j.T=c}}o.current=l,gr=2}}function cE(){if(gr===2){gr=0;var o=Nl,l=Fu,c=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||c){c=j.T,j.T=null;var h=q.p;q.p=2;var y=tn;tn|=4;try{_R(o,l.alternate,l)}finally{tn=y,q.p=h,j.T=c}}gr=3}}function fE(){if(gr===4||gr===3){gr=0,fe();var o=Nl,l=Fu,c=js,h=QR;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?gr=5:(gr=0,Fu=Nl=null,dE(o,o.pendingLanes));var y=o.pendingLanes;if(y===0&&(zl=null),$n(c),l=l.stateNode,It&&typeof It.onCommitFiberRoot=="function")try{It.onCommitFiberRoot(kt,l,void 0,(l.current.flags&128)===128)}catch{}if(h!==null){l=j.T,y=q.p,q.p=2,j.T=null;try{for(var x=o.onRecoverableError,k=0;k<h.length;k++){var B=h[k];x(B.value,{componentStack:B.stack})}}finally{j.T=l,q.p=y}}(js&3)!==0&&Bh(),Yo(o),y=o.pendingLanes,(c&261930)!==0&&(y&42)!==0?o===Ov?gf++:(gf=0,Ov=o):gf=0,pf(0)}}function dE(o,l){(o.pooledCacheLanes&=l)===0&&(l=o.pooledCache,l!=null&&(o.pooledCache=null,Kc(l)))}function Bh(){return uE(),cE(),fE(),hE()}function hE(){if(gr!==5)return!1;var o=Nl,l=Av;Av=0;var c=$n(js),h=j.T,y=q.p;try{q.p=32>c?32:c,j.T=null,c=Mv,Mv=null;var x=Nl,k=js;if(gr=0,Fu=Nl=null,js=0,(tn&6)!==0)throw Error(r(331));var B=tn;if(tn|=4,KR(x.current),qR(x,x.current,k,c),tn=B,pf(0,!1),It&&typeof It.onPostCommitFiberRoot=="function")try{It.onPostCommitFiberRoot(kt,x)}catch{}return!0}finally{q.p=y,j.T=h,dE(o,l)}}function gE(o,l,c){l=Fi(c,l),l=lv(o.stateNode,l,2),o=Ml(o,l,2),o!==null&&(Rn(o,2),Yo(o))}function un(o,l,c){if(o.tag===3)gE(o,o,c);else for(;l!==null;){if(l.tag===3){gE(l,o,c);break}else if(l.tag===1){var h=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(zl===null||!zl.has(h))){o=Fi(c,o),c=pR(2),h=Ml(l,c,2),h!==null&&(mR(c,h,l,o),Rn(h,2),Yo(h));break}}l=l.return}}function Dv(o,l,c){var h=o.pingCache;if(h===null){h=o.pingCache=new w_;var y=new Set;h.set(l,y)}else y=h.get(l),y===void 0&&(y=new Set,h.set(l,y));y.has(c)||(Rv=!0,y.add(c),o=A_.bind(null,o,l,c),l.then(o,o))}function A_(o,l,c){var h=o.pingCache;h!==null&&h.delete(l),o.pingedLanes|=o.suspendedLanes&c,o.warmLanes&=~c,Sn===o&&(_t&c)===c&&(Wn===4||Wn===3&&(_t&62914560)===_t&&300>ne()-Ih?(tn&2)===0&&Uu(o,0):Ev|=c,Vu===_t&&(Vu=0)),Yo(o)}function pE(o,l){l===0&&(l=jn()),o=Ma(o,l),o!==null&&(Rn(o,l),Yo(o))}function M_(o){var l=o.memoizedState,c=0;l!==null&&(c=l.retryLane),pE(o,c)}function O_(o,l){var c=0;switch(o.tag){case 31:case 13:var h=o.stateNode,y=o.memoizedState;y!==null&&(c=y.retryLane);break;case 19:h=o.stateNode;break;case 22:h=o.stateNode._retryCache;break;default:throw Error(r(314))}h!==null&&h.delete(l),pE(o,c)}function k_(o,l){return He(o,l)}var _h=null,qu=null,Pv=!1,Hh=!1,zv=!1,Bl=0;function Yo(o){o!==qu&&o.next===null&&(qu===null?_h=qu=o:qu=qu.next=o),Hh=!0,Pv||(Pv=!0,D_())}function pf(o,l){if(!zv&&Hh){zv=!0;do for(var c=!1,h=_h;h!==null;){if(o!==0){var y=h.pendingLanes;if(y===0)var x=0;else{var k=h.suspendedLanes,B=h.pingedLanes;x=(1<<31-at(42|o)+1)-1,x&=y&~(k&~B),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(c=!0,bE(h,x))}else x=_t,x=tt(h,h===Sn?x:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(x&3)===0||Zt(h,x)||(c=!0,bE(h,x));h=h.next}while(c);zv=!1}}function I_(){mE()}function mE(){Hh=Pv=!1;var o=0;Bl!==0&&F_()&&(o=Bl);for(var l=ne(),c=null,h=_h;h!==null;){var y=h.next,x=yE(h,l);x===0?(h.next=null,c===null?_h=y:c.next=y,y===null&&(qu=c)):(c=h,(o!==0||(x&3)!==0)&&(Hh=!0)),h=y}gr!==0&&gr!==5||pf(o),Bl!==0&&(Bl=0)}function yE(o,l){for(var c=o.suspendedLanes,h=o.pingedLanes,y=o.expirationTimes,x=o.pendingLanes&-62914561;0<x;){var k=31-at(x),B=1<<k,K=y[k];K===-1?((B&c)===0||(B&h)!==0)&&(y[k]=Hn(B,l)):K<=l&&(o.expiredLanes|=B),x&=~B}if(l=Sn,c=_t,c=tt(o,o===l?c:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),h=o.callbackNode,c===0||o===l&&(an===2||an===9)||o.cancelPendingCommit!==null)return h!==null&&h!==null&&Ge(h),o.callbackNode=null,o.callbackPriority=0;if((c&3)===0||Zt(o,c)){if(l=c&-c,l===o.callbackPriority)return l;switch(h!==null&&Ge(h),$n(c)){case 2:case 8:c=ge;break;case 32:c=De;break;case 268435456:c=_e;break;default:c=De}return h=vE.bind(null,o),c=He(c,h),o.callbackPriority=l,o.callbackNode=c,l}return h!==null&&h!==null&&Ge(h),o.callbackPriority=2,o.callbackNode=null,2}function vE(o,l){if(gr!==0&&gr!==5)return o.callbackNode=null,o.callbackPriority=0,null;var c=o.callbackNode;if(Bh()&&o.callbackNode!==c)return null;var h=_t;return h=tt(o,o===Sn?h:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),h===0?null:(JR(o,h,l),yE(o,ne()),o.callbackNode!=null&&o.callbackNode===c?vE.bind(null,o):null)}function bE(o,l){if(Bh())return null;JR(o,l,!0)}function D_(){$_(function(){(tn&6)!==0?He(Se,I_):mE()})}function Nv(){if(Bl===0){var o=ku;o===0&&(o=nn,nn<<=1,(nn&261888)===0&&(nn=256)),Bl=o}return Bl}function xE(o){return o==null||typeof o=="symbol"||typeof o=="boolean"?null:typeof o=="function"?o:vo(""+o)}function SE(o,l){var c=l.ownerDocument.createElement("input");return c.name=l.name,c.value=l.value,o.id&&c.setAttribute("form",o.id),l.parentNode.insertBefore(c,l),o=new FormData(o),c.parentNode.removeChild(c),o}function P_(o,l,c,h,y){if(l==="submit"&&c&&c.stateNode===y){var x=xE((y[zt]||null).action),k=h.submitter;k&&(l=(l=k[zt]||null)?xE(l.formAction):k.getAttribute("formAction"),l!==null&&(x=l,k=null));var B=new xu("action","action",null,h,y);o.push({event:B,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if(Bl!==0){var K=k?SE(y,k):new FormData(y);tv(c,{pending:!0,data:K,method:y.method,action:x},null,K)}}else typeof x=="function"&&(B.preventDefault(),K=k?SE(y,k):new FormData(y),tv(c,{pending:!0,data:K,method:y.method,action:x},x,K))},currentTarget:y}]})}}for(var Lv=0;Lv<vy.length;Lv++){var Bv=vy[Lv],z_=Bv.toLowerCase(),N_=Bv[0].toUpperCase()+Bv.slice(1);So(z_,"on"+N_)}So(Z1,"onAnimationEnd"),So(J1,"onAnimationIteration"),So(eC,"onAnimationStart"),So("dblclick","onDoubleClick"),So("focusin","onFocus"),So("focusout","onBlur"),So(QB,"onTransitionRun"),So(ZB,"onTransitionStart"),So(JB,"onTransitionCancel"),So(tC,"onTransitionEnd"),mo("onMouseEnter",["mouseout","mouseover"]),mo("onMouseLeave",["mouseout","mouseover"]),mo("onPointerEnter",["pointerout","pointerover"]),mo("onPointerLeave",["pointerout","pointerover"]),_i("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),_i("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),_i("onBeforeInput",["compositionend","keypress","textInput","paste"]),_i("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),_i("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),_i("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var mf="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(" "),L_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(mf));function wE(o,l){l=(l&4)!==0;for(var c=0;c<o.length;c++){var h=o[c],y=h.event;h=h.listeners;e:{var x=void 0;if(l)for(var k=h.length-1;0<=k;k--){var B=h[k],K=B.instance,se=B.currentTarget;if(B=B.listener,K!==x&&y.isPropagationStopped())break e;x=B,y.currentTarget=se;try{x(y)}catch(he){eh(he)}y.currentTarget=null,x=K}else for(k=0;k<h.length;k++){if(B=h[k],K=B.instance,se=B.currentTarget,B=B.listener,K!==x&&y.isPropagationStopped())break e;x=B,y.currentTarget=se;try{x(y)}catch(he){eh(he)}y.currentTarget=null,x=K}}}}function Lt(o,l){var c=l[Cr];c===void 0&&(c=l[Cr]=new Set);var h=o+"__bubble";c.has(h)||(CE(l,o,2,!1),c.add(h))}function _v(o,l,c){var h=0;l&&(h|=4),CE(c,o,h,l)}var jh="_reactListening"+Math.random().toString(36).slice(2);function Hv(o){if(!o[jh]){o[jh]=!0,sr.forEach(function(c){c!=="selectionchange"&&(L_.has(c)||_v(c,!1,o),_v(c,!0,o))});var l=o.nodeType===9?o:o.ownerDocument;l===null||l[jh]||(l[jh]=!0,_v("selectionchange",!1,l))}}function CE(o,l,c,h){switch(ZE(l)){case 2:var y=cH;break;case 8:y=fH;break;default:y=e0}c=y.bind(null,l,c,o),y=void 0,!$t||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(y=!0),h?y!==void 0?o.addEventListener(l,c,{capture:!0,passive:y}):o.addEventListener(l,c,!0):y!==void 0?o.addEventListener(l,c,{passive:y}):o.addEventListener(l,c,!1)}function jv(o,l,c,h,y){var x=h;if((l&1)===0&&(l&2)===0&&h!==null)e:for(;;){if(h===null)return;var k=h.tag;if(k===3||k===4){var B=h.stateNode.containerInfo;if(B===y)break;if(k===4)for(k=h.return;k!==null;){var K=k.tag;if((K===3||K===4)&&k.stateNode.containerInfo===y)return;k=k.return}for(;B!==null;){if(k=Zn(B),k===null)return;if(K=k.tag,K===5||K===6||K===26||K===27){h=x=k;continue e}B=B.parentNode}}h=h.return}xl(function(){var se=x,he=vl(c),be=[];e:{var ae=nC.get(o);if(ae!==void 0){var ce=xu,qe=o;switch(o){case"keypress":if(Vr(c)===0)break e;case"keydown":case"keyup":ce=OB;break;case"focusin":qe="focus",ce=uy;break;case"focusout":qe="blur",ce=uy;break;case"beforeblur":case"afterblur":ce=uy;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ce=I1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ce=yB;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ce=DB;break;case Z1:case J1:case eC:ce=xB;break;case tC:ce=zB;break;case"scroll":case"scrollend":ce=pB;break;case"wheel":ce=LB;break;case"copy":case"cut":case"paste":ce=wB;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ce=P1;break;case"toggle":case"beforetoggle":ce=_B}var lt=(l&4)!==0,pn=!lt&&(o==="scroll"||o==="scrollend"),re=lt?ae!==null?ae+"Capture":null:ae;lt=[];for(var Z=se,oe;Z!==null;){var ye=Z;if(oe=ye.stateNode,ye=ye.tag,ye!==5&&ye!==26&&ye!==27||oe===null||re===null||(ye=ke(Z,re),ye!=null&&lt.push(yf(Z,ye,oe))),pn)break;Z=Z.return}0<lt.length&&(ae=new ce(ae,qe,null,c,he),be.push({event:ae,listeners:lt}))}}if((l&7)===0){e:{if(ae=o==="mouseover"||o==="pointerover",ce=o==="mouseout"||o==="pointerout",ae&&c!==yl&&(qe=c.relatedTarget||c.fromElement)&&(Zn(qe)||qe[Je]))break e;if((ce||ae)&&(ae=he.window===he?he:(ae=he.ownerDocument)?ae.defaultView||ae.parentWindow:window,ce?(qe=c.relatedTarget||c.toElement,ce=se,qe=qe?Zn(qe):null,qe!==null&&(pn=s(qe),lt=qe.tag,qe!==pn||lt!==5&&lt!==27&&lt!==6)&&(qe=null)):(ce=null,qe=se),ce!==qe)){if(lt=I1,ye="onMouseLeave",re="onMouseEnter",Z="mouse",(o==="pointerout"||o==="pointerover")&&(lt=P1,ye="onPointerLeave",re="onPointerEnter",Z="pointer"),pn=ce==null?ae:li(ce),oe=qe==null?ae:li(qe),ae=new lt(ye,Z+"leave",ce,c,he),ae.target=pn,ae.relatedTarget=oe,ye=null,Zn(he)===se&&(lt=new lt(re,Z+"enter",qe,c,he),lt.target=oe,lt.relatedTarget=pn,ye=lt),pn=ye,ce&&qe)t:{for(lt=B_,re=ce,Z=qe,oe=0,ye=re;ye;ye=lt(ye))oe++;ye=0;for(var it=Z;it;it=lt(it))ye++;for(;0<oe-ye;)re=lt(re),oe--;for(;0<ye-oe;)Z=lt(Z),ye--;for(;oe--;){if(re===Z||Z!==null&&re===Z.alternate){lt=re;break t}re=lt(re),Z=lt(Z)}lt=null}else lt=null;ce!==null&&RE(be,ae,ce,lt,!1),qe!==null&&pn!==null&&RE(be,pn,qe,lt,!0)}}e:{if(ae=se?li(se):window,ce=ae.nodeName&&ae.nodeName.toLowerCase(),ce==="select"||ce==="input"&&ae.type==="file")var Kt=V1;else if(H1(ae))if(F1)Kt=KB;else{Kt=GB;var Ze=qB}else ce=ae.nodeName,!ce||ce.toLowerCase()!=="input"||ae.type!=="checkbox"&&ae.type!=="radio"?se&&Si(se.elementType)&&(Kt=V1):Kt=WB;if(Kt&&(Kt=Kt(o,se))){j1(be,Kt,c,he);break e}Ze&&Ze(o,ae,se),o==="focusout"&&se&&ae.type==="number"&&se.memoizedProps.value!=null&&Rs(ae,"number",ae.value)}switch(Ze=se?li(se):window,o){case"focusin":(H1(Ze)||Ze.contentEditable==="true")&&(wu=Ze,py=se,qc=null);break;case"focusout":qc=py=wu=null;break;case"mousedown":my=!0;break;case"contextmenu":case"mouseup":case"dragend":my=!1,X1(be,c,he);break;case"selectionchange":if(XB)break;case"keydown":case"keyup":X1(be,c,he)}var xt;if(fy)e:{switch(o){case"compositionstart":var Ht="onCompositionStart";break e;case"compositionend":Ht="onCompositionEnd";break e;case"compositionupdate":Ht="onCompositionUpdate";break e}Ht=void 0}else Su?B1(o,c)&&(Ht="onCompositionEnd"):o==="keydown"&&c.keyCode===229&&(Ht="onCompositionStart");Ht&&(z1&&c.locale!=="ko"&&(Su||Ht!=="onCompositionStart"?Ht==="onCompositionEnd"&&Su&&(xt=Tr()):(en=he,Jn="value"in en?en.value:en.textContent,Su=!0)),Ze=Vh(se,Ht),0<Ze.length&&(Ht=new D1(Ht,o,null,c,he),be.push({event:Ht,listeners:Ze}),xt?Ht.data=xt:(xt=_1(c),xt!==null&&(Ht.data=xt)))),(xt=jB?VB(o,c):FB(o,c))&&(Ht=Vh(se,"onBeforeInput"),0<Ht.length&&(Ze=new D1("onBeforeInput","beforeinput",null,c,he),be.push({event:Ze,listeners:Ht}),Ze.data=xt)),P_(be,o,se,c,he)}wE(be,l)})}function yf(o,l,c){return{instance:o,listener:l,currentTarget:c}}function Vh(o,l){for(var c=l+"Capture",h=[];o!==null;){var y=o,x=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||x===null||(y=ke(o,c),y!=null&&h.unshift(yf(o,y,x)),y=ke(o,l),y!=null&&h.push(yf(o,y,x))),o.tag===3)return h;o=o.return}return[]}function B_(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5&&o.tag!==27);return o||null}function RE(o,l,c,h,y){for(var x=l._reactName,k=[];c!==null&&c!==h;){var B=c,K=B.alternate,se=B.stateNode;if(B=B.tag,K!==null&&K===h)break;B!==5&&B!==26&&B!==27||se===null||(K=se,y?(se=ke(c,x),se!=null&&k.unshift(yf(c,se,K))):y||(se=ke(c,x),se!=null&&k.push(yf(c,se,K)))),c=c.return}k.length!==0&&o.push({event:l,listeners:k})}var __=/\r\n?/g,H_=/\u0000|\uFFFD/g;function EE(o){return(typeof o=="string"?o:""+o).replace(__,`
12
- `).replace(H_,"")}function TE(o,l){return l=EE(l),EE(o)===l}function gn(o,l,c,h,y,x){switch(c){case"children":typeof h=="string"?l==="body"||l==="textarea"&&h===""||ji(o,h):(typeof h=="number"||typeof h=="bigint")&&l!=="body"&&ji(o,""+h);break;case"className":ws(o,"class",h);break;case"tabIndex":ws(o,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":ws(o,c,h);break;case"style":$o(o,h,x);break;case"data":if(l!=="object"){ws(o,"data",h);break}case"src":case"href":if(h===""&&(l!=="a"||c!=="href")){o.removeAttribute(c);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){o.removeAttribute(c);break}h=vo(""+h),o.setAttribute(c,h);break;case"action":case"formAction":if(typeof h=="function"){o.setAttribute(c,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof x=="function"&&(c==="formAction"?(l!=="input"&&gn(o,l,"name",y.name,y,null),gn(o,l,"formEncType",y.formEncType,y,null),gn(o,l,"formMethod",y.formMethod,y,null),gn(o,l,"formTarget",y.formTarget,y,null)):(gn(o,l,"encType",y.encType,y,null),gn(o,l,"method",y.method,y,null),gn(o,l,"target",y.target,y,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){o.removeAttribute(c);break}h=vo(""+h),o.setAttribute(c,h);break;case"onClick":h!=null&&(o.onclick=jr);break;case"onScroll":h!=null&&Lt("scroll",o);break;case"onScrollEnd":h!=null&&Lt("scrollend",o);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(c=h.__html,c!=null){if(y.children!=null)throw Error(r(60));o.innerHTML=c}}break;case"multiple":o.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":o.muted=h&&typeof h!="function"&&typeof h!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(h==null||typeof h=="function"||typeof h=="boolean"||typeof h=="symbol"){o.removeAttribute("xlink:href");break}c=vo(""+h),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":h!=null&&typeof h!="function"&&typeof h!="symbol"?o.setAttribute(c,""+h):o.removeAttribute(c);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":h&&typeof h!="function"&&typeof h!="symbol"?o.setAttribute(c,""):o.removeAttribute(c);break;case"capture":case"download":h===!0?o.setAttribute(c,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?o.setAttribute(c,h):o.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?o.setAttribute(c,h):o.removeAttribute(c);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?o.removeAttribute(c):o.setAttribute(c,h);break;case"popover":Lt("beforetoggle",o),Lt("toggle",o),yo(o,"popover",h);break;case"xlinkActuate":Zr(o,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":Zr(o,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":Zr(o,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":Zr(o,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":Zr(o,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":Zr(o,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":Zr(o,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":Zr(o,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":Zr(o,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":yo(o,"is",h);break;case"innerText":case"textContent":break;default:(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(c=pl.get(c)||c,yo(o,c,h))}}function Vv(o,l,c,h,y,x){switch(c){case"style":$o(o,h,x);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(c=h.__html,c!=null){if(y.children!=null)throw Error(r(60));o.innerHTML=c}}break;case"children":typeof h=="string"?ji(o,h):(typeof h=="number"||typeof h=="bigint")&&ji(o,""+h);break;case"onScroll":h!=null&&Lt("scroll",o);break;case"onScrollEnd":h!=null&&Lt("scrollend",o);break;case"onClick":h!=null&&(o.onclick=jr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!_r.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(y=c.endsWith("Capture"),l=c.slice(2,y?c.length-7:void 0),x=o[zt]||null,x=x!=null?x[c]:null,typeof x=="function"&&o.removeEventListener(l,x,y),typeof h=="function")){typeof x!="function"&&x!==null&&(c in o?o[c]=null:o.hasAttribute(c)&&o.removeAttribute(c)),o.addEventListener(l,h,y);break e}c in o?o[c]=h:h===!0?o.setAttribute(c,""):yo(o,c,h)}}}function kr(o,l,c){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Lt("error",o),Lt("load",o);var h=!1,y=!1,x;for(x in c)if(c.hasOwnProperty(x)){var k=c[x];if(k!=null)switch(x){case"src":h=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:gn(o,l,x,k,c,null)}}y&&gn(o,l,"srcSet",c.srcSet,c,null),h&&gn(o,l,"src",c.src,c,null);return;case"input":Lt("invalid",o);var B=x=k=y=null,K=null,se=null;for(h in c)if(c.hasOwnProperty(h)){var he=c[h];if(he!=null)switch(h){case"name":y=he;break;case"type":k=he;break;case"checked":K=he;break;case"defaultChecked":se=he;break;case"value":x=he;break;case"defaultValue":B=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(r(137,l));break;default:gn(o,l,h,he,c,null)}}Ea(o,x,B,K,se,k,y,!1);return;case"select":Lt("invalid",o),h=k=x=null;for(y in c)if(c.hasOwnProperty(y)&&(B=c[y],B!=null))switch(y){case"value":x=B;break;case"defaultValue":k=B;break;case"multiple":h=B;default:gn(o,l,y,B,c,null)}l=x,c=k,o.multiple=!!h,l!=null?ui(o,!!h,l,!1):c!=null&&ui(o,!!h,c,!0);return;case"textarea":Lt("invalid",o),x=y=h=null;for(k in c)if(c.hasOwnProperty(k)&&(B=c[k],B!=null))switch(k){case"value":h=B;break;case"defaultValue":y=B;break;case"children":x=B;break;case"dangerouslySetInnerHTML":if(B!=null)throw Error(r(91));break;default:gn(o,l,k,B,c,null)}Uo(o,h,y,x);return;case"option":for(K in c)c.hasOwnProperty(K)&&(h=c[K],h!=null)&&(K==="selected"?o.selected=h&&typeof h!="function"&&typeof h!="symbol":gn(o,l,K,h,c,null));return;case"dialog":Lt("beforetoggle",o),Lt("toggle",o),Lt("cancel",o),Lt("close",o);break;case"iframe":case"object":Lt("load",o);break;case"video":case"audio":for(h=0;h<mf.length;h++)Lt(mf[h],o);break;case"image":Lt("error",o),Lt("load",o);break;case"details":Lt("toggle",o);break;case"embed":case"source":case"link":Lt("error",o),Lt("load",o);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(se in c)if(c.hasOwnProperty(se)&&(h=c[se],h!=null))switch(se){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:gn(o,l,se,h,c,null)}return;default:if(Si(l)){for(he in c)c.hasOwnProperty(he)&&(h=c[he],h!==void 0&&Vv(o,l,he,h,c,void 0));return}}for(B in c)c.hasOwnProperty(B)&&(h=c[B],h!=null&&gn(o,l,B,h,c,null))}function j_(o,l,c,h){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,x=null,k=null,B=null,K=null,se=null,he=null;for(ce in c){var be=c[ce];if(c.hasOwnProperty(ce)&&be!=null)switch(ce){case"checked":break;case"value":break;case"defaultValue":K=be;default:h.hasOwnProperty(ce)||gn(o,l,ce,null,h,be)}}for(var ae in h){var ce=h[ae];if(be=c[ae],h.hasOwnProperty(ae)&&(ce!=null||be!=null))switch(ae){case"type":x=ce;break;case"name":y=ce;break;case"checked":se=ce;break;case"defaultChecked":he=ce;break;case"value":k=ce;break;case"defaultValue":B=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(r(137,l));break;default:ce!==be&&gn(o,l,ae,ce,h,be)}}dl(o,k,B,K,se,he,x,y);return;case"select":ce=k=B=ae=null;for(x in c)if(K=c[x],c.hasOwnProperty(x)&&K!=null)switch(x){case"value":break;case"multiple":ce=K;default:h.hasOwnProperty(x)||gn(o,l,x,null,h,K)}for(y in h)if(x=h[y],K=c[y],h.hasOwnProperty(y)&&(x!=null||K!=null))switch(y){case"value":ae=x;break;case"defaultValue":B=x;break;case"multiple":k=x;default:x!==K&&gn(o,l,y,x,h,K)}l=B,c=k,h=ce,ae!=null?ui(o,!!c,ae,!1):!!h!=!!c&&(l!=null?ui(o,!!c,l,!0):ui(o,!!c,c?[]:"",!1));return;case"textarea":ce=ae=null;for(B in c)if(y=c[B],c.hasOwnProperty(B)&&y!=null&&!h.hasOwnProperty(B))switch(B){case"value":break;case"children":break;default:gn(o,l,B,null,h,y)}for(k in h)if(y=h[k],x=c[k],h.hasOwnProperty(k)&&(y!=null||x!=null))switch(k){case"value":ae=y;break;case"defaultValue":ce=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(r(91));break;default:y!==x&&gn(o,l,k,y,h,x)}hl(o,ae,ce);return;case"option":for(var qe in c)ae=c[qe],c.hasOwnProperty(qe)&&ae!=null&&!h.hasOwnProperty(qe)&&(qe==="selected"?o.selected=!1:gn(o,l,qe,null,h,ae));for(K in h)ae=h[K],ce=c[K],h.hasOwnProperty(K)&&ae!==ce&&(ae!=null||ce!=null)&&(K==="selected"?o.selected=ae&&typeof ae!="function"&&typeof ae!="symbol":gn(o,l,K,ae,h,ce));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var lt in c)ae=c[lt],c.hasOwnProperty(lt)&&ae!=null&&!h.hasOwnProperty(lt)&&gn(o,l,lt,null,h,ae);for(se in h)if(ae=h[se],ce=c[se],h.hasOwnProperty(se)&&ae!==ce&&(ae!=null||ce!=null))switch(se){case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(r(137,l));break;default:gn(o,l,se,ae,h,ce)}return;default:if(Si(l)){for(var pn in c)ae=c[pn],c.hasOwnProperty(pn)&&ae!==void 0&&!h.hasOwnProperty(pn)&&Vv(o,l,pn,void 0,h,ae);for(he in h)ae=h[he],ce=c[he],!h.hasOwnProperty(he)||ae===ce||ae===void 0&&ce===void 0||Vv(o,l,he,ae,h,ce);return}}for(var re in c)ae=c[re],c.hasOwnProperty(re)&&ae!=null&&!h.hasOwnProperty(re)&&gn(o,l,re,null,h,ae);for(be in h)ae=h[be],ce=c[be],!h.hasOwnProperty(be)||ae===ce||ae==null&&ce==null||gn(o,l,be,ae,h,ce)}function AE(o){switch(o){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function V_(){if(typeof performance.getEntriesByType=="function"){for(var o=0,l=0,c=performance.getEntriesByType("resource"),h=0;h<c.length;h++){var y=c[h],x=y.transferSize,k=y.initiatorType,B=y.duration;if(x&&B&&AE(k)){for(k=0,B=y.responseEnd,h+=1;h<c.length;h++){var K=c[h],se=K.startTime;if(se>B)break;var he=K.transferSize,be=K.initiatorType;he&&AE(be)&&(K=K.responseEnd,k+=he*(K<B?1:(B-se)/(K-se)))}if(--h,l+=8*(x+k)/(y.duration/1e3),o++,10<o)break}}if(0<o)return l/o/1e6}return navigator.connection&&(o=navigator.connection.downlink,typeof o=="number")?o:5}var Fv=null,Uv=null;function Fh(o){return o.nodeType===9?o:o.ownerDocument}function ME(o){switch(o){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function OE(o,l){if(o===0)switch(l){case"svg":return 1;case"math":return 2;default:return 0}return o===1&&l==="foreignObject"?0:o}function $v(o,l){return o==="textarea"||o==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.children=="bigint"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var qv=null;function F_(){var o=window.event;return o&&o.type==="popstate"?o===qv?!1:(qv=o,!0):(qv=null,!1)}var kE=typeof setTimeout=="function"?setTimeout:void 0,U_=typeof clearTimeout=="function"?clearTimeout:void 0,IE=typeof Promise=="function"?Promise:void 0,$_=typeof queueMicrotask=="function"?queueMicrotask:typeof IE<"u"?function(o){return IE.resolve(null).then(o).catch(q_)}:kE;function q_(o){setTimeout(function(){throw o})}function _l(o){return o==="head"}function DE(o,l){var c=l,h=0;do{var y=c.nextSibling;if(o.removeChild(c),y&&y.nodeType===8)if(c=y.data,c==="/$"||c==="/&"){if(h===0){o.removeChild(y),Yu(l);return}h--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")h++;else if(c==="html")vf(o.ownerDocument.documentElement);else if(c==="head"){c=o.ownerDocument.head,vf(c);for(var x=c.firstChild;x;){var k=x.nextSibling,B=x.nodeName;x[Fe]||B==="SCRIPT"||B==="STYLE"||B==="LINK"&&x.rel.toLowerCase()==="stylesheet"||c.removeChild(x),x=k}}else c==="body"&&vf(o.ownerDocument.body);c=y}while(c);Yu(l)}function PE(o,l){var c=o;o=0;do{var h=c.nextSibling;if(c.nodeType===1?l?(c._stashedDisplay=c.style.display,c.style.display="none"):(c.style.display=c._stashedDisplay||"",c.getAttribute("style")===""&&c.removeAttribute("style")):c.nodeType===3&&(l?(c._stashedText=c.nodeValue,c.nodeValue=""):c.nodeValue=c._stashedText||""),h&&h.nodeType===8)if(c=h.data,c==="/$"){if(o===0)break;o--}else c!=="$"&&c!=="$?"&&c!=="$~"&&c!=="$!"||o++;c=h}while(c)}function Gv(o){var l=o.firstChild;for(l&&l.nodeType===10&&(l=l.nextSibling);l;){var c=l;switch(l=l.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":Gv(c),Sa(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}o.removeChild(c)}}function G_(o,l,c,h){for(;o.nodeType===1;){var y=c;if(o.nodeName.toLowerCase()!==l.toLowerCase()){if(!h&&(o.nodeName!=="INPUT"||o.type!=="hidden"))break}else if(h){if(!o[Fe])switch(l){case"meta":if(!o.hasAttribute("itemprop"))break;return o;case"link":if(x=o.getAttribute("rel"),x==="stylesheet"&&o.hasAttribute("data-precedence"))break;if(x!==y.rel||o.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||o.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||o.getAttribute("title")!==(y.title==null?null:y.title))break;return o;case"style":if(o.hasAttribute("data-precedence"))break;return o;case"script":if(x=o.getAttribute("src"),(x!==(y.src==null?null:y.src)||o.getAttribute("type")!==(y.type==null?null:y.type)||o.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&x&&o.hasAttribute("async")&&!o.hasAttribute("itemprop"))break;return o;default:return o}}else if(l==="input"&&o.type==="hidden"){var x=y.name==null?null:""+y.name;if(y.type==="hidden"&&o.getAttribute("name")===x)return o}else return o;if(o=Wi(o.nextSibling),o===null)break}return null}function W_(o,l,c){if(l==="")return null;for(;o.nodeType!==3;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!c||(o=Wi(o.nextSibling),o===null))return null;return o}function zE(o,l){for(;o.nodeType!==8;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!l||(o=Wi(o.nextSibling),o===null))return null;return o}function Wv(o){return o.data==="$?"||o.data==="$~"}function Kv(o){return o.data==="$!"||o.data==="$?"&&o.ownerDocument.readyState!=="loading"}function K_(o,l){var c=o.ownerDocument;if(o.data==="$~")o._reactRetry=l;else if(o.data!=="$?"||c.readyState!=="loading")l();else{var h=function(){l(),c.removeEventListener("DOMContentLoaded",h)};c.addEventListener("DOMContentLoaded",h),o._reactRetry=h}}function Wi(o){for(;o!=null;o=o.nextSibling){var l=o.nodeType;if(l===1||l===3)break;if(l===8){if(l=o.data,l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"||l==="F!"||l==="F")break;if(l==="/$"||l==="/&")return null}}return o}var Yv=null;function NE(o){o=o.nextSibling;for(var l=0;o;){if(o.nodeType===8){var c=o.data;if(c==="/$"||c==="/&"){if(l===0)return Wi(o.nextSibling);l--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||l++}o=o.nextSibling}return null}function LE(o){o=o.previousSibling;for(var l=0;o;){if(o.nodeType===8){var c=o.data;if(c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"){if(l===0)return o;l--}else c!=="/$"&&c!=="/&"||l++}o=o.previousSibling}return null}function BE(o,l,c){switch(l=Fh(c),o){case"html":if(o=l.documentElement,!o)throw Error(r(452));return o;case"head":if(o=l.head,!o)throw Error(r(453));return o;case"body":if(o=l.body,!o)throw Error(r(454));return o;default:throw Error(r(451))}}function vf(o){for(var l=o.attributes;l.length;)o.removeAttributeNode(l[0]);Sa(o)}var Ki=new Map,_E=new Set;function Uh(o){return typeof o.getRootNode=="function"?o.getRootNode():o.nodeType===9?o:o.ownerDocument}var Vs=q.d;q.d={f:Y_,r:X_,D:Q_,C:Z_,L:J_,m:eH,X:nH,S:tH,M:rH};function Y_(){var o=Vs.f(),l=zh();return o||l}function X_(o){var l=Bi(o);l!==null&&l.tag===5&&l.type==="form"?tR(l):Vs.r(o)}var Gu=typeof document>"u"?null:document;function HE(o,l,c){var h=Gu;if(h&&typeof l=="string"&&l){var y=lr(l);y='link[rel="'+o+'"][href="'+y+'"]',typeof c=="string"&&(y+='[crossorigin="'+c+'"]'),_E.has(y)||(_E.add(y),o={rel:o,crossOrigin:c,href:l},h.querySelector(y)===null&&(l=h.createElement("link"),kr(l,"link",o),Vn(l),h.head.appendChild(l)))}}function Q_(o){Vs.D(o),HE("dns-prefetch",o,null)}function Z_(o,l){Vs.C(o,l),HE("preconnect",o,l)}function J_(o,l,c){Vs.L(o,l,c);var h=Gu;if(h&&o&&l){var y='link[rel="preload"][as="'+lr(l)+'"]';l==="image"&&c&&c.imageSrcSet?(y+='[imagesrcset="'+lr(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(y+='[imagesizes="'+lr(c.imageSizes)+'"]')):y+='[href="'+lr(o)+'"]';var x=y;switch(l){case"style":x=Wu(o);break;case"script":x=Ku(o)}Ki.has(x)||(o=p({rel:"preload",href:l==="image"&&c&&c.imageSrcSet?void 0:o,as:l},c),Ki.set(x,o),h.querySelector(y)!==null||l==="style"&&h.querySelector(bf(x))||l==="script"&&h.querySelector(xf(x))||(l=h.createElement("link"),kr(l,"link",o),Vn(l),h.head.appendChild(l)))}}function eH(o,l){Vs.m(o,l);var c=Gu;if(c&&o){var h=l&&typeof l.as=="string"?l.as:"script",y='link[rel="modulepreload"][as="'+lr(h)+'"][href="'+lr(o)+'"]',x=y;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=Ku(o)}if(!Ki.has(x)&&(o=p({rel:"modulepreload",href:o},l),Ki.set(x,o),c.querySelector(y)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(xf(x)))return}h=c.createElement("link"),kr(h,"link",o),Vn(h),c.head.appendChild(h)}}}function tH(o,l,c){Vs.S(o,l,c);var h=Gu;if(h&&o){var y=ai(h).hoistableStyles,x=Wu(o);l=l||"default";var k=y.get(x);if(!k){var B={loading:0,preload:null};if(k=h.querySelector(bf(x)))B.loading=5;else{o=p({rel:"stylesheet",href:o,"data-precedence":l},c),(c=Ki.get(x))&&Xv(o,c);var K=k=h.createElement("link");Vn(K),kr(K,"link",o),K._p=new Promise(function(se,he){K.onload=se,K.onerror=he}),K.addEventListener("load",function(){B.loading|=1}),K.addEventListener("error",function(){B.loading|=2}),B.loading|=4,$h(k,l,h)}k={type:"stylesheet",instance:k,count:1,state:B},y.set(x,k)}}}function nH(o,l){Vs.X(o,l);var c=Gu;if(c&&o){var h=ai(c).hoistableScripts,y=Ku(o),x=h.get(y);x||(x=c.querySelector(xf(y)),x||(o=p({src:o,async:!0},l),(l=Ki.get(y))&&Qv(o,l),x=c.createElement("script"),Vn(x),kr(x,"link",o),c.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},h.set(y,x))}}function rH(o,l){Vs.M(o,l);var c=Gu;if(c&&o){var h=ai(c).hoistableScripts,y=Ku(o),x=h.get(y);x||(x=c.querySelector(xf(y)),x||(o=p({src:o,async:!0,type:"module"},l),(l=Ki.get(y))&&Qv(o,l),x=c.createElement("script"),Vn(x),kr(x,"link",o),c.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},h.set(y,x))}}function jE(o,l,c,h){var y=(y=ee.current)?Uh(y):null;if(!y)throw Error(r(446));switch(o){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(l=Wu(c.href),c=ai(y).hoistableStyles,h=c.get(l),h||(h={type:"style",instance:null,count:0,state:null},c.set(l,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){o=Wu(c.href);var x=ai(y).hoistableStyles,k=x.get(o);if(k||(y=y.ownerDocument||y,k={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(o,k),(x=y.querySelector(bf(o)))&&!x._p&&(k.instance=x,k.state.loading=5),Ki.has(o)||(c={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},Ki.set(o,c),x||iH(y,o,c,k.state))),l&&h===null)throw Error(r(528,""));return k}if(l&&h!==null)throw Error(r(529,""));return null;case"script":return l=c.async,c=c.src,typeof c=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=Ku(c),c=ai(y).hoistableScripts,h=c.get(l),h||(h={type:"script",instance:null,count:0,state:null},c.set(l,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,o))}}function Wu(o){return'href="'+lr(o)+'"'}function bf(o){return'link[rel="stylesheet"]['+o+"]"}function VE(o){return p({},o,{"data-precedence":o.precedence,precedence:null})}function iH(o,l,c,h){o.querySelector('link[rel="preload"][as="style"]['+l+"]")?h.loading=1:(l=o.createElement("link"),h.preload=l,l.addEventListener("load",function(){return h.loading|=1}),l.addEventListener("error",function(){return h.loading|=2}),kr(l,"link",c),Vn(l),o.head.appendChild(l))}function Ku(o){return'[src="'+lr(o)+'"]'}function xf(o){return"script[async]"+o}function FE(o,l,c){if(l.count++,l.instance===null)switch(l.type){case"style":var h=o.querySelector('style[data-href~="'+lr(c.href)+'"]');if(h)return l.instance=h,Vn(h),h;var y=p({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return h=(o.ownerDocument||o).createElement("style"),Vn(h),kr(h,"style",y),$h(h,c.precedence,o),l.instance=h;case"stylesheet":y=Wu(c.href);var x=o.querySelector(bf(y));if(x)return l.state.loading|=4,l.instance=x,Vn(x),x;h=VE(c),(y=Ki.get(y))&&Xv(h,y),x=(o.ownerDocument||o).createElement("link"),Vn(x);var k=x;return k._p=new Promise(function(B,K){k.onload=B,k.onerror=K}),kr(x,"link",h),l.state.loading|=4,$h(x,c.precedence,o),l.instance=x;case"script":return x=Ku(c.src),(y=o.querySelector(xf(x)))?(l.instance=y,Vn(y),y):(h=c,(y=Ki.get(x))&&(h=p({},c),Qv(h,y)),o=o.ownerDocument||o,y=o.createElement("script"),Vn(y),kr(y,"link",h),o.head.appendChild(y),l.instance=y);case"void":return null;default:throw Error(r(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(h=l.instance,l.state.loading|=4,$h(h,c.precedence,o));return l.instance}function $h(o,l,c){for(var h=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=h.length?h[h.length-1]:null,x=y,k=0;k<h.length;k++){var B=h[k];if(B.dataset.precedence===l)x=B;else if(x!==y)break}x?x.parentNode.insertBefore(o,x.nextSibling):(l=c.nodeType===9?c.head:c,l.insertBefore(o,l.firstChild))}function Xv(o,l){o.crossOrigin==null&&(o.crossOrigin=l.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=l.referrerPolicy),o.title==null&&(o.title=l.title)}function Qv(o,l){o.crossOrigin==null&&(o.crossOrigin=l.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=l.referrerPolicy),o.integrity==null&&(o.integrity=l.integrity)}var qh=null;function UE(o,l,c){if(qh===null){var h=new Map,y=qh=new Map;y.set(c,h)}else y=qh,h=y.get(c),h||(h=new Map,y.set(c,h));if(h.has(o))return h;for(h.set(o,null),c=c.getElementsByTagName(o),y=0;y<c.length;y++){var x=c[y];if(!(x[Fe]||x[Pt]||o==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var k=x.getAttribute(l)||"";k=o+k;var B=h.get(k);B?B.push(x):h.set(k,[x])}}return h}function $E(o,l,c){o=o.ownerDocument||o,o.head.insertBefore(c,l==="title"?o.querySelector("head > title"):null)}function oH(o,l,c){if(c===1||l.itemProp!=null)return!1;switch(o){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;return l.rel==="stylesheet"?(o=l.disabled,typeof l.precedence=="string"&&o==null):!0;case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function qE(o){return!(o.type==="stylesheet"&&(o.state.loading&3)===0)}function sH(o,l,c,h){if(c.type==="stylesheet"&&(typeof h.media!="string"||matchMedia(h.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var y=Wu(h.href),x=l.querySelector(bf(y));if(x){l=x._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(o.count++,o=Gh.bind(o),l.then(o,o)),c.state.loading|=4,c.instance=x,Vn(x);return}x=l.ownerDocument||l,h=VE(h),(y=Ki.get(y))&&Xv(h,y),x=x.createElement("link"),Vn(x);var k=x;k._p=new Promise(function(B,K){k.onload=B,k.onerror=K}),kr(x,"link",h),c.instance=x}o.stylesheets===null&&(o.stylesheets=new Map),o.stylesheets.set(c,l),(l=c.state.preload)&&(c.state.loading&3)===0&&(o.count++,c=Gh.bind(o),l.addEventListener("load",c),l.addEventListener("error",c))}}var Zv=0;function lH(o,l){return o.stylesheets&&o.count===0&&Kh(o,o.stylesheets),0<o.count||0<o.imgCount?function(c){var h=setTimeout(function(){if(o.stylesheets&&Kh(o,o.stylesheets),o.unsuspend){var x=o.unsuspend;o.unsuspend=null,x()}},6e4+l);0<o.imgBytes&&Zv===0&&(Zv=62500*V_());var y=setTimeout(function(){if(o.waitingForImages=!1,o.count===0&&(o.stylesheets&&Kh(o,o.stylesheets),o.unsuspend)){var x=o.unsuspend;o.unsuspend=null,x()}},(o.imgBytes>Zv?50:800)+l);return o.unsuspend=c,function(){o.unsuspend=null,clearTimeout(h),clearTimeout(y)}}:null}function Gh(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Kh(this,this.stylesheets);else if(this.unsuspend){var o=this.unsuspend;this.unsuspend=null,o()}}}var Wh=null;function Kh(o,l){o.stylesheets=null,o.unsuspend!==null&&(o.count++,Wh=new Map,l.forEach(aH,o),Wh=null,Gh.call(o))}function aH(o,l){if(!(l.state.loading&4)){var c=Wh.get(o);if(c)var h=c.get(null);else{c=new Map,Wh.set(o,c);for(var y=o.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<y.length;x++){var k=y[x];(k.nodeName==="LINK"||k.getAttribute("media")!=="not all")&&(c.set(k.dataset.precedence,k),h=k)}h&&c.set(null,h)}y=l.instance,k=y.getAttribute("data-precedence"),x=c.get(k)||h,x===h&&c.set(null,y),c.set(k,y),this.count++,h=Gh.bind(this),y.addEventListener("load",h),y.addEventListener("error",h),x?x.parentNode.insertBefore(y,x.nextSibling):(o=o.nodeType===9?o.head:o,o.insertBefore(y,o.firstChild)),l.state.loading|=4}}var Sf={$$typeof:T,Provider:null,Consumer:null,_currentValue:V,_currentValue2:V,_threadCount:0};function uH(o,l,c,h,y,x,k,B,K){this.tag=1,this.containerInfo=o,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=Jt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Jt(0),this.hiddenUpdates=Jt(null),this.identifierPrefix=h,this.onUncaughtError=y,this.onCaughtError=x,this.onRecoverableError=k,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=K,this.incompleteTransitions=new Map}function GE(o,l,c,h,y,x,k,B,K,se,he,be){return o=new uH(o,l,c,k,K,se,he,be,B),l=1,x===!0&&(l|=24),x=Ri(3,null,null,l),o.current=x,x.stateNode=o,l=Iy(),l.refCount++,o.pooledCache=l,l.refCount++,x.memoizedState={element:h,isDehydrated:c,cache:l},Ny(x),o}function WE(o){return o?(o=Eu,o):Eu}function KE(o,l,c,h,y,x){y=WE(y),h.context===null?h.context=y:h.pendingContext=y,h=Al(l),h.payload={element:c},x=x===void 0?null:x,x!==null&&(h.callback=x),c=Ml(o,h,l),c!==null&&(gi(c,o,l),Zc(c,o,l))}function YE(o,l){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var c=o.retryLane;o.retryLane=c!==0&&c<l?c:l}}function Jv(o,l){YE(o,l),(o=o.alternate)&&YE(o,l)}function XE(o){if(o.tag===13||o.tag===31){var l=Ma(o,67108864);l!==null&&gi(l,o,67108864),Jv(o,67108864)}}function QE(o){if(o.tag===13||o.tag===31){var l=Oi();l=Ut(l);var c=Ma(o,l);c!==null&&gi(c,o,l),Jv(o,l)}}var Yh=!0;function cH(o,l,c,h){var y=j.T;j.T=null;var x=q.p;try{q.p=2,e0(o,l,c,h)}finally{q.p=x,j.T=y}}function fH(o,l,c,h){var y=j.T;j.T=null;var x=q.p;try{q.p=8,e0(o,l,c,h)}finally{q.p=x,j.T=y}}function e0(o,l,c,h){if(Yh){var y=t0(h);if(y===null)jv(o,l,h,Xh,c),JE(o,h);else if(hH(y,o,l,c,h))h.stopPropagation();else if(JE(o,h),l&4&&-1<dH.indexOf(o)){for(;y!==null;){var x=Bi(y);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var k=pt(x.pendingLanes);if(k!==0){var B=x;for(B.pendingLanes|=2,B.entangledLanes|=2;k;){var K=1<<31-at(k);B.entanglements[1]|=K,k&=~K}Yo(x),(tn&6)===0&&(Dh=ne()+500,pf(0))}}break;case 31:case 13:B=Ma(x,2),B!==null&&gi(B,x,2),zh(),Jv(x,2)}if(x=t0(h),x===null&&jv(o,l,h,Xh,c),x===y)break;y=x}y!==null&&h.stopPropagation()}else jv(o,l,h,null,c)}}function t0(o){return o=vl(o),n0(o)}var Xh=null;function n0(o){if(Xh=null,o=Zn(o),o!==null){var l=s(o);if(l===null)o=null;else{var c=l.tag;if(c===13){if(o=a(l),o!==null)return o;o=null}else if(c===31){if(o=u(l),o!==null)return o;o=null}else if(c===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;o=null}else l!==o&&(o=null)}}return Xh=o,null}function ZE(o){switch(o){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(Q()){case Se:return 2;case ge:return 8;case De:case Te:return 32;case _e:return 268435456;default:return 32}default:return 32}}var r0=!1,Hl=null,jl=null,Vl=null,wf=new Map,Cf=new Map,Fl=[],dH="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 JE(o,l){switch(o){case"focusin":case"focusout":Hl=null;break;case"dragenter":case"dragleave":jl=null;break;case"mouseover":case"mouseout":Vl=null;break;case"pointerover":case"pointerout":wf.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":Cf.delete(l.pointerId)}}function Rf(o,l,c,h,y,x){return o===null||o.nativeEvent!==x?(o={blockedOn:l,domEventName:c,eventSystemFlags:h,nativeEvent:x,targetContainers:[y]},l!==null&&(l=Bi(l),l!==null&&XE(l)),o):(o.eventSystemFlags|=h,l=o.targetContainers,y!==null&&l.indexOf(y)===-1&&l.push(y),o)}function hH(o,l,c,h,y){switch(l){case"focusin":return Hl=Rf(Hl,o,l,c,h,y),!0;case"dragenter":return jl=Rf(jl,o,l,c,h,y),!0;case"mouseover":return Vl=Rf(Vl,o,l,c,h,y),!0;case"pointerover":var x=y.pointerId;return wf.set(x,Rf(wf.get(x)||null,o,l,c,h,y)),!0;case"gotpointercapture":return x=y.pointerId,Cf.set(x,Rf(Cf.get(x)||null,o,l,c,h,y)),!0}return!1}function eT(o){var l=Zn(o.target);if(l!==null){var c=s(l);if(c!==null){if(l=c.tag,l===13){if(l=a(c),l!==null){o.blockedOn=l,wr(o.priority,function(){QE(c)});return}}else if(l===31){if(l=u(c),l!==null){o.blockedOn=l,wr(o.priority,function(){QE(c)});return}}else if(l===3&&c.stateNode.current.memoizedState.isDehydrated){o.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}o.blockedOn=null}function Qh(o){if(o.blockedOn!==null)return!1;for(var l=o.targetContainers;0<l.length;){var c=t0(o.nativeEvent);if(c===null){c=o.nativeEvent;var h=new c.constructor(c.type,c);yl=h,c.target.dispatchEvent(h),yl=null}else return l=Bi(c),l!==null&&XE(l),o.blockedOn=c,!1;l.shift()}return!0}function tT(o,l,c){Qh(o)&&c.delete(l)}function gH(){r0=!1,Hl!==null&&Qh(Hl)&&(Hl=null),jl!==null&&Qh(jl)&&(jl=null),Vl!==null&&Qh(Vl)&&(Vl=null),wf.forEach(tT),Cf.forEach(tT)}function Zh(o,l){o.blockedOn===l&&(o.blockedOn=null,r0||(r0=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,gH)))}var Jh=null;function nT(o){Jh!==o&&(Jh=o,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Jh===o&&(Jh=null);for(var l=0;l<o.length;l+=3){var c=o[l],h=o[l+1],y=o[l+2];if(typeof h!="function"){if(n0(h||c)===null)continue;break}var x=Bi(c);x!==null&&(o.splice(l,3),l-=3,tv(x,{pending:!0,data:y,method:c.method,action:h},h,y))}}))}function Yu(o){function l(K){return Zh(K,o)}Hl!==null&&Zh(Hl,o),jl!==null&&Zh(jl,o),Vl!==null&&Zh(Vl,o),wf.forEach(l),Cf.forEach(l);for(var c=0;c<Fl.length;c++){var h=Fl[c];h.blockedOn===o&&(h.blockedOn=null)}for(;0<Fl.length&&(c=Fl[0],c.blockedOn===null);)eT(c),c.blockedOn===null&&Fl.shift();if(c=(o.ownerDocument||o).$$reactFormReplay,c!=null)for(h=0;h<c.length;h+=3){var y=c[h],x=c[h+1],k=y[zt]||null;if(typeof x=="function")k||nT(c);else if(k){var B=null;if(x&&x.hasAttribute("formAction")){if(y=x,k=x[zt]||null)B=k.formAction;else if(n0(y)!==null)continue}else B=k.action;typeof B=="function"?c[h+1]=B:(c.splice(h,3),h-=3),nT(c)}}}function rT(){function o(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(k){return y=k})},focusReset:"manual",scroll:"manual"})}function l(){y!==null&&(y(),y=null),h||setTimeout(c,20)}function c(){if(!h&&!navigation.transition){var x=navigation.currentEntry;x&&x.url!=null&&navigation.navigate(x.url,{state:x.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var h=!1,y=null;return navigation.addEventListener("navigate",o),navigation.addEventListener("navigatesuccess",l),navigation.addEventListener("navigateerror",l),setTimeout(c,100),function(){h=!0,navigation.removeEventListener("navigate",o),navigation.removeEventListener("navigatesuccess",l),navigation.removeEventListener("navigateerror",l),y!==null&&(y(),y=null)}}}function i0(o){this._internalRoot=o}eg.prototype.render=i0.prototype.render=function(o){var l=this._internalRoot;if(l===null)throw Error(r(409));var c=l.current,h=Oi();KE(c,h,o,l,null,null)},eg.prototype.unmount=i0.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var l=o.containerInfo;KE(o.current,2,null,o,null,null),zh(),l[Je]=null}};function eg(o){this._internalRoot=o}eg.prototype.unstable_scheduleHydration=function(o){if(o){var l=Ln();o={blockedOn:null,target:o,priority:l};for(var c=0;c<Fl.length&&l!==0&&l<Fl[c].priority;c++);Fl.splice(c,0,o),c===0&&eT(o)}};var iT=e.version;if(iT!=="19.2.3")throw Error(r(527,iT,"19.2.3"));q.findDOMNode=function(o){var l=o._reactInternals;if(l===void 0)throw typeof o.render=="function"?Error(r(188)):(o=Object.keys(o).join(","),Error(r(268,o)));return o=d(l),o=o!==null?g(o):null,o=o===null?null:o.stateNode,o};var pH={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:j,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var tg=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!tg.isDisabled&&tg.supportsFiber)try{kt=tg.inject(pH),It=tg}catch{}}return Tf.createRoot=function(o,l){if(!i(o))throw Error(r(299));var c=!1,h="",y=fR,x=dR,k=hR;return l!=null&&(l.unstable_strictMode===!0&&(c=!0),l.identifierPrefix!==void 0&&(h=l.identifierPrefix),l.onUncaughtError!==void 0&&(y=l.onUncaughtError),l.onCaughtError!==void 0&&(x=l.onCaughtError),l.onRecoverableError!==void 0&&(k=l.onRecoverableError)),l=GE(o,1,!1,null,null,c,h,null,y,x,k,rT),o[Je]=l.current,Hv(o),new i0(l)},Tf.hydrateRoot=function(o,l,c){if(!i(o))throw Error(r(299));var h=!1,y="",x=fR,k=dR,B=hR,K=null;return c!=null&&(c.unstable_strictMode===!0&&(h=!0),c.identifierPrefix!==void 0&&(y=c.identifierPrefix),c.onUncaughtError!==void 0&&(x=c.onUncaughtError),c.onCaughtError!==void 0&&(k=c.onCaughtError),c.onRecoverableError!==void 0&&(B=c.onRecoverableError),c.formState!==void 0&&(K=c.formState)),l=GE(o,1,!0,l,c??null,h,y,K,x,k,B,rT),l.context=WE(null),c=l.current,h=Oi(),h=Ut(h),y=Al(h),y.callback=null,Ml(c,y,h),c=h,l.current.lanes=c,Rn(l,c),Yo(l),o[Je]=l.current,Hv(o),new eg(l)},Tf.version="19.2.3",Tf}var FT;function o3(){if(FT)return v0.exports;FT=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),v0.exports=i3(),v0.exports}var Qk=o3();function s3(t,e){return DS(e),Qk.hydrateRoot(e,t)}function l3(t,e){DS(e);var n=Qk.createRoot(e);return n.render(t),n}function a3(t){return t.unmount(),!0}var Yb=t=>{if(t!=null){var e=t.nodeType===1;if(e&&typeof t.getBoundingClientRect=="function")return t.getBoundingClientRect()}},Gf={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexOrder:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,fontWeight:!0,gridRow:!0,gridRowEnd:!0,gridRowGap:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnGap:!0,gridColumnStart:!0,lineClamp:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0,scale:!0,scaleX:!0,scaleY:!0,scaleZ:!0,shadowOpacity:!0},u3=["ms","Moz","O","Webkit"],c3=(t,e)=>t+e.charAt(0).toUpperCase()+e.substring(1);Object.keys(Gf).forEach(t=>{u3.forEach(e=>{Gf[c3(e,t)]=Gf[t]})});function f3(t,e,n){var r=e==null||typeof e=="boolean"||e==="";return r?"":!n&&typeof e=="number"&&e!==0&&!(Gf.hasOwnProperty(t)&&Gf[t])?e+"px":(""+e).trim()}function d3(t,e){var n=t.style;for(var r in e)if(e.hasOwnProperty(r)){var i=r.indexOf("--")===0,s=f3(r,e[r],i);r==="float"&&(r="cssFloat"),i?n.setProperty(r,s):n[r]=s}}var UT=t=>{var e=t.offsetHeight,n=t.offsetWidth,r=t.offsetLeft,i=t.offsetTop;for(t=t.offsetParent;t&&t.nodeType===1;)r+=t.offsetLeft+t.clientLeft-t.scrollLeft,i+=t.offsetTop+t.clientTop-t.scrollTop,t=t.offsetParent;return i-=window.scrollY,r-=window.scrollX,{width:n,height:e,top:i,left:r}},$T=(t,e,n)=>{var r=e||t&&t.parentNode;t&&r&&setTimeout(()=>{if(t.isConnected&&r.isConnected){var i=UT(r),s=UT(t),a=s.height,u=s.left,f=s.top,d=s.width,g=u-i.left,p=f-i.top;n(g,p,d,a,u,f)}},0)},h3={A:!0,BODY:!0,INPUT:!0,SELECT:!0,TEXTAREA:!0},sp={blur(t){try{t.blur()}catch{}},focus(t){try{var e=t.nodeName;t.getAttribute("tabIndex")==null&&t.isContentEditable!==!0&&h3[e]==null&&t.setAttribute("tabIndex","-1"),t.focus()}catch{}},measure(t,e){$T(t,null,e)},measureInWindow(t,e){t&&setTimeout(()=>{var n=Yb(t),r=n.height,i=n.left,s=n.top,a=n.width;e(i,s,a,r)},0)},measureLayout(t,e,n,r){$T(t,e,r)},updateView(t,e){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=e[n];switch(n){case"style":{d3(t,r);break}case"class":case"className":{t.setAttribute("class",r);break}case"text":case"value":t.value=r;break;default:t.setAttribute(n,r)}}},configureNextLayoutAnimation(t,e){e()},setLayoutAnimationEnabledExperimental(){}};function Xb(){return Xb=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Xb.apply(null,arguments)}var g3={children:!0,dataSet:!0,dir:!0,id:!0,ref:!0,suppressHydrationWarning:!0,tabIndex:!0,testID:!0,focusable:!0,nativeID:!0},p3={"aria-activedescendant":!0,"aria-atomic":!0,"aria-autocomplete":!0,"aria-busy":!0,"aria-checked":!0,"aria-colcount":!0,"aria-colindex":!0,"aria-colspan":!0,"aria-controls":!0,"aria-current":!0,"aria-describedby":!0,"aria-details":!0,"aria-disabled":!0,"aria-errormessage":!0,"aria-expanded":!0,"aria-flowto":!0,"aria-haspopup":!0,"aria-hidden":!0,"aria-invalid":!0,"aria-keyshortcuts":!0,"aria-label":!0,"aria-labelledby":!0,"aria-level":!0,"aria-live":!0,"aria-modal":!0,"aria-multiline":!0,"aria-multiselectable":!0,"aria-orientation":!0,"aria-owns":!0,"aria-placeholder":!0,"aria-posinset":!0,"aria-pressed":!0,"aria-readonly":!0,"aria-required":!0,inert:!0,role:!0,"aria-roledescription":!0,"aria-rowcount":!0,"aria-rowindex":!0,"aria-rowspan":!0,"aria-selected":!0,"aria-setsize":!0,"aria-sort":!0,"aria-valuemax":!0,"aria-valuemin":!0,"aria-valuenow":!0,"aria-valuetext":!0,accessibilityActiveDescendant:!0,accessibilityAtomic:!0,accessibilityAutoComplete:!0,accessibilityBusy:!0,accessibilityChecked:!0,accessibilityColumnCount:!0,accessibilityColumnIndex:!0,accessibilityColumnSpan:!0,accessibilityControls:!0,accessibilityCurrent:!0,accessibilityDescribedBy:!0,accessibilityDetails:!0,accessibilityDisabled:!0,accessibilityErrorMessage:!0,accessibilityExpanded:!0,accessibilityFlowTo:!0,accessibilityHasPopup:!0,accessibilityHidden:!0,accessibilityInvalid:!0,accessibilityKeyShortcuts:!0,accessibilityLabel:!0,accessibilityLabelledBy:!0,accessibilityLevel:!0,accessibilityLiveRegion:!0,accessibilityModal:!0,accessibilityMultiline:!0,accessibilityMultiSelectable:!0,accessibilityOrientation:!0,accessibilityOwns:!0,accessibilityPlaceholder:!0,accessibilityPosInSet:!0,accessibilityPressed:!0,accessibilityReadOnly:!0,accessibilityRequired:!0,accessibilityRole:!0,accessibilityRoleDescription:!0,accessibilityRowCount:!0,accessibilityRowIndex:!0,accessibilityRowSpan:!0,accessibilitySelected:!0,accessibilitySetSize:!0,accessibilitySort:!0,accessibilityValueMax:!0,accessibilityValueMin:!0,accessibilityValueNow:!0,accessibilityValueText:!0},m3={onClick:!0,onAuxClick:!0,onContextMenu:!0,onGotPointerCapture:!0,onLostPointerCapture:!0,onPointerCancel:!0,onPointerDown:!0,onPointerEnter:!0,onPointerMove:!0,onPointerLeave:!0,onPointerOut:!0,onPointerOver:!0,onPointerUp:!0},y3={onBlur:!0,onFocus:!0},v3={onKeyDown:!0,onKeyDownCapture:!0,onKeyUp:!0,onKeyUpCapture:!0},b3={onMouseDown:!0,onMouseEnter:!0,onMouseLeave:!0,onMouseMove:!0,onMouseOver:!0,onMouseOut:!0,onMouseUp:!0},x3={onTouchCancel:!0,onTouchCancelCapture:!0,onTouchEnd:!0,onTouchEndCapture:!0,onTouchMove:!0,onTouchMoveCapture:!0,onTouchStart:!0,onTouchStartCapture:!0},S3={style:!0};function w3(t,e){var n={};for(var r in t)t.hasOwnProperty(r)&&e[r]===!0&&(n[r]=t[r]);return n}var qT=hu?E.useLayoutEffect:E.useEffect,Qb="__reactLayoutHandler",w0=null;function C3(){return hu&&typeof window.ResizeObserver<"u"&&w0==null&&(w0=new window.ResizeObserver(function(t){t.forEach(e=>{var n=e.target,r=n[Qb];typeof r=="function"&&sp.measure(n,(i,s,a,u,f,d)=>{var g={nativeEvent:{layout:{x:i,y:s,width:a,height:u,left:f,top:d}},timeStamp:Date.now()};Object.defineProperty(g.nativeEvent,"target",{enumerable:!0,get:()=>e.target}),r(g)})})})),w0}function R3(t,e){var n=C3();qT(()=>{var r=t.current;r!=null&&(r[Qb]=e)},[t,e]),qT(()=>{var r=t.current;return r!=null&&n!=null&&(typeof r[Qb]=="function"?n.observe(r):n.unobserve(r)),()=>{r!=null&&n!=null&&n.unobserve(r)}},[t,n])}function E3(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(i){e.forEach(s=>{if(s!=null){if(typeof s=="function"){s(i);return}if(typeof s=="object"){s.current=i;return}console.error("mergeRefs cannot handle Refs of type boolean, number or string, received ref "+String(s))}})}}function T3(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return E.useMemo(()=>E3(...e),[...e])}var GT=typeof Symbol=="function"&&typeof Symbol()=="symbol"?Symbol():Object.freeze({});function A3(t){var e=E.useRef(GT);return e.current===GT&&(e.current=t()),e.current}function M3(t){t.pointerEvents,t.style;var e=A3(()=>n=>{n!=null&&(n.measure=r=>sp.measure(n,r),n.measureLayout=(r,i,s)=>sp.measureLayout(n,r,s,i),n.measureInWindow=r=>sp.measureInWindow(n,r))});return e}var WT=()=>{},O3={},k3=[];function KT(t){return t>20?t%20:t}function Zk(t,e){var n,r=!1,i,s,a=t.changedTouches,u=t.type,f=t.metaKey===!0,d=t.shiftKey===!0,g=a&&a[0].force||0,p=KT(a&&a[0].identifier||0),m=a&&a[0].clientX||t.clientX,v=a&&a[0].clientY||t.clientY,b=a&&a[0].pageX||t.pageX,S=a&&a[0].pageY||t.pageY,w=typeof t.preventDefault=="function"?t.preventDefault.bind(t):WT,C=t.timeStamp;function R(M){return Array.prototype.slice.call(M).map(D=>({force:D.force,identifier:KT(D.identifier),get locationX(){return O(D.clientX)},get locationY(){return P(D.clientY)},pageX:D.pageX,pageY:D.pageY,target:D.target,timestamp:C}))}if(a!=null)i=R(a),s=R(t.touches);else{var T=[{force:g,identifier:p,get locationX(){return O(m)},get locationY(){return P(v)},pageX:b,pageY:S,target:t.target,timestamp:C}];i=T,s=u==="mouseup"||u==="dragstart"?k3:T}var A={bubbles:!0,cancelable:!0,currentTarget:null,defaultPrevented:t.defaultPrevented,dispatchConfig:O3,eventPhase:t.eventPhase,isDefaultPrevented(){return t.defaultPrevented},isPropagationStopped(){return r},isTrusted:t.isTrusted,nativeEvent:{altKey:!1,ctrlKey:!1,metaKey:f,shiftKey:d,changedTouches:i,force:g,identifier:p,get locationX(){return O(m)},get locationY(){return P(v)},pageX:b,pageY:S,target:t.target,timestamp:C,touches:s,type:u},persist:WT,preventDefault:w,stopPropagation(){r=!0},target:t.target,timeStamp:C,touchHistory:e.touchHistory};function O(M){if(n=n||Yb(A.currentTarget),n)return M-n.left}function P(M){if(n=n||Yb(A.currentTarget),n)return M-n.top}return A}var I3="mousedown",D3="mousemove",P3="mouseup",z3="dragstart",N3="touchstart",L3="touchmove",B3="touchend",_3="touchcancel",H3="scroll",j3="select",V3="selectionchange";function Jk(t){return t===N3||t===I3}function eI(t){return t===L3||t===D3}function tI(t){return t===B3||t===P3||nI(t)}function nI(t){return t===_3||t===z3}function F3(t){return t===H3}function U3(t){return t===j3||t===V3}function $3(){var t=window.getSelection(),e=t.toString(),n=t.anchorNode,r=t.focusNode,i=n&&n.nodeType===window.Node.TEXT_NODE||r&&r.nodeType===window.Node.TEXT_NODE;return e.length>=1&&e!==`
13
- `&&i}var rI="__reactResponderId";function q3(t){if(t.type==="selectionchange"){var e=window.getSelection().anchorNode;return YT(e)}else{var n=t.composedPath!=null?t.composedPath():YT(t.target);return n}}function YT(t){for(var e=[];t!=null&&t!==document.body;)e.push(t),t=t.parentNode;return e}function G3(t){return t!=null?t[rI]:null}function W3(t,e){t!=null&&(t[rI]=e)}function K3(t){for(var e=[],n=[],r=q3(t),i=0;i<r.length;i++){var s=r[i],a=G3(s);a!=null&&(e.push(a),n.push(s))}return{idPath:e,nodePath:n}}function Y3(t,e){var n=t.length,r=e.length;if(n===0||r===0||t[n-1]!==e[r-1])return null;var i=t[0],s=0,a=e[0],u=0;n-r>0&&(s=n-r,i=t[s],n=r),r-n>0&&(u=r-n,a=e[u],r=n);for(var f=n;f--;){if(i===a)return i;i=t[s++],a=e[u++]}return null}function X3(t,e){if(!e||e.length===0)return!1;for(var n=0;n<e.length;n++){var r=e[n].target;if(r!=null&&t.contains(r))return!0}return!1}function Q3(t){return t.type==="selectionchange"?$3():t.type==="select"}function Z3(t){var e=t.altKey,n=t.button,r=t.buttons,i=t.ctrlKey,s=t.type,a=s==="touchstart"||s==="touchmove",u=s==="mousedown"&&(n===0||r===1),f=s==="mousemove"&&r===1,d=e===!1&&i===!1;return!!(a||u&&d||f&&d)}var XT=20;function oo(t){return t.timeStamp||t.timestamp}function J3(t){return{touchActive:!0,startPageX:t.pageX,startPageY:t.pageY,startTimeStamp:oo(t),currentPageX:t.pageX,currentPageY:t.pageY,currentTimeStamp:oo(t),previousPageX:t.pageX,previousPageY:t.pageY,previousTimeStamp:oo(t)}}function eF(t,e){t.touchActive=!0,t.startPageX=e.pageX,t.startPageY=e.pageY,t.startTimeStamp=oo(e),t.currentPageX=e.pageX,t.currentPageY=e.pageY,t.currentTimeStamp=oo(e),t.previousPageX=e.pageX,t.previousPageY=e.pageY,t.previousTimeStamp=oo(e)}function PS(t){var e=t.identifier;return e==null&&console.error("Touch object is missing identifier."),e}function tF(t,e){var n=PS(t),r=e.touchBank[n];r?eF(r,t):e.touchBank[n]=J3(t),e.mostRecentTimeStamp=oo(t)}function nF(t,e){var n=e.touchBank[PS(t)];n?(n.touchActive=!0,n.previousPageX=n.currentPageX,n.previousPageY=n.currentPageY,n.previousTimeStamp=n.currentTimeStamp,n.currentPageX=t.pageX,n.currentPageY=t.pageY,n.currentTimeStamp=oo(t),e.mostRecentTimeStamp=oo(t)):console.warn(`Cannot record touch move without a touch start.
14
- `,"Touch Move: "+iI(t)+`
15
- `,"Touch Bank: "+oI(e))}function rF(t,e){var n=e.touchBank[PS(t)];n?(n.touchActive=!1,n.previousPageX=n.currentPageX,n.previousPageY=n.currentPageY,n.previousTimeStamp=n.currentTimeStamp,n.currentPageX=t.pageX,n.currentPageY=t.pageY,n.currentTimeStamp=oo(t),e.mostRecentTimeStamp=oo(t)):console.warn(`Cannot record touch end without a touch start.
16
- `,"Touch End: "+iI(t)+`
17
- `,"Touch Bank: "+oI(e))}function iI(t){return JSON.stringify({identifier:t.identifier,pageX:t.pageX,pageY:t.pageY,timestamp:oo(t)})}function oI(t){var e=t.touchBank,n=JSON.stringify(e.slice(0,XT));return e.length>XT&&(n+=" (original size: "+e.length+")"),n}class iF{constructor(){this._touchHistory={touchBank:[],numberActiveTouches:0,indexOfSingleActiveTouch:-1,mostRecentTimeStamp:0}}recordTouchTrack(e,n){var r=this._touchHistory;if(eI(e))n.changedTouches.forEach(u=>nF(u,r));else if(Jk(e))n.changedTouches.forEach(u=>tF(u,r)),r.numberActiveTouches=n.touches.length,r.numberActiveTouches===1&&(r.indexOfSingleActiveTouch=n.touches[0].identifier);else if(tI(e)&&(n.changedTouches.forEach(u=>rF(u,r)),r.numberActiveTouches=n.touches.length,r.numberActiveTouches===1))for(var i=r.touchBank,s=0;s<i.length;s++){var a=i[s];if(a!=null&&a.touchActive){r.indexOfSingleActiveTouch=s;break}}}get touchHistory(){return this._touchHistory}}var oF={},QT=["onStartShouldSetResponderCapture","onStartShouldSetResponder",{bubbles:!0}],ZT=["onMoveShouldSetResponderCapture","onMoveShouldSetResponder",{bubbles:!0}],sF=["onScrollShouldSetResponderCapture","onScrollShouldSetResponder",{bubbles:!1}],lF={touchstart:QT,mousedown:QT,touchmove:ZT,mousemove:ZT,scroll:sF},Zb={id:null,idPath:null,node:null},Rp=new Map,ql=!1,Jo=0,ss={id:null,node:null,idPath:null},Jb=new iF;function ud(t){ss=t}function cd(t){var e=Rp.get(t);return e??oF}function C0(t){var e=t.type,n=t.target;if(e==="touchstart"&&(ql=!0),(e==="touchmove"||Jo>1)&&(ql=!1),!(e==="mousedown"&&ql||e==="mousemove"&&ql||e==="mousemove"&&Jo<1)){if(ql&&e==="mouseup"){Jo===0&&(ql=!1);return}var r=Jk(e)&&Z3(t),i=eI(e),s=tI(e),a=F3(e),u=U3(e),f=Zk(t,Jb);(r||i||s)&&(t.touches?Jo=t.touches.length:r?Jo=1:s&&(Jo=0),Jb.recordTouchTrack(e,f.nativeEvent));var d=K3(t),g=!1,p;if(r||i||a&&Jo>0){var m=ss.idPath,v=d.idPath;if(m!=null&&v!=null){var b=Y3(m,v);if(b!=null){var S=v.indexOf(b),w=S+(b===ss.id?1:0);d={idPath:v.slice(w),nodePath:d.nodePath.slice(w)}}else d=null}d!=null&&(p=aF(d,t,f),p!=null&&(uF(f,p),g=!0))}if(ss.id!=null&&ss.node!=null){var C=ss,R=C.id,T=C.node,A=cd(R),O=A.onResponderStart,P=A.onResponderMove,M=A.onResponderEnd,D=A.onResponderRelease,L=A.onResponderTerminate,H=A.onResponderTerminationRequest;if(f.bubbles=!1,f.cancelable=!1,f.currentTarget=T,r)O!=null&&(f.dispatchConfig.registrationName="onResponderStart",O(f));else if(i)P!=null&&(f.dispatchConfig.registrationName="onResponderMove",P(f));else{var N=nI(e)||e==="contextmenu"||e==="blur"&&n===window||e==="blur"&&n.contains(T)&&t.relatedTarget!==T||a&&Jo===0||a&&n.contains(T)&&n!==T||u&&Q3(t),_=s&&!N&&!X3(T,t.touches);if(s&&M!=null&&(f.dispatchConfig.registrationName="onResponderEnd",M(f)),_&&(D!=null&&(f.dispatchConfig.registrationName="onResponderRelease",D(f)),ud(Zb)),N){var $=!0;(e==="contextmenu"||e==="scroll"||e==="selectionchange")&&(g?$=!1:H!=null&&(f.dispatchConfig.registrationName="onResponderTerminationRequest",H(f)===!1&&($=!1))),$&&(L!=null&&(f.dispatchConfig.registrationName="onResponderTerminate",L(f)),ud(Zb),ql=!1,Jo=0)}}}}}function aF(t,e,n){var r=lF[e.type];if(r!=null){for(var i=t.idPath,s=t.nodePath,a=r[0],u=r[1],f=r[2].bubbles,d=function(P,M,D){var L=cd(P),H=L[D];if(H!=null&&(n.currentTarget=M,H(n)===!0)){var N=i.slice(i.indexOf(P));return{id:P,node:M,idPath:N}}},g=i.length-1;g>=0;g--){var p=i[g],m=s[g],v=d(p,m,a);if(v!=null)return v;if(n.isPropagationStopped()===!0)return}if(f)for(var b=0;b<i.length;b++){var S=i[b],w=s[b],C=d(S,w,u);if(C!=null)return C;if(n.isPropagationStopped()===!0)return}else{var R=i[0],T=s[0],A=e.target;if(A===T)return d(R,T,u)}}}function uF(t,e){var n=ss,r=n.id,i=n.node,s=e.id,a=e.node,u=cd(s),f=u.onResponderGrant,d=u.onResponderReject;if(t.bubbles=!1,t.cancelable=!1,t.currentTarget=a,r==null)f!=null&&(t.currentTarget=a,t.dispatchConfig.registrationName="onResponderGrant",f(t)),ud(e);else{var g=cd(r),p=g.onResponderTerminate,m=g.onResponderTerminationRequest,v=!0;m!=null&&(t.currentTarget=i,t.dispatchConfig.registrationName="onResponderTerminationRequest",m(t)===!1&&(v=!1)),v?(p!=null&&(t.currentTarget=i,t.dispatchConfig.registrationName="onResponderTerminate",p(t)),f!=null&&(t.currentTarget=a,t.dispatchConfig.registrationName="onResponderGrant",f(t)),ud(e)):d!=null&&(t.currentTarget=a,t.dispatchConfig.registrationName="onResponderReject",d(t))}}var cF=["blur","scroll"],fF=["mousedown","mousemove","mouseup","dragstart","touchstart","touchmove","touchend","touchcancel","contextmenu","select","selectionchange"];function dF(){hu&&window.__reactResponderSystemActive==null&&(window.addEventListener("blur",C0),fF.forEach(t=>{document.addEventListener(t,C0)}),cF.forEach(t=>{document.addEventListener(t,C0,!0)}),window.__reactResponderSystemActive=!0)}function hF(t,e,n){W3(e,t),Rp.set(t,n)}function JT(t){ss.id===t&&gF(),Rp.has(t)&&Rp.delete(t)}function gF(){var t=ss,e=t.id,n=t.node;if(e!=null&&n!=null){var r=cd(e),i=r.onResponderTerminate;if(i!=null){var s=Zk({},Jb);s.currentTarget=n,i(s)}ud(Zb)}ql=!1,Jo=0}function pF(){return ss.node}var mF={},yF=0;function vF(t){var e=E.useRef(null);return e.current==null&&(e.current=t()),e.current}function bF(t,e){e===void 0&&(e=mF);var n=vF(()=>yF++),r=E.useRef(!1);E.useEffect(()=>(dF(),()=>{JT(n)}),[n]),E.useEffect(()=>{var i=e,s=i.onMoveShouldSetResponder,a=i.onMoveShouldSetResponderCapture,u=i.onScrollShouldSetResponder,f=i.onScrollShouldSetResponderCapture,d=i.onSelectionChangeShouldSetResponder,g=i.onSelectionChangeShouldSetResponderCapture,p=i.onStartShouldSetResponder,m=i.onStartShouldSetResponderCapture,v=s!=null||a!=null||u!=null||f!=null||d!=null||g!=null||p!=null||m!=null,b=t.current;v?(hF(n,b,e),r.current=!0):r.current&&(JT(n),r.current=!1)},[e,t,n]),E.useDebugValue({isResponder:t.current===pF()}),E.useDebugValue(e)}var xF=E.createContext(!1),SF=["hrefAttrs","onLayout","onMoveShouldSetResponder","onMoveShouldSetResponderCapture","onResponderEnd","onResponderGrant","onResponderMove","onResponderReject","onResponderRelease","onResponderStart","onResponderTerminate","onResponderTerminationRequest","onScrollShouldSetResponder","onScrollShouldSetResponderCapture","onSelectionChangeShouldSetResponder","onSelectionChangeShouldSetResponderCapture","onStartShouldSetResponder","onStartShouldSetResponderCapture"],wF=Object.assign({},g3,p3,m3,y3,v3,b3,x3,S3,{href:!0,lang:!0,onScroll:!0,onWheel:!0,pointerEvents:!0}),CF=t=>w3(t,wF),ex=E.forwardRef((t,e)=>{var n=t.hrefAttrs,r=t.onLayout,i=t.onMoveShouldSetResponder,s=t.onMoveShouldSetResponderCapture,a=t.onResponderEnd,u=t.onResponderGrant,f=t.onResponderMove,d=t.onResponderReject,g=t.onResponderRelease,p=t.onResponderStart,m=t.onResponderTerminate,v=t.onResponderTerminationRequest,b=t.onScrollShouldSetResponder,S=t.onScrollShouldSetResponderCapture,w=t.onSelectionChangeShouldSetResponder,C=t.onSelectionChangeShouldSetResponderCapture,R=t.onStartShouldSetResponder,T=t.onStartShouldSetResponderCapture,A=um(t,SF),O=E.useContext(xF),P=E.useRef(null),M=JV(),D=M.direction;R3(P,r),bF(P,{onMoveShouldSetResponder:i,onMoveShouldSetResponderCapture:s,onResponderEnd:a,onResponderGrant:u,onResponderMove:f,onResponderReject:d,onResponderRelease:g,onResponderStart:p,onResponderTerminate:m,onResponderTerminationRequest:v,onScrollShouldSetResponder:b,onScrollShouldSetResponderCapture:S,onSelectionChangeShouldSetResponder:w,onSelectionChangeShouldSetResponderCapture:C,onStartShouldSetResponder:R,onStartShouldSetResponderCapture:T});var L="div",H=t.lang!=null?Yk(t.lang):null,N=t.dir||H,_=N||D,$=CF(A);if($.dir=N,$.style=[eA.view$raw,O&&eA.inline,t.style],t.href!=null&&(L="a",n!=null)){var F=n.download,G=n.rel,j=n.target;F!=null&&($.download=F),G!=null&&($.rel=G),typeof j=="string"&&($.target=j.charAt(0)!=="_"?"_"+j:j)}var q=M3($),V=T3(P,q,e);return $.ref=V,e3(L,$,{writingDirection:_})});ex.displayName="View";var eA=zd.create({view$raw:{alignContent:"flex-start",alignItems:"stretch",backgroundColor:"transparent",border:"0 solid black",boxSizing:"border-box",display:"flex",flexBasis:"auto",flexDirection:"column",flexShrink:0,listStyle:"none",margin:0,minHeight:0,minWidth:0,padding:0,position:"relative",textDecoration:"none",zIndex:0},inline:{display:"inline-flex"}}),R0,tA;function RF(){if(tA)return R0;tA=1;function t(e,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),s=2;s<r;s++)i[s-2]=arguments[s];if(!e){var a;if(n===void 0)a=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=0;a=new Error(n.replace(/%s/g,function(){return String(i[u++])})),a.name="Invariant Violation"}throw a.framesToPop=1,a}}return R0=t,R0}var EF=RF();const lp=_o(EF);var TF=E.createContext(null),zS=E.forwardRef((t,e)=>{var n=t.children,r=t.WrapperComponent,i=E.createElement(ex,{children:n,key:1,style:nA.appContainer});return r&&(i=E.createElement(r,null,i)),E.createElement(TF.Provider,{value:t.rootTag},E.createElement(ex,{ref:e,style:nA.appContainer},i))});zS.displayName="AppContainer";var nA=zd.create({appContainer:{flex:1,pointerEvents:"box-none"}});function AF(t,e,n,r){var i=r.hydrate,s=r.initialProps,a=r.rootTag,u=i?s3:l3;return lp(a,"Expect to have a valid rootTag, instead got ",a),u(Le.createElement(zS,{WrapperComponent:e,ref:n,rootTag:a},Le.createElement(t,s)),a)}function MF(t,e,n){var r=Le.createElement(zS,{WrapperComponent:n,rootTag:{}},Le.createElement(t,e)),i=s=>{var a=zd.getSheet();return Le.createElement("style",Xb({},s,{dangerouslySetInnerHTML:{__html:a.textContent},id:a.id}))};return{element:r,getStyleElement:i}}var rA={},Fs={},E0=t=>t(),Af;class fd{static getAppKeys(){return Object.keys(Fs)}static getApplication(e,n){return lp(Fs[e]&&Fs[e].getApplication,"Application "+e+" has not been registered. This is either due to an import error during initialization or failure to call AppRegistry.registerComponent."),Fs[e].getApplication(n)}static registerComponent(e,n){return Fs[e]={getApplication:r=>MF(E0(n),r?r.initialProps:rA,Af&&Af(r)),run:r=>AF(E0(n),Af&&Af(r),r.callback,{hydrate:r.hydrate||!1,initialProps:r.initialProps||rA,mode:r.mode||"concurrent",rootTag:r.rootTag})},e}static registerConfig(e){e.forEach(n=>{var r=n.appKey,i=n.component,s=n.run;s?fd.registerRunnable(r,s):(lp(i,"No component provider passed in"),fd.registerComponent(r,i))})}static registerRunnable(e,n){return Fs[e]={run:n},e}static runApplication(e,n){return lp(Fs[e]&&Fs[e].run,'Application "'+e+'" has not been registered. This is either due to an import error during initialization or failure to call AppRegistry.registerComponent.'),Fs[e].run(n)}static setComponentProviderInstrumentationHook(e){E0=e}static setWrapperComponentProvider(e){Af=e}static unmountApplicationComponentAtRootTag(e){a3(e)}}var il=Xk();const OF=_o(il);var T0={exports:{}},Mf={};var iA;function kF(){if(iA)return Mf;iA=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,i,s){var a=null;if(s!==void 0&&(a=""+s),i.key!==void 0&&(a=""+i.key),"key"in i){s={};for(var u in i)u!=="key"&&(s[u]=i[u])}else s=i;return i=s.ref,{$$typeof:t,type:r,key:a,ref:i!==void 0?i:null,props:s}}return Mf.Fragment=e,Mf.jsx=n,Mf.jsxs=n,Mf}var oA;function IF(){return oA||(oA=1,T0.exports=kF()),T0.exports}var I=IF(),Ld=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ru=typeof window>"u"||"Deno"in globalThis;function pi(){}function DF(t,e){return typeof t=="function"?t(e):t}function tx(t){return typeof t=="number"&&t>=0&&t!==1/0}function sI(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Jl(t,e){return typeof t=="function"?t(e):t}function Qi(t,e){return typeof t=="function"?t(e):t}function sA(t,e){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:a,stale:u}=t;if(a){if(r){if(e.queryHash!==NS(a,e.options))return!1}else if(!hd(e.queryKey,a))return!1}if(n!=="all"){const f=e.isActive();if(n==="active"&&!f||n==="inactive"&&f)return!1}return!(typeof u=="boolean"&&e.isStale()!==u||i&&i!==e.state.fetchStatus||s&&!s(e))}function lA(t,e){const{exact:n,status:r,predicate:i,mutationKey:s}=t;if(s){if(!e.options.mutationKey)return!1;if(n){if(dd(e.options.mutationKey)!==dd(s))return!1}else if(!hd(e.options.mutationKey,s))return!1}return!(r&&e.state.status!==r||i&&!i(e))}function NS(t,e){return(e?.queryKeyHashFn||dd)(t)}function dd(t){return JSON.stringify(t,(e,n)=>rx(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function hd(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>hd(t[n],e[n])):!1}function lI(t,e){if(t===e)return t;const n=aA(t)&&aA(e);if(n||rx(t)&&rx(e)){const r=n?t:Object.keys(t),i=r.length,s=n?e:Object.keys(e),a=s.length,u=n?[]:{},f=new Set(r);let d=0;for(let g=0;g<a;g++){const p=n?g:s[g];(!n&&f.has(p)||n)&&t[p]===void 0&&e[p]===void 0?(u[p]=void 0,d++):(u[p]=lI(t[p],e[p]),u[p]===t[p]&&t[p]!==void 0&&d++)}return i===a&&d===i?t:u}return e}function nx(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function aA(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function rx(t){if(!uA(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!uA(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function uA(t){return Object.prototype.toString.call(t)==="[object Object]"}function PF(t){return new Promise(e=>{setTimeout(e,t)})}function ix(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?lI(t,e):e}function zF(t){return t}function NF(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function LF(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var LS=Symbol();function aI(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:!t.queryFn||t.queryFn===LS?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function BF(t,e){return typeof t=="function"?t(...e):!!t}var _F=class extends Ld{#e;#t;#n;constructor(){super(),this.#n=t=>{if(!ru&&window.addEventListener){const e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#n=t,this.#t?.(),this.#t=t(e=>{typeof e=="boolean"?this.setFocused(e):this.onFocus()})}setFocused(t){this.#e!==t&&(this.#e=t,this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},BS=new _F,HF=class extends Ld{#e=!0;#t;#n;constructor(){super(),this.#n=t=>{if(!ru&&window.addEventListener){const e=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#n=t,this.#t?.(),this.#t=t(this.setOnline.bind(this))}setOnline(t){this.#e!==t&&(this.#e=t,this.listeners.forEach(n=>{n(t)}))}isOnline(){return this.#e}},Ep=new HF;function ox(){let t,e;const n=new Promise((i,s)=>{t=i,e=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),t(i)},n.reject=i=>{r({status:"rejected",reason:i}),e(i)},n}function jF(t){return Math.min(1e3*2**t,3e4)}function uI(t){return(t??"online")==="online"?Ep.isOnline():!0}var cI=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function A0(t){return t instanceof cI}function fI(t){let e=!1,n=0,r=!1,i;const s=ox(),a=S=>{r||(m(new cI(S)),t.abort?.())},u=()=>{e=!0},f=()=>{e=!1},d=()=>BS.isFocused()&&(t.networkMode==="always"||Ep.isOnline())&&t.canRun(),g=()=>uI(t.networkMode)&&t.canRun(),p=S=>{r||(r=!0,t.onSuccess?.(S),i?.(),s.resolve(S))},m=S=>{r||(r=!0,t.onError?.(S),i?.(),s.reject(S))},v=()=>new Promise(S=>{i=w=>{(r||d())&&S(w)},t.onPause?.()}).then(()=>{i=void 0,r||t.onContinue?.()}),b=()=>{if(r)return;let S;const w=n===0?t.initialPromise:void 0;try{S=w??t.fn()}catch(C){S=Promise.reject(C)}Promise.resolve(S).then(p).catch(C=>{if(r)return;const R=t.retry??(ru?0:3),T=t.retryDelay??jF,A=typeof T=="function"?T(n,C):T,O=R===!0||typeof R=="number"&&n<R||typeof R=="function"&&R(n,C);if(e||!O){m(C);return}n++,t.onFail?.(n,C),PF(A).then(()=>d()?void 0:v()).then(()=>{e?m(C):b()})})};return{promise:s,cancel:a,continue:()=>(i?.(),s),cancelRetry:u,continueRetry:f,canStart:g,start:()=>(g()?b():v().then(b),s)}}var VF=t=>setTimeout(t,0);function FF(){let t=[],e=0,n=u=>{u()},r=u=>{u()},i=VF;const s=u=>{e?t.push(u):i(()=>{n(u)})},a=()=>{const u=t;t=[],u.length&&i(()=>{r(()=>{u.forEach(f=>{n(f)})})})};return{batch:u=>{let f;e++;try{f=u()}finally{e--,e||a()}return f},batchCalls:u=>(...f)=>{s(()=>{u(...f)})},schedule:s,setNotifyFunction:u=>{n=u},setBatchNotifyFunction:u=>{r=u},setScheduler:u=>{i=u}}}var Pr=FF(),dI=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),tx(this.gcTime)&&(this.#e=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(ru?1/0:300*1e3))}clearGcTimeout(){this.#e&&(clearTimeout(this.#e),this.#e=void 0)}},UF=class extends dI{#e;#t;#n;#r;#i;#l;#s;constructor(t){super(),this.#s=!1,this.#l=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#r=t.client,this.#n=this.#r.getQueryCache(),this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#e=$F(this.options),this.state=t.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(t){this.options={...this.#l,...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(t,e){const n=ix(this.state.data,t,this.options);return this.#o({data:n,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),n}setState(t,e){this.#o({type:"setState",state:t,setStateOptions:e})}cancel(t){const e=this.#i?.promise;return this.#i?.cancel(t),e?e.then(pi).catch(pi):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(t=>Qi(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===LS||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Jl(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!sI(this.state.dataUpdatedAt,t)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(this.#i&&(this.#s?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#o({type:"invalidate"})}fetch(t,e){if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(t&&this.setOptions(t),!this.options.queryFn){const f=this.observers.find(d=>d.options.queryFn);f&&this.setOptions(f.options)}const n=new AbortController,r=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{const f=aI(this.options,e),g=(()=>{const p={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(p),p})();return this.#s=!1,this.options.persister?this.options.persister(f,g,this):f(g)},a=(()=>{const f={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:i};return r(f),f})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#o({type:"fetch",meta:a.fetchOptions?.meta});const u=f=>{A0(f)&&f.silent||this.#o({type:"error",error:f}),A0(f)||(this.#n.config.onError?.(f,this),this.#n.config.onSettled?.(this.state.data,f,this)),this.scheduleGc()};return this.#i=fI({initialPromise:e?.initialPromise,fn:a.fetchFn,abort:n.abort.bind(n),onSuccess:f=>{if(f===void 0){u(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(f)}catch(d){u(d);return}this.#n.config.onSuccess?.(f,this),this.#n.config.onSettled?.(f,this.state.error,this),this.scheduleGc()},onError:u,onFail:(f,d)=>{this.#o({type:"failed",failureCount:f,error:d})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}),this.#i.start()}#o(t){const e=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...hI(n.data,this.options),fetchMeta:t.meta??null};case"success":return this.#t=void 0,{...n,data:t.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const r=t.error;return A0(r)&&r.revert&&this.#t?{...this.#t,fetchStatus:"idle"}:{...n,error:r,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=e(this.state),Pr.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:t})})}};function hI(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:uI(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function $F(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var qF=class extends Ld{constructor(t={}){super(),this.config=t,this.#e=new Map}#e;build(t,e,n){const r=e.queryKey,i=e.queryHash??NS(r,e);let s=this.get(i);return s||(s=new UF({client:t,queryKey:r,queryHash:i,options:t.defaultQueryOptions(e),state:n,defaultOptions:t.getQueryDefaults(r)}),this.add(s)),s}add(t){this.#e.has(t.queryHash)||(this.#e.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const e=this.#e.get(t.queryHash);e&&(t.destroy(),e===t&&this.#e.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Pr.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#e.get(t)}getAll(){return[...this.#e.values()]}find(t){const e={exact:!0,...t};return this.getAll().find(n=>sA(e,n))}findAll(t={}){const e=this.getAll();return Object.keys(t).length>0?e.filter(n=>sA(t,n)):e}notify(t){Pr.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){Pr.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Pr.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},GF=class extends dI{#e;#t;#n;constructor(t){super(),this.mutationId=t.mutationId,this.#t=t.mutationCache,this.#e=[],this.state=t.state||WF(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#e.includes(t)||(this.#e.push(t),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#e=this.#e.filter(e=>e!==t),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#t.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(t){const e=()=>{this.#r({type:"continue"})};this.#n=fI({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(i,s)=>{this.#r({type:"failed",failureCount:i,error:s})},onPause:()=>{this.#r({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});const n=this.state.status==="pending",r=!this.#n.canStart();try{if(n)e();else{this.#r({type:"pending",variables:t,isPaused:r}),await this.#t.config.onMutate?.(t,this);const s=await this.options.onMutate?.(t);s!==this.state.context&&this.#r({type:"pending",context:s,variables:t,isPaused:r})}const i=await this.#n.start();return await this.#t.config.onSuccess?.(i,t,this.state.context,this),await this.options.onSuccess?.(i,t,this.state.context),await this.#t.config.onSettled?.(i,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(i,null,t,this.state.context),this.#r({type:"success",data:i}),i}catch(i){try{throw await this.#t.config.onError?.(i,t,this.state.context,this),await this.options.onError?.(i,t,this.state.context),await this.#t.config.onSettled?.(void 0,i,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,i,t,this.state.context),i}finally{this.#r({type:"error",error:i})}}finally{this.#t.runNext(this)}}#r(t){const e=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=e(this.state),Pr.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(t)}),this.#t.notify({mutation:this,type:"updated",action:t})})}};function WF(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var KF=class extends Ld{constructor(t={}){super(),this.config=t,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(t,e,n){const r=new GF({mutationCache:this,mutationId:++this.#n,options:t.defaultMutationOptions(e),state:n});return this.add(r),r}add(t){this.#e.add(t);const e=pg(t);if(typeof e=="string"){const n=this.#t.get(e);n?n.push(t):this.#t.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#e.delete(t)){const e=pg(t);if(typeof e=="string"){const n=this.#t.get(e);if(n)if(n.length>1){const r=n.indexOf(t);r!==-1&&n.splice(r,1)}else n[0]===t&&this.#t.delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){const e=pg(t);if(typeof e=="string"){const r=this.#t.get(e)?.find(i=>i.state.status==="pending");return!r||r===t}else return!0}runNext(t){const e=pg(t);return typeof e=="string"?this.#t.get(e)?.find(r=>r!==t&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Pr.batch(()=>{this.#e.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(t){const e={exact:!0,...t};return this.getAll().find(n=>lA(e,n))}findAll(t={}){return this.getAll().filter(e=>lA(t,e))}notify(t){Pr.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){const t=this.getAll().filter(e=>e.state.isPaused);return Pr.batch(()=>Promise.all(t.map(e=>e.continue().catch(pi))))}};function pg(t){return t.options.scope?.id}function Tp(t){return{onFetch:(e,n)=>{const r=e.options,i=e.fetchOptions?.meta?.fetchMore?.direction,s=e.state.data?.pages||[],a=e.state.data?.pageParams||[];let u={pages:[],pageParams:[]},f=0;const d=async()=>{let g=!1;const p=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(e.signal.aborted?g=!0:e.signal.addEventListener("abort",()=>{g=!0}),e.signal)})},m=aI(e.options,e.fetchOptions),v=async(b,S,w)=>{if(g)return Promise.reject();if(S==null&&b.pages.length)return Promise.resolve(b);const R=(()=>{const P={client:e.client,queryKey:e.queryKey,pageParam:S,direction:w?"backward":"forward",meta:e.options.meta};return p(P),P})(),T=await m(R),{maxPages:A}=e.options,O=w?LF:NF;return{pages:O(b.pages,T,A),pageParams:O(b.pageParams,S,A)}};if(i&&s.length){const b=i==="backward",S=b?gI:sx,w={pages:s,pageParams:a},C=S(r,w);u=await v(w,C,b)}else{const b=t??s.length;do{const S=f===0?a[0]??r.initialPageParam:sx(r,u);if(f>0&&S==null)break;u=await v(u,S),f++}while(f<b)}return u};e.options.persister?e.fetchFn=()=>e.options.persister?.(d,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n):e.fetchFn=d}}}function sx(t,{pages:e,pageParams:n}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,n[r],n):void 0}function gI(t,{pages:e,pageParams:n}){return e.length>0?t.getPreviousPageParam?.(e[0],e,n[0],n):void 0}function YF(t,e){return e?sx(t,e)!=null:!1}function XF(t,e){return!e||!t.getPreviousPageParam?!1:gI(t,e)!=null}var QF=class{#e;#t;#n;#r;#i;#l;#s;#o;constructor(t={}){this.#e=t.queryCache||new qF,this.#t=t.mutationCache||new KF,this.#n=t.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#l=0}mount(){this.#l++,this.#l===1&&(this.#s=BS.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#o=Ep.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#l--,this.#l===0&&(this.#s?.(),this.#s=void 0,this.#o?.(),this.#o=void 0)}isFetching(t){return this.#e.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#t.findAll({...t,status:"pending"}).length}getQueryData(t){const e=this.defaultQueryOptions({queryKey:t});return this.#e.get(e.queryHash)?.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=this.#e.build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(Jl(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return this.#e.findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),s=this.#e.get(r.queryHash)?.state.data,a=DF(e,s);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(t,e,n){return Pr.batch(()=>this.#e.findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return this.#e.get(e.queryHash)?.state}removeQueries(t){const e=this.#e;Pr.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=this.#e;return Pr.batch(()=>(n.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=Pr.batch(()=>this.#e.findAll(t).map(i=>i.cancel(n)));return Promise.all(r).then(pi).catch(pi)}invalidateQueries(t,e={}){return Pr.batch(()=>(this.#e.findAll(t).forEach(n=>{n.invalidate()}),t?.refetchType==="none"?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},r=Pr.batch(()=>this.#e.findAll(t).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(pi)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(pi)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=this.#e.build(this,e);return n.isStaleByTime(Jl(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(pi).catch(pi)}fetchInfiniteQuery(t){return t.behavior=Tp(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(pi).catch(pi)}ensureInfiniteQueryData(t){return t.behavior=Tp(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return Ep.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(t){this.#n=t}setQueryDefaults(t,e){this.#r.set(dd(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...this.#r.values()],n={};return e.forEach(r=>{hd(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){this.#i.set(dd(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...this.#i.values()],n={};return e.forEach(r=>{hd(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...this.#n.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=NS(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===LS&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...this.#n.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},pI=class extends Ld{constructor(t,e){super(),this.options=e,this.#e=t,this.#o=null,this.#s=ox(),this.options.experimental_prefetchInRender||this.#s.reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(e)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#l;#s;#o;#p;#d;#h;#u;#c;#a;#g=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),cA(this.#t,this.options)?this.#f():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return lx(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return lx(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#S(),this.#t.removeObserver(this)}setOptions(t){const e=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Qi(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#t.setOptions(this.options),e._defaulted&&!nx(this.options,e)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&fA(this.#t,n,this.options,e)&&this.#f(),this.updateResult(),r&&(this.#t!==n||Qi(this.options.enabled,this.#t)!==Qi(e.enabled,this.#t)||Jl(this.options.staleTime,this.#t)!==Jl(e.staleTime,this.#t))&&this.#m();const i=this.#y();r&&(this.#t!==n||Qi(this.options.enabled,this.#t)!==Qi(e.enabled,this.#t)||i!==this.#a)&&this.#v(i)}getOptimisticResult(t){const e=this.#e.getQueryCache().build(this.#e,t),n=this.createResult(e,t);return JF(this,n)&&(this.#r=n,this.#l=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(t,e){return new Proxy(t,{get:(n,r)=>(this.trackProp(r),e?.(r),Reflect.get(n,r))})}trackProp(t){this.#g.add(t)}getCurrentQuery(){return this.#t}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#e.defaultQueryOptions(t),n=this.#e.getQueryCache().build(this.#e,e);return n.fetch().then(()=>this.createResult(n,e))}fetch(t){return this.#f({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#f(t){this.#w();let e=this.#t.fetch(this.options,t);return t?.throwOnError||(e=e.catch(pi)),e}#m(){this.#x();const t=Jl(this.options.staleTime,this.#t);if(ru||this.#r.isStale||!tx(t))return;const n=sI(this.#r.dataUpdatedAt,t)+1;this.#u=setTimeout(()=>{this.#r.isStale||this.updateResult()},n)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(t){this.#S(),this.#a=t,!(ru||Qi(this.options.enabled,this.#t)===!1||!tx(this.#a)||this.#a===0)&&(this.#c=setInterval(()=>{(this.options.refetchIntervalInBackground||BS.isFocused())&&this.#f()},this.#a))}#b(){this.#m(),this.#v(this.#y())}#x(){this.#u&&(clearTimeout(this.#u),this.#u=void 0)}#S(){this.#c&&(clearInterval(this.#c),this.#c=void 0)}createResult(t,e){const n=this.#t,r=this.options,i=this.#r,s=this.#i,a=this.#l,f=t!==n?t.state:this.#n,{state:d}=t;let g={...d},p=!1,m;if(e._optimisticResults){const D=this.hasListeners(),L=!D&&cA(t,e),H=D&&fA(t,n,e,r);(L||H)&&(g={...g,...hI(d.data,t.options)}),e._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:v,errorUpdatedAt:b,status:S}=g;m=g.data;let w=!1;if(e.placeholderData!==void 0&&m===void 0&&S==="pending"){let D;i?.isPlaceholderData&&e.placeholderData===a?.placeholderData?(D=i.data,w=!0):D=typeof e.placeholderData=="function"?e.placeholderData(this.#h?.state.data,this.#h):e.placeholderData,D!==void 0&&(S="success",m=ix(i?.data,D,e),p=!0)}if(e.select&&m!==void 0&&!w)if(i&&m===s?.data&&e.select===this.#p)m=this.#d;else try{this.#p=e.select,m=e.select(m),m=ix(i?.data,m,e),this.#d=m,this.#o=null}catch(D){this.#o=D}this.#o&&(v=this.#o,m=this.#d,b=Date.now(),S="error");const C=g.fetchStatus==="fetching",R=S==="pending",T=S==="error",A=R&&C,O=m!==void 0,M={status:S,fetchStatus:g.fetchStatus,isPending:R,isSuccess:S==="success",isError:T,isInitialLoading:A,isLoading:A,data:m,dataUpdatedAt:g.dataUpdatedAt,error:v,errorUpdatedAt:b,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:g.dataUpdateCount>0||g.errorUpdateCount>0,isFetchedAfterMount:g.dataUpdateCount>f.dataUpdateCount||g.errorUpdateCount>f.errorUpdateCount,isFetching:C,isRefetching:C&&!R,isLoadingError:T&&!O,isPaused:g.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:T&&O,isStale:_S(t,e),refetch:this.refetch,promise:this.#s,isEnabled:Qi(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const D=N=>{M.status==="error"?N.reject(M.error):M.data!==void 0&&N.resolve(M.data)},L=()=>{const N=this.#s=M.promise=ox();D(N)},H=this.#s;switch(H.status){case"pending":t.queryHash===n.queryHash&&D(H);break;case"fulfilled":(M.status==="error"||M.data!==H.value)&&L();break;case"rejected":(M.status!=="error"||M.error!==H.reason)&&L();break}}return M}updateResult(){const t=this.#r,e=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#l=this.options,this.#i.data!==void 0&&(this.#h=this.#t),nx(e,t))return;this.#r=e;const n=()=>{if(!t)return!0;const{notifyOnChangeProps:r}=this.options,i=typeof r=="function"?r():r;if(i==="all"||!i&&!this.#g.size)return!0;const s=new Set(i??this.#g);return this.options.throwOnError&&s.add("error"),Object.keys(this.#r).some(a=>{const u=a;return this.#r[u]!==t[u]&&s.has(u)})};this.#C({listeners:n()})}#w(){const t=this.#e.getQueryCache().build(this.#e,this.options);if(t===this.#t)return;const e=this.#t;this.#t=t,this.#n=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#C(t){Pr.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function ZF(t,e){return Qi(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function cA(t,e){return ZF(t,e)||t.state.data!==void 0&&lx(t,e,e.refetchOnMount)}function lx(t,e,n){if(Qi(e.enabled,t)!==!1&&Jl(e.staleTime,t)!=="static"){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&_S(t,e)}return!1}function fA(t,e,n,r){return(t!==e||Qi(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&_S(t,n)}function _S(t,e){return Qi(e.enabled,t)!==!1&&t.isStaleByTime(Jl(e.staleTime,t))}function JF(t,e){return!nx(t.getCurrentResult(),e)}var e4=class extends pI{constructor(t,e){super(t,e)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(t){super.setOptions({...t,behavior:Tp()})}getOptimisticResult(t){return t.behavior=Tp(),super.getOptimisticResult(t)}fetchNextPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"backward"}}})}createResult(t,e){const{state:n}=t,r=super.createResult(t,e),{isFetching:i,isRefetching:s,isError:a,isRefetchError:u}=r,f=n.fetchMeta?.fetchMore?.direction,d=a&&f==="forward",g=i&&f==="forward",p=a&&f==="backward",m=i&&f==="backward";return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:YF(e,n.data),hasPreviousPage:XF(e,n.data),isFetchNextPageError:d,isFetchingNextPage:g,isFetchPreviousPageError:p,isFetchingPreviousPage:m,isRefetchError:u&&!d&&!p,isRefetching:s&&!g&&!m}}},mI=E.createContext(void 0),HS=t=>{const e=E.useContext(mI);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},t4=({client:t,children:e})=>(E.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),I.jsx(mI.Provider,{value:t,children:e})),yI=E.createContext(!1),n4=()=>E.useContext(yI);yI.Provider;function r4(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var i4=E.createContext(r4()),o4=()=>E.useContext(i4),s4=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOnMount=!1))},l4=t=>{E.useEffect(()=>{t.clearReset()},[t])},a4=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:i})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(i&&t.data===void 0||BF(n,[t.error,r])),u4=t=>{if(t.suspense){const e=r=>r==="static"?r:Math.max(r??1e3,1e3),n=t.staleTime;t.staleTime=typeof n=="function"?(...r)=>e(n(...r)):e(n),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},c4=(t,e)=>t.isLoading&&t.isFetching&&!e,f4=(t,e)=>t?.suspense&&e.isPending,dA=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function vI(t,e,n){const r=n4(),i=o4(),s=HS(),a=s.defaultQueryOptions(t);s.getDefaultOptions().queries?._experimental_beforeQuery?.(a),a._optimisticResults=r?"isRestoring":"optimistic",u4(a),s4(a,i),l4(i);const u=!s.getQueryCache().get(a.queryHash),[f]=E.useState(()=>new e(s,a)),d=f.getOptimisticResult(a),g=!r&&t.subscribed!==!1;if(E.useSyncExternalStore(E.useCallback(p=>{const m=g?f.subscribe(Pr.batchCalls(p)):pi;return f.updateResult(),m},[f,g]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),E.useEffect(()=>{f.setOptions(a)},[a,f]),f4(a,d))throw dA(a,f,i);if(a4({result:d,errorResetBoundary:i,throwOnError:a.throwOnError,query:s.getQueryCache().get(a.queryHash),suspense:a.suspense}))throw d.error;return s.getDefaultOptions().queries?._experimental_afterQuery?.(a,d),a.experimental_prefetchInRender&&!ru&&c4(d,r)&&(u?dA(a,f,i):s.getQueryCache().get(a.queryHash)?.promise)?.catch(pi).finally(()=>{f.updateResult()}),a.notifyOnChangeProps?d:f.trackResult(d)}function d4(t,e){return vI(t,pI)}function h4(t,e){return vI(t,e4)}const bI=()=>typeof window<"u"&&typeof window.document<"u",g4=()=>bI()&&typeof window.__ROZENITE_WEB__<"u",p4=()=>typeof window>"u";let xI=class extends Error{constructor(e){super(`Unsupported platform: ${e}`),this.name="UnsupportedPlatformError"}},SI=class extends Error{constructor(){super("Rozenite for web is not configured. A separate integration is required for web. Consult Rozenite docs for details."),this.name="MissingRozeniteForWebError"}};const jS="rozenite",m4=()=>{const t=self.__FUSEBOX_REACT_DEVTOOLS_DISPATCHER__,e=t.BINDING_NAME;return self[e]!=null?t.initializeDomain(jS):null},y4=()=>new Promise(t=>{const e=n=>{n.name===jS&&(self.__FUSEBOX_REACT_DEVTOOLS_DISPATCHER__.onDomainInitialization.removeEventListener(e),setTimeout(()=>t(n)))};self.__FUSEBOX_REACT_DEVTOOLS_DISPATCHER__.onDomainInitialization.addEventListener(e)}),v4=async()=>{const t=new Set;let e=m4();e||(e=await y4());const n=()=>{if(!e)throw new Error("Domain not initialized");return e},r=i=>{i.name===jS&&(e&&t.forEach(s=>{e.onMessage.removeEventListener(s)}),e=i,t.forEach(s=>{i.onMessage.addEventListener(s)}))};return self.__FUSEBOX_REACT_DEVTOOLS_DISPATCHER__.onDomainInitialization.addEventListener(r),{send:i=>{n().sendMessage(i)},onMessage(i){const s=a=>{setTimeout(()=>{i(a)})};return t.add(s),n().onMessage.addEventListener(s),{remove:()=>{t.delete(s),n().onMessage.removeEventListener(s)}}},close:()=>{self.__FUSEBOX_REACT_DEVTOOLS_DISPATCHER__.onDomainInitialization.removeEventListener(r)}}},b4=async()=>{if(bI()&&!g4())throw new SI;if(p4())throw new xI("server");return v4()},x4=async()=>{const t=new Set,e=n=>{t.forEach(r=>{r(n.data)})};return window.addEventListener("message",e),{send:n=>{window.parent.postMessage({type:"rozenite-message",payload:n},"*")},onMessage:n=>(t.add(n),{remove:()=>{t.delete(n)}}),close:()=>{t.clear(),window.removeEventListener("message",e)}}};let Of=null;const S4=async()=>{if(Of)return Of;const t="__ROZENITE_PANEL__"in window?x4():b4();Of=t;try{const e=await t;return Of=e,e}catch(e){throw Of=null,e}},w4=t=>typeof t!="object"||t===null||!("type"in t)||!("payload"in t)||!("pluginId"in t)?null:t;let hA=class extends Error{constructor(e){super(`Request "${e}" was aborted.`),this.requestId=e,this.name="RozeniteDevToolsRequestAbortedError"}},C4=class extends Error{constructor(e,n){super(`Request "${e}" timed out after ${n}ms.`),this.requestId=e,this.timeoutMs=n,this.name="RozeniteDevToolsRequestTimeoutError"}},gA=class extends Error{constructor(e){super(`Request "${e}" was cancelled because the client closed.`),this.requestId=e,this.name="RozeniteDevToolsRequestClientClosedError"}},R4=class extends Error{constructor(e){super(`Request "${e.requestId}" received an error response.`),this.payload=e,this.name="RozeniteDevToolsRequestResponseError"}};const E4=3e4;let pA=0;const T4=()=>typeof globalThis.crypto?.randomUUID=="function"?globalThis.crypto.randomUUID():(pA+=1,`rozenite-${Date.now()}-${pA}`),A4=async t=>{const e=await S4(),n=new Map,r=new Set;let i=!1;const s=async d=>{const g=w4(d);if(!g||g.pluginId!==t)return;n.get(g.type)?.forEach(m=>{m(g.payload)})},a=(d,g)=>{e.send({pluginId:t,type:d,payload:g})},u=e.onMessage(s),f={send:a,onMessage:(d,g)=>{const p=n.get(d)??new Set;return p.add(g),n.set(d,p),{remove:()=>{p.delete(g),p.size===0&&n.delete(d)}}},request:d=>{const g=d.requestId??T4(),p=d.timeoutMs??E4;return!Number.isFinite(p)||p<0?Promise.reject(new RangeError("timeoutMs must be a finite, non-negative number.")):i?Promise.reject(new gA(g)):d.signal?.aborted?Promise.reject(new hA(g)):new Promise((m,v)=>{let b=!1;const S=()=>{R(new hA(g))},w=()=>{A.remove(),O?.remove(),clearTimeout(P),d.signal?.removeEventListener("abort",S),r.delete(T)},C=M=>{b||(b=!0,w(),M())},R=M=>{C(()=>{v(M)})},T=()=>{R(new gA(g))},A=f.onMessage(d.responseType,M=>{M.requestId===g&&C(()=>{m(M)})}),O=d.errorType!=null?f.onMessage(d.errorType,M=>{M.requestId===g&&C(()=>{v(new R4(M))})}):void 0;d.signal?.addEventListener("abort",S,{once:!0}),r.add(T);const P=setTimeout(()=>{R(new C4(g,p))},p);try{f.send(d.requestType,{...d.payload,requestId:g})}catch(M){R(M instanceof Error?M:new Error(String(M)))}})},close:()=>{i||(i=!0,r.forEach(d=>{d()}),n.clear(),u.remove(),e.close())}};return f},M4=async t=>A4(t),O4=()=>"__ROZENITE_PANEL__"in globalThis,k4=({pluginId:t})=>{const[e,n]=E.useState(null),[r,i]=E.useState(null);if(E.useEffect(()=>{let s=!0,a=null;const u=async()=>{try{a=await M4(t),s&&n(a)}catch(d){if(d instanceof SI){console.warn(`[Rozenite, ${t}] Rozenite for web is not configured. A separate integration is required for web. Consult Rozenite docs for details.`);return}if(d instanceof xI){console.warn(`[Rozenite, ${t}] Unsupported platform, skipping setup.`);return}console.error(`[Rozenite, ${t}] Error setting up client.`,d),s&&i(d)}},f=async()=>{try{a?.close()}catch{}};return u(),()=>{s=!1,f()}},[t]),r!=null)throw r;return E.useEffect(()=>{if(!e||O4())return;const s=e,a=setTimeout(()=>{s.send("plugin-mounted",{pluginId:t})},0);return()=>{clearTimeout(a)}},[e,t]),e};function wI(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=wI(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function CI(){for(var t,e,n=0,r="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=wI(t))&&(r&&(r+=" "),r+=e);return r}const I4=(t,e)=>{const n=new Array(t.length+e.length);for(let r=0;r<t.length;r++)n[r]=t[r];for(let r=0;r<e.length;r++)n[t.length+r]=e[r];return n},D4=(t,e)=>({classGroupId:t,validator:e}),RI=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),Ap="-",mA=[],P4="arbitrary..",z4=t=>{const e=L4(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return N4(a);const u=a.split(Ap),f=u[0]===""&&u.length>1?1:0;return EI(u,f,e)},getConflictingClassGroupIds:(a,u)=>{if(u){const f=r[a],d=n[a];return f?d?I4(d,f):f:d||mA}return n[a]||mA}}},EI=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const i=t[e],s=n.nextPart.get(i);if(s){const d=EI(t,e+1,s);if(d)return d}const a=n.validators;if(a===null)return;const u=e===0?t.join(Ap):t.slice(e).join(Ap),f=a.length;for(let d=0;d<f;d++){const g=a[d];if(g.validator(u))return g.classGroupId}},N4=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),r=e.slice(0,n);return r?P4+r:void 0})(),L4=t=>{const{theme:e,classGroups:n}=t;return B4(n,e)},B4=(t,e)=>{const n=RI();for(const r in t){const i=t[r];VS(i,n,r,e)}return n},VS=(t,e,n,r)=>{const i=t.length;for(let s=0;s<i;s++){const a=t[s];_4(a,e,n,r)}},_4=(t,e,n,r)=>{if(typeof t=="string"){H4(t,e,n);return}if(typeof t=="function"){j4(t,e,n,r);return}V4(t,e,n,r)},H4=(t,e,n)=>{const r=t===""?e:TI(e,t);r.classGroupId=n},j4=(t,e,n,r)=>{if(F4(t)){VS(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(D4(n,t))},V4=(t,e,n,r)=>{const i=Object.entries(t),s=i.length;for(let a=0;a<s;a++){const[u,f]=i[a];VS(f,TI(e,u),n,r)}},TI=(t,e)=>{let n=t;const r=e.split(Ap),i=r.length;for(let s=0;s<i;s++){const a=r[s];let u=n.nextPart.get(a);u||(u=RI(),n.nextPart.set(a,u)),n=u}return n},F4=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,U4=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),r=Object.create(null);const i=(s,a)=>{n[s]=a,e++,e>t&&(e=0,r=n,n=Object.create(null))};return{get(s){let a=n[s];if(a!==void 0)return a;if((a=r[s])!==void 0)return i(s,a),a},set(s,a){s in n?n[s]=a:i(s,a)}}},ax="!",yA=":",$4=[],vA=(t,e,n,r,i)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),q4=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=i=>{const s=[];let a=0,u=0,f=0,d;const g=i.length;for(let S=0;S<g;S++){const w=i[S];if(a===0&&u===0){if(w===yA){s.push(i.slice(f,S)),f=S+1;continue}if(w==="/"){d=S;continue}}w==="["?a++:w==="]"?a--:w==="("?u++:w===")"&&u--}const p=s.length===0?i:i.slice(f);let m=p,v=!1;p.endsWith(ax)?(m=p.slice(0,-1),v=!0):p.startsWith(ax)&&(m=p.slice(1),v=!0);const b=d&&d>f?d-f:void 0;return vA(s,v,m,b)};if(e){const i=e+yA,s=r;r=a=>a.startsWith(i)?s(a.slice(i.length)):vA($4,!1,a,void 0,!0)}if(n){const i=r;r=s=>n({className:s,parseClassName:i})}return r},G4=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,r)=>{e.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let s=0;s<n.length;s++){const a=n[s],u=a[0]==="[",f=e.has(a);u||f?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(a)):i.push(a)}return i.length>0&&(i.sort(),r.push(...i)),r}},W4=t=>({cache:U4(t.cacheSize),parseClassName:q4(t),sortModifiers:G4(t),...z4(t)}),K4=/\s+/,Y4=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:s}=e,a=[],u=t.trim().split(K4);let f="";for(let d=u.length-1;d>=0;d-=1){const g=u[d],{isExternal:p,modifiers:m,hasImportantModifier:v,baseClassName:b,maybePostfixModifierPosition:S}=n(g);if(p){f=g+(f.length>0?" "+f:f);continue}let w=!!S,C=r(w?b.substring(0,S):b);if(!C){if(!w){f=g+(f.length>0?" "+f:f);continue}if(C=r(b),!C){f=g+(f.length>0?" "+f:f);continue}w=!1}const R=m.length===0?"":m.length===1?m[0]:s(m).join(":"),T=v?R+ax:R,A=T+C;if(a.indexOf(A)>-1)continue;a.push(A);const O=i(C,w);for(let P=0;P<O.length;++P){const M=O[P];a.push(T+M)}f=g+(f.length>0?" "+f:f)}return f},X4=(...t)=>{let e=0,n,r,i="";for(;e<t.length;)(n=t[e++])&&(r=AI(n))&&(i&&(i+=" "),i+=r);return i},AI=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=AI(t[r]))&&(n&&(n+=" "),n+=e);return n},Q4=(t,...e)=>{let n,r,i,s;const a=f=>{const d=e.reduce((g,p)=>p(g),t());return n=W4(d),r=n.cache.get,i=n.cache.set,s=u,u(f)},u=f=>{const d=r(f);if(d)return d;const g=Y4(f,n);return i(f,g),g};return s=a,(...f)=>s(X4(...f))},Z4=[],pr=t=>{const e=n=>n[t]||Z4;return e.isThemeGetter=!0,e},MI=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,OI=/^\((?:(\w[\w-]*):)?(.+)\)$/i,J4=/^\d+\/\d+$/,e5=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,t5=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,n5=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,r5=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,i5=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Qu=t=>J4.test(t),Ot=t=>!!t&&!Number.isNaN(Number(t)),$l=t=>!!t&&Number.isInteger(Number(t)),M0=t=>t.endsWith("%")&&Ot(t.slice(0,-1)),Us=t=>e5.test(t),o5=()=>!0,s5=t=>t5.test(t)&&!n5.test(t),kI=()=>!1,l5=t=>r5.test(t),a5=t=>i5.test(t),u5=t=>!Ke(t)&&!Ye(t),c5=t=>Dc(t,PI,kI),Ke=t=>MI.test(t),Va=t=>Dc(t,zI,s5),O0=t=>Dc(t,p5,Ot),bA=t=>Dc(t,II,kI),f5=t=>Dc(t,DI,a5),mg=t=>Dc(t,NI,l5),Ye=t=>OI.test(t),kf=t=>Pc(t,zI),d5=t=>Pc(t,m5),xA=t=>Pc(t,II),h5=t=>Pc(t,PI),g5=t=>Pc(t,DI),yg=t=>Pc(t,NI,!0),Dc=(t,e,n)=>{const r=MI.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},Pc=(t,e,n=!1)=>{const r=OI.exec(t);return r?r[1]?e(r[1]):n:!1},II=t=>t==="position"||t==="percentage",DI=t=>t==="image"||t==="url",PI=t=>t==="length"||t==="size"||t==="bg-size",zI=t=>t==="length",p5=t=>t==="number",m5=t=>t==="family-name",NI=t=>t==="shadow",y5=()=>{const t=pr("color"),e=pr("font"),n=pr("text"),r=pr("font-weight"),i=pr("tracking"),s=pr("leading"),a=pr("breakpoint"),u=pr("container"),f=pr("spacing"),d=pr("radius"),g=pr("shadow"),p=pr("inset-shadow"),m=pr("text-shadow"),v=pr("drop-shadow"),b=pr("blur"),S=pr("perspective"),w=pr("aspect"),C=pr("ease"),R=pr("animate"),T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],O=()=>[...A(),Ye,Ke],P=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto","contain","none"],D=()=>[Ye,Ke,f],L=()=>[Qu,"full","auto",...D()],H=()=>[$l,"none","subgrid",Ye,Ke],N=()=>["auto",{span:["full",$l,Ye,Ke]},$l,Ye,Ke],_=()=>[$l,"auto",Ye,Ke],$=()=>["auto","min","max","fr",Ye,Ke],F=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],G=()=>["start","end","center","stretch","center-safe","end-safe"],j=()=>["auto",...D()],q=()=>[Qu,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...D()],V=()=>[t,Ye,Ke],te=()=>[...A(),xA,bA,{position:[Ye,Ke]}],J=()=>["no-repeat",{repeat:["","x","y","space","round"]}],z=()=>["auto","cover","contain",h5,c5,{size:[Ye,Ke]}],U=()=>[M0,kf,Va],W=()=>["","none","full",d,Ye,Ke],X=()=>["",Ot,kf,Va],ie=()=>["solid","dashed","dotted","double"],ee=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ue=()=>[Ot,M0,xA,bA],Y=()=>["","none",b,Ye,Ke],le=()=>["none",Ot,Ye,Ke],xe=()=>["none",Ot,Ye,Ke],ve=()=>[Ot,Ye,Ke],de=()=>[Qu,"full",...D()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Us],breakpoint:[Us],color:[o5],container:[Us],"drop-shadow":[Us],ease:["in","out","in-out"],font:[u5],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Us],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Us],shadow:[Us],spacing:["px",Ot],text:[Us],"text-shadow":[Us],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Qu,Ke,Ye,w]}],container:["container"],columns:[{columns:[Ot,Ke,Ye,u]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:O()}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:L()}],"inset-x":[{"inset-x":L()}],"inset-y":[{"inset-y":L()}],start:[{start:L()}],end:[{end:L()}],top:[{top:L()}],right:[{right:L()}],bottom:[{bottom:L()}],left:[{left:L()}],visibility:["visible","invisible","collapse"],z:[{z:[$l,"auto",Ye,Ke]}],basis:[{basis:[Qu,"full","auto",u,...D()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ot,Qu,"auto","initial","none",Ke]}],grow:[{grow:["",Ot,Ye,Ke]}],shrink:[{shrink:["",Ot,Ye,Ke]}],order:[{order:[$l,"first","last","none",Ye,Ke]}],"grid-cols":[{"grid-cols":H()}],"col-start-end":[{col:N()}],"col-start":[{"col-start":_()}],"col-end":[{"col-end":_()}],"grid-rows":[{"grid-rows":H()}],"row-start-end":[{row:N()}],"row-start":[{"row-start":_()}],"row-end":[{"row-end":_()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":$()}],"auto-rows":[{"auto-rows":$()}],gap:[{gap:D()}],"gap-x":[{"gap-x":D()}],"gap-y":[{"gap-y":D()}],"justify-content":[{justify:[...F(),"normal"]}],"justify-items":[{"justify-items":[...G(),"normal"]}],"justify-self":[{"justify-self":["auto",...G()]}],"align-content":[{content:["normal",...F()]}],"align-items":[{items:[...G(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...G(),{baseline:["","last"]}]}],"place-content":[{"place-content":F()}],"place-items":[{"place-items":[...G(),"baseline"]}],"place-self":[{"place-self":["auto",...G()]}],p:[{p:D()}],px:[{px:D()}],py:[{py:D()}],ps:[{ps:D()}],pe:[{pe:D()}],pt:[{pt:D()}],pr:[{pr:D()}],pb:[{pb:D()}],pl:[{pl:D()}],m:[{m:j()}],mx:[{mx:j()}],my:[{my:j()}],ms:[{ms:j()}],me:[{me:j()}],mt:[{mt:j()}],mr:[{mr:j()}],mb:[{mb:j()}],ml:[{ml:j()}],"space-x":[{"space-x":D()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":D()}],"space-y-reverse":["space-y-reverse"],size:[{size:q()}],w:[{w:[u,"screen",...q()]}],"min-w":[{"min-w":[u,"screen","none",...q()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[a]},...q()]}],h:[{h:["screen","lh",...q()]}],"min-h":[{"min-h":["screen","lh","none",...q()]}],"max-h":[{"max-h":["screen","lh",...q()]}],"font-size":[{text:["base",n,kf,Va]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Ye,O0]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",M0,Ke]}],"font-family":[{font:[d5,Ke,e]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,Ye,Ke]}],"line-clamp":[{"line-clamp":[Ot,"none",Ye,O0]}],leading:[{leading:[s,...D()]}],"list-image":[{"list-image":["none",Ye,Ke]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ye,Ke]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:V()}],"text-color":[{text:V()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ie(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ot,"from-font","auto",Ye,Va]}],"text-decoration-color":[{decoration:V()}],"underline-offset":[{"underline-offset":[Ot,"auto",Ye,Ke]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ye,Ke]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ye,Ke]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:te()}],"bg-repeat":[{bg:J()}],"bg-size":[{bg:z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},$l,Ye,Ke],radial:["",Ye,Ke],conic:[$l,Ye,Ke]},g5,f5]}],"bg-color":[{bg:V()}],"gradient-from-pos":[{from:U()}],"gradient-via-pos":[{via:U()}],"gradient-to-pos":[{to:U()}],"gradient-from":[{from:V()}],"gradient-via":[{via:V()}],"gradient-to":[{to:V()}],rounded:[{rounded:W()}],"rounded-s":[{"rounded-s":W()}],"rounded-e":[{"rounded-e":W()}],"rounded-t":[{"rounded-t":W()}],"rounded-r":[{"rounded-r":W()}],"rounded-b":[{"rounded-b":W()}],"rounded-l":[{"rounded-l":W()}],"rounded-ss":[{"rounded-ss":W()}],"rounded-se":[{"rounded-se":W()}],"rounded-ee":[{"rounded-ee":W()}],"rounded-es":[{"rounded-es":W()}],"rounded-tl":[{"rounded-tl":W()}],"rounded-tr":[{"rounded-tr":W()}],"rounded-br":[{"rounded-br":W()}],"rounded-bl":[{"rounded-bl":W()}],"border-w":[{border:X()}],"border-w-x":[{"border-x":X()}],"border-w-y":[{"border-y":X()}],"border-w-s":[{"border-s":X()}],"border-w-e":[{"border-e":X()}],"border-w-t":[{"border-t":X()}],"border-w-r":[{"border-r":X()}],"border-w-b":[{"border-b":X()}],"border-w-l":[{"border-l":X()}],"divide-x":[{"divide-x":X()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":X()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ie(),"hidden","none"]}],"divide-style":[{divide:[...ie(),"hidden","none"]}],"border-color":[{border:V()}],"border-color-x":[{"border-x":V()}],"border-color-y":[{"border-y":V()}],"border-color-s":[{"border-s":V()}],"border-color-e":[{"border-e":V()}],"border-color-t":[{"border-t":V()}],"border-color-r":[{"border-r":V()}],"border-color-b":[{"border-b":V()}],"border-color-l":[{"border-l":V()}],"divide-color":[{divide:V()}],"outline-style":[{outline:[...ie(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ot,Ye,Ke]}],"outline-w":[{outline:["",Ot,kf,Va]}],"outline-color":[{outline:V()}],shadow:[{shadow:["","none",g,yg,mg]}],"shadow-color":[{shadow:V()}],"inset-shadow":[{"inset-shadow":["none",p,yg,mg]}],"inset-shadow-color":[{"inset-shadow":V()}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:V()}],"ring-offset-w":[{"ring-offset":[Ot,Va]}],"ring-offset-color":[{"ring-offset":V()}],"inset-ring-w":[{"inset-ring":X()}],"inset-ring-color":[{"inset-ring":V()}],"text-shadow":[{"text-shadow":["none",m,yg,mg]}],"text-shadow-color":[{"text-shadow":V()}],opacity:[{opacity:[Ot,Ye,Ke]}],"mix-blend":[{"mix-blend":[...ee(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ee()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ot]}],"mask-image-linear-from-pos":[{"mask-linear-from":ue()}],"mask-image-linear-to-pos":[{"mask-linear-to":ue()}],"mask-image-linear-from-color":[{"mask-linear-from":V()}],"mask-image-linear-to-color":[{"mask-linear-to":V()}],"mask-image-t-from-pos":[{"mask-t-from":ue()}],"mask-image-t-to-pos":[{"mask-t-to":ue()}],"mask-image-t-from-color":[{"mask-t-from":V()}],"mask-image-t-to-color":[{"mask-t-to":V()}],"mask-image-r-from-pos":[{"mask-r-from":ue()}],"mask-image-r-to-pos":[{"mask-r-to":ue()}],"mask-image-r-from-color":[{"mask-r-from":V()}],"mask-image-r-to-color":[{"mask-r-to":V()}],"mask-image-b-from-pos":[{"mask-b-from":ue()}],"mask-image-b-to-pos":[{"mask-b-to":ue()}],"mask-image-b-from-color":[{"mask-b-from":V()}],"mask-image-b-to-color":[{"mask-b-to":V()}],"mask-image-l-from-pos":[{"mask-l-from":ue()}],"mask-image-l-to-pos":[{"mask-l-to":ue()}],"mask-image-l-from-color":[{"mask-l-from":V()}],"mask-image-l-to-color":[{"mask-l-to":V()}],"mask-image-x-from-pos":[{"mask-x-from":ue()}],"mask-image-x-to-pos":[{"mask-x-to":ue()}],"mask-image-x-from-color":[{"mask-x-from":V()}],"mask-image-x-to-color":[{"mask-x-to":V()}],"mask-image-y-from-pos":[{"mask-y-from":ue()}],"mask-image-y-to-pos":[{"mask-y-to":ue()}],"mask-image-y-from-color":[{"mask-y-from":V()}],"mask-image-y-to-color":[{"mask-y-to":V()}],"mask-image-radial":[{"mask-radial":[Ye,Ke]}],"mask-image-radial-from-pos":[{"mask-radial-from":ue()}],"mask-image-radial-to-pos":[{"mask-radial-to":ue()}],"mask-image-radial-from-color":[{"mask-radial-from":V()}],"mask-image-radial-to-color":[{"mask-radial-to":V()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":A()}],"mask-image-conic-pos":[{"mask-conic":[Ot]}],"mask-image-conic-from-pos":[{"mask-conic-from":ue()}],"mask-image-conic-to-pos":[{"mask-conic-to":ue()}],"mask-image-conic-from-color":[{"mask-conic-from":V()}],"mask-image-conic-to-color":[{"mask-conic-to":V()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:te()}],"mask-repeat":[{mask:J()}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ye,Ke]}],filter:[{filter:["","none",Ye,Ke]}],blur:[{blur:Y()}],brightness:[{brightness:[Ot,Ye,Ke]}],contrast:[{contrast:[Ot,Ye,Ke]}],"drop-shadow":[{"drop-shadow":["","none",v,yg,mg]}],"drop-shadow-color":[{"drop-shadow":V()}],grayscale:[{grayscale:["",Ot,Ye,Ke]}],"hue-rotate":[{"hue-rotate":[Ot,Ye,Ke]}],invert:[{invert:["",Ot,Ye,Ke]}],saturate:[{saturate:[Ot,Ye,Ke]}],sepia:[{sepia:["",Ot,Ye,Ke]}],"backdrop-filter":[{"backdrop-filter":["","none",Ye,Ke]}],"backdrop-blur":[{"backdrop-blur":Y()}],"backdrop-brightness":[{"backdrop-brightness":[Ot,Ye,Ke]}],"backdrop-contrast":[{"backdrop-contrast":[Ot,Ye,Ke]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ot,Ye,Ke]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ot,Ye,Ke]}],"backdrop-invert":[{"backdrop-invert":["",Ot,Ye,Ke]}],"backdrop-opacity":[{"backdrop-opacity":[Ot,Ye,Ke]}],"backdrop-saturate":[{"backdrop-saturate":[Ot,Ye,Ke]}],"backdrop-sepia":[{"backdrop-sepia":["",Ot,Ye,Ke]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":D()}],"border-spacing-x":[{"border-spacing-x":D()}],"border-spacing-y":[{"border-spacing-y":D()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ye,Ke]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ot,"initial",Ye,Ke]}],ease:[{ease:["linear","initial",C,Ye,Ke]}],delay:[{delay:[Ot,Ye,Ke]}],animate:[{animate:["none",R,Ye,Ke]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,Ye,Ke]}],"perspective-origin":[{"perspective-origin":O()}],rotate:[{rotate:le()}],"rotate-x":[{"rotate-x":le()}],"rotate-y":[{"rotate-y":le()}],"rotate-z":[{"rotate-z":le()}],scale:[{scale:xe()}],"scale-x":[{"scale-x":xe()}],"scale-y":[{"scale-y":xe()}],"scale-z":[{"scale-z":xe()}],"scale-3d":["scale-3d"],skew:[{skew:ve()}],"skew-x":[{"skew-x":ve()}],"skew-y":[{"skew-y":ve()}],transform:[{transform:[Ye,Ke,"","none","gpu","cpu"]}],"transform-origin":[{origin:O()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:de()}],"translate-x":[{"translate-x":de()}],"translate-y":[{"translate-y":de()}],"translate-z":[{"translate-z":de()}],"translate-none":["translate-none"],accent:[{accent:V()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:V()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ye,Ke]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ye,Ke]}],fill:[{fill:["none",...V()]}],"stroke-w":[{stroke:[Ot,kf,Va,O0]}],stroke:[{stroke:["none",...V()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},v5=Q4(y5);function b5(t,e){const n=getComputedStyle(t),r=parseFloat(n.fontSize);return e*r}function x5(t,e){const n=getComputedStyle(t.ownerDocument.documentElement),r=parseFloat(n.fontSize);return e*r}function S5(t){return t/100*window.innerHeight}function w5(t){return t/100*window.innerWidth}function C5(t){switch(typeof t){case"number":return[t,"px"];case"string":{const e=parseFloat(t);return t.endsWith("%")?[e,"%"]:t.endsWith("px")?[e,"px"]:t.endsWith("rem")?[e,"rem"]:t.endsWith("em")?[e,"em"]:t.endsWith("vh")?[e,"vh"]:t.endsWith("vw")?[e,"vw"]:[e,"%"]}}}function Hf({groupSize:t,panelElement:e,styleProp:n}){let r;const[i,s]=C5(n);switch(s){case"%":{r=i/100*t;break}case"px":{r=i;break}case"rem":{r=x5(e,i);break}case"em":{r=b5(e,i);break}case"vh":{r=S5(i);break}case"vw":{r=w5(i);break}}return r}function ri(t){return parseFloat(t.toFixed(3))}function yc({group:t}){const{orientation:e,panels:n}=t;return n.reduce((r,i)=>(r+=e==="horizontal"?i.element.offsetWidth:i.element.offsetHeight,r),0)}function ux(t){const{panels:e}=t,n=yc({group:t});return n===0?e.map(r=>({groupResizeBehavior:r.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:r.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:r.panelConstraints.disabled,minSize:0,maxSize:100,panelId:r.id})):e.map(r=>{const{element:i,panelConstraints:s}=r;let a=0;if(s.collapsedSize!==void 0){const g=Hf({groupSize:n,panelElement:i,styleProp:s.collapsedSize});a=ri(g/n*100)}let u;if(s.defaultSize!==void 0){const g=Hf({groupSize:n,panelElement:i,styleProp:s.defaultSize});u=ri(g/n*100)}let f=0;if(s.minSize!==void 0){const g=Hf({groupSize:n,panelElement:i,styleProp:s.minSize});f=ri(g/n*100)}let d=100;if(s.maxSize!==void 0){const g=Hf({groupSize:n,panelElement:i,styleProp:s.maxSize});d=ri(g/n*100)}return{groupResizeBehavior:s.groupResizeBehavior,collapsedSize:a,collapsible:s.collapsible===!0,defaultSize:u,disabled:s.disabled,minSize:f,maxSize:d,panelId:r.id}})}function yn(t,e="Assertion error"){if(!t)throw Error(e)}function cx(t,e){return Array.from(e).sort(t==="horizontal"?R5:E5)}function R5(t,e){const n=t.element.offsetLeft-e.element.offsetLeft;return n!==0?n:t.element.offsetWidth-e.element.offsetWidth}function E5(t,e){const n=t.element.offsetTop-e.element.offsetTop;return n!==0?n:t.element.offsetHeight-e.element.offsetHeight}function LI(t){return t!==null&&typeof t=="object"&&"nodeType"in t&&t.nodeType===Node.ELEMENT_NODE}function BI(t,e){return{x:t.x>=e.left&&t.x<=e.right?0:Math.min(Math.abs(t.x-e.left),Math.abs(t.x-e.right)),y:t.y>=e.top&&t.y<=e.bottom?0:Math.min(Math.abs(t.y-e.top),Math.abs(t.y-e.bottom))}}function T5({orientation:t,rects:e,targetRect:n}){const r={x:n.x+n.width/2,y:n.y+n.height/2};let i,s=Number.MAX_VALUE;for(const a of e){const{x:u,y:f}=BI(r,a),d=t==="horizontal"?u:f;d<s&&(s=d,i=a)}return yn(i,"No rect found"),i}let vg;function A5(){return vg===void 0&&(typeof matchMedia=="function"?vg=!!matchMedia("(pointer:coarse)").matches:vg=!1),vg}function _I(t){const{element:e,orientation:n,panels:r,separators:i}=t,s=cx(n,Array.from(e.children).filter(LI).map(b=>({element:b}))).map(({element:b})=>b),a=[];let u=!1,f=!1,d=-1,g=-1,p=0,m,v=[];{let b=-1;for(const S of s)S.hasAttribute("data-panel")&&(b++,S.hasAttribute("data-disabled")||(p++,d===-1&&(d=b),g=b))}if(p>1){let b=-1;for(const S of s)if(S.hasAttribute("data-panel")){b++;const w=r.find(C=>C.element===S);if(w){if(m){const C=m.element.getBoundingClientRect(),R=S.getBoundingClientRect();let T;if(f){const A=n==="horizontal"?new DOMRect(C.right,C.top,0,C.height):new DOMRect(C.left,C.bottom,C.width,0),O=n==="horizontal"?new DOMRect(R.left,R.top,0,R.height):new DOMRect(R.left,R.top,R.width,0);switch(v.length){case 0:{T=[A,O];break}case 1:{const P=v[0],M=T5({orientation:n,rects:[C,R],targetRect:P.element.getBoundingClientRect()});T=[P,M===C?O:A];break}default:{T=v;break}}}else v.length?T=v:T=[n==="horizontal"?new DOMRect(C.right,R.top,R.left-C.right,R.height):new DOMRect(R.left,C.bottom,R.width,R.top-C.bottom)];for(const A of T){let O="width"in A?A:A.element.getBoundingClientRect();const P=A5()?t.resizeTargetMinimumSize.coarse:t.resizeTargetMinimumSize.fine;if(O.width<P){const D=P-O.width;O=new DOMRect(O.x-D/2,O.y,O.width+D,O.height)}if(O.height<P){const D=P-O.height;O=new DOMRect(O.x,O.y-D/2,O.width,O.height+D)}const M=b<=d||b>g;!u&&!M&&a.push({group:t,groupSize:yc({group:t}),panels:[m,w],separator:"width"in A?void 0:A,rect:O}),u=!1}}f=!1,m=w,v=[]}}else if(S.hasAttribute("data-separator")){S.ariaDisabled!==null&&(u=!0);const w=i.find(C=>C.element===S);w?v.push(w):(m=void 0,v=[])}else f=!0}return a}let HI=class{#e={};addListener(e,n){const r=this.#e[e];return r===void 0?this.#e[e]=[n]:r.includes(n)||r.push(n),()=>{this.removeListener(e,n)}}emit(e,n){const r=this.#e[e];if(r!==void 0)if(r.length===1)r[0].call(null,n);else{let i=!1,s=null;const a=Array.from(r);for(let u=0;u<a.length;u++){const f=a[u];try{f.call(null,n)}catch(d){s===null&&(i=!0,s=d)}}if(i)throw s}}removeAllListeners(){this.#e={}}removeListener(e,n){const r=this.#e[e];if(r!==void 0){const i=r.indexOf(n);i>=0&&r.splice(i,1)}}},oc={cursorFlags:0,state:"inactive"};const FS=new HI;function iu(){return oc}function M5(t){return FS.addListener("change",t)}function O5(t){const e=oc,n={...oc};n.cursorFlags=t,oc=n,FS.emit("change",{prev:e,next:n})}function sc(t){const e=oc;oc=t,FS.emit("change",{prev:e,next:t})}const k5=t=>t,k0=()=>{},jI=1,VI=2,FI=4,UI=8,SA=3,wA=12;let bg;function CA(){return bg===void 0&&(bg=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(bg=!0)),bg}function I5({cursorFlags:t,groups:e,state:n}){let r=0,i=0;switch(n){case"active":case"hover":e.forEach(s=>{if(!s.mutableState.disableCursor)switch(s.orientation){case"horizontal":{r++;break}case"vertical":{i++;break}}})}if(!(r===0&&i===0)){switch(n){case"active":{if(t&&CA()){const s=(t&jI)!==0,a=(t&VI)!==0,u=(t&FI)!==0,f=(t&UI)!==0;if(s)return u?"se-resize":f?"ne-resize":"e-resize";if(a)return u?"sw-resize":f?"nw-resize":"w-resize";if(u)return"s-resize";if(f)return"n-resize"}break}}return CA()?r>0&&i>0?"move":r>0?"ew-resize":"ns-resize":r>0&&i>0?"grab":r>0?"col-resize":"row-resize"}}const RA=new WeakMap;function US(t){if(t.defaultView===null||t.defaultView===void 0)return;let{prevStyle:e,styleSheet:n}=RA.get(t)??{};n===void 0&&(n=new t.defaultView.CSSStyleSheet,t.adoptedStyleSheets&&(Object.isExtensible(t.adoptedStyleSheets)?t.adoptedStyleSheets.push(n):t.adoptedStyleSheets=[...t.adoptedStyleSheets,n]));const r=iu();switch(r.state){case"active":case"hover":{const i=I5({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(a=>a.group),state:r.state}),s=`*, *:hover {cursor: ${i} !important; }`;if(e===s)return;e=s,i?n.cssRules.length===0?n.insertRule(s):n.replaceSync(s):n.cssRules.length===1&&n.deleteRule(0);break}case"inactive":{e=void 0,n.cssRules.length===1&&n.deleteRule(0);break}}RA.set(t,{prevStyle:e,styleSheet:n})}let cs=new Map;const $I=new HI;function D5(t){cs=new Map(cs),cs.delete(t)}function EA(t,e){for(const[n]of cs)if(n.id===t)return n}function ea(t,e){for(const[n,r]of cs)if(n.id===t)return r;if(e)throw Error(`Could not find data for Group with id ${t}`)}function gu(){return cs}function $S(t,e){return $I.addListener("groupChange",n=>{n.group.id===t&&e(n)})}function el(t,e,n){const r=cs.get(t);cs=new Map(cs),cs.set(t,e),$I.emit("groupChange",{group:t,isUserInteraction:n?.isUserInteraction===!0,prev:r,next:e})}function qI(t){const e=iu();let n=!1;return e.state==="active"&&(sc({cursorFlags:0,state:"inactive"}),e.hitRegions.length>0&&(US(t),n=!0,e.hitRegions.forEach(r=>{const i=ea(r.group.id,!0);el(r.group,i,{isUserInteraction:!0})}))),n}function TA(t){t.defaultPrevented||qI(t.currentTarget)}function P5(t,e,n){let r,i={x:1/0,y:1/0};for(const s of e){const a=BI(n,s.rect);switch(t){case"horizontal":{a.x<=i.x&&(r=s,i=a);break}case"vertical":{a.y<=i.y&&(r=s,i=a);break}}}return r?{distance:i,hitRegion:r}:void 0}function z5(t){return t!==null&&typeof t=="object"&&"nodeType"in t&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function N5(t,e){if(t===e)throw new Error("Cannot compare node with itself");const n={a:OA(t),b:OA(e)};let r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();yn(r,"Stacking order can only be calculated for elements with a common ancestor");const i={a:MA(AA(n.a)),b:MA(AA(n.b))};if(i.a===i.b){const s=r.childNodes,a={a:n.a.at(-1),b:n.b.at(-1)};let u=s.length;for(;u--;){const f=s[u];if(f===a.a)return 1;if(f===a.b)return-1}}return Math.sign(i.a-i.b)}const L5=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function B5(t){const e=getComputedStyle(GI(t)??t).display;return e==="flex"||e==="inline-flex"}function _5(t){const e=getComputedStyle(t);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||B5(t))||+e.opacity<1||"transform"in e&&e.transform!=="none"||"webkitTransform"in e&&e.webkitTransform!=="none"||"mixBlendMode"in e&&e.mixBlendMode!=="normal"||"filter"in e&&e.filter!=="none"||"webkitFilter"in e&&e.webkitFilter!=="none"||"isolation"in e&&e.isolation==="isolate"||L5.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function AA(t){let e=t.length;for(;e--;){const n=t[e];if(yn(n,"Missing node"),_5(n))return n}return null}function MA(t){return t&&Number(getComputedStyle(t).zIndex)||0}function OA(t){const e=[];for(;t;)e.push(t),t=GI(t);return e}function GI(t){const{parentNode:e}=t;return z5(e)?e.host:e}function H5(t,e){return t.x<e.x+e.width&&t.x+t.width>e.x&&t.y<e.y+e.height&&t.y+t.height>e.y}function j5({groupElement:t,hitRegion:e,pointerEventTarget:n}){if(!LI(n)||n.contains(t)||t.contains(n))return!0;if(N5(n,t)>0){let r=n;for(;r;){if(r.contains(t))return!0;if(H5(r.getBoundingClientRect(),e))return!1;r=r.parentElement}}return!0}function qS(t,e){const n=[];return e.forEach((r,i)=>{if(i.disabled)return;const s=_I(i),a=P5(i.orientation,s,{x:t.clientX,y:t.clientY});a&&a.distance.x<=0&&a.distance.y<=0&&j5({groupElement:i.element,hitRegion:a.hitRegion.rect,pointerEventTarget:t.target})&&n.push(a.hitRegion)}),n}function V5(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n])return!1;return!0}function qr(t,e,n=0){return Math.abs(ri(t)-ri(e))<=n}function rs(t,e){return qr(t,e)?0:t>e?1:-1}function tc({overrideDisabledPanels:t,panelConstraints:e,prevSize:n,size:r}){const{collapsedSize:i=0,collapsible:s,disabled:a,maxSize:u=100,minSize:f=0}=e;if(a&&!t)return n;if(rs(r,f)<0)if(s){const d=(i+f)/2;rs(r,d)<0?r=i:r=f}else r=f;return r=Math.min(u,r),r=ri(r),r}function gd({delta:t,initialLayout:e,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:s}){if(qr(t,0))return e;const a=s==="imperative-api",u=Object.values(e),f=Object.values(i),d=[...u],[g,p]=r;yn(g!=null,"Invalid first pivot index"),yn(p!=null,"Invalid second pivot index");let m=0;switch(s){case"keyboard":{{const S=t<0?p:g,w=n[S];yn(w,`Panel constraints not found for index ${S}`);const{collapsedSize:C=0,collapsible:R,minSize:T=0}=w;if(R){const A=u[S];if(yn(A!=null,`Previous layout not found for panel index ${S}`),qr(A,C)){const O=T-A;rs(O,Math.abs(t))>0&&(t=t<0?0-O:O)}}}{const S=t<0?g:p,w=n[S];yn(w,`No panel constraints found for index ${S}`);const{collapsedSize:C=0,collapsible:R,minSize:T=0}=w;if(R){const A=u[S];if(yn(A!=null,`Previous layout not found for panel index ${S}`),qr(A,T)){const O=A-C;rs(O,Math.abs(t))>0&&(t=t<0?0-O:O)}}}break}default:{const S=t<0?p:g,w=n[S];yn(w,`Panel constraints not found for index ${S}`);const C=u[S],{collapsible:R,collapsedSize:T,minSize:A}=w;if(R&&rs(C,A)<0)if(t>0){const O=A-T,P=O/2,M=C+t;rs(M,A)<0&&(t=rs(t,P)<=0?0:O)}else{const O=A-T,P=100-O/2,M=C-t;rs(M,A)<0&&(t=rs(100+t,P)>0?0:-O)}break}}{const S=t<0?1:-1;let w=t<0?p:g,C=0;for(;;){const T=u[w];yn(T!=null,`Previous layout not found for panel index ${w}`);const A=tc({overrideDisabledPanels:a,panelConstraints:n[w],prevSize:T,size:100})-T;if(C+=A,w+=S,w<0||w>=n.length)break}const R=Math.min(Math.abs(t),Math.abs(C));t=t<0?0-R:R}{let S=t<0?g:p;for(;S>=0&&S<n.length;){const w=Math.abs(t)-Math.abs(m),C=u[S];yn(C!=null,`Previous layout not found for panel index ${S}`);const R=C-w,T=tc({overrideDisabledPanels:a,panelConstraints:n[S],prevSize:C,size:R});if(!qr(C,T)&&(m+=C-T,d[S]=T,m.toFixed(3).localeCompare(Math.abs(t).toFixed(3),void 0,{numeric:!0})>=0))break;t<0?S--:S++}}if(V5(f,d))return i;{const S=t<0?p:g,w=u[S];yn(w!=null,`Previous layout not found for panel index ${S}`);const C=w+m,R=tc({overrideDisabledPanels:a,panelConstraints:n[S],prevSize:w,size:C});if(d[S]=R,!qr(R,C)){let T=C-R,A=t<0?p:g;for(;A>=0&&A<n.length;){const O=d[A];yn(O!=null,`Previous layout not found for panel index ${A}`);const P=O+T,M=tc({overrideDisabledPanels:a,panelConstraints:n[A],prevSize:O,size:P});if(qr(O,M)||(T-=M-O,d[A]=M),qr(T,0))break;t>0?A--:A++}}}const v=Object.values(d).reduce((S,w)=>w+S,0);if(!qr(v,100,.1))return i;const b=Object.keys(i);return d.reduce((S,w,C)=>(S[b[C]]=w,S),{})}function ou(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(e[n]===void 0||rs(t[n],e[n])!==0)return!1;return!0}function su({layout:t,panelConstraints:e}){const n=Object.values(t),r=[...n],i=r.reduce((u,f)=>u+f,0);if(r.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${r.map(u=>`${u}%`).join(", ")}`);if(!qr(i,100)&&r.length>0)for(let u=0;u<e.length;u++){const f=r[u];yn(f!=null,`No layout data found for index ${u}`);const d=100/i*f;r[u]=d}let s=0;for(let u=0;u<e.length;u++){const f=n[u];yn(f!=null,`No layout data found for index ${u}`);const d=r[u];yn(d!=null,`No layout data found for index ${u}`);const g=tc({overrideDisabledPanels:!0,panelConstraints:e[u],prevSize:f,size:d});d!=g&&(s+=d-g,r[u]=g)}if(!qr(s,0))for(let u=0;u<e.length;u++){const f=r[u];yn(f!=null,`No layout data found for index ${u}`);const d=f+s,g=tc({overrideDisabledPanels:!0,panelConstraints:e[u],prevSize:f,size:d});if(f!==g&&(s-=g-f,r[u]=g,qr(s,0)))break}const a=Object.keys(t);return r.reduce((u,f,d)=>(u[a[d]]=f,u),{})}function WI({groupId:t,panelId:e}){const n=()=>{const f=gu();for(const[d,{defaultLayoutDeferred:g,derivedPanelConstraints:p,layout:m,groupSize:v,separatorToPanels:b}]of f)if(d.id===t)return{defaultLayoutDeferred:g,derivedPanelConstraints:p,group:d,groupSize:v,layout:m,separatorToPanels:b};throw Error(`Group ${t} not found`)},r=()=>{const f=n().derivedPanelConstraints.find(d=>d.panelId===e);if(f!==void 0)return f;throw Error(`Panel constraints not found for Panel ${e}`)},i=()=>{const f=n().group.panels.find(d=>d.id===e);if(f!==void 0)return f;throw Error(`Layout not found for Panel ${e}`)},s=()=>{const f=n().layout[e];if(f!==void 0)return f;throw Error(`Layout not found for Panel ${e}`)},a=({nextSize:f,panels:d,prevLayout:g,derivedPanelConstraints:p})=>{const m=s(),v=d.findIndex(w=>w.id===e),b=v===0,S=v===d.length-1;if(S&&f<m&&(b||d.slice(0,v).every((w,C)=>{const R=p[C];return R?.collapsible&&qr(R.collapsedSize,g[R.panelId])}))){const w=d.slice(0,v).reduce((C,R)=>C+g[R.id],0);return{...g,[e]:ri(100-w)}}return gd({delta:S?m-f:f-m,initialLayout:g,panelConstraints:p,pivotIndices:S?[v-1,v]:[v,v+1],prevLayout:g,trigger:"imperative-api"})},u=f=>{const d=s();if(f===d)return;const{defaultLayoutDeferred:g,derivedPanelConstraints:p,group:m,groupSize:v,layout:b,separatorToPanels:S}=n(),w=a({nextSize:f,panels:m.panels,prevLayout:b,derivedPanelConstraints:p}),C=su({layout:w,panelConstraints:p});ou(b,C)||el(m,{defaultLayoutDeferred:g,derivedPanelConstraints:p,groupSize:v,layout:C,separatorToPanels:S})};return{collapse:()=>{const{collapsible:f,collapsedSize:d}=r(),{mutableValues:g}=i(),p=s();f&&p!==d&&(g.expandToSize=p,u(d))},expand:()=>{const{collapsible:f,collapsedSize:d,minSize:g}=r(),{mutableValues:p}=i(),m=s();if(f&&m===d){let v=p.expandToSize??g;v===0&&(v=1),u(v)}},getSize:()=>{const{group:f}=n(),d=s(),{element:g}=i(),p=f.orientation==="horizontal"?g.offsetWidth:g.offsetHeight;return{asPercentage:d,inPixels:p}},isCollapsed:()=>{const{collapsible:f,collapsedSize:d}=r(),g=s();return f&&qr(d,g)},resize:f=>{const{group:d}=n(),{element:g}=i(),p=yc({group:d}),m=Hf({groupSize:p,panelElement:g,styleProp:f}),v=ri(m/p*100);u(v)}}}function kA(t){if(t.defaultPrevented)return;const e=gu();qS(t,e).forEach(n=>{if(n.separator&&!n.separator.disableDoubleClick){const r=n.panels.find(i=>i.panelConstraints.defaultSize!==void 0);if(r){const i=r.panelConstraints.defaultSize,s=WI({groupId:n.group.id,panelId:r.id});s&&i!==void 0&&(s.resize(i),t.preventDefault())}}})}function ap(t){const e=gu();for(const[n]of e)if(n.separators.some(r=>r.element===t))return n;throw Error("Could not find parent Group for separator element")}function KI({groupId:t}){const e=()=>{const n=gu();for(const[r,i]of n)if(r.id===t)return{group:r,...i};throw Error(`Could not find Group with id "${t}"`)};return{getLayout(){const{defaultLayoutDeferred:n,layout:r}=e();return n?{}:r},setLayout(n){const{defaultLayoutDeferred:r,derivedPanelConstraints:i,group:s,groupSize:a,layout:u,separatorToPanels:f}=e(),d=su({layout:n,panelConstraints:i});return r?u:(ou(u,d)||el(s,{defaultLayoutDeferred:r,derivedPanelConstraints:i,groupSize:a,layout:d,separatorToPanels:f}),d)}}}function Fa(t,e){const n=ap(t),r=ea(n.id,!0),i=n.separators.find(g=>g.element===t);yn(i,"Matching separator not found");const s=r.separatorToPanels.get(i);yn(s,"Matching panels not found");const a=s.map(g=>n.panels.indexOf(g)),u=KI({groupId:n.id}).getLayout(),f=gd({delta:e,initialLayout:u,panelConstraints:r.derivedPanelConstraints,pivotIndices:a,prevLayout:u,trigger:"keyboard"}),d=su({layout:f,panelConstraints:r.derivedPanelConstraints});ou(u,d)||el(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:d,separatorToPanels:r.separatorToPanels},{isUserInteraction:!0})}function IA(t){if(t.defaultPrevented)return;const e=t.currentTarget,n=ap(e);if(!n.disabled)switch(t.key){case"ArrowDown":{t.preventDefault(),n.orientation==="vertical"&&Fa(e,5);break}case"ArrowLeft":{t.preventDefault(),n.orientation==="horizontal"&&Fa(e,-5);break}case"ArrowRight":{t.preventDefault(),n.orientation==="horizontal"&&Fa(e,5);break}case"ArrowUp":{t.preventDefault(),n.orientation==="vertical"&&Fa(e,-5);break}case"End":{t.preventDefault(),Fa(e,100);break}case"Enter":{t.preventDefault();const r=ap(e),i=ea(r.id,!0),{derivedPanelConstraints:s,layout:a,separatorToPanels:u}=i,f=r.separators.find(m=>m.element===e);yn(f,"Matching separator not found");const d=u.get(f);yn(d,"Matching panels not found");const g=d[0],p=s.find(m=>m.panelId===g.id);if(yn(p,"Panel metadata not found"),p.collapsible){const m=a[g.id],v=p.collapsedSize===m?r.mutableState.expandedPanelSizes[g.id]??p.minSize:p.collapsedSize;Fa(e,v-m)}break}case"F6":{t.preventDefault();const r=ap(e).separators.map(a=>a.element),i=Array.from(r).findIndex(a=>a===t.currentTarget);yn(i!==null,"Index not found");const s=t.shiftKey?i>0?i-1:r.length-1:i+1<r.length?i+1:0;r[s].focus({preventScroll:!0});break}case"Home":{t.preventDefault(),Fa(e,-100);break}}}function DA(t){if(t.defaultPrevented||t.pointerType==="mouse"&&t.button>0)return;const e=gu(),n=qS(t,e),r=new Map;let i=!1;n.forEach(s=>{s.separator&&(i||(i=!0,s.separator.element.focus({focusVisible:!1,preventScroll:!0})));const a=e.get(s.group);a&&r.set(s.group,a.layout)}),sc({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:t.clientX,y:t.clientY},state:"active"}),n.length&&t.preventDefault()}function YI({document:t,event:e,hitRegions:n,initialLayoutMap:r,mountedGroups:i,pointerDownAtPoint:s,prevCursorFlags:a}){let u=0;n.forEach(d=>{const{group:g,groupSize:p}=d,{orientation:m,panels:v}=g,{disableCursor:b}=g.mutableState;let S=0;s?m==="horizontal"?S=(e.clientX-s.x)/p*100:S=(e.clientY-s.y)/p*100:m==="horizontal"?S=e.clientX<0?-100:100:S=e.clientY<0?-100:100;const w=r.get(g),C=i.get(g);if(!w||!C)return;const{defaultLayoutDeferred:R,derivedPanelConstraints:T,groupSize:A,layout:O,separatorToPanels:P}=C;if(T&&O&&P){const M=gd({delta:S,initialLayout:w,panelConstraints:T,pivotIndices:d.panels.map(D=>v.indexOf(D)),prevLayout:O,trigger:"mouse-or-touch"});if(ou(M,O)){if(S!==0&&!b)switch(m){case"horizontal":{u|=S<0?jI:VI;break}case"vertical":{u|=S<0?FI:UI;break}}}else el(d.group,{defaultLayoutDeferred:R,derivedPanelConstraints:T,groupSize:A,layout:M,separatorToPanels:P})}});let f=0;e.movementX===0?f|=a&SA:f|=u&SA,e.movementY===0?f|=a&wA:f|=u&wA,O5(f),US(t)}function PA(t){const e=gu(),n=iu();n.state==="active"&&YI({document:t.currentTarget,event:t,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:e,prevCursorFlags:n.cursorFlags})}function zA(t){if(t.defaultPrevented)return;const e=iu(),n=gu();switch(e.state){case"active":{if(t.buttons===0){sc({cursorFlags:0,state:"inactive"}),e.hitRegions.forEach(r=>{const i=ea(r.group.id,!0);el(r.group,i,{isUserInteraction:!0})});return}for(const r of e.hitRegions)if(r.separator){const{element:i}=r.separator;i.hasPointerCapture?.(t.pointerId)||i.setPointerCapture?.(t.pointerId)}YI({document:t.currentTarget,event:t,hitRegions:e.hitRegions,initialLayoutMap:e.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:e.pointerDownAtPoint,prevCursorFlags:e.cursorFlags});break}default:{const r=qS(t,n);r.length===0?e.state!=="inactive"&&sc({cursorFlags:0,state:"inactive"}):sc({cursorFlags:0,hitRegions:r,state:"hover"}),US(t.currentTarget);break}}}function NA(t){t.relatedTarget instanceof HTMLIFrameElement&&iu().state==="hover"&&sc({cursorFlags:0,state:"inactive"})}function LA(t){t.defaultPrevented||t.pointerType==="mouse"&&t.button>0||qI(t.currentTarget)&&t.preventDefault()}function BA(t){let e=0,n=0;const r={};for(const s of t)if(s.defaultSize!==void 0){e++;const a=ri(s.defaultSize);n+=a,r[s.panelId]=a}else r[s.panelId]=void 0;const i=t.length-e;if(i!==0){const s=ri((100-n)/i);for(const a of t)a.defaultSize===void 0&&(r[a.panelId]=s)}return r}function F5(t,e,n){if(!n[0])return;const r=t.panels.find(f=>f.element===e);if(!r||!r.onResize)return;const i=yc({group:t}),s=t.orientation==="horizontal"?r.element.offsetWidth:r.element.offsetHeight,a=r.mutableValues.prevSize,u={asPercentage:ri(s/i*100),inPixels:s};r.mutableValues.prevSize=u,r.onResize(u,r.id,a)}function U5(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function $5({group:t,nextGroupSize:e,prevGroupSize:n,prevLayout:r}){if(n<=0||e<=0||n===e)return r;let i=0,s=0,a=!1;const u=new Map,f=[];for(const p of t.panels){const m=r[p.id]??0;if(p.panelConstraints.groupResizeBehavior==="preserve-pixel-size"){a=!0;const v=m/100*n,b=ri(v/e*100);u.set(p.id,b),i+=b}else f.push(p.id),s+=m}if(!a||f.length===0)return r;const d=100-i,g={...r};if(u.forEach((p,m)=>{g[m]=p}),s>0)for(const p of f){const m=r[p]??0;g[p]=ri(m/s*d)}else{const p=ri(d/f.length);for(const m of f)g[m]=p}return g}function q5(t,e){const n=t.map(i=>i.id),r=Object.keys(e);if(n.length!==r.length)return!1;for(const i of n)if(!r.includes(i))return!1;return!0}const Zu=new Map;function G5(t){let e=!0;yn(t.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const n=t.element.ownerDocument.defaultView.ResizeObserver,r=new Set,i=new Set,s=new n(b=>{for(const S of b){const{borderBoxSize:w,target:C}=S;if(C===t.element){if(e){const R=yc({group:t});if(R===0)return;const T=ea(t.id);if(!T)return;const A=ux(t),O=T.defaultLayoutDeferred?BA(A):T.layout,P=$5({group:t,nextGroupSize:R,prevGroupSize:T.groupSize,prevLayout:O}),M=su({layout:P,panelConstraints:A});if(!T.defaultLayoutDeferred&&ou(T.layout,M)&&U5(T.derivedPanelConstraints,A)&&T.groupSize===R)return;el(t,{defaultLayoutDeferred:!1,derivedPanelConstraints:A,groupSize:R,layout:M,separatorToPanels:T.separatorToPanels})}}else F5(t,C,w)}});s.observe(t.element),t.panels.forEach(b=>{yn(!r.has(b.id),`Panel ids must be unique; id "${b.id}" was used more than once`),r.add(b.id),b.onResize&&s.observe(b.element)});const a=yc({group:t}),u=ux(t),f=t.panels.map(({id:b})=>b).join(",");let d=t.mutableState.defaultLayout;d&&(q5(t.panels,d)||(d=void 0));const g=t.mutableState.layouts[f]??d??BA(u),p=su({layout:g,panelConstraints:u}),m=t.element.ownerDocument;Zu.set(m,(Zu.get(m)??0)+1);const v=new Map;return _I(t).forEach(b=>{b.separator&&v.set(b.separator,b.panels)}),el(t,{defaultLayoutDeferred:a===0,derivedPanelConstraints:u,groupSize:a,layout:p,separatorToPanels:v}),t.separators.forEach(b=>{yn(!i.has(b.id),`Separator ids must be unique; id "${b.id}" was used more than once`),i.add(b.id),b.element.addEventListener("keydown",IA)}),Zu.get(m)===1&&(m.addEventListener("contextmenu",TA,!0),m.addEventListener("dblclick",kA,!0),m.addEventListener("pointerdown",DA,!0),m.addEventListener("pointerleave",PA),m.addEventListener("pointermove",zA),m.addEventListener("pointerout",NA),m.addEventListener("pointerup",LA,!0)),function(){e=!1,Zu.set(m,Math.max(0,(Zu.get(m)??0)-1)),D5(t),t.separators.forEach(b=>{b.element.removeEventListener("keydown",IA)}),Zu.get(m)||(m.removeEventListener("contextmenu",TA,!0),m.removeEventListener("dblclick",kA,!0),m.removeEventListener("pointerdown",DA,!0),m.removeEventListener("pointerleave",PA),m.removeEventListener("pointermove",zA),m.removeEventListener("pointerout",NA),m.removeEventListener("pointerup",LA,!0)),s.disconnect()}}function W5(){const[t,e]=E.useState({}),n=E.useCallback(()=>e({}),[]);return[t,n]}function GS(t){const e=E.useId();return`${t??e}`}const pu=typeof window<"u"?E.useLayoutEffect:E.useEffect;function Wf(t){const e=E.useRef(t);return pu(()=>{e.current=t},[t]),E.useCallback((...n)=>e.current?.(...n),[e])}function WS(...t){return Wf(e=>{t.forEach(n=>{if(n)switch(typeof n){case"function":{n(e);break}case"object":{n.current=e;break}}})})}function KS(t){const e=E.useRef({...t});return pu(()=>{for(const n in t)e.current[n]=t[n]},[t]),e.current}const XI=E.createContext(null);function K5(t,e){const n=E.useRef({getLayout:()=>({}),setLayout:k5});E.useImperativeHandle(e,()=>n.current,[]),pu(()=>{Object.assign(n.current,KI({groupId:t}))})}function QI({children:t,className:e,defaultLayout:n,disableCursor:r,disabled:i,elementRef:s,groupRef:a,id:u,onLayoutChange:f,onLayoutChanged:d,orientation:g="horizontal",resizeTargetMinimumSize:p={coarse:20,fine:10},style:m,...v}){const b=E.useRef({onLayoutChange:{},onLayoutChanged:{}}),S=Wf(N=>{ou(b.current.onLayoutChange,N)||(b.current.onLayoutChange=N,f?.(N))}),w=Wf((N,_)=>{ou(b.current.onLayoutChanged,N)||(b.current.onLayoutChanged=N,d?.(N,{isUserInteraction:_}))}),C=GS(u),R=E.useRef(null),[T,A]=W5(),O=E.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:p,separators:[]}),P=WS(R,s);K5(C,a);const M=Wf((N,_)=>{const $=iu(),F=EA(N),G=ea(N);if(G){let j=!1;return $.state==="active"&&(j=$.hitRegions.some(q=>q.group===F)),{flexGrow:G.layout[_]??1,pointerEvents:j?"none":void 0}}if(n?.[_])return{flexGrow:n?.[_]}}),D=KS({defaultLayout:n,disableCursor:r}),L=E.useMemo(()=>({get disableCursor(){return!!D.disableCursor},getPanelStyles:M,id:C,orientation:g,registerPanel:N=>{const _=O.current;return _.panels=cx(g,[..._.panels,N]),A(),()=>{_.panels=_.panels.filter($=>$!==N),A()}},registerSeparator:N=>{const _=O.current;return _.separators=cx(g,[..._.separators,N]),A(),()=>{_.separators=_.separators.filter($=>$!==N),A()}},updatePanelProps:(N,{disabled:_})=>{const $=O.current.panels.find(j=>j.id===N);$&&($.panelConstraints.disabled=_);const F=EA(C),G=ea(C);F&&G&&el(F,{...G,derivedPanelConstraints:ux(F)})},updateSeparatorProps:(N,{disabled:_,disableDoubleClick:$})=>{const F=O.current.separators.find(G=>G.id===N);F&&(F.disabled=_,F.disableDoubleClick=$)}}),[M,C,A,g,D]),H=E.useRef(null);return pu(()=>{const N=R.current;if(N===null)return;const _=O.current;let $;if(D.defaultLayout!==void 0&&Object.keys(D.defaultLayout).length===_.panels.length){$={};for(const J of _.panels){const z=D.defaultLayout[J.id];z!==void 0&&($[J.id]=z)}}const F={disabled:!!i,element:N,id:C,mutableState:{defaultLayout:$,disableCursor:!!D.disableCursor,expandedPanelSizes:O.current.lastExpandedPanelSizes,layouts:O.current.layouts},orientation:g,panels:_.panels,resizeTargetMinimumSize:_.resizeTargetMinimumSize,separators:_.separators};H.current=F;const G=G5(F),{defaultLayoutDeferred:j,derivedPanelConstraints:q,layout:V}=ea(F.id,!0);!j&&q.length>0&&(S(V),w(V,!1));const te=$S(C,J=>{const{defaultLayoutDeferred:z,derivedPanelConstraints:U,layout:W}=J.next;if(z||U.length===0)return;const X=F.panels.map(({id:ee})=>ee).join(",");F.mutableState.layouts[X]=W,U.forEach(ee=>{if(ee.collapsible){const{layout:ue}=J.prev??{};if(ue){const Y=qr(ee.collapsedSize,W[ee.panelId]),le=qr(ee.collapsedSize,ue[ee.panelId]);Y&&!le&&(F.mutableState.expandedPanelSizes[ee.panelId]=ue[ee.panelId])}}});const ie=iu().state!=="active";S(W),ie&&w(W,J.isUserInteraction)});return()=>{H.current=null,G(),te()}},[i,C,w,S,g,T,D]),E.useEffect(()=>{const N=H.current;N&&(N.mutableState.defaultLayout=n,N.mutableState.disableCursor=!!r)}),I.jsx(XI.Provider,{value:L,children:I.jsx("div",{...v,className:e,"data-group":!0,"data-testid":C,id:C,ref:P,style:{height:"100%",width:"100%",overflow:"hidden",...m,display:"flex",flexDirection:g==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:g==="horizontal"?"pan-y":"pan-x"},children:t})})}QI.displayName="Group";function YS(){const t=E.useContext(XI);return yn(t,"Group Context not found; did you render a Panel or Separator outside of a Group?"),t}function Y5(t,e){const{id:n}=YS(),r=E.useRef({collapse:k0,expand:k0,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:k0});E.useImperativeHandle(e,()=>r.current,[]),pu(()=>{Object.assign(r.current,WI({groupId:n,panelId:t}))})}function ZI({children:t,className:e,collapsedSize:n="0%",collapsible:r=!1,defaultSize:i,disabled:s,elementRef:a,groupResizeBehavior:u="preserve-relative-size",id:f,maxSize:d="100%",minSize:g="0%",onResize:p,panelRef:m,style:v,...b}){const S=!!f,w=GS(f),C=KS({disabled:s}),R=E.useRef(null),T=WS(R,a),{getPanelStyles:A,id:O,orientation:P,registerPanel:M,updatePanelProps:D}=YS(),L=p!==null,H=Wf((F,G,j)=>{p?.(F,f,j)});pu(()=>{const F=R.current;if(F!==null){const G={element:F,id:w,idIsStable:S,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:L?H:void 0,panelConstraints:{groupResizeBehavior:u,collapsedSize:n,collapsible:r,defaultSize:i,disabled:C.disabled,maxSize:d,minSize:g}};return M(G)}},[u,n,r,i,L,w,S,d,g,H,M,C]),E.useEffect(()=>{D(w,{disabled:s})},[s,w,D]),Y5(w,m);const N=()=>{const F=A(O,w);if(F)return JSON.stringify(F)},_=E.useSyncExternalStore(F=>$S(O,F),N,N);let $;return _?$=JSON.parse(_):i!==void 0?$={flexGrow:void 0,flexShrink:void 0,flexBasis:i}:$={flexGrow:1},I.jsx("div",{...b,"data-disabled":s||void 0,"data-panel":!0,"data-testid":w,id:w,ref:T,style:{...X5,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...$},children:I.jsx("div",{className:e,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...v,touchAction:P==="horizontal"?"pan-y":"pan-x"},children:t})})}ZI.displayName="Panel";const X5={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function Q5({layout:t,panelConstraints:e,panelId:n,panelIndex:r}){let i,s;const a=t[n],u=e.find(f=>f.panelId===n);if(u){const f=u.maxSize,d=u.collapsible?u.collapsedSize:u.minSize,g=[r,r+1];s=su({layout:gd({delta:d-a,initialLayout:t,panelConstraints:e,pivotIndices:g,prevLayout:t}),panelConstraints:e})[n],i=su({layout:gd({delta:f-a,initialLayout:t,panelConstraints:e,pivotIndices:g,prevLayout:t}),panelConstraints:e})[n]}return{valueControls:n,valueMax:i,valueMin:s,valueNow:a}}function JI({children:t,className:e,disabled:n,disableDoubleClick:r,elementRef:i,id:s,style:a,...u}){const f=GS(s),d=KS({disabled:n,disableDoubleClick:r}),[g,p]=E.useState({}),[m,v]=E.useState("inactive"),[b,S]=E.useState(!1),w=E.useRef(null),C=WS(w,i),{disableCursor:R,id:T,orientation:A,registerSeparator:O,updateSeparatorProps:P}=YS(),M=A==="horizontal"?"vertical":"horizontal";pu(()=>{const H=w.current;if(H!==null){const N={disabled:d.disabled,disableDoubleClick:d.disableDoubleClick,element:H,id:f},_=O(N),$=M5(G=>{v(G.next.state!=="inactive"&&G.next.hitRegions.some(j=>j.separator===N)?G.next.state:"inactive")}),F=$S(T,G=>{const{derivedPanelConstraints:j,layout:q,separatorToPanels:V}=G.next,te=V.get(N);if(te){const J=te[0],z=te.indexOf(J);p(Q5({layout:q,panelConstraints:j,panelId:J.id,panelIndex:z}))}});return()=>{$(),F(),_()}}},[T,f,O,d]),E.useEffect(()=>{P(f,{disabled:n,disableDoubleClick:r})},[n,r,f,P]);let D;n&&!R&&(D="not-allowed");let L;return n?L="disabled":m==="active"?L="active":b?L="focus":L=m,I.jsx("div",{...u,"aria-controls":g.valueControls,"aria-disabled":n||void 0,"aria-orientation":M,"aria-valuemax":g.valueMax,"aria-valuemin":g.valueMin,"aria-valuenow":g.valueNow,children:t,className:e,"data-separator":L,"data-testid":f,id:f,onBlur:()=>S(!1),onFocus:()=>S(!0),ref:C,role:"separator",style:{flexBasis:"auto",cursor:D,...a,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:n?void 0:0})}JI.displayName="Separator";var Z5={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const J5=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),e8=(t,e)=>{const n=E.forwardRef(({color:r="currentColor",size:i=24,strokeWidth:s=2,absoluteStrokeWidth:a,children:u,...f},d)=>E.createElement("svg",{ref:d,...Z5,width:i,height:i,stroke:r,strokeWidth:a?Number(s)*24/Number(i):s,className:`lucide lucide-${J5(t)}`,...f},[...e.map(([g,p])=>E.createElement(g,p)),...(Array.isArray(u)?u:[u])||[]]));return n.displayName=`${t}`,n};var Qn=e8;const t8=Qn("AlertTriangle",[["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-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),n8=Qn("CheckCircle2",[["path",{d:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z",key:"14v8dr"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),eD=Qn("Check",[["polyline",{points:"20 6 9 17 4 12",key:"10jjfj"}]]),r8=Qn("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),i8=Qn("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),o8=Qn("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),XS=Qn("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]),s8=Qn("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]),l8=Qn("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]),a8=Qn("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]),u8=Qn("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),c8=Qn("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),f8=Qn("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]),tD=Qn("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z",key:"ymcmye"}]]),d8=Qn("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),h8=Qn("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]),g8=Qn("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]),p8=Qn("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]),_A=Qn("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]),m8=Qn("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]),nD=Qn("XCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]),QS=Qn("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),rD={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},ZS={...rD,position:"fixed",top:0,left:0},JS={...rD,position:"absolute"},HA={};function Sr(t,e){const n=E.useRef(HA);return n.current===HA&&(n.current=t(e)),n}function tl(t,e,n,r){const i=Sr(iD).current;return v8(i,t,e,n,r)&&oD(i,[t,e,n,r]),i.callback}function y8(t){const e=Sr(iD).current;return b8(e,t)&&oD(e,t),e.callback}function iD(){return{callback:null,cleanup:null,refs:[]}}function v8(t,e,n,r,i){return t.refs[0]!==e||t.refs[1]!==n||t.refs[2]!==r||t.refs[3]!==i}function b8(t,e){return t.refs.length!==e.length||t.refs.some((n,r)=>n!==e[r])}function oD(t,e){if(t.refs=e,e.every(n=>n==null)){t.callback=null;return}t.callback=n=>{if(t.cleanup&&(t.cleanup(),t.cleanup=null),n!=null){const r=Array(e.length).fill(null);for(let i=0;i<e.length;i+=1){const s=e[i];if(s!=null)switch(typeof s){case"function":{const a=s(n);typeof a=="function"&&(r[i]=a);break}case"object":{s.current=n;break}}}t.cleanup=()=>{for(let i=0;i<e.length;i+=1){const s=e[i];if(s!=null)switch(typeof s){case"function":{const a=r[i];typeof a=="function"?a():s(null);break}case"object":{s.current=null;break}}}}}}}function sD(t){const e=E.useRef(!0);e.current&&(e.current=!1,t())}function x8(t){const[e,n]=E.useState({current:t,previous:null});return Object.is(t,e.current)||n({current:t,previous:e.current}),e.previous}function lD(t){return t==null||t.hasAttribute("disabled")||t.getAttribute("aria-disabled")==="true"}function Ja({controlled:t,default:e,name:n,state:r="value"}){const{current:i}=E.useRef(t!==void 0),[s,a]=E.useState(e),u=i?t:s,f=E.useCallback(d=>{i||a(d)},[]);return[u,f]}const S8=()=>{},Oe=typeof document<"u"?E.useLayoutEffect:S8,ew={...KV},I0=ew.useInsertionEffect,w8=I0&&I0!==ew.useLayoutEffect?I0:t=>t();function Re(t){const e=Sr(C8).current;return e.next=t,w8(e.effect),e.trampoline}function C8(){const t={next:void 0,callback:R8,trampoline:(...e)=>t.callback?.(...e),effect:()=>{t.callback=t.next}};return t}function R8(){}function Fn(t){const e=Sr(E8,t).current;return e.next=t,Oe(e.effect),e}function E8(t){const e={current:t,next:t,effect:()=>{e.current=e.next}};return e}function T8(t,e){return function(r,...i){const s=new URL(t);return s.searchParams.set("code",r.toString()),i.forEach(a=>s.searchParams.append("args[]",a)),`${e} error #${r}; visit ${s} for the full message.`}}const Un=T8("https://base-ui.com/production-error","Base UI");var D0={exports:{}},P0={};var jA;function A8(){if(jA)return P0;jA=1;var t=Nd();function e(p,m){return p===m&&(p!==0||1/p===1/m)||p!==p&&m!==m}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,i=t.useEffect,s=t.useLayoutEffect,a=t.useDebugValue;function u(p,m){var v=m(),b=r({inst:{value:v,getSnapshot:m}}),S=b[0].inst,w=b[1];return s(function(){S.value=v,S.getSnapshot=m,f(S)&&w({inst:S})},[p,v,m]),i(function(){return f(S)&&w({inst:S}),p(function(){f(S)&&w({inst:S})})},[p]),a(v),v}function f(p){var m=p.getSnapshot;p=p.value;try{var v=m();return!n(p,v)}catch{return!0}}function d(p,m){return m()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:u;return P0.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:g,P0}var VA;function aD(){return VA||(VA=1,D0.exports=A8()),D0.exports}var tw=aD(),z0={exports:{}},N0={};var FA;function M8(){if(FA)return N0;FA=1;var t=Nd(),e=aD();function n(d,g){return d===g&&(d!==0||1/d===1/g)||d!==d&&g!==g}var r=typeof Object.is=="function"?Object.is:n,i=e.useSyncExternalStore,s=t.useRef,a=t.useEffect,u=t.useMemo,f=t.useDebugValue;return N0.useSyncExternalStoreWithSelector=function(d,g,p,m,v){var b=s(null);if(b.current===null){var S={hasValue:!1,value:null};b.current=S}else S=b.current;b=u(function(){function C(P){if(!R){if(R=!0,T=P,P=m(P),v!==void 0&&S.hasValue){var M=S.value;if(v(M,P))return A=M}return A=P}if(M=A,r(T,P))return M;var D=m(P);return v!==void 0&&v(M,D)?(T=P,M):(T=P,A=D)}var R=!1,T,A,O=p===void 0?null:p;return[function(){return C(g())},O===null?void 0:function(){return C(O())}]},[g,p,m,v]);var w=i(d,b[0],b[1]);return a(function(){S.hasValue=!0,S.value=w},[w]),f(w),w},N0}var UA;function O8(){return UA||(UA=1,z0.exports=M8()),z0.exports}var k8=O8();const I8=parseInt(E.version,10);function nw(t){return I8>=t}const fx=[];let dx;function D8(){return dx}function P8(t){fx.push(t)}function uD(t){const e=(n,r)=>{const i=Sr(N8).current;let s;try{dx=i;for(const a of fx)a.before(i);s=t(n,r);for(const a of fx)a.after(i);i.didInitialize=!0}finally{dx=void 0}return s};return e.displayName=t.displayName||t.name,e}function z8(t){return E.forwardRef(uD(t))}function N8(){return{didInitialize:!1}}const L8=nw(19),B8=L8?H8:j8;function pe(t,e,n,r,i){return B8(t,e,n,r,i)}function _8(t,e,n,r,i){const s=E.useCallback(()=>e(t.getSnapshot(),n,r,i),[t,e,n,r,i]);return tw.useSyncExternalStore(t.subscribe,s,s)}P8({before(t){t.syncIndex=0,t.didInitialize||(t.syncTick=1,t.syncHooks=[],t.didChangeStore=!0,t.getSnapshot=()=>{let e=!1;for(let n=0;n<t.syncHooks.length;n+=1){const r=t.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(e=!0,r.value=i)}return e&&(t.syncTick+=1),t.syncTick})},after(t){t.syncHooks.length>0&&(t.didChangeStore&&(t.didChangeStore=!1,t.subscribe=e=>{const n=new Set;for(const i of t.syncHooks)n.add(i.store);const r=[];for(const i of n)r.push(i.subscribe(e));return()=>{for(const i of r)i()}}),tw.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getSnapshot))}});function H8(t,e,n,r,i){const s=D8();if(!s)return _8(t,e,n,r,i);const a=s.syncIndex;s.syncIndex+=1;let u;return s.didInitialize?(u=s.syncHooks[a],(u.store!==t||u.selector!==e||!Object.is(u.a1,n)||!Object.is(u.a2,r)||!Object.is(u.a3,i))&&(u.store!==t&&(s.didChangeStore=!0),u.store=t,u.selector=e,u.a1=n,u.a2=r,u.a3=i,u.value=e(t.getSnapshot(),n,r,i))):(u={store:t,selector:e,a1:n,a2:r,a3:i,value:e(t.getSnapshot(),n,r,i)},s.syncHooks.push(u)),u.value}function j8(t,e,n,r,i){return k8.useSyncExternalStoreWithSelector(t.subscribe,t.getSnapshot,t.getSnapshot,s=>e(s,n,r,i))}class cD{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(e)}}update(e){for(const n in e)if(!Object.is(this.state[n],e[n])){this.setState({...this.state,...e});return}}set(e,n){Object.is(this.state[e],n)||this.setState({...this.state,[e]:n})}notifyAll(){const e={...this.state};this.setState(e)}use(e,n,r,i){return pe(this,e,n,r,i)}}function Tn(){}const Pi=Object.freeze([]),zn=Object.freeze({});class fm extends cD{constructor(e,n={},r){super(e),this.context=n,this.selectors=r}useSyncedValue(e,n){E.useDebugValue(e);const r=this;Oe(()=>{r.state[e]!==n&&r.set(e,n)},[r,e,n])}useSyncedValueWithCleanup(e,n){const r=this;Oe(()=>(r.state[e]!==n&&r.set(e,n),()=>{r.set(e,void 0)}),[r,e,n])}useSyncedValues(e){const n=this,r=Object.values(e);Oe(()=>{n.update(e)},[n,...r])}useControlledProp(e,n){E.useDebugValue(e);const r=this,i=n!==void 0;Oe(()=>{i&&!Object.is(r.state[e],n)&&r.setState({...r.state,[e]:n})},[r,e,n,i])}select(e,n,r,i){const s=this.selectors[e];return s(this.state,n,r,i)}useState(e,n,r,i){return E.useDebugValue(e),pe(this,this.selectors[e],n,r,i)}useContextCallback(e,n){E.useDebugValue(e);const r=Re(n??Tn);this.context[e]=r}useStateSetter(e){const n=E.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(e,r)}),n.current}observe(e,n){let r;typeof e=="function"?r=e:r=this.selectors[e];let i=r(this.state);return n(i,i,this),this.subscribe(s=>{const a=r(s);if(!Object.is(i,a)){const u=i;i=a,n(a,u,this)}})}}function dm(){return typeof window<"u"}function Lr(t){return rw(t)?(t.nodeName||"").toLowerCase():"#document"}function An(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function ol(t){var e;return(e=(rw(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function rw(t){return dm()?t instanceof Node||t instanceof An(t).Node:!1}function Tt(t){return dm()?t instanceof Element||t instanceof An(t).Element:!1}function fn(t){return dm()?t instanceof HTMLElement||t instanceof An(t).HTMLElement:!1}function vc(t){return!dm()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof An(t).ShadowRoot}function Bd(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=bi(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&i!=="inline"&&i!=="contents"}function V8(t){return/^(table|td|th)$/.test(Lr(t))}function hm(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const F8=/transform|translate|scale|rotate|perspective|filter/,U8=/paint|layout|strict|content/,Ua=t=>!!t&&t!=="none";let L0;function iw(t){const e=Tt(t)?bi(t):t;return Ua(e.transform)||Ua(e.translate)||Ua(e.scale)||Ua(e.rotate)||Ua(e.perspective)||!ow()&&(Ua(e.backdropFilter)||Ua(e.filter))||F8.test(e.willChange||"")||U8.test(e.contain||"")}function $8(t){let e=ia(t);for(;fn(e)&&!ta(e);){if(iw(e))return e;if(hm(e))return null;e=ia(e)}return null}function ow(){return L0==null&&(L0=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),L0}function ta(t){return/^(html|body|#document)$/.test(Lr(t))}function bi(t){return An(t).getComputedStyle(t)}function gm(t){return Tt(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function ia(t){if(Lr(t)==="html")return t;const e=t.assignedSlot||t.parentNode||vc(t)&&t.host||ol(t);return vc(e)?e.host:e}function fD(t){const e=ia(t);return ta(e)?(t.ownerDocument||t).body:fn(e)&&Bd(e)?e:fD(e)}function bc(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=fD(t),s=i===((r=t.ownerDocument)==null?void 0:r.body),a=An(i);if(s){const u=hx(a);return e.concat(a,a.visualViewport||[],Bd(i)?i:[],u&&n?bc(u):[])}else return e.concat(i,bc(i,[],n))}function hx(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function ps(...t){return()=>{for(let e=0;e<t.length;e+=1){const n=t[e];n&&n()}}}function Vt(t){return t?.ownerDocument||document}function Rt(t,e,n,r){return t.addEventListener(e,n,r),()=>{t.removeEventListener(e,n,r)}}function sw(t){E.useEffect(t,Pi)}const xg=null;class q8{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let i=0;i<n.length;i+=1)n[i]?.(e)};request(e){const n=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(e){const n=e-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}let Sg=new q8;class is{static create(){return new is}static request(e){return Sg.request(e)}static cancel(e){return Sg.cancel(e)}currentId=xg;request(e){this.cancel(),this.currentId=Sg.request(()=>{this.currentId=xg,e()})}cancel=()=>{this.currentId!==xg&&(Sg.cancel(this.currentId),this.currentId=xg)};disposeEffect=()=>this.cancel}function xc(){const t=Sr(is.create).current;return sw(t.disposeEffect),t}const If=0;class zo{static create(){return new zo}currentId=If;start(e,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=If,n()},e)}isStarted(){return this.currentId!==If}clear=()=>{this.currentId!==If&&(clearTimeout(this.currentId),this.currentId=If)};disposeEffect=()=>this.clear}function ii(){const t=Sr(zo.create).current;return sw(t.disposeEffect),t}function G8(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:W8,platform:K8,maxTouchPoints:Y8}=G8(),pm=W8.toLowerCase(),pd=K8.toLowerCase(),_d=/^i(os$|p)/.test(pd)||pd==="macintel"&&Y8>1,$A="android",Mp=pd===$A||pm.includes($A),dD=!_d&&pd.startsWith("mac");pd.startsWith("win");const X8=dD||_d,sl=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none"),qA=!sl&&pm.includes("firefox");!sl&&pm.includes("chrom");const Q8=X8,lw=/jsdom|happydom/.test(pm);function Dr(t){t.preventDefault(),t.stopPropagation()}function Z8(t){return"nativeEvent"in t}function aw(t){return t.pointerType===""&&t.isTrusted?!0:Mp&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType}function uw(t){return lw?!1:!Mp&&t.width===0&&t.height===0||Mp&&t.width===1&&t.height===1&&t.pressure===0&&t.detail===0&&t.pointerType==="mouse"||t.width<1&&t.height<1&&t.pressure===0&&t.detail===0&&t.pointerType==="touch"}function na(t,e){const n=["mouse","pen"];return e||n.push("",void 0),n.includes(t)}function J8(t){const e=t.type;return e==="click"||e==="mousedown"||e==="keydown"||e==="keyup"}const gx="data-base-ui-focusable",hD="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",eu="ArrowLeft",tu="ArrowRight",cw="ArrowUp",mm="ArrowDown";function Gr(t){let e=t.activeElement;for(;e?.shadowRoot?.activeElement!=null;)e=e.shadowRoot.activeElement;return e}function Qe(t,e){if(!t||!e)return!1;const n=e.getRootNode?.();if(t.contains(e))return!0;if(n&&vc(n)){let r=e;for(;r;){if(t===r)return!0;r=r.parentNode||r.host}}return!1}function Yn(t){return"composedPath"in t?t.composedPath()[0]:t.target}function Op(t,e){if(!Tt(t))return!1;const n=t;if(e.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,r]of e.entries())if(Qe(r,n))return!r.hasAttribute("data-trigger-disabled");return!1}function B0(t,e){if(e==null)return!1;if("composedPath"in t)return t.composedPath().includes(e);const n=t;return n.target!=null&&e.contains(n.target)}function e6(t){return t.matches("html,body")}function ym(t){return fn(t)&&t.matches(hD)}function gD(t){return t?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${hD}`)!=null}function px(t){return t?t.getAttribute("role")==="combobox"&&ym(t):!1}function t6(t){if(!t||lw)return!0;try{return t.matches(":focus-visible")}catch{return!0}}function kp(t){return t?t.hasAttribute(gx)?t:t.querySelector(`[${gx}]`)||t:null}function n6(t,e){return e!=null&&!na(e)?0:typeof t=="function"?t():t}function oa(t,e,n){const r=n6(t,n);return typeof r=="number"?r:r?.[e]}function GA(t){return typeof t=="function"?t():t}function pD(t,e){return e||t==="click"||t==="mousedown"}function r6(t){return t?.includes("mouse")&&t!=="mousedown"}const yr="none",Hd="trigger-press",mi="trigger-hover",up="trigger-focus",vm="outside-press",cp="item-press",mD="close-press",WA="clear-press",Kf="input-change",ns="input-clear",yD="input-press",jd="focus-out",Vd="escape-key",KA="list-navigation",fw="keyboard",dw="pointer",i6="cancel-open",vD="disabled",YA="missing",XA="initial",bD="imperative-action",o6="window-resize";function Xe(t,e,n,r){let i=!1,s=!1;const a=r??zn;return{reason:t,event:e??new Event("base-ui"),cancel(){i=!0},allowPropagation(){s=!0},get isCanceled(){return i},get isPropagationAllowed(){return s},trigger:n,...a}}function s6(t,e,n){const r=n??zn;return{reason:t,event:e??new Event("base-ui"),...r}}const xD=E.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new zo,currentIdRef:{current:null},currentContextRef:{current:null}});function l6(t,e){t.current=e.current}function a6(t){const{children:e,delay:n,timeoutMs:r=0}=t,i=E.useRef(n),s=E.useRef(n),a=E.useRef(null),u=E.useRef(null),f=ii();return Oe(()=>{if(s.current=n,!a.current){i.current=n;return}i.current={open:oa(i.current,"open"),close:oa(n,"close")}},[n,a,i,s]),I.jsx(xD.Provider,{value:E.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:s,currentIdRef:a,timeoutMs:r,currentContextRef:u,timeout:f}),[r,f]),children:e})}function u6(t,e={open:!1}){const{open:n}=e,r="rootStore"in t?t.rootStore:t,i=r.useState("floatingId"),s=E.useContext(xD),{currentIdRef:a,delayRef:u,timeoutMs:f,initialDelayRef:d,currentContextRef:g,hasProvider:p,timeout:m}=s,[v,b]=E.useState(!1),S=E.useRef(n);return Oe(()=>{S.current=n},[n]),Oe(()=>{function w(){g.current?.setIsInstantPhase(!1),a.current=null,g.current=null,u.current=d.current,m.clear()}if(a.current&&!n&&a.current===i){if(b(!1),f){const C=i;return m.start(f,()=>{r.select("open")||a.current&&a.current!==C||w()}),()=>{(S.current||a.current!==C)&&m.clear()}}w()}},[n,i,a,u,f,d,g,m,r]),Oe(()=>{if(!n)return;const w=g.current,C=a.current;m.clear(),g.current={onOpenChange:r.setOpen,setIsInstantPhase:b},a.current=i,u.current={open:0,close:oa(d.current,"close")},C!==null&&C!==i?(b(!0),w?.setIsInstantPhase(!0),w?.onOpenChange(!1,Xe(yr))):(b(!1),w?.setIsInstantPhase(!1))},[n,i,r,a,u,d,g,m]),Oe(()=>()=>{if(a.current===i){if(g.current=null,!S.current)return;a.current=null,l6(u,d),m.clear()}},[g,a,u,i,d,m]),E.useMemo(()=>({hasProvider:p,delayRef:u,isInstantPhase:v}),[p,u,v])}const Ip=E.forwardRef(function(e,n){const[r,i]=E.useState();Oe(()=>{Q8&&sl&&i("button")},[]);const s={tabIndex:0,role:r};return I.jsx("span",{...e,ref:n,style:ZS,"aria-hidden":r?void 0:!0,...s,"data-base-ui-focus-guard":""})}),Sc=Math.min,Qs=Math.max,Dp=Math.round,Wa=Math.floor,Zs=t=>({x:t,y:t}),c6={left:"right",right:"left",bottom:"top",top:"bottom"};function SD(t,e,n){return Qs(t,Sc(e,n))}function sa(t,e){return typeof t=="function"?t(e):t}function so(t){return t.split("-")[0]}function ha(t){return t.split("-")[1]}function hw(t){return t==="x"?"y":"x"}function gw(t){return t==="y"?"height":"width"}function eo(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function pw(t){return hw(eo(t))}function f6(t,e,n){n===void 0&&(n=!1);const r=ha(t),i=pw(t),s=gw(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(a=Pp(a)),[a,Pp(a)]}function d6(t){const e=Pp(t);return[mx(t),e,mx(e)]}function mx(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const QA=["left","right"],ZA=["right","left"],h6=["top","bottom"],g6=["bottom","top"];function p6(t,e,n){switch(t){case"top":case"bottom":return n?e?ZA:QA:e?QA:ZA;case"left":case"right":return e?h6:g6;default:return[]}}function m6(t,e,n,r){const i=ha(t);let s=p6(so(t),n==="start",r);return i&&(s=s.map(a=>a+"-"+i),e&&(s=s.concat(s.map(mx)))),s}function Pp(t){const e=so(t);return c6[e]+t.slice(e.length)}function y6(t){var e,n,r,i;return{top:(e=t.top)!=null?e:0,right:(n=t.right)!=null?n:0,bottom:(r=t.bottom)!=null?r:0,left:(i=t.left)!=null?i:0}}function wD(t){return typeof t!="number"?y6(t):{top:t,right:t,bottom:t,left:t}}function md(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function wg(t,e,n){return Math.floor(t/e)!==n}function ra(t,e){return e<0||e>=t.length}function fp(t,e){return Er(t.current,{disabledIndices:e})}function yx(t,e){return Er(t.current,{decrement:!0,startingIndex:t.current.length,disabledIndices:e})}function Er(t,{startingIndex:e=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let s=e;do s+=n?-i:i;while(s>=0&&s<=t.length-1&&wc(t,s,r));return s}function v6(t,{event:e,orientation:n,loopFocus:r,onLoop:i,rtl:s,cols:a,disabledIndices:u,minIndex:f,maxIndex:d,prevIndex:g,stopEvent:p=!1}){let m=g,v;if(e.key===cw?v="up":e.key===mm&&(v="down"),v){const b=[],S=[];let w=!1,C=0;{let L=null,H=-1;t.forEach((N,_)=>{if(N==null)return;C+=1;const $=N.closest('[role="row"]');$&&(w=!0),($!==L||H===-1)&&(L=$,H+=1,b[H]=[]),b[H].push(_),S[_]=H})}let R=!1,T=0;if(w)for(const L of b){const H=L.length;H>T&&(T=H),H!==a&&(R=!0)}const A=R&&C<t.length,O=T||a,P=L=>{if(!R||g===-1)return;const H=S[g];if(H==null)return;const N=b[H].indexOf(g),_=L==="up"?-1:1;for(let $=H+_,F=0;F<b.length;F+=1,$+=_){if($<0||$>=b.length){if(!r||A)return;if($=$<0?b.length-1:0,i){const j=Math.min(N,b[$].length-1),q=b[$][j]??b[$][0],V=i(e,g,q);$=S[V]??$}}const G=b[$];for(let j=Math.min(N,G.length-1);j>=0;j-=1){const q=G[j];if(!wc(t,q,u))return q}}},M=L=>{if(!A||g===-1)return;const H=g%O,N=L==="up"?-O:O,_=d-d%O,$=Wa(d/O)+1;for(let F=g-H+N,G=0;G<$;G+=1,F+=N){if(F<0||F>d){if(!r)return;F=F<0?_:0}const j=Math.min(F+O-1,d);for(let q=Math.min(F+H,j);q>=F;q-=1)if(!wc(t,q,u))return q}};p&&Dr(e);const D=P(v)??M(v);if(D!==void 0)m=D;else if(g===-1)m=v==="up"?d:f;else if(m=Er(t,{startingIndex:g,amount:O,decrement:v==="up",disabledIndices:u}),r){if(v==="up"&&(g-O<f||m<0)){const L=g%O,H=d%O,N=d-(H-L);H===L?m=d:m=H>L?N:N-O,i&&(m=i(e,g,m))}v==="down"&&g+O>d&&(m=Er(t,{startingIndex:g%O-O,amount:O,disabledIndices:u}),i&&(m=i(e,g,m)))}ra(t,m)&&(m=g)}if(n==="both"){const b=Wa(g/a);e.key===(s?eu:tu)&&(p&&Dr(e),g%a!==a-1?(m=Er(t,{startingIndex:g,disabledIndices:u}),r&&wg(m,a,b)&&(m=Er(t,{startingIndex:g-g%a-1,disabledIndices:u}),i&&(m=i(e,g,m)))):r&&(m=Er(t,{startingIndex:g-g%a-1,disabledIndices:u}),i&&(m=i(e,g,m))),wg(m,a,b)&&(m=g)),e.key===(s?tu:eu)&&(p&&Dr(e),g%a!==0?(m=Er(t,{startingIndex:g,decrement:!0,disabledIndices:u}),r&&wg(m,a,b)&&(m=Er(t,{startingIndex:g+(a-g%a),decrement:!0,disabledIndices:u}),i&&(m=i(e,g,m)))):r&&(m=Er(t,{startingIndex:g+(a-g%a),decrement:!0,disabledIndices:u}),i&&(m=i(e,g,m))),wg(m,a,b)&&(m=g));const S=Wa(d/a)===b;ra(t,m)&&(r&&S?(m=e.key===(s?tu:eu)?d:Er(t,{startingIndex:g-g%a-1,disabledIndices:u}),i&&(m=i(e,g,m))):m=g)}return m}function wc(t,e,n){if(typeof n=="function"?n(e):n?.includes(e)??!1)return!0;const i=t[e];return i?!bm(i)||i.matches(":disabled")?!0:!n&&(i.hasAttribute("disabled")||i.getAttribute("aria-disabled")==="true"):!1}function b6(t){return t.visibility==="hidden"||t.visibility==="collapse"}function bm(t,e=t?bi(t):null){return!t||!t.isConnected||!e||b6(e)?!1:typeof t.checkVisibility=="function"?t.checkVisibility():e.display!=="none"&&e.display!=="contents"}const x6='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function S6(t){const e=t.assignedSlot;if(e)return e;if(t.parentElement)return t.parentElement;const n=t.getRootNode();return vc(n)?n.host:null}function vx(t){for(const e of Array.from(t.children))if(Lr(e)==="summary")return e;return null}function w6(t,e){const n=vx(e);return!!n&&(t===n||Qe(n,t))}function CD(t){const e=t?Lr(t):"";return t!=null&&t.matches(x6)&&(e!=="summary"||t.parentElement!=null&&Lr(t.parentElement)==="details"&&vx(t.parentElement)===t)&&(e!=="details"||vx(t)==null)&&(e!=="input"||t.type!=="hidden")}function RD(t){if(!CD(t)||!t.isConnected||t.matches(":disabled"))return!1;for(let e=t;e;e=S6(e)){const n=e!==t,r=Lr(e)==="slot";if(e.hasAttribute("inert")||n&&Lr(e)==="details"&&!e.open&&!w6(t,e)||e.hasAttribute("hidden")||!r&&!C6(e,n))return!1}return!0}function C6(t,e){const n=bi(t);return e?n.display!=="none":bm(t,n)}function ED(t){const e=t.tabIndex;if(e<0){const n=Lr(t);if(n==="details"||n==="audio"||n==="video"||fn(t)&&t.isContentEditable)return 0}return e}function _0(t){if(Lr(t)!=="input")return null;const e=t;return e.type==="radio"&&e.name!==""?e:null}function R6(t,e){const n=_0(t);if(!n)return!0;const r=e.find(i=>{const s=_0(i);return s?.name===n.name&&s.form===n.form&&s.checked});return r?r===n:e.find(i=>{const s=_0(i);return s?.name===n.name&&s.form===n.form})===n}function TD(t){if(fn(t)&&Lr(t)==="slot"){const e=t.assignedElements({flatten:!0});if(e.length>0)return e}return fn(t)&&t.shadowRoot?Array.from(t.shadowRoot.children):Array.from(t.children)}function AD(t,e){TD(t).forEach(n=>{CD(n)&&e.push(n),AD(n,e)})}function MD(t,e,n){TD(t).forEach(r=>{fn(r)&&r.matches(e)&&n.push(r),MD(r,e,n)})}function mw(t){return RD(t)&&ED(t)>=0}function OD(t){const e=[];return AD(t,e),e.filter(RD)}function xm(t){const e=OD(t);return e.filter(n=>ED(n)>=0&&R6(n,e))}function kD(t,e){const n=xm(t),r=n.length;if(r===0)return;const i=Gr(Vt(t)),s=n.indexOf(i),a=s===-1?e===1?0:r-1:s+e;return n[a]}function ID(t){return kD(Vt(t).body,1)||t}function DD(t){return kD(Vt(t).body,-1)||t}function Yf(t,e){const n=e||t.currentTarget,r=t.relatedTarget;return!r||!Qe(n,r)}function E6(t){xm(t).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function JA(t){const e=[];MD(t,"[data-tabindex]",e),e.forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function la(t,e,n=!0){return t.filter(i=>i.parentId===e).flatMap(i=>[...!n||i.context?.open?[i]:[],...la(t,i.id,n)])}function eM(t,e){let n=[],r=t.find(i=>i.id===e)?.parentId;for(;r;){const i=t.find(s=>s.id===r);r=i?.parentId,i&&(n=n.concat(i))}return n}function yd(t){return`data-base-ui-${t}`}let Cg=0;function dp(t,e={}){const{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=e;cancelAnimationFrame(Cg);function s(){i&&!i()||t?.focus({preventScroll:n})}if(r)return s(),Tn;const a=requestAnimationFrame(s);return Cg=a,()=>{Cg===a&&(cancelAnimationFrame(a),Cg=0)}}const H0={inert:new WeakMap,"aria-hidden":new WeakMap},tM="data-base-ui-inert",bx={inert:new WeakSet,"aria-hidden":new WeakSet};let Df=new WeakMap,j0=0;function T6(t){return bx[t]}function PD(t){return t?vc(t)?t.host:PD(t.parentNode):null}const nM=(t,e)=>e.map(n=>{if(t.contains(n))return n;const r=PD(n);return t.contains(r)?r:null}).filter(n=>n!=null),rM=t=>{const e=new Set;return t.forEach(n=>{let r=n;for(;r&&!e.has(r);)e.add(r),r=r.parentNode}),e},iM=(t,e,n)=>{const r=[],i=s=>{!s||n.has(s)||Array.from(s.children).forEach(a=>{Lr(a)!=="script"&&(e.has(a)?i(a):r.push(a))})};return i(t),r};function A6(t,e,n,r,{mark:i=!0}){let s=null;r?s="inert":n&&(s="aria-hidden");let a=null,u=null;const f=nM(e,t),d=i?iM(e,rM(f),new Set(f)):[],g=[],p=[];if(s){const m=H0[s],v=T6(s);u=v,a=m;const b=nM(e,Array.from(e.querySelectorAll("[aria-live]"))),S=f.concat(b);iM(e,rM(S),new Set(S)).forEach(C=>{const R=C.getAttribute(s),T=R!==null&&R!=="false",A=(m.get(C)||0)+1;m.set(C,A),g.push(C),A===1&&T&&v.add(C),T||C.setAttribute(s,s==="inert"?"":"true")})}return i&&d.forEach(m=>{const v=(Df.get(m)||0)+1;Df.set(m,v),p.push(m),v===1&&m.setAttribute(tM,"")}),j0+=1,()=>{a&&g.forEach(m=>{const b=(a.get(m)||0)-1;a.set(m,b),b||(!u?.has(m)&&s&&m.removeAttribute(s),u?.delete(m))}),i&&p.forEach(m=>{const v=(Df.get(m)||0)-1;Df.set(m,v),v||m.removeAttribute(tM)}),j0-=1,j0||(H0.inert=new WeakMap,H0["aria-hidden"]=new WeakMap,bx.inert=new WeakSet,bx["aria-hidden"]=new WeakSet,Df=new WeakMap)}}function oM(t,e={}){const{ariaHidden:n=!1,inert:r=!1,mark:i=!0}=e,s=Vt(t[0]).body;return A6(t,s,n,r,{mark:i})}let sM=0;function M6(t,e="mui"){const[n,r]=E.useState(t),i=t||n;return E.useEffect(()=>{n==null&&(sM+=1,r(`${e}-${sM}`))},[n,e]),i}const lM=ew.useId;function Sm(t,e){if(lM!==void 0){const n=lM();return t??(e?`${e}-${n}`:n)}return M6(t,e)}function aM(t){if(!E.isValidElement(t))return null;const e=t,n=e.props;return(nw(19)?n?.ref:e.ref)??null}function xx(t,e){if(t&&!e)return t;if(!t&&e)return e;if(t||e)return{...t,...e}}function O6(t,e){const n={};for(const r in t){const i=t[r];if(e?.hasOwnProperty(r)){const s=e[r](i);s!=null&&Object.assign(n,s);continue}i===!0?n[`data-${r.toLowerCase()}`]="":i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function k6(t,e){return typeof t=="function"?t(e):t}function I6(t,e){return typeof t=="function"?t(e):t}const yw={};function ko(t,e,n,r,i){if(!n&&!r&&!i&&!t)return zp(e);let s=zp(t);return e&&(s=jf(s,e)),n&&(s=jf(s,n)),r&&(s=jf(s,r)),i&&(s=jf(s,i)),s}function D6(t){if(t.length===0)return yw;if(t.length===1)return zp(t[0]);let e=zp(t[0]);for(let n=1;n<t.length;n+=1)e=jf(e,t[n]);return e}function zp(t){return vw(t)?{...ND(t,yw)}:P6(t)}function jf(t,e){return vw(e)?ND(e,t):z6(t,e)}function P6(t){const e={...t};for(const n in e){const r=e[n];zD(n,r)&&(e[n]=LD(r))}return e}function z6(t,e){if(!e)return t;for(const n in e){const r=e[n];switch(n){case"style":{t[n]=xx(t.style,r);break}case"className":{t[n]=BD(t.className,r);break}default:zD(n,r)?t[n]=N6(t[n],r):t[n]=r}}return t}function zD(t,e){const n=t.charCodeAt(0),r=t.charCodeAt(1),i=t.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof e=="function"||typeof e>"u")}function vw(t){return typeof t=="function"}function ND(t,e){return vw(t)?t(e):t??yw}function N6(t,e){return e?t?(...n)=>{const r=n[0];if(_D(r)){const s=r;Np(s);const a=e(...n);return s.baseUIHandlerPrevented||t?.(...n),a}const i=e(...n);return t?.(...n),i}:LD(e):t}function LD(t){return t&&((...e)=>{const n=e[0];return _D(n)&&Np(n),t(...e)})}function Np(t){return t.preventBaseUIHandler=()=>{t.baseUIHandlerPrevented=!0},t}function BD(t,e){return e?t?e+" "+t:e:t}function _D(t){return t!=null&&typeof t=="object"&&"nativeEvent"in t}function At(t,e,n={}){const r=e.render,i=L6(e,n);if(n.enabled===!1)return null;const s=n.state??zn;return H6(t,r,i,s)}function L6(t,e={}){const{className:n,style:r,render:i}=t,{state:s=zn,ref:a,props:u,stateAttributesMapping:f,enabled:d=!0}=e,g=d?k6(n,s):void 0,p=d?I6(r,s):void 0,m=d?O6(s,f):zn,v=d&&u?B6(u):void 0,b=d?xx(m,v)??{}:zn;return typeof document<"u"&&(d?Array.isArray(a)?b.ref=y8([b.ref,aM(i),...a]):b.ref=tl(b.ref,aM(i),a):tl(null,null)),d?(g!==void 0&&(b.className=BD(b.className,g)),p!==void 0&&(b.style=xx(b.style,p)),b):zn}function B6(t){return Array.isArray(t)?D6(t):ko(void 0,t)}const _6=Symbol.for("react.lazy");function H6(t,e,n,r){if(e){if(typeof e=="function")return e(n,r);const i=ko(n,e.props);i.ref=n.ref;let s=e;return s?.$$typeof===_6&&(s=E.Children.toArray(e)[0]),E.cloneElement(s,i)}if(t&&typeof t=="string")return j6(t,n);throw new Error(Un(8))}function j6(t,e){return t==="button"?E.createElement("button",{type:"button",...e,key:e.key}):t==="img"?E.createElement("img",{alt:"",...e,key:e.key}):E.createElement(t,e)}const V6={style:{transition:"none"}},HD="data-base-ui-click-trigger",jD={fallbackAxisSide:"none"},F6={fallbackAxisSide:"end"},U6={clipPath:"inset(50%)",position:"fixed",top:0,left:0},VD=E.createContext(null),FD=()=>E.useContext(VD),$6=yd("portal");function UD(t={}){const{ref:e,container:n,componentProps:r=zn,elementProps:i}=t,s=Sm(),u=FD()?.portalNode,[f,d]=E.useState(null),[g,p]=E.useState(null),m=Re(w=>{w!==null&&p(w)}),v=E.useRef(null);Oe(()=>{if(n===null){v.current&&(v.current=null,p(null),d(null));return}const w=(n&&(rw(n)?n:n.current))??u??document.body;if(w==null){v.current&&(v.current=null,p(null),d(null));return}v.current!==w&&(v.current=w,p(null),d(w))},[n,u]);const b=At("div",r,{ref:[e,m],props:[{id:s,[$6]:""},i]}),S=f&&b?il.createPortal(b,f):null;return{node:g,nodeId:E.isValidElement(b)?b.props.id:void 0,subtree:S}}const bw=E.forwardRef(function(e,n){const{render:r,className:i,style:s,children:a,container:u,...f}=e,{node:d,nodeId:g,subtree:p}=UD({container:u,ref:n,componentProps:e,elementProps:f}),m=E.useRef(null),v=E.useRef(null),b=E.useRef(null),S=E.useRef(null),[w,C]=E.useState(null),R=E.useRef(!1),T=w?.modal,A=w?.open,O=!!w&&!w.modal&&w.open&&!!d;E.useEffect(()=>{if(!d||T)return;function M(D){d&&D.relatedTarget&&Yf(D)&&(D.type==="focusin"?R.current&&(JA(d),R.current=!1):(E6(d),R.current=!0))}return ps(Rt(d,"focusin",M,!0),Rt(d,"focusout",M,!0))},[d,T]),Oe(()=>{!d||A!==!0||!R.current||(JA(d),R.current=!1)},[A,d]);const P=E.useMemo(()=>({beforeOutsideRef:m,afterOutsideRef:v,beforeInsideRef:b,afterInsideRef:S,portalNode:d,setFocusManagerState:C}),[d]);return I.jsxs(E.Fragment,{children:[p,I.jsxs(VD.Provider,{value:P,children:[O&&d&&I.jsx(Ip,{"data-type":"outside",ref:m,onFocus:M=>{if(Yf(M,d))b.current?.focus();else{const D=w?w.domReference:null;DD(D)?.focus()}}}),O&&d&&I.jsx("span",{"aria-owns":g,style:U6}),d&&il.createPortal(a,d),O&&d&&I.jsx(Ip,{"data-type":"outside",ref:v,onFocus:M=>{if(Yf(M,d))S.current?.focus();else{const D=w?w.domReference:null;ID(D)?.focus(),w?.closeOnFocusOut&&w?.onOpenChange(!1,Xe(jd,M.nativeEvent))}}})]})]})});function q6(){const t=new Map;return{emit(e,n){t.get(e)?.forEach(r=>r(n))},on(e,n){t.has(e)||t.set(e,new Set),t.get(e).add(n)},off(e,n){t.get(e)?.delete(n)}}}const G6=E.createContext(null),W6=E.createContext(null),wm=()=>E.useContext(G6)?.id||null,zc=t=>{const e=E.useContext(W6);return t??e};function $s(t){return t==null?t:"current"in t?t.current:t}function K6(t,e){const n=An(Yn(t));return t instanceof n.KeyboardEvent?"keyboard":t instanceof n.FocusEvent?e||"keyboard":"pointerType"in t?t.pointerType||"keyboard":"touches"in t?"touch":t instanceof n.MouseEvent?e||(t.detail===0?"keyboard":"mouse"):""}const uM=20;let Yl=[];function xw(){Yl=Yl.filter(t=>t.deref()?.isConnected)}function cM(t){xw(),t&&Lr(t)!=="body"&&(Yl.push(new WeakRef(t)),Yl.length>uM&&(Yl=Yl.slice(-uM)))}function fM(){return xw(),Yl[Yl.length-1]?.deref()}function Y6(t){return t?mw(t)?t:xm(t)[0]||t:null}function dM(t){if(t.hasAttribute("tabindex")&&!t.hasAttribute("data-tabindex")||!t.getAttribute("role")?.includes("dialog"))return;const n=OD(t).filter(i=>{const s=i.getAttribute("data-tabindex")||"";return mw(i)||i.hasAttribute("data-tabindex")&&!s.startsWith("-")}),r=t.getAttribute("tabindex");n.length===0?r!=="0"&&(t.setAttribute("tabindex","0"),t.setAttribute("data-tabindex","0")):(r!=="-1"||t.hasAttribute("data-tabindex")&&t.getAttribute("data-tabindex")!=="-1")&&(t.setAttribute("tabindex","-1"),t.setAttribute("data-tabindex","-1"))}function Sw(t){const{context:e,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:s=!0,restoreFocus:a=!1,modal:u=!0,closeOnFocusOut:f=!0,openInteractionType:d="",nextFocusableElement:g,previousFocusableElement:p,beforeContentFocusGuardRef:m,externalTree:v,getInsideElements:b}=t,S="rootStore"in e?e.rootStore:e,w=S.useState("open"),C=S.useState("domReferenceElement"),R=S.useState("floatingElement"),{events:T,dataRef:A}=S.context,O=Re(()=>A.current.floatingContext?.nodeId),P=i===!1,M=px(C)&&P,D=Fn(i),L=Fn(s),H=Fn(d),N=Fn(w),_=zc(v),$=FD(),F=E.useRef(!1),G=E.useRef(!1),j=E.useRef(!1),q=E.useRef(null),V=E.useRef(""),te=E.useRef(""),J=E.useRef(null),z=E.useRef(null),U=tl(J,m,$?.beforeInsideRef),W=tl(z,$?.afterInsideRef),X=ii(),ie=ii(),ee=xc(),ue=$!=null,Y=kp(R),le=Re((de=Y)=>de?xm(de):[]),xe=Re(()=>b?.().filter(de=>de!=null)??[]);E.useEffect(()=>{if(r||!u)return;function de(Ce){Ce.key==="Tab"&&Qe(Y,Gr(Vt(Y)))&&le().length===0&&!M&&Dr(Ce)}const me=Vt(Y);return Rt(me,"keydown",de)},[r,Y,u,M,le]),E.useEffect(()=>{if(r||!w)return;const de=Vt(Y);function me(){j.current=!1}function Ce(ze){const Ee=Yn(ze),Ve=xe(),Ie=Qe(R,Ee)||Qe(C,Ee)||Qe($?.portalNode,Ee)||Ve.some(He=>He===Ee||Qe(He,Ee));j.current=!Ie,te.current=ze.pointerType||"keyboard",Ee?.closest(`[${HD}]`)&&(G.current=!0,ie.start(0,()=>{G.current=!1}))}function Pe(){te.current="keyboard"}return ps(Rt(de,"pointerdown",Ce,!0),Rt(de,"pointerup",me,!0),Rt(de,"pointercancel",me,!0),Rt(de,"keydown",Pe,!0),me)},[r,R,C,Y,w,$,ie,xe]),E.useEffect(()=>{if(r||!f)return;const de=Vt(Y);function me(){G.current=!0,ie.start(0,()=>{G.current=!1})}function Ce(Ve){const Ie=Yn(Ve);mw(Ie)&&(q.current=Ie)}function Pe(Ve){const Ie=Ve.relatedTarget,He=Ve.currentTarget,Ge=Yn(Ve);u&&Ie==null&&Ge!=null&&Qe(R,Ge)&&cM(Ge),queueMicrotask(()=>{const We=O(),fe=S.context.triggerElements,ne=xe(),Q=Ie?.hasAttribute(yd("focus-guard"))&&[J.current,z.current,$?.beforeInsideRef.current,$?.afterInsideRef.current,$?.beforeOutsideRef.current,$?.afterOutsideRef.current,$s(p),$s(g)].includes(Ie),Se=!(Qe(C,Ie)||Qe(R,Ie)||Qe(Ie,R)||Qe($?.portalNode,Ie)||ne.some(ge=>ge===Ie||Qe(ge,Ie))||fe.hasMatchingElement(ge=>Qe(ge,Ie))||Q||_&&(la(_.nodesRef.current,We).find(ge=>Qe(ge.context?.elements.floating,Ie)||Qe(ge.context?.elements.domReference,Ie))||eM(_.nodesRef.current,We).find(ge=>[ge.context?.elements.floating,kp(ge.context?.elements.floating)].includes(Ie)||ge.context?.elements.domReference===Ie)));if(He===C&&Y&&dM(Y),a&&He!==C&&!bm(Ge)&&Gr(de)===de.body){if(fn(Y)&&(Y.focus(),a==="popup")){ee.request(()=>{Y.focus()});return}const ge=le(),De=q.current,Te=(De&&ge.includes(De)?De:null)||ge[ge.length-1]||Y;fn(Te)&&Te.focus()}if(A.current.insideReactTree){A.current.insideReactTree=!1;return}(M||!u)&&Ie&&Se&&!G.current&&(M||Ie!==fM())&&(F.current=!0,S.setOpen(!1,Xe(jd,Ve)))})}function ze(){j.current||(A.current.insideReactTree=!0,X.start(0,()=>{A.current.insideReactTree=!1}))}const Ee=fn(C)?C:null;if(!(!R&&!Ee))return ps(Ee&&Rt(Ee,"focusout",Pe),Ee&&Rt(Ee,"pointerdown",me),R&&Rt(R,"focusin",Ce),R&&Rt(R,"focusout",Pe),R&&$&&Rt(R,"focusout",ze,!0))},[r,C,R,Y,u,_,$,S,f,a,le,M,O,A,X,ie,ee,g,p,xe]),E.useEffect(()=>{if(r||!R||!w)return;const de=Array.from($?.portalNode?.querySelectorAll(`[${yd("portal")}]`)||[]),Ce=(_?eM(_.nodesRef.current,O()):[]).find(He=>px(He.context?.elements.domReference||null))?.context?.elements.domReference,ze=[...[R,...de,J.current,z.current,$?.beforeOutsideRef.current,$?.afterOutsideRef.current,...xe()],Ce,$s(p),$s(g),M?C:null].filter(He=>He!=null),Ee=oM(ze,{ariaHidden:u||M,mark:!1}),Ve=[R,...de].filter(He=>He!=null),Ie=oM(Ve);return()=>{Ie(),Ee()}},[w,r,C,R,u,$,M,_,O,g,p,xe]),Oe(()=>{if(!w||r||!fn(Y))return;V.current="",te.current="";const de=Vt(Y),me=Gr(de);queueMicrotask(()=>{const Ce=D.current,Pe=typeof Ce=="function"?Ce(H.current||""):Ce;if(Pe===void 0||Pe===!1||Qe(Y,me))return;let Ee=null;const Ve=()=>(Ee==null&&(Ee=le(Y)),Ee[0]||Y);let Ie;Pe===!0||Pe===null?Ie=Ve():Ie=$s(Pe),Ie=Ie||Ve();const He=Qe(Y,Gr(de));dp(Ie,{preventScroll:Ie===Y,shouldFocus(){if(!N.current)return!1;if(He)return!0;const Ge=Gr(de);return!(Ge!==Ie&&Qe(Y,Ge))}})})},[r,w,Y,le,D,H,N]),Oe(()=>{if(r||!Y)return;const de=Vt(Y),me=Gr(de),Ce=H.current==null;cM(me);function Pe(Ee){if(Ee.open||(V.current=K6(Ee.nativeEvent,te.current)),Ee.reason===mi&&Ee.nativeEvent.type==="mouseleave"&&(F.current=!0),Ee.reason===vm)if(Ee.nested)F.current=!1;else if(aw(Ee.nativeEvent)||uw(Ee.nativeEvent))F.current=!1;else{let Ve=!1;Vt(Y).createElement("div").focus({get preventScroll(){return Ve=!0,!1}}),Ve?F.current=!1:F.current=!0}}T.on("openchange",Pe);function ze(Ee){const Ve=L.current;let Ie=typeof Ve=="function"?Ve(Ee):Ve;if(Ie===void 0||Ie===!1)return null;Ie===null&&(Ie=!0);const He=C?.isConnected?C:null,Ge=me?.isConnected&&Lr(me)!=="body"?me:null;let We=Ce?Ge||He:He||Ge;return We||(We=fM()||null),typeof Ie=="boolean"?We:$s(Ie)||We||null}return()=>{T.off("openchange",Pe);const Ee=Gr(de),Ve=xe(),Ie=Qe(R,Ee)||Ve.some(fe=>fe===Ee||Qe(fe,Ee))||_&&la(_.nodesRef.current,O(),!1).some(fe=>Qe(fe.context?.elements.floating,Ee)),He=L.current,Ge=V.current,We=ze(Ge);queueMicrotask(()=>{const fe=Y6(We),ne=typeof He!="boolean";if(He&&!F.current&&fn(fe)&&(!(!ne&&fe!==Ee&&Ee!==de.body)||Ie)){const Q={preventScroll:!0};Ge==="keyboard"&&(Q.focusVisible=!0),fe.focus(Q)}F.current=!1})}},[r,R,Y,L,H,T,_,C,O,xe]),Oe(()=>{if(!sl||w||!R)return;const de=Gr(Vt(R));!fn(de)||!ym(de)||Qe(R,de)&&de.blur()},[w,R]),Oe(()=>{if(!(r||!$))return $.setFocusManagerState({modal:u,closeOnFocusOut:f,open:w,onOpenChange:S.setOpen,domReference:C}),()=>{$.setFocusManagerState(null)}},[r,$,u,w,S,f,C]),Oe(()=>{if(!(r||!Y))return dM(Y),()=>{queueMicrotask(xw)}},[r,Y]);const ve=!r&&(u?!M:!0)&&(ue||u);return I.jsxs(E.Fragment,{children:[ve&&I.jsx(Ip,{"data-type":"inside",ref:U,onFocus:de=>{if(u){const me=le();dp(me[me.length-1])}else $?.portalNode&&(F.current=!1,Yf(de,$.portalNode)?ID(C)?.focus():$s(p??$.beforeOutsideRef)?.focus())}}),n,ve&&I.jsx(Ip,{"data-type":"inside",ref:W,onFocus:de=>{u?dp(le()[0]):$?.portalNode&&(f&&(F.current=!0),Yf(de,$.portalNode)?DD(C)?.focus():$s(g??$.afterOutsideRef)?.focus())}})]})}function ww(t,e={}){const{enabled:n=!0,event:r="click",toggle:i=!0,ignoreMouse:s=!1,stickIfOpen:a=!0,touchOpenDelay:u=0,reason:f=Hd}=e,d="rootStore"in t?t.rootStore:t,g=d.context.dataRef,p=E.useRef(void 0),m=xc(),v=ii(),b=E.useMemo(()=>{function S(C,R,T,A){const O=Xe(f,R,T);C&&A==="touch"&&u>0?v.start(u,()=>{d.setOpen(!0,O)}):d.setOpen(C,O)}function w(C,R,T){const A=g.current.openEvent,O=d.select("domReferenceElement")!==R;return C&&O||!C||!i?!0:A&&a?!T(A.type):!1}return{onPointerDown(C){p.current=na(C.pointerType,!0)&&uw(C.nativeEvent)?"virtual":C.pointerType},onMouseDown(C){const R=p.current,T=C.nativeEvent,A=d.select("open");if(C.button!==0||r==="click"||na(R,!0)&&s)return;const O=w(A,C.currentTarget,D=>D==="click"||D==="mousedown"),P=Yn(T);if(ym(P)){S(O,T,P,R);return}const M=C.currentTarget;m.request(()=>{S(O,T,M,R)})},onClick(C){if(r==="mousedown-only")return;const R=p.current;if(r==="mousedown"&&R){p.current=void 0;return}if(na(R,!0)&&s)return;const T=d.select("open"),A=w(T,C.currentTarget,O=>O==="click"||O==="mousedown"||O==="keydown"||O==="keyup");S(A,C.nativeEvent,C.currentTarget,R)},onKeyDown(){p.current=void 0}}},[g,r,s,f,d,a,i,m,v,u]);return E.useMemo(()=>n?{reference:b}:zn,[n,b])}function X6(t,e){let n=null,r=null,i=!1;return{contextElement:t||void 0,getBoundingClientRect(){const s=t?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},a=e.axis==="x"||e.axis==="both",u=e.axis==="y"||e.axis==="both",f=["mouseenter","mousemove"].includes(e.dataRef.current.openEvent?.type||"")&&e.pointerType!=="touch";let d=s.width,g=s.height,p=s.x,m=s.y;return n==null&&e.x&&a&&(n=s.x-e.x),r==null&&e.y&&u&&(r=s.y-e.y),p-=n||0,m-=r||0,d=0,g=0,!i||f?(d=e.axis==="y"?s.width:0,g=e.axis==="x"?s.height:0,p=a&&e.x!=null?e.x:p,m=u&&e.y!=null?e.y:m):i&&!f&&(g=e.axis==="x"?s.height:g,d=e.axis==="y"?s.width:d),i=!0,{width:d,height:g,x:p,y:m,top:m,right:p+d,bottom:m+g,left:p}}}}function hM(t){return t!=null&&t.clientX!=null}function Q6(t,e={}){const{enabled:n=!0,axis:r="both"}=e,i="rootStore"in t?t.rootStore:t,s=i.useState("open"),a=i.useState("floatingElement"),u=i.useState("domReferenceElement"),f=i.context.dataRef,d=E.useRef(!1),g=E.useRef(null),[p,m]=E.useState(),[v,b]=E.useState([]),S=Re(A=>{i.set("positionReference",A)}),w=Re((A,O,P)=>{d.current||f.current.openEvent&&!hM(f.current.openEvent)||i.set("positionReference",X6(P??u,{x:A,y:O,axis:r,dataRef:f,pointerType:p}))}),C=Re(A=>{s?g.current||(w(A.clientX,A.clientY,A.currentTarget),b([])):w(A.clientX,A.clientY,A.currentTarget)}),R=na(p)?a:s;E.useEffect(()=>{if(!n){S(u);return}if(!R)return;function A(){g.current?.(),g.current=null}const O=An(a);function P(M){const D=Yn(M);Qe(a,D)?A():w(M.clientX,M.clientY)}return!f.current.openEvent||hM(f.current.openEvent)?g.current=Rt(O,"mousemove",P):S(u),A},[R,n,a,f,u,i,w,S,v]),E.useEffect(()=>()=>{i.set("positionReference",null)},[i]),E.useEffect(()=>{n&&!a&&(d.current=!1)},[n,a]),E.useEffect(()=>{!n&&s&&(d.current=!0)},[n,s]);const T=E.useMemo(()=>{function A(O){m(O.pointerType)}return{onPointerDown:A,onPointerEnter:A,onMouseMove:C,onMouseEnter:C}},[C]);return E.useMemo(()=>n?{reference:T,trigger:T}:{},[n,T])}function Z6(){return!1}function J6(t){return{escapeKey:typeof t=="boolean"?t:t?.escapeKey??!1,outsidePress:typeof t=="boolean"?t:t?.outsidePress??!0}}function Cm(t,e={}){const{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:s="sloppy",referencePress:a=Z6,bubbles:u,externalTree:f}=e,d="rootStore"in t?t.rootStore:t,g=d.useState("open"),p=d.useState("floatingElement"),{dataRef:m}=d.context,v=zc(f),b=Re(typeof i=="function"?i:()=>!1),S=typeof i=="function"?b:i,w=S!==!1,C=Re(()=>s),{escapeKey:R,outsidePress:T}=J6(u),A=E.useRef(!1),O=E.useRef(!1),P=E.useRef(!1),M=E.useRef(!1),D=E.useRef(""),L=E.useRef(null),H=ii(),N=ii(),_=Re(()=>{N.clear(),m.current.insideReactTree=!1}),$=Re(U=>{const W=m.current.floatingContext?.nodeId;return(v?la(v.nodesRef.current,W):[]).some(ie=>ie.context?.open&&!ie.context.dataRef.current[U])}),F=Re(U=>B0(U,d.select("floatingElement"))||B0(U,d.select("domReferenceElement"))),G=Re(U=>{a()&&d.setOpen(!1,Xe(Hd,U.nativeEvent))}),j=Re(U=>{if(!g||!n||!r||U.key!=="Escape"||M.current||!R&&$("__escapeKeyBubbles"))return;const W=Z8(U)?U.nativeEvent:U,X=Xe(Vd,W);d.setOpen(!1,X),X.isCanceled||U.preventDefault(),!R&&!X.isPropagationAllowed&&U.stopPropagation()}),q=Re(()=>{m.current.insideReactTree=!0,N.start(0,_)}),V=Re(U=>{if(!g||!n||U.button!==0)return;const W=Yn(U.nativeEvent);Qe(d.select("floatingElement"),W)&&(A.current||(A.current=!0,O.current=!1))}),te=Re(U=>{!g||!n||(U.defaultPrevented||U.nativeEvent.defaultPrevented)&&A.current&&(O.current=!0)});E.useEffect(()=>{if(!g||!n)return _;m.current.__escapeKeyBubbles=R,m.current.__outsidePressBubbles=T;const U=new zo,W=new zo;function X(){U.clear(),M.current=!0}function ie(){U.start(sl?5:0,()=>{M.current=!1})}function ee(){P.current=!0,W.start(0,()=>{P.current=!1})}function ue(){A.current=!1,O.current=!1}function Y(){const ne=D.current,Q=ne==="pen"||!ne?"mouse":ne,Se=C(),ge=typeof Se=="function"?Se():Se;return typeof ge=="string"?ge:ge[Q]}function le(ne){const Q=Y();return Q==="intentional"&&ne.type!=="click"||Q==="sloppy"&&ne.type==="click"}function xe(ne){const Q=m.current.floatingContext?.nodeId,Se=v&&la(v.nodesRef.current,Q).some(ge=>B0(ne,ge.context?.elements.floating));return F(ne)||Se}function ve(ne){if(le(ne)){ne.type!=="click"&&!F(ne)&&(W.clear(),P.current=!1),_();return}if(m.current.insideReactTree){_();return}const Q=Yn(ne),Se=`[${yd("inert")}]`,ge=Tt(Q)?Q.getRootNode():null,De=Array.from((vc(ge)?ge:Vt(d.select("floatingElement"))).querySelectorAll(Se)),Te=d.context.triggerElements;if(Q&&(Te.hasElement(Q)||Te.hasMatchingElement(nt=>Qe(nt,Q))))return;let _e=Tt(Q)?Q:null;for(;_e&&!ta(_e);){const nt=ia(_e);if(ta(nt)||!Tt(nt))break;_e=nt}if(!(De.length&&Tt(Q)&&!e6(Q)&&!Qe(Q,d.select("floatingElement"))&&De.every(nt=>!Qe(_e,nt)))){if(fn(Q)&&!("touches"in ne)){const nt=ta(Q),Mt=bi(Q),kt=/auto|scroll/,It=nt||kt.test(Mt.overflowX),bn=nt||kt.test(Mt.overflowY),at=It&&Q.clientWidth>0&&Q.scrollWidth>Q.clientWidth,Mn=bn&&Q.clientHeight>0&&Q.scrollHeight>Q.clientHeight,Qt=Mt.direction==="rtl",xn=Mn&&(Qt?ne.offsetX<=Q.offsetWidth-Q.clientWidth:ne.offsetX>Q.clientWidth),nn=at&&ne.offsetY>Q.clientHeight;if(xn||nn)return}if(!xe(ne)){if(Y()==="intentional"&&P.current){W.clear(),P.current=!1;return}typeof S=="function"&&!S(ne)||$("__outsidePressBubbles")||(d.setOpen(!1,Xe(vm,ne)),_())}}}function de(ne){Y()!=="sloppy"||ne.pointerType==="touch"||!d.select("open")||!n||F(ne)||ve(ne)}function me(ne){if(Y()!=="sloppy"||!d.select("open")||!n||F(ne))return;const Q=ne.touches[0];Q&&(L.current={startTime:Date.now(),startX:Q.clientX,startY:Q.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},H.start(1e3,()=>{L.current&&(L.current.dismissOnTouchEnd=!1,L.current.dismissOnMouseDown=!1)}))}function Ce(ne,Q){const Se=Yn(ne);if(!Se)return;const ge=Rt(Se,ne.type,()=>{Q(ne),ge()})}function Pe(ne){D.current="touch",Ce(ne,me)}function ze(ne){H.clear(),ne.type==="pointerdown"&&(D.current=ne.pointerType),!(ne.type==="mousedown"&&L.current&&!L.current.dismissOnMouseDown)&&Ce(ne,Q=>{Q.type==="pointerdown"?de(Q):ve(Q)})}function Ee(ne){if(!A.current)return;const Q=O.current;if(ue(),Y()==="intentional"){if(ne.type==="pointercancel"){Q&&ee();return}if(!xe(ne)){if(Q){ee();return}typeof S=="function"&&!S(ne)||(W.clear(),P.current=!0,_())}}}function Ve(ne){if(Y()!=="sloppy"||!L.current||F(ne))return;const Q=ne.touches[0];if(!Q)return;const Se=Math.abs(Q.clientX-L.current.startX),ge=Math.abs(Q.clientY-L.current.startY),De=Math.sqrt(Se*Se+ge*ge);De>5&&(L.current.dismissOnTouchEnd=!0),De>10&&(ve(ne),H.clear(),L.current=null)}function Ie(ne){Ce(ne,Ve)}function He(ne){Y()!=="sloppy"||!L.current||F(ne)||(L.current.dismissOnTouchEnd&&ve(ne),H.clear(),L.current=null)}function Ge(ne){Ce(ne,He)}const We=Vt(p),fe=ps(r&&ps(Rt(We,"keydown",j),Rt(We,"compositionstart",X),Rt(We,"compositionend",ie)),w&&ps(Rt(We,"click",ze,!0),Rt(We,"pointerdown",ze,!0),Rt(We,"pointerup",Ee,!0),Rt(We,"pointercancel",Ee,!0),Rt(We,"mousedown",ze,!0),Rt(We,"mouseup",Ee,!0),Rt(We,"touchstart",Pe,!0),Rt(We,"touchmove",Ie,!0),Rt(We,"touchend",Ge,!0)));return()=>{fe(),U.clear(),W.clear(),ue(),P.current=!1,_()}},[m,p,r,w,S,g,n,R,T,j,_,C,$,F,v,d,H]);const J=E.useMemo(()=>({onKeyDown:j,onPointerDown:G,onClick:G}),[j,G]),z=E.useMemo(()=>({onKeyDown:j,onPointerDown:te,onMouseDown:te,onClickCapture:q,onMouseDownCapture(U){q(),V(U)},onPointerDownCapture(U){q(),V(U)},onMouseUpCapture:q,onTouchEndCapture:q,onTouchMoveCapture:q}),[j,q,V,te]);return E.useMemo(()=>n?{reference:J,floating:z,trigger:J}:{},[n,J,z])}function gM(t,e,n){let{reference:r,floating:i}=t;const s=eo(e),a=pw(e),u=gw(a),f=so(e),d=s==="y",g=r.x+r.width/2-i.width/2,p=r.y+r.height/2-i.height/2,m=r[u]/2-i[u]/2;let v;switch(f){case"top":v={x:g,y:r.y-i.height};break;case"bottom":v={x:g,y:r.y+r.height};break;case"right":v={x:r.x+r.width,y:p};break;case"left":v={x:r.x-i.width,y:p};break;default:v={x:r.x,y:r.y}}const b=ha(e);return b&&(v[a]+=m*(b==="end"?1:-1)*(n&&d?-1:1)),v}async function eU(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:s,rects:a,elements:u,strategy:f}=t,{boundary:d="clippingAncestors",rootBoundary:g="viewport",elementContext:p="floating",altBoundary:m=!1,padding:v=0}=sa(e,t),b=wD(v),w=u[m?p==="floating"?"reference":"floating":p],C=md(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(w)))==null||n?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(u.floating)),boundary:d,rootBoundary:g,strategy:f})),R=p==="floating"?{x:r,y:i,width:a.floating.width,height:a.floating.height}:a.reference,T=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u.floating)),A=await(s.isElement==null?void 0:s.isElement(T))&&await(s.getScale==null?void 0:s.getScale(T))||{x:1,y:1},O=md(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:R,offsetParent:T,strategy:f}):R);return{top:(C.top-O.top+b.top)/A.y,bottom:(O.bottom-C.bottom+b.bottom)/A.y,left:(C.left-O.left+b.left)/A.x,right:(O.right-C.right+b.right)/A.x}}const tU=50,nU=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:a}=n,u=a.detectOverflow?a:{...a,detectOverflow:eU},f=await(a.isRTL==null?void 0:a.isRTL(e));let d=await a.getElementRects({reference:t,floating:e,strategy:i}),{x:g,y:p}=gM(d,r,f),m=r,v=0;const b={};for(let S=0;S<s.length;S++){const w=s[S];if(!w)continue;const{name:C,fn:R}=w,{x:T,y:A,data:O,reset:P}=await R({x:g,y:p,initialPlacement:r,placement:m,strategy:i,middlewareData:b,rects:d,platform:u,elements:{reference:t,floating:e}});g=T??g,p=A??p,b[C]={...b[C],...O},P&&v<tU&&(v++,typeof P=="object"&&(P.placement&&(m=P.placement),P.rects&&(d=P.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:i}):P.rects),{x:g,y:p}=gM(d,m,f)),S=-1)}return{x:g,y:p,placement:m,strategy:i,middlewareData:b}},rU=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:s,rects:a,initialPlacement:u,platform:f,elements:d}=e,{mainAxis:g=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:S=!0,...w}=sa(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const C=so(i),R=eo(u),T=so(u)===u,A=await(f.isRTL==null?void 0:f.isRTL(d.floating)),O=m||(T||!S?[Pp(u)]:d6(u)),P=b!=="none";!m&&P&&O.push(...m6(u,S,b,A));const M=[u,...O],D=await f.detectOverflow(e,w),L=[];let H=((r=s.flip)==null?void 0:r.overflows)||[];if(g&&L.push(D[C]),p){const F=f6(i,a,A);L.push(D[F[0]],D[F[1]])}if(H=[...H,{placement:i,overflows:L}],!L.every(F=>F<=0)){var N,_;const F=(((N=s.flip)==null?void 0:N.index)||0)+1,G=M[F];if(G&&(!(p==="alignment"?R!==eo(G):!1)||H.every(V=>eo(V.placement)===R?V.overflows[0]>0:!0)))return{data:{index:F,overflows:H},reset:{placement:G}};let j=(_=H.filter(q=>q.overflows[0]<=0).sort((q,V)=>q.overflows[1]-V.overflows[1])[0])==null?void 0:_.placement;if(!j)switch(v){case"bestFit":{var $;const q=($=H.filter(V=>{if(P){const te=eo(V.placement);return te===R||te==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(te=>te>0).reduce((te,J)=>te+J,0)]).sort((V,te)=>V[1]-te[1])[0])==null?void 0:$[0];q&&(j=q);break}case"initialPlacement":j=u;break}if(i!==j)return{reset:{placement:j}}}return{}}}},$D=new Set(["left","top"]);async function iU(t,e){const{placement:n,platform:r,elements:i}=t,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=so(n),u=ha(n),f=eo(n)==="y",d=$D.has(a)?-1:1,g=s&&f?-1:1,p=sa(e,t);let{mainAxis:m,crossAxis:v,alignmentAxis:b}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return u&&typeof b=="number"&&(v=u==="end"?b*-1:b),f?{x:v*g,y:m*d}:{x:m*d,y:v*g}}const oU=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:s,placement:a,middlewareData:u}=e,f=await iU(e,t);return a===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:i+f.x,y:s+f.y,data:{...f,placement:a}}}}},sU=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i,platform:s}=e,{mainAxis:a=!0,crossAxis:u=!1,limiter:f={fn:R=>{let{x:T,y:A}=R;return{x:T,y:A}}},...d}=sa(t,e),g={x:n,y:r},p=await s.detectOverflow(e,d),m=eo(i),v=hw(m);let b=g[v],S=g[m];const w=(R,T)=>SD(T+p[R==="y"?"top":"left"],T,T-p[R==="y"?"bottom":"right"]);a&&(b=w(v,b)),u&&(S=w(m,S));const C=f.fn({...e,[v]:b,[m]:S});return{...C,data:{x:C.x-n,y:C.y-r,enabled:{[v]:a,[m]:u}}}}}},lU=function(t){return t===void 0&&(t={}),{options:t,fn(e){var n,r;const{x:i,y:s,placement:a,rects:u,middlewareData:f}=e,{offset:d=0,mainAxis:g=!0,crossAxis:p=!0}=sa(t,e),m={x:i,y:s},v=eo(a),b=hw(v);let S=m[b],w=m[v];const C=sa(d,e),R=typeof C=="number"?{mainAxis:C,crossAxis:0}:{mainAxis:(n=C.mainAxis)!=null?n:0,crossAxis:(r=C.crossAxis)!=null?r:0};if(g){const O=b==="y"?"height":"width",P=u.reference[b]-u.floating[O]+R.mainAxis,M=u.reference[b]+u.reference[O]-R.mainAxis;S<P?S=P:S>M&&(S=M)}if(p){var T,A;const O=b==="y"?"width":"height",P=$D.has(so(a)),M=u.reference[v]-u.floating[O]+(P&&((T=f.offset)==null?void 0:T[v])||0)+(P?0:R.crossAxis),D=u.reference[v]+u.reference[O]+(P?0:((A=f.offset)==null?void 0:A[v])||0)-(P?R.crossAxis:0);w<M?w=M:w>D&&(w=D)}return{[b]:S,[v]:w}}}},aU=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:r,platform:i,elements:s}=e,{apply:a=()=>{},...u}=sa(t,e),f=await i.detectOverflow(e,u),d=so(n),g=ha(n),p=eo(n)==="y",{width:m,height:v}=r.floating;let b,S;d==="top"||d==="bottom"?(b=d,S=g===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(S=d,b=g==="end"?"top":"bottom");const w=v-f.top-f.bottom,C=m-f.left-f.right,R=Sc(v-f[b],w),T=Sc(m-f[S],C),A=e.middlewareData.shift,O=!A;let P=R,M=T;A!=null&&A.enabled.x&&(M=C),A!=null&&A.enabled.y&&(P=w),O&&!g&&(p?M=m-2*Qs(f.left,f.right):P=v-2*Qs(f.top,f.bottom)),await a({...e,availableWidth:M,availableHeight:P});const D=await i.getDimensions(s.floating);return m!==D.width||v!==D.height?{reset:{rects:!0}}:{}}}};function qD(t){const e=bi(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=fn(t),s=i?t.offsetWidth:n,a=i?t.offsetHeight:r,u=Dp(n)!==s||Dp(r)!==a;return u&&(n=s,r=a),{width:n,height:r,$:u}}function Cw(t){return Tt(t)?t:t.contextElement}function lc(t){const e=Cw(t);if(!fn(e))return Zs(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:s}=qD(e);let a=(s?Dp(n.width):n.width)/r,u=(s?Dp(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!u||!Number.isFinite(u))&&(u=1),{x:a,y:u}}const uU=Zs(0);function GD(t){const e=An(t);return!ow()||!e.visualViewport?uU:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function cU(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===An(t)}function lu(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=Cw(t);let a=Zs(1);e&&(r?Tt(r)&&(a=lc(r)):a=lc(t));const u=cU(s,n,r)?GD(s):Zs(0);let f=(i.left+u.x)/a.x,d=(i.top+u.y)/a.y,g=i.width/a.x,p=i.height/a.y;if(s&&r){const m=An(s),v=Tt(r)?An(r):r;let b=m,S=hx(b);for(;S&&v!==b;){const w=lc(S),C=S.getBoundingClientRect(),R=bi(S),T=C.left+(S.clientLeft+parseFloat(R.paddingLeft))*w.x,A=C.top+(S.clientTop+parseFloat(R.paddingTop))*w.y;f*=w.x,d*=w.y,g*=w.x,p*=w.y,f+=T,d+=A,b=An(S),S=hx(b)}}return md({width:g,height:p,x:f,y:d})}function Rm(t,e){const n=gm(t).scrollLeft;return e?e.left+n:lu(ol(t)).left+n}function WD(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-Rm(t,n),i=n.top+e.scrollTop;return{x:r,y:i}}function fU(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const s=i==="fixed",a=ol(r),u=e?hm(e.floating):!1;if(r===a||u&&s)return n;let f={scrollLeft:0,scrollTop:0},d=Zs(1);const g=Zs(0),p=fn(r);if((p||!s)&&((Lr(r)!=="body"||Bd(a))&&(f=gm(r)),p)){const v=lu(r);d=lc(r),g.x=v.x+r.clientLeft,g.y=v.y+r.clientTop}const m=a&&!p&&!s?WD(a,f):Zs(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-f.scrollLeft*d.x+g.x+m.x,y:n.y*d.y-f.scrollTop*d.y+g.y+m.y}}function dU(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function hU(t){const e=gm(t),n=t.ownerDocument.body,r=Qs(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=Qs(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-e.scrollLeft+Rm(t);const a=-e.scrollTop;return bi(n).direction==="rtl"&&(s+=Qs(t.clientWidth,n.clientWidth)-r),{width:r,height:i,x:s,y:a}}const gU=25;function pU(t,e,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",i=An(t),s=ol(t),a=i.visualViewport;let u=s.clientWidth,f=s.clientHeight,d=0,g=0;if(a){const m=!ow()||e==="fixed";r?m||(d=-a.offsetLeft,g=-a.offsetTop):(u=a.width,f=a.height,m&&(d=a.offsetLeft,g=a.offsetTop))}if(Rm(s)<=0){const m=s.ownerDocument,v=m.body,b=getComputedStyle(v),S=m.compatMode==="CSS1Compat"&&parseFloat(b.marginLeft)+parseFloat(b.marginRight)||0,w=Math.abs(s.clientWidth-v.clientWidth-S),C=getComputedStyle(s).scrollbarGutter==="stable both-edges"?w/2:w;C<=gU&&(u-=C)}return{width:u,height:f,x:d,y:g}}function mU(t,e){const n=lu(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,s=lc(t),a=t.clientWidth*s.x,u=t.clientHeight*s.y,f=i*s.x,d=r*s.y;return{width:a,height:u,x:f,y:d}}function pM(t,e,n){let r;if(e==="viewport"||e==="layoutViewport")r=pU(t,n,e);else if(e==="document")r=hU(ol(t));else if(Tt(e))r=mU(e,n);else{const i=GD(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return md(r)}function yU(t,e){const n=e.get(t);if(n)return n;let r=bc(t,[],!1).filter(u=>Tt(u)&&Lr(u)!=="body"),i=null;const s=bi(t).position==="fixed";let a=s?ia(t):t;for(;Tt(a)&&!ta(a);){const u=bi(a),f=iw(a),d=i?i.position:s?"fixed":"";!f&&(d==="fixed"||d==="absolute"&&u.position==="static")?r=r.filter(p=>p!==a):i=u,a=ia(a)}return e.set(t,r),r}function vU(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const a=[...n==="clippingAncestors"?hm(e)?[]:yU(e,this._c):[].concat(n),r],u=pM(e,a[0],i);let f=u.top,d=u.right,g=u.bottom,p=u.left;for(let m=1;m<a.length;m++){const v=pM(e,a[m],i);f=Qs(v.top,f),d=Sc(v.right,d),g=Sc(v.bottom,g),p=Qs(v.left,p)}return{width:d-p,height:g-f,x:p,y:f}}function bU(t){const{width:e,height:n}=qD(t);return{width:e,height:n}}function xU(t,e,n){const r=fn(e),i=ol(e),s=n==="fixed",a=lu(t,!0,s,e);let u={scrollLeft:0,scrollTop:0};const f=Zs(0);if((r||!s)&&((Lr(e)!=="body"||Bd(i))&&(u=gm(e)),r)){const m=lu(e,!0,s,e);f.x=m.x+e.clientLeft,f.y=m.y+e.clientTop}!r&&i&&(f.x=Rm(i));const d=i&&!r&&!s?WD(i,u):Zs(0),g=a.left+u.scrollLeft-f.x-d.x,p=a.top+u.scrollTop-f.y-d.y;return{x:g,y:p,width:a.width,height:a.height}}function V0(t){return bi(t).position==="static"}function mM(t,e){if(!fn(t)||bi(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return ol(t)===n&&(n=n.ownerDocument.body),n}function KD(t,e){const n=An(t);if(hm(t))return n;if(!fn(t)){let i=ia(t);for(;i&&!ta(i);){if(Tt(i)&&!V0(i))return i;i=ia(i)}return n}let r=mM(t,e);for(;r&&V8(r)&&V0(r);)r=mM(r,e);return r&&ta(r)&&V0(r)&&!iw(r)?n:r||$8(t)||n}const SU=async function(t){const e=this.getOffsetParent||KD,n=this.getDimensions,r=await n(t.floating);return{reference:xU(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function wU(t){return bi(t).direction==="rtl"}const YD={convertOffsetParentRelativeRectToViewportRelativeRect:fU,getDocumentElement:ol,getClippingRect:vU,getOffsetParent:KD,getElementRects:SU,getClientRects:dU,getDimensions:bU,getScale:lc,isElement:Tt,isRTL:wU};function XD(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function CU(t,e,n){let r=null,i;const s=ol(t);function a(){var g;clearTimeout(i),(g=r)==null||g.disconnect(),r=null}function u(g,p){g===void 0&&(g=!1),p===void 0&&(p=1),a();const m=t.getBoundingClientRect(),{left:v,top:b,width:S,height:w}=m;if(g||e(),!S||!w)return;const C=Wa(b),R=Wa(s.clientWidth-(v+S)),T=Wa(s.clientHeight-(b+w)),A=Wa(v),P={rootMargin:-C+"px "+-R+"px "+-T+"px "+-A+"px",threshold:Qs(0,Sc(1,p))||1};let M=!0;function D(L){const H=L[0].intersectionRatio;if(!XD(m,t.getBoundingClientRect()))return u();if(H!==p){if(!M)return u();H?u(!1,H):i=setTimeout(()=>{u(!1,1e-7)},1e3)}M=!1}try{r=new IntersectionObserver(D,{...P,root:s.ownerDocument})}catch{r=new IntersectionObserver(D,P)}r.observe(t)}const f=An(t),d=()=>u(n);return f.addEventListener("resize",d),u(!0),()=>{f.removeEventListener("resize",d),a()}}function yM(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,d=Cw(t),g=i||s?[...d?bc(d):[],...e?bc(e):[]]:[];g.forEach(C=>{i&&C.addEventListener("scroll",n),s&&C.addEventListener("resize",n)});const p=d&&u?CU(d,n,s):null;let m=-1,v=null;a&&(v=new ResizeObserver(C=>{let[R]=C;R&&R.target===d&&v&&e&&(v.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var T;(T=v)==null||T.observe(e)})),n()}),d&&!f&&v.observe(d),e&&v.observe(e));let b,S=f?lu(t):null;f&&w();function w(){const C=lu(t);S&&!XD(S,C)&&n(),S=C,b=requestAnimationFrame(w)}return n(),()=>{var C;g.forEach(R=>{i&&R.removeEventListener("scroll",n),s&&R.removeEventListener("resize",n)}),p?.(),(C=v)==null||C.disconnect(),v=null,f&&cancelAnimationFrame(b)}}const RU=oU,EU=sU,TU=rU,AU=aU,MU=lU,OU=(t,e,n)=>{const r=new Map,i=n??{},s={...YD,...i.platform,_c:r};return nU(t,e,{...i,platform:s})};var kU=typeof document<"u",IU=function(){},hp=kU?E.useLayoutEffect:IU;function Lp(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!Lp(t[r],e[r]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const s=i[r];if(!(s==="_owner"&&t.$$typeof)&&!Lp(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function QD(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function vM(t,e){const n=QD(t);return Math.round(e*n)/n}function F0(t){const e=E.useRef(t);return hp(()=>{e.current=t}),e}function DU(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:a}={},transform:u=!0,whileElementsMounted:f,open:d}=t,[g,p]=E.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[m,v]=E.useState(r);Lp(m,r)||v(r);const[b,S]=E.useState(null),[w,C]=E.useState(null),R=E.useCallback(V=>{V!==P.current&&(P.current=V,S(V))},[]),T=E.useCallback(V=>{V!==M.current&&(M.current=V,C(V))},[]),A=s||b,O=a||w,P=E.useRef(null),M=E.useRef(null),D=E.useRef(g),L=f!=null,H=F0(f),N=F0(i),_=F0(d),$=E.useCallback(()=>{if(!P.current||!M.current)return;const V={placement:e,strategy:n,middleware:m};N.current&&(V.platform=N.current),OU(P.current,M.current,V).then(te=>{const J={...te,isPositioned:_.current!==!1};F.current&&!Lp(D.current,J)&&(D.current=J,il.flushSync(()=>{p(J)}))})},[m,e,n,N,_]);hp(()=>{d===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,p(V=>({...V,isPositioned:!1})))},[d]);const F=E.useRef(!1);hp(()=>(F.current=!0,()=>{F.current=!1}),[]),hp(()=>{if(A&&(P.current=A),O&&(M.current=O),A&&O){if(H.current)return H.current(A,O,$);$()}},[A,O,$,H,L]);const G=E.useMemo(()=>({reference:P,floating:M,setReference:R,setFloating:T}),[R,T]),j=E.useMemo(()=>({reference:A,floating:O}),[A,O]),q=E.useMemo(()=>{const V={position:n,left:0,top:0};if(!j.floating)return V;const te=vM(j.floating,g.x),J=vM(j.floating,g.y);return u?{...V,transform:"translate("+te+"px, "+J+"px)",...QD(j.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:te,top:J}},[n,u,j.floating,g.x,g.y]);return E.useMemo(()=>({...g,update:$,refs:G,elements:j,floatingStyles:q}),[g,$,G,j,q])}const PU=(t,e)=>{const n=RU(t);return{name:n.name,fn:n.fn,options:[t,e]}},zU=(t,e)=>{const n=EU(t);return{name:n.name,fn:n.fn,options:[t,e]}},NU=(t,e)=>({fn:MU(t).fn,options:[t,e]}),LU=(t,e)=>{const n=TU(t);return{name:n.name,fn:n.fn,options:[t,e]}},BU=(t,e)=>{const n=AU(t);return{name:n.name,fn:n.fn,options:[t,e]}},_U={open:t=>t.open,transitionStatus:t=>t.transitionStatus,domReferenceElement:t=>t.domReferenceElement,referenceElement:t=>t.positionReference??t.referenceElement,floatingElement:t=>t.floatingElement,floatingId:t=>t.floatingId};class Em extends fm{constructor(e){const{syncOnly:n,nested:r,onOpenChange:i,triggerElements:s,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:i,dataRef:{current:{}},events:q6(),nested:r,triggerElements:s},_U),this.syncOnly=n}syncOpenEvent=(e,n)=>{(!e||!this.state.open||n!=null&&J8(n))&&(this.context.dataRef.current.openEvent=e?n:void 0)};dispatchOpenChange=(e,n)=>{this.syncOpenEvent(e,n.event);const r={open:e,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",r)};setOpen=(e,n)=>{if(this.syncOnly){this.context.onOpenChange?.(e,n);return}this.dispatchOpenChange(e,n),this.context.onOpenChange?.(e,n)}}function HU(t){const{popupStore:e,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:s,onOpenChange:a}=t,u=e.useState("open"),f=e.useState("activeTriggerElement"),d=e.useState(n?"popupElement":"positionerElement"),g=e.context.triggerElements,p=a,m=E.useRef(null);r===void 0&&m.current===null&&(m.current=new Em({open:u,transitionStatus:void 0,referenceElement:f,floatingElement:d,triggerElements:g,onOpenChange:p,floatingId:i,syncOnly:!0,nested:s}));const v=r??m.current;return e.useSyncedValue("floatingId",i),Oe(()=>{const b={open:u,floatingId:i,referenceElement:f,floatingElement:d};Tt(f)&&(b.domReferenceElement=f),v.state.positionReference===v.state.referenceElement&&(b.positionReference=f),v.update(b)},[u,i,f,d,v]),v.context.onOpenChange=p,v.context.nested=s,v}function ga(t,e=!1,n=!1){const[r,i]=E.useState(t&&e?"idle":void 0),[s,a]=E.useState(t);return t&&!s&&(a(!0),i("starting")),!t&&s&&r!=="ending"&&!n&&i("ending"),!t&&!s&&r==="ending"&&i(void 0),Oe(()=>{if(!t&&s&&r!=="ending"&&n){const u=is.request(()=>{i("ending")});return()=>{is.cancel(u)}}},[t,s,r,n]),Oe(()=>{if(!t||e)return;const u=is.request(()=>{i(void 0)});return()=>{is.cancel(u)}},[e,t]),Oe(()=>{if(!t||!e)return;t&&s&&r!=="idle"&&i("starting");const u=is.request(()=>{i("idle")});return()=>{is.cancel(u)}},[e,t,s,r]),{mounted:s,setMounted:a,transitionStatus:r}}function jU(t,e=!1){const n=xc();return Re((r,i=null)=>{n.cancel();const s=$s(t);if(s==null)return;const a=s,u=()=>{il.flushSync(r)};if(typeof a.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){r();return}function f(){Promise.all(a.getAnimations().map(d=>d.finished)).then(()=>{i?.aborted||u()},()=>{if(i?.aborted)return;if(a.getAnimations().some(g=>g.pending||g.playState!=="finished")){f();return}u()})}if(e){const d="data-starting-style";if(!a.hasAttribute(d)){n.request(f);return}const g=new MutationObserver(()=>{a.hasAttribute(d)||(g.disconnect(),f())});g.observe(a,{attributes:!0,attributeFilter:[d]}),i?.addEventListener("abort",()=>g.disconnect(),{once:!0});return}n.request(f)})}function fo(t){const{enabled:e=!0,open:n,ref:r,onComplete:i}=t,s=Re(i),a=jU(r,n);E.useEffect(()=>{if(!e)return;const u=new AbortController;return a(s,u.signal),()=>{u.abort()}},[e,n,s,a])}const Tm={tabIndex:-1,[gx]:""};function VU(t){return e=>e==="touch"?t.current:!0}function ZD(t,e=!1){const n=Sm(),r=wm()!=null,i=Sr(()=>t(n,r)).current;return HU({popupStore:i,treatPopupAsFloatingElement:e,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function JD({handle:t,store:e}){return Oe(()=>t.attachStore(e),[t,e]),null}function FU(t,e){const n=E.useRef(null),r=E.useRef(null);return E.useCallback(i=>{if(t===void 0)return;let s=!1;if(n.current!==null){const a=n.current,u=r.current,f=e.context.triggerElements.getById(a);u&&f===u&&(e.context.triggerElements.delete(a),s=!0),n.current=null,r.current=null}if(i!==null&&(n.current=t,r.current=i,e.context.triggerElements.add(t,i),s=!0),s){const a=e.context.triggerElements.size;e.select("open")&&e.state.triggerCount!==a&&e.set("triggerCount",a)}},[e,t])}function eP(t,e,n,r=!1){e?t.preventUnmountingOnClose=!1:r&&(t.preventUnmountingOnClose=!0);const i=n?.id??null;(i||e)&&(t.activeTriggerId=i,t.activeTriggerElement=n??null)}function UU(t){let e=!1;return t.preventUnmountOnClose=()=>{e=!0},()=>e}function $U(t,e,n,r={}){const i=n.reason,s=i===mi,a=e&&i===up,u=!e&&(i===Hd||i===Vd),f=UU(n);if(t.context.onOpenChange?.(e,n),n.isCanceled)return;r.onBeforeDispatch?.(),t.state.floatingRootContext.dispatchOpenChange(e,n);const d=()=>{const g={...r.extraState,open:e};a?g.instantType="focus":u?g.instantType="dismiss":s&&(g.instantType=void 0),eP(g,e,n.trigger,f()),t.update(g)};s?il.flushSync(d):d()}function tP(t,e,n,r){const i=n.useState("isMountedByTrigger",t),s=FU(t,n),a=Re(f=>{const d=n.select("open"),g=n.select("activeTriggerId");if(g===t){n.update({activeTriggerElement:f,...d?r:null});return}g==null&&d&&n.update({activeTriggerId:t,activeTriggerElement:f,...r})}),u=E.useCallback(f=>{s(f),f&&a(f)},[s,a]);return Oe(()=>{i&&n.update({activeTriggerElement:e.current,...r})},[i,n,e,...Object.values(r)]),{registerTrigger:u,isMountedByThisTrigger:i}}function nP(t,e={}){const{closeOnActiveTriggerUnmount:n=!1}=e,r=E.useRef(null),i=t.useState("open"),s=t.useState("triggerCount"),a=t.useState("activeTriggerId"),u=t.useState("activeTriggerElement");Oe(()=>{if(!i){r.current=null,t.state.triggerCount!==0&&t.set("triggerCount",0);return}const f=t.context.triggerElements.size,d={};t.state.triggerCount!==f&&(d.triggerCount=f);const g=t.select("activeTriggerId");let p=null;if(g){const m=t.context.triggerElements.getById(g);if(m)r.current=g,m!==t.state.activeTriggerElement&&(d.activeTriggerElement=m);else{for(const[v,b]of t.context.triggerElements.entries())if(b===t.state.activeTriggerElement){d.activeTriggerId=v,d.activeTriggerElement=b,r.current=v;break}d.activeTriggerId===void 0&&(r.current===g?p=g:r.current=null)}}else r.current=null;if(!p&&!g&&f===1){const m=t.context.triggerElements.entries().next();if(!m.done){const[v,b]=m.value;d.activeTriggerId=v,d.activeTriggerElement=b,r.current=v}}(d.triggerCount!==void 0||d.activeTriggerId!==void 0||d.activeTriggerElement!==void 0)&&t.update(d),p&&n&&queueMicrotask(()=>{if(t.select("open")&&t.select("activeTriggerId")===p&&!t.context.triggerElements.getById(p)){const m=Xe(yr);t.setOpen(!1,m),m.isCanceled||t.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,t,s,a,u,n])}function rP(t,e,n){const{mounted:r,setMounted:i,transitionStatus:s}=ga(t),a=e.useState("preventUnmountingOnClose"),u=t?!1:a;e.useSyncedValues({mounted:r,transitionStatus:s,preventUnmountingOnClose:u});const f=Re(()=>{i(!1),e.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),e.context.onOpenChangeComplete?.(!1)});return fo({enabled:r&&!t&&!u,open:t,ref:e.context.popupRef,onComplete(){t||f()}}),{forceUnmount:f,transitionStatus:s}}function iP(t,e){t.useSyncedValues(e),Oe(()=>()=>{t.update({activeTriggerProps:zn,inactiveTriggerProps:zn,popupProps:zn})},[t])}function qU(t,e){Oe(()=>{!e&&t.state.openMethod!==null&&t.set("openMethod",null)},[e,t]),Oe(()=>()=>{t.state.openMethod!==null&&t.set("openMethod",null)},[t])}class Am{constructor(){this.idMap=new Map}add(e,n){this.idMap.set(e,n)}delete(e){this.idMap.delete(e)}hasElement(e){for(const n of this.idMap.values())if(n===e)return!0;return!1}hasMatchingElement(e){for(const n of this.idMap.values())if(e(n))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}function GU(){return new Em({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new Am,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function oP(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:GU(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:zn,inactiveTriggerProps:zn,popupProps:zn}}function sP(t,e,n=!1){return new Em({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:t,floatingId:e,syncOnly:!0,nested:n,onOpenChange:void 0})}const Xf=t=>t.triggerIdProp??t.activeTriggerId,Rw=t=>t.openProp??t.open,bM=t=>(t.popupElement?.id??t.floatingId)||void 0;function lP(t,e){return e!==void 0&&Rw(t)&&Xf(t)===e}function WU(t,e){return lP(t,e)?!0:e!==void 0&&Rw(t)&&Xf(t)==null&&t.triggerCount===1}const aP={open:Rw,mounted:t=>t.mounted,transitionStatus:t=>t.transitionStatus,floatingRootContext:t=>t.floatingRootContext,triggerCount:t=>t.triggerCount,preventUnmountingOnClose:t=>t.preventUnmountingOnClose,payload:t=>t.payload,activeTriggerId:Xf,activeTriggerElement:t=>t.mounted?t.activeTriggerElement:null,popupId:bM,isTriggerActive:(t,e)=>e!==void 0&&Xf(t)===e,isOpenedByTrigger:(t,e)=>lP(t,e),isMountedByTrigger:(t,e)=>e!==void 0&&Xf(t)===e&&t.mounted,triggerProps:(t,e)=>e?t.activeTriggerProps:t.inactiveTriggerProps,triggerPopupId:(t,e)=>WU(t,e)?bM(t):void 0,popupProps:t=>t.popupProps,popupElement:t=>t.popupElement,positionerElement:t=>t.positionerElement};function uP(t){const e=E.useCallback(r=>t===void 0?Tn:t.subscribeStore(r),[t]),n=E.useCallback(()=>t===void 0?void 0:t.store,[t]);return tw.useSyncExternalStore(e,n,()=>t?.serverStore)}function cP(t){const{open:e=!1,onOpenChange:n,elements:r={}}=t,i=Sm(),s=wm()!=null,a=Sr(()=>new Em({open:e,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new Am,floatingId:i,syncOnly:!1,nested:s})).current;return Oe(()=>{const u={open:e,floatingId:i};r.reference!==void 0&&(u.referenceElement=r.reference,u.domReferenceElement=Tt(r.reference)?r.reference:null),r.floating!==void 0&&(u.floatingElement=r.floating),a.update(u)},[e,i,r.reference,r.floating,a]),a.context.onOpenChange=n,a.context.nested=s,a}function KU(t){return YU(t,t.rootContext)}function YU(t,e){const{nodeId:n,externalTree:r}=t,i=e.useState("referenceElement"),s=e.useState("floatingElement"),a=e.useState("domReferenceElement"),u=e.useState("open"),f=e.useState("floatingId"),[d,g]=E.useState(null),[p,m]=E.useState(void 0),[v,b]=E.useState(void 0),S=E.useRef(null),w=zc(r),C=E.useMemo(()=>({reference:i,floating:s,domReference:a}),[i,s,a]),R=DU({...t,elements:{...C,...d&&{reference:d}}}),T=Tt(p)?p:null,A=v===void 0?e.state.floatingElement:v;e.useSyncedValue("referenceElement",p??null),e.useSyncedValue("domReferenceElement",p===void 0?a:T),e.useSyncedValue("floatingElement",A);const O=E.useCallback(N=>{const _=Tt(N)?{getBoundingClientRect:()=>N.getBoundingClientRect(),getClientRects:()=>N.getClientRects(),contextElement:N}:N;g(_),R.refs.setReference(_)},[R.refs]),P=E.useCallback(N=>{(Tt(N)||N===null)&&(S.current=N,m(N)),(Tt(R.refs.reference.current)||R.refs.reference.current===null||N!==null&&!Tt(N))&&R.refs.setReference(N)},[R.refs,m]),M=E.useCallback(N=>{b(N),R.refs.setFloating(N)},[R.refs]),D=E.useMemo(()=>({...R.refs,setReference:P,setFloating:M,setPositionReference:O,domReference:S}),[R.refs,P,M,O]),L=E.useMemo(()=>({...R.elements,domReference:a}),[R.elements,a]),H=E.useMemo(()=>({...R,dataRef:e.context.dataRef,open:u,onOpenChange:e.setOpen,events:e.context.events,floatingId:f,refs:D,elements:L,nodeId:n,rootStore:e}),[R,D,L,n,e,u,f]);return Oe(()=>{a&&(S.current=a)},[a]),Oe(()=>{e.context.dataRef.current.floatingContext=H;const N=w?.nodesRef.current.find(_=>_.id===n);N&&(N.context=H)}),E.useMemo(()=>({...R,context:H,refs:D,elements:L,rootStore:e}),[R,D,L,H,e])}const U0=dD&&sl;function XU(t,e={}){const{enabled:n=!0,delay:r}=e,i="rootStore"in t?t.rootStore:t,{events:s,dataRef:a}=i.context,u=E.useRef(!1),f=E.useRef(null),d=E.useRef(!0),g=ii();E.useEffect(()=>{const m=i.select("domReferenceElement");if(!n)return;const v=An(m);function b(){const C=i.select("domReferenceElement");!i.select("open")&&fn(C)&&C===Gr(Vt(C))&&(u.current=!0)}function S(){d.current=!0}function w(){d.current=!1}return ps(Rt(v,"blur",b),U0&&Rt(v,"keydown",S,!0),U0&&Rt(v,"pointerdown",w,!0))},[i,n]),E.useEffect(()=>{if(!n)return;function m(v){if(v.reason===Hd||v.reason===Vd){const b=i.select("domReferenceElement");Tt(b)&&(f.current=b,u.current=!0)}}return s.on("openchange",m),()=>{s.off("openchange",m)}},[s,n,i]);const p=E.useMemo(()=>{function m(){u.current=!1,f.current=null}return{onMouseLeave(){m()},onFocus(v){const b=v.currentTarget;if(u.current){if(f.current===b)return;m()}const S=Yn(v.nativeEvent);if(Tt(S)){if(U0&&!v.relatedTarget){if(!d.current&&!ym(S))return}else if(!t6(S))return}const w=Op(v.relatedTarget,i.context.triggerElements),{nativeEvent:C,currentTarget:R}=v,T=typeof r=="function"?r():r;if(i.select("open")&&w||T===0||T===void 0){i.setOpen(!0,Xe(up,C,R));return}g.start(T,()=>{u.current||i.setOpen(!0,Xe(up,C,R))})},onBlur(v){m();const b=v.relatedTarget,S=v.nativeEvent,w=Tt(b)&&b.hasAttribute(yd("focus-guard"))&&b.getAttribute("data-type")==="outside";g.start(0,()=>{const C=i.select("domReferenceElement"),R=Gr(Vt(C));!b&&R===C||Qe(a.current.floatingContext?.refs.floating.current,R)||Qe(C,R)||w||Op(b??R,i.context.triggerElements)||i.setOpen(!1,Xe(up,S))})}}},[a,r,i,g]);return E.useMemo(()=>n?{reference:p,trigger:p}:{},[n,p])}class Ew{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 zo,this.restTimeout=new zo,this.handleCloseOptions=void 0}static create(){return new Ew}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}const Bp=new WeakMap;function _p(t){if(!t.performedPointerEventsMutation)return;const e=t.pointerEventsScopeElement;e&&Bp.get(e)===t&&(t.pointerEventsScopeElement?.style.removeProperty("pointer-events"),t.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),t.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),Bp.delete(e)),t.performedPointerEventsMutation=!1,t.pointerEventsScopeElement=null,t.pointerEventsReferenceElement=null,t.pointerEventsFloatingElement=null}function fP(t,e){const{scopeElement:n,referenceElement:r,floatingElement:i}=e,s=Bp.get(n);s&&s!==t&&_p(s),_p(t),t.performedPointerEventsMutation=!0,t.pointerEventsScopeElement=n,t.pointerEventsReferenceElement=r,t.pointerEventsFloatingElement=i,Bp.set(n,t),n.style.pointerEvents="none",r.style.pointerEvents="auto",i.style.pointerEvents="auto"}function Tw(t){const e=t.context.dataRef.current,n=Sr(()=>e.hoverInteractionState??Ew.create()).current;return e.hoverInteractionState||(e.hoverInteractionState=n),sw(e.hoverInteractionState.disposeEffect),e.hoverInteractionState}function QU(t,e={}){const{enabled:n=!0,closeDelay:r=0,nodeId:i}=e,s="rootStore"in t?t.rootStore:t,a=s.useState("open"),u=s.useState("floatingElement"),f=s.useState("domReferenceElement"),{dataRef:d}=s.context,g=zc(),p=wm(),m=Tw(s),v=ii(),b=Re(()=>pD(d.current.openEvent?.type,m.interactedInside)),S=Re(()=>r6(d.current.openEvent?.type)),w=Re(()=>{_p(m)});Oe(()=>{a||(m.pointerType=void 0,m.restTimeoutPending=!1,m.interactedInside=!1,w())},[a,m,w]),E.useEffect(()=>w,[w]),Oe(()=>{if(n&&a&&m.handleCloseOptions?.blockPointerEvents&&S()&&Tt(f)&&u){const C=f,R=u,T=Vt(u),A=g?.nodesRef.current.find(D=>D.id===p)?.context?.elements.floating;A&&(A.style.pointerEvents="");const O=m.pointerEventsScopeElement!==R?m.pointerEventsScopeElement:null,P=A!==R?A:null,M=m.handleCloseOptions?.getScope?.()??O??P??C.closest("[data-rootownerid]")??T.body;return fP(m,{scopeElement:M,referenceElement:C,floatingElement:R}),()=>{w()}}},[n,a,f,u,m,S,g,p,w]),E.useEffect(()=>{if(!n)return;function C(){return!!(g&&p&&la(g.nodesRef.current,p).length>0)}function R(D){const L=oa(r,"close",m.pointerType),H=()=>{s.setOpen(!1,Xe(mi,D)),g?.events.emit("floating.closed",D)};L?m.openChangeTimeout.start(L,H):(m.openChangeTimeout.clear(),H())}function T(D){const L=Yn(D);if(!gD(L)){m.interactedInside=!1;return}m.interactedInside=L?.closest("[aria-haspopup]")!=null}function A(){m.openChangeTimeout.clear(),v.clear(),g?.events.off("floating.closed",P),w()}function O(D){if(C()&&g){g.events.on("floating.closed",P);return}if(Op(D.relatedTarget,s.context.triggerElements))return;const L=d.current.floatingContext?.nodeId??i,H=D.relatedTarget;if(!(g&&L&&Tt(H)&&la(g.nodesRef.current,L,!1).some(_=>Qe(_.context?.elements.floating,H)))){if(m.handler){m.handler(D);return}w(),S()&&!b()&&R(D)}}function P(D){!g||!p||C()||v.start(0,()=>{g.events.off("floating.closed",P),s.setOpen(!1,Xe(mi,D)),g.events.emit("floating.closed",D)})}const M=u;return ps(M&&Rt(M,"mouseenter",A),M&&Rt(M,"mouseleave",O),M&&Rt(M,"pointerdown",T,!0),()=>{g?.events.off("floating.closed",P)})},[n,u,s,d,r,i,S,b,w,m,g,p,v])}const ZU={current:null};function JU(t,e={}){const{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:s=!1,restMs:a=0,move:u=!0,triggerElementRef:f=ZU,externalTree:d,isActiveTrigger:g=!0,getHandleCloseContext:p,isClosing:m,shouldOpen:v,guardStaleOpen:b=!1}=e,S="rootStore"in t?t.rootStore:t,{dataRef:w,events:C}=S.context,R=zc(d),T=Tw(S),A=E.useRef(!1),O=Fn(i),P=Fn(r),M=Fn(a),D=Fn(n),L=Fn(v),H=Fn(m),N=Re(()=>pD(w.current.openEvent?.type,T.interactedInside)),_=Re(()=>L.current?.()!==!1),$=Re((j,q,V)=>{const te=S.context.triggerElements;if(te.hasElement(q))return!j||!Qe(j,q);if(!Tt(V))return!1;const J=V;return te.hasMatchingElement(z=>Qe(z,J))&&(!j||!Qe(j,J))}),F=Re(()=>{if(!T.handler)return;Vt(S.select("domReferenceElement")).removeEventListener("mousemove",T.handler),T.handler=void 0}),G=Re(()=>{_p(T)});return g&&(T.handleCloseOptions=O.current?.__options),E.useEffect(()=>F,[F]),E.useEffect(()=>{if(!n)return;function j(q){q.open?A.current=!1:(A.current=q.reason===mi,F(),T.openChangeTimeout.clear(),T.restTimeout.clear(),T.blockMouseMove=!0,T.restTimeoutPending=!1)}return C.on("openchange",j),()=>{C.off("openchange",j)}},[n,C,T,F]),E.useEffect(()=>{if(!n)return;function j(U,W=!0){const X=oa(P.current,"close",T.pointerType);X?T.openChangeTimeout.start(X,()=>{S.setOpen(!1,Xe(mi,U)),R?.events.emit("floating.closed",U)}):W&&(T.openChangeTimeout.clear(),S.setOpen(!1,Xe(mi,U)),R?.events.emit("floating.closed",U))}const q=f.current??(g?S.select("domReferenceElement"):null);if(!Tt(q))return;function V(U){if(T.openChangeTimeout.clear(),T.blockMouseMove=!1,s&&!na(T.pointerType))return;const W=GA(M.current),X=oa(P.current,"open",T.pointerType),ie=Yn(U),ee=U.currentTarget??null,ue=S.select("domReferenceElement");let Y=ee;if(Tt(ie)&&!S.context.triggerElements.hasElement(ie)){for(const Ee of S.context.triggerElements.elements())if(Qe(Ee,ie)){Y=Ee;break}}Tt(ee)&&Tt(ue)&&!S.context.triggerElements.hasElement(ee)&&Qe(ee,ue)&&(Y=ue);const le=Y==null?!1:$(ue,Y,ie),xe=S.select("open"),ve=H.current?.()??S.select("transitionStatus")==="ending",de=!xe&&ve&&A.current,me=!le&&Tt(Y)&&Tt(ue)&&Qe(ue,Y)&&de,Ce=W>0&&!X,Pe=le&&(xe||de)||me,ze=!xe||le;if(Pe){_()&&S.setOpen(!0,Xe(mi,U,Y));return}Ce||(X?T.openChangeTimeout.start(X,()=>{ze&&_()&&S.setOpen(!0,Xe(mi,U,Y))}):ze&&_()&&S.setOpen(!0,Xe(mi,U,Y)))}function te(U){if(N()){G();return}F();const W=S.select("domReferenceElement"),X=Vt(W);T.restTimeout.clear(),T.restTimeoutPending=!1;const ie=w.current.floatingContext??p?.();if(Op(U.relatedTarget,S.context.triggerElements))return;if(O.current&&ie){S.select("open")||T.openChangeTimeout.clear();const ue=f.current;T.handler=O.current({...ie,tree:R,x:U.clientX,y:U.clientY,onClose(){G(),F(),D.current&&!N()&&ue===S.select("domReferenceElement")&&j(U,!0)}}),X.addEventListener("mousemove",T.handler),T.handler(U);return}(T.pointerType!=="touch"||!Qe(S.select("floatingElement"),U.relatedTarget))&&j(U)}function J(U){Qe(q,U.relatedTarget)||(T.openChangeTimeout.clear(),T.restTimeout.clear(),T.restTimeoutPending=!1)}const z=b?Rt(q,"mouseout",J):void 0;return u?ps(Rt(q,"mousemove",V,{once:!0}),Rt(q,"mouseenter",V),Rt(q,"mouseleave",te),z):ps(Rt(q,"mouseenter",V),Rt(q,"mouseleave",te),z)},[F,G,w,P,S,n,O,T,g,$,N,s,u,M,f,R,D,p,H,_,b]),E.useMemo(()=>{if(!n)return;function j(q){T.pointerType=q.pointerType}return{onPointerDown:j,onPointerEnter:j,onMouseMove(q){const{nativeEvent:V}=q,te=q.currentTarget,J=S.select("domReferenceElement"),z=S.select("open"),U=$(J,te,q.target);if(s&&!na(T.pointerType))return;if(z&&U&&T.handleCloseOptions?.blockPointerEvents){const ie=S.select("floatingElement");if(ie){const ee=T.handleCloseOptions?.getScope?.()??te.ownerDocument.body;fP(T,{scopeElement:ee,referenceElement:te,floatingElement:ie})}}const W=GA(M.current);if(z&&!U||W===0||!U&&T.restTimeoutPending&&q.movementX**2+q.movementY**2<2)return;T.restTimeout.clear();function X(){if(T.restTimeoutPending=!1,N())return;const ie=S.select("open");!T.blockMouseMove&&(!ie||U)&&_()&&S.setOpen(!0,Xe(mi,V,te))}T.pointerType==="touch"?il.flushSync(()=>{X()}):U&&z?X():(T.restTimeoutPending=!0,T.restTimeout.start(W,X))}}},[n,T,N,$,s,S,M,_])}const e$="Escape";function xM(t){return sl&&t.movementX===0&&t.movementY===0}function Mm(t,e,n){switch(t){case"vertical":return e;case"horizontal":return n;default:return e||n}}function Rg(t,e){return Mm(e,t===cw||t===mm,t===eu||t===tu)}function $0(t,e,n){return Mm(e,t===mm,n?t===eu:t===tu)||t==="Enter"||t===" "||t===""}function t$(t,e,n){return Mm(e,n?t===eu:t===tu,t===mm)}function n$(t,e,n,r){const i=n?t===tu:t===eu,s=t===cw;return e==="both"||e==="horizontal"&&r?t===e$:Mm(e,i,s)}function dP(t,e){const{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:s=!0,selectedIndex:a=null,allowEscape:u=!1,loopFocus:f=!1,nested:d=!1,rtl:g=!1,virtual:p=!1,focusItemOnOpen:m="auto",focusItemOnHover:v=!0,openOnArrowKeyDown:b=!0,disabledIndices:S=void 0,orientation:w="vertical",parentOrientation:C,id:R,resetOnPointerLeave:T=!0,externalTree:A,grid:O}=e,P=O!=null,M="rootStore"in t?t.rootStore:t,D=M.useState("open"),L=M.useState("floatingElement"),H=M.useState("domReferenceElement"),N=M.context.dataRef,_=kp(L),$=px(H),F=Fn(_),G=wm(),j=zc(A),q=E.useRef(m),V=E.useRef(a??-1),te=E.useRef(null),J=E.useRef(!0),z=Re(ne=>{i(V.current===-1?null:V.current,ne)}),U=E.useRef(!!L),W=E.useRef(D),X=E.useRef(!1),ie=E.useRef(!1),ee=E.useRef(null),ue=Fn(S),Y=Fn(D),le=Fn(a),xe=Fn(T),ve=xc(),de=xc(),me=Re(()=>{function ne(De){p?j?.events.emit("virtualfocus",De):ee.current=dp(De,{sync:X.current,preventScroll:!0})}const Q=n.current[V.current],Se=ie.current;Q&&ne(Q),(X.current?De=>De():De=>ve.request(De))(()=>{const De=n.current[V.current]||Q;if(!De)return;Q||ne(De),Ie&&(Se||!J.current)&&De.scrollIntoView?.({block:"nearest",inline:"nearest"})})});Oe(()=>{N.current.orientation=w},[N,w]),Oe(()=>{s&&(D&&L?(V.current=a??-1,q.current&&a!=null&&(ie.current=!0,z())):U.current&&(V.current=-1,z()))},[s,D,L,a,z]),Oe(()=>{if(s){if(!D){X.current=!1;return}if(L)if(r==null){if(X.current=!1,le.current!=null)return;if(U.current&&(V.current=-1,me()),(!W.current||!U.current)&&q.current&&(te.current!=null||q.current===!0&&te.current==null)){let ne=0;const Q=()=>{n.current[0]==null?(ne<2&&(ne?ge=>de.request(ge):queueMicrotask)(Q),ne+=1):(V.current=te.current==null||$0(te.current,w,g)||d?fp(n):yx(n),te.current=null,z())};Q()}}else ra(n.current,r)||(V.current=r,me(),ie.current=!1)}},[s,D,L,r,le,d,n,w,g,z,me,de]),Oe(()=>{if(!s||L||!j||p||!U.current)return;const ne=j.nodesRef.current,Q=ne.find(De=>De.id===G)?.context?.elements.floating,Se=Gr(Vt(H??Q??null)),ge=ne.some(De=>De.context&&Qe(De.context.elements.floating,Se));Q&&!ge&&J.current&&Q.focus({preventScroll:!0})},[s,L,H,j,G,p]),Oe(()=>{W.current=D,U.current=!!L}),Oe(()=>{D||(te.current=null,q.current=m)},[D,m]);const Ce=r!=null,Pe=Re(ne=>{if(!Y.current)return;const Q=n.current.indexOf(ne.currentTarget);Q!==-1&&(V.current!==Q||r!==Q)&&(V.current=Q,z(ne))}),ze=Re(()=>C??j?.nodesRef.current.find(ne=>ne.id===G)?.context?.dataRef?.current.orientation),Ee=Re(()=>fp(n,ue.current)),Ve=Re(ne=>{if(J.current=!1,X.current=!0,ne.which===229||!Y.current&&ne.currentTarget===F.current)return;if(d&&n$(ne.key,w,g,P)){Rg(ne.key,ze())||Dr(ne),M.setOpen(!1,Xe(KA,ne.nativeEvent)),fn(H)&&(p?j?.events.emit("virtualfocus",H):H.focus());return}const Q=V.current,Se=fp(n,S),ge=yx(n,S);if($||(ne.key==="Home"&&(Dr(ne),V.current=Se,z(ne)),ne.key==="End"&&(Dr(ne),V.current=ge,z(ne))),O!=null){const De=O(ne,V.current,n,w,f,g,S,Se,ge);if(De!=null&&(V.current=De,z(ne)),w==="both")return}if(Rg(ne.key,w)){if(Dr(ne),D&&!p&&Gr(ne.currentTarget.ownerDocument)===ne.currentTarget){V.current=$0(ne.key,w,g)?Se:ge,z(ne);return}$0(ne.key,w,g)?f?Q>=ge?u&&Q!==n.current.length?V.current=-1:(X.current=!1,V.current=Se):V.current=Er(n.current,{startingIndex:Q,disabledIndices:S}):V.current=Math.min(ge,Er(n.current,{startingIndex:Q,disabledIndices:S})):f?Q<=Se?u&&Q!==-1?V.current=n.current.length:(X.current=!1,V.current=ge):V.current=Er(n.current,{startingIndex:Q,decrement:!0,disabledIndices:S}):V.current=Math.max(Se,Er(n.current,{startingIndex:Q,decrement:!0,disabledIndices:S})),ra(n.current,V.current)&&(V.current=-1),z(ne)}}),Ie=E.useMemo(()=>({onFocus(Q){X.current=!0,Pe(Q)},onClick:({currentTarget:Q})=>Q.focus({preventScroll:!0}),onMouseMove(Q){xM(Q)||(X.current=!0,ie.current=!1,v&&Pe(Q))},onPointerLeave(Q){if(!Y.current||!J.current||Q.pointerType==="touch")return;X.current=!0;const Se=Q.relatedTarget;if(!(!v||n.current.includes(Se))&&xe.current&&(ee.current?.(),ee.current=null,V.current=-1,z(Q),!p)){const ge=F.current,De=Gr(Vt(ge));ge&&Qe(ge,De)&&ge.focus({preventScroll:!0})}}}),[Pe,Y,F,v,n,z,xe,p]),He=E.useMemo(()=>p&&D&&Ce&&{"aria-activedescendant":`${R}-${r}`},[p,D,Ce,R,r]),Ge=E.useMemo(()=>({"aria-orientation":w==="both"?void 0:w,...$?{}:He,onKeyDown(ne){if(ne.key==="Tab"&&ne.shiftKey&&D&&!p){const Q=Yn(ne.nativeEvent);if(Q&&!Qe(F.current,Q))return;Dr(ne),M.setOpen(!1,Xe(jd,ne.nativeEvent)),fn(H)&&H.focus();return}Ve(ne)},onPointerMove(ne){xM(ne)||(J.current=!0)}}),[He,Ve,F,w,$,M,D,p,H]),We=E.useMemo(()=>{function ne(ge){M.setOpen(!0,Xe(KA,ge.nativeEvent,ge.currentTarget))}function Q(ge){m==="auto"&&aw(ge.nativeEvent)&&(q.current=!p)}function Se(ge){q.current=m,m==="auto"&&uw(ge.nativeEvent)&&(q.current=!0)}return{onKeyDown(ge){const De=M.select("open");J.current=!1;const Te=ge.key.startsWith("Arrow"),_e=t$(ge.key,ze(),g),nt=Rg(ge.key,w),Mt=(d?_e:nt)||ge.key==="Enter"||ge.key.trim()==="";if(p&&De)return Ve(ge);if(!(!De&&!b&&Te)){if(Mt){const kt=Rg(ge.key,ze());te.current=d&&kt?null:ge.key}if(d){_e&&(Dr(ge),De?(V.current=Ee(),z(ge)):ne(ge));return}nt&&(le.current!=null&&(V.current=le.current),Dr(ge),!De&&b?ne(ge):Ve(ge),De&&z(ge))}},onFocus(ge){M.select("open")&&!p&&(V.current=-1,z(ge))},onPointerDown:Se,onPointerEnter:Se,onMouseDown:Q,onClick:Q}},[Ve,m,Ee,d,z,M,b,w,ze,g,le,p]),fe=E.useMemo(()=>({...He,...We}),[He,We]);return E.useMemo(()=>s?{reference:fe,floating:Ge,item:Ie,trigger:We}:{},[s,fe,Ge,We,Ie])}function r$(t,e){const{listRef:n,elementsRef:r,activeIndex:i,onMatch:s,disabledIndices:a,onTyping:u,enabled:f=!0,resetMs:d=750,selectedIndex:g=null}=e,p="rootStore"in t?t.rootStore:t,m=p.useState("open"),v=ii(),b=E.useRef(""),S=E.useRef(g??i??-1),w=E.useRef(null),C=Re(A=>{function O(F){return r?.current[F]}function P(F){const G=O(F);return G&&!bm(G)||G?.matches(":disabled")?!1:a==null||!wc(Pi,F,a)}function M(F,G,j=0){if(F.length===0)return-1;const q=(j%F.length+F.length)%F.length,V=G.toLowerCase();for(let te=0;te<F.length;te+=1){const J=(q+te)%F.length;if(!(!F[J]?.toLowerCase().startsWith(V)||!P(J)))return J}return-1}const D=n.current;if(b.current.length>0&&A.key===" "&&(Dr(A),u?.(!0)),b.current.length>0&&b.current[0]!==" "&&M(D,b.current)===-1&&A.key!==" "&&u?.(!1),D==null||A.key.length!==1||A.ctrlKey||A.metaKey||A.altKey)return;m&&A.key!==" "&&(Dr(A),u?.(!0));const L=b.current==="";L&&(S.current=g??i??-1),D.every((F,G)=>F&&P(G)?F[0]?.toLowerCase()!==F[1]?.toLowerCase():!0)&&b.current===A.key&&(b.current="",S.current=w.current),b.current+=A.key,v.start(d,()=>{b.current="",S.current=w.current,u?.(!1)});const _=((L?g??i??-1:S.current)??0)+1,$=M(D,b.current,_);$!==-1?(s?.($),w.current=$):A.key!==" "&&(b.current="",u?.(!1))}),R=Re(A=>{const O=A.relatedTarget,P=p.select("domReferenceElement"),M=p.select("floatingElement");Qe(P,O)||Qe(M,O)||(v.clear(),b.current="",S.current=w.current,u?.(!1))});Oe(()=>{!m&&g!==null||(v.clear(),w.current=null,b.current!==""&&(b.current=""))},[m,g,v]);const T=E.useMemo(()=>({onKeyDown:C,onBlur:R}),[C,R]);return E.useMemo(()=>f?{reference:T,floating:T}:{},[f,T])}const SM=.1,i$=SM*SM,mn=.5;function Eg(t,e,n,r,i,s){return r>=e!=s>=e&&t<=(i-n)*(e-r)/(s-r)+n}function Tg(t,e,n,r,i,s,a,u,f,d){let g=!1;return Eg(t,e,n,r,i,s)&&(g=!g),Eg(t,e,i,s,a,u)&&(g=!g),Eg(t,e,a,u,f,d)&&(g=!g),Eg(t,e,f,d,n,r)&&(g=!g),g}function o$(t,e,n){return t>=n.x&&t<=n.x+n.width&&e>=n.y&&e<=n.y+n.height}function Ag(t,e,n,r,i,s){const a=Math.min(n,i),u=Math.max(n,i),f=Math.min(r,s),d=Math.max(r,s);return t>=a&&t<=u&&e>=f&&e<=d}function s$(t={}){const{blockPointerEvents:e=!1}=t,n=new zo,r=({x:i,y:s,placement:a,elements:u,onClose:f,nodeId:d,tree:g})=>{const p=a?.split("-")[0];let m=!1,v=null,b=null,S=typeof performance<"u"?performance.now():0;function w(R,T){const A=performance.now(),O=A-S;if(v===null||b===null||O===0)return v=R,b=T,S=A,!1;const P=R-v,M=T-b,D=P*P+M*M,L=O*O*i$;return v=R,b=T,S=A,D<L}function C(){n.clear(),f()}return function(T){n.clear();const A=u.domReference,O=u.floating;if(!A||!O||p==null||i==null||s==null)return;const{clientX:P,clientY:M}=T,D=Yn(T),L=T.type==="mouseleave",H=Qe(O,D),N=Qe(A,D);if(H&&(m=!0,!L))return;if(N&&(m=!1,!L)){m=!0;return}if(L&&Tt(T.relatedTarget)&&Qe(O,T.relatedTarget))return;function _(){return!!(g&&la(g.nodesRef.current,d).length>0)}function $(){_()||C()}if(_())return;const F=A.getBoundingClientRect(),G=O.getBoundingClientRect(),j=i>G.right-G.width/2,q=s>G.bottom-G.height/2,V=G.width>F.width,te=G.height>F.height,J=(V?F:G).left,z=(V?F:G).right,U=(te?F:G).top,W=(te?F:G).bottom;if(p==="top"&&s>=F.bottom-1||p==="bottom"&&s<=F.top+1||p==="left"&&i>=F.right-1||p==="right"&&i<=F.left+1){$();return}let X=!1;switch(p){case"top":X=Ag(P,M,J,F.top+1,z,G.bottom-1);break;case"bottom":X=Ag(P,M,J,G.top+1,z,F.bottom-1);break;case"left":X=Ag(P,M,G.right-1,W,F.left+1,U);break;case"right":X=Ag(P,M,F.right-1,W,G.left+1,U);break}if(X)return;if(m&&!o$(P,M,F)){$();return}if(!L&&w(P,M)){$();return}let ie=!1;switch(p){case"top":{const ee=V?mn/2:mn*4,ue=V||j?i+ee:i-ee,Y=V?i-ee:j?i+ee:i-ee,le=s+mn+1,xe=j||V?G.bottom-mn:G.top,ve=j?V?G.bottom-mn:G.top:G.bottom-mn;ie=Tg(P,M,ue,le,Y,le,G.left,xe,G.right,ve);break}case"bottom":{const ee=V?mn/2:mn*4,ue=V||j?i+ee:i-ee,Y=V?i-ee:j?i+ee:i-ee,le=s-mn,xe=j||V?G.top+mn:G.bottom,ve=j?V?G.top+mn:G.bottom:G.top+mn;ie=Tg(P,M,ue,le,Y,le,G.left,xe,G.right,ve);break}case"left":{const ee=te?mn/2:mn*4,ue=te||q?s+ee:s-ee,Y=te?s-ee:q?s+ee:s-ee,le=i+mn+1,xe=q||te?G.right-mn:G.left,ve=q?te?G.right-mn:G.left:G.right-mn;ie=Tg(P,M,xe,G.top,ve,G.bottom,le,ue,le,Y);break}case"right":{const ee=te?mn/2:mn*4,ue=te||q?s+ee:s-ee,Y=te?s-ee:q?s+ee:s-ee,le=i-mn,xe=q||te?G.left+mn:G.right,ve=q?te?G.left+mn:G.right:G.left+mn;ie=Tg(P,M,le,ue,le,Y,xe,G.top,ve,G.bottom);break}}ie?m||n.start(40,$):$()}};return r.__options={...t,blockPointerEvents:e},r}const hP=E.createContext(null);function ll(){const t=E.useContext(hP);if(t===null)throw new Error(Un(60));return t}const vd={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},gP={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},l$={disabled:!1,...gP},mu={valid(t){return t===null?null:t?{"data-valid":""}:{"data-invalid":""}}},pP={invalid:void 0,name:void 0,validityData:{state:vd,errors:[],error:"",value:"",initialValue:null},setValidityData:Tn,disabled:void 0,setTouched:Tn,setDirty:Tn,setFilled:Tn,setFocused:Tn,validationMode:"onSubmit",shouldValidateOnChange:()=>!1,state:l$,registerFieldControl:Tn,validation:{getValidationProps:(t,e=zn)=>e,inputRef:{current:null},registeredInputs:new Map,registerInput:Tn,getInputControl:()=>null,commit:async()=>{},change:Tn}},Aw=E.createContext(pP);function Ho(t=!0){const e=E.useContext(Aw);if(e.setValidityData===Tn&&!t)throw new Error(Un(28));return e}function Mw(t,e,n,r,i=!0,s){const{registerFieldControl:a}=Ho(),u=Sr(()=>Symbol());Oe(()=>{const f=u.current;if(!i){a(f,void 0);return}a(f,{controlRef:t,getValue:r,id:e,name:s,value:n})},[t,i,r,e,s,a,u,n]),Oe(()=>{const f=u.current;return()=>{a(f,void 0)}},[a,u])}function ho(t){return Sm(t,"base-ui")}const mP=E.createContext({controlId:void 0,registerControlId:Tn,labelId:void 0,setLabelId:Tn,messageIds:[],setMessageIds:Tn,getDescriptionProps:t=>t});function vs(){return E.useContext(mP)}function Om(t={}){const{id:e,implicit:n=!1,controlRef:r}=t,{controlId:i,registerControlId:s}=vs(),a=ho(e),u=n?i:void 0,f=Sr(()=>Symbol()),d=E.useRef(!1),g=E.useRef(e!=null),p=Re(()=>{!d.current||s===Tn||(d.current=!1,s(f.current,void 0))});return Oe(()=>{if(s===Tn)return;let m;if(n){const v=r?.current;Tt(v)&&v.closest("label")!=null?m=e??null:m=u??a}else if(e!=null)g.current=!0,m=e;else if(g.current)m=a;else{p();return}if(m===void 0){p();return}d.current=!0,s(f.current,m)},[e,r,u,s,n,a,f,p]),E.useEffect(()=>p,[p]),i??a}const yP=(t,e)=>Object.is(t,e);function uo(t,e,n){return t==null||e==null?Object.is(t,e):n(t,e)}function a$(t,e,n){return!t||t.length===0?!1:t.some(r=>r===void 0?!1:uo(e,r,n))}function ac(t,e,n){return!t||t.length===0?-1:t.findIndex(r=>r===void 0?!1:uo(r,e,n))}function q0(t,e,n,r){const i=r&&Array.isArray(e)?e[e.length-1]:e,s=ac(t,i,n);return s===-1?null:s}function vP(t,e,n){return t.filter(r=>!uo(e,r,n))}function Sx(t){if(t==null)return"";if(typeof t=="string")return t;try{return JSON.stringify(t)}catch{return String(t)}}function Ow(t){return t!=null&&t.length>0&&typeof t[0]=="object"&&t[0]!=null&&"items"in t[0]}function u$(t){if(!Array.isArray(t))return t!=null&&"null"in t;const e=t;if(Ow(e)){for(const n of e)for(const r of n.items)if(r&&r.value==null&&r.label!=null)return!0;return!1}for(const n of e)if(n&&n.value==null&&n.label!=null)return!0;return!1}function Zi(t,e){if(e&&t!=null)return e(t)??"";if(t&&typeof t=="object"){if("label"in t&&t.label!=null)return String(t.label);if("value"in t)return String(t.value)}return Sx(t)}function To(t,e){return e&&t!=null?e(t)??"":t&&typeof t=="object"&&"value"in t&&"label"in t?Sx(t.value):Sx(t)}function bP(t,e,n){function r(){return Zi(t,n)}if(n&&t!=null)return n(t);if(t&&typeof t=="object"&&"label"in t&&t.label!=null)return t.label;if(e&&!Array.isArray(e))return e[t]??r();if(Array.isArray(e)){const i=e,s=Ow(i)?i.flatMap(a=>a.items):i;if(t==null||typeof t!="object"){const a=s.find(u=>u.value===t);return a&&a.label!=null?a.label:r()}if("value"in t){const a=s.find(u=>u&&u.value===t.value);if(a&&a.label!=null)return a.label}}return r()}function c$(t,e,n){return t.reduce((r,i,s)=>(s>0&&r.push(", "),r.push(I.jsx(E.Fragment,{children:bP(i,e,n)},s)),r),[])}const ft={id:t=>t.id,labelId:t=>t.labelId,modal:t=>t.modal,items:t=>t.items,itemToStringLabel:t=>t.itemToStringLabel,isItemEqualToValue:t=>t.isItemEqualToValue,value:t=>t.value,hasSelectedValue:t=>{const{value:e,multiple:n,itemToStringValue:r}=t;return e==null?!1:n&&Array.isArray(e)?e.length>0:To(e,r)!==""},hasNullItemLabel:(t,e)=>e?u$(t.items):!1,open:t=>t.open,mounted:t=>t.mounted,forceMount:t=>t.forceMount,transitionStatus:t=>t.transitionStatus,openMethod:t=>t.openMethod,activeIndex:t=>t.activeIndex,selectedIndex:t=>t.selectedIndex,isActive:(t,e)=>t.activeIndex===e,isSelected:(t,e)=>{const n=t.isItemEqualToValue,r=t.value;return t.multiple?Array.isArray(r)&&r.some(i=>uo(e,i,n)):uo(e,r,n)},isSelectedByFocus:(t,e)=>t.selectedIndex===e,popupProps:t=>t.popupProps,triggerProps:t=>t.triggerProps,triggerElement:t=>t.triggerElement,positionerElement:t=>t.positionerElement,listElement:t=>t.listElement,popupSide:t=>t.popupSide,scrollUpArrowVisible:t=>t.scrollUpArrowVisible,scrollDownArrowVisible:t=>t.scrollDownArrowVisible,hasScrollArrows:t=>t.hasScrollArrows},f$=E.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:Tn,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function yu(){return E.useContext(f$)}function xP(t,e,n=(r,i)=>r===i){return t.length===e.length&&t.every((r,i)=>n(r,e[i]))}function nc(t,e){const n=E.useRef(t),r=Re(e);Oe(()=>{n.current!==t&&r(n.current),n.current=t},[t,r])}function d$(t){const e=E.useRef(""),n=E.useCallback(i=>{i.defaultPrevented||(e.current=i.pointerType,t(i,i.pointerType))},[t]);return{onClick:E.useCallback(i=>{if(i.detail===0){t(i,"keyboard");return}"pointerType"in i?t(i,i.pointerType):t(i,e.current),e.current=""},[t]),onPointerDown:n}}function SP(t,e){const n=Re((s,a)=>{(typeof t=="function"?t():t)||e(a||(_d?"touch":""))}),{onClick:r,onPointerDown:i}=d$(n);return E.useMemo(()=>({onClick:r,onPointerDown:i}),[r,i])}function wP(t){const[e,n]=E.useState(null),r=SP(t,n);return nc(t,i=>{i&&!t&&n(null)}),E.useMemo(()=>({openMethod:e,triggerProps:r}),[e,r])}function Vf(t,e=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(e,Math.min(t,n))}const qs=1;function CP(t,e){return Math.max(0,t-e)}function h$(t,e){if(e<=0)return 0;const n=Vf(t,0,e),r=n,i=e-n,s=r<=qs,a=i<=qs;return s&&a?r<=i?0:e:s?0:a?e:n}function g$(t){const{id:e,value:n,defaultValue:r=null,onValueChange:i,open:s,defaultOpen:a=!1,onOpenChange:u,name:f,form:d,autoComplete:g,disabled:p=!1,readOnly:m=!1,required:v=!1,modal:b=!0,actionsRef:S,inputRef:w,onOpenChangeComplete:C,items:R,multiple:T=!1,itemToStringLabel:A,itemToStringValue:O,isItemEqualToValue:P=yP,highlightItemOnHover:M=!0,children:D}=t,{clearErrors:L}=yu(),{setDirty:H,setTouched:N,setFocused:_,validityData:$,setFilled:F,name:G,disabled:j,validation:q,validationMode:V}=Ho(),te=Om({id:e}),J=j||p,z=G??f,[U,W]=Ja({controlled:n,default:T?r??Pi:r,name:"Select",state:"value"}),[X,ie]=Ja({controlled:s,default:a,name:"Select",state:"open"}),ee=E.useRef([]),ue=E.useRef([]),Y=E.useRef(null),le=E.useRef(null),xe=E.useRef(0),ve=E.useRef(null),de=E.useRef([]),me=E.useRef(!1),Ce=E.useRef(null),Pe=E.useRef(null),ze=E.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),Ee=E.useRef(!1),{mounted:Ve,setMounted:Ie,transitionStatus:He}=ga(X),{openMethod:Ge,triggerProps:We}=wP(X),fe=Sr(()=>new fm({id:te,labelId:void 0,modal:b,multiple:T,itemToStringLabel:A,itemToStringValue:O,isItemEqualToValue:P,value:U,open:X,mounted:Ve,transitionStatus:He,items:R,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,ne=pe(fe,ft.activeIndex),Q=pe(fe,ft.selectedIndex),Se=pe(fe,ft.triggerElement),ge=pe(fe,ft.positionerElement),De=x8(Ge),Te=Ge??De,_e=E.useMemo(()=>T?"":To(U,O),[T,U,O]),nt=E.useMemo(()=>T&&Array.isArray(U)?U.map(rt=>To(rt,O)):To(U,O),[T,U,O]),Mt=Fn(Se),kt=Re(()=>nt);Mw(Mt,te,U,kt,!J,f);const It=E.useRef(U),bn=T?Array.isArray(U)&&U.length>0:U!=null&&_e!=="";Oe(()=>{F(bn)},[bn,F]),Oe(function(){let Ut=U,$n=!1;if(T){const rn=Array.isArray(U)?U:[];$n=rn.length===0,Ut=rn[rn.length-1]}const Ln=$n?-1:ac(de.current,Ut,P),wr=Ln===-1?null:Ln;wr===null&&(Pe.current=null),!X&&fe.set("selectedIndex",wr)},[T,X,U,P,fe]);function at(rt){const Ut=$.initialValue;return Array.isArray(rt)&&Array.isArray(Ut)?!xP(rt,Ut,($n,Ln)=>uo($n,Ln,P)):rt!==Ut}nc(U,()=>{L(z),H(at(U)),q.change(U)});const Mn=Re((rt,Ut)=>{u?.(rt,Ut),!Ut.isCanceled&&(ie(rt),!rt&&(Ut.reason===jd||Ut.reason===vm)&&(N(!0),_(!1),V==="onBlur"&&q.commit(U)))}),Qt=Re(()=>{Ie(!1),fe.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),C?.(!1)});fo({enabled:!S,open:X,ref:Y,onComplete(){X||Qt()}}),E.useImperativeHandle(S,()=>({unmount:Qt}),[Qt]);const xn=Re((rt,Ut)=>{i?.(rt,Ut),!Ut.isCanceled&&W(rt)}),nn=Re(rt=>{const Ut=CP(rt.scrollHeight,rt.clientHeight),$n=h$(rt.scrollTop,Ut),Ln=$n>0,wr=$n<Ut;fe.set("scrollUpArrowVisible",Ln),fe.set("scrollDownArrowVisible",wr)}),Wt=cP({open:X,onOpenChange:Mn,elements:{reference:Se,floating:ge}}),st=ww(Wt,{enabled:!m&&!J,event:"mousedown"}),pt=Cm(Wt),tt=dP(Wt,{enabled:!m&&!J,listRef:ee,activeIndex:ne,selectedIndex:Q,disabledIndices:Pi,onNavigate(rt){rt===null&&!X||fe.set("activeIndex",rt)},focusItemOnHover:M}),Zt=r$(Wt,{enabled:!m&&!J&&(X||!T),listRef:ue,activeIndex:ne,selectedIndex:Q,disabledIndices:rt=>lD(ee.current[rt]),onMatch(rt){X?fe.set("activeIndex",rt):xn(de.current[rt],Xe(yr))},onTyping(rt){me.current=rt}}),Hn=E.useMemo(()=>ko(Zt.reference,tt.reference,pt.reference,st.reference,We),[st.reference,Zt.reference,tt.reference,pt.reference,We]),jn=E.useMemo(()=>ko(Tm,Zt.floating,tt.floating,pt.floating),[Zt.floating,tt.floating,pt.floating]),Jt=tt.item??zn;sD(()=>{fe.update({popupProps:jn,triggerProps:Hn})}),fe.useSyncedValues({id:te,modal:b,multiple:T,value:U,open:X,mounted:Ve,transitionStatus:He,popupProps:jn,triggerProps:Hn,items:R,itemToStringLabel:A,itemToStringValue:O,isItemEqualToValue:P,openMethod:Te});const Rn=E.useMemo(()=>({store:fe,floatingContext:Wt,required:v,disabled:J,readOnly:m,multiple:T,highlightItemOnHover:M,setValue:xn,setOpen:Mn,listRef:ee,popupRef:Y,scrollHandlerRef:le,handleScrollArrowVisibility:nn,scrollArrowsMountedCountRef:xe,itemProps:Jt,valueRef:ve,valuesRef:de,labelsRef:ue,typingRef:me,selectionRef:ze,firstItemTextRef:Ce,selectedItemTextRef:Pe,validation:q,onOpenChangeComplete:C,alignItemWithTriggerActiveRef:Ee,initialValueRef:It}),[fe,Wt,v,J,m,T,M,xn,Mn,Jt,q,C,nn]),Dt=tl(w,q.inputRef),Br=T?void 0:z,or=E.useMemo(()=>!T||!Array.isArray(U)||!z?null:U.map(rt=>{const Ut=To(rt,O);return I.jsx("input",{type:"hidden",form:d,name:z,value:Ut,disabled:J},Ut)}),[T,U,d,z,O,J]);return I.jsxs(hP.Provider,{value:Rn,children:[D,I.jsx("input",{...q.getValidationProps(J,{onFocus(){fe.state.triggerElement?.focus({focusVisible:!0})},onChange(rt){if(rt.nativeEvent.defaultPrevented||J||m)return;const Ut=rt.currentTarget.value,$n=Xe(yr,rt.nativeEvent);function Ln(){if(T)return;const wr=Ut.toLowerCase();let rn=de.current.findIndex(zt=>To(zt,O).toLowerCase()===wr||Zi(zt,A).toLowerCase()===wr);rn===-1&&(rn=de.current.findIndex((zt,Je)=>{const Cr=ue.current[Je];return Cr!=null&&Cr.toLowerCase()===wr}));const Pt=de.current[rn];Pt!=null&&xn(Pt,$n)}fe.set("forceMount",!0),queueMicrotask(Ln)}}),id:te&&Br==null?`${te}-hidden-input`:void 0,form:d,name:Br,autoComplete:g,value:_e,disabled:J,required:v&&!(T&&bn),readOnly:m,ref:Dt,style:z?JS:ZS,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),or]})}function p$(t,e){const n=ho(t);return Oe(()=>(e(n),()=>{e(r=>r===n?void 0:r)}),[n,e]),n}function m$(t={}){const{id:e,fallbackControlId:n,native:r=!1,setLabelId:i,focusControl:s}=t,{controlId:a,setLabelId:u}=vs(),f=Re(v=>{u(v),i?.(v)}),d=p$(e,f),g=a??n;function p(v){if(s){s(v,g);return}if(!g)return;const b=Vt(v.currentTarget).getElementById(g);fn(b)&&y$(b)}function m(v){Yn(v.nativeEvent)?.closest("button,input,select,textarea")||(!v.defaultPrevented&&v.detail>1&&v.preventDefault(),!r&&p(v))}return r?{id:d,htmlFor:g??void 0,onMouseDown:m}:{id:d,onClick:m,onPointerDown(v){v.preventDefault()}}}function y$(t){t.focus({focusVisible:!0})}function v$(t,e){return t??e}let wM=(function(t){return t.startingStyle="data-starting-style",t.endingStyle="data-ending-style",t})({});const b$={"data-starting-style":""},x$={"data-ending-style":""},al={transitionStatus(t){return t==="starting"?b$:t==="ending"?x$:null}};(function(t){return t.open="data-open",t.closed="data-closed",t[t.startingStyle=wM.startingStyle]="startingStyle",t[t.endingStyle=wM.endingStyle]="endingStyle",t.anchorHidden="data-anchor-hidden",t.side="data-side",t.align="data-align",t})({});const S$={"data-popup-open":""},w$={"data-popup-open":"","data-pressed":""},C$={"data-open":""},R$={"data-closed":""},E$={"data-anchor-hidden":""},km={open(t){return t?S$:null}},RP={open(t){return t?w$:null}},Fd={open(t){return t?C$:R$},anchorHidden(t){return t?E$:null}},EP={...Fd,...al},Mg=5;function T$(t,e){const n=A$(e);return t.clientX>=n.left-Mg&&t.clientX<=n.right+Mg&&t.clientY>=n.top-Mg&&t.clientY<=n.bottom+Mg}function A$(t){const e=t.getBoundingClientRect(),n=An(t);if(lw)return e;const r=n.getComputedStyle(t,"::before"),i=n.getComputedStyle(t,"::after");if(!(r.content!=="none"||i.content!=="none"))return e;const a=parseFloat(r.width)||0,u=parseFloat(r.height)||0,f=parseFloat(i.width)||0,d=parseFloat(i.height)||0,g=Math.max(e.width,a,f),p=Math.max(e.height,u,d),m=g-e.width,v=p-e.height;return{left:e.left-m/2,right:e.right+m/2,top:e.top-v/2,bottom:e.bottom+v/2}}const TP=E.createContext(void 0);function kw(t=!1){const e=E.useContext(TP);if(e===void 0&&!t)throw new Error(Un(16));return e}function M$(t){const{focusableWhenDisabled:e,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:s}=t,a=r&&e!==!1,u=r&&e===!1;return{props:E.useMemo(()=>{const d={onKeyDown(g){n&&e&&g.key!=="Tab"&&g.preventDefault()}};return r||(d.tabIndex=i,!s&&n&&(d.tabIndex=e?i:-1)),(s&&(e||a)||!s&&n)&&(d["aria-disabled"]=n),s&&(!e||u)&&(d.disabled=n),d},[r,n,e,a,u,s,i])}}function G0(t,e,{detail:n=0}={}){t.dispatchEvent(new(An(t)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey}))}function ul(t={}){const{disabled:e=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:s}=t,a=E.useRef(null),u=kw(!0),f=s??u!==void 0,{props:d}=M$({focusableWhenDisabled:n,disabled:e,composite:f,tabIndex:r,isNativeButton:i}),g=E.useCallback(()=>{const v=a.current;W0(v)&&f&&e&&d.disabled===void 0&&v.disabled&&(v.disabled=!1)},[e,d.disabled,f]);Oe(g,[g]);const p=E.useCallback((v={})=>{const{onClick:b,onMouseDown:S,onKeyUp:w,onKeyDown:C,onPointerDown:R,...T}=v;return ko({onClick(A){if(e){A.preventDefault();return}b?.(A)},onMouseDown(A){e||S?.(A)},onKeyDown(A){if(e||(Np(A),C?.(A),A.baseUIHandlerPrevented))return;const O=A.target===A.currentTarget,P=A.currentTarget,M=W0(P),D=!i&&O$(P),L=O&&(i?M:!D),H=A.key==="Enter",N=A.key===" ",_=P.getAttribute("role"),$=_?.startsWith("menuitem")||_==="option"||_==="gridcell";if(O&&f&&N){if(A.defaultPrevented&&$)return;A.preventDefault(),(!i||M)&&(A.preventBaseUIHandler(),G0(P,A));return}if(!L||i||!N&&!H){O&&D&&N&&A.preventDefault();return}A.defaultPrevented||(A.preventDefault(),H&&(A.preventBaseUIHandler(),G0(P,A)))},onKeyUp(A){if(!e){if(Np(A),w?.(A),A.target===A.currentTarget&&i&&f&&W0(A.currentTarget)&&A.key===" "){A.preventDefault();return}A.baseUIHandlerPrevented||A.target===A.currentTarget&&!i&&!f&&!A.defaultPrevented&&A.key===" "&&(A.preventBaseUIHandler(),G0(A.currentTarget,A))}},onPointerDown(A){if(e){A.preventDefault();return}R?.(A)}},i?{type:"button"}:{role:"button"},d,T)},[e,d,f,i]),m=Re(v=>{a.current=v,g()});return{getButtonProps:p,buttonRef:m}}function W0(t){return fn(t)&&t.tagName==="BUTTON"}function O$(t){return fn(t)&&t.tagName==="A"&&!!t.href}const k$=400,I$={...RP,...mu,popupSide:t=>t?{"data-popup-side":t}:null,value:()=>null},D$=E.forwardRef(function(e,n){const{render:r,className:i,id:s,disabled:a=!1,nativeButton:u=!0,style:f,...d}=e,{setTouched:g,setFocused:p,validationMode:m,state:v,disabled:b}=Ho(),{labelId:S}=vs(),{store:w,setOpen:C,selectionRef:R,validation:T,readOnly:A,required:O,alignItemWithTriggerActiveRef:P,disabled:M}=ll(),D=b||M||a,L=pe(w,ft.open),H=pe(w,ft.mounted),N=pe(w,ft.value),_=pe(w,ft.triggerProps),$=pe(w,ft.positionerElement),F=pe(w,ft.listElement),G=pe(w,ft.popupSide),j=pe(w,ft.id),q=pe(w,ft.labelId),V=pe(w,ft.hasSelectedValue),te=H&&$?G:null,J=s??j,z=v$(S,q);Om({id:J});const U=Fn($),W=E.useRef(null),{getButtonProps:X,buttonRef:ie}=ul({disabled:D,native:u}),ee=w.useStateSetter("triggerElement"),ue=ii(),Y=ii(),le=ii();E.useEffect(()=>{if(L)return le.start(k$,()=>{R.current.allowUnselectedMouseUp=!0,R.current.allowSelectedMouseUp=!0}),()=>{le.clear()};R.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},Y.clear()},[L,R,Y,le]);const xe=ko(_,{id:J,role:"combobox","aria-expanded":L,"aria-haspopup":"listbox","aria-controls":L?F?.id??kp($)?.id:void 0,"aria-labelledby":z,"aria-readonly":A||void 0,"aria-required":O||void 0,tabIndex:D?-1:0,onFocus(me){p(!0),L&&P.current&&C(!1,Xe(yr,me.nativeEvent)),ue.start(0,()=>{w.set("forceMount",!0)})},onBlur(me){Qe($,me.relatedTarget)||(g(!0),p(!1),m==="onBlur"&&T.commit(N))},onMouseDown(me){if(L)return;const Ce=Vt(me.currentTarget);function Pe(ze){if(!W.current)return;const Ee=ze.target;Qe(W.current,Ee)||Qe(U.current,Ee)||T$(ze,W.current)||C(!1,Xe(i6,ze))}Y.start(0,()=>{Ce.addEventListener("mouseup",Pe,{once:!0})})}},d,X),ve=T.getValidationProps(D,xe);ve.role="combobox";const de={...v,open:L,disabled:D,value:N,readOnly:A,popupSide:te,placeholder:!V};return At("button",e,{ref:[n,W,ie,ee],state:de,stateAttributesMapping:I$,props:ve})}),P$={value:()=>null},z$=E.forwardRef(function(e,n){const{className:r,render:i,children:s,placeholder:a,style:u,...f}=e,{store:d,valueRef:g}=ll(),p=pe(d,ft.value),m=pe(d,ft.items),v=pe(d,ft.itemToStringLabel),b=pe(d,ft.hasSelectedValue),S=!b&&a!=null&&s==null,w=pe(d,ft.hasNullItemLabel,S),C={value:p,placeholder:!b};let R=null;return typeof s=="function"?R=s(p):s!=null?R=s:S&&!w?R=a:Array.isArray(p)?R=c$(p,m,v):R=bP(p,m,v),At("span",e,{state:C,ref:[n,g],props:[{children:R},f],stateAttributesMapping:P$})}),N$=E.forwardRef(function(e,n){const{render:r,className:i,style:s,...a}=e,{store:u}=ll(),d={open:pe(u,ft.open)};return At("span",e,{state:d,ref:n,props:[{"aria-hidden":!0,children:"▼"},a],stateAttributesMapping:km})}),L$=E.forwardRef(function(e,n){const{store:r}=ll(),i=pe(r,ft.mounted),s=pe(r,ft.forceMount);return i||s?I.jsx(bw,{ref:n,...e}):null});function Im(t){return nw(19)?t:t?"true":void 0}const AP=E.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function B$(){return E.useContext(AP)}function Dm(t){const{children:e,elementsRef:n,labelsRef:r,onMapChange:i}=t,s=Re(i),[,a]=E.useState(!1),u=Sr(H$).current,f=Sr(_$).current,d=E.useRef(0),g=E.useRef(!0),p=E.useRef([]),m=E.useRef(null),v=Re(()=>{g.current||(g.current=!0,a(O=>!O))}),b=Re((O,P)=>{f.set(O,P),v()}),S=Re(O=>{f.delete(O),v()}),w=Re(O=>{const P=new Map;return n.current.length=0,r&&(r.current.length=0),O.forEach(M=>{P.set(M.element,{...M.registration.metadata??{},index:M.index}),n.current[M.index]=M.element,r&&(r.current[M.index]=M.registration.label!==void 0?M.registration.label:M.registration.textRef?.current?.textContent??M.element.textContent)}),d.current=n.current.length,P});function C(O){if(m.current?.disconnect(),m.current=null,typeof MutationObserver!="function"||O.length<2)return;const P=new MutationObserver(D=>{if(!F$(D))return;let L=null;for(const H of O)if(H.isConnected){if(L&&MP(L,H)>0){P.disconnect(),v();return}L=H}});m.current=P;const M=new Set;for(let D=1;D<O.length;D+=1){const L=V$(O[D-1],O[D]);L&&M.add(L)}M.forEach(D=>P.observe(D,{childList:!0}))}const R=Re(()=>{const[O,P]=j$(f),M=w(O);C(P),p.current=O,g.current=!1,u.forEach(D=>D(M)),s(M)});Oe(()=>(g.current||w(p.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,w]),Oe(()=>{g.current&&R()}),Oe(()=>()=>{m.current?.disconnect(),g.current=!0},[]);const T=Re(O=>(u.add(O),()=>{u.delete(O)})),A=E.useMemo(()=>({register:b,unregister:S,subscribeMapChange:T,nextIndexRef:d}),[b,S,T,d]);return I.jsx(AP.Provider,{value:A,children:e})}function _$(){return new Map}function H$(){return new Set}function j$(t){const e=new Set,n=[],r=[];t.forEach((s,a)=>{if(!a.isConnected)return;const u=s.index,f={index:u??-1,element:a,registration:s};u===null?r.push(f):u>=0&&(e.add(u),n.push(f))});let i=0;return r.sort((s,a)=>MP(s.element,a.element)),r.forEach(s=>{for(;e.has(i);)i+=1;s.index=i,n.push(s),i+=1}),e.size>0&&n.sort((s,a)=>s.index-a.index),[n,r.map(s=>s.element)]}function V$(t,e){let n=t.parentElement;for(;n&&!n.contains(e);)n=n.parentElement;return n}function F$(t){for(const e of t)for(let n=0;n<e.removedNodes.length;n+=1)if(e.removedNodes[n].isConnected)return!0;return!1}function MP(t,e){return t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}const U$=E.createContext(void 0);function Ud(){return E.useContext(U$)?.direction??"ltr"}const $$=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:s,platform:a,elements:u,middlewareData:f}=e,{element:d,padding:g=0,offsetParent:p="real"}=sa(t,e)||{};if(d==null)return{};const m=wD(g),v={x:n,y:r},b=pw(i),S=gw(b),w=await a.getDimensions(d),C=b==="y",R=C?"top":"left",T=C?"bottom":"right",A=C?"clientHeight":"clientWidth",O=s.reference[S]+s.reference[b]-v[b]-s.floating[S],P=v[b]-s.reference[b],M=p==="real"?await a.getOffsetParent?.(d):u.floating;let D=u.floating[A]||s.floating[S];(!D||!await a.isElement?.(M))&&(D=u.floating[A]||s.floating[S]);const L=O/2-P/2,H=D/2-w[S]/2-1,N=Math.min(m[R],H),_=Math.min(m[T],H),$=N,F=D-w[S]-_,G=D/2-w[S]/2+L,j=SD($,G,F),q=!f.arrow&&ha(i)!=null&&G!==j&&s.reference[S]/2-(G<$?N:_)-w[S]/2<0,V=q?G<$?G-$:G-F:0;return{[b]:v[b]+V,data:{[b]:j,centerOffset:G-j-V,...q&&{alignmentOffset:V}},reset:q}}}),q$=(t,e)=>({...$$(t),options:[t,e]}),G$={name:"hide",async fn(t){const{width:e,height:n,x:r,y:i}=t.rects.reference,s=e===0&&n===0&&r===0&&i===0,a=await t.platform.detectOverflow(t,{elementContext:"reference"});return{data:{referenceHidden:a.top-n>=0||a.right-e>=0||a.bottom-n>=0||a.left-e>=0||s}}}},W$={sideX:"left",sideY:"top"},CM="--available-width",RM="--available-height";function OP(t,e,n){const r=t==="inline-start"||t==="inline-end";return{top:"top",right:r?n?"inline-start":"inline-end":"right",bottom:"bottom",left:r?n?"inline-end":"inline-start":"left"}[e]}function EM(t,e,n){const{rects:r,placement:i}=t;return{side:OP(e,so(i),n),align:ha(i)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Iw(t){return K$(t,KU)}function K$(t,e){const{anchor:n,positionMethod:r="absolute",side:i="bottom",sideOffset:s=0,align:a="center",alignOffset:u=0,collisionBoundary:f,collisionPadding:d=5,sticky:g=!1,arrowPadding:p=5,disableAnchorTracking:m=!1,inline:v,keepMounted:b=!1,floatingRootContext:S,mounted:w,collisionAvoidance:C,shift:R,nodeId:T,adaptiveOrigin:A,lazyFlip:O=!1,externalTree:P}=t,[M,D]=E.useState(null);!w&&M!==null&&D(null);const L=C.side||"flip",H=C.align||"flip",N=C.fallbackAxisSide||"end",_=R?.crossAxis??!1,$=R?.rootBoundary,F=typeof n=="function"?n:void 0,G=Re(F),j=F?G:n,q=Fn(n),V=Fn(w),J=Ud()==="rtl",z=M||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":J?"left":"right","inline-start":J?"right":"left"}[i],U=a==="center"?z:`${z}-${a}`;let W=d;typeof W=="number"?W={top:W,right:W,bottom:W,left:W}:W&&(W={top:W.top||0,right:W.right||0,bottom:W.bottom||0,left:W.left||0});const X=1,ie=i==="bottom"?X:0,ee=i==="top"?X:0,ue=i==="right"?X:0,Y=i==="left"?X:0,le={boundary:f==="clipping-ancestors"?"clippingAncestors":f,padding:W},xe=E.useRef(null),ve=Fn(s),de=Fn(u),me=typeof s!="function"?s:0,Ce=typeof u!="function"?u:0,Pe=[];v&&Pe.push(v),Pe.push(PU(st=>{const pt=EM(st,i,J),tt=typeof ve.current=="function"?ve.current(pt):ve.current,Zt=typeof de.current=="function"?de.current(pt):de.current;return{mainAxis:tt,crossAxis:Zt,alignmentAxis:Zt}},[me,Ce,J,i]));const ze=H==="none"&&L!=="shift",Ee=!ze&&(g||_||L==="shift"),Ve=L==="none"?null:LU({...le,padding:{top:W.top+X+ie,right:W.right+X+Y,bottom:W.bottom+X+ee,left:W.left+X+ue},mainAxis:!_&&L==="flip",crossAxis:H==="flip"?"alignment":!1,fallbackAxisSideDirection:N}),Ie=ze?null:zU({...le,rootBoundary:$,mainAxis:H!=="none",crossAxis:Ee,limiter:g||_?void 0:NU(st=>{if(!xe.current)return{};const{width:pt,height:tt}=xe.current.getBoundingClientRect(),Zt=eo(so(st.placement)),Hn=Zt==="y"?pt:tt,jn=Zt==="y"?W.left+W.right:W.top+W.bottom;return{offset:Hn/2+jn/2}})},[le,g,_,$,W,H]);L==="shift"||H==="shift"||a==="center"?Pe.push(Ie,Ve):Pe.push(Ve,Ie),Pe.push(BU({...le,apply({elements:{floating:st},availableWidth:pt,availableHeight:tt,rects:Zt}){if(!V.current)return;const Hn=st.style;Hn.setProperty(CM,`${pt}px`),Hn.setProperty(RM,`${tt}px`);const jn=An(st).devicePixelRatio||1,{x:Jt,y:Rn,width:Dt,height:Br}=Zt.reference,or=(Math.round((Jt+Dt)*jn)-Math.round(Jt*jn))/jn,rt=(Math.round((Rn+Br)*jn)-Math.round(Rn*jn))/jn;Hn.setProperty("--anchor-width",`${or}px`),Hn.setProperty("--anchor-height",`${rt}px`)}}),q$(st=>({element:xe.current||Vt(st.elements.floating).createElement("div"),padding:p,offsetParent:"floating"}),[p]),{name:"transformOrigin",fn(st){const{elements:pt,middlewareData:tt,placement:Zt,rects:Hn,y:jn}=st,Jt=so(Zt),Rn=eo(Jt),Dt=xe.current,Br=tt.arrow?.x||0,or=tt.arrow?.y||0,rt=Dt?.clientWidth||0,Ut=Dt?.clientHeight||0,$n=Br+rt/2,Ln=or+Ut/2,wr=Math.abs(tt.shift?.y||0),rn=Hn.reference.height/2,Pt=typeof s=="function"?s(EM(st,i,J)):s,zt=wr>Pt,Je={top:`${$n}px calc(100% + ${Pt}px)`,bottom:`${$n}px ${-Pt}px`,left:`calc(100% + ${Pt}px) ${Ln}px`,right:`${-Pt}px ${Ln}px`}[Jt],Cr=`${$n}px ${Hn.reference.y+rn-jn}px`;return pt.floating.style.setProperty("--transform-origin",Ee&&Rn==="y"&&zt?Cr:Je),{}}},G$,A),Oe(()=>{!w&&S&&S.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[w,S]);const He=E.useMemo(()=>({elementResize:!m&&typeof ResizeObserver<"u",layoutShift:!m&&typeof IntersectionObserver<"u"}),[m]),{refs:Ge,elements:We,x:fe,y:ne,middlewareData:Q,update:Se,placement:ge,context:De,isPositioned:Te,floatingStyles:_e}=e({rootContext:S,open:b?w:void 0,placement:U,middleware:Pe,strategy:r,whileElementsMounted:b?void 0:(...st)=>yM(...st,He),nodeId:T,externalTree:P}),{sideX:nt,sideY:Mt}=Q.adaptiveOrigin||W$,kt=Te?r:"fixed",It=E.useMemo(()=>{let st;return Te?A?st={position:kt,[nt]:fe,[Mt]:ne}:st={..._e,position:kt}:st={position:kt,top:0,left:0},st[CM]="100vw",st[RM]="100vh",Te||(st.opacity=0),st},[A,kt,nt,fe,Mt,ne,_e,Te]),bn=E.useRef(null);Oe(()=>{if(!w)return;const st=q.current,pt=typeof st=="function"?st():st,Zt=(TM(pt)?pt.current:pt)||null||null;Zt!==bn.current&&(Ge.setPositionReference(Zt),bn.current=Zt)},[w,Ge,j,q]),E.useEffect(()=>{if(!w)return;const st=q.current;typeof st!="function"&&TM(st)&&st.current!==bn.current&&(Ge.setPositionReference(st.current),bn.current=st.current)},[w,Ge,j,q]),E.useEffect(()=>{if(b&&w&&We.reference&&We.floating)return yM(We.reference,We.floating,Se,He)},[b,w,We,Se,He]);const at=so(ge),Mn=OP(i,at,J),Qt=ha(ge)||"center",xn=!!Q.hide?.referenceHidden;Oe(()=>{O&&w&&Te&&at!==z&&D(at)},[O,w,Te,at,z]);const nn=E.useMemo(()=>({position:"absolute",top:Q.arrow?.y,left:Q.arrow?.x}),[Q.arrow]),Wt=Q.arrow?.centerOffset!==0;return E.useMemo(()=>({positionerStyles:It,arrowStyles:nn,arrowRef:xe,arrowUncentered:Wt,side:Mn,align:Qt,physicalSide:at,anchorHidden:xn,refs:Ge,context:De,isPositioned:Te,update:Se}),[It,nn,xe,Wt,Mn,Qt,at,xn,Ge,De,Te,Se])}function TM(t){return t!=null&&"current"in t}const kP=E.createContext(void 0);function IP(){const t=E.useContext(kP);if(!t)throw new Error(Un(59));return t}const Dw=E.forwardRef(function(e,n){const{cutout:r,...i}=e;let s;if(r){const a=r.getBoundingClientRect();s=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${a.left}px ${a.top}px,${a.left}px ${a.bottom}px,${a.right}px ${a.bottom}px,${a.right}px ${a.top}px,${a.left}px ${a.top}px)`}return I.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...i,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})});function Hp(t,e){t&&Object.assign(t.style,e)}const DP={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"};function Pm(t){return t==="starting"?V6:zn}function Pw(t,e,{styles:n,transitionStatus:r,props:i,refs:s,hidden:a,inert:u=!1}){const f={...n};return u&&(f.pointerEvents="none"),At("div",t,{state:e,ref:s,props:[{role:"presentation",hidden:a,style:f},Pm(r),i],stateAttributesMapping:Fd})}let AM={},MM={},OM="";function zm(t,e){return Bd(t)?t:e}function kM(t,e,n){return/hidden|clip/.test(t.getComputedStyle(zm(e,n)).overflowY)}function Y$(t){if(typeof document>"u")return!1;const e=Vt(t);return An(e).innerWidth-e.documentElement.clientWidth>0}function X$(t){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=Vt(t),r=n.documentElement,i=n.body,s=zm(r,i),a=s.style.overflowY,u=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",s.style.overflowY="scroll";const f=s.offsetWidth;s.style.overflowY="hidden";const d=s.offsetWidth;return s.style.overflowY=a,r.style.scrollbarGutter=u,f===d}function Q$(t){const e=Vt(t),n=e.documentElement,r=e.body,i=zm(n,r),s={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(i.style,s)}}function Z$(t){const e=Vt(t),n=e.documentElement,r=e.body,i=An(n);let s=0,a=0,u=!1;const f=is.create();if(sl&&(i.visualViewport?.scale??1)!==1)return()=>{};function d(){const v=i.getComputedStyle(n),b=i.getComputedStyle(r),C=(v.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,a=n.scrollLeft,AM={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},OM=n.style.scrollBehavior,MM={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 R=n.scrollHeight>n.clientHeight,T=n.scrollWidth>n.clientWidth,A=v.overflowY==="scroll"||b.overflowY==="scroll",O=v.overflowX==="scroll"||b.overflowX==="scroll",P=Math.max(0,i.innerWidth-r.clientWidth),M=Math.max(0,i.innerHeight-r.clientHeight),D=parseFloat(b.marginTop)+parseFloat(b.marginBottom),L=parseFloat(b.marginLeft)+parseFloat(b.marginRight),H=zm(n,r);if(u=X$(t),u){n.style.scrollbarGutter=C,H.style.overflowY="hidden",H.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:C,overflowY:"hidden",overflowX:"hidden"}),(R||A)&&(n.style.overflowY="scroll"),(T||O)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:D||M?`calc(100dvh - ${D+M}px)`:"100dvh",width:L||P?`calc(100vw - ${L+P}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),r.scrollTop=s,r.scrollLeft=a,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function g(){Object.assign(n.style,AM),Object.assign(r.style,MM),u||(n.scrollTop=s,n.scrollLeft=a,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=OM)}function p(){g(),f.request(d)}d();const m=Rt(i,"resize",p);return()=>{f.cancel(),g(),typeof i.removeEventListener=="function"&&m()}}class J${lockCount=0;restore=null;timeoutLock=zo.create();timeoutUnlock=zo.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),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(e){if(this.lockCount===0||this.restore!==null)return;const n=Vt(e),r=n.documentElement,i=n.body,s=An(r);if(kM(s,r,i)){const u=new s.MutationObserver(()=>{kM(s,r,i)||(u.disconnect(),this.restore=null,this.lock(e))}),f={attributes:!0};u.observe(r,f),u.observe(i,f),this.restore=()=>u.disconnect();return}const a=_d||!Y$(e);this.restore=a?Q$(e):Z$(e)}}const eq=new J$;function PP(t=!0,e=null){Oe(()=>{if(t)return eq.acquire(e)},[t,e])}const tq=20;function zP(t,e,n,r){const[i,s]=E.useState(!1);Oe(()=>{if(!t||!e||n==null){s(!1);return}const a=Vt(n).documentElement.clientWidth,u=n.offsetWidth;s(a>0&&u>0&&u>=a-tq)},[t,e,n]),PP(t&&(!e||i),r)}const nq={position:"fixed"},rq=E.forwardRef(function(e,n){const{anchor:r,className:i,render:s,positionMethod:a,side:u,align:f,sideOffset:d,alignOffset:g,collisionBoundary:p="clipping-ancestors",collisionPadding:m,arrowPadding:v,sticky:b,disableAnchorTracking:S,alignItemWithTrigger:w=!0,collisionAvoidance:C=jD,style:R,...T}=e,{store:A,listRef:O,labelsRef:P,alignItemWithTriggerActiveRef:M,selectedItemTextRef:D,valuesRef:L,initialValueRef:H,popupRef:N,setValue:_,floatingContext:$}=ll(),F=pe(A,ft.open),G=pe(A,ft.mounted),j=pe(A,ft.modal),q=pe(A,ft.value),V=pe(A,ft.openMethod),te=pe(A,ft.positionerElement),J=pe(A,ft.triggerElement),z=pe(A,ft.isItemEqualToValue),U=pe(A,ft.transitionStatus),W=E.useRef(null),X=E.useRef(null),[ie,ee]=E.useState(w),ue=G&&ie&&V!=="touch";!G&&ie!==w&&ee(w),E.useImperativeHandle(M,()=>ue),zP((ue||j)&&F,V==="touch",te,J);const Y=Iw({anchor:r,floatingRootContext:$,positionMethod:a,mounted:G,side:u,sideOffset:d,align:f,alignOffset:g,arrowPadding:v,collisionBoundary:p,collisionPadding:m,sticky:b,disableAnchorTracking:S??ue,collisionAvoidance:C,keepMounted:!0}),le=ue?"none":Y.side,xe=ue?nq:Y.positionerStyles,ve={open:F,side:le,align:Y.align,anchorHidden:Y.anchorHidden};Oe(()=>{A.set("popupSide",Y.side)},[A,Y.side]);const de=A.useStateSetter("positionerElement"),me=Pw(e,ve,{styles:xe,transitionStatus:U,props:T,refs:[n,de],hidden:!G,inert:!F}),Ce=E.useRef(0),Pe=Re(Ee=>{if(L.current.length===0)return;const Ve=Ce.current;if(Ce.current=Ee.size,Ee.size===Ve)return;const Ie=Xe(yr);if(Ve!==0&&!A.state.multiple&&q!==null&&ac(L.current,q,z)===-1){const Ge=H.current,fe=Ge!=null&&ac(L.current,Ge,z)!==-1?Ge:null;_(fe,Ie),fe===null&&(A.set("selectedIndex",null),D.current=null)}if(Ve!==0&&A.state.multiple&&Array.isArray(q)){const He=q.filter(Ge=>ac(L.current,Ge,z)!==-1);He.length!==q.length&&(_(He,Ie),He.length===0&&(A.set("selectedIndex",null),D.current=null))}if(F&&ue){A.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const He={height:""};Hp(te,He),Hp(N.current,He)}}),ze=E.useMemo(()=>({...Y,side:le,alignItemWithTriggerActive:ue,setControlledAlignItemWithTrigger:ee,scrollUpArrowRef:W,scrollDownArrowRef:X}),[Y,le,ue,ee]);return I.jsx(Dm,{elementsRef:O,labelsRef:P,onMapChange:Pe,children:I.jsxs(kP.Provider,{value:ze,children:[G&&j&&I.jsx(Dw,{inert:Im(!F),cutout:J}),me]})})}),Og="base-ui-disable-scrollbar",wx={className:Og,getElement(t){return I.jsx("style",{nonce:t,href:Og,precedence:"base-ui:low",children:`.${Og}{scrollbar-width:none}.${Og}::-webkit-scrollbar{display:none}`})}},NP=E.createContext(void 0);function Nm(t){const e=E.useContext(NP);if(e===void 0&&!t)throw new Error(Un(69));return e}const Cx="ArrowUp",Rx="ArrowDown",Ex="ArrowLeft",Tx="ArrowRight",Ax="Home",Mx="End",zw=new Set([Cx,Rx,Ex,Tx,Ax,Mx]),iq="Shift",oq=[iq,"Control","Alt","Meta"];function sq(t){return fn(t)&&t.tagName==="INPUT"}function IM(t){return!!(sq(t)&&t.selectionStart!=null||fn(t)&&t.tagName==="TEXTAREA")}function DM(t,e,n,r){if(!t||!e||!e.scrollTo)return;let i=t.scrollLeft,s=t.scrollTop;const a=t.clientWidth<t.scrollWidth,u=t.clientHeight<t.scrollHeight;if(a&&r!=="vertical"){const f=PM(t,e,"left"),d=kg(t),g=kg(e);n==="ltr"&&(f+e.offsetWidth+g.scrollMarginRight>t.scrollLeft+t.clientWidth-d.scrollPaddingRight?i=f+e.offsetWidth+g.scrollMarginRight-t.clientWidth+d.scrollPaddingRight:f-g.scrollMarginLeft<t.scrollLeft+d.scrollPaddingLeft&&(i=f-g.scrollMarginLeft-d.scrollPaddingLeft)),n==="rtl"&&(f-g.scrollMarginLeft<t.scrollLeft+d.scrollPaddingLeft?i=f-g.scrollMarginLeft-d.scrollPaddingLeft:f+e.offsetWidth+g.scrollMarginRight>t.scrollLeft+t.clientWidth-d.scrollPaddingRight&&(i=f+e.offsetWidth+g.scrollMarginRight-t.clientWidth+d.scrollPaddingRight))}if(u&&r!=="horizontal"){const f=PM(t,e,"top"),d=kg(t),g=kg(e);f-g.scrollMarginTop<t.scrollTop+d.scrollPaddingTop?s=f-g.scrollMarginTop-d.scrollPaddingTop:f+e.offsetHeight+g.scrollMarginBottom>t.scrollTop+t.clientHeight-d.scrollPaddingBottom&&(s=f+e.offsetHeight+g.scrollMarginBottom-t.clientHeight+d.scrollPaddingBottom)}t.scrollTo({left:i,top:s,behavior:"auto"})}function PM(t,e,n){const r=n==="left"?"offsetLeft":"offsetTop";let i=0;for(;e.offsetParent&&(i+=e[r],e.offsetParent!==t);)e=e.offsetParent;return i}function kg(t){const e=getComputedStyle(t);return{scrollMarginTop:parseFloat(e.scrollMarginTop)||0,scrollMarginRight:parseFloat(e.scrollMarginRight)||0,scrollMarginBottom:parseFloat(e.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(e.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(e.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(e.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(e.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(e.scrollPaddingLeft)||0}}const lq=E.createContext(void 0),aq={disableStyleElements:!1};function uq(){return E.useContext(lq)??aq}const cq={...Fd,...al},fq=E.forwardRef(function(e,n){const{render:r,className:i,style:s,finalFocus:a,...u}=e,{store:f,popupRef:d,onOpenChangeComplete:g,setOpen:p,valueRef:m,firstItemTextRef:v,selectedItemTextRef:b,multiple:S,handleScrollArrowVisibility:w,scrollHandlerRef:C,listRef:R,highlightItemOnHover:T,floatingContext:A}=ll(),{side:O,align:P,alignItemWithTriggerActive:M,isPositioned:D,setControlledAlignItemWithTrigger:L}=IP(),H=Nm(!0)!=null,N=Ud(),{nonce:_,disableStyleElements:$}=uq(),F=pe(f,ft.id),G=pe(f,ft.open),j=pe(f,ft.openMethod),q=pe(f,ft.mounted),V=pe(f,ft.popupProps),te=pe(f,ft.transitionStatus),J=pe(f,ft.triggerElement),z=pe(f,ft.positionerElement),U=pe(f,ft.listElement),W=E.useRef(!1),X=E.useRef(!1),ie=E.useRef({}),ee=xc(),ue=Re(ve=>{if(!z||!d.current||!X.current)return;const de=z.style.top==="0px",me=z.style.bottom==="0px";if(W.current||!M||!de&&!me){w(ve);return}const Ce=NM(z),Pe=Ff(z.getBoundingClientRect().height,"y",Ce),ze=Vt(z),Ee=An(z),Ve=Ee.getComputedStyle(z),Ie=parseFloat(Ve.marginTop),He=parseFloat(Ve.marginBottom),Ge=zM(Ee.getComputedStyle(d.current)),We=Math.min(ze.documentElement.clientHeight-Ie-He,Ge),fe=ve.scrollTop,ne=Ig(ve);let Q=null;const Se=_e=>{z.style.height=`${_e}px`},ge=de?ne-fe:fe,De=Math.min(Pe+ge,We);if(ge<=qs){const _e=Vf(ge,0,We-Pe);_e>0&&Se(Pe+_e),ve.scrollTop=de?ne:0,We-(Pe+_e)<=qs&&(W.current=!0),w(ve);return}if(We-De>qs)Q=de?1/0:0;else if(me&&fe<ne){const _e=Pe+ge-We;Q=fe-(ge-_e)}const Te=Math.ceil(De);if(Te!==0&&Se(Te),Q!=null){const _e=Vf(Q,0,Ig(ve));Math.abs(ve.scrollTop-_e)>qs&&(ve.scrollTop=_e)}Te>=We-qs&&(W.current=!0),w(ve)});E.useImperativeHandle(C,()=>ue,[ue]),fo({open:G,ref:d,onComplete(){G&&g?.(!0)}});const Y={open:G,transitionStatus:te,side:O,align:P};Oe(()=>{!z||!d.current||Object.keys(ie.current).length||(ie.current={top:z.style.top||"0",left:z.style.left||"0",right:z.style.right,height:z.style.height,bottom:z.style.bottom,minHeight:z.style.minHeight,maxHeight:z.style.maxHeight,marginTop:z.style.marginTop,marginBottom:z.style.marginBottom})},[d,z]),Oe(()=>{G||M||(X.current=!1,W.current=!1,Hp(z,ie.current))},[G,M,z,d]),Oe(()=>{const ve=d.current;if(!G||!J||!z||!ve||M&&!D||f.state.transitionStatus==="ending")return;if(X.current=!0,ve.style.removeProperty("--transform-origin"),!M){ee.request(()=>w(U||ve));return}const de=dq(ve);try{let me=b.current;me?.isConnected||(me=!ft.hasSelectedValue(f.state)&&v.current?.isConnected?v.current:null);const Ce=m.current,Pe=An(z),ze=Pe.getComputedStyle(z),Ee=Pe.getComputedStyle(ve),Ve=Vt(J),Ie=NM(J),He=Dg(J.getBoundingClientRect(),Ie),Ge=Dg(z.getBoundingClientRect(),Ie),We=He.height,fe=U||ve,ne=fe.scrollHeight,Q=parseFloat(Ee.borderBottomWidth),Se=parseFloat(ze.marginTop)||10,ge=parseFloat(ze.marginBottom)||10,De=parseFloat(ze.minHeight)||100,Te=zM(Ee),_e=5,nt=5,Mt=20,kt=Ve.documentElement.clientHeight-Se-ge,It=Ve.documentElement.clientWidth,bn=kt-He.bottom+We;let at,Mn=N==="rtl"?He.right-Ge.width:He.left,Qt=0;if(me&&Ce){const Rn=Dg(Ce.getBoundingClientRect(),Ie);at=Dg(me.getBoundingClientRect(),Ie),Mn=Ge.left+(N==="rtl"?Rn.right-at.right:Rn.left-at.left);const Dt=Rn.top-He.top+Rn.height/2;Qt=at.top-Ge.top+at.height/2-Dt}const xn=bn+Qt+ge+Q;let nn=Math.min(kt,xn);const Wt=kt-Se-ge,st=xn-nn,pt=It-nt;z.style.left=`${Vf(Mn,_e,pt-Ge.width)}px`,z.style.height=`${nn}px`,z.style.maxHeight="none",z.style.marginTop=`${Se}px`,z.style.marginBottom=`${ge}px`,ve.style.height="100%";const tt=Ig(fe),Zt=st>=tt-qs;Zt&&(nn=Math.min(kt,Ge.height)-(st-tt));const Hn=He.top<Mt||He.bottom>kt-Mt||Math.ceil(nn)+qs<Math.min(ne,De),jn=(Pe.visualViewport?.scale??1)!==1&&sl;if(Hn||jn){Hp(z,ie.current),L(!1);return}const Jt=Math.max(De,nn);if(Zt){const Rn=Math.max(0,kt-xn);z.style.top=Ge.height>=Wt?"0":`${Rn}px`,z.style.height=`${nn}px`,fe.scrollTop=Ig(fe)}else z.style.bottom="0",fe.scrollTop=st;if(at){const Rn=Ge.top,Dt=Ge.height,Br=at.top+at.height/2,or=Vf(Dt>0?(Br-Rn)/Dt*100:50,0,100);ve.style.setProperty("--transform-origin",`50% ${or}%`)}(Jt===kt||nn>=Te)&&(W.current=!0),w(fe),T&&f.state.selectedIndex===null&&f.state.activeIndex===null&&R.current[0]!=null&&f.set("activeIndex",0)}finally{de()}},[f,G,z,J,m,v,b,d,w,M,L,ee,U,R,T,N,D]),E.useEffect(()=>{if(!M||!z||!G)return;const ve=An(z);function de(me){p(!1,Xe(o6,me))}return Rt(ve,"resize",de)},[p,M,z,G]);const le={...U?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":S||void 0,id:`${F}-list`},onKeyDown(ve){H&&zw.has(ve.key)&&ve.stopPropagation()},onScroll(ve){U||ue(ve.currentTarget)},...M&&{style:U?{height:"100%"}:DP},className:!U&&M?wx.className:void 0},xe=At("div",e,{ref:[n,d],state:Y,stateAttributesMapping:cq,props:[V,le,Pm(te),u]});return I.jsxs(E.Fragment,{children:[!$&&wx.getElement(_),I.jsx(Sw,{context:A,modal:!1,disabled:!q,openInteractionType:j,returnFocus:a,restoreFocus:!0,children:xe})]})});function zM(t){const e=t.maxHeight;return e.endsWith("px")&&parseFloat(e)||1/0}function Ig(t){return CP(t.scrollHeight,t.clientHeight)}function NM(t){return YD.getScale(t)}function Ff(t,e,n){return t/n[e]}function Dg(t,e){return md({x:Ff(t.x,"x",e),y:Ff(t.y,"y",e),width:Ff(t.width,"x",e),height:Ff(t.height,"y",e)})}const LM=[["transform","none"],["scale","1"],["translate","0 0"]];function dq(t){const{style:e}=t,n={};for(const[r,i]of LM)n[r]=e.getPropertyValue(r),e.setProperty(r,i,"important");return()=>{for(const[r]of LM){const i=n[r];i?e.setProperty(r,i):e.removeProperty(r)}}}const hq=E.forwardRef(function(e,n){const{render:r,className:i,style:s,...a}=e,{store:u,scrollHandlerRef:f,multiple:d}=ll(),{alignItemWithTriggerActive:g}=IP(),p=pe(u,ft.hasScrollArrows),m=pe(u,ft.openMethod),b={id:`${pe(u,ft.id)}-list`,role:"listbox","aria-multiselectable":d||void 0,onScroll(w){f.current?.(w.currentTarget)},...g&&{style:DP},className:p&&m!=="touch"?wx.className:void 0},S=u.useStateSetter("listElement");return At("div",e,{ref:[n,S],props:[b,a]})});function Lm(t={}){const{guess:e,label:n,metadata:r,textRef:i,index:s}=t,{register:a,unregister:u,subscribeMapChange:f,nextIndexRef:d}=B$(),g=E.useRef(-1),[p,m]=E.useState(s==null&&e?()=>{if(g.current===-1){const w=d.current;d.current+=1,g.current=w}return g.current}:-1),v=s??p,b=E.useRef(null),S=E.useCallback(w=>{const C=b.current;C&&u(C),b.current=w,w&&a(w,{metadata:r??null,index:s??null,label:n,textRef:i})},[s,a,u,r,n,i]);return Oe(()=>{if(s==null)return f(w=>{const C=b.current?w.get(b.current)?.index:null;C!=null&&m(C)})},[s,f]),{ref:S,index:v}}const LP=E.createContext(void 0);function Nw(){const t=E.useContext(LP);if(!t)throw new Error(Un(57));return t}const gq=E.memo(E.forwardRef(function(e,n){const{render:r,className:i,style:s,value:a=null,label:u,disabled:f=!1,nativeButton:d=!1,...g}=e,p=E.useRef(null),m=Lm({guess:!0,label:u,textRef:p}),{store:v,itemProps:b,setOpen:S,setValue:w,selectionRef:C,typingRef:R,valuesRef:T,multiple:A,selectedItemTextRef:O,disabled:P,readOnly:M}=ll(),D=P||f,L=pe(v,ft.isActive,m.index),H=pe(v,ft.open),N=pe(v,ft.isSelected,a),_=pe(v,ft.isSelectedByFocus,m.index),$=pe(v,ft.isItemEqualToValue),F=m.index,G=E.useRef(null);Oe(()=>{const ee=T.current;return ee[F]=a,()=>{delete ee[F]}},[F,a,T]),Oe(()=>{const ee=v.state.value;let ue=ee;A&&Array.isArray(ee)&&(ue=ee.length>0?ee[ee.length-1]:void 0),ue!==void 0&&uo(a,ue,$)&&(v.set("selectedIndex",F),p.current&&(O.current=p.current))},[F,A,$,v,a,O]);const j=E.useRef("mouse"),q=E.useRef(!1),{getButtonProps:V,buttonRef:te}=ul({disabled:D,focusableWhenDisabled:!0,native:d,composite:!0}),J={disabled:D,selected:N,highlighted:L};function z(ee){if(P||M)return;const ue=v.state.value;if(A){const Y=Array.isArray(ue)?ue:[],le=N?vP(Y,a,$):[...Y,a];w(le,Xe(cp,ee))}else w(a,Xe(cp,ee)),S(!1,Xe(cp,ee))}function U(){C.current.dragY=0}const W={role:"option","aria-selected":N,tabIndex:H&&L?0:-1,onKeyDown(ee){v.set("activeIndex",F),ee.key===" "&&R.current&&ee.preventDefault()},onClick(ee){const ue=j.current!=="touch",Y=ee.nativeEvent.pointerType,le=ue&&aw(ee.nativeEvent)&&(Y!==void 0||L),xe=ue&&!le&&!q.current;q.current=!1,!(D||xe)&&z(ee.nativeEvent)},onPointerEnter(ee){j.current=ee.pointerType},onPointerMove(ee){if(ee.pointerType==="mouse"&&ee.buttons===1){const ue=C.current;ue.dragY+=ee.movementY,ue.dragY**2>=64&&(ue.allowUnselectedMouseUp=!0)}},onPointerDown(ee){j.current=ee.pointerType,q.current=!0,U()},onMouseUp(){if(U(),D||j.current==="touch"||q.current)return;const ee=!C.current.allowSelectedMouseUp&&N,ue=!C.current.allowUnselectedMouseUp&&!N;ee||ue||(q.current=!0,G.current?.click(),q.current=!1)}},X=At("div",e,{ref:[te,n,m.ref,G],state:J,props:[b,W,g,V]}),ie=E.useMemo(()=>({selected:N,index:F,textRef:p,selectedByFocus:_}),[N,F,p,_]);return I.jsx(LP.Provider,{value:ie,children:X})})),pq=E.forwardRef(function(e,n){const{selected:r}=Nw();return e.keepMounted||r?I.jsx(mq,{...e,ref:n}):null}),mq=E.memo(E.forwardRef((t,e)=>{const{render:n,className:r,style:i,keepMounted:s,...a}=t,{selected:u}=Nw(),f=E.useRef(null),{transitionStatus:d,setMounted:g}=ga(u),m=At("span",t,{ref:[e,f],state:{selected:u,transitionStatus:d},props:[{"aria-hidden":!0,children:"✔️"},a],stateAttributesMapping:al});return fo({open:u,ref:f,onComplete(){u||g(!1)}}),m})),yq=E.memo(E.forwardRef(function(e,n){const{index:r,textRef:i,selectedByFocus:s}=Nw(),{firstItemTextRef:a,selectedItemTextRef:u}=ll(),{render:f,className:d,style:g,...p}=e,m=E.useCallback(b=>{b&&(r===0&&(a.current=b),s&&(u.current=b))},[a,u,r,s]);return At("div",e,{ref:[m,n,i],props:p})}));function vq(t,e,n,r,i,s,a,u,f,d=2){const g=v6(n.current,{event:t,orientation:r,loopFocus:i,rtl:s,cols:d,disabledIndices:a,minIndex:u,maxIndex:f,prevIndex:e>f?u:e,stopEvent:!0});return ra(n.current,g)?void 0:g}const BP=E.createContext(void 0),_P=E.createContext(void 0),HP=E.createContext(void 0),jP=E.createContext(!1),VP=E.createContext("");function go(){const t=E.useContext(BP);if(!t)throw new Error(Un(22));return t}function Lw(){const t=E.useContext(_P);if(!t)throw new Error(Un(23));return t}function $d(){const t=E.useContext(HP);if(!t)throw new Error(Un(24));return t}function FP(){return E.useContext(VP)}function bq(){return E.useContext(jP)}const je={id:t=>t.id,selectedValue:t=>t.selectedValue,hasSelectionChips:t=>{const e=t.selectedValue;return Array.isArray(e)&&e.length>0},hasSelectedValue:t=>{const{selectedValue:e,selectionMode:n}=t;return e==null?!1:n==="multiple"&&Array.isArray(e)?e.length>0:!0},open:t=>t.open,mounted:t=>t.mounted,forceMounted:t=>t.forceMounted,inline:t=>t.inline,activeIndex:t=>t.activeIndex,selectedIndex:t=>t.selectedIndex,isActive:(t,e)=>t.activeIndex===e,isSelected:(t,e)=>{const n=t.isItemEqualToValue,r=t.selectedValue;return Array.isArray(r)?r.some(i=>uo(e,i,n)):uo(e,r,n)},transitionStatus:t=>t.transitionStatus,popupProps:t=>t.popupProps,listProps:t=>t.listProps,inputProps:t=>t.inputProps,triggerProps:t=>t.triggerProps,itemProps:t=>t.itemProps,positionerElement:t=>t.positionerElement,listElement:t=>t.listElement,triggerElement:t=>t.triggerElement,inputElement:t=>t.inputElement,inputGroupElement:t=>t.inputGroupElement,popupSide:t=>t.popupSide,openMethod:t=>t.openMethod,inputInsidePopup:t=>t.inputInsidePopup,inputOwnsFormValue:t=>t.inputOwnsFormValue,selectionMode:t=>t.selectionMode,name:t=>t.name,form:t=>t.form,disabled:t=>t.disabled,readOnly:t=>t.readOnly,required:t=>t.required,grid:t=>t.grid,virtualized:t=>t.virtualized,isItemEqualToValue:t=>t.isItemEqualToValue,modal:t=>t.modal,autoHighlight:t=>t.autoHighlight};function xq(t){return t==null?void 0:`${t}-popup`}function Sq(t,e){return(n,r)=>n==null?!1:t.contains(n,r,e)}function UP(t){return Array.isArray(t)?t.map(e=>UP(e)).join(","):t==null?"":String(t)}const BM=new Map;function wq(t={}){const e={usage:"search",sensitivity:"base",ignorePunctuation:!0,...t},n=`${UP(t.locale)}|${JSON.stringify(e)}`,r=BM.get(n);if(r)return r;const i=new Intl.Collator(t.locale,e),s={contains(a,u,f){if(!u)return!0;const d=Zi(a,f);for(let g=0;g<=d.length-u.length;g+=1)if(i.compare(d.slice(g,g+u.length),u)===0)return!0;return!1},startsWith(a,u,f){if(!u)return!0;const d=Zi(a,f);return i.compare(d.slice(0,u.length),u)===0},endsWith(a,u,f){if(!u)return!0;const d=Zi(a,f),g=u.length;return d.length>=g&&i.compare(d.slice(d.length-g),u)===0}};return BM.set(n,s),s}const Cq=wq;function Rq(t,e=!1){const{overflowY:n}=bi(t);return n!=="auto"&&n!=="scroll"?!1:e?t.clientHeight>0:t.scrollHeight>t.clientHeight}const $P=Symbol("none"),K0={value:$P,index:-1};function Eq(t){const{id:e,onOpenChangeComplete:n,defaultSelectedValue:r=null,selectedValue:i,onSelectedValueChange:s,defaultInputValue:a,inputValue:u,open:f,defaultOpen:d=!1,selectionMode:g,onItemHighlighted:p,name:m,form:v,disabled:b=!1,readOnly:S=!1,required:w=!1,inputRef:C,grid:R=!1,items:T,filteredItems:A,filter:O,openOnInputClick:P=!0,autoHighlight:M=!1,keepHighlight:D=!1,highlightItemOnHover:L=!0,loopFocus:H=!0,itemToStringLabel:N,itemToStringValue:_,isItemEqualToValue:$=yP,virtualized:F=!1,inline:G=!1,fillInputOnItemPress:j=!0,modal:q=!1,limit:V=-1,autoComplete:te="list",formAutoComplete:J,locale:z,submitOnItemClick:U=!1}=t,{clearErrors:W}=yu(),{setDirty:X,validityData:ie,setFilled:ee,name:ue,disabled:Y,setTouched:le,setFocused:xe,validationMode:ve,validation:de}=Ho(),me=Ud(),Ce=Om({id:e}),Pe=Cq({locale:z}),[ze,Ee]=E.useState(!1),[Ve,Ie]=E.useState(null),He=E.useRef([]),Ge=E.useRef([]),We=E.useRef(null),fe=E.useRef(null),ne=E.useRef(null),Q=E.useRef(null),Se=E.useRef(null),ge=E.useRef(!0),De=E.useRef(!1),Te=E.useRef(null),_e=E.useRef(null),nt=E.useRef(null),Mt=E.useRef(K0),kt=E.useRef(null),It=E.useRef([]),bn=E.useRef(null),at=Y||b,Mn=ue??m,Qt=g==="multiple",xn=g==="single",nn=u!==void 0||a!==void 0,Wt=T!==void 0,st=A!==void 0;let pt;M==="always"?pt="always":pt=M?"input-change":!1;const[tt,Zt]=Ja({controlled:i,default:Qt?r??Pi:r,name:"Combobox",state:"selectedValue"}),Hn=E.useMemo(()=>O===null?()=>!0:O!==void 0?O:Sq(Pe,N),[O,Pe,N]),jn=Sr(()=>nn?a??"":xn?Zi(tt,N):"").current,[Jt,Rn]=Ja({controlled:u,default:jn,name:"Combobox",state:"inputValue"}),[Dt,Br]=Ja({controlled:f,default:d,name:"Combobox",state:"open"}),or=Ow(T),rt=Ve??String(Jt).trim(),Ut=xn?Zi(tt,N):"",$n=xn&&!ze&&rt!==""&&Ut.length===rt.length&&Pe.contains(Ut,rt),Ln=$n?"":rt,wr=Wt&&st&&$n,rn=E.useMemo(()=>T?or?T.flatMap(ke=>ke.items):T:Pi,[T,or]),Pt=E.useMemo(()=>{if(A&&!wr)return A;if(!T)return Pi;if(or){const Ne=T,$t=[];let Bt=0;for(const en of Ne){if(V>-1&&Bt>=V)break;const Jn=V>-1?V-Bt:1/0,dn=Ln===""?en.items.slice(0,Jn):[];if(Ln!=="")for(const Tr of en.items){if(dn.length>=Jn)break;Hn(Tr,Ln,N)&&dn.push(Tr)}if(dn.length>0){const Tr={...en,items:dn};$t.push(Tr),Bt+=dn.length}}return $t}if(Ln==="")return V>-1?rn.slice(0,V):rn;const ke=[];for(const Ne of rn){if(V>-1&&ke.length>=V)break;Hn(Ne,Ln,N)&&ke.push(Ne)}return ke},[A,wr,T,or,Ln,V,Hn,N,rn]),zt=E.useMemo(()=>or?Pt.flatMap(Ne=>Ne.items):Pt,[Pt,or]),Je=Sr(()=>{let ke=null;return G&&Dt&&Wt&&g!=="none"&&(ke=q0(zt,tt,$,Qt)),new cD({id:Ce,labelId:void 0,selectedValue:tt,open:Dt,items:T,selectionMode:g,listRef:He,labelsRef:Ge,popupRef:We,emptyRef:Se,inputRef:fe,startDismissRef:ne,endDismissRef:Q,keyboardActiveRef:ge,chipsContainerRef:Te,clearRef:_e,valuesRef:It,pointerDownItemRef:bn,selectionEventRef:nt,name:Mn,form:v,disabled:at,readOnly:S,required:w,grid:R,virtualized:F,openOnInputClick:P,itemToStringLabel:N,isItemEqualToValue:$,modal:q,autoHighlight:pt,submitOnItemClick:U,hasInputValue:nn,mounted:!1,forceMounted:!1,transitionStatus:"idle",inline:G,activeIndex:null,selectedIndex:ke,popupProps:{},listProps:{},inputProps:{},triggerProps:{},itemProps:zn,positionerElement:null,listElement:null,popupId:void 0,triggerElement:null,inputElement:null,inputGroupElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,inputOwnsFormValue:g==="none",onOpenChangeComplete:Tn,setOpen:Tn,setInputValue:Tn,setSelectedValue:Tn,setIndices:Tn,handleSelection:Tn,forceMount:Tn,requestSubmit:Tn})}).current,Cr=g==="none"?Jt:tt,_c=E.useMemo(()=>g==="none"?Cr:Array.isArray(tt)?tt.map(ke=>To(ke,_)):To(tt,_),[Cr,_,g,tt]),xs=Re(p),fl=Re(n),Fe=pe(Je,je.activeIndex),Sa=pe(Je,je.selectedIndex),Zn=pe(Je,je.positionerElement),Bi=pe(Je,je.listElement),li=pe(Je,je.triggerElement),ai=pe(Je,je.inputElement),Vn=pe(Je,je.inputGroupElement),sr=pe(Je,je.inline),_r=pe(Je,je.inputInsidePopup),_i=pe(Je,je.inputOwnsFormValue),mo=Fn(li),{mounted:wa,setMounted:Ca,transitionStatus:Ss}=ga(Dt),{openMethod:Ra,triggerProps:yo}=wP(Dt),ws=Re(()=>_c);Mw(_r?mo:fe,Ce,Cr,ws,!at,m);const Zr=Re(()=>{T?Ge.current=zt.map(ke=>Zi(ke,N)):Je.set("forceMounted",!0)}),qn=Re((ke,Ne,$t)=>{if(Ne===-1){if(Mt.current===K0)return;Mt.current=K0}else Mt.current={value:ke,index:Ne};xs(ke,s6($t,void 0,{index:Ne}))}),Hr=Re(ke=>{Je.update(ke);const Ne=ke.activeIndex;if(Ne===void 0)return;const $t=ke.type||yr;Ne===null?qn(void 0,-1,$t):qn(It.current[Ne],Ne,$t)}),Jr=Re((ke,Ne)=>{if(De.current=Ne.reason===ns,t.onInputValueChange?.(ke,Ne),!Ne.isCanceled){if(Ne.reason===Kf){Dt&&Ve!==null&&Ie(null);const $t=Ne.event,Bt=$t.inputType;if($t.type==="compositionend"||Bt!=null&&Bt!==""&&Bt!=="insertReplacementText"){const Jn=ke.trim()!=="";Jn&&Ee(!0),kt.current={hasQuery:Jn};const dn=Je.state.listElement;if(!Je.state.virtualized&&dn){const Tr=We.current;for(const Vr of bc(dn.firstElementChild??dn)){if(!fn(Vr)||(Tr?!Qe(Tr,Vr):Vr.getAttribute("role")==="dialog"))break;if(Rq(Vr)){Vr.scrollTop=0;break}}}Jn&&pt&&Je.state.activeIndex==null&&(Dt||sr)&&Je.set("activeIndex",0)}}else Ne.reason===ns&&ke===""&&Je.state.inputInsidePopup&&(kt.current={hasQuery:!1,selection:!0});Rn(ke)}}),Hi=Re((ke,Ne)=>{if(Dt!==ke&&(Ne.reason===Vd&&Wt&&zt.length===0&&!Se.current&&Ne.allowPropagation(),t.onOpenChange?.(ke,Ne),!Ne.isCanceled&&(ke&&_r&&!sr&&Ve!==null&&(Ee(!1),Ie(null),Jt!==""&&Ne.reason!==Kf&&Jr("",Xe(ns,Ne.event))),!ke&&ze&&(xn?(sr||Ie(rt),rt===""&&Ee(!1)):Qt&&(sr||Ie(rt),_r&&Hr({activeIndex:null}),(!_r||sr)&&Jr("",Xe(ns,Ne.event)))),Br(ke),!ke&&_r&&(Ne.reason===jd||Ne.reason===vm)&&(le(!0),xe(!1),ve==="onBlur")))){const $t=g==="none"?Jt:tt;de.commit($t)}}),Fo=Re((ke,Ne)=>{if(s?.(ke,Ne),Ne.isCanceled)return;Zt(ke),(g==="none"&&We.current&&j||xn&&!Je.state.inputInsidePopup)&&Jr(Zi(ke,N),Xe(Ne.reason,Ne.event))}),Cs=Re((ke,Ne)=>{const $t=Yn(ke),Bt=nt.current??ke;nt.current=null;const en=Xe(cp,Bt),Jn=$t?.closest("a")?.getAttribute("href");if(Jn){Jn.startsWith("#")&&Hi(!1,en);return}if(Qt){const dn=Array.isArray(tt)?tt:[],Vr=a$(dn,Ne,$)?vP(dn,Ne,$):[...dn,Ne];if(Fo(Vr,en),en.isCanceled||!(fe.current?fe.current.value.trim()!=="":!1))return;Je.state.inputInsidePopup?Jr("",Xe(ns,en.event)):Hi(!1,en)}else{if(Fo(Ne,en),en.isCanceled)return;Hi(!1,en)}}),bu=Re(()=>{const ke=de.inputRef.current?.form??Je.state.inputElement?.form;ke&&typeof ke.requestSubmit=="function"&&ke.requestSubmit()}),lr=Re(()=>{if(Ca(!1),fl?.(!1),Ee(!1),Ie(null),Hr(g==="none"?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),Qt&&fe.current&&fe.current.value!==""&&!De.current&&Jr("",Xe(ns)),xn)if(Je.state.inputInsidePopup)fe.current&&fe.current.value!==""&&Jr("",Xe(ns));else{const ke=Zi(tt,N);fe.current&&fe.current.value!==ke&&Jr(ke,Xe(ke===""?ns:yr))}}),dl=E.useMemo(()=>sr&&Zn?{current:Zn.closest('[role="dialog"]')}:We,[sr,Zn]);fo({enabled:!t.actionsRef,open:Dt,ref:dl,onComplete(){Dt||lr()}}),E.useImperativeHandle(t.actionsRef,()=>({unmount:lr}),[lr]),Oe(function(){if(Dt||(bn.current=null,g==="none"))return;const Ne=Wt?rn:It.current;Hr({selectedIndex:q0(Ne,tt,$,Qt)})},[Dt,tt,g,Qt,Wt,rn,$,Hr]),Oe(()=>{T&&(It.current=zt,He.current.length=zt.length)},[T,zt]),Oe(()=>{const ke=kt.current;if(ke){const Tr=Dt||sr||Je.state.positionerElement?.hidden===!1;if(ke.hasQuery)pt&&Tr&&Je.set("activeIndex",0),kt.current=null;else if(String(Jt).trim()===""&&(kt.current=null,Tr)){const Vr=ke.selection;pt==="always"&&!Vr&&Je.state.selectionMode==="none"&&Je.set("activeIndex",0),queueMicrotask(()=>{if(!Je.state.open&&!Je.state.inline||fe.current&&fe.current.value.trim()!=="")return;const wi=Je.state.selectedValue,Sl=Je.state.selectionMode==="multiple",Fr=Sl&&Array.isArray(wi)?wi[wi.length-1]:wi,qo=Je.state.selectionMode!=="none"&&Fr!=null;if(qo||Vr){const xu=Wt||st?zt:It.current;Je.set("activeIndex",qo?q0(xu,wi,Je.state.isItemEqualToValue,Sl):null)}else pt==="always"&&Je.set("activeIndex",0)})}}if(!Dt&&!sr)return;const $t=Wt||st?zt:It.current,Bt=Je.state.activeIndex;if(Bt==null){if(pt==="always"&&$t.length>0){Je.set("activeIndex",0);return}qn(void 0,-1,yr);return}if(Bt>=$t.length){qn(void 0,-1,yr),Je.set("activeIndex",null);return}const en=$t[Bt],Jn=Mt.current.value,dn=Jn!==$P&&uo(en,Jn,Je.state.isItemEqualToValue);(Mt.current.index!==Bt||!dn)&&qn(en,Bt,yr)},[Fe,pt,qn,st,Wt,zt,sr,Dt,Je,Jt]),Oe(()=>{if(g==="none"){ee(String(Jt)!=="");return}ee(Qt?Array.isArray(tt)&&tt.length>0:tt!=null)},[ee,g,Jt,tt,Qt]),E.useEffect(()=>{Wt&&pt&&zt.length===0&&Hr({activeIndex:null})},[Wt,pt,zt.length,Hr]);function Ea(ke){const Ne=ie.initialValue;return Array.isArray(ke)&&Array.isArray(Ne)?!xP(ke,Ne,($t,Bt)=>uo($t,Bt,$)):ke!==Ne}nc(rt,()=>{!Dt||rt===""||rt===String(jn)||Ee(!0)});function Rs(){const ke=Zi(tt,N);Jt!==ke&&Jr(ke,Xe(yr))}nc(tt,()=>{g!=="none"&&(W(Mn),X(Ea(tt)),de.change(tt),xn&&!nn&&!_r&&Rs())}),nc(Jt,()=>{g==="none"&&(W(Mn),X(Jt!==ie.initialValue),de.change(Jt))}),nc(T,()=>{!xn||nn||_r||ze||Rs()});const ui=cP({open:sr?!0:Dt,onOpenChange:Hi,elements:{reference:_r?li:ai,floating:Zn}}),hl=R?"grid":"listbox",Uo=Dt||sr,ji=Uo?"true":"false",Es=E.useMemo(()=>{const ke=ai?.tagName==="INPUT",Ne=ai==null||ke,$t=Ne||Uo,Bt=Ne?{autoComplete:"off",spellCheck:"false",autoCorrect:"off",autoCapitalize:"none"}:{};return $t&&(Bt.role="combobox",Bt["aria-expanded"]=ji,Bt["aria-haspopup"]=hl,Bt["aria-controls"]=Uo?Bi?.id:void 0,Bt["aria-autocomplete"]=te),{reference:Bt,floating:{role:"presentation"}}},[ai,Uo,ji,hl,Bi?.id,te]),gl=ww(ui,{enabled:!S&&!at&&P,event:"mousedown-only",toggle:!1,touchOpenDelay:_r?0:100,reason:yD}),$o=Cm(ui,{enabled:!S&&!at&&!sr,outsidePressEvent:{mouse:"sloppy",touch:"intentional"},bubbles:sr?!0:void 0,outsidePress(ke){const Ne=Yn(ke);return!Qe(li,Ne)&&!Qe(_e.current,Ne)&&!Qe(Te.current,Ne)&&!Qe(Vn,Ne)}}),Si=dP(ui,{enabled:!S&&!at,id:Ce,listRef:He,activeIndex:Fe,selectedIndex:Sa,virtual:!0,loopFocus:H,allowEscape:H&&!pt,focusItemOnOpen:ze||g==="none"&&!pt?!1:"auto",focusItemOnHover:L,resetOnPointerLeave:!D,orientation:R?"horizontal":void 0,rtl:me==="rtl",disabledIndices:Pi,grid:R?vq:void 0,onNavigate(ke,Ne){!Ne&&!Dt||Ss==="ending"||Hr(Ne?{activeIndex:ke,type:ge.current?fw:dw}:{activeIndex:ke})}}),pl=E.useMemo(()=>ko(Si.reference,{onKeyDown(ke){R&&Je.state.activeIndex==null&&(ke.key==="ArrowLeft"||ke.key==="ArrowRight")&&ke.preventBaseUIHandler()}},$o.reference,gl.reference,Es.reference),[Si.reference,$o.reference,gl.reference,Es.reference,R,Je]),ml=E.useMemo(()=>ko(Tm,$o.floating),[$o.floating]),vo=E.useMemo(()=>ko(Si.floating,Es.floating),[Si.floating,Es.floating]),jr=E.useMemo(()=>{const ke=Si.item;return ke?{...ke,onFocus:void 0}:zn},[Si.item]);sD(()=>{Je.update({inline:G,popupProps:ml,listProps:vo,inputProps:pl,triggerProps:yo,itemProps:jr,setOpen:Hi,setInputValue:Jr,setSelectedValue:Fo,setIndices:Hr,handleSelection:Cs,forceMount:Zr,requestSubmit:bu,onOpenChangeComplete:fl})}),Oe(()=>{Je.update({id:Ce,selectedValue:tt,open:Dt,mounted:wa,transitionStatus:Ss,items:T,inline:G,popupProps:ml,listProps:vo,inputProps:pl,triggerProps:yo,openMethod:Ra,itemProps:jr,selectionMode:g,name:Mn,form:v,disabled:at,readOnly:S,required:w,grid:R,virtualized:F,openOnInputClick:P,itemToStringLabel:N,modal:q,autoHighlight:pt,isItemEqualToValue:$,submitOnItemClick:U,hasInputValue:nn,inputOwnsFormValue:g==="none"&&(G||!Je.state.inputInsidePopup)})},[Je,Ce,tt,Dt,wa,Ss,T,ml,vo,pl,jr,Ra,yo,g,Mn,at,S,w,R,F,P,N,q,$,U,nn,G,pt,v]);const yl=tl(C,de.inputRef),vl=E.useMemo(()=>({query:rt,hasItems:Wt,filteredItems:Pt,flatFilteredItems:zt}),[rt,Wt,Pt,zt]),bo=E.useMemo(()=>Array.isArray(Cr)?"":To(Cr,_),[Cr,_]),xo=Qt&&Array.isArray(tt)&&tt.length>0,Ts=Qt||g==="none"&&_i?void 0:Mn,bl=E.useMemo(()=>!Qt||!Array.isArray(tt)||!Mn?null:tt.map(ke=>{const Ne=To(ke,_);return I.jsx("input",{type:"hidden",form:v,name:Mn,value:Ne,disabled:at},Ne)}),[Qt,tt,v,Mn,_,at]),xl=I.jsxs(E.Fragment,{children:[t.children,I.jsx("input",{...de.getValidationProps(at,{onFocus(){if(_r){li?.focus();return}(fe.current||li)?.focus()},onChange(ke){if(ke.nativeEvent.defaultPrevented||at||S)return;const Ne=ke.currentTarget.value,$t=Ne.toLowerCase(),Bt=Xe(yr,ke.nativeEvent),en=()=>It.current.findIndex(dn=>To(dn,_).toLowerCase()===$t||Zi(dn,N).toLowerCase()===$t);function Jn(){if(Qt)return;if(g==="none"){Jr(Ne,Bt);return}let dn=en();dn===-1&&(dn=It.current.findIndex((Vr,wi)=>{const Sl=Ge.current[wi];return Sl!=null&&Sl.toLowerCase()===$t}));const Tr=dn===-1?void 0:It.current[dn];Tr!=null&&Fo?.(Tr,Bt)}xn&&(Zr(),T&&en()===-1&&Je.set("forceMounted",!0)),queueMicrotask(Jn)}}),id:Ce&&Ts==null?`${Ce}-hidden-input`:void 0,form:v,name:Ts,autoComplete:J,disabled:at,required:w&&!xo,readOnly:S,value:bo,ref:yl,style:Ts?JS:ZS,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),bl]});return I.jsx(BP.Provider,{value:Je,children:I.jsx(_P.Provider,{value:ui,children:I.jsx(jP.Provider,{value:Wt,children:I.jsx(HP.Provider,{value:vl,children:I.jsx(VP.Provider,{value:Jt,children:xl})})})})})}function Tq(t){const{multiple:e=!1,defaultValue:n,value:r,onValueChange:i,autoComplete:s,...a}=t;return I.jsx(Eq,{...a,selectionMode:e?"multiple":"single",selectedValue:r,defaultSelectedValue:n,onSelectedValueChange:i,formAutoComplete:s})}const qP={...RP,...mu,popupSide:t=>t?{"data-popup-side":t}:null,listEmpty:t=>t?{"data-list-empty":""}:null},Aq=E.createContext(void 0);function Mq(){return E.useContext(Aq)}const GP=E.createContext(void 0);function Bw(t){const e=E.useContext(GP);if(e===void 0&&!t)throw new Error(Un(21));return e}const WP=E.forwardRef(function(e,n){const r=go(),{buttonRef:i,getButtonProps:s}=ul({native:!1}),a=tl(n,i);function u(d){r.state.setOpen(!1,Xe(mD,d.nativeEvent,d.currentTarget))}const f=s({onClick:u});return I.jsx("span",{ref:a,...f,"aria-label":"Dismiss",tabIndex:void 0,style:JS})});function KP(t){const e=pe(t,je.mounted),n=pe(t,je.popupSide),r=pe(t,je.positionerElement);return e&&r?n:null}function Bm(){return $d().filteredItems.length===0}function Oq(t){return t==="rtl"?["ArrowRight","ArrowLeft"]:["ArrowLeft","ArrowRight"]}function kq(t,e){const n=t>=e-1?e-2:t;return n>=0?n:void 0}function YP(t,e,n){const r=t.state.listRef.current[e];r&&(t.state.selectionEventRef.current=n,r.click(),t.state.selectionEventRef.current=null)}const Iq=E.forwardRef(function(e,n){const{render:r,className:i,disabled:s=!1,id:a,style:u,...f}=e,{state:d,disabled:g,setTouched:p,setFocused:m,validationMode:v,validation:b}=Ho(),{labelId:S}=vs(),w=Mq(),R=!!Bw(!0),T=go(),A=FP(),O=Ud(),P=pe(T,je.required),M=pe(T,je.disabled),D=pe(T,je.readOnly),L=pe(T,je.name),H=pe(T,je.form),N=pe(T,je.selectionMode),_=pe(T,je.autoHighlight),$=pe(T,je.inputProps),F=pe(T,je.triggerProps),G=pe(T,je.open),j=pe(T,je.mounted),q=pe(T,je.selectedValue),V=pe(T,je.id),te=pe(T,je.inline),J=pe(T,je.modal),z=!!_,U=KP(T),W=g||M||s,X=Bm(),ie=R||te,ee=!ie||J,ue=ho(a??(ie?void 0:V)),Y=R?gP:d,[le,xe]=E.useState(null),ve=E.useRef(!1),de=E.useRef(null),me=E.useRef(!1),Ce=N==="none"&&!R,Pe=Re(fe=>{const ne=R||T.state.inline;ne&&!T.state.hasInputValue&&T.state.setInputValue("",Xe(yr)),T.update({inputElement:fe,inputInsidePopup:ne,inputOwnsFormValue:Ce})}),ze=R?f:b.getValidationProps(W,f);function Ee(){T.state.setIndices({activeIndex:null,selectedIndex:null,type:T.state.keyboardActiveRef.current?fw:dw})}function Ve(){T.state.keyboardActiveRef.current=!1}const Ie={...Y,open:G,disabled:W,readOnly:D,popupSide:U,listEmpty:X};function He(fe){if(!w)return;let ne;const{highlightedChipIndex:Q}=w,Se=w.chipsRef.current.length,[ge,De]=Oq(O);return Q!==void 0?(fe.key===ge?(fe.preventDefault(),Q>0?ne=Q-1:ne=void 0):fe.key===De?(fe.preventDefault(),Q<Se-1?ne=Q+1:ne=void 0):(fe.key==="Backspace"||fe.key==="Delete")&&(fe.preventDefault(),ne=kq(Q,q.length),Ee()),ne):(fe.key===ge&&(fe.currentTarget.selectionStart??0)===0&&q.length>0&&(fe.preventDefault(),ne=Se>0?Se-1:void 0),ne)}const Ge=At("input",e,{state:Ie,ref:[n,T.state.inputRef,Pe],props:[$,F,{value:le??A,"aria-readonly":D||void 0,"aria-required":P||void 0,"aria-labelledby":S,disabled:W,readOnly:D,required:N==="none"?P:void 0,form:H,...Ce&&L&&{name:L},id:ue,onFocus(){if(m(!0),!te||!me.current)return;me.current=!1;const fe=de.current;fe==null||!Object.hasOwn(T.state.valuesRef.current,fe)||T.state.setIndices({activeIndex:fe})},onBlur(){p(!0),m(!1);const fe=T.state.activeIndex;if(te&&fe!==null&&_!=="always"&&(de.current=fe,me.current=!0,T.state.setIndices({activeIndex:null})),v==="onBlur"){const ne=N==="none"?A:q;b.commit(ne)}},onCompositionStart(fe){Mp||(ve.current=!0,xe(fe.currentTarget.value))},onCompositionEnd(fe){ve.current=!1;const ne=fe.currentTarget.value;xe(null),T.state.setInputValue(ne,Xe(Kf,fe.nativeEvent))},onChange(fe){const ne=fe.nativeEvent,Q=ne.inputType,Se=!Q||Q==="insertReplacementText",ge=ve.current||!Se;function De(Mt){D||W||!Mt||!ge||(T.state.setOpen(!0,Xe(Kf,ne)),z||Ee())}if(ve.current){const Mt=fe.currentTarget.value;xe(Mt),Mt===""&&!T.state.openOnInputClick&&!T.state.inputInsidePopup&&T.state.setOpen(!1,Xe(ns,ne));const kt=Mt.trim(),It=z&&kt!=="";De(kt),G&&T.state.activeIndex!==null&&!It&&Ee();return}const Te=Xe(Kf,ne);if(T.state.setInputValue(fe.currentTarget.value,Te),Te.isCanceled)return;const _e=fe.currentTarget.value==="",nt=Xe(ns,ne);_e&&!T.state.inputInsidePopup&&(N==="single"&&T.state.setSelectedValue(null,nt),T.state.openOnInputClick||T.state.setOpen(!1,nt)),De(fe.currentTarget.value.trim()),G&&T.state.activeIndex!==null&&!z&&Ee()},onKeyDown(fe){if(W||D||fe.ctrlKey||fe.shiftKey||fe.altKey||fe.metaKey)return;T.state.keyboardActiveRef.current=!0;const ne=fe.currentTarget,Q=ne.scrollWidth-ne.clientWidth,Se=O==="rtl";if(fe.key==="Home"){Dr(fe);const Te=qA&&Se?ne.value.length:0;ne.setSelectionRange(Te,Te),ne.scrollLeft=0;return}if(fe.key==="End"){Dr(fe);const Te=qA&&Se?0:ne.value.length;ne.setSelectionRange(Te,Te),ne.scrollLeft=Se?-Q:Q;return}if(!j&&fe.key==="Escape"){const Te=N==="multiple"&&Array.isArray(q)?q.length===0:q===null,_e=Xe(Vd,fe.nativeEvent),nt=N==="multiple"?[]:null;T.state.setInputValue("",_e),T.state.setSelectedValue(nt,_e),!Te&&!T.state.inline&&!_e.isPropagationAllowed&&fe.stopPropagation();return}if(w&&fe.key==="Backspace"&&ne.value===""&&w.highlightedChipIndex===void 0&&Array.isArray(q)&&q.length>0){const Te=w.chipsRef.current.length,_e=Te>0?Te-1:q.length-1,nt=q.filter((Mt,kt)=>kt!==_e);Ee(),T.state.setSelectedValue(nt,Xe(yr,fe.nativeEvent));return}const ge=w?.highlightedChipIndex!==void 0,De=He(fe);if(w?.setHighlightedChipIndex(De),De!==void 0?w?.chipsRef.current[De]?.focus():ge&&T.state.inputRef.current?.focus(),fe.which!==229&&fe.key==="Enter"&&G){const Te=T.state.activeIndex,_e=fe.nativeEvent;if(Te===null){if(te)return;T.state.setOpen(!1,Xe(yr,_e));return}Dr(fe),YP(T,Te,_e)}},onPointerMove:Ve,onPointerDown:Ve},ze],stateAttributesMapping:qP}),We=R?I.jsx(Aw.Provider,{value:pP,children:Ge}):Ge;return I.jsxs(E.Fragment,{children:[G&&ee&&I.jsx(WP,{ref:T.state.startDismissRef}),We]})});function Dq(t,e,n,r,i){if(t.baseUIHandlerPrevented||r)return;const s=Yn(t.nativeEvent),a=Tt(s)?s:null;a!==t.currentTarget&&(i?.(a)||gD(a))||(t.preventDefault(),!n&&(e.state.inputRef.current?.focus(),e.state.openOnInputClick&&e.state.setOpen(!0,Xe(yD,t.nativeEvent))))}const Pq=E.forwardRef(function(e,n){const{render:r,className:i,style:s,...a}=e,{state:u}=Ho(),f=go(),d=pe(f,je.open),g=pe(f,je.disabled),p=pe(f,je.readOnly),m=pe(f,je.hasSelectedValue),v=pe(f,je.selectionMode),b=KP(f),S=g,w=Bm(),R={...u,open:d,disabled:S,readOnly:p,popupSide:b,listEmpty:w,placeholder:v==="none"?!1:!m},T=Re(A=>{f.set("inputGroupElement",A)});return At("div",e,{ref:[n,T],props:[{role:"group",onMouseDown(A){Dq(A,f,S,p,O=>Qe(f.state.chipsContainerRef.current,O))}},a],state:R,stateAttributesMapping:qP})}),zq=E.createContext(null);function Nq(){return E.useContext(zq)}function Lq(t){const{children:e}=t,{filteredItems:n}=$d(),r=Nq(),i=r?r.items:n;return I.jsx(E.Fragment,{children:i.map(e)})}const Bq=E.forwardRef(function(e,n){var r;const{render:i,className:s,style:a,children:u,...f}=e,d=go(),g=Lw(),p=!!Bw(!0),{filteredItems:m,hasItems:v}=$d(),b=pe(d,je.selectionMode),S=pe(d,je.grid),w=pe(d,je.listProps),C=pe(d,je.virtualized),R=pe(d,je.forceMounted),T=b==="multiple",A=m.length===0,O=Re(_=>{d.set("positionerElement",_)}),P=Re(_=>{d.set("listElement",_)}),M=E.useMemo(()=>typeof u=="function"?r||(r=I.jsx(Lq,{children:u})):u,[u]),D={empty:A},L=g.useState("floatingId"),H=At("div",e,{state:D,ref:[n,P,p?null:O],props:[w,{children:M,tabIndex:-1,id:L,role:S?"grid":"listbox","aria-multiselectable":T?"true":void 0,onKeyDown(_){if(!(d.state.disabled||d.state.readOnly)&&_.key==="Enter"){const $=d.state.activeIndex;if($==null)return;Dr(_),YP(d,$,_.nativeEvent)}},onKeyDownCapture(){d.state.keyboardActiveRef.current=!0},onPointerMoveCapture(){d.state.keyboardActiveRef.current=!1}},f]});if(C)return H;const N=v&&!R?void 0:d.state.labelsRef;return I.jsx(Dm,{elementsRef:d.state.listRef,labelsRef:N,children:H})}),_q="⁠",Hq=200;function jq(t){const e=t.ownerDocument.createTreeWalker(t,NodeFilter.SHOW_TEXT);let n=null;for(;e.nextNode();){const r=e.currentNode;r.nodeValue!==""&&(n=r)}return n}function Vq(){const t=ii(),e=E.useRef(null);return E.useEffect(()=>{if(_d)return;const n=e.current;if(n==null)return;const r=jq(n);if(r==null)return;const i=r.data,s=`${i}${_q}`;return r.nodeValue=s,t.start(Hq,()=>{r.nodeValue===s&&(r.nodeValue=i)}),()=>{t.clear(),r.nodeValue===s&&(r.nodeValue=i)}},[e,t]),e}const XP=E.createContext(void 0);function Fq(){const t=E.useContext(XP);if(t===void 0)throw new Error(Un(20));return t}const Uq=E.forwardRef(function(e,n){const{keepMounted:r=!1,...i}=e,s=go(),a=pe(s,je.mounted),u=pe(s,je.forceMounted);return a||r||u?I.jsx(XP.Provider,{value:r,children:I.jsx(bw,{ref:n,...i})}):null}),$q=E.forwardRef(function(e,n){const{render:r,className:i,anchor:s,positionMethod:a,side:u,align:f,sideOffset:d,alignOffset:g,collisionBoundary:p="clipping-ancestors",collisionPadding:m,arrowPadding:v,sticky:b,disableAnchorTracking:S=!1,collisionAvoidance:w=jD,style:C,...R}=e,T=go(),A=Lw(),O=Fq(),P=pe(T,je.modal),M=pe(T,je.open),D=pe(T,je.mounted),L=pe(T,je.openMethod),H=pe(T,je.positionerElement),N=pe(T,je.triggerElement),_=pe(T,je.inputElement),$=pe(T,je.inputGroupElement),F=pe(T,je.inputInsidePopup),G=pe(T,je.transitionStatus),j=Bm(),V=Iw({anchor:s??(F?N:$??_),floatingRootContext:A,positionMethod:a,mounted:D,side:u,sideOffset:d,align:f,alignOffset:g,arrowPadding:v,collisionBoundary:p,collisionPadding:m,sticky:b,disableAnchorTracking:S,keepMounted:O,collisionAvoidance:w,lazyFlip:!0});zP(M&&P,L==="touch",H,N);const te={open:M,side:V.side,align:V.align,anchorHidden:V.anchorHidden,empty:j};Oe(()=>{T.set("popupSide",V.side)},[T,V.side]);const J=Re(U=>{T.set("positionerElement",U)}),z=Pw(e,te,{styles:V.positionerStyles,transitionStatus:G,props:R,refs:[n,J],hidden:!D,inert:!M});return I.jsxs(GP.Provider,{value:V,children:[D&&P&&I.jsx(Dw,{inert:Im(!M),cutout:$??_??N}),z]})}),qq={...Fd,...al},Gq=E.forwardRef(function(e,n){const{render:r,className:i,style:s,initialFocus:a,finalFocus:u,...f}=e,d=go(),g=Bw(),p=Lw(),m=pe(d,je.mounted),v=pe(d,je.open),b=pe(d,je.openMethod),S=pe(d,je.popupProps),w=pe(d,je.transitionStatus),C=pe(d,je.inputInsidePopup),R=pe(d,je.inputElement),T=pe(d,je.modal),A=pe(d,je.id),O=Bm(),P=f.id??(C?xq(A):void 0);Oe(()=>(d.set("popupId",d.state.popupRef.current?.id||P),()=>{d.set("popupId",void 0)}),[d,P]),fo({open:v,ref:d.state.popupRef,onComplete(){v&&d.state.onOpenChangeComplete(!0)}});const M={open:v,side:g.side,align:g.align,anchorHidden:g.anchorHidden,transitionStatus:w,empty:O},D=At("div",e,{state:M,ref:[n,d.state.popupRef],props:[S,{id:P,role:C?"dialog":"presentation",onFocus($){const F=Yn($.nativeEvent);b!=="touch"&&(Qe(d.state.listElement,F)||F===$.currentTarget)&&d.state.inputRef.current?.focus()}},Pm(w),f],stateAttributesMapping:qq}),H=a===void 0?C?$=>$==="touch"?d.state.popupRef.current:R:!1:a;let N;u!=null?N=u:N=C?void 0:!1;const _=!C||T;return I.jsx(Sw,{context:p,disabled:!m,modal:_,openInteractionType:b,initialFocus:H,returnFocus:N,getInsideElements:()=>[d.state.startDismissRef.current,d.state.endDismissRef.current],children:I.jsxs(E.Fragment,{children:[D,_&&I.jsx(WP,{ref:d.state.endDismissRef})]})})}),Wq=E.forwardRef(function(e,n){const{render:r,className:i,style:s,...a}=e;return At("span",e,{ref:n,props:[{"aria-hidden":!0,children:"▼"},a]})}),QP=E.createContext(void 0);function ZP(){const t=E.useContext(QP);if(!t)throw new Error(Un(19));return t}const Kq=E.createContext(!1);function Yq(){return E.useContext(Kq)}function JP(t){const{componentProps:e,forwardedRef:n,virtualized:r,indexFromFilter:i}=t,{render:s,className:a,style:u,value:f=null,index:d,disabled:g=!1,nativeButton:p=!1,...m}=e,v=E.useRef(null),b=Lm({guess:!0,index:d,textRef:v}),S=go(),w=Yq(),C=bq(),R=pe(S,je.selectionMode),T=pe(S,je.disabled),A=pe(S,je.readOnly),O=pe(S,je.isItemEqualToValue),P=T||g,M=R!=="none",D=d??i??b.index,L=D!==-1,H=pe(S,je.id),N=pe(S,je.isActive,D),_=pe(S,je.isSelected,f),$=pe(S,je.itemProps),F=E.useRef(null),G=H!=null&&L?`${H}-${D}`:void 0,j=_&&M;Oe(()=>{if(!(L&&(r||d!=null)))return;const ie=S.state.listRef.current;return ie[D]=F.current,()=>{delete ie[D]}},[L,r,D,d,S]),Oe(()=>{if(!L||C)return;const X=S.state.valuesRef.current;return X[D]=f,()=>{delete X[D]}},[L,C,D,f,S]),Oe(()=>{if(!L||C)return;const X=S.state.selectedValue,ie=Array.isArray(X)?X[X.length-1]:X;uo(f,ie,O)&&S.set("selectedIndex",D)},[L,C,S,D,f,O]);const{getButtonProps:q,buttonRef:V}=ul({disabled:P,focusableWhenDisabled:!0,native:p,composite:!0}),te={disabled:P,selected:j,highlighted:N};function J(X){function ie(){S.state.handleSelection(X,f)}S.state.submitOnItemClick?(il.flushSync(ie),S.state.requestSubmit()):ie()}const z={id:G,role:w?"gridcell":"option","aria-selected":M?j:void 0,tabIndex:void 0,onPointerDownCapture(X){X.isPrimary&&(S.state.pointerDownItemRef.current=X.currentTarget),X.preventDefault()},onMouseDown(X){X.preventDefault()},onClick(X){P||A||J(X.nativeEvent)},onMouseUp(X){const ie=S.state.pointerDownItemRef.current===X.currentTarget;S.state.pointerDownItemRef.current=null,!(P||A||X.button!==0||ie||!N)&&J(X.nativeEvent)}},U=At("div",e,{ref:[V,n,b.ref,F],state:te,props:[$,z,m,q]}),W=E.useMemo(()=>({selected:j,textRef:v}),[j,v]);return I.jsx(QP.Provider,{value:W,children:U})}function Xq(t){const{componentProps:e,forwardedRef:n}=t,r=go(),i=pe(r,je.isItemEqualToValue),{flatFilteredItems:s}=$d(),a=ac(s,e.value??null,i);return I.jsx(JP,{componentProps:e,forwardedRef:n,virtualized:!0,indexFromFilter:a})}const Qq=E.memo(E.forwardRef(function(e,n){const r=go(),i=pe(r,je.virtualized);return i&&e.index==null?I.jsx(Xq,{componentProps:e,forwardedRef:n}):I.jsx(JP,{componentProps:e,forwardedRef:n,virtualized:i,indexFromFilter:void 0})})),Zq=E.forwardRef(function(e,n){const{selected:r}=ZP();return e.keepMounted||r?I.jsx(Jq,{...e,ref:n}):null}),Jq=E.memo(E.forwardRef((t,e)=>{const{render:n,className:r,style:i,keepMounted:s,...a}=t,{selected:u}=ZP(),f=E.useRef(null),{transitionStatus:d,setMounted:g}=ga(u),m=At("span",t,{ref:[e,f],state:{selected:u,transitionStatus:d},props:[{"aria-hidden":!0,children:"✔️"},a],stateAttributesMapping:al});return fo({open:u,ref:f,onComplete(){u||g(!1)}}),m})),e9=E.forwardRef(function(e,n){const{render:r,className:i,style:s,children:a,...u}=e,{filteredItems:f}=$d(),d=go(),g=Vq(),p=f.length===0?a:null;return At("div",e,{ref:[n,d.state.emptyRef,g],props:[{children:p,role:"status","aria-live":"polite","aria-atomic":!0},u]})}),t9={...al,...km},n9=E.forwardRef(function(e,n){const{render:r,className:i,disabled:s=!1,nativeButton:a=!0,keepMounted:u=!1,style:f,...d}=e,{disabled:g}=Ho(),p=go(),m=pe(p,je.selectionMode),v=pe(p,je.disabled),b=pe(p,je.readOnly),S=pe(p,je.open),w=pe(p,je.selectedValue),C=pe(p,je.hasSelectionChips),R=FP();let T=!1;m==="none"?T=R!=="":m==="single"?T=w!=null:T=C;const A=g||v||s,{buttonRef:O,getButtonProps:P}=ul({native:a,disabled:A}),{mounted:M,transitionStatus:D,setMounted:L}=ga(T),H={disabled:A,visible:T,open:S,transitionStatus:D};fo({open:T,ref:p.state.clearRef,onComplete(){T||L(!1)}});const N=At("button",e,{state:H,ref:[n,O,p.state.clearRef],props:[{tabIndex:-1,children:"x",onMouseDown($){$.preventDefault()},onClick($){if(A||b)return;const F=p.state.keyboardActiveRef.current?fw:dw;p.state.setInputValue("",Xe(WA,$.nativeEvent)),m!=="none"?(p.state.setSelectedValue(Array.isArray(w)?[]:null,Xe(WA,$.nativeEvent)),p.state.setIndices({activeIndex:null,selectedIndex:null,type:F})):p.state.setIndices({activeIndex:null,type:F}),p.state.inputRef.current?.focus()}},d,P],stateAttributesMapping:t9});return u||M?N:null}),ez=E.createContext(void 0);function cl(t){const e=E.useContext(ez);if(!t&&e===void 0)throw new Error(Un(27));return e}const r9=E.forwardRef(function(e,n){const{render:r,className:i,style:s,forceRender:a=!1,...u}=e,f=cl(),d=f.useState("open"),g=f.useState("nested"),p=f.useState("mounted"),m=f.useState("transitionStatus");return At("div",e,{state:{open:d,transitionStatus:m},ref:[f.context.backdropRef,n],stateAttributesMapping:EP,props:[{role:"presentation",hidden:!p,style:{userSelect:"none",WebkitUserSelect:"none"}},u],enabled:a||!g})}),tz=E.forwardRef(function(e,n){const{render:r,className:i,style:s,disabled:a=!1,nativeButton:u=!0,...f}=e,d=cl(),g=d.useState("open"),{getButtonProps:p,buttonRef:m}=ul({disabled:a,native:u}),v={disabled:a};function b(S){g&&d.setOpen(!1,Xe(mD,S.nativeEvent))}return At("button",e,{state:v,ref:[n,m],props:[{onClick:b},f,p]})}),i9=E.forwardRef(function(e,n){const{render:r,className:i,style:s,id:a,...u}=e,f=cl(),d=ho(a);return f.useSyncedValueWithCleanup("descriptionElementId",d),At("p",e,{ref:n,props:[{id:d},u]})}),nz=E.createContext(void 0);function rz(){const t=E.useContext(nz);if(t===void 0)throw new Error(Un(26));return t}const iz={...Fd,...al,nestedDialogOpen(t){return t?{"data-nested-dialog-open":""}:null}},o9=E.forwardRef(function(e,n){const{render:r,className:i,style:s,finalFocus:a,initialFocus:u,...f}=e,d=cl(),g=d.useState("descriptionElementId"),p=d.useState("disablePointerDismissal"),m=d.useState("floatingRootContext"),v=d.useState("popupProps"),b=d.useState("modal"),S=d.useState("mounted"),w=d.useState("nested"),C=d.useState("nestedOpenDialogCount"),R=d.useState("open"),T=d.useState("openMethod"),A=d.useState("titleElementId"),O=d.useState("transitionStatus"),P=d.useState("role"),M=m.useState("floatingId");rz(),fo({open:R,ref:d.context.popupRef,onComplete(){R&&d.context.onOpenChangeComplete?.(!0)}});const D=u===void 0?VU(d.context.popupRef):u,L=C>0,H=d.useStateSetter("popupElement"),_=At("div",e,{state:{open:R,nested:w,transitionStatus:O,nestedDialogOpen:L},props:[v,{id:M,"aria-labelledby":A,"aria-describedby":g,role:P,...Tm,hidden:!S,onKeyDown($){zw.has($.key)&&$.stopPropagation()},style:{"--nested-dialogs":C}},f],ref:[n,d.context.popupRef,H],stateAttributesMapping:iz});return I.jsx(Sw,{context:m,openInteractionType:T,disabled:!S,closeOnFocusOut:!p,initialFocus:D,returnFocus:a,modal:b!==!1,restoreFocus:"popup",children:_})}),s9=E.forwardRef(function(e,n){const{keepMounted:r=!1,...i}=e,s=cl(),a=s.useState("mounted"),u=s.useState("modal"),f=s.useState("open");return a||r?I.jsx(nz.Provider,{value:r,children:I.jsxs(bw,{ref:n,...i,children:[a&&u===!0&&I.jsx(Dw,{ref:s.context.internalBackdropRef,inert:Im(!f)}),e.children]})}):null});function l9({store:t,parentContext:e,isDrawer:n}){const r=t.useState("open"),i=t.useState("disablePointerDismissal"),s=t.useState("modal"),a=t.useState("popupElement"),u=t.useState("floatingRootContext"),[f,d]=E.useState(0),[g,p]=E.useState(0),m=f===0,v=Cm(u,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:s==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(b){if(!t.context.outsidePressEnabledRef.current||"button"in b&&b.button!==0)return!1;if("touches"in b){if(b.type==="touchend"){if(b.changedTouches.length!==1||b.touches.length!==0)return!1}else if(b.touches.length!==1)return!1}const S=Yn(b);if(m&&!i){if(s){const w=t.context.internalBackdropRef.current,C=t.context.backdropRef.current;return w||C?w===S||C===S||Qe(S,a)&&!S?.hasAttribute("data-base-ui-portal"):!0}return!0}return!1},escapeKey:m});return PP(r&&s===!0,a),t.useContextCallback("onNestedDialogOpen",(b,S)=>{d(b),p(S)}),Oe(()=>(e?.onNestedDialogOpen&&(r?e.onNestedDialogOpen(f+1,g+(n?1:0)):e.onNestedDialogOpen(0,0)),()=>{e?.onNestedDialogOpen&&r&&e.onNestedDialogOpen(0,0)}),[n,r,f,g,e]),iP(t,{activeTriggerProps:v.reference,inactiveTriggerProps:v.trigger,popupProps:v.floating,nestedOpenDialogCount:f,nestedOpenDrawerCount:g}),null}const a9={...aP,modal:t=>t.modal,nested:t=>t.nested,nestedOpenDialogCount:t=>t.nestedOpenDialogCount,nestedOpenDrawerCount:t=>t.nestedOpenDrawerCount,disablePointerDismissal:t=>t.disablePointerDismissal,openMethod:t=>t.openMethod,descriptionElementId:t=>t.descriptionElementId,titleElementId:t=>t.titleElementId,viewportElement:t=>t.viewportElement,role:t=>t.role};class u9 extends fm{constructor(e,n,r){const i=new Am,s=c9(e,i,n,r);super(s,f9(i),a9)}setOpen=(e,n)=>{if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!e&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,n),n.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,n);const r={open:e};eP(r,e,n.trigger),this.update(r)}}function c9(t,e,n,r=!1){const i={...oP(),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...t};return i.floatingRootContext=sP(e,n,r),i}function f9(t){return{popupRef:E.createRef(),backdropRef:E.createRef(),internalBackdropRef:E.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:t,onOpenChange:void 0,onOpenChangeComplete:void 0}}function d9(t,e){const{children:n,open:r,defaultOpen:i=!1,onOpenChange:s,onOpenChangeComplete:a,disablePointerDismissal:u=!1,modal:f=!0,actionsRef:d,handle:g,triggerId:p,defaultTriggerId:m=null}=e,v=t==="drawer",b=f,S=u,w="dialog",C=cl(!0),R=C!=null,T={modal:b,disablePointerDismissal:S,nested:R,role:w},A=ZD((H,N)=>new u9({open:i,openProp:r,activeTriggerId:m,triggerIdProp:p,...T},H,N),!0);A.useControlledProp("openProp",r),A.useControlledProp("triggerIdProp",p),A.useSyncedValues(T),A.useContextCallback("onOpenChange",s),A.useContextCallback("onOpenChangeComplete",a);const O=A.useState("open"),P=A.useState("mounted"),M=A.useState("payload");qU(A,O),nP(A);const{forceUnmount:D}=rP(O,A);E.useImperativeHandle(d,()=>({unmount:D,close:()=>A.setOpen(!1,Xe(bD))}),[D,A]);const L=O||P;return I.jsxs(ez.Provider,{value:A,children:[g&&I.jsx(JD,{handle:g,store:A}),L&&I.jsx(l9,{store:A,parentContext:C?.context,isDrawer:v}),typeof n=="function"?n({payload:M}):n]})}function h9(t){return d9("dialog",t)}const g9=E.forwardRef(function(e,n){const{render:r,className:i,style:s,children:a,...u}=e,f=rz(),d=cl(),g=d.useState("open"),p=d.useState("nested"),m=d.useState("transitionStatus"),v=d.useState("nestedOpenDialogCount"),b=d.useState("mounted"),S=d.useStateSetter("viewportElement"),w=v>0;return At("div",e,{enabled:f||b,state:{open:g,nested:p,transitionStatus:m,nestedDialogOpen:w},ref:[n,S],stateAttributesMapping:iz,props:[{role:"presentation",hidden:!b,style:{pointerEvents:g?void 0:"none"},children:a},u]})}),p9=E.forwardRef(function(e,n){const{render:r,className:i,style:s,id:a,...u}=e,f=cl(),d=ho(a);return f.useSyncedValueWithCleanup("titleElementId",d),At("h2",e,{ref:n,props:[{id:d},u]})}),m9=E.forwardRef(function(e,n){const{render:r,className:i,style:s,disabled:a=!1,nativeButton:u=!0,id:f,payload:d,handle:g,...p}=e,m=cl(!0),b=uP(g)??m;if(!b)throw new Error(Un(79));const S=ho(f),w=b.useState("floatingRootContext"),C=b.useState("isOpenedByTrigger",S),R=b.useState("triggerPopupId",S),T=E.useRef(null),{registerTrigger:A,isMountedByThisTrigger:O}=tP(S,T,b,{payload:d}),{getButtonProps:P,buttonRef:M}=ul({disabled:a,native:u}),D=ww(w),L=SP(()=>b.select("open"),_=>{b.set("openMethod",_)}),H={disabled:a,open:C},N=b.useState("triggerProps",O);return At("button",e,{state:H,ref:[M,n,A,T],props:[D.reference,N,L,{[HD]:"",id:S,"aria-haspopup":"dialog","aria-expanded":C,"aria-controls":R},p,P],stateAttributesMapping:km})}),oz=E.createContext(void 0);function _m(t){const e=E.useContext(oz);if(e===void 0&&!t)throw new Error(Un(72));return e}const y9={...aP,disabled:t=>t.disabled,instantType:t=>t.instantType,isInstantPhase:t=>t.isInstantPhase,trackCursorAxis:t=>t.trackCursorAxis,disableHoverablePopup:t=>t.disableHoverablePopup,lastOpenChangeReason:t=>t.openChangeReason,closeOnClick:t=>t.closeOnClick,closeDelay:t=>t.closeDelay,adaptiveOrigin:t=>t.adaptiveOrigin};class v9 extends fm{constructor(e,n,r){const i=new Am;super(b9(e,i,n,r),x9(i),y9)}setOpen=(e,n)=>{$U(this,e,n,{extraState:{openChangeReason:n.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,Xe(Hd,e))}}function b9(t,e,n,r=!1){const i={...oP(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...t};return i.floatingRootContext=sP(e,n,r),i}function x9(t){return{popupRef:E.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:t}}const S9=uD(function(e){const{disabled:n=!1,defaultOpen:r=!1,open:i,disableHoverablePopup:s=!1,trackCursorAxis:a="none",actionsRef:u,onOpenChange:f,onOpenChangeComplete:d,handle:g,triggerId:p,defaultTriggerId:m=null,children:v}=e,b=ZD((N,_)=>new v9({open:r,openProp:i,activeTriggerId:m,triggerIdProp:p},N,_));b.useControlledProp("openProp",i),b.useControlledProp("triggerIdProp",p),b.useContextCallback("onOpenChange",f),b.useContextCallback("onOpenChangeComplete",d);const S=b.useState("open"),w=!n&&S,C=b.useState("activeTriggerId"),R=b.useState("mounted"),T=b.useState("payload");b.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:s,disabled:n}),nP(b,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:A,transitionStatus:O}=rP(w,b),P=b.useState("isInstantPhase"),M=b.useState("instantType"),D=b.useState("lastOpenChangeReason"),L=E.useRef(null);Oe(()=>{S&&n&&b.setOpen(!1,Xe(vD))},[S,n,b]),Oe(()=>{O==="ending"&&D===yr||O!=="ending"&&P?(M!=="delay"&&(L.current=M),b.set("instantType","delay")):L.current!==null&&(b.set("instantType",L.current),L.current=null)},[O,P,D,M,b]),Oe(()=>{w&&C==null&&b.set("payload",void 0)},[b,C,w]),E.useImperativeHandle(u,()=>({unmount:A,close:()=>b.setOpen(!1,Xe(bD))}),[A,b]);const H=w||R||!n&&a!=="none";return I.jsxs(oz.Provider,{value:b,children:[g&&I.jsx(JD,{handle:g,store:b}),H&&I.jsx(w9,{store:b,disabled:n,trackCursorAxis:a}),typeof v=="function"?v({payload:T}):v]})});function w9({store:t,disabled:e,trackCursorAxis:n}){const r=t.useState("floatingRootContext"),i=Cm(r,{enabled:!e,referencePress:()=>t.select("closeOnClick")}),s=Q6(r,{enabled:!e&&n!=="none",axis:n==="none"?void 0:n}),a=E.useMemo(()=>ko(s.reference,i.reference),[s.reference,i.reference]);return iP(t,{activeTriggerProps:a,inactiveTriggerProps:a,popupProps:i.floating??zn}),null}const sz=E.createContext(void 0);function C9(){return E.useContext(sz)}const _M=600,lz="data-base-ui-tooltip-trigger";function HM(t){if("composedPath"in t){const n=t.composedPath();for(let r=0;r<n.length;r+=1){const i=n[r];if(Tt(i))return i}}const e=t.target;return Tt(e)?e:null}function R9(t){let e=t;for(;e;){const n=e.closest(`[${lz}]`);if(n)return n;const r=e.getRootNode();e="host"in r&&Tt(r.host)?r.host:null}return null}const E9=z8(function(e,n){const{render:r,className:i,style:s,handle:a,payload:u,disabled:f,delay:d,closeOnClick:g=!0,closeDelay:p,id:m,...v}=e,b=_m(!0),w=uP(a)??b;if(!w)throw new Error(Un(82));const C=ho(m),R=w.useState("isTriggerActive",C),T=w.useState("isOpenedByTrigger",C),A=w.useState("floatingRootContext"),O=E.useRef(null),P=d??_M,M=p??0,{registerTrigger:D,isMountedByThisTrigger:L}=tP(C,O,w,{payload:u,closeOnClick:g,closeDelay:M}),H=C9(),{delayRef:N,isInstantPhase:_,hasProvider:$}=u6(A,{open:T}),F=Tw(A);w.useSyncedValue("isInstantPhase",_);const G=w.useState("disabled"),j=f??G,q=Fn(j),V=w.useState("trackCursorAxis"),te=w.useState("disableHoverablePopup"),J=E.useRef(!1),z=ii(),U=E.useRef(void 0);function W(){return $?oa(N.current,"open")===0?0:d??H??_M:P}function X(me){const Ce=O.current;if(!Ce||!me)return!1;const Pe=R9(me);return Pe!==null&&Pe!==Ce&&Qe(Ce,Pe)}function ie(me){const Ce=X(me);return J.current=Ce,Ce&&(F.openChangeTimeout.clear(),F.restTimeout.clear(),F.restTimeoutPending=!1,z.clear()),Ce}const ee=JU(A,{enabled:!j,mouseOnly:!0,move:!1,handleClose:!te&&V!=="both"?s$():null,restMs:W,delay(){return p==null&&$?{close:oa(N.current,"close")}:{close:M}},triggerElementRef:O,isActiveTrigger:R,isClosing:()=>w.select("transitionStatus")==="ending",shouldOpen(){return!J.current}}),ue=XU(A,{enabled:!j}).reference,Y=me=>{const Ce=J.current,Pe=HM(me),ze=ie(Pe),Ee=O.current,Ve=Ee&&Pe&&Qe(Ee,Pe);if(ze&&w.select("open")&&w.select("lastOpenChangeReason")===mi){w.setOpen(!1,Xe(mi,me));return}if(Ce&&!ze&&Ve&&!q.current&&!w.select("open")&&Ee&&na(U.current)){const Ie=()=>{!J.current&&!q.current&&!w.select("open")&&w.setOpen(!0,Xe(mi,me,Ee))},He=W();He===0?(z.clear(),Ie()):z.start(He,Ie)}},le=w.useState("triggerProps",L);return At("button",e,{state:{open:T},ref:[n,D,O],props:[ee,ue,L||V!=="none"?le:void 0,{onMouseOver(me){Y(me.nativeEvent)},onFocus(me){X(HM(me.nativeEvent))&&me.preventBaseUIHandler()},onMouseLeave(){J.current=!1,z.clear(),U.current=void 0},onPointerEnter(me){U.current=me.pointerType},onPointerDown(me){U.current=me.pointerType,w.set("closeOnClick",g),g&&!w.select("open")&&w.cancelPendingOpen(me.nativeEvent)},onClick(me){g&&!w.select("open")&&w.cancelPendingOpen(me.nativeEvent)},id:C,"data-trigger-disabled":j?"":void 0,[lz]:j?void 0:""},v],stateAttributesMapping:km})}),az=E.createContext(void 0);function T9(){const t=E.useContext(az);if(t===void 0)throw new Error(Un(70));return t}const A9=E.forwardRef(function(e,n){const{children:r,container:i,className:s,render:a,style:u,...f}=e,{node:d,subtree:g}=UD({container:i,ref:n,componentProps:e,elementProps:f});return!g&&!d?null:I.jsxs(E.Fragment,{children:[g,d&&il.createPortal(r,d)]})}),M9=E.forwardRef(function(e,n){const{keepMounted:r=!1,...i}=e;return _m().useState("mounted")||r?I.jsx(az.Provider,{value:r,children:I.jsx(A9,{ref:n,...i})}):null}),uz=E.createContext(void 0);function O9(){const t=E.useContext(uz);if(t===void 0)throw new Error(Un(71));return t}const k9=E.forwardRef(function(e,n){const{render:r,className:i,anchor:s,positionMethod:a="absolute",side:u="top",align:f="center",sideOffset:d=0,alignOffset:g=0,collisionBoundary:p="clipping-ancestors",collisionPadding:m=5,arrowPadding:v=5,sticky:b=!1,disableAnchorTracking:S=!1,collisionAvoidance:w=F6,style:C,...R}=e,T=_m(),A=T9(),O=T.useState("open"),P=T.useState("mounted"),M=T.useState("trackCursorAxis"),D=T.useState("disableHoverablePopup"),L=T.useState("floatingRootContext"),H=T.useState("instantType"),N=T.useState("transitionStatus"),_=T.useState("adaptiveOrigin"),$=Iw({anchor:s,positionMethod:a,floatingRootContext:L,mounted:P,side:u,sideOffset:d,align:f,alignOffset:g,collisionBoundary:p,collisionPadding:m,sticky:b,arrowPadding:v,disableAnchorTracking:S,keepMounted:A,collisionAvoidance:w,adaptiveOrigin:_}),F=E.useMemo(()=>({open:O,side:$.side,align:$.align,anchorHidden:$.anchorHidden,instant:M!=="none"?"tracking-cursor":H}),[O,$.side,$.align,$.anchorHidden,M,H]),G=Pw(e,F,{styles:$.positionerStyles,transitionStatus:N,props:R,refs:[n,T.useStateSetter("positionerElement")],hidden:!P,inert:!O||M==="both"||D});return I.jsx(uz.Provider,{value:$,children:G})}),I9=E.forwardRef(function(e,n){const{render:r,className:i,style:s,...a}=e,u=_m(),{side:f,align:d}=O9(),g=u.useState("open"),p=u.useState("instantType"),m=u.useState("transitionStatus"),v=u.useState("popupProps"),b=u.useState("floatingRootContext"),S=u.useState("disabled"),w=u.useState("closeDelay");fo({open:g,ref:u.context.popupRef,onComplete(){g&&u.context.onOpenChangeComplete?.(!0)}}),QU(b,{enabled:!S,closeDelay:w});const C=u.useStateSetter("popupElement");return At("div",e,{state:{open:g,side:f,align:d,instant:p,transitionStatus:m},ref:[n,u.context.popupRef,C],props:[Tm,v,Pm(m),a],stateAttributesMapping:EP})}),D9=function(e){const{delay:n,closeDelay:r,timeout:i=400}=e,s=E.useMemo(()=>({open:n,close:r}),[n,r]);return I.jsx(sz.Provider,{value:n,children:I.jsx(a6,{delay:s,timeoutMs:i,children:e.children})})},cz=E.createContext(void 0);function _w(){const t=E.useContext(cz);if(t===void 0)throw new Error(Un(64));return t}const Hm={tabActivationDirection:t=>({"data-activation-direction":t})},P9=E.forwardRef(function(e,n){const{className:r,defaultValue:i=0,onValueChange:s,orientation:a="horizontal",render:u,value:f,style:d,...g}=e,p=e.defaultValue!==void 0,m=E.useRef([]),[v,b]=E.useState(()=>new Map),[S,w]=Ja({controlled:f,default:i,name:"Tabs",state:"value"}),C=f!==void 0,[R,T]=E.useState(()=>new Map),A=E.useRef(void 0),O=E.useCallback(Y=>Ox(R,Y),[R]),[P,M]=E.useState(()=>({previousValue:S,tabActivationDirection:"none"})),{previousValue:D,tabActivationDirection:L}=P;let H=L,N=!1;D!==S&&(H=jM(D,S,a,R),N=D!=null&&S!=null&&O(S)==null);const _=N?D:S,$=D!==_||L!==H;Oe(()=>{$&&M({previousValue:_,tabActivationDirection:H})},[_,$,H]);const F=Re((Y,le)=>{const xe=jM(S,Y,a,R);le.activationDirection=xe,s?.(Y,le),!le.isCanceled&&w(Y)}),G=Re((Y,le)=>{s?.(Y,Xe(le,void 0,void 0,{activationDirection:"none"}))}),j=Re((Y,le)=>(b(xe=>{const ve=new Map(xe);return ve.set(Y,le),ve}),()=>{b(xe=>{if(xe.get(Y)!==le)return xe;const ve=new Map(xe);return ve.delete(Y),ve})})),q=E.useCallback(Y=>v.get(Y),[v]),V=E.useCallback(Y=>{for(const le of R.values())if(Y===le.value)return le.id},[R]),te=E.useMemo(()=>({getTabElementBySelectedValue:O,getTabIdByPanelValue:V,getTabPanelIdByValue:q,onValueChange:F,orientation:a,registerMountedTabPanel:j,setTabMap:T,tabActivationDirection:H,value:S}),[O,V,q,F,a,j,T,H,S]),J=E.useMemo(()=>{for(const Y of R.values())if(Y.value===S)return Y},[R,S]),z=E.useMemo(()=>{for(const Y of R.values())if(!Y.disabled)return Y.value},[R]),U=E.useRef(!p),W=E.useRef(i),X=E.useRef(p),ie=E.useRef(!1);Oe(()=>{if(C)return;function Y(de,me){w(de),M({previousValue:de,tabActivationDirection:"none"}),G(de,me),U.current=!1}if(R.size===0){ie.current&&S!==null&&!A.current?.isConnected&&Y(null,YA);return}ie.current=!0,A.current=R.keys().next().value;const le=J?.disabled,xe=J==null&&S!==null;if(!le&&S===W.current&&(X.current=!1),X.current&&le&&S===W.current)return;const ve=U.current;if(le||xe){const de=z??null;if(S===de){U.current=!1;return}let me=YA;ve?me=XA:le&&(me=vD),Y(de,me);return}ve&&J!=null&&(G(S,XA),U.current=!1)},[z,C,G,J,w,R,S]);const ue=At("div",e,{state:{orientation:a,tabActivationDirection:H},ref:n,props:g,stateAttributesMapping:Hm});return I.jsx(cz.Provider,{value:te,children:I.jsx(Dm,{elementsRef:m,children:ue})})});function Ox(t,e){for(const[n,r]of t.entries())if(e===r.value)return n;return null}function jM(t,e,n,r){if(t==null||e==null)return"none";const[i,s,a]=n==="horizontal"?["left","left","right"]:["top","up","down"],u=Ox(r,t),f=Ox(r,e);if(u==null||f==null)return u!==f&&(typeof t=="number"||typeof t=="string")&&typeof t==typeof e?e>t?a:s:"none";const d=u.getBoundingClientRect()[i],g=f.getBoundingClientRect()[i];return g<d?s:g>d?a:"none"}const fz="data-composite-item-active";function dz(t={}){const{highlightItemOnHover:e,highlightedIndex:n,onHighlightedIndexChange:r}=kw(),{ref:i,index:s}=Lm(t),a=n===s,u=E.useRef(null),f=tl(i,u);return{compositeProps:{tabIndex:a?0:-1,onFocus(){r(s)},onMouseMove(){const g=u.current;if(!e||!g)return;const p=g.hasAttribute("disabled")||g.ariaDisabled==="true";!a&&!p&&g.focus()}},compositeRef:f,index:s}}const hz=E.createContext(void 0);function z9(){const t=E.useContext(hz);if(t===void 0)throw new Error(Un(65));return t}const N9=E.forwardRef(function(e,n){const{className:r,disabled:i=!1,render:s,value:a,id:u,nativeButton:f=!0,style:d,...g}=e,{value:p,getTabPanelIdByValue:m,onValueChange:v,orientation:b,tabActivationDirection:S}=_w(),{activateOnFocus:w,registerTabResizeObserverElement:C,tabsListElement:R}=z9(),{highlightedIndex:T,onHighlightedIndexChange:A}=kw(),O=ho(u),P=E.useMemo(()=>({disabled:i,id:O,value:a}),[i,O,a]),{compositeProps:M,compositeRef:D,index:L}=dz({metadata:P}),H=a===p,N=E.useRef(!1),_=E.useRef(null),$=Re(ie=>{_.current?.(),_.current=ie?C(ie):null});Oe(()=>{if(N.current){N.current=!1;return}if(!(H&&L>-1&&T!==L))return;const ie=R;if(ie!=null){const ee=Gr(Vt(ie));if(ee&&Qe(ie,ee))return}i||A(L)},[H,L,T,A,i,R]);const{getButtonProps:F,buttonRef:G}=ul({disabled:i,native:f,focusableWhenDisabled:!0}),j=m(a),q=E.useRef(!1),V=E.useRef(!1);function te(ie){v(a,Xe(yr,ie.nativeEvent,void 0,{activationDirection:"none"}))}function J(ie){H||i||te(ie)}function z(ie){H||i||w&&(!q.current||V.current)&&te(ie)}function U(ie){if(H||i)return;q.current=!0,V.current=ie.button===0;const ee=Vt(ie.currentTarget);function ue(){q.current=!1,V.current=!1,ee.removeEventListener("pointerup",ue),ee.removeEventListener("pointercancel",ue)}ee.addEventListener("pointerup",ue),ee.addEventListener("pointercancel",ue)}return At("button",e,{state:{disabled:i,active:H,orientation:b,tabActivationDirection:S},ref:[n,G,D,$],props:[M,{role:"tab","aria-controls":j,"aria-selected":H,id:O,onClick:J,onFocus:z,onPointerDown:U,[fz]:H?"":void 0,onKeyDownCapture(){N.current=!0}},g,F],stateAttributesMapping:Hm})}),L9={...Hm,...al},B9=E.forwardRef(function(e,n){const{className:r,value:i,render:s,keepMounted:a=!1,style:u,...f}=e,{value:d,getTabIdByPanelValue:g,orientation:p,tabActivationDirection:m,registerMountedTabPanel:v}=_w(),b=ho(),{ref:S,index:w}=Lm(),C=i===d,{mounted:R,transitionStatus:T,setMounted:A}=ga(C),O=!R,P=g(i),M={hidden:O,orientation:p,tabActivationDirection:m,transitionStatus:T},D=E.useRef(null),L=At("div",e,{state:M,ref:[n,S,D],props:[{"aria-labelledby":P,hidden:O,id:b,role:"tabpanel",tabIndex:C?0:-1,inert:Im(!C),"data-index":w},f],stateAttributesMapping:L9});return fo({open:C,ref:D,onComplete(){C||A(!1)}}),Oe(()=>{if(!(b==null||O&&!a))return v(i,b)},[O,a,i,b,v]),a||R?L:null}),_9=[];function H9(t){const{loopFocus:e=!0,orientation:n="both",grid:r,onLoop:i,direction:s,highlightedIndex:a,onHighlightedIndexChange:u,rootRef:f,enableHomeAndEndKeys:d=!1,stopEventPropagation:g,disabledIndices:p,modifierKeys:m=_9}=t,[v,b]=E.useState(0),S=r!=null,w=E.useRef(null),C=tl(w,f),R=E.useRef([]),T=E.useRef(!1),A=a??v,O=Re((H,N=!1)=>{if((u??b)(H),N){const _=R.current[H];DM(w.current,_,s,n)}}),P=Re(H=>{if(H.size===0||T.current)return;T.current=!0;const N=Array.from(H.keys()),_=N.find(F=>F?.hasAttribute(fz))??null,$=_?H.get(_)?.index??-1:-1;if($!==-1)O($);else if(wc(N,A,p)){const F=Er(N,{disabledIndices:p});ra(N,F)||O(F)}DM(w.current,_,s,n)});Oe(()=>{if(p==null||a!=null||!T.current)return;const H=R.current;if(wc(H,A,p)){const N=Er(H,{disabledIndices:p});ra(H,N)||O(N)}},[p,a,A,R,O]);const M=Re((H,N,_)=>i?i(H,N,_,R):_),D=Re(H=>{const N=H.key===Ax||H.key===Mx;if(!zw.has(H.key)||!d&&N||j9(H,m)||!w.current)return;const $=s==="rtl",F=$?Ex:Tx,G=$?Tx:Ex,j=n==="vertical"?Rx:F,q=n==="vertical"?Cx:G,V=Yn(H.nativeEvent);if(V!=null&&IM(V)&&!lD(V)){const X=V.selectionStart,ie=V.selectionEnd,ee=V.value;if(X==null||H.shiftKey||X!==ie||H.key!==q&&X<ee.length||H.key!==j&&X>0)return}let te=A;const J=fp(R,p),z=yx(R,p);r!=null&&(te=r({disabledIndices:p,elementsRef:R,event:H,highlightedIndex:A,loopFocus:e,maxIndex:z,minIndex:J,onLoop:M,orientation:n,rtl:$}));const U=n!=="vertical"&&H.key===F||n!=="horizontal"&&H.key===Rx,W=n!=="vertical"&&H.key===G||n!=="horizontal"&&H.key===Cx;d&&(H.key===Ax?te=J:H.key===Mx&&(te=z)),te===A&&(U||W)&&(e&&te===z&&U?(te=J,i&&(te=i(H,A,te,R))):e&&te===J&&W?(te=z,i&&(te=i(H,A,te,R))):te=Er(R.current,{startingIndex:te,decrement:W,disabledIndices:p})),te!==A&&!ra(R.current,te)&&(g&&H.stopPropagation(),(S||N||U||W)&&H.preventDefault(),O(te,!0),queueMicrotask(()=>{R.current[te]?.focus()}))});return{props:{ref:C,onFocus(H){const N=w.current,_=Yn(H.nativeEvent);!N||_==null||!IM(_)||_.setSelectionRange(0,_.value.length)},onKeyDown:D},highlightedIndex:A,onHighlightedIndexChange:O,elementsRef:R,onMapChange:P,relayKeyboardEvent:D}}function j9(t,e){for(const n of oq)if(!e.includes(n)&&t.getModifierState(n))return!0;return!1}function gz(t){const{render:e,className:n,style:r,refs:i=Pi,props:s=Pi,state:a=zn,stateAttributesMapping:u,highlightedIndex:f,onHighlightedIndexChange:d,orientation:g,grid:p,loopFocus:m,onLoop:v,enableHomeAndEndKeys:b,onMapChange:S,stopEventPropagation:w=!0,rootRef:C,disabledIndices:R,modifierKeys:T,highlightItemOnHover:A=!1,tag:O="div",...P}=t,M=Ud(),{props:D,highlightedIndex:L,onHighlightedIndexChange:H,elementsRef:N,onMapChange:_,relayKeyboardEvent:$}=H9({grid:p,loopFocus:m,onLoop:v,orientation:g,highlightedIndex:f,onHighlightedIndexChange:d,rootRef:C,stopEventPropagation:w,enableHomeAndEndKeys:b,direction:M,disabledIndices:R,modifierKeys:T}),F=At(O,t,{state:a,ref:i,props:[D,...s,P],stateAttributesMapping:u}),G=E.useMemo(()=>({highlightedIndex:L,onHighlightedIndexChange:H,highlightItemOnHover:A,relayKeyboardEvent:$}),[L,H,A,$]);return I.jsx(TP.Provider,{value:G,children:I.jsx(Dm,{elementsRef:N,onMapChange:j=>{S?.(j),_(j)},children:F})})}const V9=E.forwardRef(function(e,n){const{activateOnFocus:r=!1,className:i,loopFocus:s=!0,render:a,style:u,...f}=e,{orientation:d,setTabMap:g,tabActivationDirection:p}=_w(),[m,v]=E.useState(0),[b,S]=E.useState(null),w=E.useRef(new Set),C=E.useRef(new Set),R=E.useRef(null);Oe(()=>{if(typeof ResizeObserver>"u")return;const D=new ResizeObserver(()=>{w.current.forEach(L=>{L()})});return R.current=D,b&&D.observe(b),C.current.forEach(L=>{D.observe(L)}),()=>{D.disconnect(),R.current=null}},[b]);const T=Re(D=>(w.current.add(D),()=>{w.current.delete(D)})),A=Re(D=>(C.current.add(D),R.current?.observe(D),()=>{C.current.delete(D),R.current?.unobserve(D)})),O={orientation:d,tabActivationDirection:p},P={"aria-orientation":d==="vertical"?"vertical":void 0,role:"tablist"},M=E.useMemo(()=>({activateOnFocus:r,registerIndicatorUpdateListener:T,registerTabResizeObserverElement:A,tabsListElement:b}),[r,T,A,b]);return I.jsx(hz.Provider,{value:M,children:I.jsx(gz,{render:a,className:i,style:u,state:O,refs:[n,S],props:[P,f],stateAttributesMapping:Hm,highlightedIndex:m,enableHomeAndEndKeys:!0,loopFocus:s,orientation:d,onHighlightedIndexChange:v,onMapChange:g,disabledIndices:Pi})})}),F9=E.createContext(void 0);function U9(t=!1){const e=E.useContext(F9);if(!e&&!t)throw new Error(Un(86));return e}const $9=function(e){const n=ho(),r=e.controlId===void 0?n:e.controlId,[i,s]=E.useState(r),[a,u]=E.useState(e.labelId),[f,d]=E.useState([]),g=Sr(()=>new Map),{messageIds:p}=vs(),m=Re((S,w)=>{const C=g.current;if(w===void 0){C.delete(S);return}C.set(S,w),s(R=>{if(C.size===0)return;let T;for(const A of C.values()){if(R!==void 0&&A===R)return R;T===void 0&&(T=A)}return T})}),v=E.useCallback(S=>{const w=S["aria-describedby"]?S["aria-describedby"].split(" "):[];return w.push(...p,...f),{...S,"aria-describedby":Array.from(new Set(w)).join(" ")||void 0}},[p,f]),b=E.useMemo(()=>({controlId:i,registerControlId:m,labelId:a,setLabelId:u,messageIds:f,setMessageIds:d,getDescriptionProps:v}),[i,m,a,u,f,d,v]);return I.jsx(mP.Provider,{value:b,children:e.children})};function kx(t,e){return{...t,state:{...t.state,valid:!e&&t.state.valid}}}const Y0=Object.keys(vd);function q9(t,e){return t.matches(":disabled")?!1:!e||t.form===e?!0:t.form===null&&!t.hasAttribute("form")}function VM(t,e){let n=null;for(const r of t.keys())if(q9(r,e)){if(!r.validity.valid)return r;n??=r}return n}function FM(t,e){for(const n of e.keys())n.setCustomValidity("");t?.setCustomValidity("")}function G9(t){const{elementRef:e,formRef:n}=yu(),{setValidityData:r,validate:i,validityData:s,validationDebounceTime:a,invalid:u,markedDirtyRef:f,state:d,shouldValidateOnChange:g,registeredFieldIdRef:p}=t,{controlId:m,getDescriptionProps:v}=vs(),b=ii(),S=E.useRef(null),w=Sr(()=>new Map).current,C=E.useRef(0),R=E.useCallback((M,D)=>(w.set(M,D),()=>{w.delete(M)}),[w]),T=Re(()=>{const M=VM(w,e.current);return M&&w.get(M)?.controlRef.current||null}),A=Re(async(M,D=!1)=>{C.current+=1;const L=C.current;function H(J,z=u){const U=p.current??m;if(U==null)return;const W=n.current.fields.get(U);if(!W)return;const X=kx(J,z);n.current.fields.set(U,{...W,validityData:X})}function N(J,z){const U={value:M,state:{...vd,valid:!0},error:"",errors:[],initialValue:s.initialValue};FM(J,w),H(U,z),r(U)}const _=w.size>0?VM(w,e.current):S.current;if(D){if(d.valid!==!1||!_)return;const J=_.validity;if(!J.valueMissing){N(_,!1);return}for(const z of Y0)if(z!=="valid"&&z!=="valueMissing"&&z!=="customError"&&J[z])return}function $(J){const z=Y0.reduce((W,X)=>(W[X]=J.validity[X],W),{});let U=!1;for(const W of Y0)if(W!=="valid"){if(W==="valueMissing"&&z[W])U=!0;else if(z[W])return z}return U&&!f.current&&(z.valid=!0,z.valueMissing=!1),z}b.clear();let F=null,G=[];const j=_?$(_):{...vd,valid:!0};let q;const V=g();if(_&&_.validationMessage&&!V)q=_.validationMessage,G=[_.validationMessage];else{const J=Array.from(n.current.fields.values()).reduce((U,W)=>(W.name&&(U[W.name]=W.getValue()),U),{}),z=i(M,J);if(typeof z=="object"&&z!==null&&"then"in z){if(F=await z,L!==C.current)return}else F=z;F!==null?(j.valid=!1,j.customError=!0,Array.isArray(F)?(G=F,_?.setCustomValidity(F.join(`
18
- `))):F&&(G=[F],_?.setCustomValidity(F))):V&&(FM(_,w),j.customError=!1,_&&_.validationMessage?(q=_.validationMessage,G=[_.validationMessage]):(!_||_.validity.valid)&&!j.valid&&(j.valid=!0))}const te={value:M,state:j,error:q??(Array.isArray(F)?F[0]:F??""),errors:G,initialValue:s.initialValue};H(te),r(te)}),O=Re(M=>{b.clear();const D=g();D&&M!==""&&a?(C.current+=1,b.start(a,()=>{A(M)})):A(M,!D)}),P=E.useCallback((M,D={})=>ko(v(D),d.valid===!1&&!d.disabled&&!M?{"aria-invalid":!0}:zn),[v,d.disabled,d.valid]);return E.useMemo(()=>({getValidationProps:P,inputRef:S,registeredInputs:w,registerInput:R,getInputControl:T,commit:A,change:O}),[P,w,R,T,A,O])}function W9(t){const{commit:e,invalid:n,markedDirtyRef:r,name:i,setRegisteredFieldName:s,registeredFieldIdRef:a,setValidityData:u,validityData:f}=t,{formRef:d}=yu(),g=E.useRef(null),p=E.useRef(null),m=E.useRef(!1),v=Re(()=>{const A=p.current;if(A)return A.getValue?A.getValue():A.value});function b(A){return A.value===void 0?v():A.value}const S=Re(()=>{const A=p.current;if(r.current=!0,!A){e(f.value);return}e(b(A))});function w(){const A=p.current;!A||!A.id||d.current.fields.set(A.id,{getValue:v,name:i??A.name,controlRef:A.controlRef,validityData:kx(f,n),validate:S})}function C(A=p.current?.id){A&&d.current.fields.delete(A)}function R(A){if(m.current)return;m.current=!0;const O=b(A);u(P=>P.initialValue===O?P:{...P,initialValue:O})}Oe(()=>{const A=p.current;!A||!A.id||(s(i?void 0:A.name),d.current.fields.set(A.id,{getValue:v,name:i??A.name,controlRef:A.controlRef,validityData:kx(f,n),validate:S}))},[d,v,n,i,s,S,f]),Oe(()=>{const A=d.current.fields;return()=>{const O=p.current?.id;O&&A.delete(O)}},[d]);const T=Re((A,O)=>{if(!O){g.current===A&&(g.current=null,C(),p.current=null,s(void 0),a.current=void 0);return}const P=p.current?.id;g.current=A,p.current=O,i||s(O.name),a.current=O.id,P&&P!==O.id&&C(P),R(O),w()});return[S,T]}const K9=E.forwardRef(function(e,n){const{errors:r,validationMode:i,submitAttemptedRef:s}=yu(),{render:a,className:u,validate:f,validationDebounceTime:d=0,validationMode:g=i,name:p,disabled:m=!1,invalid:v,dirty:b,touched:S,actionsRef:w,style:C,...R}=e,T=U9(!0)?.disabled,A=Re(f||(()=>null)),O=T||m,[P,M]=E.useState(!1),[D,L]=E.useState(!1),[H,N]=E.useState(!1),[_,$]=E.useState(!1),F=b??D,G=S??P,j=E.useRef(F),q=E.useRef(void 0),[V,te]=E.useState(),J=p??V;Oe(()=>{b!==void 0&&(j.current=b)},[b]);const z=Re(ze=>{b===void 0&&(ze&&(j.current=!0),L(ze))}),U=Re(ze=>{S===void 0&&M(ze)}),W=Re(()=>g==="onChange"||g==="onSubmit"&&s.current),X=J&&Object.hasOwn(r,J)?r[J]:null,ie=!!(Array.isArray(X)?X.length:X),ee=v===!0||ie,[ue,Y]=E.useState({state:vd,error:"",errors:[],value:null,initialValue:null}),le=!ee&&(O?null:ue.state.valid),xe=E.useMemo(()=>({disabled:O,touched:G,dirty:F,valid:le,filled:H,focused:_}),[O,G,F,le,H,_]),ve=G9({setValidityData:Y,validate:A,validityData:ue,validationDebounceTime:d,invalid:ee,markedDirtyRef:j,state:xe,shouldValidateOnChange:W,registeredFieldIdRef:q}),[de,me]=W9({commit:ve.commit,invalid:ee,markedDirtyRef:j,name:p,setRegisteredFieldName:te,registeredFieldIdRef:q,setValidityData:Y,validityData:ue});E.useImperativeHandle(w,()=>({validate:de}),[de]);const Ce=E.useMemo(()=>({invalid:ee,name:J,validityData:ue,setValidityData:Y,disabled:O,setTouched:U,setDirty:z,setFilled:N,setFocused:$,validationMode:g,shouldValidateOnChange:W,state:xe,registerFieldControl:me,validation:ve}),[ee,J,ue,O,U,z,N,$,g,W,xe,me,ve]),Pe=At("div",e,{ref:n,state:xe,props:R,stateAttributesMapping:mu});return I.jsx(Aw.Provider,{value:Ce,children:Pe})}),Y9=E.forwardRef(function(e,n){return I.jsx($9,{children:I.jsx(K9,{...e,ref:n})})}),X9=E.createContext({disabled:!1});function pz(){return E.useContext(X9)}const Q9=E.forwardRef(function(e,n){const{render:r,className:i,style:s,id:a,nativeLabel:u=!0,...f}=e,d=Ho(!1),g=pz(),{labelId:p}=vs(),m={...d.state,disabled:d.disabled||g.disabled},v=E.useRef(null),b=m$({id:p??a,native:u});return At("label",e,{ref:[n,v],state:m,props:[b,f],stateAttributesMapping:mu})}),Z9={...mu,...al},J9=E.forwardRef(function(e,n){const{render:r,id:i,className:s,match:a,style:u,...f}=e,d=ho(i),{validityData:g,state:p,name:m}=Ho(!1),{setMessageIds:v}=vs(),{errors:b}=yu(),S=m&&Object.hasOwn(b,m)?b[m]:null,w=!!(Array.isArray(S)?S.length:S),C=typeof a=="string";let R=!1;a===!0?R=!0:p.disabled?R=!1:C?R=!!g.state[a]:R=w||g.state.valid===!1;const{mounted:T,transitionStatus:A,setMounted:O}=ga(R);Oe(()=>{if(!(!R||!d))return v(j=>j.concat(d)),()=>{v(j=>j.filter(q=>q!==d))}},[R,d,v]);const P=E.useRef(null),[M,D]=E.useState(null),[L,H]=E.useState(null);let N=g.error;!C&&w?N=S:g.errors.length>1&&(N=g.errors);let _=N;Array.isArray(N)&&(_=N.length>1?I.jsx("ul",{children:N.map(j=>I.jsx("li",{children:j},j))}):N[0]);const $=Array.isArray(N)?JSON.stringify(N):N;R&&$!==L&&(H($),D(_)),fo({open:R,ref:P,onComplete(){R||O(!1)}});const F={...p,transitionStatus:A},G=At("div",e,{ref:[n,P],state:F,props:[{id:d,children:R?_:M},f],stateAttributesMapping:Z9,enabled:T});return T?G:null}),e2=E.forwardRef(function(e,n){const{render:r,id:i,className:s,style:a,...u}=e,f=ho(i),d=Ho(!1),g=pz(),{setMessageIds:p}=vs(),m={...d.state,disabled:d.disabled||g.disabled};return Oe(()=>{if(f)return p(b=>b.concat(f)),()=>{p(b=>b.filter(S=>S!==f))}},[f,p]),At("p",e,{ref:n,state:m,props:[{id:f},u],stateAttributesMapping:mu})}),t2=E.forwardRef(function(e,n){const{render:r,className:i,id:s,name:a,value:u,disabled:f=!1,onValueChange:d,defaultValue:g,autoFocus:p=!1,style:m,...v}=e,{state:b,name:S,disabled:w,setTouched:C,setDirty:R,validityData:T,setFocused:A,setFilled:O,validationMode:P,validation:M}=Ho(),{clearErrors:D}=yu(),L=w||f,H=S??a,N={...b,disabled:L},{labelId:_}=vs(),$=Om({id:s});Oe(()=>{const J=u!=null;M.inputRef.current?.value||J&&u!==""?O(!0):J&&u===""&&O(!1)},[M.inputRef,O,u]);const F=E.useRef(null);Oe(()=>{p&&F.current===Gr(Vt(F.current))&&A(!0)},[p,A]);const[G]=Ja({controlled:u,default:g,name:"FieldControl",state:"value"}),j=u!==void 0,q=j?G:void 0,V=Re(()=>M.inputRef.current?.value);return Mw(M.inputRef,$,q,V,!L,a),At("input",e,{ref:[n,F],state:N,props:[{id:$,disabled:L,name:H,ref:M.inputRef,"aria-labelledby":_,autoFocus:p,...j?{value:q}:{defaultValue:g},onChange(J){const z=J.currentTarget.value;d?.(z,Xe(yr,J.nativeEvent)),R(z!==(T.initialValue??"")),O(z!==""),J.nativeEvent.defaultPrevented||(D(H),M.change(z))},onFocus(){A(!0)},onBlur(J){C(!0),A(!1),P==="onBlur"&&M.commit(J.currentTarget.value)},onKeyDown(J){J.currentTarget.tagName==="INPUT"&&J.key==="Enter"&&(C(!0),M.commit(J.currentTarget.value))}},v,J=>M.getValidationProps(L,J)],stateAttributesMapping:mu})}),n2=E.forwardRef(function(e,n){const{className:r,render:i,orientation:s="horizontal",style:a,...u}=e;return At("div",e,{state:{orientation:s},ref:n,props:[{role:"separator","aria-orientation":s},u]})}),r2=E.forwardRef(function(e,n){const i=Nm().orientation==="vertical"?"horizontal":"vertical";return I.jsx(n2,{orientation:i,...e,ref:n})}),i2=E.forwardRef(function(e,n){const{disabled:r=!1,loopFocus:i,orientation:s="horizontal",className:a,render:u,style:f,...d}=e,[g,p]=E.useState(()=>new Map),m=E.useMemo(()=>{const w=[];for(const C of g.values())C.disabled&&!C.focusableWhenDisabled&&w.push(C.index);return w},[g]),v=E.useMemo(()=>({disabled:r,orientation:s}),[r,s]),b={disabled:r,orientation:s},S={"aria-orientation":s,role:"toolbar"};return I.jsx(NP.Provider,{value:v,children:I.jsx(gz,{render:u,className:a,style:f,state:b,refs:[n],props:[S,d],disabledIndices:m,loopFocus:i,onMapChange:p,orientation:s})})}),mz=E.createContext(void 0);function o2(){return E.useContext(mz)}const s2=E.forwardRef(function(e,n){const{className:r,disabled:i=!1,render:s,style:a,...u}=e,{orientation:f,disabled:d}=Nm(),g=d||i,p=E.useMemo(()=>({disabled:g}),[g]),v=At("div",e,{state:{disabled:g,orientation:f},ref:n,props:[{role:"group"},u]});return I.jsx(mz.Provider,{value:p,children:v})});function l2(t){const{render:e,className:n,style:r,state:i=zn,props:s=Pi,refs:a=Pi,metadata:u,stateAttributesMapping:f,tag:d="div",...g}=t,{compositeProps:p,compositeRef:m}=dz({metadata:u});return At(d,t,{state:i,ref:[m,...a],props:[p,...s,g],stateAttributesMapping:f})}const a2=E.forwardRef(function(e,n){const{className:r,disabled:i=!1,focusableWhenDisabled:s=!0,render:a,nativeButton:u,style:f,...d}=e,{disabled:g,orientation:p}=Nm(),m=o2(),v=g||(m?.disabled??!1)||i,b=E.useMemo(()=>({disabled:v,focusableWhenDisabled:s}),[v,s]),{getButtonProps:S,buttonRef:w}=ul({disabled:v,focusableWhenDisabled:s,native:u}),C={disabled:v,orientation:p,focusable:s};return I.jsx(l2,{tag:"button",render:a,className:r,style:f,metadata:b,state:C,refs:[n,w],props:[d,a?{disabled:v}:zn,S]})}),UM=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,$M=CI,yz=(t,e)=>n=>{var r;if(e?.variants==null)return $M(t,n?.class,n?.className);const{variants:i,defaultVariants:s}=e,a=Object.keys(i).map(d=>{const g=n?.[d],p=s?.[d];if(g===null)return null;const m=UM(g)||UM(p);return i[d][m]}),u=n&&Object.entries(n).reduce((d,g)=>{let[p,m]=g;return m===void 0||(d[p]=m),d},{}),f=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((d,g)=>{let{class:p,className:m,...v}=g;return Object.entries(v).every(b=>{let[S,w]=b;return Array.isArray(w)?w.includes({...s,...u}[S]):{...s,...u}[S]===w})?[...d,p,m]:d},[]);return $M(t,a,f,n?.class,n?.className)};function Xl(t,e){return typeof t=="function"?t(e):t}function Ni(t,e){return n=>{e.setState(r=>({...r,[t]:Xl(n,r[t])}))}}function jm(t){return t instanceof Function}function u2(t){return Array.isArray(t)&&t.every(e=>typeof e=="number")}function c2(t,e){const n=[],r=i=>{i.forEach(s=>{n.push(s);const a=e(s);a!=null&&a.length&&r(a)})};return r(t),n}function dt(t,e,n){let r=[],i;return s=>{let a;n.key&&n.debug&&(a=Date.now());const u=t(s);if(!(u.length!==r.length||u.some((g,p)=>r[p]!==g)))return i;r=u;let d;if(n.key&&n.debug&&(d=Date.now()),i=e(...u),n==null||n.onChange==null||n.onChange(i),n.key&&n.debug&&n!=null&&n.debug()){const g=Math.round((Date.now()-a)*100)/100,p=Math.round((Date.now()-d)*100)/100,m=p/16,v=(b,S)=>{for(b=String(b);b.length<S;)b=" "+b;return b};console.info(`%c⏱ ${v(p,5)} /${v(g,5)} ms`,`
19
- font-size: .6rem;
20
- font-weight: bold;
21
- color: hsl(${Math.max(0,Math.min(120-120*m,120))}deg 100% 31%);`,n?.key)}return i}}function ht(t,e,n,r){return{debug:()=>{var i;return(i=t?.debugAll)!=null?i:t[e]},key:!1,onChange:r}}function f2(t,e,n,r){const i=()=>{var a;return(a=s.getValue())!=null?a:t.options.renderFallbackValue},s={id:`${e.id}_${n.id}`,row:e,column:n,getValue:()=>e.getValue(r),renderValue:i,getContext:dt(()=>[t,n,e,s],(a,u,f,d)=>({table:a,column:u,row:f,cell:d,getValue:d.getValue,renderValue:d.renderValue}),ht(t.options,"debugCells"))};return t._features.forEach(a=>{a.createCell==null||a.createCell(s,n,e,t)},{}),s}function d2(t,e,n,r){var i,s;const u={...t._getDefaultColumnDef(),...e},f=u.accessorKey;let d=(i=(s=u.id)!=null?s:f?typeof String.prototype.replaceAll=="function"?f.replaceAll(".","_"):f.replace(/\./g,"_"):void 0)!=null?i:typeof u.header=="string"?u.header:void 0,g;if(u.accessorFn?g=u.accessorFn:f&&(f.includes(".")?g=m=>{let v=m;for(const S of f.split(".")){var b;v=(b=v)==null?void 0:b[S]}return v}:g=m=>m[u.accessorKey]),!d)throw new Error;let p={id:`${String(d)}`,accessorFn:g,parent:r,depth:n,columnDef:u,columns:[],getFlatColumns:dt(()=>[!0],()=>{var m;return[p,...(m=p.columns)==null?void 0:m.flatMap(v=>v.getFlatColumns())]},ht(t.options,"debugColumns")),getLeafColumns:dt(()=>[t._getOrderColumnsFn()],m=>{var v;if((v=p.columns)!=null&&v.length){let b=p.columns.flatMap(S=>S.getLeafColumns());return m(b)}return[p]},ht(t.options,"debugColumns"))};for(const m of t._features)m.createColumn==null||m.createColumn(p,t);return p}const $r="debugHeaders";function qM(t,e,n){var r;let s={id:(r=n.id)!=null?r:e.id,column:e,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const a=[],u=f=>{f.subHeaders&&f.subHeaders.length&&f.subHeaders.map(u),a.push(f)};return u(s),a},getContext:()=>({table:t,header:s,column:e})};return t._features.forEach(a=>{a.createHeader==null||a.createHeader(s,t)}),s}const h2={createTable:t=>{t.getHeaderGroups=dt(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,r,i)=>{var s,a;const u=(s=r?.map(p=>n.find(m=>m.id===p)).filter(Boolean))!=null?s:[],f=(a=i?.map(p=>n.find(m=>m.id===p)).filter(Boolean))!=null?a:[],d=n.filter(p=>!(r!=null&&r.includes(p.id))&&!(i!=null&&i.includes(p.id)));return Pg(e,[...u,...d,...f],t)},ht(t.options,$r)),t.getCenterHeaderGroups=dt(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,r,i)=>(n=n.filter(s=>!(r!=null&&r.includes(s.id))&&!(i!=null&&i.includes(s.id))),Pg(e,n,t,"center")),ht(t.options,$r)),t.getLeftHeaderGroups=dt(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left],(e,n,r)=>{var i;const s=(i=r?.map(a=>n.find(u=>u.id===a)).filter(Boolean))!=null?i:[];return Pg(e,s,t,"left")},ht(t.options,$r)),t.getRightHeaderGroups=dt(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.right],(e,n,r)=>{var i;const s=(i=r?.map(a=>n.find(u=>u.id===a)).filter(Boolean))!=null?i:[];return Pg(e,s,t,"right")},ht(t.options,$r)),t.getFooterGroups=dt(()=>[t.getHeaderGroups()],e=>[...e].reverse(),ht(t.options,$r)),t.getLeftFooterGroups=dt(()=>[t.getLeftHeaderGroups()],e=>[...e].reverse(),ht(t.options,$r)),t.getCenterFooterGroups=dt(()=>[t.getCenterHeaderGroups()],e=>[...e].reverse(),ht(t.options,$r)),t.getRightFooterGroups=dt(()=>[t.getRightHeaderGroups()],e=>[...e].reverse(),ht(t.options,$r)),t.getFlatHeaders=dt(()=>[t.getHeaderGroups()],e=>e.map(n=>n.headers).flat(),ht(t.options,$r)),t.getLeftFlatHeaders=dt(()=>[t.getLeftHeaderGroups()],e=>e.map(n=>n.headers).flat(),ht(t.options,$r)),t.getCenterFlatHeaders=dt(()=>[t.getCenterHeaderGroups()],e=>e.map(n=>n.headers).flat(),ht(t.options,$r)),t.getRightFlatHeaders=dt(()=>[t.getRightHeaderGroups()],e=>e.map(n=>n.headers).flat(),ht(t.options,$r)),t.getCenterLeafHeaders=dt(()=>[t.getCenterFlatHeaders()],e=>e.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ht(t.options,$r)),t.getLeftLeafHeaders=dt(()=>[t.getLeftFlatHeaders()],e=>e.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ht(t.options,$r)),t.getRightLeafHeaders=dt(()=>[t.getRightFlatHeaders()],e=>e.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ht(t.options,$r)),t.getLeafHeaders=dt(()=>[t.getLeftHeaderGroups(),t.getCenterHeaderGroups(),t.getRightHeaderGroups()],(e,n,r)=>{var i,s,a,u,f,d;return[...(i=(s=e[0])==null?void 0:s.headers)!=null?i:[],...(a=(u=n[0])==null?void 0:u.headers)!=null?a:[],...(f=(d=r[0])==null?void 0:d.headers)!=null?f:[]].map(g=>g.getLeafHeaders()).flat()},ht(t.options,$r))}};function Pg(t,e,n,r){var i,s;let a=0;const u=function(m,v){v===void 0&&(v=1),a=Math.max(a,v),m.filter(b=>b.getIsVisible()).forEach(b=>{var S;(S=b.columns)!=null&&S.length&&u(b.columns,v+1)},0)};u(t);let f=[];const d=(m,v)=>{const b={depth:v,id:[r,`${v}`].filter(Boolean).join("_"),headers:[]},S=[];m.forEach(w=>{const C=[...S].reverse()[0],R=w.column.depth===b.depth;let T,A=!1;if(R&&w.column.parent?T=w.column.parent:(T=w.column,A=!0),C&&C?.column===T)C.subHeaders.push(w);else{const O=qM(n,T,{id:[r,v,T.id,w?.id].filter(Boolean).join("_"),isPlaceholder:A,placeholderId:A?`${S.filter(P=>P.column===T).length}`:void 0,depth:v,index:S.length});O.subHeaders.push(w),S.push(O)}b.headers.push(w),w.headerGroup=b}),f.push(b),v>0&&d(S,v-1)},g=e.map((m,v)=>qM(n,m,{depth:a,index:v}));d(g,a-1),f.reverse();const p=m=>m.filter(b=>b.column.getIsVisible()).map(b=>{let S=0,w=0,C=[0];b.subHeaders&&b.subHeaders.length?(C=[],p(b.subHeaders).forEach(T=>{let{colSpan:A,rowSpan:O}=T;S+=A,C.push(O)})):S=1;const R=Math.min(...C);return w=w+R,b.colSpan=S,b.rowSpan=w,{colSpan:S,rowSpan:w}});return p((i=(s=f[0])==null?void 0:s.headers)!=null?i:[]),f}const g2=(t,e,n,r,i,s,a)=>{let u={id:e,index:r,original:n,depth:i,parentId:a,_valuesCache:{},_uniqueValuesCache:{},getValue:f=>{if(u._valuesCache.hasOwnProperty(f))return u._valuesCache[f];const d=t.getColumn(f);if(d!=null&&d.accessorFn)return u._valuesCache[f]=d.accessorFn(u.original,r),u._valuesCache[f]},getUniqueValues:f=>{if(u._uniqueValuesCache.hasOwnProperty(f))return u._uniqueValuesCache[f];const d=t.getColumn(f);if(d!=null&&d.accessorFn)return d.columnDef.getUniqueValues?(u._uniqueValuesCache[f]=d.columnDef.getUniqueValues(u.original,r),u._uniqueValuesCache[f]):(u._uniqueValuesCache[f]=[u.getValue(f)],u._uniqueValuesCache[f])},renderValue:f=>{var d;return(d=u.getValue(f))!=null?d:t.options.renderFallbackValue},subRows:[],getLeafRows:()=>c2(u.subRows,f=>f.subRows),getParentRow:()=>u.parentId?t.getRow(u.parentId,!0):void 0,getParentRows:()=>{let f=[],d=u;for(;;){const g=d.getParentRow();if(!g)break;f.push(g),d=g}return f.reverse()},getAllCells:dt(()=>[t.getAllLeafColumns()],f=>f.map(d=>f2(t,u,d,d.id)),ht(t.options,"debugRows")),_getAllCellsByColumnId:dt(()=>[u.getAllCells()],f=>f.reduce((d,g)=>(d[g.column.id]=g,d),{}),ht(t.options,"debugRows"))};for(let f=0;f<t._features.length;f++){const d=t._features[f];d==null||d.createRow==null||d.createRow(u,t)}return u},p2={createColumn:(t,e)=>{t._getFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,t.id),t.getFacetedRowModel=()=>t._getFacetedRowModel?t._getFacetedRowModel():e.getPreFilteredRowModel(),t._getFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,t.id),t.getFacetedUniqueValues=()=>t._getFacetedUniqueValues?t._getFacetedUniqueValues():new Map,t._getFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,t.id),t.getFacetedMinMaxValues=()=>{if(t._getFacetedMinMaxValues)return t._getFacetedMinMaxValues()}}},vz=(t,e,n)=>{var r,i;const s=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((i=t.getValue(e))==null||(i=i.toString())==null||(i=i.toLowerCase())==null)&&i.includes(s))};vz.autoRemove=t=>Io(t);const bz=(t,e,n)=>{var r;return!!(!((r=t.getValue(e))==null||(r=r.toString())==null)&&r.includes(n))};bz.autoRemove=t=>Io(t);const xz=(t,e,n)=>{var r;return((r=t.getValue(e))==null||(r=r.toString())==null?void 0:r.toLowerCase())===n?.toLowerCase()};xz.autoRemove=t=>Io(t);const Sz=(t,e,n)=>{var r;return(r=t.getValue(e))==null?void 0:r.includes(n)};Sz.autoRemove=t=>Io(t);const wz=(t,e,n)=>!n.some(r=>{var i;return!((i=t.getValue(e))!=null&&i.includes(r))});wz.autoRemove=t=>Io(t)||!(t!=null&&t.length);const Cz=(t,e,n)=>n.some(r=>{var i;return(i=t.getValue(e))==null?void 0:i.includes(r)});Cz.autoRemove=t=>Io(t)||!(t!=null&&t.length);const Rz=(t,e,n)=>t.getValue(e)===n;Rz.autoRemove=t=>Io(t);const Ez=(t,e,n)=>t.getValue(e)==n;Ez.autoRemove=t=>Io(t);const Hw=(t,e,n)=>{let[r,i]=n;const s=t.getValue(e);return s>=r&&s<=i};Hw.resolveFilterValue=t=>{let[e,n]=t,r=typeof e!="number"?parseFloat(e):e,i=typeof n!="number"?parseFloat(n):n,s=e===null||Number.isNaN(r)?-1/0:r,a=n===null||Number.isNaN(i)?1/0:i;if(s>a){const u=s;s=a,a=u}return[s,a]};Hw.autoRemove=t=>Io(t)||Io(t[0])&&Io(t[1]);const Gs={includesString:vz,includesStringSensitive:bz,equalsString:xz,arrIncludes:Sz,arrIncludesAll:wz,arrIncludesSome:Cz,equals:Rz,weakEquals:Ez,inNumberRange:Hw};function Io(t){return t==null||t===""}const m2={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:t=>({columnFilters:[],...t}),getDefaultOptions:t=>({onColumnFiltersChange:Ni("columnFilters",t),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(t,e)=>{t.getAutoFilterFn=()=>{const n=e.getCoreRowModel().flatRows[0],r=n?.getValue(t.id);return typeof r=="string"?Gs.includesString:typeof r=="number"?Gs.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?Gs.equals:Array.isArray(r)?Gs.arrIncludes:Gs.weakEquals},t.getFilterFn=()=>{var n,r;return jm(t.columnDef.filterFn)?t.columnDef.filterFn:t.columnDef.filterFn==="auto"?t.getAutoFilterFn():(n=(r=e.options.filterFns)==null?void 0:r[t.columnDef.filterFn])!=null?n:Gs[t.columnDef.filterFn]},t.getCanFilter=()=>{var n,r,i;return((n=t.columnDef.enableColumnFilter)!=null?n:!0)&&((r=e.options.enableColumnFilters)!=null?r:!0)&&((i=e.options.enableFilters)!=null?i:!0)&&!!t.accessorFn},t.getIsFiltered=()=>t.getFilterIndex()>-1,t.getFilterValue=()=>{var n;return(n=e.getState().columnFilters)==null||(n=n.find(r=>r.id===t.id))==null?void 0:n.value},t.getFilterIndex=()=>{var n,r;return(n=(r=e.getState().columnFilters)==null?void 0:r.findIndex(i=>i.id===t.id))!=null?n:-1},t.setFilterValue=n=>{e.setColumnFilters(r=>{const i=t.getFilterFn(),s=r?.find(g=>g.id===t.id),a=Xl(n,s?s.value:void 0);if(GM(i,a,t)){var u;return(u=r?.filter(g=>g.id!==t.id))!=null?u:[]}const f={id:t.id,value:a};if(s){var d;return(d=r?.map(g=>g.id===t.id?f:g))!=null?d:[]}return r!=null&&r.length?[...r,f]:[f]})}},createRow:(t,e)=>{t.columnFilters={},t.columnFiltersMeta={}},createTable:t=>{t.setColumnFilters=e=>{const n=t.getAllLeafColumns(),r=i=>{var s;return(s=Xl(e,i))==null?void 0:s.filter(a=>{const u=n.find(f=>f.id===a.id);if(u){const f=u.getFilterFn();if(GM(f,a.value,u))return!1}return!0})};t.options.onColumnFiltersChange==null||t.options.onColumnFiltersChange(r)},t.resetColumnFilters=e=>{var n,r;t.setColumnFilters(e?[]:(n=(r=t.initialState)==null?void 0:r.columnFilters)!=null?n:[])},t.getPreFilteredRowModel=()=>t.getCoreRowModel(),t.getFilteredRowModel=()=>(!t._getFilteredRowModel&&t.options.getFilteredRowModel&&(t._getFilteredRowModel=t.options.getFilteredRowModel(t)),t.options.manualFiltering||!t._getFilteredRowModel?t.getPreFilteredRowModel():t._getFilteredRowModel())}};function GM(t,e,n){return(t&&t.autoRemove?t.autoRemove(e,n):!1)||typeof e>"u"||typeof e=="string"&&!e}const y2=(t,e,n)=>n.reduce((r,i)=>{const s=i.getValue(t);return r+(typeof s=="number"?s:0)},0),v2=(t,e,n)=>{let r;return n.forEach(i=>{const s=i.getValue(t);s!=null&&(r>s||r===void 0&&s>=s)&&(r=s)}),r},b2=(t,e,n)=>{let r;return n.forEach(i=>{const s=i.getValue(t);s!=null&&(r<s||r===void 0&&s>=s)&&(r=s)}),r},x2=(t,e,n)=>{let r,i;return n.forEach(s=>{const a=s.getValue(t);a!=null&&(r===void 0?a>=a&&(r=i=a):(r>a&&(r=a),i<a&&(i=a)))}),[r,i]},S2=(t,e)=>{let n=0,r=0;if(e.forEach(i=>{let s=i.getValue(t);s!=null&&(s=+s)>=s&&(++n,r+=s)}),n)return r/n},w2=(t,e)=>{if(!e.length)return;const n=e.map(s=>s.getValue(t));if(!u2(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),i=n.sort((s,a)=>s-a);return n.length%2!==0?i[r]:(i[r-1]+i[r])/2},C2=(t,e)=>Array.from(new Set(e.map(n=>n.getValue(t))).values()),R2=(t,e)=>new Set(e.map(n=>n.getValue(t))).size,E2=(t,e)=>e.length,X0={sum:y2,min:v2,max:b2,extent:x2,mean:S2,median:w2,unique:C2,uniqueCount:R2,count:E2},T2={getDefaultColumnDef:()=>({aggregatedCell:t=>{var e,n;return(e=(n=t.getValue())==null||n.toString==null?void 0:n.toString())!=null?e:null},aggregationFn:"auto"}),getInitialState:t=>({grouping:[],...t}),getDefaultOptions:t=>({onGroupingChange:Ni("grouping",t),groupedColumnMode:"reorder"}),createColumn:(t,e)=>{t.toggleGrouping=()=>{e.setGrouping(n=>n!=null&&n.includes(t.id)?n.filter(r=>r!==t.id):[...n??[],t.id])},t.getCanGroup=()=>{var n,r;return((n=t.columnDef.enableGrouping)!=null?n:!0)&&((r=e.options.enableGrouping)!=null?r:!0)&&(!!t.accessorFn||!!t.columnDef.getGroupingValue)},t.getIsGrouped=()=>{var n;return(n=e.getState().grouping)==null?void 0:n.includes(t.id)},t.getGroupedIndex=()=>{var n;return(n=e.getState().grouping)==null?void 0:n.indexOf(t.id)},t.getToggleGroupingHandler=()=>{const n=t.getCanGroup();return()=>{n&&t.toggleGrouping()}},t.getAutoAggregationFn=()=>{const n=e.getCoreRowModel().flatRows[0],r=n?.getValue(t.id);if(typeof r=="number")return X0.sum;if(Object.prototype.toString.call(r)==="[object Date]")return X0.extent},t.getAggregationFn=()=>{var n,r;if(!t)throw new Error;return jm(t.columnDef.aggregationFn)?t.columnDef.aggregationFn:t.columnDef.aggregationFn==="auto"?t.getAutoAggregationFn():(n=(r=e.options.aggregationFns)==null?void 0:r[t.columnDef.aggregationFn])!=null?n:X0[t.columnDef.aggregationFn]}},createTable:t=>{t.setGrouping=e=>t.options.onGroupingChange==null?void 0:t.options.onGroupingChange(e),t.resetGrouping=e=>{var n,r;t.setGrouping(e?[]:(n=(r=t.initialState)==null?void 0:r.grouping)!=null?n:[])},t.getPreGroupedRowModel=()=>t.getFilteredRowModel(),t.getGroupedRowModel=()=>(!t._getGroupedRowModel&&t.options.getGroupedRowModel&&(t._getGroupedRowModel=t.options.getGroupedRowModel(t)),t.options.manualGrouping||!t._getGroupedRowModel?t.getPreGroupedRowModel():t._getGroupedRowModel())},createRow:(t,e)=>{t.getIsGrouped=()=>!!t.groupingColumnId,t.getGroupingValue=n=>{if(t._groupingValuesCache.hasOwnProperty(n))return t._groupingValuesCache[n];const r=e.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(t._groupingValuesCache[n]=r.columnDef.getGroupingValue(t.original),t._groupingValuesCache[n]):t.getValue(n)},t._groupingValuesCache={}},createCell:(t,e,n,r)=>{t.getIsGrouped=()=>e.getIsGrouped()&&e.id===n.groupingColumnId,t.getIsPlaceholder=()=>!t.getIsGrouped()&&e.getIsGrouped(),t.getIsAggregated=()=>{var i;return!t.getIsGrouped()&&!t.getIsPlaceholder()&&!!((i=n.subRows)!=null&&i.length)}}};function A2(t,e,n){if(!(e!=null&&e.length)||!n)return t;const r=t.filter(s=>!e.includes(s.id));return n==="remove"?r:[...e.map(s=>t.find(a=>a.id===s)).filter(Boolean),...r]}const M2={getInitialState:t=>({columnOrder:[],...t}),getDefaultOptions:t=>({onColumnOrderChange:Ni("columnOrder",t)}),createColumn:(t,e)=>{t.getIndex=dt(n=>[Qf(e,n)],n=>n.findIndex(r=>r.id===t.id),ht(e.options,"debugColumns")),t.getIsFirstColumn=n=>{var r;return((r=Qf(e,n)[0])==null?void 0:r.id)===t.id},t.getIsLastColumn=n=>{var r;const i=Qf(e,n);return((r=i[i.length-1])==null?void 0:r.id)===t.id}},createTable:t=>{t.setColumnOrder=e=>t.options.onColumnOrderChange==null?void 0:t.options.onColumnOrderChange(e),t.resetColumnOrder=e=>{var n;t.setColumnOrder(e?[]:(n=t.initialState.columnOrder)!=null?n:[])},t._getOrderColumnsFn=dt(()=>[t.getState().columnOrder,t.getState().grouping,t.options.groupedColumnMode],(e,n,r)=>i=>{let s=[];if(!(e!=null&&e.length))s=i;else{const a=[...e],u=[...i];for(;u.length&&a.length;){const f=a.shift(),d=u.findIndex(g=>g.id===f);d>-1&&s.push(u.splice(d,1)[0])}s=[...s,...u]}return A2(s,n,r)},ht(t.options,"debugTable"))}},Q0=()=>({left:[],right:[]}),O2={getInitialState:t=>({columnPinning:Q0(),...t}),getDefaultOptions:t=>({onColumnPinningChange:Ni("columnPinning",t)}),createColumn:(t,e)=>{t.pin=n=>{const r=t.getLeafColumns().map(i=>i.id).filter(Boolean);e.setColumnPinning(i=>{var s,a;if(n==="right"){var u,f;return{left:((u=i?.left)!=null?u:[]).filter(p=>!(r!=null&&r.includes(p))),right:[...((f=i?.right)!=null?f:[]).filter(p=>!(r!=null&&r.includes(p))),...r]}}if(n==="left"){var d,g;return{left:[...((d=i?.left)!=null?d:[]).filter(p=>!(r!=null&&r.includes(p))),...r],right:((g=i?.right)!=null?g:[]).filter(p=>!(r!=null&&r.includes(p)))}}return{left:((s=i?.left)!=null?s:[]).filter(p=>!(r!=null&&r.includes(p))),right:((a=i?.right)!=null?a:[]).filter(p=>!(r!=null&&r.includes(p)))}})},t.getCanPin=()=>t.getLeafColumns().some(r=>{var i,s,a;return((i=r.columnDef.enablePinning)!=null?i:!0)&&((s=(a=e.options.enableColumnPinning)!=null?a:e.options.enablePinning)!=null?s:!0)}),t.getIsPinned=()=>{const n=t.getLeafColumns().map(u=>u.id),{left:r,right:i}=e.getState().columnPinning,s=n.some(u=>r?.includes(u)),a=n.some(u=>i?.includes(u));return s?"left":a?"right":!1},t.getPinnedIndex=()=>{var n,r;const i=t.getIsPinned();return i?(n=(r=e.getState().columnPinning)==null||(r=r[i])==null?void 0:r.indexOf(t.id))!=null?n:-1:0}},createRow:(t,e)=>{t.getCenterVisibleCells=dt(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,r,i)=>{const s=[...r??[],...i??[]];return n.filter(a=>!s.includes(a.column.id))},ht(e.options,"debugRows")),t.getLeftVisibleCells=dt(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left],(n,r)=>(r??[]).map(s=>n.find(a=>a.column.id===s)).filter(Boolean).map(s=>({...s,position:"left"})),ht(e.options,"debugRows")),t.getRightVisibleCells=dt(()=>[t._getAllVisibleCells(),e.getState().columnPinning.right],(n,r)=>(r??[]).map(s=>n.find(a=>a.column.id===s)).filter(Boolean).map(s=>({...s,position:"right"})),ht(e.options,"debugRows"))},createTable:t=>{t.setColumnPinning=e=>t.options.onColumnPinningChange==null?void 0:t.options.onColumnPinningChange(e),t.resetColumnPinning=e=>{var n,r;return t.setColumnPinning(e?Q0():(n=(r=t.initialState)==null?void 0:r.columnPinning)!=null?n:Q0())},t.getIsSomeColumnsPinned=e=>{var n;const r=t.getState().columnPinning;if(!e){var i,s;return!!((i=r.left)!=null&&i.length||(s=r.right)!=null&&s.length)}return!!((n=r[e])!=null&&n.length)},t.getLeftLeafColumns=dt(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left],(e,n)=>(n??[]).map(r=>e.find(i=>i.id===r)).filter(Boolean),ht(t.options,"debugColumns")),t.getRightLeafColumns=dt(()=>[t.getAllLeafColumns(),t.getState().columnPinning.right],(e,n)=>(n??[]).map(r=>e.find(i=>i.id===r)).filter(Boolean),ht(t.options,"debugColumns")),t.getCenterLeafColumns=dt(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,r)=>{const i=[...n??[],...r??[]];return e.filter(s=>!i.includes(s.id))},ht(t.options,"debugColumns"))}};function k2(t){return t||(typeof document<"u"?document:null)}const zg={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Z0=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),I2={getDefaultColumnDef:()=>zg,getInitialState:t=>({columnSizing:{},columnSizingInfo:Z0(),...t}),getDefaultOptions:t=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Ni("columnSizing",t),onColumnSizingInfoChange:Ni("columnSizingInfo",t)}),createColumn:(t,e)=>{t.getSize=()=>{var n,r,i;const s=e.getState().columnSizing[t.id];return Math.min(Math.max((n=t.columnDef.minSize)!=null?n:zg.minSize,(r=s??t.columnDef.size)!=null?r:zg.size),(i=t.columnDef.maxSize)!=null?i:zg.maxSize)},t.getStart=dt(n=>[n,Qf(e,n),e.getState().columnSizing],(n,r)=>r.slice(0,t.getIndex(n)).reduce((i,s)=>i+s.getSize(),0),ht(e.options,"debugColumns")),t.getAfter=dt(n=>[n,Qf(e,n),e.getState().columnSizing],(n,r)=>r.slice(t.getIndex(n)+1).reduce((i,s)=>i+s.getSize(),0),ht(e.options,"debugColumns")),t.resetSize=()=>{e.setColumnSizing(n=>{let{[t.id]:r,...i}=n;return i})},t.getCanResize=()=>{var n,r;return((n=t.columnDef.enableResizing)!=null?n:!0)&&((r=e.options.enableColumnResizing)!=null?r:!0)},t.getIsResizing=()=>e.getState().columnSizingInfo.isResizingColumn===t.id},createHeader:(t,e)=>{t.getSize=()=>{let n=0;const r=i=>{if(i.subHeaders.length)i.subHeaders.forEach(r);else{var s;n+=(s=i.column.getSize())!=null?s:0}};return r(t),n},t.getStart=()=>{if(t.index>0){const n=t.headerGroup.headers[t.index-1];return n.getStart()+n.getSize()}return 0},t.getResizeHandler=n=>{const r=e.getColumn(t.column.id),i=r?.getCanResize();return s=>{if(!r||!i||(s.persist==null||s.persist(),J0(s)&&s.touches&&s.touches.length>1))return;const a=t.getSize(),u=t?t.getLeafHeaders().map(C=>[C.column.id,C.column.getSize()]):[[r.id,r.getSize()]],f=J0(s)?Math.round(s.touches[0].clientX):s.clientX,d={},g=(C,R)=>{typeof R=="number"&&(e.setColumnSizingInfo(T=>{var A,O;const P=e.options.columnResizeDirection==="rtl"?-1:1,M=(R-((A=T?.startOffset)!=null?A:0))*P,D=Math.max(M/((O=T?.startSize)!=null?O:0),-.999999);return T.columnSizingStart.forEach(L=>{let[H,N]=L;d[H]=Math.round(Math.max(N+N*D,0)*100)/100}),{...T,deltaOffset:M,deltaPercentage:D}}),(e.options.columnResizeMode==="onChange"||C==="end")&&e.setColumnSizing(T=>({...T,...d})))},p=C=>g("move",C),m=C=>{g("end",C),e.setColumnSizingInfo(R=>({...R,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},v=k2(n),b={moveHandler:C=>p(C.clientX),upHandler:C=>{v?.removeEventListener("mousemove",b.moveHandler),v?.removeEventListener("mouseup",b.upHandler),m(C.clientX)}},S={moveHandler:C=>(C.cancelable&&(C.preventDefault(),C.stopPropagation()),p(C.touches[0].clientX),!1),upHandler:C=>{var R;v?.removeEventListener("touchmove",S.moveHandler),v?.removeEventListener("touchend",S.upHandler),C.cancelable&&(C.preventDefault(),C.stopPropagation()),m((R=C.touches[0])==null?void 0:R.clientX)}},w=D2()?{passive:!1}:!1;J0(s)?(v?.addEventListener("touchmove",S.moveHandler,w),v?.addEventListener("touchend",S.upHandler,w)):(v?.addEventListener("mousemove",b.moveHandler,w),v?.addEventListener("mouseup",b.upHandler,w)),e.setColumnSizingInfo(C=>({...C,startOffset:f,startSize:a,deltaOffset:0,deltaPercentage:0,columnSizingStart:u,isResizingColumn:r.id}))}}},createTable:t=>{t.setColumnSizing=e=>t.options.onColumnSizingChange==null?void 0:t.options.onColumnSizingChange(e),t.setColumnSizingInfo=e=>t.options.onColumnSizingInfoChange==null?void 0:t.options.onColumnSizingInfoChange(e),t.resetColumnSizing=e=>{var n;t.setColumnSizing(e?{}:(n=t.initialState.columnSizing)!=null?n:{})},t.resetHeaderSizeInfo=e=>{var n;t.setColumnSizingInfo(e?Z0():(n=t.initialState.columnSizingInfo)!=null?n:Z0())},t.getTotalSize=()=>{var e,n;return(e=(n=t.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?e:0},t.getLeftTotalSize=()=>{var e,n;return(e=(n=t.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?e:0},t.getCenterTotalSize=()=>{var e,n;return(e=(n=t.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?e:0},t.getRightTotalSize=()=>{var e,n;return(e=(n=t.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,i)=>r+i.getSize(),0))!=null?e:0}}};let Ng=null;function D2(){if(typeof Ng=="boolean")return Ng;let t=!1;try{const e={get passive(){return t=!0,!1}},n=()=>{};window.addEventListener("test",n,e),window.removeEventListener("test",n)}catch{t=!1}return Ng=t,Ng}function J0(t){return t.type==="touchstart"}const P2={getInitialState:t=>({columnVisibility:{},...t}),getDefaultOptions:t=>({onColumnVisibilityChange:Ni("columnVisibility",t)}),createColumn:(t,e)=>{t.toggleVisibility=n=>{t.getCanHide()&&e.setColumnVisibility(r=>({...r,[t.id]:n??!t.getIsVisible()}))},t.getIsVisible=()=>{var n,r;const i=t.columns;return(n=i.length?i.some(s=>s.getIsVisible()):(r=e.getState().columnVisibility)==null?void 0:r[t.id])!=null?n:!0},t.getCanHide=()=>{var n,r;return((n=t.columnDef.enableHiding)!=null?n:!0)&&((r=e.options.enableHiding)!=null?r:!0)},t.getToggleVisibilityHandler=()=>n=>{t.toggleVisibility==null||t.toggleVisibility(n.target.checked)}},createRow:(t,e)=>{t._getAllVisibleCells=dt(()=>[t.getAllCells(),e.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),ht(e.options,"debugRows")),t.getVisibleCells=dt(()=>[t.getLeftVisibleCells(),t.getCenterVisibleCells(),t.getRightVisibleCells()],(n,r,i)=>[...n,...r,...i],ht(e.options,"debugRows"))},createTable:t=>{const e=(n,r)=>dt(()=>[r(),r().filter(i=>i.getIsVisible()).map(i=>i.id).join("_")],i=>i.filter(s=>s.getIsVisible==null?void 0:s.getIsVisible()),ht(t.options,"debugColumns"));t.getVisibleFlatColumns=e("getVisibleFlatColumns",()=>t.getAllFlatColumns()),t.getVisibleLeafColumns=e("getVisibleLeafColumns",()=>t.getAllLeafColumns()),t.getLeftVisibleLeafColumns=e("getLeftVisibleLeafColumns",()=>t.getLeftLeafColumns()),t.getRightVisibleLeafColumns=e("getRightVisibleLeafColumns",()=>t.getRightLeafColumns()),t.getCenterVisibleLeafColumns=e("getCenterVisibleLeafColumns",()=>t.getCenterLeafColumns()),t.setColumnVisibility=n=>t.options.onColumnVisibilityChange==null?void 0:t.options.onColumnVisibilityChange(n),t.resetColumnVisibility=n=>{var r;t.setColumnVisibility(n?{}:(r=t.initialState.columnVisibility)!=null?r:{})},t.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!t.getIsAllColumnsVisible(),t.setColumnVisibility(t.getAllLeafColumns().reduce((i,s)=>({...i,[s.id]:n||!(s.getCanHide!=null&&s.getCanHide())}),{}))},t.getIsAllColumnsVisible=()=>!t.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),t.getIsSomeColumnsVisible=()=>t.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),t.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;t.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function Qf(t,e){return e?e==="center"?t.getCenterVisibleLeafColumns():e==="left"?t.getLeftVisibleLeafColumns():t.getRightVisibleLeafColumns():t.getVisibleLeafColumns()}const z2={createTable:t=>{t._getGlobalFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,"__global__"),t.getGlobalFacetedRowModel=()=>t.options.manualFiltering||!t._getGlobalFacetedRowModel?t.getPreFilteredRowModel():t._getGlobalFacetedRowModel(),t._getGlobalFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,"__global__"),t.getGlobalFacetedUniqueValues=()=>t._getGlobalFacetedUniqueValues?t._getGlobalFacetedUniqueValues():new Map,t._getGlobalFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,"__global__"),t.getGlobalFacetedMinMaxValues=()=>{if(t._getGlobalFacetedMinMaxValues)return t._getGlobalFacetedMinMaxValues()}}},N2={getInitialState:t=>({globalFilter:void 0,...t}),getDefaultOptions:t=>({onGlobalFilterChange:Ni("globalFilter",t),globalFilterFn:"auto",getColumnCanGlobalFilter:e=>{var n;const r=(n=t.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[e.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(t,e)=>{t.getCanGlobalFilter=()=>{var n,r,i,s;return((n=t.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=e.options.enableGlobalFilter)!=null?r:!0)&&((i=e.options.enableFilters)!=null?i:!0)&&((s=e.options.getColumnCanGlobalFilter==null?void 0:e.options.getColumnCanGlobalFilter(t))!=null?s:!0)&&!!t.accessorFn}},createTable:t=>{t.getGlobalAutoFilterFn=()=>Gs.includesString,t.getGlobalFilterFn=()=>{var e,n;const{globalFilterFn:r}=t.options;return jm(r)?r:r==="auto"?t.getGlobalAutoFilterFn():(e=(n=t.options.filterFns)==null?void 0:n[r])!=null?e:Gs[r]},t.setGlobalFilter=e=>{t.options.onGlobalFilterChange==null||t.options.onGlobalFilterChange(e)},t.resetGlobalFilter=e=>{t.setGlobalFilter(e?void 0:t.initialState.globalFilter)}}},L2={getInitialState:t=>({expanded:{},...t}),getDefaultOptions:t=>({onExpandedChange:Ni("expanded",t),paginateExpandedRows:!0}),createTable:t=>{let e=!1,n=!1;t._autoResetExpanded=()=>{var r,i;if(!e){t._queue(()=>{e=!0});return}if((r=(i=t.options.autoResetAll)!=null?i:t.options.autoResetExpanded)!=null?r:!t.options.manualExpanding){if(n)return;n=!0,t._queue(()=>{t.resetExpanded(),n=!1})}},t.setExpanded=r=>t.options.onExpandedChange==null?void 0:t.options.onExpandedChange(r),t.toggleAllRowsExpanded=r=>{r??!t.getIsAllRowsExpanded()?t.setExpanded(!0):t.setExpanded({})},t.resetExpanded=r=>{var i,s;t.setExpanded(r?{}:(i=(s=t.initialState)==null?void 0:s.expanded)!=null?i:{})},t.getCanSomeRowsExpand=()=>t.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),t.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),t.toggleAllRowsExpanded()},t.getIsSomeRowsExpanded=()=>{const r=t.getState().expanded;return r===!0||Object.values(r).some(Boolean)},t.getIsAllRowsExpanded=()=>{const r=t.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||t.getRowModel().flatRows.some(i=>!i.getIsExpanded()))},t.getExpandedDepth=()=>{let r=0;return(t.getState().expanded===!0?Object.keys(t.getRowModel().rowsById):Object.keys(t.getState().expanded)).forEach(s=>{const a=s.split(".");r=Math.max(r,a.length)}),r},t.getPreExpandedRowModel=()=>t.getSortedRowModel(),t.getExpandedRowModel=()=>(!t._getExpandedRowModel&&t.options.getExpandedRowModel&&(t._getExpandedRowModel=t.options.getExpandedRowModel(t)),t.options.manualExpanding||!t._getExpandedRowModel?t.getPreExpandedRowModel():t._getExpandedRowModel())},createRow:(t,e)=>{t.toggleExpanded=n=>{e.setExpanded(r=>{var i;const s=r===!0?!0:!!(r!=null&&r[t.id]);let a={};if(r===!0?Object.keys(e.getRowModel().rowsById).forEach(u=>{a[u]=!0}):a=r,n=(i=n)!=null?i:!s,!s&&n)return{...a,[t.id]:!0};if(s&&!n){const{[t.id]:u,...f}=a;return f}return r})},t.getIsExpanded=()=>{var n;const r=e.getState().expanded;return!!((n=e.options.getIsRowExpanded==null?void 0:e.options.getIsRowExpanded(t))!=null?n:r===!0||r?.[t.id])},t.getCanExpand=()=>{var n,r,i;return(n=e.options.getRowCanExpand==null?void 0:e.options.getRowCanExpand(t))!=null?n:((r=e.options.enableExpanding)!=null?r:!0)&&!!((i=t.subRows)!=null&&i.length)},t.getIsAllParentsExpanded=()=>{let n=!0,r=t;for(;n&&r.parentId;)r=e.getRow(r.parentId,!0),n=r.getIsExpanded();return n},t.getToggleExpandedHandler=()=>{const n=t.getCanExpand();return()=>{n&&t.toggleExpanded()}}}},Ix=0,Dx=10,eb=()=>({pageIndex:Ix,pageSize:Dx}),B2={getInitialState:t=>({...t,pagination:{...eb(),...t?.pagination}}),getDefaultOptions:t=>({onPaginationChange:Ni("pagination",t)}),createTable:t=>{let e=!1,n=!1;t._autoResetPageIndex=()=>{var r,i;if(!e){t._queue(()=>{e=!0});return}if((r=(i=t.options.autoResetAll)!=null?i:t.options.autoResetPageIndex)!=null?r:!t.options.manualPagination){if(n)return;n=!0,t._queue(()=>{t.resetPageIndex(),n=!1})}},t.setPagination=r=>{const i=s=>Xl(r,s);return t.options.onPaginationChange==null?void 0:t.options.onPaginationChange(i)},t.resetPagination=r=>{var i;t.setPagination(r?eb():(i=t.initialState.pagination)!=null?i:eb())},t.setPageIndex=r=>{t.setPagination(i=>{let s=Xl(r,i.pageIndex);const a=typeof t.options.pageCount>"u"||t.options.pageCount===-1?Number.MAX_SAFE_INTEGER:t.options.pageCount-1;return s=Math.max(0,Math.min(s,a)),{...i,pageIndex:s}})},t.resetPageIndex=r=>{var i,s;t.setPageIndex(r?Ix:(i=(s=t.initialState)==null||(s=s.pagination)==null?void 0:s.pageIndex)!=null?i:Ix)},t.resetPageSize=r=>{var i,s;t.setPageSize(r?Dx:(i=(s=t.initialState)==null||(s=s.pagination)==null?void 0:s.pageSize)!=null?i:Dx)},t.setPageSize=r=>{t.setPagination(i=>{const s=Math.max(1,Xl(r,i.pageSize)),a=i.pageSize*i.pageIndex,u=Math.floor(a/s);return{...i,pageIndex:u,pageSize:s}})},t.setPageCount=r=>t.setPagination(i=>{var s;let a=Xl(r,(s=t.options.pageCount)!=null?s:-1);return typeof a=="number"&&(a=Math.max(-1,a)),{...i,pageCount:a}}),t.getPageOptions=dt(()=>[t.getPageCount()],r=>{let i=[];return r&&r>0&&(i=[...new Array(r)].fill(null).map((s,a)=>a)),i},ht(t.options,"debugTable")),t.getCanPreviousPage=()=>t.getState().pagination.pageIndex>0,t.getCanNextPage=()=>{const{pageIndex:r}=t.getState().pagination,i=t.getPageCount();return i===-1?!0:i===0?!1:r<i-1},t.previousPage=()=>t.setPageIndex(r=>r-1),t.nextPage=()=>t.setPageIndex(r=>r+1),t.firstPage=()=>t.setPageIndex(0),t.lastPage=()=>t.setPageIndex(t.getPageCount()-1),t.getPrePaginationRowModel=()=>t.getExpandedRowModel(),t.getPaginationRowModel=()=>(!t._getPaginationRowModel&&t.options.getPaginationRowModel&&(t._getPaginationRowModel=t.options.getPaginationRowModel(t)),t.options.manualPagination||!t._getPaginationRowModel?t.getPrePaginationRowModel():t._getPaginationRowModel()),t.getPageCount=()=>{var r;return(r=t.options.pageCount)!=null?r:Math.ceil(t.getRowCount()/t.getState().pagination.pageSize)},t.getRowCount=()=>{var r;return(r=t.options.rowCount)!=null?r:t.getPrePaginationRowModel().rows.length}}},tb=()=>({top:[],bottom:[]}),_2={getInitialState:t=>({rowPinning:tb(),...t}),getDefaultOptions:t=>({onRowPinningChange:Ni("rowPinning",t)}),createRow:(t,e)=>{t.pin=(n,r,i)=>{const s=r?t.getLeafRows().map(f=>{let{id:d}=f;return d}):[],a=i?t.getParentRows().map(f=>{let{id:d}=f;return d}):[],u=new Set([...a,t.id,...s]);e.setRowPinning(f=>{var d,g;if(n==="bottom"){var p,m;return{top:((p=f?.top)!=null?p:[]).filter(S=>!(u!=null&&u.has(S))),bottom:[...((m=f?.bottom)!=null?m:[]).filter(S=>!(u!=null&&u.has(S))),...Array.from(u)]}}if(n==="top"){var v,b;return{top:[...((v=f?.top)!=null?v:[]).filter(S=>!(u!=null&&u.has(S))),...Array.from(u)],bottom:((b=f?.bottom)!=null?b:[]).filter(S=>!(u!=null&&u.has(S)))}}return{top:((d=f?.top)!=null?d:[]).filter(S=>!(u!=null&&u.has(S))),bottom:((g=f?.bottom)!=null?g:[]).filter(S=>!(u!=null&&u.has(S)))}})},t.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:i}=e.options;return typeof r=="function"?r(t):(n=r??i)!=null?n:!0},t.getIsPinned=()=>{const n=[t.id],{top:r,bottom:i}=e.getState().rowPinning,s=n.some(u=>r?.includes(u)),a=n.some(u=>i?.includes(u));return s?"top":a?"bottom":!1},t.getPinnedIndex=()=>{var n,r;const i=t.getIsPinned();if(!i)return-1;const s=(n=i==="top"?e.getTopRows():e.getBottomRows())==null?void 0:n.map(a=>{let{id:u}=a;return u});return(r=s?.indexOf(t.id))!=null?r:-1}},createTable:t=>{t.setRowPinning=e=>t.options.onRowPinningChange==null?void 0:t.options.onRowPinningChange(e),t.resetRowPinning=e=>{var n,r;return t.setRowPinning(e?tb():(n=(r=t.initialState)==null?void 0:r.rowPinning)!=null?n:tb())},t.getIsSomeRowsPinned=e=>{var n;const r=t.getState().rowPinning;if(!e){var i,s;return!!((i=r.top)!=null&&i.length||(s=r.bottom)!=null&&s.length)}return!!((n=r[e])!=null&&n.length)},t._getPinnedRows=(e,n,r)=>{var i;return((i=t.options.keepPinnedRows)==null||i?(n??[]).map(a=>{const u=t.getRow(a,!0);return u.getIsAllParentsExpanded()?u:null}):(n??[]).map(a=>e.find(u=>u.id===a))).filter(Boolean).map(a=>({...a,position:r}))},t.getTopRows=dt(()=>[t.getRowModel().rows,t.getState().rowPinning.top],(e,n)=>t._getPinnedRows(e,n,"top"),ht(t.options,"debugRows")),t.getBottomRows=dt(()=>[t.getRowModel().rows,t.getState().rowPinning.bottom],(e,n)=>t._getPinnedRows(e,n,"bottom"),ht(t.options,"debugRows")),t.getCenterRows=dt(()=>[t.getRowModel().rows,t.getState().rowPinning.top,t.getState().rowPinning.bottom],(e,n,r)=>{const i=new Set([...n??[],...r??[]]);return e.filter(s=>!i.has(s.id))},ht(t.options,"debugRows"))}},H2={getInitialState:t=>({rowSelection:{},...t}),getDefaultOptions:t=>({onRowSelectionChange:Ni("rowSelection",t),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:t=>{t.setRowSelection=e=>t.options.onRowSelectionChange==null?void 0:t.options.onRowSelectionChange(e),t.resetRowSelection=e=>{var n;return t.setRowSelection(e?{}:(n=t.initialState.rowSelection)!=null?n:{})},t.toggleAllRowsSelected=e=>{t.setRowSelection(n=>{e=typeof e<"u"?e:!t.getIsAllRowsSelected();const r={...n},i=t.getPreGroupedRowModel().flatRows;return e?i.forEach(s=>{s.getCanSelect()&&(r[s.id]=!0)}):i.forEach(s=>{delete r[s.id]}),r})},t.toggleAllPageRowsSelected=e=>t.setRowSelection(n=>{const r=typeof e<"u"?e:!t.getIsAllPageRowsSelected(),i={...n};return t.getRowModel().rows.forEach(s=>{Px(i,s.id,r,!0,t)}),i}),t.getPreSelectedRowModel=()=>t.getCoreRowModel(),t.getSelectedRowModel=dt(()=>[t.getState().rowSelection,t.getCoreRowModel()],(e,n)=>Object.keys(e).length?nb(t,n):{rows:[],flatRows:[],rowsById:{}},ht(t.options,"debugTable")),t.getFilteredSelectedRowModel=dt(()=>[t.getState().rowSelection,t.getFilteredRowModel()],(e,n)=>Object.keys(e).length?nb(t,n):{rows:[],flatRows:[],rowsById:{}},ht(t.options,"debugTable")),t.getGroupedSelectedRowModel=dt(()=>[t.getState().rowSelection,t.getSortedRowModel()],(e,n)=>Object.keys(e).length?nb(t,n):{rows:[],flatRows:[],rowsById:{}},ht(t.options,"debugTable")),t.getIsAllRowsSelected=()=>{const e=t.getFilteredRowModel().flatRows,{rowSelection:n}=t.getState();let r=!!(e.length&&Object.keys(n).length);return r&&e.some(i=>i.getCanSelect()&&!n[i.id])&&(r=!1),r},t.getIsAllPageRowsSelected=()=>{const e=t.getPaginationRowModel().flatRows.filter(i=>i.getCanSelect()),{rowSelection:n}=t.getState();let r=!!e.length;return r&&e.some(i=>!n[i.id])&&(r=!1),r},t.getIsSomeRowsSelected=()=>{var e;const n=Object.keys((e=t.getState().rowSelection)!=null?e:{}).length;return n>0&&n<t.getFilteredRowModel().flatRows.length},t.getIsSomePageRowsSelected=()=>{const e=t.getPaginationRowModel().flatRows;return t.getIsAllPageRowsSelected()?!1:e.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},t.getToggleAllRowsSelectedHandler=()=>e=>{t.toggleAllRowsSelected(e.target.checked)},t.getToggleAllPageRowsSelectedHandler=()=>e=>{t.toggleAllPageRowsSelected(e.target.checked)}},createRow:(t,e)=>{t.toggleSelected=(n,r)=>{const i=t.getIsSelected();e.setRowSelection(s=>{var a;if(n=typeof n<"u"?n:!i,t.getCanSelect()&&i===n)return s;const u={...s};return Px(u,t.id,n,(a=r?.selectChildren)!=null?a:!0,e),u})},t.getIsSelected=()=>{const{rowSelection:n}=e.getState();return jw(t,n)},t.getIsSomeSelected=()=>{const{rowSelection:n}=e.getState();return zx(t,n)==="some"},t.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=e.getState();return zx(t,n)==="all"},t.getCanSelect=()=>{var n;return typeof e.options.enableRowSelection=="function"?e.options.enableRowSelection(t):(n=e.options.enableRowSelection)!=null?n:!0},t.getCanSelectSubRows=()=>{var n;return typeof e.options.enableSubRowSelection=="function"?e.options.enableSubRowSelection(t):(n=e.options.enableSubRowSelection)!=null?n:!0},t.getCanMultiSelect=()=>{var n;return typeof e.options.enableMultiRowSelection=="function"?e.options.enableMultiRowSelection(t):(n=e.options.enableMultiRowSelection)!=null?n:!0},t.getToggleSelectedHandler=()=>{const n=t.getCanSelect();return r=>{var i;n&&t.toggleSelected((i=r.target)==null?void 0:i.checked)}}}},Px=(t,e,n,r,i)=>{var s;const a=i.getRow(e,!0);n?(a.getCanMultiSelect()||Object.keys(t).forEach(u=>delete t[u]),a.getCanSelect()&&(t[e]=!0)):delete t[e],r&&(s=a.subRows)!=null&&s.length&&a.getCanSelectSubRows()&&a.subRows.forEach(u=>Px(t,u.id,n,r,i))};function nb(t,e){const n=t.getState().rowSelection,r=[],i={},s=function(a,u){return a.map(f=>{var d;const g=jw(f,n);if(g&&(r.push(f),i[f.id]=f),(d=f.subRows)!=null&&d.length&&(f={...f,subRows:s(f.subRows)}),g)return f}).filter(Boolean)};return{rows:s(e.rows),flatRows:r,rowsById:i}}function jw(t,e){var n;return(n=e[t.id])!=null?n:!1}function zx(t,e,n){var r;if(!((r=t.subRows)!=null&&r.length))return!1;let i=!0,s=!1;return t.subRows.forEach(a=>{if(!(s&&!i)&&(a.getCanSelect()&&(jw(a,e)?s=!0:i=!1),a.subRows&&a.subRows.length)){const u=zx(a,e);u==="all"?s=!0:(u==="some"&&(s=!0),i=!1)}}),i?"all":s?"some":!1}const Nx=/([0-9]+)/gm,j2=(t,e,n)=>Tz(aa(t.getValue(n)).toLowerCase(),aa(e.getValue(n)).toLowerCase()),V2=(t,e,n)=>Tz(aa(t.getValue(n)),aa(e.getValue(n))),F2=(t,e,n)=>Vw(aa(t.getValue(n)).toLowerCase(),aa(e.getValue(n)).toLowerCase()),U2=(t,e,n)=>Vw(aa(t.getValue(n)),aa(e.getValue(n))),$2=(t,e,n)=>{const r=t.getValue(n),i=e.getValue(n);return r>i?1:r<i?-1:0},q2=(t,e,n)=>Vw(t.getValue(n),e.getValue(n));function Vw(t,e){return t===e?0:t>e?1:-1}function aa(t){return typeof t=="number"?isNaN(t)||t===1/0||t===-1/0?"":String(t):typeof t=="string"?t:""}function Tz(t,e){const n=t.split(Nx).filter(Boolean),r=e.split(Nx).filter(Boolean);for(;n.length&&r.length;){const i=n.shift(),s=r.shift(),a=parseInt(i,10),u=parseInt(s,10),f=[a,u].sort();if(isNaN(f[0])){if(i>s)return 1;if(s>i)return-1;continue}if(isNaN(f[1]))return isNaN(a)?-1:1;if(a>u)return 1;if(u>a)return-1}return n.length-r.length}const Pf={alphanumeric:j2,alphanumericCaseSensitive:V2,text:F2,textCaseSensitive:U2,datetime:$2,basic:q2},G2={getInitialState:t=>({sorting:[],...t}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:t=>({onSortingChange:Ni("sorting",t),isMultiSortEvent:e=>e.shiftKey}),createColumn:(t,e)=>{t.getAutoSortingFn=()=>{const n=e.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const i of n){const s=i?.getValue(t.id);if(Object.prototype.toString.call(s)==="[object Date]")return Pf.datetime;if(typeof s=="string"&&(r=!0,s.split(Nx).length>1))return Pf.alphanumeric}return r?Pf.text:Pf.basic},t.getAutoSortDir=()=>{const n=e.getFilteredRowModel().flatRows[0];return typeof n?.getValue(t.id)=="string"?"asc":"desc"},t.getSortingFn=()=>{var n,r;if(!t)throw new Error;return jm(t.columnDef.sortingFn)?t.columnDef.sortingFn:t.columnDef.sortingFn==="auto"?t.getAutoSortingFn():(n=(r=e.options.sortingFns)==null?void 0:r[t.columnDef.sortingFn])!=null?n:Pf[t.columnDef.sortingFn]},t.toggleSorting=(n,r)=>{const i=t.getNextSortingOrder(),s=typeof n<"u"&&n!==null;e.setSorting(a=>{const u=a?.find(v=>v.id===t.id),f=a?.findIndex(v=>v.id===t.id);let d=[],g,p=s?n:i==="desc";if(a!=null&&a.length&&t.getCanMultiSort()&&r?u?g="toggle":g="add":a!=null&&a.length&&f!==a.length-1?g="replace":u?g="toggle":g="replace",g==="toggle"&&(s||i||(g="remove")),g==="add"){var m;d=[...a,{id:t.id,desc:p}],d.splice(0,d.length-((m=e.options.maxMultiSortColCount)!=null?m:Number.MAX_SAFE_INTEGER))}else g==="toggle"?d=a.map(v=>v.id===t.id?{...v,desc:p}:v):g==="remove"?d=a.filter(v=>v.id!==t.id):d=[{id:t.id,desc:p}];return d})},t.getFirstSortDir=()=>{var n,r;return((n=(r=t.columnDef.sortDescFirst)!=null?r:e.options.sortDescFirst)!=null?n:t.getAutoSortDir()==="desc")?"desc":"asc"},t.getNextSortingOrder=n=>{var r,i;const s=t.getFirstSortDir(),a=t.getIsSorted();return a?a!==s&&((r=e.options.enableSortingRemoval)==null||r)&&(!(n&&(i=e.options.enableMultiRemove)!=null)||i)?!1:a==="desc"?"asc":"desc":s},t.getCanSort=()=>{var n,r;return((n=t.columnDef.enableSorting)!=null?n:!0)&&((r=e.options.enableSorting)!=null?r:!0)&&!!t.accessorFn},t.getCanMultiSort=()=>{var n,r;return(n=(r=t.columnDef.enableMultiSort)!=null?r:e.options.enableMultiSort)!=null?n:!!t.accessorFn},t.getIsSorted=()=>{var n;const r=(n=e.getState().sorting)==null?void 0:n.find(i=>i.id===t.id);return r?r.desc?"desc":"asc":!1},t.getSortIndex=()=>{var n,r;return(n=(r=e.getState().sorting)==null?void 0:r.findIndex(i=>i.id===t.id))!=null?n:-1},t.clearSorting=()=>{e.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==t.id):[])},t.getToggleSortingHandler=()=>{const n=t.getCanSort();return r=>{n&&(r.persist==null||r.persist(),t.toggleSorting==null||t.toggleSorting(void 0,t.getCanMultiSort()?e.options.isMultiSortEvent==null?void 0:e.options.isMultiSortEvent(r):!1))}}},createTable:t=>{t.setSorting=e=>t.options.onSortingChange==null?void 0:t.options.onSortingChange(e),t.resetSorting=e=>{var n,r;t.setSorting(e?[]:(n=(r=t.initialState)==null?void 0:r.sorting)!=null?n:[])},t.getPreSortedRowModel=()=>t.getGroupedRowModel(),t.getSortedRowModel=()=>(!t._getSortedRowModel&&t.options.getSortedRowModel&&(t._getSortedRowModel=t.options.getSortedRowModel(t)),t.options.manualSorting||!t._getSortedRowModel?t.getPreSortedRowModel():t._getSortedRowModel())}},W2=[h2,P2,M2,O2,p2,m2,z2,N2,G2,T2,L2,B2,_2,H2,I2];function K2(t){var e,n;const r=[...W2,...(e=t._features)!=null?e:[]];let i={_features:r};const s=i._features.reduce((m,v)=>Object.assign(m,v.getDefaultOptions==null?void 0:v.getDefaultOptions(i)),{}),a=m=>i.options.mergeOptions?i.options.mergeOptions(s,m):{...s,...m};let f={...{},...(n=t.initialState)!=null?n:{}};i._features.forEach(m=>{var v;f=(v=m.getInitialState==null?void 0:m.getInitialState(f))!=null?v:f});const d=[];let g=!1;const p={_features:r,options:{...s,...t},initialState:f,_queue:m=>{d.push(m),g||(g=!0,Promise.resolve().then(()=>{for(;d.length;)d.shift()();g=!1}).catch(v=>setTimeout(()=>{throw v})))},reset:()=>{i.setState(i.initialState)},setOptions:m=>{const v=Xl(m,i.options);i.options=a(v)},getState:()=>i.options.state,setState:m=>{i.options.onStateChange==null||i.options.onStateChange(m)},_getRowId:(m,v,b)=>{var S;return(S=i.options.getRowId==null?void 0:i.options.getRowId(m,v,b))!=null?S:`${b?[b.id,v].join("."):v}`},getCoreRowModel:()=>(i._getCoreRowModel||(i._getCoreRowModel=i.options.getCoreRowModel(i)),i._getCoreRowModel()),getRowModel:()=>i.getPaginationRowModel(),getRow:(m,v)=>{let b=(v?i.getPrePaginationRowModel():i.getRowModel()).rowsById[m];if(!b&&(b=i.getCoreRowModel().rowsById[m],!b))throw new Error;return b},_getDefaultColumnDef:dt(()=>[i.options.defaultColumn],m=>{var v;return m=(v=m)!=null?v:{},{header:b=>{const S=b.header.column.columnDef;return S.accessorKey?S.accessorKey:S.accessorFn?S.id:null},cell:b=>{var S,w;return(S=(w=b.renderValue())==null||w.toString==null?void 0:w.toString())!=null?S:null},...i._features.reduce((b,S)=>Object.assign(b,S.getDefaultColumnDef==null?void 0:S.getDefaultColumnDef()),{}),...m}},ht(t,"debugColumns")),_getColumnDefs:()=>i.options.columns,getAllColumns:dt(()=>[i._getColumnDefs()],m=>{const v=function(b,S,w){return w===void 0&&(w=0),b.map(C=>{const R=d2(i,C,w,S),T=C;return R.columns=T.columns?v(T.columns,R,w+1):[],R})};return v(m)},ht(t,"debugColumns")),getAllFlatColumns:dt(()=>[i.getAllColumns()],m=>m.flatMap(v=>v.getFlatColumns()),ht(t,"debugColumns")),_getAllFlatColumnsById:dt(()=>[i.getAllFlatColumns()],m=>m.reduce((v,b)=>(v[b.id]=b,v),{}),ht(t,"debugColumns")),getAllLeafColumns:dt(()=>[i.getAllColumns(),i._getOrderColumnsFn()],(m,v)=>{let b=m.flatMap(S=>S.getLeafColumns());return v(b)},ht(t,"debugColumns")),getColumn:m=>i._getAllFlatColumnsById()[m]};Object.assign(i,p);for(let m=0;m<i._features.length;m++){const v=i._features[m];v==null||v.createTable==null||v.createTable(i)}return i}function Y2(){return t=>dt(()=>[t.options.data],e=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(i,s,a){s===void 0&&(s=0);const u=[];for(let d=0;d<i.length;d++){const g=g2(t,t._getRowId(i[d],d,a),i[d],d,s,void 0,a?.id);if(n.flatRows.push(g),n.rowsById[g.id]=g,u.push(g),t.options.getSubRows){var f;g.originalSubRows=t.options.getSubRows(i[d],d),(f=g.originalSubRows)!=null&&f.length&&(g.subRows=r(g.originalSubRows,s+1,g))}}return u};return n.rows=r(e),n},ht(t.options,"debugTable","getRowModel",()=>t._autoResetPageIndex()))}function X2(){return t=>dt(()=>[t.getState().sorting,t.getPreSortedRowModel()],(e,n)=>{if(!n.rows.length||!(e!=null&&e.length))return n;const r=t.getState().sorting,i=[],s=r.filter(f=>{var d;return(d=t.getColumn(f.id))==null?void 0:d.getCanSort()}),a={};s.forEach(f=>{const d=t.getColumn(f.id);d&&(a[f.id]={sortUndefined:d.columnDef.sortUndefined,invertSorting:d.columnDef.invertSorting,sortingFn:d.getSortingFn()})});const u=f=>{const d=f.map(g=>({...g}));return d.sort((g,p)=>{for(let v=0;v<s.length;v+=1){var m;const b=s[v],S=a[b.id],w=S.sortUndefined,C=(m=b?.desc)!=null?m:!1;let R=0;if(w){const T=g.getValue(b.id),A=p.getValue(b.id),O=T===void 0,P=A===void 0;if(O||P){if(w==="first")return O?-1:1;if(w==="last")return O?1:-1;R=O&&P?0:O?w:-w}}if(R===0&&(R=S.sortingFn(g,p,b.id)),R!==0)return C&&(R*=-1),S.invertSorting&&(R*=-1),R}return g.index-p.index}),d.forEach(g=>{var p;i.push(g),(p=g.subRows)!=null&&p.length&&(g.subRows=u(g.subRows))}),d};return{rows:u(n.rows),flatRows:i,rowsById:n.rowsById}},ht(t.options,"debugTable","getSortedRowModel",()=>t._autoResetPageIndex()))}function rb(t,e){return t?Q2(t)?E.createElement(t,e):t:null}function Q2(t){return Z2(t)||typeof t=="function"||J2(t)}function Z2(t){return typeof t=="function"&&(()=>{const e=Object.getPrototypeOf(t);return e.prototype&&e.prototype.isReactComponent})()}function J2(t){return typeof t=="object"&&typeof t.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(t.$$typeof.description)}function eG(t){const e={state:{},onStateChange:()=>{},renderFallbackValue:null,...t},[n]=E.useState(()=>({current:K2(e)})),[r,i]=E.useState(()=>n.current.initialState);return n.current.setOptions(s=>({...s,...t,state:{...r,...t.state},onStateChange:a=>{i(a),t.onStateChange==null||t.onStateChange(a)}})),n.current}const Vm=0,pa=1,Nc=2,Az=4;function WM(t){return()=>t}function tG(t){t()}function bd(t,e){return n=>t(e(n))}function KM(t,e){return()=>t(e)}function nG(t,e){return n=>t(e,n)}function Fw(t){return t!==void 0}function rG(...t){return()=>{t.map(tG)}}function Lc(){}function Fm(t,e){return e(t),t}function iG(t,e){return e(t)}function Nn(...t){return t}function ln(t,e){return t(pa,e)}function St(t,e){t(Vm,e)}function Uw(t){t(Nc)}function _n(t){return t(Az)}function et(t,e){return ln(t,nG(e,Vm))}function Do(t,e){const n=t(pa,r=>{n(),e(r)});return n}function YM(t){let e,n;return r=>i=>{e=i,n&&clearTimeout(n),n=setTimeout(()=>{r(e)},t)}}function Mz(t,e){return t===e}function Dn(t=Mz){let e;return n=>r=>{t(e,r)||(e=r,n(r))}}function ct(t){return e=>n=>{t(n)&&e(n)}}function Ue(t){return e=>bd(e,t)}function os(t){return e=>()=>{e(t)}}function we(t,...e){const n=oG(...e);return((r,i)=>{switch(r){case Nc:Uw(t);return;case pa:return ln(t,n(i))}})}function fs(t,e){return n=>r=>{n(e=t(e,r))}}function au(t){return e=>n=>{t>0?t--:e(n)}}function Ks(t){let e=null,n;return r=>i=>{e=i,!n&&(n=setTimeout(()=>{n=void 0,r(e)},t))}}function Et(...t){const e=new Array(t.length);let n=0,r=null;const i=2**t.length-1;return t.forEach((s,a)=>{const u=2**a;ln(s,f=>{const d=n;n|=u,e[a]=f,d!==i&&n===i&&r&&(r(),r=null)})}),s=>a=>{const u=()=>{s([a].concat(e))};n===i?u():r=u}}function oG(...t){return e=>t.reduceRight(iG,e)}function sG(t){let e,n;const r=()=>e?.();return function(i,s){switch(i){case pa:return s?n===s?void 0:(r(),n=s,e=ln(t,s),e):(r(),Lc);case Nc:r(),n=null;return}}}function Me(t){let e=t;const n=Ft();return((r,i)=>{switch(r){case Vm:e=i;break;case pa:{i(e);break}case Az:return e}return n(r,i)})}function Kr(t,e){return Fm(Me(e),n=>et(t,n))}function Ft(){const t=[];return((e,n)=>{switch(e){case Vm:t.slice().forEach(r=>{r(n)});return;case Nc:t.splice(0,t.length);return;case pa:return t.push(n),()=>{const r=t.indexOf(n);r>-1&&t.splice(r,1)}}})}function zi(t){return Fm(Ft(),e=>et(t,e))}function Xt(t,e=[],{singleton:n}={singleton:!0}){return{constructor:t,dependencies:e,id:lG(),singleton:n}}const lG=()=>Symbol();function aG(t){const e=new Map,n=({constructor:r,dependencies:i,id:s,singleton:a})=>{if(a&&e.has(s))return e.get(s);const u=r(i.map(f=>n(f)));return a&&e.set(s,u),u};return n(t)}function dr(...t){const e=Ft(),n=new Array(t.length);let r=0;const i=2**t.length-1;return t.forEach((s,a)=>{const u=2**a;ln(s,f=>{n[a]=f,r|=u,r===i&&St(e,n)})}),function(s,a){switch(s){case Nc:{Uw(e);return}case pa:return r===i&&a(n),ln(e,a)}}}function ut(t,e=Mz){return we(t,Dn(e))}function Lx(...t){return function(e,n){switch(e){case Nc:return;case pa:return rG(...t.map(r=>ln(r,n)))}}}const br={DEBUG:0,INFO:1,WARN:2,ERROR:3},uG={[br.DEBUG]:"debug",[br.ERROR]:"error",[br.INFO]:"log",[br.WARN]:"warn"},cG=()=>typeof globalThis>"u"?window:globalThis,ma=Xt(()=>{const t=Me(br.ERROR);return{log:Me((e,n,r=br.INFO)=>{const i=cG().VIRTUOSO_LOG_LEVEL??_n(t);r>=i&&console[uG[r]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",e,n)}),logLevel:t}},[],{singleton:!0}),Bx=new WeakMap;function Oz(t){return"self"in t?t.document.documentElement:t}function fG(t){const e=Oz(t),n=Bx.get(e);if(n!==void 0)return n;const r=e.ownerDocument.defaultView.getComputedStyle(e).direction==="rtl";return Bx.set(e,r),r}function XM(t){Bx.delete(Oz(t))}function kz(t,e){return fG(t)?-e:e}const Ka=kz;function QM(t,e){return kz(t,e)}function ys(t,e,n){return $w(t,e,n).callbackRef}function $w(t,e,n){const r=Le.useRef(null);let i=a=>{};const s=Le.useMemo(()=>typeof ResizeObserver<"u"?new ResizeObserver(a=>{const u=()=>{const f=a[0].target;f.offsetParent!==null&&t(f)};n?u():requestAnimationFrame(u)}):null,[t,n]);return i=a=>{a&&e?(s?.observe(a),r.current=a):(r.current&&s?.unobserve(r.current),r.current=null)},{callbackRef:i,ref:r}}function Iz(t,e,n,r,i,s,a,u,f){const d=Le.useCallback(g=>{const p=dG(g.children,e,u?"offsetWidth":"offsetHeight",i);let m=g.parentElement;for(;m.dataset.virtuosoScroller===void 0;)m=m.parentElement;const v=m.lastElementChild.dataset.viewportType==="window";let b;v&&(b=m.ownerDocument.defaultView);const S=a?u?a.scrollWidth:a.scrollHeight:v?u?b.document.documentElement.scrollWidth:b.document.documentElement.scrollHeight:u?m.scrollWidth:m.scrollHeight,w=a?u?a.offsetWidth:a.offsetHeight:v?u?b.innerWidth:b.innerHeight:u?m.offsetWidth:m.offsetHeight,C=a?u?Ka(a,a.scrollLeft):a.scrollTop:v?u?Ka(b,b.scrollX||b.document.documentElement.scrollLeft):b.scrollY||b.document.documentElement.scrollTop:u?Ka(m,m.scrollLeft):m.scrollTop;r({scrollHeight:S,scrollTop:Math.max(C,0),viewportHeight:w}),s?.(u?ZM("column-gap",getComputedStyle(g).columnGap,i):ZM("row-gap",getComputedStyle(g).rowGap,i)),p!==null&&t(p)},[t,e,i,s,a,r,u]);return $w(d,n,f)}function dG(t,e,n,r){const i=t.length;if(i===0)return null;const s=[];for(let a=0;a<i;a++){const u=t.item(a);if(u.dataset.index===void 0)continue;const f=parseInt(u.dataset.index),d=parseFloat(u.dataset.knownSize),g=e(u,n);if(g===0&&r("Zero-sized element, this should not happen",{child:u},br.ERROR),g===d)continue;const p=s[s.length-1];s.length===0||p.size!==g||p.endIndex!==f-1?s.push({endIndex:f,size:g,startIndex:f}):s[s.length-1].endIndex++}return s}function ZM(t,e,n){return e!=="normal"&&e?.endsWith("px")!==!0&&n(`${t} was not resolved to pixel value correctly`,e,br.WARN),e==="normal"?0:parseInt(e??"0",10)}function qw(t,e,n){const r=Le.useRef(null),i=Le.useCallback(f=>{if(!f?.offsetParent)return;const d=f.getBoundingClientRect(),g=d.width;let p,m;if(e){const v=e.getBoundingClientRect(),b=d.top-v.top;m=v.height-Math.max(0,b),p=b+e.scrollTop}else{const v=a.current.ownerDocument.defaultView;m=v.innerHeight-Math.max(0,d.top),p=d.top+v.scrollY}r.current={listHeight:d.height,offsetTop:p,visibleHeight:m,visibleWidth:g},t(r.current)},[t,e]),{callbackRef:s,ref:a}=$w(i,!0,n),u=Le.useCallback(()=>{i(a.current)},[i,a]);return Le.useEffect(()=>{if(e){e.addEventListener("scroll",u);const d=new ResizeObserver(()=>{requestAnimationFrame(u)});return d.observe(e),()=>{e.removeEventListener("scroll",u),d.unobserve(e)}}const f=a.current?.ownerDocument.defaultView;return f?.addEventListener("scroll",u),f?.addEventListener("resize",u),()=>{f?.removeEventListener("scroll",u),f?.removeEventListener("resize",u)}},[u,e,a]),s}const si=Xt(()=>{const t=Ft(),e=Ft(),n=Me(0),r=Ft(),i=Me(0),s=Ft(),a=Ft(),u=Me(0),f=Me(0),d=Me(0),g=Me(0),p=Ft(),m=Ft(),v=Me(!1),b=Me(!1),S=Me(!1);return et(we(t,Ue(({scrollTop:w})=>w)),e),et(we(t,Ue(({scrollHeight:w})=>w)),a),et(e,i),{deviation:n,fixedFooterHeight:d,fixedHeaderHeight:f,footerHeight:g,headerHeight:u,horizontalDirection:b,scrollBy:m,scrollContainerState:t,scrollHeight:a,scrollingInProgress:v,scrollTo:p,scrollTop:e,skipAnimationFrameInResizeObserver:S,smoothScrollTargetReached:r,statefulScrollTop:i,viewportHeight:s}},[],{singleton:!0}),xd={lvl:0};function Dz(t,e){const n=t.length;if(n===0)return[];let{index:r,value:i}=e(t[0]);const s=[];for(let a=1;a<n;a++){const{index:u,value:f}=e(t[a]);s.push({end:u-1,start:r,value:i}),r=u,i=f}return s.push({end:1/0,start:r,value:i}),s}function vn(t){return t===xd}function Sd(t,e){if(!vn(t))return e===t.k?t.v:e<t.k?Sd(t.l,e):Sd(t.r,e)}function No(t,e,n="k"){if(vn(t))return[-1/0,void 0];if(Number(t[n])===e)return[t.k,t.v];if(Number(t[n])<e){const r=No(t.r,e,n);return r[0]===-1/0?[t.k,t.v]:r}return No(t.l,e,n)}function Ii(t,e,n){return vn(t)?Nz(e,n,1):e===t.k?mr(t,{k:e,v:n}):e<t.k?JM(mr(t,{l:Ii(t.l,e,n)})):JM(mr(t,{r:Ii(t.r,e,n)}))}function uc(){return xd}function cc(t,e,n){if(vn(t))return[];const r=No(t,e)[0];return hG(Hx(t,r,n))}function _x(t,e){if(vn(t))return xd;const{k:n,l:r,r:i}=t;if(e===n){if(vn(r))return i;if(vn(i))return r;const[s,a]=zz(r);return gp(mr(t,{k:s,l:Pz(r),v:a}))}return e<n?gp(mr(t,{l:_x(r,e)})):gp(mr(t,{r:_x(i,e)}))}function Ya(t){return vn(t)?[]:[...Ya(t.l),{k:t.k,v:t.v},...Ya(t.r)]}function Hx(t,e,n){if(vn(t))return[];const{k:r,l:i,r:s,v:a}=t;let u=[];return r>e&&(u=u.concat(Hx(i,e,n))),r>=e&&r<=n&&u.push({k:r,v:a}),r<=n&&(u=u.concat(Hx(s,e,n))),u}function gp(t){const{l:e,lvl:n,r}=t;if(r.lvl>=n-1&&e.lvl>=n-1)return t;if(n>r.lvl+1){if(ib(e))return Lz(mr(t,{lvl:n-1}));if(!vn(e)&&!vn(e.r))return mr(e.r,{l:mr(e,{r:e.r.l}),lvl:n,r:mr(t,{l:e.r.r,lvl:n-1})});throw new Error("Unexpected empty nodes")}if(ib(t))return jx(mr(t,{lvl:n-1}));if(!vn(r)&&!vn(r.l)){const i=r.l,s=ib(i)?r.lvl-1:r.lvl;return mr(i,{l:mr(t,{lvl:n-1,r:i.l}),lvl:i.lvl+1,r:jx(mr(r,{l:i.r,lvl:s}))})}throw new Error("Unexpected empty nodes")}function mr(t,e){return Nz(e.k!==void 0?e.k:t.k,e.v!==void 0?e.v:t.v,e.lvl!==void 0?e.lvl:t.lvl,e.l!==void 0?e.l:t.l,e.r!==void 0?e.r:t.r)}function Pz(t){return vn(t.r)?t.l:gp(mr(t,{r:Pz(t.r)}))}function ib(t){return vn(t)||t.lvl>t.r.lvl}function zz(t){return vn(t.r)?[t.k,t.v]:zz(t.r)}function Nz(t,e,n,r=xd,i=xd){return{k:t,l:r,lvl:n,r:i,v:e}}function JM(t){return jx(Lz(t))}function Lz(t){const{l:e}=t;return!vn(e)&&e.lvl===t.lvl?mr(e,{r:mr(t,{l:e.r})}):t}function jx(t){const{lvl:e,r:n}=t;return!vn(n)&&!vn(n.r)&&n.lvl===e&&n.r.lvl===e?mr(n,{l:mr(t,{r:n.l}),lvl:e+1}):t}function hG(t){return Dz(t,({k:e,v:n})=>({index:e,value:n}))}function Bz(t,e){return!!(t&&t.startIndex===e.startIndex&&t.endIndex===e.endIndex)}function wd(t,e){return!!(t&&t[0]===e[0]&&t[1]===e[1])}const Gw=Xt(()=>({recalcInProgress:Me(!1)}),[],{singleton:!0});function _z(t,e,n){return t[jp(t,e,n)]}function jp(t,e,n,r=0){let i=t.length-1;for(;r<=i;){const s=Math.floor((r+i)/2),a=t[s],u=n(a,e);if(u===0)return s;if(u===-1){if(i-r<2)return s-1;i=s-1}else{if(i===r)return s;r=s+1}}throw new Error(`Failed binary finding record in array - ${t.join(",")}, searched for ${e}`)}function gG(t,e,n,r){const i=jp(t,e,r),s=jp(t,n,r,i);return t.slice(i,s+1)}function Lo(t,e){return Math.round(t.getBoundingClientRect()[e])}function Um(t){return!vn(t.groupOffsetTree)}function Ww({index:t},e){return e===t?0:e<t?-1:1}function pG(){return{groupIndices:[],groupOffsetTree:uc(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:uc()}}function mG(t,e){let n=vn(t)?0:1/0;for(const r of e){const{endIndex:i,size:s,startIndex:a}=r;if(n=Math.min(n,a),vn(t)){t=Ii(t,0,s);continue}const u=cc(t,a-1,i+1);if(u.some(CG(r)))continue;let f=!1,d=!1;for(const{end:g,start:p,value:m}of u)f?(i>=p||s===m)&&(t=_x(t,p)):(d=m!==s,f=!0),g>i&&i>=p&&m!==s&&(t=Ii(t,i+1,m));d&&(t=Ii(t,a,s))}return[t,n]}function yG(t){return typeof t.groupIndex<"u"}function vG({offset:t},e){return e===t?0:e<t?-1:1}function Cd(t,e,n){if(e.length===0)return 0;const{index:r,offset:i,size:s}=_z(e,t,Ww),a=t-r,u=s*a+(a-1)*n+i;return u>0?u+n:u}function Hz(t,e){if(!Um(e))return t;let n=0;for(;e.groupIndices[n]<=t+n;)n++;return t+n}function jz(t,e,n){if(yG(t))return e.groupIndices[t.groupIndex]+1;const r=t.index==="LAST"?n:t.index;let i=Hz(r,e);return i=Math.max(0,i,Math.min(n,i)),i}function bG(t,e,n,r=0){return r>0&&(e=Math.max(e,_z(t,r,Ww).offset)),Dz(gG(t,e,n,vG),wG)}function xG(t,[e,n,r,i]){e.length>0&&r("received item sizes",e,br.DEBUG);const s=t.sizeTree;let a=s,u=0;if(n.length>0&&vn(s)&&e.length===2){const m=e[0].size,v=e[1].size;a=n.reduce((b,S)=>Ii(Ii(b,S,m),S+1,v),a)}else[a,u]=mG(a,e);if(a===s)return t;const{lastIndex:f,lastOffset:d,lastSize:g,offsetTree:p}=Vx(t.offsetTree,u,a,i);return{groupIndices:n,groupOffsetTree:n.reduce((m,v)=>Ii(m,v,Cd(v,p,i)),uc()),lastIndex:f,lastOffset:d,lastSize:g,offsetTree:p,sizeTree:a}}function SG(t){return Ya(t).map(({k:e,v:n},r,i)=>{const s=i[r+1];return{endIndex:s!==void 0?s.k-1:1/0,size:n,startIndex:e}})}function eO(t,e){let n=0,r=0;for(;n<t;)n+=e[r+1]-e[r]-1,r++;return r-(n===t?0:1)}function Vx(t,e,n,r){let i=t,s=0,a=0,u=0,f=0;if(e!==0){f=jp(i,e-1,Ww),u=i[f].offset;const d=No(n,e-1);s=d[0],a=d[1],i.length&&i[f].size===No(n,e)[1]&&(f-=1),i=i.slice(0,f+1)}else i=[];for(const{start:d,value:g}of cc(n,e,1/0)){const p=d-s,m=p*a+u+p*r;i.push({index:d,offset:m,size:g}),s=d,u=m,a=g}return{lastIndex:s,lastOffset:u,lastSize:a,offsetTree:i}}function wG(t){return{index:t.index,value:t}}function CG(t){const{endIndex:e,size:n,startIndex:r}=t;return i=>i.start===r&&(i.end===e||i.end===1/0)&&i.value===n}const RG={offsetHeight:"height",offsetWidth:"width"},bs=Xt(([{log:t},{recalcInProgress:e}])=>{const n=Ft(),r=Ft(),i=Kr(r,0),s=Ft(),a=Ft(),u=Me(0),f=Me([]),d=Me(void 0),g=Me(void 0),p=Me(void 0),m=Me(void 0),v=Me((M,D)=>Lo(M,RG[D])),b=Me(void 0),S=Me(0),w=pG(),C=Kr(we(n,Et(f,t,S),fs(xG,w),Dn()),w),R=Kr(we(f,Dn(),fs((M,D)=>({current:D,prev:M.current}),{current:[],prev:[]}),Ue(({prev:M})=>M)),[]);et(we(f,ct(M=>M.length>0),Et(C,S),Ue(([M,D,L])=>{const H=M.reduce((N,_,$)=>Ii(N,_,Cd(_,D.offsetTree,L)||$),uc());return{...D,groupIndices:M,groupOffsetTree:H}})),C),et(we(r,Et(C),ct(([M,{lastIndex:D}])=>M<D),Ue(([M,{lastIndex:D,lastSize:L}])=>[{endIndex:D,size:L,startIndex:M}])),n),et(d,g);const T=Kr(we(d,Ue(M=>M===void 0)),!0);et(we(g,ct(M=>M!==void 0&&vn(_n(C).sizeTree)),Ue(M=>{const D=_n(p),L=_n(f).length>0;return D!==void 0&&D!==0?L?[{endIndex:0,size:D,startIndex:0},{endIndex:1,size:M,startIndex:1}]:[]:[{endIndex:0,size:M,startIndex:0}]})),n),et(we(m,ct(M=>M!==void 0&&M.length>0&&vn(_n(C).sizeTree)),Ue(M=>{const D=[];let L=M[0],H=0;for(let N=1;N<M.length;N++){const _=M[N];_!==L&&(D.push({endIndex:N-1,size:L,startIndex:H}),L=_,H=N)}return D.push({endIndex:M.length-1,size:L,startIndex:H}),D})),n),et(we(f,Et(p,g),ct(([,M,D])=>M!==void 0&&D!==void 0),Ue(([M,D,L])=>{const H=[];for(let N=0;N<M.length;N++){const _=M[N],$=M[N+1];H.push({startIndex:_,endIndex:_,size:D}),$!==void 0&&H.push({startIndex:_+1,endIndex:$-1,size:L})}return H})),n);const A=zi(we(n,Et(C),fs(({sizes:M},[D,L])=>({changed:L!==M,sizes:L}),{changed:!1,sizes:w}),Ue(M=>M.changed)));ln(we(u,fs((M,D)=>({diff:M.prev-D,prev:D}),{diff:0,prev:0}),Ue(M=>M.diff)),M=>{const{groupIndices:D}=_n(C);if(M>0)St(e,!0),St(s,M+eO(M,D));else if(M<0){const L=_n(R);L.length>0&&(M-=eO(-M,L)),St(a,M)}}),ln(we(u,Et(t)),([M,D])=>{M<0&&D("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:u},br.ERROR)});const O=zi(s);et(we(s,Et(C),Ue(([M,D])=>{const L=D.groupIndices.length>0,H=[],N=D.lastSize;if(L){const _=Sd(D.sizeTree,0);let $=0,F=0;for(;$<M;){const j=D.groupIndices[F],q=D.groupIndices.length===F+1?1/0:D.groupIndices[F+1]-j-1;H.push({endIndex:j,size:_,startIndex:j}),H.push({endIndex:j+1+q-1,size:N,startIndex:j+1}),F++,$+=q+1}const G=Ya(D.sizeTree);return $!==M&&G.shift(),G.reduce((j,{k:q,v:V})=>{let te=j.ranges;return j.prevSize!==0&&(te=[...j.ranges,{endIndex:q+M-1,size:j.prevSize,startIndex:j.prevIndex}]),{prevIndex:q+M,prevSize:V,ranges:te}},{prevIndex:M,prevSize:0,ranges:H}).ranges}return Ya(D.sizeTree).reduce((_,{k:$,v:F})=>({prevIndex:$+M,prevSize:F,ranges:[..._.ranges,{endIndex:$+M-1,size:_.prevSize,startIndex:_.prevIndex}]}),{prevIndex:0,prevSize:N,ranges:[]}).ranges})),n);const P=zi(we(a,Et(C,S),Ue(([M,{offsetTree:D},L])=>{const H=-M;return Cd(H,D,L)})));return et(we(a,Et(C,S),Ue(([M,D,L])=>{if(D.groupIndices.length>0){if(vn(D.sizeTree))return D;let N=uc();const _=_n(R);let $=0,F=0,G=0;for(;$<-M;){G=_[F];const j=_[F+1]-G-1;F++,$+=j+1}if(N=Ya(D.sizeTree).reduce((j,{k:q,v:V})=>Ii(j,Math.max(0,q+M),V),N),$!==-M){const j=Sd(D.sizeTree,G);N=Ii(N,0,j);const q=No(D.sizeTree,-M+1)[1];N=Ii(N,1,q)}return{...D,sizeTree:N,...Vx(D.offsetTree,0,N,L)}}const H=Ya(D.sizeTree).reduce((N,{k:_,v:$})=>Ii(N,Math.max(0,_+M),$),uc());return{...D,sizeTree:H,...Vx(D.offsetTree,0,H,L)}})),C),{beforeUnshiftWith:O,data:b,defaultItemSize:g,firstItemIndex:u,fixedItemSize:d,fixedGroupSize:p,gap:S,groupIndices:f,heightEstimates:m,itemSize:v,listRefresh:A,shiftWith:a,shiftWithOffset:P,sizeRanges:n,sizes:C,statefulTotalCount:i,totalCount:r,trackItemSizes:T,unshiftWith:s}},Nn(ma,Gw),{singleton:!0});function EG(t){return t.reduce((e,n)=>(e.groupIndices.push(e.totalCount),e.totalCount+=n+1,e),{groupIndices:[],totalCount:0})}const Vz=Xt(([{groupIndices:t,sizes:e,totalCount:n},{headerHeight:r,scrollTop:i}])=>{const s=Ft(),a=Ft(),u=zi(we(s,Ue(EG)));return et(we(u,Ue(f=>f.totalCount)),n),et(we(u,Ue(f=>f.groupIndices)),t),et(we(dr(i,e,r),ct(([f,d])=>Um(d)),Ue(([f,d,g])=>No(d.groupOffsetTree,Math.max(f-g,0),"v")[0]),Dn(),Ue(f=>[f])),a),{groupCounts:s,topItemsIndexes:a}},Nn(bs,si)),ya=Xt(([{log:t}])=>{const e=Me(!1),n=zi(we(e,ct(r=>r),Dn()));return ln(e,r=>{r&&_n(t)("props updated",{},br.DEBUG)}),{didMount:n,propsReady:e}},Nn(ma),{singleton:!0}),TG=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function Fz(t){const e=typeof t=="number"?{index:t}:t;return e.align||(e.align="start"),(!e.behavior||!TG)&&(e.behavior="auto"),e.offset===void 0&&(e.offset=0),e}const qd=Xt(([{gap:t,listRefresh:e,sizes:n,totalCount:r},{fixedFooterHeight:i,fixedHeaderHeight:s,footerHeight:a,headerHeight:u,scrollingInProgress:f,scrollTo:d,smoothScrollTargetReached:g,viewportHeight:p},{log:m}])=>{const v=Ft(),b=Ft(),S=Me(0);let w=null,C=null,R=null;function T(){w!==null&&(w(),w=null),R!==null&&(R(),R=null),C&&(clearTimeout(C),C=null),St(f,!1)}return et(we(v,Et(n,p,r,S,u,a,m),Et(t,s,i),Ue(([[A,O,P,M,D,L,H,N],_,$,F])=>{const G=Fz(A),{align:j,behavior:q,offset:V}=G,te=M-1,J=jz(G,O,te);let z=Cd(J,O.offsetTree,_)+L;j==="end"?(z+=$+No(O.sizeTree,J)[1]-P+F,J===te&&(z+=H)):j==="center"?z+=($+No(O.sizeTree,J)[1]-P+F)/2:z-=D,V!==void 0&&V!==0&&(z+=V);const U=W=>{T(),W?(N("retrying to scroll to",{location:A},br.DEBUG),St(v,A)):(St(b,!0),N("list did not change, scroll successful",{},br.DEBUG))};if(T(),q==="smooth"){let W=!1;R=ln(e,X=>{W=W||X}),w=Do(g,()=>{U(W)})}else w=Do(we(e,AG(150)),U);return C=setTimeout(()=>{T()},1200),St(f,!0),N("scrolling from index to",{behavior:q,index:J,top:z},br.DEBUG),{behavior:q,top:z}})),d),{scrollTargetReached:b,scrollToIndex:v,topListHeight:S}},Nn(bs,si,ma),{singleton:!0});function AG(t){return e=>{const n=setTimeout(()=>{e(!1)},t);return r=>{r&&(e(!0),clearTimeout(n))}}}function Kw(t,e){t===0?e():requestAnimationFrame(()=>{Kw(t-1,e)})}function Yw(t,e){const n=e-1;return typeof t=="number"?t:t.index==="LAST"?n:t.index}const Gd=Xt(([{defaultItemSize:t,listRefresh:e,sizes:n},{scrollTop:r},{scrollTargetReached:i,scrollToIndex:s},{didMount:a}])=>{const u=Me(!0),f=Me(0),d=Me(!0);return et(we(a,Et(f),ct(([g,p])=>p!==0),os(!1)),u),et(we(a,Et(f),ct(([g,p])=>p!==0),os(!1)),d),ln(we(dr(e,a),Et(u,n,t,d),ct(([[,g],p,{sizeTree:m},v,b])=>g&&(!vn(m)||Fw(v))&&!p&&!b),Et(f)),([,g])=>{Do(i,()=>{St(d,!0)}),Kw(4,()=>{Do(r,()=>{St(u,!0)}),St(s,g)})}),{initialItemFinalLocationReached:d,initialTopMostItemIndex:f,scrolledToInitialItem:u}},Nn(bs,si,qd,ya),{singleton:!0});function Uz(t,e){return Math.abs(t-e)<1.01}const Rd="up",Zf="down",MG="none",OG={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},kG=0,Wd=Xt(([{footerHeight:t,headerHeight:e,scrollBy:n,scrollContainerState:r,scrollTop:i,viewportHeight:s}])=>{const a=Me(!1),u=Me(!0),f=Ft(),d=Ft(),g=Me(4),p=Me(kG),m=Kr(we(Lx(we(ut(i),au(1),os(!0)),we(ut(i),au(1),os(!1),YM(100))),Dn()),!1),v=Kr(we(Lx(we(n,os(!0)),we(n,os(!1),YM(200))),Dn()),!1);et(we(dr(ut(i),ut(p)),Ue(([R,T])=>R<=T),Dn()),u),et(we(u,Ks(50)),d);const b=zi(we(dr(r,ut(s),ut(e),ut(t),ut(g)),fs((R,[{scrollHeight:T,scrollTop:A},O,P,M,D])=>{const L=A+O-T>-D,H={scrollHeight:T,scrollTop:A,viewportHeight:O};if(L){let _,$;return A>R.state.scrollTop?(_="SCROLLED_DOWN",$=R.state.scrollTop-A):(_="SIZE_DECREASED",$=R.state.scrollTop-A||R.scrollTopDelta),{atBottom:!0,atBottomBecause:_,scrollTopDelta:$,state:H}}let N;return H.scrollHeight>R.state.scrollHeight?N="SIZE_INCREASED":O<R.state.viewportHeight?N="VIEWPORT_HEIGHT_DECREASING":A<R.state.scrollTop?N="SCROLLING_UPWARDS":N="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:N,state:H}},OG),Dn((R,T)=>R!==void 0&&R.atBottom===T.atBottom))),S=Kr(we(r,fs((R,{scrollHeight:T,scrollTop:A,viewportHeight:O})=>{if(!Uz(R.scrollHeight,T)){const P=T-(A+O)<1;return R.scrollTop!==A&&P?{changed:!0,jump:R.scrollTop-A,scrollHeight:T,scrollTop:A}:{changed:!0,jump:0,scrollHeight:T,scrollTop:A}}return{changed:!1,jump:0,scrollHeight:T,scrollTop:A}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),ct(R=>R.changed),Ue(R=>R.jump)),0);et(we(b,Ue(R=>R.atBottom)),a),et(we(a,Ks(50)),f);const w=Me(Zf);et(we(r,Ue(({scrollTop:R})=>R),Dn(),fs((R,T)=>_n(v)?{direction:R.direction,prevScrollTop:T}:{direction:T<R.prevScrollTop?Rd:Zf,prevScrollTop:T},{direction:Zf,prevScrollTop:0}),Ue(R=>R.direction)),w),et(we(r,Ks(50),os(MG)),w);const C=Me(0);return et(we(m,ct(R=>!R),os(0)),C),et(we(i,Ks(100),Et(m),ct(([R,T])=>T),fs(([R,T],[A])=>[T,A],[0,0]),Ue(([R,T])=>T-R)),C),{atBottomState:b,atBottomStateChange:f,atBottomThreshold:g,atTopStateChange:d,atTopThreshold:p,isAtBottom:a,isAtTop:u,isScrolling:m,lastJumpDueToItemResize:S,scrollDirection:w,scrollVelocity:C}},Nn(si)),Ed="top",Td="bottom",tO="none";function nO(t,e,n){return typeof t=="number"?n===Rd&&e===Ed||n===Zf&&e===Td?t:0:n===Rd?e===Ed?t.main:t.reverse:e===Td?t.main:t.reverse}function rO(t,e){return typeof t=="number"?t:t[e]??0}const Xw=Xt(([{deviation:t,fixedHeaderHeight:e,headerHeight:n,scrollTop:r,viewportHeight:i}])=>{const s=Ft(),a=Me(0),u=Me(0),f=Me(0),d=Kr(we(dr(ut(r),ut(i),ut(n),ut(s,wd),ut(f),ut(a),ut(e),ut(t),ut(u)),Ue(([g,p,m,[v,b],S,w,C,R,T])=>{const A=g-R,O=w+C,P=Math.max(m-A,0);let M=tO;const D=rO(T,Ed),L=rO(T,Td);return v-=R,v+=m+C,b+=m+C,b-=R,v>g+O-D&&(M=Rd),b<g-P+p+L&&(M=Zf),M!==tO?[Math.max(A-m-nO(S,Ed,M)-D,0),A-P-C+p+nO(S,Td,M)+L]:null}),ct(g=>g!==null),Dn(wd)),[0,0]);return{increaseViewportBy:u,listBoundary:s,overscan:f,topListHeight:a,visibleRange:d}},Nn(si),{singleton:!0});function IG(t,e,n){if(Um(e)){const r=Hz(t,e);return[{index:No(e.groupOffsetTree,r)[0],offset:0,size:0},{data:n?.[0],index:r,offset:0,size:0}]}return[{data:n?.[0],index:t,offset:0,size:0}]}const ob={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function pp(t,e,n,r,i,s){const{lastIndex:a,lastOffset:u,lastSize:f}=i;let d=0,g=0;if(t.length>0){d=t[0].offset;const S=t[t.length-1];g=S.offset+S.size}const p=n-a,m=u+p*f+(p-1)*r,v=d,b=m-g;return{bottom:g,firstItemIndex:s,items:iO(t,i,s),offsetBottom:b,offsetTop:d,top:v,topItems:iO(e,i,s),topListHeight:e.reduce((S,w)=>w.size+S,0),totalCount:n}}function $z(t,e,n,r,i,s){let a=0;if(n.groupIndices.length>0)for(const g of n.groupIndices){if(g-a>=t)break;a++}const u=t+a,f=Yw(e,u),d=Array.from({length:u}).map((g,p)=>({data:s[p+f],index:p+f,offset:0,size:0}));return pp(d,[],u,i,n,r)}function iO(t,e,n){if(t.length===0)return[];if(!Um(e))return t.map(d=>({...d,index:d.index+n,originalIndex:d.index}));const r=t[0].index,i=t[t.length-1].index,s=[],a=cc(e.groupOffsetTree,r,i);let u,f=0;for(const d of t){(!u||u.end<d.index)&&(u=a.shift(),f=e.groupIndices.indexOf(u.start));let g;d.index===u.start?g={index:f,type:"group"}:g={groupIndex:f,index:d.index-(f+1)+n},s.push({...g,data:d.data,offset:d.offset,originalIndex:d.index,size:d.size})}return s}function oO(t,e){return t===void 0?0:typeof t=="number"?t:t[e]??0}const vu=Xt(([{data:t,firstItemIndex:e,gap:n,sizes:r,totalCount:i},s,{listBoundary:a,topListHeight:u,visibleRange:f},{initialTopMostItemIndex:d,scrolledToInitialItem:g},{topListHeight:p},m,{didMount:v},{recalcInProgress:b}])=>{const S=Me([]),w=Me(0),C=Ft(),R=Me(0);et(s.topItemsIndexes,S);const T=Kr(we(dr(v,b,ut(f,wd),ut(i),ut(r),ut(d),g,ut(S),ut(e),ut(n),ut(R),t),ct(([M,D,,L,,,,,,,,H])=>{const N=H!==void 0&&H.length!==L;return M&&!D&&!N}),Ue(([,,[M,D],L,H,N,_,$,F,G,j,q])=>{const V=H,{offsetTree:te,sizeTree:J}=V,z=_n(w);if(L===0)return{...ob,totalCount:L};if(M===0&&D===0)return z===0?{...ob,totalCount:L}:$z(z,N,H,F,G,q||[]);if(vn(J))return z>0?null:pp(IG(Yw(N,L),V,q),[],L,G,V,F);const U=[];if($.length>0){const le=$[0],xe=$[$.length-1];let ve=0;for(const de of cc(J,le,xe)){const me=de.value,Ce=Math.max(de.start,le),Pe=Math.min(de.end,xe);for(let ze=Ce;ze<=Pe;ze++)U.push({data:q?.[ze],index:ze,offset:ve,size:me}),ve+=me}}if(!_)return pp([],U,L,G,V,F);const W=$.length>0?$[$.length-1]+1:0,X=bG(te,M,D,W);if(X.length===0)return null;const ie=L-1,ee=Fm([],le=>{for(const xe of X){const ve=xe.value;let de=ve.offset,me=xe.start;const Ce=ve.size;if(ve.offset<M){me+=Math.floor((M-ve.offset+G)/(Ce+G));const ze=me-xe.start;de+=ze*Ce+ze*G}me<W&&(de+=(W-me)*Ce,me=W);const Pe=Math.min(xe.end,ie);for(let ze=me;ze<=Pe&&!(de>=D);ze++)le.push({data:q?.[ze],index:ze,offset:de,size:Ce}),de+=Ce+G}}),ue=oO(j,Ed),Y=oO(j,Td);if(ee.length>0&&(ue>0||Y>0)){const le=ee[0],xe=ee[ee.length-1];if(ue>0&&le.index>W){const ve=Math.min(ue,le.index-W),de=[];let me=le.offset;for(let Ce=le.index-1;Ce>=le.index-ve;Ce--){const Pe=cc(J,Ce,Ce)[0]?.value??le.size;me-=Pe+G,de.unshift({data:q?.[Ce],index:Ce,offset:me,size:Pe})}ee.unshift(...de)}if(Y>0&&xe.index<ie){const ve=Math.min(Y,ie-xe.index);let de=xe.offset+xe.size+G;for(let me=xe.index+1;me<=xe.index+ve;me++){const Ce=cc(J,me,me)[0]?.value??xe.size;ee.push({data:q?.[me],index:me,offset:de,size:Ce}),de+=Ce+G}}}return pp(ee,U,L,G,V,F)}),ct(M=>M!==null),Dn()),ob);et(we(t,ct(Fw),Ue(M=>M?.length)),i),et(we(T,Ue(M=>M.topListHeight)),p),et(p,u),et(we(T,Ue(M=>[M.top,M.bottom])),a),et(we(T,Ue(M=>M.items)),C);const A=zi(we(T,ct(({items:M})=>M.length>0),Et(i,t),ct(([{items:M},D])=>M[M.length-1].originalIndex===D-1),Ue(([,M,D])=>[M-1,D]),Dn(wd),Ue(([M])=>M))),O=zi(we(T,Ks(200),ct(({items:M,topItems:D})=>M.length>0&&M[0].originalIndex===D.length),Ue(({items:M})=>M[0].index),Dn())),P=zi(we(T,ct(({items:M})=>M.length>0),Ue(({items:M})=>{let D=0,L=M.length-1;for(;M[D].type==="group"&&D<L;)D++;for(;M[L].type==="group"&&L>D;)L--;return{endIndex:M[L].index,startIndex:M[D].index}}),Dn(Bz)));return{endReached:A,initialItemCount:w,itemsRendered:C,listState:T,minOverscanItemCount:R,rangeChanged:P,startReached:O,topItemsIndexes:S,...m}},Nn(bs,Vz,Xw,Gd,qd,Wd,ya,Gw),{singleton:!0}),qz=Xt(([{fixedFooterHeight:t,fixedHeaderHeight:e,footerHeight:n,headerHeight:r},{listState:i}])=>{const s=Ft(),a=Kr(we(dr(n,t,r,e,i),Ue(([u,f,d,g,p])=>u+f+d+g+p.offsetBottom+p.bottom)),0);return et(ut(a),s),{totalListHeight:a,totalListHeightChanged:s}},Nn(si,vu),{singleton:!0}),DG=Xt(([{viewportHeight:t},{totalListHeight:e}])=>{const n=Me(!1),r=Kr(we(dr(n,t,e),ct(([i])=>i),Ue(([,i,s])=>Math.max(0,i-s)),Ks(0),Dn()),0);return{alignToBottom:n,paddingTopAddition:r}},Nn(si,qz),{singleton:!0}),Gz=Xt(()=>({context:Me(null)})),PG=({itemBottom:t,itemTop:e,locationParams:{align:n,behavior:r,...i},viewportBottom:s,viewportTop:a})=>e<a?{...i,align:n??"start",...r!==void 0?{behavior:r}:{}}:t>s?{...i,align:n??"end",...r!==void 0?{behavior:r}:{}}:null,Wz=Xt(([{gap:t,sizes:e,totalCount:n},{fixedFooterHeight:r,fixedHeaderHeight:i,headerHeight:s,scrollingInProgress:a,scrollTop:u,viewportHeight:f},{scrollToIndex:d}])=>{const g=Ft();return et(we(g,Et(e,f,n,s,i,r,u),Et(t),Ue(([[p,m,v,b,S,w,C,R],T])=>{const{calculateViewLocation:A=PG,done:O,...P}=p,M=jz(p,m,b-1),D=Cd(M,m.offsetTree,T)+S+w,L=D+No(m.sizeTree,M)[1],H=R+w,N=R+v-C,_=A({itemBottom:L,itemTop:D,locationParams:P,viewportBottom:N,viewportTop:H});return _!==null?O&&Do(we(a,ct($=>!$),au(_n(a)?1:2)),O):O?.(),_}),ct(p=>p!==null)),d),{scrollIntoView:g}},Nn(bs,si,qd,vu,ma),{singleton:!0});function sO(t){return t===!1?!1:t==="smooth"?"smooth":"auto"}const zG=(t,e)=>typeof t=="function"?sO(t(e)):e&&sO(t),NG=Xt(([{listRefresh:t,totalCount:e,fixedItemSize:n,data:r},{atBottomState:i,isAtBottom:s},{scrollToIndex:a},{scrolledToInitialItem:u},{didMount:f,propsReady:d},{log:g},{scrollingInProgress:p},{context:m},{scrollIntoView:v}])=>{const b=Me(!1),S=Ft();let w=null;function C(O){St(a,{align:"end",behavior:O,index:"LAST"})}ln(we(dr(we(ut(e),au(1)),f),Et(ut(b),s,u,p),Ue(([[O,P],M,D,L,H])=>{let N=P&&L,_="auto";return N&&(_=zG(M,D||H),N=N&&_!==!1),{followOutputBehavior:_,shouldFollow:N,totalCount:O}}),ct(({shouldFollow:O})=>O)),({followOutputBehavior:O,totalCount:P})=>{w!==null&&(w(),w=null),_n(n)!==void 0?requestAnimationFrame(()=>{_n(g)("following output to ",{totalCount:P},br.DEBUG),C(O)}):w=Do(t,()=>{_n(g)("following output to ",{totalCount:P},br.DEBUG),C(O),w=null})});function R(O){const P=Do(i,M=>{O&&!M.atBottom&&M.notAtBottomBecause==="SIZE_INCREASED"&&w===null&&(_n(g)("scrolling to bottom due to increased size",{},br.DEBUG),C("auto"))});setTimeout(P,100)}ln(we(dr(ut(b),e,d),ct(([O,,P])=>O!==!1&&P),fs(({value:O},[,P])=>({refreshed:O===P,value:P}),{refreshed:!1,value:0}),ct(({refreshed:O})=>O),Et(b,e)),([,O])=>{_n(u)&&R(O!==!1)}),ln(S,()=>{R(_n(b)!==!1)}),ln(dr(ut(b),i),([O,P])=>{O!==!1&&!P.atBottom&&P.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&C("auto")});const T=Me(null),A=Ft();return et(Lx(we(ut(r),Ue(O=>O?.length??0)),we(ut(e))),A),ln(we(dr(we(A,au(1)),f),Et(ut(T),u,p,m),Ue(([[O,P],M,D,L,H])=>P&&D&&M?.({context:H,totalCount:O,scrollingInProgress:L})),ct(O=>!!O),Ks(0)),O=>{w!==null&&(w(),w=null),_n(n)!==void 0?requestAnimationFrame(()=>{_n(g)("scrolling into view",{}),St(v,O)}):w=Do(t,()=>{_n(g)("scrolling into view",{}),St(v,O),w=null})}),{autoscrollToBottom:S,followOutput:b,scrollIntoViewOnChange:T}},Nn(bs,Wd,qd,Gd,ya,ma,si,Gz,Wz)),LG=Xt(([{data:t,firstItemIndex:e,gap:n,sizes:r},{initialTopMostItemIndex:i},{initialItemCount:s,listState:a},{didMount:u}])=>(et(we(u,Et(s),ct(([,f])=>f!==0),Et(i,r,e,n,t),Ue(([[,f],d,g,p,m,v=[]])=>$z(f,d,g,p,m,v))),a),{}),Nn(bs,Gd,vu,ya),{singleton:!0}),BG=Xt(([{didMount:t},{scrollTo:e},{listState:n}])=>{const r=Me(0);return ln(we(t,Et(r),ct(([,i])=>i!==0),Ue(([,i])=>({top:i}))),i=>{Do(we(n,au(1),ct(s=>s.items.length>1)),()=>{requestAnimationFrame(()=>{St(e,i)})})}),{initialScrollTop:r}},Nn(ya,si,vu),{singleton:!0}),Kz=Xt(([{scrollVelocity:t}])=>{const e=Me(!1),n=Ft(),r=Me(!1);return et(we(t,Et(r,e,n),ct(([i,s])=>s!==!1&&s!==void 0),Ue(([i,s,a,u])=>{const{enter:f,exit:d}=s;if(a){if(d(i,u))return!1}else if(f(i,u))return!0;return a}),Dn()),e),ln(we(dr(e,t,n),Et(r)),([[i,s,a],u])=>{i&&u!==!1&&u!==void 0&&u.change&&u.change(s,a)}),{isSeeking:e,scrollSeekConfiguration:r,scrollSeekRangeChanged:n,scrollVelocity:t}},Nn(Wd),{singleton:!0}),Qw=Xt(([{scrollContainerState:t,scrollTo:e}])=>{const n=Ft(),r=Ft(),i=Ft(),s=Me(!1),a=Me(void 0);return et(we(dr(n,r),Ue(([{scrollTop:u,viewportHeight:f},{offsetTop:d,listHeight:g}])=>({scrollHeight:g,scrollTop:Math.max(0,u-d),viewportHeight:f}))),t),et(we(e,Et(r),Ue(([u,{offsetTop:f}])=>({...u,top:u.top+f}))),i),{customScrollParent:a,useWindowScroll:s,windowScrollContainerState:n,windowScrollTo:i,windowViewportRect:r}},Nn(si)),_G=Xt(([{sizeRanges:t,sizes:e},{headerHeight:n,scrollTop:r},{initialTopMostItemIndex:i},{didMount:s},{useWindowScroll:a,windowScrollContainerState:u,windowViewportRect:f}])=>{const d=Ft(),g=Me(void 0),p=Me(null),m=Me(null);return et(u,p),et(f,m),ln(we(d,Et(e,r,a,p,m,n)),([v,b,S,w,C,R,T])=>{const A=SG(b.sizeTree);w&&C!==null&&R!==null&&(S=C.scrollTop-R.offsetTop),S-=T,v({ranges:A,scrollTop:S})}),et(we(g,ct(Fw),Ue(HG)),i),et(we(s,Et(g),ct(([,v])=>v!==void 0),Dn(),Ue(([,v])=>v.ranges)),t),{getState:d,restoreStateFrom:g}},Nn(bs,si,Gd,ya,Qw));function HG(t){return{align:"start",index:0,offset:t.scrollTop}}const jG=Xt(([{topItemsIndexes:t}])=>{const e=Me(0);return et(we(e,ct(n=>n>=0),Ue(n=>Array.from({length:n}).map((r,i)=>i))),t),{topItemCount:e}},Nn(vu));function Yz(t){let e=!1,n;return(()=>(e||(e=!0,n=t()),n))}const VG=Yz(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),FG=Xt(([{deviation:t,scrollBy:e,scrollingInProgress:n,scrollTop:r},{isAtBottom:i,isScrolling:s,lastJumpDueToItemResize:a,scrollDirection:u},{listState:f},{beforeUnshiftWith:d,gap:g,shiftWithOffset:p,sizes:m},{log:v},{recalcInProgress:b}])=>{const S=zi(we(f,Et(a),fs(([,C,R,T],[{bottom:A,items:O,offsetBottom:P,totalCount:M},D])=>{const L=A+P;let H=0;return R===M&&C.length>0&&O.length>0&&(O[0].originalIndex===0&&C[0].originalIndex===0||(H=L-T,H!==0&&(H+=D))),[H,O,M,L]},[0,[],0,0]),ct(([C])=>C!==0),Et(r,u,n,i,v,b),ct(([,C,R,T,,,A])=>!A&&!T&&C!==0&&R===Rd),Ue(([[C],,,,,R])=>(R("Upward scrolling compensation",{amount:C},br.DEBUG),C))));function w(C){C>0?(St(e,{behavior:"auto",top:-C}),St(t,0)):(St(t,0),St(e,{behavior:"auto",top:-C}))}return ln(we(S,Et(t,s)),([C,R,T])=>{T&&VG()?St(t,R-C):w(-C)}),ln(we(dr(Kr(s,!1),t,b),ct(([C,R,T])=>!C&&!T&&R!==0),Ue(([C,R])=>R),Ks(1)),w),et(we(p,Ue(C=>({top:-C}))),e),ln(we(d,Et(m,g),Ue(([C,{groupIndices:R,lastSize:T,sizeTree:A},O])=>{function P(N){return N*(T+O)}if(R.length===0)return P(C);let M=0;const D=Sd(A,0);let L=0,H=0;for(;L<C;){L++,M+=D;let N=R.length===H+1?1/0:R[H+1]-R[H]-1;L+N>C&&(M-=D,N=C-L+1),L+=N,M+=P(N),H++}return M})),C=>{St(t,C),requestAnimationFrame(()=>{St(e,{top:C}),requestAnimationFrame(()=>{St(t,0),St(b,!1)})})}),{deviation:t}},Nn(si,Wd,vu,bs,ma,Gw)),UG=Xt(([t,e,n,r,i,s,a,u,f,d,g])=>({...t,...e,...n,...r,...i,...s,...a,...u,...f,...d,...g}),Nn(Xw,LG,ya,Kz,qz,BG,DG,Qw,Wz,ma,Gz)),Xz=Xt(([{data:t,defaultItemSize:e,firstItemIndex:n,fixedItemSize:r,fixedGroupSize:i,gap:s,groupIndices:a,heightEstimates:u,itemSize:f,sizeRanges:d,sizes:g,statefulTotalCount:p,totalCount:m,trackItemSizes:v},{initialItemFinalLocationReached:b,initialTopMostItemIndex:S,scrolledToInitialItem:w},C,R,T,A,{scrollToIndex:O},P,{topItemCount:M},{groupCounts:D},L])=>{const{listState:H,minOverscanItemCount:N,topItemsIndexes:_,rangeChanged:$,...F}=A;return et($,L.scrollSeekRangeChanged),et(we(L.windowViewportRect,Ue(G=>G.visibleHeight)),C.viewportHeight),{data:t,defaultItemHeight:e,firstItemIndex:n,fixedItemHeight:r,fixedGroupHeight:i,gap:s,groupCounts:D,heightEstimates:u,initialItemFinalLocationReached:b,initialTopMostItemIndex:S,scrolledToInitialItem:w,sizeRanges:d,topItemCount:M,topItemsIndexes:_,totalCount:m,...T,groupIndices:a,itemSize:f,listState:H,minOverscanItemCount:N,scrollToIndex:O,statefulTotalCount:p,trackItemSizes:v,rangeChanged:$,...F,...L,...C,sizes:g,...R}},Nn(bs,Gd,si,_G,NG,vu,qd,FG,jG,Vz,UG));function $G(t,e){const n={},r={};let i=0;const s=t.length;for(;i<s;)r[t[i]]=1,i+=1;for(const a in e)Object.hasOwn(r,a)||(n[a]=e[a]);return n}const Lg=typeof document<"u"?Le.useLayoutEffect:Le.useEffect;function Zw(t,e,n){const r=Object.keys(e.required||{}),i=Object.keys(e.optional||{}),s=Object.keys(e.methods||{}),a=Object.keys(e.events||{}),u=Le.createContext({});function f(w,C){w.propsReady!==void 0&&St(w.propsReady,!1);for(const R of r){const T=w[e.required[R]];St(T,C[R])}for(const R of i)if(R in C){const T=w[e.optional[R]];St(T,C[R])}w.propsReady!==void 0&&St(w.propsReady,!0)}function d(w){return s.reduce((C,R)=>(C[R]=T=>{const A=w[e.methods[R]];St(A,T)},C),{})}function g(w){return a.reduce((C,R)=>(C[R]=sG(w[e.events[R]]),C),{})}const p=Le.forwardRef(function(w,C){const{children:R,...T}=w,[A]=Le.useState(()=>Fm(aG(t),M=>{f(M,T)})),[O]=Le.useState(KM(g,A));Lg(()=>{for(const M of a)M in T&&ln(O[M],T[M]);return()=>{Object.values(O).map(Uw)}},[T,O,A]),Lg(()=>{f(A,T)}),Le.useImperativeHandle(C,WM(d(A)));const P=n;return I.jsx(u.Provider,{value:A,children:n!==void 0?I.jsx(P,{...$G([...r,...i,...a],T),children:R}):R})}),m=w=>{const C=Le.useContext(u);return Le.useCallback(R=>{St(C[w],R)},[C,w])},v=w=>{const C=Le.useContext(u)[w],R=Le.useCallback(T=>ln(C,T),[C]);return Le.useSyncExternalStore(R,()=>_n(C),()=>_n(C))},b=w=>{const C=Le.useContext(u)[w],[R,T]=Le.useState(KM(_n,C));return Lg(()=>ln(C,A=>{A!==R&&T(WM(A))}),[C,R]),R},S=parseInt(Le.version)>=18?v:b;return{Component:p,useEmitter:(w,C)=>{const R=Le.useContext(u)[w];Lg(()=>ln(R,C),[C,R])},useEmitterValue:S,usePublisher:m}}const $m=Le.createContext(void 0),Qz=Le.createContext(void 0),sb="-webkit-sticky",lO="sticky",Jw=Yz(()=>{if(typeof document>"u")return lO;const t=document.createElement("div");return t.style.position=sb,t.style.position===sb?sb:lO}),Zz=typeof document<"u"?Le.useLayoutEffect:Le.useEffect;function lb(t){return"self"in t}function qG(t){return"body"in t}function Jz(t,e,n,r=Lc,i,s){const a=Le.useRef(null),u=Le.useRef(null),f=Le.useRef(null),d=Le.useCallback(m=>{let v,b,S;const w=m.target;if(qG(w)||lb(w)){const R=lb(w)?w:w.defaultView;S=s===!0?Ka(R,R.scrollX):R.scrollY,v=s===!0?R.document.documentElement.scrollWidth:R.document.documentElement.scrollHeight,b=s===!0?R.innerWidth:R.innerHeight}else S=s===!0?Ka(w,w.scrollLeft):w.scrollTop,v=s===!0?w.scrollWidth:w.scrollHeight,b=s===!0?w.offsetWidth:w.offsetHeight;const C=()=>{t({scrollHeight:v,scrollTop:Math.max(S,0),viewportHeight:b})};m.suppressFlushSync===!0?C():OF.flushSync(C),u.current!==null&&(S===u.current||S<=0||S===v-b)&&(u.current=null,e(!0),f.current&&(clearTimeout(f.current),f.current=null))},[t,e,s]);Le.useEffect(()=>{const m=i||a.current;return XM(m),r(i||a.current),d({suppressFlushSync:!0,target:m}),m.addEventListener("scroll",d,{passive:!0}),()=>{XM(m),r(null),m.removeEventListener("scroll",d)}},[a,d,n,r,i]);function g(m){const v=a.current;if(!v||(s===!0?"offsetWidth"in v&&v.offsetWidth===0:"offsetHeight"in v&&v.offsetHeight===0))return;const b=m.behavior==="smooth";let S,w,C;lb(v)?(w=Math.max(Lo(v.document.documentElement,s===!0?"width":"height"),s===!0?v.document.documentElement.scrollWidth:v.document.documentElement.scrollHeight),S=s===!0?v.innerWidth:v.innerHeight,C=s===!0?Ka(v,v.scrollX):v.scrollY):(w=v[s===!0?"scrollWidth":"scrollHeight"],S=Lo(v,s===!0?"width":"height"),C=s===!0?Ka(v,v.scrollLeft):v.scrollTop);const R=w-S;if(m.top===void 0){v.scrollTo(m);return}const T=Math.ceil(Math.max(Math.min(R,m.top),0));if(m.top=T,Uz(S,w)||T===C){t({scrollHeight:w,scrollTop:C,viewportHeight:S}),b&&e(!0);return}b?(u.current=T,f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{f.current=null,u.current=null,e(!0)},1e3)):u.current=null,s===!0&&(m={...m.behavior!==void 0?{behavior:m.behavior}:{},left:QM(v,T)}),v.scrollTo(m)}function p(m){s===!0&&(m={...m.behavior!==void 0?{behavior:m.behavior}:{},...m.top!==void 0?{left:QM(a.current,m.top)}:{}}),a.current.scrollBy(m)}return{scrollByCallback:p,scrollerRef:a,scrollToCallback:g}}function e1(t){return t}const GG=Xt(()=>{const t=Me(u=>`Item ${u}`),e=Me(u=>`Group ${u}`),n=Me({}),r=Me(e1),i=Me("div"),s=Me(Lc),a=(u,f=null)=>Kr(we(n,Ue(d=>d[u]),Dn()),f);return{components:n,computeItemKey:r,EmptyPlaceholder:a("EmptyPlaceholder"),FooterComponent:a("Footer"),GroupComponent:a("Group","div"),groupContent:e,HeaderComponent:a("Header"),HeaderFooterTag:i,ItemComponent:a("Item","div"),itemContent:t,ListComponent:a("List","div"),ScrollerComponent:a("Scroller","div"),scrollerRef:s,ScrollSeekPlaceholder:a("ScrollSeekPlaceholder"),TopItemListComponent:a("TopItemList")}}),WG=Xt(([t,e])=>({...t,...e}),Nn(Xz,GG)),KG=({height:t})=>I.jsx("div",{style:{height:t}}),YG={overflowAnchor:"none",position:Jw(),zIndex:1},eN={overflowAnchor:"none"},XG={...eN,display:"inline-block",height:"100%"},aO=Le.memo(function({showTopList:t=!1}){const e=gt("listState"),n=to("sizeRanges"),r=gt("useWindowScroll"),i=gt("customScrollParent"),s=to("windowScrollContainerState"),a=to("scrollContainerState"),u=i||r?s:a,f=gt("itemContent"),d=gt("context"),g=gt("groupContent"),p=gt("trackItemSizes"),m=gt("itemSize"),v=gt("log"),b=to("gap"),S=gt("horizontalDirection"),{callbackRef:w}=Iz(n,m,p,t?Lc:u,v,b,i,S,gt("skipAnimationFrameInResizeObserver")),[C,R]=Le.useState(0);i1("deviation",F=>{C!==F&&R(F)});const T=gt("EmptyPlaceholder"),A=gt("ScrollSeekPlaceholder")??KG,O=gt("ListComponent"),P=gt("ItemComponent"),M=gt("GroupComponent"),D=gt("computeItemKey"),L=gt("isSeeking"),H=gt("groupIndices").length>0,N=gt("alignToBottom"),_=gt("initialItemFinalLocationReached"),$=t?{}:{boxSizing:"border-box",...S?{display:"inline-block",height:"100%",marginInlineStart:C!==0?C:N?"auto":0,paddingInlineEnd:e.offsetBottom,paddingInlineStart:e.offsetTop,whiteSpace:"nowrap"}:{marginTop:C!==0?C:N?"auto":0,paddingBottom:e.offsetBottom,paddingTop:e.offsetTop},..._?{}:{visibility:"hidden"}};return!t&&e.totalCount===0&&T!==null&&T!==void 0?I.jsx(T,{...Pn(T,d)}):I.jsx(O,{...Pn(O,d),"data-testid":t?"virtuoso-top-item-list":"virtuoso-item-list",ref:w,style:$,children:(t?e.topItems:e.items).map(F=>{const G=F.originalIndex,j=D(G+e.firstItemIndex,F.data,d);return L?E.createElement(A,{...Pn(A,d),height:F.size,index:F.index,key:j,type:F.type||"item",...F.type==="group"?{}:{groupIndex:F.groupIndex}}):F.type==="group"?E.createElement(M,{...Pn(M,d),"data-index":G,"data-item-index":F.index,"data-known-size":F.size,key:j,style:YG},g(F.index,d)):E.createElement(P,{...Pn(P,d),...tN(P,F.data),"data-index":G,"data-item-group-index":F.groupIndex,"data-item-index":F.index,"data-known-size":F.size,key:j,style:S?XG:eN},H?f(F.index,F.groupIndex,F.data,d):f(F.index,F.data,d))})})}),QG={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},ZG={outline:"none",overflowX:"auto",position:"relative"},qm=t=>({height:"100%",position:"absolute",top:0,width:"100%",...t?{display:"flex",flexDirection:"column"}:void 0}),t1=(t,e,n=0)=>({...qm(t),position:e?"relative":"absolute",top:e?-n:0}),JG={position:Jw(),top:0,width:"100%",zIndex:1};function Pn(t,e){if(typeof t!="string")return{context:e}}function tN(t,e){return{item:typeof t=="string"?void 0:e}}const e7=Le.memo(function(){const t=gt("HeaderComponent"),e=to("headerHeight"),n=gt("HeaderFooterTag"),r=ys(Le.useMemo(()=>s=>{e(Lo(s,"height"))},[e]),!0,gt("skipAnimationFrameInResizeObserver")),i=gt("context");return t!=null?I.jsx(n,{ref:r,children:I.jsx(t,{...Pn(t,i)})}):null}),t7=Le.memo(function(){const t=gt("FooterComponent"),e=to("footerHeight"),n=gt("HeaderFooterTag"),r=ys(Le.useMemo(()=>s=>{e(Lo(s,"height"))},[e]),!0,gt("skipAnimationFrameInResizeObserver")),i=gt("context");return t!=null?I.jsx(n,{ref:r,children:I.jsx(t,{...Pn(t,i)})}):null});function n1({useEmitter:t,useEmitterValue:e,usePublisher:n}){return Le.memo(function({children:r,style:i,context:s,...a}){const u=n("scrollContainerState"),f=e("ScrollerComponent"),d=n("smoothScrollTargetReached"),g=e("scrollerRef"),p=e("horizontalDirection")||!1,{scrollByCallback:m,scrollerRef:v,scrollToCallback:b}=Jz(u,d,f,g,void 0,p);return t("scrollTo",b),t("scrollBy",m),I.jsx(f,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:v,style:{...p?ZG:QG,...i},tabIndex:0,...a,...Pn(f,s),children:r})})}function r1({useEmitter:t,useEmitterValue:e,usePublisher:n}){return Le.memo(function({children:r,style:i,context:s,...a}){const u=n("windowScrollContainerState"),f=e("ScrollerComponent"),d=n("smoothScrollTargetReached"),g=e("totalListHeight"),p=e("deviation"),m=e("customScrollParent"),v=Le.useRef(null),b=e("scrollerRef"),{scrollByCallback:S,scrollerRef:w,scrollToCallback:C}=Jz(u,d,f,b,m);return Zz(()=>(w.current=m||v.current?.ownerDocument.defaultView,()=>{w.current=null}),[w,m]),t("windowScrollTo",C),t("scrollBy",S),I.jsx(f,{ref:v,"data-virtuoso-scroller":!0,style:{position:"relative",...i,...g!==0?{height:g+p}:void 0},...a,...Pn(f,s),children:r})})}const n7=({children:t})=>{const e=Le.useContext($m),n=to("viewportHeight"),r=to("fixedItemHeight"),i=gt("alignToBottom"),s=gt("horizontalDirection"),a=Le.useMemo(()=>bd(n,f=>Lo(f,s?"width":"height")),[n,s]),u=ys(a,!0,gt("skipAnimationFrameInResizeObserver"));return Le.useEffect(()=>{e&&(n(e.viewportHeight),r(e.itemHeight))},[e,n,r]),I.jsx("div",{"data-viewport-type":"element",ref:u,style:qm(i),children:t})},r7=({children:t})=>{const e=Le.useContext($m),n=to("windowViewportRect"),r=to("fixedItemHeight"),i=gt("customScrollParent"),s=gt("useWindowScroll"),a=gt("topListHeight"),u=qw(n,i,gt("skipAnimationFrameInResizeObserver")),f=gt("alignToBottom");return Le.useEffect(()=>{e&&(r(e.itemHeight),n({listHeight:0,offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:100}))},[e,n,r]),I.jsx("div",{"data-viewport-type":"window",ref:u,style:t1(f,s,a),children:t})},i7=({children:t})=>{const e=gt("TopItemListComponent")??"div",n=gt("headerHeight"),r={...JG,marginTop:`${n}px`},i=gt("context");return I.jsx(e,{style:r,...Pn(e,i),children:t})},o7=Le.memo(function(t){const e=gt("useWindowScroll"),n=gt("topItemsIndexes").length>0,r=gt("customScrollParent"),i=gt("context");return I.jsxs(r||e?a7:l7,{...t,context:i,children:[n&&I.jsx(i7,{children:I.jsx(aO,{showTopList:!0})}),I.jsxs(r||e?r7:n7,{children:[I.jsx(e7,{}),I.jsx(aO,{}),I.jsx(t7,{})]})]})}),{Component:s7,useEmitter:i1,useEmitterValue:gt,usePublisher:to}=Zw(WG,{optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",scrollIntoViewOnChange:"scrollIntoViewOnChange",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",minOverscanItemCount:"minOverscanItemCount",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedGroupHeight:"fixedGroupHeight",fixedItemHeight:"fixedItemHeight",heightEstimates:"heightEstimates",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"HeaderFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",horizontalDirection:"horizontalDirection",skipAnimationFrameInResizeObserver:"skipAnimationFrameInResizeObserver"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},o7),l7=n1({useEmitter:i1,useEmitterValue:gt,usePublisher:to}),a7=r1({useEmitter:i1,useEmitterValue:gt,usePublisher:to}),nN=s7,u7=Xt(()=>{const t=Me(d=>I.jsxs("td",{children:["Item $",d]})),e=Me(null),n=Me(d=>I.jsxs("td",{colSpan:1e3,children:["Group ",d]})),r=Me(null),i=Me(null),s=Me({}),a=Me(e1),u=Me(Lc),f=(d,g=null)=>Kr(we(s,Ue(p=>p[d]),Dn()),g);return{components:s,computeItemKey:a,context:e,EmptyPlaceholder:f("EmptyPlaceholder"),FillerRow:f("FillerRow"),fixedFooterContent:i,fixedHeaderContent:r,itemContent:t,groupContent:n,ScrollerComponent:f("Scroller","div"),scrollerRef:u,ScrollSeekPlaceholder:f("ScrollSeekPlaceholder"),TableBodyComponent:f("TableBody","tbody"),TableComponent:f("Table","table"),TableFooterComponent:f("TableFoot","tfoot"),TableHeadComponent:f("TableHead","thead"),TableRowComponent:f("TableRow","tr"),GroupComponent:f("Group","tr")}}),c7=Xt(([t,e])=>({...t,...e}),Nn(Xz,u7)),f7=({height:t})=>I.jsx("tr",{children:I.jsx("td",{style:{height:t}})}),d7=({height:t})=>I.jsx("tr",{children:I.jsx("td",{style:{border:0,height:t,padding:0}})}),h7={overflowAnchor:"none"},uO={position:Jw(),zIndex:2,overflowAnchor:"none"},cO=Le.memo(function({showTopList:t=!1}){const e=bt("listState"),n=bt("computeItemKey"),r=bt("firstItemIndex"),i=bt("context"),s=bt("isSeeking"),a=bt("fixedHeaderHeight"),u=bt("groupIndices").length>0,f=bt("itemContent"),d=bt("groupContent"),g=bt("ScrollSeekPlaceholder")??f7,p=bt("GroupComponent"),m=bt("TableRowComponent"),v=(t?e.topItems:[]).reduce((b,S,w)=>(w===0?b.push(S.size):b.push(b[w-1]+S.size),b),[]);return(t?e.topItems:e.items).map(b=>{const S=b.originalIndex,w=n(S+r,b.data,i),C=t?S===0?0:v[S-1]:0;return s?E.createElement(g,{...Pn(g,i),height:b.size,index:b.index,key:w,type:b.type||"item"}):b.type==="group"?E.createElement(p,{...Pn(p,i),"data-index":S,"data-item-index":b.index,"data-known-size":b.size,key:w,style:{...uO,top:a}},d(b.index,i)):E.createElement(m,{...Pn(m,i),...tN(m,b.data),"data-index":S,"data-item-index":b.index,"data-known-size":b.size,"data-item-group-index":b.groupIndex,key:w,style:t?{...uO,top:a+C}:h7},u?f(b.index,b.groupIndex,b.data,i):f(b.index,b.data,i))})}),g7=Le.memo(function(){const t=bt("listState"),e=bt("topItemsIndexes").length>0,n=Po("sizeRanges"),r=bt("useWindowScroll"),i=bt("customScrollParent"),s=Po("windowScrollContainerState"),a=Po("scrollContainerState"),u=i||r?s:a,f=bt("trackItemSizes"),d=bt("itemSize"),g=bt("log"),{callbackRef:p,ref:m}=Iz(n,d,f,u,g,void 0,i,!1,bt("skipAnimationFrameInResizeObserver")),[v,b]=Le.useState(0);o1("deviation",H=>{v!==H&&(m.current.style.marginTop=`${H}px`,b(H))});const S=bt("EmptyPlaceholder"),w=bt("FillerRow")??d7,C=bt("TableBodyComponent"),R=bt("paddingTopAddition"),T=bt("statefulTotalCount"),A=bt("context");if(T===0&&S!==null&&S!==void 0)return I.jsx(S,{...Pn(S,A)});const O=(e?t.topItems:[]).reduce((H,N)=>H+N.size,0),P=t.offsetTop+R+v-O,M=t.offsetBottom,D=P>0?I.jsx(w,{context:A,height:P},"padding-top"):null,L=M>0?I.jsx(w,{context:A,height:M},"padding-bottom"):null;return I.jsxs(C,{"data-testid":"virtuoso-item-list",ref:p,...Pn(C,A),children:[D,e&&I.jsx(cO,{showTopList:!0}),I.jsx(cO,{}),L]})}),p7=({children:t})=>{const e=Le.useContext($m),n=Po("viewportHeight"),r=Po("fixedItemHeight"),i=ys(Le.useMemo(()=>bd(n,s=>Lo(s,"height")),[n]),!0,bt("skipAnimationFrameInResizeObserver"));return Le.useEffect(()=>{e&&(n(e.viewportHeight),r(e.itemHeight))},[e,n,r]),I.jsx("div",{"data-viewport-type":"element",ref:i,style:qm(!1),children:t})},m7=({children:t})=>{const e=Le.useContext($m),n=Po("windowViewportRect"),r=Po("fixedItemHeight"),i=bt("customScrollParent"),s=bt("useWindowScroll"),a=qw(n,i,bt("skipAnimationFrameInResizeObserver"));return Le.useEffect(()=>{e&&(r(e.itemHeight),n({listHeight:0,offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:100}))},[e,n,r]),I.jsx("div",{"data-viewport-type":"window",ref:a,style:t1(!1,s),children:t})},y7=Le.memo(function(t){const e=bt("useWindowScroll"),n=bt("customScrollParent"),r=Po("fixedHeaderHeight"),i=Po("fixedFooterHeight"),s=bt("fixedHeaderContent"),a=bt("fixedFooterContent"),u=bt("context"),f=ys(Le.useMemo(()=>bd(r,C=>Lo(C,"height")),[r]),!0,bt("skipAnimationFrameInResizeObserver")),d=ys(Le.useMemo(()=>bd(i,C=>Lo(C,"height")),[i]),!0,bt("skipAnimationFrameInResizeObserver")),g=n||e?x7:b7,p=n||e?m7:p7,m=bt("TableComponent"),v=bt("TableHeadComponent"),b=bt("TableFooterComponent"),S=s?I.jsx(v,{ref:f,style:{position:"sticky",top:0,zIndex:2},...Pn(v,u),children:s()},"TableHead"):null,w=a?I.jsx(b,{ref:d,style:{bottom:0,position:"sticky",zIndex:1},...Pn(b,u),children:a()},"TableFoot"):null;return I.jsx(g,{...t,...Pn(g,u),children:I.jsx(p,{children:I.jsxs(m,{style:{borderSpacing:0,overflowAnchor:"none"},...Pn(m,u),children:[S,I.jsx(g7,{},"TableBody"),w]})})})}),{Component:v7,useEmitter:o1,useEmitterValue:bt,usePublisher:Po}=Zw(c7,{optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",firstItemIndex:"firstItemIndex",itemContent:"itemContent",groupContent:"groupContent",fixedHeaderContent:"fixedHeaderContent",fixedFooterContent:"fixedFooterContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",minOverscanItemCount:"minOverscanItemCount",totalCount:"totalCount",topItemCount:"topItemCount",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",groupCounts:"groupCounts",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedGroupHeight:"fixedGroupHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},y7),b7=n1({useEmitter:o1,useEmitterValue:bt,usePublisher:Po}),x7=r1({useEmitter:o1,useEmitterValue:bt,usePublisher:Po}),S7=v7,fO={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},w7={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:dO,floor:Vp,max:Jf,min:ab,round:hO}=Math;function gO(t,e,n){return Array.from({length:e-t+1}).map((r,i)=>({data:n===null?null:n[i+t],index:i+t}))}function C7(t){return{...w7,items:t}}function Bg(t,e){return t!==void 0&&t.width===e.width&&t.height===e.height}function R7(t,e){return t!==void 0&&t.column===e.column&&t.row===e.row}const E7=Xt(([{increaseViewportBy:t,listBoundary:e,overscan:n,visibleRange:r},{footerHeight:i,headerHeight:s,scrollBy:a,scrollContainerState:u,scrollTo:f,scrollTop:d,smoothScrollTargetReached:g,viewportHeight:p},m,v,{didMount:b,propsReady:S},{customScrollParent:w,useWindowScroll:C,windowScrollContainerState:R,windowScrollTo:T,windowViewportRect:A},O])=>{const P=Me(0),M=Me(0),D=Me(fO),L=Me({height:0,width:0}),H=Me({height:0,width:0}),N=Ft(),_=Ft(),$=Me(0),F=Me(null),G=Me({column:0,row:0}),j=Ft(),q=Ft(),V=Me(!1),te=Me(0),J=Me(!0),z=Me(!1),U=Me(!1);ln(we(b,Et(te),ct(([Y,le])=>le!==0)),()=>{St(J,!1)}),ln(we(dr(b,J,H,L,te,z),ct(([Y,le,xe,ve,,de])=>Y&&!le&&xe.height!==0&&ve.height!==0&&!de)),([,,,,Y])=>{St(z,!0),Kw(1,()=>{St(N,Y)}),Do(we(d),()=>{St(e,[0,0]),St(J,!0)})}),et(we(q,ct(Y=>Y!=null&&Y.scrollTop>0),os(0)),M),ln(we(b,Et(q),ct(([,Y])=>Y!=null)),([,Y])=>{Y&&(St(L,Y.viewport),St(H,Y.item),St(G,Y.gap),Y.scrollTop>0&&(St(V,!0),Do(we(d,au(1)),le=>{St(V,!1)}),St(f,{top:Y.scrollTop})))}),et(we(L,Ue(({height:Y})=>Y)),p),et(we(dr(ut(L,Bg),ut(H,Bg),ut(G,(Y,le)=>Y!==void 0&&Y.column===le.column&&Y.row===le.row),ut(d)),Ue(([Y,le,xe,ve])=>({gap:xe,item:le,scrollTop:ve,viewport:Y}))),j),et(we(dr(ut(P),r,ut(G,R7),ut(H,Bg),ut(L,Bg),ut(F),ut(M),ut(V),ut(J),ut(te)),ct(([,,,,,,,Y])=>!Y),Ue(([Y,[le,xe],ve,de,me,Ce,Pe,,ze,Ee])=>{const{column:Ve,row:Ie}=ve,{height:He,width:Ge}=de,{width:We}=me;if(Pe===0&&(Y===0||We===0))return fO;if(Ge===0){const nt=Yw(Ee,Y),Mt=nt+Math.max(Pe-1,0);return C7(gO(nt,Mt,Ce))}const fe=rN(We,Ge,Ve);let ne,Q;ze?le===0&&xe===0&&Pe>0?(ne=0,Q=Pe-1):(ne=fe*Vp((le+Ie)/(He+Ie)),Q=fe*dO((xe+Ie)/(He+Ie))-1,Q=ab(Y-1,Jf(Q,fe-1)),ne=ab(Q,Jf(0,ne))):(ne=0,Q=-1);const Se=gO(ne,Q,Ce),{bottom:ge,top:De}=pO(me,ve,de,Se),Te=dO(Y/fe),_e=Te*He+(Te-1)*Ie-ge;return{bottom:ge,itemHeight:He,items:Se,itemWidth:Ge,offsetBottom:_e,offsetTop:De,top:De}})),D),et(we(F,ct(Y=>Y!==null),Ue(Y=>Y.length)),P),et(we(dr(L,H,D,G),ct(([Y,le,{items:xe}])=>xe.length>0&&le.height!==0&&Y.height!==0),Ue(([Y,le,{items:xe},ve])=>{const{bottom:de,top:me}=pO(Y,ve,le,xe);return[me,de]}),Dn(wd)),e);const W=Me(!1);et(we(d,Et(W),Ue(([Y,le])=>le||Y!==0)),W);const X=zi(we(dr(D,P),ct(([{items:Y}])=>Y.length>0),Et(W),ct(([[Y,le],xe])=>{const ve=Y.items[Y.items.length-1].index===le-1;return(xe||Y.bottom>0&&Y.itemHeight>0&&Y.offsetBottom===0&&Y.items.length===le)&&ve}),Ue(([[,Y]])=>Y-1),Dn())),ie=zi(we(ut(D),ct(({items:Y})=>Y.length>0&&Y[0].index===0),os(0),Dn())),ee=zi(we(ut(D),Et(V),ct(([{items:Y},le])=>Y.length>0&&!le),Ue(([{items:Y}])=>({endIndex:Y[Y.length-1].index,startIndex:Y[0].index})),Dn(Bz),Ks(0)));et(ee,v.scrollSeekRangeChanged),et(we(N,Et(L,H,P,G),Ue(([Y,le,xe,ve,de])=>{const me=Fz(Y),{align:Ce,behavior:Pe,offset:ze}=me;let Ee=me.index;Ee==="LAST"&&(Ee=ve-1),Ee=Jf(0,Ee,ab(ve-1,Ee));let Ve=Fx(le,de,xe,Ee);return Ce==="end"?Ve=hO(Ve-le.height+xe.height):Ce==="center"&&(Ve=hO(Ve-le.height/2+xe.height/2)),ze!==void 0&&ze!==0&&(Ve+=ze),{behavior:Pe,top:Ve}})),f);const ue=Kr(we(D,Ue(Y=>Y.offsetBottom+Y.bottom)),0);return et(we(A,Ue(Y=>({height:Y.visibleHeight,width:Y.visibleWidth}))),L),{customScrollParent:w,data:F,deviation:$,footerHeight:i,gap:G,headerHeight:s,increaseViewportBy:t,initialItemCount:M,itemDimensions:H,overscan:n,restoreStateFrom:q,scrollBy:a,scrollContainerState:u,scrollHeight:_,scrollTo:f,scrollToIndex:N,scrollTop:d,smoothScrollTargetReached:g,totalCount:P,useWindowScroll:C,viewportDimensions:L,windowScrollContainerState:R,windowScrollTo:T,windowViewportRect:A,...v,gridState:D,horizontalDirection:U,initialTopMostItemIndex:te,totalListHeight:ue,...m,endReached:X,propsReady:S,rangeChanged:ee,startReached:ie,stateChanged:j,stateRestoreInProgress:V,...O}},Nn(Xw,si,Wd,Kz,ya,Qw,ma));function rN(t,e,n){return Jf(1,Vp((t+n)/(Vp(e)+n)))}function pO(t,e,n,r){const{height:i}=n;if(i===void 0||r.length===0)return{bottom:0,top:0};const s=Fx(t,e,n,r[0].index);return{bottom:Fx(t,e,n,r[r.length-1].index)+i,top:s}}function Fx(t,e,n,r){const i=rN(t.width,n.width,e.column),s=Vp(r/i),a=s*n.height+Jf(0,s-1)*e.row;return a>0?a+e.row:a}const T7=Xt(()=>{const t=Me(p=>`Item ${p}`),e=Me({}),n=Me(null),r=Me("virtuoso-grid-item"),i=Me("virtuoso-grid-list"),s=Me(e1),a=Me("div"),u=Me(Lc),f=(p,m=null)=>Kr(we(e,Ue(v=>v[p]),Dn()),m),d=Me(!1),g=Me(!1);return et(ut(g),d),{components:e,computeItemKey:s,context:n,FooterComponent:f("Footer"),HeaderComponent:f("Header"),headerFooterTag:a,itemClassName:r,ItemComponent:f("Item","div"),itemContent:t,listClassName:i,ListComponent:f("List","div"),readyStateChanged:d,reportReadyState:g,ScrollerComponent:f("Scroller","div"),scrollerRef:u,ScrollSeekPlaceholder:f("ScrollSeekPlaceholder","div")}}),A7=Xt(([t,e])=>({...t,...e}),Nn(E7,T7)),M7=Le.memo(function(){const t=In("gridState"),e=In("listClassName"),n=In("itemClassName"),r=In("itemContent"),i=In("computeItemKey"),s=In("isSeeking"),a=no("scrollHeight"),u=In("ItemComponent"),f=In("ListComponent"),d=In("ScrollSeekPlaceholder"),g=In("context"),p=no("itemDimensions"),m=no("gap"),v=In("log"),b=In("stateRestoreInProgress"),S=no("reportReadyState"),w=ys(Le.useMemo(()=>C=>{const R=C.parentElement.parentElement.scrollHeight;a(R);const T=C.firstChild;if(T!==null){const{height:A,width:O}=T.getBoundingClientRect();p({height:A,width:O})}m({column:mO("column-gap",getComputedStyle(C).columnGap,v),row:mO("row-gap",getComputedStyle(C).rowGap,v)})},[a,p,m,v]),!0,!1);return Zz(()=>{t.itemHeight>0&&t.itemWidth>0&&S(!0)},[t]),b?null:I.jsx(f,{className:e,ref:w,...Pn(f,g),"data-testid":"virtuoso-item-list",style:{paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},children:t.items.map(C=>{const R=i(C.index,C.data,g);return s?I.jsx(d,{...Pn(d,g),height:t.itemHeight,index:C.index,width:t.itemWidth},R):E.createElement(u,{...Pn(u,g),className:n,"data-index":C.index,key:R},r(C.index,C.data,g))})})}),O7=Le.memo(function(){const t=In("HeaderComponent"),e=no("headerHeight"),n=In("headerFooterTag"),r=ys(Le.useMemo(()=>s=>{e(Lo(s,"height"))},[e]),!0,!1),i=In("context");return t!=null?I.jsx(n,{ref:r,children:I.jsx(t,{...Pn(t,i)})}):null}),k7=Le.memo(function(){const t=In("FooterComponent"),e=no("footerHeight"),n=In("headerFooterTag"),r=ys(Le.useMemo(()=>s=>{e(Lo(s,"height"))},[e]),!0,!1),i=In("context");return t!=null?I.jsx(n,{ref:r,children:I.jsx(t,{...Pn(t,i)})}):null}),I7=({children:t})=>{const e=Le.useContext(Qz),n=no("itemDimensions"),r=no("viewportDimensions"),i=ys(Le.useMemo(()=>s=>{r(s.getBoundingClientRect())},[r]),!0,!1);return Le.useEffect(()=>{e&&(r({height:e.viewportHeight,width:e.viewportWidth}),n({height:e.itemHeight,width:e.itemWidth}))},[e,r,n]),I.jsx("div",{ref:i,style:qm(!1),children:t})},D7=({children:t})=>{const e=Le.useContext(Qz),n=no("windowViewportRect"),r=no("itemDimensions"),i=In("customScrollParent"),s=In("useWindowScroll"),a=qw(n,i,!1);return Le.useEffect(()=>{e&&(r({height:e.itemHeight,width:e.itemWidth}),n({listHeight:0,offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:e.viewportWidth}))},[e,n,r]),I.jsx("div",{ref:a,style:t1(!1,s),children:t})},P7=Le.memo(function({...t}){const e=In("useWindowScroll"),n=In("customScrollParent"),r=n||e?N7:z7,i=n||e?D7:I7,s=In("context");return I.jsx(r,{...t,...Pn(r,s),children:I.jsxs(i,{children:[I.jsx(O7,{}),I.jsx(M7,{}),I.jsx(k7,{})]})})}),{useEmitter:iN,useEmitterValue:In,usePublisher:no}=Zw(A7,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},P7),z7=n1({useEmitter:iN,useEmitterValue:In,usePublisher:no}),N7=r1({useEmitter:iN,useEmitterValue:In,usePublisher:no});function mO(t,e,n){return e!=="normal"&&e?.endsWith("px")!==!0&&n(`${t} was not resolved to pixel value correctly`,e,br.WARN),e==="normal"?0:parseInt(e??"0",10)}function ot(...t){return v5(CI(t))}function L7({direction:t="horizontal",autoSaveId:e,id:n,className:r,disableCursor:i=!0,...s}){return I.jsx(QI,{"data-slot":"split",orientation:t,id:n??e,disableCursor:i,className:ot("flex h-full w-full",r),...s})}function _g(t){return typeof t=="number"?`${t}%`:t}function B7({className:t,defaultSize:e,minSize:n,maxSize:r,collapsedSize:i,...s}){return I.jsx(ZI,{"data-slot":"split-pane",className:ot("min-h-0 min-w-0",t),defaultSize:_g(e),minSize:_g(n),maxSize:_g(r),collapsedSize:_g(i),...s})}function _7({className:t,withHandle:e=!1,children:n,...r}){return I.jsxs(JI,{"data-slot":"split-handle",className:ot("group/split-handle relative flex items-center justify-center bg-border","aria-[orientation=vertical]:w-px aria-[orientation=vertical]:cursor-col-resize","aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:cursor-row-resize","after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2","outline-none",t),...r,children:[e&&I.jsx("div",{className:ot("z-10 flex items-center justify-center rounded-sm border border-border bg-background","group-aria-[orientation=vertical]/split-handle:h-4 group-aria-[orientation=vertical]/split-handle:w-3","group-aria-[orientation=horizontal]/split-handle:h-3 group-aria-[orientation=horizontal]/split-handle:w-4 group-aria-[orientation=horizontal]/split-handle:rotate-90"),children:I.jsx(a8,{className:"h-2.5 w-2.5 text-muted-foreground"})}),n]})}const Hg=Object.assign(L7,{Pane:B7,Handle:_7});function H7(t,e){return t==="light"||t==="dark"?t:e?"dark":"light"}const oN="@rozenite/ui:theme";function j7(){try{return localStorage.getItem(oN)}catch{return null}}function V7(t){try{localStorage.setItem(oN,t)}catch{}}function F7(){try{return window.matchMedia("(prefers-color-scheme: dark)").matches}catch{return!1}}const sN=E.createContext(null);function U7({children:t}){const[e,n]=E.useState(()=>H7(j7(),F7())),r=E.useCallback(a=>{n(a),V7(a)},[]),i=E.useCallback(()=>{r(e==="dark"?"light":"dark")},[r,e]),s=E.useMemo(()=>({theme:e,setTheme:r,toggleTheme:i}),[e,r,i]);return I.jsx(sN.Provider,{value:s,children:t})}function lN(){const t=E.useContext(sN);if(!t)throw new Error("usePluginTheme must be used within a PluginShell");return t}const aN=E.createContext(null);function Gm(){return E.useContext(aN)}function $7({unstyled:t=!1,className:e,children:n,...r}){return t?I.jsx("div",{"data-slot":"plugin-shell",className:ot("flex h-screen min-h-0 flex-col",e),...r,children:n}):I.jsx(U7,{children:I.jsx(q7,{className:e,...r,children:n})})}function q7({className:t,children:e,...n}){const{theme:r}=lN(),[i,s]=E.useState(null);return I.jsx("div",{ref:s,"data-slot":"plugin-shell",className:ot(r==="dark"&&"dark","flex h-screen min-h-0 flex-col bg-background text-foreground",t),...n,children:I.jsx(aN.Provider,{value:i,children:e})})}function G7({className:t,...e}){return I.jsx("div",{"data-slot":"plugin-shell-body",className:ot("flex min-h-0 flex-1 flex-col overflow-auto",t),...e})}const yO=Object.assign($7,{Body:G7});function W7({className:t,...e}){return I.jsx("header",{"data-slot":"plugin-header",className:ot("flex shrink-0 items-center gap-3 border-b border-border bg-card px-4 py-3",t),...e})}function K7({className:t,...e}){return I.jsx("h1",{"data-slot":"plugin-header-title",className:ot("text-sm font-semibold text-foreground",t),...e})}function Y7({className:t,...e}){return I.jsx("p",{"data-slot":"plugin-header-subtitle",className:ot("text-xs text-muted-foreground",t),...e})}function X7({className:t,...e}){return I.jsx("div",{"data-slot":"plugin-header-actions",className:ot("ml-auto flex items-center gap-2",t),...e})}function Q7({className:t,...e}){const{theme:n,toggleTheme:r}=lN();return I.jsx("button",{type:"button","data-slot":"plugin-header-theme-switcher","aria-label":n==="dark"?"Switch to light theme":"Switch to dark theme",onClick:r,className:ot("inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground","hover:bg-accent hover:text-accent-foreground","outline-none focus-visible:ring-2 focus-visible:ring-ring","transition-colors",t),...e,children:n==="dark"?I.jsx(p8,{className:"h-4 w-4"}):I.jsx(f8,{className:"h-4 w-4"})})}Object.assign(W7,{Title:K7,Subtitle:Y7,Actions:X7,ThemeSwitcher:Q7});function Z7(t){return I.jsx(g$,{...t})}function J7({className:t,children:e,...n}){return I.jsxs(D$,{"data-slot":"select-trigger",className:ot("flex h-8 w-full items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 text-sm text-foreground shadow-xs","outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/50","disabled:pointer-events-none disabled:opacity-50",t),...n,children:[e,I.jsx(N$,{children:I.jsx(XS,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"})})]})}function eW({className:t,...e}){return I.jsx(z$,{"data-slot":"select-value",className:ot("truncate",t),...e})}function tW({className:t,side:e="bottom",sideOffset:n=4,align:r="start",children:i,...s}){const a=Gm();return I.jsx(L$,{container:a,children:I.jsx(rq,{side:e,sideOffset:n,align:r,className:"z-50",children:I.jsx(fq,{"data-slot":"select-content",className:ot("max-h-64 min-w-[--anchor-width] overflow-y-auto rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md","origin-(--transform-origin) transition-[transform,scale,opacity] data-[ending-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:scale-95 data-[starting-style]:opacity-0",t),...s,children:I.jsx(hq,{children:i})})})})}function nW({className:t,children:e,...n}){return I.jsxs(gq,{"data-slot":"select-item",className:ot("flex cursor-default items-center justify-between gap-2 rounded-sm px-2 py-1.5 text-sm text-foreground select-none","data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[I.jsx(yq,{children:e}),I.jsx(pq,{children:I.jsx(eD,{className:"h-3.5 w-3.5"})})]})}const Ju=Object.assign(Z7,{Trigger:J7,Value:eW,Content:tW,Item:nW});function rW(t){return I.jsx(Tq,{...t})}function iW({className:t,...e}){return I.jsxs(Pq,{"data-slot":"combobox-input-group",className:"relative flex items-center",children:[I.jsx(Iq,{"data-slot":"combobox-input",className:ot("h-8 w-full rounded-md border border-input bg-transparent px-3 pr-14 text-sm text-foreground shadow-xs","outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/50","placeholder:text-muted-foreground disabled:pointer-events-none disabled:opacity-50",t),...e}),I.jsxs("div",{className:"absolute right-1.5 flex items-center gap-0.5",children:[I.jsx(n9,{"data-slot":"combobox-clear",className:"inline-flex h-5 w-5 items-center justify-center rounded-sm text-muted-foreground hover:text-foreground",children:I.jsx(QS,{className:"h-3.5 w-3.5"})}),I.jsx(Wq,{"data-slot":"combobox-icon",children:I.jsx(XS,{className:"h-3.5 w-3.5 text-muted-foreground"})})]})]})}function oW({className:t,side:e="bottom",sideOffset:n=4,align:r="start",emptyMessage:i="No results found.",children:s,...a}){const u=Gm();return I.jsx(Uq,{container:u,children:I.jsx($q,{side:e,sideOffset:n,align:r,className:"z-50",children:I.jsxs(Gq,{"data-slot":"combobox-content",className:ot("max-h-64 min-w-[--anchor-width] overflow-y-auto rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md","origin-(--transform-origin) transition-[transform,scale,opacity] data-[ending-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:scale-95 data-[starting-style]:opacity-0",t),...a,children:[I.jsx(e9,{"data-slot":"combobox-empty",className:"px-2 py-1.5 text-sm text-muted-foreground",children:i}),I.jsx(Bq,{children:s})]})})})}function sW({className:t,children:e,...n}){return I.jsxs(Qq,{"data-slot":"combobox-item",className:ot("flex cursor-default items-center justify-between gap-2 rounded-sm px-2 py-1.5 text-sm text-foreground select-none","data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[e,I.jsx(Zq,{children:I.jsx(eD,{className:"h-3.5 w-3.5"})})]})}Object.assign(rW,{Input:iW,Content:oW,Item:sW});const uN=E.createContext(null);function lW(t){const[e,n]=E.useState(t.defaultOpen??!1),r=t.open??e;return I.jsx(uN.Provider,{value:r,children:I.jsx(h9,{...t,onOpenChange:(i,s)=>{t.open===void 0&&n(i),t.onOpenChange?.(i,s)}})})}function aW(t){return I.jsx(m9,{"data-slot":"dialog-trigger",...t})}function uW(t){return I.jsx(tz,{"data-slot":"dialog-close",...t})}function cW({className:t,children:e,showCloseButton:n=!0,...r}){const i=Gm(),s=E.useContext(uN),a=E.useRef(e);return I.jsxs(s9,{container:i,children:[I.jsx(r9,{"data-slot":"dialog-backdrop",className:ot("fixed inset-0 z-50 bg-background/70","transition-opacity data-[ending-style]:opacity-0 data-[starting-style]:opacity-0")}),I.jsx(g9,{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:I.jsxs(o9,{"data-slot":"dialog-content",className:ot("relative flex w-full max-w-md flex-col gap-4 rounded-lg border border-border bg-card p-6 text-card-foreground shadow-lg","transition-[transform,scale,opacity] data-[ending-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:scale-95 data-[starting-style]:opacity-0",t),render:u=>{const{children:f,...d}=u;return s&&(a.current=f),I.jsx("div",{...d,children:a.current})},...r,children:[e,n&&I.jsx(tz,{"data-slot":"dialog-close","aria-label":"Close",className:ot("absolute top-4 right-4 inline-flex h-6 w-6 items-center justify-center rounded-sm text-muted-foreground","hover:bg-accent hover:text-accent-foreground","outline-none focus-visible:ring-2 focus-visible:ring-ring"),children:I.jsx(QS,{className:"h-4 w-4"})})]})})]})}function fW({className:t,...e}){return I.jsx("div",{"data-slot":"dialog-header",className:ot("flex flex-col gap-1.5",t),...e})}function dW({className:t,...e}){return I.jsx("div",{"data-slot":"dialog-footer",className:ot("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...e})}function hW({className:t,...e}){return I.jsx(p9,{"data-slot":"dialog-title",className:ot("text-sm font-semibold text-foreground",t),...e})}function gW({className:t,...e}){return I.jsx(i9,{"data-slot":"dialog-description",className:ot("text-sm text-muted-foreground",t),...e})}const sn=Object.assign(lW,{Trigger:aW,Close:uW,Content:cW,Header:fW,Footer:dW,Title:hW,Description:gW});function pW(t){return I.jsx(D9,{"data-slot":"tooltip-provider",...t})}function mW(t){return I.jsx(S9,{"data-slot":"tooltip",...t})}function yW(t){return I.jsx(E9,{"data-slot":"tooltip-trigger",...t})}function vW({className:t,side:e="top",sideOffset:n=6,align:r="center",alignOffset:i=0,children:s,...a}){const u=Gm();return I.jsx(M9,{container:u,children:I.jsx(k9,{side:e,sideOffset:n,align:r,alignOffset:i,className:"z-50",children:I.jsx(I9,{"data-slot":"tooltip-content",className:ot("z-50 w-fit max-w-xs rounded-md bg-foreground px-2.5 py-1.5 text-xs text-background","origin-(--transform-origin) transition-[transform,scale,opacity] data-[ending-style]:scale-90 data-[ending-style]:opacity-0 data-[starting-style]:scale-90 data-[starting-style]:opacity-0",t),...a,children:s})})})}Object.assign(mW,{Provider:pW,Trigger:yW,Content:vW});function bW(t){return I.jsx(P9,{"data-slot":"tabs",...t})}function xW({className:t,...e}){return I.jsx(V9,{"data-slot":"tabs-list",className:ot("inline-flex h-8 items-center gap-1 rounded-md bg-muted p-1 text-muted-foreground",t),...e})}function SW({className:t,...e}){return I.jsx(N9,{"data-slot":"tabs-tab",className:ot("inline-flex h-6 items-center justify-center rounded-sm px-2.5 text-sm font-medium whitespace-nowrap text-muted-foreground","outline-none focus-visible:ring-2 focus-visible:ring-ring","data-[selected]:bg-background data-[selected]:text-foreground data-[selected]:shadow-xs","disabled:pointer-events-none disabled:opacity-50",t),...e})}function wW({className:t,...e}){return I.jsx(B9,{"data-slot":"tabs-panel",className:ot("flex-1 outline-none",t),...e})}Object.assign(bW,{List:xW,Tab:SW,Panel:wW});function CW({className:t,...e}){return I.jsx(Y9,{"data-slot":"field",className:ot("flex flex-col gap-1.5",t),...e})}function RW({className:t,...e}){return I.jsx(Q9,{"data-slot":"field-label",className:ot("text-sm font-medium text-foreground",t),...e})}function EW({className:t,...e}){return I.jsx(t2,{"data-slot":"field-control",className:ot("h-8 w-full rounded-md border border-input bg-transparent px-3 text-sm text-foreground shadow-xs","outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/50","placeholder:text-muted-foreground disabled:pointer-events-none disabled:opacity-50",t),...e})}function TW({className:t,...e}){return I.jsx(e2,{"data-slot":"field-description",className:ot("text-xs text-muted-foreground",t),...e})}function AW({className:t,...e}){return I.jsx(J9,{"data-slot":"field-error",className:ot("text-xs text-destructive",t),...e})}const Eo=Object.assign(CW,{Label:RW,Control:EW,Description:TW,Error:AW});function MW({className:t,...e}){return I.jsx(i2,{"data-slot":"toolbar",className:ot("flex items-center gap-1 border-b border-border bg-card px-2 py-1.5",t),...e})}function OW({className:t,...e}){return I.jsx(a2,{"data-slot":"toolbar-button",className:ot("inline-flex h-7 items-center justify-center gap-1.5 rounded-md px-2 text-sm font-medium text-foreground","hover:bg-accent hover:text-accent-foreground","outline-none focus-visible:ring-2 focus-visible:ring-ring","disabled:pointer-events-none disabled:opacity-50",t),...e})}function kW({className:t,...e}){return I.jsx(r2,{"data-slot":"toolbar-separator",className:ot("mx-1 h-4 w-px bg-border",t),...e})}function IW({className:t,...e}){return I.jsx(s2,{"data-slot":"toolbar-group",className:ot("flex items-center gap-1",t),...e})}const Yi=Object.assign(MW,{Button:OW,Separator:kW,Group:IW}),DW=yz(ot("inline-flex shrink-0 items-center justify-center gap-1.5 whitespace-nowrap rounded-md text-sm font-medium transition-colors","outline-none focus-visible:ring-2 focus-visible:ring-ring","disabled:pointer-events-none disabled:opacity-50","[&_svg]:pointer-events-none [&_svg]:shrink-0"),{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-transparent text-foreground hover:bg-accent hover:text-accent-foreground",ghost:"text-foreground hover:bg-accent hover:text-accent-foreground"},size:{default:"h-8 px-3 [&_svg]:size-4",compact:"h-6 px-2 text-xs [&_svg]:size-3.5",icon:"h-8 w-8 [&_svg]:size-4"}},defaultVariants:{variant:"default",size:"default"}});function Li({className:t,variant:e,size:n,type:r="button",...i}){return I.jsx("button",{type:r,"data-slot":"button",className:ot(DW({variant:e,size:n}),t),...i})}const PW=yz("inline-flex w-fit shrink-0 items-center justify-center rounded-sm px-2 py-0.5 text-xs font-medium whitespace-nowrap",{variants:{variant:{default:"bg-primary text-primary-foreground",secondary:"bg-secondary text-secondary-foreground",outline:"border border-border text-foreground"}},defaultVariants:{variant:"default"}});function Fp({className:t,variant:e,...n}){return I.jsx("span",{"data-slot":"badge",className:ot(PW({variant:e}),t),...n})}function Ux({className:t,type:e="text",...n}){return I.jsx("input",{type:e,"data-slot":"input",className:ot("h-8 w-full min-w-0 rounded-md border border-input bg-transparent px-3 text-sm text-foreground shadow-xs transition-colors","outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/50","placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",t),...n})}function zW({className:t,value:e,onClear:n,...r}){const i=!!n&&!!e;return I.jsxs("div",{"data-slot":"search-field",className:"relative flex items-center",children:[I.jsx(g8,{className:"pointer-events-none absolute left-2.5 h-3.5 w-3.5 text-muted-foreground"}),I.jsx("input",{type:"search",value:e,className:ot("h-8 w-full min-w-0 rounded-md border border-input bg-transparent pl-8 text-sm text-foreground shadow-xs transition-colors",i?"pr-8":"pr-3","outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/50","placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50","[&::-webkit-search-cancel-button]:appearance-none",t),...r}),i&&I.jsx("button",{type:"button",onClick:n,"aria-label":"Clear search",className:"absolute right-2 inline-flex h-4 w-4 items-center justify-center rounded-sm text-muted-foreground hover:text-foreground",children:I.jsx(QS,{className:"h-3.5 w-3.5"})})]})}const NW=({children:t,context:e,style:n})=>I.jsx("table",{"aria-label":e.ariaLabel,className:e.tableClassName,style:n,children:t}),LW=({children:t,context:e,item:n,...r})=>{const i=n,s=!!e.onRowClick,a=()=>{e.onRowClick?.(i.original)},u=f=>{!s||f.key!=="Enter"&&f.key!==" "||(f.preventDefault(),a())};return I.jsx("tr",{...r,"aria-label":e.getRowTextValue?.(i.original,i.index)??String(i.id),className:`border-b border-border last:border-0 transition-colors hover:bg-accent/50 ${s?"cursor-pointer":""}`,onClick:s?a:void 0,onKeyDown:u,tabIndex:s?0:void 0,children:t})},BW=({context:t})=>I.jsx("tr",{children:I.jsx("td",{colSpan:t.columnCount,children:t.renderEmptyState?.()??I.jsx("div",{className:"flex min-h-56 w-full items-center justify-center px-4 py-10 text-center",children:I.jsx("span",{className:"text-sm text-muted",children:t.isLoading?"Loading…":t.emptyMessage})})})}),_W={EmptyPlaceholder:BW,Table:NW,TableRow:LW},HW=({ariaLabel:t,data:e,columns:n,getRowId:r,getRowTextValue:i,onRowClick:s,onStartReached:a,onEndReached:u,sorting:f,onSortingChange:d,manualSorting:g=!1,loading:p=!1,emptyMessage:m="No data available",renderEmptyState:v,className:b="w-full border-collapse text-sm",scrollClassName:S="h-full w-full overflow-auto",style:w={height:400}})=>{const[C,R]=E.useState([]),T=f??C,A=E.useCallback(N=>{const _=typeof N=="function"?N(T):N;f===void 0&&R(_),d?.(_)},[f,d,T]),O=eG({columns:n,data:e,getCoreRowModel:Y2(),getRowId:r,getSortedRowModel:X2(),manualSorting:g,onSortingChange:A,state:{sorting:T}}),P=O.getRowModel().rows,M=E.useMemo(()=>({ariaLabel:t,columnCount:O.getVisibleLeafColumns().length,emptyMessage:m,getRowTextValue:i,isLoading:p,onRowClick:s,renderEmptyState:v,tableClassName:b}),[t,b,m,i,p,s,v,O]),D=E.useCallback((N,_)=>_.getVisibleCells().map($=>I.jsx("td",{className:"px-3 py-1.5 text-foreground",children:rb($.column.columnDef.cell,$.getContext())},$.id)),[]),L=E.useCallback(()=>O.getHeaderGroups().map(N=>I.jsx("tr",{className:"border-b border-border",children:N.headers.map(_=>{const $=_.column.getCanSort(),F=_.column.getIsSorted();return I.jsx("th",{"aria-sort":F==="asc"?"ascending":F==="desc"?"descending":"none",colSpan:_.colSpan,className:"h-8 px-3 text-left text-xs font-medium text-muted-foreground",scope:"col",children:_.isPlaceholder?null:$?I.jsxs("button",{className:"inline-flex items-center gap-1 hover:text-foreground",onClick:_.column.getToggleSortingHandler(),type:"button",children:[rb(_.column.columnDef.header,_.getContext()),I.jsx("span",{"aria-hidden":"true",children:I.jsx(jW,{direction:F})})]}):rb(_.column.columnDef.header,_.getContext())},_.id)})},N.id)),[O]),H=E.useCallback((N,_)=>_.id,[]);return I.jsx(S7,{className:S,components:_W,computeItemKey:H,context:M,data:P,endReached:u,fixedHeaderContent:L,itemContent:D,startReached:a,style:w})};function jW({direction:t}){return t==="asc"?I.jsx(o8,{className:"h-3 w-3"}):t==="desc"?I.jsx(r8,{className:"h-3 w-3"}):I.jsx(XS,{className:"h-3 w-3 text-muted-foreground/60"})}function VW({className:t,...e}){return I.jsx("nav",{"data-slot":"sidebar",className:ot("flex h-full w-56 shrink-0 flex-col gap-4 overflow-y-auto border-r border-sidebar-border bg-sidebar p-2 text-sidebar-foreground",t),...e})}function FW({className:t,label:e,children:n,...r}){return I.jsxs("div",{"data-slot":"sidebar-group",className:ot("flex flex-col gap-0.5",t),...r,children:[e&&I.jsx("div",{"data-slot":"sidebar-group-label",className:"px-2 py-1 text-xs font-medium text-sidebar-foreground/60",children:e}),n]})}function UW({className:t,selected:e=!1,trailing:n,children:r,type:i="button",...s}){return I.jsxs("button",{type:i,"data-slot":"sidebar-item","data-selected":e||void 0,"aria-current":e||void 0,className:ot("flex h-7 w-full items-center gap-2 rounded-md px-2 text-left text-sm text-sidebar-foreground","hover:bg-sidebar-accent hover:text-sidebar-accent-foreground","outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring","data-[selected]:bg-sidebar-accent data-[selected]:text-sidebar-accent-foreground data-[selected]:font-medium",t),...s,children:[I.jsx("span",{className:"min-w-0 flex-1 truncate",children:r}),n]})}const ub=Object.assign(VW,{Group:FW,Item:UW});function $W({className:t,icon:e,title:n,description:r,action:i,...s}){return I.jsxs("div",{"data-slot":"empty-state",className:ot("flex flex-1 flex-col items-center justify-center gap-1.5 p-8 text-center",t),...s,children:[e&&I.jsx(e,{className:"mb-2 h-8 w-8 text-muted-foreground"}),I.jsx("p",{className:"text-sm font-medium text-foreground",children:n}),r&&I.jsx("p",{className:"max-w-sm text-sm text-muted-foreground",children:r}),i&&I.jsx("div",{className:"mt-3",children:i})]})}function ed({open:t,onOpenChange:e,title:n,description:r,variant:i="confirm",destructive:s=!1,confirmLabel:a,cancelLabel:u="Cancel",onConfirm:f}){const d=i==="alert";return I.jsx(sn,{open:t,onOpenChange:e,children:I.jsxs(sn.Content,{showCloseButton:!1,children:[I.jsxs(sn.Header,{children:[I.jsx(sn.Title,{children:n}),r&&I.jsx(sn.Description,{children:r})]}),I.jsxs(sn.Footer,{children:[!d&&I.jsx(sn.Close,{render:I.jsx(Li,{variant:"outline"}),children:u}),I.jsx(sn.Close,{render:I.jsx(Li,{variant:s?"destructive":"default"}),onClick:f,children:a??(d?"OK":"Confirm")})]})]})})}const qW=new Set(["object","array"]);function s1(t){if(t===null)return"null";if(Array.isArray(t))return"array";const e=typeof t;return e==="object"?"object":e}function GW(t){return qW.has(s1(t))}function cN(t){if(Array.isArray(t))return t.map((e,n)=>String(n));if(s1(t)==="object")return Object.keys(t)}function WW(t){const e=cN(t)??[];return Array.isArray(t)?`[${e.length}]`:`{${e.length}}`}function KW({data:t,className:e,defaultExpandedDepth:n=1}){return I.jsx("div",{"data-slot":"json-inspector",className:ot("font-mono text-xs",e),children:I.jsx(fN,{label:null,value:t,depth:0,defaultExpandedDepth:n})})}function fN({label:t,value:e,depth:n,defaultExpandedDepth:r}){const[i,s]=E.useState(n<r);if(!GW(e))return I.jsxs("div",{"data-slot":"json-inspector-leaf",className:"flex gap-1",children:[t!==null&&I.jsxs("span",{className:"text-muted-foreground",children:[t,":"]}),I.jsx(XW,{value:e})]});const a=cN(e)??[];return I.jsxs("div",{"data-slot":"json-inspector-node",children:[I.jsxs("button",{type:"button",onClick:()=>s(u=>!u),className:"inline-flex items-center gap-1 text-foreground hover:text-primary",children:[I.jsx(i8,{className:ot("h-3 w-3 shrink-0 text-muted-foreground transition-transform",i&&"rotate-90")}),t!==null&&I.jsxs("span",{className:"text-muted-foreground",children:[t,":"]}),I.jsx("span",{className:"text-muted-foreground",children:WW(e)})]}),i&&I.jsx("div",{className:"ml-3.5 border-l border-border pl-2",children:a.map(u=>I.jsx(fN,{label:u,value:e[u],depth:n+1,defaultExpandedDepth:r},u))})]})}const YW={string:"text-primary",number:"text-accent-foreground",boolean:"text-secondary-foreground",null:"text-destructive",undefined:"text-destructive"};function XW({value:t}){const e=s1(t),n=e==="string"?`"${t}"`:String(t);return I.jsx("span",{className:YW[e]??"text-foreground",children:n})}const vO=["string","number","boolean","buffer"],jg=({adapterId:t,storageId:e})=>`${t}:${e}`,cb=1;class Ao extends Error{constructor(e,n){super(n),this.path=e}}const ls=t=>t===null?"null":Array.isArray(t)?"array":typeof t,QW=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),Wm=(t,e)=>{if(!QW(t))throw new Ao(e,`Expected object, got ${ls(t)}`);return t},Xa=(t,e)=>{if(typeof t!="string")throw new Ao(e,`Expected string, got ${ls(t)}`);return t},dN=(t,e)=>{if(!Array.isArray(t))throw new Ao(e,`Expected array, got ${ls(t)}`);return t},hN=(t,e)=>{if(typeof t!="string"||!vO.includes(t))throw new Ao(e,`Expected one of ${vO.join(", ")}, got ${ls(t)}`);return t},ZW=(t,e)=>{const n=Wm(t,e);return{supportedTypes:dN(n.supportedTypes,`${e}.supportedTypes`).map((s,a)=>hN(s,`${e}.supportedTypes[${a}]`))}},JW=t=>{const e=Wm(t,"storage");return{adapterId:Xa(e.adapterId,"storage.adapterId"),storageId:Xa(e.storageId,"storage.storageId"),adapterName:Xa(e.adapterName,"storage.adapterName"),storageName:Xa(e.storageName,"storage.storageName"),capabilities:ZW(e.capabilities,"storage.capabilities")}},eK=(t,e)=>{const n=Wm(t,e),r=Xa(n.key,`${e}.key`),i=hN(n.type,`${e}.type`),s=`${e}.value`;switch(i){case"string":{const a=n.value;if(typeof a!="string")throw new Ao(s,`Expected string for type "string", got ${ls(a)}`);return{key:r,type:"string",value:a}}case"number":{const a=n.value;if(typeof a!="number"||!Number.isFinite(a))throw new Ao(s,`Expected finite number for type "number", got ${ls(a)}`);return{key:r,type:"number",value:a}}case"boolean":{const a=n.value;if(typeof a!="boolean")throw new Ao(s,`Expected boolean for type "boolean", got ${ls(a)}`);return{key:r,type:"boolean",value:a}}case"buffer":{const a=n.value;if(!Array.isArray(a))throw new Ao(s,`Expected number[] for type "buffer", got ${ls(a)}`);const u=a.map((f,d)=>{if(typeof f!="number"||!Number.isInteger(f)||f<0||f>255)throw new Ao(`${s}[${d}]`,`Expected uint8 (integer 0-255), got ${ls(f)}`);return f});return{key:r,type:"buffer",value:u}}}},tK=t=>{try{const e=Wm(t,"$"),n=e.version;if(n!==cb)throw new Ao("version",`Unsupported snapshot version: ${ls(n)} (this build supports version ${cb})`);const r=Xa(e.plugin,"plugin"),i=Xa(e.createdAt,"createdAt"),s=JW(e.storage),u=dN(e.entries,"entries").map((f,d)=>eK(f,`entries[${d}]`));return{ok:!0,snapshot:{version:cb,plugin:r,createdAt:i,storage:s,entries:u}}}catch(e){if(e instanceof Ao)return{ok:!1,error:{path:e.path,message:e.message}};throw e}};let $x=[],gN=[];(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,n=0;e<t.length;e++)(e%2?gN:$x).push(n=n+t[e])})();function nK(t){if(t<768)return!1;for(let e=0,n=$x.length;;){let r=e+n>>1;if(t<$x[r])n=r;else if(t>=gN[r])e=r+1;else return!0;if(e==n)return!1}}function bO(t){return t>=127462&&t<=127487}const xO=8205;function rK(t,e,n=!0,r=!0){return(n?pN:iK)(t,e,r)}function pN(t,e,n){if(e==t.length)return e;e&&mN(t.charCodeAt(e))&&yN(t.charCodeAt(e-1))&&e--;let r=fb(t,e);for(e+=SO(r);e<t.length;){let i=fb(t,e);if(r==xO||i==xO||n&&nK(i))e+=SO(i),r=i;else if(bO(i)){let s=0,a=e-2;for(;a>=0&&bO(fb(t,a));)s++,a-=2;if(s%2==0)break;e+=2}else break}return e}function iK(t,e,n){for(;e>0;){let r=pN(t,e-2,n);if(r<e)return r;e--}return 0}function fb(t,e){let n=t.charCodeAt(e);if(!yN(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return mN(r)?(n-55296<<10)+(r-56320)+65536:n}function mN(t){return t>=56320&&t<57344}function yN(t){return t>=55296&&t<56320}function SO(t){return t<65536?1:2}class qt{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,n,r){[e,n]=Cc(this,e,n);let i=[];return this.decompose(0,e,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(n,this.length,i,1),as.from(i,this.length-(n-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=Cc(this,e,n);let r=[];return this.decompose(e,n,r,0),as.from(r,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),i=new td(this),s=new td(e);for(let a=n,u=n;;){if(i.next(a),s.next(a),a=0,i.lineBreak!=s.lineBreak||i.done!=s.done||i.value!=s.value)return!1;if(u+=i.value.length,i.done||u>=r)return!0}}iter(e=1){return new td(this,e)}iterRange(e,n=this.length){return new vN(this,e,n)}iterLines(e,n){let r;if(e==null)r=this.iter();else{n==null&&(n=this.lines+1);let i=this.line(e).from;r=this.iterRange(i,Math.max(i,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new bN(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?qt.empty:e.length<=32?new nr(e):as.from(nr.split(e,[]))}}class nr extends qt{constructor(e,n=oK(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,r,i){for(let s=0;;s++){let a=this.text[s],u=i+a.length;if((n?r:u)>=e)return new sK(i,u,r,a);i=u+1,r++}}decompose(e,n,r,i){let s=e<=0&&n>=this.length?this:new nr(wO(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(i&1){let a=r.pop(),u=mp(s.text,a.text.slice(),0,s.length);if(u.length<=32)r.push(new nr(u,a.length+s.length));else{let f=u.length>>1;r.push(new nr(u.slice(0,f)),new nr(u.slice(f)))}}else r.push(s)}replace(e,n,r){if(!(r instanceof nr))return super.replace(e,n,r);[e,n]=Cc(this,e,n);let i=mp(this.text,mp(r.text,wO(this.text,0,e)),n),s=this.length+r.length-(n-e);return i.length<=32?new nr(i,s):as.from(nr.split(i,[]),s)}sliceString(e,n=this.length,r=`
22
- `){[e,n]=Cc(this,e,n);let i="";for(let s=0,a=0;s<=n&&a<this.text.length;a++){let u=this.text[a],f=s+u.length;s>e&&a&&(i+=r),e<f&&n>s&&(i+=u.slice(Math.max(0,e-s),n-s)),s=f+1}return i}flatten(e){for(let n of this.text)e.push(n)}scanIdentical(){return 0}static split(e,n){let r=[],i=-1;for(let s of e)r.push(s),i+=s.length+1,r.length==32&&(n.push(new nr(r,i)),r=[],i=-1);return i>-1&&n.push(new nr(r,i)),n}}class as extends qt{constructor(e,n){super(),this.children=e,this.length=n,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,n,r,i){for(let s=0;;s++){let a=this.children[s],u=i+a.length,f=r+a.lines-1;if((n?f:u)>=e)return a.lineInner(e,n,r,i);i=u+1,r=f+1}}decompose(e,n,r,i){for(let s=0,a=0;a<=n&&s<this.children.length;s++){let u=this.children[s],f=a+u.length;if(e<=f&&n>=a){let d=i&((a<=e?1:0)|(f>=n?2:0));a>=e&&f<=n&&!d?r.push(u):u.decompose(e-a,n-a,r,d)}a=f+1}}replace(e,n,r){if([e,n]=Cc(this,e,n),r.lines<this.lines)for(let i=0,s=0;i<this.children.length;i++){let a=this.children[i],u=s+a.length;if(e>=s&&n<=u){let f=a.replace(e-s,n-s,r),d=this.lines-a.lines+f.lines;if(f.lines<d>>4&&f.lines>d>>6){let g=this.children.slice();return g[i]=f,new as(g,this.length-(n-e)+r.length)}return super.replace(s,u,f)}s=u+1}return super.replace(e,n,r)}sliceString(e,n=this.length,r=`
23
- `){[e,n]=Cc(this,e,n);let i="";for(let s=0,a=0;s<this.children.length&&a<=n;s++){let u=this.children[s],f=a+u.length;a>e&&s&&(i+=r),e<f&&n>a&&(i+=u.sliceString(e-a,n-a,r)),a=f+1}return i}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof as))return 0;let r=0,[i,s,a,u]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=n,s+=n){if(i==a||s==u)return r;let f=this.children[i],d=e.children[s];if(f!=d)return r+f.scanIdentical(d,n);r+=f.length+1}}static from(e,n=e.reduce((r,i)=>r+i.length+1,-1)){let r=0;for(let v of e)r+=v.lines;if(r<32){let v=[];for(let b of e)b.flatten(v);return new nr(v,n)}let i=Math.max(32,r>>5),s=i<<1,a=i>>1,u=[],f=0,d=-1,g=[];function p(v){let b;if(v.lines>s&&v instanceof as)for(let S of v.children)p(S);else v.lines>a&&(f>a||!f)?(m(),u.push(v)):v instanceof nr&&f&&(b=g[g.length-1])instanceof nr&&v.lines+b.lines<=32?(f+=v.lines,d+=v.length+1,g[g.length-1]=new nr(b.text.concat(v.text),b.length+1+v.length)):(f+v.lines>i&&m(),f+=v.lines,d+=v.length+1,g.push(v))}function m(){f!=0&&(u.push(g.length==1?g[0]:as.from(g,d)),d=-1,f=g.length=0)}for(let v of e)p(v);return m(),u.length==1?u[0]:new as(u,n)}}qt.empty=new nr([""],0);function oK(t){let e=-1;for(let n of t)e+=n.length+1;return e}function mp(t,e,n=0,r=1e9){for(let i=0,s=0,a=!0;s<t.length&&i<=r;s++){let u=t[s],f=i+u.length;f>=n&&(f>r&&(u=u.slice(0,r-i)),i<n&&(u=u.slice(n-i)),a?(e[e.length-1]+=u,a=!1):e.push(u)),i=f+1}return e}function wO(t,e,n){return mp(t,[""],e,n)}class td{constructor(e,n=1){this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[n>0?1:(e instanceof nr?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,i=this.nodes[r],s=this.offsets[r],a=s>>1,u=i instanceof nr?i.text.length:i.children.length;if(a==(n>0?u:0)){if(r==0)return this.done=!0,this.value="",this;n>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(n>0?0:1)){if(this.offsets[r]+=n,e==0)return this.lineBreak=!0,this.value=`
24
- `,this;e--}else if(i instanceof nr){let f=i.text[a+(n<0?-1:0)];if(this.offsets[r]+=n,f.length>Math.max(0,e))return this.value=e==0?f:n>0?f.slice(e):f.slice(0,f.length-e),this;e-=f.length}else{let f=i.children[a+(n<0?-1:0)];e>f.length?(e-=f.length,this.offsets[r]+=n):(n<0&&this.offsets[r]--,this.nodes.push(f),this.offsets.push(n>0?1:(f instanceof nr?f.text.length:f.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class vN{constructor(e,n,r){this.value="",this.done=!1,this.cursor=new td(e,n>r?-1:1),this.pos=n>r?e.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}nextInner(e,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let r=n<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*n,this.value=i.length<=r?i:n<0?i.slice(i.length-r):i.slice(0,r),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class bN{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:r,value:i}=this.inner.next(e);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(qt.prototype[Symbol.iterator]=function(){return this.iter()},td.prototype[Symbol.iterator]=vN.prototype[Symbol.iterator]=bN.prototype[Symbol.iterator]=function(){return this});class sK{constructor(e,n,r,i){this.from=e,this.to=n,this.number=r,this.text=i}get length(){return this.to-this.from}}function Cc(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}function Yr(t,e,n=!0,r=!0){return rK(t,e,n,r)}function lK(t){return t>=56320&&t<57344}function aK(t){return t>=55296&&t<56320}function uK(t,e){let n=t.charCodeAt(e);if(!aK(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return lK(r)?(n-55296<<10)+(r-56320)+65536:n}function cK(t){return t<65536?1:2}const qx=/\r\n?|\n/;var Di=(function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t})(Di||(Di={}));class ms{constructor(e){this.sections=e}get length(){let e=0;for(let n=0;n<this.sections.length;n+=2)e+=this.sections[n];return e}get newLength(){let e=0;for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n+1];e+=r<0?this.sections[n]:r}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let n=0,r=0,i=0;n<this.sections.length;){let s=this.sections[n++],a=this.sections[n++];a<0?(e(r,i,s),i+=s):i+=a,r+=s}}iterChangedRanges(e,n=!1){Gx(this,e,n)}get invertedDesc(){let e=[];for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];i<0?e.push(r,i):e.push(i,r)}return new ms(e)}composeDesc(e){return this.empty?e:e.empty?this:xN(this,e)}mapDesc(e,n=!1){return e.empty?this:Wx(this,e,n)}mapPos(e,n=-1,r=Di.Simple){let i=0,s=0;for(let a=0;a<this.sections.length;){let u=this.sections[a++],f=this.sections[a++],d=i+u;if(f<0){if(d>e)return s+(e-i);s+=u}else{if(r!=Di.Simple&&d>=e&&(r==Di.TrackDel&&i<e&&d>e||r==Di.TrackBefore&&i<e||r==Di.TrackAfter&&d>e))return null;if(d>e||d==e&&n<0&&!u)return e==i||n<0?s:s+f;s+=f}i=d}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return s}touchesRange(e,n=e){for(let r=0,i=0;r<this.sections.length&&i<=n;){let s=this.sections[r++],a=this.sections[r++],u=i+s;if(a>=0&&i<=n&&u>=e)return i<e&&u>n?"cover":!0;i=u}return!1}toString(){let e="";for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];e+=(e?" ":"")+r+(i>=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new ms(e)}static create(e){return new ms(e)}}class vr extends ms{constructor(e,n){super(e),this.inserted=n}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return Gx(this,(n,r,i,s,a)=>e=e.replace(i,i+(r-n),a),!1),e}mapDesc(e,n=!1){return Wx(this,e,n,!0)}invert(e){let n=this.sections.slice(),r=[];for(let i=0,s=0;i<n.length;i+=2){let a=n[i],u=n[i+1];if(u>=0){n[i]=u,n[i+1]=a;let f=i>>1;for(;r.length<f;)r.push(qt.empty);r.push(a?e.slice(s,s+a):qt.empty)}s+=a}return new vr(n,r)}compose(e){return this.empty?e:e.empty?this:xN(this,e,!0)}map(e,n=!1){return e.empty?this:Wx(this,e,n,!0)}iterChanges(e,n=!1){Gx(this,e,n)}get desc(){return ms.create(this.sections)}filter(e){let n=[],r=[],i=[],s=new Ad(this);e:for(let a=0,u=0;;){let f=a==e.length?1e9:e[a++];for(;u<f||u==f&&s.len==0;){if(s.done)break e;let g=Math.min(s.len,f-u);Wr(i,g,-1);let p=s.ins==-1?-1:s.off==0?s.ins:0;Wr(n,g,p),p>0&&Ql(r,n,s.text),s.forward(g),u+=g}let d=e[a++];for(;u<d;){if(s.done)break e;let g=Math.min(s.len,d-u);Wr(n,g,-1),Wr(i,g,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(g),u+=g}}return{changes:new vr(n,r),filtered:ms.create(i)}}toJSON(){let e=[];for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n],i=this.sections[n+1];i<0?e.push(r):i==0?e.push([r]):e.push([r].concat(this.inserted[n>>1].toJSON()))}return e}static of(e,n,r){let i=[],s=[],a=0,u=null;function f(g=!1){if(!g&&!i.length)return;a<n&&Wr(i,n-a,-1);let p=new vr(i,s);u=u?u.compose(p.map(u)):p,i=[],s=[],a=0}function d(g){if(Array.isArray(g))for(let p of g)d(p);else if(g instanceof vr){if(g.length!=n)throw new RangeError(`Mismatched change set length (got ${g.length}, expected ${n})`);f(),u=u?u.compose(g.map(u)):g}else{let{from:p,to:m=p,insert:v}=g;if(p>m||p<0||m>n)throw new RangeError(`Invalid change range ${p} to ${m} (in doc of length ${n})`);let b=v?typeof v=="string"?qt.of(v.split(r||qx)):v:qt.empty,S=b.length;if(p==m&&S==0)return;p<a&&f(),p>a&&Wr(i,p-a,-1),Wr(i,m-p,S),Ql(s,i,b),a=m}}return d(e),f(!u),u}static empty(e){return new vr(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],r=[];for(let i=0;i<e.length;i++){let s=e[i];if(typeof s=="number")n.push(s,-1);else{if(!Array.isArray(s)||typeof s[0]!="number"||s.some((a,u)=>u&&typeof a!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)n.push(s[0],0);else{for(;r.length<i;)r.push(qt.empty);r[i]=qt.of(s.slice(1)),n.push(s[0],r[i].length)}}}return new vr(n,r)}static createSet(e,n){return new vr(e,n)}}function Wr(t,e,n,r=!1){if(e==0&&n<=0)return;let i=t.length-2;i>=0&&n<=0&&n==t[i+1]?t[i]+=e:i>=0&&e==0&&t[i]==0?t[i+1]+=n:r?(t[i]+=e,t[i+1]+=n):t.push(e,n)}function Ql(t,e,n){if(n.length==0)return;let r=e.length-2>>1;if(r<t.length)t[t.length-1]=t[t.length-1].append(n);else{for(;t.length<r;)t.push(qt.empty);t.push(n)}}function Gx(t,e,n){let r=t.inserted;for(let i=0,s=0,a=0;a<t.sections.length;){let u=t.sections[a++],f=t.sections[a++];if(f<0)i+=u,s+=u;else{let d=i,g=s,p=qt.empty;for(;d+=u,g+=f,f&&r&&(p=p.append(r[a-2>>1])),!(n||a==t.sections.length||t.sections[a+1]<0);)u=t.sections[a++],f=t.sections[a++];e(i,d,s,g,p),i=d,s=g}}}function Wx(t,e,n,r=!1){let i=[],s=r?[]:null,a=new Ad(t),u=new Ad(e);for(let f=-1;;){if(a.done&&u.len||u.done&&a.len)throw new Error("Mismatched change set lengths");if(a.ins==-1&&u.ins==-1){let d=Math.min(a.len,u.len);Wr(i,d,-1),a.forward(d),u.forward(d)}else if(u.ins>=0&&(a.ins<0||f==a.i||a.off==0&&(u.len<a.len||u.len==a.len&&!n))){let d=u.len;for(Wr(i,u.ins,-1);d;){let g=Math.min(a.len,d);a.ins>=0&&f<a.i&&a.len<=g&&(Wr(i,0,a.ins),s&&Ql(s,i,a.text),f=a.i),a.forward(g),d-=g}u.next()}else if(a.ins>=0){let d=0,g=a.len;for(;g;)if(u.ins==-1){let p=Math.min(g,u.len);d+=p,g-=p,u.forward(p)}else if(u.ins==0&&u.len<g)g-=u.len,u.next();else break;Wr(i,d,f<a.i?a.ins:0),s&&f<a.i&&Ql(s,i,a.text),f=a.i,a.forward(a.len-g)}else{if(a.done&&u.done)return s?vr.createSet(i,s):ms.create(i);throw new Error("Mismatched change set lengths")}}}function xN(t,e,n=!1){let r=[],i=n?[]:null,s=new Ad(t),a=new Ad(e);for(let u=!1;;){if(s.done&&a.done)return i?vr.createSet(r,i):ms.create(r);if(s.ins==0)Wr(r,s.len,0,u),s.next();else if(a.len==0&&!a.done)Wr(r,0,a.ins,u),i&&Ql(i,r,a.text),a.next();else{if(s.done||a.done)throw new Error("Mismatched change set lengths");{let f=Math.min(s.len2,a.len),d=r.length;if(s.ins==-1){let g=a.ins==-1?-1:a.off?0:a.ins;Wr(r,f,g,u),i&&g&&Ql(i,r,a.text)}else a.ins==-1?(Wr(r,s.off?0:s.len,f,u),i&&Ql(i,r,s.textBit(f))):(Wr(r,s.off?0:s.len,a.off?0:a.ins,u),i&&!a.off&&Ql(i,r,a.text));u=(s.ins>f||a.ins>=0&&a.len>f)&&(u||r.length>d),s.forward2(f),a.forward(f)}}}}class Ad{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,n=this.i-2>>1;return n>=e.length?qt.empty:e[n]}textBit(e){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!e?qt.empty:n[r].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class Qa{constructor(e,n,r){this.from=e,this.to=n,this.flags=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,n=-1){let r,i;return this.empty?r=i=e.mapPos(this.from,n):(r=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new Qa(r,i,this.flags)}extend(e,n=e,r=0){if(e<=this.anchor&&n>=this.anchor)return Ae.range(e,n,void 0,void 0,r);let i=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return Ae.range(this.anchor,i,void 0,void 0,r)}eq(e,n=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!n||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return Ae.range(e.anchor,e.head)}static create(e,n,r){return new Qa(e,n,r)}}class Ae{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:Ae.create(this.ranges.map(r=>r.map(e,n)),this.mainIndex)}eq(e,n=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let r=0;r<this.ranges.length;r++)if(!this.ranges[r].eq(e.ranges[r],n))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new Ae([this.main],0)}addRange(e,n=!0){return Ae.create([e].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(e,n=this.mainIndex){let r=this.ranges.slice();return r[n]=e,Ae.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new Ae(e.ranges.map(n=>Qa.fromJSON(n)),e.main)}static single(e,n=e){return new Ae([Ae.range(e,n)],0)}static create(e,n=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,i=0;i<e.length;i++){let s=e[i];if(s.empty?s.from<=r:s.from<r)return Ae.normalized(e.slice(),n);r=s.to}return new Ae(e,n)}static cursor(e,n=0,r,i){return Qa.create(e,e,(n==0?0:n<0?8:16)|(r==null?7:Math.min(6,r))|(i??16777215)<<6)}static range(e,n,r,i,s){let a=(r??16777215)<<6|(i==null?7:Math.min(6,i));return!s&&e!=n&&(s=n<e?1:-1),n<e?Qa.create(n,e,48|a):Qa.create(e,n,(s?s<0?8:16:0)|a)}static normalized(e,n=0){let r=e[n];e.sort((i,s)=>i.from-s.from),n=e.indexOf(r);for(let i=1;i<e.length;i++){let s=e[i],a=e[i-1];if(s.empty?s.from<=a.to:s.from<a.to){let u=a.from,f=Math.max(s.to,a.to);i<=n&&n--,e.splice(--i,2,s.anchor>s.head?Ae.range(f,u):Ae.range(u,f))}}return new Ae(e,n)}}function SN(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let l1=0;class mt{constructor(e,n,r,i,s){this.combine=e,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=l1++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new mt(e.combine||(n=>n),e.compareInput||((n,r)=>n===r),e.compare||(e.combine?(n,r)=>n===r:a1),!!e.static,e.enables)}of(e){return new yp([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new yp(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new yp(e,this,2,n)}from(e,n){return n||(n=r=>r),this.compute([e],r=>n(r.field(e)))}}function a1(t,e){return t==e||t.length==e.length&&t.every((n,r)=>n===e[r])}class yp{constructor(e,n,r,i){this.dependencies=e,this.facet=n,this.type=r,this.value=i,this.id=l1++}dynamicSlot(e){var n;let r=this.value,i=this.facet.compareInput,s=this.id,a=e[s]>>1,u=this.type==2,f=!1,d=!1,g=[];for(let p of this.dependencies)p=="doc"?f=!0:p=="selection"?d=!0:(((n=e[p.id])!==null&&n!==void 0?n:1)&1)==0&&g.push(e[p.id]);return{create(p){return p.values[a]=r(p),1},update(p,m){if(f&&m.docChanged||d&&(m.docChanged||m.selection)||Kx(p,g)){let v=r(p);if(u?!CO(v,p.values[a],i):!i(v,p.values[a]))return p.values[a]=v,1}return 0},reconfigure:(p,m)=>{let v,b=m.config.address[s];if(b!=null){let S=$p(m,b);if(this.dependencies.every(w=>w instanceof mt?m.facet(w)===p.facet(w):w instanceof va?m.field(w,!1)==p.field(w,!1):!0)||(u?CO(v=r(p),S,i):i(v=r(p),S)))return p.values[a]=S,0}else v=r(p);return p.values[a]=v,1}}}}function CO(t,e,n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!n(t[r],e[r]))return!1;return!0}function Kx(t,e){let n=!1;for(let r of e)nd(t,r)&1&&(n=!0);return n}function fK(t,e,n){let r=n.map(f=>t[f.id]),i=n.map(f=>f.type),s=r.filter(f=>!(f&1)),a=t[e.id]>>1;function u(f){let d=[];for(let g=0;g<r.length;g++){let p=$p(f,r[g]);if(i[g]==2)for(let m of p)d.push(m);else d.push(p)}return e.combine(d)}return{create(f){for(let d of r)nd(f,d);return f.values[a]=u(f),1},update(f,d){if(!Kx(f,s))return 0;let g=u(f);return e.compare(g,f.values[a])?0:(f.values[a]=g,1)},reconfigure(f,d){let g=Kx(f,r),p=d.config.facets[e.id],m=d.facet(e);if(p&&!g&&a1(n,p))return f.values[a]=m,0;let v=u(f);return e.compare(v,m)?(f.values[a]=m,0):(f.values[a]=v,1)}}}const Vg=mt.define({static:!0});class va{constructor(e,n,r,i,s){this.id=e,this.createF=n,this.updateF=r,this.compareF=i,this.spec=s,this.provides=void 0}static define(e){let n=new va(l1++,e.create,e.update,e.compare||((r,i)=>r===i),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(Vg).find(r=>r.field==this);return(n?.create||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:r=>(r.values[n]=this.create(r),1),update:(r,i)=>{let s=r.values[n],a=this.updateF(s,i);return this.compareF(s,a)?0:(r.values[n]=a,1)},reconfigure:(r,i)=>{let s=r.facet(Vg),a=i.facet(Vg),u;return(u=s.find(f=>f.field==this))&&u!=a.find(f=>f.field==this)?(r.values[n]=u.create(r),1):i.config.address[this.id]!=null?(r.values[n]=i.field(this),0):(r.values[n]=this.create(r),1)}}}init(e){return[this,Vg.of({field:this,create:e})]}get extension(){return this}}const Ga={lowest:4,low:3,default:2,high:1,highest:0};function zf(t){return e=>new CN(e,t)}const wN={highest:zf(Ga.highest),high:zf(Ga.high),default:zf(Ga.default),low:zf(Ga.low),lowest:zf(Ga.lowest)};class CN{constructor(e,n){this.inner=e,this.prec=n}}class Km{of(e){return new Yx(this,e)}reconfigure(e){return Km.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Yx{constructor(e,n){this.compartment=e,this.inner=n}}class Up{constructor(e,n,r,i,s,a){for(this.base=e,this.compartments=n,this.dynamicSlots=r,this.address=i,this.staticValues=s,this.facets=a,this.statusTemplate=[];this.statusTemplate.length<r.length;)this.statusTemplate.push(0)}staticFacet(e){let n=this.address[e.id];return n==null?e.default:this.staticValues[n>>1]}static resolve(e,n,r){let i=[],s=Object.create(null),a=new Map;for(let m of dK(e,n,a))m instanceof va?i.push(m):(s[m.facet.id]||(s[m.facet.id]=[])).push(m);let u=Object.create(null),f=[],d=[];for(let m of i)u[m.id]=d.length<<1,d.push(v=>m.slot(v));let g=r?.config.facets;for(let m in s){let v=s[m],b=v[0].facet,S=g&&g[m]||[];if(v.every(w=>w.type==0))if(u[b.id]=f.length<<1|1,a1(S,v))f.push(r.facet(b));else{let w=b.combine(v.map(C=>C.value));f.push(r&&b.compare(w,r.facet(b))?r.facet(b):w)}else{for(let w of v)w.type==0?(u[w.id]=f.length<<1|1,f.push(w.value)):(u[w.id]=d.length<<1,d.push(C=>w.dynamicSlot(C)));u[b.id]=d.length<<1,d.push(w=>fK(w,b,v))}}let p=d.map(m=>m(u));return new Up(e,a,p,u,f,s)}}function dK(t,e,n){let r=[[],[],[],[],[]],i=new Map;function s(a,u){let f=i.get(a);if(f!=null){if(f<=u)return;let d=r[f].indexOf(a);d>-1&&r[f].splice(d,1),a instanceof Yx&&n.delete(a.compartment)}if(i.set(a,u),Array.isArray(a))for(let d of a)s(d,u);else if(a instanceof Yx){if(n.has(a.compartment))throw new RangeError("Duplicate use of compartment in extensions");let d=e.get(a.compartment)||a.inner;n.set(a.compartment,d),s(d,u)}else if(a instanceof CN)s(a.inner,a.prec);else if(a instanceof va)r[u].push(a),a.provides&&s(a.provides,u);else if(a instanceof yp)r[u].push(a),a.facet.extensions&&s(a.facet.extensions,Ga.default);else{let d=a.extension;if(!d)throw new Error(`Unrecognized extension value in extension set (${a}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(d,u)}}return s(t,Ga.default),r.reduce((a,u)=>a.concat(u))}function nd(t,e){if(e&1)return 2;let n=e>>1,r=t.status[n];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;t.status[n]=4;let i=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|i}function $p(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const RN=mt.define(),Xx=mt.define({combine:t=>t.some(e=>e),static:!0}),EN=mt.define({combine:t=>t.length?t[0]:void 0,static:!0}),TN=mt.define(),AN=mt.define(),MN=mt.define(),ON=mt.define({combine:t=>t.length?t[0]:!1});class ba{constructor(e,n){this.type=e,this.value=n}static define(){return new hK}}class hK{of(e){return new ba(this,e)}}class gK{constructor(e){this.map=e}of(e){return new ir(this,e)}}class ir{constructor(e,n){this.type=e,this.value=n}map(e){let n=this.type.map(this.value,e);return n===void 0?void 0:n==this.value?this:new ir(this.type,n)}is(e){return this.type==e}static define(e={}){return new gK(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let r=[];for(let i of e){let s=i.map(n);s&&r.push(s)}return r}}ir.reconfigure=ir.define();ir.appendConfig=ir.define();class xr{constructor(e,n,r,i,s,a){this.startState=e,this.changes=n,this.selection=r,this.effects=i,this.annotations=s,this.scrollIntoView=a,this._doc=null,this._state=null,r&&SN(r,n.newLength),s.some(u=>u.type==xr.time)||(this.annotations=s.concat(xr.time.of(Date.now())))}static create(e,n,r,i,s,a){return new xr(e,n,r,i,s,a)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let n of this.annotations)if(n.type==e)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let n=this.annotation(xr.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}xr.time=ba.define();xr.userEvent=ba.define();xr.addToHistory=ba.define();xr.remote=ba.define();function pK(t,e){let n=[];for(let r=0,i=0;;){let s,a;if(r<t.length&&(i==e.length||e[i]>=t[r]))s=t[r++],a=t[r++];else if(i<e.length)s=e[i++],a=e[i++];else return n;!n.length||n[n.length-1]<s?n.push(s,a):n[n.length-1]<a&&(n[n.length-1]=a)}}function kN(t,e,n){var r;let i,s,a;return n?(i=e.changes,s=vr.empty(e.changes.length),a=t.changes.compose(e.changes)):(i=e.changes.map(t.changes),s=t.changes.mapDesc(e.changes,!0),a=t.changes.compose(i)),{changes:a,selection:e.selection?e.selection.map(s):(r=t.selection)===null||r===void 0?void 0:r.map(i),effects:ir.mapEffects(t.effects,i).concat(ir.mapEffects(e.effects,s)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function Qx(t,e,n){let r=e.selection,i=fc(e.annotations);return e.userEvent&&(i=i.concat(xr.userEvent.of(e.userEvent))),{changes:e.changes instanceof vr?e.changes:vr.of(e.changes||[],n,t.facet(EN)),selection:r&&(r instanceof Ae?r:Ae.single(r.anchor,r.head)),effects:fc(e.effects),annotations:i,scrollIntoView:!!e.scrollIntoView}}function IN(t,e,n){let r=Qx(t,e.length?e[0]:{},t.doc.length);e.length&&e[0].filter===!1&&(n=!1);for(let s=1;s<e.length;s++){e[s].filter===!1&&(n=!1);let a=!!e[s].sequential;r=kN(r,Qx(t,e[s],a?r.changes.newLength:t.doc.length),a)}let i=xr.create(t,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return yK(n?mK(i):i)}function mK(t){let e=t.startState,n=!0;for(let i of e.facet(TN)){let s=i(t);if(s===!1){n=!1;break}Array.isArray(s)&&(n=n===!0?s:pK(n,s))}if(n!==!0){let i,s;if(n===!1)s=t.changes.invertedDesc,i=vr.empty(e.doc.length);else{let a=t.changes.filter(n);i=a.changes,s=a.filtered.mapDesc(a.changes).invertedDesc}t=xr.create(e,i,t.selection&&t.selection.map(s),ir.mapEffects(t.effects,s),t.annotations,t.scrollIntoView)}let r=e.facet(AN);for(let i=r.length-1;i>=0;i--){let s=r[i](t);s instanceof xr?t=s:Array.isArray(s)&&s.length==1&&s[0]instanceof xr?t=s[0]:t=IN(e,fc(s),!1)}return t}function yK(t){let e=t.startState,n=e.facet(MN),r=t;for(let i=n.length-1;i>=0;i--){let s=n[i](t);s&&Object.keys(s).length&&(r=kN(r,Qx(e,s,t.changes.newLength),!0))}return r==t?t:xr.create(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}const vK=[];function fc(t){return t==null?vK:Array.isArray(t)?t:[t]}var Ys=(function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t})(Ys||(Ys={}));const bK=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Zx;try{Zx=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function xK(t){if(Zx)return Zx.test(t);for(let e=0;e<t.length;e++){let n=t[e];if(/\w/.test(n)||n>"€"&&(n.toUpperCase()!=n.toLowerCase()||bK.test(n)))return!0}return!1}function SK(t){return e=>{if(!/\S/.test(e))return Ys.Space;if(xK(e))return Ys.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return Ys.Word;return Ys.Other}}class on{constructor(e,n,r,i,s,a){this.config=e,this.doc=n,this.selection=r,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=s,a&&(a._state=this);for(let u=0;u<this.config.dynamicSlots.length;u++)nd(this,u<<1);this.computeSlot=null}field(e,n=!0){let r=this.config.address[e.id];if(r==null){if(n)throw new RangeError("Field is not present in this state");return}return nd(this,r),$p(this,r)}update(...e){return IN(this,e,!0)}applyTransaction(e){let n=this.config,{base:r,compartments:i}=n;for(let u of e.effects)u.is(Km.reconfigure)?(n&&(i=new Map,n.compartments.forEach((f,d)=>i.set(d,f)),n=null),i.set(u.value.compartment,u.value.extension)):u.is(ir.reconfigure)?(n=null,r=u.value):u.is(ir.appendConfig)&&(n=null,r=fc(r).concat(u.value));let s;n?s=e.startState.values.slice():(n=Up.resolve(r,i,this),s=new on(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(f,d)=>d.reconfigure(f,this),null).values);let a=e.startState.facet(Xx)?e.newSelection:e.newSelection.asSingle();new on(n,e.newDoc,a,s,(u,f)=>f.update(u,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:e},range:Ae.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,r=e(n.ranges[0]),i=this.changes(r.changes),s=[r.range],a=fc(r.effects);for(let u=1;u<n.ranges.length;u++){let f=e(n.ranges[u]),d=this.changes(f.changes),g=d.map(i);for(let m=0;m<u;m++)s[m]=s[m].map(g);let p=i.mapDesc(d,!0);s.push(f.range.map(p)),i=i.compose(g),a=ir.mapEffects(a,g).concat(ir.mapEffects(fc(f.effects),p))}return{changes:i,selection:Ae.create(s,n.mainIndex),effects:a}}changes(e=[]){return e instanceof vr?e:vr.of(e,this.doc.length,this.facet(on.lineSeparator))}toText(e){return qt.of(e.split(this.facet(on.lineSeparator)||qx))}sliceDoc(e=0,n=this.doc.length){return this.doc.sliceString(e,n,this.lineBreak)}facet(e){let n=this.config.address[e.id];return n==null?e.default:(nd(this,n),$p(this,n))}toJSON(e){let n={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let r in e){let i=e[r];i instanceof va&&this.config.address[i.id]!=null&&(n[r]=i.spec.toJSON(this.field(e[r]),this))}return n}static fromJSON(e,n={},r){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let i=[];if(r){for(let s in r)if(Object.prototype.hasOwnProperty.call(e,s)){let a=r[s],u=e[s];i.push(a.init(f=>a.spec.fromJSON(u,f)))}}return on.create({doc:e.doc,selection:Ae.fromJSON(e.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(e={}){let n=Up.resolve(e.extensions||[],new Map),r=e.doc instanceof qt?e.doc:qt.of((e.doc||"").split(n.staticFacet(on.lineSeparator)||qx)),i=e.selection?e.selection instanceof Ae?e.selection:Ae.single(e.selection.anchor,e.selection.head):Ae.single(0);return SN(i,r.length),n.staticFacet(Xx)||(i=i.asSingle()),new on(n,r,i,n.dynamicSlots.map(()=>null),(s,a)=>a.create(s),null)}get tabSize(){return this.facet(on.tabSize)}get lineBreak(){return this.facet(on.lineSeparator)||`
25
- `}get readOnly(){return this.facet(ON)}phrase(e,...n){for(let r of this.facet(on.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return n.length&&(e=e.replace(/\$(\$|\d*)/g,(r,i)=>{if(i=="$")return"$";let s=+(i||1);return!s||s>n.length?r:n[s-1]})),e}languageDataAt(e,n,r=-1){let i=[];for(let s of this.facet(RN))for(let a of s(this,n,r))Object.prototype.hasOwnProperty.call(a,e)&&i.push(a[e]);return i}charCategorizer(e){let n=this.languageDataAt("wordChars",e);return SK(n.length?n[0]:"")}wordAt(e){let{text:n,from:r,length:i}=this.doc.lineAt(e),s=this.charCategorizer(e),a=e-r,u=e-r;for(;a>0;){let f=Yr(n,a,!1);if(s(n.slice(f,a))!=Ys.Word)break;a=f}for(;u<i;){let f=Yr(n,u);if(s(n.slice(u,f))!=Ys.Word)break;u=f}return a==u?null:Ae.range(a+r,u+r)}}on.allowMultipleSelections=Xx;on.tabSize=mt.define({combine:t=>t.length?t[0]:4});on.lineSeparator=EN;on.readOnly=ON;on.phrases=mt.define({compare(t,e){let n=Object.keys(t),r=Object.keys(e);return n.length==r.length&&n.every(i=>t[i]==e[i])}});on.languageData=RN;on.changeFilter=TN;on.transactionFilter=AN;on.transactionExtender=MN;Km.reconfigure=ir.define();function wK(t,e,n={}){let r={};for(let i of t)for(let s of Object.keys(i)){let a=i[s],u=r[s];if(u===void 0)r[s]=a;else if(!(u===a||a===void 0))if(Object.hasOwnProperty.call(n,s))r[s]=n[s](u,a);else throw new Error("Config merge conflict for field "+s)}for(let i in e)r[i]===void 0&&(r[i]=e[i]);return r}class uu{eq(e){return this==e}range(e,n=e){return Jx.create(e,n,this)}}uu.prototype.startSide=uu.prototype.endSide=0;uu.prototype.point=!1;uu.prototype.mapMode=Di.TrackDel;function u1(t,e){return t==e||t.constructor==e.constructor&&t.eq(e)}let Jx=class DN{constructor(e,n,r){this.from=e,this.to=n,this.value=r}static create(e,n,r){return new DN(e,n,r)}};function eS(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class c1{constructor(e,n,r,i){this.from=e,this.to=n,this.value=r,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,n,r,i=0){let s=r?this.to:this.from;for(let a=i,u=s.length;;){if(a==u)return a;let f=a+u>>1,d=s[f]-e||(r?this.value[f].endSide:this.value[f].startSide)-n;if(f==a)return d>=0?a:u;d>=0?u=f:a=f+1}}between(e,n,r,i){for(let s=this.findIndex(n,-1e9,!0),a=this.findIndex(r,1e9,!1,s);s<a;s++)if(i(this.from[s]+e,this.to[s]+e,this.value[s])===!1)return!1}map(e,n){let r=[],i=[],s=[],a=-1,u=-1;for(let f=0;f<this.value.length;f++){let d=this.value[f],g=this.from[f]+e,p=this.to[f]+e,m,v;if(g==p){let b=n.mapPos(g,d.startSide,d.mapMode);if(b==null||(m=v=b,d.startSide!=d.endSide&&(v=n.mapPos(g,d.endSide),v<m)))continue}else if(m=n.mapPos(g,d.startSide),v=n.mapPos(p,d.endSide),m>v||m==v&&d.startSide>0&&d.endSide<=0)continue;(v-m||d.endSide-d.startSide)<0||(a<0&&(a=m),d.point&&(u=Math.max(u,v-m)),r.push(d),i.push(m-a),s.push(v-a))}return{mapped:r.length?new c1(i,s,r,u):null,pos:a}}}class cn{constructor(e,n,r,i){this.chunkPos=e,this.chunk=n,this.nextLayer=r,this.maxPoint=i}static create(e,n,r,i){return new cn(e,n,r,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let n of this.chunk)e+=n.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:n=[],sort:r=!1,filterFrom:i=0,filterTo:s=this.length}=e,a=e.filter;if(n.length==0&&!a)return this;if(r&&(n=n.slice().sort(eS)),this.isEmpty)return n.length?cn.of(n):this;let u=new PN(this,null,-1).goto(0),f=0,d=[],g=new qp;for(;u.value||f<n.length;)if(f<n.length&&(u.from-n[f].from||u.startSide-n[f].value.startSide)>=0){let p=n[f++];g.addInner(p.from,p.to,p.value)||d.push(p)}else u.rangeIndex==1&&u.chunkIndex<this.chunk.length&&(f==n.length||this.chunkEnd(u.chunkIndex)<n[f].from)&&(!a||i>this.chunkEnd(u.chunkIndex)||s<this.chunkPos[u.chunkIndex])&&g.addChunk(this.chunkPos[u.chunkIndex],this.chunk[u.chunkIndex])?u.nextChunk():((!a||i>u.to||s<u.from||a(u.from,u.to,u.value))&&(g.addInner(u.from,u.to,u.value)||d.push(Jx.create(u.from,u.to,u.value))),u.next());return g.finishInner(this.nextLayer.isEmpty&&!d.length?cn.empty:this.nextLayer.update({add:d,filter:a,filterFrom:i,filterTo:s}))}map(e){if(e.empty||this.isEmpty)return this;let n=[],r=[],i=-1;for(let a=0;a<this.chunk.length;a++){let u=this.chunkPos[a],f=this.chunk[a],d=e.touchesRange(u,u+f.length);if(d===!1)i=Math.max(i,f.maxPoint),n.push(f),r.push(e.mapPos(u));else if(d===!0){let{mapped:g,pos:p}=f.map(u,e);g&&(i=Math.max(i,g.maxPoint),n.push(g),r.push(p))}}let s=this.nextLayer.map(e);return n.length==0?s:new cn(r,n,s||cn.empty,i)}between(e,n,r){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let s=this.chunkPos[i],a=this.chunk[i];if(n>=s&&e<=s+a.length&&a.between(s,e-s,n-s,r)===!1)return}this.nextLayer.between(e,n,r)}}iter(e=0){return Md.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return Md.from(e).goto(n)}static compare(e,n,r,i,s=-1){let a=e.filter(p=>p.maxPoint>0||!p.isEmpty&&p.maxPoint>=s),u=n.filter(p=>p.maxPoint>0||!p.isEmpty&&p.maxPoint>=s),f=RO(a,u,r),d=new Nf(a,f,s),g=new Nf(u,f,s);r.iterGaps((p,m,v)=>EO(d,p,g,m,v,i)),r.empty&&r.length==0&&EO(d,0,g,0,0,i)}static eq(e,n,r=0,i){i==null&&(i=999999999);let s=e.filter(g=>!g.isEmpty&&n.indexOf(g)<0),a=n.filter(g=>!g.isEmpty&&e.indexOf(g)<0);if(s.length!=a.length)return!1;if(!s.length)return!0;let u=RO(s,a),f=new Nf(s,u,0).goto(r),d=new Nf(a,u,0).goto(r);for(;;){if(f.to!=d.to||!tS(f.active,d.active)||f.point&&(!d.point||!u1(f.point,d.point)))return!1;if(f.to>i)return!0;f.next(),d.next()}}static spans(e,n,r,i,s=-1){let a=new Nf(e,null,s).goto(n),u=n,f=a.openStart;for(;;){let d=Math.min(a.to,r);if(a.point){let g=a.activeForPoint(a.to),p=a.pointFrom<n?g.length+1:a.point.startSide<0?g.length:Math.min(g.length,f);i.point(u,d,a.point,g,p,a.pointRank),f=Math.min(a.openEnd(d),g.length)}else d>u&&(i.span(u,d,a.active,f),f=a.openEnd(d));if(a.to>r)return f+(a.point&&a.to>r?1:0);u=a.to,a.next()}}static of(e,n=!1){let r=new qp;for(let i of e instanceof Jx?[e]:n?CK(e):e)r.add(i.from,i.to,i.value);return r.finish()}static join(e){if(!e.length)return cn.empty;let n=e[e.length-1];for(let r=e.length-2;r>=0;r--)for(let i=e[r];i!=cn.empty;i=i.nextLayer)n=new cn(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}}cn.empty=new cn([],[],null,-1);function CK(t){if(t.length>1)for(let e=t[0],n=1;n<t.length;n++){let r=t[n];if(eS(e,r)>0)return t.slice().sort(eS);e=r}return t}cn.empty.nextLayer=cn.empty;class qp{finishChunk(e){this.chunks.push(new c1(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,n,r){this.addInner(e,n,r)||(this.nextLayer||(this.nextLayer=new qp)).add(e,n,r)}addInner(e,n,r){let i=e-this.lastTo||r.startSide-this.last.endSide;if(i<=0&&(e-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(n-this.chunkStart),this.last=r,this.lastFrom=e,this.lastTo=n,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,n-e)),!0)}addChunk(e,n){if((e-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(e);let r=n.value.length-1;return this.last=n.value[r],this.lastFrom=n.from[r]+e,this.lastTo=n.to[r]+e,!0}finish(){return this.finishInner(cn.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=cn.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}}function RO(t,e,n){let r=new Map;for(let s of t)for(let a=0;a<s.chunk.length;a++)s.chunk[a].maxPoint<=0&&r.set(s.chunk[a],s.chunkPos[a]);let i=new Set;for(let s of e)for(let a=0;a<s.chunk.length;a++){let u=r.get(s.chunk[a]);u!=null&&(n?n.mapPos(u):u)==s.chunkPos[a]&&!n?.touchesRange(u,u+s.chunk[a].length)&&i.add(s.chunk[a])}return i}class PN{constructor(e,n,r,i=0){this.layer=e,this.skip=n,this.minPoint=r,this.rank=i}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,n=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,n,!1),this}gotoInner(e,n,r){for(;this.chunkIndex<this.layer.chunk.length;){let i=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(i)||this.layer.chunkEnd(this.chunkIndex)<e||i.maxPoint<this.minPoint))break;this.chunkIndex++,r=!1}if(this.chunkIndex<this.layer.chunk.length){let i=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],n,!0);(!r||this.rangeIndex<i)&&this.setRangeIndex(i)}this.next()}forward(e,n){(this.to-e||this.endSide-n)<0&&this.gotoInner(e,n,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],n=this.layer.chunk[this.chunkIndex],r=e+n.from[this.rangeIndex];if(this.from=r,this.to=e+n.to[this.rangeIndex],this.value=n.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class Md{constructor(e){this.heap=e}static from(e,n=null,r=-1){let i=[];for(let s=0;s<e.length;s++)for(let a=e[s];!a.isEmpty;a=a.nextLayer)a.maxPoint>=r&&i.push(new PN(a,n,r,s));return i.length==1?i[0]:new Md(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,n=-1e9){for(let r of this.heap)r.goto(e,n);for(let r=this.heap.length>>1;r>=0;r--)db(this.heap,r);return this.next(),this}forward(e,n){for(let r of this.heap)r.forward(e,n);for(let r=this.heap.length>>1;r>=0;r--)db(this.heap,r);(this.to-e||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),db(this.heap,0)}}}function db(t,e){for(let n=t[e];;){let r=(e<<1)+1;if(r>=t.length)break;let i=t[r];if(r+1<t.length&&i.compare(t[r+1])>=0&&(i=t[r+1],r++),n.compare(i)<0)break;t[r]=n,t[e]=i,e=r}}class Nf{constructor(e,n,r){this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Md.from(e,n,r)}goto(e,n=-1e9){return this.cursor.goto(e,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=n,this.openStart=-1,this.next(),this}forward(e,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(e,n)}removeActive(e){Fg(this.active,e),Fg(this.activeTo,e),Fg(this.activeRank,e),this.minActive=TO(this.active,this.activeTo)}addActive(e){let n=0,{value:r,to:i,rank:s}=this.cursor;for(;n<this.activeRank.length&&(s-this.activeRank[n]||i-this.activeTo[n])>0;)n++;Ug(this.active,n,r),Ug(this.activeTo,n,i),Ug(this.activeRank,n,s),e&&Ug(e,n,this.cursor.from),this.minActive=TO(this.active,this.activeTo)}next(){let e=this.to,n=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),r&&Fg(r,i)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(r),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=s,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=s.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(r){this.openStart=0;for(let i=r.length-1;i>=0&&r[i]<e;i--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let n=[];for(let r=this.active.length-1;r>=0&&!(this.activeRank[r]<this.pointRank);r--)(this.activeTo[r]>e||this.activeTo[r]==e&&this.active[r].endSide>=this.point.endSide)&&n.push(this.active[r]);return n.reverse()}openEnd(e){let n=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>e;r--)n++;return n}}function EO(t,e,n,r,i,s){t.goto(e),n.goto(r);let a=r+i,u=r,f=r-e,d=!!s.boundChange;for(let g=!1;;){let p=t.to+f-n.to,m=p||t.endSide-n.endSide,v=m<0?t.to+f:n.to,b=Math.min(v,a);if(t.point||n.point?(t.point&&n.point&&u1(t.point,n.point)&&tS(t.activeForPoint(t.to),n.activeForPoint(n.to))||s.comparePoint(u,b,t.point,n.point),g=!1):(g&&s.boundChange(u),b>u&&!tS(t.active,n.active)&&s.compareRange(u,b,t.active,n.active),d&&b<a&&(p||t.openEnd(v)!=n.openEnd(v))&&(g=!0)),v>a)break;u=v,m<=0&&t.next(),m>=0&&n.next()}}function tS(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n]&&!u1(t[n],e[n]))return!1;return!0}function Fg(t,e){for(let n=e,r=t.length-1;n<r;n++)t[n]=t[n+1];t.pop()}function Ug(t,e,n){for(let r=t.length-1;r>=e;r--)t[r+1]=t[r];t[e]=n}function TO(t,e){let n=-1,r=1e9;for(let i=0;i<e.length;i++)(e[i]-r||t[i].endSide-t[n].endSide)<0&&(n=i,r=e[i]);return n}function Ym(t,e,n=t.length){let r=0;for(let i=0;i<n&&i<t.length;)t.charCodeAt(i)==9?(r+=e-r%e,i++):(r++,i=Yr(t,i));return r}function RK(t,e,n,r){for(let i=0,s=0;;){if(s>=e)return i;if(i==t.length)break;s+=t.charCodeAt(i)==9?n-s%n:1,i=Yr(t,i)}return t.length}const nS="ͼ",AO=typeof Symbol>"u"?"__"+nS:Symbol.for(nS),rS=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),MO=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Rc{constructor(e,n){this.rules=[];let{finish:r}=n||{};function i(a){return/^@/.test(a)?[a]:a.split(/,\s*/)}function s(a,u,f,d){let g=[],p=/^@(\w+)\b/.exec(a[0]),m=p&&p[1]=="keyframes";if(p&&u==null)return f.push(a[0]+";");for(let v in u){let b=u[v];if(/&/.test(v))s(v.split(/,\s*/).map(S=>a.map(w=>S.replace(/&/,w))).reduce((S,w)=>S.concat(w)),b,f);else if(b&&typeof b=="object"){if(!p)throw new RangeError("The value of a property ("+v+") should be a primitive value.");s(i(v),b,g,m)}else b!=null&&g.push(v.replace(/_.*/,"").replace(/[A-Z]/g,S=>"-"+S.toLowerCase())+": "+b+";")}(g.length||m)&&f.push((r&&!p&&!d?a.map(r):a).join(", ")+" {"+g.join(" ")+"}")}for(let a in e)s(i(a),e[a],this.rules)}getRules(){return this.rules.join(`
26
- `)}static newName(){let e=MO[AO]||1;return MO[AO]=e+1,nS+e.toString(36)}static mount(e,n,r){let i=e[rS],s=r&&r.nonce;i?s&&i.setNonce(s):i=new EK(e,s),i.mount(Array.isArray(n)?n:[n],e)}}let OO=new Map;class EK{constructor(e,n){let r=e.ownerDocument||e,i=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let s=OO.get(r);if(s)return e[rS]=s;this.sheet=new i.CSSStyleSheet,OO.set(r,this)}else this.styleTag=r.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[rS]=this}mount(e,n){let r=this.sheet,i=0,s=0;for(let a=0;a<e.length;a++){let u=e[a],f=this.modules.indexOf(u);if(f<s&&f>-1&&(this.modules.splice(f,1),s--,f=-1),f==-1){if(this.modules.splice(s++,0,u),r)for(let d=0;d<u.rules.length;d++)r.insertRule(u.rules[d],i++)}else{for(;s<f;)i+=this.modules[s++].rules.length;i+=u.rules.length,s++}}if(r)n.adoptedStyleSheets.indexOf(this.sheet)<0&&(n.adoptedStyleSheets=[this.sheet,...n.adoptedStyleSheets]);else{let a="";for(let f=0;f<this.modules.length;f++)a+=this.modules[f].getRules()+`
27
- `;this.styleTag.textContent=a;let u=n.head||n;this.styleTag.parentNode!=u&&u.insertBefore(this.styleTag,u.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var ua={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Od={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},TK=typeof navigator<"u"&&/Mac/.test(navigator.platform),AK=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var zr=0;zr<10;zr++)ua[48+zr]=ua[96+zr]=String(zr);for(var zr=1;zr<=24;zr++)ua[zr+111]="F"+zr;for(var zr=65;zr<=90;zr++)ua[zr]=String.fromCharCode(zr+32),Od[zr]=String.fromCharCode(zr);for(var hb in ua)Od.hasOwnProperty(hb)||(Od[hb]=ua[hb]);function MK(t){var e=TK&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||AK&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Od:ua)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}let ti=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},iS=typeof document<"u"?document:{documentElement:{style:{}}};const oS=/Edge\/(\d+)/.exec(ti.userAgent),zN=/MSIE \d/.test(ti.userAgent),sS=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ti.userAgent),Xm=!!(zN||sS||oS),kO=!Xm&&/gecko\/(\d+)/i.test(ti.userAgent),gb=!Xm&&/Chrome\/(\d+)/.exec(ti.userAgent),OK="webkitFontSmoothing"in iS.documentElement.style,lS=!Xm&&/Apple Computer/.test(ti.vendor),IO=lS&&(/Mobile\/\w+/.test(ti.userAgent)||ti.maxTouchPoints>2);var $e={mac:IO||/Mac/.test(ti.platform),windows:/Win/.test(ti.platform),linux:/Linux|X11/.test(ti.platform),ie:Xm,ie_version:zN?iS.documentMode||6:sS?+sS[1]:oS?+oS[1]:0,gecko:kO,gecko_version:kO?+(/Firefox\/(\d+)/.exec(ti.userAgent)||[0,0])[1]:0,chrome:!!gb,chrome_version:gb?+gb[1]:0,ios:IO,android:/Android\b/.test(ti.userAgent),webkit_version:OK?+(/\bAppleWebKit\/(\d+)/.exec(ti.userAgent)||[0,0])[1]:0,safari:lS,safari_version:lS?+(/\bVersion\/(\d+(\.\d+)?)/.exec(ti.userAgent)||[0,0])[1]:0,tabSize:iS.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function f1(t,e){for(let n in t)n=="class"&&e.class?e.class+=" "+t.class:n=="style"&&e.style?e.style+=";"+t.style:e[n]=t[n];return e}const Gp=Object.create(null);function d1(t,e,n){if(t==e)return!0;t||(t=Gp),e||(e=Gp);let r=Object.keys(t),i=Object.keys(e);if(r.length-0!=i.length-0)return!1;for(let s of r)if(s!=n&&(i.indexOf(s)==-1||t[s]!==e[s]))return!1;return!0}function kK(t,e){for(let n=t.attributes.length-1;n>=0;n--){let r=t.attributes[n].name;e[r]==null&&t.removeAttribute(r)}for(let n in e){let r=e[n];n=="style"?t.style.cssText=r:t.getAttribute(n)!=r&&t.setAttribute(n,r)}}function DO(t,e,n){let r=!1;if(e)for(let i in e)n&&i in n||(r=!0,i=="style"?t.style.cssText="":t.removeAttribute(i));if(n)for(let i in n)e&&e[i]==n[i]||(r=!0,i=="style"?t.style.cssText=n[i]:t.setAttribute(i,n[i]));return r}function IK(t){let e=Object.create(null);for(let n=0;n<t.attributes.length;n++){let r=t.attributes[n];e[r.name]=r.value}return e}class Qm{eq(e){return!1}updateDOM(e,n,r){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,n,r){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var lo=(function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t})(lo||(lo={}));class Xr extends uu{constructor(e,n,r,i){super(),this.startSide=e,this.endSide=n,this.widget=r,this.spec=i}get heightRelevant(){return!1}static mark(e){return new Kd(e)}static widget(e){let n=Math.max(-1e4,Math.min(1e4,e.side||0)),r=!!e.block;return n+=r&&!e.inlineOrder?n>0?3e8:-4e8:n>0?1e8:-1e8,new cu(e,n,n,r,e.widget||null,!1)}static replace(e){let n=!!e.block,r,i;if(e.isBlockGap)r=-5e8,i=4e8;else{let{start:s,end:a}=NN(e,n);r=(s?n?-3e8:-1:5e8)-1,i=(a?n?2e8:1:-6e8)+1}return new cu(e,r,i,n,e.widget||null,!0)}static line(e){return new Yd(e)}static set(e,n=!1){return cn.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Xr.none=cn.empty;class Kd extends Xr{constructor(e){let{start:n,end:r}=NN(e);super(n?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?f1(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||Gp}eq(e){return this==e||e instanceof Kd&&this.tagName==e.tagName&&d1(this.attrs,e.attrs)}range(e,n=e){if(e>=n)throw new RangeError("Mark decorations may not be empty");return super.range(e,n)}}Kd.prototype.point=!1;class Yd extends Xr{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Yd&&this.spec.class==e.spec.class&&d1(this.spec.attributes,e.spec.attributes)}range(e,n=e){if(n!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,n)}}Yd.prototype.mapMode=Di.TrackBefore;Yd.prototype.point=!0;class cu extends Xr{constructor(e,n,r,i,s,a){super(n,r,s,e),this.block=i,this.isReplace=a,this.mapMode=i?n<=0?Di.TrackBefore:Di.TrackAfter:Di.TrackDel}get type(){return this.startSide!=this.endSide?lo.WidgetRange:this.startSide<=0?lo.WidgetBefore:lo.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof cu&&DK(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,n=e){if(this.isReplace&&(e>n||e==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,n)}}cu.prototype.point=!0;function NN(t,e=!1){let{inclusiveStart:n,inclusiveEnd:r}=t;return n==null&&(n=t.inclusive),r==null&&(r=t.inclusive),{start:n??e,end:r??e}}function DK(t,e){return t==e||!!(t&&e&&t.compare(e))}function dc(t,e,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=t?n[i]=Math.max(n[i],e):n.push(t,e)}class kd extends uu{constructor(e,n){super(),this.tagName=e,this.attributes=n}eq(e){return e==this||e instanceof kd&&this.tagName==e.tagName&&d1(this.attributes,e.attributes)}static create(e){return new kd(e.tagName,e.attributes||Gp)}static set(e,n=!1){return cn.of(e,n)}}kd.prototype.startSide=kd.prototype.endSide=-1;function Id(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function aS(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function rd(t,e){if(!e.anchorNode)return!1;try{return aS(t,e.anchorNode)}catch{return!1}}function vp(t){return t.nodeType==3?Dd(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function id(t,e,n,r){return n?PO(t,e,n,r,-1)||PO(t,e,n,r,1):!1}function ca(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function Wp(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function PO(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:nl(t))){if(t.nodeName=="DIV")return!1;let s=t.parentNode;if(!s||s.nodeType!=1)return!1;e=ca(t)+(i<0?0:1),t=s}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=i<0?nl(t):0}else return!1}}function nl(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Kp(t,e){let n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function PK(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function LN(t,e){let n=e.width/t.offsetWidth,r=e.height/t.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.width-t.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.height-t.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function zK(t,e,n,r,i,s,a,u){let f=t.ownerDocument,d=f.defaultView||window;for(let g=t,p=!1;g&&!p;)if(g.nodeType==1){let m,v=g==f.body,b=1,S=1;if(v)m=PK(d);else{if(/^(fixed|sticky)$/.test(getComputedStyle(g).position)&&(p=!0),g.scrollHeight<=g.clientHeight&&g.scrollWidth<=g.clientWidth){g=g.assignedSlot||g.parentNode;continue}let R=g.getBoundingClientRect();({scaleX:b,scaleY:S}=LN(g,R)),m={left:R.left,right:R.left+g.clientWidth*b,top:R.top,bottom:R.top+g.clientHeight*S}}let w=0,C=0;if(i=="nearest")e.top<m.top?(C=e.top-(m.top+a),n>0&&e.bottom>m.bottom+C&&(C=e.bottom-m.bottom+a)):e.bottom>m.bottom&&(C=e.bottom-m.bottom+a,n<0&&e.top-C<m.top&&(C=e.top-(m.top+a)));else{let R=e.bottom-e.top,T=m.bottom-m.top;C=(i=="center"&&R<=T?e.top+R/2-T/2:i=="start"||i=="center"&&n<0?e.top-a:e.bottom-T+a)-m.top}if(r=="nearest"?e.left<m.left?(w=e.left-(m.left+s),n>0&&e.right>m.right+w&&(w=e.right-m.right+s)):e.right>m.right&&(w=e.right-m.right+s,n<0&&e.left<m.left+w&&(w=e.left-(m.left+s))):w=(r=="center"?e.left+(e.right-e.left)/2-(m.right-m.left)/2:r=="start"==u?e.left-s:e.right-(m.right-m.left)+s)-m.left,w||C)if(v)d.scrollBy(w,C);else{let R=0,T=0;if(C){let A=g.scrollTop;g.scrollTop+=C/S,T=(g.scrollTop-A)*S}if(w){let A=g.scrollLeft;g.scrollLeft+=w/b,R=(g.scrollLeft-A)*b}e={left:e.left-R,top:e.top-T,right:e.right-R,bottom:e.bottom-T},R&&Math.abs(R-w)<1&&(r="nearest"),T&&Math.abs(T-C)<1&&(i="nearest")}if(v)break;(e.top<m.top||e.bottom>m.bottom||e.left<m.left||e.right>m.right)&&(e={left:Math.max(e.left,m.left),right:Math.min(e.right,m.right),top:Math.max(e.top,m.top),bottom:Math.min(e.bottom,m.bottom)}),g=g.assignedSlot||g.parentNode}else if(g.nodeType==11)g=g.host;else break}function BN(t,e=!0){let n=t.ownerDocument,r=null,i=null;for(let s=t.parentNode;s&&!(s==n.body||(!e||r)&&i);)if(s.nodeType==1)!i&&s.scrollHeight>s.clientHeight&&(i=s),e&&!r&&s.scrollWidth>s.clientWidth&&(r=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:r,y:i}}class NK{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:n,focusNode:r}=e;this.set(n,Math.min(e.anchorOffset,n?nl(n):0),r,Math.min(e.focusOffset,r?nl(r):0))}set(e,n,r,i){this.anchorNode=e,this.anchorOffset=n,this.focusNode=r,this.focusOffset=i}}let qa=null;$e.safari&&$e.safari_version>=26&&(qa=!1);function _N(t){if(t.setActive)return t.setActive();if(qa)return t.focus(qa);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(qa==null?{get preventScroll(){return qa={preventScroll:!0},!0}}:void 0),!qa){qa=!1;for(let n=0;n<e.length;){let r=e[n++],i=e[n++],s=e[n++];r.scrollTop!=i&&(r.scrollTop=i),r.scrollLeft!=s&&(r.scrollLeft=s)}}}let zO;function Dd(t,e,n=e){let r=zO||(zO=document.createRange());return r.setEnd(t,n),r.setStart(t,e),r}function hc(t,e,n,r){let i={key:e,code:e,keyCode:n,which:n,cancelable:!0};r&&({altKey:i.altKey,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,metaKey:i.metaKey}=r);let s=new KeyboardEvent("keydown",i);s.synthetic=!0,t.dispatchEvent(s);let a=new KeyboardEvent("keyup",i);return a.synthetic=!0,t.dispatchEvent(a),s.defaultPrevented||a.defaultPrevented}function LK(t){for(;t;){if(t&&(t.nodeType==9||t.nodeType==11&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}function BK(t,e){let n=e.focusNode,r=e.focusOffset;if(!n||e.anchorNode!=n||e.anchorOffset!=r)return!1;for(r=Math.min(r,nl(n));;)if(r){if(n.nodeType!=1)return!1;let i=n.childNodes[r-1];i.contentEditable=="false"?r--:(n=i,r=nl(n))}else{if(n==t)return!0;r=ca(n),n=n.parentNode}}function HN(t){return t instanceof Window?t.pageYOffset>Math.max(0,t.document.documentElement.scrollHeight-t.innerHeight-4):t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4)}function jN(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&r>0)return{node:n,offset:r};if(n.nodeType==1&&r>0){if(n.contentEditable=="false")return null;n=n.childNodes[r-1],r=nl(n)}else if(n.parentNode&&!Wp(n))r=ca(n),n=n.parentNode;else return null}}function VN(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&r<n.nodeValue.length)return{node:n,offset:r};if(n.nodeType==1&&r<n.childNodes.length){if(n.contentEditable=="false")return null;n=n.childNodes[r],r=0}else if(n.parentNode&&!Wp(n))r=ca(n)+1,n=n.parentNode;else return null}}class Oo{constructor(e,n,r=!0){this.node=e,this.offset=n,this.precise=r}static before(e,n){return new Oo(e.parentNode,ca(e),n)}static after(e,n){return new Oo(e.parentNode,ca(e)+1,n)}}var hr=(function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t})(hr||(hr={}));const fu=hr.LTR,h1=hr.RTL;function FN(t){let e=[];for(let n=0;n<t.length;n++)e.push(1<<+t[n]);return e}const _K=FN("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),HK=FN("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),uS=Object.create(null),Xo=[];for(let t of["()","[]","{}"]){let e=t.charCodeAt(0),n=t.charCodeAt(1);uS[e]=n,uS[n]=-e}function UN(t){return t<=247?_K[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?HK[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1}const jK=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class ds{get dir(){return this.level%2?h1:fu}constructor(e,n,r){this.from=e,this.to=n,this.level=r}side(e,n){return this.dir==n==e?this.to:this.from}forward(e,n){return e==(this.dir==n)}static find(e,n,r,i){let s=-1;for(let a=0;a<e.length;a++){let u=e[a];if(u.from<=n&&u.to>=n){if(u.level==r)return a;(s<0||(i!=0?i<0?u.from<n:u.to>n:e[s].level>u.level))&&(s=a)}}if(s<0)throw new RangeError("Index out of range");return s}}function $N(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++){let r=t[n],i=e[n];if(r.from!=i.from||r.to!=i.to||r.direction!=i.direction||!$N(r.inner,i.inner))return!1}return!0}const Cn=[];function VK(t,e,n,r,i){for(let s=0;s<=r.length;s++){let a=s?r[s-1].to:e,u=s<r.length?r[s].from:n,f=s?256:i;for(let d=a,g=f,p=f;d<u;d++){let m=UN(t.charCodeAt(d));m==512?m=g:m==8&&p==4&&(m=16),Cn[d]=m==4?2:m,m&7&&(p=m),g=m}for(let d=a,g=f,p=f;d<u;d++){let m=Cn[d];if(m==128)d<u-1&&g==Cn[d+1]&&g&24?m=Cn[d]=g:Cn[d]=256;else if(m==64){let v=d+1;for(;v<u&&Cn[v]==64;)v++;let b=d&&g==8||v<n&&Cn[v]==8?p==1?1:8:256;for(let S=d;S<v;S++)Cn[S]=b;d=v-1}else m==8&&p==1&&(Cn[d]=1);g=m,m&7&&(p=m)}}}function FK(t,e,n,r,i){let s=i==1?2:1;for(let a=0,u=0,f=0;a<=r.length;a++){let d=a?r[a-1].to:e,g=a<r.length?r[a].from:n;for(let p=d,m,v,b;p<g;p++)if(v=uS[m=t.charCodeAt(p)])if(v<0){for(let S=u-3;S>=0;S-=3)if(Xo[S+1]==-v){let w=Xo[S+2],C=w&2?i:w&4?w&1?s:i:0;C&&(Cn[p]=Cn[Xo[S]]=C),u=S;break}}else{if(Xo.length==189)break;Xo[u++]=p,Xo[u++]=m,Xo[u++]=f}else if((b=Cn[p])==2||b==1){let S=b==i;f=S?0:1;for(let w=u-3;w>=0;w-=3){let C=Xo[w+2];if(C&2)break;if(S)Xo[w+2]|=2;else{if(C&4)break;Xo[w+2]|=4}}}}}function UK(t,e,n,r){for(let i=0,s=r;i<=n.length;i++){let a=i?n[i-1].to:t,u=i<n.length?n[i].from:e;for(let f=a;f<u;){let d=Cn[f];if(d==256){let g=f+1;for(;;)if(g==u){if(i==n.length)break;g=n[i++].to,u=i<n.length?n[i].from:e}else if(Cn[g]==256)g++;else break;let p=s==1,m=(g<e?Cn[g]:r)==1,v=p==m?p?1:2:r;for(let b=g,S=i,w=S?n[S-1].to:t;b>f;)b==w&&(b=n[--S].from,w=S?n[S-1].to:t),Cn[--b]=v;f=g}else s=d,f++}}}function cS(t,e,n,r,i,s,a){let u=r%2?2:1;if(r%2==i%2)for(let f=e,d=0;f<n;){let g=!0,p=!1;if(d==s.length||f<s[d].from){let S=Cn[f];S!=u&&(g=!1,p=S==16)}let m=!g&&u==1?[]:null,v=g?r:r+1,b=f;e:for(;;)if(d<s.length&&b==s[d].from){if(p)break e;let S=s[d];if(!g)for(let w=S.to,C=d+1;;){if(w==n)break e;if(C<s.length&&s[C].from==w)w=s[C++].to;else{if(Cn[w]==u)break e;break}}if(d++,m)m.push(S);else{S.from>f&&a.push(new ds(f,S.from,v));let w=S.direction==fu!=!(v%2);fS(t,w?r+1:r,i,S.inner,S.from,S.to,a),f=S.to}b=S.to}else{if(b==n||(g?Cn[b]!=u:Cn[b]==u))break;b++}m?cS(t,f,b,r+1,i,m,a):f<b&&a.push(new ds(f,b,v)),f=b}else for(let f=n,d=s.length;f>e;){let g=!0,p=!1;if(!d||f>s[d-1].to){let S=Cn[f-1];S!=u&&(g=!1,p=S==16)}let m=!g&&u==1?[]:null,v=g?r:r+1,b=f;e:for(;;)if(d&&b==s[d-1].to){if(p)break e;let S=s[--d];if(!g)for(let w=S.from,C=d;;){if(w==e)break e;if(C&&s[C-1].to==w)w=s[--C].from;else{if(Cn[w-1]==u)break e;break}}if(m)m.push(S);else{S.to<f&&a.push(new ds(S.to,f,v));let w=S.direction==fu!=!(v%2);fS(t,w?r+1:r,i,S.inner,S.from,S.to,a),f=S.from}b=S.from}else{if(b==e||(g?Cn[b-1]!=u:Cn[b-1]==u))break;b--}m?cS(t,b,f,r+1,i,m,a):b<f&&a.push(new ds(b,f,v)),f=b}}function fS(t,e,n,r,i,s,a){let u=e%2?2:1;VK(t,i,s,r,u),FK(t,i,s,r,u),UK(i,s,r,u),cS(t,i,s,e,n,r,a)}function $K(t,e,n){if(!t)return[new ds(0,0,e==h1?1:0)];if(e==fu&&!n.length&&!jK.test(t))return qN(t.length);if(n.length)for(;t.length>Cn.length;)Cn[Cn.length]=256;let r=[],i=e==fu?0:1;return fS(t,i,i,n,0,t.length,r),r}function qN(t){return[new ds(0,t,0)]}let GN="";function qK(t,e,n,r,i){var s;let a=r.head-t.from,u=ds.find(e,a,(s=r.bidiLevel)!==null&&s!==void 0?s:-1,r.assoc),f=e[u],d=f.side(i,n);if(a==d){let m=u+=i?1:-1;if(m<0||m>=e.length)return null;f=e[u=m],a=f.side(!i,n),d=f.side(i,n)}let g=Yr(t.text,a,f.forward(i,n));(g<f.from||g>f.to)&&(g=d),GN=t.text.slice(Math.min(a,g),Math.max(a,g));let p=u==(i?e.length-1:0)?null:e[u+(i?1:-1)];return p&&g==d&&p.level+(i?0:1)<f.level?Ae.cursor(p.side(!i,n)+t.from,p.forward(i,n)?1:-1,p.level):Ae.cursor(g+t.from,f.forward(i,n)?-1:1,f.level)}function GK(t,e,n){for(let r=e;r<n;r++){let i=UN(t.charCodeAt(r));if(i==1)return fu;if(i==2||i==4)return h1}return fu}const WN=mt.define(),KN=mt.define(),YN=mt.define(),XN=mt.define(),dS=mt.define(),QN=mt.define(),ZN=mt.define(),g1=mt.define(),p1=mt.define(),JN=mt.define({combine:t=>t.some(e=>e)}),WK=mt.define({combine:t=>t.some(e=>e)}),eL=mt.define();class gc{constructor(e,n="nearest",r="nearest",i=5,s=5,a=!1){this.range=e,this.y=n,this.x=r,this.yMargin=i,this.xMargin=s,this.isSnapshot=a}map(e){return e.empty?this:new gc(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new gc(Ae.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const $g=ir.define({map:(t,e)=>t.map(e)}),tL=ir.define();function hs(t,e,n){let r=t.facet(XN);r.length?r[0](e):window.onerror&&window.onerror(String(e),n,void 0,void 0,e)||(n?console.error(n+":",e):console.error(e))}const Ws=mt.define({combine:t=>t.length?t[0]:!0});let KK=0;const rc=mt.define({combine(t){return t.filter((e,n)=>{for(let r=0;r<n;r++)if(t[r].plugin==e.plugin)return!1;return!0})}});class Ec{constructor(e,n,r,i,s){this.id=e,this.create=n,this.domEventHandlers=r,this.domEventObservers=i,this.baseExtensions=s(this),this.extension=this.baseExtensions.concat(rc.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(rc.of({plugin:this,arg:e}))}static define(e,n){const{eventHandlers:r,eventObservers:i,provide:s,decorations:a}=n||{};return new Ec(KK++,e,r,i,u=>{let f=[];return a&&f.push(Zm.of(d=>{let g=d.plugin(u);return g?a(g):Xr.none})),s&&f.push(s(u)),f})}static fromClass(e,n){return Ec.define((r,i)=>new e(r,i),n)}}class pb{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(r){if(hs(n.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(n){hs(e.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(r){hs(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const nL=mt.define(),m1=mt.define(),Zm=mt.define(),rL=mt.define(),y1=mt.define(),Xd=mt.define(),iL=mt.define();function NO(t,e){let n=t.state.facet(iL);if(!n.length)return n;let r=n.map(s=>s instanceof Function?s(t):s),i=[];return cn.spans(r,e.from,e.to,{point(){},span(s,a,u,f){let d=s-e.from,g=a-e.from,p=i;for(let m=u.length-1;m>=0;m--,f--){let v=u[m].spec.bidiIsolate,b;if(v==null&&(v=GK(e.text,d,g)),f>0&&p.length&&(b=p[p.length-1]).to==d&&b.direction==v)b.to=g,p=b.inner;else{let S={from:d,to:g,direction:v,inner:[]};p.push(S),p=S.inner}}}}),i}const oL=mt.define();function sL(t){let e=0,n=0,r=0,i=0;for(let s of t.state.facet(oL)){let a=s(t);a&&(a.left!=null&&(e=Math.max(e,a.left)),a.right!=null&&(n=Math.max(n,a.right)),a.top!=null&&(r=Math.max(r,a.top)),a.bottom!=null&&(i=Math.max(i,a.bottom)))}return{left:e,right:n,top:r,bottom:i}}const Uf=mt.define();class ro{constructor(e,n,r,i){this.fromA=e,this.toA=n,this.fromB=r,this.toB=i}join(e){return new ro(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let n=e.length,r=this;for(;n>0;n--){let i=e[n-1];if(!(i.fromA>r.toA)){if(i.toA<r.fromA)break;r=r.join(i),e.splice(n-1,1)}}return e.splice(n,0,r),e}static extendWithRanges(e,n){if(n.length==0)return e;let r=[];for(let i=0,s=0,a=0;;){let u=i<e.length?e[i].fromB:1e9,f=s<n.length?n[s]:1e9,d=Math.min(u,f);if(d==1e9)break;let g=d+a,p=d,m=g;for(;;)if(s<n.length&&n[s]<=p){let v=n[s+1];s+=2,p=Math.max(p,v);for(let b=i;b<e.length&&e[b].fromB<=p;b++)a=e[b].toA-e[b].toB;m=Math.max(m,v+a)}else if(i<e.length&&e[i].fromB<=p){let v=e[i++];p=Math.max(p,v.toB),m=Math.max(m,v.toA),a=v.toA-v.toB}else break;r.push(new ro(g,m,d,p))}return r}}class Yp{constructor(e,n,r){this.view=e,this.state=n,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=vr.empty(this.startState.doc.length);for(let s of r)this.changes=this.changes.compose(s.changes);let i=[];this.changes.iterChangedRanges((s,a,u,f)=>i.push(new ro(s,a,u,f))),this.changedRanges=i}static create(e,n,r){return new Yp(e,n,r)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const YK=[];class Xn{constructor(e,n,r=0){this.dom=e,this.length=n,this.flags=r,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return YK}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let n=this.domAttrs;n&&kK(this.dom,n)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,n=this.posAtStart){let r=n;for(let i of this.children){if(i==e)return r;r+=i.length+i.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,n){return null}domPosFor(e,n){let r=ca(this.dom),i=this.length?e>0:n>0;return new Oo(this.parent.dom,r+(i?1:0),e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof ey)return e;return null}static get(e){return e.cmTile}}class Jm extends Xn{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let n=this.dom,r=null,i,s=e?.node==n?e:null,a=0;for(let u of this.children){if(u.sync(e),a+=u.length+u.breakAfter,i=r?r.nextSibling:n.firstChild,s&&i!=u.dom&&(s.written=!0),u.dom.parentNode==n)for(;i&&i!=u.dom;)i=LO(i);else n.insertBefore(u.dom,i);r=u.dom}for(i=r?r.nextSibling:n.firstChild,s&&i&&(s.written=!0);i;)i=LO(i);this.length=a}}function LO(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class ey extends Jm{constructor(e,n){super(n),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let n=Xn.get(e);if(n&&this.owns(n))return n;e=e.parentNode}}blockTiles(e){for(let n=[],r=this,i=0,s=0;;)if(i==r.children.length){if(!n.length)return;r=r.parent,r.breakAfter&&s++,i=n.pop()}else{let a=r.children[i++];if(a instanceof Js)n.push(i),r=a,i=0;else{let u=s+a.length,f=e(a,s);if(f!==void 0)return f;s=u+a.breakAfter}}}resolveBlock(e,n){let r,i=-1,s,a=-1;if(this.blockTiles((u,f)=>{let d=f+u.length;if(e>=f&&e<=d){if(u.isWidget()&&n>=-1&&n<=1){if(u.flags&32)return!0;u.flags&16&&(r=void 0)}(f<e||e==d&&(n<-1?u.length:u.covers(1)))&&(!r||!u.isWidget()&&r.isWidget())&&(r=u,i=e-f),(d>e||e==f&&(n>1?u.length:u.covers(-1)))&&(!s||!u.isWidget()&&s.isWidget())&&(s=u,a=e-f)}}),!r&&!s)throw new Error("No tile at position "+e);return r&&n<0||!s?{tile:r,offset:i}:{tile:s,offset:a}}}class Js extends Jm{constructor(e,n){super(e),this.wrapper=n}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(e,n){let r=new Js(n||document.createElement(e.tagName),e);return n||(r.flags|=4),r}}class Tc extends Jm{constructor(e,n){super(e),this.attrs=n}isLine(){return!0}static start(e,n,r){let i=new Tc(n||document.createElement("div"),e);return(!n||!r)&&(i.flags|=4),i}get domAttrs(){return this.attrs}resolveInline(e,n,r){let i=null,s=-1,a=null,u=-1;function f(g,p){for(let m=0,v=0;m<g.children.length&&v<=p;m++){let b=g.children[m],S=v+b.length;S>=p&&(b.isComposite()?f(b,p-v):(!a||a.isHidden&&(n>0||r&&QK(a,b)))&&(S>p||b.flags&32)?(a=b,u=p-v):(v<p||b.flags&16&&!b.isHidden)&&(i=b,s=p-v)),v=S}}f(this,e);let d=(n<0?i:a)||i||a;return d?{tile:d,offset:d==i?s:u}:null}coordsIn(e,n){let r=this.resolveInline(e,n,!0);return r?r.tile.coordsIn(Math.max(0,r.offset),n):XK(this)}domIn(e,n){let r=this.resolveInline(e,n);if(r){let{tile:i,offset:s}=r;if(this.dom.contains(i.dom))return i.isText()?new Oo(i.dom,Math.min(i.dom.nodeValue.length,s)):i.domPosFor(s,i.flags&16?1:i.flags&32?-1:n);let a=r.tile.parent,u=!1;for(let f of a.children){if(u)return new Oo(f.dom,0);f==r.tile&&(u=!0)}}return new Oo(this.dom,0)}}function XK(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let n=vp(e);return n[n.length-1]||null}function QK(t,e){let n=t.coordsIn(0,1),r=e.coordsIn(0,1);return n&&r&&r.top<n.bottom}class yi extends Jm{constructor(e,n){super(e),this.mark=n}get domAttrs(){return this.mark.attrs}static of(e,n){let r=new yi(n||document.createElement(e.tagName),e);return n||(r.flags|=4),r}}class Za extends Xn{constructor(e,n){super(e,n.length),this.text=n}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,n){let r=this.dom.nodeValue.length;e>r&&(e=r);let i=e,s=e,a=0;e==0&&n<0||e==r&&n>=0?$e.chrome||$e.gecko||(e?(i--,a=1):s<r&&(s++,a=-1)):n<0?i--:s<r&&s++;let u=Dd(this.dom,i,s).getClientRects();if(!u.length)return null;let f=u[(a?a<0:n>=0)?0:u.length-1];return $e.safari&&!a&&f.width==0&&(f=Array.prototype.find.call(u,d=>d.width)||f),a?Kp(f,a<0):f||null}static of(e,n){let r=new Za(n||document.createTextNode(e),e);return n||(r.flags|=2),r}}class du extends Xn{constructor(e,n,r,i){super(e,n,i),this.widget=r}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,n){return this.coordsInWidget(e,n,!1)}coordsInWidget(e,n,r){let i=this.widget.coordsAt(this.dom,e,n);if(i)return i;if(r)return Kp(this.dom.getBoundingClientRect(),this.length?e==0:n<=0);{let s=this.dom.getClientRects(),a=null;if(!s.length)return null;let u=this.flags&16?!0:this.flags&32?!1:e>0;for(let f=u?s.length-1:0;a=s[f],!(e>0?f==0:f==s.length-1||a.top<a.bottom);f+=u?-1:1);return Kp(a,!u)}}get overrideDOMText(){if(!this.length)return qt.empty;let{root:e}=this;if(!e)return qt.empty;let n=this.posAtStart;return e.view.state.doc.slice(n,n+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,n,r,i,s){return s||(s=e.toDOM(n),e.editable||(s.contentEditable="false")),new du(s,r,e,i)}}class Xp extends Xn{constructor(e){let n=document.createElement("img");n.className="cm-widgetBuffer",n.setAttribute("aria-hidden","true"),super(n,0,e)}get isHidden(){return!0}get overrideDOMText(){return qt.empty}coordsIn(e){return this.dom.getBoundingClientRect()}}class ZK{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,n,r){let{tile:i,index:s,beforeBreak:a,parents:u}=this;for(;e||n>0;)if(i.isComposite())if(a){if(!e)break;r&&r.break(),e--,a=!1}else if(s==i.children.length){if(!e&&!u.length)break;r&&r.leave(i),a=!!i.breakAfter,{tile:i,index:s}=u.pop(),s++}else{let f=i.children[s],d=f.breakAfter;(n>0?f.length<=e:f.length<e)&&(!r||r.skip(f,0,f.length)!==!1||!f.isComposite)?(a=!!d,s++,e-=f.length):(u.push({tile:i,index:s}),i=f,s=0,r&&f.isComposite()&&r.enter(f))}else if(s==i.length)a=!!i.breakAfter,{tile:i,index:s}=u.pop(),s++;else if(e){let f=Math.min(e,i.length-s);r&&r.skip(i,s,s+f),e-=f,s+=f}else break;return this.tile=i,this.index=s,this.beforeBreak=a,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class JK{constructor(e,n,r,i){this.from=e,this.to=n,this.wrapper=r,this.rank=i}}class eY{constructor(e,n,r){this.cache=e,this.root=n,this.blockWrappers=r,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,n,r,i){var s;this.flushBuffer();let a=this.ensureMarks(n,r),u=a.lastChild;if(u&&u.isText()&&!(u.flags&8)&&u.length+e.length<512){this.cache.reused.set(u,2);let f=a.children[a.children.length-1]=new Za(u.dom,u.text+e);f.parent=a}else a.append(i||Za.of(e,(s=this.cache.find(Za))===null||s===void 0?void 0:s.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,n){let r=this.curLine;r.dom!=n.line.dom&&(r.setDOM(this.cache.reused.has(n.line)?mb(n.line.dom):n.line.dom),this.cache.reused.set(n.line,2));let i=r;for(let u=n.marks.length-1;u>=0;u--){let f=n.marks[u],d=i.lastChild;if(d instanceof yi&&d.mark.eq(f.mark))d.dom!=f.dom&&d.setDOM(mb(f.dom)),i=d;else{if(this.cache.reused.get(f)){let p=Xn.get(f.dom);p&&p.setDOM(mb(f.dom))}let g=yi.of(f.mark,f.dom);i.append(g),i=g}this.cache.reused.set(f,2)}let s=Xn.get(e.text);s&&this.cache.reused.set(s,2);let a=new Za(e.text,e.text.nodeValue);a.flags|=8,i.append(a)}addInlineWidget(e,n,r){let i=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);i||this.flushBuffer();let s=this.ensureMarks(n,r);!i&&!(e.flags&16)&&s.append(this.getBuffer(1)),s.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,n,r){this.flushBuffer(),this.ensureMarks(n,r).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let n=this.afterWidget||this.lastBlock;n.length+=e,this.pos+=e}addLineStart(e,n){var r;e||(e=lL);let i=Tc.start(e,n||((r=this.cache.find(Tc))===null||r===void 0?void 0:r.dom),!!n);this.getBlockPos().append(this.lastBlock=this.curLine=i)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,n){var r;let i=this.curLine;for(let s=e.length-1;s>=0;s--){let a=e[s],u;if(n>0&&(u=i.lastChild)&&u instanceof yi&&u.mark.eq(a))i=u,n--;else{let f=yi.of(a,(r=this.cache.find(yi,d=>d.mark.eq(a)))===null||r===void 0?void 0:r.dom);i.append(f),i=f,n=0}}return i}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!BO(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!($e.ios&&BO(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(yb,0,32)||new du(yb.toDOM(),0,yb,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let n=new JK(e.from,e.to,e.value,e.rank),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-n.rank||this.wrappers[r-1].to-n.to)<0;)r--;this.wrappers.splice(r,0,n)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let n=this.root;for(let r of this.wrappers){let i=n.lastChild;if(r.from<this.pos&&i instanceof Js&&i.wrapper.eq(r.wrapper))n=i;else{let s=Js.of(r.wrapper,(e=this.cache.find(Js,a=>a.wrapper.eq(r.wrapper)))===null||e===void 0?void 0:e.dom);n.append(s),n=s}}return n}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let n=2|(e<0?16:32),r=this.cache.find(Xp,void 0,1);return r&&(r.flags=n),r||new Xp(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class tY{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:i,lineBreak:s,done:a}=this.cursor.next(this.skipCount);if(this.skipCount=0,a)throw new Error("Ran out of text content when drawing inline views");this.text=i;let u=this.textOff=Math.min(e,i.length);return s?null:i.slice(0,u)}let n=Math.min(this.text.length,this.textOff+e),r=this.text.slice(this.textOff,n);return this.textOff=n,r}}const Qp=[du,Tc,Za,yi,Xp,Js,ey];for(let t=0;t<Qp.length;t++)Qp[t].bucket=t;class nY{constructor(e){this.view=e,this.buckets=Qp.map(()=>[]),this.index=Qp.map(()=>0),this.reused=new Map}add(e){let n=e.constructor.bucket,r=this.buckets[n];r.length<6?r.push(e):r[this.index[n]=(this.index[n]+1)%6]=e}find(e,n,r=2){let i=e.bucket,s=this.buckets[i],a=this.index[i];for(let u=s.length-1;u>=0;u--){let f=(u+a)%s.length,d=s[f];if((!n||n(d))&&!this.reused.has(d))return s.splice(f,1),f<a&&this.index[i]--,this.reused.set(d,r),d}return null}findWidget(e,n,r){let i=this.buckets[0];if(i.length)for(let s=0,a=0;;s++){if(s==i.length){if(a)return null;a=1,s=0}let u=i[s];if(!this.reused.has(u)&&(a==0?u.widget.compare(e):u.widget.constructor==e.constructor&&e.updateDOM(u.dom,this.view,u.widget)))return i.splice(s,1),s<this.index[0]&&this.index[0]--,u.widget==e&&u.length==n&&(u.flags&497)==r?(this.reused.set(u,1),u):(this.reused.set(u,2),new du(u.dom,n,e,u.flags&-498|r))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,n=2){if(!this.reused.has(e))return this.reused.set(e,n),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}}class rY{constructor(e,n,r,i,s){this.view=e,this.decorations=i,this.disallowBlockEffectsFor=s,this.openWidget=!1,this.openMarks=0,this.cache=new nY(e),this.text=new tY(e.state.doc),this.builder=new eY(this.cache,new ey(e,e.contentDOM),cn.iter(r)),this.cache.reused.set(n,2),this.old=new ZK(n),this.reuseWalker={skip:(a,u,f)=>{if(this.cache.add(a),a.isComposite())return!1},enter:a=>this.cache.add(a),leave:()=>{},break:()=>{}}}run(e,n){let r=n&&this.getCompositionContext(n.text);for(let i=0,s=0,a=0;;){let u=a<e.length?e[a++]:null,f=u?u.fromA:this.old.root.length;if(f>i){let d=f-i;this.preserve(d,!a,!u),i=f,s+=d}if(!u)break;n&&u.fromA<=n.range.fromA&&u.toA>=n.range.toA?(this.forward(u.fromA,n.range.fromA,n.range.fromA<n.range.toA?1:-1),this.emit(s,n.range.fromB),this.cache.clear(),this.builder.addComposition(n,r),this.text.skip(n.range.toB-n.range.fromB),this.forward(n.range.fromA,u.toA),this.emit(n.range.toB,u.toB)):(this.forward(u.fromA,u.toA),this.emit(s,u.toB)),s=u.toB,i=u.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,n,r){let i=sY(this.old),s=this.openMarks;this.old.advance(e,r?1:-1,{skip:(a,u,f)=>{if(a.isWidget())if(this.openWidget)this.builder.continueWidget(f-u);else{let d=f>0||u<a.length?du.of(a.widget,this.view,f-u,a.flags&496,this.cache.maybeReuse(a)):this.cache.reuse(a);d.flags&256?(d.flags&=-2,this.builder.addBlockWidget(d)):(this.builder.ensureLine(null),this.builder.addInlineWidget(d,i,s),s=i.length)}else if(a.isText())this.builder.ensureLine(null),!u&&f==a.length&&!this.cache.reused.has(a)?this.builder.addText(a.text,i,s,this.cache.reuse(a)):(this.cache.add(a),this.builder.addText(a.text.slice(u,f),i,s)),s=i.length;else if(a.isLine())a.flags&=-2,this.cache.reused.set(a,1),this.builder.addLine(a);else if(a instanceof Xp)this.cache.add(a);else if(a instanceof yi)this.builder.ensureLine(null),this.builder.addMark(a,i,s),this.cache.reused.set(a,1),s=i.length;else return!1;this.openWidget=!1},enter:a=>{a.isLine()?this.builder.addLineStart(a.attrs,this.cache.maybeReuse(a)):(this.cache.add(a),a instanceof yi&&i.unshift(a.mark)),this.openWidget=!1},leave:a=>{a.isLine()?i.length&&(i.length=s=0):a instanceof yi&&(i.shift(),s=Math.min(s,i.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,n){let r=null,i=this.builder,s=0,a=cn.spans(this.decorations,e,n,{point:(u,f,d,g,p,m)=>{if(d instanceof cu){if(this.disallowBlockEffectsFor[m]){if(d.block)throw new RangeError("Block decorations may not be specified via plugins");if(f>this.view.state.doc.lineAt(u).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(s=g.length,p>g.length)i.continueWidget(f-u);else{let v=d.widget||(d.block?Ac.block:Ac.inline),b=iY(d),S=this.cache.findWidget(v,f-u,b)||du.of(v,this.view,f-u,b);d.block?(d.startSide>0&&i.addLineStartIfNotCovered(r),i.addBlockWidget(S)):(i.ensureLine(r),i.addInlineWidget(S,g,p))}r=null}else r=oY(r,d);f>u&&this.text.skip(f-u)},span:(u,f,d,g)=>{for(let p=u;p<f;){let m=this.text.next(Math.min(512,f-p));m==null?(i.addLineStartIfNotCovered(r),i.addBreak(),p++):(i.ensureLine(r),i.addText(m,d,p==u?g:d.length),p+=m.length),r=null}}});i.addLineStartIfNotCovered(r),this.openWidget=a>s,this.openMarks=a}forward(e,n,r=1){n-e<=10?this.old.advance(n-e,r,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(n-e-10,-1),this.old.advance(5,r,this.reuseWalker))}getCompositionContext(e){let n=[],r=null;for(let i=e.parentNode;;i=i.parentNode){let s=Xn.get(i);if(i==this.view.contentDOM)break;s instanceof yi?n.push(s):s?.isLine()?r=s:s instanceof Js||(i.nodeName=="DIV"&&!r&&i!=this.view.contentDOM?r=new Tc(i,lL):r||n.push(yi.of(new Kd({tagName:i.nodeName.toLowerCase(),attributes:IK(i)}),i)))}return{line:r,marks:n}}}function BO(t,e){let n=r=>{for(let i of r.children)if((e?i.isText():i.length)||n(i))return!0;return!1};return n(t)}function iY(t){let e=t.isReplace?(t.startSide<0?64:0)|(t.endSide>0?128:0):t.startSide>0?32:16;return t.block&&(e|=256),e}const lL={class:"cm-line"};function oY(t,e){let n=e.spec.attributes,r=e.spec.class;return!n&&!r||(t||(t={class:"cm-line"}),n&&f1(n,t),r&&(t.class+=" "+r)),t}function sY(t){let e=[];for(let n=t.parents.length;n>1;n--){let r=n==t.parents.length?t.tile:t.parents[n].tile;r instanceof yi&&e.push(r.mark)}return e}function mb(t){let e=Xn.get(t);return e&&e.setDOM(t.cloneNode()),t}class Ac extends Qm{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}Ac.inline=new Ac("span");Ac.block=new Ac("div");const yb=new class extends Qm{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class _O{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=Xr.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new ey(e,e.contentDOM),this.updateInner([new ro(0,0,0,e.state.doc.length)],null)}update(e){var n;let r=e.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:g,toA:p})=>p<this.minWidthFrom||g>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let i=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?i=this.domChanged.newSel.head:!pY(e.changes,this.hasComposition)&&!e.selectionSet&&(i=e.state.selection.main.head));let s=i>-1?aY(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){let{from:g,to:p}=this.hasComposition;r=new ro(g,p,e.changes.mapPos(g,-1),e.changes.mapPos(p,1)).addToSet(r.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,($e.ie||$e.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let a=this.decorations,u=this.blockWrappers;this.updateDeco();let f=fY(a,this.decorations,e.changes);f.length&&(r=ro.extendWithRanges(r,f));let d=hY(u,this.blockWrappers,e.changes);return d.length&&(r=ro.extendWithRanges(r,d)),s&&!r.some(g=>g.fromA<=s.range.fromA&&g.toA>=s.range.toA)&&(r=s.range.addToSet(r.slice())),this.tile.flags&2&&r.length==0?!1:(this.updateInner(r,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,n){this.view.viewState.mustMeasureContent=!0;let{observer:r}=this.view;r.ignore(()=>{if(n||e.length){let a=this.tile,u=new rY(this.view,a,this.blockWrappers,this.decorations,this.dynamicDecorationMap);n&&Xn.get(n.text)&&u.cache.reused.set(Xn.get(n.text),2),this.tile=u.run(e,n),hS(a,u.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=$e.chrome||$e.ios?{node:r.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(s),s&&(s.written||r.selectionRange.focusNode!=s.node||!this.tile.dom.contains(s.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let i=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let s of this.tile.children)s.isWidget()&&s.widget instanceof vb&&i.push(s.dom);r.updateGaps(i)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let n of e.transactions)for(let r of n.effects)r.is(tL)&&(this.editContextFormatting=r.value)}updateSelection(e=!1,n=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:r}=this.tile,i=this.view.root.activeElement,s=i==r,a=!s&&!(this.view.state.facet(Ws)||r.tabIndex>-1)&&rd(r,this.view.observer.selectionRange)&&!(i&&r.contains(i));if(!(s||n||a))return;let u=this.forceSelection;this.forceSelection=!1;let f=this.view.state.selection.main,d,g;if(f.empty?g=d=this.inlineDOMNearPos(f.anchor,f.assoc||1):(g=this.inlineDOMNearPos(f.head,f.head==f.from?1:-1),d=this.inlineDOMNearPos(f.anchor,f.anchor==f.from?1:-1)),$e.gecko&&f.empty&&!this.hasComposition&&lY(d)){let m=document.createTextNode("");this.view.observer.ignore(()=>d.node.insertBefore(m,d.node.childNodes[d.offset]||null)),d=g=new Oo(m,0),u=!0}let p=this.view.observer.selectionRange;(u||!p.focusNode||(!id(d.node,d.offset,p.anchorNode,p.anchorOffset)||!id(g.node,g.offset,p.focusNode,p.focusOffset))&&!this.suppressWidgetCursorChange(p,f))&&(this.view.observer.ignore(()=>{$e.android&&$e.chrome&&r.contains(p.focusNode)&&gY(p.focusNode,r)&&(r.blur(),r.focus({preventScroll:!0}));let m=Id(this.view.root);if(m)if(f.empty){if($e.gecko){let v=uY(d.node,d.offset);if(v&&v!=3){let b=(v==1?jN:VN)(d.node,d.offset);b&&(d=new Oo(b.node,b.offset))}}m.collapse(d.node,d.offset),f.bidiLevel!=null&&m.caretBidiLevel!==void 0&&(m.caretBidiLevel=f.bidiLevel)}else if(m.extend){m.collapse(d.node,d.offset);try{m.extend(g.node,g.offset)}catch{}}else{let v=document.createRange();f.anchor>f.head&&([d,g]=[g,d]),v.setEnd(g.node,g.offset),v.setStart(d.node,d.offset),m.removeAllRanges(),m.addRange(v)}a&&this.view.root.activeElement==r&&(r.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(d,g)),this.impreciseAnchor=d.precise?null:new Oo(p.anchorNode,p.anchorOffset),this.impreciseHead=g.precise?null:new Oo(p.focusNode,p.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&id(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,n=e.state.selection.main,r=Id(e.root),{anchorNode:i,anchorOffset:s}=e.observer.selectionRange;if(!r||!n.empty||!n.assoc||!r.modify)return;let a=this.lineAt(n.head,n.assoc);if(!a)return;let u=a.posAtStart;if(n.head==u||n.head==u+a.length)return;let f=this.coordsAt(n.head,-1),d=this.coordsAt(n.head,1);if(!f||!d||f.bottom>d.top)return;let g=this.domAtPos(n.head+n.assoc,n.assoc);r.collapse(g.node,g.offset),r.modify("move",n.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let p=e.observer.selectionRange;e.docView.posFromDOM(p.anchorNode,p.anchorOffset)!=n.from&&r.collapse(i,s)}posFromDOM(e,n){let r=this.tile.nearest(e);if(!r)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let i=r.posAtStart;if(r.isComposite()){let s;if(e==r.dom)s=r.dom.childNodes[n];else{let a=nl(e)==0?0:n==0?-1:1;for(;;){let u=e.parentNode;if(u==r.dom)break;a==0&&u.firstChild!=u.lastChild&&(e==u.firstChild?a=-1:a=1),e=u}a<0?s=e:s=e.nextSibling}if(s==r.dom.firstChild)return i;for(;s&&!Xn.get(s);)s=s.nextSibling;if(!s)return i+r.length;for(let a=0,u=i;;a++){let f=r.children[a];if(f.dom==s)return u;u+=f.length+f.breakAfter}}else return r.isText()?e==r.dom?i+n:i+(n?r.length:0):i}domAtPos(e,n){let{tile:r,offset:i}=this.tile.resolveBlock(e,n);return r.isWidget()?r.domPosFor(e,n):r.domIn(i,n)}inlineDOMNearPos(e,n){let r,i=-1,s=!1,a,u=-1,f=!1;return this.tile.blockTiles((d,g)=>{if(d.isWidget()){if(d.flags&32&&g>=e)return!0;d.flags&16&&(s=!0)}else{let p=g+d.length;if(g<=e&&(r=d,i=e-g,s=p<e),p>=e&&!a&&(a=d,u=e-g,f=g>e),g>e&&a)return!0}}),!r&&!a?this.domAtPos(e,n):(s&&a?r=null:f&&r&&(a=null),r&&n<0||!a?r.domIn(i,n):a.domIn(u,n))}coordsAt(e,n){let{tile:r,offset:i}=this.tile.resolveBlock(e,n);return r.isWidget()?r.widget instanceof vb?null:r.coordsInWidget(i,n,!0):r.coordsIn(i,n)}lineAt(e,n){let{tile:r}=this.tile.resolveBlock(e,n);return r.isLine()?r:null}coordsForChar(e){let{tile:n,offset:r}=this.tile.resolveBlock(e,1);if(!n.isLine())return null;function i(s,a){if(s.isComposite())for(let u of s.children){if(u.length>=a){let f=i(u,a);if(f)return f}if(a-=u.length,a<0)break}else if(s.isText()&&a<s.length){let u=Yr(s.text,a);if(u==a)return null;let f=Dd(s.dom,a,u).getClientRects();for(let d=0;d<f.length;d++){let g=f[d];if(d==f.length-1||g.top<g.bottom&&g.left<g.right)return g}}return null}return i(n,r)}measureVisibleLineHeights(e){let n=[],{from:r,to:i}=e,s=this.view.contentDOM.clientWidth,a=s>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,u=-1,f=this.view.textDirection==hr.LTR,d=0,g=(p,m,v)=>{for(let b=0;b<p.children.length&&!(m>i);b++){let S=p.children[b],w=m+S.length,C=S.dom.getBoundingClientRect(),{height:R}=C;if(v&&!b&&(d+=C.top-v.top),S instanceof Js)w>r&&g(S,m,C);else if(m>=r&&(d>0&&n.push(-d),n.push(R+d),d=0,a)){let T=S.dom.lastChild,A=T?vp(T):[];if(A.length){let O=A[A.length-1],P=f?O.right-C.left:C.right-O.left;P>u&&(u=P,this.minWidth=s,this.minWidthFrom=m,this.minWidthTo=w)}}v&&b==p.children.length-1&&(d+=v.bottom-C.bottom),m=w+S.breakAfter}};return g(this.tile,0,null),n}textDirectionAt(e){let{tile:n}=this.tile.resolveBlock(e,1);return getComputedStyle(n.dom).direction=="rtl"?hr.RTL:hr.LTR}measureTextSize(){let e=this.tile.blockTiles(a=>{if(a.isLine()&&a.children.length&&a.length<=20){let u=0,f;for(let d of a.children){if(!d.isText()||/[^ -~]/.test(d.text))return;let g=vp(d.dom);if(g.length!=1)return;u+=g[0].width,f=g[0].height}if(u)return{lineHeight:a.dom.getBoundingClientRect().height,charWidth:u/a.length,textHeight:f}}});if(e)return e;let n=document.createElement("div"),r,i,s;return n.className="cm-line",n.style.width="99999px",n.style.position="absolute",n.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(n);let a=vp(n.firstChild)[0];r=n.getBoundingClientRect().height,i=a&&a.width?a.width/27:7,s=a&&a.height?a.height:r,n.remove()}),{lineHeight:r,charWidth:i,textHeight:s}}computeBlockGapDeco(){let e=[],n=this.view.viewState;for(let r=0,i=0;;i++){let s=i==n.viewports.length?null:n.viewports[i],a=s?s.from-1:this.view.state.doc.length;if(a>r){let u=(n.lineBlockAt(a).bottom-n.lineBlockAt(r).top)/this.view.scaleY;e.push(Xr.replace({widget:new vb(u),block:!0,inclusive:!0,isBlockGap:!0}).range(r,a))}if(!s)break;r=s.to+1}return Xr.set(e)}updateDeco(){let e=1,n=this.view.state.facet(Zm).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),r=!1,i=this.view.state.facet(y1).map((s,a)=>{let u=typeof s=="function";return u&&(r=!0),u?s(this.view):s});for(i.length&&(this.dynamicDecorationMap[e++]=r,n.push(cn.join(i))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(rL).map(s=>typeof s=="function"?s(this.view):s)}scrollIntoView(e){var n;if(e.isSnapshot){let g=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=g.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let g of this.view.state.facet(eL))try{if(g(this.view,e.range,e))return!0}catch(p){hs(this.view.state,p,"scroll handler")}let{range:r}=e,i=this.coordsAt(r.head,(n=r.assoc)!==null&&n!==void 0?n:r.empty?0:r.head>r.anchor?-1:1),s;if(!i)return;!r.empty&&(s=this.coordsAt(r.anchor,r.anchor>r.head?-1:1))&&(i={left:Math.min(i.left,s.left),top:Math.min(i.top,s.top),right:Math.max(i.right,s.right),bottom:Math.max(i.bottom,s.bottom)});let a=sL(this.view),u={left:i.left-a.left,top:i.top-a.top,right:i.right+a.right,bottom:i.bottom+a.bottom},{offsetWidth:f,offsetHeight:d}=this.view.scrollDOM;if(zK(this.view.scrollDOM,u,r.head<r.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,f),-f),Math.max(Math.min(e.yMargin,d),-d),this.view.textDirection==hr.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(i.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||i.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let g=this.view.docView.lineAt(r.head,1);g&&g.dom.scrollIntoView({block:"nearest"})}}lineHasWidget(e){let n=r=>r.isWidget()||r.children.some(n);return n(this.tile.resolveBlock(e,1).tile)}destroy(){hS(this.tile)}}function hS(t,e){let n=e?.get(t);if(n!=1){n==null&&t.destroy();for(let r of t.children)hS(r,e)}}function lY(t){return t.node.nodeType==1&&t.node.firstChild&&(t.offset==0||t.node.childNodes[t.offset-1].contentEditable=="false")&&(t.offset==t.node.childNodes.length||t.node.childNodes[t.offset].contentEditable=="false")}function aL(t,e){let n=t.observer.selectionRange;if(!n.focusNode)return null;let r=jN(n.focusNode,n.focusOffset),i=VN(n.focusNode,n.focusOffset),s=r||i;if(i&&r&&i.node!=r.node){let u=Xn.get(i.node);if(!u||u.isText()&&u.text!=i.node.nodeValue)s=i;else if(t.docView.lastCompositionAfterCursor){let f=Xn.get(r.node);!f||f.isText()&&f.text!=r.node.nodeValue||(s=i)}}if(t.docView.lastCompositionAfterCursor=s!=r,!s)return null;let a=e-s.offset;return{from:a,to:a+s.node.nodeValue.length,node:s.node}}function aY(t,e,n){let r=aL(t,n);if(!r)return null;let{node:i,from:s,to:a}=r,u=i.nodeValue;if(/[\n\r]/.test(u)||t.state.doc.sliceString(r.from,r.to)!=u)return null;let f=e.invertedDesc;return{range:new ro(f.mapPos(s),f.mapPos(a),s,a),text:i}}function uY(t,e){return t.nodeType!=1?0:(e&&t.childNodes[e-1].contentEditable=="false"?1:0)|(e<t.childNodes.length&&t.childNodes[e].contentEditable=="false"?2:0)}let cY=class{constructor(){this.changes=[]}compareRange(e,n){dc(e,n,this.changes)}comparePoint(e,n){dc(e,n,this.changes)}boundChange(e){dc(e,e,this.changes)}};function fY(t,e,n){let r=new cY;return cn.compare(t,e,n,r),r.changes}class dY{constructor(){this.changes=[]}compareRange(e,n){dc(e,n,this.changes)}comparePoint(){}boundChange(e){dc(e,e,this.changes)}}function hY(t,e,n){let r=new dY;return cn.compare(t,e,n,r),r.changes}function gY(t,e){for(let n=t;n&&n!=e;n=n.assignedSlot||n.parentNode)if(n.nodeType==1&&n.contentEditable=="false")return!0;return!1}function pY(t,e){let n=!1;return e&&t.iterChangedRanges((r,i)=>{r<e.to&&i>e.from&&(n=!0)}),n}class vb extends Qm{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function mY(t,e,n=1){let r=t.charCategorizer(e),i=t.doc.lineAt(e),s=e-i.from;if(i.length==0)return Ae.cursor(e);s==0?n=1:s==i.length&&(n=-1);let a=s,u=s;n<0?a=Yr(i.text,s,!1):u=Yr(i.text,s);let f=r(i.text.slice(a,u));for(;a>0;){let d=Yr(i.text,a,!1);if(r(i.text.slice(d,a))!=f)break;a=d}for(;u<i.length;){let d=Yr(i.text,u);if(r(i.text.slice(u,d))!=f)break;u=d}return Ae.range(a+i.from,u+i.from)}function yY(t,e,n,r,i){let s=Math.round((r-e.left)*t.defaultCharacterWidth);if(t.lineWrapping&&n.height>t.defaultLineHeight*1.5){let u=t.viewState.heightOracle.textHeight,f=Math.floor((i-n.top-(t.defaultLineHeight-u)*.5)/u);s+=f*t.viewState.heightOracle.lineLength}let a=t.state.sliceDoc(n.from,n.to);return n.from+RK(a,s,t.state.tabSize)}function vY(t,e,n){let r=t.lineBlockAt(e);if(Array.isArray(r.type)){let i;for(let s of r.type){if(s.from>e)break;if(!(s.to<e)){if(s.from<e&&s.to>e)return s;(!i||s.type==lo.Text&&(i.type!=s.type||(n<0?s.from<e:s.to>e)))&&(i=s)}}return i||r}return r}function bY(t,e,n,r){let i=vY(t,e.head,e.assoc||-1),s=!r||i.type!=lo.Text||!(t.lineWrapping||i.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>i.from?e.head-1:e.head);if(s){let a=t.dom.getBoundingClientRect(),u=t.textDirectionAt(i.from),f=t.posAtCoords({x:n==(u==hr.LTR)?a.right-1:a.left+1,y:(s.top+s.bottom)/2});if(f!=null)return Ae.cursor(f,n?-1:1)}return Ae.cursor(n?i.to:i.from,n?-1:1)}function HO(t,e,n,r){let i=t.state.doc.lineAt(e.head),s=t.bidiSpans(i),a=t.textDirectionAt(i.from);for(let u=e,f=null;;){let d=qK(i,s,a,u,n),g=GN;if(!d){if(i.number==(n?t.state.doc.lines:1))return u;g=`
28
- `,i=t.state.doc.line(i.number+(n?1:-1)),s=t.bidiSpans(i),d=t.visualLineSide(i,!n)}if(f){if(!f(g))return u}else{if(!r)return d;f=r(g)}u=d}}function xY(t,e,n){let r=t.state.charCategorizer(e),i=r(n);return s=>{let a=r(s);return i==Ys.Space&&(i=a),i==a}}function SY(t,e,n,r){let i=e.head,s=n?1:-1;if(i==(n?t.state.doc.length:0))return Ae.cursor(i,e.assoc);let a=e.goalColumn,u,f=t.contentDOM.getBoundingClientRect(),d=t.coordsAtPos(i,e.assoc||((e.empty?n:e.head==e.from)?1:-1)),g=t.documentTop;if(d)a==null&&(a=d.left-f.left),u=s<0?d.top:d.bottom;else{let b=t.viewState.lineBlockAt(i);a==null&&(a=Math.min(f.right-f.left,t.defaultCharacterWidth*(i-b.from))),u=(s<0?b.top:b.bottom)+g}let p=f.left+a,m=t.viewState.heightOracle.textHeight>>1,v=r??m;for(let b=0;;b+=m){let S=u+(v+b)*s,w=gS(t,{x:p,y:S},!1,s);if(n?S>f.bottom:S<f.top)return Ae.cursor(w.pos,w.assoc);let C=t.coordsAtPos(w.pos,w.assoc),R=C?(C.top+C.bottom)/2:0;if(!C||(n?R>u:R<u))return Ae.cursor(w.pos,w.assoc,void 0,a)}}function od(t,e,n){for(;;){let r=0;for(let i of t)i.between(e-1,e+1,(s,a,u)=>{if(e>s&&e<a){let f=r||n||(e-s<a-e?-1:1);e=f<0?s:a,r=f}});if(!r)return e}}function uL(t,e){let n=null;for(let r=0;r<e.ranges.length;r++){let i=e.ranges[r],s=null;if(i.empty){let a=od(t,i.from,0);a!=i.from&&(s=Ae.cursor(a,-1))}else{let a=od(t,i.from,-1),u=od(t,i.to,1);(a!=i.from||u!=i.to)&&(s=Ae.range(i.from==i.anchor?a:u,i.from==i.head?a:u))}s&&(n||(n=e.ranges.slice()),n[r]=s)}return n?Ae.create(n,e.mainIndex):e}function bb(t,e,n){let r=od(t.state.facet(Xd).map(i=>i(t)),n.from,e.head>n.from?-1:1);return r==n.from?n:Ae.cursor(r,r<n.from?1:-1)}class us{constructor(e,n){this.pos=e,this.assoc=n}}function gS(t,e,n,r){let i=t.contentDOM.getBoundingClientRect(),s=i.top+t.viewState.paddingTop,{x:a,y:u}=e,f=u-s,d;for(;;){if(f<0)return new us(0,1);if(f>t.viewState.docHeight)return new us(t.state.doc.length,-1);if(d=t.elementAtHeight(f),r==null)break;if(d.type==lo.Text){if(r<0?d.to<t.viewport.from:d.from>t.viewport.to)break;let m=t.docView.coordsAt(r<0?d.from:d.to,r>0?-1:1);if(m&&(r<0?m.top<=f+s:m.bottom>=f+s))break}let p=t.viewState.heightOracle.textHeight/2;f=r>0?d.bottom+p:d.top-p}if(t.viewport.from>=d.to||t.viewport.to<=d.from){if(n)return null;if(d.type==lo.Text){let p=yY(t,i,d,a,u);return new us(p,p==d.from?1:-1)}}if(d.type!=lo.Text)return f<(d.top+d.bottom)/2?new us(d.from,1):new us(d.to,-1);let g=t.docView.lineAt(d.from,2);return(!g||g.length!=d.length)&&(g=t.docView.lineAt(d.from,-2)),new wY(t,a,u,t.textDirectionAt(d.from)).scanTile(g,d.from)}class wY{constructor(e,n,r,i){this.view=e,this.x=n,this.y=r,this.baseDir=i,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,n){let{line:r,spans:i}=this.bidiSpansAt(e);return i[ds.find(i,e-r.from,-1,n)].level==this.baseDir}dirAt(e,n){let{line:r,spans:i}=this.bidiSpansAt(e);return i[ds.find(i,e-r.from,-1,n)].dir}bidiIn(e,n){let{spans:r,line:i}=this.bidiSpansAt(e);return r.length>1||r.length&&(r[0].level!=this.baseDir||r[0].to+i.from<n)}scan(e,n){let r=0,i=e.length-1,s=new Set,a=this.bidiIn(e[0],e[i]),u,f,d=-1,g=1e9,p;e:for(;r<i;){let v=i-r,b=r+i>>1;t:if(s.has(b)){let w=r+Math.floor(Math.random()*v);for(let C=0;C<v;C++){if(!s.has(w)){b=w;break t}w++,w==i&&(w=r)}break e}s.add(b);let S=n(b);if(S)for(let w=0;w<S.length;w++){let C=S[w],R=0;if(!(C.width==0&&S.length>1)){if(C.bottom<this.y)(!u||u.bottom<C.bottom)&&(u=C),R=1;else if(C.top>this.y)(!f||f.top>C.top)&&(f=C),R=-1;else{let T=C.left>this.x?this.x-C.left:C.right<this.x?this.x-C.right:0,A=Math.abs(T);A<g&&(d=b,g=A,p=C),T&&(R=T<0==(this.baseDir==hr.LTR)?-1:1)}R==-1&&(!a||this.baseDirAt(e[b],1))?i=b:R==1&&(!a||this.baseDirAt(e[b+1],-1))&&(r=b+1)}}}if(!p){let v=u&&(!f||this.y-u.bottom<f.top-this.y)?u:f;return this.y=(v.top+v.bottom)/2,this.scan(e,n)}let m=(a?this.dirAt(e[d],1):this.baseDir)==hr.LTR;return{i:d,after:this.x>(p.left+p.right)/2==m}}scanText(e,n){let r=[];for(let s=0;s<e.length;s=Yr(e.text,s))r.push(n+s);r.push(n+e.length);let i=this.scan(r,s=>{let a=r[s]-n,u=r[s+1]-n;return Dd(e.dom,a,u).getClientRects()});return i.after?new us(r[i.i+1],-1):new us(r[i.i],1)}scanTile(e,n){if(!e.length)return new us(n,1);if(e.children.length==1){let u=e.children[0];if(u.isText())return this.scanText(u,n);if(u.isComposite())return this.scanTile(u,n)}let r=[n];for(let u=0,f=n;u<e.children.length;u++)r.push(f+=e.children[u].length);let i=this.scan(r,u=>{let f=e.children[u];return f.flags&48?null:(f.dom.nodeType==1?f.dom:Dd(f.dom,0,f.length)).getClientRects()}),s=e.children[i.i],a=r[i.i];return s.isText()?this.scanText(s,a):s.isComposite()?this.scanTile(s,a):i.after?new us(r[i.i+1],-1):new us(a,1)}}const ec="￿";class CY{constructor(e,n){this.points=e,this.view=n,this.text="",this.lineSeparator=n.state.facet(on.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=ec}readRange(e,n){if(!e)return this;let r=e.parentNode;for(let i=e;;){this.findPointBefore(r,i);let s=this.text.length;this.readNode(i);let a=Xn.get(i),u=i.nextSibling;if(u==n){a?.breakAfter&&!u&&r!=this.view.contentDOM&&this.lineBreak();break}let f=Xn.get(u);(a&&f?a.breakAfter:(a?a.breakAfter:Wp(i))||Wp(u)&&(i.nodeName!="BR"||a?.isWidget())&&this.text.length>s)&&!EY(u,n)&&this.lineBreak(),i=u}return this.findPointBefore(r,n),this}readTextNode(e){let n=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,n.length));for(let r=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,a=1,u;if(this.lineSeparator?(s=n.indexOf(this.lineSeparator,r),a=this.lineSeparator.length):(u=i.exec(n))&&(s=u.index,a=u[0].length),this.append(n.slice(r,s<0?n.length:s)),s<0)break;if(this.lineBreak(),a>1)for(let f of this.points)f.node==e&&f.pos>this.text.length&&(f.pos-=a-1);r=s+a}}readNode(e){let n=Xn.get(e),r=n&&n.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let i=r.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,n){for(let r of this.points)r.node==e&&e.childNodes[r.offset]==n&&(r.pos=this.text.length)}findPointInside(e,n){for(let r of this.points)(e.nodeType==3?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+(RY(e,r.node,r.offset)?n:0))}}function RY(t,e,n){for(;;){if(!e||n<nl(e))return!1;if(e==t)return!0;n=ca(e)+1,e=e.parentNode}}function EY(t,e){let n;for(;!(t==e||!t);t=t.nextSibling){let r=Xn.get(t);if(!r?.isWidget())return!1;r&&(n||(n=[])).push(r)}if(n)for(let r of n){let i=r.overrideDOMText;if(i?.length)return!1}return!0}class jO{constructor(e,n){this.node=e,this.offset=n,this.pos=-1}}class TY{constructor(e,n,r,i){this.typeOver=i,this.bounds=null,this.text="",this.domChanged=n>-1;let{impreciseHead:s,impreciseAnchor:a}=e.docView,u=e.state.selection;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=cL(e.docView.tile,n,r,0))){let f=s||a?[]:MY(e),d=new CY(f,e);d.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=d.text,this.newSel=OY(f,this.bounds.from)}else{let f=e.observer.selectionRange,d=s&&s.node==f.focusNode&&s.offset==f.focusOffset||!aS(e.contentDOM,f.focusNode)?u.main.head:e.docView.posFromDOM(f.focusNode,f.focusOffset),g=a&&a.node==f.anchorNode&&a.offset==f.anchorOffset||!aS(e.contentDOM,f.anchorNode)?u.main.anchor:e.docView.posFromDOM(f.anchorNode,f.anchorOffset),p=e.viewport;if(($e.ios||$e.chrome)&&u.main.empty&&d!=g&&(p.from>0||p.to<e.state.doc.length)){let m=Math.min(d,g),v=Math.max(d,g),b=p.from-m,S=p.to-v;(b==0||b==1||m==0)&&(S==0||S==-1||v==e.state.doc.length)&&(d=0,g=e.state.doc.length)}if(e.inputState.composing>-1&&u.ranges.length>1)this.newSel=u.replaceRange(Ae.range(g,d));else if(e.lineWrapping&&g==d&&!(u.main.empty&&u.main.head==d)&&e.inputState.lastTouchTime>Date.now()-100){let m=e.coordsAtPos(d,-1),v=0;m&&(v=e.inputState.lastTouchY<=m.bottom?-1:1),this.newSel=Ae.create([Ae.cursor(d,v)])}else this.newSel=Ae.single(g,d)}}}function cL(t,e,n,r){if(t.isComposite()){let i=-1,s=-1,a=-1,u=-1;for(let f=0,d=r,g=r;f<t.children.length;f++){let p=t.children[f],m=d+p.length;if(d<e&&m>n)return cL(p,e,n,d);if(m>=e&&i==-1&&(i=f,s=d),d>n&&p.dom.parentNode==t.dom){a=f,u=g;break}g=m,d=m+p.breakAfter}return{from:s,to:u<0?r+t.length:u,startDOM:(i?t.children[i-1].dom.nextSibling:null)||t.dom.firstChild,endDOM:a<t.children.length&&a>=0?t.children[a].dom:null}}else return t.isText()?{from:r,to:r+t.length,startDOM:t.dom,endDOM:t.dom.nextSibling}:null}function fL(t,e){let n,{newSel:r}=e,{state:i}=t,s=i.selection.main,a=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:u,to:f}=e.bounds,d=s.from,g=null;(a===8||$e.android&&e.text.length<f-u)&&(d=s.to,g="end");let p=i.doc.sliceString(u,f,ec),m,v;!s.empty&&s.from>=u&&s.to<=f&&(e.typeOver||p!=e.text)&&p.slice(0,s.from-u)==e.text.slice(0,s.from-u)&&p.slice(s.to-u)==e.text.slice(m=e.text.length-(p.length-(s.to-u)))?n={from:s.from,to:s.to,insert:qt.of(e.text.slice(s.from-u,m).split(ec))}:(v=dL(p,e.text,d-u,g))&&($e.chrome&&a==13&&v.toB==v.from+2&&e.text.slice(v.from,v.toB)==ec+ec&&v.toB--,n={from:u+v.from,to:u+v.toA,insert:qt.of(e.text.slice(v.from,v.toB).split(ec))})}else r&&(!t.hasFocus&&i.facet(Ws)||Zp(r,s))&&(r=null);if(!n&&!r)return!1;if(($e.mac||$e.android)&&n&&n.from==n.to&&n.from==s.head-1&&/^\. ?$/.test(n.insert.toString())&&t.contentDOM.getAttribute("autocorrect")=="off"?(r&&n.insert.length==2&&(r=Ae.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:qt.of([n.insert.toString().replace("."," ")])}):i.doc.lineAt(s.from).to<s.to&&t.docView.lineHasWidget(s.to)&&t.inputState.insertingTextAt>Date.now()-50?n={from:s.from,to:s.to,insert:i.toText(t.inputState.insertingText)}:$e.chrome&&n&&n.from==n.to&&n.from==s.head&&n.insert.toString()==`
29
- `&&t.lineWrapping&&(r&&(r=Ae.single(r.main.anchor-1,r.main.head-1)),n={from:s.from,to:s.to,insert:qt.of([" "])}),n)return v1(t,n,r,a);if(r&&!Zp(r,s)){let u=!1,f="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(u=!0),f=t.inputState.lastSelectionOrigin,f=="select.pointer"&&(r=uL(i.facet(Xd).map(d=>d(t)),r))),t.dispatch({selection:r,scrollIntoView:u,userEvent:f}),!0}else return!1}function v1(t,e,n,r=-1){if($e.ios&&t.inputState.flushIOSKey(e))return!0;let i=t.state.selection.main;if($e.android&&(e.to==i.to&&(e.from==i.from||e.from==i.from-1&&t.state.sliceDoc(e.from,i.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&hc(t.contentDOM,"Enter",13)||(e.from==i.from-1&&e.to==i.to&&e.insert.length==0||r==8&&e.insert.length<e.to-e.from&&e.to>i.head)&&hc(t.contentDOM,"Backspace",8)||e.from==i.from&&e.to==i.to+1&&e.insert.length==0&&hc(t.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let a,u=()=>a||(a=AY(t,e,n));return t.state.facet(QN).some(f=>f(t,e.from,e.to,s,u))||t.dispatch(u()),!0}function AY(t,e,n){let r,i=t.state,s=i.selection.main,a=-1;if(e.from==e.to&&e.from<s.from||e.from>s.to){let f=e.from<s.from?-1:1,d=f<0?s.from:s.to,g=od(i.facet(Xd).map(p=>p(t)),d,f);e.from==g&&(a=g)}if(a>-1)r={changes:e,selection:Ae.cursor(e.from+e.insert.length,-1)};else if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!n||n.main.empty&&n.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let f=s.from<e.from?i.sliceDoc(s.from,e.from):"",d=s.to>e.to?i.sliceDoc(e.to,s.to):"";r=i.replaceSelection(t.state.toText(f+e.insert.sliceString(0,void 0,t.state.lineBreak)+d))}else{let f=i.changes(e),d=n&&n.main.to<=f.newLength?n.main:void 0;if(i.selection.ranges.length>1&&(t.inputState.composing>=0||t.inputState.compositionPendingChange)&&e.to<=s.to+10&&e.to>=s.to-10){let g=t.state.sliceDoc(e.from,e.to),p,m=n&&aL(t,n.main.head);if(m){let b=e.insert.length-(e.to-e.from);p={from:m.from,to:m.to-b}}else p=t.state.doc.lineAt(s.head);let v=s.to-e.to;r=i.changeByRange(b=>{if(b.from==s.from&&b.to==s.to)return{changes:f,range:d||b.map(f)};let S=b.to-v,w=S-g.length;if(t.state.sliceDoc(w,S)!=g||S>=p.from&&w<=p.to)return{range:b};let C=i.changes({from:w,to:S,insert:e.insert}),R=b.to-s.to;return{changes:C,range:d?Ae.range(Math.max(0,d.anchor+R),Math.max(0,d.head+R)):b.map(C)}})}else r={changes:f,selection:d&&i.selection.replaceRange(d)}}let u="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,u+=".compose",t.inputState.compositionFirstChange&&(u+=".start",t.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:u,scrollIntoView:!0})}function dL(t,e,n,r){let i=Math.min(t.length,e.length),s=0;for(;s<i&&t.charCodeAt(s)==e.charCodeAt(s);)s++;if(s==i&&t.length==e.length)return null;let a=t.length,u=e.length;for(;a>0&&u>0&&t.charCodeAt(a-1)==e.charCodeAt(u-1);)a--,u--;if(r=="end"){let f=Math.max(0,s-Math.min(a,u));n-=a+f-s}if(a<s&&t.length<e.length){let f=n<=s&&n>=a?s-n:0;s-=f,u=s+(u-a),a=s}else if(u<s){let f=n<=s&&n>=u?s-n:0;s-=f,a=s+(a-u),u=s}return{from:s,toA:a,toB:u}}function MY(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}=t.observer.selectionRange;return n&&(e.push(new jO(n,r)),(i!=n||s!=r)&&e.push(new jO(i,s))),e}function OY(t,e){if(t.length==0)return null;let n=t[0].pos,r=t.length==2?t[1].pos:n;return n>-1&&r>-1?Ae.single(n+e,r+e):null}function Zp(t,e){return e.head==t.main.head&&e.anchor==t.main.anchor}class kY{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,$e.safari&&e.contentDOM.addEventListener("input",()=>null),$e.gecko&&qY(e.contentDOM.ownerDocument)}handleEvent(e){!_Y(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,n){let r=this.handlers[e];if(r){for(let i of r.observers)i(this.view,n);for(let i of r.handlers){if(n.defaultPrevented)break;if(i(this.view,n)){n.preventDefault();break}}}}ensureHandlers(e){let n=IY(e),r=this.handlers,i=this.view.contentDOM;for(let s in n)if(s!="scroll"){let a=!n[s].handlers.length,u=r[s];u&&a!=!u.handlers.length&&(i.removeEventListener(s,this.handleEvent),u=null),u||i.addEventListener(s,this.handleEvent,{passive:a})}for(let s in r)s!="scroll"&&!n[s]&&i.removeEventListener(s,this.handleEvent);this.handlers=n}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&gL.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),$e.android&&$e.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let n;return $e.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&!e.shiftKey&&((n=hL.find(r=>r.keyCode==e.keyCode))&&!e.ctrlKey||DY.indexOf(e.key)>-1&&e.ctrlKey)?(this.pendingIOSKey=n||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,hc(this.view.contentDOM,n.key,n.keyCode,n instanceof KeyboardEvent?n:void 0))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:$e.safari&&!$e.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function VO(t,e){return(n,r)=>{try{return e.call(t,r,n)}catch(i){hs(n.state,i)}}}function IY(t){let e=Object.create(null);function n(r){return e[r]||(e[r]={observers:[],handlers:[]})}for(let r of t){let i=r.spec,s=i&&i.plugin.domEventHandlers,a=i&&i.plugin.domEventObservers;if(s)for(let u in s){let f=s[u];f&&n(u).handlers.push(VO(r.value,f))}if(a)for(let u in a){let f=a[u];f&&n(u).observers.push(VO(r.value,f))}}for(let r in Bo)n(r).handlers.push(Bo[r]);for(let r in xi)n(r).observers.push(xi[r]);return e}const hL=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],DY="dthko",gL=[16,17,18,20,91,92,224,225],qg=6;function Gg(t){return Math.max(0,t)*.7+8}function PY(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class zY{constructor(e,n,r,i){this.view=e,this.startEvent=n,this.style=r,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=BN(e.contentDOM),this.atoms=e.state.facet(Xd).map(a=>a(e));let s=e.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=e.state.facet(on.allowMultipleSelections)&&NY(e,n),this.dragging=BY(e,n)&&yL(n)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&PY(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,r=0,i=0,s=0,a=this.view.win.innerWidth,u=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:u}=this.scrollParents.y.getBoundingClientRect());let f=sL(this.view);e.clientX-f.left<=i+qg?n=-Gg(i-e.clientX):e.clientX+f.right>=a-qg&&(n=Gg(e.clientX-a)),e.clientY-f.top<=s+qg?r=-Gg(s-e.clientY):e.clientY+f.bottom>=u-qg&&(r=Gg(e.clientY-u)),this.setScrollSpeed(n,r)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,n){this.scrollSpeed={x:e,y:n},e||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:n}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(e||n)&&this.view.win.scrollBy(e,n),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:n}=this,r=uL(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!r.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:r,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function NY(t,e){let n=t.state.facet(WN);return n.length?n[0](e):$e.mac?e.metaKey:e.ctrlKey}function LY(t,e){let n=t.state.facet(KN);return n.length?n[0](e):$e.mac?!e.altKey:!e.ctrlKey}function BY(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let r=Id(t.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let s=0;s<i.length;s++){let a=i[s];if(a.left<=e.clientX&&a.right>=e.clientX&&a.top<=e.clientY&&a.bottom>=e.clientY)return!0}return!1}function _Y(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target,r;n!=t.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=Xn.get(n))&&r.isWidget()&&!r.isHidden&&r.widget.ignoreEvent(e))return!1;return!0}const Bo=Object.create(null),xi=Object.create(null),pL=$e.ie&&$e.ie_version<15||$e.ios&&$e.webkit_version<604;function HY(t){let e=t.dom.parentNode;if(!e)return;let n=e.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{t.focus(),n.remove(),mL(t,n.value)},50)}function ty(t,e,n){for(let r of t.facet(e))n=r(n,t);return n}function mL(t,e){e=ty(t.state,g1,e);let{state:n}=t,r,i=1,s=n.toText(e),a=s.lines==n.selection.ranges.length;if(pS!=null&&n.selection.ranges.every(f=>f.empty)&&pS==s.toString()){let f=-1;r=n.changeByRange(d=>{let g=n.doc.lineAt(d.from);if(g.from==f)return{range:d};f=g.from;let p=n.toText((a?s.line(i++).text:e)+n.lineBreak);return{changes:{from:g.from,insert:p},range:Ae.cursor(d.from+p.length)}})}else a?r=n.changeByRange(f=>{let d=s.line(i++);return{changes:{from:f.from,to:f.to,insert:d.text},range:Ae.cursor(f.from+d.length)}}):r=n.replaceSelection(s);t.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}xi.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};xi.wheel=xi.mousewheel=t=>{t.inputState.lastWheelEvent=Date.now()};Bo.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);xi.touchstart=(t,e)=>{let n=t.inputState,r=e.targetTouches[0];n.lastTouchTime=Date.now(),r&&(n.lastTouchX=r.clientX,n.lastTouchY=r.clientY),n.setSelectionOrigin("select.pointer")};xi.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};Bo.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of t.state.facet(YN))if(n=r(t,e),n)break;if(!n&&e.button==0&&(n=VY(t,e)),n){let r=!t.hasFocus;t.inputState.startMouseSelection(new zY(t,e,n,r)),r&&t.observer.ignore(()=>{_N(t.contentDOM);let s=t.root.activeElement;s&&!s.contains(t.contentDOM)&&s.blur()});let i=t.inputState.mouseSelection;if(i)return i.start(e),i.dragging===!1}else t.inputState.setSelectionOrigin("select.pointer");return!1};function FO(t,e,n,r){if(r==1)return Ae.cursor(e,n);if(r==2)return mY(t.state,e,n);{let i=t.docView.lineAt(e,n),s=t.state.doc.lineAt(i?i.posAtEnd:e),a=i?i.posAtStart:s.from,u=i?i.posAtEnd:s.to;return u<t.state.doc.length&&u==s.to&&u++,Ae.range(a,u)}}const jY=$e.ie&&$e.ie_version<=11;let UO=null,$O=0,qO=0;function yL(t){if(!jY)return t.detail;let e=UO,n=qO;return UO=t,qO=Date.now(),$O=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?($O+1)%3:1}function VY(t,e){let n=t.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),r=yL(e),i=t.state.selection;return{update(s){s.docChanged&&(n.pos=s.changes.mapPos(n.pos),i=i.map(s.changes))},get(s,a,u){let f=t.posAndSideAtCoords({x:s.clientX,y:s.clientY},!1),d,g=FO(t,f.pos,f.assoc,r);if(n.pos!=f.pos&&!a){let p=FO(t,n.pos,n.assoc,r),m=Math.min(p.from,g.from),v=Math.max(p.to,g.to);g=m<g.from?Ae.range(m,v,g.assoc):Ae.range(v,m,g.assoc)}return a?i.replaceRange(i.main.extend(g.from,g.to,g.assoc)):u&&r==1&&i.ranges.length>1&&(d=FY(i,f.pos))?d:u?i.addRange(g):Ae.create([g])}}}function FY(t,e){for(let n=0;n<t.ranges.length;n++){let{from:r,to:i}=t.ranges[n];if(r<=e&&i>=e)return Ae.create(t.ranges.slice(0,n).concat(t.ranges.slice(n+1)),t.mainIndex==n?0:t.mainIndex-(t.mainIndex>n?1:0))}return null}Bo.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let i=t.docView.tile.nearest(e.target);if(i&&i.isWidget()){let s=i.posAtStart,a=s+i.length;(s>=n.to||a<=n.from)&&(n=Ae.range(s,a))}}let{inputState:r}=t;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",ty(t.state,p1,t.state.sliceDoc(n.from,n.to))),e.dataTransfer.effectAllowed="copyMove"),!1};Bo.dragend=t=>(t.inputState.draggedContent=null,!1);function GO(t,e,n,r){if(n=ty(t.state,g1,n),!n)return;let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=t.inputState,a=r&&s&&LY(t,e)?{from:s.from,to:s.to}:null,u={from:i,insert:n},f=t.state.changes(a?[a,u]:u);t.focus(),t.dispatch({changes:f,selection:{anchor:f.mapPos(i,-1),head:f.mapPos(i,1)},userEvent:a?"move.drop":"input.drop"}),t.inputState.draggedContent=null}Bo.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let n=e.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,s=()=>{++i==n.length&&GO(t,e,r.filter(a=>a!=null).join(t.state.lineBreak),!1)};for(let a=0;a<n.length;a++){let u=new FileReader;u.onerror=s,u.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(u.result)||(r[a]=u.result),s()},u.readAsText(n[a])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return GO(t,e,r,!0),!0}return!1};Bo.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=pL?null:e.clipboardData;return n?(mL(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(HY(t),!1)};function UY(t,e){let n=t.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout(()=>{r.remove(),t.focus()},50)}function $Y(t){let e=[],n=[],r=!1;for(let i of t.selection.ranges)i.empty||(e.push(t.sliceDoc(i.from,i.to)),n.push(i));if(!e.length){let i=-1;for(let{from:s}of t.selection.ranges){let a=t.doc.lineAt(s);a.number>i&&(e.push(a.text),n.push({from:a.from,to:Math.min(t.doc.length,a.to+1)})),i=a.number}r=!0}return{text:ty(t,p1,e.join(t.lineBreak)),ranges:n,linewise:r}}let pS=null;Bo.copy=Bo.cut=(t,e)=>{if(!rd(t.contentDOM,t.observer.selectionRange))return!1;let{text:n,ranges:r,linewise:i}=$Y(t.state);if(!n&&!i)return!1;pS=i?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let s=pL?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",n),!0):(UY(t,n),!1)};const vL=ba.define();function bL(t,e){let n=[];for(let r of t.facet(ZN)){let i=r(t,e);i&&n.push(i)}return n.length?t.update({effects:n,annotations:vL.of(!0)}):null}function xL(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=bL(t.state,e);n?t.dispatch(n):t.update([])}},10)}xi.focus=t=>{t.inputState.lastFocusTime=Date.now(),!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)&&(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),xL(t)};xi.blur=t=>{t.observer.clearSelectionRange(),xL(t)};xi.compositionstart=xi.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};xi.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,$e.chrome&&$e.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};xi.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};Bo.beforeinput=(t,e)=>{var n,r;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(t.inputState.insertingText=e.data,t.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&t.observer.editContext){let s=(n=e.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),a=e.getTargetRanges();if(s&&a.length){let u=a[0],f=t.posAtDOM(u.startContainer,u.startOffset),d=t.posAtDOM(u.endContainer,u.endOffset);return v1(t,{from:f,to:d,insert:t.state.toText(s)},null),!0}}let i;if($e.chrome&&$e.android&&(i=hL.find(s=>s.inputType==e.inputType))&&(t.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let s=((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0;setTimeout(()=>{var a;(((a=window.visualViewport)===null||a===void 0?void 0:a.height)||0)>s+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return $e.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),$e.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>xi.compositionend(t,e),20),!1};const WO=new Set;function qY(t){WO.has(t)||(WO.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const KO=["pre-wrap","normal","pre-line","break-spaces"];let Mc=!1;function YO(){Mc=!1}class GY{constructor(e){this.lineWrapping=e,this.doc=qt.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,n){let r=this.doc.lineAt(n).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((n-e-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return KO.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let n=!1;for(let r=0;r<e.length;r++){let i=e[r];i<0?r++:this.heightSamples[Math.floor(i*10)]||(n=!0,this.heightSamples[Math.floor(i*10)]=!0)}return n}refresh(e,n,r,i,s,a){let u=KO.indexOf(e)>-1,f=Math.abs(n-this.lineHeight)>.3||this.lineWrapping!=u||Math.abs(r-this.charWidth)>.1;if(this.lineWrapping=u,this.lineHeight=n,this.charWidth=r,this.textHeight=i,this.lineLength=s,f){this.heightSamples={};for(let d=0;d<a.length;d++){let g=a[d];g<0?d++:this.heightSamples[Math.floor(g*10)]=!0}}return f}}class WY{constructor(e,n){this.from=e,this.heights=n,this.index=0}get more(){return this.index<this.heights.length}}class Mo{constructor(e,n,r,i,s){this.from=e,this.length=n,this.top=r,this.height=i,this._content=s}get type(){return typeof this._content=="number"?lo.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof cu?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new Mo(this.from,this.length+e.length,this.top,this.height+e.height,n)}}var En=(function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t})(En||(En={}));const bp=.001;class oi{constructor(e,n,r=2){this.length=e,this.height=n,this.flags=r}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>bp&&(Mc=!0),this.height=e)}replace(e,n,r){return oi.of(r)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,r,i){let s=this,a=r.doc;for(let u=i.length-1;u>=0;u--){let{fromA:f,toA:d,fromB:g,toB:p}=i[u],m=s.lineAt(f,En.ByPosNoHeight,r.setDoc(n),0,0),v=m.to>=d?m:s.lineAt(d,En.ByPosNoHeight,r,0,0);for(p+=v.to-d,d=v.to;u>0&&m.from<=i[u-1].toA;)f=i[u-1].fromA,g=i[u-1].fromB,u--,f<m.from&&(m=s.lineAt(f,En.ByPosNoHeight,r,0,0));g+=m.from-f,f=m.from;let b=b1.build(r.setDoc(a),e,g,p);s=Jp(s,s.replace(f,d,b))}return s.updateHeight(r,0)}static empty(){return new ki(0,0,0)}static of(e){if(e.length==1)return e[0];let n=0,r=e.length,i=0,s=0;for(;;)if(n==r)if(i>s*2){let u=e[n-1];u.break?e.splice(--n,1,u.left,null,u.right):e.splice(--n,1,u.left,u.right),r+=1+u.break,i-=u.size}else if(s>i*2){let u=e[r];u.break?e.splice(r,1,u.left,null,u.right):e.splice(r,1,u.left,u.right),r+=2+u.break,s-=u.size}else break;else if(i<s){let u=e[n++];u&&(i+=u.size)}else{let u=e[--r];u&&(s+=u.size)}let a=0;return e[n-1]==null?(a=1,n--):e[n]==null&&(a=1,r++),new YY(oi.of(e.slice(0,n)),a,oi.of(e.slice(r)))}}function Jp(t,e){return t==e?t:(t.constructor!=e.constructor&&(Mc=!0),e)}oi.prototype.size=1;const KY=Xr.replace({});class SL extends oi{constructor(e,n,r){super(e,n),this.deco=r,this.spaceAbove=0}mainBlock(e,n){return new Mo(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,n,r,i){return this.spaceAbove&&e<r+this.spaceAbove?new Mo(i,0,r,this.spaceAbove,KY):this.mainBlock(r,i)}lineAt(e,n,r,i,s){let a=this.mainBlock(i,s);return this.spaceAbove?this.blockAt(0,r,i,s).join(a):a}forEachLine(e,n,r,i,s,a){e<=s+this.length&&n>=s&&a(this.lineAt(0,En.ByPos,r,i,s))}setMeasuredHeight(e){let n=e.heights[e.index++];n<0?(this.spaceAbove=-n,n=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(n)}updateHeight(e,n=0,r=!1,i){return i&&i.from<=n&&i.more&&this.setMeasuredHeight(i),this.outdated=!1,this}toString(){return`block(${this.length})`}}class ki extends SL{constructor(e,n,r){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=r}mainBlock(e,n){return new Mo(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,n,r){let i=r[0];return r.length==1&&(i instanceof ki||i instanceof Ir&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof Ir?i=new ki(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):oi.of(r)}updateHeight(e,n=0,r=!1,i){return i&&i.from<=n&&i.more?this.setMeasuredHeight(i):(r||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class Ir extends oi{constructor(e){super(e,0)}heightMetrics(e,n){let r=e.doc.lineAt(n).number,i=e.doc.lineAt(n+this.length).number,s=i-r+1,a,u=0;if(e.lineWrapping){let f=Math.min(this.height,e.lineHeight*s);a=f/s,this.length>s+1&&(u=(this.height-f)/(this.length-s-1))}else a=this.height/s;return{firstLine:r,lastLine:i,perLine:a,perChar:u}}blockAt(e,n,r,i){let{firstLine:s,lastLine:a,perLine:u,perChar:f}=this.heightMetrics(n,i);if(n.lineWrapping){let d=i+(e<n.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-r)/this.height))*this.length)),g=n.doc.lineAt(d),p=u+g.length*f,m=Math.max(r,e-p/2);return new Mo(g.from,g.length,m,p,0)}else{let d=Math.max(0,Math.min(a-s,Math.floor((e-r)/u))),{from:g,length:p}=n.doc.line(s+d);return new Mo(g,p,r+u*d,u,0)}}lineAt(e,n,r,i,s){if(n==En.ByHeight)return this.blockAt(e,r,i,s);if(n==En.ByPosNoHeight){let{from:v,to:b}=r.doc.lineAt(e);return new Mo(v,b-v,0,0,0)}let{firstLine:a,perLine:u,perChar:f}=this.heightMetrics(r,s),d=r.doc.lineAt(e),g=u+d.length*f,p=d.number-a,m=i+u*p+f*(d.from-s-p);return new Mo(d.from,d.length,Math.max(i,Math.min(m,i+this.height-g)),g,0)}forEachLine(e,n,r,i,s,a){e=Math.max(e,s),n=Math.min(n,s+this.length);let{firstLine:u,perLine:f,perChar:d}=this.heightMetrics(r,s);for(let g=e,p=i;g<=n;){let m=r.doc.lineAt(g);if(g==e){let b=m.number-u;p+=f*b+d*(e-s-b)}let v=f+d*m.length;a(new Mo(m.from,m.length,p,v,0)),p+=v,g=m.to+1}}replace(e,n,r){let i=this.length-n;if(i>0){let s=r[r.length-1];s instanceof Ir?r[r.length-1]=new Ir(s.length+i):r.push(null,new Ir(i-1))}if(e>0){let s=r[0];s instanceof Ir?r[0]=new Ir(e+s.length):r.unshift(new Ir(e-1),null)}return oi.of(r)}decomposeLeft(e,n){n.push(new Ir(e-1),null)}decomposeRight(e,n){n.push(null,new Ir(this.length-e-1))}updateHeight(e,n=0,r=!1,i){let s=n+this.length;if(i&&i.from<=n+this.length&&i.more){let a=[],u=Math.max(n,i.from),f=-1;for(i.from>n&&a.push(new Ir(i.from-n-1).updateHeight(e,n));u<=s&&i.more;){let g=e.doc.lineAt(u).length;a.length&&a.push(null);let p=i.heights[i.index++],m=0;p<0&&(m=-p,p=i.heights[i.index++]),f==-1?f=p:Math.abs(p-f)>=bp&&(f=-2);let v=new ki(g,p,m);v.outdated=!1,a.push(v),u+=g+1}u<=s&&a.push(null,new Ir(s-u).updateHeight(e,u));let d=oi.of(a);return(f<0||Math.abs(d.height-this.height)>=bp||Math.abs(f-this.heightMetrics(e,n).perLine)>=bp)&&(Mc=!0),Jp(this,d)}else(r||this.outdated)&&(this.setHeight(e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class YY extends oi{constructor(e,n,r){super(e.length+n+r.length,e.height+r.height,n|(e.outdated||r.outdated?2:0)),this.left=e,this.right=r,this.size=e.size+r.size}get break(){return this.flags&1}blockAt(e,n,r,i){let s=r+this.left.height;return e<s?this.left.blockAt(e,n,r,i):this.right.blockAt(e,n,s,i+this.left.length+this.break)}lineAt(e,n,r,i,s){let a=i+this.left.height,u=s+this.left.length+this.break,f=n==En.ByHeight?e<a:e<u,d=f?this.left.lineAt(e,n,r,i,s):this.right.lineAt(e,n,r,a,u);if(this.break||(f?d.to<u:d.from>u))return d;let g=n==En.ByPosNoHeight?En.ByPosNoHeight:En.ByPos;return f?d.join(this.right.lineAt(u,g,r,a,u)):this.left.lineAt(u,g,r,i,s).join(d)}forEachLine(e,n,r,i,s,a){let u=i+this.left.height,f=s+this.left.length+this.break;if(this.break)e<f&&this.left.forEachLine(e,n,r,i,s,a),n>=f&&this.right.forEachLine(e,n,r,u,f,a);else{let d=this.lineAt(f,En.ByPos,r,i,s);e<d.from&&this.left.forEachLine(e,d.from-1,r,i,s,a),d.to>=e&&d.from<=n&&a(d),n>d.to&&this.right.forEachLine(d.to+1,n,r,u,f,a)}}replace(e,n,r){let i=this.left.length+this.break;if(n<i)return this.balanced(this.left.replace(e,n,r),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-i,n-i,r));let s=[];e>0&&this.decomposeLeft(e,s);let a=s.length;for(let u of r)s.push(u);if(e>0&&XO(s,a-1),n<this.length){let u=s.length;this.decomposeRight(n,s),XO(s,u)}return oi.of(s)}decomposeLeft(e,n){let r=this.left.length;if(e<=r)return this.left.decomposeLeft(e,n);n.push(this.left),this.break&&(r++,e>=r&&n.push(null)),e>r&&this.right.decomposeLeft(e-r,n)}decomposeRight(e,n){let r=this.left.length,i=r+this.break;if(e>=i)return this.right.decomposeRight(e-i,n);e<r&&this.left.decomposeRight(e,n),this.break&&e<i&&n.push(null),n.push(this.right)}balanced(e,n){return e.size>2*n.size||n.size>2*e.size?oi.of(this.break?[e,null,n]:[e,n]):(this.left=Jp(this.left,e),this.right=Jp(this.right,n),this.setHeight(e.height+n.height),this.outdated=e.outdated||n.outdated,this.size=e.size+n.size,this.length=e.length+this.break+n.length,this)}updateHeight(e,n=0,r=!1,i){let{left:s,right:a}=this,u=n+s.length+this.break,f=null;return i&&i.from<=n+s.length&&i.more?f=s=s.updateHeight(e,n,r,i):s.updateHeight(e,n,r),i&&i.from<=u+a.length&&i.more?f=a=a.updateHeight(e,u,r,i):a.updateHeight(e,u,r),f?this.balanced(s,a):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function XO(t,e){let n,r;t[e]==null&&(n=t[e-1])instanceof Ir&&(r=t[e+1])instanceof Ir&&t.splice(e-1,3,new Ir(n.length+1+r.length))}const XY=5;class b1{constructor(e,n){this.pos=e,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,n){if(this.lineStart>-1){let r=Math.min(n,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof ki?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new ki(r-this.pos,-1,0)),this.writtenTo=r,n>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(e,n,r){if(e<n||r.heightRelevant){let i=r.widget?r.widget.estimatedHeight:0,s=r.widget?r.widget.lineBreaks:0;i<0&&(i=this.oracle.lineHeight);let a=n-e;r.block?this.addBlock(new SL(a,i,r)):(a||s||i>=XY)&&this.addLineDeco(i,s,a)}else n>e&&this.span(e,n);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=n,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new ki(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,n){let r=new Ir(n-e);return this.oracle.doc.lineAt(e).to==n&&(r.flags|=4),r}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof ki)return e;let n=new ki(0,-1,0);return this.nodes.push(n),n}addBlock(e){this.enterLine();let n=e.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,n&&n.endSide>0&&(this.covering=e)}addLineDeco(e,n,r){let i=this.ensureLine();i.length+=r,i.collapsed+=r,i.widgetHeight=Math.max(i.widgetHeight,e),i.breaks+=n,this.writtenTo=this.pos=this.pos+r}finish(e){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof ki)&&!this.isCovered?this.nodes.push(new ki(0,-1,0)):(this.writtenTo<this.pos||n==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let r=e;for(let i of this.nodes)i instanceof ki&&i.updateHeight(this.oracle,r),r+=i?i.length:1;return this.nodes}static build(e,n,r,i){let s=new b1(r,e);return cn.spans(n,r,i,s,0),s.finish(r)}}function QY(t,e,n){let r=new ZY;return cn.compare(t,e,n,r,0),r.changes}class ZY{constructor(){this.changes=[]}compareRange(){}comparePoint(e,n,r,i){(e<n||r&&r.heightRelevant||i&&i.heightRelevant)&&dc(e,n,this.changes,5)}}function JY(t,e){let n=t.getBoundingClientRect(),r=t.ownerDocument,i=r.defaultView||window,s=Math.max(0,n.left),a=Math.min(i.innerWidth,n.right),u=Math.max(0,n.top),f=Math.min(i.innerHeight,n.bottom);for(let d=t.parentNode;d&&d!=r.body;)if(d.nodeType==1){let g=d,p=window.getComputedStyle(g);if((g.scrollHeight>g.clientHeight||g.scrollWidth>g.clientWidth)&&p.overflow!="visible"){let m=g.getBoundingClientRect();s=Math.max(s,m.left),a=Math.min(a,m.right),u=Math.max(u,m.top),f=Math.min(d==t.parentNode?i.innerHeight:f,m.bottom)}d=p.position=="absolute"||p.position=="fixed"?g.offsetParent:g.parentNode}else if(d.nodeType==11)d=d.host;else break;return{left:s-n.left,right:Math.max(s,a)-n.left,top:u-(n.top+e),bottom:Math.max(u,f)-(n.top+e)}}function eX(t){let e=t.getBoundingClientRect(),n=t.ownerDocument.defaultView||window;return e.left<n.innerWidth&&e.right>0&&e.top<n.innerHeight&&e.bottom>0}function tX(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class xb{constructor(e,n,r,i){this.from=e,this.to=n,this.size=r,this.displaySize=i}static same(e,n){if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++){let i=e[r],s=n[r];if(i.from!=s.from||i.to!=s.to||i.size!=s.size)return!1}return!0}draw(e,n){return Xr.replace({widget:new nX(this.displaySize*(n?e.scaleY:e.scaleX),n)}).range(this.from,this.to)}}class nX extends Qm{constructor(e,n){super(),this.size=e,this.vertical=n}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class QO{constructor(e,n){this.view=e,this.state=n,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=ZO,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=hr.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let r=n.facet(m1).some(i=>typeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new GY(r),this.stateDeco=JO(n),this.heightMap=oi.empty().applyChanges(this.stateDeco,qt.empty,this.heightOracle.setDoc(n.doc),[new ro(0,0,0,n.doc.length)]);for(let i=0;i<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());i++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Xr.set(this.lineGaps.map(i=>i.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let r=0;r<=1;r++){let i=r?n.head:n.anchor;if(!e.some(({from:s,to:a})=>i>=s&&i<=a)){let{from:s,to:a}=this.lineBlockAt(i);e.push(new Wg(s,a))}}return this.viewports=e.sort((r,i)=>r.from-i.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?ZO:new x1(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push($f(e,this.scaler))})}update(e,n=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=JO(this.state);let i=e.changedRanges,s=ro.extendWithRanges(i,QY(r,this.stateDeco,e?e.changes:vr.empty(this.state.doc.length))),a=this.heightMap.height,u=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);YO(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=a||Mc)&&(e.flags|=2),u?(this.scrollAnchorPos=e.changes.mapPos(u.from,-1),this.scrollAnchorHeight=u.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=a);let f=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(n&&(n.range.head<f.from||n.range.head>f.to)||!this.viewportIsAppropriate(f))&&(f=this.getViewport(0,n));let d=f.from!=this.viewport.from||f.to!=this.viewport.to;this.viewport=f,e.flags|=this.updateForViewport(),(d||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(WK)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,n=e.contentDOM,r=window.getComputedStyle(n),i=this.heightOracle,s=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?hr.RTL:hr.LTR;let a=this.heightOracle.mustRefreshForWrapping(s)||this.mustMeasureContent==="refresh",u=n.getBoundingClientRect(),f=a||this.mustMeasureContent||this.contentDOMHeight!=u.height;this.contentDOMHeight=u.height,this.mustMeasureContent=!1;let d=0,g=0;if(u.width&&u.height){let{scaleX:O,scaleY:P}=LN(n,u);(O>.005&&Math.abs(this.scaleX-O)>.005||P>.005&&Math.abs(this.scaleY-P)>.005)&&(this.scaleX=O,this.scaleY=P,d|=16,a=f=!0)}let p=(parseInt(r.paddingTop)||0)*this.scaleY,m=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=p||this.paddingBottom!=m)&&(this.paddingTop=p,this.paddingBottom=m,d|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(i.lineWrapping&&(f=!0),this.editorWidth=e.scrollDOM.clientWidth,d|=16);let v=BN(this.view.contentDOM,!1).y;v!=this.scrollParent&&(this.scrollParent=v,this.scrollAnchorHeight=-1,this.scrollOffset=0);let b=this.getScrollOffset();this.scrollOffset!=b&&(this.scrollAnchorHeight=-1,this.scrollOffset=b),this.scrolledToBottom=HN(this.scrollParent||e.win);let S=(this.printing?tX:JY)(n,this.paddingTop),w=S.top-this.pixelViewport.top,C=S.bottom-this.pixelViewport.bottom;this.pixelViewport=S;let R=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(R!=this.inView&&(this.inView=R,R&&(f=!0)),!this.inView&&!this.scrollTarget&&!eX(e.dom))return 0;let T=u.width;if((this.contentDOMWidth!=T||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=u.width,this.editorHeight=e.scrollDOM.clientHeight,d|=16),f){let O=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(O)&&(a=!0),a||i.lineWrapping&&Math.abs(T-this.contentDOMWidth)>i.charWidth){let{lineHeight:P,charWidth:M,textHeight:D}=e.docView.measureTextSize();a=P>0&&i.refresh(s,P,M,D,Math.max(5,T/M),O),a&&(e.docView.minWidth=0,d|=16)}w>0&&C>0?g=Math.max(w,C):w<0&&C<0&&(g=Math.min(w,C)),YO();for(let P of this.viewports){let M=P.from==this.viewport.from?O:e.docView.measureVisibleLineHeights(P);this.heightMap=(a?oi.empty().applyChanges(this.stateDeco,qt.empty,this.heightOracle,[new ro(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,a,new WY(P.from,M))}Mc&&(d|=2)}let A=!this.viewportIsAppropriate(this.viewport,g)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return A&&(d&2&&(d|=this.updateScaler()),this.viewport=this.getViewport(g,this.scrollTarget),d|=this.updateForViewport()),(d&2||A)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(a?[]:this.lineGaps,e)),d|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),d}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,n){let r=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),i=this.heightMap,s=this.heightOracle,{visibleTop:a,visibleBottom:u}=this,f=new Wg(i.lineAt(a-r*1e3,En.ByHeight,s,0,0).from,i.lineAt(u+(1-r)*1e3,En.ByHeight,s,0,0).to);if(n){let{head:d}=n.range;if(d<f.from||d>f.to){let g=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),p=i.lineAt(d,En.ByPos,s,0,0),m;n.y=="center"?m=(p.top+p.bottom)/2-g/2:n.y=="start"||n.y=="nearest"&&d<f.from?m=p.top:m=p.bottom-g,f=new Wg(i.lineAt(m-1e3/2,En.ByHeight,s,0,0).from,i.lineAt(m+g+1e3/2,En.ByHeight,s,0,0).to)}}return f}mapViewport(e,n){let r=n.mapPos(e.from,-1),i=n.mapPos(e.to,1);return new Wg(this.heightMap.lineAt(r,En.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(i,En.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:n},r=0){if(!this.inView)return!0;let{top:i}=this.heightMap.lineAt(e,En.ByPos,this.heightOracle,0,0),{bottom:s}=this.heightMap.lineAt(n,En.ByPos,this.heightOracle,0,0),{visibleTop:a,visibleBottom:u}=this;return(e==0||i<=a-Math.max(10,Math.min(-r,250)))&&(n==this.state.doc.length||s>=u+Math.max(10,Math.min(r,250)))&&i>a-2*1e3&&s<u+2*1e3}mapLineGaps(e,n){if(!e.length||n.empty)return e;let r=[];for(let i of e)n.touchesRange(i.from,i.to)||r.push(new xb(n.mapPos(i.from),n.mapPos(i.to),i.size,i.displaySize));return r}ensureLineGaps(e,n){let r=this.heightOracle.lineWrapping,i=r?1e4:2e3,s=i>>1,a=i<<1;if(this.defaultTextDirection!=hr.LTR&&!r)return[];let u=[],f=(g,p,m,v)=>{if(p-g<s)return;let b=this.state.selection.main,S=[b.from];b.empty||S.push(b.to);for(let C of S)if(C>g&&C<p){f(g,C-10,m,v),f(C+10,p,m,v);return}let w=iX(e,C=>C.from>=m.from&&C.to<=m.to&&Math.abs(C.from-g)<s&&Math.abs(C.to-p)<s&&!S.some(R=>C.from<R&&C.to>R));if(!w){if(p<m.to&&n&&r&&n.visibleRanges.some(T=>T.from<=p&&T.to>=p)){let T=n.moveToLineBoundary(Ae.cursor(p),!1,!0).head;T>g&&(p=T)}let C=this.gapSize(m,g,p,v),R=r||C<2e6?C:2e6;w=new xb(g,p,C,R)}u.push(w)},d=g=>{if(g.length<a||g.type!=lo.Text)return;let p=rX(g.from,g.to,this.stateDeco);if(p.total<a)return;let m=this.scrollTarget?this.scrollTarget.range.head:null,v,b;if(r){let S=i/this.heightOracle.lineLength*this.heightOracle.lineHeight,w,C;if(m!=null){let R=Yg(p,m),T=((this.visibleBottom-this.visibleTop)/2+S)/g.height;w=R-T,C=R+T}else w=(this.visibleTop-g.top-S)/g.height,C=(this.visibleBottom-g.top+S)/g.height;v=Kg(p,w),b=Kg(p,C)}else{let S=p.total*this.heightOracle.charWidth,w=i*this.heightOracle.charWidth,C=0;if(S>2e6)for(let P of e)P.from>=g.from&&P.from<g.to&&P.size!=P.displaySize&&P.from*this.heightOracle.charWidth+C<this.pixelViewport.left&&(C=P.size-P.displaySize);let R=this.pixelViewport.left+C,T=this.pixelViewport.right+C,A,O;if(m!=null){let P=Yg(p,m),M=((T-R)/2+w)/S;A=P-M,O=P+M}else A=(R-w)/S,O=(T+w)/S;v=Kg(p,A),b=Kg(p,O)}v>g.from&&f(g.from,v,g,p),b<g.to&&f(b,g.to,g,p)};for(let g of this.viewportLines)Array.isArray(g.type)?g.type.forEach(d):d(g);return u}gapSize(e,n,r,i){let s=Yg(i,r)-Yg(i,n);return this.heightOracle.lineWrapping?e.height*s:i.total*this.heightOracle.charWidth*s}updateLineGaps(e){xb.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=Xr.set(e.map(n=>n.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let r=[];cn.spans(n,this.viewport.from,this.viewport.to,{span(s,a){r.push({from:s,to:a})},point(){}},20);let i=0;if(r.length!=this.visibleRanges.length)i=12;else for(let s=0;s<r.length&&!(i&8);s++){let a=this.visibleRanges[s],u=r[s];(a.from!=u.from||a.to!=u.to)&&(i|=4,e&&e.mapPos(a.from,-1)==u.from&&e.mapPos(a.to,1)==u.to||(i|=8))}return this.visibleRanges=r,i}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(n=>n.from<=e&&n.to>=e)||$f(this.heightMap.lineAt(e,En.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=e&&n.bottom>=e)||$f(this.heightMap.lineAt(this.scaler.fromDOM(e),En.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(e){let n=this.lineBlockAtHeight(e+8);return n.from>=this.viewport.from||this.viewportLines[0].top-e>200?n:this.viewportLines[0]}elementAtHeight(e){return $f(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Wg{constructor(e,n){this.from=e,this.to=n}}function rX(t,e,n){let r=[],i=t,s=0;return cn.spans(n,t,e,{span(){},point(a,u){a>i&&(r.push({from:i,to:a}),s+=a-i),i=u}},20),i<e&&(r.push({from:i,to:e}),s+=e-i),{total:s,ranges:r}}function Kg({total:t,ranges:e},n){if(n<=0)return e[0].from;if(n>=1)return e[e.length-1].to;let r=Math.floor(t*n);for(let i=0;;i++){let{from:s,to:a}=e[i],u=a-s;if(r<=u)return s+r;r-=u}}function Yg(t,e){let n=0;for(let{from:r,to:i}of t.ranges){if(e<=i){n+=e-r;break}n+=i-r}return n/t.total}function iX(t,e){for(let n of t)if(e(n))return n}const ZO={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};function JO(t){let e=t.facet(Zm).filter(r=>typeof r!="function"),n=t.facet(y1).filter(r=>typeof r!="function");return n.length&&e.push(cn.join(n)),e}class x1{constructor(e,n,r){let i=0,s=0,a=0;this.viewports=r.map(({from:u,to:f})=>{let d=n.lineAt(u,En.ByPos,e,0,0).top,g=n.lineAt(f,En.ByPos,e,0,0).bottom;return i+=g-d,{from:u,to:f,top:d,bottom:g,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(n.height-i);for(let u of this.viewports)u.domTop=a+(u.top-s)*this.scale,a=u.domBottom=u.domTop+(u.bottom-u.top),s=u.bottom}toDOM(e){for(let n=0,r=0,i=0;;n++){let s=n<this.viewports.length?this.viewports[n]:null;if(!s||e<s.top)return i+(e-r)*this.scale;if(e<=s.bottom)return s.domTop+(e-s.top);r=s.bottom,i=s.domBottom}}fromDOM(e){for(let n=0,r=0,i=0;;n++){let s=n<this.viewports.length?this.viewports[n]:null;if(!s||e<s.domTop)return r+(e-i)/this.scale;if(e<=s.domBottom)return s.top+(e-s.domTop);r=s.bottom,i=s.domBottom}}eq(e){return e instanceof x1?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((n,r)=>n.from==e.viewports[r].from&&n.to==e.viewports[r].to):!1}}function $f(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),r=e.toDOM(t.bottom);return new Mo(t.from,t.length,n,r-n,Array.isArray(t._content)?t._content.map(i=>$f(i,e)):t._content)}const Xg=mt.define({combine:t=>t.join(" ")}),mS=mt.define({combine:t=>t.indexOf(!0)>-1}),yS=Rc.newName(),wL=Rc.newName(),CL=Rc.newName(),RL={"&light":"."+wL,"&dark":"."+CL};function vS(t,e,n){return new Rc(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,i=>{if(i=="&")return t;if(!n||!n[i])throw new RangeError(`Unsupported selector: ${i}`);return n[i]}):t+" "+r}})}const oX=vS("."+yS,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},RL),sX={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Sb=$e.ie&&$e.ie_version<=11;class lX{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new NK,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(n=>{for(let r of n)this.queue.push(r);($e.ie&&$e.ie_version<=11||$e.ios&&e.composing)&&n.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&$e.android&&e.constructor.EDIT_CONTEXT!==!1&&!($e.chrome&&$e.chrome_version<126)&&(this.editContext=new uX(e),e.state.facet(Ws)&&(e.contentDOM.editContext=this.editContext.editContext)),Sb&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(n=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((n,r)=>n!=e[r]))){this.gapIntersection.disconnect();for(let n of e)this.gapIntersection.observe(n);this.gaps=e}}onSelectionChange(e){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,i=this.selectionRange;if(r.state.facet(Ws)?r.root.activeElement!=this.dom:!rd(this.dom,i))return;let s=i.anchorNode&&r.docView.tile.nearest(i.anchorNode);if(s&&s.isWidget()&&s.widget.ignoreEvent(e)){n||(this.selectionChanged=!1);return}($e.ie&&$e.ie_version<=11||$e.android&&$e.chrome)&&!r.state.selection.main.empty&&i.focusNode&&id(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=Id(e.root);if(!n)return!1;let r=$e.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&aX(this.view,n)||n;if(!r||this.selectionRange.eq(r))return!1;let i=rd(this.dom,r);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&BK(this.dom,r)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(r),i&&(this.selectionChanged=!0),!0)}setSelectionRange(e,n){this.selectionRange.set(e.node,e.offset,n.node,n.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,n=null;for(let r=this.dom;r;)if(r.nodeType==1)!n&&e<this.scrollTargets.length&&this.scrollTargets[e]==r?e++:n||(n=this.scrollTargets.slice(0,e)),n&&n.push(r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;if(e<this.scrollTargets.length&&!n&&(n=this.scrollTargets.slice(0,e)),n){for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);for(let r of this.scrollTargets=n)r.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,sX),Sb&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Sb&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,n){var r;if(!this.delayedAndroidKey){let i=()=>{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&hc(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:n,force:this.lastChange<Date.now()-50||!!(!((r=this.delayedAndroidKey)===null||r===void 0)&&r.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let n=-1,r=-1,i=!1;for(let s of e){let a=this.readMutation(s);a&&(a.typeOver&&(i=!0),n==-1?{from:n,to:r}=a:(n=Math.min(a.from,n),r=Math.max(a.to,r)))}return{from:n,to:r,typeOver:i}}readChange(){let{from:e,to:n,typeOver:r}=this.processRecords(),i=this.selectionChanged&&rd(this.dom,this.selectionRange);if(e<0&&!i)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new TY(this.view,e,n,r);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let r=this.view.state,i=fL(this.view,n);return this.view.state==r&&(n.domChanged||n.newSel&&!Zp(this.view.state.selection,n.newSel.main))&&this.view.update([]),i}readMutation(e){let n=this.view.docView.tile.nearest(e.target);if(!n||n.isWidget())return null;if(n.markDirty(e.type=="attributes"),e.type=="childList"){let r=ek(n,e.previousSibling||e.target.previousSibling,-1),i=ek(n,e.nextSibling||e.target.nextSibling,1);return{from:r?n.posAfter(r):n.posAtStart,to:i?n.posBefore(i):n.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(Ws)!=e.state.facet(Ws)&&(e.view.contentDOM.editContext=e.state.facet(Ws)?this.editContext.editContext:null))}destroy(){var e,n,r;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function ek(t,e,n){for(;e;){let r=Xn.get(e);if(r&&r.parent==t)return r;let i=e.parentNode;e=i!=t.dom?i:n>0?e.nextSibling:e.previousSibling}return null}function tk(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,s=e.endOffset,a=t.docView.domAtPos(t.state.selection.main.anchor,1);return id(a.node,a.offset,i,s)&&([n,r,i,s]=[i,s,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}}function aX(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return tk(t,i)}let n=null;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",r,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",r,!0),n?tk(t,n):null}class uX{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let n=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=r=>{let i=e.state.selection.main,{anchor:s,head:a}=i,u=this.toEditorPos(r.updateRangeStart),f=this.toEditorPos(r.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:r.updateRangeStart,editorBase:u,drifted:!1});let d=f-u>r.text.length;u==this.from&&s<this.from?u=s:f==this.to&&s>this.to&&(f=s);let g=dL(e.state.sliceDoc(u,f),r.text,(d?i.from:i.to)-u,d?"end":null);if(!g){let m=Ae.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd));Zp(m,i)||e.dispatch({selection:m,userEvent:"select"});return}let p={from:g.from+u,to:g.toA+u,insert:qt.of(r.text.slice(g.from,g.toB).split(`
30
- `))};if(($e.mac||$e.android)&&p.from==a-1&&/^\. ?$/.test(r.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(p={from:u,to:f,insert:qt.of([r.text.replace("."," ")])}),this.pendingContextChange=p,!e.state.readOnly){let m=this.to-this.from+(p.to-p.from+p.insert.length);v1(e,p,Ae.single(this.toEditorPos(r.selectionStart,m),this.toEditorPos(r.selectionEnd,m)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),p.from<p.to&&!p.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,r.updateRangeStart-1),Math.min(n.text.length,r.updateRangeStart+1)))&&this.handlers.compositionend(r)},this.handlers.characterboundsupdate=r=>{let i=[],s=null;for(let a=this.toEditorPos(r.rangeStart),u=this.toEditorPos(r.rangeEnd);a<u;a++){let f=e.coordsForChar(a);s=f&&new DOMRect(f.left,f.top,f.right-f.left,f.bottom-f.top)||s||new DOMRect,i.push(s)}n.updateCharacterBounds(r.rangeStart,i)},this.handlers.textformatupdate=r=>{let i=[];for(let s of r.getTextFormats()){let a=s.underlineStyle,u=s.underlineThickness;if(!/none/i.test(a)&&!/none/i.test(u)){let f=this.toEditorPos(s.rangeStart),d=this.toEditorPos(s.rangeEnd);if(f<d){let g=`text-decoration: underline ${/^[a-z]/.test(a)?a+" ":a=="Dashed"?"dashed ":a=="Squiggle"?"wavy ":""}${/thin/i.test(u)?1:2}px`;i.push(Xr.mark({attributes:{style:g}}).range(f,d))}}}e.dispatch({effects:tL.of(Xr.set(i))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:r}=this.composing;this.composing=null,r&&this.reset(e.state)}};for(let r in this.handlers)n.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let i=Id(r.root);i&&i.rangeCount&&this.editContext.updateSelectionBounds(i.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let n=0,r=!1,i=this.pendingContextChange;return e.changes.iterChanges((s,a,u,f,d)=>{if(r)return;let g=d.length-(a-s);if(i&&a>=i.to)if(i.from==s&&i.to==a&&i.insert.eq(d)){i=this.pendingContextChange=null,n+=g,this.to+=g;return}else i=null,this.revertPending(e.state);if(s+=n,a+=n,a<=this.from)this.from+=g,this.to+=g;else if(s<this.to){if(s<this.from||a>this.to||this.to-this.from+d.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(a),d.toString()),this.to+=g}n+=g}),i&&!r&&this.revertPending(e.state),!r}update(e){let n=this.pendingContextChange,r=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(r.from,r.to)&&e.transactions.some(i=>!i.isUserEvent("input.type")&&i.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||n)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:n}=e.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(e.doc.length,n+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),e.doc.sliceString(n.from,n.to))}setSelection(e){let{main:n}=e.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),i=this.toContextPos(n.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=i)&&this.editContext.updateSelection(r,i)}rangeIsValid(e){let{head:n}=e.selection.main;return!(this.from>0&&n-this.from<500||this.to<e.doc.length&&this.to-n<500||this.to-this.from>1e4*3)}toEditorPos(e,n=this.to-this.from){e=Math.min(e,n);let r=this.composing;return r&&r.drifted?r.editorBase+(e-r.contextBase):e+this.from}toContextPos(e){let n=this.composing;return n&&n.drifted?n.contextBase+(e-n.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class wt{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:r}=e;this.dispatchTransactions=e.dispatchTransactions||r&&(i=>i.forEach(s=>r(s,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=e.root||LK(e.parent)||document,this.viewState=new QO(this,e.state||on.create(e)),e.scrollTo&&e.scrollTo.is($g)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(rc).map(i=>new pb(i));for(let i of this.plugins)i.update(this);this.observer=new lX(this),this.inputState=new kY(this),this.inputState.ensureHandlers(this.plugins),this.docView=new _O(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let n=e.length==1&&e[0]instanceof xr?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(n,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,r=!1,i,s=this.state;for(let m of e){if(m.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=m.state}if(this.destroyed){this.viewState.state=s;return}let a=this.hasFocus,u=0,f=null;e.some(m=>m.annotation(vL))?(this.inputState.notifiedFocused=a,u=1):a!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=a,f=bL(s,a),f||(u=1));let d=this.observer.delayedAndroidKey,g=null;if(d?(this.observer.clearDelayedAndroidKey(),g=this.observer.readChange(),(g&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(g=null)):this.observer.clear(),s.facet(on.phrases)!=this.state.facet(on.phrases))return this.setState(s);i=Yp.create(this,s,e),i.flags|=u;let p=this.viewState.scrollTarget;try{this.updateState=2;for(let m of e){if(p&&(p=p.map(m.changes)),m.scrollIntoView){let{main:v}=m.state.selection;p=new gc(v.empty?v:Ae.cursor(v.head,v.head>v.anchor?-1:1))}for(let v of m.effects)v.is($g)&&(p=v.value.clip(this.state))}this.viewState.update(i,p),this.bidiCache=em.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet(Uf)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(m=>m.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(Xg)!=i.state.facet(Xg)&&(this.viewState.mustMeasureContent=!0),(n||r||p||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!i.empty)for(let m of this.state.facet(dS))try{m(i)}catch(v){hs(this.state,v,"update listener")}(f||g)&&Promise.resolve().then(()=>{f&&this.state==f.startState&&this.dispatch(f),g&&!fL(this,g)&&d.force&&hc(this.contentDOM,d.key,d.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let n=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new QO(this,e),this.plugins=e.facet(rc).map(r=>new pb(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new _O(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(e){let n=e.startState.facet(rc),r=e.state.facet(rc);if(n!=r){let i=[];for(let s of r){let a=n.indexOf(s);if(a<0)i.push(new pb(s));else{let u=this.plugins[a];u.mustUpdate=e,i.push(u)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let i of this.plugins)i.mustUpdate=e;for(let i=0;i<this.plugins.length;i++)this.plugins[i].update(this);n!=r&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let n=e.value;if(n&&n.docViewUpdate)try{n.docViewUpdate(this)}catch(r){hs(this.state,r,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let n=null,r=this.viewState.scrollParent,i=this.viewState.getScrollOffset(),{scrollAnchorPos:s,scrollAnchorHeight:a}=this.viewState;Math.abs(i-this.viewState.scrollOffset)>1&&(a=-1),this.viewState.scrollAnchorHeight=-1;try{for(let u=0;;u++){if(a<0)if(HN(r||this.win))s=-1,a=this.viewState.heightMap.height;else{let v=this.viewState.scrollAnchorAt(i);s=v.from,a=v.top}this.updateState=1;let f=this.viewState.measure();if(!f&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(u>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let d=[];f&4||([this.measureRequests,d]=[d,this.measureRequests]);let g=d.map(v=>{try{return v.read(this)}catch(b){return hs(this.state,b),nk}}),p=Yp.create(this,this.state,[]),m=!1;p.flags|=f,n?n.flags|=f:n=p,this.updateState=2,p.empty||(this.updatePlugins(p),this.inputState.update(p),this.updateAttrs(),m=this.docView.update(p),m&&this.docViewUpdate());for(let v=0;v<d.length;v++)if(g[v]!=nk)try{let b=d[v];b.write&&b.write(g[v],this)}catch(b){hs(this.state,b)}if(m&&this.docView.updateSelection(!0),!p.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,a=-1;continue}else{let b=((s<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(s).top)-a)/this.scaleY;if((b>1||b<-1)&&(r==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){i=i+b,r?r.scrollTop+=b:this.win.scrollBy(0,b),a=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let u of this.state.facet(dS))u(n)}get themeClasses(){return yS+" "+(this.state.facet(mS)?CL:wL)+" "+this.state.facet(Xg)}updateAttrs(){let e=rk(this,nL,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Ws)?"true":"false",class:"cm-content",style:`${$e.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),rk(this,m1,n);let r=this.observer.ignore(()=>{let i=DO(this.contentDOM,this.contentAttrs,n),s=DO(this.dom,this.editorAttrs,e);return i||s});return this.editorAttrs=e,this.contentAttrs=n,r}showAnnouncements(e){let n=!0;for(let r of e)for(let i of r.effects)if(i.is(wt.announce)){n&&(this.announceDOM.textContent=""),n=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(Uf);let e=this.state.facet(wt.cspNonce);Rc.mount(this.root,this.styleModules.concat(oX).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let n=0;n<this.measureRequests.length;n++)if(this.measureRequests[n].key===e.key){this.measureRequests[n]=e;return}}this.measureRequests.push(e)}}plugin(e){let n=this.pluginMap.get(e);return(n===void 0||n&&n.plugin!=e)&&this.pluginMap.set(e,n=this.plugins.find(r=>r.plugin==e)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,n,r){return bb(this,e,HO(this,e,n,r))}moveByGroup(e,n){return bb(this,e,HO(this,e,n,r=>xY(this,e.head,r)))}visualLineSide(e,n){let r=this.bidiSpans(e),i=this.textDirectionAt(e.from),s=r[n?r.length-1:0];return Ae.cursor(s.side(n,i)+e.from,s.forward(!n,i)?1:-1)}moveToLineBoundary(e,n,r=!0){return bY(this,e,n,r)}moveVertically(e,n,r){return bb(this,e,SY(this,e,n,r))}domAtPos(e,n=1){return this.docView.domAtPos(e,n)}posAtDOM(e,n=0){return this.docView.posFromDOM(e,n)}posAtCoords(e,n=!0){this.readMeasured();let r=gS(this,e,n);return r&&r.pos}posAndSideAtCoords(e,n=!0){return this.readMeasured(),gS(this,e,n)}coordsAtPos(e,n=1){this.readMeasured();let r=this.docView.coordsAt(e,n);if(!r||r.left==r.right)return r;let i=this.state.doc.lineAt(e),s=this.bidiSpans(i),a=s[ds.find(s,e-i.from,-1,n)];return Kp(r,a.dir==hr.LTR==n>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(JN)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>cX)return qN(e.length);let n=this.textDirectionAt(e.from),r;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==n&&(s.fresh||$N(s.isolates,r=NO(this,e))))return s.order;r||(r=NO(this,e));let i=$K(e.text,n,r);return this.bidiCache.push(new em(e.from,e.to,n,r,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||$e.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{_N(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,n={}){return $g.of(new gc(typeof e=="number"?Ae.cursor(e):e,n.y,n.x,n.yMargin,n.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:n}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return $g.of(new gc(Ae.cursor(r.from),"start","start",r.top-e,n,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return Ec.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Ec.define(()=>({}),{eventObservers:e})}static theme(e,n){let r=Rc.newName(),i=[Xg.of(r),Uf.of(vS(`.${r}`,e))];return n&&n.dark&&i.push(mS.of(!0)),i}static baseTheme(e){return wN.lowest(Uf.of(vS("."+yS,e,RL)))}static findFromDOM(e){var n;let r=e.querySelector(".cm-content"),i=r&&Xn.get(r)||Xn.get(e);return((n=i?.root)===null||n===void 0?void 0:n.view)||null}}wt.styleModule=Uf;wt.inputHandler=QN;wt.clipboardInputFilter=g1;wt.clipboardOutputFilter=p1;wt.scrollHandler=eL;wt.focusChangeEffect=ZN;wt.perLineTextDirection=JN;wt.exceptionSink=XN;wt.updateListener=dS;wt.editable=Ws;wt.mouseSelectionStyle=YN;wt.dragMovesSelection=KN;wt.clickAddsSelectionRange=WN;wt.decorations=Zm;wt.blockWrappers=rL;wt.outerDecorations=y1;wt.atomicRanges=Xd;wt.bidiIsolatedRanges=iL;wt.scrollMargins=oL;wt.darkTheme=mS;wt.cspNonce=mt.define({combine:t=>t.length?t[0]:""});wt.contentAttributes=m1;wt.editorAttributes=nL;wt.lineWrapping=wt.contentAttributes.of({class:"cm-lineWrapping"});wt.announce=ir.define();const cX=4096,nk={};class em{constructor(e,n,r,i,s,a){this.from=e,this.to=n,this.dir=r,this.isolates=i,this.fresh=s,this.order=a}static update(e,n){if(n.empty&&!e.some(s=>s.fresh))return e;let r=[],i=e.length?e[e.length-1].dir:hr.LTR;for(let s=Math.max(0,e.length-10);s<e.length;s++){let a=e[s];a.dir==i&&!n.touchesRange(a.from,a.to)&&r.push(new em(n.mapPos(a.from,1),n.mapPos(a.to,-1),a.dir,a.isolates,!1,a.order))}return r}}function rk(t,e,n){for(let r=t.state.facet(e),i=r.length-1;i>=0;i--){let s=r[i],a=typeof s=="function"?s(t):s;a&&f1(a,n)}return n}const fX=$e.mac?"mac":$e.windows?"win":$e.linux?"linux":"key";function dX(t,e){const n=t.split(/-(?!$)/);let r=n[n.length-1];r=="Space"&&(r=" ");let i,s,a,u;for(let f=0;f<n.length-1;++f){const d=n[f];if(/^(cmd|meta|m)$/i.test(d))u=!0;else if(/^a(lt)?$/i.test(d))i=!0;else if(/^(c|ctrl|control)$/i.test(d))s=!0;else if(/^s(hift)?$/i.test(d))a=!0;else if(/^mod$/i.test(d))e=="mac"?u=!0:s=!0;else throw new Error("Unrecognized modifier name: "+d)}return i&&(r="Alt-"+r),s&&(r="Ctrl-"+r),u&&(r="Meta-"+r),a&&(r="Shift-"+r),r}function Qg(t,e,n){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n!==!1&&e.shiftKey&&(t="Shift-"+t),t}const hX=wN.default(wt.domEventHandlers({keydown(t,e){return yX(gX(e.state),t,e,"editor")}})),EL=mt.define({enables:hX}),ik=new WeakMap;function gX(t){let e=t.facet(EL),n=ik.get(e);return n||ik.set(e,n=mX(e.reduce((r,i)=>r.concat(i),[]))),n}let Kl=null;const pX=4e3;function mX(t,e=fX){let n=Object.create(null),r=Object.create(null),i=(a,u)=>{let f=r[a];if(f==null)r[a]=u;else if(f!=u)throw new Error("Key binding "+a+" is used both as a regular binding and as a multi-stroke prefix")},s=(a,u,f,d,g)=>{var p,m;let v=n[a]||(n[a]=Object.create(null)),b=u.split(/ (?!$)/).map(C=>dX(C,e));for(let C=1;C<b.length;C++){let R=b.slice(0,C).join(" ");i(R,!0),v[R]||(v[R]={preventDefault:!0,stopPropagation:!1,run:[T=>{let A=Kl={view:T,prefix:R,scope:a};return setTimeout(()=>{Kl==A&&(Kl=null)},pX),!0}]})}let S=b.join(" ");i(S,!1);let w=v[S]||(v[S]={preventDefault:!1,stopPropagation:!1,run:((m=(p=v._any)===null||p===void 0?void 0:p.run)===null||m===void 0?void 0:m.slice())||[]});f&&w.run.push(f),d&&(w.preventDefault=!0),g&&(w.stopPropagation=!0)};for(let a of t){let u=a.scope?a.scope.split(" "):["editor"];if(a.any)for(let d of u){let g=n[d]||(n[d]=Object.create(null));g._any||(g._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:p}=a;for(let m in g)g[m].run.push(v=>p(v,bS))}let f=a[e]||a.key;if(f)for(let d of u)s(d,f,a.run,a.preventDefault,a.stopPropagation),a.shift&&s(d,"Shift-"+f,a.shift,a.preventDefault,a.stopPropagation)}return n}let bS=null;function yX(t,e,n,r){bS=e;let i=MK(e),s=uK(i,0),a=cK(s)==i.length&&i!=" ",u="",f=!1,d=!1,g=!1;Kl&&Kl.view==n&&Kl.scope==r&&(u=Kl.prefix+" ",gL.indexOf(e.keyCode)<0&&(d=!0,Kl=null));let p=new Set,m=w=>{if(w){for(let C of w.run)if(!p.has(C)&&(p.add(C),C(n)))return w.stopPropagation&&(g=!0),!0;w.preventDefault&&(w.stopPropagation&&(g=!0),d=!0)}return!1},v=t[r],b,S;return v&&(m(v[u+Qg(i,e,!a)])?f=!0:a&&(e.altKey||e.metaKey||e.ctrlKey)&&!($e.windows&&e.ctrlKey&&e.altKey)&&!($e.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(b=ua[e.keyCode])&&b!=i?(m(v[u+Qg(b,e,!0)])||e.shiftKey&&(S=Od[e.keyCode])!=i&&S!=b&&m(v[u+Qg(S,e,!1)]))&&(f=!0):a&&e.shiftKey&&m(v[u+Qg(i,e,!0)])&&(f=!0),!f&&m(v._any)&&(f=!0)),d&&(f=!0),f&&g&&e.stopPropagation(),bS=null,f}class Oc extends uu{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Oc.prototype.elementClass="";Oc.prototype.toDOM=void 0;Oc.prototype.mapMode=Di.TrackBefore;Oc.prototype.startSide=Oc.prototype.endSide=-1;Oc.prototype.point=!0;const vX=1024;let bX=0;class wb{constructor(e,n){this.from=e,this.to=n}}class Gt{constructor(e={}){this.id=bX++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=co.match(e)),n=>{let r=e(n);return r===void 0?null:[this,r]}}}Gt.closedBy=new Gt({deserialize:t=>t.split(" ")});Gt.openedBy=new Gt({deserialize:t=>t.split(" ")});Gt.group=new Gt({deserialize:t=>t.split(" ")});Gt.isolate=new Gt({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});Gt.contextHash=new Gt({perNode:!0});Gt.lookAhead=new Gt({perNode:!0});Gt.mounted=new Gt({perNode:!0});class sd{constructor(e,n,r,i=!1){this.tree=e,this.overlay=n,this.parser=r,this.bracketed=i}static get(e){return e&&e.props&&e.props[Gt.mounted.id]}}const xX=Object.create(null);class co{constructor(e,n,r,i=0){this.name=e,this.props=n,this.id=r,this.flags=i}static define(e){let n=e.props&&e.props.length?Object.create(null):xX,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new co(e.name||"",n,e.id,r);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(i)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[s[0].id]=s[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let n=this.prop(Gt.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let r in e)for(let i of r.split(" "))n[i]=e[r];return r=>{for(let i=r.prop(Gt.group),s=-1;s<(i?i.length:0);s++){let a=n[s<0?r.name:i[s]];if(a)return a}}}}co.none=new co("",Object.create(null),0,8);const Zg=new WeakMap,ok=new WeakMap;var rr;(function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays",t[t.EnterBracketed=16]="EnterBracketed"})(rr||(rr={}));class Nr{constructor(e,n,r,i,s){if(this.type=e,this.children=n,this.positions=r,this.length=i,this.props=null,s&&s.length){this.props=Object.create(null);for(let[a,u]of s)this.props[typeof a=="number"?a:a.id]=u}}toString(){let e=sd.get(this);if(e&&!e.overlay)return e.tree.toString();let n="";for(let r of this.children){let i=r.toString();i&&(n&&(n+=","),n+=i)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(n.length?"("+n+")":""):n}cursor(e=0){return new SS(this.topNode,e)}cursorAt(e,n=0,r=0){let i=Zg.get(this)||this.topNode,s=new SS(i);return s.moveTo(e,n),Zg.set(this,s._tree),s}get topNode(){return new ao(this,0,0,null)}resolve(e,n=0){let r=Pd(Zg.get(this)||this.topNode,e,n,!1);return Zg.set(this,r),r}resolveInner(e,n=0){let r=Pd(ok.get(this)||this.topNode,e,n,!0);return ok.set(this,r),r}resolveStack(e,n=0){return CX(this,e,n)}iterate(e){let{enter:n,leave:r,from:i=0,to:s=this.length}=e,a=e.mode||0,u=(a&rr.IncludeAnonymous)>0;for(let f=this.cursor(a|rr.IncludeAnonymous);;){let d=!1;if(f.from<=s&&f.to>=i&&(!u&&f.type.isAnonymous||n(f)!==!1)){if(f.firstChild())continue;d=!0}for(;d&&r&&(u||!f.type.isAnonymous)&&r(f),!f.nextSibling();){if(!f.parent())return;d=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let n in this.props)e.push([+n,this.props[n]]);return e}balance(e={}){return this.children.length<=8?this:C1(co.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,i)=>new Nr(this.type,n,r,i,this.propValues),e.makeTree||((n,r,i)=>new Nr(co.none,n,r,i)))}static build(e){return RX(e)}}Nr.empty=new Nr(co.none,[],[],0);class S1{constructor(e,n){this.buffer=e,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new S1(this.buffer,this.index)}}class fa{constructor(e,n,r){this.buffer=e,this.length=n,this.set=r}get type(){return co.none}toString(){let e=[];for(let n=0;n<this.buffer.length;)e.push(this.childString(n)),n=this.buffer[n+3];return e.join(",")}childString(e){let n=this.buffer[e],r=this.buffer[e+3],i=this.set.types[n],s=i.name;if(/\W/.test(s)&&!i.isError&&(s=JSON.stringify(s)),e+=4,r==e)return s;let a=[];for(;e<r;)a.push(this.childString(e)),e=this.buffer[e+3];return s+"("+a.join(",")+")"}findChild(e,n,r,i,s){let{buffer:a}=this,u=-1;for(let f=e;f!=n&&!(TL(s,i,a[f+1],a[f+2])&&(u=f,r>0));f=a[f+3]);return u}slice(e,n,r){let i=this.buffer,s=new Uint16Array(n-e),a=0;for(let u=e,f=0;u<n;){s[f++]=i[u++],s[f++]=i[u++]-r;let d=s[f++]=i[u++]-r;s[f++]=i[u++]-e,a=Math.max(a,d)}return new fa(s,a,this.set)}}function TL(t,e,n,r){switch(t){case-2:return n<e;case-1:return r>=e&&n<e;case 0:return n<e&&r>e;case 1:return n<=e&&r>e;case 2:return r>e;case 4:return!0}}function Pd(t,e,n,r){for(var i;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to<e);){let a=!r&&t instanceof ao&&t.index<0?null:t.parent;if(!a)return t;t=a}let s=r?0:rr.IgnoreOverlays;if(r)for(let a=t,u=a.parent;u;a=u,u=a.parent)a instanceof ao&&a.index<0&&((i=u.enter(e,n,s))===null||i===void 0?void 0:i.from)!=a.from&&(t=u);for(;;){let a=t.enter(e,n,s);if(!a)return t;t=a}}class AL{cursor(e=0){return new SS(this,e)}getChild(e,n=null,r=null){let i=sk(this,e,n,r);return i.length?i[0]:null}getChildren(e,n=null,r=null){return sk(this,e,n,r)}resolve(e,n=0){return Pd(this,e,n,!1)}resolveInner(e,n=0){return Pd(this,e,n,!0)}matchContext(e){return xS(this.parent,e)}enterUnfinishedNodesBefore(e){let n=this.childBefore(e),r=this;for(;n;){let i=n.lastChild;if(!i||i.to!=n.to)break;i.type.isError&&i.from==i.to?(r=n,n=i.prevSibling):n=i}return r}get node(){return this}get next(){return this.parent}}class ao extends AL{constructor(e,n,r,i){super(),this._tree=e,this.from=n,this.index=r,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,n,r,i,s=0){for(let a=this;;){for(let{children:u,positions:f}=a._tree,d=n>0?u.length:-1;e!=d;e+=n){let g=u[e],p=f[e]+a.from,m;if(!(!(s&rr.EnterBracketed&&g instanceof Nr&&(m=sd.get(g))&&!m.overlay&&m.bracketed&&r>=p&&r<=p+g.length)&&!TL(i,r,p,p+g.length))){if(g instanceof fa){if(s&rr.ExcludeBuffers)continue;let v=g.findChild(0,g.buffer.length,n,r-p,i);if(v>-1)return new Zl(new SX(a,g,e,p),null,v)}else if(s&rr.IncludeAnonymous||!g.type.isAnonymous||w1(g)){let v;if(!(s&rr.IgnoreMounts)&&(v=sd.get(g))&&!v.overlay)return new ao(v.tree,p,e,a);let b=new ao(g,p,e,a);return s&rr.IncludeAnonymous||!b.type.isAnonymous?b:b.nextChild(n<0?g.children.length-1:0,n,r,i,s)}}}if(s&rr.IncludeAnonymous||!a.type.isAnonymous||(a.index>=0?e=a.index+n:e=n<0?-1:a._parent._tree.children.length,a=a._parent,!a))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,n,r=0){let i;if(!(r&rr.IgnoreOverlays)&&(i=sd.get(this._tree))&&i.overlay){let s=e-this.from,a=r&rr.EnterBracketed&&i.bracketed;for(let{from:u,to:f}of i.overlay)if((n>0||a?u<=s:u<s)&&(n<0||a?f>=s:f>s))return new ao(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function sk(t,e,n,r){let i=t.cursor(),s=[];if(!i.firstChild())return s;if(n!=null){for(let a=!1;!a;)if(a=i.type.is(n),!i.nextSibling())return s}for(;;){if(r!=null&&i.type.is(r))return s;if(i.type.is(e)&&s.push(i.node),!i.nextSibling())return r==null?s:[]}}function xS(t,e,n=e.length-1){for(let r=t;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[n]&&e[n]!=r.name)return!1;n--}}return!0}class SX{constructor(e,n,r,i){this.parent=e,this.buffer=n,this.index=r,this.start=i}}class Zl extends AL{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,n,r){super(),this.context=e,this._parent=n,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,n,r){let{buffer:i}=this.context,s=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.context.start,r);return s<0?null:new Zl(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,n,r=0){if(r&rr.ExcludeBuffers)return null;let{buffer:i}=this.context,s=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return s<0?null:new Zl(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new Zl(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new Zl(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:r}=this.context,i=this.index+4,s=r.buffer[this.index+3];if(s>i){let a=r.buffer[this.index+1];e.push(r.slice(i,s,a)),n.push(0)}return new Nr(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function ML(t){if(!t.length)return null;let e=0,n=t[0];for(let s=1;s<t.length;s++){let a=t[s];(a.from>n.from||a.to<n.to)&&(n=a,e=s)}let r=n instanceof ao&&n.index<0?null:n.parent,i=t.slice();return r?i[e]=r:i.splice(e,1),new wX(i,n)}class wX{constructor(e,n){this.heads=e,this.node=n}get next(){return ML(this.heads)}}function CX(t,e,n){let r=t.resolveInner(e,n),i=null;for(let s=r instanceof ao?r:r.context.parent;s;s=s.parent)if(s.index<0){let a=s.parent;(i||(i=[r])).push(a.resolve(e,n)),s=a}else{let a=sd.get(s.tree);if(a&&a.overlay&&a.overlay[0].from<=e&&a.overlay[a.overlay.length-1].to>=e){let u=new ao(a.tree,a.overlay[0].from+s.from,-1,s);(i||(i=[r])).push(Pd(u,e,n,!1))}}return i?ML(i):r}class SS{get name(){return this.type.name}constructor(e,n=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=n&~rr.EnterBracketed,e instanceof ao)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:r,buffer:i}=this.buffer;return this.type=n||i.set.types[i.buffer[e]],this.from=r+i.buffer[e+1],this.to=r+i.buffer[e+2],!0}yield(e){return e?e instanceof ao?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,n,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,r,this.mode));let{buffer:i}=this.buffer,s=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.buffer.start,r);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,r=this.mode){return this.buffer?r&rr.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&rr.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&rr.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:n}=this.buffer,r=this.stack.length-1;if(e<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(n.findChild(i,this.index,-1,0,4))}else{let i=n.buffer[this.index+3];if(i<(r<0?n.buffer.length:n.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,r,{buffer:i}=this;if(i){if(e>0){if(this.index<i.buffer.buffer.length)return!1}else for(let s=0;s<this.index;s++)if(i.buffer.buffer[s+3]<this.index)return!1;({index:n,parent:r}=i)}else({index:n,_parent:r}=this._tree);for(;r;{index:n,_parent:r}=r)if(n>-1)for(let s=n+e,a=e<0?-1:r._tree.children.length;s!=a;s+=e){let u=r._tree.children[s];if(this.mode&rr.IncludeAnonymous||u instanceof fa||!u.type.isAnonymous||w1(u))return!1}return!0}move(e,n){if(n&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,n=0){for(;(this.from==this.to||(n<1?this.from>=e:this.from>e)||(n>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,n););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,n=null,r=0;if(e&&e.context==this.buffer)e:for(let i=this.index,s=this.stack.length;s>=0;){for(let a=e;a;a=a._parent)if(a.index==i){if(i==this.index)return a;n=a,r=s+1;break e}i=this.stack[--s]}for(let i=r;i<this.stack.length;i++)n=new Zl(this.buffer,n,this.stack[i]);return this.bufferNode=new Zl(this.buffer,n,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,n){for(let r=0;;){let i=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){r++;continue}this.type.isAnonymous||(i=!0)}for(;;){if(i&&n&&n(this),i=this.type.isAnonymous,!r)return;if(this.nextSibling())break;this.parent(),r--,i=!0}}}matchContext(e){if(!this.buffer)return xS(this.node.parent,e);let{buffer:n}=this.buffer,{types:r}=n.set;for(let i=e.length-1,s=this.stack.length-1;i>=0;s--){if(s<0)return xS(this._tree,e,i);let a=r[n.buffer[this.stack[s]]];if(!a.isAnonymous){if(e[i]&&e[i]!=a.name)return!1;i--}}return!0}}function w1(t){return t.children.some(e=>e instanceof fa||!e.type.isAnonymous||w1(e))}function RX(t){var e;let{buffer:n,nodeSet:r,maxBufferLength:i=vX,reused:s=[],minRepeatType:a=r.types.length}=t,u=Array.isArray(n)?new S1(n,n.length):n,f=r.types,d=0,g=0;function p(O,P,M,D,L,H){let{id:N,start:_,end:$,size:F}=u,G=g,j=d;if(F<0)if(u.next(),F==-1){let z=s[N];M.push(z),D.push(_-O);return}else if(F==-3){d=N;return}else if(F==-4){g=N;return}else throw new RangeError(`Unrecognized record size: ${F}`);let q=f[N],V,te,J=_-O;if($-_<=i&&(te=w(u.pos-P,L))){let z=new Uint16Array(te.size-te.skip),U=u.pos-te.size,W=z.length;for(;u.pos>U;)W=C(te.start,z,W);V=new fa(z,$-te.start,r),J=te.start-O}else{let z=u.pos-F;u.next();let U=[],W=[],X=N>=a?N:-1,ie=0,ee=$;for(;u.pos>z;)X>=0&&u.id==X&&u.size>=0?(u.end<=ee-i&&(b(U,W,_,ie,u.end,ee,X,G,j),ie=U.length,ee=u.end),u.next()):H>2500?m(_,z,U,W):p(_,z,U,W,X,H+1);if(X>=0&&ie>0&&ie<U.length&&b(U,W,_,ie,_,ee,X,G,j),U.reverse(),W.reverse(),X>-1&&ie>0){let ue=v(q,j);V=C1(q,U,W,0,U.length,0,$-_,ue,ue)}else V=S(q,U,W,$-_,G-$,j)}M.push(V),D.push(J)}function m(O,P,M,D){let L=[],H=0,N=-1;for(;u.pos>P;){let{id:_,start:$,end:F,size:G}=u;if(G>4)u.next();else{if(N>-1&&$<N)break;N<0&&(N=F-i),L.push(_,$,F),H++,u.next()}}if(H){let _=new Uint16Array(H*4),$=L[L.length-2];for(let F=L.length-3,G=0;F>=0;F-=3)_[G++]=L[F],_[G++]=L[F+1]-$,_[G++]=L[F+2]-$,_[G++]=G;M.push(new fa(_,L[2]-$,r)),D.push($-O)}}function v(O,P){return(M,D,L)=>{let H=0,N=M.length-1,_,$;if(N>=0&&(_=M[N])instanceof Nr){if(!N&&_.type==O&&_.length==L)return _;($=_.prop(Gt.lookAhead))&&(H=D[N]+_.length+$)}return S(O,M,D,L,H,P)}}function b(O,P,M,D,L,H,N,_,$){let F=[],G=[];for(;O.length>D;)F.push(O.pop()),G.push(P.pop()+M-L);O.push(S(r.types[N],F,G,H-L,_-H,$)),P.push(L-M)}function S(O,P,M,D,L,H,N){if(H){let _=[Gt.contextHash,H];N=N?[_].concat(N):[_]}if(L>25){let _=[Gt.lookAhead,L];N=N?[_].concat(N):[_]}return new Nr(O,P,M,D,N)}function w(O,P){let M=u.fork(),D=0,L=0,H=0,N=M.end-i,_={size:0,start:0,skip:0};e:for(let $=M.pos-O;M.pos>$;){let F=M.size;if(M.id==P&&F>=0){_.size=D,_.start=L,_.skip=H,H+=4,D+=4,M.next();continue}let G=M.pos-F;if(F<0||G<$||M.start<N)break;let j=M.id>=a?4:0,q=M.start;for(M.next();M.pos>G;){if(M.size<0)if(M.size==-3||M.size==-4)j+=4;else break e;else M.id>=a&&(j+=4);M.next()}L=q,D+=F,H+=j}return(P<0||D==O)&&(_.size=D,_.start=L,_.skip=H),_.size>4?_:void 0}function C(O,P,M){let{id:D,start:L,end:H,size:N}=u;if(u.next(),N>=0&&D<a){let _=M;if(N>4){let $=u.pos-(N-4);for(;u.pos>$;)M=C(O,P,M)}P[--M]=_,P[--M]=H-O,P[--M]=L-O,P[--M]=D}else N==-3?d=D:N==-4&&(g=D);return M}let R=[],T=[];for(;u.pos>0;)p(t.start||0,t.bufferStart||0,R,T,-1,0);let A=(e=t.length)!==null&&e!==void 0?e:R.length?T[0]+R[0].length:0;return new Nr(f[t.topID],R.reverse(),T.reverse(),A)}const lk=new WeakMap;function xp(t,e){if(!t.isAnonymous||e instanceof fa||e.type!=t)return 1;let n=lk.get(e);if(n==null){n=1;for(let r of e.children){if(r.type!=t||!(r instanceof Nr)){n=1;break}n+=xp(t,r)}lk.set(e,n)}return n}function C1(t,e,n,r,i,s,a,u,f){let d=0;for(let b=r;b<i;b++)d+=xp(t,e[b]);let g=Math.ceil(d*1.5/8),p=[],m=[];function v(b,S,w,C,R){for(let T=w;T<C;){let A=T,O=S[T],P=xp(t,b[T]);for(T++;T<C;T++){let M=xp(t,b[T]);if(P+M>=g)break;P+=M}if(T==A+1){if(P>g){let M=b[A];v(M.children,M.positions,0,M.children.length,S[A]+R);continue}p.push(b[A])}else{let M=S[T-1]+b[T-1].length-O;p.push(C1(t,b,S,A,T,O,M,null,f))}m.push(O+R-s)}}return v(e,n,r,i,0),(u||f)(p,m,a)}class nu{constructor(e,n,r,i,s=!1,a=!1){this.from=e,this.to=n,this.tree=r,this.offset=i,this.open=(s?1:0)|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],r=!1){let i=[new nu(0,e.length,e,0,!1,r)];for(let s of n)s.to>e.length&&i.push(s);return i}static applyChanges(e,n,r=128){if(!n.length)return e;let i=[],s=1,a=e.length?e[0]:null;for(let u=0,f=0,d=0;;u++){let g=u<n.length?n[u]:null,p=g?g.fromA:1e9;if(p-f>=r)for(;a&&a.from<p;){let m=a;if(f>=m.from||p<=m.to||d){let v=Math.max(m.from,f)-d,b=Math.min(m.to,p)-d;m=v>=b?null:new nu(v,b,m.tree,m.offset+d,u>0,!!g)}if(m&&i.push(m),a.to>p)break;a=s<e.length?e[s++]:null}if(!g)break;f=g.toA,d=g.toA-g.toB}return i}}class EX{startParse(e,n,r){return typeof e=="string"&&(e=new TX(e)),r=r?r.length?r.map(i=>new wb(i.from,i.to)):[new wb(0,0)]:[new wb(0,e.length)],this.createParse(e,n||[],r)}parse(e,n,r){let i=this.startParse(e,n,r);for(;;){let s=i.advance();if(s)return s}}}class TX{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,n){return this.string.slice(e,n)}}new Gt({perNode:!0});let AX=0;class Ji{constructor(e,n,r,i){this.name=e,this.set=n,this.base=r,this.modified=i,this.id=AX++}toString(){let{name:e}=this;for(let n of this.modified)n.name&&(e=`${n.name}(${e})`);return e}static define(e,n){let r=typeof e=="string"?e:"?";if(e instanceof Ji&&(n=e),n?.base)throw new Error("Can not derive from a modified tag");let i=new Ji(r,[],null,[]);if(i.set.push(i),n)for(let s of n.set)i.set.push(s);return i}static defineModifier(e){let n=new tm(e);return r=>r.modified.indexOf(n)>-1?r:tm.get(r.base||r,r.modified.concat(n).sort((i,s)=>i.id-s.id))}}let MX=0;class tm{constructor(e){this.name=e,this.instances=[],this.id=MX++}static get(e,n){if(!n.length)return e;let r=n[0].instances.find(u=>u.base==e&&OX(n,u.modified));if(r)return r;let i=[],s=new Ji(e.name,i,e,n);for(let u of n)u.instances.push(s);let a=kX(n);for(let u of e.set)if(!u.modified.length)for(let f of a)i.push(tm.get(u,f));return s}}function OX(t,e){return t.length==e.length&&t.every((n,r)=>n==e[r])}function kX(t){let e=[[]];for(let n=0;n<t.length;n++)for(let r=0,i=e.length;r<i;r++)e.push(e[r].concat(t[n]));return e.sort((n,r)=>r.length-n.length)}function IX(t){let e=Object.create(null);for(let n in t){let r=t[n];Array.isArray(r)||(r=[r]);for(let i of n.split(" "))if(i){let s=[],a=2,u=i;for(let p=0;;){if(u=="..."&&p>0&&p+3==i.length){a=1;break}let m=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(u);if(!m)throw new RangeError("Invalid path: "+i);if(s.push(m[0]=="*"?"":m[0][0]=='"'?JSON.parse(m[0]):m[0]),p+=m[0].length,p==i.length)break;let v=i[p++];if(p==i.length&&v=="!"){a=0;break}if(v!="/")throw new RangeError("Invalid path: "+i);u=i.slice(p)}let f=s.length-1,d=s[f];if(!d)throw new RangeError("Invalid path: "+i);let g=new nm(r,a,f>0?s.slice(0,f):null);e[d]=g.sort(e[d])}}return DX.add(e)}const DX=new Gt({combine(t,e){let n,r,i;for(;t||e;){if(!t||e&&t.depth>=e.depth?(i=e,e=e.next):(i=t,t=t.next),n&&n.mode==i.mode&&!i.context&&!n.context)continue;let s=new nm(i.tags,i.mode,i.context);n?n.next=s:r=s,n=s}return r}});class nm{constructor(e,n,r,i){this.tags=e,this.mode=n,this.context=r,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}nm.empty=new nm([],2,null);function PX(t,e){let n=Object.create(null);for(let s of t)if(!Array.isArray(s.tag))n[s.tag.id]=s.class;else for(let a of s.tag)n[a.id]=s.class;let{scope:r,all:i=null}={};return{style:s=>{let a=i;for(let u of s)for(let f of u.set){let d=n[f.id];if(d){a=a?a+" "+d:d;break}}return a},scope:r}}const Be=Ji.define,Jg=Be(),Gl=Be(),ak=Be(Gl),uk=Be(Gl),Wl=Be(),ep=Be(Wl),Cb=Be(Wl),es=Be(),$a=Be(es),Qo=Be(),Zo=Be(),wS=Be(),Lf=Be(wS),tp=Be(),Ct={comment:Jg,lineComment:Be(Jg),blockComment:Be(Jg),docComment:Be(Jg),name:Gl,variableName:Be(Gl),typeName:ak,tagName:Be(ak),propertyName:uk,attributeName:Be(uk),className:Be(Gl),labelName:Be(Gl),namespace:Be(Gl),macroName:Be(Gl),literal:Wl,string:ep,docString:Be(ep),character:Be(ep),attributeValue:Be(ep),number:Cb,integer:Be(Cb),float:Be(Cb),bool:Be(Wl),regexp:Be(Wl),escape:Be(Wl),color:Be(Wl),url:Be(Wl),keyword:Qo,self:Be(Qo),null:Be(Qo),atom:Be(Qo),unit:Be(Qo),modifier:Be(Qo),operatorKeyword:Be(Qo),controlKeyword:Be(Qo),definitionKeyword:Be(Qo),moduleKeyword:Be(Qo),operator:Zo,derefOperator:Be(Zo),arithmeticOperator:Be(Zo),logicOperator:Be(Zo),bitwiseOperator:Be(Zo),compareOperator:Be(Zo),updateOperator:Be(Zo),definitionOperator:Be(Zo),typeOperator:Be(Zo),controlOperator:Be(Zo),punctuation:wS,separator:Be(wS),bracket:Lf,angleBracket:Be(Lf),squareBracket:Be(Lf),paren:Be(Lf),brace:Be(Lf),content:es,heading:$a,heading1:Be($a),heading2:Be($a),heading3:Be($a),heading4:Be($a),heading5:Be($a),heading6:Be($a),contentSeparator:Be(es),list:Be(es),quote:Be(es),emphasis:Be(es),strong:Be(es),link:Be(es),monospace:Be(es),strikethrough:Be(es),inserted:Be(),deleted:Be(),changed:Be(),invalid:Be(),meta:tp,documentMeta:Be(tp),annotation:Be(tp),processingInstruction:Be(tp),definition:Ji.defineModifier("definition"),constant:Ji.defineModifier("constant"),function:Ji.defineModifier("function"),standard:Ji.defineModifier("standard"),local:Ji.defineModifier("local"),special:Ji.defineModifier("special")};for(let t in Ct){let e=Ct[t];e instanceof Ji&&(e.name=t)}PX([{tag:Ct.link,class:"tok-link"},{tag:Ct.heading,class:"tok-heading"},{tag:Ct.emphasis,class:"tok-emphasis"},{tag:Ct.strong,class:"tok-strong"},{tag:Ct.keyword,class:"tok-keyword"},{tag:Ct.atom,class:"tok-atom"},{tag:Ct.bool,class:"tok-bool"},{tag:Ct.url,class:"tok-url"},{tag:Ct.labelName,class:"tok-labelName"},{tag:Ct.inserted,class:"tok-inserted"},{tag:Ct.deleted,class:"tok-deleted"},{tag:Ct.literal,class:"tok-literal"},{tag:Ct.string,class:"tok-string"},{tag:Ct.number,class:"tok-number"},{tag:[Ct.regexp,Ct.escape,Ct.special(Ct.string)],class:"tok-string2"},{tag:Ct.variableName,class:"tok-variableName"},{tag:Ct.local(Ct.variableName),class:"tok-variableName tok-local"},{tag:Ct.definition(Ct.variableName),class:"tok-variableName tok-definition"},{tag:Ct.special(Ct.variableName),class:"tok-variableName2"},{tag:Ct.definition(Ct.propertyName),class:"tok-propertyName tok-definition"},{tag:Ct.typeName,class:"tok-typeName"},{tag:Ct.namespace,class:"tok-namespace"},{tag:Ct.className,class:"tok-className"},{tag:Ct.macroName,class:"tok-macroName"},{tag:Ct.propertyName,class:"tok-propertyName"},{tag:Ct.operator,class:"tok-operator"},{tag:Ct.comment,class:"tok-comment"},{tag:Ct.meta,class:"tok-meta"},{tag:Ct.invalid,class:"tok-invalid"},{tag:Ct.punctuation,class:"tok-punctuation"}]);var Rb;const np=new Gt,zX=new Gt;class Xs{constructor(e,n,r=[],i=""){this.data=e,this.name=i,on.prototype.hasOwnProperty("tree")||Object.defineProperty(on.prototype,"tree",{get(){return da(this)}}),this.parser=n,this.extension=[Ic.of(this),on.languageData.of((s,a,u)=>{let f=ck(s,a,u),d=f.type.prop(np);if(!d)return[];let g=s.facet(d),p=f.type.prop(zX);if(p){let m=f.resolve(a-f.from,u);for(let v of p)if(v.test(m,s)){let b=s.facet(v.facet);return v.type=="replace"?b:b.concat(g)}}return g})].concat(r)}isActiveAt(e,n,r=-1){return ck(e,n,r).type.prop(np)==this.data}findRegions(e){let n=e.facet(Ic);if(n?.data==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let r=[],i=(s,a)=>{if(s.prop(np)==this.data){r.push({from:a,to:a+s.length});return}let u=s.prop(Gt.mounted);if(u){if(u.tree.prop(np)==this.data){if(u.overlay)for(let f of u.overlay)r.push({from:f.from+a,to:f.to+a});else r.push({from:a,to:a+s.length});return}else if(u.overlay){let f=r.length;if(i(u.tree,u.overlay[0].from+a),r.length>f)return}}for(let f=0;f<s.children.length;f++){let d=s.children[f];d instanceof Nr&&i(d,s.positions[f]+a)}};return i(da(e),0),r}get allowsNesting(){return!0}}Xs.setState=ir.define();function ck(t,e,n){let r=t.facet(Ic),i=da(t).topNode;if(!r||r.allowsNesting)for(let s=i;s;s=s.enter(e,n,rr.ExcludeBuffers|rr.EnterBracketed))s.type.isTop&&(i=s);return i}function da(t){let e=t.field(Xs.state,!1);return e?e.tree:Nr.empty}class NX{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,n){let r=this.cursorPos-this.string.length;return e<r||n>=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-r,n-r)}}let Bf=null;class rm{constructor(e,n,r=[],i,s,a,u,f){this.parser=e,this.state=n,this.fragments=r,this.tree=i,this.treeLen=s,this.viewport=a,this.skipped=u,this.scheduleOn=f,this.parse=null,this.tempSkipped=[]}static create(e,n,r){return new rm(e,n,[],Nr.empty,0,r,[],null)}startParse(){return this.parser.startParse(new NX(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=Nr.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let i=Date.now()+e;e=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n<this.state.doc.length&&this.parse.stopAt(n);;){let i=this.parse.advance();if(i)if(this.fragments=this.withoutTempSkipped(nu.addTree(i,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(r=this.parse.stoppedAt)!==null&&r!==void 0?r:this.state.doc.length,this.tree=i,this.parse=null,this.treeLen<(n??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,n;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=e,this.tree=n,this.fragments=this.withoutTempSkipped(nu.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=Bf;Bf=this;try{return e()}finally{Bf=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=fk(e,n.from,n.to);return e}changes(e,n){let{fragments:r,tree:i,treeLen:s,viewport:a,skipped:u}=this;if(this.takeTree(),!e.empty){let f=[];if(e.iterChangedRanges((d,g,p,m)=>f.push({fromA:d,toA:g,fromB:p,toB:m})),r=nu.applyChanges(r,f),i=Nr.empty,s=0,a={from:e.mapPos(a.from,-1),to:e.mapPos(a.to,1)},this.skipped.length){u=[];for(let d of this.skipped){let g=e.mapPos(d.from,1),p=e.mapPos(d.to,-1);g<p&&u.push({from:g,to:p})}}}return new rm(this.parser,n,r,i,s,a,u,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let n=this.skipped.length;for(let r=0;r<this.skipped.length;r++){let{from:i,to:s}=this.skipped[r];i<e.to&&s>e.from&&(this.fragments=fk(this.fragments,i,s),this.skipped.splice(r--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,n){this.skipped.push({from:e,to:n})}static getSkippingParser(e){return new class extends EX{createParse(n,r,i){let s=i[0].from,a=i[i.length-1].to;return{parsedPos:s,advance(){let f=Bf;if(f){for(let d of i)f.tempSkipped.push(d);e&&(f.scheduleOn=f.scheduleOn?Promise.all([f.scheduleOn,e]):e)}return this.parsedPos=a,new Nr(co.none,[],[],a-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let n=this.fragments;return this.treeLen>=e&&n.length&&n[0].from==0&&n[0].to>=e}static get(){return Bf}}function fk(t,e,n){return nu.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class kc{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new kc(n)}static init(e){let n=Math.min(3e3,e.doc.length),r=rm.create(e.facet(Ic).parser,e,{from:0,to:n});return r.work(20,n)||r.takeTree(),new kc(r)}}Xs.state=va.define({create:kc.init,update(t,e){for(let n of e.effects)if(n.is(Xs.setState))return n.value;return e.startState.facet(Ic)!=e.state.facet(Ic)?kc.init(e.state):t.apply(e)}});let OL=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(OL=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const Eb=typeof navigator<"u"&&(!((Rb=navigator.scheduling)===null||Rb===void 0)&&Rb.isInputPending)?()=>navigator.scheduling.isInputPending():null,LX=Ec.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let n=this.view.state.field(Xs.state).context;(n.updateViewport(e.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:e}=this.view,n=e.field(Xs.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=OL(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEnd<n&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=n+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:r,viewport:{to:i}}=this.view,s=r.field(Xs.state);if(s.tree==s.context.tree&&s.context.isDone(i+1e5))return;let a=Date.now()+Math.min(this.chunkBudget,100,e&&!Eb?Math.max(25,e.timeRemaining()-5):1e9),u=s.context.treeLen<i&&r.doc.length>i+1e3,f=s.context.work(()=>Eb&&Eb()||Date.now()>a,i+(u?0:1e5));this.chunkBudget-=Date.now()-n,(f||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:Xs.setState.of(new kc(s.context))})),this.chunkBudget>0&&!(f&&!u)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>hs(this.view.state,n)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Ic=mt.define({combine(t){return t.length?t[0]:null},enables:t=>[Xs.state,LX,wt.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]}),BX=mt.define(),R1=mt.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(n=>n!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function im(t){let e=t.facet(R1);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function om(t,e){let n="",r=t.tabSize,i=t.facet(R1)[0];if(i==" "){for(;e>=r;)n+=" ",e-=r;i=" "}for(let s=0;s<e;s++)n+=i;return n}function kL(t,e){t instanceof on&&(t=new ny(t));for(let r of t.state.facet(BX)){let i=r(t,e);if(i!==void 0)return i}let n=da(t.state);return n.length>=e?HX(t,n,e):null}class ny{constructor(e,n={}){this.state=e,this.options=n,this.unit=im(e)}lineAt(e,n=1){let r=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:s}=this.options;return i!=null&&i>=r.from&&i<=r.to?s&&i==e?{text:"",from:e}:(n<0?i<e:i<=e)?{text:r.text.slice(i-r.from),from:i}:{text:r.text.slice(0,i-r.from),from:r.from}:r}textAfterPos(e,n=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:r,from:i}=this.lineAt(e,n);return r.slice(e-i,Math.min(r.length,e+100-i))}column(e,n=1){let{text:r,from:i}=this.lineAt(e,n),s=this.countColumn(r,e-i),a=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return a>-1&&(s+=a-this.countColumn(r,r.search(/\S|$/))),s}countColumn(e,n=e.length){return Ym(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:r,from:i}=this.lineAt(e,n),s=this.options.overrideIndentation;if(s){let a=s(i);if(a>-1)return a}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const _X=new Gt;function HX(t,e,n){let r=e.resolveStack(n),i=e.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(i!=r.node){let s=[];for(let a=i;a&&!(a.from<r.node.from||a.to>r.node.to||a.from==r.node.from&&a.type==r.node.type);a=a.parent)s.push(a);for(let a=s.length-1;a>=0;a--)r={node:s[a],next:r}}return IL(r,t,n)}function IL(t,e,n){for(let r=t;r;r=r.next){let i=VX(r.node);if(i)return i(E1.create(e,n,r))}return 0}function jX(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function VX(t){let e=t.type.prop(_X);if(e)return e;let n=t.firstChild,r;if(n&&(r=n.type.prop(Gt.closedBy))){let i=t.lastChild,s=i&&r.indexOf(i.name)>-1;return a=>qX(a,!0,1,void 0,s&&!jX(a)?i.from:void 0)}return t.parent==null?FX:null}function FX(){return 0}class E1 extends ny{constructor(e,n,r){super(e.state,e.options),this.base=e,this.pos=n,this.context=r}get node(){return this.context.node}static create(e,n,r){return new E1(e,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let n=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(n.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(UX(r,e))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return IL(this.context.next,this.base,this.pos)}}function UX(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function $X(t){let e=t.node,n=e.childAfter(e.from),r=e.lastChild;if(!n)return null;let i=t.options.simulateBreak,s=t.state.doc.lineAt(n.from),a=i==null||i<=s.from?s.to:Math.min(s.to,i);for(let u=n.to;;){let f=e.childAfter(u);if(!f||f==r)return null;if(!f.type.isSkipped){if(f.from>=a)return null;let d=/^ */.exec(s.text.slice(n.to-s.from))[0].length;return{from:n.from,to:n.to+d}}u=f.to}}function qX(t,e,n,r,i){let s=t.textAfter,a=s.match(/^\s*/)[0].length,u=r&&s.slice(a,a+r.length)==r||i==t.pos+a,f=$X(t);return f?u?t.column(f.from):t.column(f.to):t.baseIndent+(u?0:t.unit*n)}const GX=1e4,WX="()[]{}",KX=new Gt;function CS(t,e,n){let r=t.prop(e<0?Gt.openedBy:Gt.closedBy);if(r)return r;if(t.name.length==1){let i=n.indexOf(t.name);if(i>-1&&i%2==(e<0?1:0))return[n[i+e]]}return null}function RS(t){let e=t.type.prop(KX);return e?e(t.node):t}function ic(t,e,n,r={}){let i=r.maxScanDistance||GX,s=r.brackets||WX,a=da(t),u=a.resolveInner(e,n);for(let f=u;f;f=f.parent){let d=CS(f.type,n,s);if(d&&f.from<f.to){let g=RS(f);if(g&&(n>0?e>=g.from&&e<g.to:e>g.from&&e<=g.to))return YX(t,e,n,f,g,d,s)}}return XX(t,e,n,a,u.type,i,s)}function YX(t,e,n,r,i,s,a){let u=r.parent,f={from:i.from,to:i.to},d=0,g=u?.cursor();if(g&&(n<0?g.childBefore(r.from):g.childAfter(r.to)))do if(n<0?g.to<=r.from:g.from>=r.to){if(d==0&&s.indexOf(g.type.name)>-1&&g.from<g.to){let p=RS(g);return{start:f,end:p?{from:p.from,to:p.to}:void 0,matched:!0}}else if(CS(g.type,n,a))d++;else if(CS(g.type,-n,a)){if(d==0){let p=RS(g);return{start:f,end:p&&p.from<p.to?{from:p.from,to:p.to}:void 0,matched:!1}}d--}}while(n<0?g.prevSibling():g.nextSibling());return{start:f,matched:!1}}function XX(t,e,n,r,i,s,a){if(n<0?!e:e==t.doc.length)return null;let u=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),f=a.indexOf(u);if(f<0||f%2==0!=n>0)return null;let d={from:n<0?e-1:e,to:n>0?e+1:e},g=t.doc.iterRange(e,n>0?t.doc.length:0),p=0;for(let m=0;!g.next().done&&m<=s;){let v=g.value;n<0&&(m+=v.length);let b=e+m*n;for(let S=n>0?0:v.length-1,w=n>0?v.length:-1;S!=w;S+=n){let C=a.indexOf(v[S]);if(!(C<0||r.resolveInner(b+S,1).type!=i))if(C%2==0==n>0)p++;else{if(p==1)return{start:d,end:{from:b+S,to:b+S+1},matched:C>>1==f>>1};p--}}n>0&&(m+=v.length)}return g.done?{start:d,matched:!1}:null}const QX=Object.create(null),dk=[co.none],hk=[],gk=Object.create(null),ZX=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])ZX[t]=JX(QX,e);function Tb(t,e){hk.indexOf(t)>-1||(hk.push(t),console.warn(e))}function JX(t,e){let n=[];for(let u of e.split(" ")){let f=[];for(let d of u.split(".")){let g=t[d]||Ct[d];g?typeof g=="function"?f.length?f=f.map(g):Tb(d,`Modifier ${d} used at start of tag`):f.length?Tb(d,`Tag ${d} used as modifier`):f=Array.isArray(g)?g:[g]:Tb(d,`Unknown highlighting tag ${d}`)}for(let d of f)n.push(d)}if(!n.length)return 0;let r=e.replace(/ /g,"_"),i=r+" "+n.map(u=>u.id),s=gk[i];if(s)return s.id;let a=gk[i]=co.define({id:dk.length,name:r,props:[IX({[r]:n})]});return dk.push(a),a.id}hr.RTL,hr.LTR;const eQ=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),r=A1(t.state,n.from);return r.line?tQ(t):r.block?rQ(t):!1};function T1(t,e){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=t(e,n);return i?(r(n.update(i)),!0):!1}}const tQ=T1(sQ,0),nQ=T1(DL,0),rQ=T1((t,e)=>DL(t,e,oQ(e)),0);function A1(t,e){let n=t.languageDataAt("commentTokens",e,1);return n.length?n[0]:{}}const _f=50;function iQ(t,{open:e,close:n},r,i){let s=t.sliceDoc(r-_f,r),a=t.sliceDoc(i,i+_f),u=/\s*$/.exec(s)[0].length,f=/^\s*/.exec(a)[0].length,d=s.length-u;if(s.slice(d-e.length,d)==e&&a.slice(f,f+n.length)==n)return{open:{pos:r-u,margin:u&&1},close:{pos:i+f,margin:f&&1}};let g,p;i-r<=2*_f?g=p=t.sliceDoc(r,i):(g=t.sliceDoc(r,r+_f),p=t.sliceDoc(i-_f,i));let m=/^\s*/.exec(g)[0].length,v=/\s*$/.exec(p)[0].length,b=p.length-v-n.length;return g.slice(m,m+e.length)==e&&p.slice(b,b+n.length)==n?{open:{pos:r+m+e.length,margin:/\s/.test(g.charAt(m+e.length))?1:0},close:{pos:i-v-n.length,margin:/\s/.test(p.charAt(b-1))?1:0}}:null}function oQ(t){let e=[];for(let n of t.selection.ranges){let r=t.doc.lineAt(n.from),i=n.to<=r.to?r:t.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:t.doc.lineAt(n.to-1));let s=e.length-1;s>=0&&e[s].to>r.from?e[s].to=i.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return e}function DL(t,e,n=e.selection.ranges){let r=n.map(s=>A1(e,s.from).block);if(!r.every(s=>s))return null;let i=n.map((s,a)=>iQ(e,r[a],s.from,s.to));if(t!=2&&!i.every(s=>s))return{changes:e.changes(n.map((s,a)=>i[a]?[]:[{from:s.from,insert:r[a].open+" "},{from:s.to,insert:" "+r[a].close}]))};if(t!=1&&i.some(s=>s)){let s=[];for(let a=0,u;a<i.length;a++)if(u=i[a]){let f=r[a],{open:d,close:g}=u;s.push({from:d.pos-f.open.length,to:d.pos+d.margin},{from:g.pos-g.margin,to:g.pos+f.close.length})}return{changes:s}}return null}function sQ(t,e,n=e.selection.ranges){let r=[],i=-1;e:for(let{from:s,to:a}of n){let u=r.length,f=1e9,d;for(let g=s;g<=a;){let p=e.doc.lineAt(g);if(d==null&&(d=A1(e,p.from).line,!d))continue e;if(p.from>i&&(s==a||a>p.from)){i=p.from;let m=/^\s*/.exec(p.text)[0].length,v=m==p.length,b=p.text.slice(m,m+d.length)==d?m:-1;m<p.text.length&&m<f&&(f=m),r.push({line:p,comment:b,token:d,indent:m,empty:v,single:!1})}g=p.to+1}if(f<1e9)for(let g=u;g<r.length;g++)r[g].indent<r[g].line.text.length&&(r[g].indent=f);r.length==u+1&&(r[u].single=!0)}if(t!=2&&r.some(s=>s.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:u,token:f,indent:d,empty:g,single:p}of r)(p||!g)&&s.push({from:u.from+d,insert:f+" "});let a=e.changes(s);return{changes:a,selection:e.selection.map(a,1)}}else if(t!=1&&r.some(s=>s.comment>=0)){let s=[];for(let{line:a,comment:u,token:f}of r)if(u>=0){let d=a.from+u,g=d+f.length;a.text[g-a.from]==" "&&g++,s.push({from:d,to:g})}return{changes:s}}return null}const ES=ba.define(),lQ=ba.define(),aQ=mt.define(),PL=mt.define({combine(t){return wK(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(r,i)=>e(r,i)||n(r,i)})}}),zL=va.define({create(){return gs.empty},update(t,e){let n=e.state.facet(PL),r=e.annotation(ES);if(r){let f=vi.fromTransaction(e,r.selection),d=r.side,g=d==0?t.undone:t.done;return f?g=sm(g,g.length,n.minDepth,f):g=BL(g,e.startState.selection),new gs(d==0?r.rest:g,d==0?g:r.rest)}let i=e.annotation(lQ);if((i=="full"||i=="before")&&(t=t.isolate()),e.annotation(xr.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let s=vi.fromTransaction(e),a=e.annotation(xr.time),u=e.annotation(xr.userEvent);return s?t=t.addChanges(s,a,u,n,e):e.selection&&(t=t.addSelection(e.startState.selection,a,u,n.newGroupDelay)),(i=="full"||i=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new gs(t.done.map(vi.fromJSON),t.undone.map(vi.fromJSON))}});function uQ(t={}){return[zL,PL.of(t),wt.domEventHandlers({beforeinput(e,n){let r=e.inputType=="historyUndo"?NL:e.inputType=="historyRedo"?TS:null;return r?(e.preventDefault(),r(n)):!1}})]}function ry(t,e){return function({state:n,dispatch:r}){if(!e&&n.readOnly)return!1;let i=n.field(zL,!1);if(!i)return!1;let s=i.pop(t,n,e);return s?(r(s),!0):!1}}const NL=ry(0,!1),TS=ry(1,!1),cQ=ry(0,!0),fQ=ry(1,!0);class vi{constructor(e,n,r,i,s){this.changes=e,this.effects=n,this.mapped=r,this.startSelection=i,this.selectionsAfter=s}setSelAfter(e){return new vi(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,n,r;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(e){return new vi(e.changes&&vr.fromJSON(e.changes),[],e.mapped&&ms.fromJSON(e.mapped),e.startSelection&&Ae.fromJSON(e.startSelection),e.selectionsAfter.map(Ae.fromJSON))}static fromTransaction(e,n){let r=io;for(let i of e.startState.facet(aQ)){let s=i(e);s.length&&(r=r.concat(s))}return!r.length&&e.changes.empty?null:new vi(e.changes.invert(e.startState.doc),r,void 0,n||e.startState.selection,io)}static selection(e){return new vi(void 0,io,void 0,void 0,e)}}function sm(t,e,n,r){let i=e+1>n+20?e-n-1:0,s=t.slice(i,e);return s.push(r),s}function dQ(t,e){let n=[],r=!1;return t.iterChangedRanges((i,s)=>n.push(i,s)),e.iterChangedRanges((i,s,a,u)=>{for(let f=0;f<n.length;){let d=n[f++],g=n[f++];u>=d&&a<=g&&(r=!0)}}),r}function hQ(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,r)=>n.empty!=e.ranges[r].empty).length===0}function LL(t,e){return t.length?e.length?t.concat(e):t:e}const io=[],gQ=200;function BL(t,e){if(t.length){let n=t[t.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-gQ));return r.length&&r[r.length-1].eq(e)?t:(r.push(e),sm(t,t.length-1,1e9,n.setSelAfter(r)))}else return[vi.selection([e])]}function pQ(t){let e=t[t.length-1],n=t.slice();return n[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),n}function Ab(t,e){if(!t.length)return t;let n=t.length,r=io;for(;n;){let i=mQ(t[n-1],e,r);if(i.changes&&!i.changes.empty||i.effects.length){let s=t.slice(0,n);return s[n-1]=i,s}else e=i.mapped,n--,r=i.selectionsAfter}return r.length?[vi.selection(r)]:io}function mQ(t,e,n){let r=LL(t.selectionsAfter.length?t.selectionsAfter.map(u=>u.map(e)):io,n);if(!t.changes)return vi.selection(r);let i=t.changes.map(e),s=e.mapDesc(t.changes,!0),a=t.mapped?t.mapped.composeDesc(s):s;return new vi(i,ir.mapEffects(t.effects,e),a,t.startSelection.map(s),r)}const yQ=/^(input\.type|delete)($|\.)/;class gs{constructor(e,n,r=0,i=void 0){this.done=e,this.undone=n,this.prevTime=r,this.prevUserEvent=i}isolate(){return this.prevTime?new gs(this.done,this.undone):this}addChanges(e,n,r,i,s){let a=this.done,u=a[a.length-1];return u&&u.changes&&!u.changes.empty&&e.changes&&(!r||yQ.test(r))&&(!u.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(s,dQ(u.changes,e.changes))||r=="input.type.compose")?a=sm(a,a.length-1,i.minDepth,new vi(e.changes.compose(u.changes),LL(ir.mapEffects(e.effects,u.changes),u.effects),u.mapped,u.startSelection,io)):a=sm(a,a.length,i.minDepth,e),new gs(a,io,n,r)}addSelection(e,n,r,i){let s=this.done.length?this.done[this.done.length-1].selectionsAfter:io;return s.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&hQ(s[s.length-1],e)?this:new gs(BL(this.done,e),this.undone,n,r)}addMapping(e){return new gs(Ab(this.done,e),Ab(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,n,r){let i=e==0?this.done:this.undone;if(i.length==0)return null;let s=i[i.length-1],a=s.selectionsAfter[0]||(s.startSelection?s.startSelection.map(s.changes.invertedDesc,1):n.selection);if(r&&s.selectionsAfter.length)return n.update({selection:s.selectionsAfter[s.selectionsAfter.length-1],annotations:ES.of({side:e,rest:pQ(i),selection:a}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(s.changes){let u=i.length==1?io:i.slice(0,i.length-1);return s.mapped&&(u=Ab(u,s.mapped)),n.update({changes:s.changes,selection:s.startSelection,effects:s.effects,annotations:ES.of({side:e,rest:u,selection:a}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}gs.empty=new gs(io,io);const vQ=[{key:"Mod-z",run:NL,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:TS,preventDefault:!0},{linux:"Ctrl-Shift-z",run:TS,preventDefault:!0},{key:"Mod-u",run:cQ,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:fQ,preventDefault:!0}];function Bc(t,e){return Ae.create(t.ranges.map(e),t.mainIndex)}function jo(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function Vo({state:t,dispatch:e},n){let r=Bc(t.selection,n);return r.eq(t.selection,!0)?!1:(e(jo(t,r)),!0)}function iy(t,e){return Ae.cursor(e?t.to:t.from)}function _L(t,e){return Vo(t,n=>n.empty?t.moveByChar(n,e):iy(n,e))}function Qr(t){return t.textDirectionAt(t.state.selection.main.head)==hr.LTR}const HL=t=>_L(t,!Qr(t)),jL=t=>_L(t,Qr(t));function VL(t,e){return Vo(t,n=>n.empty?t.moveByGroup(n,e):iy(n,e))}const bQ=t=>VL(t,!Qr(t)),xQ=t=>VL(t,Qr(t));function SQ(t,e,n){if(e.type.prop(n))return!0;let r=e.to-e.from;return r&&(r>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function oy(t,e,n){let r=da(t).resolveInner(e.head),i=n?Gt.closedBy:Gt.openedBy;for(let f=e.head;;){let d=n?r.childAfter(f):r.childBefore(f);if(!d)break;SQ(t,d,i)?r=d:f=n?d.to:d.from}let s=r.type.prop(i),a,u;return s&&(a=n?ic(t,r.from,1):ic(t,r.to,-1))&&a.matched?u=n?a.end.to:a.end.from:u=n?r.to:r.from,Ae.cursor(u,n?-1:1)}const wQ=t=>Vo(t,e=>oy(t.state,e,!Qr(t))),CQ=t=>Vo(t,e=>oy(t.state,e,Qr(t)));function FL(t,e){return Vo(t,n=>{if(!n.empty)return iy(n,e);let r=t.moveVertically(n,e);return r.head!=n.head?r:t.moveToLineBoundary(n,e)})}const UL=t=>FL(t,!1),$L=t=>FL(t,!0);function qL(t){let e=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,n=0,r=0,i;if(e){for(let s of t.state.facet(wt.scrollMargins)){let a=s(t);a?.top&&(n=Math.max(a?.top,n)),a?.bottom&&(r=Math.max(a?.bottom,r))}i=t.scrollDOM.clientHeight-n-r}else i=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:e,height:Math.max(t.defaultLineHeight,i-5)}}function GL(t,e){let n=qL(t),{state:r}=t,i=Bc(r.selection,a=>a.empty?t.moveVertically(a,e,n.height):iy(a,e));if(i.eq(r.selection))return!1;let s;if(n.selfScroll){let a=t.coordsAtPos(r.selection.main.head),u=t.scrollDOM.getBoundingClientRect(),f=u.top+n.marginTop,d=u.bottom-n.marginBottom;a&&a.top>f&&a.bottom<d&&(s=wt.scrollIntoView(i.main.head,{y:"start",yMargin:a.top-f}))}return t.dispatch(jo(r,i),{effects:s}),!0}const pk=t=>GL(t,!1),AS=t=>GL(t,!0);function xa(t,e,n){let r=t.lineBlockAt(e.head),i=t.moveToLineBoundary(e,n);if(i.head==e.head&&i.head!=(n?r.to:r.from)&&(i=t.moveToLineBoundary(e,n,!1)),!n&&i.head==r.from&&r.length){let s=/^\s*/.exec(t.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;s&&e.head!=r.from+s&&(i=Ae.cursor(r.from+s))}return i}const RQ=t=>Vo(t,e=>xa(t,e,!0)),EQ=t=>Vo(t,e=>xa(t,e,!1)),TQ=t=>Vo(t,e=>xa(t,e,!Qr(t))),AQ=t=>Vo(t,e=>xa(t,e,Qr(t))),MQ=t=>Vo(t,e=>Ae.cursor(t.lineBlockAt(e.head).from,1)),OQ=t=>Vo(t,e=>Ae.cursor(t.lineBlockAt(e.head).to,-1));function kQ(t,e,n){let r=!1,i=Bc(t.selection,s=>{let a=ic(t,s.head,-1)||ic(t,s.head,1)||s.head>0&&ic(t,s.head-1,1)||s.head<t.doc.length&&ic(t,s.head+1,-1);if(!a||!a.end)return s;r=!0;let u=a.start.from==s.head?a.end.to:a.end.from;return Ae.cursor(u)});return r?(e(jo(t,i)),!0):!1}const IQ=({state:t,dispatch:e})=>kQ(t,e);function po(t,e){let n=Bc(t.state.selection,r=>{let i=e(r);return Ae.range(r.anchor,i.head,i.goalColumn,i.bidiLevel||void 0,i.assoc)});return n.eq(t.state.selection)?!1:(t.dispatch(jo(t.state,n)),!0)}function WL(t,e){return po(t,n=>t.moveByChar(n,e))}const KL=t=>WL(t,!Qr(t)),YL=t=>WL(t,Qr(t));function XL(t,e){return po(t,n=>t.moveByGroup(n,e))}const DQ=t=>XL(t,!Qr(t)),PQ=t=>XL(t,Qr(t)),zQ=t=>po(t,e=>oy(t.state,e,!Qr(t))),NQ=t=>po(t,e=>oy(t.state,e,Qr(t)));function QL(t,e){return po(t,n=>t.moveVertically(n,e))}const ZL=t=>QL(t,!1),JL=t=>QL(t,!0);function eB(t,e){return po(t,n=>t.moveVertically(n,e,qL(t).height))}const mk=t=>eB(t,!1),yk=t=>eB(t,!0),LQ=t=>po(t,e=>xa(t,e,!0)),BQ=t=>po(t,e=>xa(t,e,!1)),_Q=t=>po(t,e=>xa(t,e,!Qr(t))),HQ=t=>po(t,e=>xa(t,e,Qr(t))),jQ=t=>po(t,e=>Ae.cursor(t.lineBlockAt(e.head).from)),VQ=t=>po(t,e=>Ae.cursor(t.lineBlockAt(e.head).to)),vk=({state:t,dispatch:e})=>(e(jo(t,{anchor:0})),!0),bk=({state:t,dispatch:e})=>(e(jo(t,{anchor:t.doc.length})),!0),xk=({state:t,dispatch:e})=>(e(jo(t,{anchor:t.selection.main.anchor,head:0})),!0),Sk=({state:t,dispatch:e})=>(e(jo(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),FQ=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),UQ=({state:t,dispatch:e})=>{let n=sy(t).map(({from:r,to:i})=>Ae.range(r,Math.min(i+1,t.doc.length)));return e(t.update({selection:Ae.create(n),userEvent:"select"})),!0},$Q=({state:t,dispatch:e})=>{let n=Bc(t.selection,r=>{let i=da(t),s=i.resolveStack(r.from,1);if(r.empty){let a=i.resolveStack(r.from,-1);a.node.from>=s.node.from&&a.node.to<=s.node.to&&(s=a)}for(let a=s;a;a=a.next){let{node:u}=a;if((u.from<r.from&&u.to>=r.to||u.to>r.to&&u.from<=r.from)&&a.next)return Ae.range(u.to,u.from)}return r});return n.eq(t.selection)?!1:(e(jo(t,n)),!0)};function tB(t,e){let{state:n}=t,r=n.selection,i=n.selection.ranges.slice();for(let s of n.selection.ranges){let a=n.doc.lineAt(s.head);if(e?a.to<t.state.doc.length:a.from>0)for(let u=s;;){let f=t.moveVertically(u,e);if(f.head<a.from||f.head>a.to){i.some(d=>d.head==f.head)||i.push(f);break}else{if(f.head==u.head)break;u=f}}}return i.length==r.ranges.length?!1:(t.dispatch(jo(n,Ae.create(i,i.length-1))),!0)}const qQ=t=>tB(t,!1),GQ=t=>tB(t,!0),WQ=({state:t,dispatch:e})=>{let n=t.selection,r=null;return n.ranges.length>1?r=Ae.create([n.main]):n.main.empty||(r=Ae.create([Ae.cursor(n.main.head)])),r?(e(jo(t,r)),!0):!1};function Qd(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:r}=t,i=r.changeByRange(s=>{let{from:a,to:u}=s;if(a==u){let f=e(s);f<a?(n="delete.backward",f=rp(t,f,!1)):f>a&&(n="delete.forward",f=rp(t,f,!0)),a=Math.min(a,f),u=Math.max(u,f)}else a=rp(t,a,!1),u=rp(t,u,!0);return a==u?{range:s}:{changes:{from:a,to:u},range:Ae.cursor(a,a<s.head?-1:1)}});return i.changes.empty?!1:(t.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?wt.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function rp(t,e,n){if(t instanceof wt)for(let r of t.state.facet(wt.atomicRanges).map(i=>i(t)))r.between(e,e,(i,s)=>{i<e&&s>e&&(e=n?s:i)});return e}const nB=(t,e,n)=>Qd(t,r=>{let i=r.from,{state:s}=t,a=s.doc.lineAt(i),u,f;if(n&&!e&&i>a.from&&i<a.from+200&&!/[^ \t]/.test(u=a.text.slice(0,i-a.from))){if(u[u.length-1]==" ")return i-1;let d=Ym(u,s.tabSize),g=d%im(s)||im(s);for(let p=0;p<g&&u[u.length-1-p]==" ";p++)i--;f=i}else f=Yr(a.text,i-a.from,e,e)+a.from,f==i&&a.number!=(e?s.doc.lines:1)?f+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(a.text.slice(f-a.from,i-a.from))&&(f=Yr(a.text,f-a.from,!1,!1)+a.from);return f}),MS=t=>nB(t,!1,!0),rB=t=>nB(t,!0,!1),iB=(t,e)=>Qd(t,n=>{let r=n.head,{state:i}=t,s=i.doc.lineAt(r),a=i.charCategorizer(r);for(let u=null;;){if(r==(e?s.to:s.from)){r==n.head&&s.number!=(e?i.doc.lines:1)&&(r+=e?1:-1);break}let f=Yr(s.text,r-s.from,e)+s.from,d=s.text.slice(Math.min(r,f)-s.from,Math.max(r,f)-s.from),g=a(d);if(u!=null&&g!=u)break;(d!=" "||r!=n.head)&&(u=g),r=f}return r}),oB=t=>iB(t,!1),KQ=t=>iB(t,!0),YQ=t=>Qd(t,e=>{let n=t.lineBlockAt(e.head).to;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),XQ=t=>Qd(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),QQ=t=>Qd(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),ZQ=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:qt.of(["",""])},range:Ae.cursor(r.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},JQ=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>{if(!r.empty||r.from==0||r.from==t.doc.length)return{range:r};let i=r.from,s=t.doc.lineAt(i),a=i==s.from?i-1:Yr(s.text,i-s.from,!1)+s.from,u=i==s.to?i+1:Yr(s.text,i-s.from,!0)+s.from;return{changes:{from:a,to:u,insert:t.doc.slice(i,u).append(t.doc.slice(a,i))},range:Ae.cursor(u)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function sy(t){let e=[],n=-1;for(let r of t.selection.ranges){let i=t.doc.lineAt(r.from),s=t.doc.lineAt(r.to);if(!r.empty&&r.to==s.from&&(s=t.doc.lineAt(r.to-1)),n>=i.number){let a=e[e.length-1];a.to=s.to,a.ranges.push(r)}else e.push({from:i.from,to:s.to,ranges:[r]});n=s.number+1}return e}function sB(t,e,n){if(t.readOnly)return!1;let r=[],i=[];for(let s of sy(t)){if(n?s.to==t.doc.length:s.from==0)continue;let a=t.doc.lineAt(n?s.to+1:s.from-1),u=a.length+1;if(n){r.push({from:s.to,to:a.to},{from:s.from,insert:a.text+t.lineBreak});for(let f of s.ranges)i.push(Ae.range(Math.min(t.doc.length,f.anchor+u),Math.min(t.doc.length,f.head+u)))}else{r.push({from:a.from,to:s.from},{from:s.to,insert:t.lineBreak+a.text});for(let f of s.ranges)i.push(Ae.range(f.anchor-u,f.head-u))}}return r.length?(e(t.update({changes:r,scrollIntoView:!0,selection:Ae.create(i,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const eZ=({state:t,dispatch:e})=>sB(t,e,!1),tZ=({state:t,dispatch:e})=>sB(t,e,!0);function lB(t,e,n){if(t.readOnly)return!1;let r=[];for(let s of sy(t))n?r.push({from:s.from,insert:t.doc.slice(s.from,s.to)+t.lineBreak}):r.push({from:s.to,insert:t.lineBreak+t.doc.slice(s.from,s.to)});let i=t.changes(r);return e(t.update({changes:i,selection:t.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const nZ=({state:t,dispatch:e})=>lB(t,e,!1),rZ=({state:t,dispatch:e})=>lB(t,e,!0),iZ=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(sy(e).map(({from:i,to:s})=>(i>0?i--:s<e.doc.length&&s++,{from:i,to:s}))),r=Bc(e.selection,i=>{let s;if(t.lineWrapping){let a=t.lineBlockAt(i.head),u=t.coordsAtPos(i.head,i.assoc||1);u&&(s=a.bottom+t.documentTop-u.bottom+t.defaultLineHeight/2)}return t.moveVertically(i,!0,s)}).map(n);return t.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function oZ(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=da(t).resolveInner(e),r=n.childBefore(e),i=n.childAfter(e),s;return r&&i&&r.to<=e&&i.from>=e&&(s=r.type.prop(Gt.closedBy))&&s.indexOf(i.name)>-1&&t.doc.lineAt(r.to).from==t.doc.lineAt(i.from).from&&!/\S/.test(t.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}const wk=aB(!1),sZ=aB(!0);function aB(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let r=e.changeByRange(i=>{let{from:s,to:a}=i,u=e.doc.lineAt(s),f=!t&&s==a&&oZ(e,s);t&&(s=a=(a<=u.to?u:e.doc.lineAt(a)).to);let d=new ny(e,{simulateBreak:s,simulateDoubleBreak:!!f}),g=kL(d,s);for(g==null&&(g=Ym(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));a<u.to&&/\s/.test(u.text[a-u.from]);)a++;f?{from:s,to:a}=f:s>u.from&&s<u.from+100&&!/\S/.test(u.text.slice(0,s))&&(s=u.from);let p=["",om(e,g)];return f&&p.push(om(e,d.lineIndent(u.from,-1))),{changes:{from:s,to:a,insert:qt.of(p)},range:Ae.cursor(s+1+p[1].length)}});return n(e.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function M1(t,e){let n=-1;return t.changeByRange(r=>{let i=[];for(let a=r.from;a<=r.to;){let u=t.doc.lineAt(a);u.number>n&&(r.empty||r.to>u.from)&&(e(u,i,r),n=u.number),a=u.to+1}let s=t.changes(i);return{changes:i,range:Ae.range(s.mapPos(r.anchor,1),s.mapPos(r.head,1))}})}const lZ=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),r=new ny(t,{overrideIndentation:s=>{let a=n[s];return a??-1}}),i=M1(t,(s,a,u)=>{let f=kL(r,s.from);if(f==null)return;/\S/.test(s.text)||(f=0);let d=/^\s*/.exec(s.text)[0],g=om(t,f);(d!=g||u.from<s.from+d.length)&&(n[s.from]=f,a.push({from:s.from,to:s.from+d.length,insert:g}))});return i.changes.empty||e(t.update(i,{userEvent:"indent"})),!0},aZ=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(M1(t,(n,r)=>{r.push({from:n.from,insert:t.facet(R1)})}),{userEvent:"input.indent"})),!0),uZ=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(M1(t,(n,r)=>{let i=/^\s*/.exec(n.text)[0];if(!i)return;let s=Ym(i,t.tabSize),a=0,u=om(t,Math.max(0,s-im(t)));for(;a<i.length&&a<u.length&&i.charCodeAt(a)==u.charCodeAt(a);)a++;r.push({from:n.from+a,to:n.from+i.length,insert:u.slice(a)})}),{userEvent:"delete.dedent"})),!0),cZ=t=>(t.setTabFocusMode(),!0),fZ=[{key:"Ctrl-b",run:HL,shift:KL,preventDefault:!0},{key:"Ctrl-f",run:jL,shift:YL},{key:"Ctrl-p",run:UL,shift:ZL},{key:"Ctrl-n",run:$L,shift:JL},{key:"Ctrl-a",run:MQ,shift:jQ},{key:"Ctrl-e",run:OQ,shift:VQ},{key:"Ctrl-d",run:rB},{key:"Ctrl-h",run:MS},{key:"Ctrl-k",run:YQ},{key:"Ctrl-Alt-h",run:oB},{key:"Ctrl-o",run:ZQ},{key:"Ctrl-t",run:JQ},{key:"Ctrl-v",run:AS}],dZ=[{key:"ArrowLeft",run:HL,shift:KL,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:bQ,shift:DQ,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:TQ,shift:_Q,preventDefault:!0},{key:"ArrowRight",run:jL,shift:YL,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:xQ,shift:PQ,preventDefault:!0},{mac:"Cmd-ArrowRight",run:AQ,shift:HQ,preventDefault:!0},{key:"ArrowUp",run:UL,shift:ZL,preventDefault:!0},{mac:"Cmd-ArrowUp",run:vk,shift:xk},{mac:"Ctrl-ArrowUp",run:pk,shift:mk},{key:"ArrowDown",run:$L,shift:JL,preventDefault:!0},{mac:"Cmd-ArrowDown",run:bk,shift:Sk},{mac:"Ctrl-ArrowDown",run:AS,shift:yk},{key:"PageUp",run:pk,shift:mk},{key:"PageDown",run:AS,shift:yk},{key:"Home",run:EQ,shift:BQ,preventDefault:!0},{key:"Mod-Home",run:vk,shift:xk},{key:"End",run:RQ,shift:LQ,preventDefault:!0},{key:"Mod-End",run:bk,shift:Sk},{key:"Enter",run:wk,shift:wk},{key:"Mod-a",run:FQ},{key:"Backspace",run:MS,shift:MS,preventDefault:!0},{key:"Delete",run:rB,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:oB,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:KQ,preventDefault:!0},{mac:"Mod-Backspace",run:XQ,preventDefault:!0},{mac:"Mod-Delete",run:QQ,preventDefault:!0}].concat(fZ.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),hZ=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:wQ,shift:zQ},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:CQ,shift:NQ},{key:"Alt-ArrowUp",run:eZ},{key:"Shift-Alt-ArrowUp",run:nZ},{key:"Alt-ArrowDown",run:tZ},{key:"Shift-Alt-ArrowDown",run:rZ},{key:"Mod-Alt-ArrowUp",run:qQ},{key:"Mod-Alt-ArrowDown",run:GQ},{key:"Escape",run:WQ},{key:"Mod-Enter",run:sZ},{key:"Alt-l",mac:"Ctrl-l",run:UQ},{key:"Mod-i",run:$Q,preventDefault:!0},{key:"Mod-[",run:uZ},{key:"Mod-]",run:aZ},{key:"Mod-Alt-\\",run:lZ},{key:"Shift-Mod-k",run:iZ},{key:"Shift-Mod-\\",run:IQ},{key:"Mod-/",run:eQ},{key:"Alt-A",run:nQ},{key:"Ctrl-m",mac:"Shift-Alt-m",run:cZ}].concat(dZ),OS=16,lm=8,gZ=8,pZ=32,mZ=126,am=t=>t.toString(16).toUpperCase().padStart(2,"0"),uB=t=>t>=pZ&&t<=mZ?String.fromCharCode(t):".",yZ=t=>{const e=t.slice(0,lm).map(am).join(" "),n=t.slice(lm).map(am).join(" ");return n?`${e} ${n}`:e},vZ=(t,e)=>{let n="",r="",i="";const s=Math.min(e+OS,t.length);for(let a=e;a<s;a++){const u=am(t[a]);a<e+lm?n+=n?` ${u}`:u:r+=r?` ${u}`:u,i+=uB(t[a])}return{offset:e.toString(16).padStart(gZ,"0"),hex:r?`${n} ${r}`:n,ascii:i}},bZ=t=>{const e=[];for(let n=0;n<t.length;n+=OS)e.push(yZ(t.slice(n,n+OS)));return e.join(`
31
- `)},xZ=(t,e=64)=>{let n="";const r=Math.min(t.length,e);for(let i=0;i<r;i++)n+=uB(t[i]);return t.length>e?`${n}…`:n},SZ=t=>{const e=[];for(let r=0;r<t.length;r+=8192){let i="";const s=Math.min(r+8192,t.length);for(let a=r;a<s;a++)i+=String.fromCharCode(t[a]);e.push(i)}return btoa(e.join(""))},wZ=(t,e={})=>{const n=e.maxBytes??lm,r=`${t.length} B`;if(t.length===0)return r;const i=t.slice(0,n).map(am).join(" ");return t.length<=n?`${i} ${r}`:`${i} … ${r}`},CZ=/^[0-9a-fA-F]{4,16}(?::\s+|\s{2,})/,RZ=/\|[^|]*\|\s*$/,EZ=t=>{const e=t.split(/\r?\n/).map(r=>r.replace(RZ,"").replace(CZ,"")).join("").replace(/0x/gi,"").replace(/\s+/g,"");if(e.length===0)return{ok:!1,error:"Enter at least one byte."};if(!/^[0-9a-fA-F]+$/.test(e))return{ok:!1,error:"Hex input contains invalid characters."};if(e.length%2!==0)return{ok:!1,error:"Hex input must contain complete bytes."};const n=[];for(let r=0;r<e.length;r+=2)n.push(parseInt(e.slice(r,r+2),16));return{ok:!0,value:n}},TZ=t=>{const e=t.replace(/\s+/g,"");if(e.length===0)return{ok:!1,error:"Enter at least one byte."};let n;try{n=atob(e)}catch{return{ok:!1,error:"Base64 input is invalid."}}const r=[];for(let i=0;i<n.length;i++)r.push(n.charCodeAt(i));return{ok:!0,value:r}},Sp=(t,e)=>e==="hex"?bZ(t):SZ(t),cB=(t,e)=>e==="hex"?EZ(t):TZ(t),AZ=(t,e)=>{const n=cB(t,e);return n.ok?{bytes:n.value,error:null}:{bytes:null,error:n.error}},MZ=t=>{const e=t.mode??"hex";return t.initialBytes&&t.initialBytes.length>0?{mode:e,text:Sp(t.initialBytes,e),bytes:t.initialBytes,error:null}:{mode:e,text:"",bytes:null,error:null}},OZ=(t,e)=>{switch(e.type){case"set-text":return{...t,text:e.text,...AZ(e.text,t.mode)};case"normalize-paste":{const n=cB(e.text,t.mode);return n.ok?{...t,text:Sp(n.value,t.mode),bytes:n.value,error:null}:{...t,text:e.text,bytes:null,error:n.error}}case"switch-mode":return t.mode===e.mode?t:t.bytes!==null?{mode:e.mode,text:Sp(t.bytes,e.mode),bytes:t.bytes,error:null}:{mode:e.mode,text:"",bytes:null,error:null};case"replace-bytes":return{mode:t.mode,text:Sp(e.bytes,t.mode),bytes:e.bytes,error:null}}},kZ=wt.theme({"&":{color:"var(--foreground)",backgroundColor:"transparent",fontSize:"12px"},".cm-content":{caretColor:"var(--ring)",fontFamily:'ui-monospace, "Cascadia Mono", "Fira Code", Menlo, monospace',padding:"8px"},".cm-focused":{outline:"none"},".cm-gutters":{display:"none"},".cm-scroller":{overflow:"auto"}}),Ck=({label:t,active:e,onClick:n})=>I.jsx("button",{type:"button",onClick:n,className:ot("rounded-md px-2 py-1 text-xs font-medium transition-colors",e?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:t}),IZ=({initialBytes:t,onChange:e})=>{const[n,r]=E.useReducer(OZ,void 0,()=>MZ({})),i=E.useRef(t),[s,a]=E.useState(!!(i.current&&i.current.length>0)),u=E.useRef(null),f=E.useRef(null),d=E.useRef(n);d.current=n;const g=E.useRef(e);g.current=e,E.useEffect(()=>{const b=i.current;if(!b?.length)return;const S=window.setTimeout(()=>{r({type:"replace-bytes",bytes:b}),a(!1)},0);return()=>window.clearTimeout(S)},[]),E.useEffect(()=>{if(!u.current)return;const b=new wt({state:on.create({doc:d.current.text,extensions:[uQ(),EL.of([...hZ,...vQ]),kZ,wt.lineWrapping,wt.updateListener.of(S=>{if(!S.docChanged)return;const w=S.state.doc.toString();if(w===d.current.text)return;const C=S.transactions.some(R=>R.isUserEvent("input.paste"));r({type:C?"normalize-paste":"set-text",text:w})})]}),parent:u.current});return f.current=b,()=>{b.destroy(),f.current=null}},[]),E.useEffect(()=>{const b=f.current;if(!b)return;const S=b.state.doc.toString();S!==n.text&&b.dispatch({changes:{from:0,to:S.length,insert:n.text}})},[n.text]),E.useEffect(()=>{g.current(n.bytes)},[n.bytes]);const p=n.bytes?.length??t?.length??0,m=n.bytes?xZ(n.bytes):"",v=b=>{n.mode!==b&&r({type:"switch-mode",mode:b})};return I.jsxs("div",{className:"flex flex-col gap-2",children:[I.jsxs("div",{className:"flex items-center gap-1",children:[I.jsx(Ck,{label:"Hex",active:n.mode==="hex",onClick:()=>v("hex")}),I.jsx(Ck,{label:"Base64",active:n.mode==="base64",onClick:()=>v("base64")})]}),I.jsx("div",{ref:u,className:"min-h-[120px] max-h-[300px] overflow-auto rounded-md border border-input bg-muted"}),s?I.jsxs("div",{className:"text-xs text-muted-foreground",children:["Preparing editor for ",t?.length??0," bytes…"]}):null,I.jsxs("div",{className:"flex flex-col gap-1 text-xs",children:[I.jsxs("div",{className:"text-muted-foreground",children:[p," bytes"]}),m&&I.jsxs("div",{className:"overflow-hidden text-ellipsis whitespace-nowrap text-muted-foreground",children:["ASCII:"," ",I.jsx("span",{className:"font-mono text-foreground",children:m})]}),n.error&&I.jsx("div",{className:"text-destructive",children:n.error})]})]})},DZ={string:"Text",number:"Number",boolean:"Boolean",buffer:"Hex"},PZ=["string","number","boolean","buffer"],zZ=({supportedTypes:t,value:e,onChange:n})=>{const r=PZ.filter(i=>t.includes(i));return r.length<=1?null:I.jsx("div",{role:"tablist","aria-label":"Edit as",className:"inline-flex overflow-hidden rounded-md border border-border",children:r.map(i=>I.jsx("button",{type:"button",role:"tab","aria-selected":e===i,onClick:()=>n(i),className:ot("px-3 py-1 text-xs font-medium transition-colors",e===i?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:DZ[i]},i))})},NZ=new TextEncoder,LZ=new TextDecoder("utf-8",{fatal:!0}),Mb=t=>{try{return LZ.decode(new Uint8Array(t))}catch{return""}},Ob=t=>Array.from(NZ.encode(t)),BZ=(t,e,n)=>{if(t===e)return n;if(t==="string"){const r=n;switch(e){case"number":{const i=Number(r);return Number.isNaN(i)?0:i}case"boolean":return r==="true";case"buffer":return Ob(r)}}if(t==="number"){const r=n;switch(e){case"string":return String(r);case"boolean":return r!==0;case"buffer":return Ob(String(r))}}if(t==="boolean"){const r=n;switch(e){case"string":return String(r);case"number":return r?1:0;case"buffer":return Ob(String(r))}}if(t==="buffer"){const r=n;switch(e){case"string":return Mb(r);case"number":{const i=Mb(r),s=Number(i);return Number.isNaN(s)?0:s}case"boolean":return Mb(r)==="true"}}return n},pc=t=>{switch(t){case"string":return"";case"number":return 0;case"boolean":return!1;case"buffer":return[]}},fB=({supportedTypes:t,type:e,value:n,onChange:r,inputId:i,autoFocus:s})=>{const a=u=>{if(u!==e){if(n===null){r(u,pc(u));return}r(u,BZ(e,u,n))}};return I.jsxs("div",{className:"flex flex-col gap-2",children:[I.jsx(zZ,{supportedTypes:t,value:e,onChange:a}),e==="buffer"?I.jsx(IZ,{initialBytes:Array.isArray(n)?n:void 0,onChange:u=>r("buffer",u)}):e==="boolean"?I.jsxs(Ju,{value:String(n??!1),onValueChange:u=>r("boolean",u==="true"),children:[I.jsx(Ju.Trigger,{id:i,autoFocus:s,children:I.jsx(Ju.Value,{})}),I.jsxs(Ju.Content,{children:[I.jsx(Ju.Item,{value:"true",children:"true"}),I.jsx(Ju.Item,{value:"false",children:"false"})]})]}):e==="number"?I.jsx(Ux,{id:i,type:"number",value:String(n??""),onChange:u=>{const f=u.target.value,d=f===""?0:Number(f);r("number",Number.isNaN(d)?0:d)},placeholder:"Enter number value",autoFocus:s}):I.jsx(Ux,{id:i,type:"text",value:String(n??""),onChange:u=>r("string",u.target.value),placeholder:"Enter string value",autoFocus:s})]})},_Z=(t,e,n)=>{switch(e){case"string":return{key:t,type:"string",value:n};case"number":return{key:t,type:"number",value:n};case"boolean":return{key:t,type:"boolean",value:n};case"buffer":return{key:t,type:"buffer",value:n}}},HZ=({isOpen:t,onClose:e,onAddEntry:n,existingKeys:r,supportedTypes:i})=>{const s=i.includes("string")?"string":i[0]??"string",[a,u]=E.useState(""),[f,d]=E.useState(s),[g,p]=E.useState(pc(s)),[m,v]=E.useState(null);E.useEffect(()=>{t&&(u(""),d(s),p(pc(s)))},[t,s]);const b=i.includes(f),S=()=>{u(""),d(s),p(pc(s)),e()},w=()=>{if(!(!a.trim()||g===null)){if(!b){v({title:"Unsupported Type",message:"Selected type is not supported by this storage."});return}if(r.includes(a)){v({title:"Key Already Exists",message:"An entry with this key already exists."});return}n(_Z(a,f,g)),S()}},C=T=>{T.key==="Enter"&&a.trim()&&f!=="buffer"&&w()},R=!a.trim()||!b||g===null;return I.jsxs(I.Fragment,{children:[I.jsx(sn,{open:t,onOpenChange:T=>{T||S()},children:I.jsxs(sn.Content,{onKeyDown:C,children:[I.jsx(sn.Header,{children:I.jsx(sn.Title,{children:"Add New Entry"})}),I.jsxs("div",{className:"flex flex-col gap-4",children:[I.jsxs(Eo,{children:[I.jsx(Eo.Label,{htmlFor:"new-entry-key",children:"Key"}),I.jsx(Ux,{id:"new-entry-key",value:a,onChange:T=>u(T.target.value),placeholder:"Enter key name",autoFocus:!0})]}),I.jsxs(Eo,{children:[I.jsx(Eo.Label,{htmlFor:"new-entry-value",children:"Value"}),I.jsx(fB,{supportedTypes:i,type:f,value:g,onChange:(T,A)=>{d(T),p(A)},inputId:"new-entry-value"}),!b&&I.jsx(Eo.Description,{className:"text-destructive",children:"Selected type is not supported by this storage."})]})]}),I.jsxs(sn.Footer,{children:[I.jsx(Li,{variant:"outline",onClick:S,children:"Cancel"}),I.jsx(Li,{onClick:w,disabled:R,children:"Add Entry"})]})]})}),I.jsx(ed,{open:m!==null,onOpenChange:T=>{T||v(null)},variant:"alert",title:m?.title??"",description:m?.message})]})},jZ=({isOpen:t,onClose:e,onEditEntry:n,entry:r,supportedTypes:i})=>{const s=E.useRef(r),[a,u]=E.useState("string"),[f,d]=E.useState(pc("string")),[g,p]=E.useState(null);E.useEffect(()=>{r&&t&&(s.current=r,u(r.type),d(r.value))},[r,t]);const m=r??s.current,v=i.includes(a),b=()=>{u("string"),d(pc("string")),e()},S=()=>{if(!(!r||f===null)){if(!v){p({title:"Unsupported Type",message:"This storage does not support the selected type."});return}n(r.key,f),b()}},w=R=>{R.key==="Enter"&&a!=="buffer"&&S()};if(!m)return null;const C=!v||f===null;return I.jsxs(I.Fragment,{children:[I.jsx(sn,{open:t,onOpenChange:R=>{R||b()},children:I.jsxs(sn.Content,{onKeyDown:w,children:[I.jsx(sn.Header,{children:I.jsx(sn.Title,{children:"Edit Entry"})}),I.jsxs("div",{className:"flex flex-col gap-4",children:[I.jsxs(Eo,{children:[I.jsx(Eo.Label,{children:"Key"}),I.jsx("div",{className:"h-8 w-full truncate rounded-md border border-input bg-muted px-3 py-1.5 font-mono text-sm text-foreground",children:m.key}),I.jsx(Eo.Description,{children:"Key cannot be changed during editing"})]}),I.jsxs(Eo,{children:[I.jsx(Eo.Label,{htmlFor:"edit-entry-value",children:"Value"}),I.jsx(fB,{supportedTypes:i,type:a,value:f,onChange:(R,T)=>{u(R),d(T)},inputId:"edit-entry-value",autoFocus:!0},m.key),!v&&I.jsxs(Eo.Description,{className:"text-destructive",children:["This storage does not support ",a," values."]})]})]}),I.jsxs(sn.Footer,{children:[I.jsx(Li,{variant:"outline",onClick:b,children:"Cancel"}),I.jsx(Li,{onClick:S,disabled:C,children:"Save Changes"})]})]})}),I.jsx(ed,{open:g!==null,onOpenChange:R=>{R||p(null)},variant:"alert",title:g?.title??"",description:g?.message})]})},VZ=t=>t.type==="string"?I.jsxs("span",{className:"font-mono text-foreground",children:['"',t.value,'"']}):t.type==="number"?I.jsx("span",{className:"font-mono text-foreground",children:t.value}):t.type==="boolean"?I.jsx("span",{className:ot("font-mono",t.value?"text-primary":"text-destructive"),children:t.value?"true":"false"}):I.jsx("span",{className:"font-mono text-muted-foreground",children:wZ(t.value)}),FZ=5e4,Rk=2e3,UZ=t=>{const e=[];let n=0;for(;n<t.length;){const r=t.indexOf(`
32
- `,n),i=r===-1?t.length:r+1;for(let s=n;s<i;s+=Rk)e.push([s,Math.min(s+Rk,i)]);n=i}return e.length===0?[[0,0]]:e},$Z=({value:t})=>{const e=E.useMemo(()=>t.length>FZ?UZ(t):null,[t]);return e?I.jsx(nN,{"aria-label":"Large string value",className:"font-mono text-sm text-success",style:{height:384},totalCount:e.length,itemContent:n=>{const[r,i]=e[n];return I.jsxs("div",{className:"whitespace-pre-wrap wrap-anywhere",children:[n===0?'"':"",t.slice(r,i),n===e.length-1?'"':""]})}}):I.jsxs("pre",{className:"font-mono text-sm text-success whitespace-pre-wrap wrap-anywhere",children:['"',t,'"']})},qZ=({bytes:t})=>{const e=Math.ceil(t.length/16);return e===0?I.jsx("div",{className:"text-xs text-muted italic",children:"No bytes to display."}):I.jsx(nN,{"aria-label":"Buffer hexdump",className:"font-mono text-xs text-accent",style:{height:384},totalCount:e,itemContent:n=>{const r=vZ(t,n*16);return I.jsxs("div",{className:"flex gap-4 leading-snug whitespace-pre",children:[I.jsx("span",{className:"text-muted",children:r.offset}),I.jsx("span",{children:r.hex}),I.jsxs("span",{className:"text-muted",children:["|",r.ascii,"|"]})]})}})},GZ=5e4,WZ=t=>{try{const e=JSON.parse(t);return Array.isArray(e)||e&&typeof e=="object"?e:null}catch{return null}},KZ=({open:t,onOpenChange:e,onEdit:n,entry:r})=>{const i=r?.type==="string",s=i?r.value:"",a=E.useMemo(()=>!i||s.length>GZ?null:WZ(s),[i,s]);return I.jsx(sn,{open:t,onOpenChange:e,children:I.jsxs(sn.Content,{className:"max-w-2xl",children:[I.jsx(sn.Header,{children:I.jsxs("div",{className:"flex items-center gap-2",children:[I.jsx(u8,{className:"h-4 w-4 text-muted-foreground"}),I.jsx(sn.Title,{children:"Entry Details"})]})}),r&&I.jsxs("div",{className:"flex max-h-[70vh] flex-col gap-4 overflow-auto",children:[I.jsxs("div",{children:[I.jsx("div",{className:"mb-1 text-sm font-medium text-foreground",children:"Key"}),I.jsx("div",{className:"w-full break-all rounded-md border border-input bg-muted px-3 py-2 font-mono text-sm text-foreground",children:r.key})]}),I.jsxs("div",{children:[I.jsx("div",{className:"mb-1 text-sm font-medium text-foreground",children:"Type"}),I.jsx(Fp,{variant:"outline",children:r.type})]}),I.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[I.jsx("div",{className:"mb-1 text-sm font-medium text-foreground",children:"Value"}),I.jsx("div",{className:"max-h-96 overflow-auto rounded-md border border-input bg-muted p-3",children:a?I.jsx(KW,{data:a}):r.type==="buffer"?I.jsxs("div",{className:"flex flex-col gap-2",children:[I.jsxs("div",{className:"text-xs text-muted-foreground",children:[r.value.length," ",r.value.length===1?"byte":"bytes"]}),I.jsx(qZ,{bytes:r.value})]}):r.type==="string"?I.jsx($Z,{value:r.value}):I.jsx("div",{className:"text-sm",children:VZ(r)})})]})]}),I.jsxs(sn.Footer,{children:[r&&n&&I.jsxs(Li,{variant:"outline",onClick:()=>n(r),children:[I.jsx(tD,{className:"h-3.5 w-3.5"}),"Edit"]}),I.jsx(sn.Close,{render:I.jsx(Li,{}),children:"Close"})]})]})})},kb=({title:t,items:e})=>e.length===0?null:I.jsxs("div",{children:[I.jsxs("div",{className:"text-xs font-medium text-foreground",children:[t," (",e.length,")"]}),I.jsxs("div",{className:"mt-1 max-h-24 overflow-auto rounded-md bg-muted px-2 py-1 font-mono text-xs text-muted-foreground",children:[e.slice(0,50).join(", "),e.length>50?`, +${e.length-50} more`:""]})]}),Ib=({label:t,value:e})=>I.jsxs("div",{className:"rounded-md bg-muted p-2",children:[I.jsx("div",{className:"text-muted-foreground",children:t}),I.jsx("div",{className:"text-base font-semibold text-foreground",children:e})]}),YZ=({state:t,onApply:e,onCancel:n})=>{const{snapshot:r,preview:i,entriesToWrite:s,targetLabel:a}=t,u=i.unsupportedTypes.length>0,f=`${r.storage.adapterName} / ${r.storage.storageName}`;return I.jsxs(I.Fragment,{children:[I.jsxs("div",{className:"flex flex-col gap-3",children:[i.metadataMismatch&&I.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-border bg-muted p-2 text-xs text-foreground",children:[I.jsx(t8,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"}),I.jsxs("div",{children:["This file was exported from ",I.jsx("strong",{children:f}),". You are importing into ",I.jsx("strong",{children:a}),"."]})]}),u&&I.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-destructive/40 bg-destructive/10 p-2 text-xs text-destructive",children:[I.jsx(nD,{className:"mt-0.5 h-4 w-4 shrink-0"}),I.jsxs("div",{children:[i.unsupportedTypes.length," ",i.unsupportedTypes.length===1?"entry has a type":"entries have types"," ","not supported by this storage. Remove them from the file and try again.",I.jsx("div",{className:"mt-1 max-h-20 overflow-auto rounded-md bg-muted px-2 py-1 font-mono text-xs",children:i.unsupportedTypes.map(d=>`${d.key} (${d.type})`).join(", ")})]})]}),I.jsxs("div",{className:"grid grid-cols-3 gap-2 text-xs",children:[I.jsx(Ib,{label:"New",value:i.newKeys.length}),I.jsx(Ib,{label:"Overwrite",value:i.overwriteKeys.length}),I.jsx(Ib,{label:"Skipped",value:i.skippedKeys.length})]}),I.jsx(kb,{title:"New keys",items:i.newKeys}),I.jsx(kb,{title:"Overwrite keys",items:i.overwriteKeys}),I.jsx(kb,{title:"Skipped (filtered by storage)",items:i.skippedKeys.map(d=>d.key)})]}),I.jsxs(sn.Footer,{children:[I.jsx(Li,{variant:"outline",onClick:n,children:"Cancel"}),I.jsxs(Li,{onClick:e,disabled:u,children:["Apply (",s.length,")"]})]})]})},XZ=({state:t})=>I.jsxs("div",{className:"flex flex-col items-center gap-3 py-6",children:[I.jsx(c8,{className:"h-6 w-6 animate-spin text-muted-foreground"}),I.jsxs("div",{className:"text-sm text-foreground",children:["Importing… ",t.written," / ",t.total]})]}),QZ=({state:t,onClose:e})=>I.jsxs(I.Fragment,{children:[t.ok?I.jsxs("div",{className:"flex flex-col items-center gap-3 py-4",children:[I.jsx(n8,{className:"h-8 w-8 text-primary"}),I.jsxs("div",{className:"text-sm text-foreground",children:["Imported ",t.written," ",t.written===1?"entry":"entries","."]})]}):I.jsxs("div",{className:"flex flex-col gap-2 py-2",children:[I.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[I.jsx(nD,{className:"h-5 w-5"}),I.jsxs("div",{className:"text-sm font-medium",children:["Import failed after ",t.written," of ",t.total,"."]})]}),t.failedKey&&I.jsxs("div",{className:"text-xs text-muted-foreground",children:["Failed at key:"," ",I.jsx(Fp,{variant:"outline",className:"font-mono",children:t.failedKey})]}),I.jsx("div",{className:"rounded-md bg-muted px-2 py-1 font-mono text-xs text-destructive",children:t.error})]}),I.jsx(sn.Footer,{children:I.jsx(Li,{onClick:e,autoFocus:!0,children:"Close"})})]}),ZZ=({state:t,onApply:e,onCancel:n,onClose:r})=>{const i=t===null?"":t.phase==="preview"?"Import snapshot":t.phase==="importing"?"Importing…":t.ok?"Import complete":"Import failed",s=t!==null&&t.phase!=="importing";return I.jsx(sn,{open:t!==null,onOpenChange:a=>{!a&&s&&r()},children:I.jsxs(sn.Content,{showCloseButton:s,children:[I.jsx(sn.Header,{children:I.jsx(sn.Title,{children:i})}),t?.phase==="preview"&&I.jsx(YZ,{state:t,onApply:e,onCancel:n}),t?.phase==="importing"&&I.jsx(XZ,{state:t}),t?.phase==="result"&&I.jsx(QZ,{state:t,onClose:r})]})})},JZ={defaultOptions:{queries:{gcTime:0,refetchOnReconnect:!1,refetchOnWindowFocus:!1,retry:!1}}},eJ=()=>new QF(JZ),tJ=({children:t})=>{const[e]=E.useState(eJ);return E.useEffect(()=>()=>e.clear(),[e]),I.jsx(t4,{client:e,children:t})},nJ=t=>{const e=new Map;for(const[n,r]of t){const{adapterId:i}=r.target;let s=e.get(i);s||(s={adapterId:i,adapterName:r.adapterName,items:[]},e.set(i,s)),s.items.push({viewId:n,storageName:r.storageName,entryCount:r.entryCount})}return[...e.values()]},rJ=100,iJ=5,dB=t=>t.trim().toLowerCase(),O1=t=>["storage-entry-previews",t.adapterId,t.storageId],oJ=(t,e,n)=>[...O1(t),dB(e),n],k1=t=>["storage-full-entry",t.adapterId,t.storageId],hB=(t,e)=>[...k1(t),e],Ek=async(t,e)=>{const n=O1(e),r=k1(e);await t.cancelQueries({queryKey:n}),await t.cancelQueries({queryKey:r}),t.removeQueries({queryKey:r}),await t.resetQueries({queryKey:n})},sJ=async(t,e)=>t.invalidateQueries({queryKey:O1(e)}),lJ=async(t,e,n)=>{const r=n==null?k1(e):hB(e,n);await t.cancelQueries({queryKey:r,exact:n!=null}),t.removeQueries({queryKey:r,exact:n!=null})},aJ=({client:t,target:e,search:n,keySortDirection:r,pageSize:i=rJ,maxPages:s=iJ})=>{const a=dB(n),u=E.useMemo(()=>e?oJ(e,a,r):["storage-entry-previews","no-target"],[r,a,e?.adapterId,e?.storageId]);return h4({queryKey:u,enabled:t!=null&&e!=null,initialPageParam:void 0,maxPages:Math.max(1,s),placeholderData:zF,queryFn:({pageParam:f,signal:d})=>{if(!t||!e)throw new Error("A storage target and request client are required.");return t.request({requestType:"list-entry-previews",responseType:"entry-previews",errorType:"storage-request-error",payload:{type:"list-entry-previews",target:e,search:a||void 0,keySortDirection:r,cursor:f,limit:i},signal:d})},getNextPageParam:f=>f.nextCursor,getPreviousPageParam:f=>f.previousCursor,refetchOnWindowFocus:!1})},uJ=t=>t?.pages.flatMap(e=>e.items)??[],cJ=({client:t,target:e,key:n,enabled:r=!0})=>{const i=HS(),s=E.useMemo(()=>e&&n!=null?hB(e,n):["storage-full-entry","no-entry"],[n,e?.adapterId,e?.storageId]),a=d4({queryKey:s,enabled:r&&t!=null&&e!=null&&n!=null,gcTime:0,queryFn:({signal:f})=>{if(!t||!e||n==null)throw new Error("A storage target, key, and request client are required.");return t.request({requestType:"get-entry",responseType:"entry",errorType:"storage-request-error",payload:{type:"get-entry",target:e,key:n},signal:f})},refetchOnWindowFocus:!1});E.useEffect(()=>()=>{i.cancelQueries({queryKey:s}),i.removeQueries({queryKey:s})},[i,s]);const u=E.useCallback(()=>{i.cancelQueries({queryKey:s}),i.removeQueries({queryKey:s})},[i,s]);return{...a,entry:a.data?.entry,reset:u}},fJ=(t,e)=>{const n=JSON.stringify(t,null,2),r=new Blob([n],{type:"application/json"}),i=URL.createObjectURL(r),s=document.createElement("a");s.href=i,s.download=e,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(i)},Tk=t=>t.replace(/[^a-zA-Z0-9_-]/g,"-"),dJ=(t,e=new Date)=>{const n=e.getFullYear().toString().padStart(4,"0"),r=(e.getMonth()+1).toString().padStart(2,"0"),i=e.getDate().toString().padStart(2,"0"),s=e.getHours().toString().padStart(2,"0"),a=e.getMinutes().toString().padStart(2,"0"),u=e.getSeconds().toString().padStart(2,"0"),f=`${n}${r}${i}-${s}${a}${u}`;return`rozenite-storage-${Tk(t.adapterId)}-${Tk(t.storageId)}-${f}.json`},Xi=(t,e)=>t.adapterId===e.adapterId&&t.storageId===e.storageId,Ak=t=>typeof t=="string"?"string":typeof t=="number"?"number":typeof t=="boolean"?"boolean":"buffer",hJ=(t,e=250)=>{const[n,r]=E.useState(t);return E.useEffect(()=>{const i=window.setTimeout(()=>r(t),e);return()=>window.clearTimeout(i)},[e,t]),n};function gJ(){const[t,e]=E.useState([]),[n,r]=E.useState(null),[i,s]=E.useState(""),[a,u]=E.useState("ascending"),[f,d]=E.useState(null),[g,p]=E.useState(!1),[m,v]=E.useState(null),[b,S]=E.useState(!1),[w,C]=E.useState(0),[R,T]=E.useState({status:"idle"}),[A,O]=E.useState(null),[P,M]=E.useState(null),D=E.useRef(null),L=E.useRef(null),H=E.useRef(0),N=E.useRef(null),_=E.useRef(null),$=E.useRef(0),F=E.useRef(null),G=E.useRef(!1),j=E.useRef(!1),q=E.useRef(new Set),V=k4({pluginId:"@rozenite/storage-plugin"}),te=HS(),J=hJ(i),z=t.find(Q=>n&&Xi(Q.target,n)),U=aJ({client:V,target:n,search:J,keySortDirection:a}),W=cJ({client:V,target:n,key:f?.key,enabled:f!==null}),X=uJ(U.data),ie=z?.capabilities.supportedTypes??[],ee=E.useMemo(()=>{const Q=new Map(t.map(Se=>[jg(Se.target),Se]));return nJ(Q)},[t]),ue=()=>{W.reset(),d(null)},Y=async()=>{n&&(ue(),C(Q=>Q+1),await Ek(te,n))};E.useEffect(()=>{if(!V)return;const Q=V.onMessage("storage-descriptors",Te=>{Te.requestId===`discovery-${H.current}`&&(e(Te.storages),r(_e=>_e&&Te.storages.some(nt=>Xi(nt.target,_e))?_e:Te.storages[0]?.target??null))}),Se=V.onMessage("import-progress",Te=>{O(_e=>_e?.phase==="importing"&&_e.requestId===Te.requestId&&Xi(_e.target,Te.target)?{..._e,written:Te.written,total:Te.total}:_e)}),ge=V.onMessage("import-result",Te=>{F.current===Te.requestId&&L.current&&Xi(Te.target,L.current)&&(F.current=null,ue(),C(_e=>_e+1),Ek(te,Te.target)),O(_e=>_e?.phase!=="importing"||_e.requestId!==Te.requestId||!Xi(_e.target,Te.target)?_e:Te.ok?{phase:"result",ok:!0,written:Te.written}:{phase:"result",ok:!1,written:Te.written,total:Te.total,failedKey:Te.failedKey,error:Te.error??"Unknown error"})}),De=V.onMessage("storage-invalidated",Te=>{lJ(te,Te.target,Te.key),Te.operation==="purge"&&e(nt=>nt.map(Mt=>Xi(Mt.target,Te.target)?{...Mt,entryCount:0}:Mt)),L.current&&Xi(Te.target,L.current)&&d(nt=>nt&&(Te.key==null||nt.key===Te.key)?null:nt);const _e=jg(Te.target);q.current.has(_e)||(q.current.add(_e),queueMicrotask(()=>{q.current.delete(_e),L.current&&Xi(Te.target,L.current)&&C(nt=>nt+1),sJ(te,Te.target)}))});return H.current+=1,V.send("discover-storages",{type:"discover-storages",requestId:`discovery-${H.current}`}),()=>{Q.remove(),Se.remove(),ge.remove(),De.remove()}},[V,te]),E.useEffect(()=>{L.current=n,N.current?.abort(),N.current=null,_.current?.abort(),_.current=null,F.current=null,T({status:"idle"}),v(null),S(!1),d(null),O(null)},[n]),E.useEffect(()=>()=>{N.current?.abort(),_.current?.abort()},[]);const le=Q=>{Q()},xe=(Q,Se)=>{if(!V||!n||!ie.includes(Ak(Se)))return;const ge=Ak(Se),De=ge==="string"?{key:Q,type:ge,value:Se}:ge==="number"?{key:Q,type:ge,value:Se}:ge==="boolean"?{key:Q,type:ge,value:Se}:{key:Q,type:ge,value:Se};le(()=>V.send("set-entry",{type:"set-entry",target:n,entry:De}))},ve=Q=>{!V||!n||le(()=>V.send("set-entry",{type:"set-entry",target:n,entry:Q}))},de=()=>{if(!V||!n||!m)return;const Q=m;v(null),le(()=>V.send("delete-entry",{type:"delete-entry",target:n,key:Q}))},me=()=>{!V||!n||(S(!1),V.send("purge-storage",{type:"purge-storage",target:n}))},Ce=(Q,Se)=>M({title:Q,message:Se}),Pe=()=>{D.current&&(D.current.value="",D.current.click())},ze=async Q=>{const Se=Q.target.files?.[0];if(!Se||!V||!n)return;let ge;try{ge=JSON.parse(await Se.text())}catch(nt){Ce("Could not read file",nt instanceof Error?nt.message:String(nt));return}const De=tK(ge);if(!De.ok){Ce("Invalid snapshot",`${De.error.path}: ${De.error.message}`);return}_.current?.abort();const Te=new AbortController;_.current=Te;const _e=n;try{const nt=await V.request({requestType:"preview-import",responseType:"import-preview",errorType:"storage-request-error",payload:{type:"preview-import",target:_e,snapshot:De.snapshot},signal:Te.signal});if(Te.signal.aborted||!Xi(_e,L.current??_e))return;O({phase:"preview",target:_e,targetLabel:z?`${z.adapterName} / ${z.storageName}`:"selected storage",snapshot:De.snapshot,preview:nt.preview,entriesToWrite:nt.preview.acceptedEntryIndexes.map(Mt=>De.snapshot.entries[Mt])})}catch{!Te.signal.aborted&&Xi(_e,L.current??_e)&&Ce("Could not preview import","Could not inspect the selected storage. Please try again.")}finally{_.current===Te&&(_.current=null)}},Ee=()=>{if(!V||A?.phase!=="preview")return;const Q=`import-${++$.current}`;F.current=Q,V.send("import-entries",{type:"import-entries",requestId:Q,target:A.target,entries:A.entriesToWrite}),O({phase:"importing",requestId:Q,target:A.target,total:A.entriesToWrite.length,written:0})},Ve=async()=>{if(!V||!n||N.current)return;const Q=n,Se=new AbortController;N.current=Se,T({status:"loading"});try{const ge=await V.request({requestType:"export-snapshot",responseType:"export-snapshot-result",errorType:"storage-request-error",payload:{type:"export-snapshot",target:Q},signal:Se.signal});!Se.signal.aborted&&Xi(Q,L.current??Q)&&(fJ(ge.snapshot,dJ(Q)),T({status:"idle"}))}catch{!Se.signal.aborted&&Xi(Q,L.current??Q)&&T({status:"error",message:"Could not export the selected storage. Please try again."})}finally{N.current===Se&&(N.current=null)}},Ie=E.useMemo(()=>[{id:"key",accessorKey:"key",header:"Key",enableSorting:!0,cell:({row:Q})=>I.jsx("span",{className:"font-mono text-sm text-foreground",children:Q.original.key})},{id:"type",accessorKey:"type",header:"Type",enableSorting:!1,cell:({row:Q})=>I.jsx(Fp,{variant:"outline",children:Q.original.type})},{id:"preview",accessorKey:"preview",header:"Value",enableSorting:!1,cell:({row:Q})=>I.jsxs("div",{className:"min-w-0",children:[I.jsx("span",{className:"break-all font-mono text-sm text-foreground",children:Q.original.preview}),I.jsx("span",{className:"ml-2 text-xs text-muted-foreground",title:Q.original.isTruncated?`Full value size: ${Q.original.valueSize}`:void 0,children:Q.original.isTruncated?`truncated · ${Q.original.valueSize}`:Q.original.valueSize})]})},{id:"actions",header:"",enableSorting:!1,cell:({row:Q})=>I.jsxs("div",{className:"flex items-center gap-1",onClick:Se=>Se.stopPropagation(),children:[I.jsx(Li,{variant:"ghost",size:"icon",onClick:()=>d({key:Q.original.key,mode:"edit"}),"aria-label":`Edit value for ${Q.original.key}`,children:I.jsx(tD,{className:"h-3.5 w-3.5"})}),I.jsx(Li,{variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-destructive",onClick:()=>v(Q.original.key),"aria-label":`Delete entry ${Q.original.key}`,children:I.jsx(_A,{className:"h-3.5 w-3.5"})})]})}],[]),He=[{id:"key",desc:a==="descending"}],Ge=Q=>{const ge=(typeof Q=="function"?Q(He):Q).find(De=>De.id==="key");u(ge?.desc?"descending":"ascending")},We=()=>{!U.hasNextPage||U.isFetching||U.isFetchingNextPage||G.current||(G.current=!0,U.fetchNextPage().finally(()=>{G.current=!1}))},fe=()=>{!U.hasPreviousPage||U.isFetching||U.isFetchingPreviousPage||j.current||(j.current=!0,U.fetchPreviousPage().finally(()=>{j.current=!1}))},ne=n?jg(n):"";return I.jsxs(yO,{children:[I.jsx(yO.Body,{children:I.jsxs(Hg,{direction:"horizontal",autoSaveId:"storage",children:[I.jsx(Hg.Pane,{defaultSize:22,minSize:15,maxSize:40,children:I.jsx(ub,{className:"w-full border-r-0",children:ee.length===0?I.jsx("div",{className:"flex flex-1 items-center justify-center p-4 text-center text-xs text-sidebar-foreground/60",children:"Waiting for storages…"}):ee.map(Q=>I.jsx(ub.Group,{label:Q.adapterName,children:Q.items.map(Se=>I.jsx(ub.Item,{selected:Se.viewId===ne,trailing:I.jsx(Fp,{variant:"secondary",children:Se.entryCount}),onClick:()=>{const ge=t.find(De=>jg(De.target)===Se.viewId);ge&&r(ge.target)},children:Se.storageName},Se.viewId))},Q.adapterId))})}),I.jsx(Hg.Handle,{}),I.jsx(Hg.Pane,{children:I.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[I.jsxs(Yi,{children:[I.jsxs(Yi.Group,{children:[I.jsx(Yi.Button,{onClick:()=>p(!0),disabled:!z,"aria-label":"Add entry",title:"Add entry",className:"w-7 px-0",children:I.jsx(d8,{className:"h-3.5 w-3.5"})}),I.jsx(Yi.Button,{onClick:()=>S(!0),disabled:!V||!n||U.isFetching,"aria-label":"Purge storage",title:"Purge storage",className:"w-7 px-0 text-muted-foreground hover:text-destructive",children:I.jsx(_A,{className:"h-3.5 w-3.5"})})]}),I.jsx(Yi.Separator,{}),I.jsx(Yi.Group,{children:I.jsx(Yi.Button,{onClick:()=>{Y()},disabled:!n||U.isFetching,"aria-label":"Refresh storage",title:"Refresh storage",className:"w-7 px-0",children:I.jsx(h8,{className:"h-3.5 w-3.5"})})}),I.jsx(Yi.Separator,{}),I.jsxs(Yi.Group,{children:[I.jsx(Yi.Button,{onClick:Pe,disabled:!z,"aria-label":"Import storage",title:"Import storage",className:"w-7 px-0",children:I.jsx(m8,{className:"h-3.5 w-3.5"})}),I.jsx(Yi.Button,{onClick:Ve,disabled:!V||!n||R.status==="loading","aria-label":R.status==="loading"?"Exporting storage":"Export storage",title:R.status==="loading"?"Exporting storage":"Export storage",className:"w-7 px-0",children:I.jsx(l8,{className:"h-3.5 w-3.5"})})]}),I.jsx(Yi.Separator,{}),I.jsx("div",{className:"min-w-40 flex-1",children:I.jsx(zW,{placeholder:"Search keys…",value:i,onChange:Q=>s(Q.target.value),onClear:()=>s(""),disabled:!z})}),R.status==="error"?I.jsx("span",{role:"alert",className:"text-xs text-destructive",children:R.message}):null,I.jsx("input",{ref:D,type:"file",accept:"application/json,.json",className:"hidden",onChange:ze})]}),I.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:z?I.jsx(HW,{ariaLabel:"Storage entries",columns:Ie,data:X,getRowId:Q=>Q.key,getRowTextValue:Q=>Q.key,loading:U.isLoading,emptyMessage:J?"No entries match your search.":"This storage is empty.",manualSorting:!0,onEndReached:We,onRowClick:Q=>d({key:Q.key,mode:"detail"}),onSortingChange:Ge,onStartReached:fe,scrollClassName:"h-full w-full overflow-auto",style:{height:"100%"},sorting:He},w):I.jsx($W,{icon:s8,title:"No storage selected",description:"Choose a storage from the sidebar to inspect its entries."})})]})})]})}),I.jsx(HZ,{isOpen:g,onClose:()=>p(!1),onAddEntry:ve,existingKeys:X.map(Q=>Q.key),supportedTypes:ie}),I.jsx(KZ,{open:f?.mode==="detail"&&W.entry!=null,onOpenChange:Q=>{Q||ue()},onEdit:()=>d(Q=>Q&&{...Q,mode:"edit"}),entry:W.entry??null}),I.jsx(jZ,{isOpen:f?.mode==="edit"&&W.entry!=null,onClose:ue,onEditEntry:xe,entry:W.entry??null,supportedTypes:ie}),I.jsx(ZZ,{state:A,onApply:Ee,onCancel:()=>O(null),onClose:()=>O(null)}),I.jsx(ed,{open:m!==null,onOpenChange:Q=>{Q||v(null)},variant:"confirm",destructive:!0,title:"Delete Entry",description:m?`Are you sure you want to delete the entry "${m}"?`:void 0,confirmLabel:"Delete",onConfirm:de}),I.jsx(ed,{open:b,onOpenChange:S,variant:"confirm",destructive:!0,title:"Purge Storage",description:z?`Are you sure you want to remove all entries from "${z.storageName}"? This action cannot be undone.`:"Are you sure you want to remove all entries from this storage? This action cannot be undone.",confirmLabel:"Purge",onConfirm:me}),I.jsx(ed,{open:P!==null,onOpenChange:Q=>{Q||M(null)},variant:"alert",title:P?.title??"",description:P?.message})]})}function pJ(){return I.jsx(tJ,{children:I.jsx(gJ,{})})}const gB="panel";fd.registerComponent(gB,()=>pJ);fd.runApplication(gB,{initialProps:{},rootTag:document.getElementById("root")});