@dss-kit/ui-kit 0.2.33 → 0.2.35

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.
@@ -1,11 +1,11 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("react/jsx-runtime"),S=require("react"),T=require("@emotion/css"),$s=require("react-dom"),hl=require("@highcharts/react");function D0(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const N=D0(S),k_=D0($s);function A_(e){const{h:t,w:n,m:r,mx:o,my:i,mt:s,mr:a,mb:l,ml:c,p:u,px:f,py:d,pt:h,pr:g,pb:p,pl:m,gap:v,xGap:y,yGap:x,row:b,flex:w,relative:_,absolute:E,display:R,overflow:k,absoluteFill:M,center:F,justifyContent:D,alignItems:j,alignSelf:I,borderWidth:$,borderBottomWidth:H,borderColor:O,borderRadius:P,borderStyle:K,border:G,zIndex:re,minWidth:U,minHeight:Z,maxWidth:Q,maxHeight:ne,flexWrap:oe,flexGrow:me,flexShrink:ee,flexBasis:xe,backgroundColor:Se,position:Ee,top:ze,right:je,bottom:Rt,left:gn,cursor:ot,...Gt}=e;return{spacers:{h:t,w:n,m:r,mx:o,my:i,mt:s,mr:a,mb:l,ml:c,p:u,px:f,py:d,pt:h,pr:g,pb:p,pl:m,gap:v,xGap:y,yGap:x,row:b,flex:w,relative:_,absolute:E,display:R,overflow:k,absoluteFill:M,center:F,justifyContent:D,alignItems:j,alignSelf:I,borderWidth:$,borderBottomWidth:H,borderColor:O,borderRadius:P,borderStyle:K,border:G,zIndex:re,minWidth:U,minHeight:Z,maxWidth:Q,maxHeight:ne,flexWrap:oe,flexGrow:me,flexShrink:ee,flexBasis:xe,backgroundColor:Se,position:Ee,top:ze,right:je,bottom:Rt,left:gn,cursor:ot},rest:Gt}}const N_=e=>T.css({display:e.display??"flex",flexDirection:e.row?"row":"column",height:e.h==="screen"?"100vh":e.h==="full"?"100%":e.h,width:e.w==="screen"?"100vw":e.w==="full"?"100%":e.w,margin:e.m,marginTop:e.mt??e.my,marginBottom:e.mb??e.my,marginLeft:e.ml??e.mx,marginRight:e.mr??e.mx,padding:e.p,paddingTop:e.pt??e.py,paddingBottom:e.pb??e.py,paddingLeft:e.pl??e.px,paddingRight:e.pr??e.px,gap:e.gap,columnGap:e.xGap,rowGap:e.yGap,justifyContent:e.center?"center":e.justifyContent,alignItems:e.center?"center":e.alignItems,alignSelf:e.alignSelf,borderWidth:e.borderWidth,borderBottomWidth:e.borderBottomWidth,borderColor:e.borderColor,borderRadius:e.borderRadius,borderStyle:e.borderStyle,border:e.border,zIndex:e.zIndex,overflow:e.overflow,minWidth:e.minWidth,minHeight:e.minHeight,maxWidth:e.maxWidth,maxHeight:e.maxHeight,flex:e.flex===!0?1:e.flex,flexWrap:e.flexWrap,flexGrow:e.flexGrow,flexShrink:e.flexShrink,flexBasis:e.flexBasis,backgroundColor:e.backgroundColor,position:e?.position?e?.position:e?.absolute?"absolute":e?.relative?"relative":void 0,...e.absoluteFill&&{position:"absolute",top:0,right:0,bottom:0,left:0},top:e?.top,right:e?.right,bottom:e?.bottom,left:e?.left,cursor:e.cursor}),q=S.forwardRef(({className:e,children:t,...n},r)=>{const{spacers:o,rest:i}=A_(n),s=S.useMemo(()=>N_(o),[o]);return C.jsx("div",{ref:r,className:T.cx(s,e),...i,children:t})});q.displayName="Box";var po=(e=>(e[e._1920=1920]="_1920",e[e._1440=1440]="_1440",e[e._1280=1280]="_1280",e[e._1200=1200]="_1200",e[e._1024=1024]="_1024",e[e._992=992]="_992",e[e._768=768]="_768",e[e._576=576]="_576",e[e._480=480]="_480",e[e._375=375]="_375",e))(po||{});const Ar={xs:480,sm:576,md:768,lg:992,xl:1200},M_=e=>{const{direction:t="max"}=e||{},[n,r]=S.useState(typeof window<"u"?window.innerWidth:Ar.xl);S.useEffect(()=>{if(typeof window>"u")return;const i=()=>r(window.innerWidth);return window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]);const o=S.useCallback(i=>{const s=Ar[i];return t==="min"?n>=s:n<s},[n,t]);return{windowWidth:n,match:o,isXs:o("xs"),isSm:o("sm"),isMd:o("md"),isLg:o("lg"),isXl:o("xl")}};function Bo(e,t){const{current:n}=S.useRef(e!==void 0),[r,o]=S.useState(t),i=n?e:r,s=S.useCallback(a=>{n||o(a)},[]);return[i,s]}function Pf(e,t,n,r=""){if(n)return e[`${t}_${n}${r}`]}function P_(e,t,n){return Pf(e,t,n,"Weight")}function L_(e,t,n){return Pf(e,t,n,"Size")}const F_={border:{accentPrimary:"var(--border-accent-primary)",accentPrimaryHover:"var(--border-accent-primary-hover)",accentSecondary:"var(--border-accent-secondary)",accentSecondaryHover:"var(--border-accent-secondary-hover)",negativePrimary:"var(--border-negative-primary)",negativePrimaryHover:"var(--border-negative-primary-hover)",negativeSecondary:"var(--border-negative-secondary)",negativeSecondaryHover:"var(--border-negative-secondary-hover)",positivePrimary:"var(--border-positive-primary)",positivePrimaryHover:"var(--border-positive-primary-hover)",positiveSecondary:"var(--border-positive-secondary)",positiveSecondaryHover:"var(--border-positive-secondary-hover)",warningPrimary:"var(--border-warning-primary)",warningPrimaryHover:"var(--border-warning-primary-hover)",warningSecondary:"var(--border-warning-secondary)",warningSecondaryHover:"var(--border-warning-secondary-hover)",neutralPrimary:"var(--border-neutral-primary)",neutralPrimaryHover:"var(--border-neutral-primary-hover)",neutralAlphaBasic:"var(--border-neutral-alpha-basic)",neutralAlphaLow:"var(--border-neutral-alpha-low)",neutralAlphaHigh:"var(--border-neutral-alpha-high)",transferPrimary:"var(--border-transfer-primary)",transferPrimaryHover:"var(--border-transfer-primary-hover)",transferSecondary:"var(--border-transfer-secondary)",transferSecondaryHover:"var(--border-transfer-secondary-hover)"},text:{primary:"var(--text-primary)",primaryInverse:"var(--text-primary-inverse)",primaryHover:"var(--text-primary-hover)",secondary:"var(--text-secondary)",secondaryInverse:"var(--text-secondary-inverse)",secondaryHover:"var(--text-secondary-hover)",tertiary:"var(--text-tertiary)",tertiaryInverse:"var(--text-tertiary-inverse)",tertiaryHover:"var(--text-tertiary-hover)",positive:"var(--text-positive)",positiveHover:"var(--text-positive-hover)",negative:"var(--text-negative)",negativeHover:"var(--text-negative-hover)",warning:"var(--text-warning)",warningHover:"var(--text-warning-hover)",accent:"var(--text-accent)",accentHover:"var(--text-accent-hover)",inverse:"var(--text-inverse)",transfer:"var(--text-transfer)",transferHover:"var(--text-transfer-hover)"},icon:{primary:"var(--icon-primary)",primaryHover:"var(--icon-primary-hover)",primaryInverse:"var(--icon-primary-inverse)",secondary:"var(--icon-secondary)",secondaryHover:"var(--icon-secondary-hover)",tertiary:"var(--icon-tertiary)",tertiaryInverse:"var(--icon-tertiary-inverse)",tertiaryHover:"var(--icon-tertiary-hover)",positive:"var(--icon-positive)",positiveHover:"var(--icon-positive-hover)",negative:"var(--icon-negative)",negativeHover:"var(--icon-negative-hover)",warning:"var(--icon-warning)",warningHover:"var(--icon-warning-hover)",accent:"var(--icon-accent)",accentHover:"var(--icon-accent-hover)",inverse:"var(--icon-inverse)",transfer:"var(--icon-transfer)",transferHover:"var(--icon-transfer-hover)"},fill:{accentPrimary:"var(--fill-accent-primary)",accentPrimaryHover:"var(--fill-accent-primary-hover)",accentSecondary:"var(--fill-accent-secondary)",accentSecondaryHover:"var(--fill-accent-secondary-hover)",accentTintHigh:"var(--fill-accent-tint-high)",accentTint:"var(--fill-accent-tint)",accentTintLow:"var(--fill-accent-tint-low)",accentTransparent:"var(--fill-accent-transparent)",positivePrimary:"var(--fill-positive-primary)",positivePrimaryHover:"var(--fill-positive-primary-hover)",positiveSecondary:"var(--fill-positive-secondary)",positiveSecondaryHover:"var(--fill-positive-secondary-hover)",positiveTintHigh:"var(--fill-positive-tint-high)",positiveTint:"var(--fill-positive-tint)",positiveTintLow:"var(--fill-positive-tint-low)",positiveTransparent:"var(--fill-positive-transparent)",negativePrimary:"var(--fill-negative-primary)",negativePrimaryHover:"var(--fill-negative-primary-hover)",negativeSecondary:"var(--fill-negative-secondary)",negativeSecondaryHover:"var(--fill-negative-secondary-hover)",negativeTintHigh:"var(--fill-negative-tint-high)",negativeTint:"var(--fill-negative-tint)",negativeTintLow:"var(--fill-negative-tint-low)",negativeTransparent:"var(--fill-negative-transparent)",warningPrimary:"var(--fill-warning-primary)",warningPrimaryHover:"var(--fill-warning-primary-hover)",warningSecondary:"var(--fill-warning-secondary)",warningSecondaryHover:"var(--fill-warning-secondary-hover)",warningTintHigh:"var(--fill-warning-tint-high)",warningTint:"var(--fill-warning-tint)",warningTintLow:"var(--fill-warning-tint-low)",warningTransparent:"var(--fill-warning-transparent)",neutralPrimary:"var(--fill-neutral-primary)",neutralPrimaryHover:"var(--fill-neutral-primary-hover)",neutralSecondary:"var(--fill-neutral-secondary)",neutralSecondaryInverse:"var(--fill-neutral-secondary-inverse)",neutralSecondaryHover:"var(--fill-neutral-secondary-hover)",neutralTint:"var(--fill-neutral-tint)",neutralTintLow:"var(--fill-neutral-tint-low)",transferPrimary:"var(--fill-transfer-primary)",transferPrimaryHover:"var(--fill-transfer-primary-hover)",transferSecondary:"var(--fill-transfer-secondary)",transferSecondaryHover:"var(--fill-transfer-secondary-hover)",transferTintHigh:"var(--fill-transfer-tint-high)",transferTint:"var(--fill-transfer-tint)",transferTintLow:"var(--fill-transfer-tint-low)",transferTransparent:"var(--fill-transfer-transparent)",bgPrimary:"var(--fill-bg-primary)",bgPrimaryInverse:"var(--fill-bg-primary-inverse)",bgSecondary:"var(--fill-bg-secondary)",bgSecondaryInverse:"var(--fill-bg-secondary-inverse)",bgTertiary:"var(--fill-bg-tertiary)",bgOverlayPrimary:"var(--fill-bg-overlay-primary)"},status:{accent:"var(--status-accent)",accentTint:"var(--status-accent-tint)",accentTintLow:"var(--status-accent-tint-low)",negative:"var(--status-negative)",negativeTint:"var(--status-negative-tint)",negativeTintLow:"var(--status-negative-tint-low)",positive:"var(--status-positive)",positiveTint:"var(--status-positive-tint)",positiveTintLow:"var(--status-positive-tint-low)",warning:"var(--status-warning)",warningTint:"var(--status-warning-tint)",warningTintLow:"var(--status-warning-tint-low)",neutral:"var(--status-neutral)",neutralTint:"var(--status-neutral-tint)",neutralTintLow:"var(--status-neutral-tint-low)",transfer:"var(--status-transfer)",transferTint:"var(--status-transfer-tint)",transferTintLow:"var(--status-transfer-tint-low)"},effect:{shadowS:"var(--effect-shadow-s)",shadowM:"var(--effect-shadow-m)",shadowL:"var(--effect-shadow-l)"},scrollbar:{thumbPrimary:"var(--scrollbar-thumb-primary)",trackPrimary:"var(--scrollbar-track-primary)"},gradient:{progressbar:"var(--gradient-progressbar)",progressbarPositive:"var(--gradient-progressbar-positive)",progressbarAccent:"var(--gradient-progressbar-accent)",progressbarNegative:"var(--gradient-progressbar-negative)",progressbarWarning:"var(--gradient-progressbar-warning)",progressbarNeutral:"var(--gradient-progressbar-neutral)",progressbarTransfer:"var(--gradient-progressbar-transfer)",accent1:"var(--gradient-accent-1)",accent1_20:"var(--gradient-accent-1-20)",accent1_10:"var(--gradient-accent-1-10)",negative1:"var(--gradient-negative-1)",negative1_20:"var(--gradient-negative-1-20)",negative1_10:"var(--gradient-negative-1-10)",positive1:"var(--gradient-positive-1)",positive1_20:"var(--gradient-positive-1-20)",positive1_10:"var(--gradient-positive-1-10)",warning1:"var(--gradient-warning-1)",warning1_20:"var(--gradient-warning-1-20)",warning1_10:"var(--gradient-warning-1-10)",neutral1:"var(--gradient-neutral-1)",neutral1_20:"var(--gradient-neutral-1-20)",neutral1_10:"var(--gradient-neutral-1-10)",accentAlternative1:"var(--gradient-accent-alternative-1)",transfer1:"var(--gradient-transfer-1)",transfer1_20:"var(--gradient-transfer-1-20)",transfer1_10:"var(--gradient-transfer-1-10)"}},$_={zero:"var(--corner-zero)",xs:"var(--corner-xs)",sm:"var(--corner-sm)",md:"var(--corner-md)",lg:"var(--corner-lg)",xl:"var(--corner-xl)","2xl":"var(--corner-2xl)","3xl":"var(--corner-3xl)","4xl":"var(--corner-4xl)","5xl":"var(--corner-5xl)","6xl":"var(--corner-6xl)",fullRound:"var(--corner-full-round)"},O_={regular:"var(--fw-regular)",medium:"var(--fw-medium)",semibold:"var(--fw-semibold)",bold:"var(--fw-bold)"},I_={button:{xs:"var(--height-button-xs)",sm:"var(--height-button-sm)",md:"var(--height-button-md)",lg:"var(--height-button-lg)"},avatar:{"2xs":"var(--height-avatar-2xs)",xs:"var(--height-avatar-xs)",sm:"var(--height-avatar-sm)",md:"var(--height-avatar-md)",lg:"var(--height-avatar-lg)",xl:"var(--height-avatar-xl)","2xl":"var(--height-avatar-2xl)"},icon:{"2xs":"var(--height-icon-2xs)",xs:"var(--height-icon-xs)",sm:"var(--height-icon-sm)",md:"var(--height-icon-md)",lg:"var(--height-icon-lg)",xl:"var(--height-icon-xl)"},switch:{sm:"var(--height-switch-sm)",md:"var(--height-switch-md)",lg:"var(--height-switch-lg)"}},D_={primary:"var(--opacity-primary)",secondary:"var(--opacity-secondary)",tertiary:"var(--opacity-tertiary)"},j_={zero:"var(--spacing-zero)",xs:"var(--spacing-xs)",sm:"var(--spacing-sm)",md:"var(--spacing-md)",lg:"var(--spacing-lg)",xl:"var(--spacing-xl)","2xl":"var(--spacing-2xl)","3xl":"var(--spacing-3xl)","4xl":"var(--spacing-4xl)","5xl":"var(--spacing-5xl)","6xl":"var(--spacing-6xl)","7xl":"var(--spacing-7xl)","8xl":"var(--spacing-8xl)","9xl":"var(--spacing-9xl)","10xl":"var(--spacing-10xl)"},V_={general:"var(--transition-general)"},V={spacing:j_,cornerRadius:$_,opacity:D_,transition:V_,fontWeight:O_,height:I_,color:F_},j0=T.keyframes`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("react/jsx-runtime"),S=require("react"),T=require("@emotion/css"),$s=require("react-dom"),hl=require("@highcharts/react");function V0(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const N=V0(S),A_=V0($s);function N_(e){const{h:t,w:n,m:r,mx:o,my:i,mt:s,mr:a,mb:l,ml:c,p:u,px:f,py:d,pt:h,pr:g,pb:p,pl:m,gap:v,xGap:y,yGap:x,row:b,flex:w,relative:_,absolute:E,display:R,overflow:k,absoluteFill:P,center:F,justifyContent:$,alignItems:j,alignSelf:O,borderWidth:D,borderBottomWidth:K,borderColor:I,borderRadius:M,borderStyle:H,border:U,zIndex:re,minWidth:G,minHeight:Y,maxWidth:Q,maxHeight:ne,flexWrap:oe,flexGrow:me,flexShrink:ee,flexBasis:ve,backgroundColor:Se,position:Ee,top:ze,right:je,bottom:Rt,left:gn,cursor:ot,...Gt}=e;return{spacers:{h:t,w:n,m:r,mx:o,my:i,mt:s,mr:a,mb:l,ml:c,p:u,px:f,py:d,pt:h,pr:g,pb:p,pl:m,gap:v,xGap:y,yGap:x,row:b,flex:w,relative:_,absolute:E,display:R,overflow:k,absoluteFill:P,center:F,justifyContent:$,alignItems:j,alignSelf:O,borderWidth:D,borderBottomWidth:K,borderColor:I,borderRadius:M,borderStyle:H,border:U,zIndex:re,minWidth:G,minHeight:Y,maxWidth:Q,maxHeight:ne,flexWrap:oe,flexGrow:me,flexShrink:ee,flexBasis:ve,backgroundColor:Se,position:Ee,top:ze,right:je,bottom:Rt,left:gn,cursor:ot},rest:Gt}}const M_=e=>T.css({display:e.display??"flex",flexDirection:e.row?"row":"column",height:e.h==="screen"?"100vh":e.h==="full"?"100%":e.h,width:e.w==="screen"?"100vw":e.w==="full"?"100%":e.w,margin:e.m,marginTop:e.mt??e.my,marginBottom:e.mb??e.my,marginLeft:e.ml??e.mx,marginRight:e.mr??e.mx,padding:e.p,paddingTop:e.pt??e.py,paddingBottom:e.pb??e.py,paddingLeft:e.pl??e.px,paddingRight:e.pr??e.px,gap:e.gap,columnGap:e.xGap,rowGap:e.yGap,justifyContent:e.center?"center":e.justifyContent,alignItems:e.center?"center":e.alignItems,alignSelf:e.alignSelf,borderWidth:e.borderWidth,borderBottomWidth:e.borderBottomWidth,borderColor:e.borderColor,borderRadius:e.borderRadius,borderStyle:e.borderStyle,border:e.border,zIndex:e.zIndex,overflow:e.overflow,minWidth:e.minWidth,minHeight:e.minHeight,maxWidth:e.maxWidth,maxHeight:e.maxHeight,flex:e.flex===!0?1:e.flex,flexWrap:e.flexWrap,flexGrow:e.flexGrow,flexShrink:e.flexShrink,flexBasis:e.flexBasis,backgroundColor:e.backgroundColor,position:e?.position?e?.position:e?.absolute?"absolute":e?.relative?"relative":void 0,...e.absoluteFill&&{position:"absolute",top:0,right:0,bottom:0,left:0},top:e?.top,right:e?.right,bottom:e?.bottom,left:e?.left,cursor:e.cursor}),q=S.forwardRef(({className:e,children:t,...n},r)=>{const{spacers:o,rest:i}=N_(n),s=S.useMemo(()=>M_(o),[o]);return C.jsx("div",{ref:r,className:T.cx(s,e),...i,children:t})});q.displayName="Box";var po=(e=>(e[e._1920=1920]="_1920",e[e._1440=1440]="_1440",e[e._1280=1280]="_1280",e[e._1200=1200]="_1200",e[e._1024=1024]="_1024",e[e._992=992]="_992",e[e._768=768]="_768",e[e._576=576]="_576",e[e._480=480]="_480",e[e._375=375]="_375",e))(po||{});const Ar={xs:480,sm:576,md:768,lg:992,xl:1200},P_=e=>{const{direction:t="max"}=e||{},[n,r]=S.useState(typeof window<"u"?window.innerWidth:Ar.xl);S.useEffect(()=>{if(typeof window>"u")return;const i=()=>r(window.innerWidth);return window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]);const o=S.useCallback(i=>{const s=Ar[i];return t==="min"?n>=s:n<s},[n,t]);return{windowWidth:n,match:o,isXs:o("xs"),isSm:o("sm"),isMd:o("md"),isLg:o("lg"),isXl:o("xl")}};function Bo(e,t){const{current:n}=S.useRef(e!==void 0),[r,o]=S.useState(t),i=n?e:r,s=S.useCallback(a=>{n||o(a)},[]);return[i,s]}function Lf(e,t,n,r=""){if(n)return e[`${t}_${n}${r}`]}function L_(e,t,n){return Lf(e,t,n,"Weight")}function F_(e,t,n){return Lf(e,t,n,"Size")}const $_={border:{accentPrimary:"var(--border-accent-primary)",accentPrimaryHover:"var(--border-accent-primary-hover)",accentSecondary:"var(--border-accent-secondary)",accentSecondaryHover:"var(--border-accent-secondary-hover)",negativePrimary:"var(--border-negative-primary)",negativePrimaryHover:"var(--border-negative-primary-hover)",negativeSecondary:"var(--border-negative-secondary)",negativeSecondaryHover:"var(--border-negative-secondary-hover)",positivePrimary:"var(--border-positive-primary)",positivePrimaryHover:"var(--border-positive-primary-hover)",positiveSecondary:"var(--border-positive-secondary)",positiveSecondaryHover:"var(--border-positive-secondary-hover)",warningPrimary:"var(--border-warning-primary)",warningPrimaryHover:"var(--border-warning-primary-hover)",warningSecondary:"var(--border-warning-secondary)",warningSecondaryHover:"var(--border-warning-secondary-hover)",neutralPrimary:"var(--border-neutral-primary)",neutralPrimaryHover:"var(--border-neutral-primary-hover)",neutralAlphaBasic:"var(--border-neutral-alpha-basic)",neutralAlphaLow:"var(--border-neutral-alpha-low)",neutralAlphaHigh:"var(--border-neutral-alpha-high)",transferPrimary:"var(--border-transfer-primary)",transferPrimaryHover:"var(--border-transfer-primary-hover)",transferSecondary:"var(--border-transfer-secondary)",transferSecondaryHover:"var(--border-transfer-secondary-hover)"},text:{primary:"var(--text-primary)",primaryInverse:"var(--text-primary-inverse)",primaryHover:"var(--text-primary-hover)",secondary:"var(--text-secondary)",secondaryInverse:"var(--text-secondary-inverse)",secondaryHover:"var(--text-secondary-hover)",tertiary:"var(--text-tertiary)",tertiaryInverse:"var(--text-tertiary-inverse)",tertiaryHover:"var(--text-tertiary-hover)",positive:"var(--text-positive)",positiveHover:"var(--text-positive-hover)",negative:"var(--text-negative)",negativeHover:"var(--text-negative-hover)",warning:"var(--text-warning)",warningHover:"var(--text-warning-hover)",accent:"var(--text-accent)",accentHover:"var(--text-accent-hover)",inverse:"var(--text-inverse)",transfer:"var(--text-transfer)",transferHover:"var(--text-transfer-hover)"},icon:{primary:"var(--icon-primary)",primaryHover:"var(--icon-primary-hover)",primaryInverse:"var(--icon-primary-inverse)",secondary:"var(--icon-secondary)",secondaryHover:"var(--icon-secondary-hover)",tertiary:"var(--icon-tertiary)",tertiaryInverse:"var(--icon-tertiary-inverse)",tertiaryHover:"var(--icon-tertiary-hover)",positive:"var(--icon-positive)",positiveHover:"var(--icon-positive-hover)",negative:"var(--icon-negative)",negativeHover:"var(--icon-negative-hover)",warning:"var(--icon-warning)",warningHover:"var(--icon-warning-hover)",accent:"var(--icon-accent)",accentHover:"var(--icon-accent-hover)",inverse:"var(--icon-inverse)",transfer:"var(--icon-transfer)",transferHover:"var(--icon-transfer-hover)"},fill:{accentPrimary:"var(--fill-accent-primary)",accentPrimaryHover:"var(--fill-accent-primary-hover)",accentSecondary:"var(--fill-accent-secondary)",accentSecondaryHover:"var(--fill-accent-secondary-hover)",accentTintHigh:"var(--fill-accent-tint-high)",accentTint:"var(--fill-accent-tint)",accentTintLow:"var(--fill-accent-tint-low)",accentTransparent:"var(--fill-accent-transparent)",positivePrimary:"var(--fill-positive-primary)",positivePrimaryHover:"var(--fill-positive-primary-hover)",positiveSecondary:"var(--fill-positive-secondary)",positiveSecondaryHover:"var(--fill-positive-secondary-hover)",positiveTintHigh:"var(--fill-positive-tint-high)",positiveTint:"var(--fill-positive-tint)",positiveTintLow:"var(--fill-positive-tint-low)",positiveTransparent:"var(--fill-positive-transparent)",negativePrimary:"var(--fill-negative-primary)",negativePrimaryHover:"var(--fill-negative-primary-hover)",negativeSecondary:"var(--fill-negative-secondary)",negativeSecondaryHover:"var(--fill-negative-secondary-hover)",negativeTintHigh:"var(--fill-negative-tint-high)",negativeTint:"var(--fill-negative-tint)",negativeTintLow:"var(--fill-negative-tint-low)",negativeTransparent:"var(--fill-negative-transparent)",warningPrimary:"var(--fill-warning-primary)",warningPrimaryHover:"var(--fill-warning-primary-hover)",warningSecondary:"var(--fill-warning-secondary)",warningSecondaryHover:"var(--fill-warning-secondary-hover)",warningTintHigh:"var(--fill-warning-tint-high)",warningTint:"var(--fill-warning-tint)",warningTintLow:"var(--fill-warning-tint-low)",warningTransparent:"var(--fill-warning-transparent)",neutralPrimary:"var(--fill-neutral-primary)",neutralPrimaryHover:"var(--fill-neutral-primary-hover)",neutralSecondary:"var(--fill-neutral-secondary)",neutralSecondaryInverse:"var(--fill-neutral-secondary-inverse)",neutralSecondaryHover:"var(--fill-neutral-secondary-hover)",neutralTint:"var(--fill-neutral-tint)",neutralTintLow:"var(--fill-neutral-tint-low)",transferPrimary:"var(--fill-transfer-primary)",transferPrimaryHover:"var(--fill-transfer-primary-hover)",transferSecondary:"var(--fill-transfer-secondary)",transferSecondaryHover:"var(--fill-transfer-secondary-hover)",transferTintHigh:"var(--fill-transfer-tint-high)",transferTint:"var(--fill-transfer-tint)",transferTintLow:"var(--fill-transfer-tint-low)",transferTransparent:"var(--fill-transfer-transparent)",bgPrimary:"var(--fill-bg-primary)",bgPrimaryInverse:"var(--fill-bg-primary-inverse)",bgSecondary:"var(--fill-bg-secondary)",bgSecondaryInverse:"var(--fill-bg-secondary-inverse)",bgTertiary:"var(--fill-bg-tertiary)",bgOverlayPrimary:"var(--fill-bg-overlay-primary)"},status:{accent:"var(--status-accent)",accentTint:"var(--status-accent-tint)",accentTintLow:"var(--status-accent-tint-low)",negative:"var(--status-negative)",negativeTint:"var(--status-negative-tint)",negativeTintLow:"var(--status-negative-tint-low)",positive:"var(--status-positive)",positiveTint:"var(--status-positive-tint)",positiveTintLow:"var(--status-positive-tint-low)",warning:"var(--status-warning)",warningTint:"var(--status-warning-tint)",warningTintLow:"var(--status-warning-tint-low)",neutral:"var(--status-neutral)",neutralTint:"var(--status-neutral-tint)",neutralTintLow:"var(--status-neutral-tint-low)",transfer:"var(--status-transfer)",transferTint:"var(--status-transfer-tint)",transferTintLow:"var(--status-transfer-tint-low)"},effect:{shadowS:"var(--effect-shadow-s)",shadowM:"var(--effect-shadow-m)",shadowL:"var(--effect-shadow-l)"},scrollbar:{thumbPrimary:"var(--scrollbar-thumb-primary)",trackPrimary:"var(--scrollbar-track-primary)"},gradient:{progressbar:"var(--gradient-progressbar)",progressbarPositive:"var(--gradient-progressbar-positive)",progressbarAccent:"var(--gradient-progressbar-accent)",progressbarNegative:"var(--gradient-progressbar-negative)",progressbarWarning:"var(--gradient-progressbar-warning)",progressbarNeutral:"var(--gradient-progressbar-neutral)",progressbarTransfer:"var(--gradient-progressbar-transfer)",accent1:"var(--gradient-accent-1)",accent1_20:"var(--gradient-accent-1-20)",accent1_10:"var(--gradient-accent-1-10)",negative1:"var(--gradient-negative-1)",negative1_20:"var(--gradient-negative-1-20)",negative1_10:"var(--gradient-negative-1-10)",positive1:"var(--gradient-positive-1)",positive1_20:"var(--gradient-positive-1-20)",positive1_10:"var(--gradient-positive-1-10)",warning1:"var(--gradient-warning-1)",warning1_20:"var(--gradient-warning-1-20)",warning1_10:"var(--gradient-warning-1-10)",neutral1:"var(--gradient-neutral-1)",neutral1_20:"var(--gradient-neutral-1-20)",neutral1_10:"var(--gradient-neutral-1-10)",accentAlternative1:"var(--gradient-accent-alternative-1)",transfer1:"var(--gradient-transfer-1)",transfer1_20:"var(--gradient-transfer-1-20)",transfer1_10:"var(--gradient-transfer-1-10)"}},O_={zero:"var(--corner-zero)",xs:"var(--corner-xs)",sm:"var(--corner-sm)",md:"var(--corner-md)",lg:"var(--corner-lg)",xl:"var(--corner-xl)","2xl":"var(--corner-2xl)","3xl":"var(--corner-3xl)","4xl":"var(--corner-4xl)","5xl":"var(--corner-5xl)","6xl":"var(--corner-6xl)",fullRound:"var(--corner-full-round)"},I_={regular:"var(--fw-regular)",medium:"var(--fw-medium)",semibold:"var(--fw-semibold)",bold:"var(--fw-bold)"},D_={button:{xs:"var(--height-button-xs)",sm:"var(--height-button-sm)",md:"var(--height-button-md)",lg:"var(--height-button-lg)"},avatar:{"2xs":"var(--height-avatar-2xs)",xs:"var(--height-avatar-xs)",sm:"var(--height-avatar-sm)",md:"var(--height-avatar-md)",lg:"var(--height-avatar-lg)",xl:"var(--height-avatar-xl)","2xl":"var(--height-avatar-2xl)"},icon:{"2xs":"var(--height-icon-2xs)",xs:"var(--height-icon-xs)",sm:"var(--height-icon-sm)",md:"var(--height-icon-md)",lg:"var(--height-icon-lg)",xl:"var(--height-icon-xl)"},switch:{sm:"var(--height-switch-sm)",md:"var(--height-switch-md)",lg:"var(--height-switch-lg)"}},j_={primary:"var(--opacity-primary)",secondary:"var(--opacity-secondary)",tertiary:"var(--opacity-tertiary)"},V_={zero:"var(--spacing-zero)",xs:"var(--spacing-xs)",sm:"var(--spacing-sm)",md:"var(--spacing-md)",lg:"var(--spacing-lg)",xl:"var(--spacing-xl)","2xl":"var(--spacing-2xl)","3xl":"var(--spacing-3xl)","4xl":"var(--spacing-4xl)","5xl":"var(--spacing-5xl)","6xl":"var(--spacing-6xl)","7xl":"var(--spacing-7xl)","8xl":"var(--spacing-8xl)","9xl":"var(--spacing-9xl)","10xl":"var(--spacing-10xl)"},B_={general:"var(--transition-general)"},V={spacing:V_,cornerRadius:O_,opacity:j_,transition:B_,fontWeight:I_,height:D_,color:$_},B0=T.keyframes`
2
2
  0% {
3
3
  box-shadow: 0 16px 0 var(--loader-color);
4
4
  }
5
5
  100% {
6
6
  box-shadow: 0 20px 0 var(--loader-color);
7
7
  }
8
- `,Bg={content:'""',position:"absolute",width:8,height:8,borderRadius:"50%",boxShadow:"0 16px 0 var(--loader-color)",animationName:j0,animationDuration:"0.4s",animationTimingFunction:"ease-in-out",animationIterationCount:"infinite",animationDirection:"alternate"},B_={loader:T.css({width:8,height:8,borderRadius:"50%",boxShadow:"0 16px 0 var(--loader-color)",position:"relative",animationName:j0,animationDuration:"0.4s",animationTimingFunction:"ease-in-out",animationIterationCount:"infinite",animationDirection:"alternate",animationDelay:"0.32s",display:"block",top:-19,opacity:.9,"&::before":{...Bg,left:-12,animationDelay:"0.48s"},"&::after":{...Bg,right:-12,animationDelay:"0.16s"}})},V0=({color:e=V.color.text.accent,className:t})=>C.jsx("span",{className:T.cx(B_.loader,T.css({"--loader-color":e}),t)}),B0=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}));var Bn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Lf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $c={exports:{}};var zg;function z_(){return zg||(zg=1,(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var i="",s=0;s<arguments.length;s++){var a=arguments[s];a&&(i=o(i,r(a)))}return i}function r(i){if(typeof i=="string"||typeof i=="number")return i;if(typeof i!="object")return"";if(Array.isArray(i))return n.apply(null,i);if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]"))return i.toString();var s="";for(var a in i)t.call(i,a)&&i[a]&&(s=o(s,a));return s}function o(i,s){return s?i?i+" "+s:i+s:i}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})($c)),$c.exports}var H_=z_();const mo=Lf(H_),W_=T.keyframes`
8
+ `,zg={content:'""',position:"absolute",width:8,height:8,borderRadius:"50%",boxShadow:"0 16px 0 var(--loader-color)",animationName:B0,animationDuration:"0.4s",animationTimingFunction:"ease-in-out",animationIterationCount:"infinite",animationDirection:"alternate"},z_={loader:T.css({width:8,height:8,borderRadius:"50%",boxShadow:"0 16px 0 var(--loader-color)",position:"relative",animationName:B0,animationDuration:"0.4s",animationTimingFunction:"ease-in-out",animationIterationCount:"infinite",animationDirection:"alternate",animationDelay:"0.32s",display:"block",top:-19,opacity:.9,"&::before":{...zg,left:-12,animationDelay:"0.48s"},"&::after":{...zg,right:-12,animationDelay:"0.16s"}})},z0=({color:e=V.color.text.accent,className:t})=>C.jsx("span",{className:T.cx(z_.loader,T.css({"--loader-color":e}),t)}),H0=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}));var Bn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ff(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Oc={exports:{}};var Hg;function H_(){return Hg||(Hg=1,(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var i="",s=0;s<arguments.length;s++){var a=arguments[s];a&&(i=o(i,r(a)))}return i}function r(i){if(typeof i=="string"||typeof i=="number")return i;if(typeof i!="object")return"";if(Array.isArray(i))return n.apply(null,i);if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]"))return i.toString();var s="";for(var a in i)t.call(i,a)&&i[a]&&(s=o(s,a));return s}function o(i,s){return s?i?i+" "+s:i+s:i}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(Oc)),Oc.exports}var W_=H_();const mo=Ff(W_),K_=T.keyframes`
9
9
  0% {
10
10
  transform: scale(0);
11
11
  opacity: 0.36;
@@ -14,7 +14,7 @@
14
14
  transform: scale(1);
15
15
  opacity: 0;
16
16
  }
17
- `,Hg={rippleOverlay:T.css({position:"absolute",inset:0,pointerEvents:"none",overflow:"visible",borderRadius:"inherit",zIndex:0}),ripple:T.css({position:"absolute",borderRadius:"50%",transform:"scale(0)",transformOrigin:"center center",opacity:.36,willChange:"transform, opacity",animationName:W_,animationTimingFunction:"cubic-bezier(0.4, 0, 0.2, 1)",animationFillMode:"forwards"})},Oc="button, a, input, label, [role='button'], [data-ripple]";function K_(e){if(typeof e.composedPath=="function")return e.composedPath();const t=[];let n=e.target;for(;n;)t.push(n),n=n.parentNode||n.host;return t.push(window),t}const zo=S.forwardRef(({color:e="rgba(0,0,0,0.18)",duration:t=1e3,radius:n="auto",className:r},o)=>{const i=S.useRef(null),[s,a]=S.useState([]),l=S.useRef([]),c=S.useRef(1),u=S.useRef(null),f=()=>{l.current.map(p=>clearTimeout(p)),l.current=[]},d=S.useCallback((p,m,v,y)=>{if(typeof window>"u")return;const x=v.getBoundingClientRect(),b=n==="auto"?Math.max(x.width,x.height)*2:n,w=p-y.left,_=m-y.top,E=Math.max(0,x.top-y.top),R=Math.max(0,x.left-y.left),k=Math.max(0,y.right-x.right),M=Math.max(0,y.bottom-x.bottom),D=window.getComputedStyle(v).borderRadius||"0px",j=c.current++,I={id:j,left:w-b/2,top:_-b/2,size:Math.ceil(b),clip:{top:Math.round(E),right:Math.round(k),bottom:Math.round(M),left:Math.round(R)},borderRadius:D};a(H=>[...H,I]);const $=window.setTimeout(()=>{a(H=>H.filter(O=>O.id!==j))},t+80);l.current.push($)},[t,n]),h=S.useCallback(p=>{try{if(!i.current)return;const m=i.current,v=m.parentElement;if(!v)return;const y=K_(p);let x=null;for(const R of y)if(R instanceof Element){if(R===v)break;if(R.matches&&R.matches(Oc)){x=R;break}}if(x||(x=v),x.closest&&(x.closest("[disabled]")||x.getAttribute("aria-disabled")==="true"||x.classList.contains("ripple-disabled")))return;const b=p.target;if(b?.closest&&(b.closest("[disabled]")||b.getAttribute?.("aria-disabled")==="true"))return;const w=m.getBoundingClientRect(),{clientX:_}=p,{clientY:E}=p;d(_,E,x,w)}catch{}},[d]),g=S.useCallback(p=>{if(!i.current||!(p.key==="Enter"||p.key===" "))return;const m=i.current,v=m.parentElement;if(!v)return;const y=document.activeElement;let x=null;if(y instanceof Element&&y.matches(Oc)&&(x=y),x||(x=v),x.closest&&(x.closest("[disabled]")||x.getAttribute("aria-disabled")==="true"))return;const b=m.getBoundingClientRect(),w=x.getBoundingClientRect().left+x.getBoundingClientRect().width/2,_=x.getBoundingClientRect().top+x.getBoundingClientRect().height/2;d(w,_,x,b)},[d]);return S.useImperativeHandle(o,()=>({trigger:({center:p=!0,x:m,y:v}={})=>{const y=i.current;if(!y)return;const x=y.parentElement;if(!x)return;const b=y.getBoundingClientRect(),w=document.activeElement instanceof Element&&document.activeElement.matches(Oc)?document.activeElement:x,_=p?w.getBoundingClientRect().left+w.getBoundingClientRect().width/2:m??b.left+b.width/2,E=p?w.getBoundingClientRect().top+w.getBoundingClientRect().height/2:v??b.top+b.height/2;d(_,E,w,b)}}),[d]),S.useEffect(()=>{const p=i.current;if(!p)return;const m=p.parentElement;if(!m||typeof window>"u")return;const v=window.getComputedStyle(m);let y=!1;return v.position==="static"&&(m.style.position="relative",y=!0,u.current=m),m.addEventListener("pointerdown",h,!0),m.addEventListener("keydown",g),()=>{m.removeEventListener("pointerdown",h,!0),m.removeEventListener("keydown",g),y&&u.current&&(u.current.style.position="",u.current=null),f()}},[h,g]),S.useEffect(()=>()=>f(),[]),C.jsx("div",{ref:i,className:`${Hg.rippleOverlay} ${r??""}`,"aria-hidden":!0,children:s.map(p=>C.jsx("span",{className:Hg.ripple,style:{left:`${p.left}px`,top:`${p.top}px`,width:`${p.size}px`,height:`${p.size}px`,backgroundColor:e,animationDuration:`${t}ms`,clipPath:`inset(${p.clip.top}px ${p.clip.right}px ${p.clip.bottom}px ${p.clip.left}px round ${p.borderRadius})`}},p.id))})}),U_=T.css({display:"flex",alignItems:"center",justifyContent:"center",transition:V.transition.general,position:"relative",overflow:"hidden","& svg":{transition:V.transition.general},"&:disabled":{opacity:.5}}),G_={md:T.css({minHeight:V.height.button.md,minWidth:V.height.button.md,borderRadius:V.cornerRadius.md,"& svg, & img":{width:V.height.icon.md,height:V.height.icon.md}}),sm:T.css({minHeight:V.height.button.sm,minWidth:V.height.button.sm,borderRadius:V.cornerRadius.md,"& svg, & img":{width:V.height.icon.sm,height:V.height.icon.sm}}),xs:T.css({minHeight:V.height.button.xs,minWidth:V.height.button.xs,borderRadius:V.cornerRadius.sm,"& svg, & img":{width:V.height.icon.sm,height:V.height.icon.sm}}),custom:T.css({})},q_={primary:T.css({backgroundColor:V.color.fill.accentPrimary,":where(&) svg":{color:V.color.icon.primaryInverse},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:V.color.fill.accentPrimaryHover,":where(&) svg":{color:V.color.icon.primaryInverse}}}),secondary:T.css({backgroundColor:V.color.fill.accentSecondary,":where(&) svg":{color:V.color.icon.primary},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:V.color.fill.accentSecondaryHover,":where(&) svg":{color:V.color.icon.primaryHover}}}),negative:T.css({backgroundColor:V.color.fill.negativeSecondary,":where(&) svg":{color:V.color.icon.primary},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:V.color.fill.negativeSecondaryHover,":where(&) svg":{color:V.color.icon.primaryHover}}}),positive:T.css({backgroundColor:V.color.fill.positiveSecondary,":where(&) svg":{color:V.color.icon.primary},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:V.color.fill.positiveSecondaryHover,":where(&) svg":{color:V.color.icon.primaryHover}}}),warning:T.css({backgroundColor:V.color.fill.warningSecondary,":where(&) svg":{color:V.color.icon.primary},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:V.color.fill.warningSecondaryHover,":where(&) svg":{color:V.color.icon.primaryHover}}}),neutral:T.css({backgroundColor:V.color.fill.neutralSecondary,":where(&) svg":{color:V.color.icon.primary},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:V.color.fill.neutralSecondaryHover,":where(&) svg":{color:V.color.icon.primaryHover}}}),transfer:T.css({backgroundColor:V.color.fill.transferSecondary,":where(&) svg":{color:V.color.icon.primary},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:V.color.fill.transferSecondaryHover,":where(&) svg":{color:V.color.icon.primaryHover}}}),"neutral-white":T.css({backgroundColor:V.color.fill.bgPrimary,":where(&) svg":{color:V.color.icon.primary},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:V.color.fill.bgSecondary,":where(&) svg":{color:V.color.icon.primaryHover}}}),"no-bg":T.css({backgroundColor:"transparent",":where(&) svg":{color:V.color.icon.primary},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:V.color.fill.bgSecondary,":where(&) svg":{color:V.color.icon.primaryHover}}}),custom:T.css({})};function pr({attr:e,children:t,className:n,type:r="button",color:o="primary",size:i="md",...s}){return C.jsxs("button",{...e,...s,type:r,className:mo(U_,G_[i],q_[o],n),children:[C.jsx(zo,{}),t]})}const z0=S.createContext({isOpen:!1,onClose:()=>{}}),Y_=()=>S.useContext(z0),Fn=(e,t="max")=>t==="min"?`@media (min-width: ${e}px)`:`@media (max-width: ${e-1}px)`,vs={xs:(e="max")=>Fn(Ar.xs,e),sm:(e="max")=>Fn(Ar.sm,e),md:(e="max")=>Fn(Ar.md,e),lg:(e="max")=>Fn(Ar.lg,e),xl:(e="max")=>Fn(Ar.xl,e),bp375:(e="max")=>Fn(po._375,e),bp1024:(e="max")=>Fn(po._1024,e),bp1280:(e="max")=>Fn(po._1280,e),bp1440:(e="max")=>Fn(po._1440,e),bp1920:(e="max")=>Fn(po._1920,e)},X_=T.keyframes`
17
+ `,Wg={rippleOverlay:T.css({position:"absolute",inset:0,pointerEvents:"none",overflow:"visible",borderRadius:"inherit",zIndex:0}),ripple:T.css({position:"absolute",borderRadius:"50%",transform:"scale(0)",transformOrigin:"center center",opacity:.36,willChange:"transform, opacity",animationName:K_,animationTimingFunction:"cubic-bezier(0.4, 0, 0.2, 1)",animationFillMode:"forwards"})},Ic="button, a, input, label, [role='button'], [data-ripple]";function U_(e){if(typeof e.composedPath=="function")return e.composedPath();const t=[];let n=e.target;for(;n;)t.push(n),n=n.parentNode||n.host;return t.push(window),t}const zo=S.forwardRef(({color:e="rgba(0,0,0,0.18)",duration:t=1e3,radius:n="auto",className:r},o)=>{const i=S.useRef(null),[s,a]=S.useState([]),l=S.useRef([]),c=S.useRef(1),u=S.useRef(null),f=()=>{l.current.map(p=>clearTimeout(p)),l.current=[]},d=S.useCallback((p,m,v,y)=>{if(typeof window>"u")return;const x=v.getBoundingClientRect(),b=n==="auto"?Math.max(x.width,x.height)*2:n,w=p-y.left,_=m-y.top,E=Math.max(0,x.top-y.top),R=Math.max(0,x.left-y.left),k=Math.max(0,y.right-x.right),P=Math.max(0,y.bottom-x.bottom),$=window.getComputedStyle(v).borderRadius||"0px",j=c.current++,O={id:j,left:w-b/2,top:_-b/2,size:Math.ceil(b),clip:{top:Math.round(E),right:Math.round(k),bottom:Math.round(P),left:Math.round(R)},borderRadius:$};a(K=>[...K,O]);const D=window.setTimeout(()=>{a(K=>K.filter(I=>I.id!==j))},t+80);l.current.push(D)},[t,n]),h=S.useCallback(p=>{try{if(!i.current)return;const m=i.current,v=m.parentElement;if(!v)return;const y=U_(p);let x=null;for(const R of y)if(R instanceof Element){if(R===v)break;if(R.matches&&R.matches(Ic)){x=R;break}}if(x||(x=v),x.closest&&(x.closest("[disabled]")||x.getAttribute("aria-disabled")==="true"||x.classList.contains("ripple-disabled")))return;const b=p.target;if(b?.closest&&(b.closest("[disabled]")||b.getAttribute?.("aria-disabled")==="true"))return;const w=m.getBoundingClientRect(),{clientX:_}=p,{clientY:E}=p;d(_,E,x,w)}catch{}},[d]),g=S.useCallback(p=>{if(!i.current||!(p.key==="Enter"||p.key===" "))return;const m=i.current,v=m.parentElement;if(!v)return;const y=document.activeElement;let x=null;if(y instanceof Element&&y.matches(Ic)&&(x=y),x||(x=v),x.closest&&(x.closest("[disabled]")||x.getAttribute("aria-disabled")==="true"))return;const b=m.getBoundingClientRect(),w=x.getBoundingClientRect().left+x.getBoundingClientRect().width/2,_=x.getBoundingClientRect().top+x.getBoundingClientRect().height/2;d(w,_,x,b)},[d]);return S.useImperativeHandle(o,()=>({trigger:({center:p=!0,x:m,y:v}={})=>{const y=i.current;if(!y)return;const x=y.parentElement;if(!x)return;const b=y.getBoundingClientRect(),w=document.activeElement instanceof Element&&document.activeElement.matches(Ic)?document.activeElement:x,_=p?w.getBoundingClientRect().left+w.getBoundingClientRect().width/2:m??b.left+b.width/2,E=p?w.getBoundingClientRect().top+w.getBoundingClientRect().height/2:v??b.top+b.height/2;d(_,E,w,b)}}),[d]),S.useEffect(()=>{const p=i.current;if(!p)return;const m=p.parentElement;if(!m||typeof window>"u")return;const v=window.getComputedStyle(m);let y=!1;return v.position==="static"&&(m.style.position="relative",y=!0,u.current=m),m.addEventListener("pointerdown",h,!0),m.addEventListener("keydown",g),()=>{m.removeEventListener("pointerdown",h,!0),m.removeEventListener("keydown",g),y&&u.current&&(u.current.style.position="",u.current=null),f()}},[h,g]),S.useEffect(()=>()=>f(),[]),C.jsx("div",{ref:i,className:`${Wg.rippleOverlay} ${r??""}`,"aria-hidden":!0,children:s.map(p=>C.jsx("span",{className:Wg.ripple,style:{left:`${p.left}px`,top:`${p.top}px`,width:`${p.size}px`,height:`${p.size}px`,backgroundColor:e,animationDuration:`${t}ms`,clipPath:`inset(${p.clip.top}px ${p.clip.right}px ${p.clip.bottom}px ${p.clip.left}px round ${p.borderRadius})`}},p.id))})}),G_=T.css({display:"flex",alignItems:"center",justifyContent:"center",transition:V.transition.general,position:"relative",overflow:"hidden","& svg":{transition:V.transition.general},"&:disabled":{opacity:.5}}),q_={md:T.css({minHeight:V.height.button.md,minWidth:V.height.button.md,borderRadius:V.cornerRadius.md,"& svg, & img":{width:V.height.icon.md,height:V.height.icon.md}}),sm:T.css({minHeight:V.height.button.sm,minWidth:V.height.button.sm,borderRadius:V.cornerRadius.md,"& svg, & img":{width:V.height.icon.sm,height:V.height.icon.sm}}),xs:T.css({minHeight:V.height.button.xs,minWidth:V.height.button.xs,borderRadius:V.cornerRadius.sm,"& svg, & img":{width:V.height.icon.sm,height:V.height.icon.sm}}),custom:T.css({})},Y_={primary:T.css({backgroundColor:V.color.fill.accentPrimary,":where(&) svg":{color:V.color.icon.primaryInverse},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:V.color.fill.accentPrimaryHover,":where(&) svg":{color:V.color.icon.primaryInverse}}}),secondary:T.css({backgroundColor:V.color.fill.accentSecondary,":where(&) svg":{color:V.color.icon.primary},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:V.color.fill.accentSecondaryHover,":where(&) svg":{color:V.color.icon.primaryHover}}}),negative:T.css({backgroundColor:V.color.fill.negativeSecondary,":where(&) svg":{color:V.color.icon.primary},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:V.color.fill.negativeSecondaryHover,":where(&) svg":{color:V.color.icon.primaryHover}}}),positive:T.css({backgroundColor:V.color.fill.positiveSecondary,":where(&) svg":{color:V.color.icon.primary},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:V.color.fill.positiveSecondaryHover,":where(&) svg":{color:V.color.icon.primaryHover}}}),warning:T.css({backgroundColor:V.color.fill.warningSecondary,":where(&) svg":{color:V.color.icon.primary},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:V.color.fill.warningSecondaryHover,":where(&) svg":{color:V.color.icon.primaryHover}}}),neutral:T.css({backgroundColor:V.color.fill.neutralSecondary,":where(&) svg":{color:V.color.icon.primary},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:V.color.fill.neutralSecondaryHover,":where(&) svg":{color:V.color.icon.primaryHover}}}),transfer:T.css({backgroundColor:V.color.fill.transferSecondary,":where(&) svg":{color:V.color.icon.primary},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:V.color.fill.transferSecondaryHover,":where(&) svg":{color:V.color.icon.primaryHover}}}),"neutral-white":T.css({backgroundColor:V.color.fill.bgPrimary,":where(&) svg":{color:V.color.icon.primary},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:V.color.fill.bgSecondary,":where(&) svg":{color:V.color.icon.primaryHover}}}),"no-bg":T.css({backgroundColor:"transparent",":where(&) svg":{color:V.color.icon.primary},"&:hover:not(:disabled), &:active:not(:disabled)":{backgroundColor:V.color.fill.bgSecondary,":where(&) svg":{color:V.color.icon.primaryHover}}}),custom:T.css({})};function pr({attr:e,children:t,className:n,type:r="button",color:o="primary",size:i="md",...s}){return C.jsxs("button",{...e,...s,type:r,className:mo(G_,q_[i],Y_[o],n),children:[C.jsx(zo,{}),t]})}const W0=S.createContext({isOpen:!1,onClose:()=>{}}),X_=()=>S.useContext(W0),Fn=(e,t="max")=>t==="min"?`@media (min-width: ${e}px)`:`@media (max-width: ${e-1}px)`,vs={xs:(e="max")=>Fn(Ar.xs,e),sm:(e="max")=>Fn(Ar.sm,e),md:(e="max")=>Fn(Ar.md,e),lg:(e="max")=>Fn(Ar.lg,e),xl:(e="max")=>Fn(Ar.xl,e),bp375:(e="max")=>Fn(po._375,e),bp1024:(e="max")=>Fn(po._1024,e),bp1280:(e="max")=>Fn(po._1280,e),bp1440:(e="max")=>Fn(po._1440,e),bp1920:(e="max")=>Fn(po._1920,e)},Z_=T.keyframes`
18
18
  0% {
19
19
  opacity: 0;
20
20
  transform: scale(0.95);
@@ -23,7 +23,7 @@
23
23
  opacity: 1;
24
24
  transform: none;
25
25
  }
26
- `,wa={overlay:T.css({backdropFilter:"blur(5px)"}),modal:T.css({animationDuration:"0.2s",animationTimingFunction:"ease-in-out",animationName:X_,maxWidth:`calc(100vw - ${V.spacing["3xl"]})`,maxHeight:`calc(100vh - ${V.spacing["7xl"]} - ${V.spacing["7xl"]})`,borderRadius:V.cornerRadius["2xl"],backgroundColor:V.color.fill.bgPrimary,boxShadow:`0 4px 20px 0 ${V.color.effect.shadowS}`,[vs.sm()]:{flex:1}}),closeButton:T.css({position:"absolute",zIndex:1,top:V.spacing.lg,right:V.spacing.lg}),size_lg:T.css({width:874}),size_md:T.css({width:650}),size_sm:T.css({width:426})},H0=S.forwardRef(({isOpen:e,onClose:t,overlayClassName:n,modalClassName:r,absoluteCloseButtonClassName:o,size:i="md",closeOnBackdropClick:s=!0,closeOnEsc:a=!0,disableBodyScroll:l=!0,showAbsoluteCloseButton:c,children:u},f)=>{S.useEffect(()=>{if(l&&e&&typeof window<"u"&&typeof document<"u"){const m=window.getComputedStyle(document.body).overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=m}}},[e,l]);const d=S.useCallback(m=>{m.key==="Escape"&&t()},[t]);S.useEffect(()=>{if(typeof window<"u"&&typeof document<"u"&&a&&e)return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[e,a,d]);const h=S.useRef(!1),g=S.useCallback(m=>{h.current=m.target===m.currentTarget},[]),p=S.useCallback(m=>{s&&m.target===m.currentTarget&&h.current&&t()},[s,t]);return e?C.jsx(ts,{children:C.jsx(z0.Provider,{value:{isOpen:e,onClose:t},children:C.jsx(q,{position:"fixed",top:0,right:0,bottom:0,left:0,row:!0,center:!0,flex:1,onMouseDown:g,onClick:p,backgroundColor:V.color.fill.bgOverlayPrimary,className:T.cx(wa.overlay,n),zIndex:1,children:C.jsxs(q,{ref:f,className:T.cx(wa.modal,wa[`size_${i}`],r),relative:!0,children:[c&&C.jsx(pr,{className:T.cx(wa.closeButton,o),onClick:t,color:"neutral",children:C.jsx(B0,{})}),u]})})})}):null});H0.displayName="Modal";const Z_=T.css({borderTop:`1px solid ${V.color.border.neutralAlphaBasic}`}),W0=S.forwardRef(({children:e,row:t=!0,flex:n=!0,gap:r=V.spacing.lg,p:o=V.spacing["2xl"],className:i,...s},a)=>C.jsx(q,{flex:n,row:t,gap:r,p:o,className:T.cx(Z_,i),ref:a,...s,children:e}));W0.displayName="ModalFooter";const Ff=S.createContext({});function $f(e){const t=S.useRef(null);return t.current===null&&(t.current=e()),t.current}const Of=typeof window<"u",K0=Of?S.useLayoutEffect:S.useEffect,Gl=S.createContext(null);function If(e,t){e.indexOf(t)===-1&&e.push(t)}function Df(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const yr=(e,t,n)=>n>t?t:n<e?e:n;function sd(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let Bi=()=>{},vr=()=>{};process.env.NODE_ENV!=="production"&&(Bi=(e,t,n)=>{!e&&typeof console<"u"&&console.warn(sd(t,n))},vr=(e,t,n)=>{if(!e)throw new Error(sd(t,n))});const xr={},U0=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function G0(e){return typeof e=="object"&&e!==null}const q0=e=>/^0[^.\s]+$/u.test(e);function jf(e){let t;return()=>(t===void 0&&(t=e()),t)}const cn=e=>e,J_=(e,t)=>n=>t(e(n)),Xs=(...e)=>e.reduce(J_),Os=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class Vf{constructor(){this.subscriptions=[]}add(t){return If(this.subscriptions,t),()=>Df(this.subscriptions,t)}notify(t,n,r){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,n,r);else for(let i=0;i<o;i++){const s=this.subscriptions[i];s&&s(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Tn=e=>e*1e3,ln=e=>e/1e3;function Y0(e,t){return t?e*(1e3/t):0}const Wg=new Set;function Bf(e,t,n){e||Wg.has(t)||(console.warn(sd(t,n)),Wg.add(t))}const X0=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Q_=1e-7,eT=12;function tT(e,t,n,r,o){let i,s,a=0;do s=t+(n-t)/2,i=X0(s,r,o)-e,i>0?n=s:t=s;while(Math.abs(i)>Q_&&++a<eT);return s}function Zs(e,t,n,r){if(e===t&&n===r)return cn;const o=i=>tT(i,0,1,e,n);return i=>i===0||i===1?i:X0(o(i),t,r)}const Z0=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,J0=e=>t=>1-e(1-t),Q0=Zs(.33,1.53,.69,.99),zf=J0(Q0),ex=Z0(zf),tx=e=>(e*=2)<1?.5*zf(e):.5*(2-Math.pow(2,-10*(e-1))),Hf=e=>1-Math.sin(Math.acos(e)),nx=J0(Hf),rx=Z0(Hf),nT=Zs(.42,0,1,1),rT=Zs(0,0,.58,1),ox=Zs(.42,0,.58,1),oT=e=>Array.isArray(e)&&typeof e[0]!="number",ix=e=>Array.isArray(e)&&typeof e[0]=="number",Kg={linear:cn,easeIn:nT,easeInOut:ox,easeOut:rT,circIn:Hf,circInOut:rx,circOut:nx,backIn:zf,backInOut:ex,backOut:Q0,anticipate:tx},iT=e=>typeof e=="string",Ug=e=>{if(ix(e)){vr(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,r,o]=e;return Zs(t,n,r,o)}else if(iT(e))return vr(Kg[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),Kg[e];return e},Ca=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function sT(e,t){let n=new Set,r=new Set,o=!1,i=!1;const s=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(u){s.has(u)&&(c.schedule(u),e()),u(a)}const c={schedule:(u,f=!1,d=!1)=>{const g=d&&o?n:r;return f&&s.add(u),g.has(u)||g.add(u),u},cancel:u=>{r.delete(u),s.delete(u)},process:u=>{if(a=u,o){i=!0;return}o=!0,[n,r]=[r,n],n.forEach(l),n.clear(),o=!1,i&&(i=!1,c.process(u))}};return c}const aT=40;function sx(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,s=Ca.reduce((x,b)=>(x[b]=sT(i),x),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:u,update:f,preRender:d,render:h,postRender:g}=s,p=()=>{const x=xr.useManualTiming?o.timestamp:performance.now();n=!1,xr.useManualTiming||(o.delta=r?1e3/60:Math.max(Math.min(x-o.timestamp,aT),1)),o.timestamp=x,o.isProcessing=!0,a.process(o),l.process(o),c.process(o),u.process(o),f.process(o),d.process(o),h.process(o),g.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(p))},m=()=>{n=!0,r=!0,o.isProcessing||e(p)};return{schedule:Ca.reduce((x,b)=>{const w=s[b];return x[b]=(_,E=!1,R=!1)=>(n||m(),w.schedule(_,E,R)),x},{}),cancel:x=>{for(let b=0;b<Ca.length;b++)s[Ca[b]].cancel(x)},state:o,steps:s}}const{schedule:Ue,cancel:jr,state:mt,steps:Ic}=sx(typeof requestAnimationFrame<"u"?requestAnimationFrame:cn,!0);let Qa;function lT(){Qa=void 0}const jt={now:()=>(Qa===void 0&&jt.set(mt.isProcessing||xr.useManualTiming?mt.timestamp:performance.now()),Qa),set:e=>{Qa=e,queueMicrotask(lT)}},ax=e=>t=>typeof t=="string"&&t.startsWith(e),lx=ax("--"),cT=ax("var(--"),Wf=e=>cT(e)?uT.test(e.split("/*")[0].trim()):!1,uT=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,zi={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Is={...zi,transform:e=>yr(0,1,e)},Sa={...zi,default:1},Ts=e=>Math.round(e*1e5)/1e5,Kf=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function dT(e){return e==null}const fT=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Uf=(e,t)=>n=>!!(typeof n=="string"&&fT.test(n)&&n.startsWith(e)||t&&!dT(n)&&Object.prototype.hasOwnProperty.call(n,t)),cx=(e,t,n)=>r=>{if(typeof r!="string")return r;const[o,i,s,a]=r.match(Kf);return{[e]:parseFloat(o),[t]:parseFloat(i),[n]:parseFloat(s),alpha:a!==void 0?parseFloat(a):1}},hT=e=>yr(0,255,e),Dc={...zi,transform:e=>Math.round(hT(e))},xo={test:Uf("rgb","red"),parse:cx("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Dc.transform(e)+", "+Dc.transform(t)+", "+Dc.transform(n)+", "+Ts(Is.transform(r))+")"};function gT(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const ad={test:Uf("#"),parse:gT,transform:xo.transform},Js=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Rr=Js("deg"),Hn=Js("%"),he=Js("px"),pT=Js("vh"),mT=Js("vw"),Gg={...Hn,parse:e=>Hn.parse(e)/100,transform:e=>Hn.transform(e*100)},pi={test:Uf("hsl","hue"),parse:cx("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Hn.transform(Ts(t))+", "+Hn.transform(Ts(n))+", "+Ts(Is.transform(r))+")"},it={test:e=>xo.test(e)||ad.test(e)||pi.test(e),parse:e=>xo.test(e)?xo.parse(e):pi.test(e)?pi.parse(e):ad.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?xo.transform(e):pi.transform(e),getAnimatableNone:e=>{const t=it.parse(e);return t.alpha=0,it.transform(t)}},yT=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function vT(e){return isNaN(e)&&typeof e=="string"&&(e.match(Kf)?.length||0)+(e.match(yT)?.length||0)>0}const ux="number",dx="color",xT="var",bT="var(",qg="${}",wT=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Ds(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let i=0;const a=t.replace(wT,l=>(it.test(l)?(r.color.push(i),o.push(dx),n.push(it.parse(l))):l.startsWith(bT)?(r.var.push(i),o.push(xT),n.push(l)):(r.number.push(i),o.push(ux),n.push(parseFloat(l))),++i,qg)).split(qg);return{values:n,split:a,indexes:r,types:o}}function fx(e){return Ds(e).values}function hx(e){const{split:t,types:n}=Ds(e),r=t.length;return o=>{let i="";for(let s=0;s<r;s++)if(i+=t[s],o[s]!==void 0){const a=n[s];a===ux?i+=Ts(o[s]):a===dx?i+=it.transform(o[s]):i+=o[s]}return i}}const CT=e=>typeof e=="number"?0:it.test(e)?it.getAnimatableNone(e):e;function ST(e){const t=fx(e);return hx(e)(t.map(CT))}const Vr={test:vT,parse:fx,createTransformer:hx,getAnimatableNone:ST};function jc(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function _T({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let o=0,i=0,s=0;if(!t)o=i=s=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;o=jc(l,a,e+1/3),i=jc(l,a,e),s=jc(l,a,e-1/3)}return{red:Math.round(o*255),green:Math.round(i*255),blue:Math.round(s*255),alpha:r}}function gl(e,t){return n=>n>0?t:e}const Je=(e,t,n)=>e+(t-e)*n,Vc=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},TT=[ad,xo,pi],ET=e=>TT.find(t=>t.test(e));function Yg(e){const t=ET(e);if(Bi(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let n=t.parse(e);return t===pi&&(n=_T(n)),n}const Xg=(e,t)=>{const n=Yg(e),r=Yg(t);if(!n||!r)return gl(e,t);const o={...n};return i=>(o.red=Vc(n.red,r.red,i),o.green=Vc(n.green,r.green,i),o.blue=Vc(n.blue,r.blue,i),o.alpha=Je(n.alpha,r.alpha,i),xo.transform(o))},ld=new Set(["none","hidden"]);function RT(e,t){return ld.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function kT(e,t){return n=>Je(e,t,n)}function Gf(e){return typeof e=="number"?kT:typeof e=="string"?Wf(e)?gl:it.test(e)?Xg:MT:Array.isArray(e)?gx:typeof e=="object"?it.test(e)?Xg:AT:gl}function gx(e,t){const n=[...e],r=n.length,o=e.map((i,s)=>Gf(i)(i,t[s]));return i=>{for(let s=0;s<r;s++)n[s]=o[s](i);return n}}function AT(e,t){const n={...e,...t},r={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(r[o]=Gf(e[o])(e[o],t[o]));return o=>{for(const i in r)n[i]=r[i](o);return n}}function NT(e,t){const n=[],r={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const i=t.types[o],s=e.indexes[i][r[i]],a=e.values[s]??0;n[o]=a,r[i]++}return n}const MT=(e,t)=>{const n=Vr.createTransformer(t),r=Ds(e),o=Ds(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?ld.has(e)&&!o.values.length||ld.has(t)&&!r.values.length?RT(e,t):Xs(gx(NT(r,o),o.values),n):(Bi(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),gl(e,t))};function px(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Je(e,t,n):Gf(e)(e,t)}const PT=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>Ue.update(t,n),stop:()=>jr(t),now:()=>mt.isProcessing?mt.timestamp:jt.now()}},mx=(e,t,n=10)=>{let r="";const o=Math.max(Math.round(t/n),2);for(let i=0;i<o;i++)r+=Math.round(e(i/(o-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},pl=2e4;function qf(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<pl;)t+=n,r=e.next(t);return t>=pl?1/0:t}function LT(e,t=100,n){const r=n({...e,keyframes:[0,t]}),o=Math.min(qf(r),pl);return{type:"keyframes",ease:i=>r.next(o*i).value/t,duration:ln(o)}}const FT=5;function yx(e,t,n){const r=Math.max(t-FT,0);return Y0(n-e(r),t-r)}const Xe={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Bc=.001;function $T({duration:e=Xe.duration,bounce:t=Xe.bounce,velocity:n=Xe.velocity,mass:r=Xe.mass}){let o,i;Bi(e<=Tn(Xe.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let s=1-t;s=yr(Xe.minDamping,Xe.maxDamping,s),e=yr(Xe.minDuration,Xe.maxDuration,ln(e)),s<1?(o=c=>{const u=c*s,f=u*e,d=u-n,h=cd(c,s),g=Math.exp(-f);return Bc-d/h*g},i=c=>{const f=c*s*e,d=f*n+n,h=Math.pow(s,2)*Math.pow(c,2)*e,g=Math.exp(-f),p=cd(Math.pow(c,2),s);return(-o(c)+Bc>0?-1:1)*((d-h)*g)/p}):(o=c=>{const u=Math.exp(-c*e),f=(c-n)*e+1;return-Bc+u*f},i=c=>{const u=Math.exp(-c*e),f=(n-c)*(e*e);return u*f});const a=5/e,l=IT(o,i,a);if(e=Tn(e),isNaN(l))return{stiffness:Xe.stiffness,damping:Xe.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:s*2*Math.sqrt(r*c),duration:e}}}const OT=12;function IT(e,t,n){let r=n;for(let o=1;o<OT;o++)r=r-e(r)/t(r);return r}function cd(e,t){return e*Math.sqrt(1-t*t)}const DT=["duration","bounce"],jT=["stiffness","damping","mass"];function Zg(e,t){return t.some(n=>e[n]!==void 0)}function VT(e){let t={velocity:Xe.velocity,stiffness:Xe.stiffness,damping:Xe.damping,mass:Xe.mass,isResolvedFromDuration:!1,...e};if(!Zg(e,jT)&&Zg(e,DT))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),o=r*r,i=2*yr(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:Xe.mass,stiffness:o,damping:i}}else{const n=$T(e);t={...t,...n,mass:Xe.mass},t.isResolvedFromDuration=!0}return t}function ml(e=Xe.visualDuration,t=Xe.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:o}=n;const i=n.keyframes[0],s=n.keyframes[n.keyframes.length-1],a={done:!1,value:i},{stiffness:l,damping:c,mass:u,duration:f,velocity:d,isResolvedFromDuration:h}=VT({...n,velocity:-ln(n.velocity||0)}),g=d||0,p=c/(2*Math.sqrt(l*u)),m=s-i,v=ln(Math.sqrt(l/u)),y=Math.abs(m)<5;r||(r=y?Xe.restSpeed.granular:Xe.restSpeed.default),o||(o=y?Xe.restDelta.granular:Xe.restDelta.default);let x;if(p<1){const w=cd(v,p);x=_=>{const E=Math.exp(-p*v*_);return s-E*((g+p*v*m)/w*Math.sin(w*_)+m*Math.cos(w*_))}}else if(p===1)x=w=>s-Math.exp(-v*w)*(m+(g+v*m)*w);else{const w=v*Math.sqrt(p*p-1);x=_=>{const E=Math.exp(-p*v*_),R=Math.min(w*_,300);return s-E*((g+p*v*m)*Math.sinh(R)+w*m*Math.cosh(R))/w}}const b={calculatedDuration:h&&f||null,next:w=>{const _=x(w);if(h)a.done=w>=f;else{let E=w===0?g:0;p<1&&(E=w===0?Tn(g):yx(x,w,_));const R=Math.abs(E)<=r,k=Math.abs(s-_)<=o;a.done=R&&k}return a.value=a.done?s:_,a},toString:()=>{const w=Math.min(qf(b),pl),_=mx(E=>b.next(w*E).value,w,30);return w+"ms "+_},toTransition:()=>{}};return b}ml.applyToOptions=e=>{const t=LT(e,100,ml);return e.ease=t.ease,e.duration=Tn(t.duration),e.type="keyframes",e};function ud({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:i=500,modifyTarget:s,min:a,max:l,restDelta:c=.5,restSpeed:u}){const f=e[0],d={done:!1,value:f},h=R=>a!==void 0&&R<a||l!==void 0&&R>l,g=R=>a===void 0?l:l===void 0||Math.abs(a-R)<Math.abs(l-R)?a:l;let p=n*t;const m=f+p,v=s===void 0?m:s(m);v!==m&&(p=v-f);const y=R=>-p*Math.exp(-R/r),x=R=>v+y(R),b=R=>{const k=y(R),M=x(R);d.done=Math.abs(k)<=c,d.value=d.done?v:M};let w,_;const E=R=>{h(d.value)&&(w=R,_=ml({keyframes:[d.value,g(d.value)],velocity:yx(x,R,d.value),damping:o,stiffness:i,restDelta:c,restSpeed:u}))};return E(0),{calculatedDuration:null,next:R=>{let k=!1;return!_&&w===void 0&&(k=!0,b(R),E(R)),w!==void 0&&R>=w?_.next(R-w):(!k&&b(R),d)}}}function BT(e,t,n){const r=[],o=n||xr.mix||px,i=e.length-1;for(let s=0;s<i;s++){let a=o(e[s],e[s+1]);if(t){const l=Array.isArray(t)?t[s]||cn:t;a=Xs(l,a)}r.push(a)}return r}function zT(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const i=e.length;if(vr(i===t.length,"Both input and output ranges must be the same length","range-length"),i===1)return()=>t[0];if(i===2&&t[0]===t[1])return()=>t[1];const s=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=BT(t,r,o),l=a.length,c=u=>{if(s&&u<e[0])return t[0];let f=0;if(l>1)for(;f<e.length-2&&!(u<e[f+1]);f++);const d=Os(e[f],e[f+1],u);return a[f](d)};return n?u=>c(yr(e[0],e[i-1],u)):c}function HT(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=Os(0,t,r);e.push(Je(n,1,o))}}function WT(e){const t=[0];return HT(t,e.length-1),t}function KT(e,t){return e.map(n=>n*t)}function UT(e,t){return e.map(()=>t||ox).splice(0,e.length-1)}function mi({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=oT(r)?r.map(Ug):Ug(r),i={done:!1,value:t[0]},s=KT(n&&n.length===t.length?n:WT(t),e),a=zT(s,t,{ease:Array.isArray(o)?o:UT(t,o)});return{calculatedDuration:e,next:l=>(i.value=a(l),i.done=l>=e,i)}}const GT=e=>e!==null;function Yf(e,{repeat:t,repeatType:n="loop"},r,o=1){const i=e.filter(GT),a=o<0||t&&n!=="loop"&&t%2===1?0:i.length-1;return!a||r===void 0?i[a]:r}const qT={decay:ud,inertia:ud,tween:mi,keyframes:mi,spring:ml};function vx(e){typeof e.type=="string"&&(e.type=qT[e.type])}class Xf{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const YT=e=>e/100;class Zf extends Xf{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==jt.now()&&this.tick(jt.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;vx(t);const{type:n=mi,repeat:r=0,repeatDelay:o=0,repeatType:i,velocity:s=0}=t;let{keyframes:a}=t;const l=n||mi;process.env.NODE_ENV!=="production"&&l!==mi&&vr(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),l!==mi&&typeof a[0]!="number"&&(this.mixKeyframes=Xs(YT,px(a[0],a[1])),a=[0,100]);const c=l({...t,keyframes:a});i==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...a].reverse(),velocity:-s})),c.calculatedDuration===null&&(c.calculatedDuration=qf(c));const{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+o,this.totalDuration=this.resolvedDuration*(r+1)-o,this.generator=c}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:o,mixKeyframes:i,mirroredGenerator:s,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return r.next(0);const{delay:c=0,keyframes:u,repeat:f,repeatType:d,repeatDelay:h,type:g,onUpdate:p,finalKeyframe:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-o/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const v=this.currentTime-c*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?v<0:v>o;this.currentTime=Math.max(v,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let x=this.currentTime,b=r;if(f){const R=Math.min(this.currentTime,o)/a;let k=Math.floor(R),M=R%1;!M&&R>=1&&(M=1),M===1&&k--,k=Math.min(k,f+1),k%2&&(d==="reverse"?(M=1-M,h&&(M-=h/a)):d==="mirror"&&(b=s)),x=yr(0,1,M)*a}const w=y?{done:!1,value:u[0]}:b.next(x);i&&(w.value=i(w.value));let{done:_}=w;!y&&l!==null&&(_=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);const E=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&_);return E&&g!==ud&&(w.value=Yf(u,this.options,m,this.speed)),p&&p(w.value),E&&this.finish(),w}then(t,n){return this.finished.then(t,n)}get duration(){return ln(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+ln(t)}get time(){return ln(this.currentTime)}set time(t){t=Tn(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(jt.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=ln(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=PT,startTime:n}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),this.options.onPlay?.();const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(jt.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function XT(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const bo=e=>e*180/Math.PI,dd=e=>{const t=bo(Math.atan2(e[1],e[0]));return fd(t)},ZT={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:dd,rotateZ:dd,skewX:e=>bo(Math.atan(e[1])),skewY:e=>bo(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},fd=e=>(e=e%360,e<0&&(e+=360),e),Jg=dd,Qg=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),ep=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),JT={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Qg,scaleY:ep,scale:e=>(Qg(e)+ep(e))/2,rotateX:e=>fd(bo(Math.atan2(e[6],e[5]))),rotateY:e=>fd(bo(Math.atan2(-e[2],e[0]))),rotateZ:Jg,rotate:Jg,skewX:e=>bo(Math.atan(e[4])),skewY:e=>bo(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function hd(e){return e.includes("scale")?1:0}function gd(e,t){if(!e||e==="none")return hd(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,o;if(n)r=JT,o=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=ZT,o=a}if(!o)return hd(t);const i=r[t],s=o[1].split(",").map(eE);return typeof i=="function"?i(s):s[i]}const QT=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return gd(n,t)};function eE(e){return parseFloat(e.trim())}const Hi=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Wi=new Set(Hi),tp=e=>e===zi||e===he,tE=new Set(["x","y","z"]),nE=Hi.filter(e=>!tE.has(e));function rE(e){const t=[];return nE.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const So={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>gd(t,"x"),y:(e,{transform:t})=>gd(t,"y")};So.translateX=So.x;So.translateY=So.y;const _o=new Set;let pd=!1,md=!1,yd=!1;function xx(){if(md){const e=Array.from(_o).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const o=rE(r);o.length&&(n.set(r,o),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const o=n.get(r);o&&o.forEach(([i,s])=>{r.getValue(i)?.set(s)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}md=!1,pd=!1,_o.forEach(e=>e.complete(yd)),_o.clear()}function bx(){_o.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(md=!0)})}function oE(){yd=!0,bx(),xx(),yd=!1}class Jf{constructor(t,n,r,o,i,s=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=o,this.element=i,this.isAsync=s}scheduleResolve(){this.state="scheduled",this.isAsync?(_o.add(this),pd||(pd=!0,Ue.read(bx),Ue.resolveKeyframes(xx))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:o}=this;if(t[0]===null){const i=o?.get(),s=t[t.length-1];if(i!==void 0)t[0]=i;else if(r&&n){const a=r.readValue(n,s);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=s),o&&i===void 0&&o.set(t[0])}XT(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),_o.delete(this)}cancel(){this.state==="scheduled"&&(_o.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const iE=e=>e.startsWith("--");function sE(e,t,n){iE(t)?e.style.setProperty(t,n):e.style[t]=n}const aE=jf(()=>window.ScrollTimeline!==void 0),lE={};function cE(e,t){const n=jf(e);return()=>lE[t]??n()}const wx=cE(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),xs=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,np={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:xs([0,.65,.55,1]),circOut:xs([.55,0,1,.45]),backIn:xs([.31,.01,.66,-.59]),backOut:xs([.33,1.53,.69,.99])};function Cx(e,t){if(e)return typeof e=="function"?wx()?mx(e,t):"ease-out":ix(e)?xs(e):Array.isArray(e)?e.map(n=>Cx(n,t)||np.easeOut):np[e]}function uE(e,t,n,{delay:r=0,duration:o=300,repeat:i=0,repeatType:s="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[t]:n};l&&(u.offset=l);const f=Cx(a,o);Array.isArray(f)&&(u.easing=f);const d={delay:r,duration:o,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:i+1,direction:s==="reverse"?"alternate":"normal"};return c&&(d.pseudoElement=c),e.animate(u,d)}function Sx(e){return typeof e=="function"&&"applyToOptions"in e}function dE({type:e,...t}){return Sx(e)&&wx()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class fE extends Xf{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:r,keyframes:o,pseudoElement:i,allowFlatten:s=!1,finalKeyframe:a,onComplete:l}=t;this.isPseudoElement=!!i,this.allowFlatten=s,this.options=t,vr(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const c=dE(t);this.animation=uE(n,r,o,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const u=Yf(o,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(u):sE(n,r,u),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return ln(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+ln(t)}get time(){return ln(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=Tn(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&aE()?(this.animation.timeline=t,cn):n(this)}}const _x={anticipate:tx,backInOut:ex,circInOut:rx};function hE(e){return e in _x}function gE(e){typeof e.ease=="string"&&hE(e.ease)&&(e.ease=_x[e.ease])}const rp=10;class pE extends fE{constructor(t){gE(t),vx(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:o,element:i,...s}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new Zf({...s,autoplay:!1}),l=Tn(this.finishedTime??this.time);n.setWithVelocity(a.sample(l-rp).value,a.sample(l).value,rp),a.stop()}}const op=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Vr.test(e)||e==="0")&&!e.startsWith("url("));function mE(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function yE(e,t,n,r){const o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],s=op(o,t),a=op(i,t);return Bi(s===a,`You are trying to animate ${t} from "${o}" to "${i}". "${s?i:o}" is not an animatable value.`,"value-not-animatable"),!s||!a?!1:mE(e)||(n==="spring"||Sx(n))&&r}function vd(e){e.duration=0,e.type="keyframes"}const vE=new Set(["opacity","clipPath","filter","transform"]),xE=jf(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function bE(e){const{motionValue:t,name:n,repeatDelay:r,repeatType:o,damping:i,type:s}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=t.owner.getProps();return xE()&&n&&vE.has(n)&&(n!=="transform"||!c)&&!l&&!r&&o!=="mirror"&&i!==0&&s!=="inertia"}const wE=40;class CE extends Xf{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:o=0,repeatDelay:i=0,repeatType:s="loop",keyframes:a,name:l,motionValue:c,element:u,...f}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=jt.now();const d={autoplay:t,delay:n,type:r,repeat:o,repeatDelay:i,repeatType:s,name:l,motionValue:c,element:u,...f},h=u?.KeyframeResolver||Jf;this.keyframeResolver=new h(a,(g,p,m)=>this.onKeyframesResolved(g,p,d,!m),l,c,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,r,o){this.keyframeResolver=void 0;const{name:i,type:s,velocity:a,delay:l,isHandoff:c,onUpdate:u}=r;this.resolvedAt=jt.now(),yE(t,i,s,a)||((xr.instantAnimations||!l)&&u?.(Yf(t,r,n)),t[0]=t[t.length-1],vd(r),r.repeat=0);const d={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>wE?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},h=!c&&bE(d)?new pE({...d,element:d.motionValue.owner.current}):new Zf(d);h.finished.then(()=>this.notifyFinished()).catch(cn),this.pendingTimeline&&(this.stopTimeline=h.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=h}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),oE()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const SE=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function _E(e){const t=SE.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${n??r}`,o]}const TE=4;function Tx(e,t,n=1){vr(n<=TE,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,o]=_E(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const s=i.trim();return U0(s)?parseFloat(s):s}return Wf(o)?Tx(o,t,n+1):o}function Qf(e,t){return e?.[t]??e?.default??e}const Ex=new Set(["width","height","top","left","right","bottom",...Hi]),EE={test:e=>e==="auto",parse:e=>e},Rx=e=>t=>t.test(e),kx=[zi,he,Hn,Rr,mT,pT,EE],ip=e=>kx.find(Rx(e));function RE(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||q0(e):!0}const kE=new Set(["brightness","contrast","saturate","opacity"]);function AE(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Kf)||[];if(!r)return e;const o=n.replace(r,"");let i=kE.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+o+")"}const NE=/\b([a-z-]*)\(.*?\)/gu,xd={...Vr,getAnimatableNone:e=>{const t=e.match(NE);return t?t.map(AE).join(" "):e}},sp={...zi,transform:Math.round},ME={rotate:Rr,rotateX:Rr,rotateY:Rr,rotateZ:Rr,scale:Sa,scaleX:Sa,scaleY:Sa,scaleZ:Sa,skew:Rr,skewX:Rr,skewY:Rr,distance:he,translateX:he,translateY:he,translateZ:he,x:he,y:he,z:he,perspective:he,transformPerspective:he,opacity:Is,originX:Gg,originY:Gg,originZ:he},eh={borderWidth:he,borderTopWidth:he,borderRightWidth:he,borderBottomWidth:he,borderLeftWidth:he,borderRadius:he,radius:he,borderTopLeftRadius:he,borderTopRightRadius:he,borderBottomRightRadius:he,borderBottomLeftRadius:he,width:he,maxWidth:he,height:he,maxHeight:he,top:he,right:he,bottom:he,left:he,padding:he,paddingTop:he,paddingRight:he,paddingBottom:he,paddingLeft:he,margin:he,marginTop:he,marginRight:he,marginBottom:he,marginLeft:he,backgroundPositionX:he,backgroundPositionY:he,...ME,zIndex:sp,fillOpacity:Is,strokeOpacity:Is,numOctaves:sp},PE={...eh,color:it,backgroundColor:it,outlineColor:it,fill:it,stroke:it,borderColor:it,borderTopColor:it,borderRightColor:it,borderBottomColor:it,borderLeftColor:it,filter:xd,WebkitFilter:xd},Ax=e=>PE[e];function Nx(e,t){let n=Ax(e);return n!==xd&&(n=Vr),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const LE=new Set(["auto","none","0"]);function FE(e,t,n){let r=0,o;for(;r<e.length&&!o;){const i=e[r];typeof i=="string"&&!LE.has(i)&&Ds(i).values.length&&(o=e[r]),r++}if(o&&n)for(const i of t)e[i]=Nx(n,o)}class $E extends Jf{constructor(t,n,r,o,i){super(t,n,r,o,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let c=t[l];if(typeof c=="string"&&(c=c.trim(),Wf(c))){const u=Tx(c,n.current);u!==void 0&&(t[l]=u),l===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!Ex.has(r)||t.length!==2)return;const[o,i]=t,s=ip(o),a=ip(i);if(s!==a)if(tp(s)&&tp(a))for(let l=0;l<t.length;l++){const c=t[l];typeof c=="string"&&(t[l]=parseFloat(c))}else So[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let o=0;o<t.length;o++)(t[o]===null||RE(t[o]))&&r.push(o);r.length&&FE(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=So[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const o=n[n.length-1];o!==void 0&&t.getValue(r,o).jump(o,!1)}measureEndState(){const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const o=t.getValue(n);o&&o.jump(this.measuredOrigin,!1);const i=r.length-1,s=r[i];r[i]=So[n](t.measureViewportBox(),window.getComputedStyle(t.current)),s!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=s),this.removedTransforms?.length&&this.removedTransforms.forEach(([a,l])=>{t.getValue(a).set(l)}),this.resolveNoneKeyframes()}}function OE(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const o=n?.[e]??r.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e)}const Mx=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Px(e){return G0(e)&&"offsetHeight"in e}const ap=30,IE=e=>!isNaN(parseFloat(e));class DE{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{const o=jt.now();if(this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const i of this.dependents)i.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=jt.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=IE(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&Bf(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Vf);const r=this.events[t].add(n);return t==="change"?()=>{r(),Ue.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=jt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>ap)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,ap);return Y0(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Pi(e,t){return new DE(e,t)}const{schedule:th}=sx(queueMicrotask,!1),bn={x:!1,y:!1};function Lx(){return bn.x||bn.y}function jE(e){return e==="x"||e==="y"?bn[e]?null:(bn[e]=!0,()=>{bn[e]=!1}):bn.x||bn.y?null:(bn.x=bn.y=!0,()=>{bn.x=bn.y=!1})}function Fx(e,t){const n=OE(e),r=new AbortController,o={passive:!0,...t,signal:r.signal};return[n,o,()=>r.abort()]}function lp(e){return!(e.pointerType==="touch"||Lx())}function VE(e,t,n={}){const[r,o,i]=Fx(e,n),s=a=>{if(!lp(a))return;const{target:l}=a,c=t(l,a);if(typeof c!="function"||!l)return;const u=f=>{lp(f)&&(c(f),l.removeEventListener("pointerleave",u))};l.addEventListener("pointerleave",u,o)};return r.forEach(a=>{a.addEventListener("pointerenter",s,o)}),i}const $x=(e,t)=>t?e===t?!0:$x(e,t.parentElement):!1,nh=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,BE=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function zE(e){return BE.has(e.tagName)||e.tabIndex!==-1}const el=new WeakSet;function cp(e){return t=>{t.key==="Enter"&&e(t)}}function zc(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const HE=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=cp(()=>{if(el.has(n))return;zc(n,"down");const o=cp(()=>{zc(n,"up")}),i=()=>zc(n,"cancel");n.addEventListener("keyup",o,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function up(e){return nh(e)&&!Lx()}function WE(e,t,n={}){const[r,o,i]=Fx(e,n),s=a=>{const l=a.currentTarget;if(!up(a))return;el.add(l);const c=t(l,a),u=(h,g)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",d),el.has(l)&&el.delete(l),up(h)&&typeof c=="function"&&c(h,{success:g})},f=h=>{u(h,l===window||l===document||n.useGlobalTarget||$x(l,h.target))},d=h=>{u(h,!1)};window.addEventListener("pointerup",f,o),window.addEventListener("pointercancel",d,o)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",s,o),Px(a)&&(a.addEventListener("focus",c=>HE(c,o)),!zE(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),i}function Ox(e){return G0(e)&&"ownerSVGElement"in e}function KE(e){return Ox(e)&&e.tagName==="svg"}const St=e=>!!(e&&e.getVelocity),UE=[...kx,it,Vr],GE=e=>UE.find(Rx(e)),rh=S.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function dp(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function qE(...e){return t=>{let n=!1;const r=e.map(o=>{const i=dp(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():dp(e[o],null)}}}}function YE(...e){return N.useCallback(qE(...e),e)}class XE extends N.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,o=Px(r)&&r.offsetWidth||0,i=this.props.sizeRef.current;i.height=n.offsetHeight||0,i.width=n.offsetWidth||0,i.top=n.offsetTop,i.left=n.offsetLeft,i.right=o-i.width-i.left}return null}componentDidUpdate(){}render(){return this.props.children}}function ZE({children:e,isPresent:t,anchorX:n,root:r}){const o=S.useId(),i=S.useRef(null),s=S.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:a}=S.useContext(rh),l=YE(i,e?.ref);return S.useInsertionEffect(()=>{const{width:c,height:u,top:f,left:d,right:h}=s.current;if(t||!i.current||!c||!u)return;const g=n==="left"?`left: ${d}`:`right: ${h}`;i.current.dataset.motionPopId=o;const p=document.createElement("style");a&&(p.nonce=a);const m=r??document.head;return m.appendChild(p),p.sheet&&p.sheet.insertRule(`
26
+ `,wa={overlay:T.css({backdropFilter:"blur(5px)"}),modal:T.css({animationDuration:"0.2s",animationTimingFunction:"ease-in-out",animationName:Z_,maxWidth:`calc(100vw - ${V.spacing["3xl"]})`,maxHeight:`calc(100vh - ${V.spacing["7xl"]} - ${V.spacing["7xl"]})`,borderRadius:V.cornerRadius["2xl"],backgroundColor:V.color.fill.bgPrimary,boxShadow:`0 4px 20px 0 ${V.color.effect.shadowS}`,[vs.sm()]:{flex:1}}),closeButton:T.css({position:"absolute",zIndex:1,top:V.spacing.lg,right:V.spacing.lg}),size_lg:T.css({width:874}),size_md:T.css({width:650}),size_sm:T.css({width:426})},K0=S.forwardRef(({isOpen:e,onClose:t,overlayClassName:n,modalClassName:r,absoluteCloseButtonClassName:o,size:i="md",closeOnBackdropClick:s=!0,closeOnEsc:a=!0,disableBodyScroll:l=!0,showAbsoluteCloseButton:c,children:u},f)=>{S.useEffect(()=>{if(l&&e&&typeof window<"u"&&typeof document<"u"){const m=window.getComputedStyle(document.body).overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=m}}},[e,l]);const d=S.useCallback(m=>{m.key==="Escape"&&t()},[t]);S.useEffect(()=>{if(typeof window<"u"&&typeof document<"u"&&a&&e)return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[e,a,d]);const h=S.useRef(!1),g=S.useCallback(m=>{h.current=m.target===m.currentTarget},[]),p=S.useCallback(m=>{s&&m.target===m.currentTarget&&h.current&&t()},[s,t]);return e?C.jsx(ts,{children:C.jsx(W0.Provider,{value:{isOpen:e,onClose:t},children:C.jsx(q,{position:"fixed",top:0,right:0,bottom:0,left:0,row:!0,center:!0,flex:1,onMouseDown:g,onClick:p,backgroundColor:V.color.fill.bgOverlayPrimary,className:T.cx(wa.overlay,n),zIndex:1,children:C.jsxs(q,{ref:f,className:T.cx(wa.modal,wa[`size_${i}`],r),relative:!0,children:[c&&C.jsx(pr,{className:T.cx(wa.closeButton,o),onClick:t,color:"neutral",children:C.jsx(H0,{})}),u]})})})}):null});K0.displayName="Modal";const J_=T.css({borderTop:`1px solid ${V.color.border.neutralAlphaBasic}`}),U0=S.forwardRef(({children:e,row:t=!0,flex:n=!0,gap:r=V.spacing.lg,p:o=V.spacing["2xl"],className:i,...s},a)=>C.jsx(q,{flex:n,row:t,gap:r,p:o,className:T.cx(J_,i),ref:a,...s,children:e}));U0.displayName="ModalFooter";const $f=S.createContext({});function Of(e){const t=S.useRef(null);return t.current===null&&(t.current=e()),t.current}const If=typeof window<"u",G0=If?S.useLayoutEffect:S.useEffect,ql=S.createContext(null);function Df(e,t){e.indexOf(t)===-1&&e.push(t)}function jf(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const yr=(e,t,n)=>n>t?t:n<e?e:n;function ad(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let Bi=()=>{},vr=()=>{};process.env.NODE_ENV!=="production"&&(Bi=(e,t,n)=>{!e&&typeof console<"u"&&console.warn(ad(t,n))},vr=(e,t,n)=>{if(!e)throw new Error(ad(t,n))});const xr={},q0=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function Y0(e){return typeof e=="object"&&e!==null}const X0=e=>/^0[^.\s]+$/u.test(e);function Vf(e){let t;return()=>(t===void 0&&(t=e()),t)}const cn=e=>e,Q_=(e,t)=>n=>t(e(n)),Xs=(...e)=>e.reduce(Q_),Os=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class Bf{constructor(){this.subscriptions=[]}add(t){return Df(this.subscriptions,t),()=>jf(this.subscriptions,t)}notify(t,n,r){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,n,r);else for(let i=0;i<o;i++){const s=this.subscriptions[i];s&&s(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Tn=e=>e*1e3,ln=e=>e/1e3;function Z0(e,t){return t?e*(1e3/t):0}const Kg=new Set;function zf(e,t,n){e||Kg.has(t)||(console.warn(ad(t,n)),Kg.add(t))}const J0=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,eT=1e-7,tT=12;function nT(e,t,n,r,o){let i,s,a=0;do s=t+(n-t)/2,i=J0(s,r,o)-e,i>0?n=s:t=s;while(Math.abs(i)>eT&&++a<tT);return s}function Zs(e,t,n,r){if(e===t&&n===r)return cn;const o=i=>nT(i,0,1,e,n);return i=>i===0||i===1?i:J0(o(i),t,r)}const Q0=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,ex=e=>t=>1-e(1-t),tx=Zs(.33,1.53,.69,.99),Hf=ex(tx),nx=Q0(Hf),rx=e=>(e*=2)<1?.5*Hf(e):.5*(2-Math.pow(2,-10*(e-1))),Wf=e=>1-Math.sin(Math.acos(e)),ox=ex(Wf),ix=Q0(Wf),rT=Zs(.42,0,1,1),oT=Zs(0,0,.58,1),sx=Zs(.42,0,.58,1),iT=e=>Array.isArray(e)&&typeof e[0]!="number",ax=e=>Array.isArray(e)&&typeof e[0]=="number",Ug={linear:cn,easeIn:rT,easeInOut:sx,easeOut:oT,circIn:Wf,circInOut:ix,circOut:ox,backIn:Hf,backInOut:nx,backOut:tx,anticipate:rx},sT=e=>typeof e=="string",Gg=e=>{if(ax(e)){vr(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,r,o]=e;return Zs(t,n,r,o)}else if(sT(e))return vr(Ug[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),Ug[e];return e},Ca=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function aT(e,t){let n=new Set,r=new Set,o=!1,i=!1;const s=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(u){s.has(u)&&(c.schedule(u),e()),u(a)}const c={schedule:(u,f=!1,d=!1)=>{const g=d&&o?n:r;return f&&s.add(u),g.has(u)||g.add(u),u},cancel:u=>{r.delete(u),s.delete(u)},process:u=>{if(a=u,o){i=!0;return}o=!0,[n,r]=[r,n],n.forEach(l),n.clear(),o=!1,i&&(i=!1,c.process(u))}};return c}const lT=40;function lx(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,s=Ca.reduce((x,b)=>(x[b]=aT(i),x),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:u,update:f,preRender:d,render:h,postRender:g}=s,p=()=>{const x=xr.useManualTiming?o.timestamp:performance.now();n=!1,xr.useManualTiming||(o.delta=r?1e3/60:Math.max(Math.min(x-o.timestamp,lT),1)),o.timestamp=x,o.isProcessing=!0,a.process(o),l.process(o),c.process(o),u.process(o),f.process(o),d.process(o),h.process(o),g.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(p))},m=()=>{n=!0,r=!0,o.isProcessing||e(p)};return{schedule:Ca.reduce((x,b)=>{const w=s[b];return x[b]=(_,E=!1,R=!1)=>(n||m(),w.schedule(_,E,R)),x},{}),cancel:x=>{for(let b=0;b<Ca.length;b++)s[Ca[b]].cancel(x)},state:o,steps:s}}const{schedule:Ue,cancel:jr,state:mt,steps:Dc}=lx(typeof requestAnimationFrame<"u"?requestAnimationFrame:cn,!0);let Qa;function cT(){Qa=void 0}const jt={now:()=>(Qa===void 0&&jt.set(mt.isProcessing||xr.useManualTiming?mt.timestamp:performance.now()),Qa),set:e=>{Qa=e,queueMicrotask(cT)}},cx=e=>t=>typeof t=="string"&&t.startsWith(e),ux=cx("--"),uT=cx("var(--"),Kf=e=>uT(e)?dT.test(e.split("/*")[0].trim()):!1,dT=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,zi={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Is={...zi,transform:e=>yr(0,1,e)},Sa={...zi,default:1},Ts=e=>Math.round(e*1e5)/1e5,Uf=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function fT(e){return e==null}const hT=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Gf=(e,t)=>n=>!!(typeof n=="string"&&hT.test(n)&&n.startsWith(e)||t&&!fT(n)&&Object.prototype.hasOwnProperty.call(n,t)),dx=(e,t,n)=>r=>{if(typeof r!="string")return r;const[o,i,s,a]=r.match(Uf);return{[e]:parseFloat(o),[t]:parseFloat(i),[n]:parseFloat(s),alpha:a!==void 0?parseFloat(a):1}},gT=e=>yr(0,255,e),jc={...zi,transform:e=>Math.round(gT(e))},xo={test:Gf("rgb","red"),parse:dx("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+jc.transform(e)+", "+jc.transform(t)+", "+jc.transform(n)+", "+Ts(Is.transform(r))+")"};function pT(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const ld={test:Gf("#"),parse:pT,transform:xo.transform},Js=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Rr=Js("deg"),Hn=Js("%"),he=Js("px"),mT=Js("vh"),yT=Js("vw"),qg={...Hn,parse:e=>Hn.parse(e)/100,transform:e=>Hn.transform(e*100)},pi={test:Gf("hsl","hue"),parse:dx("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Hn.transform(Ts(t))+", "+Hn.transform(Ts(n))+", "+Ts(Is.transform(r))+")"},it={test:e=>xo.test(e)||ld.test(e)||pi.test(e),parse:e=>xo.test(e)?xo.parse(e):pi.test(e)?pi.parse(e):ld.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?xo.transform(e):pi.transform(e),getAnimatableNone:e=>{const t=it.parse(e);return t.alpha=0,it.transform(t)}},vT=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function xT(e){return isNaN(e)&&typeof e=="string"&&(e.match(Uf)?.length||0)+(e.match(vT)?.length||0)>0}const fx="number",hx="color",bT="var",wT="var(",Yg="${}",CT=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Ds(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let i=0;const a=t.replace(CT,l=>(it.test(l)?(r.color.push(i),o.push(hx),n.push(it.parse(l))):l.startsWith(wT)?(r.var.push(i),o.push(bT),n.push(l)):(r.number.push(i),o.push(fx),n.push(parseFloat(l))),++i,Yg)).split(Yg);return{values:n,split:a,indexes:r,types:o}}function gx(e){return Ds(e).values}function px(e){const{split:t,types:n}=Ds(e),r=t.length;return o=>{let i="";for(let s=0;s<r;s++)if(i+=t[s],o[s]!==void 0){const a=n[s];a===fx?i+=Ts(o[s]):a===hx?i+=it.transform(o[s]):i+=o[s]}return i}}const ST=e=>typeof e=="number"?0:it.test(e)?it.getAnimatableNone(e):e;function _T(e){const t=gx(e);return px(e)(t.map(ST))}const Vr={test:xT,parse:gx,createTransformer:px,getAnimatableNone:_T};function Vc(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function TT({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let o=0,i=0,s=0;if(!t)o=i=s=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;o=Vc(l,a,e+1/3),i=Vc(l,a,e),s=Vc(l,a,e-1/3)}return{red:Math.round(o*255),green:Math.round(i*255),blue:Math.round(s*255),alpha:r}}function gl(e,t){return n=>n>0?t:e}const Je=(e,t,n)=>e+(t-e)*n,Bc=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},ET=[ld,xo,pi],RT=e=>ET.find(t=>t.test(e));function Xg(e){const t=RT(e);if(Bi(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let n=t.parse(e);return t===pi&&(n=TT(n)),n}const Zg=(e,t)=>{const n=Xg(e),r=Xg(t);if(!n||!r)return gl(e,t);const o={...n};return i=>(o.red=Bc(n.red,r.red,i),o.green=Bc(n.green,r.green,i),o.blue=Bc(n.blue,r.blue,i),o.alpha=Je(n.alpha,r.alpha,i),xo.transform(o))},cd=new Set(["none","hidden"]);function kT(e,t){return cd.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function AT(e,t){return n=>Je(e,t,n)}function qf(e){return typeof e=="number"?AT:typeof e=="string"?Kf(e)?gl:it.test(e)?Zg:PT:Array.isArray(e)?mx:typeof e=="object"?it.test(e)?Zg:NT:gl}function mx(e,t){const n=[...e],r=n.length,o=e.map((i,s)=>qf(i)(i,t[s]));return i=>{for(let s=0;s<r;s++)n[s]=o[s](i);return n}}function NT(e,t){const n={...e,...t},r={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(r[o]=qf(e[o])(e[o],t[o]));return o=>{for(const i in r)n[i]=r[i](o);return n}}function MT(e,t){const n=[],r={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const i=t.types[o],s=e.indexes[i][r[i]],a=e.values[s]??0;n[o]=a,r[i]++}return n}const PT=(e,t)=>{const n=Vr.createTransformer(t),r=Ds(e),o=Ds(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?cd.has(e)&&!o.values.length||cd.has(t)&&!r.values.length?kT(e,t):Xs(mx(MT(r,o),o.values),n):(Bi(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),gl(e,t))};function yx(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Je(e,t,n):qf(e)(e,t)}const LT=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>Ue.update(t,n),stop:()=>jr(t),now:()=>mt.isProcessing?mt.timestamp:jt.now()}},vx=(e,t,n=10)=>{let r="";const o=Math.max(Math.round(t/n),2);for(let i=0;i<o;i++)r+=Math.round(e(i/(o-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},pl=2e4;function Yf(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<pl;)t+=n,r=e.next(t);return t>=pl?1/0:t}function FT(e,t=100,n){const r=n({...e,keyframes:[0,t]}),o=Math.min(Yf(r),pl);return{type:"keyframes",ease:i=>r.next(o*i).value/t,duration:ln(o)}}const $T=5;function xx(e,t,n){const r=Math.max(t-$T,0);return Z0(n-e(r),t-r)}const Xe={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},zc=.001;function OT({duration:e=Xe.duration,bounce:t=Xe.bounce,velocity:n=Xe.velocity,mass:r=Xe.mass}){let o,i;Bi(e<=Tn(Xe.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let s=1-t;s=yr(Xe.minDamping,Xe.maxDamping,s),e=yr(Xe.minDuration,Xe.maxDuration,ln(e)),s<1?(o=c=>{const u=c*s,f=u*e,d=u-n,h=ud(c,s),g=Math.exp(-f);return zc-d/h*g},i=c=>{const f=c*s*e,d=f*n+n,h=Math.pow(s,2)*Math.pow(c,2)*e,g=Math.exp(-f),p=ud(Math.pow(c,2),s);return(-o(c)+zc>0?-1:1)*((d-h)*g)/p}):(o=c=>{const u=Math.exp(-c*e),f=(c-n)*e+1;return-zc+u*f},i=c=>{const u=Math.exp(-c*e),f=(n-c)*(e*e);return u*f});const a=5/e,l=DT(o,i,a);if(e=Tn(e),isNaN(l))return{stiffness:Xe.stiffness,damping:Xe.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:s*2*Math.sqrt(r*c),duration:e}}}const IT=12;function DT(e,t,n){let r=n;for(let o=1;o<IT;o++)r=r-e(r)/t(r);return r}function ud(e,t){return e*Math.sqrt(1-t*t)}const jT=["duration","bounce"],VT=["stiffness","damping","mass"];function Jg(e,t){return t.some(n=>e[n]!==void 0)}function BT(e){let t={velocity:Xe.velocity,stiffness:Xe.stiffness,damping:Xe.damping,mass:Xe.mass,isResolvedFromDuration:!1,...e};if(!Jg(e,VT)&&Jg(e,jT))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),o=r*r,i=2*yr(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:Xe.mass,stiffness:o,damping:i}}else{const n=OT(e);t={...t,...n,mass:Xe.mass},t.isResolvedFromDuration=!0}return t}function ml(e=Xe.visualDuration,t=Xe.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:o}=n;const i=n.keyframes[0],s=n.keyframes[n.keyframes.length-1],a={done:!1,value:i},{stiffness:l,damping:c,mass:u,duration:f,velocity:d,isResolvedFromDuration:h}=BT({...n,velocity:-ln(n.velocity||0)}),g=d||0,p=c/(2*Math.sqrt(l*u)),m=s-i,v=ln(Math.sqrt(l/u)),y=Math.abs(m)<5;r||(r=y?Xe.restSpeed.granular:Xe.restSpeed.default),o||(o=y?Xe.restDelta.granular:Xe.restDelta.default);let x;if(p<1){const w=ud(v,p);x=_=>{const E=Math.exp(-p*v*_);return s-E*((g+p*v*m)/w*Math.sin(w*_)+m*Math.cos(w*_))}}else if(p===1)x=w=>s-Math.exp(-v*w)*(m+(g+v*m)*w);else{const w=v*Math.sqrt(p*p-1);x=_=>{const E=Math.exp(-p*v*_),R=Math.min(w*_,300);return s-E*((g+p*v*m)*Math.sinh(R)+w*m*Math.cosh(R))/w}}const b={calculatedDuration:h&&f||null,next:w=>{const _=x(w);if(h)a.done=w>=f;else{let E=w===0?g:0;p<1&&(E=w===0?Tn(g):xx(x,w,_));const R=Math.abs(E)<=r,k=Math.abs(s-_)<=o;a.done=R&&k}return a.value=a.done?s:_,a},toString:()=>{const w=Math.min(Yf(b),pl),_=vx(E=>b.next(w*E).value,w,30);return w+"ms "+_},toTransition:()=>{}};return b}ml.applyToOptions=e=>{const t=FT(e,100,ml);return e.ease=t.ease,e.duration=Tn(t.duration),e.type="keyframes",e};function dd({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:i=500,modifyTarget:s,min:a,max:l,restDelta:c=.5,restSpeed:u}){const f=e[0],d={done:!1,value:f},h=R=>a!==void 0&&R<a||l!==void 0&&R>l,g=R=>a===void 0?l:l===void 0||Math.abs(a-R)<Math.abs(l-R)?a:l;let p=n*t;const m=f+p,v=s===void 0?m:s(m);v!==m&&(p=v-f);const y=R=>-p*Math.exp(-R/r),x=R=>v+y(R),b=R=>{const k=y(R),P=x(R);d.done=Math.abs(k)<=c,d.value=d.done?v:P};let w,_;const E=R=>{h(d.value)&&(w=R,_=ml({keyframes:[d.value,g(d.value)],velocity:xx(x,R,d.value),damping:o,stiffness:i,restDelta:c,restSpeed:u}))};return E(0),{calculatedDuration:null,next:R=>{let k=!1;return!_&&w===void 0&&(k=!0,b(R),E(R)),w!==void 0&&R>=w?_.next(R-w):(!k&&b(R),d)}}}function zT(e,t,n){const r=[],o=n||xr.mix||yx,i=e.length-1;for(let s=0;s<i;s++){let a=o(e[s],e[s+1]);if(t){const l=Array.isArray(t)?t[s]||cn:t;a=Xs(l,a)}r.push(a)}return r}function HT(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const i=e.length;if(vr(i===t.length,"Both input and output ranges must be the same length","range-length"),i===1)return()=>t[0];if(i===2&&t[0]===t[1])return()=>t[1];const s=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=zT(t,r,o),l=a.length,c=u=>{if(s&&u<e[0])return t[0];let f=0;if(l>1)for(;f<e.length-2&&!(u<e[f+1]);f++);const d=Os(e[f],e[f+1],u);return a[f](d)};return n?u=>c(yr(e[0],e[i-1],u)):c}function WT(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=Os(0,t,r);e.push(Je(n,1,o))}}function KT(e){const t=[0];return WT(t,e.length-1),t}function UT(e,t){return e.map(n=>n*t)}function GT(e,t){return e.map(()=>t||sx).splice(0,e.length-1)}function mi({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=iT(r)?r.map(Gg):Gg(r),i={done:!1,value:t[0]},s=UT(n&&n.length===t.length?n:KT(t),e),a=HT(s,t,{ease:Array.isArray(o)?o:GT(t,o)});return{calculatedDuration:e,next:l=>(i.value=a(l),i.done=l>=e,i)}}const qT=e=>e!==null;function Xf(e,{repeat:t,repeatType:n="loop"},r,o=1){const i=e.filter(qT),a=o<0||t&&n!=="loop"&&t%2===1?0:i.length-1;return!a||r===void 0?i[a]:r}const YT={decay:dd,inertia:dd,tween:mi,keyframes:mi,spring:ml};function bx(e){typeof e.type=="string"&&(e.type=YT[e.type])}class Zf{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const XT=e=>e/100;class Jf extends Zf{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==jt.now()&&this.tick(jt.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;bx(t);const{type:n=mi,repeat:r=0,repeatDelay:o=0,repeatType:i,velocity:s=0}=t;let{keyframes:a}=t;const l=n||mi;process.env.NODE_ENV!=="production"&&l!==mi&&vr(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),l!==mi&&typeof a[0]!="number"&&(this.mixKeyframes=Xs(XT,yx(a[0],a[1])),a=[0,100]);const c=l({...t,keyframes:a});i==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...a].reverse(),velocity:-s})),c.calculatedDuration===null&&(c.calculatedDuration=Yf(c));const{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+o,this.totalDuration=this.resolvedDuration*(r+1)-o,this.generator=c}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:o,mixKeyframes:i,mirroredGenerator:s,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return r.next(0);const{delay:c=0,keyframes:u,repeat:f,repeatType:d,repeatDelay:h,type:g,onUpdate:p,finalKeyframe:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-o/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const v=this.currentTime-c*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?v<0:v>o;this.currentTime=Math.max(v,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let x=this.currentTime,b=r;if(f){const R=Math.min(this.currentTime,o)/a;let k=Math.floor(R),P=R%1;!P&&R>=1&&(P=1),P===1&&k--,k=Math.min(k,f+1),k%2&&(d==="reverse"?(P=1-P,h&&(P-=h/a)):d==="mirror"&&(b=s)),x=yr(0,1,P)*a}const w=y?{done:!1,value:u[0]}:b.next(x);i&&(w.value=i(w.value));let{done:_}=w;!y&&l!==null&&(_=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);const E=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&_);return E&&g!==dd&&(w.value=Xf(u,this.options,m,this.speed)),p&&p(w.value),E&&this.finish(),w}then(t,n){return this.finished.then(t,n)}get duration(){return ln(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+ln(t)}get time(){return ln(this.currentTime)}set time(t){t=Tn(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(jt.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=ln(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=LT,startTime:n}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),this.options.onPlay?.();const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(jt.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function ZT(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const bo=e=>e*180/Math.PI,fd=e=>{const t=bo(Math.atan2(e[1],e[0]));return hd(t)},JT={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:fd,rotateZ:fd,skewX:e=>bo(Math.atan(e[1])),skewY:e=>bo(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},hd=e=>(e=e%360,e<0&&(e+=360),e),Qg=fd,ep=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),tp=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),QT={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ep,scaleY:tp,scale:e=>(ep(e)+tp(e))/2,rotateX:e=>hd(bo(Math.atan2(e[6],e[5]))),rotateY:e=>hd(bo(Math.atan2(-e[2],e[0]))),rotateZ:Qg,rotate:Qg,skewX:e=>bo(Math.atan(e[4])),skewY:e=>bo(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function gd(e){return e.includes("scale")?1:0}function pd(e,t){if(!e||e==="none")return gd(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,o;if(n)r=QT,o=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=JT,o=a}if(!o)return gd(t);const i=r[t],s=o[1].split(",").map(tE);return typeof i=="function"?i(s):s[i]}const eE=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return pd(n,t)};function tE(e){return parseFloat(e.trim())}const Hi=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Wi=new Set(Hi),np=e=>e===zi||e===he,nE=new Set(["x","y","z"]),rE=Hi.filter(e=>!nE.has(e));function oE(e){const t=[];return rE.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const So={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>pd(t,"x"),y:(e,{transform:t})=>pd(t,"y")};So.translateX=So.x;So.translateY=So.y;const _o=new Set;let md=!1,yd=!1,vd=!1;function wx(){if(yd){const e=Array.from(_o).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const o=oE(r);o.length&&(n.set(r,o),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const o=n.get(r);o&&o.forEach(([i,s])=>{r.getValue(i)?.set(s)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}yd=!1,md=!1,_o.forEach(e=>e.complete(vd)),_o.clear()}function Cx(){_o.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(yd=!0)})}function iE(){vd=!0,Cx(),wx(),vd=!1}class Qf{constructor(t,n,r,o,i,s=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=o,this.element=i,this.isAsync=s}scheduleResolve(){this.state="scheduled",this.isAsync?(_o.add(this),md||(md=!0,Ue.read(Cx),Ue.resolveKeyframes(wx))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:o}=this;if(t[0]===null){const i=o?.get(),s=t[t.length-1];if(i!==void 0)t[0]=i;else if(r&&n){const a=r.readValue(n,s);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=s),o&&i===void 0&&o.set(t[0])}ZT(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),_o.delete(this)}cancel(){this.state==="scheduled"&&(_o.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const sE=e=>e.startsWith("--");function aE(e,t,n){sE(t)?e.style.setProperty(t,n):e.style[t]=n}const lE=Vf(()=>window.ScrollTimeline!==void 0),cE={};function uE(e,t){const n=Vf(e);return()=>cE[t]??n()}const Sx=uE(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),xs=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,rp={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:xs([0,.65,.55,1]),circOut:xs([.55,0,1,.45]),backIn:xs([.31,.01,.66,-.59]),backOut:xs([.33,1.53,.69,.99])};function _x(e,t){if(e)return typeof e=="function"?Sx()?vx(e,t):"ease-out":ax(e)?xs(e):Array.isArray(e)?e.map(n=>_x(n,t)||rp.easeOut):rp[e]}function dE(e,t,n,{delay:r=0,duration:o=300,repeat:i=0,repeatType:s="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[t]:n};l&&(u.offset=l);const f=_x(a,o);Array.isArray(f)&&(u.easing=f);const d={delay:r,duration:o,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:i+1,direction:s==="reverse"?"alternate":"normal"};return c&&(d.pseudoElement=c),e.animate(u,d)}function Tx(e){return typeof e=="function"&&"applyToOptions"in e}function fE({type:e,...t}){return Tx(e)&&Sx()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class hE extends Zf{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:r,keyframes:o,pseudoElement:i,allowFlatten:s=!1,finalKeyframe:a,onComplete:l}=t;this.isPseudoElement=!!i,this.allowFlatten=s,this.options=t,vr(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const c=fE(t);this.animation=dE(n,r,o,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const u=Xf(o,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(u):aE(n,r,u),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return ln(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+ln(t)}get time(){return ln(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=Tn(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&lE()?(this.animation.timeline=t,cn):n(this)}}const Ex={anticipate:rx,backInOut:nx,circInOut:ix};function gE(e){return e in Ex}function pE(e){typeof e.ease=="string"&&gE(e.ease)&&(e.ease=Ex[e.ease])}const op=10;class mE extends hE{constructor(t){pE(t),bx(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:o,element:i,...s}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new Jf({...s,autoplay:!1}),l=Tn(this.finishedTime??this.time);n.setWithVelocity(a.sample(l-op).value,a.sample(l).value,op),a.stop()}}const ip=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Vr.test(e)||e==="0")&&!e.startsWith("url("));function yE(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function vE(e,t,n,r){const o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],s=ip(o,t),a=ip(i,t);return Bi(s===a,`You are trying to animate ${t} from "${o}" to "${i}". "${s?i:o}" is not an animatable value.`,"value-not-animatable"),!s||!a?!1:yE(e)||(n==="spring"||Tx(n))&&r}function xd(e){e.duration=0,e.type="keyframes"}const xE=new Set(["opacity","clipPath","filter","transform"]),bE=Vf(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function wE(e){const{motionValue:t,name:n,repeatDelay:r,repeatType:o,damping:i,type:s}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=t.owner.getProps();return bE()&&n&&xE.has(n)&&(n!=="transform"||!c)&&!l&&!r&&o!=="mirror"&&i!==0&&s!=="inertia"}const CE=40;class SE extends Zf{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:o=0,repeatDelay:i=0,repeatType:s="loop",keyframes:a,name:l,motionValue:c,element:u,...f}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=jt.now();const d={autoplay:t,delay:n,type:r,repeat:o,repeatDelay:i,repeatType:s,name:l,motionValue:c,element:u,...f},h=u?.KeyframeResolver||Qf;this.keyframeResolver=new h(a,(g,p,m)=>this.onKeyframesResolved(g,p,d,!m),l,c,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,r,o){this.keyframeResolver=void 0;const{name:i,type:s,velocity:a,delay:l,isHandoff:c,onUpdate:u}=r;this.resolvedAt=jt.now(),vE(t,i,s,a)||((xr.instantAnimations||!l)&&u?.(Xf(t,r,n)),t[0]=t[t.length-1],xd(r),r.repeat=0);const d={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>CE?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},h=!c&&wE(d)?new mE({...d,element:d.motionValue.owner.current}):new Jf(d);h.finished.then(()=>this.notifyFinished()).catch(cn),this.pendingTimeline&&(this.stopTimeline=h.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=h}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),iE()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const _E=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function TE(e){const t=_E.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${n??r}`,o]}const EE=4;function Rx(e,t,n=1){vr(n<=EE,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,o]=TE(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const s=i.trim();return q0(s)?parseFloat(s):s}return Kf(o)?Rx(o,t,n+1):o}function eh(e,t){return e?.[t]??e?.default??e}const kx=new Set(["width","height","top","left","right","bottom",...Hi]),RE={test:e=>e==="auto",parse:e=>e},Ax=e=>t=>t.test(e),Nx=[zi,he,Hn,Rr,yT,mT,RE],sp=e=>Nx.find(Ax(e));function kE(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||X0(e):!0}const AE=new Set(["brightness","contrast","saturate","opacity"]);function NE(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Uf)||[];if(!r)return e;const o=n.replace(r,"");let i=AE.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+o+")"}const ME=/\b([a-z-]*)\(.*?\)/gu,bd={...Vr,getAnimatableNone:e=>{const t=e.match(ME);return t?t.map(NE).join(" "):e}},ap={...zi,transform:Math.round},PE={rotate:Rr,rotateX:Rr,rotateY:Rr,rotateZ:Rr,scale:Sa,scaleX:Sa,scaleY:Sa,scaleZ:Sa,skew:Rr,skewX:Rr,skewY:Rr,distance:he,translateX:he,translateY:he,translateZ:he,x:he,y:he,z:he,perspective:he,transformPerspective:he,opacity:Is,originX:qg,originY:qg,originZ:he},th={borderWidth:he,borderTopWidth:he,borderRightWidth:he,borderBottomWidth:he,borderLeftWidth:he,borderRadius:he,radius:he,borderTopLeftRadius:he,borderTopRightRadius:he,borderBottomRightRadius:he,borderBottomLeftRadius:he,width:he,maxWidth:he,height:he,maxHeight:he,top:he,right:he,bottom:he,left:he,padding:he,paddingTop:he,paddingRight:he,paddingBottom:he,paddingLeft:he,margin:he,marginTop:he,marginRight:he,marginBottom:he,marginLeft:he,backgroundPositionX:he,backgroundPositionY:he,...PE,zIndex:ap,fillOpacity:Is,strokeOpacity:Is,numOctaves:ap},LE={...th,color:it,backgroundColor:it,outlineColor:it,fill:it,stroke:it,borderColor:it,borderTopColor:it,borderRightColor:it,borderBottomColor:it,borderLeftColor:it,filter:bd,WebkitFilter:bd},Mx=e=>LE[e];function Px(e,t){let n=Mx(e);return n!==bd&&(n=Vr),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const FE=new Set(["auto","none","0"]);function $E(e,t,n){let r=0,o;for(;r<e.length&&!o;){const i=e[r];typeof i=="string"&&!FE.has(i)&&Ds(i).values.length&&(o=e[r]),r++}if(o&&n)for(const i of t)e[i]=Px(n,o)}class OE extends Qf{constructor(t,n,r,o,i){super(t,n,r,o,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let c=t[l];if(typeof c=="string"&&(c=c.trim(),Kf(c))){const u=Rx(c,n.current);u!==void 0&&(t[l]=u),l===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!kx.has(r)||t.length!==2)return;const[o,i]=t,s=sp(o),a=sp(i);if(s!==a)if(np(s)&&np(a))for(let l=0;l<t.length;l++){const c=t[l];typeof c=="string"&&(t[l]=parseFloat(c))}else So[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let o=0;o<t.length;o++)(t[o]===null||kE(t[o]))&&r.push(o);r.length&&$E(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=So[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const o=n[n.length-1];o!==void 0&&t.getValue(r,o).jump(o,!1)}measureEndState(){const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const o=t.getValue(n);o&&o.jump(this.measuredOrigin,!1);const i=r.length-1,s=r[i];r[i]=So[n](t.measureViewportBox(),window.getComputedStyle(t.current)),s!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=s),this.removedTransforms?.length&&this.removedTransforms.forEach(([a,l])=>{t.getValue(a).set(l)}),this.resolveNoneKeyframes()}}function IE(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const o=n?.[e]??r.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e)}const Lx=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Fx(e){return Y0(e)&&"offsetHeight"in e}const lp=30,DE=e=>!isNaN(parseFloat(e));class jE{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{const o=jt.now();if(this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const i of this.dependents)i.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=jt.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=DE(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&zf(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Bf);const r=this.events[t].add(n);return t==="change"?()=>{r(),Ue.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=jt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>lp)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,lp);return Z0(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Pi(e,t){return new jE(e,t)}const{schedule:nh}=lx(queueMicrotask,!1),bn={x:!1,y:!1};function $x(){return bn.x||bn.y}function VE(e){return e==="x"||e==="y"?bn[e]?null:(bn[e]=!0,()=>{bn[e]=!1}):bn.x||bn.y?null:(bn.x=bn.y=!0,()=>{bn.x=bn.y=!1})}function Ox(e,t){const n=IE(e),r=new AbortController,o={passive:!0,...t,signal:r.signal};return[n,o,()=>r.abort()]}function cp(e){return!(e.pointerType==="touch"||$x())}function BE(e,t,n={}){const[r,o,i]=Ox(e,n),s=a=>{if(!cp(a))return;const{target:l}=a,c=t(l,a);if(typeof c!="function"||!l)return;const u=f=>{cp(f)&&(c(f),l.removeEventListener("pointerleave",u))};l.addEventListener("pointerleave",u,o)};return r.forEach(a=>{a.addEventListener("pointerenter",s,o)}),i}const Ix=(e,t)=>t?e===t?!0:Ix(e,t.parentElement):!1,rh=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,zE=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function HE(e){return zE.has(e.tagName)||e.tabIndex!==-1}const el=new WeakSet;function up(e){return t=>{t.key==="Enter"&&e(t)}}function Hc(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const WE=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=up(()=>{if(el.has(n))return;Hc(n,"down");const o=up(()=>{Hc(n,"up")}),i=()=>Hc(n,"cancel");n.addEventListener("keyup",o,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function dp(e){return rh(e)&&!$x()}function KE(e,t,n={}){const[r,o,i]=Ox(e,n),s=a=>{const l=a.currentTarget;if(!dp(a))return;el.add(l);const c=t(l,a),u=(h,g)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",d),el.has(l)&&el.delete(l),dp(h)&&typeof c=="function"&&c(h,{success:g})},f=h=>{u(h,l===window||l===document||n.useGlobalTarget||Ix(l,h.target))},d=h=>{u(h,!1)};window.addEventListener("pointerup",f,o),window.addEventListener("pointercancel",d,o)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",s,o),Fx(a)&&(a.addEventListener("focus",c=>WE(c,o)),!HE(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),i}function Dx(e){return Y0(e)&&"ownerSVGElement"in e}function UE(e){return Dx(e)&&e.tagName==="svg"}const St=e=>!!(e&&e.getVelocity),GE=[...Nx,it,Vr],qE=e=>GE.find(Ax(e)),oh=S.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function fp(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function YE(...e){return t=>{let n=!1;const r=e.map(o=>{const i=fp(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():fp(e[o],null)}}}}function XE(...e){return N.useCallback(YE(...e),e)}class ZE extends N.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,o=Fx(r)&&r.offsetWidth||0,i=this.props.sizeRef.current;i.height=n.offsetHeight||0,i.width=n.offsetWidth||0,i.top=n.offsetTop,i.left=n.offsetLeft,i.right=o-i.width-i.left}return null}componentDidUpdate(){}render(){return this.props.children}}function JE({children:e,isPresent:t,anchorX:n,root:r}){const o=S.useId(),i=S.useRef(null),s=S.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:a}=S.useContext(oh),l=XE(i,e?.ref);return S.useInsertionEffect(()=>{const{width:c,height:u,top:f,left:d,right:h}=s.current;if(t||!i.current||!c||!u)return;const g=n==="left"?`left: ${d}`:`right: ${h}`;i.current.dataset.motionPopId=o;const p=document.createElement("style");a&&(p.nonce=a);const m=r??document.head;return m.appendChild(p),p.sheet&&p.sheet.insertRule(`
27
27
  [data-motion-pop-id="${o}"] {
28
28
  position: absolute !important;
29
29
  width: ${c}px !important;
@@ -31,45 +31,45 @@
31
31
  ${g}px !important;
32
32
  top: ${f}px !important;
33
33
  }
34
- `),()=>{m.contains(p)&&m.removeChild(p)}},[t]),C.jsx(XE,{isPresent:t,childRef:i,sizeRef:s,children:N.cloneElement(e,{ref:l})})}const JE=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:i,mode:s,anchorX:a,root:l})=>{const c=$f(QE),u=S.useId();let f=!0,d=S.useMemo(()=>(f=!1,{id:u,initial:t,isPresent:n,custom:o,onExitComplete:h=>{c.set(h,!0);for(const g of c.values())if(!g)return;r&&r()},register:h=>(c.set(h,!1),()=>c.delete(h))}),[n,c,r]);return i&&f&&(d={...d}),S.useMemo(()=>{c.forEach((h,g)=>c.set(g,!1))},[n]),N.useEffect(()=>{!n&&!c.size&&r&&r()},[n]),s==="popLayout"&&(e=C.jsx(ZE,{isPresent:n,anchorX:a,root:l,children:e})),C.jsx(Gl.Provider,{value:d,children:e})};function QE(){return new Map}function Ix(e=!0){const t=S.useContext(Gl);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=t,i=S.useId();S.useEffect(()=>{if(e)return o(i)},[e]);const s=S.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,s]:[!0]}const _a=e=>e.key||"";function fp(e){const t=[];return S.Children.forEach(e,n=>{S.isValidElement(n)&&t.push(n)}),t}const Dx=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:i="sync",propagate:s=!1,anchorX:a="left",root:l})=>{const[c,u]=Ix(s),f=S.useMemo(()=>fp(e),[e]),d=s&&!c?[]:f.map(_a),h=S.useRef(!0),g=S.useRef(f),p=$f(()=>new Map),[m,v]=S.useState(f),[y,x]=S.useState(f);K0(()=>{h.current=!1,g.current=f;for(let _=0;_<y.length;_++){const E=_a(y[_]);d.includes(E)?p.delete(E):p.get(E)!==!0&&p.set(E,!1)}},[y,d.length,d.join("-")]);const b=[];if(f!==m){let _=[...f];for(let E=0;E<y.length;E++){const R=y[E],k=_a(R);d.includes(k)||(_.splice(E,0,R),b.push(R))}return i==="wait"&&b.length&&(_=b),x(fp(_)),v(f),null}process.env.NODE_ENV!=="production"&&i==="wait"&&y.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:w}=S.useContext(Ff);return C.jsx(C.Fragment,{children:y.map(_=>{const E=_a(_),R=s&&!c?!1:f===y||d.includes(E),k=()=>{if(p.has(E))p.set(E,!0);else return;let M=!0;p.forEach(F=>{F||(M=!1)}),M&&(w?.(),x(g.current),s&&u?.(),r&&r())};return C.jsx(JE,{isPresent:R,initial:!h.current||n?void 0:!1,custom:t,presenceAffectsLayout:o,mode:i,root:l,onExitComplete:R?void 0:k,anchorX:a,children:_},E)})})},jx=S.createContext({strict:!1}),hp={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Li={};for(const e in hp)Li[e]={isEnabled:t=>hp[e].some(n=>!!t[n])};function e2(e){for(const t in e)Li[t]={...Li[t],...e[t]}}const t2=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function yl(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||t2.has(e)}let Vx=e=>!yl(e);function n2(e){typeof e=="function"&&(Vx=t=>t.startsWith("on")?!yl(t):e(t))}try{n2(require("@emotion/is-prop-valid").default)}catch{}function r2(e,t,n){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||(Vx(o)||n===!0&&yl(o)||!t&&!yl(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}const ql=S.createContext({});function Yl(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function js(e){return typeof e=="string"||Array.isArray(e)}const oh=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ih=["initial",...oh];function Xl(e){return Yl(e.animate)||ih.some(t=>js(e[t]))}function Bx(e){return!!(Xl(e)||e.variants)}function o2(e,t){if(Xl(e)){const{initial:n,animate:r}=e;return{initial:n===!1||js(n)?n:void 0,animate:js(r)?r:void 0}}return e.inherit!==!1?t:{}}function i2(e){const{initial:t,animate:n}=o2(e,S.useContext(ql));return S.useMemo(()=>({initial:t,animate:n}),[gp(t),gp(n)])}function gp(e){return Array.isArray(e)?e.join(" "):e}function pp(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const ss={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(he.test(e))e=parseFloat(e);else return e;const n=pp(e,t.target.x),r=pp(e,t.target.y);return`${n}% ${r}%`}},s2={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=Vr.parse(e);if(o.length>5)return r;const i=Vr.createTransformer(e),s=typeof o[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;o[0+s]/=a,o[1+s]/=l;const c=Je(a,l,.5);return typeof o[2+s]=="number"&&(o[2+s]/=c),typeof o[3+s]=="number"&&(o[3+s]/=c),i(o)}},bd={borderRadius:{...ss,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:ss,borderTopRightRadius:ss,borderBottomLeftRadius:ss,borderBottomRightRadius:ss,boxShadow:s2};function zx(e,{layout:t,layoutId:n}){return Wi.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!bd[e]||e==="opacity")}const a2={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},l2=Hi.length;function c2(e,t,n){let r="",o=!0;for(let i=0;i<l2;i++){const s=Hi[i],a=e[s];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(s.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=Mx(a,eh[s]);if(!l){o=!1;const u=a2[s]||s;r+=`${u}(${c}) `}n&&(t[s]=c)}}return r=r.trim(),n?r=n(t,o?"":r):o&&(r="none"),r}function sh(e,t,n){const{style:r,vars:o,transformOrigin:i}=e;let s=!1,a=!1;for(const l in t){const c=t[l];if(Wi.has(l)){s=!0;continue}else if(lx(l)){o[l]=c;continue}else{const u=Mx(c,eh[l]);l.startsWith("origin")?(a=!0,i[l]=u):r[l]=u}}if(t.transform||(s||n?r.transform=c2(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=i;r.transformOrigin=`${l} ${c} ${u}`}}const ah=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Hx(e,t,n){for(const r in t)!St(t[r])&&!zx(r,n)&&(e[r]=t[r])}function u2({transformTemplate:e},t){return S.useMemo(()=>{const n=ah();return sh(n,t,e),Object.assign({},n.vars,n.style)},[t])}function d2(e,t){const n=e.style||{},r={};return Hx(r,n,e),Object.assign(r,u2(e,t)),r}function f2(e,t){const n={},r=d2(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const h2={offset:"stroke-dashoffset",array:"stroke-dasharray"},g2={offset:"strokeDashoffset",array:"strokeDasharray"};function p2(e,t,n=1,r=0,o=!0){e.pathLength=1;const i=o?h2:g2;e[i.offset]=he.transform(-r);const s=he.transform(t),a=he.transform(n);e[i.array]=`${s} ${a}`}function Wx(e,{attrX:t,attrY:n,attrScale:r,pathLength:o,pathSpacing:i=1,pathOffset:s=0,...a},l,c,u){if(sh(e,a,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:d}=e;f.transform&&(d.transform=f.transform,delete f.transform),(d.transform||f.transformOrigin)&&(d.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete f.transformBox),t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),o!==void 0&&p2(f,o,i,s,!1)}const Kx=()=>({...ah(),attrs:{}}),Ux=e=>typeof e=="string"&&e.toLowerCase()==="svg";function m2(e,t,n,r){const o=S.useMemo(()=>{const i=Kx();return Wx(i,t,Ux(r),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};Hx(i,e.style,e),o.style={...i,...o.style}}return o}const y2=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function lh(e){return typeof e!="string"||e.includes("-")?!1:!!(y2.indexOf(e)>-1||/[A-Z]/u.test(e))}function v2(e,t,n,{latestValues:r},o,i=!1){const a=(lh(e)?m2:f2)(t,r,o,e),l=r2(t,typeof e=="string",i),c=e!==S.Fragment?{...l,...a,ref:n}:{},{children:u}=t,f=S.useMemo(()=>St(u)?u.get():u,[u]);return S.createElement(e,{...c,children:f})}function mp(e){const t=[{},{}];return e?.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function ch(e,t,n,r){if(typeof t=="function"){const[o,i]=mp(r);t=t(n!==void 0?n:e.custom,o,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[o,i]=mp(r);t=t(n!==void 0?n:e.custom,o,i)}return t}function tl(e){return St(e)?e.get():e}function x2({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,o){return{latestValues:b2(n,r,o,e),renderState:t()}}function b2(e,t,n,r){const o={},i=r(e,{});for(const d in i)o[d]=tl(i[d]);let{initial:s,animate:a}=e;const l=Xl(e),c=Bx(e);t&&c&&!l&&e.inherit!==!1&&(s===void 0&&(s=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||s===!1;const f=u?a:s;if(f&&typeof f!="boolean"&&!Yl(f)){const d=Array.isArray(f)?f:[f];for(let h=0;h<d.length;h++){const g=ch(e,d[h]);if(g){const{transitionEnd:p,transition:m,...v}=g;for(const y in v){let x=v[y];if(Array.isArray(x)){const b=u?x.length-1:0;x=x[b]}x!==null&&(o[y]=x)}for(const y in p)o[y]=p[y]}}}return o}const Gx=e=>(t,n)=>{const r=S.useContext(ql),o=S.useContext(Gl),i=()=>x2(e,t,r,o);return n?i():$f(i)};function uh(e,t,n){const{style:r}=e,o={};for(const i in r)(St(r[i])||t.style&&St(t.style[i])||zx(i,e)||n?.getValue(i)?.liveStyle!==void 0)&&(o[i]=r[i]);return o}const w2=Gx({scrapeMotionValuesFromProps:uh,createRenderState:ah});function qx(e,t,n){const r=uh(e,t,n);for(const o in e)if(St(e[o])||St(t[o])){const i=Hi.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[i]=e[o]}return r}const C2=Gx({scrapeMotionValuesFromProps:qx,createRenderState:Kx}),S2=Symbol.for("motionComponentSymbol");function yi(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function _2(e,t,n){return S.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):yi(n)&&(n.current=r))},[t])}const dh=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),T2="framerAppearId",Yx="data-"+dh(T2),Xx=S.createContext({});function E2(e,t,n,r,o){const{visualElement:i}=S.useContext(ql),s=S.useContext(jx),a=S.useContext(Gl),l=S.useContext(rh).reducedMotion,c=S.useRef(null);r=r||s.renderer,!c.current&&r&&(c.current=r(e,{visualState:t,parent:i,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const u=c.current,f=S.useContext(Xx);u&&!u.projection&&o&&(u.type==="html"||u.type==="svg")&&R2(c.current,n,o,f);const d=S.useRef(!1);S.useInsertionEffect(()=>{u&&d.current&&u.update(n,a)});const h=n[Yx],g=S.useRef(!!h&&!window.MotionHandoffIsComplete?.(h)&&window.MotionHasOptimisedAnimation?.(h));return K0(()=>{u&&(d.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),g.current&&u.animationState&&u.animationState.animateChanges())}),S.useEffect(()=>{u&&(!g.current&&u.animationState&&u.animationState.animateChanges(),g.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(h)}),g.current=!1),u.enteringChildren=void 0)}),u}function R2(e,t,n,r){const{layoutId:o,layout:i,drag:s,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Zx(e.parent)),e.projection.setOptions({layoutId:o,layout:i,alwaysMeasureLayout:!!s||a&&yi(a),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:u,layoutScroll:l,layoutRoot:c})}function Zx(e){if(e)return e.options.allowProjection!==!1?e.projection:Zx(e.parent)}function Hc(e,{forwardMotionProps:t=!1}={},n,r){n&&e2(n);const o=lh(e)?C2:w2;function i(a,l){let c;const u={...S.useContext(rh),...a,layoutId:k2(a)},{isStatic:f}=u,d=i2(a),h=o(a,f);if(!f&&Of){A2(u,n);const g=N2(u);c=g.MeasureLayout,d.visualElement=E2(e,h,u,r,g.ProjectionNode)}return C.jsxs(ql.Provider,{value:d,children:[c&&d.visualElement?C.jsx(c,{visualElement:d.visualElement,...u}):null,v2(e,a,_2(h,d.visualElement,l),h,f,t)]})}i.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const s=S.forwardRef(i);return s[S2]=e,s}function k2({layoutId:e}){const t=S.useContext(Ff).id;return t&&e!==void 0?t+"-"+e:e}function A2(e,t){const n=S.useContext(jx).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?Bi(!1,r,"lazy-strict-mode"):vr(!1,r,"lazy-strict-mode")}}function N2(e){const{drag:t,layout:n}=Li;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function M2(e,t){if(typeof Proxy>"u")return Hc;const n=new Map,r=(i,s)=>Hc(i,s,e,t),o=(i,s)=>(process.env.NODE_ENV!=="production"&&Bf(!1,"motion() is deprecated. Use motion.create() instead."),r(i,s));return new Proxy(o,{get:(i,s)=>s==="create"?r:(n.has(s)||n.set(s,Hc(s,void 0,e,t)),n.get(s))})}function Jx({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function P2({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function L2(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Wc(e){return e===void 0||e===1}function wd({scale:e,scaleX:t,scaleY:n}){return!Wc(e)||!Wc(t)||!Wc(n)}function uo(e){return wd(e)||Qx(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Qx(e){return yp(e.x)||yp(e.y)}function yp(e){return e&&e!=="0%"}function vl(e,t,n){const r=e-n,o=t*r;return n+o}function vp(e,t,n,r,o){return o!==void 0&&(e=vl(e,o,r)),vl(e,n,r)+t}function Cd(e,t=0,n=1,r,o){e.min=vp(e.min,t,n,r,o),e.max=vp(e.max,t,n,r,o)}function eb(e,{x:t,y:n}){Cd(e.x,t.translate,t.scale,t.originPoint),Cd(e.y,n.translate,n.scale,n.originPoint)}const xp=.999999999999,bp=1.0000000000001;function F2(e,t,n,r=!1){const o=n.length;if(!o)return;t.x=t.y=1;let i,s;for(let a=0;a<o;a++){i=n[a],s=i.projectionDelta;const{visualElement:l}=i.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&xi(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,eb(e,s)),r&&uo(i.latestValues)&&xi(e,i.latestValues))}t.x<bp&&t.x>xp&&(t.x=1),t.y<bp&&t.y>xp&&(t.y=1)}function vi(e,t){e.min=e.min+t,e.max=e.max+t}function wp(e,t,n,r,o=.5){const i=Je(e.min,e.max,o);Cd(e,t,n,i,r)}function xi(e,t){wp(e.x,t.x,t.scaleX,t.scale,t.originX),wp(e.y,t.y,t.scaleY,t.scale,t.originY)}function tb(e,t){return Jx(L2(e.getBoundingClientRect(),t))}function $2(e,t,n){const r=tb(e,n),{scroll:o}=t;return o&&(vi(r.x,o.offset.x),vi(r.y,o.offset.y)),r}const Cp=()=>({translate:0,scale:1,origin:0,originPoint:0}),bi=()=>({x:Cp(),y:Cp()}),Sp=()=>({min:0,max:0}),ct=()=>({x:Sp(),y:Sp()}),Sd={current:null},nb={current:!1};function O2(){if(nb.current=!0,!!Of)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Sd.current=e.matches;e.addEventListener("change",t),t()}else Sd.current=!1}const I2=new WeakMap;function D2(e,t,n){for(const r in t){const o=t[r],i=n[r];if(St(o))e.addValue(r,o);else if(St(i))e.addValue(r,Pi(o,{owner:e}));else if(i!==o)if(e.hasValue(r)){const s=e.getValue(r);s.liveStyle===!0?s.jump(o):s.hasAnimated||s.set(o)}else{const s=e.getStaticValue(r);e.addValue(r,Pi(s!==void 0?s:o,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const _p=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class j2{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:o,blockInitialAnimation:i,visualState:s},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Jf,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const d=jt.now();this.renderScheduledAt<d&&(this.renderScheduledAt=d,Ue.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=s;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=a,this.blockInitialAnimation=!!i,this.isControllingVariants=Xl(n),this.isVariantNode=Bx(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const d in f){const h=f[d];l[d]!==void 0&&St(h)&&h.set(l[d])}}mount(t){this.current=t,I2.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),nb.current||O2(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Sd.current,process.env.NODE_ENV!=="production"&&Bf(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),jr(this.notifyUpdate),jr(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=Wi.has(t);r&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",s=>{this.latestValues[t]=s,this.props.onUpdate&&Ue.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{o(),i&&i(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Li){const n=Li[t];if(!n)continue;const{isEnabled:r,Feature:o}=n;if(!this.features[t]&&o&&r(this.props)&&(this.features[t]=new o(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ct()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<_p.length;r++){const o=_p[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const i="on"+o,s=t[i];s&&(this.propEventSubscriptions[o]=this.on(o,s))}this.prevMotionValues=D2(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Pi(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(U0(r)||q0(r))?r=parseFloat(r):!GE(r)&&Vr.test(n)&&(r=Nx(t,n)),this.setBaseTarget(t,St(r)?r.get():r)),St(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const i=ch(this.props,n,this.presenceContext?.custom);i&&(r=i[t])}if(n&&r!==void 0)return r;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!St(o)?o:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Vf),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){th.render(this.render)}}class rb extends j2{constructor(){super(...arguments),this.KeyframeResolver=$E}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;St(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function ob(e,{style:t,vars:n},r,o){const i=e.style;let s;for(s in t)i[s]=t[s];o?.applyProjectionStyles(i,r);for(s in n)i.setProperty(s,n[s])}function V2(e){return window.getComputedStyle(e)}class B2 extends rb{constructor(){super(...arguments),this.type="html",this.renderInstance=ob}readValueFromInstance(t,n){if(Wi.has(n))return this.projection?.isProjecting?hd(n):QT(t,n);{const r=V2(t),o=(lx(n)?r.getPropertyValue(n):r[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return tb(t,n)}build(t,n,r){sh(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return uh(t,n,r)}}const ib=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function z2(e,t,n,r){ob(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(ib.has(o)?o:dh(o),t.attrs[o])}class H2 extends rb{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ct}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Wi.has(n)){const r=Ax(n);return r&&r.default||0}return n=ib.has(n)?n:dh(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return qx(t,n,r)}build(t,n,r){Wx(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,o){z2(t,n,r,o)}mount(t){this.isSVGTag=Ux(t.tagName),super.mount(t)}}const W2=(e,t)=>lh(e)?new H2(t):new B2(t,{allowProjection:e!==S.Fragment});function Ci(e,t,n){const r=e.getProps();return ch(r,t,n!==void 0?n:r.custom,e)}const _d=e=>Array.isArray(e);function K2(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Pi(n))}function U2(e){return _d(e)?e[e.length-1]||0:e}function G2(e,t){const n=Ci(e,t);let{transitionEnd:r={},transition:o={},...i}=n||{};i={...i,...r};for(const s in i){const a=U2(i[s]);K2(e,s,a)}}function q2(e){return!!(St(e)&&e.add)}function Td(e,t){const n=e.getValue("willChange");if(q2(n))return n.add(t);if(!n&&xr.WillChange){const r=new xr.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function sb(e){return e.props[Yx]}const Y2=e=>e!==null;function X2(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(Y2),i=t&&n!=="loop"&&t%2===1?0:o.length-1;return o[i]}const Z2={type:"spring",stiffness:500,damping:25,restSpeed:10},J2=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Q2={type:"keyframes",duration:.8},eR={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},tR=(e,{keyframes:t})=>t.length>2?Q2:Wi.has(e)?e.startsWith("scale")?J2(t[1]):Z2:eR;function nR({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:i,repeatType:s,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const fh=(e,t,n,r={},o,i)=>s=>{const a=Qf(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-Tn(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:d=>{t.set(d),a.onUpdate&&a.onUpdate(d)},onComplete:()=>{s(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:i?void 0:o};nR(a)||Object.assign(u,tR(e,u)),u.duration&&(u.duration=Tn(u.duration)),u.repeatDelay&&(u.repeatDelay=Tn(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let f=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(vd(u),u.delay===0&&(f=!0)),(xr.instantAnimations||xr.skipAnimations)&&(f=!0,vd(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,f&&!i&&t.get()!==void 0){const d=X2(u.keyframes,a);if(d!==void 0){Ue.update(()=>{u.onUpdate(d),u.onComplete()});return}}return a.isSync?new Zf(u):new CE(u)};function rR({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function ab(e,t,{delay:n=0,transitionOverride:r,type:o}={}){let{transition:i=e.getDefaultTransition(),transitionEnd:s,...a}=t;r&&(i=r);const l=[],c=o&&e.animationState&&e.animationState.getState()[o];for(const u in a){const f=e.getValue(u,e.latestValues[u]??null),d=a[u];if(d===void 0||c&&rR(c,u))continue;const h={delay:n,...Qf(i||{},u)},g=f.get();if(g!==void 0&&!f.isAnimating&&!Array.isArray(d)&&d===g&&!h.velocity)continue;let p=!1;if(window.MotionHandoffAnimation){const v=sb(e);if(v){const y=window.MotionHandoffAnimation(v,u,Ue);y!==null&&(h.startTime=y,p=!0)}}Td(e,u),f.start(fh(u,f,d,e.shouldReduceMotion&&Ex.has(u)?{type:!1}:h,e,p));const m=f.animation;m&&l.push(m)}return s&&Promise.all(l).then(()=>{Ue.update(()=>{s&&G2(e,s)})}),l}function lb(e,t,n,r=0,o=1){const i=Array.from(e).sort((c,u)=>c.sortNodePosition(u)).indexOf(t),s=e.size,a=(s-1)*r;return typeof n=="function"?n(i,s):o===1?i*r:a-i*r}function Ed(e,t,n={}){const r=Ci(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);const i=r?()=>Promise.all(ab(e,r,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:c=0,staggerChildren:u,staggerDirection:f}=o;return oR(e,t,l,c,u,f,n)}:()=>Promise.resolve(),{when:a}=o;if(a){const[l,c]=a==="beforeChildren"?[i,s]:[s,i];return l().then(()=>c())}else return Promise.all([i(),s(n.delay)])}function oR(e,t,n=0,r=0,o=0,i=1,s){const a=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),a.push(Ed(l,t,{...s,delay:n+(typeof r=="function"?0:r)+lb(e.variantChildren,l,r,o,i)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(a)}function iR(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(i=>Ed(e,i,n));r=Promise.all(o)}else if(typeof t=="string")r=Ed(e,t,n);else{const o=typeof t=="function"?Ci(e,t,n.custom):t;r=Promise.all(ab(e,o,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function cb(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const sR=ih.length;function ub(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?ub(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<sR;n++){const r=ih[n],o=e.props[r];(js(o)||o===!1)&&(t[r]=o)}return t}const aR=[...oh].reverse(),lR=oh.length;function cR(e){return t=>Promise.all(t.map(({animation:n,options:r})=>iR(e,n,r)))}function uR(e){let t=cR(e),n=Tp(),r=!0;const o=l=>(c,u)=>{const f=Ci(e,u,l==="exit"?e.presenceContext?.custom:void 0);if(f){const{transition:d,transitionEnd:h,...g}=f;c={...c,...g,...h}}return c};function i(l){t=l(e)}function s(l){const{props:c}=e,u=ub(e.parent)||{},f=[],d=new Set;let h={},g=1/0;for(let m=0;m<lR;m++){const v=aR[m],y=n[v],x=c[v]!==void 0?c[v]:u[v],b=js(x),w=v===l?y.isActive:null;w===!1&&(g=m);let _=x===u[v]&&x!==c[v]&&b;if(_&&r&&e.manuallyAnimateOnMount&&(_=!1),y.protectedKeys={...h},!y.isActive&&w===null||!x&&!y.prevProp||Yl(x)||typeof x=="boolean")continue;const E=dR(y.prevProp,x);let R=E||v===l&&y.isActive&&!_&&b||m>g&&b,k=!1;const M=Array.isArray(x)?x:[x];let F=M.reduce(o(v),{});w===!1&&(F={});const{prevResolvedValues:D={}}=y,j={...D,...F},I=O=>{R=!0,d.has(O)&&(k=!0,d.delete(O)),y.needsAnimating[O]=!0;const P=e.getValue(O);P&&(P.liveStyle=!1)};for(const O in j){const P=F[O],K=D[O];if(h.hasOwnProperty(O))continue;let G=!1;_d(P)&&_d(K)?G=!cb(P,K):G=P!==K,G?P!=null?I(O):d.add(O):P!==void 0&&d.has(O)?I(O):y.protectedKeys[O]=!0}y.prevProp=x,y.prevResolvedValues=F,y.isActive&&(h={...h,...F}),r&&e.blockInitialAnimation&&(R=!1);const $=_&&E;R&&(!$||k)&&f.push(...M.map(O=>{const P={type:v};if(typeof O=="string"&&r&&!$&&e.manuallyAnimateOnMount&&e.parent){const{parent:K}=e,G=Ci(K,O);if(K.enteringChildren&&G){const{delayChildren:re}=G.transition||{};P.delay=lb(K.enteringChildren,e,re)}}return{animation:O,options:P}}))}if(d.size){const m={};if(typeof c.initial!="boolean"){const v=Ci(e,Array.isArray(c.initial)?c.initial[0]:c.initial);v&&v.transition&&(m.transition=v.transition)}d.forEach(v=>{const y=e.getBaseTarget(v),x=e.getValue(v);x&&(x.liveStyle=!0),m[v]=y??null}),f.push({animation:m})}let p=!!f.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,p?t(f):Promise.resolve()}function a(l,c){if(n[l].isActive===c)return Promise.resolve();e.variantChildren?.forEach(f=>f.animationState?.setActive(l,c)),n[l].isActive=c;const u=s(l);for(const f in n)n[f].protectedKeys={};return u}return{animateChanges:s,setActive:a,setAnimateFunction:i,getState:()=>n,reset:()=>{n=Tp()}}}function dR(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!cb(t,e):!1}function so(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Tp(){return{animate:so(!0),whileInView:so(),whileHover:so(),whileTap:so(),whileDrag:so(),whileFocus:so(),exit:so()}}class Zr{constructor(t){this.isMounted=!1,this.node=t}update(){}}class fR extends Zr{constructor(t){super(t),t.animationState||(t.animationState=uR(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Yl(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let hR=0;class gR extends Zr{constructor(){super(...arguments),this.id=hR++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const o=this.node.animationState.setActive("exit",!t);n&&!t&&o.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const pR={animation:{Feature:fR},exit:{Feature:gR}};function Vs(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Qs(e){return{point:{x:e.pageX,y:e.pageY}}}const mR=e=>t=>nh(t)&&e(t,Qs(t));function Es(e,t,n,r){return Vs(e,t,mR(n),r)}const db=1e-4,yR=1-db,vR=1+db,fb=.01,xR=0-fb,bR=0+fb;function Pt(e){return e.max-e.min}function wR(e,t,n){return Math.abs(e-t)<=n}function Ep(e,t,n,r=.5){e.origin=r,e.originPoint=Je(t.min,t.max,e.origin),e.scale=Pt(n)/Pt(t),e.translate=Je(n.min,n.max,e.origin)-e.originPoint,(e.scale>=yR&&e.scale<=vR||isNaN(e.scale))&&(e.scale=1),(e.translate>=xR&&e.translate<=bR||isNaN(e.translate))&&(e.translate=0)}function Rs(e,t,n,r){Ep(e.x,t.x,n.x,r?r.originX:void 0),Ep(e.y,t.y,n.y,r?r.originY:void 0)}function Rp(e,t,n){e.min=n.min+t.min,e.max=e.min+Pt(t)}function CR(e,t,n){Rp(e.x,t.x,n.x),Rp(e.y,t.y,n.y)}function kp(e,t,n){e.min=t.min-n.min,e.max=e.min+Pt(t)}function xl(e,t,n){kp(e.x,t.x,n.x),kp(e.y,t.y,n.y)}function sn(e){return[e("x"),e("y")]}const hb=({current:e})=>e?e.ownerDocument.defaultView:null,Ap=(e,t)=>Math.abs(e-t);function SR(e,t){const n=Ap(e.x,t.x),r=Ap(e.y,t.y);return Math.sqrt(n**2+r**2)}class gb{constructor(t,n,{transformPagePoint:r,contextWindow:o=window,dragSnapToOrigin:i=!1,distanceThreshold:s=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=Uc(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,g=SR(d.offset,{x:0,y:0})>=this.distanceThreshold;if(!h&&!g)return;const{point:p}=d,{timestamp:m}=mt;this.history.push({...p,timestamp:m});const{onStart:v,onMove:y}=this.handlers;h||(v&&v(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,d)},this.handlePointerMove=(d,h)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=Kc(h,this.transformPagePoint),Ue.update(this.updatePoint,!0)},this.handlePointerUp=(d,h)=>{this.end();const{onEnd:g,onSessionEnd:p,resumeAnimation:m}=this.handlers;if(this.dragSnapToOrigin&&m&&m(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=Uc(d.type==="pointercancel"?this.lastMoveEventInfo:Kc(h,this.transformPagePoint),this.history);this.startEvent&&g&&g(d,v),p&&p(d,v)},!nh(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=s,this.contextWindow=o||window;const a=Qs(t),l=Kc(a,this.transformPagePoint),{point:c}=l,{timestamp:u}=mt;this.history=[{...c,timestamp:u}];const{onSessionStart:f}=n;f&&f(t,Uc(l,this.history)),this.removeListeners=Xs(Es(this.contextWindow,"pointermove",this.handlePointerMove),Es(this.contextWindow,"pointerup",this.handlePointerUp),Es(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),jr(this.updatePoint)}}function Kc(e,t){return t?{point:t(e.point)}:e}function Np(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Uc({point:e},t){return{point:e,delta:Np(e,pb(t)),offset:Np(e,_R(t)),velocity:TR(t,.1)}}function _R(e){return e[0]}function pb(e){return e[e.length-1]}function TR(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=pb(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>Tn(t)));)n--;if(!r)return{x:0,y:0};const i=ln(o.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const s={x:(o.x-r.x)/i,y:(o.y-r.y)/i};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function ER(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Je(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Je(n,e,r.max):Math.min(e,n)),e}function Mp(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function RR(e,{top:t,left:n,bottom:r,right:o}){return{x:Mp(e.x,n,o),y:Mp(e.y,t,r)}}function Pp(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function kR(e,t){return{x:Pp(e.x,t.x),y:Pp(e.y,t.y)}}function AR(e,t){let n=.5;const r=Pt(e),o=Pt(t);return o>r?n=Os(t.min,t.max-r,e.min):r>o&&(n=Os(e.min,e.max-o,t.min)),yr(0,1,n)}function NR(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Rd=.35;function MR(e=Rd){return e===!1?e=0:e===!0&&(e=Rd),{x:Lp(e,"left","right"),y:Lp(e,"top","bottom")}}function Lp(e,t,n){return{min:Fp(e,t),max:Fp(e,n)}}function Fp(e,t){return typeof e=="number"?e:e[t]||0}const PR=new WeakMap;class LR{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ct(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const i=f=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Qs(f).point)},s=(f,d)=>{const{drag:h,dragPropagation:g,onDragStart:p}=this.getProps();if(h&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=jE(h),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=d,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),sn(v=>{let y=this.getAxisMotionValue(v).get()||0;if(Hn.test(y)){const{projection:x}=this.visualElement;if(x&&x.layout){const b=x.layout.layoutBox[v];b&&(y=Pt(b)*(parseFloat(y)/100))}}this.originPoint[v]=y}),p&&Ue.postRender(()=>p(f,d)),Td(this.visualElement,"transform");const{animationState:m}=this.visualElement;m&&m.setActive("whileDrag",!0)},a=(f,d)=>{this.latestPointerEvent=f,this.latestPanInfo=d;const{dragPropagation:h,dragDirectionLock:g,onDirectionLock:p,onDrag:m}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:v}=d;if(g&&this.currentDirection===null){this.currentDirection=FR(v),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",d.point,v),this.updateAxis("y",d.point,v),this.visualElement.render(),m&&m(f,d)},l=(f,d)=>{this.latestPointerEvent=f,this.latestPanInfo=d,this.stop(f,d),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>sn(f=>this.getAnimationState(f)==="paused"&&this.getAxisMotionValue(f).animation?.play()),{dragSnapToOrigin:u}=this.getProps();this.panSession=new gb(t,{onSessionStart:i,onStart:s,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:r,contextWindow:hb(this.visualElement)})}stop(t,n){const r=t||this.latestPointerEvent,o=n||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!o||!r)return;const{velocity:s}=o;this.startAnimation(s);const{onDragEnd:a}=this.getProps();a&&Ue.postRender(()=>a(r,o))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:o}=this.getProps();if(!r||!Ta(t,o,this.currentDirection))return;const i=this.getAxisMotionValue(t);let s=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(s=ER(s,this.constraints[t],this.elastic[t])),i.set(s)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,o=this.constraints;t&&yi(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=RR(r.layoutBox,t):this.constraints=!1,this.elastic=MR(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&sn(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=NR(r.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!yi(t))return!1;const r=t.current;vr(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const i=$2(r,o.root,this.visualElement.getTransformPagePoint());let s=kR(o.layout.layoutBox,i);if(n){const a=n(P2(s));this.hasMutatedConstraints=!!a,a&&(s=Jx(a))}return s}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:i,dragSnapToOrigin:s,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=sn(u=>{if(!Ta(u,n,this.currentDirection))return;let f=l&&l[u]||{};s&&(f={min:0,max:0});const d=o?200:1e6,h=o?40:1e7,g={type:"inertia",velocity:r?t[u]:0,bounceStiffness:d,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(u,g)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Td(this.visualElement,t),r.start(fh(t,r,0,n,this.visualElement,!1))}stopAnimation(){sn(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){sn(t=>this.getAxisMotionValue(t).animation?.pause())}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),o=r[n];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){sn(n=>{const{drag:r}=this.getProps();if(!Ta(n,r,this.currentDirection))return;const{projection:o}=this.visualElement,i=this.getAxisMotionValue(n);if(o&&o.layout){const{min:s,max:a}=o.layout.layoutBox[n];i.set(t[n]-Je(s,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!yi(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};sn(s=>{const a=this.getAxisMotionValue(s);if(a&&this.constraints!==!1){const l=a.get();o[s]=AR({min:l,max:l},this.constraints[s])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),sn(s=>{if(!Ta(s,t,null))return;const a=this.getAxisMotionValue(s),{min:l,max:c}=this.constraints[s];a.set(Je(l,c,o[s]))})}addListeners(){if(!this.visualElement.current)return;PR.set(this.visualElement,this);const t=this.visualElement.current,n=Es(t,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();yi(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,i=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),Ue.read(r);const s=Vs(window,"resize",()=>this.scalePositionWithinConstraints()),a=o.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(sn(u=>{const f=this.getAxisMotionValue(u);f&&(this.originPoint[u]+=l[u].translate,f.set(f.get()+l[u].translate))}),this.visualElement.render())}));return()=>{s(),n(),i(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:i=!1,dragElastic:s=Rd,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:i,dragElastic:s,dragMomentum:a}}}function Ta(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function FR(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class $R extends Zr{constructor(t){super(t),this.removeGroupControls=cn,this.removeListeners=cn,this.controls=new LR(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||cn}unmount(){this.removeGroupControls(),this.removeListeners()}}const $p=e=>(t,n)=>{e&&Ue.postRender(()=>e(t,n))};class OR extends Zr{constructor(){super(...arguments),this.removePointerDownListener=cn}onPointerDown(t){this.session=new gb(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:hb(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:$p(t),onStart:$p(n),onMove:r,onEnd:(i,s)=>{delete this.session,o&&Ue.postRender(()=>o(i,s))}}}mount(){this.removePointerDownListener=Es(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const nl={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let Gc=!1;class IR extends S.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:i}=t;i&&(n.group&&n.group.add(i),r&&r.register&&o&&r.register(i),Gc&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),nl.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:o,isPresent:i}=this.props,{projection:s}=r;return s&&(s.isPresent=i,Gc=!0,o||t.layoutDependency!==n||n===void 0||t.isPresent!==i?s.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?s.promote():s.relegate()||Ue.postRender(()=>{const a=s.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),th.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=t;Gc=!0,o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function mb(e){const[t,n]=Ix(),r=S.useContext(Ff);return C.jsx(IR,{...e,layoutGroup:r,switchLayoutGroup:S.useContext(Xx),isPresent:t,safeToRemove:n})}function DR(e,t,n){const r=St(e)?e:Pi(e);return r.start(fh("",r,t,n)),r.animation}const jR=(e,t)=>e.depth-t.depth;class VR{constructor(){this.children=[],this.isDirty=!1}add(t){If(this.children,t),this.isDirty=!0}remove(t){Df(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(jR),this.isDirty=!1,this.children.forEach(t)}}function BR(e,t){const n=jt.now(),r=({timestamp:o})=>{const i=o-n;i>=t&&(jr(r),e(i-t))};return Ue.setup(r,!0),()=>jr(r)}const yb=["TopLeft","TopRight","BottomLeft","BottomRight"],zR=yb.length,Op=e=>typeof e=="string"?parseFloat(e):e,Ip=e=>typeof e=="number"||he.test(e);function HR(e,t,n,r,o,i){o?(e.opacity=Je(0,n.opacity??1,WR(r)),e.opacityExit=Je(t.opacity??1,0,KR(r))):i&&(e.opacity=Je(t.opacity??1,n.opacity??1,r));for(let s=0;s<zR;s++){const a=`border${yb[s]}Radius`;let l=Dp(t,a),c=Dp(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||Ip(l)===Ip(c)?(e[a]=Math.max(Je(Op(l),Op(c),r),0),(Hn.test(c)||Hn.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=Je(t.rotate||0,n.rotate||0,r))}function Dp(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const WR=vb(0,.5,nx),KR=vb(.5,.95,cn);function vb(e,t,n){return r=>r<e?0:r>t?1:n(Os(e,t,r))}function jp(e,t){e.min=t.min,e.max=t.max}function mn(e,t){jp(e.x,t.x),jp(e.y,t.y)}function Vp(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Bp(e,t,n,r,o){return e-=t,e=vl(e,1/n,r),o!==void 0&&(e=vl(e,1/o,r)),e}function UR(e,t=0,n=1,r=.5,o,i=e,s=e){if(Hn.test(t)&&(t=parseFloat(t),t=Je(s.min,s.max,t/100)-s.min),typeof t!="number")return;let a=Je(i.min,i.max,r);e===i&&(a-=t),e.min=Bp(e.min,t,n,a,o),e.max=Bp(e.max,t,n,a,o)}function zp(e,t,[n,r,o],i,s){UR(e,t[n],t[r],t[o],t.scale,i,s)}const GR=["x","scaleX","originX"],qR=["y","scaleY","originY"];function Hp(e,t,n,r){zp(e.x,t,GR,n?n.x:void 0,r?r.x:void 0),zp(e.y,t,qR,n?n.y:void 0,r?r.y:void 0)}function Wp(e){return e.translate===0&&e.scale===1}function xb(e){return Wp(e.x)&&Wp(e.y)}function Kp(e,t){return e.min===t.min&&e.max===t.max}function YR(e,t){return Kp(e.x,t.x)&&Kp(e.y,t.y)}function Up(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function bb(e,t){return Up(e.x,t.x)&&Up(e.y,t.y)}function Gp(e){return Pt(e.x)/Pt(e.y)}function qp(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class XR{constructor(){this.members=[]}add(t){If(this.members,t),t.scheduleRender()}remove(t){if(Df(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(o=>t===o);if(n===0)return!1;let r;for(let o=n;o>=0;o--){const i=this.members[o];if(i.isPresent!==!1){r=i;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;o===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function ZR(e,t,n){let r="";const o=e.x.translate/t.x,i=e.y.translate/t.y,s=n?.z||0;if((o||i||s)&&(r=`translate3d(${o}px, ${i}px, ${s}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:f,rotateY:d,skewX:h,skewY:g}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),f&&(r+=`rotateX(${f}deg) `),d&&(r+=`rotateY(${d}deg) `),h&&(r+=`skewX(${h}deg) `),g&&(r+=`skewY(${g}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const qc=["","X","Y","Z"],JR=1e3;let QR=0;function Yc(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function wb(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=sb(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Ue,!(o||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&wb(r)}function Cb({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(s={},a=t?.()){this.id=QR++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(nk),this.nodes.forEach(sk),this.nodes.forEach(ak),this.nodes.forEach(rk)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new VR)}addEventListener(s,a){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new Vf),this.eventHandlers.get(s).add(a)}notifyListeners(s,...a){const l=this.eventHandlers.get(s);l&&l.notify(...a)}hasListeners(s){return this.eventHandlers.has(s)}mount(s){if(this.instance)return;this.isSVG=Ox(s)&&!KE(s),this.instance=s;const{layoutId:a,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),e){let u,f=0;const d=()=>this.root.updateBlockedByResize=!1;Ue.read(()=>{f=window.innerWidth}),e(s,()=>{const h=window.innerWidth;h!==f&&(f=h,this.root.updateBlockedByResize=!0,u&&u(),u=BR(d,250),nl.hasAnimatedSinceResize&&(nl.hasAnimatedSinceResize=!1,this.nodes.forEach(Zp)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:f,hasRelativeLayoutChanged:d,layout:h})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||c.getDefaultTransition()||fk,{onLayoutAnimationStart:p,onLayoutAnimationComplete:m}=c.getProps(),v=!this.targetLayout||!bb(this.targetLayout,h),y=!f&&d;if(this.options.layoutRoot||this.resumeFrom||y||f&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const x={...Qf(g,"layout"),onPlay:p,onComplete:m};(c.shouldReduceMotion||this.options.layoutRoot)&&(x.delay=0,x.type=!1),this.startAnimation(x),this.setAnimationOrigin(u,y)}else f||Zp(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=h})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),jr(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(lk),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&wb(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const f=this.path[u];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Yp);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Xp);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(ik),this.nodes.forEach(ek),this.nodes.forEach(tk)):this.nodes.forEach(Xp),this.clearAllSnapshots();const a=jt.now();mt.delta=yr(0,1e3/60,a-mt.timestamp),mt.timestamp=a,mt.isProcessing=!0,Ic.update.process(mt),Ic.preRender.process(mt),Ic.render.process(mt),mt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,th.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ok),this.sharedNodes.forEach(ck)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Ue.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Ue.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Pt(this.snapshot.measuredBox.x)&&!Pt(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const s=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=ct(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,s?s.layoutBox:void 0)}updateScroll(s="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(a=!1),a&&this.instance){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!o)return;const s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!xb(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;s&&this.instance&&(a||uo(this.latestValues)||u)&&(o(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return s&&(l=this.removeTransform(l)),hk(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:s}=this.options;if(!s)return ct();const a=s.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(gk))){const{scroll:c}=this.root;c&&(vi(a.x,c.offset.x),vi(a.y,c.offset.y))}return a}removeElementScroll(s){const a=ct();if(mn(a,s),this.scroll?.wasRoot)return a;for(let l=0;l<this.path.length;l++){const c=this.path[l],{scroll:u,options:f}=c;c!==this.root&&u&&f.layoutScroll&&(u.wasRoot&&mn(a,s),vi(a.x,u.offset.x),vi(a.y,u.offset.y))}return a}applyTransform(s,a=!1){const l=ct();mn(l,s);for(let c=0;c<this.path.length;c++){const u=this.path[c];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&xi(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),uo(u.latestValues)&&xi(l,u.latestValues)}return uo(this.latestValues)&&xi(l,this.latestValues),l}removeTransform(s){const a=ct();mn(a,s);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!uo(c.latestValues))continue;wd(c.latestValues)&&c.updateSnapshot();const u=ct(),f=c.measurePageBox();mn(u,f),Hp(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return uo(this.latestValues)&&Hp(a,this.latestValues),a}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==mt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(s||l&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:f}=this.options;if(!this.layout||!(u||f))return;this.resolvedRelativeTargetAt=mt.timestamp;const d=this.getClosestProjectingParent();d&&this.linkedParentVersion!==d.layoutVersion&&!d.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(d&&d.layout?this.createRelativeTarget(d,this.layout.layoutBox,d.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=ct(),this.targetWithTransforms=ct()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),CR(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):mn(this.target,this.layout.layoutBox),eb(this.target,this.targetDelta)):mn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,d&&!!d.resumingFrom==!!this.resumingFrom&&!d.options.layoutScroll&&d.target&&this.animationProgress!==1?this.createRelativeTarget(d,this.target,d.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||wd(this.parent.latestValues)||Qx(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(s,a,l){this.relativeParent=s,this.linkedParentVersion=s.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ct(),this.relativeTargetOrigin=ct(),xl(this.relativeTargetOrigin,a,l),mn(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const s=this.getLead(),a=!!this.resumingFrom||this!==s;let l=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===mt.timestamp&&(l=!1),l)return;const{layout:c,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||u))return;mn(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,d=this.treeScale.y;F2(this.layoutCorrected,this.treeScale,this.path,a),s.layout&&!s.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(s.target=s.layout.layoutBox,s.targetWithTransforms=ct());const{target:h}=s;if(!h){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Vp(this.prevProjectionDelta.x,this.projectionDelta.x),Vp(this.prevProjectionDelta.y,this.projectionDelta.y)),Rs(this.projectionDelta,this.layoutCorrected,h,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==d||!qp(this.projectionDelta.x,this.prevProjectionDelta.x)||!qp(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",h))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){if(this.options.visualElement?.scheduleRender(),s){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=bi(),this.projectionDelta=bi(),this.projectionDeltaWithTransform=bi()}setAnimationOrigin(s,a=!1){const l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},f=bi();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const d=ct(),h=l?l.source:void 0,g=this.layout?this.layout.source:void 0,p=h!==g,m=this.getStack(),v=!m||m.members.length<=1,y=!!(p&&!v&&this.options.crossfade===!0&&!this.path.some(dk));this.animationProgress=0;let x;this.mixTargetDelta=b=>{const w=b/1e3;Jp(f.x,s.x,w),Jp(f.y,s.y,w),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(xl(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox),uk(this.relativeTarget,this.relativeTargetOrigin,d,w),x&&YR(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=ct()),mn(x,this.relativeTarget)),p&&(this.animationValues=u,HR(u,c,this.latestValues,w,y,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=w},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(jr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ue.update(()=>{nl.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Pi(0)),this.currentAnimation=DR(this.motionValue,[0,1e3],{...s,velocity:0,isSync:!0,onUpdate:a=>{this.mixTargetDelta(a),s.onUpdate&&s.onUpdate(a)},onStop:()=>{},onComplete:()=>{s.onComplete&&s.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(JR),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=s;if(!(!a||!l||!c)){if(this!==s&&this.layout&&c&&Sb(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||ct();const f=Pt(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+f;const d=Pt(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+d}mn(a,l),xi(a,u),Rs(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(s,a){this.sharedNodes.has(s)||this.sharedNodes.set(s,new XR),this.sharedNodes.get(s).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){const{layoutId:s}=this.options;return s?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:s}=this.options;return s?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),s&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let a=!1;const{latestValues:l}=s;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&Yc("z",s,c,this.animationValues);for(let u=0;u<qc.length;u++)Yc(`rotate${qc[u]}`,s,c,this.animationValues),Yc(`skew${qc[u]}`,s,c,this.animationValues);s.render();for(const u in c)s.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);s.scheduleRender()}applyProjectionStyles(s,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){s.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,s.visibility="",s.opacity="",s.pointerEvents=tl(a?.pointerEvents)||"",s.transform=l?l(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(s.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,s.pointerEvents=tl(a?.pointerEvents)||""),this.hasProjected&&!uo(this.latestValues)&&(s.transform=l?l({},""):"none",this.hasProjected=!1);return}s.visibility="";const u=c.animationValues||c.latestValues;this.applyTransformsToTarget();let f=ZR(this.projectionDeltaWithTransform,this.treeScale,u);l&&(f=l(u,f)),s.transform=f;const{x:d,y:h}=this.projectionDelta;s.transformOrigin=`${d.origin*100}% ${h.origin*100}% 0`,c.animationValues?s.opacity=c===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:s.opacity=c===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const g in bd){if(u[g]===void 0)continue;const{correct:p,applyTo:m,isCSSVariable:v}=bd[g],y=f==="none"?u[g]:p(u[g],c);if(m){const x=m.length;for(let b=0;b<x;b++)s[m[b]]=y}else v?this.options.visualElement.renderState.vars[g]=y:s[g]=y}this.options.layoutId&&(s.pointerEvents=c===this?tl(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>s.currentAnimation?.stop()),this.root.nodes.forEach(Yp),this.root.sharedNodes.clear()}}}function ek(e){e.updateLayout()}function tk(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:r}=e.layout,{animationType:o}=e.options,i=t.source!==e.layout.source;o==="size"?sn(u=>{const f=i?t.measuredBox[u]:t.layoutBox[u],d=Pt(f);f.min=n[u].min,f.max=f.min+d}):Sb(o,t.layoutBox,n)&&sn(u=>{const f=i?t.measuredBox[u]:t.layoutBox[u],d=Pt(n[u]);f.max=f.min+d,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[u].max=e.relativeTarget[u].min+d)});const s=bi();Rs(s,n,t.layoutBox);const a=bi();i?Rs(a,e.applyTransform(r,!0),t.measuredBox):Rs(a,n,t.layoutBox);const l=!xb(s);let c=!1;if(!e.resumeFrom){const u=e.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:f,layout:d}=u;if(f&&d){const h=ct();xl(h,t.layoutBox,f.layoutBox);const g=ct();xl(g,n,d.layoutBox),bb(h,g)||(c=!0),u.options.layoutRoot&&(e.relativeTarget=g,e.relativeTargetOrigin=h,e.relativeParent=u)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:a,layoutDelta:s,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function nk(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function rk(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function ok(e){e.clearSnapshot()}function Yp(e){e.clearMeasurements()}function Xp(e){e.isLayoutDirty=!1}function ik(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Zp(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function sk(e){e.resolveTargetDelta()}function ak(e){e.calcProjection()}function lk(e){e.resetSkewAndRotation()}function ck(e){e.removeLeadSnapshot()}function Jp(e,t,n){e.translate=Je(t.translate,0,n),e.scale=Je(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Qp(e,t,n,r){e.min=Je(t.min,n.min,r),e.max=Je(t.max,n.max,r)}function uk(e,t,n,r){Qp(e.x,t.x,n.x,r),Qp(e.y,t.y,n.y,r)}function dk(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const fk={duration:.45,ease:[.4,0,.1,1]},em=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),tm=em("applewebkit/")&&!em("chrome/")?Math.round:cn;function nm(e){e.min=tm(e.min),e.max=tm(e.max)}function hk(e){nm(e.x),nm(e.y)}function Sb(e,t,n){return e==="position"||e==="preserve-aspect"&&!wR(Gp(t),Gp(n),.2)}function gk(e){return e!==e.root&&e.scroll?.wasRoot}const pk=Cb({attachResizeListener:(e,t)=>Vs(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Xc={current:void 0},_b=Cb({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Xc.current){const e=new pk({});e.mount(window),e.setOptions({layoutScroll:!0}),Xc.current=e}return Xc.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),mk={pan:{Feature:OR},drag:{Feature:$R,ProjectionNode:_b,MeasureLayout:mb}};function rm(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,i=r[o];i&&Ue.postRender(()=>i(t,Qs(t)))}class yk extends Zr{mount(){const{current:t}=this.node;t&&(this.unmount=VE(t,(n,r)=>(rm(this.node,r,"Start"),o=>rm(this.node,o,"End"))))}unmount(){}}class vk extends Zr{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Xs(Vs(this.node.current,"focus",()=>this.onFocus()),Vs(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function om(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),i=r[o];i&&Ue.postRender(()=>i(t,Qs(t)))}class xk extends Zr{mount(){const{current:t}=this.node;t&&(this.unmount=WE(t,(n,r)=>(om(this.node,r,"Start"),(o,{success:i})=>om(this.node,o,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const kd=new WeakMap,Zc=new WeakMap,bk=e=>{const t=kd.get(e.target);t&&t(e)},wk=e=>{e.forEach(bk)};function Ck({root:e,...t}){const n=e||document;Zc.has(n)||Zc.set(n,{});const r=Zc.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(wk,{root:e,...t})),r[o]}function Sk(e,t,n){const r=Ck(t);return kd.set(e,n),r.observe(e),()=>{kd.delete(e),r.unobserve(e)}}const _k={some:0,all:1};class Tk extends Zr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:i}=t,s={root:n?n.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:_k[o]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,i&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:f}=this.node.getProps(),d=c?u:f;d&&d(l)};return Sk(this.node.current,s,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Ek(t,n))&&this.startObserver()}unmount(){}}function Ek({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Rk={inView:{Feature:Tk},tap:{Feature:xk},focus:{Feature:vk},hover:{Feature:yk}},kk={layout:{ProjectionNode:_b,MeasureLayout:mb}},Ak={...pR,...Rk,...mk,...kk},ea=M2(Ak,W2),yn={fontFamily:"Inter, sans-serif",wordBreak:"break-word"},ye={common:yn,title1:{...yn,fontSize:32,lineHeight:"36px",[vs.md()]:{fontSize:24}},title2:{...yn,fontSize:24,lineHeight:"28px",[vs.md()]:{fontSize:20}},title3:{...yn,fontSize:20,lineHeight:"28px",[vs.md()]:{fontSize:18},[vs.xs()]:{fontSize:16}},headline1:{...yn,fontSize:22,lineHeight:"26px"},headline2:{...yn,fontSize:18,lineHeight:"22px"},headline3:{...yn,fontSize:16,lineHeight:"20px"},body1:{...yn,fontSize:16,lineHeight:"24px"},body2:{...yn,fontSize:14,lineHeight:"20px"},caption1:{...yn,fontSize:12,lineHeight:"16px"},caption2:{...yn,fontSize:10,lineHeight:"14px"}},{transition:Nk,color:er,fontWeight:Ea}=V,Ra={text:T.css({...ye.common,transition:Nk.general}),"title-1":T.css({...ye.title1}),"title-2":T.css({...ye.title2}),"title-3":T.css({...ye.title3}),"headline-1":T.css({...ye.headline1}),"headline-2":T.css({...ye.headline2}),"headline-3":T.css({...ye.headline3}),"body-1":T.css({...ye.body1}),"body-2":T.css({...ye.body2}),"caption-1":T.css({...ye.caption1}),"caption-2":T.css({...ye.caption2}),primary:T.css({color:er.text.primary}),secondary:T.css({color:er.text.secondary}),tertiary:T.css({color:er.text.tertiary}),positive:T.css({color:er.text.positive}),negative:T.css({color:er.text.negative}),warning:T.css({color:er.text.warning}),accent:T.css({color:er.text.accent}),inverse:T.css({color:er.text.inverse}),transfer:T.css({color:er.text.transfer}),regular:T.css({fontWeight:Ea.regular}),medium:T.css({fontWeight:Ea.medium}),semibold:T.css({fontWeight:Ea.semibold}),bold:T.css({fontWeight:Ea.bold})},Mk=e=>{let t;e.center?t="center":e.left?t="left":e.right&&(t="right");let n;return e.uppercase?n="uppercase":e.lowercase?n="lowercase":e.capitalize&&(n="capitalize"),T.css({marginTop:e.mt,marginBottom:e.mb,marginRight:e.mr,marginLeft:e.ml,flex:e.flex,cursor:e.cursor,wordBreak:e.wordBreak,whiteSpace:e.whiteSpace,textOverflow:e.textOverflow,textDecoration:e.decoration,textAlign:t,textTransform:n,color:e.color,opacity:e.disabled?.5:void 0,overflow:e.overflow})},le=S.forwardRef(({children:e,className:t,variant:n="body-1",fontWeight:r="medium",tag:o="p",colorName:i="primary",style:s,clickOpacity:a=.5,opacityDuration:l=200,onClick:c,disabled:u,mt:f,mb:d,ml:h,mr:g,flex:p,cursor:m,wordBreak:v,whiteSpace:y,textOverflow:x,decoration:b,color:w,center:_,left:E,right:R,uppercase:k,lowercase:M,capitalize:F,overflow:D,...j},I)=>{const[$,H]=S.useState(!1),O=!!c,P=()=>O&&H(!0),K=()=>O&&H(!1),G=Mk({mt:f,mb:d,ml:h,mr:g,flex:p,cursor:m,wordBreak:v,whiteSpace:y,textOverflow:x,decoration:b,color:w,center:_,left:E,right:R,uppercase:k,lowercase:M,capitalize:F,overflow:D}),re=o,U=O?T.css({opacity:$?a:1,transition:`opacity ${l}ms ease`}):"";return C.jsx(re,{ref:I,...j,className:T.cx(Ra.text,Ra[n],Ra[i],Ra[r],U,t,G),style:s,onClick:c,onMouseDown:P,onMouseUp:K,onMouseLeave:K,onTouchStart:P,onTouchEnd:K,role:O?"button":void 0,tabIndex:O?0:void 0,children:e})});le.displayName="Text";const Tb=ea(le),{color:Ad,cornerRadius:Yt,height:ka,transition:Pk}=V,Lk=T.css({display:"flex",alignItems:"center",justifyContent:"center",position:"relative",borderRadius:16,height:48,padding:"0 16px",cursor:"pointer",fontSize:16,fontWeight:600,overflow:"hidden",transition:"all 0.2s ease",gap:8}),as={zero:Yt.zero,xs:Yt.xs,sm:Yt.sm,md:Yt.md,lg:Yt.lg,xl:Yt.xl,"2xl":Yt["2xl"],"3xl":Yt["3xl"],"4xl":Yt["4xl"],"5xl":Yt["5xl"],"6xl":Yt["6xl"],"full-round":Yt.fullRound},Fk={xs:ka.button.xs,sm:ka.button.sm,md:ka.button.md,lg:ka.button.lg},$k={clear:T.css({backgroundColor:"transparent",border:"none"}),filled:T.css({backgroundColor:Ad.fill.accentPrimary,color:"white",border:"none"}),outline:T.css({backgroundColor:"transparent",border:`1px solid ${Ad.border.accentPrimary}`})},Ok=(e,t,n,r)=>{if(r)return T.css({cursor:"not-allowed",opacity:.7});const o={transition:Pk.general,borderRadius:Yt.lg,border:"none",color:e==="filled"?Ad.text.inverse:`var(--text-${t})`};switch(e){case"filled":return T.css({...o,backgroundColor:`var(--fill-${t}-${n})`,":hover":{backgroundColor:`var(--fill-${t}-${n}-hover)`},":active":{backgroundColor:`var(--fill-${t}-${n}-hover)`}});case"outline":return T.css({...o,backgroundColor:"transparent",border:`1px solid var(--border-${t}-${n})`,":hover":{backgroundColor:`var(--fill-${t}-secondary-hover)`},":active":{backgroundColor:`var(--fill-${t}-secondary-hover)`}});case"clear":return T.css({...o,backgroundColor:"transparent",":hover":{backgroundColor:`var(--fill-${t}-secondary-hover)`},":active":{backgroundColor:`var(--fill-${t}-secondary-hover)`}});default:return T.css(o)}},{color:Aa}=V,Br=({disabled:e,loading:t,className:n,wrapperClassName:r,buttonClassName:o,buttonDisabledClassName:i,textClassName:s,children:a,variant:l="filled",backgroundColor:c,textColor:u,textFontWeight:f,borderColor:d,color:h="accent",opacity:g,borderRadius:p,width:m="full",size:v="md",iconLeft:y,iconRight:x,intensity:b="primary",flex:w,type:_="button",...E})=>{const R=S.useMemo(()=>{switch(m){case"full":return"100%";case"auto":return"auto";default:return m}},[m]),k=S.useMemo(()=>c||(l==="filled"?h==="neutral"?Aa.fill.neutralSecondary:`var(--fill-${h}-${b})`:"transparent"),[l,c,h,b]),M=S.useMemo(()=>{if(b==="primary"){if(h==="neutral")return Aa.text.secondary;if(l==="filled")return Aa.text.inverse}else if(h==="neutral")return Aa.text.secondary;return`var(--text-${h})`},[b,h,l]),F=S.useMemo(()=>{if(b==="primary"){if(h==="neutral")return"secondary";if(l==="filled")return"inverse"}else if(h==="neutral")return"secondary";return h},[l,h,b]),D=S.useMemo(()=>d||(l==="outline"?`var(--border-${h}-${b})`:"transparent"),[l,d,h,b]),j=S.useMemo(()=>{switch(v){case"lg":return as.lg;case"md":case"sm":return as.md;case"xs":return as.sm;default:return as.md}},[v]),I=T.cx(Lk,Ok(l,h,b,e),$k[l],e?i:void 0,T.css({borderRadius:p?as[p]:j,backgroundColor:k,borderColor:D,color:u??`var(--text-${F})`,width:"100%",height:Fk[v],opacity:g||(e?.7:1)}),o),$=S.useMemo(()=>{switch(v){case"lg":case"md":return"body-1";case"sm":case"xs":return"body-2";default:return"body-1"}},[v]);return C.jsx(q,{className:T.cx(r,n),w:R,flex:w,relative:!0,overflow:"hidden",children:C.jsxs(ea.button,{...E,whileTap:!e&&!t?{scale:.99,boxShadow:"inset 0 0 0 10000px rgba(0,0,0,0.1)",transition:{duration:0}}:{},disabled:e||t,className:I,type:_,children:[t?C.jsx(V0,{color:M}):C.jsxs(C.Fragment,{children:[y,C.jsx(Tb,{style:{color:u},colorName:F,variant:$,className:s,textOverflow:"ellipsis",overflow:"hidden",children:a}),x]}),C.jsx(zo,{})]})})},Ik=e=>N.createElement("svg",{width:16,height:16,viewBox:"0 0 24 24",fill:"none",...e},N.createElement("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z",fill:"currentColor"})),Dk=e=>N.createElement("svg",{viewBox:"0 0 24 24",fill:"none",...e},N.createElement("path",{d:"M19 13H5v-2h14v2z",fill:"currentColor"})),{color:ao}=V,Sr={checkbox:T.css({display:"inline-flex",alignItems:"flex-start",gap:8,userSelect:"none"}),disabled:T.css({cursor:"not-allowed",opacity:.5}),checkbox__input:T.css({position:"absolute",opacity:0,width:"var(--checkbox-size)",height:"var(--checkbox-size)"}),checkbox__box:T.css({width:"var(--checkbox-size)",height:"var(--checkbox-size)",display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:4,border:`1px solid ${ao.border.neutralAlphaHigh}`,backgroundColor:ao.fill.bgSecondary,opacity:1,transition:"all 0.15s cubic-bezier(0.4, 0, 0.2, 1)",position:"relative","& svg":{color:ao.border.accentPrimary}}),checked:T.css({borderColor:`${ao.border.accentPrimary} !important`,backgroundColor:`${ao.fill.accentSecondary} !important`}),error:T.css({borderColor:ao.border.negativePrimary,backgroundColor:ao.fill.negativeSecondary})},jk={primary:T.css({}),secondary:T.css({backgroundColor:"transparent"})},Vk={sm:20,md:24},hh=S.forwardRef(({checked:e,onChange:t,disabled:n,error:r,indeterminate:o,size:i="md",title:s,titleColor:a,subtitle:l,subtitleColor:c="secondary",name:u,required:f,variant:d="primary",flex:h,readOnly:g,className:p,inputClassName:m,boxClassName:v,titleClassName:y,subtitleClassName:x},b)=>{const[w,_]=S.useState(!1),E=e!==void 0,R=E?e:w,k=I=>{E||_(I.target.checked),t?.(I)},M=Vk[i],F=R||o,D=!!g&&!n,j=n?"not-allowed":D?"auto":"pointer";return C.jsxs("label",{className:T.cx(Sr.checkbox,T.css({flex:h,cursor:j}),{[Sr.disabled]:n},p),children:[C.jsxs(q,{relative:!0,display:"inline-flex",style:{"--checkbox-size":`${M}px`,"--checkbox-size-double":`${M*2}px`},children:[C.jsx("input",{ref:b,type:"checkbox",checked:R,onChange:D?void 0:k,onClick:I=>I.stopPropagation(),disabled:n,readOnly:D,name:u,required:f,className:T.cx(Sr.checkbox__input,{[Sr.disabled]:n},T.css({cursor:j}),m)}),C.jsx("div",{className:T.cx(Sr.checkbox__box,jk[d],{[Sr.disabled]:n,[Sr.error]:r,[Sr.checked]:F},v),children:F&&(o?C.jsx(Dk,{width:M*.75,height:M*.75}):C.jsx(Ik,{width:M*.75,height:M*.75}))})]}),(s||l)&&C.jsxs(q,{gap:4,children:[s&&C.jsx(le,{colorName:a,variant:i==="sm"?"body-2":"body-1",className:y,children:s}),l&&C.jsx(le,{variant:"body-2",colorName:c,className:x,children:l})]})]})});hh.displayName="Checkbox";const Bk=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("g",{opacity:.5},N.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.0002 17.9999C14.4185 17.9999 18.0002 14.4182 18.0002 9.99991C18.0002 5.58163 14.4185 1.99991 10.0002 1.99991C5.58197 1.99991 2.00024 5.58163 2.00024 9.99991C2.00024 14.4182 5.58197 17.9999 10.0002 17.9999ZM6.46514 6.46446C6.85566 6.07393 7.48883 6.07393 7.87935 6.46446L9.64712 8.23222C9.84238 8.42749 10.159 8.42749 10.3542 8.23222L12.122 6.46446C12.5125 6.07393 13.1457 6.07393 13.5362 6.46446C13.9267 6.85498 13.9267 7.48814 13.5362 7.87867L11.7684 9.64644C11.5732 9.8417 11.5732 10.1583 11.7684 10.3535L13.5362 12.1213C13.9267 12.5118 13.9267 13.145 13.5362 13.5355C13.1457 13.926 12.5125 13.926 12.122 13.5355L10.3542 11.7678C10.159 11.5725 9.84238 11.5725 9.64712 11.7678L7.87935 13.5355C7.48883 13.926 6.85566 13.926 6.46514 13.5355C6.07462 13.145 6.07462 12.5118 6.46514 12.1213L8.23291 10.3535C8.42817 10.1583 8.42817 9.8417 8.23291 9.64644L6.46514 7.87867C6.07462 7.48815 6.07462 6.85498 6.46514 6.46446Z",fill:"currentColor"}))),{color:en,spacing:ls}=V,Jc=T.css({opacity:.6,cursor:"not-allowed"}),xt={"input-container":T.css({backgroundColor:en.fill.accentSecondary,border:`1px solid ${en.border.neutralAlphaBasic}`,padding:`${ls.md} ${ls.lg}`,borderRadius:12,minHeight:40,width:"100%",transition:"border-color 0.2s ease, background-color 0.2s ease","& textarea":{resize:"none"},[`&:not(.${Jc}):hover`]:{backgroundColor:en.fill.neutralPrimaryHover},"&:focus-within":{borderColor:en.border.accentPrimary,[`&:not(.${Jc}):hover`]:{borderColor:en.border.accentPrimary}}}),input:T.css({...ye.common,...ye.body1,background:"transparent",width:"100%",color:en.text.primary,"&::placeholder":{color:en.text.tertiary,textOverflow:"ellipsis"}}),"input-text-size_sm":T.css({...ye.body2}),"input-text-size_md":T.css({...ye.body2}),"input-text-align_left":T.css({textAlign:"left"}),"input-text-align_center":T.css({textAlign:"center"}),"input-text-align_right":T.css({textAlign:"right"}),sm:T.css({height:40,padding:ls.md}),md:T.css({height:48,padding:`14px ${ls.lg} 14px ${ls.lg}`}),error:T.css({borderColor:en.border.negativePrimary}),disabled:Jc,multiline:T.css({height:"auto"}),primary:T.css({background:en.fill.bgPrimary}),secondary:T.css({background:en.fill.bgSecondary}),"clear-button":T.css({cursor:"pointer",color:en.text.tertiary,height:20,"&:hover":{color:en.text.primary}})},{spacing:im}=V;function sm(e){return{...new Event("input",{bubbles:!0}),target:e,currentTarget:e}}const Fi=S.forwardRef((e,t)=>{const{label:n,prompt:r,error:o,errorText:i,size:s="md",prefix:a,suffix:l,background:c="primary",showClearButton:u,disabled:f,value:d,defaultValue:h,className:g,wrapperClassName:p,labelClassName:m,fieldContainerClassName:v,promptClassName:y,errorClassName:x,textAlign:b="left",...w}=e,_=e.multiline===!0,E=S.useRef(null),R=S.useRef(null),[k,M]=Bo(typeof d=="string"||typeof d=="number"?String(d):void 0,typeof h=="string"||typeof h=="number"?String(h):"");S.useImperativeHandle(t,()=>({focus:()=>{E.current?.focus(),R.current?.focus()},blur:()=>{E.current?.blur(),R.current?.blur()},get value(){return E.current?.value||R.current?.value},set value($){M($),E.current&&(E.current.value=$),R.current&&(R.current.value=$)}}));const F=$=>{if(M($.target.value),_){const H=e.onChange;H?.($)}else{const H=e.onChange;H?.($)}};S.useEffect(()=>{_&&e.autoResize&&R.current&&(R.current.style.height="auto",R.current.style.height=`${R.current.scrollHeight}px`)},[k,_,e.autoResize]);const D=()=>{if(M(""),!_){const H=E.current;if(H){H.value="";const O=sm(H),P=e.onChange;P?.(O)}return}const $=R.current;if($){$.value="";const H=sm($),O=e.onChange;O?.(H)}},j=()=>{if(_){const{rows:P,autoResize:K,onChange:G,multiline:re,...U}=w;return C.jsx("textarea",{ref:R,rows:e.rows??3,className:T.cx(xt.input,g,{[xt.disabled]:f,[xt[`input-text-align_${b}`]]:!!b}),disabled:f,maxLength:e.maxLength,...U,value:k,onChange:F})}const{onChange:$,multiline:H,...O}=w;return C.jsx("input",{...O,ref:E,className:T.cx(xt.input,xt[`input-text-size_${s}`],g,{[xt.disabled]:f,[xt[`input-text-align_${b}`]]:!!b}),disabled:f,type:e.type??"text",value:k,onChange:F})},I=S.useMemo(()=>c==="white"?xt.primary:c==="gray"?xt.secondary:xt[c],[c]);return C.jsxs(q,{w:"full",gap:im.sm,className:p,children:[typeof n=="string"?C.jsx(le,{variant:"body-2",fontWeight:"regular",colorName:"tertiary",className:m,children:n}):n,C.jsxs(q,{row:!0,alignItems:_?"flex-start":"center",w:"full",gap:im.md,className:T.cx(xt["input-container"],I,xt[s],{[xt.error]:o,[xt.disabled]:f,[xt.multiline]:_},v),children:[a&&C.jsx(q,{flex:"none",children:a}),C.jsx(q,{flex:"1",children:j()}),u&&k&&!f&&C.jsx(q,{flex:"none",children:C.jsx("span",{className:xt["clear-button"],onClick:D,children:C.jsx(Bk,{})})}),l&&C.jsx(q,{flex:"none",children:l})]}),(r||_)&&C.jsxs(q,{row:!0,gap:10,w:"full",children:[typeof r=="string"?C.jsx(le,{variant:"caption-1",colorName:"tertiary",className:y,children:r}):r,_&&e.maxLength&&C.jsx(le,{right:!0,ml:"auto",flex:"none",variant:"caption-1",colorName:"tertiary",children:`${k.length}/${e.maxLength}`})]}),i&&o&&C.jsx(le,{variant:"body-2",colorName:"negative",fontWeight:"regular",className:x,children:i})]})});Fi.displayName="Input";const zk=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M15 8.33333H5M17.5 5H2.5M17.5 11.6667H2.5M15 15H5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),Hk=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M13.3333 8.33333H2.5M16.6667 5H2.5M16.6667 11.6667H2.5M13.3333 15H2.5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),Wk=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M17.5 8.33333H6.66665M17.5 5H3.33331M17.5 11.6667H3.33331M17.5 15H6.66665",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),Kk=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M5 10H11.6667C13.5076 10 15 8.50766 15 6.66671C15 4.82576 13.5076 3.33337 11.6667 3.33337H5V10ZM5 10H12.5C14.3409 10 15.8333 11.4924 15.8333 13.3334C15.8333 15.1743 14.3409 16.6667 12.5 16.6667H5V10Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),Uk=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M13.5 17.5H5.77614C5.2713 17.5 5.01887 17.5 4.90199 17.4002C4.80056 17.3135 4.74674 17.1836 4.75721 17.0506C4.76927 16.8974 4.94776 16.7189 5.30474 16.3619L12.3905 9.27614C12.7205 8.94613 12.8855 8.78112 13.0758 8.7193C13.2432 8.66492 13.4235 8.66492 13.5908 8.7193C13.7811 8.78112 13.9461 8.94613 14.2761 9.27614L17.5 12.5V13.5M13.5 17.5C14.9001 17.5 15.6002 17.5 16.135 17.2275C16.6054 16.9878 16.9878 16.6054 17.2275 16.135C17.5 15.6002 17.5 14.9001 17.5 13.5M13.5 17.5H6.5C5.09987 17.5 4.3998 17.5 3.86502 17.2275C3.39462 16.9878 3.01217 16.6054 2.77248 16.135C2.5 15.6002 2.5 14.9001 2.5 13.5V6.5C2.5 5.09987 2.5 4.3998 2.77248 3.86502C3.01217 3.39462 3.39462 3.01217 3.86502 2.77248C4.3998 2.5 5.09987 2.5 6.5 2.5H13.5C14.9001 2.5 15.6002 2.5 16.135 2.77248C16.6054 3.01217 16.9878 3.39462 17.2275 3.86502C17.5 4.3998 17.5 5.09987 17.5 6.5V13.5M8.75 7.08333C8.75 8.00381 8.00381 8.75 7.08333 8.75C6.16286 8.75 5.41667 8.00381 5.41667 7.08333C5.41667 6.16286 6.16286 5.41667 7.08333 5.41667C8.00381 5.41667 8.75 6.16286 8.75 7.08333Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),Gk=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M15.8334 3.33337H8.33335M11.6667 16.6667H4.16669M12.5 3.33337L7.50002 16.6667",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),qk=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("g",{clipPath:"url(#clip0_1571_1710)"},N.createElement("path",{d:"M8.33332 10.8333C8.69119 11.3118 9.14778 11.7077 9.67211 11.9941C10.1964 12.2806 10.7762 12.4509 11.3722 12.4936C11.9681 12.5363 12.5663 12.4503 13.1261 12.2415C13.6859 12.0327 14.1942 11.7059 14.6167 11.2833L17.1167 8.78335C17.8756 7.9975 18.2956 6.94499 18.2861 5.85251C18.2766 4.76002 17.8384 3.71497 17.0659 2.94243C16.2934 2.1699 15.2483 1.7317 14.1558 1.7222C13.0633 1.71271 12.0108 2.13269 11.225 2.89168L9.79165 4.31668M11.6666 9.16668C11.3088 8.68824 10.8522 8.29236 10.3279 8.0059C9.80353 7.71943 9.22373 7.54908 8.62777 7.5064C8.03182 7.46372 7.43366 7.54971 6.87386 7.75853C6.31406 7.96735 5.80572 8.29412 5.38332 8.71668L2.88332 11.2167C2.12432 12.0025 1.70435 13.055 1.71384 14.1475C1.72334 15.24 2.16154 16.2851 2.93407 17.0576C3.70661 17.8301 4.75166 18.2683 5.84414 18.2778C6.93663 18.2873 7.98914 17.8673 8.77498 17.1083L10.2 15.6833",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),N.createElement("defs",null,N.createElement("clipPath",{id:"clip0_1571_1710"},N.createElement("rect",{width:20,height:20,fill:"white"})))),Yk=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M17.5 9.99996L7.5 9.99996M17.5 4.99996L7.5 4.99996M17.5 15L7.5 15M4.16667 9.99996C4.16667 10.4602 3.79357 10.8333 3.33333 10.8333C2.8731 10.8333 2.5 10.4602 2.5 9.99996C2.5 9.53972 2.8731 9.16663 3.33333 9.16663C3.79357 9.16663 4.16667 9.53972 4.16667 9.99996ZM4.16667 4.99996C4.16667 5.4602 3.79357 5.83329 3.33333 5.83329C2.8731 5.83329 2.5 5.4602 2.5 4.99996C2.5 4.53972 2.8731 4.16663 3.33333 4.16663C3.79357 4.16663 4.16667 4.53972 4.16667 4.99996ZM4.16667 15C4.16667 15.4602 3.79357 15.8333 3.33333 15.8333C2.8731 15.8333 2.5 15.4602 2.5 15C2.5 14.5397 2.8731 14.1666 3.33333 14.1666C3.79357 14.1666 4.16667 14.5397 4.16667 15Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),Xk=e=>N.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M14 8.74967C14.4142 8.74967 14.75 8.41389 14.75 7.99967C14.75 7.58546 14.4142 7.24967 14 7.24967V7.99967V8.74967ZM6 7.24967C5.58579 7.24967 5.25 7.58546 5.25 7.99967C5.25 8.41389 5.58579 8.74967 6 8.74967V7.99967V7.24967ZM14 4.74967C14.4142 4.74967 14.75 4.41389 14.75 3.99967C14.75 3.58546 14.4142 3.24967 14 3.24967V3.99967V4.74967ZM6 3.24967C5.58579 3.24967 5.25 3.58546 5.25 3.99967C5.25 4.41389 5.58579 4.74967 6 4.74967V3.99967V3.24967ZM14 12.7497C14.4142 12.7497 14.75 12.4139 14.75 11.9997C14.75 11.5855 14.4142 11.2497 14 11.2497V11.9997V12.7497ZM6 11.2497C5.58579 11.2497 5.25 11.5855 5.25 11.9997C5.25 12.4139 5.58579 12.7497 6 12.7497V11.9997V11.2497ZM1.58967 3.48952C1.24295 3.71614 1.14558 4.18092 1.3722 4.52765C1.59882 4.87437 2.0636 4.97174 2.41033 4.74512L2 4.11732L1.58967 3.48952ZM3.2 3.33301H3.95C3.95 3.05764 3.79909 2.80441 3.5569 2.67337C3.31471 2.54233 3.02018 2.55455 2.78967 2.70521L3.2 3.33301ZM2.4 5.91634C1.98579 5.91634 1.65 6.25213 1.65 6.66634C1.65 7.08055 1.98579 7.41634 2.4 7.41634V6.66634V5.91634ZM4 7.41634C4.41421 7.41634 4.75 7.08055 4.75 6.66634C4.75 6.25213 4.41421 5.91634 4 5.91634V6.66634V7.41634ZM3.73743 10.8967L4.2726 11.4222L4.2726 11.4222L3.73743 10.8967ZM2 12.6663L1.46483 12.1409C1.25318 12.3565 1.19153 12.678 1.30841 12.9565C1.4253 13.2351 1.69791 13.4163 2 13.4163V12.6663ZM4 13.4163C4.41421 13.4163 4.75 13.0806 4.75 12.6663C4.75 12.2521 4.41421 11.9163 4 11.9163V12.6663V13.4163ZM1.25 10.2589C1.25 10.6731 1.58579 11.0089 2 11.0089C2.41421 11.0089 2.75 10.6731 2.75 10.2589H2H1.25ZM14 7.99967V7.24967L6 7.24967V7.99967V8.74967L14 8.74967V7.99967ZM14 3.99967V3.24967H6V3.99967V4.74967H14V3.99967ZM14 11.9997V11.2497L6 11.2497V11.9997V12.7497L14 12.7497V11.9997ZM2 4.11732L2.41033 4.74512L3.61033 3.96081L3.2 3.33301L2.78967 2.70521L1.58967 3.48952L2 4.11732ZM3.2 3.33301H2.45V6.66634H3.2H3.95V3.33301H3.2ZM3.2 6.66634V5.91634H2.4V6.66634V7.41634H3.2V6.66634ZM3.2 6.66634V7.41634H4V6.66634V5.91634H3.2V6.66634ZM3.73743 10.8967L3.20226 10.3713L1.46483 12.1409L2 12.6663L2.53517 13.1918L4.2726 11.4222L3.73743 10.8967ZM2 12.6663V13.4163H4V12.6663V11.9163H2V12.6663ZM4 10.2654H3.25C3.25 10.2957 3.23759 10.3353 3.20225 10.3713L3.73743 10.8967L4.2726 11.4222C4.57518 11.114 4.75 10.7002 4.75 10.2654H4ZM3 9.33301V10.083C3.08406 10.083 3.1515 10.1147 3.19493 10.1553C3.23791 10.1955 3.25 10.2354 3.25 10.2654H4H4.75C4.75 9.29296 3.91808 8.58301 3 8.58301V9.33301ZM2 10.2589H2.75C2.75 10.2299 2.76126 10.1927 2.80245 10.1545C2.84462 10.1155 2.91258 10.083 3 10.083V9.33301V8.58301C2.0889 8.58301 1.25 9.28004 1.25 10.2589H2Z",fill:"currentColor"})),Zk=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M5 13.3334C5 15.1743 6.49238 16.6667 8.33333 16.6667H11.6667C13.5076 16.6667 15 15.1743 15 13.3334C15 11.4924 13.5076 10 11.6667 10M15 6.66671C15 4.82576 13.5076 3.33337 11.6667 3.33337H8.33333C6.49238 3.33337 5 4.82576 5 6.66671M2.5 10H17.5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),Jk=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M2.5 7.5L17.5 7.5M7.5 2.5L7.5 17.5M6.5 2.5H13.5C14.9001 2.5 15.6002 2.5 16.135 2.77248C16.6054 3.01217 16.9878 3.39462 17.2275 3.86502C17.5 4.3998 17.5 5.09987 17.5 6.5V13.5C17.5 14.9001 17.5 15.6002 17.2275 16.135C16.9878 16.6054 16.6054 16.9878 16.135 17.2275C15.6002 17.5 14.9001 17.5 13.5 17.5H6.5C5.09987 17.5 4.3998 17.5 3.86502 17.2275C3.39462 16.9878 3.01217 16.6054 2.77248 16.135C2.5 15.6002 2.5 14.9001 2.5 13.5V6.5C2.5 5.09987 2.5 4.3998 2.77248 3.86502C3.01217 3.39462 3.39462 3.01217 3.86502 2.77248C4.3998 2.5 5.09987 2.5 6.5 2.5Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),Qk=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M15 3.33337V9.16671C15 11.9281 12.7614 14.1667 9.99998 14.1667C7.23856 14.1667 4.99998 11.9281 4.99998 9.16671V3.33337M3.33331 17.5H16.6666",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),gh=S.createContext(null);function ta(){const e=S.useContext(gh);if(!e)throw new Error("useEditorStates must be used within EditorState Provider");return e}const Eb=S.createContext(null);function e3(){const e=S.useContext(Eb);if(!e)throw new Error("useToolbarContext must be used within ToolbarContext provider");return e}var bs={exports:{}};bs.exports;var am;function t3(){return am||(am=1,(function(e,t){var n=200,r="__lodash_hash_undefined__",o=800,i=16,s=9007199254740991,a="[object Arguments]",l="[object Array]",c="[object AsyncFunction]",u="[object Boolean]",f="[object Date]",d="[object Error]",h="[object Function]",g="[object GeneratorFunction]",p="[object Map]",m="[object Number]",v="[object Null]",y="[object Object]",x="[object Proxy]",b="[object RegExp]",w="[object Set]",_="[object String]",E="[object Undefined]",R="[object WeakMap]",k="[object ArrayBuffer]",M="[object DataView]",F="[object Float32Array]",D="[object Float64Array]",j="[object Int8Array]",I="[object Int16Array]",$="[object Int32Array]",H="[object Uint8Array]",O="[object Uint8ClampedArray]",P="[object Uint16Array]",K="[object Uint32Array]",G=/[\\^$.*+?()[\]{}|]/g,re=/^\[object .+?Constructor\]$/,U=/^(?:0|[1-9]\d*)$/,Z={};Z[F]=Z[D]=Z[j]=Z[I]=Z[$]=Z[H]=Z[O]=Z[P]=Z[K]=!0,Z[a]=Z[l]=Z[k]=Z[u]=Z[M]=Z[f]=Z[d]=Z[h]=Z[p]=Z[m]=Z[y]=Z[b]=Z[w]=Z[_]=Z[R]=!1;var Q=typeof Bn=="object"&&Bn&&Bn.Object===Object&&Bn,ne=typeof self=="object"&&self&&self.Object===Object&&self,oe=Q||ne||Function("return this")(),me=t&&!t.nodeType&&t,ee=me&&!0&&e&&!e.nodeType&&e,xe=ee&&ee.exports===me,Se=xe&&Q.process,Ee=(function(){try{var A=ee&&ee.require&&ee.require("util").types;return A||Se&&Se.binding&&Se.binding("util")}catch{}})(),ze=Ee&&Ee.isTypedArray;function je(A,L,z){switch(z.length){case 0:return A.call(L);case 1:return A.call(L,z[0]);case 2:return A.call(L,z[0],z[1]);case 3:return A.call(L,z[0],z[1],z[2])}return A.apply(L,z)}function Rt(A,L){for(var z=-1,ie=Array(A);++z<A;)ie[z]=L(z);return ie}function gn(A){return function(L){return A(L)}}function ot(A,L){return A?.[L]}function Gt(A,L){return function(z){return A(L(z))}}var Qt=Array.prototype,pt=Function.prototype,se=Object.prototype,Re=oe["__core-js_shared__"],Ye=pt.toString,rt=se.hasOwnProperty,It=(function(){var A=/[^.]+$/.exec(Re&&Re.keys&&Re.keys.IE_PROTO||"");return A?"Symbol(src)_1."+A:""})(),to=se.toString,no=Ye.call(Object),pa=RegExp("^"+Ye.call(rt).replace(G,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),qo=xe?oe.Buffer:void 0,Ce=oe.Symbol,Le=oe.Uint8Array;qo&&qo.allocUnsafe;var Yo=Gt(Object.getPrototypeOf,Object),kg=Object.create,_S=se.propertyIsEnumerable,TS=Qt.splice,ro=Ce?Ce.toStringTag:void 0,ma=(function(){try{var A=Rc(Object,"defineProperty");return A({},"",{}),A}catch{}})(),ES=qo?qo.isBuffer:void 0,Ag=Math.max,RS=Date.now,Ng=Rc(oe,"Map"),rs=Rc(Object,"create"),kS=(function(){function A(){}return function(L){if(!io(L))return{};if(kg)return kg(L);A.prototype=L;var z=new A;return A.prototype=void 0,z}})();function oo(A){var L=-1,z=A==null?0:A.length;for(this.clear();++L<z;){var ie=A[L];this.set(ie[0],ie[1])}}function AS(){this.__data__=rs?rs(null):{},this.size=0}function NS(A){var L=this.has(A)&&delete this.__data__[A];return this.size-=L?1:0,L}function MS(A){var L=this.__data__;if(rs){var z=L[A];return z===r?void 0:z}return rt.call(L,A)?L[A]:void 0}function PS(A){var L=this.__data__;return rs?L[A]!==void 0:rt.call(L,A)}function LS(A,L){var z=this.__data__;return this.size+=this.has(A)?0:1,z[A]=rs&&L===void 0?r:L,this}oo.prototype.clear=AS,oo.prototype.delete=NS,oo.prototype.get=MS,oo.prototype.has=PS,oo.prototype.set=LS;function Qn(A){var L=-1,z=A==null?0:A.length;for(this.clear();++L<z;){var ie=A[L];this.set(ie[0],ie[1])}}function FS(){this.__data__=[],this.size=0}function $S(A){var L=this.__data__,z=ya(L,A);if(z<0)return!1;var ie=L.length-1;return z==ie?L.pop():TS.call(L,z,1),--this.size,!0}function OS(A){var L=this.__data__,z=ya(L,A);return z<0?void 0:L[z][1]}function IS(A){return ya(this.__data__,A)>-1}function DS(A,L){var z=this.__data__,ie=ya(z,A);return ie<0?(++this.size,z.push([A,L])):z[ie][1]=L,this}Qn.prototype.clear=FS,Qn.prototype.delete=$S,Qn.prototype.get=OS,Qn.prototype.has=IS,Qn.prototype.set=DS;function Xo(A){var L=-1,z=A==null?0:A.length;for(this.clear();++L<z;){var ie=A[L];this.set(ie[0],ie[1])}}function jS(){this.size=0,this.__data__={hash:new oo,map:new(Ng||Qn),string:new oo}}function VS(A){var L=xa(this,A).delete(A);return this.size-=L?1:0,L}function BS(A){return xa(this,A).get(A)}function zS(A){return xa(this,A).has(A)}function HS(A,L){var z=xa(this,A),ie=z.size;return z.set(A,L),this.size+=z.size==ie?0:1,this}Xo.prototype.clear=jS,Xo.prototype.delete=VS,Xo.prototype.get=BS,Xo.prototype.has=zS,Xo.prototype.set=HS;function Zo(A){var L=this.__data__=new Qn(A);this.size=L.size}function WS(){this.__data__=new Qn,this.size=0}function KS(A){var L=this.__data__,z=L.delete(A);return this.size=L.size,z}function US(A){return this.__data__.get(A)}function GS(A){return this.__data__.has(A)}function qS(A,L){var z=this.__data__;if(z instanceof Qn){var ie=z.__data__;if(!Ng||ie.length<n-1)return ie.push([A,L]),this.size=++z.size,this;z=this.__data__=new Xo(ie)}return z.set(A,L),this.size=z.size,this}Zo.prototype.clear=WS,Zo.prototype.delete=KS,Zo.prototype.get=US,Zo.prototype.has=GS,Zo.prototype.set=qS;function YS(A,L){var z=Nc(A),ie=!z&&Ac(A),_e=!z&&!ie&&$g(A),Oe=!z&&!ie&&!_e&&Ig(A),He=z||ie||_e||Oe,Ae=He?Rt(A.length,String):[],We=Ae.length;for(var pn in A)He&&(pn=="length"||_e&&(pn=="offset"||pn=="parent")||Oe&&(pn=="buffer"||pn=="byteLength"||pn=="byteOffset")||Lg(pn,We))||Ae.push(pn);return Ae}function Tc(A,L,z){(z!==void 0&&!ba(A[L],z)||z===void 0&&!(L in A))&&Ec(A,L,z)}function XS(A,L,z){var ie=A[L];(!(rt.call(A,L)&&ba(ie,z))||z===void 0&&!(L in A))&&Ec(A,L,z)}function ya(A,L){for(var z=A.length;z--;)if(ba(A[z][0],L))return z;return-1}function Ec(A,L,z){L=="__proto__"&&ma?ma(A,L,{configurable:!0,enumerable:!0,value:z,writable:!0}):A[L]=z}var ZS=u_();function va(A){return A==null?A===void 0?E:v:ro&&ro in Object(A)?d_(A):y_(A)}function Mg(A){return os(A)&&va(A)==a}function JS(A){if(!io(A)||p_(A))return!1;var L=Pc(A)?pa:re;return L.test(w_(A))}function QS(A){return os(A)&&Og(A.length)&&!!Z[va(A)]}function e_(A){if(!io(A))return m_(A);var L=Fg(A),z=[];for(var ie in A)ie=="constructor"&&(L||!rt.call(A,ie))||z.push(ie);return z}function Pg(A,L,z,ie,_e){A!==L&&ZS(L,function(Oe,He){if(_e||(_e=new Zo),io(Oe))t_(A,L,He,z,Pg,ie,_e);else{var Ae=ie?ie(kc(A,He),Oe,He+"",A,L,_e):void 0;Ae===void 0&&(Ae=Oe),Tc(A,He,Ae)}},Dg)}function t_(A,L,z,ie,_e,Oe,He){var Ae=kc(A,z),We=kc(L,z),pn=He.get(We);if(pn){Tc(A,z,pn);return}var qt=Oe?Oe(Ae,We,z+"",A,L,He):void 0,is=qt===void 0;if(is){var Lc=Nc(We),Fc=!Lc&&$g(We),Vg=!Lc&&!Fc&&Ig(We);qt=We,Lc||Fc||Vg?Nc(Ae)?qt=Ae:C_(Ae)?qt=a_(Ae):Fc?(is=!1,qt=o_(We)):Vg?(is=!1,qt=s_(We)):qt=[]:S_(We)||Ac(We)?(qt=Ae,Ac(Ae)?qt=__(Ae):(!io(Ae)||Pc(Ae))&&(qt=f_(We))):is=!1}is&&(He.set(We,qt),_e(qt,We,ie,Oe,He),He.delete(We)),Tc(A,z,qt)}function n_(A,L){return x_(v_(A,L,jg),A+"")}var r_=ma?function(A,L){return ma(A,"toString",{configurable:!0,enumerable:!1,value:E_(L),writable:!0})}:jg;function o_(A,L){return A.slice()}function i_(A){var L=new A.constructor(A.byteLength);return new Le(L).set(new Le(A)),L}function s_(A,L){var z=i_(A.buffer);return new A.constructor(z,A.byteOffset,A.length)}function a_(A,L){var z=-1,ie=A.length;for(L||(L=Array(ie));++z<ie;)L[z]=A[z];return L}function l_(A,L,z,ie){var _e=!z;z||(z={});for(var Oe=-1,He=L.length;++Oe<He;){var Ae=L[Oe],We=void 0;We===void 0&&(We=A[Ae]),_e?Ec(z,Ae,We):XS(z,Ae,We)}return z}function c_(A){return n_(function(L,z){var ie=-1,_e=z.length,Oe=_e>1?z[_e-1]:void 0,He=_e>2?z[2]:void 0;for(Oe=A.length>3&&typeof Oe=="function"?(_e--,Oe):void 0,He&&h_(z[0],z[1],He)&&(Oe=_e<3?void 0:Oe,_e=1),L=Object(L);++ie<_e;){var Ae=z[ie];Ae&&A(L,Ae,ie,Oe)}return L})}function u_(A){return function(L,z,ie){for(var _e=-1,Oe=Object(L),He=ie(L),Ae=He.length;Ae--;){var We=He[++_e];if(z(Oe[We],We,Oe)===!1)break}return L}}function xa(A,L){var z=A.__data__;return g_(L)?z[typeof L=="string"?"string":"hash"]:z.map}function Rc(A,L){var z=ot(A,L);return JS(z)?z:void 0}function d_(A){var L=rt.call(A,ro),z=A[ro];try{A[ro]=void 0;var ie=!0}catch{}var _e=to.call(A);return ie&&(L?A[ro]=z:delete A[ro]),_e}function f_(A){return typeof A.constructor=="function"&&!Fg(A)?kS(Yo(A)):{}}function Lg(A,L){var z=typeof A;return L=L??s,!!L&&(z=="number"||z!="symbol"&&U.test(A))&&A>-1&&A%1==0&&A<L}function h_(A,L,z){if(!io(z))return!1;var ie=typeof L;return(ie=="number"?Mc(z)&&Lg(L,z.length):ie=="string"&&L in z)?ba(z[L],A):!1}function g_(A){var L=typeof A;return L=="string"||L=="number"||L=="symbol"||L=="boolean"?A!=="__proto__":A===null}function p_(A){return!!It&&It in A}function Fg(A){var L=A&&A.constructor,z=typeof L=="function"&&L.prototype||se;return A===z}function m_(A){var L=[];if(A!=null)for(var z in Object(A))L.push(z);return L}function y_(A){return to.call(A)}function v_(A,L,z){return L=Ag(L===void 0?A.length-1:L,0),function(){for(var ie=arguments,_e=-1,Oe=Ag(ie.length-L,0),He=Array(Oe);++_e<Oe;)He[_e]=ie[L+_e];_e=-1;for(var Ae=Array(L+1);++_e<L;)Ae[_e]=ie[_e];return Ae[L]=z(He),je(A,this,Ae)}}function kc(A,L){if(!(L==="constructor"&&typeof A[L]=="function")&&L!="__proto__")return A[L]}var x_=b_(r_);function b_(A){var L=0,z=0;return function(){var ie=RS(),_e=i-(ie-z);if(z=ie,_e>0){if(++L>=o)return arguments[0]}else L=0;return A.apply(void 0,arguments)}}function w_(A){if(A!=null){try{return Ye.call(A)}catch{}try{return A+""}catch{}}return""}function ba(A,L){return A===L||A!==A&&L!==L}var Ac=Mg((function(){return arguments})())?Mg:function(A){return os(A)&&rt.call(A,"callee")&&!_S.call(A,"callee")},Nc=Array.isArray;function Mc(A){return A!=null&&Og(A.length)&&!Pc(A)}function C_(A){return os(A)&&Mc(A)}var $g=ES||R_;function Pc(A){if(!io(A))return!1;var L=va(A);return L==h||L==g||L==c||L==x}function Og(A){return typeof A=="number"&&A>-1&&A%1==0&&A<=s}function io(A){var L=typeof A;return A!=null&&(L=="object"||L=="function")}function os(A){return A!=null&&typeof A=="object"}function S_(A){if(!os(A)||va(A)!=y)return!1;var L=Yo(A);if(L===null)return!0;var z=rt.call(L,"constructor")&&L.constructor;return typeof z=="function"&&z instanceof z&&Ye.call(z)==no}var Ig=ze?gn(ze):QS;function __(A){return l_(A,Dg(A))}function Dg(A){return Mc(A)?YS(A):e_(A)}var T_=c_(function(A,L,z){Pg(A,L,z)});function E_(A){return function(){return A}}function jg(A){return A}function R_(){return!1}e.exports=T_})(bs,bs.exports)),bs.exports}var n3=t3();const r3=Lf(n3),Rb=S.createContext(null);function o3(){return S.useContext(Rb)}function i3({children:e,locale:t}){return C.jsx(Rb.Provider,{value:t||null,children:e})}function s3({localeKey:e,defaultLocale:t}){const n=S.createContext(t);function r(s){const{extraLocale:a}=s||{},l=o3();return{value:S.useMemo(()=>{const u=l?l[e]:null,f=[{},t];return u&&f.push(u),a&&f.push(a),r3(...f)},[t,a,e,l])}}function o(){return S.useContext(n)}function i({children:s,locale:a}){const{value:l}=r({extraLocale:a});return C.jsx(n.Provider,{value:l,children:s})}return{Context:n,useComposeLocaleProviderValue:r,useLocale:o,Provider:i}}const kb="MarkdownTextEditor",a3={toolbar:{link:{textPlaceholder:"Enter the text to display",linkPlaceholder:"Paste a link",linkErrorText:"Please enter a valid link",buttonText:"Save"},table:{maxRowsErrorText:e=>`Maximum number of rows is ${e.limit}`,maxColumnsErrorText:e=>`Maximum number of columns is ${e.limit}`,minRowsErrorText:e=>`Minimum number of rows is ${e.limit}`,minColumnsErrorText:e=>`Minimum number of columns is ${e.limit}`,rowsPlaceholder:"Rows count",columnsPlaceholder:"Columns count",buttonText:"Create table"},textSize:{paragraph:"Normal text",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3"},preview:{show:"Preview",hide:"Preview"},actions:{bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",link:"Link",image:"Image",alignLeft:"Align left",alignCenter:"Align center",alignRight:"Align right",table:"Table",bulletList:"Bullet list",numberedList:"Numbered list"}}},{Provider:l3,useLocale:na}=s3({localeKey:kb,defaultLocale:a3}),Ab=S.createContext(null);function c3(e,t){return{getTheme:function(){return t??null}}}function lt(){const e=S.useContext(Ab);return e==null&&(function(t,...n){const r=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",t);for(const i of n)o.append("v",i);throw r.search=o.toString(),Error(`Minified Lexical error #${t}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(8),e}function Y(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Nb(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);n.search=r.toString(),console.warn(`Minified Lexical warning #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const Ln=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,u3=Ln&&"documentMode"in document?document.documentMode:null,wn=Ln&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),ko=Ln&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),bl=!(!Ln||!("InputEvent"in window)||u3)&&"getTargetRanges"in new window.InputEvent("input"),ra=Ln&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Ki=Ln&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,d3=Ln&&/Android/.test(navigator.userAgent),Mb=Ln&&/^(?=.*Chrome).*/i.test(navigator.userAgent),lm=Ln&&d3&&Mb,oa=Ln&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&wn&&!Mb;function Pb(...e){const t=[];for(const n of e)if(n&&typeof n=="string")for(const[r]of n.matchAll(/\S+/g))t.push(r);return t}const f3=0,h3=1,g3=2,Lb=128,p3=1,m3=2,y3=3,v3=4,x3=5,b3=6,Zl=ra||Ki||oa?" ":"​",zr=`
34
+ `),()=>{m.contains(p)&&m.removeChild(p)}},[t]),C.jsx(ZE,{isPresent:t,childRef:i,sizeRef:s,children:N.cloneElement(e,{ref:l})})}const QE=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:i,mode:s,anchorX:a,root:l})=>{const c=Of(e2),u=S.useId();let f=!0,d=S.useMemo(()=>(f=!1,{id:u,initial:t,isPresent:n,custom:o,onExitComplete:h=>{c.set(h,!0);for(const g of c.values())if(!g)return;r&&r()},register:h=>(c.set(h,!1),()=>c.delete(h))}),[n,c,r]);return i&&f&&(d={...d}),S.useMemo(()=>{c.forEach((h,g)=>c.set(g,!1))},[n]),N.useEffect(()=>{!n&&!c.size&&r&&r()},[n]),s==="popLayout"&&(e=C.jsx(JE,{isPresent:n,anchorX:a,root:l,children:e})),C.jsx(ql.Provider,{value:d,children:e})};function e2(){return new Map}function jx(e=!0){const t=S.useContext(ql);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=t,i=S.useId();S.useEffect(()=>{if(e)return o(i)},[e]);const s=S.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,s]:[!0]}const _a=e=>e.key||"";function hp(e){const t=[];return S.Children.forEach(e,n=>{S.isValidElement(n)&&t.push(n)}),t}const Vx=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:i="sync",propagate:s=!1,anchorX:a="left",root:l})=>{const[c,u]=jx(s),f=S.useMemo(()=>hp(e),[e]),d=s&&!c?[]:f.map(_a),h=S.useRef(!0),g=S.useRef(f),p=Of(()=>new Map),[m,v]=S.useState(f),[y,x]=S.useState(f);G0(()=>{h.current=!1,g.current=f;for(let _=0;_<y.length;_++){const E=_a(y[_]);d.includes(E)?p.delete(E):p.get(E)!==!0&&p.set(E,!1)}},[y,d.length,d.join("-")]);const b=[];if(f!==m){let _=[...f];for(let E=0;E<y.length;E++){const R=y[E],k=_a(R);d.includes(k)||(_.splice(E,0,R),b.push(R))}return i==="wait"&&b.length&&(_=b),x(hp(_)),v(f),null}process.env.NODE_ENV!=="production"&&i==="wait"&&y.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:w}=S.useContext($f);return C.jsx(C.Fragment,{children:y.map(_=>{const E=_a(_),R=s&&!c?!1:f===y||d.includes(E),k=()=>{if(p.has(E))p.set(E,!0);else return;let P=!0;p.forEach(F=>{F||(P=!1)}),P&&(w?.(),x(g.current),s&&u?.(),r&&r())};return C.jsx(QE,{isPresent:R,initial:!h.current||n?void 0:!1,custom:t,presenceAffectsLayout:o,mode:i,root:l,onExitComplete:R?void 0:k,anchorX:a,children:_},E)})})},Bx=S.createContext({strict:!1}),gp={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Li={};for(const e in gp)Li[e]={isEnabled:t=>gp[e].some(n=>!!t[n])};function t2(e){for(const t in e)Li[t]={...Li[t],...e[t]}}const n2=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function yl(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||n2.has(e)}let zx=e=>!yl(e);function r2(e){typeof e=="function"&&(zx=t=>t.startsWith("on")?!yl(t):e(t))}try{r2(require("@emotion/is-prop-valid").default)}catch{}function o2(e,t,n){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||(zx(o)||n===!0&&yl(o)||!t&&!yl(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}const Yl=S.createContext({});function Xl(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function js(e){return typeof e=="string"||Array.isArray(e)}const ih=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],sh=["initial",...ih];function Zl(e){return Xl(e.animate)||sh.some(t=>js(e[t]))}function Hx(e){return!!(Zl(e)||e.variants)}function i2(e,t){if(Zl(e)){const{initial:n,animate:r}=e;return{initial:n===!1||js(n)?n:void 0,animate:js(r)?r:void 0}}return e.inherit!==!1?t:{}}function s2(e){const{initial:t,animate:n}=i2(e,S.useContext(Yl));return S.useMemo(()=>({initial:t,animate:n}),[pp(t),pp(n)])}function pp(e){return Array.isArray(e)?e.join(" "):e}function mp(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const ss={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(he.test(e))e=parseFloat(e);else return e;const n=mp(e,t.target.x),r=mp(e,t.target.y);return`${n}% ${r}%`}},a2={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=Vr.parse(e);if(o.length>5)return r;const i=Vr.createTransformer(e),s=typeof o[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;o[0+s]/=a,o[1+s]/=l;const c=Je(a,l,.5);return typeof o[2+s]=="number"&&(o[2+s]/=c),typeof o[3+s]=="number"&&(o[3+s]/=c),i(o)}},wd={borderRadius:{...ss,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:ss,borderTopRightRadius:ss,borderBottomLeftRadius:ss,borderBottomRightRadius:ss,boxShadow:a2};function Wx(e,{layout:t,layoutId:n}){return Wi.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!wd[e]||e==="opacity")}const l2={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},c2=Hi.length;function u2(e,t,n){let r="",o=!0;for(let i=0;i<c2;i++){const s=Hi[i],a=e[s];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(s.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=Lx(a,th[s]);if(!l){o=!1;const u=l2[s]||s;r+=`${u}(${c}) `}n&&(t[s]=c)}}return r=r.trim(),n?r=n(t,o?"":r):o&&(r="none"),r}function ah(e,t,n){const{style:r,vars:o,transformOrigin:i}=e;let s=!1,a=!1;for(const l in t){const c=t[l];if(Wi.has(l)){s=!0;continue}else if(ux(l)){o[l]=c;continue}else{const u=Lx(c,th[l]);l.startsWith("origin")?(a=!0,i[l]=u):r[l]=u}}if(t.transform||(s||n?r.transform=u2(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=i;r.transformOrigin=`${l} ${c} ${u}`}}const lh=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Kx(e,t,n){for(const r in t)!St(t[r])&&!Wx(r,n)&&(e[r]=t[r])}function d2({transformTemplate:e},t){return S.useMemo(()=>{const n=lh();return ah(n,t,e),Object.assign({},n.vars,n.style)},[t])}function f2(e,t){const n=e.style||{},r={};return Kx(r,n,e),Object.assign(r,d2(e,t)),r}function h2(e,t){const n={},r=f2(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const g2={offset:"stroke-dashoffset",array:"stroke-dasharray"},p2={offset:"strokeDashoffset",array:"strokeDasharray"};function m2(e,t,n=1,r=0,o=!0){e.pathLength=1;const i=o?g2:p2;e[i.offset]=he.transform(-r);const s=he.transform(t),a=he.transform(n);e[i.array]=`${s} ${a}`}function Ux(e,{attrX:t,attrY:n,attrScale:r,pathLength:o,pathSpacing:i=1,pathOffset:s=0,...a},l,c,u){if(ah(e,a,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:d}=e;f.transform&&(d.transform=f.transform,delete f.transform),(d.transform||f.transformOrigin)&&(d.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete f.transformBox),t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),o!==void 0&&m2(f,o,i,s,!1)}const Gx=()=>({...lh(),attrs:{}}),qx=e=>typeof e=="string"&&e.toLowerCase()==="svg";function y2(e,t,n,r){const o=S.useMemo(()=>{const i=Gx();return Ux(i,t,qx(r),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};Kx(i,e.style,e),o.style={...i,...o.style}}return o}const v2=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function ch(e){return typeof e!="string"||e.includes("-")?!1:!!(v2.indexOf(e)>-1||/[A-Z]/u.test(e))}function x2(e,t,n,{latestValues:r},o,i=!1){const a=(ch(e)?y2:h2)(t,r,o,e),l=o2(t,typeof e=="string",i),c=e!==S.Fragment?{...l,...a,ref:n}:{},{children:u}=t,f=S.useMemo(()=>St(u)?u.get():u,[u]);return S.createElement(e,{...c,children:f})}function yp(e){const t=[{},{}];return e?.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function uh(e,t,n,r){if(typeof t=="function"){const[o,i]=yp(r);t=t(n!==void 0?n:e.custom,o,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[o,i]=yp(r);t=t(n!==void 0?n:e.custom,o,i)}return t}function tl(e){return St(e)?e.get():e}function b2({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,o){return{latestValues:w2(n,r,o,e),renderState:t()}}function w2(e,t,n,r){const o={},i=r(e,{});for(const d in i)o[d]=tl(i[d]);let{initial:s,animate:a}=e;const l=Zl(e),c=Hx(e);t&&c&&!l&&e.inherit!==!1&&(s===void 0&&(s=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||s===!1;const f=u?a:s;if(f&&typeof f!="boolean"&&!Xl(f)){const d=Array.isArray(f)?f:[f];for(let h=0;h<d.length;h++){const g=uh(e,d[h]);if(g){const{transitionEnd:p,transition:m,...v}=g;for(const y in v){let x=v[y];if(Array.isArray(x)){const b=u?x.length-1:0;x=x[b]}x!==null&&(o[y]=x)}for(const y in p)o[y]=p[y]}}}return o}const Yx=e=>(t,n)=>{const r=S.useContext(Yl),o=S.useContext(ql),i=()=>b2(e,t,r,o);return n?i():Of(i)};function dh(e,t,n){const{style:r}=e,o={};for(const i in r)(St(r[i])||t.style&&St(t.style[i])||Wx(i,e)||n?.getValue(i)?.liveStyle!==void 0)&&(o[i]=r[i]);return o}const C2=Yx({scrapeMotionValuesFromProps:dh,createRenderState:lh});function Xx(e,t,n){const r=dh(e,t,n);for(const o in e)if(St(e[o])||St(t[o])){const i=Hi.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[i]=e[o]}return r}const S2=Yx({scrapeMotionValuesFromProps:Xx,createRenderState:Gx}),_2=Symbol.for("motionComponentSymbol");function yi(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function T2(e,t,n){return S.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):yi(n)&&(n.current=r))},[t])}const fh=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),E2="framerAppearId",Zx="data-"+fh(E2),Jx=S.createContext({});function R2(e,t,n,r,o){const{visualElement:i}=S.useContext(Yl),s=S.useContext(Bx),a=S.useContext(ql),l=S.useContext(oh).reducedMotion,c=S.useRef(null);r=r||s.renderer,!c.current&&r&&(c.current=r(e,{visualState:t,parent:i,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const u=c.current,f=S.useContext(Jx);u&&!u.projection&&o&&(u.type==="html"||u.type==="svg")&&k2(c.current,n,o,f);const d=S.useRef(!1);S.useInsertionEffect(()=>{u&&d.current&&u.update(n,a)});const h=n[Zx],g=S.useRef(!!h&&!window.MotionHandoffIsComplete?.(h)&&window.MotionHasOptimisedAnimation?.(h));return G0(()=>{u&&(d.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),g.current&&u.animationState&&u.animationState.animateChanges())}),S.useEffect(()=>{u&&(!g.current&&u.animationState&&u.animationState.animateChanges(),g.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(h)}),g.current=!1),u.enteringChildren=void 0)}),u}function k2(e,t,n,r){const{layoutId:o,layout:i,drag:s,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Qx(e.parent)),e.projection.setOptions({layoutId:o,layout:i,alwaysMeasureLayout:!!s||a&&yi(a),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:u,layoutScroll:l,layoutRoot:c})}function Qx(e){if(e)return e.options.allowProjection!==!1?e.projection:Qx(e.parent)}function Wc(e,{forwardMotionProps:t=!1}={},n,r){n&&t2(n);const o=ch(e)?S2:C2;function i(a,l){let c;const u={...S.useContext(oh),...a,layoutId:A2(a)},{isStatic:f}=u,d=s2(a),h=o(a,f);if(!f&&If){N2(u,n);const g=M2(u);c=g.MeasureLayout,d.visualElement=R2(e,h,u,r,g.ProjectionNode)}return C.jsxs(Yl.Provider,{value:d,children:[c&&d.visualElement?C.jsx(c,{visualElement:d.visualElement,...u}):null,x2(e,a,T2(h,d.visualElement,l),h,f,t)]})}i.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const s=S.forwardRef(i);return s[_2]=e,s}function A2({layoutId:e}){const t=S.useContext($f).id;return t&&e!==void 0?t+"-"+e:e}function N2(e,t){const n=S.useContext(Bx).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?Bi(!1,r,"lazy-strict-mode"):vr(!1,r,"lazy-strict-mode")}}function M2(e){const{drag:t,layout:n}=Li;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function P2(e,t){if(typeof Proxy>"u")return Wc;const n=new Map,r=(i,s)=>Wc(i,s,e,t),o=(i,s)=>(process.env.NODE_ENV!=="production"&&zf(!1,"motion() is deprecated. Use motion.create() instead."),r(i,s));return new Proxy(o,{get:(i,s)=>s==="create"?r:(n.has(s)||n.set(s,Wc(s,void 0,e,t)),n.get(s))})}function e1({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function L2({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function F2(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Kc(e){return e===void 0||e===1}function Cd({scale:e,scaleX:t,scaleY:n}){return!Kc(e)||!Kc(t)||!Kc(n)}function uo(e){return Cd(e)||t1(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function t1(e){return vp(e.x)||vp(e.y)}function vp(e){return e&&e!=="0%"}function vl(e,t,n){const r=e-n,o=t*r;return n+o}function xp(e,t,n,r,o){return o!==void 0&&(e=vl(e,o,r)),vl(e,n,r)+t}function Sd(e,t=0,n=1,r,o){e.min=xp(e.min,t,n,r,o),e.max=xp(e.max,t,n,r,o)}function n1(e,{x:t,y:n}){Sd(e.x,t.translate,t.scale,t.originPoint),Sd(e.y,n.translate,n.scale,n.originPoint)}const bp=.999999999999,wp=1.0000000000001;function $2(e,t,n,r=!1){const o=n.length;if(!o)return;t.x=t.y=1;let i,s;for(let a=0;a<o;a++){i=n[a],s=i.projectionDelta;const{visualElement:l}=i.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&xi(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,n1(e,s)),r&&uo(i.latestValues)&&xi(e,i.latestValues))}t.x<wp&&t.x>bp&&(t.x=1),t.y<wp&&t.y>bp&&(t.y=1)}function vi(e,t){e.min=e.min+t,e.max=e.max+t}function Cp(e,t,n,r,o=.5){const i=Je(e.min,e.max,o);Sd(e,t,n,i,r)}function xi(e,t){Cp(e.x,t.x,t.scaleX,t.scale,t.originX),Cp(e.y,t.y,t.scaleY,t.scale,t.originY)}function r1(e,t){return e1(F2(e.getBoundingClientRect(),t))}function O2(e,t,n){const r=r1(e,n),{scroll:o}=t;return o&&(vi(r.x,o.offset.x),vi(r.y,o.offset.y)),r}const Sp=()=>({translate:0,scale:1,origin:0,originPoint:0}),bi=()=>({x:Sp(),y:Sp()}),_p=()=>({min:0,max:0}),ct=()=>({x:_p(),y:_p()}),_d={current:null},o1={current:!1};function I2(){if(o1.current=!0,!!If)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>_d.current=e.matches;e.addEventListener("change",t),t()}else _d.current=!1}const D2=new WeakMap;function j2(e,t,n){for(const r in t){const o=t[r],i=n[r];if(St(o))e.addValue(r,o);else if(St(i))e.addValue(r,Pi(o,{owner:e}));else if(i!==o)if(e.hasValue(r)){const s=e.getValue(r);s.liveStyle===!0?s.jump(o):s.hasAnimated||s.set(o)}else{const s=e.getStaticValue(r);e.addValue(r,Pi(s!==void 0?s:o,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Tp=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class V2{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:o,blockInitialAnimation:i,visualState:s},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Qf,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const d=jt.now();this.renderScheduledAt<d&&(this.renderScheduledAt=d,Ue.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=s;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=a,this.blockInitialAnimation=!!i,this.isControllingVariants=Zl(n),this.isVariantNode=Hx(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const d in f){const h=f[d];l[d]!==void 0&&St(h)&&h.set(l[d])}}mount(t){this.current=t,D2.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),o1.current||I2(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:_d.current,process.env.NODE_ENV!=="production"&&zf(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),jr(this.notifyUpdate),jr(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=Wi.has(t);r&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",s=>{this.latestValues[t]=s,this.props.onUpdate&&Ue.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{o(),i&&i(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Li){const n=Li[t];if(!n)continue;const{isEnabled:r,Feature:o}=n;if(!this.features[t]&&o&&r(this.props)&&(this.features[t]=new o(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ct()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<Tp.length;r++){const o=Tp[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const i="on"+o,s=t[i];s&&(this.propEventSubscriptions[o]=this.on(o,s))}this.prevMotionValues=j2(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Pi(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(q0(r)||X0(r))?r=parseFloat(r):!qE(r)&&Vr.test(n)&&(r=Px(t,n)),this.setBaseTarget(t,St(r)?r.get():r)),St(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const i=uh(this.props,n,this.presenceContext?.custom);i&&(r=i[t])}if(n&&r!==void 0)return r;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!St(o)?o:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Bf),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){nh.render(this.render)}}class i1 extends V2{constructor(){super(...arguments),this.KeyframeResolver=OE}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;St(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function s1(e,{style:t,vars:n},r,o){const i=e.style;let s;for(s in t)i[s]=t[s];o?.applyProjectionStyles(i,r);for(s in n)i.setProperty(s,n[s])}function B2(e){return window.getComputedStyle(e)}class z2 extends i1{constructor(){super(...arguments),this.type="html",this.renderInstance=s1}readValueFromInstance(t,n){if(Wi.has(n))return this.projection?.isProjecting?gd(n):eE(t,n);{const r=B2(t),o=(ux(n)?r.getPropertyValue(n):r[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return r1(t,n)}build(t,n,r){ah(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return dh(t,n,r)}}const a1=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function H2(e,t,n,r){s1(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(a1.has(o)?o:fh(o),t.attrs[o])}class W2 extends i1{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ct}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Wi.has(n)){const r=Mx(n);return r&&r.default||0}return n=a1.has(n)?n:fh(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return Xx(t,n,r)}build(t,n,r){Ux(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,o){H2(t,n,r,o)}mount(t){this.isSVGTag=qx(t.tagName),super.mount(t)}}const K2=(e,t)=>ch(e)?new W2(t):new z2(t,{allowProjection:e!==S.Fragment});function Ci(e,t,n){const r=e.getProps();return uh(r,t,n!==void 0?n:r.custom,e)}const Td=e=>Array.isArray(e);function U2(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Pi(n))}function G2(e){return Td(e)?e[e.length-1]||0:e}function q2(e,t){const n=Ci(e,t);let{transitionEnd:r={},transition:o={},...i}=n||{};i={...i,...r};for(const s in i){const a=G2(i[s]);U2(e,s,a)}}function Y2(e){return!!(St(e)&&e.add)}function Ed(e,t){const n=e.getValue("willChange");if(Y2(n))return n.add(t);if(!n&&xr.WillChange){const r=new xr.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function l1(e){return e.props[Zx]}const X2=e=>e!==null;function Z2(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(X2),i=t&&n!=="loop"&&t%2===1?0:o.length-1;return o[i]}const J2={type:"spring",stiffness:500,damping:25,restSpeed:10},Q2=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),eR={type:"keyframes",duration:.8},tR={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},nR=(e,{keyframes:t})=>t.length>2?eR:Wi.has(e)?e.startsWith("scale")?Q2(t[1]):J2:tR;function rR({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:i,repeatType:s,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const hh=(e,t,n,r={},o,i)=>s=>{const a=eh(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-Tn(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:d=>{t.set(d),a.onUpdate&&a.onUpdate(d)},onComplete:()=>{s(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:i?void 0:o};rR(a)||Object.assign(u,nR(e,u)),u.duration&&(u.duration=Tn(u.duration)),u.repeatDelay&&(u.repeatDelay=Tn(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let f=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(xd(u),u.delay===0&&(f=!0)),(xr.instantAnimations||xr.skipAnimations)&&(f=!0,xd(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,f&&!i&&t.get()!==void 0){const d=Z2(u.keyframes,a);if(d!==void 0){Ue.update(()=>{u.onUpdate(d),u.onComplete()});return}}return a.isSync?new Jf(u):new SE(u)};function oR({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function c1(e,t,{delay:n=0,transitionOverride:r,type:o}={}){let{transition:i=e.getDefaultTransition(),transitionEnd:s,...a}=t;r&&(i=r);const l=[],c=o&&e.animationState&&e.animationState.getState()[o];for(const u in a){const f=e.getValue(u,e.latestValues[u]??null),d=a[u];if(d===void 0||c&&oR(c,u))continue;const h={delay:n,...eh(i||{},u)},g=f.get();if(g!==void 0&&!f.isAnimating&&!Array.isArray(d)&&d===g&&!h.velocity)continue;let p=!1;if(window.MotionHandoffAnimation){const v=l1(e);if(v){const y=window.MotionHandoffAnimation(v,u,Ue);y!==null&&(h.startTime=y,p=!0)}}Ed(e,u),f.start(hh(u,f,d,e.shouldReduceMotion&&kx.has(u)?{type:!1}:h,e,p));const m=f.animation;m&&l.push(m)}return s&&Promise.all(l).then(()=>{Ue.update(()=>{s&&q2(e,s)})}),l}function u1(e,t,n,r=0,o=1){const i=Array.from(e).sort((c,u)=>c.sortNodePosition(u)).indexOf(t),s=e.size,a=(s-1)*r;return typeof n=="function"?n(i,s):o===1?i*r:a-i*r}function Rd(e,t,n={}){const r=Ci(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);const i=r?()=>Promise.all(c1(e,r,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:c=0,staggerChildren:u,staggerDirection:f}=o;return iR(e,t,l,c,u,f,n)}:()=>Promise.resolve(),{when:a}=o;if(a){const[l,c]=a==="beforeChildren"?[i,s]:[s,i];return l().then(()=>c())}else return Promise.all([i(),s(n.delay)])}function iR(e,t,n=0,r=0,o=0,i=1,s){const a=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),a.push(Rd(l,t,{...s,delay:n+(typeof r=="function"?0:r)+u1(e.variantChildren,l,r,o,i)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(a)}function sR(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(i=>Rd(e,i,n));r=Promise.all(o)}else if(typeof t=="string")r=Rd(e,t,n);else{const o=typeof t=="function"?Ci(e,t,n.custom):t;r=Promise.all(c1(e,o,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function d1(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const aR=sh.length;function f1(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?f1(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<aR;n++){const r=sh[n],o=e.props[r];(js(o)||o===!1)&&(t[r]=o)}return t}const lR=[...ih].reverse(),cR=ih.length;function uR(e){return t=>Promise.all(t.map(({animation:n,options:r})=>sR(e,n,r)))}function dR(e){let t=uR(e),n=Ep(),r=!0;const o=l=>(c,u)=>{const f=Ci(e,u,l==="exit"?e.presenceContext?.custom:void 0);if(f){const{transition:d,transitionEnd:h,...g}=f;c={...c,...g,...h}}return c};function i(l){t=l(e)}function s(l){const{props:c}=e,u=f1(e.parent)||{},f=[],d=new Set;let h={},g=1/0;for(let m=0;m<cR;m++){const v=lR[m],y=n[v],x=c[v]!==void 0?c[v]:u[v],b=js(x),w=v===l?y.isActive:null;w===!1&&(g=m);let _=x===u[v]&&x!==c[v]&&b;if(_&&r&&e.manuallyAnimateOnMount&&(_=!1),y.protectedKeys={...h},!y.isActive&&w===null||!x&&!y.prevProp||Xl(x)||typeof x=="boolean")continue;const E=fR(y.prevProp,x);let R=E||v===l&&y.isActive&&!_&&b||m>g&&b,k=!1;const P=Array.isArray(x)?x:[x];let F=P.reduce(o(v),{});w===!1&&(F={});const{prevResolvedValues:$={}}=y,j={...$,...F},O=I=>{R=!0,d.has(I)&&(k=!0,d.delete(I)),y.needsAnimating[I]=!0;const M=e.getValue(I);M&&(M.liveStyle=!1)};for(const I in j){const M=F[I],H=$[I];if(h.hasOwnProperty(I))continue;let U=!1;Td(M)&&Td(H)?U=!d1(M,H):U=M!==H,U?M!=null?O(I):d.add(I):M!==void 0&&d.has(I)?O(I):y.protectedKeys[I]=!0}y.prevProp=x,y.prevResolvedValues=F,y.isActive&&(h={...h,...F}),r&&e.blockInitialAnimation&&(R=!1);const D=_&&E;R&&(!D||k)&&f.push(...P.map(I=>{const M={type:v};if(typeof I=="string"&&r&&!D&&e.manuallyAnimateOnMount&&e.parent){const{parent:H}=e,U=Ci(H,I);if(H.enteringChildren&&U){const{delayChildren:re}=U.transition||{};M.delay=u1(H.enteringChildren,e,re)}}return{animation:I,options:M}}))}if(d.size){const m={};if(typeof c.initial!="boolean"){const v=Ci(e,Array.isArray(c.initial)?c.initial[0]:c.initial);v&&v.transition&&(m.transition=v.transition)}d.forEach(v=>{const y=e.getBaseTarget(v),x=e.getValue(v);x&&(x.liveStyle=!0),m[v]=y??null}),f.push({animation:m})}let p=!!f.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,p?t(f):Promise.resolve()}function a(l,c){if(n[l].isActive===c)return Promise.resolve();e.variantChildren?.forEach(f=>f.animationState?.setActive(l,c)),n[l].isActive=c;const u=s(l);for(const f in n)n[f].protectedKeys={};return u}return{animateChanges:s,setActive:a,setAnimateFunction:i,getState:()=>n,reset:()=>{n=Ep()}}}function fR(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!d1(t,e):!1}function so(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ep(){return{animate:so(!0),whileInView:so(),whileHover:so(),whileTap:so(),whileDrag:so(),whileFocus:so(),exit:so()}}class Zr{constructor(t){this.isMounted=!1,this.node=t}update(){}}class hR extends Zr{constructor(t){super(t),t.animationState||(t.animationState=dR(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Xl(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let gR=0;class pR extends Zr{constructor(){super(...arguments),this.id=gR++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const o=this.node.animationState.setActive("exit",!t);n&&!t&&o.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const mR={animation:{Feature:hR},exit:{Feature:pR}};function Vs(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Qs(e){return{point:{x:e.pageX,y:e.pageY}}}const yR=e=>t=>rh(t)&&e(t,Qs(t));function Es(e,t,n,r){return Vs(e,t,yR(n),r)}const h1=1e-4,vR=1-h1,xR=1+h1,g1=.01,bR=0-g1,wR=0+g1;function Pt(e){return e.max-e.min}function CR(e,t,n){return Math.abs(e-t)<=n}function Rp(e,t,n,r=.5){e.origin=r,e.originPoint=Je(t.min,t.max,e.origin),e.scale=Pt(n)/Pt(t),e.translate=Je(n.min,n.max,e.origin)-e.originPoint,(e.scale>=vR&&e.scale<=xR||isNaN(e.scale))&&(e.scale=1),(e.translate>=bR&&e.translate<=wR||isNaN(e.translate))&&(e.translate=0)}function Rs(e,t,n,r){Rp(e.x,t.x,n.x,r?r.originX:void 0),Rp(e.y,t.y,n.y,r?r.originY:void 0)}function kp(e,t,n){e.min=n.min+t.min,e.max=e.min+Pt(t)}function SR(e,t,n){kp(e.x,t.x,n.x),kp(e.y,t.y,n.y)}function Ap(e,t,n){e.min=t.min-n.min,e.max=e.min+Pt(t)}function xl(e,t,n){Ap(e.x,t.x,n.x),Ap(e.y,t.y,n.y)}function sn(e){return[e("x"),e("y")]}const p1=({current:e})=>e?e.ownerDocument.defaultView:null,Np=(e,t)=>Math.abs(e-t);function _R(e,t){const n=Np(e.x,t.x),r=Np(e.y,t.y);return Math.sqrt(n**2+r**2)}class m1{constructor(t,n,{transformPagePoint:r,contextWindow:o=window,dragSnapToOrigin:i=!1,distanceThreshold:s=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=Gc(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,g=_R(d.offset,{x:0,y:0})>=this.distanceThreshold;if(!h&&!g)return;const{point:p}=d,{timestamp:m}=mt;this.history.push({...p,timestamp:m});const{onStart:v,onMove:y}=this.handlers;h||(v&&v(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,d)},this.handlePointerMove=(d,h)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=Uc(h,this.transformPagePoint),Ue.update(this.updatePoint,!0)},this.handlePointerUp=(d,h)=>{this.end();const{onEnd:g,onSessionEnd:p,resumeAnimation:m}=this.handlers;if(this.dragSnapToOrigin&&m&&m(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=Gc(d.type==="pointercancel"?this.lastMoveEventInfo:Uc(h,this.transformPagePoint),this.history);this.startEvent&&g&&g(d,v),p&&p(d,v)},!rh(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=s,this.contextWindow=o||window;const a=Qs(t),l=Uc(a,this.transformPagePoint),{point:c}=l,{timestamp:u}=mt;this.history=[{...c,timestamp:u}];const{onSessionStart:f}=n;f&&f(t,Gc(l,this.history)),this.removeListeners=Xs(Es(this.contextWindow,"pointermove",this.handlePointerMove),Es(this.contextWindow,"pointerup",this.handlePointerUp),Es(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),jr(this.updatePoint)}}function Uc(e,t){return t?{point:t(e.point)}:e}function Mp(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Gc({point:e},t){return{point:e,delta:Mp(e,y1(t)),offset:Mp(e,TR(t)),velocity:ER(t,.1)}}function TR(e){return e[0]}function y1(e){return e[e.length-1]}function ER(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=y1(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>Tn(t)));)n--;if(!r)return{x:0,y:0};const i=ln(o.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const s={x:(o.x-r.x)/i,y:(o.y-r.y)/i};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function RR(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Je(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Je(n,e,r.max):Math.min(e,n)),e}function Pp(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function kR(e,{top:t,left:n,bottom:r,right:o}){return{x:Pp(e.x,n,o),y:Pp(e.y,t,r)}}function Lp(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function AR(e,t){return{x:Lp(e.x,t.x),y:Lp(e.y,t.y)}}function NR(e,t){let n=.5;const r=Pt(e),o=Pt(t);return o>r?n=Os(t.min,t.max-r,e.min):r>o&&(n=Os(e.min,e.max-o,t.min)),yr(0,1,n)}function MR(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const kd=.35;function PR(e=kd){return e===!1?e=0:e===!0&&(e=kd),{x:Fp(e,"left","right"),y:Fp(e,"top","bottom")}}function Fp(e,t,n){return{min:$p(e,t),max:$p(e,n)}}function $p(e,t){return typeof e=="number"?e:e[t]||0}const LR=new WeakMap;class FR{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ct(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const i=f=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Qs(f).point)},s=(f,d)=>{const{drag:h,dragPropagation:g,onDragStart:p}=this.getProps();if(h&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=VE(h),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=d,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),sn(v=>{let y=this.getAxisMotionValue(v).get()||0;if(Hn.test(y)){const{projection:x}=this.visualElement;if(x&&x.layout){const b=x.layout.layoutBox[v];b&&(y=Pt(b)*(parseFloat(y)/100))}}this.originPoint[v]=y}),p&&Ue.postRender(()=>p(f,d)),Ed(this.visualElement,"transform");const{animationState:m}=this.visualElement;m&&m.setActive("whileDrag",!0)},a=(f,d)=>{this.latestPointerEvent=f,this.latestPanInfo=d;const{dragPropagation:h,dragDirectionLock:g,onDirectionLock:p,onDrag:m}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:v}=d;if(g&&this.currentDirection===null){this.currentDirection=$R(v),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",d.point,v),this.updateAxis("y",d.point,v),this.visualElement.render(),m&&m(f,d)},l=(f,d)=>{this.latestPointerEvent=f,this.latestPanInfo=d,this.stop(f,d),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>sn(f=>this.getAnimationState(f)==="paused"&&this.getAxisMotionValue(f).animation?.play()),{dragSnapToOrigin:u}=this.getProps();this.panSession=new m1(t,{onSessionStart:i,onStart:s,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:r,contextWindow:p1(this.visualElement)})}stop(t,n){const r=t||this.latestPointerEvent,o=n||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!o||!r)return;const{velocity:s}=o;this.startAnimation(s);const{onDragEnd:a}=this.getProps();a&&Ue.postRender(()=>a(r,o))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:o}=this.getProps();if(!r||!Ta(t,o,this.currentDirection))return;const i=this.getAxisMotionValue(t);let s=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(s=RR(s,this.constraints[t],this.elastic[t])),i.set(s)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,o=this.constraints;t&&yi(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=kR(r.layoutBox,t):this.constraints=!1,this.elastic=PR(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&sn(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=MR(r.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!yi(t))return!1;const r=t.current;vr(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const i=O2(r,o.root,this.visualElement.getTransformPagePoint());let s=AR(o.layout.layoutBox,i);if(n){const a=n(L2(s));this.hasMutatedConstraints=!!a,a&&(s=e1(a))}return s}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:i,dragSnapToOrigin:s,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=sn(u=>{if(!Ta(u,n,this.currentDirection))return;let f=l&&l[u]||{};s&&(f={min:0,max:0});const d=o?200:1e6,h=o?40:1e7,g={type:"inertia",velocity:r?t[u]:0,bounceStiffness:d,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(u,g)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Ed(this.visualElement,t),r.start(hh(t,r,0,n,this.visualElement,!1))}stopAnimation(){sn(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){sn(t=>this.getAxisMotionValue(t).animation?.pause())}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),o=r[n];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){sn(n=>{const{drag:r}=this.getProps();if(!Ta(n,r,this.currentDirection))return;const{projection:o}=this.visualElement,i=this.getAxisMotionValue(n);if(o&&o.layout){const{min:s,max:a}=o.layout.layoutBox[n];i.set(t[n]-Je(s,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!yi(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};sn(s=>{const a=this.getAxisMotionValue(s);if(a&&this.constraints!==!1){const l=a.get();o[s]=NR({min:l,max:l},this.constraints[s])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),sn(s=>{if(!Ta(s,t,null))return;const a=this.getAxisMotionValue(s),{min:l,max:c}=this.constraints[s];a.set(Je(l,c,o[s]))})}addListeners(){if(!this.visualElement.current)return;LR.set(this.visualElement,this);const t=this.visualElement.current,n=Es(t,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();yi(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,i=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),Ue.read(r);const s=Vs(window,"resize",()=>this.scalePositionWithinConstraints()),a=o.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(sn(u=>{const f=this.getAxisMotionValue(u);f&&(this.originPoint[u]+=l[u].translate,f.set(f.get()+l[u].translate))}),this.visualElement.render())}));return()=>{s(),n(),i(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:i=!1,dragElastic:s=kd,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:i,dragElastic:s,dragMomentum:a}}}function Ta(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function $R(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class OR extends Zr{constructor(t){super(t),this.removeGroupControls=cn,this.removeListeners=cn,this.controls=new FR(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||cn}unmount(){this.removeGroupControls(),this.removeListeners()}}const Op=e=>(t,n)=>{e&&Ue.postRender(()=>e(t,n))};class IR extends Zr{constructor(){super(...arguments),this.removePointerDownListener=cn}onPointerDown(t){this.session=new m1(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:p1(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:Op(t),onStart:Op(n),onMove:r,onEnd:(i,s)=>{delete this.session,o&&Ue.postRender(()=>o(i,s))}}}mount(){this.removePointerDownListener=Es(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const nl={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let qc=!1;class DR extends S.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:i}=t;i&&(n.group&&n.group.add(i),r&&r.register&&o&&r.register(i),qc&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),nl.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:o,isPresent:i}=this.props,{projection:s}=r;return s&&(s.isPresent=i,qc=!0,o||t.layoutDependency!==n||n===void 0||t.isPresent!==i?s.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?s.promote():s.relegate()||Ue.postRender(()=>{const a=s.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),nh.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=t;qc=!0,o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function v1(e){const[t,n]=jx(),r=S.useContext($f);return C.jsx(DR,{...e,layoutGroup:r,switchLayoutGroup:S.useContext(Jx),isPresent:t,safeToRemove:n})}function jR(e,t,n){const r=St(e)?e:Pi(e);return r.start(hh("",r,t,n)),r.animation}const VR=(e,t)=>e.depth-t.depth;class BR{constructor(){this.children=[],this.isDirty=!1}add(t){Df(this.children,t),this.isDirty=!0}remove(t){jf(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(VR),this.isDirty=!1,this.children.forEach(t)}}function zR(e,t){const n=jt.now(),r=({timestamp:o})=>{const i=o-n;i>=t&&(jr(r),e(i-t))};return Ue.setup(r,!0),()=>jr(r)}const x1=["TopLeft","TopRight","BottomLeft","BottomRight"],HR=x1.length,Ip=e=>typeof e=="string"?parseFloat(e):e,Dp=e=>typeof e=="number"||he.test(e);function WR(e,t,n,r,o,i){o?(e.opacity=Je(0,n.opacity??1,KR(r)),e.opacityExit=Je(t.opacity??1,0,UR(r))):i&&(e.opacity=Je(t.opacity??1,n.opacity??1,r));for(let s=0;s<HR;s++){const a=`border${x1[s]}Radius`;let l=jp(t,a),c=jp(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||Dp(l)===Dp(c)?(e[a]=Math.max(Je(Ip(l),Ip(c),r),0),(Hn.test(c)||Hn.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=Je(t.rotate||0,n.rotate||0,r))}function jp(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const KR=b1(0,.5,ox),UR=b1(.5,.95,cn);function b1(e,t,n){return r=>r<e?0:r>t?1:n(Os(e,t,r))}function Vp(e,t){e.min=t.min,e.max=t.max}function mn(e,t){Vp(e.x,t.x),Vp(e.y,t.y)}function Bp(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function zp(e,t,n,r,o){return e-=t,e=vl(e,1/n,r),o!==void 0&&(e=vl(e,1/o,r)),e}function GR(e,t=0,n=1,r=.5,o,i=e,s=e){if(Hn.test(t)&&(t=parseFloat(t),t=Je(s.min,s.max,t/100)-s.min),typeof t!="number")return;let a=Je(i.min,i.max,r);e===i&&(a-=t),e.min=zp(e.min,t,n,a,o),e.max=zp(e.max,t,n,a,o)}function Hp(e,t,[n,r,o],i,s){GR(e,t[n],t[r],t[o],t.scale,i,s)}const qR=["x","scaleX","originX"],YR=["y","scaleY","originY"];function Wp(e,t,n,r){Hp(e.x,t,qR,n?n.x:void 0,r?r.x:void 0),Hp(e.y,t,YR,n?n.y:void 0,r?r.y:void 0)}function Kp(e){return e.translate===0&&e.scale===1}function w1(e){return Kp(e.x)&&Kp(e.y)}function Up(e,t){return e.min===t.min&&e.max===t.max}function XR(e,t){return Up(e.x,t.x)&&Up(e.y,t.y)}function Gp(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function C1(e,t){return Gp(e.x,t.x)&&Gp(e.y,t.y)}function qp(e){return Pt(e.x)/Pt(e.y)}function Yp(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class ZR{constructor(){this.members=[]}add(t){Df(this.members,t),t.scheduleRender()}remove(t){if(jf(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(o=>t===o);if(n===0)return!1;let r;for(let o=n;o>=0;o--){const i=this.members[o];if(i.isPresent!==!1){r=i;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;o===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function JR(e,t,n){let r="";const o=e.x.translate/t.x,i=e.y.translate/t.y,s=n?.z||0;if((o||i||s)&&(r=`translate3d(${o}px, ${i}px, ${s}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:f,rotateY:d,skewX:h,skewY:g}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),f&&(r+=`rotateX(${f}deg) `),d&&(r+=`rotateY(${d}deg) `),h&&(r+=`skewX(${h}deg) `),g&&(r+=`skewY(${g}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const Yc=["","X","Y","Z"],QR=1e3;let ek=0;function Xc(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function S1(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=l1(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Ue,!(o||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&S1(r)}function _1({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(s={},a=t?.()){this.id=ek++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(rk),this.nodes.forEach(ak),this.nodes.forEach(lk),this.nodes.forEach(ok)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new BR)}addEventListener(s,a){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new Bf),this.eventHandlers.get(s).add(a)}notifyListeners(s,...a){const l=this.eventHandlers.get(s);l&&l.notify(...a)}hasListeners(s){return this.eventHandlers.has(s)}mount(s){if(this.instance)return;this.isSVG=Dx(s)&&!UE(s),this.instance=s;const{layoutId:a,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),e){let u,f=0;const d=()=>this.root.updateBlockedByResize=!1;Ue.read(()=>{f=window.innerWidth}),e(s,()=>{const h=window.innerWidth;h!==f&&(f=h,this.root.updateBlockedByResize=!0,u&&u(),u=zR(d,250),nl.hasAnimatedSinceResize&&(nl.hasAnimatedSinceResize=!1,this.nodes.forEach(Jp)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:f,hasRelativeLayoutChanged:d,layout:h})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||c.getDefaultTransition()||hk,{onLayoutAnimationStart:p,onLayoutAnimationComplete:m}=c.getProps(),v=!this.targetLayout||!C1(this.targetLayout,h),y=!f&&d;if(this.options.layoutRoot||this.resumeFrom||y||f&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const x={...eh(g,"layout"),onPlay:p,onComplete:m};(c.shouldReduceMotion||this.options.layoutRoot)&&(x.delay=0,x.type=!1),this.startAnimation(x),this.setAnimationOrigin(u,y)}else f||Jp(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=h})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),jr(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(ck),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&S1(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const f=this.path[u];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Xp);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Zp);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(sk),this.nodes.forEach(tk),this.nodes.forEach(nk)):this.nodes.forEach(Zp),this.clearAllSnapshots();const a=jt.now();mt.delta=yr(0,1e3/60,a-mt.timestamp),mt.timestamp=a,mt.isProcessing=!0,Dc.update.process(mt),Dc.preRender.process(mt),Dc.render.process(mt),mt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,nh.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ik),this.sharedNodes.forEach(uk)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Ue.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Ue.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Pt(this.snapshot.measuredBox.x)&&!Pt(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const s=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=ct(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,s?s.layoutBox:void 0)}updateScroll(s="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(a=!1),a&&this.instance){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!o)return;const s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!w1(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;s&&this.instance&&(a||uo(this.latestValues)||u)&&(o(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return s&&(l=this.removeTransform(l)),gk(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:s}=this.options;if(!s)return ct();const a=s.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(pk))){const{scroll:c}=this.root;c&&(vi(a.x,c.offset.x),vi(a.y,c.offset.y))}return a}removeElementScroll(s){const a=ct();if(mn(a,s),this.scroll?.wasRoot)return a;for(let l=0;l<this.path.length;l++){const c=this.path[l],{scroll:u,options:f}=c;c!==this.root&&u&&f.layoutScroll&&(u.wasRoot&&mn(a,s),vi(a.x,u.offset.x),vi(a.y,u.offset.y))}return a}applyTransform(s,a=!1){const l=ct();mn(l,s);for(let c=0;c<this.path.length;c++){const u=this.path[c];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&xi(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),uo(u.latestValues)&&xi(l,u.latestValues)}return uo(this.latestValues)&&xi(l,this.latestValues),l}removeTransform(s){const a=ct();mn(a,s);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!uo(c.latestValues))continue;Cd(c.latestValues)&&c.updateSnapshot();const u=ct(),f=c.measurePageBox();mn(u,f),Wp(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return uo(this.latestValues)&&Wp(a,this.latestValues),a}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==mt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(s||l&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:f}=this.options;if(!this.layout||!(u||f))return;this.resolvedRelativeTargetAt=mt.timestamp;const d=this.getClosestProjectingParent();d&&this.linkedParentVersion!==d.layoutVersion&&!d.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(d&&d.layout?this.createRelativeTarget(d,this.layout.layoutBox,d.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=ct(),this.targetWithTransforms=ct()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),SR(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):mn(this.target,this.layout.layoutBox),n1(this.target,this.targetDelta)):mn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,d&&!!d.resumingFrom==!!this.resumingFrom&&!d.options.layoutScroll&&d.target&&this.animationProgress!==1?this.createRelativeTarget(d,this.target,d.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Cd(this.parent.latestValues)||t1(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(s,a,l){this.relativeParent=s,this.linkedParentVersion=s.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ct(),this.relativeTargetOrigin=ct(),xl(this.relativeTargetOrigin,a,l),mn(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const s=this.getLead(),a=!!this.resumingFrom||this!==s;let l=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===mt.timestamp&&(l=!1),l)return;const{layout:c,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||u))return;mn(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,d=this.treeScale.y;$2(this.layoutCorrected,this.treeScale,this.path,a),s.layout&&!s.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(s.target=s.layout.layoutBox,s.targetWithTransforms=ct());const{target:h}=s;if(!h){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Bp(this.prevProjectionDelta.x,this.projectionDelta.x),Bp(this.prevProjectionDelta.y,this.projectionDelta.y)),Rs(this.projectionDelta,this.layoutCorrected,h,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==d||!Yp(this.projectionDelta.x,this.prevProjectionDelta.x)||!Yp(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",h))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){if(this.options.visualElement?.scheduleRender(),s){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=bi(),this.projectionDelta=bi(),this.projectionDeltaWithTransform=bi()}setAnimationOrigin(s,a=!1){const l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},f=bi();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const d=ct(),h=l?l.source:void 0,g=this.layout?this.layout.source:void 0,p=h!==g,m=this.getStack(),v=!m||m.members.length<=1,y=!!(p&&!v&&this.options.crossfade===!0&&!this.path.some(fk));this.animationProgress=0;let x;this.mixTargetDelta=b=>{const w=b/1e3;Qp(f.x,s.x,w),Qp(f.y,s.y,w),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(xl(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox),dk(this.relativeTarget,this.relativeTargetOrigin,d,w),x&&XR(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=ct()),mn(x,this.relativeTarget)),p&&(this.animationValues=u,WR(u,c,this.latestValues,w,y,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=w},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(jr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ue.update(()=>{nl.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Pi(0)),this.currentAnimation=jR(this.motionValue,[0,1e3],{...s,velocity:0,isSync:!0,onUpdate:a=>{this.mixTargetDelta(a),s.onUpdate&&s.onUpdate(a)},onStop:()=>{},onComplete:()=>{s.onComplete&&s.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(QR),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=s;if(!(!a||!l||!c)){if(this!==s&&this.layout&&c&&T1(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||ct();const f=Pt(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+f;const d=Pt(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+d}mn(a,l),xi(a,u),Rs(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(s,a){this.sharedNodes.has(s)||this.sharedNodes.set(s,new ZR),this.sharedNodes.get(s).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){const{layoutId:s}=this.options;return s?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:s}=this.options;return s?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),s&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let a=!1;const{latestValues:l}=s;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&Xc("z",s,c,this.animationValues);for(let u=0;u<Yc.length;u++)Xc(`rotate${Yc[u]}`,s,c,this.animationValues),Xc(`skew${Yc[u]}`,s,c,this.animationValues);s.render();for(const u in c)s.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);s.scheduleRender()}applyProjectionStyles(s,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){s.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,s.visibility="",s.opacity="",s.pointerEvents=tl(a?.pointerEvents)||"",s.transform=l?l(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(s.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,s.pointerEvents=tl(a?.pointerEvents)||""),this.hasProjected&&!uo(this.latestValues)&&(s.transform=l?l({},""):"none",this.hasProjected=!1);return}s.visibility="";const u=c.animationValues||c.latestValues;this.applyTransformsToTarget();let f=JR(this.projectionDeltaWithTransform,this.treeScale,u);l&&(f=l(u,f)),s.transform=f;const{x:d,y:h}=this.projectionDelta;s.transformOrigin=`${d.origin*100}% ${h.origin*100}% 0`,c.animationValues?s.opacity=c===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:s.opacity=c===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const g in wd){if(u[g]===void 0)continue;const{correct:p,applyTo:m,isCSSVariable:v}=wd[g],y=f==="none"?u[g]:p(u[g],c);if(m){const x=m.length;for(let b=0;b<x;b++)s[m[b]]=y}else v?this.options.visualElement.renderState.vars[g]=y:s[g]=y}this.options.layoutId&&(s.pointerEvents=c===this?tl(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>s.currentAnimation?.stop()),this.root.nodes.forEach(Xp),this.root.sharedNodes.clear()}}}function tk(e){e.updateLayout()}function nk(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:r}=e.layout,{animationType:o}=e.options,i=t.source!==e.layout.source;o==="size"?sn(u=>{const f=i?t.measuredBox[u]:t.layoutBox[u],d=Pt(f);f.min=n[u].min,f.max=f.min+d}):T1(o,t.layoutBox,n)&&sn(u=>{const f=i?t.measuredBox[u]:t.layoutBox[u],d=Pt(n[u]);f.max=f.min+d,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[u].max=e.relativeTarget[u].min+d)});const s=bi();Rs(s,n,t.layoutBox);const a=bi();i?Rs(a,e.applyTransform(r,!0),t.measuredBox):Rs(a,n,t.layoutBox);const l=!w1(s);let c=!1;if(!e.resumeFrom){const u=e.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:f,layout:d}=u;if(f&&d){const h=ct();xl(h,t.layoutBox,f.layoutBox);const g=ct();xl(g,n,d.layoutBox),C1(h,g)||(c=!0),u.options.layoutRoot&&(e.relativeTarget=g,e.relativeTargetOrigin=h,e.relativeParent=u)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:a,layoutDelta:s,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function rk(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function ok(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function ik(e){e.clearSnapshot()}function Xp(e){e.clearMeasurements()}function Zp(e){e.isLayoutDirty=!1}function sk(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Jp(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function ak(e){e.resolveTargetDelta()}function lk(e){e.calcProjection()}function ck(e){e.resetSkewAndRotation()}function uk(e){e.removeLeadSnapshot()}function Qp(e,t,n){e.translate=Je(t.translate,0,n),e.scale=Je(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function em(e,t,n,r){e.min=Je(t.min,n.min,r),e.max=Je(t.max,n.max,r)}function dk(e,t,n,r){em(e.x,t.x,n.x,r),em(e.y,t.y,n.y,r)}function fk(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const hk={duration:.45,ease:[.4,0,.1,1]},tm=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),nm=tm("applewebkit/")&&!tm("chrome/")?Math.round:cn;function rm(e){e.min=nm(e.min),e.max=nm(e.max)}function gk(e){rm(e.x),rm(e.y)}function T1(e,t,n){return e==="position"||e==="preserve-aspect"&&!CR(qp(t),qp(n),.2)}function pk(e){return e!==e.root&&e.scroll?.wasRoot}const mk=_1({attachResizeListener:(e,t)=>Vs(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Zc={current:void 0},E1=_1({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Zc.current){const e=new mk({});e.mount(window),e.setOptions({layoutScroll:!0}),Zc.current=e}return Zc.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),yk={pan:{Feature:IR},drag:{Feature:OR,ProjectionNode:E1,MeasureLayout:v1}};function om(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,i=r[o];i&&Ue.postRender(()=>i(t,Qs(t)))}class vk extends Zr{mount(){const{current:t}=this.node;t&&(this.unmount=BE(t,(n,r)=>(om(this.node,r,"Start"),o=>om(this.node,o,"End"))))}unmount(){}}class xk extends Zr{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Xs(Vs(this.node.current,"focus",()=>this.onFocus()),Vs(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function im(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),i=r[o];i&&Ue.postRender(()=>i(t,Qs(t)))}class bk extends Zr{mount(){const{current:t}=this.node;t&&(this.unmount=KE(t,(n,r)=>(im(this.node,r,"Start"),(o,{success:i})=>im(this.node,o,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Ad=new WeakMap,Jc=new WeakMap,wk=e=>{const t=Ad.get(e.target);t&&t(e)},Ck=e=>{e.forEach(wk)};function Sk({root:e,...t}){const n=e||document;Jc.has(n)||Jc.set(n,{});const r=Jc.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(Ck,{root:e,...t})),r[o]}function _k(e,t,n){const r=Sk(t);return Ad.set(e,n),r.observe(e),()=>{Ad.delete(e),r.unobserve(e)}}const Tk={some:0,all:1};class Ek extends Zr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:i}=t,s={root:n?n.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:Tk[o]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,i&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:f}=this.node.getProps(),d=c?u:f;d&&d(l)};return _k(this.node.current,s,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Rk(t,n))&&this.startObserver()}unmount(){}}function Rk({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const kk={inView:{Feature:Ek},tap:{Feature:bk},focus:{Feature:xk},hover:{Feature:vk}},Ak={layout:{ProjectionNode:E1,MeasureLayout:v1}},Nk={...mR,...kk,...yk,...Ak},ea=P2(Nk,K2),yn={fontFamily:"Inter, sans-serif",wordBreak:"break-word"},xe={common:yn,title1:{...yn,fontSize:32,lineHeight:"36px",[vs.md()]:{fontSize:24}},title2:{...yn,fontSize:24,lineHeight:"28px",[vs.md()]:{fontSize:20}},title3:{...yn,fontSize:20,lineHeight:"28px",[vs.md()]:{fontSize:18},[vs.xs()]:{fontSize:16}},headline1:{...yn,fontSize:22,lineHeight:"26px"},headline2:{...yn,fontSize:18,lineHeight:"22px"},headline3:{...yn,fontSize:16,lineHeight:"20px"},body1:{...yn,fontSize:16,lineHeight:"24px"},body2:{...yn,fontSize:14,lineHeight:"20px"},caption1:{...yn,fontSize:12,lineHeight:"16px"},caption2:{...yn,fontSize:10,lineHeight:"14px"}},{transition:Mk,color:er,fontWeight:Ea}=V,Ra={text:T.css({transition:Mk.general}),inherit:T.css({}),"title-1":T.css({...xe.title1}),"title-2":T.css({...xe.title2}),"title-3":T.css({...xe.title3}),"headline-1":T.css({...xe.headline1}),"headline-2":T.css({...xe.headline2}),"headline-3":T.css({...xe.headline3}),"body-1":T.css({...xe.body1}),"body-2":T.css({...xe.body2}),"caption-1":T.css({...xe.caption1}),"caption-2":T.css({...xe.caption2}),primary:T.css({color:er.text.primary}),secondary:T.css({color:er.text.secondary}),tertiary:T.css({color:er.text.tertiary}),positive:T.css({color:er.text.positive}),negative:T.css({color:er.text.negative}),warning:T.css({color:er.text.warning}),accent:T.css({color:er.text.accent}),inverse:T.css({color:er.text.inverse}),transfer:T.css({color:er.text.transfer}),regular:T.css({fontWeight:Ea.regular}),medium:T.css({fontWeight:Ea.medium}),semibold:T.css({fontWeight:Ea.semibold}),bold:T.css({fontWeight:Ea.bold})},Pk=e=>{let t;e.center?t="center":e.left?t="left":e.right&&(t="right");let n;return e.uppercase?n="uppercase":e.lowercase?n="lowercase":e.capitalize&&(n="capitalize"),T.css({marginTop:e.mt,marginBottom:e.mb,marginRight:e.mr,marginLeft:e.ml,flex:e.flex,cursor:e.cursor,wordBreak:e.wordBreak,whiteSpace:e.whiteSpace,textOverflow:e.textOverflow,textDecoration:e.decoration,textAlign:t,textTransform:n,color:e.color,opacity:e.disabled?.5:void 0,overflow:e.overflow})},le=S.forwardRef(({children:e,className:t,variant:n="body-1",fontWeight:r="medium",tag:o="p",colorName:i="primary",inherit:s=!1,style:a,clickOpacity:l=.5,opacityDuration:c=200,onClick:u,disabled:f,mt:d,mb:h,ml:g,mr:p,flex:m,cursor:v,wordBreak:y,whiteSpace:x,textOverflow:b,decoration:w,color:_,center:E,left:R,right:k,uppercase:P,lowercase:F,capitalize:$,overflow:j,...O},D)=>{const[K,I]=S.useState(!1),M=!!u,H=()=>M&&I(!0),U=()=>M&&I(!1),re=Pk({mt:d,mb:h,ml:g,mr:p,flex:m,cursor:v,wordBreak:y,whiteSpace:x,textOverflow:b,decoration:w,color:_,center:E,left:R,right:k,uppercase:P,lowercase:F,capitalize:$,overflow:j}),G=o,Y=Ra[s?"inherit":n],Q=Ra[s?"inherit":i],ne=Ra[s?"inherit":r],oe=M?T.css({opacity:K?l:1,transition:`opacity ${c}ms ease`}):"";return C.jsx(G,{ref:D,...O,className:T.cx(Ra.text,Y,Q,ne,oe,t,re),style:a,onClick:u,onMouseDown:H,onMouseUp:U,onMouseLeave:U,onTouchStart:H,onTouchEnd:U,role:M?"button":void 0,tabIndex:M?0:void 0,children:e})});le.displayName="Text";const R1=ea(le),{color:Nd,cornerRadius:Yt,height:ka,transition:Lk}=V,Fk=T.css({display:"flex",alignItems:"center",justifyContent:"center",position:"relative",borderRadius:16,height:48,padding:"0 16px",cursor:"pointer",fontSize:16,fontWeight:600,overflow:"hidden",transition:"all 0.2s ease",gap:8}),as={zero:Yt.zero,xs:Yt.xs,sm:Yt.sm,md:Yt.md,lg:Yt.lg,xl:Yt.xl,"2xl":Yt["2xl"],"3xl":Yt["3xl"],"4xl":Yt["4xl"],"5xl":Yt["5xl"],"6xl":Yt["6xl"],"full-round":Yt.fullRound},$k={xs:ka.button.xs,sm:ka.button.sm,md:ka.button.md,lg:ka.button.lg},Ok={clear:T.css({backgroundColor:"transparent",border:"none"}),filled:T.css({backgroundColor:Nd.fill.accentPrimary,color:"white",border:"none"}),outline:T.css({backgroundColor:"transparent",border:`1px solid ${Nd.border.accentPrimary}`})},Ik=(e,t,n,r)=>{if(r)return T.css({cursor:"not-allowed",opacity:.7});const o={transition:Lk.general,borderRadius:Yt.lg,border:"none",color:e==="filled"?Nd.text.inverse:`var(--text-${t})`};switch(e){case"filled":return T.css({...o,backgroundColor:`var(--fill-${t}-${n})`,":hover":{backgroundColor:`var(--fill-${t}-${n}-hover)`},":active":{backgroundColor:`var(--fill-${t}-${n}-hover)`}});case"outline":return T.css({...o,backgroundColor:"transparent",border:`1px solid var(--border-${t}-${n})`,":hover":{backgroundColor:`var(--fill-${t}-secondary-hover)`},":active":{backgroundColor:`var(--fill-${t}-secondary-hover)`}});case"clear":return T.css({...o,backgroundColor:"transparent",":hover":{backgroundColor:`var(--fill-${t}-secondary-hover)`},":active":{backgroundColor:`var(--fill-${t}-secondary-hover)`}});default:return T.css(o)}},{color:Aa}=V,Br=({disabled:e,loading:t,className:n,wrapperClassName:r,buttonClassName:o,buttonDisabledClassName:i,textClassName:s,children:a,variant:l="filled",backgroundColor:c,textColor:u,textFontWeight:f,borderColor:d,color:h="accent",opacity:g,borderRadius:p,width:m="full",size:v="md",iconLeft:y,iconRight:x,intensity:b="primary",flex:w,type:_="button",...E})=>{const R=S.useMemo(()=>{switch(m){case"full":return"100%";case"auto":return"auto";default:return m}},[m]),k=S.useMemo(()=>c||(l==="filled"?h==="neutral"?Aa.fill.neutralSecondary:`var(--fill-${h}-${b})`:"transparent"),[l,c,h,b]),P=S.useMemo(()=>{if(b==="primary"){if(h==="neutral")return Aa.text.secondary;if(l==="filled")return Aa.text.inverse}else if(h==="neutral")return Aa.text.secondary;return`var(--text-${h})`},[b,h,l]),F=S.useMemo(()=>{if(b==="primary"){if(h==="neutral")return"secondary";if(l==="filled")return"inverse"}else if(h==="neutral")return"secondary";return h},[l,h,b]),$=S.useMemo(()=>d||(l==="outline"?`var(--border-${h}-${b})`:"transparent"),[l,d,h,b]),j=S.useMemo(()=>{switch(v){case"lg":return as.lg;case"md":case"sm":return as.md;case"xs":return as.sm;default:return as.md}},[v]),O=T.cx(Fk,Ik(l,h,b,e),Ok[l],e?i:void 0,T.css({borderRadius:p?as[p]:j,backgroundColor:k,borderColor:$,color:u??`var(--text-${F})`,width:"100%",height:$k[v],opacity:g||(e?.7:1)}),o),D=S.useMemo(()=>{switch(v){case"lg":case"md":return"body-1";case"sm":case"xs":return"body-2";default:return"body-1"}},[v]);return C.jsx(q,{className:T.cx(r,n),w:R,flex:w,relative:!0,overflow:"hidden",children:C.jsxs(ea.button,{...E,whileTap:!e&&!t?{scale:.99,boxShadow:"inset 0 0 0 10000px rgba(0,0,0,0.1)",transition:{duration:0}}:{},disabled:e||t,className:O,type:_,children:[t?C.jsx(z0,{color:P}):C.jsxs(C.Fragment,{children:[y,C.jsx(R1,{style:{color:u},colorName:F,variant:D,className:s,textOverflow:"ellipsis",overflow:"hidden",children:a}),x]}),C.jsx(zo,{})]})})},Dk=e=>N.createElement("svg",{width:16,height:16,viewBox:"0 0 24 24",fill:"none",...e},N.createElement("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z",fill:"currentColor"})),jk=e=>N.createElement("svg",{viewBox:"0 0 24 24",fill:"none",...e},N.createElement("path",{d:"M19 13H5v-2h14v2z",fill:"currentColor"})),{color:ao}=V,Sr={checkbox:T.css({display:"inline-flex",alignItems:"flex-start",gap:8,userSelect:"none"}),disabled:T.css({cursor:"not-allowed",opacity:.5}),checkbox__input:T.css({position:"absolute",opacity:0,width:"var(--checkbox-size)",height:"var(--checkbox-size)"}),checkbox__box:T.css({width:"var(--checkbox-size)",height:"var(--checkbox-size)",display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:4,border:`1px solid ${ao.border.neutralAlphaHigh}`,backgroundColor:ao.fill.bgSecondary,opacity:1,transition:"all 0.15s cubic-bezier(0.4, 0, 0.2, 1)",position:"relative","& svg":{color:ao.border.accentPrimary}}),checked:T.css({borderColor:`${ao.border.accentPrimary} !important`,backgroundColor:`${ao.fill.accentSecondary} !important`}),error:T.css({borderColor:ao.border.negativePrimary,backgroundColor:ao.fill.negativeSecondary})},Vk={primary:T.css({}),secondary:T.css({backgroundColor:"transparent"})},Bk={sm:20,md:24},gh=S.forwardRef(({checked:e,onChange:t,disabled:n,error:r,indeterminate:o,size:i="md",title:s,titleColor:a,subtitle:l,subtitleColor:c="secondary",name:u,required:f,variant:d="primary",flex:h,readOnly:g,className:p,inputClassName:m,boxClassName:v,titleClassName:y,subtitleClassName:x},b)=>{const[w,_]=S.useState(!1),E=e!==void 0,R=E?e:w,k=O=>{E||_(O.target.checked),t?.(O)},P=Bk[i],F=R||o,$=!!g&&!n,j=n?"not-allowed":$?"auto":"pointer";return C.jsxs("label",{className:T.cx(Sr.checkbox,T.css({flex:h,cursor:j}),{[Sr.disabled]:n},p),children:[C.jsxs(q,{relative:!0,display:"inline-flex",style:{"--checkbox-size":`${P}px`,"--checkbox-size-double":`${P*2}px`},children:[C.jsx("input",{ref:b,type:"checkbox",checked:R,onChange:$?void 0:k,onClick:O=>O.stopPropagation(),disabled:n,readOnly:$,name:u,required:f,className:T.cx(Sr.checkbox__input,{[Sr.disabled]:n},T.css({cursor:j}),m)}),C.jsx("div",{className:T.cx(Sr.checkbox__box,Vk[d],{[Sr.disabled]:n,[Sr.error]:r,[Sr.checked]:F},v),children:F&&(o?C.jsx(jk,{width:P*.75,height:P*.75}):C.jsx(Dk,{width:P*.75,height:P*.75}))})]}),(s||l)&&C.jsxs(q,{gap:4,children:[s&&C.jsx(le,{colorName:a,variant:i==="sm"?"body-2":"body-1",className:y,children:s}),l&&C.jsx(le,{variant:"body-2",colorName:c,className:x,children:l})]})]})});gh.displayName="Checkbox";function Jl(){return typeof window<"u"}function Ki(e){return k1(e)?(e.nodeName||"").toLowerCase():"#document"}function Bt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Jn(e){var t;return(t=(k1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function k1(e){return Jl()?e instanceof Node||e instanceof Bt(e).Node:!1}function De(e){return Jl()?e instanceof Element||e instanceof Bt(e).Element:!1}function Ft(e){return Jl()?e instanceof HTMLElement||e instanceof Bt(e).HTMLElement:!1}function Md(e){return!Jl()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Bt(e).ShadowRoot}const zk=new Set(["inline","contents"]);function ta(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=dn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!zk.has(o)}const Hk=new Set(["table","td","th"]);function Wk(e){return Hk.has(Ki(e))}const Kk=[":popover-open",":modal"];function Ql(e){return Kk.some(t=>{try{return e.matches(t)}catch{return!1}})}const Uk=["transform","translate","scale","rotate","perspective"],Gk=["transform","translate","scale","rotate","perspective","filter"],qk=["paint","layout","strict","content"];function ph(e){const t=ec(),n=De(e)?dn(e):e;return Uk.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Gk.some(r=>(n.willChange||"").includes(r))||qk.some(r=>(n.contain||"").includes(r))}function Yk(e){let t=br(e);for(;Ft(t)&&!mr(t);){if(ph(t))return t;if(Ql(t))return null;t=br(t)}return null}function ec(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Xk=new Set(["html","body","#document"]);function mr(e){return Xk.has(Ki(e))}function dn(e){return Bt(e).getComputedStyle(e)}function tc(e){return De(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function br(e){if(Ki(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Md(e)&&e.host||Jn(e);return Md(t)?t.host:t}function A1(e){const t=br(e);return mr(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ft(t)&&ta(t)?t:A1(t)}function Ir(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=A1(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=Bt(o);if(i){const a=Pd(s);return t.concat(s,s.visualViewport||[],ta(o)?o:[],a&&n?Ir(a):[])}return t.concat(o,Ir(o,[],n))}function Pd(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const zr=Math.min,Xt=Math.max,bl=Math.round,Na=Math.floor,Wn=e=>({x:e,y:e}),Zk={left:"right",right:"left",bottom:"top",top:"bottom"},Jk={start:"end",end:"start"};function Ld(e,t,n){return Xt(e,zr(t,n))}function Ui(e,t){return typeof e=="function"?e(t):e}function Hr(e){return e.split("-")[0]}function Gi(e){return e.split("-")[1]}function N1(e){return e==="x"?"y":"x"}function mh(e){return e==="y"?"height":"width"}const Qk=new Set(["top","bottom"]);function fr(e){return Qk.has(Hr(e))?"y":"x"}function yh(e){return N1(fr(e))}function e3(e,t,n){n===void 0&&(n=!1);const r=Gi(e),o=yh(e),i=mh(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=wl(s)),[s,wl(s)]}function t3(e){const t=wl(e);return[Fd(e),t,Fd(t)]}function Fd(e){return e.replace(/start|end/g,t=>Jk[t])}const sm=["left","right"],am=["right","left"],n3=["top","bottom"],r3=["bottom","top"];function o3(e,t,n){switch(e){case"top":case"bottom":return n?t?am:sm:t?sm:am;case"left":case"right":return t?n3:r3;default:return[]}}function i3(e,t,n,r){const o=Gi(e);let i=o3(Hr(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Fd)))),i}function wl(e){return e.replace(/left|right|bottom|top/g,t=>Zk[t])}function s3(e){return{top:0,right:0,bottom:0,left:0,...e}}function M1(e){return typeof e!="number"?s3(e):{top:e,right:e,bottom:e,left:e}}function Cl(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function a3(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function l3(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function c3(){return/apple/i.test(navigator.vendor)}function u3(){return a3().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function d3(){return l3().includes("jsdom/")}const lm="data-floating-ui-focusable",f3="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function cm(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function Bs(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Md(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function ci(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Qc(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function h3(e){return e.matches("html,body")}function wo(e){return e?.ownerDocument||document}function P1(e){return Ft(e)&&e.matches(f3)}function g3(e){if(!e||d3())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function p3(e){return e?e.hasAttribute(lm)?e:e.querySelector("["+lm+"]")||e:null}function rl(e,t,n){return n===void 0&&(n=!0),e.filter(o=>{var i;return o.parentId===t&&(!n||((i=o.context)==null?void 0:i.open))}).flatMap(o=>[o,...rl(e,o.id,n)])}function m3(e){return"nativeEvent"in e}function zs(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var y3=typeof document<"u",v3=function(){},Fi=y3?S.useLayoutEffect:v3;const x3={...N};function Ma(e){const t=N.useRef(e);return Fi(()=>{t.current=e}),t}const b3=x3.useInsertionEffect,w3=b3||(e=>e());function jn(e){const t=N.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return w3(()=>{t.current=e}),N.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function um(e,t,n){let{reference:r,floating:o}=e;const i=fr(t),s=yh(t),a=mh(s),l=Hr(t),c=i==="y",u=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[a]/2-o[a]/2;let h;switch(l){case"top":h={x:u,y:r.y-o.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-o.width,y:f};break;default:h={x:r.x,y:r.y}}switch(Gi(t)){case"start":h[s]-=d*(n&&c?-1:1);break;case"end":h[s]+=d*(n&&c?-1:1);break}return h}const C3=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=um(c,r,l),d=r,h={},g=0;for(let p=0;p<a.length;p++){const{name:m,fn:v}=a[p],{x:y,y:x,data:b,reset:w}=await v({x:u,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:h,rects:c,platform:s,elements:{reference:e,floating:t}});u=y??u,f=x??f,h={...h,[m]:{...h[m],...b}},w&&g<=50&&(g++,typeof w=="object"&&(w.placement&&(d=w.placement),w.rects&&(c=w.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):w.rects),{x:u,y:f}=um(c,d,l)),p=-1)}return{x:u,y:f,placement:d,strategy:o,middlewareData:h}};async function vh(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:d=!1,padding:h=0}=Ui(t,e),g=M1(h),m=a[d?f==="floating"?"reference":"floating":f],v=Cl(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(m)))==null||n?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),y=f==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),b=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},w=Cl(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:x,strategy:l}):y);return{top:(v.top-w.top+g.top)/b.y,bottom:(w.bottom-v.bottom+g.bottom)/b.y,left:(v.left-w.left+g.left)/b.x,right:(w.right-v.right+g.right)/b.x}}const S3=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=Ui(e,t)||{};if(c==null)return{};const f=M1(u),d={x:n,y:r},h=yh(o),g=mh(h),p=await s.getDimensions(c),m=h==="y",v=m?"top":"left",y=m?"bottom":"right",x=m?"clientHeight":"clientWidth",b=i.reference[g]+i.reference[h]-d[h]-i.floating[g],w=d[h]-i.reference[h],_=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let E=_?_[x]:0;(!E||!await(s.isElement==null?void 0:s.isElement(_)))&&(E=a.floating[x]||i.floating[g]);const R=b/2-w/2,k=E/2-p[g]/2-1,P=zr(f[v],k),F=zr(f[y],k),$=P,j=E-p[g]-F,O=E/2-p[g]/2+R,D=Ld($,O,j),K=!l.arrow&&Gi(o)!=null&&O!==D&&i.reference[g]/2-(O<$?P:F)-p[g]/2<0,I=K?O<$?O-$:O-j:0;return{[h]:d[h]+I,data:{[h]:D,centerOffset:O-D-I,...K&&{alignmentOffset:I}},reset:K}}}),_3=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:p=!0,...m}=Ui(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const v=Hr(o),y=fr(a),x=Hr(a)===a,b=await(l.isRTL==null?void 0:l.isRTL(c.floating)),w=d||(x||!p?[wl(a)]:t3(a)),_=g!=="none";!d&&_&&w.push(...i3(a,p,g,b));const E=[a,...w],R=await vh(t,m),k=[];let P=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&k.push(R[v]),f){const O=e3(o,s,b);k.push(R[O[0]],R[O[1]])}if(P=[...P,{placement:o,overflows:k}],!k.every(O=>O<=0)){var F,$;const O=(((F=i.flip)==null?void 0:F.index)||0)+1,D=E[O];if(D&&(!(f==="alignment"?y!==fr(D):!1)||P.every(M=>fr(M.placement)===y?M.overflows[0]>0:!0)))return{data:{index:O,overflows:P},reset:{placement:D}};let K=($=P.filter(I=>I.overflows[0]<=0).sort((I,M)=>I.overflows[1]-M.overflows[1])[0])==null?void 0:$.placement;if(!K)switch(h){case"bestFit":{var j;const I=(j=P.filter(M=>{if(_){const H=fr(M.placement);return H===y||H==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(H=>H>0).reduce((H,U)=>H+U,0)]).sort((M,H)=>M[1]-H[1])[0])==null?void 0:j[0];I&&(K=I);break}case"initialPlacement":K=a;break}if(o!==K)return{reset:{placement:K}}}return{}}}},T3=new Set(["left","top"]);async function E3(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Hr(n),a=Gi(n),l=fr(n)==="y",c=T3.has(s)?-1:1,u=i&&l?-1:1,f=Ui(t,e);let{mainAxis:d,crossAxis:h,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof g=="number"&&(h=a==="end"?g*-1:g),l?{x:h*u,y:d*c}:{x:d*c,y:h*u}}const R3=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await E3(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},k3=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:m=>{let{x:v,y}=m;return{x:v,y}}},...l}=Ui(e,t),c={x:n,y:r},u=await vh(t,l),f=fr(Hr(o)),d=N1(f);let h=c[d],g=c[f];if(i){const m=d==="y"?"top":"left",v=d==="y"?"bottom":"right",y=h+u[m],x=h-u[v];h=Ld(y,h,x)}if(s){const m=f==="y"?"top":"left",v=f==="y"?"bottom":"right",y=g+u[m],x=g-u[v];g=Ld(y,g,x)}const p=a.fn({...t,[d]:h,[f]:g});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[d]:i,[f]:s}}}}}},A3=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=Ui(e,t),u=await vh(t,c),f=Hr(o),d=Gi(o),h=fr(o)==="y",{width:g,height:p}=i.floating;let m,v;f==="top"||f==="bottom"?(m=f,v=d===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(v=f,m=d==="end"?"top":"bottom");const y=p-u.top-u.bottom,x=g-u.left-u.right,b=zr(p-u[m],y),w=zr(g-u[v],x),_=!t.middlewareData.shift;let E=b,R=w;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(R=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(E=y),_&&!d){const P=Xt(u.left,0),F=Xt(u.right,0),$=Xt(u.top,0),j=Xt(u.bottom,0);h?R=g-2*(P!==0||F!==0?P+F:Xt(u.left,u.right)):E=p-2*($!==0||j!==0?$+j:Xt(u.top,u.bottom))}await l({...t,availableWidth:R,availableHeight:E});const k=await s.getDimensions(a.floating);return g!==k.width||p!==k.height?{reset:{rects:!0}}:{}}}};function L1(e){const t=dn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ft(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=bl(n)!==i||bl(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function xh(e){return De(e)?e:e.contextElement}function Si(e){const t=xh(e);if(!Ft(t))return Wn(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=L1(t);let s=(i?bl(n.width):n.width)/r,a=(i?bl(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const N3=Wn(0);function F1(e){const t=Bt(e);return!ec()||!t.visualViewport?N3:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function M3(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Bt(e)?!1:t}function ko(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=xh(e);let s=Wn(1);t&&(r?De(r)&&(s=Si(r)):s=Si(e));const a=M3(i,n,r)?F1(i):Wn(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,f=o.height/s.y;if(i){const d=Bt(i),h=r&&De(r)?Bt(r):r;let g=d,p=Pd(g);for(;p&&r&&h!==g;){const m=Si(p),v=p.getBoundingClientRect(),y=dn(p),x=v.left+(p.clientLeft+parseFloat(y.paddingLeft))*m.x,b=v.top+(p.clientTop+parseFloat(y.paddingTop))*m.y;l*=m.x,c*=m.y,u*=m.x,f*=m.y,l+=x,c+=b,g=Bt(p),p=Pd(g)}}return Cl({width:u,height:f,x:l,y:c})}function nc(e,t){const n=tc(e).scrollLeft;return t?t.left+n:ko(Jn(e)).left+n}function $1(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-nc(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function P3(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=Jn(r),a=t?Ql(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=Wn(1);const u=Wn(0),f=Ft(r);if((f||!f&&!i)&&((Ki(r)!=="body"||ta(s))&&(l=tc(r)),Ft(r))){const h=ko(r);c=Si(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}const d=s&&!f&&!i?$1(s,l):Wn(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+d.x,y:n.y*c.y-l.scrollTop*c.y+u.y+d.y}}function L3(e){return Array.from(e.getClientRects())}function F3(e){const t=Jn(e),n=tc(e),r=e.ownerDocument.body,o=Xt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Xt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+nc(e);const a=-n.scrollTop;return dn(r).direction==="rtl"&&(s+=Xt(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}const dm=25;function $3(e,t){const n=Bt(e),r=Jn(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const u=ec();(!u||u&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const c=nc(r);if(c<=0){const u=r.ownerDocument,f=u.body,d=getComputedStyle(f),h=u.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,g=Math.abs(r.clientWidth-f.clientWidth-h);g<=dm&&(i-=g)}else c<=dm&&(i+=c);return{width:i,height:s,x:a,y:l}}const O3=new Set(["absolute","fixed"]);function I3(e,t){const n=ko(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Ft(e)?Si(e):Wn(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:s,height:a,x:l,y:c}}function fm(e,t,n){let r;if(t==="viewport")r=$3(e,n);else if(t==="document")r=F3(Jn(e));else if(De(t))r=I3(t,n);else{const o=F1(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Cl(r)}function O1(e,t){const n=br(e);return n===t||!De(n)||mr(n)?!1:dn(n).position==="fixed"||O1(n,t)}function D3(e,t){const n=t.get(e);if(n)return n;let r=Ir(e,[],!1).filter(a=>De(a)&&Ki(a)!=="body"),o=null;const i=dn(e).position==="fixed";let s=i?br(e):e;for(;De(s)&&!mr(s);){const a=dn(s),l=ph(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&O3.has(o.position)||ta(s)&&!l&&O1(e,s))?r=r.filter(u=>u!==s):o=a,s=br(s)}return t.set(e,r),r}function j3(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?Ql(t)?[]:D3(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const f=fm(t,u,o);return c.top=Xt(f.top,c.top),c.right=zr(f.right,c.right),c.bottom=zr(f.bottom,c.bottom),c.left=Xt(f.left,c.left),c},fm(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function V3(e){const{width:t,height:n}=L1(e);return{width:t,height:n}}function B3(e,t,n){const r=Ft(t),o=Jn(t),i=n==="fixed",s=ko(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=Wn(0);function c(){l.x=nc(o)}if(r||!r&&!i)if((Ki(t)!=="body"||ta(o))&&(a=tc(t)),r){const h=ko(t,!0,i,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else o&&c();i&&!r&&o&&c();const u=o&&!r&&!i?$1(o,a):Wn(0),f=s.left+a.scrollLeft-l.x-u.x,d=s.top+a.scrollTop-l.y-u.y;return{x:f,y:d,width:s.width,height:s.height}}function eu(e){return dn(e).position==="static"}function hm(e,t){if(!Ft(e)||dn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Jn(e)===n&&(n=n.ownerDocument.body),n}function I1(e,t){const n=Bt(e);if(Ql(e))return n;if(!Ft(e)){let o=br(e);for(;o&&!mr(o);){if(De(o)&&!eu(o))return o;o=br(o)}return n}let r=hm(e,t);for(;r&&Wk(r)&&eu(r);)r=hm(r,t);return r&&mr(r)&&eu(r)&&!ph(r)?n:r||Yk(e)||n}const z3=async function(e){const t=this.getOffsetParent||I1,n=this.getDimensions,r=await n(e.floating);return{reference:B3(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function H3(e){return dn(e).direction==="rtl"}const W3={convertOffsetParentRelativeRectToViewportRelativeRect:P3,getDocumentElement:Jn,getClippingRect:j3,getOffsetParent:I1,getElementRects:z3,getClientRects:L3,getDimensions:V3,getScale:Si,isElement:De,isRTL:H3};function D1(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function K3(e,t){let n=null,r;const o=Jn(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const c=e.getBoundingClientRect(),{left:u,top:f,width:d,height:h}=c;if(a||t(),!d||!h)return;const g=Na(f),p=Na(o.clientWidth-(u+d)),m=Na(o.clientHeight-(f+h)),v=Na(u),x={rootMargin:-g+"px "+-p+"px "+-m+"px "+-v+"px",threshold:Xt(0,zr(1,l))||1};let b=!0;function w(_){const E=_[0].intersectionRatio;if(E!==l){if(!b)return s();E?s(!1,E):r=setTimeout(()=>{s(!1,1e-7)},1e3)}E===1&&!D1(c,e.getBoundingClientRect())&&s(),b=!1}try{n=new IntersectionObserver(w,{...x,root:o.ownerDocument})}catch{n=new IntersectionObserver(w,x)}n.observe(e)}return s(!0),i}function bh(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=xh(e),u=o||i?[...c?Ir(c):[],...Ir(t)]:[];u.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const f=c&&a?K3(c,n):null;let d=-1,h=null;s&&(h=new ResizeObserver(v=>{let[y]=v;y&&y.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var x;(x=h)==null||x.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let g,p=l?ko(e):null;l&&m();function m(){const v=ko(e);p&&!D1(p,v)&&n(),p=v,g=requestAnimationFrame(m)}return n(),()=>{var v;u.forEach(y=>{o&&y.removeEventListener("scroll",n),i&&y.removeEventListener("resize",n)}),f?.(),(v=h)==null||v.disconnect(),h=null,l&&cancelAnimationFrame(g)}}const U3=R3,G3=k3,q3=_3,Y3=A3,gm=S3,X3=(e,t,n)=>{const r=new Map,o={platform:W3,...n},i={...o.platform,_c:r};return C3(e,t,{...o,platform:i})};var Z3=typeof document<"u",J3=function(){},ol=Z3?S.useLayoutEffect:J3;function Sl(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Sl(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!Sl(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function j1(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function pm(e,t){const n=j1(e);return Math.round(t*n)/n}function tu(e){const t=N.useRef(e);return ol(()=>{t.current=e}),t}function Q3(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,f]=N.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,h]=N.useState(r);Sl(d,r)||h(r);const[g,p]=N.useState(null),[m,v]=N.useState(null),y=N.useCallback(M=>{M!==_.current&&(_.current=M,p(M))},[]),x=N.useCallback(M=>{M!==E.current&&(E.current=M,v(M))},[]),b=i||g,w=s||m,_=N.useRef(null),E=N.useRef(null),R=N.useRef(u),k=l!=null,P=tu(l),F=tu(o),$=tu(c),j=N.useCallback(()=>{if(!_.current||!E.current)return;const M={placement:t,strategy:n,middleware:d};F.current&&(M.platform=F.current),X3(_.current,E.current,M).then(H=>{const U={...H,isPositioned:$.current!==!1};O.current&&!Sl(R.current,U)&&(R.current=U,A_.flushSync(()=>{f(U)}))})},[d,t,n,F,$]);ol(()=>{c===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,f(M=>({...M,isPositioned:!1})))},[c]);const O=N.useRef(!1);ol(()=>(O.current=!0,()=>{O.current=!1}),[]),ol(()=>{if(b&&(_.current=b),w&&(E.current=w),b&&w){if(P.current)return P.current(b,w,j);j()}},[b,w,j,P,k]);const D=N.useMemo(()=>({reference:_,floating:E,setReference:y,setFloating:x}),[y,x]),K=N.useMemo(()=>({reference:b,floating:w}),[b,w]),I=N.useMemo(()=>{const M={position:n,left:0,top:0};if(!K.floating)return M;const H=pm(K.floating,u.x),U=pm(K.floating,u.y);return a?{...M,transform:"translate("+H+"px, "+U+"px)",...j1(K.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:H,top:U}},[n,a,K.floating,u.x,u.y]);return N.useMemo(()=>({...u,update:j,refs:D,elements:K,floatingStyles:I}),[u,j,D,K,I])}const eA=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?gm({element:r.current,padding:o}).fn(n):{}:r?gm({element:r,padding:o}).fn(n):{}}}},wh=(e,t)=>({...U3(e),options:[e,t]}),Ch=(e,t)=>({...G3(e),options:[e,t]}),Sh=(e,t)=>({...q3(e),options:[e,t]}),tA=(e,t)=>({...Y3(e),options:[e,t]}),nA=(e,t)=>({...eA(e),options:[e,t]});function _l(e){const t=N.useRef(void 0),n=N.useCallback(r=>{const o=e.map(i=>{if(i!=null){if(typeof i=="function"){const s=i,a=s(r);return typeof a=="function"?a:()=>{s(null)}}return i.current=r,()=>{i.current=null}}});return()=>{o.forEach(i=>i?.())}},e);return N.useMemo(()=>e.every(r=>r==null)?null:r=>{t.current&&(t.current(),t.current=void 0),r!=null&&(t.current=n(r))},e)}const rA="data-floating-ui-focusable",mm="active",ym="selected",oA={...N};let vm=!1,iA=0;const xm=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+iA++;function sA(){const[e,t]=N.useState(()=>vm?xm():void 0);return Fi(()=>{e==null&&t(xm())},[]),N.useEffect(()=>{vm=!0},[]),e}const aA=oA.useId,V1=aA||sA;let $d;process.env.NODE_ENV!=="production"&&($d=new Set);function lA(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=$d)!=null&&e.has(o))){var i;(i=$d)==null||i.add(o),console.error(o)}}function cA(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}const uA=N.createContext(null),dA=N.createContext(null),_h=()=>{var e;return((e=N.useContext(uA))==null?void 0:e.id)||null},Th=()=>N.useContext(dA);function Eh(e){return"data-floating-ui-"+e}function on(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const bm=Eh("safe-polygon");function nu(e,t,n){if(n&&!zs(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const r=e();return typeof r=="number"?r:r?.[t]}return e?.[t]}function ru(e){return typeof e=="function"?e():e}function B1(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:s}=e,{enabled:a=!0,delay:l=0,handleClose:c=null,mouseOnly:u=!1,restMs:f=0,move:d=!0}=t,h=Th(),g=_h(),p=Ma(c),m=Ma(l),v=Ma(n),y=Ma(f),x=N.useRef(),b=N.useRef(-1),w=N.useRef(),_=N.useRef(-1),E=N.useRef(!0),R=N.useRef(!1),k=N.useRef(()=>{}),P=N.useRef(!1),F=jn(()=>{var I;const M=(I=o.current.openEvent)==null?void 0:I.type;return M?.includes("mouse")&&M!=="mousedown"});N.useEffect(()=>{if(!a)return;function I(M){let{open:H}=M;H||(on(b),on(_),E.current=!0,P.current=!1)}return i.on("openchange",I),()=>{i.off("openchange",I)}},[a,i]),N.useEffect(()=>{if(!a||!p.current||!n)return;function I(H){F()&&r(!1,H,"hover")}const M=wo(s.floating).documentElement;return M.addEventListener("mouseleave",I),()=>{M.removeEventListener("mouseleave",I)}},[s.floating,n,r,a,p,F]);const $=N.useCallback(function(I,M,H){M===void 0&&(M=!0),H===void 0&&(H="hover");const U=nu(m.current,"close",x.current);U&&!w.current?(on(b),b.current=window.setTimeout(()=>r(!1,I,H),U)):M&&(on(b),r(!1,I,H))},[m,r]),j=jn(()=>{k.current(),w.current=void 0}),O=jn(()=>{if(R.current){const I=wo(s.floating).body;I.style.pointerEvents="",I.removeAttribute(bm),R.current=!1}}),D=jn(()=>o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1);N.useEffect(()=>{if(!a)return;function I(G){if(on(b),E.current=!1,u&&!zs(x.current)||ru(y.current)>0&&!nu(m.current,"open"))return;const Y=nu(m.current,"open",x.current);Y?b.current=window.setTimeout(()=>{v.current||r(!0,G,"hover")},Y):n||r(!0,G,"hover")}function M(G){if(D()){O();return}k.current();const Y=wo(s.floating);if(on(_),P.current=!1,p.current&&o.current.floatingContext){n||on(b),w.current=p.current({...o.current.floatingContext,tree:h,x:G.clientX,y:G.clientY,onClose(){O(),j(),D()||$(G,!0,"safe-polygon")}});const ne=w.current;Y.addEventListener("mousemove",ne),k.current=()=>{Y.removeEventListener("mousemove",ne)};return}(x.current!=="touch"||!Bs(s.floating,G.relatedTarget))&&$(G)}function H(G){D()||o.current.floatingContext&&(p.current==null||p.current({...o.current.floatingContext,tree:h,x:G.clientX,y:G.clientY,onClose(){O(),j(),D()||$(G)}})(G))}function U(){on(b)}function re(G){D()||$(G,!1)}if(De(s.domReference)){const G=s.domReference,Y=s.floating;return n&&G.addEventListener("mouseleave",H),d&&G.addEventListener("mousemove",I,{once:!0}),G.addEventListener("mouseenter",I),G.addEventListener("mouseleave",M),Y&&(Y.addEventListener("mouseleave",H),Y.addEventListener("mouseenter",U),Y.addEventListener("mouseleave",re)),()=>{n&&G.removeEventListener("mouseleave",H),d&&G.removeEventListener("mousemove",I),G.removeEventListener("mouseenter",I),G.removeEventListener("mouseleave",M),Y&&(Y.removeEventListener("mouseleave",H),Y.removeEventListener("mouseenter",U),Y.removeEventListener("mouseleave",re))}}},[s,a,e,u,d,$,j,O,r,n,v,h,m,p,o,D,y]),Fi(()=>{var I;if(a&&n&&(I=p.current)!=null&&(I=I.__options)!=null&&I.blockPointerEvents&&F()){R.current=!0;const H=s.floating;if(De(s.domReference)&&H){var M;const U=wo(s.floating).body;U.setAttribute(bm,"");const re=s.domReference,G=h==null||(M=h.nodesRef.current.find(Y=>Y.id===g))==null||(M=M.context)==null?void 0:M.elements.floating;return G&&(G.style.pointerEvents=""),U.style.pointerEvents="none",re.style.pointerEvents="auto",H.style.pointerEvents="auto",()=>{U.style.pointerEvents="",re.style.pointerEvents="",H.style.pointerEvents=""}}}},[a,n,g,s,h,p,F]),Fi(()=>{n||(x.current=void 0,P.current=!1,j(),O())},[n,j,O]),N.useEffect(()=>()=>{j(),on(b),on(_),O()},[a,s.domReference,j,O]);const K=N.useMemo(()=>{function I(M){x.current=M.pointerType}return{onPointerDown:I,onPointerEnter:I,onMouseMove(M){const{nativeEvent:H}=M;function U(){!E.current&&!v.current&&r(!0,H,"hover")}u&&!zs(x.current)||n||ru(y.current)===0||P.current&&M.movementX**2+M.movementY**2<2||(on(_),x.current==="touch"?U():(P.current=!0,_.current=window.setTimeout(U,ru(y.current))))}}},[u,r,n,v,y]);return N.useMemo(()=>a?{reference:K}:{},[a,K])}function wm(e){return Ft(e.target)&&e.target.tagName==="BUTTON"}function fA(e){return Ft(e.target)&&e.target.tagName==="A"}function Cm(e){return P1(e)}function hA(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:i}}=e,{enabled:s=!0,event:a="click",toggle:l=!0,ignoreMouse:c=!1,keyboardHandlers:u=!0,stickIfOpen:f=!0}=t,d=N.useRef(),h=N.useRef(!1),g=N.useMemo(()=>({onPointerDown(p){d.current=p.pointerType},onMouseDown(p){const m=d.current;p.button===0&&a!=="click"&&(zs(m,!0)&&c||(n&&l&&(!(o.current.openEvent&&f)||o.current.openEvent.type==="mousedown")?r(!1,p.nativeEvent,"click"):(p.preventDefault(),r(!0,p.nativeEvent,"click"))))},onClick(p){const m=d.current;if(a==="mousedown"&&d.current){d.current=void 0;return}zs(m,!0)&&c||(n&&l&&(!(o.current.openEvent&&f)||o.current.openEvent.type==="click")?r(!1,p.nativeEvent,"click"):r(!0,p.nativeEvent,"click"))},onKeyDown(p){d.current=void 0,!(p.defaultPrevented||!u||wm(p))&&(p.key===" "&&!Cm(i)&&(p.preventDefault(),h.current=!0),!fA(p)&&p.key==="Enter"&&r(!(n&&l),p.nativeEvent,"click"))},onKeyUp(p){p.defaultPrevented||!u||wm(p)||Cm(i)||p.key===" "&&h.current&&(h.current=!1,r(!(n&&l),p.nativeEvent,"click"))}}),[o,i,a,c,u,r,n,f,l]);return N.useMemo(()=>s?{reference:g}:{},[s,g])}const gA={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},pA={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Sm=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e?.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e?.outsidePress)!=null?n:!0}};function z1(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:i}=e,{enabled:s=!0,escapeKey:a=!0,outsidePress:l=!0,outsidePressEvent:c="pointerdown",referencePress:u=!1,referencePressEvent:f="pointerdown",ancestorScroll:d=!1,bubbles:h,capture:g}=t,p=Th(),m=jn(typeof l=="function"?l:()=>!1),v=typeof l=="function"?m:l,y=N.useRef(!1),{escapeKey:x,outsidePress:b}=Sm(h),{escapeKey:w,outsidePress:_}=Sm(g),E=N.useRef(!1),R=jn(O=>{var D;if(!n||!s||!a||O.key!=="Escape"||E.current)return;const K=(D=i.current.floatingContext)==null?void 0:D.nodeId,I=p?rl(p.nodesRef.current,K):[];if(!x&&(O.stopPropagation(),I.length>0)){let M=!0;if(I.forEach(H=>{var U;if((U=H.context)!=null&&U.open&&!H.context.dataRef.current.__escapeKeyBubbles){M=!1;return}}),!M)return}r(!1,m3(O)?O.nativeEvent:O,"escape-key")}),k=jn(O=>{var D;const K=()=>{var I;R(O),(I=ci(O))==null||I.removeEventListener("keydown",K)};(D=ci(O))==null||D.addEventListener("keydown",K)}),P=jn(O=>{var D;const K=i.current.insideReactTree;i.current.insideReactTree=!1;const I=y.current;if(y.current=!1,c==="click"&&I||K||typeof v=="function"&&!v(O))return;const M=ci(O),H="["+Eh("inert")+"]",U=wo(o.floating).querySelectorAll(H);let re=De(M)?M:null;for(;re&&!mr(re);){const ne=br(re);if(mr(ne)||!De(ne))break;re=ne}if(U.length&&De(M)&&!h3(M)&&!Bs(M,o.floating)&&Array.from(U).every(ne=>!Bs(re,ne)))return;if(Ft(M)&&j){const ne=mr(M),oe=dn(M),me=/auto|scroll/,ee=ne||me.test(oe.overflowX),ve=ne||me.test(oe.overflowY),Se=ee&&M.clientWidth>0&&M.scrollWidth>M.clientWidth,Ee=ve&&M.clientHeight>0&&M.scrollHeight>M.clientHeight,ze=oe.direction==="rtl",je=Ee&&(ze?O.offsetX<=M.offsetWidth-M.clientWidth:O.offsetX>M.clientWidth),Rt=Se&&O.offsetY>M.clientHeight;if(je||Rt)return}const G=(D=i.current.floatingContext)==null?void 0:D.nodeId,Y=p&&rl(p.nodesRef.current,G).some(ne=>{var oe;return Qc(O,(oe=ne.context)==null?void 0:oe.elements.floating)});if(Qc(O,o.floating)||Qc(O,o.domReference)||Y)return;const Q=p?rl(p.nodesRef.current,G):[];if(Q.length>0){let ne=!0;if(Q.forEach(oe=>{var me;if((me=oe.context)!=null&&me.open&&!oe.context.dataRef.current.__outsidePressBubbles){ne=!1;return}}),!ne)return}r(!1,O,"outside-press")}),F=jn(O=>{var D;const K=()=>{var I;P(O),(I=ci(O))==null||I.removeEventListener(c,K)};(D=ci(O))==null||D.addEventListener(c,K)});N.useEffect(()=>{if(!n||!s)return;i.current.__escapeKeyBubbles=x,i.current.__outsidePressBubbles=b;let O=-1;function D(U){r(!1,U,"ancestor-scroll")}function K(){window.clearTimeout(O),E.current=!0}function I(){O=window.setTimeout(()=>{E.current=!1},ec()?5:0)}const M=wo(o.floating);a&&(M.addEventListener("keydown",w?k:R,w),M.addEventListener("compositionstart",K),M.addEventListener("compositionend",I)),v&&M.addEventListener(c,_?F:P,_);let H=[];return d&&(De(o.domReference)&&(H=Ir(o.domReference)),De(o.floating)&&(H=H.concat(Ir(o.floating))),!De(o.reference)&&o.reference&&o.reference.contextElement&&(H=H.concat(Ir(o.reference.contextElement)))),H=H.filter(U=>{var re;return U!==((re=M.defaultView)==null?void 0:re.visualViewport)}),H.forEach(U=>{U.addEventListener("scroll",D,{passive:!0})}),()=>{a&&(M.removeEventListener("keydown",w?k:R,w),M.removeEventListener("compositionstart",K),M.removeEventListener("compositionend",I)),v&&M.removeEventListener(c,_?F:P,_),H.forEach(U=>{U.removeEventListener("scroll",D)}),window.clearTimeout(O)}},[i,o,a,v,c,n,r,d,s,x,b,R,w,k,P,_,F]),N.useEffect(()=>{i.current.insideReactTree=!1},[i,v,c]);const $=N.useMemo(()=>({onKeyDown:R,...u&&{[gA[f]]:O=>{r(!1,O.nativeEvent,"reference-press")},...f!=="click"&&{onClick(O){r(!1,O.nativeEvent,"reference-press")}}}}),[R,r,u,f]),j=N.useMemo(()=>({onKeyDown:R,onMouseDown(){y.current=!0},onMouseUp(){y.current=!0},[pA[c]]:()=>{i.current.insideReactTree=!0}}),[R,c,i]);return N.useMemo(()=>s?{reference:$,floating:j}:{},[s,$,j])}function mA(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=V1(),i=N.useRef({}),[s]=N.useState(()=>cA()),a=_h()!=null;if(process.env.NODE_ENV!=="production"){const h=r.reference;h&&!De(h)&&lA("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,c]=N.useState(r.reference),u=jn((h,g,p)=>{i.current.openEvent=h?g:void 0,s.emit("openchange",{open:h,event:g,reason:p,nested:a}),n?.(h,g,p)}),f=N.useMemo(()=>({setPositionReference:c}),[]),d=N.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return N.useMemo(()=>({dataRef:i,open:t,onOpenChange:u,elements:d,events:s,floatingId:o,refs:f}),[t,u,d,s,o,f])}function Rh(e){e===void 0&&(e={});const{nodeId:t}=e,n=mA({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,s]=N.useState(null),[a,l]=N.useState(null),u=o?.domReference||i,f=N.useRef(null),d=Th();Fi(()=>{u&&(f.current=u)},[u]);const h=Q3({...e,elements:{...o,...a&&{reference:a}}}),g=N.useCallback(x=>{const b=De(x)?{getBoundingClientRect:()=>x.getBoundingClientRect(),getClientRects:()=>x.getClientRects(),contextElement:x}:x;l(b),h.refs.setReference(b)},[h.refs]),p=N.useCallback(x=>{(De(x)||x===null)&&(f.current=x,s(x)),(De(h.refs.reference.current)||h.refs.reference.current===null||x!==null&&!De(x))&&h.refs.setReference(x)},[h.refs]),m=N.useMemo(()=>({...h.refs,setReference:p,setPositionReference:g,domReference:f}),[h.refs,p,g]),v=N.useMemo(()=>({...h.elements,domReference:u}),[h.elements,u]),y=N.useMemo(()=>({...h,...r,refs:m,elements:v,nodeId:t}),[h,m,v,t,r]);return Fi(()=>{r.dataRef.current.floatingContext=y;const x=d?.nodesRef.current.find(b=>b.id===t);x&&(x.context=y)}),N.useMemo(()=>({...h,context:y,refs:m,elements:v}),[h,m,v,y])}function ou(){return u3()&&c3()}function yA(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:i,elements:s}=e,{enabled:a=!0,visibleOnly:l=!0}=t,c=N.useRef(!1),u=N.useRef(-1),f=N.useRef(!0);N.useEffect(()=>{if(!a)return;const h=Bt(s.domReference);function g(){!n&&Ft(s.domReference)&&s.domReference===cm(wo(s.domReference))&&(c.current=!0)}function p(){f.current=!0}function m(){f.current=!1}return h.addEventListener("blur",g),ou()&&(h.addEventListener("keydown",p,!0),h.addEventListener("pointerdown",m,!0)),()=>{h.removeEventListener("blur",g),ou()&&(h.removeEventListener("keydown",p,!0),h.removeEventListener("pointerdown",m,!0))}},[s.domReference,n,a]),N.useEffect(()=>{if(!a)return;function h(g){let{reason:p}=g;(p==="reference-press"||p==="escape-key")&&(c.current=!0)}return o.on("openchange",h),()=>{o.off("openchange",h)}},[o,a]),N.useEffect(()=>()=>{on(u)},[]);const d=N.useMemo(()=>({onMouseLeave(){c.current=!1},onFocus(h){if(c.current)return;const g=ci(h.nativeEvent);if(l&&De(g)){if(ou()&&!h.relatedTarget){if(!f.current&&!P1(g))return}else if(!g3(g))return}r(!0,h.nativeEvent,"focus")},onBlur(h){c.current=!1;const g=h.relatedTarget,p=h.nativeEvent,m=De(g)&&g.hasAttribute(Eh("focus-guard"))&&g.getAttribute("data-type")==="outside";u.current=window.setTimeout(()=>{var v;const y=cm(s.domReference?s.domReference.ownerDocument:document);!g&&y===s.domReference||Bs((v=i.current.floatingContext)==null?void 0:v.refs.floating.current,y)||Bs(s.domReference,y)||m||r(!1,p,"focus")})}}),[i,s.domReference,r,l]);return N.useMemo(()=>a?{reference:d}:{},[a,d])}function iu(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[mm]:s,[ym]:a,...l}=e;i=l}return{...n==="floating"&&{tabIndex:-1,[rA]:""},...i,...t.map(s=>{const a=s?s[n]:null;return typeof a=="function"?e?a(e):null:a}).concat(e).reduce((s,a)=>(a&&Object.entries(a).forEach(l=>{let[c,u]=l;if(!(o&&[mm,ym].includes(c)))if(c.indexOf("on")===0){if(r.has(c)||r.set(c,[]),typeof u=="function"){var f;(f=r.get(c))==null||f.push(u),s[c]=function(){for(var d,h=arguments.length,g=new Array(h),p=0;p<h;p++)g[p]=arguments[p];return(d=r.get(c))==null?void 0:d.map(m=>m(...g)).find(m=>m!==void 0)}}}else s[c]=u}),s),{})}}function H1(e){e===void 0&&(e=[]);const t=e.map(a=>a?.reference),n=e.map(a=>a?.floating),r=e.map(a=>a?.item),o=N.useCallback(a=>iu(a,e,"reference"),t),i=N.useCallback(a=>iu(a,e,"floating"),n),s=N.useCallback(a=>iu(a,e,"item"),r);return N.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:s}),[o,i,s])}const vA=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function W1(e,t){var n,r;t===void 0&&(t={});const{open:o,elements:i,floatingId:s}=e,{enabled:a=!0,role:l="dialog"}=t,c=V1(),u=((n=i.domReference)==null?void 0:n.id)||c,f=N.useMemo(()=>{var y;return((y=p3(i.floating))==null?void 0:y.id)||s},[i.floating,s]),d=(r=vA.get(l))!=null?r:l,g=_h()!=null,p=N.useMemo(()=>d==="tooltip"||l==="label"?{["aria-"+(l==="label"?"labelledby":"describedby")]:o?f:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":d==="alertdialog"?"dialog":d,"aria-controls":o?f:void 0,...d==="listbox"&&{role:"combobox"},...d==="menu"&&{id:u},...d==="menu"&&g&&{role:"menuitem"},...l==="select"&&{"aria-autocomplete":"none"},...l==="combobox"&&{"aria-autocomplete":"list"}},[d,f,g,o,u,l]),m=N.useMemo(()=>{const y={id:f,...d&&{role:d}};return d==="tooltip"||l==="label"?y:{...y,...d==="menu"&&{"aria-labelledby":u}}},[d,f,u,l]),v=N.useCallback(y=>{let{active:x,selected:b}=y;const w={role:"option",...x&&{id:f+"-fui-option"}};switch(l){case"select":case"combobox":return{...w,"aria-selected":b}}return{}},[f,l]);return N.useMemo(()=>a?{reference:p,floating:m,item:v}:{},[a,p,m,v])}const xA=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("g",{opacity:.5},N.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.0002 17.9999C14.4185 17.9999 18.0002 14.4182 18.0002 9.99991C18.0002 5.58163 14.4185 1.99991 10.0002 1.99991C5.58197 1.99991 2.00024 5.58163 2.00024 9.99991C2.00024 14.4182 5.58197 17.9999 10.0002 17.9999ZM6.46514 6.46446C6.85566 6.07393 7.48883 6.07393 7.87935 6.46446L9.64712 8.23222C9.84238 8.42749 10.159 8.42749 10.3542 8.23222L12.122 6.46446C12.5125 6.07393 13.1457 6.07393 13.5362 6.46446C13.9267 6.85498 13.9267 7.48814 13.5362 7.87867L11.7684 9.64644C11.5732 9.8417 11.5732 10.1583 11.7684 10.3535L13.5362 12.1213C13.9267 12.5118 13.9267 13.145 13.5362 13.5355C13.1457 13.926 12.5125 13.926 12.122 13.5355L10.3542 11.7678C10.159 11.5725 9.84238 11.5725 9.64712 11.7678L7.87935 13.5355C7.48883 13.926 6.85566 13.926 6.46514 13.5355C6.07462 13.145 6.07462 12.5118 6.46514 12.1213L8.23291 10.3535C8.42817 10.1583 8.42817 9.8417 8.23291 9.64644L6.46514 7.87867C6.07462 7.48815 6.07462 6.85498 6.46514 6.46446Z",fill:"currentColor"}))),{color:en,spacing:ls}=V,su=T.css({opacity:.6,cursor:"not-allowed"}),xt={"input-container":T.css({backgroundColor:en.fill.accentSecondary,border:`1px solid ${en.border.neutralAlphaBasic}`,padding:`${ls.md} ${ls.lg}`,borderRadius:12,minHeight:40,width:"100%",transition:"border-color 0.2s ease, background-color 0.2s ease","& textarea":{resize:"none"},[`&:not(.${su}):hover`]:{backgroundColor:en.fill.neutralPrimaryHover},"&:focus-within":{borderColor:en.border.accentPrimary,[`&:not(.${su}):hover`]:{borderColor:en.border.accentPrimary}}}),input:T.css({...xe.common,...xe.body1,background:"transparent",width:"100%",color:en.text.primary,"&::placeholder":{color:en.text.tertiary,textOverflow:"ellipsis"}}),"input-text-size_sm":T.css({...xe.body2}),"input-text-size_md":T.css({...xe.body2}),"input-text-align_left":T.css({textAlign:"left"}),"input-text-align_center":T.css({textAlign:"center"}),"input-text-align_right":T.css({textAlign:"right"}),sm:T.css({height:40,padding:ls.md}),md:T.css({height:48,padding:`14px ${ls.lg} 14px ${ls.lg}`}),error:T.css({borderColor:en.border.negativePrimary}),disabled:su,multiline:T.css({height:"auto"}),primary:T.css({background:en.fill.bgPrimary}),secondary:T.css({background:en.fill.bgSecondary}),"clear-button":T.css({cursor:"pointer",color:en.text.tertiary,height:20,"&:hover":{color:en.text.primary}})},{spacing:_m}=V;function Tm(e){return{...new Event("input",{bubbles:!0}),target:e,currentTarget:e}}const $i=S.forwardRef((e,t)=>{const{label:n,prompt:r,error:o,errorText:i,size:s="md",prefix:a,suffix:l,background:c="primary",showClearButton:u,disabled:f,value:d,defaultValue:h,className:g,wrapperClassName:p,labelClassName:m,fieldContainerClassName:v,promptClassName:y,errorClassName:x,textAlign:b="left",...w}=e,_=e.multiline===!0,E=S.useRef(null),R=S.useRef(null),k=_l([E,t]),P=_l([R,t]),{current:F}=S.useRef(d!==void 0),[$,j]=Bo(typeof d=="string"||typeof d=="number"?String(d):void 0,typeof h=="string"||typeof h=="number"?String(h):""),O=M=>{if(j(M.target.value),_){const H=e.onChange;H?.(M)}else{const H=e.onChange;H?.(M)}};S.useEffect(()=>{_&&e.autoResize&&R.current&&(R.current.style.height="auto",R.current.style.height=`${R.current.scrollHeight}px`)},[$,_,e.autoResize]);const D=()=>{if(j(""),!_){const H=E.current;if(H){H.value="";const U=Tm(H),re=e.onChange;re?.(U)}return}const M=R.current;if(M){M.value="";const H=Tm(M),U=e.onChange;U?.(H)}},K=()=>{if(_){const{rows:re,autoResize:G,onChange:Y,multiline:Q,...ne}=w;return C.jsx("textarea",{ref:P,rows:e.rows??3,className:T.cx(xt.input,g,{[xt.disabled]:f,[xt[`input-text-align_${b}`]]:!!b}),disabled:f,maxLength:e.maxLength,...ne,...F?{value:$}:{defaultValue:String(h??"")},onChange:O})}const{onChange:M,multiline:H,...U}=w;return C.jsx("input",{...U,ref:k,className:T.cx(xt.input,xt[`input-text-size_${s}`],g,{[xt.disabled]:f,[xt[`input-text-align_${b}`]]:!!b}),disabled:f,type:e.type??"text",...F?{value:$}:{defaultValue:String(h??"")},onChange:O})},I=S.useMemo(()=>c==="white"?xt.primary:c==="gray"?xt.secondary:xt[c],[c]);return C.jsxs(q,{w:"full",gap:_m.sm,className:p,children:[typeof n=="string"?C.jsx(le,{variant:"body-2",fontWeight:"regular",colorName:"tertiary",className:m,children:n}):n,C.jsxs(q,{row:!0,alignItems:_?"flex-start":"center",w:"full",gap:_m.md,className:T.cx(xt["input-container"],I,xt[s],{[xt.error]:o,[xt.disabled]:f,[xt.multiline]:_},v),children:[a&&C.jsx(q,{flex:"none",children:a}),C.jsx(q,{flex:"1",children:K()}),u&&$&&!f&&C.jsx(q,{flex:"none",children:C.jsx("span",{className:xt["clear-button"],onClick:D,children:C.jsx(xA,{})})}),l&&C.jsx(q,{flex:"none",children:l})]}),(r||_)&&C.jsxs(q,{row:!0,gap:10,w:"full",children:[typeof r=="string"?C.jsx(le,{variant:"caption-1",colorName:"tertiary",className:y,children:r}):r,_&&e.maxLength&&C.jsx(le,{right:!0,ml:"auto",flex:"none",variant:"caption-1",colorName:"tertiary",children:`${$.length}/${e.maxLength}`})]}),i&&o&&C.jsx(le,{variant:"body-2",colorName:"negative",fontWeight:"regular",className:x,children:i})]})});$i.displayName="Input";const bA=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M15 8.33333H5M17.5 5H2.5M17.5 11.6667H2.5M15 15H5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),wA=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M13.3333 8.33333H2.5M16.6667 5H2.5M16.6667 11.6667H2.5M13.3333 15H2.5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),CA=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M17.5 8.33333H6.66665M17.5 5H3.33331M17.5 11.6667H3.33331M17.5 15H6.66665",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),SA=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M5 10H11.6667C13.5076 10 15 8.50766 15 6.66671C15 4.82576 13.5076 3.33337 11.6667 3.33337H5V10ZM5 10H12.5C14.3409 10 15.8333 11.4924 15.8333 13.3334C15.8333 15.1743 14.3409 16.6667 12.5 16.6667H5V10Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),_A=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M13.5 17.5H5.77614C5.2713 17.5 5.01887 17.5 4.90199 17.4002C4.80056 17.3135 4.74674 17.1836 4.75721 17.0506C4.76927 16.8974 4.94776 16.7189 5.30474 16.3619L12.3905 9.27614C12.7205 8.94613 12.8855 8.78112 13.0758 8.7193C13.2432 8.66492 13.4235 8.66492 13.5908 8.7193C13.7811 8.78112 13.9461 8.94613 14.2761 9.27614L17.5 12.5V13.5M13.5 17.5C14.9001 17.5 15.6002 17.5 16.135 17.2275C16.6054 16.9878 16.9878 16.6054 17.2275 16.135C17.5 15.6002 17.5 14.9001 17.5 13.5M13.5 17.5H6.5C5.09987 17.5 4.3998 17.5 3.86502 17.2275C3.39462 16.9878 3.01217 16.6054 2.77248 16.135C2.5 15.6002 2.5 14.9001 2.5 13.5V6.5C2.5 5.09987 2.5 4.3998 2.77248 3.86502C3.01217 3.39462 3.39462 3.01217 3.86502 2.77248C4.3998 2.5 5.09987 2.5 6.5 2.5H13.5C14.9001 2.5 15.6002 2.5 16.135 2.77248C16.6054 3.01217 16.9878 3.39462 17.2275 3.86502C17.5 4.3998 17.5 5.09987 17.5 6.5V13.5M8.75 7.08333C8.75 8.00381 8.00381 8.75 7.08333 8.75C6.16286 8.75 5.41667 8.00381 5.41667 7.08333C5.41667 6.16286 6.16286 5.41667 7.08333 5.41667C8.00381 5.41667 8.75 6.16286 8.75 7.08333Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),TA=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M15.8334 3.33337H8.33335M11.6667 16.6667H4.16669M12.5 3.33337L7.50002 16.6667",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),EA=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("g",{clipPath:"url(#clip0_1571_1710)"},N.createElement("path",{d:"M8.33332 10.8333C8.69119 11.3118 9.14778 11.7077 9.67211 11.9941C10.1964 12.2806 10.7762 12.4509 11.3722 12.4936C11.9681 12.5363 12.5663 12.4503 13.1261 12.2415C13.6859 12.0327 14.1942 11.7059 14.6167 11.2833L17.1167 8.78335C17.8756 7.9975 18.2956 6.94499 18.2861 5.85251C18.2766 4.76002 17.8384 3.71497 17.0659 2.94243C16.2934 2.1699 15.2483 1.7317 14.1558 1.7222C13.0633 1.71271 12.0108 2.13269 11.225 2.89168L9.79165 4.31668M11.6666 9.16668C11.3088 8.68824 10.8522 8.29236 10.3279 8.0059C9.80353 7.71943 9.22373 7.54908 8.62777 7.5064C8.03182 7.46372 7.43366 7.54971 6.87386 7.75853C6.31406 7.96735 5.80572 8.29412 5.38332 8.71668L2.88332 11.2167C2.12432 12.0025 1.70435 13.055 1.71384 14.1475C1.72334 15.24 2.16154 16.2851 2.93407 17.0576C3.70661 17.8301 4.75166 18.2683 5.84414 18.2778C6.93663 18.2873 7.98914 17.8673 8.77498 17.1083L10.2 15.6833",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),N.createElement("defs",null,N.createElement("clipPath",{id:"clip0_1571_1710"},N.createElement("rect",{width:20,height:20,fill:"white"})))),RA=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M17.5 9.99996L7.5 9.99996M17.5 4.99996L7.5 4.99996M17.5 15L7.5 15M4.16667 9.99996C4.16667 10.4602 3.79357 10.8333 3.33333 10.8333C2.8731 10.8333 2.5 10.4602 2.5 9.99996C2.5 9.53972 2.8731 9.16663 3.33333 9.16663C3.79357 9.16663 4.16667 9.53972 4.16667 9.99996ZM4.16667 4.99996C4.16667 5.4602 3.79357 5.83329 3.33333 5.83329C2.8731 5.83329 2.5 5.4602 2.5 4.99996C2.5 4.53972 2.8731 4.16663 3.33333 4.16663C3.79357 4.16663 4.16667 4.53972 4.16667 4.99996ZM4.16667 15C4.16667 15.4602 3.79357 15.8333 3.33333 15.8333C2.8731 15.8333 2.5 15.4602 2.5 15C2.5 14.5397 2.8731 14.1666 3.33333 14.1666C3.79357 14.1666 4.16667 14.5397 4.16667 15Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),kA=e=>N.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M14 8.74967C14.4142 8.74967 14.75 8.41389 14.75 7.99967C14.75 7.58546 14.4142 7.24967 14 7.24967V7.99967V8.74967ZM6 7.24967C5.58579 7.24967 5.25 7.58546 5.25 7.99967C5.25 8.41389 5.58579 8.74967 6 8.74967V7.99967V7.24967ZM14 4.74967C14.4142 4.74967 14.75 4.41389 14.75 3.99967C14.75 3.58546 14.4142 3.24967 14 3.24967V3.99967V4.74967ZM6 3.24967C5.58579 3.24967 5.25 3.58546 5.25 3.99967C5.25 4.41389 5.58579 4.74967 6 4.74967V3.99967V3.24967ZM14 12.7497C14.4142 12.7497 14.75 12.4139 14.75 11.9997C14.75 11.5855 14.4142 11.2497 14 11.2497V11.9997V12.7497ZM6 11.2497C5.58579 11.2497 5.25 11.5855 5.25 11.9997C5.25 12.4139 5.58579 12.7497 6 12.7497V11.9997V11.2497ZM1.58967 3.48952C1.24295 3.71614 1.14558 4.18092 1.3722 4.52765C1.59882 4.87437 2.0636 4.97174 2.41033 4.74512L2 4.11732L1.58967 3.48952ZM3.2 3.33301H3.95C3.95 3.05764 3.79909 2.80441 3.5569 2.67337C3.31471 2.54233 3.02018 2.55455 2.78967 2.70521L3.2 3.33301ZM2.4 5.91634C1.98579 5.91634 1.65 6.25213 1.65 6.66634C1.65 7.08055 1.98579 7.41634 2.4 7.41634V6.66634V5.91634ZM4 7.41634C4.41421 7.41634 4.75 7.08055 4.75 6.66634C4.75 6.25213 4.41421 5.91634 4 5.91634V6.66634V7.41634ZM3.73743 10.8967L4.2726 11.4222L4.2726 11.4222L3.73743 10.8967ZM2 12.6663L1.46483 12.1409C1.25318 12.3565 1.19153 12.678 1.30841 12.9565C1.4253 13.2351 1.69791 13.4163 2 13.4163V12.6663ZM4 13.4163C4.41421 13.4163 4.75 13.0806 4.75 12.6663C4.75 12.2521 4.41421 11.9163 4 11.9163V12.6663V13.4163ZM1.25 10.2589C1.25 10.6731 1.58579 11.0089 2 11.0089C2.41421 11.0089 2.75 10.6731 2.75 10.2589H2H1.25ZM14 7.99967V7.24967L6 7.24967V7.99967V8.74967L14 8.74967V7.99967ZM14 3.99967V3.24967H6V3.99967V4.74967H14V3.99967ZM14 11.9997V11.2497L6 11.2497V11.9997V12.7497L14 12.7497V11.9997ZM2 4.11732L2.41033 4.74512L3.61033 3.96081L3.2 3.33301L2.78967 2.70521L1.58967 3.48952L2 4.11732ZM3.2 3.33301H2.45V6.66634H3.2H3.95V3.33301H3.2ZM3.2 6.66634V5.91634H2.4V6.66634V7.41634H3.2V6.66634ZM3.2 6.66634V7.41634H4V6.66634V5.91634H3.2V6.66634ZM3.73743 10.8967L3.20226 10.3713L1.46483 12.1409L2 12.6663L2.53517 13.1918L4.2726 11.4222L3.73743 10.8967ZM2 12.6663V13.4163H4V12.6663V11.9163H2V12.6663ZM4 10.2654H3.25C3.25 10.2957 3.23759 10.3353 3.20225 10.3713L3.73743 10.8967L4.2726 11.4222C4.57518 11.114 4.75 10.7002 4.75 10.2654H4ZM3 9.33301V10.083C3.08406 10.083 3.1515 10.1147 3.19493 10.1553C3.23791 10.1955 3.25 10.2354 3.25 10.2654H4H4.75C4.75 9.29296 3.91808 8.58301 3 8.58301V9.33301ZM2 10.2589H2.75C2.75 10.2299 2.76126 10.1927 2.80245 10.1545C2.84462 10.1155 2.91258 10.083 3 10.083V9.33301V8.58301C2.0889 8.58301 1.25 9.28004 1.25 10.2589H2Z",fill:"currentColor"})),AA=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M5 13.3334C5 15.1743 6.49238 16.6667 8.33333 16.6667H11.6667C13.5076 16.6667 15 15.1743 15 13.3334C15 11.4924 13.5076 10 11.6667 10M15 6.66671C15 4.82576 13.5076 3.33337 11.6667 3.33337H8.33333C6.49238 3.33337 5 4.82576 5 6.66671M2.5 10H17.5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),NA=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M2.5 7.5L17.5 7.5M7.5 2.5L7.5 17.5M6.5 2.5H13.5C14.9001 2.5 15.6002 2.5 16.135 2.77248C16.6054 3.01217 16.9878 3.39462 17.2275 3.86502C17.5 4.3998 17.5 5.09987 17.5 6.5V13.5C17.5 14.9001 17.5 15.6002 17.2275 16.135C16.9878 16.6054 16.6054 16.9878 16.135 17.2275C15.6002 17.5 14.9001 17.5 13.5 17.5H6.5C5.09987 17.5 4.3998 17.5 3.86502 17.2275C3.39462 16.9878 3.01217 16.6054 2.77248 16.135C2.5 15.6002 2.5 14.9001 2.5 13.5V6.5C2.5 5.09987 2.5 4.3998 2.77248 3.86502C3.01217 3.39462 3.39462 3.01217 3.86502 2.77248C4.3998 2.5 5.09987 2.5 6.5 2.5Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),MA=e=>N.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M15 3.33337V9.16671C15 11.9281 12.7614 14.1667 9.99998 14.1667C7.23856 14.1667 4.99998 11.9281 4.99998 9.16671V3.33337M3.33331 17.5H16.6666",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),kh=S.createContext(null);function na(){const e=S.useContext(kh);if(!e)throw new Error("useEditorStates must be used within EditorState Provider");return e}const K1=S.createContext(null);function PA(){const e=S.useContext(K1);if(!e)throw new Error("useToolbarContext must be used within ToolbarContext provider");return e}var bs={exports:{}};bs.exports;var Em;function LA(){return Em||(Em=1,(function(e,t){var n=200,r="__lodash_hash_undefined__",o=800,i=16,s=9007199254740991,a="[object Arguments]",l="[object Array]",c="[object AsyncFunction]",u="[object Boolean]",f="[object Date]",d="[object Error]",h="[object Function]",g="[object GeneratorFunction]",p="[object Map]",m="[object Number]",v="[object Null]",y="[object Object]",x="[object Proxy]",b="[object RegExp]",w="[object Set]",_="[object String]",E="[object Undefined]",R="[object WeakMap]",k="[object ArrayBuffer]",P="[object DataView]",F="[object Float32Array]",$="[object Float64Array]",j="[object Int8Array]",O="[object Int16Array]",D="[object Int32Array]",K="[object Uint8Array]",I="[object Uint8ClampedArray]",M="[object Uint16Array]",H="[object Uint32Array]",U=/[\\^$.*+?()[\]{}|]/g,re=/^\[object .+?Constructor\]$/,G=/^(?:0|[1-9]\d*)$/,Y={};Y[F]=Y[$]=Y[j]=Y[O]=Y[D]=Y[K]=Y[I]=Y[M]=Y[H]=!0,Y[a]=Y[l]=Y[k]=Y[u]=Y[P]=Y[f]=Y[d]=Y[h]=Y[p]=Y[m]=Y[y]=Y[b]=Y[w]=Y[_]=Y[R]=!1;var Q=typeof Bn=="object"&&Bn&&Bn.Object===Object&&Bn,ne=typeof self=="object"&&self&&self.Object===Object&&self,oe=Q||ne||Function("return this")(),me=t&&!t.nodeType&&t,ee=me&&!0&&e&&!e.nodeType&&e,ve=ee&&ee.exports===me,Se=ve&&Q.process,Ee=(function(){try{var A=ee&&ee.require&&ee.require("util").types;return A||Se&&Se.binding&&Se.binding("util")}catch{}})(),ze=Ee&&Ee.isTypedArray;function je(A,L,z){switch(z.length){case 0:return A.call(L);case 1:return A.call(L,z[0]);case 2:return A.call(L,z[0],z[1]);case 3:return A.call(L,z[0],z[1],z[2])}return A.apply(L,z)}function Rt(A,L){for(var z=-1,ie=Array(A);++z<A;)ie[z]=L(z);return ie}function gn(A){return function(L){return A(L)}}function ot(A,L){return A?.[L]}function Gt(A,L){return function(z){return A(L(z))}}var Qt=Array.prototype,pt=Function.prototype,se=Object.prototype,Re=oe["__core-js_shared__"],Ye=pt.toString,rt=se.hasOwnProperty,It=(function(){var A=/[^.]+$/.exec(Re&&Re.keys&&Re.keys.IE_PROTO||"");return A?"Symbol(src)_1."+A:""})(),to=se.toString,no=Ye.call(Object),pa=RegExp("^"+Ye.call(rt).replace(U,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),qo=ve?oe.Buffer:void 0,Ce=oe.Symbol,Le=oe.Uint8Array;qo&&qo.allocUnsafe;var Yo=Gt(Object.getPrototypeOf,Object),Ag=Object.create,TS=se.propertyIsEnumerable,ES=Qt.splice,ro=Ce?Ce.toStringTag:void 0,ma=(function(){try{var A=kc(Object,"defineProperty");return A({},"",{}),A}catch{}})(),RS=qo?qo.isBuffer:void 0,Ng=Math.max,kS=Date.now,Mg=kc(oe,"Map"),rs=kc(Object,"create"),AS=(function(){function A(){}return function(L){if(!io(L))return{};if(Ag)return Ag(L);A.prototype=L;var z=new A;return A.prototype=void 0,z}})();function oo(A){var L=-1,z=A==null?0:A.length;for(this.clear();++L<z;){var ie=A[L];this.set(ie[0],ie[1])}}function NS(){this.__data__=rs?rs(null):{},this.size=0}function MS(A){var L=this.has(A)&&delete this.__data__[A];return this.size-=L?1:0,L}function PS(A){var L=this.__data__;if(rs){var z=L[A];return z===r?void 0:z}return rt.call(L,A)?L[A]:void 0}function LS(A){var L=this.__data__;return rs?L[A]!==void 0:rt.call(L,A)}function FS(A,L){var z=this.__data__;return this.size+=this.has(A)?0:1,z[A]=rs&&L===void 0?r:L,this}oo.prototype.clear=NS,oo.prototype.delete=MS,oo.prototype.get=PS,oo.prototype.has=LS,oo.prototype.set=FS;function Qn(A){var L=-1,z=A==null?0:A.length;for(this.clear();++L<z;){var ie=A[L];this.set(ie[0],ie[1])}}function $S(){this.__data__=[],this.size=0}function OS(A){var L=this.__data__,z=ya(L,A);if(z<0)return!1;var ie=L.length-1;return z==ie?L.pop():ES.call(L,z,1),--this.size,!0}function IS(A){var L=this.__data__,z=ya(L,A);return z<0?void 0:L[z][1]}function DS(A){return ya(this.__data__,A)>-1}function jS(A,L){var z=this.__data__,ie=ya(z,A);return ie<0?(++this.size,z.push([A,L])):z[ie][1]=L,this}Qn.prototype.clear=$S,Qn.prototype.delete=OS,Qn.prototype.get=IS,Qn.prototype.has=DS,Qn.prototype.set=jS;function Xo(A){var L=-1,z=A==null?0:A.length;for(this.clear();++L<z;){var ie=A[L];this.set(ie[0],ie[1])}}function VS(){this.size=0,this.__data__={hash:new oo,map:new(Mg||Qn),string:new oo}}function BS(A){var L=xa(this,A).delete(A);return this.size-=L?1:0,L}function zS(A){return xa(this,A).get(A)}function HS(A){return xa(this,A).has(A)}function WS(A,L){var z=xa(this,A),ie=z.size;return z.set(A,L),this.size+=z.size==ie?0:1,this}Xo.prototype.clear=VS,Xo.prototype.delete=BS,Xo.prototype.get=zS,Xo.prototype.has=HS,Xo.prototype.set=WS;function Zo(A){var L=this.__data__=new Qn(A);this.size=L.size}function KS(){this.__data__=new Qn,this.size=0}function US(A){var L=this.__data__,z=L.delete(A);return this.size=L.size,z}function GS(A){return this.__data__.get(A)}function qS(A){return this.__data__.has(A)}function YS(A,L){var z=this.__data__;if(z instanceof Qn){var ie=z.__data__;if(!Mg||ie.length<n-1)return ie.push([A,L]),this.size=++z.size,this;z=this.__data__=new Xo(ie)}return z.set(A,L),this.size=z.size,this}Zo.prototype.clear=KS,Zo.prototype.delete=US,Zo.prototype.get=GS,Zo.prototype.has=qS,Zo.prototype.set=YS;function XS(A,L){var z=Mc(A),ie=!z&&Nc(A),_e=!z&&!ie&&Og(A),Oe=!z&&!ie&&!_e&&Dg(A),He=z||ie||_e||Oe,Ae=He?Rt(A.length,String):[],We=Ae.length;for(var pn in A)He&&(pn=="length"||_e&&(pn=="offset"||pn=="parent")||Oe&&(pn=="buffer"||pn=="byteLength"||pn=="byteOffset")||Fg(pn,We))||Ae.push(pn);return Ae}function Ec(A,L,z){(z!==void 0&&!ba(A[L],z)||z===void 0&&!(L in A))&&Rc(A,L,z)}function ZS(A,L,z){var ie=A[L];(!(rt.call(A,L)&&ba(ie,z))||z===void 0&&!(L in A))&&Rc(A,L,z)}function ya(A,L){for(var z=A.length;z--;)if(ba(A[z][0],L))return z;return-1}function Rc(A,L,z){L=="__proto__"&&ma?ma(A,L,{configurable:!0,enumerable:!0,value:z,writable:!0}):A[L]=z}var JS=d_();function va(A){return A==null?A===void 0?E:v:ro&&ro in Object(A)?f_(A):v_(A)}function Pg(A){return os(A)&&va(A)==a}function QS(A){if(!io(A)||m_(A))return!1;var L=Lc(A)?pa:re;return L.test(C_(A))}function e_(A){return os(A)&&Ig(A.length)&&!!Y[va(A)]}function t_(A){if(!io(A))return y_(A);var L=$g(A),z=[];for(var ie in A)ie=="constructor"&&(L||!rt.call(A,ie))||z.push(ie);return z}function Lg(A,L,z,ie,_e){A!==L&&JS(L,function(Oe,He){if(_e||(_e=new Zo),io(Oe))n_(A,L,He,z,Lg,ie,_e);else{var Ae=ie?ie(Ac(A,He),Oe,He+"",A,L,_e):void 0;Ae===void 0&&(Ae=Oe),Ec(A,He,Ae)}},jg)}function n_(A,L,z,ie,_e,Oe,He){var Ae=Ac(A,z),We=Ac(L,z),pn=He.get(We);if(pn){Ec(A,z,pn);return}var qt=Oe?Oe(Ae,We,z+"",A,L,He):void 0,is=qt===void 0;if(is){var Fc=Mc(We),$c=!Fc&&Og(We),Bg=!Fc&&!$c&&Dg(We);qt=We,Fc||$c||Bg?Mc(Ae)?qt=Ae:S_(Ae)?qt=l_(Ae):$c?(is=!1,qt=i_(We)):Bg?(is=!1,qt=a_(We)):qt=[]:__(We)||Nc(We)?(qt=Ae,Nc(Ae)?qt=T_(Ae):(!io(Ae)||Lc(Ae))&&(qt=h_(We))):is=!1}is&&(He.set(We,qt),_e(qt,We,ie,Oe,He),He.delete(We)),Ec(A,z,qt)}function r_(A,L){return b_(x_(A,L,Vg),A+"")}var o_=ma?function(A,L){return ma(A,"toString",{configurable:!0,enumerable:!1,value:R_(L),writable:!0})}:Vg;function i_(A,L){return A.slice()}function s_(A){var L=new A.constructor(A.byteLength);return new Le(L).set(new Le(A)),L}function a_(A,L){var z=s_(A.buffer);return new A.constructor(z,A.byteOffset,A.length)}function l_(A,L){var z=-1,ie=A.length;for(L||(L=Array(ie));++z<ie;)L[z]=A[z];return L}function c_(A,L,z,ie){var _e=!z;z||(z={});for(var Oe=-1,He=L.length;++Oe<He;){var Ae=L[Oe],We=void 0;We===void 0&&(We=A[Ae]),_e?Rc(z,Ae,We):ZS(z,Ae,We)}return z}function u_(A){return r_(function(L,z){var ie=-1,_e=z.length,Oe=_e>1?z[_e-1]:void 0,He=_e>2?z[2]:void 0;for(Oe=A.length>3&&typeof Oe=="function"?(_e--,Oe):void 0,He&&g_(z[0],z[1],He)&&(Oe=_e<3?void 0:Oe,_e=1),L=Object(L);++ie<_e;){var Ae=z[ie];Ae&&A(L,Ae,ie,Oe)}return L})}function d_(A){return function(L,z,ie){for(var _e=-1,Oe=Object(L),He=ie(L),Ae=He.length;Ae--;){var We=He[++_e];if(z(Oe[We],We,Oe)===!1)break}return L}}function xa(A,L){var z=A.__data__;return p_(L)?z[typeof L=="string"?"string":"hash"]:z.map}function kc(A,L){var z=ot(A,L);return QS(z)?z:void 0}function f_(A){var L=rt.call(A,ro),z=A[ro];try{A[ro]=void 0;var ie=!0}catch{}var _e=to.call(A);return ie&&(L?A[ro]=z:delete A[ro]),_e}function h_(A){return typeof A.constructor=="function"&&!$g(A)?AS(Yo(A)):{}}function Fg(A,L){var z=typeof A;return L=L??s,!!L&&(z=="number"||z!="symbol"&&G.test(A))&&A>-1&&A%1==0&&A<L}function g_(A,L,z){if(!io(z))return!1;var ie=typeof L;return(ie=="number"?Pc(z)&&Fg(L,z.length):ie=="string"&&L in z)?ba(z[L],A):!1}function p_(A){var L=typeof A;return L=="string"||L=="number"||L=="symbol"||L=="boolean"?A!=="__proto__":A===null}function m_(A){return!!It&&It in A}function $g(A){var L=A&&A.constructor,z=typeof L=="function"&&L.prototype||se;return A===z}function y_(A){var L=[];if(A!=null)for(var z in Object(A))L.push(z);return L}function v_(A){return to.call(A)}function x_(A,L,z){return L=Ng(L===void 0?A.length-1:L,0),function(){for(var ie=arguments,_e=-1,Oe=Ng(ie.length-L,0),He=Array(Oe);++_e<Oe;)He[_e]=ie[L+_e];_e=-1;for(var Ae=Array(L+1);++_e<L;)Ae[_e]=ie[_e];return Ae[L]=z(He),je(A,this,Ae)}}function Ac(A,L){if(!(L==="constructor"&&typeof A[L]=="function")&&L!="__proto__")return A[L]}var b_=w_(o_);function w_(A){var L=0,z=0;return function(){var ie=kS(),_e=i-(ie-z);if(z=ie,_e>0){if(++L>=o)return arguments[0]}else L=0;return A.apply(void 0,arguments)}}function C_(A){if(A!=null){try{return Ye.call(A)}catch{}try{return A+""}catch{}}return""}function ba(A,L){return A===L||A!==A&&L!==L}var Nc=Pg((function(){return arguments})())?Pg:function(A){return os(A)&&rt.call(A,"callee")&&!TS.call(A,"callee")},Mc=Array.isArray;function Pc(A){return A!=null&&Ig(A.length)&&!Lc(A)}function S_(A){return os(A)&&Pc(A)}var Og=RS||k_;function Lc(A){if(!io(A))return!1;var L=va(A);return L==h||L==g||L==c||L==x}function Ig(A){return typeof A=="number"&&A>-1&&A%1==0&&A<=s}function io(A){var L=typeof A;return A!=null&&(L=="object"||L=="function")}function os(A){return A!=null&&typeof A=="object"}function __(A){if(!os(A)||va(A)!=y)return!1;var L=Yo(A);if(L===null)return!0;var z=rt.call(L,"constructor")&&L.constructor;return typeof z=="function"&&z instanceof z&&Ye.call(z)==no}var Dg=ze?gn(ze):e_;function T_(A){return c_(A,jg(A))}function jg(A){return Pc(A)?XS(A):t_(A)}var E_=u_(function(A,L,z){Lg(A,L,z)});function R_(A){return function(){return A}}function Vg(A){return A}function k_(){return!1}e.exports=E_})(bs,bs.exports)),bs.exports}var FA=LA();const $A=Ff(FA),U1=S.createContext(null);function OA(){return S.useContext(U1)}function IA({children:e,locale:t}){return C.jsx(U1.Provider,{value:t||null,children:e})}function DA({localeKey:e,defaultLocale:t}){const n=S.createContext(t);function r(s){const{extraLocale:a}=s||{},l=OA();return{value:S.useMemo(()=>{const u=l?l[e]:null,f=[{},t];return u&&f.push(u),a&&f.push(a),$A(...f)},[t,a,e,l])}}function o(){return S.useContext(n)}function i({children:s,locale:a}){const{value:l}=r({extraLocale:a});return C.jsx(n.Provider,{value:l,children:s})}return{Context:n,useComposeLocaleProviderValue:r,useLocale:o,Provider:i}}const G1="MarkdownTextEditor",jA={toolbar:{link:{textPlaceholder:"Enter the text to display",linkPlaceholder:"Paste a link",linkErrorText:"Please enter a valid link",buttonText:"Save"},table:{maxRowsErrorText:e=>`Maximum number of rows is ${e.limit}`,maxColumnsErrorText:e=>`Maximum number of columns is ${e.limit}`,minRowsErrorText:e=>`Minimum number of rows is ${e.limit}`,minColumnsErrorText:e=>`Minimum number of columns is ${e.limit}`,rowsPlaceholder:"Rows count",columnsPlaceholder:"Columns count",buttonText:"Create table"},textSize:{paragraph:"Normal text",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3"},preview:{show:"Preview",hide:"Preview"},actions:{bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",link:"Link",image:"Image",alignLeft:"Align left",alignCenter:"Align center",alignRight:"Align right",table:"Table",bulletList:"Bullet list",numberedList:"Numbered list"}}},{Provider:VA,useLocale:ra}=DA({localeKey:G1,defaultLocale:jA}),q1=S.createContext(null);function BA(e,t){return{getTheme:function(){return t??null}}}function lt(){const e=S.useContext(q1);return e==null&&(function(t,...n){const r=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",t);for(const i of n)o.append("v",i);throw r.search=o.toString(),Error(`Minified Lexical error #${t}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(8),e}function X(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Y1(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);n.search=r.toString(),console.warn(`Minified Lexical warning #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const Ln=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,zA=Ln&&"documentMode"in document?document.documentMode:null,wn=Ln&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Ao=Ln&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Tl=!(!Ln||!("InputEvent"in window)||zA)&&"getTargetRanges"in new window.InputEvent("input"),oa=Ln&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),qi=Ln&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,HA=Ln&&/Android/.test(navigator.userAgent),X1=Ln&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Rm=Ln&&HA&&X1,ia=Ln&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&wn&&!X1;function Z1(...e){const t=[];for(const n of e)if(n&&typeof n=="string")for(const[r]of n.matchAll(/\S+/g))t.push(r);return t}const WA=0,KA=1,UA=2,J1=128,GA=1,qA=2,YA=3,XA=4,ZA=5,JA=6,rc=oa||qi||ia?" ":"​",Wr=`
35
35
 
36
- `,w3=ko?" ":Zl,Hr={bold:1,capitalize:1024,code:16,highlight:Lb,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},C3={directionless:1,unmergeable:2},cm={center:2,end:6,justify:4,left:1,right:3,start:5},S3={[m3]:"center",[b3]:"end",[v3]:"justify",[p3]:"left",[y3]:"right",[x3]:"start"},_3={normal:0,segmented:2,token:1},T3={[f3]:"normal",[g3]:"segmented",[h3]:"token"},um="$config";function Fb(e,t,n,r,o,i){let s=e.getFirstChild();for(;s!==null;){const a=s.__key;s.__parent===t&&(B(s)&&Fb(s,a,n,r,o,i),n.has(a)||i.delete(a),o.push(a)),s=s.getNextSibling()}}let Nd=!1,ph=0;function E3(e){ph=e.timeStamp}function Qc(e,t,n){const r=e.nodeName==="BR",o=t.__lexicalLineBreak;return o&&(e===o||r&&e.previousSibling===o)||r&&cc(e,n)!==void 0}function R3(e,t,n){const r=Ot(hn(n));let o=null,i=null;r!==null&&r.anchorNode===e&&(o=r.anchorOffset,i=r.focusOffset);const s=e.nodeValue;s!==null&&Ih(t,s,o,i,!1)}function k3(e,t,n){if(W(e)){const r=e.anchor.getNode();if(r.is(n)&&e.format!==r.getFormat())return!1}return Cr(t)&&n.isAttached()}function A3(e,t,n,r){for(let o=e;o&&!LA(o);o=la(o)){const i=cc(o,t);if(i!==void 0){const s=Pe(i,n);if(s)return Te(s)||!Be(o)?void 0:[o,s]}else if(o===r)return[r,$1(n)]}}function $b(e,t,n){Nd=!0;const r=performance.now()-ph>100;try{Un(e,()=>{const o=X()||(function(d){return d.getEditorState().read(()=>{const h=X();return h!==null?h.clone():null})})(e),i=new Map,s=e.getRootElement(),a=e._editorState,l=e._blockCursorElement;let c=!1,u="";for(let d=0;d<t.length;d++){const h=t[d],g=h.type,p=h.target,m=A3(p,e,a,s);if(!m)continue;const[v,y]=m;if(g==="characterData")r&&J(y)&&Cr(p)&&k3(o,p,y)&&R3(p,y,e);else if(g==="childList"){c=!0;const x=h.addedNodes;for(let _=0;_<x.length;_++){const E=x[_],R=L1(E),k=E.parentNode;if(k!=null&&E!==l&&R===null&&!Qc(E,k,e)){if(ko){const M=(Be(E)?E.innerText:null)||E.nodeValue;M&&(u+=M)}k.removeChild(E)}}const b=h.removedNodes,w=b.length;if(w>0){let _=0;for(let E=0;E<w;E++){const R=b[E];(Qc(R,p,e)||l===R)&&(p.appendChild(R),_++)}w!==_&&i.set(v,y)}}}if(i.size>0)for(const[d,h]of i)h.reconcileObservedMutation(d,e);const f=n.takeRecords();if(f.length>0){for(let d=0;d<f.length;d++){const h=f[d],g=h.addedNodes,p=h.target;for(let m=0;m<g.length;m++){const v=g[m],y=v.parentNode;y==null||v.nodeName!=="BR"||Qc(v,p,e)||y.removeChild(v)}}n.takeRecords()}o!==null&&(c&&Ge(o),ko&&j1(e)&&o.insertRawText(u))})}finally{Nd=!1}}function Ob(e){const t=e._observer;t!==null&&$b(e,t.takeRecords(),t)}function Ib(e){(function(t){ph===0&&hn(t).addEventListener("textInput",E3,!0)})(e),e._observer=new MutationObserver((t,n)=>{$b(e,t,n)})}let N3=class{key;parse;unparse;isEqual;defaultValue;constructor(t,n){this.key=t,this.parse=n.parse.bind(n),this.unparse=(n.unparse||F3).bind(n),this.isEqual=(n.isEqual||Object.is).bind(n),this.defaultValue=this.parse(void 0)}};function M3(e,t){return new N3(e,t)}function Db(e,t,n="latest"){const r=(n==="latest"?e.getLatest():e).__state;return r?r.getValue(t):t.defaultValue}function eu(e,t,n){let r;if(ft(),typeof n=="function"){const i=e.getLatest(),s=Db(i,t);if(r=n(s),t.isEqual(s,r))return i}else r=n;const o=e.getWritable();return Vb(o).updateFromKnown(t,r),o}function P3(e){const t=new Map,n=new Set;for(let r=typeof e=="function"?e:e.replace;r.prototype&&r.prototype.getType!==void 0;r=Object.getPrototypeOf(r)){const{ownNodeConfig:o}=dc(r);if(o&&o.stateConfigs)for(const i of o.stateConfigs){let s;"stateConfig"in i?(s=i.stateConfig,i.flat&&n.add(s.key)):s=i,t.set(s.key,s)}}return{flatKeys:n,sharedConfigMap:t}}let L3=class jb{node;knownState;unknownState;sharedNodeState;size;constructor(t,n,r=void 0,o=new Map,i=void 0){this.node=t,this.sharedNodeState=n,this.unknownState=r,this.knownState=o;const{sharedConfigMap:s}=this.sharedNodeState,a=i!==void 0?i:(function(l,c,u){let f=u.size;if(c)for(const d in c){const h=l.get(d);h&&u.has(h)||f++}return f})(s,r,o);this.size=a}getValue(t){const n=this.knownState.get(t);if(n!==void 0)return n;this.sharedNodeState.sharedConfigMap.set(t.key,t);let r=t.defaultValue;if(this.unknownState&&t.key in this.unknownState){const o=this.unknownState[t.key];o!==void 0&&(r=t.parse(o)),this.updateFromKnown(t,r)}return r}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){const t={...this.unknownState},n={};for(const[r,o]of this.knownState)r.isEqual(o,r.defaultValue)?delete t[r.key]:t[r.key]=r.unparse(o);for(const r of this.sharedNodeState.flatKeys)r in t&&(n[r]=t[r],delete t[r]);return dm(t)&&(n.$=t),n}getWritable(t){if(this.node===t)return this;const{sharedNodeState:n,unknownState:r}=this,o=new Map(this.knownState);return new jb(t,n,(function(i,s,a){let l;if(a)for(const[c,u]of Object.entries(a)){const f=i.get(c);f?s.has(f)||s.set(f,f.parse(u)):(l=l||{},l[c]=u)}return l})(n.sharedConfigMap,o,r),o,this.size)}updateFromKnown(t,n){const r=t.key;this.sharedNodeState.sharedConfigMap.set(r,t);const{knownState:o,unknownState:i}=this;o.has(t)||i&&r in i||(i&&(delete i[r],this.unknownState=dm(i)),this.size++),o.set(t,n)}updateFromUnknown(t,n){const r=this.sharedNodeState.sharedConfigMap.get(t);r?this.updateFromKnown(r,r.parse(n)):(this.unknownState=this.unknownState||{},t in this.unknownState||this.size++,this.unknownState[t]=n)}updateFromJSON(t){const{knownState:n}=this;for(const r of n.keys())n.set(r,r.defaultValue);if(this.size=n.size,this.unknownState=void 0,t)for(const[r,o]of Object.entries(t))this.updateFromUnknown(r,o)}};function Vb(e){const t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new L3(t,Bb(t));return t.__state=n,n}function Bb(e){return e.__state?e.__state.sharedNodeState:R1(Zi(),e.getType()).sharedNodeState}function dm(e){if(e)for(const t in e)return e}function F3(e){return e}function fm(e,t,n){for(const[r,o]of t.knownState){if(e.has(r.key))continue;e.add(r.key);const i=n?n.getValue(r):r.defaultValue;if(i!==o&&!r.isEqual(i,o))return!0}return!1}function hm(e,t,n){const{unknownState:r}=t,o=n?n.unknownState:void 0;if(r){for(const[i,s]of Object.entries(r))if(!e.has(i)&&(e.add(i),s!==(o?o[i]:void 0)))return!0}return!1}function gm(e,t){const n=e.__state;return n&&n.node===e?n.getWritable(t):n}function pm(e,t){const n=e.__mode,r=e.__format,o=e.__style,i=t.__mode,s=t.__format,a=t.__style,l=e.__state,c=t.__state;return(n===null||n===i)&&(r===null||r===s)&&(o===null||o===a)&&(e.__state===null||l===c||(function(u,f){if(u===f)return!0;if(u&&f&&u.size!==f.size)return!1;const d=new Set;return!(u&&fm(d,u,f)||f&&fm(d,f,u)||u&&hm(d,u,f)||f&&hm(d,f,u))})(l,c))}function mm(e,t){const n=e.mergeWithSibling(t),r=$e()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function ym(e){let t,n,r=e;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(t=r.getPreviousSibling())!==null&&J(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(pm(t,r)){r=mm(t,r);break}break}t.remove()}for(;(n=r.getNextSibling())!==null&&J(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(n.__text!==""){if(pm(r,n)){r=mm(r,n);break}break}n.remove()}}else r.remove()}function Bs(e){return vm(e.anchor),vm(e.focus),e}function vm(e){for(;e.type==="element";){const t=e.getNode(),n=e.offset;let r,o;if(n===t.getChildrenSize()?(r=t.getChildAtIndex(n-1),o=!0):(r=t.getChildAtIndex(n),o=!1),J(r)){e.set(r.__key,o?r.getTextContentSize():0,"text",!0);break}if(!B(r))break;e.set(r.__key,o?r.getChildrenSize():0,"element",!0)}}let Ao,_t,zs,Jl,Md,Pd,No,En,Ld,Hs,ut="",Dn=null,fo=null,lr="",ci=!1,wl=!1;function Cl(e,t){const n=No.get(e);if(t!==null){const r=Id(e);r.parentNode===t&&t.removeChild(r)}if(En.has(e)||_t._keyToDOMMap.delete(e),B(n)){const r=_l(n,No);Fd(r,0,r.length-1,null)}n!==void 0&&Dh(Hs,zs,Jl,n,"destroyed")}function Fd(e,t,n,r){let o=t;for(;o<=n;++o){const i=e[o];i!==void 0&&Cl(i,r)}}function lo(e,t){e.setProperty("text-align",t)}const $3="40px";function zb(e,t){const n=Ao.theme.indent;if(typeof n=="string"){const o=e.classList.contains(n);t>0&&!o?e.classList.add(n):t<1&&o&&e.classList.remove(n)}const r=getComputedStyle(e).getPropertyValue("--lexical-indent-base-value")||$3;e.style.setProperty("padding-inline-start",t===0?"":`calc(${t} * ${r})`)}function Hb(e,t){const n=e.style;t===0?lo(n,""):t===1?lo(n,"left"):t===2?lo(n,"center"):t===3?lo(n,"right"):t===4?lo(n,"justify"):t===5?lo(n,"start"):t===6&&lo(n,"end")}function $d(e,t){const n=(function(r){const o=r.__dir;if(o!==null)return o;if(at(r))return null;const i=r.getParentOrThrow();return at(i)&&i.__dir===null?"auto":null})(t);n!==null?e.dir=n:e.removeAttribute("dir")}function Sl(e,t){const n=En.get(e);n===void 0&&Y(60);const r=n.createDOM(Ao,_t);if((function(o,i,s){const a=s._keyToDOMMap;(function(l,c,u){const f=`__lexicalKey_${c._key}`;l[f]=u})(i,s,o),a.set(o,i)})(e,r,_t),J(n)?r.setAttribute("data-lexical-text","true"):Te(n)&&r.setAttribute("data-lexical-decorator","true"),B(n)){const o=n.__indent,i=n.__size;if($d(r,n),o!==0&&zb(r,o),i!==0){const a=i-1;Od(_l(n,En),n,0,a,n.getDOMSlot(r))}const s=n.__format;s!==0&&Hb(r,s),n.isInline()||Wb(null,n,r),uc(n)&&(ut+=zr,lr+=zr)}else{const o=n.getTextContent();if(Te(n)){const i=n.decorate(_t,Ao);i!==null&&Kb(e,i),r.contentEditable="false"}ut+=o,lr+=o}return t!==null&&t.insertChild(r),Dh(Hs,zs,Jl,n,"created"),r}function Od(e,t,n,r,o){const i=ut;ut="";let s=n;for(;s<=r;++s){Sl(e[s],o);const a=En.get(e[s]);a!==null&&J(a)&&Dn===null&&(Dn=a.getFormat(),fo=a.getStyle())}uc(t)&&(ut+=zr),o.element.__lexicalTextContent=ut,ut=i+ut}function xm(e,t){if(e){const n=e.__last;if(n){const r=t.get(n);if(r)return Kn(r)?"line-break":Te(r)&&r.isInline()?"decorator":null}return"empty"}return null}function Wb(e,t,n){const r=xm(e,No),o=xm(t,En);r!==o&&t.getDOMSlot(n).setManagedLineBreak(o)}function O3(e,t,n){var r;Dn=null,fo=null,(function(o,i,s){const a=ut,l=o.__size,c=i.__size;ut="";const u=s.element;if(l===1&&c===1){const f=o.__first,d=i.__first;if(f===d)ws(f,u);else{const g=Id(f),p=Sl(d,null);try{u.replaceChild(p,g)}catch(m){if(typeof m=="object"&&m!=null){const v=`${m.toString()} Parent: ${u.tagName}, new child: {tag: ${p.tagName} key: ${d}}, old child: {tag: ${g.tagName}, key: ${f}}.`;throw new Error(v)}throw m}Cl(f,null)}const h=En.get(d);J(h)&&Dn===null&&(Dn=h.getFormat(),fo=h.getStyle())}else{const f=_l(o,No),d=_l(i,En);if(f.length!==l&&Y(227),d.length!==c&&Y(228),l===0)c!==0&&Od(d,i,0,c-1,s);else if(c===0){if(l!==0){const h=s.after==null&&s.before==null&&s.element.__lexicalLineBreak==null;Fd(f,0,l-1,h?null:u),h&&(u.textContent="")}}else(function(h,g,p,m,v,y){const x=m-1,b=v-1;let w,_,E=y.getFirstChild(),R=0,k=0;for(;R<=x&&k<=b;){const D=g[R],j=p[k];if(D===j)E=tu(ws(j,y.element)),R++,k++;else{w===void 0&&(w=new Set(g)),_===void 0&&(_=new Set(p));const $=_.has(D),H=w.has(j);if($)if(H){const O=Lo(_t,j);O===E?E=tu(ws(j,y.element)):(y.withBefore(E).insertChild(O),ws(j,y.element)),R++,k++}else Sl(j,y.withBefore(E)),k++;else E=tu(Id(D)),Cl(D,y.element),R++}const I=En.get(j);I!==null&&J(I)&&Dn===null&&(Dn=I.getFormat(),fo=I.getStyle())}const M=R>x,F=k>b;if(M&&!F){const D=p[b+1],j=D===void 0?null:_t.getElementByKey(D);Od(p,h,k,b,y.withBefore(j))}else F&&!M&&Fd(g,R,x,y.element)})(i,f,d,l,c,s)}uc(i)&&(ut+=zr),u.__lexicalTextContent=ut,ut=a+ut})(e,t,t.getDOMSlot(n)),r=t,Dn==null||Dn===r.__textFormat||wl||r.setTextFormat(Dn),(function(o){fo==null||fo===o.__textStyle||wl||o.setTextStyle(fo)})(t)}function _l(e,t){const n=[];let r=e.__first;for(;r!==null;){const o=t.get(r);o===void 0&&Y(101),n.push(r),r=o.__next}return n}function ws(e,t){const n=No.get(e);let r=En.get(e);n!==void 0&&r!==void 0||Y(61);const o=ci||Pd.has(e)||Md.has(e),i=Lo(_t,e);if(n===r&&!o){if(B(n)){const s=i.__lexicalTextContent;s!==void 0&&(ut+=s,lr+=s)}else{const s=n.getTextContent();lr+=s,ut+=s}return i}if(n!==r&&o&&Dh(Hs,zs,Jl,r,"updated"),r.updateDOM(n,i,Ao)){const s=Sl(e,null);return t===null&&Y(62),t.replaceChild(s,i),Cl(e,null),s}if(B(n)&&B(r)){const s=r.__indent;(ci||s!==n.__indent)&&zb(i,s);const a=r.__format;if((ci||a!==n.__format)&&Hb(i,a),o&&(O3(n,r,i),at(r)||r.isInline()||Wb(n,r,i)),uc(r)&&(ut+=zr,lr+=zr),(ci||r.__dir!==n.__dir)&&($d(i,r),at(r)&&!ci))for(const l of r.getChildren())B(l)&&$d(Lo(_t,l.getKey()),l)}else{const s=r.getTextContent();if(Te(r)){const a=r.decorate(_t,Ao);a!==null&&Kb(e,a)}ut+=s,lr+=s}if(!wl&&at(r)&&r.__cachedText!==lr){const s=r.getWritable();s.__cachedText=lr,r=s}return i}function Kb(e,t){let n=_t._pendingDecorators;const r=_t._decorators;if(n===null){if(r[e]===t)return;n=F1(_t)}n[e]=t}function tu(e){let t=e.nextSibling;return t!==null&&t===_t._blockCursorElement&&(t=t.nextSibling),t}function I3(e,t,n,r,o,i){ut="",lr="",ci=r===2,_t=n,Ao=n._config,zs=n._nodes,Jl=_t._listeners.mutation,Md=o,Pd=i,No=e._nodeMap,En=t._nodeMap,wl=t._readOnly,Ld=new Map(n._keyToDOMMap);const s=new Map;return Hs=s,ws("root",null),_t=void 0,zs=void 0,Md=void 0,Pd=void 0,No=void 0,En=void 0,Ao=void 0,Ld=void 0,Hs=void 0,s}function Id(e){const t=Ld.get(e);return t===void 0&&Y(75,e),t}function ce(e){return{type:e}}const fr=ce("SELECTION_CHANGE_COMMAND"),mh=ce("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),Ql=ce("CLICK_COMMAND"),Ub=ce("BEFORE_INPUT_COMMAND"),Gb=ce("INPUT_COMMAND"),qb=ce("COMPOSITION_START_COMMAND"),Yb=ce("COMPOSITION_END_COMMAND"),Ir=ce("DELETE_CHARACTER_COMMAND"),Si=ce("INSERT_LINE_BREAK_COMMAND"),Mo=ce("INSERT_PARAGRAPH_COMMAND"),To=ce("CONTROLLED_TEXT_INSERTION_COMMAND"),yh=ce("PASTE_COMMAND"),Dd=ce("REMOVE_TEXT_COMMAND"),$i=ce("DELETE_WORD_COMMAND"),Po=ce("DELETE_LINE_COMMAND"),Vt=ce("FORMAT_TEXT_COMMAND"),Xb=ce("UNDO_COMMAND"),Zb=ce("REDO_COMMAND"),Jb=ce("KEYDOWN_COMMAND"),vh=ce("KEY_ARROW_RIGHT_COMMAND"),D3=ce("MOVE_TO_END"),xh=ce("KEY_ARROW_LEFT_COMMAND"),j3=ce("MOVE_TO_START"),bh=ce("KEY_ARROW_UP_COMMAND"),wh=ce("KEY_ARROW_DOWN_COMMAND"),Tl=ce("KEY_ENTER_COMMAND"),Qb=ce("KEY_SPACE_COMMAND"),ec=ce("KEY_BACKSPACE_COMMAND"),Ch=ce("KEY_ESCAPE_COMMAND"),Sh=ce("KEY_DELETE_COMMAND"),_h=ce("KEY_TAB_COMMAND"),V3=ce("INSERT_TAB_COMMAND"),B3=ce("INDENT_CONTENT_COMMAND"),bm=ce("OUTDENT_CONTENT_COMMAND"),e1=ce("DROP_COMMAND"),_i=ce("FORMAT_ELEMENT_COMMAND"),t1=ce("DRAGSTART_COMMAND"),n1=ce("DRAGOVER_COMMAND"),z3=ce("DRAGEND_COMMAND"),tc=ce("COPY_COMMAND"),nc=ce("CUT_COMMAND"),jd=ce("SELECT_ALL_COMMAND"),r1=ce("FOCUS_COMMAND"),H3=ce("BLUR_COMMAND"),W3=ce("KEY_MODIFIER_COMMAND"),tr=Object.freeze({}),Vd=[["keydown",function(e,t){Ws=e.timeStamp,o1=e.key,!t.isComposing()&&te(t,Jb,e)}],["pointerdown",function(e,t){const n=e.target,r=e.pointerType;Cn(n)&&r!=="touch"&&r!=="pen"&&e.button===0&&Un(t,()=>{k1(n)||(Hd=!0)})}],["compositionstart",function(e,t){te(t,qb,e)}],["compositionend",function(e,t){ko?Cs=!0:Ki||!ra&&!oa?te(t,Yb,e):(Wd=!0,Kd=e.data)}],["input",function(e,t){e.stopPropagation(),Un(t,()=>{t.dispatchCommand(Gb,e)},{event:e}),ui=null}],["click",function(e,t){Un(t,()=>{const n=X(),r=Ot(hn(t)),o=Zn();if(r){if(W(n)){const i=n.anchor,s=i.getNode();if(i.type==="element"&&i.offset===0&&n.isCollapsed()&&!at(s)&&qe().getChildrenSize()===1&&s.getTopLevelElementOrThrow().isEmpty()&&o!==null&&n.is(o))r.removeAllRanges(),n.dirty=!0;else if(e.detail===3&&!n.isCollapsed()&&s!==n.focus.getNode()){const a=we(s,l=>B(l)&&!l.isInline());B(a)&&a.select(0)}}else if(e.pointerType==="touch"||e.pointerType==="pen"){const i=r.anchorNode;(Be(i)||Cr(i))&&Ge(sc(o,r,t,e))}}te(t,Ql,e)})}],["cut",tr],["copy",tr],["dragstart",tr],["dragover",tr],["dragend",tr],["paste",tr],["focus",tr],["blur",tr],["drop",tr]];bl&&Vd.push(["beforeinput",(e,t)=>(function(n,r){const o=n.inputType;o==="deleteCompositionText"||ko&&j1(r)||o!=="insertCompositionText"&&te(r,Ub,n)})(e,t)]);let Ws=0,o1=null,i1=0,ui=null;const Bd=new WeakMap,El=new WeakMap;let zd=!1,Hd=!1,ks=!1,Cs=!1,Wd=!1,Kd="",yo=null,s1=[0,"",0,"root",0];function a1(e,t,n,r,o){const i=e.anchor,s=e.focus,a=i.getNode(),l=$e(),c=Ot(hn(l)),u=c!==null?c.anchorNode:null,f=i.key,d=l.getElementByKey(f),h=n.length;return f!==s.key||!J(a)||(!o&&(!bl||i1<r+50)||a.isDirty()&&h<2||O1(n))&&i.offset!==s.offset&&!a.isComposing()||sr(a)||a.isDirty()&&h>1||(o||!bl)&&d!==null&&!a.isComposing()&&u!==Ii(d)||c!==null&&t!==null&&(!t.collapsed||t.startContainer!==c.anchorNode||t.startOffset!==c.anchorOffset)||a.getFormat()!==e.format||a.getStyle()!==e.style||(function(g,p){if(p.isSegmented())return!0;if(!g.isCollapsed())return!1;const m=g.anchor.offset,v=p.getParentOrThrow(),y=Eo(p);return m===0?!p.canInsertTextBefore()||!v.canInsertTextBefore()&&!p.isComposing()||y||(function(x){const b=x.getPreviousSibling();return(J(b)||B(b)&&b.isInline())&&!b.canInsertTextAfter()})(p):m===p.getTextContentSize()&&(!p.canInsertTextAfter()||!v.canInsertTextAfter()&&!p.isComposing()||y)})(e,a)}function wm(e,t){return Cr(e)&&e.nodeValue!==null&&t!==0&&t!==e.nodeValue.length}function Cm(e,t,n){const{anchorNode:r,anchorOffset:o,focusNode:i,focusOffset:s}=e;zd&&(zd=!1,wm(r,o)&&wm(i,s)&&!yo)||Un(t,()=>{if(!n)return void Ge(null);if(!aa(t,r,i))return;let a=X();if(yo&&W(a)&&a.isCollapsed()){const l=a.anchor,c=yo.anchor;(l.key===c.key&&l.offset===c.offset+1||l.offset===1&&c.getNode().is(l.getNode().getPreviousSibling()))&&(a=yo.clone(),Ge(a))}if(yo=null,W(a)){const l=a.anchor,c=l.getNode();if(a.isCollapsed()){e.type==="Range"&&e.anchorNode===e.focusNode&&(a.dirty=!0);const u=hn(t).event,f=u?u.timeStamp:performance.now(),[d,h,g,p,m]=s1,v=qe(),y=t.isComposing()===!1&&v.getTextContent()==="";if(f<m+200&&l.offset===g&&l.key===p)rl(a,d,h);else if(l.type==="text")J(c)||Y(141),l1(a,c);else if(l.type==="element"&&!y){B(c)||Y(259);const x=l.getNode();x.isEmpty()?(function(b,w){const _=w.getTextFormat(),E=w.getTextStyle();rl(b,_,E)})(a,x):rl(a,0,"")}}else{const u=l.key,f=a.focus.key,d=a.getNodes(),h=d.length,g=a.isBackward(),p=g?s:o,m=g?o:s,v=g?f:u,y=g?u:f;let x=2047,b=!1;for(let w=0;w<h;w++){const _=d[w],E=_.getTextContentSize();if(J(_)&&E!==0&&!(w===0&&_.__key===v&&p===E||w===h-1&&_.__key===y&&m===0)&&(b=!0,x&=_.getFormat(),x===0))break}a.format=b?x:0}}te(t,fr,void 0)})}function rl(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function l1(e,t){rl(e,t.getFormat(),t.getStyle())}function c1(e){if(!e.getTargetRanges)return null;const t=e.getTargetRanges();return t.length===0?null:t[0]}function K3(e){const t=e.inputType,n=c1(e),r=$e(),o=X();if(t==="deleteContentBackward"){if(o===null){const f=Zn();if(!W(f))return!0;Ge(f.clone())}if(W(o)){const f=o.anchor.key===o.focus.key;if(i=e.timeStamp,o1==="MediaLast"&&i<Ws+30&&r.isComposing()&&f){if(yt(null),Ws=0,setTimeout(()=>{Un(r,()=>{yt(null)})},30),W(o)){const d=o.anchor.getNode();d.markDirty(),J(d)||Y(142),l1(o,d)}}else{yt(null),e.preventDefault();const d=o.anchor.getNode(),h=d.getTextContent(),g=d.canInsertTextAfter(),p=o.anchor.offset===0&&o.focus.offset===h.length;let m=lm&&f&&!p&&g;if(m&&o.isCollapsed()&&(m=!Te(Xd(o.anchor,!0))),!m){te(r,Ir,!0);const v=X();lm&&W(v)&&v.isCollapsed()&&(yo=v,setTimeout(()=>yo=null))}}return!0}}var i;if(!W(o))return!0;const s=e.data;ui!==null&&Oh(!1,r,ui),o.dirty&&ui===null||!o.isCollapsed()||at(o.anchor.getNode())||n===null||o.applyDOMRange(n),ui=null;const a=o.anchor,l=o.focus,c=a.getNode(),u=l.getNode();if(t==="insertText"||t==="insertTranspose"){if(s===`
37
- `)e.preventDefault(),te(r,Si,!1);else if(s===zr)e.preventDefault(),te(r,Mo,void 0);else if(s==null&&e.dataTransfer){const f=e.dataTransfer.getData("text/plain");e.preventDefault(),o.insertRawText(f)}else s!=null&&a1(o,n,s,e.timeStamp,!0)?(e.preventDefault(),te(r,To,s)):ui=s;return i1=e.timeStamp,!0}switch(e.preventDefault(),t){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":te(r,To,e);break;case"insertFromComposition":yt(null),te(r,To,e);break;case"insertLineBreak":yt(null),te(r,Si,!1);break;case"insertParagraph":yt(null),ks&&!Ki?(ks=!1,te(r,Si,!1)):te(r,Mo,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":te(r,yh,e);break;case"deleteByComposition":(function(f,d){return f!==d||B(f)||B(d)||!Eo(f)||!Eo(d)})(c,u)&&te(r,Dd,e);break;case"deleteByDrag":case"deleteByCut":te(r,Dd,e);break;case"deleteContent":te(r,Ir,!1);break;case"deleteWordBackward":te(r,$i,!0);break;case"deleteWordForward":te(r,$i,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":te(r,Po,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":te(r,Po,!1);break;case"formatStrikeThrough":te(r,Vt,"strikethrough");break;case"formatBold":te(r,Vt,"bold");break;case"formatItalic":te(r,Vt,"italic");break;case"formatUnderline":te(r,Vt,"underline");break;case"historyUndo":te(r,Xb,void 0);break;case"historyRedo":te(r,Zb,void 0)}return!0}function U3(e){if(Be(e.target)&&k1(e.target))return!0;const t=$e(),n=X(),r=e.data,o=c1(e);if(r!=null&&W(n)&&a1(n,o,r,e.timeStamp,!1)){Cs&&(Rl(t,r),Cs=!1);const i=n.anchor.getNode(),s=Ot(hn(t));if(s===null)return!0;const a=n.isBackward(),l=a?n.anchor.offset:n.focus.offset,c=a?n.focus.offset:n.anchor.offset;bl&&!n.isCollapsed()&&J(i)&&s.anchorNode!==null&&i.getTextContent().slice(0,l)+r+i.getTextContent().slice(l+c)===D1(s.anchorNode)||te(t,To,r);const u=r.length;ko&&u>1&&e.inputType==="insertCompositionText"&&!t.isComposing()&&(n.anchor.offset-=u),ra||Ki||oa||!t.isComposing()||(Ws=0,yt(null))}else Oh(!1,t,r!==null?r:void 0),Cs&&(Rl(t,r||void 0),Cs=!1);return(function(){ft();const i=$e();Ob(i)})(),!0}function G3(e){const t=$e(),n=X();if(W(n)&&!t.isComposing()){const r=n.anchor,o=n.anchor.getNode();yt(r.key),(e.timeStamp<Ws+30||r.type==="element"||!n.isCollapsed()||o.getFormat()!==n.format||J(o)&&o.getStyle()!==n.style)&&te(t,To,w3)}return!0}function q3(e){return Rl($e(),e.data),!0}function Rl(e,t){const n=e._compositionKey;if(yt(null),n!==null&&t!=null){if(t===""){const r=Pe(n),o=Ii(e.getElementByKey(n));return void(o!==null&&o.nodeValue!==null&&J(r)&&Ih(r,o.nodeValue,null,null,!0))}if(t[t.length-1]===`
38
- `){const r=X();if(W(r)){const o=r.focus;return r.anchor.set(o.key,o.offset,o.type),void te(e,Tl,null)}}}Oh(!0,e,t)}function Y3(e){const t=$e();if(e.key==null)return!0;if(Wd&&Gm(e))return Un(t,()=>{Rl(t,Kd)}),Wd=!1,Kd="",!0;if((function(n){return Me(n,"ArrowRight",{shiftKey:"any"})})(e))te(t,vh,e);else if((function(n){return Me(n,"ArrowRight",rr)})(e))te(t,D3,e);else if((function(n){return Me(n,"ArrowLeft",{shiftKey:"any"})})(e))te(t,xh,e);else if((function(n){return Me(n,"ArrowLeft",rr)})(e))te(t,j3,e);else if((function(n){return Me(n,"ArrowUp",{altKey:"any",shiftKey:"any"})})(e))te(t,bh,e);else if((function(n){return Me(n,"ArrowDown",{altKey:"any",shiftKey:"any"})})(e))te(t,wh,e);else if((function(n){return Me(n,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:!0})})(e))ks=!0,te(t,Tl,e);else if((function(n){return n.key===" "})(e))te(t,Qb,e);else if((function(n){return wn&&Me(n,"o",{ctrlKey:!0})})(e))e.preventDefault(),ks=!0,te(t,Si,!0);else if((function(n){return Me(n,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any"})})(e))ks=!1,te(t,Tl,e);else if((function(n){return Me(n,"Backspace",{shiftKey:"any"})||wn&&Me(n,"h",{ctrlKey:!0})})(e))Gm(e)?te(t,ec,e):(e.preventDefault(),te(t,Ir,!0));else if((function(n){return n.key==="Escape"})(e))te(t,Ch,e);else if((function(n){return Me(n,"Delete",{})||wn&&Me(n,"d",{ctrlKey:!0})})(e))(function(n){return n.key==="Delete"})(e)?te(t,Sh,e):(e.preventDefault(),te(t,Ir,!1));else if((function(n){return Me(n,"Backspace",Um)})(e))e.preventDefault(),te(t,$i,!0);else if((function(n){return Me(n,"Delete",Um)})(e))e.preventDefault(),te(t,$i,!1);else if((function(n){return wn&&Me(n,"Backspace",{metaKey:!0})})(e))e.preventDefault(),te(t,Po,!0);else if((function(n){return wn&&(Me(n,"Delete",{metaKey:!0})||Me(n,"k",{ctrlKey:!0}))})(e))e.preventDefault(),te(t,Po,!1);else if((function(n){return Me(n,"b",rr)})(e))e.preventDefault(),te(t,Vt,"bold");else if((function(n){return Me(n,"u",rr)})(e))e.preventDefault(),te(t,Vt,"underline");else if((function(n){return Me(n,"i",rr)})(e))e.preventDefault(),te(t,Vt,"italic");else if((function(n){return Me(n,"Tab",{shiftKey:"any"})})(e))te(t,_h,e);else if((function(n){return Me(n,"z",rr)})(e))e.preventDefault(),te(t,Xb,void 0);else if((function(n){return wn?Me(n,"z",{metaKey:!0,shiftKey:!0}):Me(n,"y",{ctrlKey:!0})||Me(n,"z",{ctrlKey:!0,shiftKey:!0})})(e))e.preventDefault(),te(t,Zb,void 0);else{const n=t._editorState._selection;n===null||W(n)?qm(e)&&(e.preventDefault(),te(t,jd,e)):(function(r){return Me(r,"c",rr)})(e)?(e.preventDefault(),te(t,tc,e)):(function(r){return Me(r,"x",rr)})(e)?(e.preventDefault(),te(t,nc,e)):qm(e)&&(e.preventDefault(),te(t,jd,e))}return(function(n){return n.ctrlKey||n.shiftKey||n.altKey||n.metaKey})(e)&&t.dispatchCommand(W3,e),!0}function u1(e){let t=e.__lexicalEventHandles;return t===void 0&&(t=[],e.__lexicalEventHandles=t),t}const Ti=new Map;function d1(e){const t=AA(e.target);if(t===null)return;const n=A1(t.anchorNode);if(n===null)return;Hd&&(Hd=!1,Un(n,()=>{const l=Zn(),c=t.anchorNode;(Be(c)||Cr(c))&&Ge(sc(l,t,n,e))}));const r=$h(n),o=r[r.length-1],i=o._key,s=Ti.get(i),a=s||o;a!==n&&Cm(t,a,!1),Cm(t,n,!0),n!==o?Ti.set(i,n):s&&Ti.delete(i)}function Sm(e){e._lexicalHandled=!0}function _m(e){return e._lexicalHandled===!0}function X3(e){const t=Bd.get(e);if(t===void 0)return;const n=El.get(t);if(n===void 0)return;const r=n-1;r>=0||Y(164),Bd.delete(e),El.set(t,r),r===0&&t.removeEventListener("selectionchange",d1);const o=lc(e);Fh(o)?((function(s){if(s._parentEditor!==null){const a=$h(s),l=a[a.length-1]._key;Ti.get(l)===s&&Ti.delete(l)}else Ti.delete(s._key)})(o),e.__lexicalEditor=null):o&&Y(198);const i=u1(e);for(let s=0;s<i.length;s++)i[s]();e.__lexicalEventHandles=[]}function Ud(e,t,n){ft();const r=e.__key,o=e.getParent();if(o===null)return;const i=(function(a){const l=X();if(!W(l)||!B(a))return l;const{anchor:c,focus:u}=l,f=c.getNode(),d=u.getNode();return Zd(f,a)&&c.set(a.__key,0,"element"),Zd(d,a)&&u.set(a.__key,0,"element"),l})(e);let s=!1;if(W(i)&&t){const a=i.anchor,l=i.focus;a.key===r&&(Nl(a,e,o,e.getPreviousSibling(),e.getNextSibling()),s=!0),l.key===r&&(Nl(l,e,o,e.getPreviousSibling(),e.getNextSibling()),s=!0)}else Ct(i)&&t&&e.isSelected()&&e.selectPrevious();if(W(i)&&t&&!s){const a=e.getIndexWithinParent();Ro(e),Al(i,o,a,-1)}else Ro(e);n||vt(o)||o.canBeEmpty()||!o.isEmpty()||Ud(o,t),t&&i&&at(o)&&o.isEmpty()&&o.selectEnd()}const f1=Symbol.for("ephemeral");function kl(e){return e[f1]||!1}class Wn{__type;__key;__parent;__prev;__next;__state;static getType(){const{ownNodeType:t}=dc(this);return t===void 0&&Y(64,this.name),t}static clone(t){Y(65,this.name)}$config(){return{}}config(t,n){const r=n.extends||Object.getPrototypeOf(this.constructor);return Object.assign(n,{extends:r,type:t}),{[t]:n}}afterCloneFrom(t){this.__key===t.__key?(this.__parent=t.__parent,this.__next=t.__next,this.__prev=t.__prev,this.__state=t.__state):t.__state&&(this.__state=t.__state.getWritable(this))}static importDOM;constructor(t){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",{configurable:!0,enumerable:!1,value:void 0,writable:!0}),P1(this,t)}getType(){return this.__type}isInline(){Y(137,this.constructor.name)}isAttached(){let t=this.__key;for(;t!==null;){if(t==="root")return!0;const n=Pe(t);if(n===null)break;t=n.__parent}return!1}isSelected(t){const n=t||X();if(n==null)return!1;const r=n.getNodes().some(o=>o.__key===this.__key);if(J(this))return r;if(W(n)&&n.anchor.type==="element"&&n.focus.type==="element"){if(n.isCollapsed())return!1;const o=this.getParent();if(Te(this)&&this.isInline()&&o){const i=n.isBackward()?n.focus:n.anchor;if(o.is(i.getNode())&&i.offset===o.getChildrenSize()&&this.is(o.getLastChild()))return!1}}return r}getKey(){return this.__key}getIndexWithinParent(){const t=this.getParent();if(t===null)return-1;let n=t.getFirstChild(),r=0;for(;n!==null;){if(this.is(n))return r;r++,n=n.getNextSibling()}return-1}getParent(){const t=this.getLatest().__parent;return t===null?null:Pe(t)}getParentOrThrow(){const t=this.getParent();return t===null&&Y(66,this.__key),t}getTopLevelElement(){let t=this;for(;t!==null;){const n=t.getParent();if(vt(n))return B(t)||t===this&&Te(t)||Y(194),t;t=n}return null}getTopLevelElementOrThrow(){const t=this.getTopLevelElement();return t===null&&Y(67,this.__key),t}getParents(){const t=[];let n=this.getParent();for(;n!==null;)t.push(n),n=n.getParent();return t}getParentKeys(){const t=[];let n=this.getParent();for(;n!==null;)t.push(n.__key),n=n.getParent();return t}getPreviousSibling(){const t=this.getLatest().__prev;return t===null?null:Pe(t)}getPreviousSiblings(){const t=[],n=this.getParent();if(n===null)return t;let r=n.getFirstChild();for(;r!==null&&!r.is(this);)t.push(r),r=r.getNextSibling();return t}getNextSibling(){const t=this.getLatest().__next;return t===null?null:Pe(t)}getNextSiblings(){const t=[];let n=this.getNextSibling();for(;n!==null;)t.push(n),n=n.getNextSibling();return t}getCommonAncestor(t){const n=B(this)?this:this.getParent(),r=B(t)?t:t.getParent(),o=n&&r?il(n,r):null;return o?o.commonAncestor:null}is(t){return t!=null&&this.__key===t.__key}isBefore(t){const n=il(this,t);return n!==null&&(n.type==="descendant"||(n.type==="branch"?U1(n)===-1:(n.type!=="same"&&n.type!=="ancestor"&&Y(279),!1)))}isParentOf(t){const n=il(this,t);return n!==null&&n.type==="ancestor"}getNodesBetween(t){const n=this.isBefore(t),r=[],o=new Set;let i=this;for(;i!==null;){const s=i.__key;if(o.has(s)||(o.add(s),r.push(i)),i===t)break;const a=B(i)?n?i.getFirstChild():i.getLastChild():null;if(a!==null){i=a;continue}const l=n?i.getNextSibling():i.getPreviousSibling();if(l!==null){i=l;continue}const c=i.getParentOrThrow();if(o.has(c.__key)||r.push(c),c===t)break;let u=null,f=c;do{if(f===null&&Y(68),u=n?f.getNextSibling():f.getPreviousSibling(),f=f.getParent(),f===null)break;u!==null||o.has(f.__key)||r.push(f)}while(u===null);i=u}return n||r.reverse(),r}isDirty(){const t=$e()._dirtyLeaves;return t!==null&&t.has(this.__key)}getLatest(){if(kl(this))return this;const t=Pe(this.__key);return t===null&&Y(113),t}getWritable(){if(kl(this))return this;ft();const t=Jr(),n=$e(),r=t._nodeMap,o=this.__key,i=this.getLatest(),s=n._cloneNotNeeded,a=X();if(a!==null&&a.setCachedNodes(null),s.has(o))return Pl(i),i;const l=z1(i);return s.add(o),Pl(l),r.set(o,l),l}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(t,n){Y(70)}updateDOM(t,n,r){Y(71)}exportDOM(t){return{element:this.createDOM(t._config,t)}}exportJSON(){const t=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...t}}static importJSON(t){Y(18,this.name)}updateFromJSON(t){return(function(n,r){const o=n.getWritable(),i=r.$;let s=i;for(const a of Bb(o).flatKeys)a in r&&(s!==void 0&&s!==i||(s={...i}),s[a]=r[a]);return(o.__state||s)&&Vb(n).updateFromJSON(s),o})(this,t)}static transform(){return null}remove(t){Ud(this,!0,t)}replace(t,n){ft();let r=X();r!==null&&(r=r.clone()),au(this,t);const o=this.getLatest(),i=this.__key,s=t.__key,a=t.getWritable(),l=this.getParentOrThrow().getWritable(),c=l.__size;Ro(a);const u=o.getPreviousSibling(),f=o.getNextSibling(),d=o.__prev,h=o.__next,g=o.__parent;if(Ud(o,!1,!0),u===null?l.__first=s:u.getWritable().__next=s,a.__prev=d,f===null?l.__last=s:f.getWritable().__prev=s,a.__next=h,a.__parent=g,l.__size=c,n&&(B(this)&&B(a)||Y(139),this.getChildren().forEach(p=>{a.append(p)})),W(r)){Ge(r);const p=r.anchor,m=r.focus;p.key===i&&km(p,a),m.key===i&&km(m,a)}return Mr()===i&&yt(s),a}insertAfter(t,n=!0){ft(),au(this,t);const r=this.getWritable(),o=t.getWritable(),i=o.getParent(),s=X();let a=!1,l=!1;if(i!==null){const h=t.getIndexWithinParent();if(Ro(o),W(s)){const g=i.__key,p=s.anchor,m=s.focus;a=p.type==="element"&&p.key===g&&p.offset===h+1,l=m.type==="element"&&m.key===g&&m.offset===h+1}}const c=this.getNextSibling(),u=this.getParentOrThrow().getWritable(),f=o.__key,d=r.__next;if(c===null?u.__last=f:c.getWritable().__prev=f,u.__size++,r.__next=f,o.__next=d,o.__prev=r.__key,o.__parent=r.__parent,n&&W(s)){const h=this.getIndexWithinParent();Al(s,u,h+1);const g=u.__key;a&&s.anchor.set(g,h+2,"element"),l&&s.focus.set(g,h+2,"element")}return t}insertBefore(t,n=!0){ft(),au(this,t);const r=this.getWritable(),o=t.getWritable(),i=o.__key;Ro(o);const s=this.getPreviousSibling(),a=this.getParentOrThrow().getWritable(),l=r.__prev,c=this.getIndexWithinParent();s===null?a.__first=i:s.getWritable().__next=i,a.__size++,r.__prev=i,o.__prev=l,o.__next=r.__key,o.__parent=r.__parent;const u=X();return n&&W(u)&&Al(u,this.getParentOrThrow(),c),t}isParentRequired(){return!1}createParentElementNode(){return ve()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(t,n){ft();const r=this.getPreviousSibling(),o=this.getParentOrThrow();if(r===null)return o.select(0,0);if(B(r))return r.select();if(!J(r)){const i=r.getIndexWithinParent()+1;return o.select(i,i)}return r.select(t,n)}selectNext(t,n){ft();const r=this.getNextSibling(),o=this.getParentOrThrow();if(r===null)return o.select();if(B(r))return r.select(0,0);if(!J(r)){const i=r.getIndexWithinParent();return o.select(i,i)}return r.select(t,n)}markDirty(){this.getWritable()}reconcileObservedMutation(t,n){this.markDirty()}}const Z3="historic",Ei="history-merge",J3="paste",h1="collaboration",Q3="skip-scroll-into-view",eA="skip-dom-selection",tA="skip-selection-focus";class Ui extends Wn{static getType(){return"linebreak"}static clone(t){return new Ui(t.__key)}constructor(t){super(t)}getTextContent(){return`
39
- `}createDOM(){return document.createElement("br")}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:t=>(function(n){const r=n.parentElement;if(r!==null&&Ll(r)){const o=r.firstChild;if(o===n||o.nextSibling===n&&Na(o)){const i=r.lastChild;if(i===n||i.previousSibling===n&&Na(i))return!0}}return!1})(t)||(function(n){const r=n.parentElement;if(r!==null&&Ll(r)){const o=r.firstChild;if(o===n||o.nextSibling===n&&Na(o))return!1;const i=r.lastChild;if(i===n||i.previousSibling===n&&Na(i))return!0}return!1})(t)?null:{conversion:nA,priority:0}}}static importJSON(t){return kn().updateFromJSON(t)}}function nA(e){return{node:kn()}}function kn(){return Et(new Ui)}function Kn(e){return e instanceof Ui}function Na(e){return Cr(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||"")}function nu(e,t){return 16&t?"code":t&Lb?"mark":32&t?"sub":64&t?"sup":null}function ru(e,t){return 1&t?"strong":2&t?"em":"span"}function g1(e,t,n,r,o){const i=r.classList;let s=Ri(o,"base");s!==void 0&&i.add(...s),s=Ri(o,"underlineStrikethrough");let a=!1;const l=8&t&&4&t;s!==void 0&&(8&n&&4&n?(a=!0,l||i.add(...s)):l&&i.remove(...s));for(const c in Hr){const u=Hr[c];if(s=Ri(o,c),s!==void 0)if(n&u){if(a&&(c==="underline"||c==="strikethrough")){t&u&&i.remove(...s);continue}((t&u)===0||l&&c==="underline"||c==="strikethrough")&&i.add(...s)}else t&u&&i.remove(...s)}}function p1(e,t,n){const r=t.firstChild,o=n.isComposing(),i=e+(o?Zl:"");if(r==null)t.textContent=i;else{const s=r.nodeValue;if(s!==i)if(o||ko){const[a,l,c]=(function(u,f){const d=u.length,h=f.length;let g=0,p=0;for(;g<d&&g<h&&u[g]===f[g];)g++;for(;p+g<d&&p+g<h&&u[d-p-1]===f[h-p-1];)p++;return[g,d-g-p,f.slice(g,h-p)]})(s,i);l!==0&&r.deleteData(a,l),r.insertData(a,c)}else r.nodeValue=i}}function Tm(e,t,n,r,o,i){p1(o,e,t);const s=i.theme.text;s!==void 0&&g1(0,0,r,e,s)}function Ma(e,t){const n=document.createElement(t);return n.appendChild(e),n}class fn extends Wn{__text;__format;__style;__mode;__detail;static getType(){return"text"}static clone(t){return new fn(t.__text,t.__key)}afterCloneFrom(t){super.afterCloneFrom(t),this.__text=t.__text,this.__format=t.__format,this.__style=t.__style,this.__mode=t.__mode,this.__detail=t.__detail}constructor(t="",n){super(n),this.__text=t,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const t=this.getLatest();return T3[t.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===Mr()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(t){const n=Hr[t];return(this.getFormat()&n)!==0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(t,n){return Ml(this.getLatest().__format,t,n)}canHaveFormat(){return!0}isInline(){return!0}createDOM(t,n){const r=this.__format,o=nu(0,r),i=ru(0,r),s=o===null?i:o,a=document.createElement(s);let l=a;this.hasFormat("code")&&a.setAttribute("spellcheck","false"),o!==null&&(l=document.createElement(i),a.appendChild(l)),Tm(l,this,0,r,this.__text,t);const c=this.__style;return c!==""&&(a.style.cssText=c),a}updateDOM(t,n,r){const o=this.__text,i=t.__format,s=this.__format,a=nu(0,i),l=nu(0,s),c=ru(0,i),u=ru(0,s);if((a===null?c:a)!==(l===null?u:l))return!0;if(a===l&&c!==u){const p=n.firstChild;p==null&&Y(48);const m=document.createElement(u);return Tm(m,this,0,s,o,r),n.replaceChild(m,p),!1}let f=n;l!==null&&a!==null&&(f=n.firstChild,f==null&&Y(49)),p1(o,f,this);const d=r.theme.text;d!==void 0&&i!==s&&g1(0,i,s,f,d);const h=t.__style,g=this.__style;return h!==g&&(n.style.cssText=g),!1}static importDOM(){return{"#text":()=>({conversion:sA,priority:0}),b:()=>({conversion:oA,priority:0}),code:()=>({conversion:nr,priority:0}),em:()=>({conversion:nr,priority:0}),i:()=>({conversion:nr,priority:0}),mark:()=>({conversion:nr,priority:0}),s:()=>({conversion:nr,priority:0}),span:()=>({conversion:rA,priority:0}),strong:()=>({conversion:nr,priority:0}),sub:()=>({conversion:nr,priority:0}),sup:()=>({conversion:nr,priority:0}),u:()=>({conversion:nr,priority:0})}}static importJSON(t){return Fe().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setTextContent(t.text).setFormat(t.format).setDetail(t.detail).setMode(t.mode).setStyle(t.style)}exportDOM(t){let{element:n}=super.exportDOM(t);return Be(n)||Y(132),n.style.whiteSpace="pre-wrap",this.hasFormat("lowercase")?n.style.textTransform="lowercase":this.hasFormat("uppercase")?n.style.textTransform="uppercase":this.hasFormat("capitalize")&&(n.style.textTransform="capitalize"),this.hasFormat("bold")&&(n=Ma(n,"b")),this.hasFormat("italic")&&(n=Ma(n,"i")),this.hasFormat("strikethrough")&&(n=Ma(n,"s")),this.hasFormat("underline")&&(n=Ma(n,"u")),{element:n}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(t,n){}setFormat(t){const n=this.getWritable();return n.__format=typeof t=="string"?Hr[t]:t,n}setDetail(t){const n=this.getWritable();return n.__detail=typeof t=="string"?C3[t]:t,n}setStyle(t){const n=this.getWritable();return n.__style=t,n}toggleFormat(t){const n=Ml(this.getFormat(),t,null);return this.setFormat(n)}toggleDirectionless(){const t=this.getWritable();return t.__detail^=1,t}toggleUnmergeable(){const t=this.getWritable();return t.__detail^=2,t}setMode(t){const n=_3[t];if(this.__mode===n)return this;const r=this.getWritable();return r.__mode=n,r}setTextContent(t){if(this.__text===t)return this;const n=this.getWritable();return n.__text=t,n}select(t,n){ft();let r=t,o=n;const i=X(),s=this.getTextContent(),a=this.__key;if(typeof s=="string"){const l=s.length;r===void 0&&(r=l),o===void 0&&(o=l)}else r=0,o=0;if(!W(i))return v1(a,r,a,o,"text","text");{const l=Mr();l!==i.anchor.key&&l!==i.focus.key||yt(a),i.setTextNodeRange(this,r,this,o)}return i}selectStart(){return this.select(0,0)}selectEnd(){const t=this.getTextContentSize();return this.select(t,t)}spliceText(t,n,r,o){const i=this.getWritable(),s=i.__text,a=r.length;let l=t;l<0&&(l=a+l,l<0&&(l=0));const c=X();if(o&&W(c)){const f=t+a;c.setTextNodeRange(i,f,i,f)}const u=s.slice(0,l)+r+s.slice(l+n);return i.__text=u,i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...t){ft();const n=this.getLatest(),r=n.getTextContent();if(r==="")return[];const o=n.__key,i=Mr(),s=r.length;t.sort((R,k)=>R-k),t.push(s);const a=[],l=t.length;for(let R=0,k=0;R<s&&k<=l;k++){const M=t[k];M>R&&(a.push(r.slice(R,M)),R=M)}const c=a.length;if(c===1)return[n];const u=a[0],f=n.getParent();let d;const h=n.getFormat(),g=n.getStyle(),p=n.__detail;let m=!1,v=null,y=null;const x=X();if(W(x)){const[R,k]=x.isBackward()?[x.focus,x.anchor]:[x.anchor,x.focus];R.type==="text"&&R.key===o&&(v=R),k.type==="text"&&k.key===o&&(y=k)}n.isSegmented()?(d=Fe(u),d.__format=h,d.__style=g,d.__detail=p,d.__state=gm(n,d),m=!0):d=n.setTextContent(u);const b=[d];for(let R=1;R<c;R++){const k=Fe(a[R]);k.__format=h,k.__style=g,k.__detail=p,k.__state=gm(n,k);const M=k.__key;i===o&&yt(M),b.push(k)}const w=v?v.offset:null,_=y?y.offset:null;let E=0;for(const R of b){if(!v&&!y)break;const k=E+R.getTextContentSize();if(v!==null&&w!==null&&w<=k&&w>=E&&(v.set(R.getKey(),w-E,"text"),w<k&&(v=null)),y!==null&&_!==null&&_<=k&&_>=E){y.set(R.getKey(),_-E,"text");break}E=k}if(f!==null){(function(M){const F=M.getPreviousSibling(),D=M.getNextSibling();F!==null&&Pl(F),D!==null&&Pl(D)})(this);const R=f.getWritable(),k=this.getIndexWithinParent();m?(R.splice(k,0,b),this.remove()):R.splice(k,1,b),W(x)&&Al(x,f,k,c-1)}return b}mergeWithSibling(t){const n=t===this.getPreviousSibling();n||t===this.getNextSibling()||Y(50);const r=this.__key,o=t.__key,i=this.__text,s=i.length;Mr()===o&&yt(r);const a=X();if(W(a)){const f=a.anchor,d=a.focus;f!==null&&f.key===o&&$m(f,n,r,t,s),d!==null&&d.key===o&&$m(d,n,r,t,s)}const l=t.__text,c=n?l+i:i+l;this.setTextContent(c);const u=this.getWritable();return t.remove(),u}isTextEntity(){return!1}}function rA(e){return{forChild:Th(e.style),node:null}}function oA(e){const t=e,n=t.style.fontWeight==="normal";return{forChild:Th(t.style,n?void 0:"bold"),node:null}}const Em=new WeakMap;function iA(e){if(!Be(e))return!1;if(e.nodeName==="PRE")return!0;const t=e.style.whiteSpace;return typeof t=="string"&&t.startsWith("pre")}function sA(e){const t=e;e.parentElement===null&&Y(129);let n=t.textContent||"";if((function(r){let o,i=r.parentNode;const s=[r];for(;i!==null&&(o=Em.get(i))===void 0&&!iA(i);)s.push(i),i=i.parentNode;const a=o===void 0?i:o;for(let l=0;l<s.length;l++)Em.set(s[l],a);return a})(t)!==null){const r=n.split(/(\r?\n|\t)/),o=[],i=r.length;for(let s=0;s<i;s++){const a=r[s];a===`
36
+ `,QA=Ao?" ":rc,Kr={bold:1,capitalize:1024,code:16,highlight:J1,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},eN={directionless:1,unmergeable:2},km={center:2,end:6,justify:4,left:1,right:3,start:5},tN={[qA]:"center",[JA]:"end",[XA]:"justify",[GA]:"left",[YA]:"right",[ZA]:"start"},nN={normal:0,segmented:2,token:1},rN={[WA]:"normal",[UA]:"segmented",[KA]:"token"},Am="$config";function Q1(e,t,n,r,o,i){let s=e.getFirstChild();for(;s!==null;){const a=s.__key;s.__parent===t&&(B(s)&&Q1(s,a,n,r,o,i),n.has(a)||i.delete(a),o.push(a)),s=s.getNextSibling()}}let Od=!1,Ah=0;function oN(e){Ah=e.timeStamp}function au(e,t,n){const r=e.nodeName==="BR",o=t.__lexicalLineBreak;return o&&(e===o||r&&e.previousSibling===o)||r&&pc(e,n)!==void 0}function iN(e,t,n){const r=Ot(hn(n));let o=null,i=null;r!==null&&r.anchorNode===e&&(o=r.anchorOffset,i=r.focusOffset);const s=e.nodeValue;s!==null&&Zh(t,s,o,i,!1)}function sN(e,t,n){if(W(e)){const r=e.anchor.getNode();if(r.is(n)&&e.format!==r.getFormat())return!1}return Cr(t)&&n.isAttached()}function aN(e,t,n,r){for(let o=e;o&&!dM(o);o=ca(o)){const i=pc(o,t);if(i!==void 0){const s=Pe(i,n);if(s)return Te(s)||!Be(o)?void 0:[o,s]}else if(o===r)return[r,ew(n)]}}function eb(e,t,n){Od=!0;const r=performance.now()-Ah>100;try{Gn(e,()=>{const o=Z()||(function(d){return d.getEditorState().read(()=>{const h=Z();return h!==null?h.clone():null})})(e),i=new Map,s=e.getRootElement(),a=e._editorState,l=e._blockCursorElement;let c=!1,u="";for(let d=0;d<t.length;d++){const h=t[d],g=h.type,p=h.target,m=aN(p,e,a,s);if(!m)continue;const[v,y]=m;if(g==="characterData")r&&J(y)&&Cr(p)&&sN(o,p,y)&&iN(p,y,e);else if(g==="childList"){c=!0;const x=h.addedNodes;for(let _=0;_<x.length;_++){const E=x[_],R=Jb(E),k=E.parentNode;if(k!=null&&E!==l&&R===null&&!au(E,k,e)){if(Ao){const P=(Be(E)?E.innerText:null)||E.nodeValue;P&&(u+=P)}k.removeChild(E)}}const b=h.removedNodes,w=b.length;if(w>0){let _=0;for(let E=0;E<w;E++){const R=b[E];(au(R,p,e)||l===R)&&(p.appendChild(R),_++)}w!==_&&i.set(v,y)}}}if(i.size>0)for(const[d,h]of i)h.reconcileObservedMutation(d,e);const f=n.takeRecords();if(f.length>0){for(let d=0;d<f.length;d++){const h=f[d],g=h.addedNodes,p=h.target;for(let m=0;m<g.length;m++){const v=g[m],y=v.parentNode;y==null||v.nodeName!=="BR"||au(v,p,e)||y.removeChild(v)}}n.takeRecords()}o!==null&&(c&&Ge(o),Ao&&ow(e)&&o.insertRawText(u))})}finally{Od=!1}}function tb(e){const t=e._observer;t!==null&&eb(e,t.takeRecords(),t)}function nb(e){(function(t){Ah===0&&hn(t).addEventListener("textInput",oN,!0)})(e),e._observer=new MutationObserver((t,n)=>{eb(e,t,n)})}let lN=class{key;parse;unparse;isEqual;defaultValue;constructor(t,n){this.key=t,this.parse=n.parse.bind(n),this.unparse=(n.unparse||fN).bind(n),this.isEqual=(n.isEqual||Object.is).bind(n),this.defaultValue=this.parse(void 0)}};function cN(e,t){return new lN(e,t)}function rb(e,t,n="latest"){const r=(n==="latest"?e.getLatest():e).__state;return r?r.getValue(t):t.defaultValue}function lu(e,t,n){let r;if(ft(),typeof n=="function"){const i=e.getLatest(),s=rb(i,t);if(r=n(s),t.isEqual(s,r))return i}else r=n;const o=e.getWritable();return ib(o).updateFromKnown(t,r),o}function uN(e){const t=new Map,n=new Set;for(let r=typeof e=="function"?e:e.replace;r.prototype&&r.prototype.getType!==void 0;r=Object.getPrototypeOf(r)){const{ownNodeConfig:o}=yc(r);if(o&&o.stateConfigs)for(const i of o.stateConfigs){let s;"stateConfig"in i?(s=i.stateConfig,i.flat&&n.add(s.key)):s=i,t.set(s.key,s)}}return{flatKeys:n,sharedConfigMap:t}}let dN=class ob{node;knownState;unknownState;sharedNodeState;size;constructor(t,n,r=void 0,o=new Map,i=void 0){this.node=t,this.sharedNodeState=n,this.unknownState=r,this.knownState=o;const{sharedConfigMap:s}=this.sharedNodeState,a=i!==void 0?i:(function(l,c,u){let f=u.size;if(c)for(const d in c){const h=l.get(d);h&&u.has(h)||f++}return f})(s,r,o);this.size=a}getValue(t){const n=this.knownState.get(t);if(n!==void 0)return n;this.sharedNodeState.sharedConfigMap.set(t.key,t);let r=t.defaultValue;if(this.unknownState&&t.key in this.unknownState){const o=this.unknownState[t.key];o!==void 0&&(r=t.parse(o)),this.updateFromKnown(t,r)}return r}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){const t={...this.unknownState},n={};for(const[r,o]of this.knownState)r.isEqual(o,r.defaultValue)?delete t[r.key]:t[r.key]=r.unparse(o);for(const r of this.sharedNodeState.flatKeys)r in t&&(n[r]=t[r],delete t[r]);return Nm(t)&&(n.$=t),n}getWritable(t){if(this.node===t)return this;const{sharedNodeState:n,unknownState:r}=this,o=new Map(this.knownState);return new ob(t,n,(function(i,s,a){let l;if(a)for(const[c,u]of Object.entries(a)){const f=i.get(c);f?s.has(f)||s.set(f,f.parse(u)):(l=l||{},l[c]=u)}return l})(n.sharedConfigMap,o,r),o,this.size)}updateFromKnown(t,n){const r=t.key;this.sharedNodeState.sharedConfigMap.set(r,t);const{knownState:o,unknownState:i}=this;o.has(t)||i&&r in i||(i&&(delete i[r],this.unknownState=Nm(i)),this.size++),o.set(t,n)}updateFromUnknown(t,n){const r=this.sharedNodeState.sharedConfigMap.get(t);r?this.updateFromKnown(r,r.parse(n)):(this.unknownState=this.unknownState||{},t in this.unknownState||this.size++,this.unknownState[t]=n)}updateFromJSON(t){const{knownState:n}=this;for(const r of n.keys())n.set(r,r.defaultValue);if(this.size=n.size,this.unknownState=void 0,t)for(const[r,o]of Object.entries(t))this.updateFromUnknown(r,o)}};function ib(e){const t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new dN(t,sb(t));return t.__state=n,n}function sb(e){return e.__state?e.__state.sharedNodeState:Ub(es(),e.getType()).sharedNodeState}function Nm(e){if(e)for(const t in e)return e}function fN(e){return e}function Mm(e,t,n){for(const[r,o]of t.knownState){if(e.has(r.key))continue;e.add(r.key);const i=n?n.getValue(r):r.defaultValue;if(i!==o&&!r.isEqual(i,o))return!0}return!1}function Pm(e,t,n){const{unknownState:r}=t,o=n?n.unknownState:void 0;if(r){for(const[i,s]of Object.entries(r))if(!e.has(i)&&(e.add(i),s!==(o?o[i]:void 0)))return!0}return!1}function Lm(e,t){const n=e.__state;return n&&n.node===e?n.getWritable(t):n}function Fm(e,t){const n=e.__mode,r=e.__format,o=e.__style,i=t.__mode,s=t.__format,a=t.__style,l=e.__state,c=t.__state;return(n===null||n===i)&&(r===null||r===s)&&(o===null||o===a)&&(e.__state===null||l===c||(function(u,f){if(u===f)return!0;if(u&&f&&u.size!==f.size)return!1;const d=new Set;return!(u&&Mm(d,u,f)||f&&Mm(d,f,u)||u&&Pm(d,u,f)||f&&Pm(d,f,u))})(l,c))}function $m(e,t){const n=e.mergeWithSibling(t),r=$e()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function Om(e){let t,n,r=e;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(t=r.getPreviousSibling())!==null&&J(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(Fm(t,r)){r=$m(t,r);break}break}t.remove()}for(;(n=r.getNextSibling())!==null&&J(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(n.__text!==""){if(Fm(r,n)){r=$m(r,n);break}break}n.remove()}}else r.remove()}function Hs(e){return Im(e.anchor),Im(e.focus),e}function Im(e){for(;e.type==="element";){const t=e.getNode(),n=e.offset;let r,o;if(n===t.getChildrenSize()?(r=t.getChildAtIndex(n-1),o=!0):(r=t.getChildAtIndex(n),o=!1),J(r)){e.set(r.__key,o?r.getTextContentSize():0,"text",!0);break}if(!B(r))break;e.set(r.__key,o?r.getChildrenSize():0,"element",!0)}}let No,_t,Ws,oc,Id,Dd,Mo,En,jd,Ks,ut="",Dn=null,fo=null,lr="",ui=!1,El=!1;function Rl(e,t){const n=Mo.get(e);if(t!==null){const r=Hd(e);r.parentNode===t&&t.removeChild(r)}if(En.has(e)||_t._keyToDOMMap.delete(e),B(n)){const r=Al(n,Mo);Vd(r,0,r.length-1,null)}n!==void 0&&Jh(Ks,Ws,oc,n,"destroyed")}function Vd(e,t,n,r){let o=t;for(;o<=n;++o){const i=e[o];i!==void 0&&Rl(i,r)}}function lo(e,t){e.setProperty("text-align",t)}const hN="40px";function ab(e,t){const n=No.theme.indent;if(typeof n=="string"){const o=e.classList.contains(n);t>0&&!o?e.classList.add(n):t<1&&o&&e.classList.remove(n)}const r=getComputedStyle(e).getPropertyValue("--lexical-indent-base-value")||hN;e.style.setProperty("padding-inline-start",t===0?"":`calc(${t} * ${r})`)}function lb(e,t){const n=e.style;t===0?lo(n,""):t===1?lo(n,"left"):t===2?lo(n,"center"):t===3?lo(n,"right"):t===4?lo(n,"justify"):t===5?lo(n,"start"):t===6&&lo(n,"end")}function Bd(e,t){const n=(function(r){const o=r.__dir;if(o!==null)return o;if(at(r))return null;const i=r.getParentOrThrow();return at(i)&&i.__dir===null?"auto":null})(t);n!==null?e.dir=n:e.removeAttribute("dir")}function kl(e,t){const n=En.get(e);n===void 0&&X(60);const r=n.createDOM(No,_t);if((function(o,i,s){const a=s._keyToDOMMap;(function(l,c,u){const f=`__lexicalKey_${c._key}`;l[f]=u})(i,s,o),a.set(o,i)})(e,r,_t),J(n)?r.setAttribute("data-lexical-text","true"):Te(n)&&r.setAttribute("data-lexical-decorator","true"),B(n)){const o=n.__indent,i=n.__size;if(Bd(r,n),o!==0&&ab(r,o),i!==0){const a=i-1;zd(Al(n,En),n,0,a,n.getDOMSlot(r))}const s=n.__format;s!==0&&lb(r,s),n.isInline()||cb(null,n,r),mc(n)&&(ut+=Wr,lr+=Wr)}else{const o=n.getTextContent();if(Te(n)){const i=n.decorate(_t,No);i!==null&&ub(e,i),r.contentEditable="false"}ut+=o,lr+=o}return t!==null&&t.insertChild(r),Jh(Ks,Ws,oc,n,"created"),r}function zd(e,t,n,r,o){const i=ut;ut="";let s=n;for(;s<=r;++s){kl(e[s],o);const a=En.get(e[s]);a!==null&&J(a)&&Dn===null&&(Dn=a.getFormat(),fo=a.getStyle())}mc(t)&&(ut+=Wr),o.element.__lexicalTextContent=ut,ut=i+ut}function Dm(e,t){if(e){const n=e.__last;if(n){const r=t.get(n);if(r)return Un(r)?"line-break":Te(r)&&r.isInline()?"decorator":null}return"empty"}return null}function cb(e,t,n){const r=Dm(e,Mo),o=Dm(t,En);r!==o&&t.getDOMSlot(n).setManagedLineBreak(o)}function gN(e,t,n){var r;Dn=null,fo=null,(function(o,i,s){const a=ut,l=o.__size,c=i.__size;ut="";const u=s.element;if(l===1&&c===1){const f=o.__first,d=i.__first;if(f===d)ws(f,u);else{const g=Hd(f),p=kl(d,null);try{u.replaceChild(p,g)}catch(m){if(typeof m=="object"&&m!=null){const v=`${m.toString()} Parent: ${u.tagName}, new child: {tag: ${p.tagName} key: ${d}}, old child: {tag: ${g.tagName}, key: ${f}}.`;throw new Error(v)}throw m}Rl(f,null)}const h=En.get(d);J(h)&&Dn===null&&(Dn=h.getFormat(),fo=h.getStyle())}else{const f=Al(o,Mo),d=Al(i,En);if(f.length!==l&&X(227),d.length!==c&&X(228),l===0)c!==0&&zd(d,i,0,c-1,s);else if(c===0){if(l!==0){const h=s.after==null&&s.before==null&&s.element.__lexicalLineBreak==null;Vd(f,0,l-1,h?null:u),h&&(u.textContent="")}}else(function(h,g,p,m,v,y){const x=m-1,b=v-1;let w,_,E=y.getFirstChild(),R=0,k=0;for(;R<=x&&k<=b;){const $=g[R],j=p[k];if($===j)E=cu(ws(j,y.element)),R++,k++;else{w===void 0&&(w=new Set(g)),_===void 0&&(_=new Set(p));const D=_.has($),K=w.has(j);if(D)if(K){const I=Fo(_t,j);I===E?E=cu(ws(j,y.element)):(y.withBefore(E).insertChild(I),ws(j,y.element)),R++,k++}else kl(j,y.withBefore(E)),k++;else E=cu(Hd($)),Rl($,y.element),R++}const O=En.get(j);O!==null&&J(O)&&Dn===null&&(Dn=O.getFormat(),fo=O.getStyle())}const P=R>x,F=k>b;if(P&&!F){const $=p[b+1],j=$===void 0?null:_t.getElementByKey($);zd(p,h,k,b,y.withBefore(j))}else F&&!P&&Vd(g,R,x,y.element)})(i,f,d,l,c,s)}mc(i)&&(ut+=Wr),u.__lexicalTextContent=ut,ut=a+ut})(e,t,t.getDOMSlot(n)),r=t,Dn==null||Dn===r.__textFormat||El||r.setTextFormat(Dn),(function(o){fo==null||fo===o.__textStyle||El||o.setTextStyle(fo)})(t)}function Al(e,t){const n=[];let r=e.__first;for(;r!==null;){const o=t.get(r);o===void 0&&X(101),n.push(r),r=o.__next}return n}function ws(e,t){const n=Mo.get(e);let r=En.get(e);n!==void 0&&r!==void 0||X(61);const o=ui||Dd.has(e)||Id.has(e),i=Fo(_t,e);if(n===r&&!o){if(B(n)){const s=i.__lexicalTextContent;s!==void 0&&(ut+=s,lr+=s)}else{const s=n.getTextContent();lr+=s,ut+=s}return i}if(n!==r&&o&&Jh(Ks,Ws,oc,r,"updated"),r.updateDOM(n,i,No)){const s=kl(e,null);return t===null&&X(62),t.replaceChild(s,i),Rl(e,null),s}if(B(n)&&B(r)){const s=r.__indent;(ui||s!==n.__indent)&&ab(i,s);const a=r.__format;if((ui||a!==n.__format)&&lb(i,a),o&&(gN(n,r,i),at(r)||r.isInline()||cb(n,r,i)),mc(r)&&(ut+=Wr,lr+=Wr),(ui||r.__dir!==n.__dir)&&(Bd(i,r),at(r)&&!ui))for(const l of r.getChildren())B(l)&&Bd(Fo(_t,l.getKey()),l)}else{const s=r.getTextContent();if(Te(r)){const a=r.decorate(_t,No);a!==null&&ub(e,a)}ut+=s,lr+=s}if(!El&&at(r)&&r.__cachedText!==lr){const s=r.getWritable();s.__cachedText=lr,r=s}return i}function ub(e,t){let n=_t._pendingDecorators;const r=_t._decorators;if(n===null){if(r[e]===t)return;n=Qb(_t)}n[e]=t}function cu(e){let t=e.nextSibling;return t!==null&&t===_t._blockCursorElement&&(t=t.nextSibling),t}function pN(e,t,n,r,o,i){ut="",lr="",ui=r===2,_t=n,No=n._config,Ws=n._nodes,oc=_t._listeners.mutation,Id=o,Dd=i,Mo=e._nodeMap,En=t._nodeMap,El=t._readOnly,jd=new Map(n._keyToDOMMap);const s=new Map;return Ks=s,ws("root",null),_t=void 0,Ws=void 0,Id=void 0,Dd=void 0,Mo=void 0,En=void 0,No=void 0,jd=void 0,Ks=void 0,s}function Hd(e){const t=jd.get(e);return t===void 0&&X(75,e),t}function ce(e){return{type:e}}const hr=ce("SELECTION_CHANGE_COMMAND"),Nh=ce("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),ic=ce("CLICK_COMMAND"),db=ce("BEFORE_INPUT_COMMAND"),fb=ce("INPUT_COMMAND"),hb=ce("COMPOSITION_START_COMMAND"),gb=ce("COMPOSITION_END_COMMAND"),Dr=ce("DELETE_CHARACTER_COMMAND"),_i=ce("INSERT_LINE_BREAK_COMMAND"),Po=ce("INSERT_PARAGRAPH_COMMAND"),To=ce("CONTROLLED_TEXT_INSERTION_COMMAND"),Mh=ce("PASTE_COMMAND"),Wd=ce("REMOVE_TEXT_COMMAND"),Oi=ce("DELETE_WORD_COMMAND"),Lo=ce("DELETE_LINE_COMMAND"),Vt=ce("FORMAT_TEXT_COMMAND"),pb=ce("UNDO_COMMAND"),mb=ce("REDO_COMMAND"),yb=ce("KEYDOWN_COMMAND"),Ph=ce("KEY_ARROW_RIGHT_COMMAND"),mN=ce("MOVE_TO_END"),Lh=ce("KEY_ARROW_LEFT_COMMAND"),yN=ce("MOVE_TO_START"),Fh=ce("KEY_ARROW_UP_COMMAND"),$h=ce("KEY_ARROW_DOWN_COMMAND"),Nl=ce("KEY_ENTER_COMMAND"),vb=ce("KEY_SPACE_COMMAND"),sc=ce("KEY_BACKSPACE_COMMAND"),Oh=ce("KEY_ESCAPE_COMMAND"),Ih=ce("KEY_DELETE_COMMAND"),Dh=ce("KEY_TAB_COMMAND"),vN=ce("INSERT_TAB_COMMAND"),xN=ce("INDENT_CONTENT_COMMAND"),jm=ce("OUTDENT_CONTENT_COMMAND"),xb=ce("DROP_COMMAND"),Ti=ce("FORMAT_ELEMENT_COMMAND"),bb=ce("DRAGSTART_COMMAND"),wb=ce("DRAGOVER_COMMAND"),bN=ce("DRAGEND_COMMAND"),ac=ce("COPY_COMMAND"),lc=ce("CUT_COMMAND"),Kd=ce("SELECT_ALL_COMMAND"),Cb=ce("FOCUS_COMMAND"),wN=ce("BLUR_COMMAND"),CN=ce("KEY_MODIFIER_COMMAND"),tr=Object.freeze({}),Ud=[["keydown",function(e,t){Us=e.timeStamp,Sb=e.key,!t.isComposing()&&te(t,yb,e)}],["pointerdown",function(e,t){const n=e.target,r=e.pointerType;Cn(n)&&r!=="touch"&&r!=="pen"&&e.button===0&&Gn(t,()=>{Gb(n)||(Yd=!0)})}],["compositionstart",function(e,t){te(t,hb,e)}],["compositionend",function(e,t){Ao?Cs=!0:qi||!oa&&!ia?te(t,gb,e):(Xd=!0,Zd=e.data)}],["input",function(e,t){e.stopPropagation(),Gn(t,()=>{t.dispatchCommand(fb,e)},{event:e}),di=null}],["click",function(e,t){Gn(t,()=>{const n=Z(),r=Ot(hn(t)),o=Zn();if(r){if(W(n)){const i=n.anchor,s=i.getNode();if(i.type==="element"&&i.offset===0&&n.isCollapsed()&&!at(s)&&qe().getChildrenSize()===1&&s.getTopLevelElementOrThrow().isEmpty()&&o!==null&&n.is(o))r.removeAllRanges(),n.dirty=!0;else if(e.detail===3&&!n.isCollapsed()&&s!==n.focus.getNode()){const a=we(s,l=>B(l)&&!l.isInline());B(a)&&a.select(0)}}else if(e.pointerType==="touch"||e.pointerType==="pen"){const i=r.anchorNode;(Be(i)||Cr(i))&&Ge(fc(o,r,t,e))}}te(t,ic,e)})}],["cut",tr],["copy",tr],["dragstart",tr],["dragover",tr],["dragend",tr],["paste",tr],["focus",tr],["blur",tr],["drop",tr]];Tl&&Ud.push(["beforeinput",(e,t)=>(function(n,r){const o=n.inputType;o==="deleteCompositionText"||Ao&&ow(r)||o!=="insertCompositionText"&&te(r,db,n)})(e,t)]);let Us=0,Sb=null,_b=0,di=null;const Gd=new WeakMap,Ml=new WeakMap;let qd=!1,Yd=!1,ks=!1,Cs=!1,Xd=!1,Zd="",yo=null,Tb=[0,"",0,"root",0];function Eb(e,t,n,r,o){const i=e.anchor,s=e.focus,a=i.getNode(),l=$e(),c=Ot(hn(l)),u=c!==null?c.anchorNode:null,f=i.key,d=l.getElementByKey(f),h=n.length;return f!==s.key||!J(a)||(!o&&(!Tl||_b<r+50)||a.isDirty()&&h<2||tw(n))&&i.offset!==s.offset&&!a.isComposing()||sr(a)||a.isDirty()&&h>1||(o||!Tl)&&d!==null&&!a.isComposing()&&u!==Di(d)||c!==null&&t!==null&&(!t.collapsed||t.startContainer!==c.anchorNode||t.startOffset!==c.anchorOffset)||a.getFormat()!==e.format||a.getStyle()!==e.style||(function(g,p){if(p.isSegmented())return!0;if(!g.isCollapsed())return!1;const m=g.anchor.offset,v=p.getParentOrThrow(),y=Eo(p);return m===0?!p.canInsertTextBefore()||!v.canInsertTextBefore()&&!p.isComposing()||y||(function(x){const b=x.getPreviousSibling();return(J(b)||B(b)&&b.isInline())&&!b.canInsertTextAfter()})(p):m===p.getTextContentSize()&&(!p.canInsertTextAfter()||!v.canInsertTextAfter()&&!p.isComposing()||y)})(e,a)}function Vm(e,t){return Cr(e)&&e.nodeValue!==null&&t!==0&&t!==e.nodeValue.length}function Bm(e,t,n){const{anchorNode:r,anchorOffset:o,focusNode:i,focusOffset:s}=e;qd&&(qd=!1,Vm(r,o)&&Vm(i,s)&&!yo)||Gn(t,()=>{if(!n)return void Ge(null);if(!la(t,r,i))return;let a=Z();if(yo&&W(a)&&a.isCollapsed()){const l=a.anchor,c=yo.anchor;(l.key===c.key&&l.offset===c.offset+1||l.offset===1&&c.getNode().is(l.getNode().getPreviousSibling()))&&(a=yo.clone(),Ge(a))}if(yo=null,W(a)){const l=a.anchor,c=l.getNode();if(a.isCollapsed()){e.type==="Range"&&e.anchorNode===e.focusNode&&(a.dirty=!0);const u=hn(t).event,f=u?u.timeStamp:performance.now(),[d,h,g,p,m]=Tb,v=qe(),y=t.isComposing()===!1&&v.getTextContent()==="";if(f<m+200&&l.offset===g&&l.key===p)il(a,d,h);else if(l.type==="text")J(c)||X(141),Rb(a,c);else if(l.type==="element"&&!y){B(c)||X(259);const x=l.getNode();x.isEmpty()?(function(b,w){const _=w.getTextFormat(),E=w.getTextStyle();il(b,_,E)})(a,x):il(a,0,"")}}else{const u=l.key,f=a.focus.key,d=a.getNodes(),h=d.length,g=a.isBackward(),p=g?s:o,m=g?o:s,v=g?f:u,y=g?u:f;let x=2047,b=!1;for(let w=0;w<h;w++){const _=d[w],E=_.getTextContentSize();if(J(_)&&E!==0&&!(w===0&&_.__key===v&&p===E||w===h-1&&_.__key===y&&m===0)&&(b=!0,x&=_.getFormat(),x===0))break}a.format=b?x:0}}te(t,hr,void 0)})}function il(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function Rb(e,t){il(e,t.getFormat(),t.getStyle())}function kb(e){if(!e.getTargetRanges)return null;const t=e.getTargetRanges();return t.length===0?null:t[0]}function SN(e){const t=e.inputType,n=kb(e),r=$e(),o=Z();if(t==="deleteContentBackward"){if(o===null){const f=Zn();if(!W(f))return!0;Ge(f.clone())}if(W(o)){const f=o.anchor.key===o.focus.key;if(i=e.timeStamp,Sb==="MediaLast"&&i<Us+30&&r.isComposing()&&f){if(yt(null),Us=0,setTimeout(()=>{Gn(r,()=>{yt(null)})},30),W(o)){const d=o.anchor.getNode();d.markDirty(),J(d)||X(142),Rb(o,d)}}else{yt(null),e.preventDefault();const d=o.anchor.getNode(),h=d.getTextContent(),g=d.canInsertTextAfter(),p=o.anchor.offset===0&&o.focus.offset===h.length;let m=Rm&&f&&!p&&g;if(m&&o.isCollapsed()&&(m=!Te(nf(o.anchor,!0))),!m){te(r,Dr,!0);const v=Z();Rm&&W(v)&&v.isCollapsed()&&(yo=v,setTimeout(()=>yo=null))}}return!0}}var i;if(!W(o))return!0;const s=e.data;di!==null&&Xh(!1,r,di),o.dirty&&di===null||!o.isCollapsed()||at(o.anchor.getNode())||n===null||o.applyDOMRange(n),di=null;const a=o.anchor,l=o.focus,c=a.getNode(),u=l.getNode();if(t==="insertText"||t==="insertTranspose"){if(s===`
37
+ `)e.preventDefault(),te(r,_i,!1);else if(s===Wr)e.preventDefault(),te(r,Po,void 0);else if(s==null&&e.dataTransfer){const f=e.dataTransfer.getData("text/plain");e.preventDefault(),o.insertRawText(f)}else s!=null&&Eb(o,n,s,e.timeStamp,!0)?(e.preventDefault(),te(r,To,s)):di=s;return _b=e.timeStamp,!0}switch(e.preventDefault(),t){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":te(r,To,e);break;case"insertFromComposition":yt(null),te(r,To,e);break;case"insertLineBreak":yt(null),te(r,_i,!1);break;case"insertParagraph":yt(null),ks&&!qi?(ks=!1,te(r,_i,!1)):te(r,Po,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":te(r,Mh,e);break;case"deleteByComposition":(function(f,d){return f!==d||B(f)||B(d)||!Eo(f)||!Eo(d)})(c,u)&&te(r,Wd,e);break;case"deleteByDrag":case"deleteByCut":te(r,Wd,e);break;case"deleteContent":te(r,Dr,!1);break;case"deleteWordBackward":te(r,Oi,!0);break;case"deleteWordForward":te(r,Oi,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":te(r,Lo,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":te(r,Lo,!1);break;case"formatStrikeThrough":te(r,Vt,"strikethrough");break;case"formatBold":te(r,Vt,"bold");break;case"formatItalic":te(r,Vt,"italic");break;case"formatUnderline":te(r,Vt,"underline");break;case"historyUndo":te(r,pb,void 0);break;case"historyRedo":te(r,mb,void 0)}return!0}function _N(e){if(Be(e.target)&&Gb(e.target))return!0;const t=$e(),n=Z(),r=e.data,o=kb(e);if(r!=null&&W(n)&&Eb(n,o,r,e.timeStamp,!1)){Cs&&(Pl(t,r),Cs=!1);const i=n.anchor.getNode(),s=Ot(hn(t));if(s===null)return!0;const a=n.isBackward(),l=a?n.anchor.offset:n.focus.offset,c=a?n.focus.offset:n.anchor.offset;Tl&&!n.isCollapsed()&&J(i)&&s.anchorNode!==null&&i.getTextContent().slice(0,l)+r+i.getTextContent().slice(l+c)===rw(s.anchorNode)||te(t,To,r);const u=r.length;Ao&&u>1&&e.inputType==="insertCompositionText"&&!t.isComposing()&&(n.anchor.offset-=u),oa||qi||ia||!t.isComposing()||(Us=0,yt(null))}else Xh(!1,t,r!==null?r:void 0),Cs&&(Pl(t,r||void 0),Cs=!1);return(function(){ft();const i=$e();tb(i)})(),!0}function TN(e){const t=$e(),n=Z();if(W(n)&&!t.isComposing()){const r=n.anchor,o=n.anchor.getNode();yt(r.key),(e.timeStamp<Us+30||r.type==="element"||!n.isCollapsed()||o.getFormat()!==n.format||J(o)&&o.getStyle()!==n.style)&&te(t,To,QA)}return!0}function EN(e){return Pl($e(),e.data),!0}function Pl(e,t){const n=e._compositionKey;if(yt(null),n!==null&&t!=null){if(t===""){const r=Pe(n),o=Di(e.getElementByKey(n));return void(o!==null&&o.nodeValue!==null&&J(r)&&Zh(r,o.nodeValue,null,null,!0))}if(t[t.length-1]===`
38
+ `){const r=Z();if(W(r)){const o=r.focus;return r.anchor.set(o.key,o.offset,o.type),void te(e,Nl,null)}}}Xh(!0,e,t)}function RN(e){const t=$e();if(e.key==null)return!0;if(Xd&&fy(e))return Gn(t,()=>{Pl(t,Zd)}),Xd=!1,Zd="",!0;if((function(n){return Me(n,"ArrowRight",{shiftKey:"any"})})(e))te(t,Ph,e);else if((function(n){return Me(n,"ArrowRight",rr)})(e))te(t,mN,e);else if((function(n){return Me(n,"ArrowLeft",{shiftKey:"any"})})(e))te(t,Lh,e);else if((function(n){return Me(n,"ArrowLeft",rr)})(e))te(t,yN,e);else if((function(n){return Me(n,"ArrowUp",{altKey:"any",shiftKey:"any"})})(e))te(t,Fh,e);else if((function(n){return Me(n,"ArrowDown",{altKey:"any",shiftKey:"any"})})(e))te(t,$h,e);else if((function(n){return Me(n,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:!0})})(e))ks=!0,te(t,Nl,e);else if((function(n){return n.key===" "})(e))te(t,vb,e);else if((function(n){return wn&&Me(n,"o",{ctrlKey:!0})})(e))e.preventDefault(),ks=!0,te(t,_i,!0);else if((function(n){return Me(n,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any"})})(e))ks=!1,te(t,Nl,e);else if((function(n){return Me(n,"Backspace",{shiftKey:"any"})||wn&&Me(n,"h",{ctrlKey:!0})})(e))fy(e)?te(t,sc,e):(e.preventDefault(),te(t,Dr,!0));else if((function(n){return n.key==="Escape"})(e))te(t,Oh,e);else if((function(n){return Me(n,"Delete",{})||wn&&Me(n,"d",{ctrlKey:!0})})(e))(function(n){return n.key==="Delete"})(e)?te(t,Ih,e):(e.preventDefault(),te(t,Dr,!1));else if((function(n){return Me(n,"Backspace",dy)})(e))e.preventDefault(),te(t,Oi,!0);else if((function(n){return Me(n,"Delete",dy)})(e))e.preventDefault(),te(t,Oi,!1);else if((function(n){return wn&&Me(n,"Backspace",{metaKey:!0})})(e))e.preventDefault(),te(t,Lo,!0);else if((function(n){return wn&&(Me(n,"Delete",{metaKey:!0})||Me(n,"k",{ctrlKey:!0}))})(e))e.preventDefault(),te(t,Lo,!1);else if((function(n){return Me(n,"b",rr)})(e))e.preventDefault(),te(t,Vt,"bold");else if((function(n){return Me(n,"u",rr)})(e))e.preventDefault(),te(t,Vt,"underline");else if((function(n){return Me(n,"i",rr)})(e))e.preventDefault(),te(t,Vt,"italic");else if((function(n){return Me(n,"Tab",{shiftKey:"any"})})(e))te(t,Dh,e);else if((function(n){return Me(n,"z",rr)})(e))e.preventDefault(),te(t,pb,void 0);else if((function(n){return wn?Me(n,"z",{metaKey:!0,shiftKey:!0}):Me(n,"y",{ctrlKey:!0})||Me(n,"z",{ctrlKey:!0,shiftKey:!0})})(e))e.preventDefault(),te(t,mb,void 0);else{const n=t._editorState._selection;n===null||W(n)?hy(e)&&(e.preventDefault(),te(t,Kd,e)):(function(r){return Me(r,"c",rr)})(e)?(e.preventDefault(),te(t,ac,e)):(function(r){return Me(r,"x",rr)})(e)?(e.preventDefault(),te(t,lc,e)):hy(e)&&(e.preventDefault(),te(t,Kd,e))}return(function(n){return n.ctrlKey||n.shiftKey||n.altKey||n.metaKey})(e)&&t.dispatchCommand(CN,e),!0}function Ab(e){let t=e.__lexicalEventHandles;return t===void 0&&(t=[],e.__lexicalEventHandles=t),t}const Ei=new Map;function Nb(e){const t=aM(e.target);if(t===null)return;const n=qb(t.anchorNode);if(n===null)return;Yd&&(Yd=!1,Gn(n,()=>{const l=Zn(),c=t.anchorNode;(Be(c)||Cr(c))&&Ge(fc(l,t,n,e))}));const r=Yh(n),o=r[r.length-1],i=o._key,s=Ei.get(i),a=s||o;a!==n&&Bm(t,a,!1),Bm(t,n,!0),n!==o?Ei.set(i,n):s&&Ei.delete(i)}function zm(e){e._lexicalHandled=!0}function Hm(e){return e._lexicalHandled===!0}function kN(e){const t=Gd.get(e);if(t===void 0)return;const n=Ml.get(t);if(n===void 0)return;const r=n-1;r>=0||X(164),Gd.delete(e),Ml.set(t,r),r===0&&t.removeEventListener("selectionchange",Nb);const o=gc(e);qh(o)?((function(s){if(s._parentEditor!==null){const a=Yh(s),l=a[a.length-1]._key;Ei.get(l)===s&&Ei.delete(l)}else Ei.delete(s._key)})(o),e.__lexicalEditor=null):o&&X(198);const i=Ab(e);for(let s=0;s<i.length;s++)i[s]();e.__lexicalEventHandles=[]}function Jd(e,t,n){ft();const r=e.__key,o=e.getParent();if(o===null)return;const i=(function(a){const l=Z();if(!W(l)||!B(a))return l;const{anchor:c,focus:u}=l,f=c.getNode(),d=u.getNode();return rf(f,a)&&c.set(a.__key,0,"element"),rf(d,a)&&u.set(a.__key,0,"element"),l})(e);let s=!1;if(W(i)&&t){const a=i.anchor,l=i.focus;a.key===r&&($l(a,e,o,e.getPreviousSibling(),e.getNextSibling()),s=!0),l.key===r&&($l(l,e,o,e.getPreviousSibling(),e.getNextSibling()),s=!0)}else Ct(i)&&t&&e.isSelected()&&e.selectPrevious();if(W(i)&&t&&!s){const a=e.getIndexWithinParent();Ro(e),Fl(i,o,a,-1)}else Ro(e);n||vt(o)||o.canBeEmpty()||!o.isEmpty()||Jd(o,t),t&&i&&at(o)&&o.isEmpty()&&o.selectEnd()}const Mb=Symbol.for("ephemeral");function Ll(e){return e[Mb]||!1}class Kn{__type;__key;__parent;__prev;__next;__state;static getType(){const{ownNodeType:t}=yc(this);return t===void 0&&X(64,this.name),t}static clone(t){X(65,this.name)}$config(){return{}}config(t,n){const r=n.extends||Object.getPrototypeOf(this.constructor);return Object.assign(n,{extends:r,type:t}),{[t]:n}}afterCloneFrom(t){this.__key===t.__key?(this.__parent=t.__parent,this.__next=t.__next,this.__prev=t.__prev,this.__state=t.__state):t.__state&&(this.__state=t.__state.getWritable(this))}static importDOM;constructor(t){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",{configurable:!0,enumerable:!1,value:void 0,writable:!0}),Zb(this,t)}getType(){return this.__type}isInline(){X(137,this.constructor.name)}isAttached(){let t=this.__key;for(;t!==null;){if(t==="root")return!0;const n=Pe(t);if(n===null)break;t=n.__parent}return!1}isSelected(t){const n=t||Z();if(n==null)return!1;const r=n.getNodes().some(o=>o.__key===this.__key);if(J(this))return r;if(W(n)&&n.anchor.type==="element"&&n.focus.type==="element"){if(n.isCollapsed())return!1;const o=this.getParent();if(Te(this)&&this.isInline()&&o){const i=n.isBackward()?n.focus:n.anchor;if(o.is(i.getNode())&&i.offset===o.getChildrenSize()&&this.is(o.getLastChild()))return!1}}return r}getKey(){return this.__key}getIndexWithinParent(){const t=this.getParent();if(t===null)return-1;let n=t.getFirstChild(),r=0;for(;n!==null;){if(this.is(n))return r;r++,n=n.getNextSibling()}return-1}getParent(){const t=this.getLatest().__parent;return t===null?null:Pe(t)}getParentOrThrow(){const t=this.getParent();return t===null&&X(66,this.__key),t}getTopLevelElement(){let t=this;for(;t!==null;){const n=t.getParent();if(vt(n))return B(t)||t===this&&Te(t)||X(194),t;t=n}return null}getTopLevelElementOrThrow(){const t=this.getTopLevelElement();return t===null&&X(67,this.__key),t}getParents(){const t=[];let n=this.getParent();for(;n!==null;)t.push(n),n=n.getParent();return t}getParentKeys(){const t=[];let n=this.getParent();for(;n!==null;)t.push(n.__key),n=n.getParent();return t}getPreviousSibling(){const t=this.getLatest().__prev;return t===null?null:Pe(t)}getPreviousSiblings(){const t=[],n=this.getParent();if(n===null)return t;let r=n.getFirstChild();for(;r!==null&&!r.is(this);)t.push(r),r=r.getNextSibling();return t}getNextSibling(){const t=this.getLatest().__next;return t===null?null:Pe(t)}getNextSiblings(){const t=[];let n=this.getNextSibling();for(;n!==null;)t.push(n),n=n.getNextSibling();return t}getCommonAncestor(t){const n=B(this)?this:this.getParent(),r=B(t)?t:t.getParent(),o=n&&r?al(n,r):null;return o?o.commonAncestor:null}is(t){return t!=null&&this.__key===t.__key}isBefore(t){const n=al(this,t);return n!==null&&(n.type==="descendant"||(n.type==="branch"?dw(n)===-1:(n.type!=="same"&&n.type!=="ancestor"&&X(279),!1)))}isParentOf(t){const n=al(this,t);return n!==null&&n.type==="ancestor"}getNodesBetween(t){const n=this.isBefore(t),r=[],o=new Set;let i=this;for(;i!==null;){const s=i.__key;if(o.has(s)||(o.add(s),r.push(i)),i===t)break;const a=B(i)?n?i.getFirstChild():i.getLastChild():null;if(a!==null){i=a;continue}const l=n?i.getNextSibling():i.getPreviousSibling();if(l!==null){i=l;continue}const c=i.getParentOrThrow();if(o.has(c.__key)||r.push(c),c===t)break;let u=null,f=c;do{if(f===null&&X(68),u=n?f.getNextSibling():f.getPreviousSibling(),f=f.getParent(),f===null)break;u!==null||o.has(f.__key)||r.push(f)}while(u===null);i=u}return n||r.reverse(),r}isDirty(){const t=$e()._dirtyLeaves;return t!==null&&t.has(this.__key)}getLatest(){if(Ll(this))return this;const t=Pe(this.__key);return t===null&&X(113),t}getWritable(){if(Ll(this))return this;ft();const t=Jr(),n=$e(),r=t._nodeMap,o=this.__key,i=this.getLatest(),s=n._cloneNotNeeded,a=Z();if(a!==null&&a.setCachedNodes(null),s.has(o))return Il(i),i;const l=aw(i);return s.add(o),Il(l),r.set(o,l),l}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(t,n){X(70)}updateDOM(t,n,r){X(71)}exportDOM(t){return{element:this.createDOM(t._config,t)}}exportJSON(){const t=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...t}}static importJSON(t){X(18,this.name)}updateFromJSON(t){return(function(n,r){const o=n.getWritable(),i=r.$;let s=i;for(const a of sb(o).flatKeys)a in r&&(s!==void 0&&s!==i||(s={...i}),s[a]=r[a]);return(o.__state||s)&&ib(n).updateFromJSON(s),o})(this,t)}static transform(){return null}remove(t){Jd(this,!0,t)}replace(t,n){ft();let r=Z();r!==null&&(r=r.clone()),pu(this,t);const o=this.getLatest(),i=this.__key,s=t.__key,a=t.getWritable(),l=this.getParentOrThrow().getWritable(),c=l.__size;Ro(a);const u=o.getPreviousSibling(),f=o.getNextSibling(),d=o.__prev,h=o.__next,g=o.__parent;if(Jd(o,!1,!0),u===null?l.__first=s:u.getWritable().__next=s,a.__prev=d,f===null?l.__last=s:f.getWritable().__prev=s,a.__next=h,a.__parent=g,l.__size=c,n&&(B(this)&&B(a)||X(139),this.getChildren().forEach(p=>{a.append(p)})),W(r)){Ge(r);const p=r.anchor,m=r.focus;p.key===i&&Gm(p,a),m.key===i&&Gm(m,a)}return Mr()===i&&yt(s),a}insertAfter(t,n=!0){ft(),pu(this,t);const r=this.getWritable(),o=t.getWritable(),i=o.getParent(),s=Z();let a=!1,l=!1;if(i!==null){const h=t.getIndexWithinParent();if(Ro(o),W(s)){const g=i.__key,p=s.anchor,m=s.focus;a=p.type==="element"&&p.key===g&&p.offset===h+1,l=m.type==="element"&&m.key===g&&m.offset===h+1}}const c=this.getNextSibling(),u=this.getParentOrThrow().getWritable(),f=o.__key,d=r.__next;if(c===null?u.__last=f:c.getWritable().__prev=f,u.__size++,r.__next=f,o.__next=d,o.__prev=r.__key,o.__parent=r.__parent,n&&W(s)){const h=this.getIndexWithinParent();Fl(s,u,h+1);const g=u.__key;a&&s.anchor.set(g,h+2,"element"),l&&s.focus.set(g,h+2,"element")}return t}insertBefore(t,n=!0){ft(),pu(this,t);const r=this.getWritable(),o=t.getWritable(),i=o.__key;Ro(o);const s=this.getPreviousSibling(),a=this.getParentOrThrow().getWritable(),l=r.__prev,c=this.getIndexWithinParent();s===null?a.__first=i:s.getWritable().__next=i,a.__size++,r.__prev=i,o.__prev=l,o.__next=r.__key,o.__parent=r.__parent;const u=Z();return n&&W(u)&&Fl(u,this.getParentOrThrow(),c),t}isParentRequired(){return!1}createParentElementNode(){return ye()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(t,n){ft();const r=this.getPreviousSibling(),o=this.getParentOrThrow();if(r===null)return o.select(0,0);if(B(r))return r.select();if(!J(r)){const i=r.getIndexWithinParent()+1;return o.select(i,i)}return r.select(t,n)}selectNext(t,n){ft();const r=this.getNextSibling(),o=this.getParentOrThrow();if(r===null)return o.select();if(B(r))return r.select(0,0);if(!J(r)){const i=r.getIndexWithinParent();return o.select(i,i)}return r.select(t,n)}markDirty(){this.getWritable()}reconcileObservedMutation(t,n){this.markDirty()}}const AN="historic",Ri="history-merge",NN="paste",Pb="collaboration",MN="skip-scroll-into-view",PN="skip-dom-selection",LN="skip-selection-focus";class Yi extends Kn{static getType(){return"linebreak"}static clone(t){return new Yi(t.__key)}constructor(t){super(t)}getTextContent(){return`
39
+ `}createDOM(){return document.createElement("br")}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:t=>(function(n){const r=n.parentElement;if(r!==null&&Dl(r)){const o=r.firstChild;if(o===n||o.nextSibling===n&&Pa(o)){const i=r.lastChild;if(i===n||i.previousSibling===n&&Pa(i))return!0}}return!1})(t)||(function(n){const r=n.parentElement;if(r!==null&&Dl(r)){const o=r.firstChild;if(o===n||o.nextSibling===n&&Pa(o))return!1;const i=r.lastChild;if(i===n||i.previousSibling===n&&Pa(i))return!0}return!1})(t)?null:{conversion:FN,priority:0}}}static importJSON(t){return kn().updateFromJSON(t)}}function FN(e){return{node:kn()}}function kn(){return Et(new Yi)}function Un(e){return e instanceof Yi}function Pa(e){return Cr(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||"")}function uu(e,t){return 16&t?"code":t&J1?"mark":32&t?"sub":64&t?"sup":null}function du(e,t){return 1&t?"strong":2&t?"em":"span"}function Lb(e,t,n,r,o){const i=r.classList;let s=ki(o,"base");s!==void 0&&i.add(...s),s=ki(o,"underlineStrikethrough");let a=!1;const l=8&t&&4&t;s!==void 0&&(8&n&&4&n?(a=!0,l||i.add(...s)):l&&i.remove(...s));for(const c in Kr){const u=Kr[c];if(s=ki(o,c),s!==void 0)if(n&u){if(a&&(c==="underline"||c==="strikethrough")){t&u&&i.remove(...s);continue}((t&u)===0||l&&c==="underline"||c==="strikethrough")&&i.add(...s)}else t&u&&i.remove(...s)}}function Fb(e,t,n){const r=t.firstChild,o=n.isComposing(),i=e+(o?rc:"");if(r==null)t.textContent=i;else{const s=r.nodeValue;if(s!==i)if(o||Ao){const[a,l,c]=(function(u,f){const d=u.length,h=f.length;let g=0,p=0;for(;g<d&&g<h&&u[g]===f[g];)g++;for(;p+g<d&&p+g<h&&u[d-p-1]===f[h-p-1];)p++;return[g,d-g-p,f.slice(g,h-p)]})(s,i);l!==0&&r.deleteData(a,l),r.insertData(a,c)}else r.nodeValue=i}}function Wm(e,t,n,r,o,i){Fb(o,e,t);const s=i.theme.text;s!==void 0&&Lb(0,0,r,e,s)}function La(e,t){const n=document.createElement(t);return n.appendChild(e),n}class fn extends Kn{__text;__format;__style;__mode;__detail;static getType(){return"text"}static clone(t){return new fn(t.__text,t.__key)}afterCloneFrom(t){super.afterCloneFrom(t),this.__text=t.__text,this.__format=t.__format,this.__style=t.__style,this.__mode=t.__mode,this.__detail=t.__detail}constructor(t="",n){super(n),this.__text=t,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const t=this.getLatest();return rN[t.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===Mr()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(t){const n=Kr[t];return(this.getFormat()&n)!==0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(t,n){return Ol(this.getLatest().__format,t,n)}canHaveFormat(){return!0}isInline(){return!0}createDOM(t,n){const r=this.__format,o=uu(0,r),i=du(0,r),s=o===null?i:o,a=document.createElement(s);let l=a;this.hasFormat("code")&&a.setAttribute("spellcheck","false"),o!==null&&(l=document.createElement(i),a.appendChild(l)),Wm(l,this,0,r,this.__text,t);const c=this.__style;return c!==""&&(a.style.cssText=c),a}updateDOM(t,n,r){const o=this.__text,i=t.__format,s=this.__format,a=uu(0,i),l=uu(0,s),c=du(0,i),u=du(0,s);if((a===null?c:a)!==(l===null?u:l))return!0;if(a===l&&c!==u){const p=n.firstChild;p==null&&X(48);const m=document.createElement(u);return Wm(m,this,0,s,o,r),n.replaceChild(m,p),!1}let f=n;l!==null&&a!==null&&(f=n.firstChild,f==null&&X(49)),Fb(o,f,this);const d=r.theme.text;d!==void 0&&i!==s&&Lb(0,i,s,f,d);const h=t.__style,g=this.__style;return h!==g&&(n.style.cssText=g),!1}static importDOM(){return{"#text":()=>({conversion:DN,priority:0}),b:()=>({conversion:ON,priority:0}),code:()=>({conversion:nr,priority:0}),em:()=>({conversion:nr,priority:0}),i:()=>({conversion:nr,priority:0}),mark:()=>({conversion:nr,priority:0}),s:()=>({conversion:nr,priority:0}),span:()=>({conversion:$N,priority:0}),strong:()=>({conversion:nr,priority:0}),sub:()=>({conversion:nr,priority:0}),sup:()=>({conversion:nr,priority:0}),u:()=>({conversion:nr,priority:0})}}static importJSON(t){return Fe().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setTextContent(t.text).setFormat(t.format).setDetail(t.detail).setMode(t.mode).setStyle(t.style)}exportDOM(t){let{element:n}=super.exportDOM(t);return Be(n)||X(132),n.style.whiteSpace="pre-wrap",this.hasFormat("lowercase")?n.style.textTransform="lowercase":this.hasFormat("uppercase")?n.style.textTransform="uppercase":this.hasFormat("capitalize")&&(n.style.textTransform="capitalize"),this.hasFormat("bold")&&(n=La(n,"b")),this.hasFormat("italic")&&(n=La(n,"i")),this.hasFormat("strikethrough")&&(n=La(n,"s")),this.hasFormat("underline")&&(n=La(n,"u")),{element:n}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(t,n){}setFormat(t){const n=this.getWritable();return n.__format=typeof t=="string"?Kr[t]:t,n}setDetail(t){const n=this.getWritable();return n.__detail=typeof t=="string"?eN[t]:t,n}setStyle(t){const n=this.getWritable();return n.__style=t,n}toggleFormat(t){const n=Ol(this.getFormat(),t,null);return this.setFormat(n)}toggleDirectionless(){const t=this.getWritable();return t.__detail^=1,t}toggleUnmergeable(){const t=this.getWritable();return t.__detail^=2,t}setMode(t){const n=nN[t];if(this.__mode===n)return this;const r=this.getWritable();return r.__mode=n,r}setTextContent(t){if(this.__text===t)return this;const n=this.getWritable();return n.__text=t,n}select(t,n){ft();let r=t,o=n;const i=Z(),s=this.getTextContent(),a=this.__key;if(typeof s=="string"){const l=s.length;r===void 0&&(r=l),o===void 0&&(o=l)}else r=0,o=0;if(!W(i))return Ib(a,r,a,o,"text","text");{const l=Mr();l!==i.anchor.key&&l!==i.focus.key||yt(a),i.setTextNodeRange(this,r,this,o)}return i}selectStart(){return this.select(0,0)}selectEnd(){const t=this.getTextContentSize();return this.select(t,t)}spliceText(t,n,r,o){const i=this.getWritable(),s=i.__text,a=r.length;let l=t;l<0&&(l=a+l,l<0&&(l=0));const c=Z();if(o&&W(c)){const f=t+a;c.setTextNodeRange(i,f,i,f)}const u=s.slice(0,l)+r+s.slice(l+n);return i.__text=u,i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...t){ft();const n=this.getLatest(),r=n.getTextContent();if(r==="")return[];const o=n.__key,i=Mr(),s=r.length;t.sort((R,k)=>R-k),t.push(s);const a=[],l=t.length;for(let R=0,k=0;R<s&&k<=l;k++){const P=t[k];P>R&&(a.push(r.slice(R,P)),R=P)}const c=a.length;if(c===1)return[n];const u=a[0],f=n.getParent();let d;const h=n.getFormat(),g=n.getStyle(),p=n.__detail;let m=!1,v=null,y=null;const x=Z();if(W(x)){const[R,k]=x.isBackward()?[x.focus,x.anchor]:[x.anchor,x.focus];R.type==="text"&&R.key===o&&(v=R),k.type==="text"&&k.key===o&&(y=k)}n.isSegmented()?(d=Fe(u),d.__format=h,d.__style=g,d.__detail=p,d.__state=Lm(n,d),m=!0):d=n.setTextContent(u);const b=[d];for(let R=1;R<c;R++){const k=Fe(a[R]);k.__format=h,k.__style=g,k.__detail=p,k.__state=Lm(n,k);const P=k.__key;i===o&&yt(P),b.push(k)}const w=v?v.offset:null,_=y?y.offset:null;let E=0;for(const R of b){if(!v&&!y)break;const k=E+R.getTextContentSize();if(v!==null&&w!==null&&w<=k&&w>=E&&(v.set(R.getKey(),w-E,"text"),w<k&&(v=null)),y!==null&&_!==null&&_<=k&&_>=E){y.set(R.getKey(),_-E,"text");break}E=k}if(f!==null){(function(P){const F=P.getPreviousSibling(),$=P.getNextSibling();F!==null&&Il(F),$!==null&&Il($)})(this);const R=f.getWritable(),k=this.getIndexWithinParent();m?(R.splice(k,0,b),this.remove()):R.splice(k,1,b),W(x)&&Fl(x,f,k,c-1)}return b}mergeWithSibling(t){const n=t===this.getPreviousSibling();n||t===this.getNextSibling()||X(50);const r=this.__key,o=t.__key,i=this.__text,s=i.length;Mr()===o&&yt(r);const a=Z();if(W(a)){const f=a.anchor,d=a.focus;f!==null&&f.key===o&&ey(f,n,r,t,s),d!==null&&d.key===o&&ey(d,n,r,t,s)}const l=t.__text,c=n?l+i:i+l;this.setTextContent(c);const u=this.getWritable();return t.remove(),u}isTextEntity(){return!1}}function $N(e){return{forChild:jh(e.style),node:null}}function ON(e){const t=e,n=t.style.fontWeight==="normal";return{forChild:jh(t.style,n?void 0:"bold"),node:null}}const Km=new WeakMap;function IN(e){if(!Be(e))return!1;if(e.nodeName==="PRE")return!0;const t=e.style.whiteSpace;return typeof t=="string"&&t.startsWith("pre")}function DN(e){const t=e;e.parentElement===null&&X(129);let n=t.textContent||"";if((function(r){let o,i=r.parentNode;const s=[r];for(;i!==null&&(o=Km.get(i))===void 0&&!IN(i);)s.push(i),i=i.parentNode;const a=o===void 0?i:o;for(let l=0;l<s.length;l++)Km.set(s[l],a);return a})(t)!==null){const r=n.split(/(\r?\n|\t)/),o=[],i=r.length;for(let s=0;s<i;s++){const a=r[s];a===`
40
40
  `||a===`\r
41
- `?o.push(kn()):a===" "?o.push(qi()):a!==""&&o.push(Fe(a))}return{node:o}}if(n=n.replace(/\r/g,"").replace(/[ \t\n]+/g," "),n==="")return{node:null};if(n[0]===" "){let r=t,o=!0;for(;r!==null&&(r=Rm(r,!1))!==null;){const i=r.textContent||"";if(i.length>0){/[ \t\n]$/.test(i)&&(n=n.slice(1)),o=!1;break}}o&&(n=n.slice(1))}if(n[n.length-1]===" "){let r=t,o=!0;for(;r!==null&&(r=Rm(r,!0))!==null;)if((r.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){o=!1;break}o&&(n=n.slice(0,n.length-1))}return n===""?{node:null}:{node:Fe(n)}}function Rm(e,t){let n=e;for(;;){let r;for(;(r=t?n.nextSibling:n.previousSibling)===null;){const i=n.parentElement;if(i===null)return null;n=i}if(n=r,Be(n)){const i=n.style.display;if(i===""&&!ef(n)||i!==""&&!i.startsWith("inline"))return null}let o=n;for(;(o=t?n.firstChild:n.lastChild)!==null;)n=o;if(Cr(n))return n;if(n.nodeName==="BR")return null}}const aA={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function nr(e){const t=aA[e.nodeName.toLowerCase()];return t===void 0?{node:null}:{forChild:Th(e.style,t),node:null}}function Fe(e=""){return Et(new fn(e))}function J(e){return e instanceof fn}function Th(e,t){const n=e.fontWeight,r=e.textDecoration.split(" "),o=n==="700"||n==="bold",i=r.includes("line-through"),s=e.fontStyle==="italic",a=r.includes("underline"),l=e.verticalAlign;return c=>(J(c)&&(o&&!c.hasFormat("bold")&&c.toggleFormat("bold"),i&&!c.hasFormat("strikethrough")&&c.toggleFormat("strikethrough"),s&&!c.hasFormat("italic")&&c.toggleFormat("italic"),a&&!c.hasFormat("underline")&&c.toggleFormat("underline"),l!=="sub"||c.hasFormat("subscript")||c.toggleFormat("subscript"),l!=="super"||c.hasFormat("superscript")||c.toggleFormat("superscript"),t&&!c.hasFormat(t)&&c.toggleFormat(t)),c)}class Gi extends fn{static getType(){return"tab"}static clone(t){return new Gi(t.__key)}constructor(t){super(" ",t),this.__detail=2}static importDOM(){return null}createDOM(t){const n=super.createDOM(t),r=Ri(t.theme,"tab");return r!==void 0&&n.classList.add(...r),n}static importJSON(t){return qi().updateFromJSON(t)}setTextContent(t){return t!==" "&&t!==""&&Nb(126),super.setTextContent(" ")}spliceText(t,n,r,o){return r===""&&n===0||r===" "&&n===1||Y(286),this}setDetail(t){return t!==2&&Y(127),this}setMode(t){return t!=="normal"&&Y(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function qi(){return Et(new Gi)}function rc(e){return e instanceof Gi}class lA{key;offset;type;_selection;constructor(t,n,r){this._selection=null,this.key=t,this.offset=n,this.type=r}is(t){return this.key===t.key&&this.offset===t.offset&&this.type===t.type}isBefore(t){return this.key===t.key?this.offset<t.offset:K1(Lt(An(this,"next")),Lt(An(t,"next")))<0}getNode(){const t=Pe(this.key);return t===null&&Y(20),t}set(t,n,r,o){const i=this._selection,s=this.key;o&&this.key===t&&this.offset===n&&this.type===r||(this.key=t,this.offset=n,this.type=r,Yi()||(Mr()===s&&yt(t),i!==null&&(i.setCachedNodes(null),i.dirty=!0)))}}function Kt(e,t,n){return new lA(e,t,n)}function ou(e,t){let n=t.__key,r=e.offset,o="element";if(J(t)){o="text";const i=t.getTextContentSize();r>i&&(r=i)}else if(!B(t)){const i=t.getNextSibling();if(J(i))n=i.__key,r=0,o="text";else{const s=t.getParent();s&&(n=s.__key,r=t.getIndexWithinParent()+1)}}e.set(n,r,o)}function km(e,t){if(B(t)){const n=t.getLastDescendant();B(n)||J(n)?ou(e,n):ou(e,t)}else ou(e,t)}class oc{_nodes;_cachedNodes;dirty;constructor(t){this._cachedNodes=null,this._nodes=t,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){if(!Ct(t))return!1;const n=this._nodes,r=t._nodes;return n.size===r.size&&Array.from(n).every(o=>r.has(o))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(t){this.dirty=!0,this._nodes.add(t),this._cachedNodes=null}delete(t){this.dirty=!0,this._nodes.delete(t),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(t){return this._nodes.has(t)}clone(){return new oc(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(t){}insertText(){}insertNodes(t){const n=this.getNodes(),r=n.length,o=n[r-1];let i;if(J(o))i=o.select();else{const s=o.getIndexWithinParent()+1;i=o.getParentOrThrow().select(s,s)}i.insertNodes(t);for(let s=0;s<r;s++)n[s].remove()}getNodes(){const t=this._cachedNodes;if(t!==null)return t;const n=this._nodes,r=[];for(const o of n){const i=Pe(o);i!==null&&r.push(i)}return Yi()||(this._cachedNodes=r),r}getTextContent(){const t=this.getNodes();let n="";for(let r=0;r<t.length;r++)n+=t[r].getTextContent();return n}deleteNodes(){const t=this.getNodes();if((X()||Zn())===this&&t[0]){const n=nt(t[0],"next");G1(Kr(n,n))}for(const n of t)n.remove()}}function W(e){return e instanceof Ho}class Ho{format;style;anchor;focus;_cachedNodes;dirty;constructor(t,n,r,o){this.anchor=t,this.focus=n,t._selection=this,n._selection=this,this._cachedNodes=null,this.format=r,this.style=o,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){return!!W(t)&&this.anchor.is(t.anchor)&&this.focus.is(t.focus)&&this.format===t.format&&this.style===t.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const t=this._cachedNodes;if(t!==null)return t;const n=(function(r){const o=[],[i,s]=r.getTextSlices();i&&o.push(i.caret.origin);const a=new Set,l=new Set;for(const c of r)if(zt(c)){const{origin:u}=c;o.length===0?a.add(u):(l.add(u),o.push(u))}else{const{origin:u}=c;B(u)&&l.has(u)||o.push(u)}if(s&&o.push(s.caret.origin),Wr(r.focus)&&B(r.focus.origin)&&r.focus.getNodeAtCaret()===null)for(let c=Ft(r.focus.origin,"previous");zt(c)&&a.has(c.origin)&&!c.origin.isEmpty()&&c.origin.is(o[o.length-1]);c=ca(c))a.delete(c.origin),o.pop();for(;o.length>1;){const c=o[o.length-1];if(!B(c)||l.has(c)||c.isEmpty()||a.has(c))break;o.pop()}if(o.length===0&&r.isCollapsed()){const c=Lt(r.anchor),u=Lt(r.anchor.getFlipped()),f=h=>Gn(h)?h.origin:h.getNodeAtCaret(),d=f(c)||f(u)||(r.anchor.getNodeAtCaret()?c.origin:u.origin);o.push(d)}return o})(q1(ey(this),"next"));return Yi()||(this._cachedNodes=n),n}setTextNodeRange(t,n,r,o){this.anchor.set(t.__key,n,"text"),this.focus.set(r.__key,o,"text")}getTextContent(){const t=this.getNodes();if(t.length===0)return"";const n=t[0],r=t[t.length-1],o=this.anchor,i=this.focus,s=o.isBefore(i),[a,l]=Gd(this);let c="",u=!0;for(let f=0;f<t.length;f++){const d=t[f];if(B(d)&&!d.isInline())u||(c+=`
42
- `),u=!d.isEmpty();else if(u=!1,J(d)){let h=d.getTextContent();d===n?d===r?o.type==="element"&&i.type==="element"&&i.offset!==o.offset||(h=a<l?h.slice(a,l):h.slice(l,a)):h=s?h.slice(a):h.slice(l):d===r&&(h=s?h.slice(0,l):h.slice(0,a)),c+=h}else!Te(d)&&!Kn(d)||d===r&&this.isCollapsed()||(c+=d.getTextContent())}return c}applyDOMRange(t){const n=$e(),r=n.getEditorState()._selection,o=y1(t.startContainer,t.startOffset,t.endContainer,t.endOffset,n,r);if(o===null)return;const[i,s]=o;this.anchor.set(i.key,i.offset,i.type,!0),this.focus.set(s.key,s.offset,s.type,!0),Bs(this)}clone(){const t=this.anchor,n=this.focus;return new Ho(Kt(t.key,t.offset,t.type),Kt(n.key,n.offset,n.type),this.format,this.style)}toggleFormat(t){this.format=Ml(this.format,t,null),this.dirty=!0}setFormat(t){this.format=t,this.dirty=!0}setStyle(t){this.style=t,this.dirty=!0}hasFormat(t){const n=Hr[t];return(this.format&n)!==0}insertRawText(t){const n=t.split(/(\r?\n|\t)/),r=[],o=n.length;for(let i=0;i<o;i++){const s=n[i];s===`
41
+ `?o.push(kn()):a===" "?o.push(Zi()):a!==""&&o.push(Fe(a))}return{node:o}}if(n=n.replace(/\r/g,"").replace(/[ \t\n]+/g," "),n==="")return{node:null};if(n[0]===" "){let r=t,o=!0;for(;r!==null&&(r=Um(r,!1))!==null;){const i=r.textContent||"";if(i.length>0){/[ \t\n]$/.test(i)&&(n=n.slice(1)),o=!1;break}}o&&(n=n.slice(1))}if(n[n.length-1]===" "){let r=t,o=!0;for(;r!==null&&(r=Um(r,!0))!==null;)if((r.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){o=!1;break}o&&(n=n.slice(0,n.length-1))}return n===""?{node:null}:{node:Fe(n)}}function Um(e,t){let n=e;for(;;){let r;for(;(r=t?n.nextSibling:n.previousSibling)===null;){const i=n.parentElement;if(i===null)return null;n=i}if(n=r,Be(n)){const i=n.style.display;if(i===""&&!af(n)||i!==""&&!i.startsWith("inline"))return null}let o=n;for(;(o=t?n.firstChild:n.lastChild)!==null;)n=o;if(Cr(n))return n;if(n.nodeName==="BR")return null}}const jN={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function nr(e){const t=jN[e.nodeName.toLowerCase()];return t===void 0?{node:null}:{forChild:jh(e.style,t),node:null}}function Fe(e=""){return Et(new fn(e))}function J(e){return e instanceof fn}function jh(e,t){const n=e.fontWeight,r=e.textDecoration.split(" "),o=n==="700"||n==="bold",i=r.includes("line-through"),s=e.fontStyle==="italic",a=r.includes("underline"),l=e.verticalAlign;return c=>(J(c)&&(o&&!c.hasFormat("bold")&&c.toggleFormat("bold"),i&&!c.hasFormat("strikethrough")&&c.toggleFormat("strikethrough"),s&&!c.hasFormat("italic")&&c.toggleFormat("italic"),a&&!c.hasFormat("underline")&&c.toggleFormat("underline"),l!=="sub"||c.hasFormat("subscript")||c.toggleFormat("subscript"),l!=="super"||c.hasFormat("superscript")||c.toggleFormat("superscript"),t&&!c.hasFormat(t)&&c.toggleFormat(t)),c)}class Xi extends fn{static getType(){return"tab"}static clone(t){return new Xi(t.__key)}constructor(t){super(" ",t),this.__detail=2}static importDOM(){return null}createDOM(t){const n=super.createDOM(t),r=ki(t.theme,"tab");return r!==void 0&&n.classList.add(...r),n}static importJSON(t){return Zi().updateFromJSON(t)}setTextContent(t){return t!==" "&&t!==""&&Y1(126),super.setTextContent(" ")}spliceText(t,n,r,o){return r===""&&n===0||r===" "&&n===1||X(286),this}setDetail(t){return t!==2&&X(127),this}setMode(t){return t!=="normal"&&X(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function Zi(){return Et(new Xi)}function cc(e){return e instanceof Xi}class VN{key;offset;type;_selection;constructor(t,n,r){this._selection=null,this.key=t,this.offset=n,this.type=r}is(t){return this.key===t.key&&this.offset===t.offset&&this.type===t.type}isBefore(t){return this.key===t.key?this.offset<t.offset:uw(Lt(An(this,"next")),Lt(An(t,"next")))<0}getNode(){const t=Pe(this.key);return t===null&&X(20),t}set(t,n,r,o){const i=this._selection,s=this.key;o&&this.key===t&&this.offset===n&&this.type===r||(this.key=t,this.offset=n,this.type=r,Ji()||(Mr()===s&&yt(t),i!==null&&(i.setCachedNodes(null),i.dirty=!0)))}}function Kt(e,t,n){return new VN(e,t,n)}function fu(e,t){let n=t.__key,r=e.offset,o="element";if(J(t)){o="text";const i=t.getTextContentSize();r>i&&(r=i)}else if(!B(t)){const i=t.getNextSibling();if(J(i))n=i.__key,r=0,o="text";else{const s=t.getParent();s&&(n=s.__key,r=t.getIndexWithinParent()+1)}}e.set(n,r,o)}function Gm(e,t){if(B(t)){const n=t.getLastDescendant();B(n)||J(n)?fu(e,n):fu(e,t)}else fu(e,t)}class uc{_nodes;_cachedNodes;dirty;constructor(t){this._cachedNodes=null,this._nodes=t,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){if(!Ct(t))return!1;const n=this._nodes,r=t._nodes;return n.size===r.size&&Array.from(n).every(o=>r.has(o))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(t){this.dirty=!0,this._nodes.add(t),this._cachedNodes=null}delete(t){this.dirty=!0,this._nodes.delete(t),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(t){return this._nodes.has(t)}clone(){return new uc(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(t){}insertText(){}insertNodes(t){const n=this.getNodes(),r=n.length,o=n[r-1];let i;if(J(o))i=o.select();else{const s=o.getIndexWithinParent()+1;i=o.getParentOrThrow().select(s,s)}i.insertNodes(t);for(let s=0;s<r;s++)n[s].remove()}getNodes(){const t=this._cachedNodes;if(t!==null)return t;const n=this._nodes,r=[];for(const o of n){const i=Pe(o);i!==null&&r.push(i)}return Ji()||(this._cachedNodes=r),r}getTextContent(){const t=this.getNodes();let n="";for(let r=0;r<t.length;r++)n+=t[r].getTextContent();return n}deleteNodes(){const t=this.getNodes();if((Z()||Zn())===this&&t[0]){const n=nt(t[0],"next");fw(Gr(n,n))}for(const n of t)n.remove()}}function W(e){return e instanceof Ho}class Ho{format;style;anchor;focus;_cachedNodes;dirty;constructor(t,n,r,o){this.anchor=t,this.focus=n,t._selection=this,n._selection=this,this._cachedNodes=null,this.format=r,this.style=o,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){return!!W(t)&&this.anchor.is(t.anchor)&&this.focus.is(t.focus)&&this.format===t.format&&this.style===t.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const t=this._cachedNodes;if(t!==null)return t;const n=(function(r){const o=[],[i,s]=r.getTextSlices();i&&o.push(i.caret.origin);const a=new Set,l=new Set;for(const c of r)if(Ht(c)){const{origin:u}=c;o.length===0?a.add(u):(l.add(u),o.push(u))}else{const{origin:u}=c;B(u)&&l.has(u)||o.push(u)}if(s&&o.push(s.caret.origin),Ur(r.focus)&&B(r.focus.origin)&&r.focus.getNodeAtCaret()===null)for(let c=$t(r.focus.origin,"previous");Ht(c)&&a.has(c.origin)&&!c.origin.isEmpty()&&c.origin.is(o[o.length-1]);c=ua(c))a.delete(c.origin),o.pop();for(;o.length>1;){const c=o[o.length-1];if(!B(c)||l.has(c)||c.isEmpty()||a.has(c))break;o.pop()}if(o.length===0&&r.isCollapsed()){const c=Lt(r.anchor),u=Lt(r.anchor.getFlipped()),f=h=>qn(h)?h.origin:h.getNodeAtCaret(),d=f(c)||f(u)||(r.anchor.getNodeAtCaret()?c.origin:u.origin);o.push(d)}return o})(hw(xy(this),"next"));return Ji()||(this._cachedNodes=n),n}setTextNodeRange(t,n,r,o){this.anchor.set(t.__key,n,"text"),this.focus.set(r.__key,o,"text")}getTextContent(){const t=this.getNodes();if(t.length===0)return"";const n=t[0],r=t[t.length-1],o=this.anchor,i=this.focus,s=o.isBefore(i),[a,l]=Qd(this);let c="",u=!0;for(let f=0;f<t.length;f++){const d=t[f];if(B(d)&&!d.isInline())u||(c+=`
42
+ `),u=!d.isEmpty();else if(u=!1,J(d)){let h=d.getTextContent();d===n?d===r?o.type==="element"&&i.type==="element"&&i.offset!==o.offset||(h=a<l?h.slice(a,l):h.slice(l,a)):h=s?h.slice(a):h.slice(l):d===r&&(h=s?h.slice(0,l):h.slice(0,a)),c+=h}else!Te(d)&&!Un(d)||d===r&&this.isCollapsed()||(c+=d.getTextContent())}return c}applyDOMRange(t){const n=$e(),r=n.getEditorState()._selection,o=Ob(t.startContainer,t.startOffset,t.endContainer,t.endOffset,n,r);if(o===null)return;const[i,s]=o;this.anchor.set(i.key,i.offset,i.type,!0),this.focus.set(s.key,s.offset,s.type,!0),Hs(this)}clone(){const t=this.anchor,n=this.focus;return new Ho(Kt(t.key,t.offset,t.type),Kt(n.key,n.offset,n.type),this.format,this.style)}toggleFormat(t){this.format=Ol(this.format,t,null),this.dirty=!0}setFormat(t){this.format=t,this.dirty=!0}setStyle(t){this.style=t,this.dirty=!0}hasFormat(t){const n=Kr[t];return(this.format&n)!==0}insertRawText(t){const n=t.split(/(\r?\n|\t)/),r=[],o=n.length;for(let i=0;i<o;i++){const s=n[i];s===`
43
43
  `||s===`\r
44
- `?r.push(kn()):s===" "?r.push(qi()):r.push(Fe(s))}this.insertNodes(r)}insertText(t){const n=this.anchor,r=this.focus,o=this.format,i=this.style;let s=n,a=r;!this.isCollapsed()&&r.isBefore(n)&&(s=r,a=n),s.type==="element"&&(function(m,v,y,x){const b=m.getNode(),w=b.getChildAtIndex(m.offset),_=Fe();if(_.setFormat(y),_.setStyle(x),Qr(w))w.splice(0,0,[_]);else{const E=at(b)?ve().append(_):_;w===null?b.append(E):w.insertBefore(E)}m.is(v)&&v.set(_.__key,0,"text"),m.set(_.__key,0,"text")})(s,a,o,i),a.type==="element"&&Sn(a,Lt(An(a,"next")));const l=s.offset;let c=a.offset;const u=this.getNodes(),f=u.length;let d=u[0];J(d)||Y(26);const h=d.getTextContent().length,g=d.getParentOrThrow();let p=u[f-1];if(f===1&&a.type==="element"&&(c=h,a.set(s.key,c,"text")),this.isCollapsed()&&l===h&&(sr(d)||!d.canInsertTextAfter()||!g.canInsertTextAfter()&&d.getNextSibling()===null)){let m=d.getNextSibling();if(J(m)&&m.canInsertTextBefore()&&!sr(m)||(m=Fe(),m.setFormat(o),m.setStyle(i),g.canInsertTextAfter()?d.insertAfter(m):g.insertAfter(m)),m.select(0,0),d=m,t!=="")return void this.insertText(t)}else if(this.isCollapsed()&&l===0&&(sr(d)||!d.canInsertTextBefore()||!g.canInsertTextBefore()&&d.getPreviousSibling()===null)){let m=d.getPreviousSibling();if(J(m)&&!sr(m)||(m=Fe(),m.setFormat(o),g.canInsertTextBefore()?d.insertBefore(m):g.insertBefore(m)),m.select(),d=m,t!=="")return void this.insertText(t)}else if(d.isSegmented()&&l!==h){const m=Fe(d.getTextContent());m.setFormat(o),d.replace(m),d=m}else if(!this.isCollapsed()&&t!==""){const m=p.getParent();if(!g.canInsertTextBefore()||!g.canInsertTextAfter()||B(m)&&(!m.canInsertTextBefore()||!m.canInsertTextAfter()))return this.insertText(""),m1(this.anchor,this.focus,null),void this.insertText(t)}if(f===1){if(Eo(d)){const x=Fe(t);return x.select(),void d.replace(x)}const m=d.getFormat(),v=d.getStyle();if(l!==c||m===o&&v===i){if(rc(d)){const x=Fe(t);return x.setFormat(o),x.setStyle(i),x.select(),void d.replace(x)}}else{if(d.getTextContent()!==""){const x=Fe(t);if(x.setFormat(o),x.setStyle(i),x.select(),l===0)d.insertBefore(x,!1);else{const[b]=d.splitText(l);b.insertAfter(x,!1)}return void(x.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=t.length))}d.setFormat(o),d.setStyle(i)}const y=c-l;d=d.spliceText(l,y,t,!0),d.getTextContent()===""?d.remove():this.anchor.type==="text"&&(d.isComposing()?this.anchor.offset-=t.length:(this.format=m,this.style=v))}else{const m=new Set([...d.getParentKeys(),...p.getParentKeys()]),v=B(d)?d:d.getParentOrThrow();let y=B(p)?p:p.getParentOrThrow(),x=p;if(!v.is(y)&&y.isInline())do x=y,y=y.getParentOrThrow();while(y.isInline());if(a.type==="text"&&(c!==0||p.getTextContent()==="")||a.type==="element"&&p.getIndexWithinParent()<c)if(J(p)&&!Eo(p)&&c!==p.getTextContentSize()){if(p.isSegmented()){const R=Fe(p.getTextContent());p.replace(R),p=R}at(a.getNode())||a.type!=="text"||(p=p.spliceText(0,c,"")),m.add(p.__key)}else{const R=p.getParentOrThrow();R.canBeEmpty()||R.getChildrenSize()!==1?p.remove():R.remove()}else m.add(p.__key);const b=y.getChildren(),w=new Set(u),_=v.is(y),E=v.isInline()&&d.getNextSibling()===null?v:d;for(let R=b.length-1;R>=0;R--){const k=b[R];if(k.is(d)||B(k)&&k.isParentOf(d))break;k.isAttached()&&(!w.has(k)||k.is(x)?_||E.insertAfter(k,!1):k.remove())}if(!_){let R=y,k=null;for(;R!==null;){const M=R.getChildren(),F=M.length;(F===0||M[F-1].is(k))&&(m.delete(R.__key),k=R),R=R.getParent()}}if(Eo(d))if(l===h)d.select();else{const R=Fe(t);R.select(),d.replace(R)}else d=d.spliceText(l,h-l,t,!0),d.getTextContent()===""?d.remove():d.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=t.length);for(let R=1;R<f;R++){const k=u[R],M=k.__key;m.has(M)||k.remove()}}}removeText(){const t=X()===this;sl(this,BA(ey(this))),t&&X()!==this&&Ge(this)}formatText(t,n=null){if(this.isCollapsed())return this.toggleFormat(t),void yt(null);const r=this.getNodes(),o=[];for(const b of r)J(b)&&o.push(b);const i=b=>{r.forEach(w=>{if(B(w)){const _=w.getFormatFlags(t,b);w.setTextFormat(_)}})},s=o.length;if(s===0)return this.toggleFormat(t),yt(null),void i(n);const a=this.anchor,l=this.focus,c=this.isBackward(),u=c?l:a,f=c?a:l;let d=0,h=o[0],g=u.type==="element"?0:u.offset;if(u.type==="text"&&g===h.getTextContentSize()&&(d=1,h=o[1],g=0),h==null)return;const p=h.getFormatFlags(t,n);i(p);const m=s-1;let v=o[m];const y=f.type==="text"?f.offset:v.getTextContentSize();if(h.is(v)){if(g===y)return;if(sr(h)||g===0&&y===h.getTextContentSize())h.setFormat(p);else{const b=h.splitText(g,y),w=g===0?b[0]:b[1];w.setFormat(p),u.type==="text"&&u.set(w.__key,0,"text"),f.type==="text"&&f.set(w.__key,y-g,"text")}return void(this.format=p)}g===0||sr(h)||([,h]=h.splitText(g),g=0),h.setFormat(p);const x=v.getFormatFlags(t,p);y>0&&(y===v.getTextContentSize()||sr(v)||([v]=v.splitText(y)),v.setFormat(x));for(let b=d+1;b<m;b++){const w=o[b],_=w.getFormatFlags(t,x);w.setFormat(_)}u.type==="text"&&u.set(h.__key,g,"text"),f.type==="text"&&f.set(v.__key,y,"text"),this.format=p|x}insertNodes(t){if(t.length===0)return;if(this.isCollapsed()||this.removeText(),this.anchor.key==="root"){this.insertParagraph();const g=X();return W(g)||Y(134),g.insertNodes(t)}const n=(this.isBackward()?this.focus:this.anchor).getNode(),r=we(n,Nr),o=t[t.length-1];if(B(r)&&"__language"in r){if("__language"in t[0])this.insertText(t[0].getTextContent());else{const g=iu(this);r.splice(g,0,t),o.selectEnd()}return}if(!t.some(g=>(B(g)||Te(g))&&!g.isInline())){B(r)||Y(211,n.constructor.name,n.getType());const g=iu(this);return r.splice(g,0,t),void o.selectEnd()}const i=(function(g){const p=ve();let m=null;for(let v=0;v<g.length;v++){const y=g[v],x=Kn(y);if(x||Te(y)&&y.isInline()||B(y)&&y.isInline()||J(y)||y.isParentRequired()){if(m===null&&(m=y.createParentElementNode(),p.append(m),x))continue;m!==null&&m.append(y)}else p.append(y),m=null}return p})(t),s=i.getLastDescendant(),a=i.getChildren(),l=!B(r)||!r.isEmpty()?this.insertParagraph():null,c=a[a.length-1];let u=a[0];var f;B(f=u)&&Nr(f)&&!f.isEmpty()&&B(r)&&(!r.isEmpty()||r.canMergeWhenEmpty())&&(B(r)||Y(211,n.constructor.name,n.getType()),r.append(...u.getChildren()),u=a[1]),u&&(r===null&&Y(212,n.constructor.name,n.getType()),(function(g,p){const m=p.getParentOrThrow().getLastChild();let v=p;const y=[p];for(;v!==m;)v.getNextSibling()||Y(140),v=v.getNextSibling(),y.push(v);let x=g;for(const b of y)x=x.insertAfter(b)})(r,u));const d=we(s,Nr);l&&B(d)&&(l.canMergeWhenEmpty()||Nr(c))&&(d.append(...l.getChildren()),l.remove()),B(r)&&r.isEmpty()&&r.remove(),s.selectEnd();const h=B(r)?r.getLastChild():null;Kn(h)&&d!==r&&h.remove()}insertParagraph(){if(this.anchor.key==="root"){const s=ve();return qe().splice(this.anchor.offset,0,[s]),s.select(),s}const t=iu(this),n=we(this.anchor.getNode(),Nr);B(n)||Y(213);const r=n.getChildAtIndex(t),o=r?[r,...r.getNextSiblings()]:[],i=n.insertNewAfter(this,!1);return i?(i.append(...o),i.selectStart(),i):null}insertLineBreak(t){const n=kn();if(this.insertNodes([n]),t){const r=n.getParentOrThrow(),o=n.getIndexWithinParent();r.select(o,o)}}extract(){const t=[...this.getNodes()],n=t.length;let r=t[0],o=t[n-1];const[i,s]=Gd(this),a=this.isBackward(),[l,c]=a?[this.focus,this.anchor]:[this.anchor,this.focus],[u,f]=a?[s,i]:[i,s];if(n===0)return[];if(n===1){if(J(r)&&!this.isCollapsed()){const d=r.splitText(u,f),h=u===0?d[0]:d[1];return h?(l.set(h.getKey(),0,"text"),c.set(h.getKey(),h.getTextContentSize(),"text"),[h]):[]}return[r]}if(J(r)&&(u===r.getTextContentSize()?t.shift():u!==0&&([,r]=r.splitText(u),t[0]=r,l.set(r.getKey(),0,"text"))),J(o)){const d=o.getTextContent().length;f===0?t.pop():f!==d&&([o]=o.splitText(f),t[t.length-1]=o,c.set(o.getKey(),o.getTextContentSize(),"text"))}return t}modify(t,n,r){if(Om(this,t,n,r))return;const o=t==="move",i=$e(),s=Ot(hn(i));if(!s)return;const a=i._blockCursorElement,l=i._rootElement,c=this.focus.getNode();if(l===null||a===null||!B(c)||c.isInline()||c.canBeEmpty()||Jd(a,i,l),this.dirty){let u=Lo(i,this.anchor.key),f=Lo(i,this.focus.key);this.anchor.type==="text"&&(u=Ii(u)),this.focus.type==="text"&&(f=Ii(f)),u&&f&&x1(s,u,this.anchor.offset,f,this.focus.offset)}if((function(u,f,d,h){u.modify(f,d,h)})(s,t,n?"backward":"forward",r),s.rangeCount>0){const u=s.getRangeAt(0),f=this.anchor.getNode(),d=at(f)?f:EA(f);if(this.applyDOMRange(u),this.dirty=!0,!o){const h=this.getNodes(),g=[];let p=!1;for(let m=0;m<h.length;m++){const v=h[m];Zd(v,d)?g.push(v):p=!0}if(p&&g.length>0)if(n){const m=g[0];B(m)?m.selectStart():m.getParentOrThrow().selectStart()}else{const m=g[g.length-1];B(m)?m.selectEnd():m.getParentOrThrow().selectEnd()}s.anchorNode===u.startContainer&&s.anchorOffset===u.startOffset||(function(m){const v=m.focus,y=m.anchor,x=y.key,b=y.offset,w=y.type;y.set(v.key,v.offset,v.type,!0),v.set(x,b,w,!0)})(this)}}r==="lineboundary"&&Om(this,t,n,r,"decorators")}forwardDeletion(t,n,r){if(!r&&(t.type==="element"&&B(n)&&t.offset===n.getChildrenSize()||t.type==="text"&&t.offset===n.getTextContentSize())){const o=n.getParent(),i=n.getNextSibling()||(o===null?null:o.getNextSibling());if(B(i)&&i.isShadowRoot())return!0}return!1}deleteCharacter(t){const n=this.isCollapsed();if(this.isCollapsed()){const r=this.anchor;let o=r.getNode();if(this.forwardDeletion(r,o,t))return;const i=Us(An(r,t?"previous":"next"));if(i.getTextSlices().every(a=>a===null||a.distance===0)){let a={type:"initial"};for(const l of i.iterNodeCarets("shadowRoot"))if(zt(l)){if(!l.origin.isInline()){if(l.origin.isShadowRoot()){if(a.type==="merge-block")break;if(B(i.anchor.origin)&&i.anchor.origin.isEmpty()){const c=Lt(l);sl(this,Kr(c,c)),i.anchor.origin.remove()}return}a.type!=="merge-next-block"&&a.type!=="merge-block"||(a={block:a.block,caret:l,type:"merge-block"})}}else{if(a.type==="merge-block")break;if(Wr(l)){if(B(l.origin)){if(l.origin.isInline()){if(!l.origin.isParentOf(i.anchor.origin))break}else a={block:l.origin,type:"merge-next-block"};continue}if(Te(l.origin)){if(!l.origin.isIsolated())if(a.type==="merge-next-block"&&(l.origin.isKeyboardSelectable()||!l.origin.isInline())&&B(i.anchor.origin)&&i.anchor.origin.isEmpty()){i.anchor.origin.remove();const c=Eh();c.add(l.origin.getKey()),Ge(c)}else l.origin.remove();return}break}}if(a.type==="merge-block"){const{caret:l,block:c}=a;return sl(this,Kr(!l.origin.isEmpty()&&c.isEmpty()?ua(nt(c,l.direction)):i.anchor,l)),this.removeText()}}const s=this.focus;if(this.modify("extend",t,"character"),this.isCollapsed()){if(t&&r.offset===0&&Nm(this,r.getNode()))return}else{const a=s.type==="text"?s.getNode():null;if(o=r.type==="text"?r.getNode():null,a!==null&&a.isSegmented()){const l=s.offset,c=a.getTextContentSize();if(a.is(o)||t&&l!==c||!t&&l!==0)return void Mm(a,t,l)}else if(o!==null&&o.isSegmented()){const l=r.offset,c=o.getTextContentSize();if(o.is(a)||t&&l!==0||!t&&l!==c)return void Mm(o,t,l)}(function(l,c){const u=l.anchor,f=l.focus,d=u.getNode(),h=f.getNode();if(d===h&&u.type==="text"&&f.type==="text"){const g=u.offset,p=f.offset,m=g<p,v=m?g:p,y=m?p:g,x=y-1;v!==x&&(function(b){return!(O1(b)||cA(b))})(d.getTextContent().slice(v,y))&&(c?f.set(f.key,x,f.type):u.set(u.key,x,u.type))}})(this,t)}}if(this.removeText(),t&&!n&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const r=this.anchor.getNode();r.isEmpty()&&at(r.getParent())&&r.getPreviousSibling()===null&&Nm(this,r)}}deleteLine(t){this.isCollapsed()&&this.modify("extend",t,"lineboundary"),this.isCollapsed()?this.deleteCharacter(t):this.removeText()}deleteWord(t){if(this.isCollapsed()){const n=this.anchor,r=n.getNode();if(this.forwardDeletion(n,r,t))return;this.modify("extend",t,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function Ct(e){return e instanceof oc}function Am(e){const t=e.offset;if(e.type==="text")return t;const n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function Gd(e){const t=e.getStartEndPoints();if(t===null)return[0,0];const[n,r]=t;return n.type==="element"&&r.type==="element"&&n.key===r.key&&n.offset===r.offset?[0,0]:[Am(n),Am(r)]}function Nm(e,t){for(let n=t;n;n=n.getParent()){if(B(n)){if(n.collapseAtStart(e))return!0;if(vt(n))break}if(n.getPreviousSibling())break}return!1}const cA=(()=>{try{const e=new RegExp("\\p{Emoji}","u"),t=e.test.bind(e);if(t("❤️")&&t("#️⃣")&&t("👍"))return t}catch{}return()=>!1})();function Mm(e,t,n){const r=e,o=r.getTextContent().split(/(?=\s)/g),i=o.length;let s=0,a=0;for(let c=0;c<i;c++){const u=c===i-1;if(a=s,s+=o[c].length,t&&s===n||s>n||u){o.splice(c,1),u&&(a=void 0);break}}const l=o.join("").trim();l===""?r.remove():(r.setTextContent(l),r.select(a,a))}function Pm(e,t,n,r){let o,i=t;if(Be(e)){let s=!1;const a=e.childNodes,l=a.length,c=r._blockCursorElement;i===l&&(s=!0,i=l-1);let u=a[i],f=!1;if(u===c)u=a[i+1],f=!0;else if(c!==null){const d=c.parentNode;e===d&&t>Array.prototype.indexOf.call(d.children,c)&&i--}if(o=wi(u),J(o))i=qn(o,s?"next":"previous");else{let d=wi(e);if(d===null)return null;if(B(d)){const h=r.getElementByKey(d.getKey());h===null&&Y(214),[d,i]=d.getDOMSlot(h).resolveChildIndex(d,h,e,t),B(d)||Y(215),s&&i>=d.getChildrenSize()&&(i=Math.max(0,d.getChildrenSize()-1));let p=d.getChildAtIndex(i);if(B(p)&&(function(m,v,y){const x=m.getParent();return y===null||x===null||!x.canBeEmpty()||x!==y.getNode()})(p,0,n)){const m=s?p.getLastDescendant():p.getFirstDescendant();m===null?d=p:(p=m,d=B(p)?p:p.getParentOrThrow()),i=0}J(p)?(o=p,d=null,i=qn(p,s?"next":"previous")):p!==d&&s&&!f&&(B(d)||Y(216),i=Math.min(d.getChildrenSize(),i+1))}else{const h=d.getIndexWithinParent();i=t===0&&Te(d)&&wi(e)===d?h:h+1,d=d.getParentOrThrow()}if(B(d))return Kt(d.__key,i,"element")}}else o=wi(e);return J(o)?Kt(o.__key,qn(o,i,"clamp"),"text"):null}function Lm(e,t,n){const r=e.offset,o=e.getNode();if(r===0){const i=o.getPreviousSibling(),s=o.getParent();if(t){if((n||!t)&&i===null&&B(s)&&s.isInline()){const a=s.getPreviousSibling();J(a)&&e.set(a.__key,a.getTextContent().length,"text")}}else B(i)&&!n&&i.isInline()?e.set(i.__key,i.getChildrenSize(),"element"):J(i)&&e.set(i.__key,i.getTextContent().length,"text")}else if(r===o.getTextContent().length){const i=o.getNextSibling(),s=o.getParent();if(t&&B(i)&&i.isInline())e.set(i.__key,0,"element");else if((n||t)&&i===null&&B(s)&&s.isInline()&&!s.canInsertTextAfter()){const a=s.getNextSibling();J(a)&&e.set(a.__key,0,"text")}}}function m1(e,t,n){if(e.type==="text"&&t.type==="text"){const r=e.isBefore(t),o=e.is(t);Lm(e,r,o),Lm(t,!r,o),o&&t.set(e.key,e.offset,e.type);const i=$e();if(i.isComposing()&&i._compositionKey!==e.key&&W(n)){const s=n.anchor,a=n.focus;e.set(s.key,s.offset,s.type,!0),t.set(a.key,a.offset,a.type,!0)}}}function y1(e,t,n,r,o,i){if(e===null||n===null||!aa(o,e,n))return null;const s=Pm(e,t,W(i)?i.anchor:null,o);if(s===null)return null;const a=Pm(n,r,W(i)?i.focus:null,o);if(a===null)return null;if(s.type==="element"&&a.type==="element"){const l=wi(e),c=wi(n);if(Te(l)&&Te(c))return null}return m1(s,a,i),[s,a]}function qd(e){return B(e)&&!e.isInline()}function v1(e,t,n,r,o,i){const s=Jr(),a=new Ho(Kt(e,t,o),Kt(n,r,i),0,"");return a.dirty=!0,s._selection=a,a}function ic(){const e=Kt("root",0,"element"),t=Kt("root",0,"element");return new Ho(e,t,0,"")}function Eh(){return new oc(new Set)}function uA(e,t){return sc(null,e,t,null)}function sc(e,t,n,r){const o=n._window;if(o===null)return null;const i=r||o.event,s=i?i.type:void 0,a=s==="selectionchange",l=!Nd&&(a||s==="beforeinput"||s==="compositionstart"||s==="compositionend"||s==="click"&&i&&i.detail===3||s==="drop"||s===void 0);let c,u,f,d;if(W(e)&&!l)return e.clone();if(t===null)return null;if(c=t.anchorNode,u=t.focusNode,f=t.anchorOffset,d=t.focusOffset,(a||s===void 0)&&W(e)&&!aa(n,c,u))return e.clone();const h=y1(c,f,u,d,n,e);if(h===null)return null;const[g,p]=h;return new Ho(g,p,W(e)?e.format:0,W(e)?e.style:"")}function X(){return Jr()._selection}function Zn(){return $e()._editorState._selection}function Al(e,t,n,r=1){const o=e.anchor,i=e.focus,s=o.getNode(),a=i.getNode();if(!t.is(s)&&!t.is(a))return;const l=t.__key;if(e.isCollapsed()){const c=o.offset;if(n<=c&&r>0||n<c&&r<0){const u=Math.max(0,c+r);o.set(l,u,"element"),i.set(l,u,"element"),Fm(e)}}else{const c=e.isBackward(),u=c?i:o,f=u.getNode(),d=c?o:i,h=d.getNode();if(t.is(f)){const g=u.offset;(n<=g&&r>0||n<g&&r<0)&&u.set(l,Math.max(0,g+r),"element")}if(t.is(h)){const g=d.offset;(n<=g&&r>0||n<g&&r<0)&&d.set(l,Math.max(0,g+r),"element")}}Fm(e)}function Fm(e){const t=e.anchor,n=t.offset,r=e.focus,o=r.offset,i=t.getNode(),s=r.getNode();if(e.isCollapsed()){if(!B(i))return;const a=i.getChildrenSize(),l=n>=a,c=l?i.getChildAtIndex(a-1):i.getChildAtIndex(n);if(J(c)){let u=0;l&&(u=c.getTextContentSize()),t.set(c.__key,u,"text"),r.set(c.__key,u,"text")}return}if(B(i)){const a=i.getChildrenSize(),l=n>=a,c=l?i.getChildAtIndex(a-1):i.getChildAtIndex(n);if(J(c)){let u=0;l&&(u=c.getTextContentSize()),t.set(c.__key,u,"text")}}if(B(s)){const a=s.getChildrenSize(),l=o>=a,c=l?s.getChildAtIndex(a-1):s.getChildAtIndex(o);if(J(c)){let u=0;l&&(u=c.getTextContentSize()),r.set(c.__key,u,"text")}}}function Nl(e,t,n,r,o){let i=null,s=0,a=null;r!==null?(i=r.__key,J(r)?(s=r.getTextContentSize(),a="text"):B(r)&&(s=r.getChildrenSize(),a="element")):o!==null&&(i=o.__key,J(o)?a="text":B(o)&&(a="element")),i!==null&&a!==null?e.set(i,s,a):(s=t.getIndexWithinParent(),s===-1&&(s=n.getChildrenSize()),e.set(n.__key,s,"element"))}function $m(e,t,n,r,o){e.type==="text"?e.set(n,e.offset+(t?0:o),"text"):e.offset>r.getIndexWithinParent()&&e.set(e.key,e.offset-1,"element")}function x1(e,t,n,r,o){try{e.setBaseAndExtent(t,n,r,o)}catch{}}function dA(e,t,n,r,o,i,s){const a=r.anchorNode,l=r.focusNode,c=r.anchorOffset,u=r.focusOffset,f=document.activeElement;if(o.has(h1)&&f!==i||f!==null&&Lh(f))return;if(!W(t))return void(e!==null&&aa(n,a,l)&&r.removeAllRanges());const d=t.anchor,h=t.focus,g=d.key,p=h.key,m=Lo(n,g),v=Lo(n,p),y=d.offset,x=h.offset,b=t.format,w=t.style,_=t.isCollapsed();let E=m,R=v,k=!1;if(d.type==="text"){E=Ii(m);const $=d.getNode();k=$.getFormat()!==b||$.getStyle()!==w}else W(e)&&e.anchor.type==="text"&&(k=!0);var M,F,D,j,I;if(h.type==="text"&&(R=Ii(v)),E!==null&&R!==null&&(_&&(e===null||k||W(e)&&(e.format!==b||e.style!==w))&&(M=b,F=w,D=y,j=g,I=performance.now(),s1=[M,F,D,j,I]),c!==y||u!==x||a!==E||l!==R||r.type==="Range"&&_||(f!==null&&i.contains(f)||o.has(tA)||i.focus({preventScroll:!0}),d.type==="element"))){if(x1(r,E,y,R,x),!o.has(Q3)&&t.isCollapsed()&&i!==null&&i===document.activeElement){const $=W(t)&&t.anchor.type==="element"?E.childNodes[y]||null:r.rangeCount>0?r.getRangeAt(0):null;if($!==null){let H;if($ instanceof Text){const O=document.createRange();O.selectNode($),H=O.getBoundingClientRect()}else H=$.getBoundingClientRect();(function(O,P,K){const G=V1(K),re=jh(G);if(G===null||re===null)return;let{top:U,bottom:Z}=P,Q=0,ne=0,oe=K;for(;oe!==null;){const me=oe===G.body;if(me)Q=0,ne=hn(O).innerHeight;else{const xe=oe.getBoundingClientRect();Q=xe.top,ne=xe.bottom}let ee=0;if(U<Q?ee=-(Q-U):Z>ne&&(ee=Z-ne),ee!==0)if(me)re.scrollBy(0,ee);else{const xe=oe.scrollTop;oe.scrollTop+=ee;const Se=oe.scrollTop-xe;U-=Se,Z-=Se}if(me)break;oe=la(oe)}})(n,H,i)}}zd=!0}}function Rh(e){let t=X()||Zn();t===null&&(t=qe().selectEnd()),t.insertNodes(e)}function iu(e){let t=e;e.isCollapsed()||t.removeText();const n=X();W(n)&&(t=n),W(t)||Y(161);const r=t.anchor;let o=r.getNode(),i=r.offset;for(;!Nr(o);){const s=o;if([o,i]=fA(o,i),s.is(o))break}return i}function fA(e,t){const n=e.getParent();if(!n){const o=ve();return qe().append(o),o.select(),[qe(),0]}if(J(e)){const o=e.splitText(t);if(o.length===0)return[n,e.getIndexWithinParent()];const i=t===0?0:1;return[n,o[0].getIndexWithinParent()+i]}if(!B(e)||t===0)return[n,e.getIndexWithinParent()];const r=e.getChildAtIndex(t);if(r){const o=new Ho(Kt(e.__key,t,"element"),Kt(e.__key,t,"element"),0,""),i=e.insertNewAfter(o);i&&i.append(r,...r.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}function Om(e,t,n,r,o="decorators-and-blocks"){if(t==="move"&&r==="character"&&!e.isCollapsed()){const[u,f]=n===e.isBackward()?[e.focus,e.anchor]:[e.anchor,e.focus];return f.set(u.key,u.offset,u.type),!0}const i=An(e.focus,n?"previous":"next"),s=r==="lineboundary",a=t==="move";let l=i,c=o==="decorators-and-blocks";if(!Kh(l)){for(const u of l){c=!1;const{origin:f}=u;if(!Te(f)||f.isIsolated()||(l=u,!s||!f.isInline()))break}if(c)for(const u of Us(i).iterNodeCarets(t==="extend"?"shadowRoot":"root")){if(zt(u))u.origin.isInline()||(l=u);else{if(B(u.origin))continue;Te(u.origin)&&!u.origin.isInline()&&(l=u)}break}}if(l===i)return!1;if(a&&!s&&Te(l.origin)&&l.origin.isKeyboardSelectable()){const u=Eh();return u.add(l.origin.getKey()),Ge(u),!0}return l=Lt(l),a&&Sn(e.anchor,l),Sn(e.focus,l),c||!s}let ht=null,gt=null,Bt=!1,su=!1,ol=0;const Im={characterData:!0,childList:!0,subtree:!0};function Yi(){return Bt||ht!==null&&ht._readOnly}function ft(){Bt&&Y(13)}function b1(){ol>99&&Y(14)}function Jr(){return ht===null&&Y(195,w1()),ht}function $e(){return gt===null&&Y(196,w1()),gt}function w1(){let e=0;const t=new Set,n=Oi.version;if(typeof window<"u")for(const o of document.querySelectorAll("[contenteditable]")){const i=lc(o);if(Fh(i))e++;else if(i){let s=String(i.constructor.version||"<0.17.1");s===n&&(s+=" (separately built, likely a bundler configuration issue)"),t.add(s)}}let r=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(r+=` and incompatible editors with versions ${Array.from(t).join(", ")}`),r}function hA(){return gt}function Dm(e,t,n){const r=t.__type,o=R1(e,r);let i=n.get(r);i===void 0&&(i=Array.from(o.transforms),n.set(r,i));const s=i.length;for(let a=0;a<s&&(i[a](t),t.isAttached());a++);}function jm(e,t){return e!==void 0&&e.__key!==t&&e.isAttached()}function C1(e,t){if(!t)return;const n=e._updateTags;let r=t;Array.isArray(t)||(r=[t]);for(const o of r)n.add(o)}function gA(e){return kh(e,$e()._nodes)}function kh(e,t){const n=e.type,r=t.get(n);r===void 0&&Y(17,n);const o=r.klass;e.type!==o.getType()&&Y(18,o.name);const i=o.importJSON(e),s=e.children;if(B(i)&&Array.isArray(s))for(let a=0;a<s.length;a++){const l=kh(s[a],t);i.append(l)}return i}function Vm(e,t,n){const r=ht,o=Bt,i=gt;ht=t,Bt=!0,gt=e;try{return n()}finally{ht=r,Bt=o,gt=i}}function cr(e,t){const n=e._pendingEditorState,r=e._rootElement,o=e._headless||r===null;if(n===null)return;const i=e._editorState,s=i._selection,a=n._selection,l=e._dirtyType!==0,c=ht,u=Bt,f=gt,d=e._updating,h=e._observer;let g=null;if(e._pendingEditorState=null,e._editorState=n,!o&&l&&h!==null){gt=e,ht=n,Bt=!1,e._updating=!0;try{const _=e._dirtyType,E=e._dirtyElements,R=e._dirtyLeaves;h.disconnect(),g=I3(i,n,e,_,E,R)}catch(_){if(_ instanceof Error&&e._onError(_),su)throw _;return T1(e,null,r,n),Ib(e),e._dirtyType=2,su=!0,cr(e,i),void(su=!1)}finally{h.observe(r,Im),e._updating=d,ht=c,Bt=u,gt=f}}n._readOnly||(n._readOnly=!0);const p=e._dirtyLeaves,m=e._dirtyElements,v=e._normalizedNodes,y=e._updateTags,x=e._deferred;l&&(e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements=new Map,e._normalizedNodes=new Set,e._updateTags=new Set),(function(_,E){const R=_._decorators;let k=_._pendingDecorators||R;const M=E._nodeMap;let F;for(F in k)M.has(F)||(k===R&&(k=F1(_)),delete k[F])})(e,n);const b=o?null:Ot(hn(e));if(e._editable&&b!==null&&(l||a===null||a.dirty||!a.is(s))&&r!==null&&!y.has(eA)){gt=e,ht=n;try{if(h!==null&&h.disconnect(),l||a===null||a.dirty){const _=e._blockCursorElement;_!==null&&Jd(_,e,r),dA(s,a,e,b,y,r)}(function(_,E,R){let k=_._blockCursorElement;if(W(R)&&R.isCollapsed()&&R.anchor.type==="element"&&E.contains(document.activeElement)){const M=R.anchor,F=M.getNode(),D=M.offset;let j=!1,I=null;if(D===F.getChildrenSize())lu(F.getChildAtIndex(D-1))&&(j=!0);else{const $=F.getChildAtIndex(D);if($!==null&&lu($)){const H=$.getPreviousSibling();(H===null||lu(H))&&(j=!0,I=_.getElementByKey($.__key))}}if(j){const $=_.getElementByKey(F.__key);return k===null&&(_._blockCursorElement=k=(function(H){const O=H.theme,P=document.createElement("div");P.contentEditable="false",P.setAttribute("data-lexical-cursor","true");let K=O.blockCursor;if(K!==void 0){if(typeof K=="string"){const G=Pb(K);K=O.blockCursor=G}K!==void 0&&P.classList.add(...K)}return P})(_._config)),E.style.caretColor="transparent",void(I===null?$.appendChild(k):$.insertBefore(k,I))}}k!==null&&Jd(k,_,E)})(e,r,a)}finally{h!==null&&h.observe(r,Im),gt=f,ht=c}}g!==null&&(function(_,E,R,k,M){const F=Array.from(_._listeners.mutation),D=F.length;for(let j=0;j<D;j++){const[I,$]=F[j];for(const H of $){const O=E.get(H);O!==void 0&&I(O,{dirtyLeaves:k,prevEditorState:M,updateTags:R})}}})(e,g,y,p,i),W(a)||a===null||s!==null&&s.is(a)||e.dispatchCommand(fr,void 0);const w=e._pendingDecorators;w!==null&&(e._decorators=w,e._pendingDecorators=null,As("decorator",e,!0,w)),(function(_,E,R){const k=Wm(E),M=Wm(R);k!==M&&As("textcontent",_,!0,M)})(e,t||i,n),As("update",e,!0,{dirtyElements:m,dirtyLeaves:p,editorState:n,mutatedNodes:g,normalizedNodes:v,prevEditorState:t||i,tags:y}),(function(_,E){if(_._deferred=[],E.length!==0){const R=_._updating;_._updating=!0;try{for(let k=0;k<E.length;k++)E[k]()}finally{_._updating=R}}})(e,x),(function(_){const E=_._updates;if(E.length!==0){const R=E.shift();if(R){const[k,M]=R;ac(_,k,M)}}})(e)}function As(e,t,n,...r){const o=t._updating;t._updating=n;try{const i=Array.from(t._listeners[e]);for(let s=0;s<i.length;s++)i[s].apply(null,r)}finally{t._updating=o}}function Bm(e,t){const n=e._updates;let r=t||!1;for(;n.length!==0;){const o=n.shift();if(o){const[i,s]=o,a=e._pendingEditorState;let l;s!==void 0&&(l=s.onUpdate,s.skipTransforms&&(r=!0),s.discrete&&(a===null&&Y(191),a._flushSync=!0),l&&e._deferred.push(l),C1(e,s.tag)),a==null?ac(e,i,s):i()}}return r}function ac(e,t,n){const r=e._updateTags;let o,i=!1,s=!1;n!==void 0&&(o=n.onUpdate,C1(e,n.tag),i=n.skipTransforms||!1,s=n.discrete||!1),o&&e._deferred.push(o);const a=e._editorState;let l=e._pendingEditorState,c=!1;(l===null||l._readOnly)&&(l=e._pendingEditorState=S1(l||a),c=!0),l._flushSync=s;const u=ht,f=Bt,d=gt,h=e._updating;ht=l,Bt=!1,e._updating=!0,gt=e;const g=e._headless||e.getRootElement()===null;Mh(null);try{c&&(g?a._selection!==null&&(l._selection=a._selection.clone()):l._selection=(function(y,x){const b=y.getEditorState()._selection,w=Ot(hn(y));return W(b)||b==null?sc(b,w,y,x):b.clone()})(e,n&&n.event||null));const m=e._compositionKey;t(),i=Bm(e,i),(function(y,x){const b=x.getEditorState()._selection,w=y._selection;if(W(w)){const _=w.anchor,E=w.focus;let R;if(_.type==="text"&&(R=_.getNode(),R.selectionTransform(b,w)),E.type==="text"){const k=E.getNode();R!==k&&k.selectionTransform(b,w)}}})(l,e),e._dirtyType!==0&&(i?(function(y,x){const b=x._dirtyLeaves,w=y._nodeMap;for(const _ of b){const E=w.get(_);J(E)&&E.isAttached()&&E.isSimpleText()&&!E.isUnmergeable()&&ym(E)}})(l,e):(function(y,x){const b=x._dirtyLeaves,w=x._dirtyElements,_=y._nodeMap,E=Mr(),R=new Map;let k=b,M=k.size,F=w,D=F.size;for(;M>0||D>0;){if(M>0){x._dirtyLeaves=new Set;for(const j of k){const I=_.get(j);J(I)&&I.isAttached()&&I.isSimpleText()&&!I.isUnmergeable()&&ym(I),I!==void 0&&jm(I,E)&&Dm(x,I,R),b.add(j)}if(k=x._dirtyLeaves,M=k.size,M>0){ol++;continue}}x._dirtyLeaves=new Set,x._dirtyElements=new Map,F.delete("root")&&F.set("root",!0);for(const j of F){const I=j[0],$=j[1];if(w.set(I,$),!$)continue;const H=_.get(I);H!==void 0&&jm(H,E)&&Dm(x,H,R)}k=x._dirtyLeaves,M=k.size,F=x._dirtyElements,D=F.size,ol++}x._dirtyLeaves=b,x._dirtyElements=w})(l,e),Bm(e),(function(y,x,b,w){const _=y._nodeMap,E=x._nodeMap,R=[];for(const[k]of w){const M=E.get(k);M!==void 0&&(M.isAttached()||(B(M)&&Fb(M,k,_,E,R,w),_.has(k)||w.delete(k),R.push(k)))}for(const k of R)E.delete(k);for(const k of b){const M=E.get(k);M===void 0||M.isAttached()||(_.has(k)||b.delete(k),E.delete(k))}})(a,l,e._dirtyLeaves,e._dirtyElements)),m!==e._compositionKey&&(l._flushSync=!0);const v=l._selection;if(W(v)){const y=l._nodeMap,x=v.anchor.key,b=v.focus.key;y.get(x)!==void 0&&y.get(b)!==void 0||Y(19)}else Ct(v)&&v._nodes.size===0&&(l._selection=null)}catch(m){return m instanceof Error&&e._onError(m),e._pendingEditorState=a,e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),void cr(e)}finally{ht=u,Bt=f,gt=d,e._updating=h,ol=0}e._dirtyType!==0||e._deferred.length>0||(function(m,v){const y=v.getEditorState()._selection,x=m._selection;if(x!==null){if(x.dirty||!x.is(y))return!0}else if(y!==null)return!0;return!1})(l,e)?l._flushSync?(l._flushSync=!1,cr(e)):c&&bA(()=>{cr(e)}):(l._flushSync=!1,c&&(r.clear(),e._deferred=[],e._pendingEditorState=null))}function Un(e,t,n){gt===e&&n===void 0?t():ac(e,t,n)}class Ns{element;before;after;constructor(t,n,r){this.element=t,this.before=n||null,this.after=r||null}withBefore(t){return new Ns(this.element,t,this.after)}withAfter(t){return new Ns(this.element,this.before,t)}withElement(t){return this.element===t?this:new Ns(t,this.before,this.after)}insertChild(t){const n=this.before||this.getManagedLineBreak();return n!==null&&n.parentElement!==this.element&&Y(222),this.element.insertBefore(t,n),this}removeChild(t){return t.parentElement!==this.element&&Y(223),this.element.removeChild(t),this}replaceChild(t,n){return n.parentElement!==this.element&&Y(224),this.element.replaceChild(t,n),this}getFirstChild(){const t=this.after?this.after.nextSibling:this.element.firstChild;return t===this.before||t===this.getManagedLineBreak()?null:t}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(t){if(t===null)this.removeManagedLineBreak();else{const n=t==="decorator"&&(oa||Ki||ra);this.insertManagedLineBreak(n)}}removeManagedLineBreak(){const t=this.getManagedLineBreak();if(t){const n=this.element,r=t.nodeName==="IMG"?t.nextSibling:null;r&&n.removeChild(r),n.removeChild(t),n.__lexicalLineBreak=void 0}}insertManagedLineBreak(t){const n=this.getManagedLineBreak();if(n){if(t===(n.nodeName==="IMG"))return;this.removeManagedLineBreak()}const r=this.element,o=this.before,i=document.createElement("br");if(r.insertBefore(i,o),t){const s=document.createElement("img");s.setAttribute("data-lexical-linebreak","true"),s.style.cssText="display: inline !important; border: 0px !important; margin: 0px !important;",s.alt="",r.insertBefore(s,i),r.__lexicalLineBreak=s}else r.__lexicalLineBreak=i}getFirstChildOffset(){let t=0;for(let n=this.after;n!==null;n=n.previousSibling)t++;return t}resolveChildIndex(t,n,r,o){if(r===this.element){const l=this.getFirstChildOffset();return[t,Math.min(l+t.getChildrenSize(),Math.max(l,o))]}const i=zm(n,r);i.push(o);const s=zm(n,this.element);let a=t.getIndexWithinParent();for(let l=0;l<s.length;l++){const c=i[l],u=s[l];if(c===void 0||c<u)break;if(c>u){a+=1;break}}return[t.getParentOrThrow(),a]}}function zm(e,t){const n=[];let r=t;for(;r!==e&&r!==null;r=r.parentNode){let o=0;for(let i=r.previousSibling;i!==null;i=i.previousSibling)o++;n.push(o)}return r!==e&&Y(225),n.reverse()}class Tt extends Wn{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;constructor(t){super(t),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=""}afterCloneFrom(t){super.afterCloneFrom(t),this.__key===t.__key&&(this.__first=t.__first,this.__last=t.__last,this.__size=t.__size),this.__indent=t.__indent,this.__format=t.__format,this.__style=t.__style,this.__dir=t.__dir,this.__textFormat=t.__textFormat,this.__textStyle=t.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){const t=this.getFormat();return S3[t]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const t=[];let n=this.getFirstChild();for(;n!==null;)t.push(n),n=n.getNextSibling();return t}getChildrenKeys(){const t=[];let n=this.getFirstChild();for(;n!==null;)t.push(n.__key),n=n.getNextSibling();return t}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){const t=$e()._dirtyElements;return t!==null&&t.has(this.__key)}isLastChild(){const t=this.getLatest(),n=this.getParentOrThrow().getLastChild();return n!==null&&n.is(t)}getAllTextNodes(){const t=[];let n=this.getFirstChild();for(;n!==null;){if(J(n)&&t.push(n),B(n)){const r=n.getAllTextNodes();t.push(...r)}n=n.getNextSibling()}return t}getFirstDescendant(){let t=this.getFirstChild();for(;B(t);){const n=t.getFirstChild();if(n===null)break;t=n}return t}getLastDescendant(){let t=this.getLastChild();for(;B(t);){const n=t.getLastChild();if(n===null)break;t=n}return t}getDescendantByIndex(t){const n=this.getChildren(),r=n.length;if(t>=r){const i=n[r-1];return B(i)&&i.getLastDescendant()||i||null}const o=n[t];return B(o)&&o.getFirstDescendant()||o||null}getFirstChild(){const t=this.getLatest().__first;return t===null?null:Pe(t)}getFirstChildOrThrow(){const t=this.getFirstChild();return t===null&&Y(45,this.__key),t}getLastChild(){const t=this.getLatest().__last;return t===null?null:Pe(t)}getLastChildOrThrow(){const t=this.getLastChild();return t===null&&Y(96,this.__key),t}getChildAtIndex(t){const n=this.getChildrenSize();let r,o;if(t<n/2){for(r=this.getFirstChild(),o=0;r!==null&&o<=t;){if(o===t)return r;r=r.getNextSibling(),o++}return null}for(r=this.getLastChild(),o=n-1;r!==null&&o>=t;){if(o===t)return r;r=r.getPreviousSibling(),o--}return null}getTextContent(){let t="";const n=this.getChildren(),r=n.length;for(let o=0;o<r;o++){const i=n[o];t+=i.getTextContent(),B(i)&&o!==r-1&&!i.isInline()&&(t+=zr)}return t}getTextContentSize(){let t=0;const n=this.getChildren(),r=n.length;for(let o=0;o<r;o++){const i=n[o];t+=i.getTextContentSize(),B(i)&&o!==r-1&&!i.isInline()&&(t+=2)}return t}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(t){if(t!==""){const n=cm[t];return(this.getFormat()&n)!==0}return!1}hasTextFormat(t){const n=Hr[t];return(this.getTextFormat()&n)!==0}getFormatFlags(t,n){return Ml(this.getLatest().__textFormat,t,n)}getTextStyle(){return this.getLatest().__textStyle}select(t,n){ft();const r=X();let o=t,i=n;const s=this.getChildrenSize();if(!this.canBeEmpty()){if(t===0&&n===0){const l=this.getFirstChild();if(J(l)||B(l))return l.select(0,0)}else if(!(t!==void 0&&t!==s||n!==void 0&&n!==s)){const l=this.getLastChild();if(J(l)||B(l))return l.select()}}o===void 0&&(o=s),i===void 0&&(i=s);const a=this.__key;return W(r)?(r.anchor.set(a,o,"element"),r.focus.set(a,i,"element"),r.dirty=!0,r):v1(a,o,a,i,"element","element")}selectStart(){const t=this.getFirstDescendant();return t?t.selectStart():this.select()}selectEnd(){const t=this.getLastDescendant();return t?t.selectEnd():this.select()}clear(){const t=this.getWritable();return this.getChildren().forEach(n=>n.remove()),t}append(...t){return this.splice(this.getChildrenSize(),0,t)}setDirection(t){const n=this.getWritable();return n.__dir=t,n}setFormat(t){return this.getWritable().__format=t!==""?cm[t]:0,this}setStyle(t){return this.getWritable().__style=t||"",this}setTextFormat(t){const n=this.getWritable();return n.__textFormat=t,n}setTextStyle(t){const n=this.getWritable();return n.__textStyle=t,n}setIndent(t){return this.getWritable().__indent=t,this}splice(t,n,r){kl(this)&&Y(324,this.__key,this.__type);const o=this.getChildrenSize(),i=this.getWritable();t+n<=o||Y(226,String(t),String(n),String(o));const s=i.__key,a=[],l=[],c=this.getChildAtIndex(t+n);let u=null,f=o-n+r.length;if(t!==0)if(t===o)u=this.getLastChild();else{const h=this.getChildAtIndex(t);h!==null&&(u=h.getPreviousSibling())}if(n>0){let h=u===null?this.getFirstChild():u.getNextSibling();for(let g=0;g<n;g++){h===null&&Y(100);const p=h.getNextSibling(),m=h.__key;Ro(h.getWritable()),l.push(m),h=p}}let d=u;for(const h of r){d!==null&&h.is(d)&&(u=d=d.getPreviousSibling());const g=h.getWritable();g.__parent===s&&f--,Ro(g);const p=h.__key;if(d===null)i.__first=p,g.__prev=null;else{const m=d.getWritable();m.__next=p,g.__prev=m.__key}h.__key===s&&Y(76),g.__parent=s,a.push(p),d=h}if(t+n===o)d!==null&&(d.getWritable().__next=null,i.__last=d.__key);else if(c!==null){const h=c.getWritable();if(d!==null){const g=d.getWritable();h.__prev=d.__key,g.__next=c.__key}else h.__prev=null}if(i.__size=f,l.length){const h=X();if(W(h)){const g=new Set(l),p=new Set(a),{anchor:m,focus:v}=h;Hm(m,g,p)&&Nl(m,m.getNode(),this,u,c),Hm(v,g,p)&&Nl(v,v.getNode(),this,u,c),f!==0||this.canBeEmpty()||vt(this)||this.remove()}}return i}getDOMSlot(t){return new Ns(t)}exportDOM(t){const{element:n}=super.exportDOM(t);if(Be(n)){const r=this.getIndent();r>0&&(n.style.paddingInlineStart=40*r+"px");const o=this.getDirection();o&&(n.dir=o)}return{element:n}}exportJSON(){const t={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},n=this.getTextFormat(),r=this.getTextStyle();return n===0&&r===""||vt(this)||this.getChildren().some(J)||(n!==0&&(t.textFormat=n),r!==""&&(t.textStyle=r)),t}updateFromJSON(t){return super.updateFromJSON(t).setFormat(t.format).setIndent(t.indent).setDirection(t.direction).setTextFormat(t.textFormat||0).setTextStyle(t.textStyle||"")}insertNewAfter(t,n){return null}canIndent(){return!0}collapseAtStart(t){return!1}excludeFromCopy(t){return!1}canReplaceWith(t){return!0}canInsertAfter(t){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(t){return!1}extractWithChild(t,n,r){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(t,n){const r=this.getDOMSlot(t);let o=r.getFirstChild();for(let i=this.getFirstChild();i;i=i.getNextSibling()){const s=n.getElementByKey(i.getKey());s!==null&&(o==null?(r.insertChild(s),o=s):o!==s&&r.replaceChild(s,o),o=o.nextSibling)}}}function B(e){return e instanceof Tt}function Hm(e,t,n){let r=e.getNode();for(;r;){const o=r.__key;if(t.has(o)&&!n.has(o))return!0;r=r.getParent()}return!1}class ia extends Wn{decorate(t,n){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function Te(e){return e instanceof ia}class Xi extends Tt{__cachedText;static getType(){return"root"}static clone(){return new Xi}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){Y(51)}getTextContent(){const t=this.__cachedText;return!Yi()&&$e()._dirtyType!==0||t===null?super.getTextContent():t}remove(){Y(52)}replace(t){Y(53)}insertBefore(t){Y(54)}insertAfter(t){Y(55)}updateDOM(t,n){return!1}splice(t,n,r){for(const o of r)B(o)||Te(o)||Y(282);return super.splice(t,n,r)}static importJSON(t){return qe().updateFromJSON(t)}collapseAtStart(){return!0}}function at(e){return e instanceof Xi}function S1(e){return new sa(new Map(e._nodeMap))}function Ah(){return new sa(new Map([["root",new Xi]]))}function _1(e){const t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&Y(130,n.name),B(e)){const r=t.children;Array.isArray(r)||Y(59,n.name);const o=e.getChildren();for(let i=0;i<o.length;i++){const s=_1(o[i]);r.push(s)}}return t}function pA(e){return e instanceof sa}class sa{_nodeMap;_selection;_flushSync;_readOnly;constructor(t,n){this._nodeMap=t,this._selection=n||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(t,n){return Vm(n&&n.editor||null,this,t)}clone(t){const n=new sa(this._nodeMap,t===void 0?this._selection:t);return n._readOnly=!0,n}toJSON(){return Vm(null,this,()=>({root:_1(qe())}))}}class Nh extends Tt{static getType(){return"artificial"}createDOM(t){return document.createElement("div")}}class Wo extends Tt{static getType(){return"paragraph"}static clone(t){return new Wo(t.__key)}createDOM(t){const n=document.createElement("p"),r=Ri(t.theme,"paragraph");return r!==void 0&&n.classList.add(...r),n}updateDOM(t,n,r){return!1}static importDOM(){return{p:t=>({conversion:mA,priority:0})}}exportDOM(t){const{element:n}=super.exportDOM(t);if(Be(n)){this.isEmpty()&&n.append(document.createElement("br"));const r=this.getFormatType();r&&(n.style.textAlign=r)}return{element:n}}static importJSON(t){return ve().updateFromJSON(t)}exportJSON(){const t=super.exportJSON();if(t.textFormat===void 0||t.textStyle===void 0){const n=this.getChildren().find(J);n?(t.textFormat=n.getFormat(),t.textStyle=n.getStyle()):(t.textFormat=this.getTextFormat(),t.textStyle=this.getTextStyle())}return t}insertNewAfter(t,n){const r=ve();r.setTextFormat(t.format),r.setTextStyle(t.style);const o=this.getDirection();return r.setDirection(o),r.setFormat(this.getFormatType()),r.setStyle(this.getStyle()),this.insertAfter(r,n),r}collapseAtStart(){const t=this.getChildren();if(t.length===0||J(t[0])&&t[0].getTextContent().trim()===""){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}}function mA(e){const t=ve();return e.style&&(t.setFormat(e.style.textAlign),Vh(e,t)),{node:t}}function ve(){return Et(new Wo)}function Qr(e){return e instanceof Wo}const be=0,ur=1,Dt=3,yA=4;function T1(e,t,n,r){const o=e._keyToDOMMap;o.clear(),e._editorState=Ah(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,e._updateTags=new Set,e._updates=[],e._blockCursorElement=null;const i=e._observer;i!==null&&(i.disconnect(),e._observer=null),t!==null&&(t.textContent=""),n!==null&&(n.textContent="",o.set("root",n))}function vA(e){const t=new Set,n=new Set;let r=e;for(;r;){const{ownNodeConfig:o}=dc(r),i=r.transform;if(!n.has(i)){n.add(i);const s=r.transform();s&&t.add(s)}if(o){const s=o.$transform;s&&t.add(s),r=o.extends}else{const s=Object.getPrototypeOf(r);r=s.prototype instanceof Wn&&s!==Wn?s:void 0}}return t}function E1(e){const t=e||{},n=hA(),r=t.theme||{},o=e===void 0?n:t.parentEditor||null,i=t.disableEvents||!1,s=Ah(),a=t.namespace||(o!==null?o._config.namespace:I1()),l=t.editorState,c=[Xi,fn,Ui,Gi,Wo,Nh,...t.nodes||[]],{onError:u,html:f}=t,d=t.editable===void 0||t.editable;let h;if(e===void 0&&n!==null)h=n._nodes;else{h=new Map;for(let p=0;p<c.length;p++){let m=c[p],v=null,y=null;if(typeof m!="function"){const w=m;m=w.replace,v=w.with,y=w.withKlass||null}dc(m);const x=m.getType(),b=vA(m);h.set(x,{exportDOM:f&&f.export?f.export.get(m):void 0,klass:m,replace:v,replaceWithKlass:y,sharedNodeState:P3(c[p]),transforms:b})}}const g=new Oi(s,o,h,{disableEvents:i,namespace:a,theme:r},u||console.error,(function(p,m){const v=new Map,y=new Set,x=b=>{Object.keys(b).forEach(w=>{let _=v.get(w);_===void 0&&(_=[],v.set(w,_)),_.push(b[w])})};return p.forEach(b=>{const w=b.klass.importDOM;if(w==null||y.has(w))return;y.add(w);const _=w.call(b.klass);_!==null&&x(_)}),m&&x(m),v})(h,f?f.import:void 0),d,e);return l!==void 0&&(g._pendingEditorState=l,g._dirtyType=2),(function(p){p.registerCommand(Ub,K3,be),p.registerCommand(Gb,U3,be),p.registerCommand(qb,G3,be),p.registerCommand(Yb,q3,be),p.registerCommand(Jb,Y3,be)})(g),g}class Oi{static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_htmlConversions;_window;_editable;_blockCursorElement;_createEditorArgs;constructor(t,n,r,o,i,s,a,l){this._createEditorArgs=l,this._parentEditor=n,this._rootElement=null,this._editorState=t,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=o,this._nodes=r,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=I1(),this._onError=i,this._htmlConversions=s,this._editable=a,this._headless=n!==null&&n._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(t){const n=this._listeners.update;return n.add(t),()=>{n.delete(t)}}registerEditableListener(t){const n=this._listeners.editable;return n.add(t),()=>{n.delete(t)}}registerDecoratorListener(t){const n=this._listeners.decorator;return n.add(t),()=>{n.delete(t)}}registerTextContentListener(t){const n=this._listeners.textcontent;return n.add(t),()=>{n.delete(t)}}registerRootListener(t){const n=this._listeners.root;return t(this._rootElement,null),n.add(t),()=>{t(null,this._rootElement),n.delete(t)}}registerCommand(t,n,r){r===void 0&&Y(35);const o=this._commands;o.has(t)||o.set(t,[new Set,new Set,new Set,new Set,new Set]);const i=o.get(t);i===void 0&&Y(36,String(t));const s=i[r];return s.add(n),()=>{s.delete(n),i.every(a=>a.size===0)&&o.delete(t)}}registerMutationListener(t,n,r){const o=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(t)).klass,i=this._listeners.mutation;let s=i.get(n);s===void 0&&(s=new Set,i.set(n,s)),s.add(o);const a=r&&r.skipInitialization;return a!==void 0&&a||this.initializeMutationListener(n,o),()=>{s.delete(o),s.size===0&&i.delete(n)}}getRegisteredNode(t){const n=this._nodes.get(t.getType());return n===void 0&&Y(37,t.name),n}resolveRegisteredNodeAfterReplacements(t){for(;t.replaceWithKlass;)t=this.getRegisteredNode(t.replaceWithKlass);return t}initializeMutationListener(t,n){const r=this._editorState,o=Zm(r).get(n.getType());if(!o)return;const i=new Map;for(const s of o.keys())i.set(s,"created");i.size>0&&t(i,{dirtyLeaves:new Set,prevEditorState:r,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(t,n){const r=this.getRegisteredNode(t);return r.transforms.add(n),r}registerNodeTransform(t,n){const r=this.registerNodeTransformToKlass(t,n),o=[r],i=r.replaceWithKlass;if(i!=null){const s=this.registerNodeTransformToKlass(i,n);o.push(s)}return(function(s,a){const l=Zm(s.getEditorState()),c=[];for(const u of a){const f=l.get(u);f&&c.push(f)}c.length!==0&&s.update(()=>{for(const u of c)for(const f of u.keys()){const d=Pe(f);d&&d.markDirty()}},s._pendingEditorState===null?{tag:Ei}:void 0)})(this,o.map(s=>s.klass.getType())),()=>{o.forEach(s=>s.transforms.delete(n))}}hasNode(t){return this._nodes.has(t.getType())}hasNodes(t){return t.every(this.hasNode.bind(this))}dispatchCommand(t,n){return te(this,t,n)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(t){const n=this._rootElement;if(t!==n){const r=Ri(this._config.theme,"root"),o=this._pendingEditorState||this._editorState;if(this._rootElement=t,T1(this,n,t,o),n!==null&&(this._config.disableEvents||X3(n),r!=null&&n.classList.remove(...r)),t!==null){const i=jh(t),s=t.style;s.userSelect="text",s.whiteSpace="pre-wrap",s.wordBreak="break-word",t.setAttribute("data-lexical-editor","true"),this._window=i,this._dirtyType=2,Ib(this),this._updateTags.add(Ei),cr(this),this._config.disableEvents||(function(a,l){const c=a.ownerDocument;Bd.set(a,c);const u=El.get(c)??0;u<1&&c.addEventListener("selectionchange",d1),El.set(c,u+1),a.__lexicalEditor=l;const f=u1(a);for(let d=0;d<Vd.length;d++){const[h,g]=Vd[d],p=typeof g=="function"?m=>{_m(m)||(Sm(m),(l.isEditable()||h==="click")&&g(m,l))}:m=>{if(_m(m))return;Sm(m);const v=l.isEditable();switch(h){case"cut":return v&&te(l,nc,m);case"copy":return te(l,tc,m);case"paste":return v&&te(l,yh,m);case"dragstart":return v&&te(l,t1,m);case"dragover":return v&&te(l,n1,m);case"dragend":return v&&te(l,z3,m);case"focus":return v&&te(l,r1,m);case"blur":return v&&te(l,H3,m);case"drop":return v&&te(l,e1,m)}};a.addEventListener(h,p),f.push(()=>{a.removeEventListener(h,p)})}})(t,this),r!=null&&t.classList.add(...r)}else this._window=null,this._updateTags.add(Ei),cr(this);As("root",this,!1,t,n)}}getElementByKey(t){return this._keyToDOMMap.get(t)||null}getEditorState(){return this._editorState}setEditorState(t,n){t.isEmpty()&&Y(38);let r=t;r._readOnly&&(r=S1(t),r._selection=t._selection?t._selection.clone():null),Ob(this);const o=this._pendingEditorState,i=this._updateTags,s=n!==void 0?n.tag:null;o===null||o.isEmpty()||(s!=null&&i.add(s),cr(this)),this._pendingEditorState=r,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,s!=null&&i.add(s),this._updating||cr(this)}parseEditorState(t,n){return(function(r,o,i){const s=Ah(),a=ht,l=Bt,c=gt,u=o._dirtyElements,f=o._dirtyLeaves,d=o._cloneNotNeeded,h=o._dirtyType;o._dirtyElements=new Map,o._dirtyLeaves=new Set,o._cloneNotNeeded=new Set,o._dirtyType=0,ht=s,Bt=!1,gt=o,Mh(null);try{const g=o._nodes;kh(r.root,g),i&&i(),s._readOnly=!0}catch(g){g instanceof Error&&o._onError(g)}finally{o._dirtyElements=u,o._dirtyLeaves=f,o._cloneNotNeeded=d,o._dirtyType=h,ht=a,Bt=l,gt=c}return s})(typeof t=="string"?JSON.parse(t):t,this,n)}read(t){return cr(this),this.getEditorState().read(t,{editor:this})}update(t,n){(function(r,o,i){r._updating?r._updates.push([o,i]):ac(r,o,i)})(this,t,n)}focus(t,n={}){const r=this._rootElement;r!==null&&(r.setAttribute("autocapitalize","off"),Un(this,()=>{const o=X(),i=qe();o!==null?o.dirty||Ge(o.clone()):i.getChildrenSize()!==0&&(n.defaultSelection==="rootStart"?i.selectStart():i.selectEnd()),SA("focus"),_A(()=>{r.removeAttribute("autocapitalize"),t&&t()})}),this._pendingEditorState===null&&r.removeAttribute("autocapitalize"))}blur(){const t=this._rootElement;t!==null&&t.blur();const n=Ot(this._window);n!==null&&n.removeAllRanges()}isEditable(){return this._editable}setEditable(t){this._editable!==t&&(this._editable=t,As("editable",this,!0,t))}toJSON(){return{editorState:this._editorState.toJSON()}}}Oi.version="0.39.0+prod.esm";let Yd=null;function Mh(e){Yd=e}let xA=1;function R1(e,t){const n=Ph(e,t);return n===void 0&&Y(30,t),n}function Ph(e,t){return e._nodes.get(t)}const bA=typeof queueMicrotask=="function"?queueMicrotask:e=>{Promise.resolve().then(e)};function k1(e){return Te(Ut(e))}function Lh(e){const t=document.activeElement;if(!Be(t))return!1;const n=t.nodeName;return Te(Ut(e))&&(n==="INPUT"||n==="TEXTAREA"||t.contentEditable==="true"&&lc(t)==null)}function aa(e,t,n){const r=e.getRootElement();try{return r!==null&&r.contains(t)&&r.contains(n)&&t!==null&&!Lh(t)&&A1(t)===e}catch{return!1}}function Fh(e){return e instanceof Oi}function A1(e){let t=e;for(;t!=null;){const n=lc(t);if(Fh(n))return n;t=la(t)}return null}function lc(e){return e?e.__lexicalEditor:null}function Eo(e){return rc(e)||e.isToken()}function sr(e){return Eo(e)||e.isSegmented()}function Cr(e){return Cn(e)&&e.nodeType===3}function N1(e){return Cn(e)&&e.nodeType===9}function Ii(e){let t=e;for(;t!=null;){if(Cr(t))return t;t=t.firstChild}return null}function Ml(e,t,n){const r=Hr[t];if(n!==null&&(e&r)===(n&r))return e;let o=e^r;return t==="subscript"?o&=-65:t==="superscript"?o&=-33:t==="lowercase"?(o&=-513,o&=-1025):t==="uppercase"?(o&=-257,o&=-1025):t==="capitalize"&&(o&=-257,o&=-513),o}function M1(e){return J(e)||Kn(e)||Te(e)}function P1(e,t){const n=(function(){const s=Yd;return Yd=null,s})();if((t=t||n&&n.__key)!=null)return void(e.__key=t);ft(),b1();const r=$e(),o=Jr(),i=""+xA++;o._nodeMap.set(i,e),B(e)?r._dirtyElements.set(i,!0):r._dirtyLeaves.add(i),r._cloneNotNeeded.add(i),r._dirtyType=1,e.__key=i}function Ro(e){const t=e.getParent();if(t!==null){const n=e.getWritable(),r=t.getWritable(),o=e.getPreviousSibling(),i=e.getNextSibling(),s=i!==null?i.__key:null,a=o!==null?o.__key:null,l=o!==null?o.getWritable():null,c=i!==null?i.getWritable():null;o===null&&(r.__first=s),i===null&&(r.__last=a),l!==null&&(l.__next=s),c!==null&&(c.__prev=a),n.__prev=null,n.__next=null,n.__parent=null,r.__size--}}function Pl(e){b1(),kl(e)&&Y(323,e.__key,e.__type);const t=e.getLatest(),n=t.__parent,r=Jr(),o=$e(),i=r._nodeMap,s=o._dirtyElements;n!==null&&(function(l,c,u){let f=l;for(;f!==null;){if(u.has(f))return;const d=c.get(f);if(d===void 0)break;u.set(f,!1),f=d.__parent}})(n,i,s);const a=t.__key;o._dirtyType=1,B(e)?s.set(a,!0):o._dirtyLeaves.add(a)}function yt(e){ft();const t=$e(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,n!==null){const r=Pe(n);r!==null&&r.getWritable()}if(e!==null){const r=Pe(e);r!==null&&r.getWritable()}}}function Mr(){return Yi()?null:$e()._compositionKey}function Pe(e,t){const n=(t||Jr())._nodeMap.get(e);return n===void 0?null:n}function L1(e,t){const n=cc(e,$e());return n!==void 0?Pe(n,t):null}function cc(e,t){return e[`__lexicalKey_${t._key}`]}function Ut(e,t){let n=e;for(;n!=null;){const r=L1(n,t);if(r!==null)return r;n=la(n)}return null}function F1(e){const t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function Wm(e){return e.read(()=>qe().getTextContent())}function qe(){return $1(Jr())}function $1(e){return e._nodeMap.get("root")}function Ge(e){ft();const t=Jr();e!==null&&(e.dirty=!0,e.setCachedNodes(null)),t._selection=e}function wi(e){const t=$e(),n=(function(r,o){let i=r;for(;i!=null;){const s=cc(i,o);if(s!==void 0)return s;i=la(i)}return null})(e,t);return n===null?e===t.getRootElement()?Pe("root"):null:Pe(n)}function O1(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function $h(e){const t=[];let n=e;for(;n!==null;)t.push(n),n=n._parentEditor;return t}function I1(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function D1(e){return Cr(e)?e.nodeValue:null}function Oh(e,t,n){const r=Ot(hn(t));if(r===null)return;const o=r.anchorNode;let{anchorOffset:i,focusOffset:s}=r;if(o!==null){let a=D1(o);const l=Ut(o);if(a!==null&&J(l)){if(a===Zl&&n){const c=n.length;a=n,i=c,s=c}a!==null&&Ih(l,a,i,s,e)}}}function Ih(e,t,n,r,o){let i=e;if(i.isAttached()&&(o||!i.isDirty())){const s=i.isComposing();let a=t;(s||o)&&t[t.length-1]===Zl&&(a=t.slice(0,-1));const l=i.getTextContent();if(o||a!==l){if(a===""){if(yt(null),ra||Ki||oa)i.remove();else{const p=$e();setTimeout(()=>{p.update(()=>{i.isAttached()&&i.remove()})},20)}return}const c=i.getParent(),u=Zn(),f=i.getTextContentSize(),d=Mr(),h=i.getKey();if(i.isToken()||d!==null&&h===d&&!s||W(u)&&(c!==null&&!c.canInsertTextBefore()&&u.anchor.offset===0||u.anchor.key===e.__key&&u.anchor.offset===0&&!i.canInsertTextBefore()&&!s||u.focus.key===e.__key&&u.focus.offset===f&&!i.canInsertTextAfter()&&!s))return void i.markDirty();const g=X();if(!W(g)||n===null||r===null)return void Km(i,a,g);if(g.setTextNodeRange(i,n,i,r),i.isSegmented()){const p=Fe(i.getTextContent());i.replace(p),i=p}Km(i,a,g)}}}function Km(e,t,n){if(e.setTextContent(t),W(n)){const r=e.getKey();for(const o of["anchor","focus"]){const i=n[o];i.type==="text"&&i.key===r&&(i.offset=qn(e,i.offset,"clamp"))}}}function Pa(e,t,n){const r=t[n]||!1;return r==="any"||r===e[n]}function wA(e,t){return Pa(e,t,"altKey")&&Pa(e,t,"ctrlKey")&&Pa(e,t,"shiftKey")&&Pa(e,t,"metaKey")}function Me(e,t,n){return wA(e,n)&&e.key.toLowerCase()===t.toLowerCase()}const rr={ctrlKey:!wn,metaKey:wn},Um={altKey:wn,ctrlKey:!wn};function Gm(e){return e.key==="Backspace"}function qm(e){return Me(e,"a",rr)}function CA(e){const t=qe();if(W(e)){const n=e.anchor,r=e.focus,o=n.getNode().getTopLevelElementOrThrow().getParentOrThrow();return n.set(o.getKey(),0,"element"),r.set(o.getKey(),o.getChildrenSize(),"element"),Bs(e),e}{const n=t.select(0,t.getChildrenSize());return Ge(Bs(n)),n}}function Ri(e,t){e.__lexicalClassNameCache===void 0&&(e.__lexicalClassNameCache={});const n=e.__lexicalClassNameCache,r=n[t];if(r!==void 0)return r;const o=e[t];if(typeof o=="string"){const i=Pb(o);return n[t]=i,i}return o}function Dh(e,t,n,r,o){if(n.size===0)return;const i=r.__type,s=r.__key,a=t.get(i);a===void 0&&Y(33,i);const l=a.klass;let c=e.get(l);c===void 0&&(c=new Map,e.set(l,c));const u=c.get(s),f=u==="destroyed"&&o==="created";(u===void 0||f)&&c.set(s,f?"updated":o)}function Ym(e,t,n){const r=e.getParent();let o=n,i=e;return r!==null&&(t&&n===0?(o=i.getIndexWithinParent(),i=r):t||n!==i.getChildrenSize()||(o=i.getIndexWithinParent()+1,i=r)),i.getChildAtIndex(t?o-1:o)}function Xd(e,t){const n=e.offset;if(e.type==="element")return Ym(e.getNode(),t,n);{const r=e.getNode();if(t&&n===0||!t&&n===r.getTextContentSize()){const o=t?r.getPreviousSibling():r.getNextSibling();return o===null?Ym(r.getParentOrThrow(),t,r.getIndexWithinParent()+(t?0:1)):o}}return null}function j1(e){const t=hn(e).event,n=t&&t.inputType;return n==="insertFromPaste"||n==="insertFromPasteAsQuotation"}function te(e,t,n){return(function(r,o,i){const s=$h(r);for(let a=4;a>=0;a--)for(let l=0;l<s.length;l++){const c=s[l],u=c._commands.get(o);if(u!==void 0){const f=u[a];if(f!==void 0){const d=Array.from(f),h=d.length;let g=!1;if(Un(c,()=>{for(let p=0;p<h;p++)if(d[p](i,r))return void(g=!0)}),g)return g}}}return!1})(e,t,n)}function uc(e){return!at(e)&&!e.isLastChild()&&!e.isInline()}function Lo(e,t){const n=e._keyToDOMMap.get(t);return n===void 0&&Y(75,t),n}function la(e){const t=e.assignedSlot||e.parentElement;return Qd(t)?t.host:t}function V1(e){return N1(e)?e:Be(e)?e.ownerDocument:null}function SA(e){ft(),$e()._updateTags.add(e)}function _A(e){ft(),$e()._deferred.push(e)}function Zd(e,t){let n=e.getParent();for(;n!==null;){if(n.is(t))return!0;n=n.getParent()}return!1}function jh(e){const t=V1(e);return t?t.defaultView:null}function hn(e){const t=e._window;return t===null&&Y(78),t}function TA(e){return B(e)&&e.isInline()||Te(e)&&e.isInline()}function EA(e){let t=e.getParentOrThrow();for(;t!==null;){if(vt(t))return t;t=t.getParentOrThrow()}return t}function vt(e){return at(e)||B(e)&&e.isShadowRoot()}function RA(e){const t=e.constructor.clone(e);return P1(t,null),t.afterCloneFrom(e),t}function Et(e){const t=$e(),n=e.getType(),r=Ph(t,n);r===void 0&&Y(200,e.constructor.name,n);const{replace:o,replaceWithKlass:i}=r;if(o!==null){const s=o(e),a=s.constructor;return i!==null?s instanceof i||Y(201,i.name,i.getType(),a.name,a.getType(),e.constructor.name,n):s instanceof e.constructor&&a!==e.constructor||Y(202,a.name,a.getType(),e.constructor.name,n),s.__key===e.__key&&Y(203,e.constructor.name,n,a.name,a.getType()),s}return e}function au(e,t){!at(e.getParent())||B(t)||Te(t)||Y(99)}function kA(e){const t=Pe(e);return t===null&&Y(63,e),t}function lu(e){return(Te(e)||B(e)&&!e.canBeEmpty())&&!e.isInline()}function Jd(e,t,n){n.style.removeProperty("caret-color"),t._blockCursorElement=null;const r=e.parentElement;r!==null&&r.removeChild(e)}function Ot(e){return Ln?(e||window).getSelection():null}function AA(e){const t=jh(e);return t?t.getSelection():null}function B1(e){return Be(e)&&e.tagName==="A"}function Be(e){return Cn(e)&&e.nodeType===1}function Cn(e){return typeof e=="object"&&e!==null&&"nodeType"in e&&typeof e.nodeType=="number"}function Qd(e){return Cn(e)&&e.nodeType===11}function ef(e){const t=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return e.nodeName.match(t)!==null}function Ll(e){const t=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return e.nodeName.match(t)!==null}function Nr(e){if(Te(e)&&!e.isInline())return!0;if(!B(e)||vt(e))return!1;const t=e.getFirstChild(),n=t===null||Kn(t)||J(t)||t.isInline();return!e.isInline()&&e.canBeEmpty()!==!1&&n}function Zi(){return $e()}const Xm=new WeakMap,NA=new Map;function Zm(e){if(!e._readOnly&&e.isEmpty())return NA;e._readOnly||Y(192);let t=Xm.get(e);return t||(t=(function(n){const r=new Map;for(const[o,i]of n._nodeMap){const s=i.__type;let a=r.get(s);a||(a=new Map,r.set(s,a)),a.set(o,i)}return r})(e),Xm.set(e,t)),t}function z1(e){const t=e.constructor.clone(e);return t.afterCloneFrom(e),t}function MA(e){return(t=z1(e))[f1]=!0,t;var t}function Vh(e,t){const n=parseInt(e.style.paddingInlineStart,10)||0,r=Math.round(n/40);t.setIndent(r)}function PA(e){e.__lexicalUnmanaged=!0}function LA(e){return e.__lexicalUnmanaged===!0}function cs(e,t){return(function(n,r){return Object.prototype.hasOwnProperty.call(n,r)})(e,t)&&e[t]!==Wn[t]}function dc(e){const t=um in e.prototype?e.prototype[um]():void 0,n=(function(s){if(!(s===Wn||s.prototype instanceof Wn)){let a="<unknown>",l="<unknown>";try{a=s.getType()}catch{}try{Oi.version&&(l=JSON.parse(Oi.version))}catch{}Y(290,s.name,a,l)}return s===ia||s===Tt||s===Wn})(e),r=!n&&cs(e,"getType")?e.getType():void 0;let o,i=r;if(t)if(r)o=t[r];else for(const[s,a]of Object.entries(t))i=s,o=a;if(!n&&i&&(cs(e,"getType")||(e.getType=()=>i),cs(e,"clone")||(e.clone=s=>(Mh(s),new e)),cs(e,"importJSON")||(e.importJSON=o&&o.$importJSON||(s=>new e().updateFromJSON(s))),!cs(e,"importDOM")&&o)){const{importDOM:s}=o;s&&(e.importDOM=()=>s)}return{ownNodeConfig:o,ownNodeType:i}}function H1(e){const t=Zi();return ft(),new(t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e))).klass}const we=(e,t)=>{let n=e;for(;n!=null&&!at(n);){if(t(n))return n;n=n.getParent()}return null},FA={next:"previous",previous:"next"};class Bh{origin;constructor(t){this.origin=t}[Symbol.iterator](){return Wh({hasNext:Wr,initial:this.getAdjacentCaret(),map:t=>t,step:t=>t.getAdjacentCaret()})}getAdjacentCaret(){return nt(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return nt(this.origin,this.direction)}remove(){const t=this.getNodeAtCaret();return t&&t.remove(),this}replaceOrInsert(t,n){const r=this.getNodeAtCaret();return t.is(this.origin)||t.is(r)||(r===null?this.insert(t):r.replace(t,n)),this}splice(t,n,r="next"){const o=r===this.direction?n:Array.from(n).reverse();let i=this;const s=this.getParentAtCaret(),a=new Map;for(let l=i.getAdjacentCaret();l!==null&&a.size<t;l=l.getAdjacentCaret()){const c=l.origin.getWritable();a.set(c.getKey(),c)}for(const l of o){if(a.size>0){const c=i.getNodeAtCaret();if(c){if(a.delete(c.getKey()),a.delete(l.getKey()),!(c.is(l)||i.origin.is(l))){const u=l.getParent();u&&u.is(s)&&l.remove(),c.replace(l)}}else c===null&&Y(263,Array.from(a).join(" "))}else i.insert(l);i=nt(l,this.direction)}for(const l of a.values())l.remove();return this}}class Ks extends Bh{type="child";getLatest(){const t=this.origin.getLatest();return t===this.origin?this:Ft(t,this.direction)}getParentCaret(t="root"){return nt(zh(this.getParentAtCaret(),t),this.direction)}getFlipped(){const t=Ko(this.direction);return nt(this.getNodeAtCaret(),t)||Ft(this.origin,t)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(t){return t instanceof Ks&&this.direction===t.direction&&this.origin.is(t.origin)}isSamePointCaret(t){return this.isSameNodeCaret(t)}}const $A={root:at,shadowRoot:vt};function Ko(e){return FA[e]}function zh(e,t="root"){return $A[t](e)?null:e}class Fo extends Bh{type="sibling";getLatest(){const t=this.origin.getLatest();return t===this.origin?this:nt(t,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return B(this.origin)?Ft(this.origin,this.direction):null}getParentCaret(t="root"){return nt(zh(this.getParentAtCaret(),t),this.direction)}getFlipped(){const t=Ko(this.direction);return nt(this.getNodeAtCaret(),t)||Ft(this.origin.getParentOrThrow(),t)}isSamePointCaret(t){return t instanceof Fo&&this.direction===t.direction&&this.origin.is(t.origin)}isSameNodeCaret(t){return(t instanceof Fo||t instanceof $o)&&this.direction===t.direction&&this.origin.is(t.origin)}}class $o extends Bh{type="text";offset;constructor(t,n){super(t),this.offset=n}getLatest(){const t=this.origin.getLatest();return t===this.origin?this:Oo(t,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(t="root"){return nt(zh(this.getParentAtCaret(),t),this.direction)}getFlipped(){return Oo(this.origin,Ko(this.direction),this.offset)}isSamePointCaret(t){return t instanceof $o&&this.direction===t.direction&&this.origin.is(t.origin)&&this.offset===t.offset}isSameNodeCaret(t){return(t instanceof Fo||t instanceof $o)&&this.direction===t.direction&&this.origin.is(t.origin)}getSiblingCaret(){return nt(this.origin,this.direction)}}function Gn(e){return e instanceof $o}function Wr(e){return e instanceof Fo}function zt(e){return e instanceof Ks}const OA={next:class extends $o{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends $o{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},IA={next:class extends Fo{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends Fo{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},DA={next:class extends Ks{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends Ks{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function nt(e,t){return e?new IA[t](e):null}function Oo(e,t,n){return e?new OA[t](e,qn(e,n)):null}function qn(e,t,n="error"){const r=e.getTextContentSize();let o=t==="next"?r:t==="previous"?0:t;return(o<0||o>r)&&(n!=="clamp"&&Nb(284,String(t),String(r),e.getKey()),o=o<0?0:r),o}function Jm(e,t){return new VA(e,t)}function Ft(e,t){return B(e)?new DA[t](e):null}function jA(e){return e&&e.getChildCaret()||e}function ca(e){return e&&jA(e.getAdjacentCaret())}class Hh{type="node-caret-range";direction;anchor;focus;constructor(t,n,r){this.anchor=t,this.focus=n,this.direction=r}getLatest(){const t=this.anchor.getLatest(),n=this.focus.getLatest();return t===this.anchor&&n===this.focus?this:new Hh(t,n,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){const t=o=>{const i=this[o].getLatest();return Gn(i)?(function(s,a){const{direction:l,origin:c}=s,u=qn(c,a==="focus"?Ko(l):l);return Jm(s,u-s.offset)})(i,o):null},n=t("anchor"),r=t("focus");if(n&&r){const{caret:o}=n,{caret:i}=r;if(o.isSameNodeCaret(i))return[Jm(o,i.offset-o.offset),null]}return[n,r]}iterNodeCarets(t="root"){const n=Gn(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),r=this.focus.getLatest(),o=Gn(r),i=s=>s.isSameNodeCaret(r)?null:ca(s)||s.getParentCaret(t);return Wh({hasNext:s=>s!==null&&!(o&&r.isSameNodeCaret(s)),initial:n.isSameNodeCaret(r)?null:i(n),map:s=>s,step:i})}[Symbol.iterator](){return this.iterNodeCarets("root")}}class VA{type="slice";caret;distance;constructor(t,n){this.caret=t,this.distance=n}getSliceIndices(){const{distance:t,caret:{offset:n}}=this,r=n+t;return r<n?[r,n]:[n,r]}getTextContent(){const[t,n]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(t,n)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){const{caret:{origin:t,direction:n}}=this,[r,o]=this.getSliceIndices(),i=t.getTextContent();return Oo(t.setTextContent(i.slice(0,r)+i.slice(o)),n,r)}}function Us(e){return Kr(e,nt(qe(),e.direction))}function W1(e){return Kr(e,e)}function Kr(e,t){return e.direction!==t.direction&&Y(265),new Hh(e,t,e.direction)}function Wh(e){const{initial:t,hasNext:n,step:r,map:o}=e;let i=t;return{[Symbol.iterator](){return this},next(){if(!n(i))return{done:!0,value:void 0};const s={done:!1,value:o(i)};return i=r(i),s}}}function K1(e,t){const n=il(e.origin,t.origin);switch(n===null&&Y(275,e.origin.getKey(),t.origin.getKey()),n.type){case"same":{const r=e.type==="text",o=t.type==="text";return r&&o?(function(i,s){return Math.sign(i-s)})(e.offset,t.offset):e.type===t.type?0:r?-1:o?1:e.type==="child"?-1:1}case"ancestor":return e.type==="child"?-1:1;case"descendant":return t.type==="child"?1:-1;case"branch":return U1(n)}}function U1(e){const{a:t,b:n}=e,r=t.__key,o=n.__key;let i=t,s=n;for(;i&&s;i=i.getNextSibling(),s=s.getNextSibling()){if(i.__key===o)return-1;if(s.__key===r)return 1}return i===null?1:-1}function La(e,t){return t.is(e)}function Qm(e){return B(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function il(e,t){if(e.is(t))return{commonAncestor:e,type:"same"};const n=new Map;for(let[r,o]=Qm(e);r;o=r,r=r.getParent())n.set(r,o);for(let[r,o]=Qm(t);r;o=r,r=r.getParent()){const i=n.get(r);if(i!==void 0)return i===null?(La(e,r)||Y(276),{commonAncestor:r,type:"ancestor"}):o===null?(La(t,r)||Y(277),{commonAncestor:r,type:"descendant"}):((B(i)||La(e,i))&&(B(o)||La(t,o))&&r.is(i.getParent())&&r.is(o.getParent())||Y(278),{a:i,b:o,commonAncestor:r,type:"branch"})}return null}function An(e,t){const{type:n,key:r,offset:o}=e,i=kA(e.key);return n==="text"?(J(i)||Y(266,i.getType(),r),Oo(i,t,o)):(B(i)||Y(267,i.getType(),r),zA(i,e.offset,t))}function Sn(e,t){const{origin:n,direction:r}=t,o=r==="next";Gn(t)?e.set(n.getKey(),t.offset,"text"):Wr(t)?J(n)?e.set(n.getKey(),qn(n,r),"text"):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+(o?1:0),"element"):(zt(t)&&B(n)||Y(268),e.set(n.getKey(),o?0:n.getChildrenSize(),"element"))}function G1(e){const t=X(),n=W(t)?t:ic();return sl(n,e),Ge(n),n}function sl(e,t){Sn(e.anchor,t.anchor),Sn(e.focus,t.focus)}function ey(e){const{anchor:t,focus:n}=e,r=An(t,"next"),o=An(n,"next"),i=K1(r,o)<=0?"next":"previous";return Kr(br(r,i),br(o,i))}function ua(e){const{direction:t,origin:n}=e,r=nt(n,Ko(t)).getNodeAtCaret();return r?nt(r,t):Ft(n.getParentOrThrow(),t)}function ty(e,t="root"){const n=[e];for(let r=zt(e)?e.getParentCaret(t):e.getSiblingCaret();r!==null;r=r.getParentCaret(t))n.push(ua(r));return n}function cu(e){return!!e&&e.origin.isAttached()}function BA(e,t="removeEmptySlices"){if(e.isCollapsed())return e;const n="root",r="next";let o=t;const i=q1(e,r),s=ty(i.anchor,n),a=ty(i.focus.getFlipped(),n),l=new Set,c=[];for(const g of i.iterNodeCarets(n))if(zt(g))l.add(g.origin.getKey());else if(Wr(g)){const{origin:p}=g;B(p)&&!l.has(p.getKey())||c.push(p)}for(const g of c)g.remove();for(const g of i.getTextSlices()){if(!g)continue;const{origin:p}=g.caret,m=p.getTextContentSize(),v=ua(nt(p,r)),y=p.getMode();if(Math.abs(g.distance)===m&&o==="removeEmptySlices"||y==="token"&&g.distance!==0)v.remove();else if(g.distance!==0){o="removeEmptySlices";let x=g.removeTextSlice();const b=g.caret.origin;if(y==="segmented"){const w=x.origin,_=Fe(w.getTextContent()).setStyle(w.getStyle()).setFormat(w.getFormat());v.replaceOrInsert(_),x=Oo(_,r,x.offset)}b.is(s[0].origin)&&(s[0]=x),b.is(a[0].origin)&&(a[0]=x.getFlipped())}}let u,f;for(const g of s)if(cu(g)){u=Lt(g);break}for(const g of a)if(cu(g)){f=Lt(g);break}const d=(function(g,p,m){if(!g||!p)return null;const v=g.getParentAtCaret(),y=p.getParentAtCaret();if(!v||!y)return null;const x=v.getParents().reverse();x.push(v);const b=y.getParents().reverse();b.push(y);const w=Math.min(x.length,b.length);let _;for(_=0;_<w&&x[_]===b[_];_++);const E=(M,F)=>{let D;for(let j=_;j<M.length;j++){const I=M[j];if(vt(I))return;!D&&F(I)&&(D=I)}return D},R=E(x,Nr),k=R&&E(b,M=>m.has(M.getKey())&&Nr(M));return R&&k?[R,k]:null})(u,f,l);if(d){const[g,p]=d;Ft(g,"previous").splice(0,p.getChildren()),p.remove()}const h=[u,f,...s,...a].find(cu);if(h)return W1(br(Lt(h),e.direction));Y(269,JSON.stringify(s.map(g=>g.origin.__key)))}function Lt(e){const t=(function(o){let i=o;for(;zt(i);){const s=ca(i);if(!zt(s))break;i=s}return i})(e.getLatest()),{direction:n}=t;if(J(t.origin))return Gn(t)?t:Oo(t.origin,n,n);const r=t.getAdjacentCaret();return Wr(r)&&J(r.origin)?Oo(r.origin,n,Ko(n)):t}function Kh(e){return Gn(e)&&e.offset!==qn(e.origin,e.direction)}function br(e,t){return e.direction===t?e:e.getFlipped()}function q1(e,t){return e.direction===t?e:Kr(br(e.focus,t),br(e.anchor,t))}function zA(e,t,n){let r=Ft(e,"next");for(let o=0;o<t;o++){const i=r.getAdjacentCaret();if(i===null)break;r=i}return br(r,n)}function HA(e){const{origin:t,offset:n,direction:r}=e;if(n===qn(t,r))return e.getSiblingCaret();if(n===qn(t,Ko(r)))return ua(e.getSiblingCaret());const[o]=t.splitText(n);return J(o)||Y(281),br(nt(o,"next"),r)}function WA(e,t){return!0}function KA(e,{$copyElementNode:t=RA,$splitTextPointCaretNext:n=HA,rootMode:r="shadowRoot",$shouldSplit:o=WA}={}){if(Gn(e))return n(e);const i=e.getParentCaret(r);if(i){const{origin:s}=i;if(zt(e)&&(!s.canBeEmpty()||!o(s,"first")))return ua(i);const a=(function(l){const c=[];for(let u=l.getAdjacentCaret();u;u=u.getAdjacentCaret())c.push(u.origin);return c})(e);(a.length>0||s.canBeEmpty()&&o(s,"last"))&&i.insert(t(s).splice(0,0,a))}return i}function UA(e,t){if(!t||e===t)return e;for(const n in t)if(e[n]!==t[n])return{...e,...t};return e}const tf=new Map;function Y1(e){const t={};if(!e)return t;const n=e.split(";");for(const r of n)if(r!==""){const[o,i]=r.split(/:([^]+)/);o&&i&&(t[o.trim()]=i.trim())}return t}function ny(e){let t=tf.get(e);return t===void 0&&(t=Y1(e),tf.set(e,t)),t}function X1(e){const t=Zi().getElementByKey(e.getKey());if(t===null)return null;const n=t.ownerDocument.defaultView;return n===null?null:n.getComputedStyle(t)}function Z1(e){return X1(at(e)?e:e.getParentOrThrow())}function ry(e){const t=Z1(e);return t!==null&&t.direction==="rtl"}function J1(e,t,n="self"){const r=e.getStartEndPoints();if(t.isSelected(e)&&!sr(t)&&r!==null){const[o,i]=r,s=e.isBackward(),a=o.getNode(),l=i.getNode(),c=t.is(a),u=t.is(l);if(c||u){const[f,d]=Gd(e),h=a.is(l),g=t.is(s?l:a),p=t.is(s?a:l);let m,v=0;h?(v=f>d?d:f,m=f>d?f:d):g?(v=s?d:f,m=void 0):p&&(v=0,m=s?f:d);const y=t.__text.slice(v,m);y!==t.__text&&(n==="clone"&&(t=MA(t)),t.__text=y)}}return t}function GA(e){const t=e.getStyle(),n=Y1(t);tf.set(t,n)}function Q1(e){const t=ew(e);return t!==null&&t.writingMode==="vertical-rl"}function ew(e){const t=e.anchor.getNode();return B(t)?X1(t):Z1(t)}function oy(e,t){let n=Q1(e)?!t:t;tw(e)&&(n=!n);const r=An(e.focus,n?"previous":"next");if(Kh(r))return!1;for(const o of Us(r)){if(zt(o))return!o.origin.isInline();if(!B(o.origin)){if(Te(o.origin))return!0;break}}return!1}function qA(e,t,n,r){e.modify(t?"extend":"move",n,r)}function tw(e){const t=ew(e);return t!==null&&t.direction==="rtl"}function iy(e,t,n){const r=tw(e);let o;o=Q1(e)||r?!n:n,qA(e,t,o,"character")}function nw(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const rw=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,YA=rw&&"documentMode"in document?document.documentMode:null;!(!rw||!("InputEvent"in window)||YA)&&"getTargetRanges"in new window.InputEvent("input");function ow(...e){const t=[];for(const n of e)if(n&&typeof n=="string")for(const[r]of n.matchAll(/\S+/g))t.push(r);return t}function Nn(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function et(e,...t){const n=ow(...t);n.length>0&&e.classList.add(...n)}function Yn(e,...t){const n=ow(...t);n.length>0&&e.classList.remove(...n)}function XA(e){return e?e.getAdjacentCaret():null}function ZA(e,t){let n=e;for(;n!=null;){if(n instanceof t)return n;n=n.getParent()}return null}function JA(e){const t=we(e,n=>B(n)&&!n.isInline());return B(t)||nw(4,e.__key),t}function QA(e){const t=X()||Zn();let n;if(W(t))n=An(t.focus,"next");else{if(t!=null){const s=t.getNodes(),a=s[s.length-1];a&&(n=nt(a,"next"))}n=n||Ft(qe(),"previous").getFlipped().insert(ve())}const r=eN(e,n),o=ca(r),i=zt(o)?Lt(o):r;return G1(W1(i)),e.getLatest()}function eN(e,t,n){let r=br(t,"next");for(let o=r;o;o=KA(o,n))r=o;return Gn(r)&&nw(283),r.insert(e.isInline()?ve().append(e):e),br(nt(e.getLatest(),"next"),t.direction)}function Pr(e,t){return e!==null&&Object.getPrototypeOf(e).constructor.name===t.name}function tN(e,t){Ft(e,"next").insert(t)}function iw(e,t){return sw(e,t,null)}function sw(e,t,n){let r=!1;for(const o of lw(e))t(o)?n!==null&&n(o):(r=!0,B(o)&&sw(o,t,n||(i=>o.insertAfter(i))),o.remove());return r}function aw(e,t){const n=[],r=Array.from(e).reverse();for(let o=r.pop();o!==void 0;o=r.pop())if(t(o))n.push(o);else if(B(o))for(const i of lw(o))r.push(i);return n}function lw(e){return nN(Ft(e,"previous"))}function nN(e){return Wh({hasNext:Wr,initial:e.getAdjacentCaret(),map:t=>t.origin.getLatest(),step:t=>t.getAdjacentCaret()})}function cw(){const[e]=lt(),[t,n]=S.useState(!1),[r,o]=S.useState(!1),[i,s]=S.useState(!1),[a,l]=S.useState(!1),[c,u]=S.useState("left"),f=c==="left",d=c==="center",h=c==="right",g=S.useCallback(()=>{const v=X();W(v)&&(n(v.hasFormat("bold")),o(v.hasFormat("italic")),s(v.hasFormat("underline")),l(v.hasFormat("strikethrough")))},[]),p=S.useCallback(v=>{u(v)},[]),m=S.useCallback(()=>{const v=X();if(!W(v))return;const y=v.anchor.getNode(),x=y.getKey()==="root"?y:y.getTopLevelElementOrThrow();if(B(x)){const b=x.getFormatType();p(b)}},[p]);return S.useEffect(()=>{const v=Nn(e.registerCommand(Vt,(y,x)=>(e.read(()=>{g()}),!1),ur),e.registerCommand(_i,(y,x)=>(e.read(()=>{p(y)}),!1),ur),e.registerCommand(fr,(y,x)=>(e.read(()=>{g(),m()}),!1),ur));return()=>{v()}},[e,g,p,m]),{isBold:t,isItalic:r,isUnderline:i,isStrikethrough:a,alignment:c,isAlignLeft:f,isAlignCenter:d,isAlignRight:h}}var ae=(e=>(e.BOLD="font-bold",e.ITALIC="font-italic",e.UNDERLINE="font-underline",e.STRIKETHROUGH="font-strikethrough",e.ALIGN_LEFT="align-left",e.ALIGN_CENTER="align-center",e.ALIGN_RIGHT="align-right",e.LINK="insert-link",e.IMAGE="insert-image",e.TABLE="insert-table",e.BULLET_LIST="insert-bullet-list",e.NUMBERED_LIST="insert-numbered-list",e))(ae||{});function rN(){const{isBold:e,isItalic:t,isUnderline:n,isStrikethrough:r,isAlignLeft:o,isAlignCenter:i,isAlignRight:s}=cw(),l=na().toolbar.actions,{availableActions:c}=e3(),u=S.useMemo(()=>({id:ae.BOLD,IconComponent:Kk,label:l.bold,isActive:e}),[l.bold,e]),f=S.useMemo(()=>({id:ae.ITALIC,IconComponent:Gk,label:l.italic,isActive:t}),[l.italic,t]),d=S.useMemo(()=>({id:ae.UNDERLINE,IconComponent:Qk,label:l.underline,isActive:n}),[l.underline,n]),h=S.useMemo(()=>({id:ae.STRIKETHROUGH,IconComponent:Zk,label:l.strikethrough,isActive:r}),[l.strikethrough,r]),g=S.useMemo(()=>({id:ae.ALIGN_LEFT,IconComponent:Hk,label:l.alignLeft,isActive:o}),[l.alignLeft,o]),p=S.useMemo(()=>({id:ae.ALIGN_CENTER,IconComponent:zk,label:l.alignCenter,isActive:i}),[l.alignCenter,i]),m=S.useMemo(()=>({id:ae.ALIGN_RIGHT,IconComponent:Wk,label:l.alignRight,isActive:s}),[l.alignRight,s]),v=S.useMemo(()=>({id:ae.BULLET_LIST,IconComponent:Yk,label:l.bulletList}),[l.bulletList]),y=S.useMemo(()=>({id:ae.NUMBERED_LIST,IconComponent:Xk,label:l.numberedList}),[l.numberedList]),x=S.useMemo(()=>({id:ae.LINK,IconComponent:qk,label:l.link}),[l.link]),b=S.useMemo(()=>({id:ae.IMAGE,IconComponent:Uk,label:l.image}),[l.image]),w=S.useMemo(()=>({id:ae.TABLE,IconComponent:Jk,label:l.table}),[l.table]),_=S.useMemo(()=>({[ae.BOLD]:u,[ae.ITALIC]:f,[ae.UNDERLINE]:d,[ae.STRIKETHROUGH]:h,[ae.ALIGN_LEFT]:g,[ae.ALIGN_CENTER]:p,[ae.ALIGN_RIGHT]:m,[ae.BULLET_LIST]:v,[ae.NUMBERED_LIST]:y,[ae.LINK]:x,[ae.IMAGE]:b,[ae.TABLE]:w}),[u,f,d,h,g,p,m,v,y,x,b,w]),E=S.useMemo(()=>c.map(k=>k.map(M=>_[M])),[c,_]);return{availableActions:S.useMemo(()=>E.flat(),[E]),availableActionGroups:E}}const oN=Symbol.for("preact-signals");function Uh(){if(ki>1)return void ki--;let e,t=!1;for(;Ms!==void 0;){let n=Ms;for(Ms=void 0,nf++;n!==void 0;){const r=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&dw(n))try{n.c()}catch(o){t||(e=o,t=!0)}n=r}}if(nf=0,ki--,t)throw e}let Ne,Ms;function sy(e){const t=Ne;Ne=void 0;try{return e()}finally{Ne=t}}let ki=0,nf=0,al=0;function ay(e){if(Ne===void 0)return;let t=e.n;return t===void 0||t.t!==Ne?(t={i:0,S:e,p:Ne.s,n:void 0,t:Ne,e:void 0,x:void 0,r:t},Ne.s!==void 0&&(Ne.s.n=t),Ne.s=t,e.n=t,32&Ne.f&&e.S(t),t):t.i===-1?(t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=Ne.s,t.n=void 0,Ne.s.n=t,Ne.s=t),t):void 0}function Nt(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function uw(e,t){return new Nt(e,t)}function dw(e){for(let t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function ly(e){for(let t=e.s;t!==void 0;t=t.n){const n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function fw(e){let t,n=e.s;for(;n!==void 0;){const r=n.p;n.i===-1?(n.S.U(n),r!==void 0&&(r.n=n.n),n.n!==void 0&&(n.n.p=r)):t=n,n.S.n=n.r,n.r!==void 0&&(n.r=void 0),n=r}e.s=t}function Jo(e,t){Nt.call(this,void 0),this.x=e,this.s=void 0,this.g=al-1,this.f=4,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function hw(e){const t=e.u;if(e.u=void 0,typeof t=="function"){ki++;const n=Ne;Ne=void 0;try{t()}catch(r){throw e.f&=-2,e.f|=8,Gh(e),r}finally{Ne=n,Uh()}}}function Gh(e){for(let t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,hw(e)}function iN(e){if(Ne!==this)throw new Error("Out-of-order effect");fw(this),Ne=e,this.f&=-2,8&this.f&&Gh(this),Uh()}function di(e,t){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=t?.name}function sN(e,t){const n=new di(e,t);try{n.c()}catch(o){throw n.d(),o}const r=n.d.bind(n);return r[Symbol.dispose]=r,r}Nt.prototype.brand=oN,Nt.prototype.h=function(){return!0},Nt.prototype.S=function(e){const t=this.t;t!==e&&e.e===void 0&&(e.x=t,this.t=e,t!==void 0?t.e=e:sy(()=>{var n;(n=this.W)==null||n.call(this)}))},Nt.prototype.U=function(e){if(this.t!==void 0){const t=e.e,n=e.x;t!==void 0&&(t.x=n,e.e=void 0),n!==void 0&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n,n===void 0&&sy(()=>{var r;(r=this.Z)==null||r.call(this)}))}},Nt.prototype.subscribe=function(e){return sN(()=>{const t=this.value,n=Ne;Ne=void 0;try{e(t)}finally{Ne=n}},{name:"sub"})},Nt.prototype.valueOf=function(){return this.value},Nt.prototype.toString=function(){return this.value+""},Nt.prototype.toJSON=function(){return this.value},Nt.prototype.peek=function(){const e=Ne;Ne=void 0;try{return this.value}finally{Ne=e}},Object.defineProperty(Nt.prototype,"value",{get(){const e=ay(this);return e!==void 0&&(e.i=this.i),this.v},set(e){if(e!==this.v){if(nf>100)throw new Error("Cycle detected");this.v=e,this.i++,al++,ki++;try{for(let t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Uh()}}}}),Jo.prototype=new Nt,Jo.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===al))return!0;if(this.g=al,this.f|=1,this.i>0&&!dw(this))return this.f&=-2,!0;const e=Ne;try{ly(this),Ne=this;const t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(t){this.v=t,this.f|=16,this.i++}return Ne=e,fw(this),this.f&=-2,!0},Jo.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(let t=this.s;t!==void 0;t=t.n)t.S.S(t)}Nt.prototype.S.call(this,e)},Jo.prototype.U=function(e){if(this.t!==void 0&&(Nt.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(let t=this.s;t!==void 0;t=t.n)t.S.U(t)}},Jo.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(Jo.prototype,"value",{get(){if(1&this.f)throw new Error("Cycle detected");const e=ay(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),di.prototype.c=function(){const e=this.S();try{if(8&this.f||this.x===void 0)return;const t=this.x();typeof t=="function"&&(this.u=t)}finally{e()}},di.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,hw(this),ly(this),ki++;const e=Ne;return Ne=this,iN.bind(this,e)},di.prototype.N=function(){2&this.f||(this.f|=2,this.o=Ms,Ms=this)},di.prototype.d=function(){this.f|=8,1&this.f||Gh(this)},di.prototype.dispose=function(){this.d()};function aN(e){return(typeof e.nodes=="function"?e.nodes():e.nodes)||[]}function Ie(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function gw(e,t){if(e&&t&&!Array.isArray(t)&&typeof e=="object"&&typeof t=="object"){const n=e,r=t;for(const o in r)n[o]=gw(n[o],r[o]);return e}return t}const qh=0,rf=1,pw=2,uu=3,Fa=4,Qo=5,du=6,us=7;function fu(e){return e.id===qh}function mw(e){return e.id===pw}function lN(e){return(function(t){return t.id===rf})(e)||Ie(305,String(e.id),String(rf)),Object.assign(e,{id:pw})}const cN=new Set;let uN=class{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(t,n){this.builder=t,this.extension=n,this.configs=new Set,this.state={id:qh}}mergeConfigs(){let t=this.extension.config||{};const n=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):UA;for(const r of this.configs)t=n(t,r);return t}init(t){const n=this.state;mw(n)||Ie(306,String(n.id));const r={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},o={...r,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},i=(function(a,l,c){return Object.assign(a,{config:l,id:uu,registerState:c})})(n,this.mergeConfigs(),r);let s;this.state=i,this.extension.init&&(s=this.extension.init(t,i.config,r)),this.state=(function(a,l,c){return Object.assign(a,{id:Fa,initResult:l,registerState:c})})(i,s,o)}build(t){const n=this.state;let r;n.id!==Fa&&Ie(307,String(n.id),String(Qo)),this.extension.build&&(r=this.extension.build(t,n.config,n.registerState));const o={...n.registerState,getOutput:()=>r,getSignal:this.getSignal.bind(this)};this.state=(function(i,s,a){return Object.assign(i,{id:Qo,output:s,registerState:a})})(n,r,o)}register(t,n){this._signal=n;const r=this.state;r.id!==Qo&&Ie(308,String(r.id),String(Qo));const o=this.extension.register&&this.extension.register(t,r.config,r.registerState);return this.state=(function(i){return Object.assign(i,{id:du})})(r),()=>{const i=this.state;i.id!==us&&Ie(309,String(r.id),String(us)),this.state=(function(s){return Object.assign(s,{id:Qo})})(i),o&&o()}}afterRegistration(t){const n=this.state;let r;return n.id!==du&&Ie(310,String(n.id),String(du)),this.extension.afterRegistration&&(r=this.extension.afterRegistration(t,n.config,n.registerState)),this.state=(function(o){return Object.assign(o,{id:us})})(n),r}getSignal(){return this._signal===void 0&&Ie(311),this._signal}getInitResult(){this.extension.init===void 0&&Ie(312,this.extension.name);const t=this.state;return(function(n){return n.id>=Fa})(t)||Ie(313,String(t.id),String(Fa)),t.initResult}getInitPeer(t){const n=this.builder.extensionNameMap.get(t);return n?n.getExtensionInitDependency():void 0}getExtensionInitDependency(){const t=this.state;return(function(n){return n.id>=uu})(t)||Ie(314,String(t.id),String(uu)),{config:t.config}}getPeer(t){const n=this.builder.extensionNameMap.get(t);return n?n.getExtensionDependency():void 0}getInitDependency(t){const n=this.builder.getExtensionRep(t);return n===void 0&&Ie(315,this.extension.name,t.name),n.getExtensionInitDependency()}getDependency(t){const n=this.builder.getExtensionRep(t);return n===void 0&&Ie(315,this.extension.name,t.name),n.getExtensionDependency()}getState(){const t=this.state;return(function(n){return n.id>=us})(t)||Ie(316,String(t.id),String(us)),t}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||cN}getPeerNameSet(){let t=this._peerNameSet;return t||(t=new Set((this.extension.peerDependencies||[]).map(([n])=>n)),this._peerNameSet=t),t}getExtensionDependency(){if(!this._dependency){const t=this.state;(function(n){return n.id>=Qo})(t)||Ie(317,this.extension.name),this._dependency={config:t.config,init:t.initResult,output:t.output}}return this._dependency}};const cy={tag:Ei};function dN(){const e=qe();e.isEmpty()&&e.append(ve())}const fN={config:{setOptions:cy,updateOptions:cy},init:({$initialEditorState:e=dN})=>({$initialEditorState:e,initialized:!1}),afterRegistration(e,{updateOptions:t,setOptions:n},r){const o=r.getInitResult();if(!o.initialized){o.initialized=!0;const{$initialEditorState:i}=o;if(pA(i))e.setEditorState(i,n);else if(typeof i=="function")e.update(()=>{i(e)},t);else if(i&&(typeof i=="string"||typeof i=="object")){const s=e.parseEditorState(i);e.setEditorState(s,n)}}return()=>{}},name:"@lexical/extension/InitialState",nodes:[Xi,fn,Ui,Gi,Wo]},uy=Symbol.for("@lexical/extension/LexicalBuilder");function dy(){}function hN(e){throw e}function $a(e){return Array.isArray(e)?e:[e]}const hu="0.39.0+prod.esm";let gN=class ll{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(t){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=hu,this.roots=t;for(const n of t)this.addExtension(n)}static fromExtensions(t){const n=[$a(fN)];for(const r of t)n.push($a(r));return new ll(n)}static maybeFromEditor(t){const n=t[uy];return n&&(n.PACKAGE_VERSION!==hu&&Ie(292,n.PACKAGE_VERSION,hu),n instanceof ll||Ie(293)),n}static fromEditor(t){const n=ll.maybeFromEditor(t);return n===void 0&&Ie(294),n}constructEditor(){const{$initialEditorState:t,onError:n,...r}=this.buildCreateEditorArgs(),o=Object.assign(E1({...r,...n?{onError:i=>{n(i,o)}}:{}}),{[uy]:this});for(const i of this.sortedExtensionReps())i.build(o);return o}buildEditor(){let t=dy;function n(){try{t()}finally{t=dy}}const r=Object.assign(this.constructEditor(),{dispose:n,[Symbol.dispose]:n});return t=Nn(this.registerEditor(r),()=>r.setRootElement(null)),r}hasExtensionByName(t){return this.extensionNameMap.has(t)}getExtensionRep(t){const n=this.extensionNameMap.get(t.name);if(n)return n.extension!==t&&Ie(295,t.name),n}addEdge(t,n,r){const o=this.outgoingConfigEdges.get(t);o?o.set(n,r):this.outgoingConfigEdges.set(t,new Map([[n,r]]));const i=this.incomingEdges.get(n);i?i.add(t):this.incomingEdges.set(n,new Set([t]))}addExtension(t){this._sortedExtensionReps!==void 0&&Ie(296);const n=$a(t),[r]=n;typeof r.name!="string"&&Ie(297,typeof r.name);let o=this.extensionNameMap.get(r.name);if(o!==void 0&&o.extension!==r&&Ie(298,r.name),!o){o=new uN(this,r),this.extensionNameMap.set(r.name,o);const i=this.conflicts.get(r.name);typeof i=="string"&&Ie(299,r.name,i);for(const s of r.conflictsWith||[])this.extensionNameMap.has(s)&&Ie(299,r.name,s),this.conflicts.set(s,r.name);for(const s of r.dependencies||[]){const a=$a(s);this.addEdge(r.name,a[0].name,a.slice(1)),this.addExtension(a)}for(const[s,a]of r.peerDependencies||[])this.addEdge(r.name,s,a?[a]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;const t=[],n=(r,o)=>{let i=r.state;if(mw(i))return;const s=r.extension.name;var a;fu(i)||Ie(300,s,o||"[unknown]"),fu(a=i)||Ie(304,String(a.id),String(qh)),i=Object.assign(a,{id:rf}),r.state=i;const l=this.outgoingConfigEdges.get(s);if(l)for(const c of l.keys()){const u=this.extensionNameMap.get(c);u&&n(u,s)}i=lN(i),r.state=i,t.push(r)};for(const r of this.extensionNameMap.values())fu(r.state)&&n(r);for(const r of t)for(const[o,i]of this.outgoingConfigEdges.get(r.extension.name)||[])if(i.length>0){const s=this.extensionNameMap.get(o);if(s)for(const a of i)s.configs.add(a)}for(const[r,...o]of this.roots)if(o.length>0){const i=this.extensionNameMap.get(r.name);i===void 0&&Ie(301,r.name);for(const s of o)i.configs.add(s)}return this._sortedExtensionReps=t,this._sortedExtensionReps}registerEditor(t){const n=this.sortedExtensionReps(),r=new AbortController,o=[()=>r.abort()],i=r.signal;for(const s of n){const a=s.register(t,i);a&&o.push(a)}for(const s of n){const a=s.afterRegistration(t);a&&o.push(a)}return Nn(...o)}buildCreateEditorArgs(){const t={},n=new Set,r=new Map,o=new Map,i={},s={},a=this.sortedExtensionReps();for(const u of a){const{extension:f}=u;if(f.onError!==void 0&&(t.onError=f.onError),f.disableEvents!==void 0&&(t.disableEvents=f.disableEvents),f.parentEditor!==void 0&&(t.parentEditor=f.parentEditor),f.editable!==void 0&&(t.editable=f.editable),f.namespace!==void 0&&(t.namespace=f.namespace),f.$initialEditorState!==void 0&&(t.$initialEditorState=f.$initialEditorState),f.nodes)for(const d of aN(f)){if(typeof d!="function"){const h=r.get(d.replace);h&&Ie(302,f.name,d.replace.name,h.extension.name),r.set(d.replace,u)}n.add(d)}if(f.html){if(f.html.export)for(const[d,h]of f.html.export.entries())o.set(d,h);f.html.import&&Object.assign(i,f.html.import)}f.theme&&gw(s,f.theme)}Object.keys(s).length>0&&(t.theme=s),n.size&&(t.nodes=[...n]);const l=Object.keys(i).length>0,c=o.size>0;(l||c)&&(t.html={},l&&(t.html.import=i),c&&(t.html.export=o));for(const u of a)u.init(t);return t.onError||(t.onError=hN),t}},Yh=class yw extends ia{static getType(){return"horizontalrule"}static clone(t){return new yw(t.__key)}static importJSON(t){return vw().updateFromJSON(t)}static importDOM(){return{hr:()=>({conversion:pN,priority:0})}}exportDOM(){return{element:document.createElement("hr")}}createDOM(t){const n=document.createElement("hr");return et(n,t.theme.hr),n}getTextContent(){return`
45
- `}isInline(){return!1}updateDOM(){return!1}};function pN(){return{node:vw()}}function vw(){return H1(Yh)}function mN(e){return e instanceof Yh}function Lr(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function of(e){let t=1,n=e.getParent();for(;n!=null;){if(ke(n)){const r=n.getParent();if(pe(r)){t++,n=r.getParent();continue}Lr(40)}return t}return t}function sf(e){let t=e.getParent();pe(t)||Lr(40);let n=t;for(;n!==null;)n=n.getParent(),pe(n)&&(t=n);return t}function xw(e){let t=[];const n=e.getChildren().filter(ke);for(let r=0;r<n.length;r++){const o=n[r],i=o.getFirstChild();pe(i)?t=t.concat(xw(i)):t.push(o)}return t}function jn(e){return ke(e)&&pe(e.getFirstChild())}function fy(e){return Zt().append(e)}function bw(e,t){return ke(e)&&(t.length===0||t.length===1&&e.is(t[0])&&e.getChildrenSize()===0)}function hy(e){const t=X();if(t!==null){let n=t.getNodes();if(W(t)){const o=t.getStartEndPoints();o===null&&Lr(143);const[i]=o,s=i.getNode(),a=s.getParent();if(vt(s)){const l=s.getFirstChild();if(l)n=l.selectStart().getNodes();else{const c=ve();s.append(c),n=c.select().getNodes()}}else if(bw(s,n)){const l=Ht(e);if(vt(a)){s.replace(l);const c=Zt();B(s)&&(c.setFormat(s.getFormatType()),c.setIndent(s.getIndent())),l.append(c)}else if(ke(s)){const c=s.getParentOrThrow();Io(l,c.getChildren()),c.replace(l)}return}}const r=new Set;for(let o=0;o<n.length;o++){const i=n[o];if(B(i)&&i.isEmpty()&&!ke(i)&&!r.has(i.getKey())){gy(i,e);continue}let s=M1(i)?i.getParent():ke(i)&&i.isEmpty()?i:null;for(;s!=null;){const a=s.getKey();if(pe(s)){if(!r.has(a)){const l=Ht(e);Io(l,s.getChildren()),s.replace(l),r.add(a)}break}{const l=s.getParent();if(vt(l)&&!r.has(a)){r.add(a),gy(s,e);break}s=l}}}}}function Io(e,t){e.splice(e.getChildrenSize(),0,t)}function gy(e,t){if(pe(e))return e;const n=e.getPreviousSibling(),r=e.getNextSibling(),o=Zt();let i;if(Io(o,e.getChildren()),pe(n)&&t===n.getListType())n.append(o),pe(r)&&t===r.getListType()&&(Io(n,r.getChildren()),r.remove()),i=n;else if(pe(r)&&t===r.getListType())r.getFirstChildOrThrow().insertBefore(o),i=r;else{const s=Ht(t);s.append(o),e.replace(s),i=s}return o.setFormat(e.getFormatType()),o.setIndent(e.getIndent()),e.remove(),i}function Xh(e,t){const n=e.getLastChild(),r=t.getFirstChild();n&&r&&jn(n)&&jn(r)&&(Xh(n.getFirstChild(),r.getFirstChild()),r.remove());const o=t.getChildren();o.length>0&&e.append(...o),t.remove()}function yN(){const e=X();if(W(e)){const t=new Set,n=e.getNodes(),r=e.anchor.getNode();if(bw(r,n))t.add(sf(r));else for(let o=0;o<n.length;o++){const i=n[o];if(M1(i)){const s=ZA(i,eo);s!=null&&t.add(sf(s))}}for(const o of t){let i=o;const s=xw(o);for(const a of s){const l=ve().setTextStyle(e.style).setTextFormat(e.format);Io(l,a.getChildren()),i.insertAfter(l),i=l,a.__key===e.anchor.key&&Sn(e.anchor,Lt(Ft(l,"next"))),a.__key===e.focus.key&&Sn(e.focus,Lt(Ft(l,"next"))),a.remove()}o.remove()}}}function ww(e){const t=e.getListType()!=="check";let n=e.getStart();for(const r of e.getChildren())ke(r)&&(r.getValue()!==n&&r.setValue(n),t&&r.getLatest().__checked!=null&&r.setChecked(void 0),pe(r.getFirstChild())||n++)}function vN(e){const t=new Set;if(jn(e)||t.has(e.getKey()))return;const n=e.getParent(),r=e.getNextSibling(),o=e.getPreviousSibling();if(jn(r)&&jn(o)){const i=o.getFirstChild();if(pe(i)){i.append(e);const s=r.getFirstChild();pe(s)&&(Io(i,s.getChildren()),r.remove(),t.add(r.getKey()))}}else if(jn(r)){const i=r.getFirstChild();if(pe(i)){const s=i.getFirstChild();s!==null&&s.insertBefore(e)}}else if(jn(o)){const i=o.getFirstChild();pe(i)&&i.append(e)}else if(pe(n)){const i=Zt().setTextFormat(e.getTextFormat()).setTextStyle(e.getTextStyle()),s=Ht(n.getListType()).setTextFormat(n.getTextFormat()).setTextStyle(n.getTextStyle());i.append(s),s.append(e),o?o.insertAfter(i):r?r.insertBefore(i):n.append(i)}}function xN(e){if(jn(e))return;const t=e.getParent(),n=t?t.getParent():void 0;if(pe(n?n.getParent():void 0)&&ke(n)&&pe(t)){const r=t?t.getFirstChild():void 0,o=t?t.getLastChild():void 0;if(e.is(r))n.insertBefore(e),t.isEmpty()&&n.remove();else if(e.is(o))n.insertAfter(e),t.isEmpty()&&n.remove();else{const i=t.getListType(),s=Zt(),a=Ht(i);s.append(a),e.getPreviousSiblings().forEach(u=>a.append(u));const l=Zt(),c=Ht(i);l.append(c),Io(c,e.getNextSiblings()),n.insertBefore(s),n.insertAfter(l),n.replace(e)}}}function bN(){const e=X();if(!W(e)||!e.isCollapsed())return!1;const t=e.anchor.getNode();if(!ke(t)||t.getChildrenSize()!==0)return!1;const n=sf(t),r=t.getParent();pe(r)||Lr(40);const o=r.getParent();let i;if(vt(o))i=ve(),n.insertAfter(i);else{if(!ke(o))return!1;i=Zt(),o.insertAfter(i)}i.setTextStyle(e.style).setTextFormat(e.format).select();const s=t.getNextSiblings();if(s.length>0){const a=Ht(r.getListType());if(ke(i)){const l=Zt();l.append(a),i.insertAfter(l)}else i.insertAfter(a);a.append(...s)}return(function(a){let l=a;for(;l.getNextSibling()==null&&l.getPreviousSibling()==null;){const c=l.getParent();if(c==null||!ke(c)&&!pe(c))break;l=c}l.remove()})(t),!0}function Fl(...e){const t=[];for(const n of e)if(n&&typeof n=="string")for(const[r]of n.matchAll(/\S+/g))t.push(r);return t}let eo=class extends Tt{__value;__checked;$config(){return this.config("listitem",{$transform:t=>{if(t.__checked==null)return;const n=t.getParent();pe(n)&&n.getListType()!=="check"&&t.getChecked()!=null&&t.setChecked(void 0)},extends:Tt,importDOM:{li:()=>({conversion:wN,priority:0})}})}constructor(t=1,n=void 0,r){super(r),this.__value=t===void 0?1:t,this.__checked=n}afterCloneFrom(t){super.afterCloneFrom(t),this.__value=t.__value,this.__checked=t.__checked}createDOM(t){const n=document.createElement("li");return this.updateListItemDOM(null,n,t),n}updateListItemDOM(t,n,r){(function(s,a,l){const c=a.getParent();!pe(c)||c.getListType()!=="check"||pe(a.getFirstChild())?(s.removeAttribute("role"),s.removeAttribute("tabIndex"),s.removeAttribute("aria-checked")):(s.setAttribute("role","checkbox"),s.setAttribute("tabIndex","-1"),l&&a.__checked===l.__checked||s.setAttribute("aria-checked",a.getChecked()?"true":"false"))})(n,this,t),n.value=this.__value,(function(s,a,l){const c=[],u=[],f=a.list,d=f?f.listitem:void 0;let h;if(f&&f.nested&&(h=f.nested.listitem),d!==void 0&&c.push(...Fl(d)),f){const g=l.getParent(),p=pe(g)&&g.getListType()==="check",m=l.getChecked();p&&!m||u.push(f.listitemUnchecked),p&&m||u.push(f.listitemChecked),p&&c.push(m?f.listitemChecked:f.listitemUnchecked)}if(h!==void 0){const g=Fl(h);l.getChildren().some(p=>pe(p))?c.push(...g):u.push(...g)}u.length>0&&Yn(s,...u),c.length>0&&et(s,...c)})(n,r.theme,this);const o=t?t.__style:"",i=this.__style;o!==i&&(i===""?n.removeAttribute("style"):n.style.cssText=i),(function(s,a,l){const c=ny(a.__textStyle);for(const u in c)s.style.setProperty(`--listitem-marker-${u}`,c[u]);if(l)for(const u in ny(l.__textStyle))u in c||s.style.removeProperty(`--listitem-marker-${u}`)})(n,this,t)}updateDOM(t,n,r){const o=n;return this.updateListItemDOM(t,o,r),!1}updateFromJSON(t){return super.updateFromJSON(t).setValue(t.value).setChecked(t.checked)}exportDOM(t){const n=this.createDOM(t._config),r=this.getFormatType();r&&(n.style.textAlign=r);const o=this.getDirection();return o&&(n.dir=o),{element:n}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...t){for(let n=0;n<t.length;n++){const r=t[n];if(B(r)&&this.canMergeWith(r)){const o=r.getChildren();this.append(...o),r.remove()}else super.append(r)}return this}replace(t,n){if(ke(t))return super.replace(t);this.setIndent(0);const r=this.getParentOrThrow();if(!pe(r))return t;if(r.__first===this.getKey())r.insertBefore(t);else if(r.__last===this.getKey())r.insertAfter(t);else{const o=Ht(r.getListType());let i=this.getNextSibling();for(;i;){const s=i;i=i.getNextSibling(),o.append(s)}r.insertAfter(t),t.insertAfter(o)}return n&&(B(t)||Lr(139),this.getChildren().forEach(o=>{t.append(o)})),this.remove(),r.getChildrenSize()===0&&r.remove(),t}insertAfter(t,n=!0){const r=this.getParentOrThrow();if(pe(r)||Lr(39),ke(t))return super.insertAfter(t,n);const o=this.getNextSiblings();if(r.insertAfter(t,n),o.length!==0){const i=Ht(r.getListType());o.forEach(s=>i.append(s)),t.insertAfter(i,n)}return t}remove(t){const n=this.getPreviousSibling(),r=this.getNextSibling();super.remove(t),n&&r&&jn(n)&&jn(r)&&(Xh(n.getFirstChild(),r.getFirstChild()),r.remove())}insertNewAfter(t,n=!0){const r=Zt().updateFromJSON(this.exportJSON()).setChecked(!this.getChecked()&&void 0);return this.insertAfter(r,n),r}collapseAtStart(t){const n=ve();this.getChildren().forEach(s=>n.append(s));const r=this.getParentOrThrow(),o=r.getParentOrThrow(),i=ke(o);if(r.getChildrenSize()===1)if(i)r.remove(),o.select();else{r.insertBefore(n),r.remove();const s=t.anchor,a=t.focus,l=n.getKey();s.type==="element"&&s.getNode().is(this)&&s.set(l,s.offset,"element"),a.type==="element"&&a.getNode().is(this)&&a.set(l,a.offset,"element")}else r.insertBefore(n),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(t){const n=this.getWritable();return n.__value=t,n}getChecked(){const t=this.getLatest();let n;const r=this.getParent();return pe(r)&&(n=r.getListType()),n==="check"?!!t.__checked:void 0}setChecked(t){const n=this.getWritable();return n.__checked=t,n}toggleChecked(){const t=this.getWritable();return t.setChecked(!t.__checked)}getIndent(){const t=this.getParent();if(t===null||!this.isAttached())return this.getLatest().__indent;let n=t.getParentOrThrow(),r=0;for(;ke(n);)n=n.getParentOrThrow().getParentOrThrow(),r++;return r}setIndent(t){typeof t!="number"&&Lr(117),(t=Math.floor(t))>=0||Lr(199);let n=this.getIndent();for(;n!==t;)n<t?(vN(this),n++):(xN(this),n--);return this}canInsertAfter(t){return ke(t)}canReplaceWith(t){return ke(t)}canMergeWith(t){return ke(t)||Qr(t)}extractWithChild(t,n){if(!W(n))return!1;const r=n.anchor.getNode(),o=n.focus.getNode();return this.isParentOf(r)&&this.isParentOf(o)&&this.getTextContent().length===n.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return Ht("bullet")}canMergeWhenEmpty(){return!0}};function wN(e){if(e.classList.contains("task-list-item")){for(const n of e.children)if(n.tagName==="INPUT")return py(n)}if(e.classList.contains("joplin-checkbox")){for(const n of e.children)if(n.classList.contains("checkbox-wrapper")&&n.children.length>0&&n.children[0].tagName==="INPUT")return py(n.children[0])}const t=e.getAttribute("aria-checked");return{node:Zt(t==="true"||t!=="false"&&void 0)}}function py(e){return e.getAttribute("type")!=="checkbox"?{node:null}:{node:Zt(e.hasAttribute("checked"))}}function Zt(e){return Et(new eo(void 0,e))}function ke(e){return e instanceof eo}let Uo=class extends Tt{__tag;__start;__listType;$config(){return this.config("list",{$transform:t=>{(function(n){const r=n.getNextSibling();pe(r)&&n.getListType()===r.getListType()&&Xh(n,r)})(t),ww(t)},extends:Tt,importDOM:{ol:()=>({conversion:yy,priority:0}),ul:()=>({conversion:yy,priority:0})}})}constructor(t="number",n=1,r){super(r);const o=SN[t]||t;this.__listType=o,this.__tag=o==="number"?"ol":"ul",this.__start=n}afterCloneFrom(t){super.afterCloneFrom(t),this.__listType=t.__listType,this.__tag=t.__tag,this.__start=t.__start}getTag(){return this.getLatest().__tag}setListType(t){const n=this.getWritable();return n.__listType=t,n.__tag=t==="number"?"ol":"ul",n}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(t){const n=this.getWritable();return n.__start=t,n}createDOM(t,n){const r=this.__tag,o=document.createElement(r);return this.__start!==1&&o.setAttribute("start",String(this.__start)),o.__lexicalListType=this.__listType,my(o,t.theme,this),o}updateDOM(t,n,r){return t.__tag!==this.__tag||t.__listType!==this.__listType||(my(n,r.theme,this),!1)}updateFromJSON(t){return super.updateFromJSON(t).setListType(t.listType).setStart(t.start)}exportDOM(t){const n=this.createDOM(t._config,t);return Be(n)&&(this.__start!==1&&n.setAttribute("start",String(this.__start)),this.__listType==="check"&&n.setAttribute("__lexicalListType","check")),{element:n}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}splice(t,n,r){let o=r;for(let i=0;i<r.length;i++){const s=r[i];ke(s)||(o===r&&(o=[...r]),o[i]=Zt().append(!B(s)||pe(s)||s.isInline()?s:Fe(s.getTextContent())))}return super.splice(t,n,o)}extractWithChild(t){return ke(t)}};function my(e,t,n){const r=[],o=[],i=t.list;if(i!==void 0){const s=i[`${n.__tag}Depth`]||[],a=of(n)-1,l=a%s.length,c=s[l],u=i[n.__tag];let f;const d=i.nested,h=i.checklist;if(d!==void 0&&d.list&&(f=d.list),u!==void 0&&r.push(u),h!==void 0&&n.__listType==="check"&&r.push(h),c!==void 0){r.push(...Fl(c));for(let g=0;g<s.length;g++)g!==l&&o.push(n.__tag+g)}if(f!==void 0){const g=Fl(f);a>1?r.push(...g):o.push(...g)}}o.length>0&&Yn(e,...o),r.length>0&&et(e,...r)}function CN(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n];if(ke(r)){t.push(r);const o=r.getChildren();o.length>1&&o.forEach(i=>{pe(i)&&t.push(fy(i))})}else t.push(fy(r))}return t}function yy(e){const t=e.nodeName.toLowerCase();let n=null;return t==="ol"?n=Ht("number",e.start):t==="ul"&&(n=(function(r){if(r.getAttribute("__lexicallisttype")==="check"||r.classList.contains("contains-task-list")||r.getAttribute("data-is-checklist")==="1")return!0;for(const o of r.childNodes)if(Be(o)&&o.hasAttribute("aria-checked"))return!0;return!1})(e)?Ht("check"):Ht("bullet")),{after:CN,node:n}}const SN={ol:"number",ul:"bullet"};function Ht(e="number",t=1){return Et(new Uo(e,t))}function pe(e){return e instanceof Uo}const _N=ce("UPDATE_LIST_START_COMMAND"),Cw=ce("INSERT_UNORDERED_LIST_COMMAND"),Sw=ce("INSERT_ORDERED_LIST_COMMAND"),TN=ce("REMOVE_LIST_COMMAND");function EN(e){return Nn(e.registerCommand(Sw,()=>(hy("number"),!0),ur),e.registerCommand(_N,t=>{const{listNodeKey:n,newStart:r}=t,o=Pe(n);return!!pe(o)&&(o.getListType()==="number"&&(o.setStart(r),ww(o)),!0)},ur),e.registerCommand(Cw,()=>(hy("bullet"),!0),ur),e.registerCommand(TN,()=>(yN(),!0),ur),e.registerCommand(Mo,()=>bN(),ur),e.registerNodeTransform(eo,t=>{const n=t.getFirstChild();if(n){if(J(n)){const r=n.getStyle(),o=n.getFormat();t.getTextStyle()!==r&&t.setTextStyle(r),t.getTextFormat()!==o&&t.setTextFormat(o)}}else{const r=X();W(r)&&(r.style!==t.getTextStyle()||r.format!==t.getTextFormat())&&r.isCollapsed()&&t.is(r.anchor.getNode())&&t.setTextStyle(r.style).setTextFormat(r.format)}}),e.registerNodeTransform(fn,t=>{const n=t.getParent();if(ke(n)&&t.is(n.getFirstChild())){const r=t.getStyle(),o=t.getFormat();r===n.getTextStyle()&&o===n.getTextFormat()||n.setTextStyle(r).setTextFormat(o)}}))}function RN(e){const t=n=>{const r=n.getParent();if(pe(n.getFirstChild())||!pe(r))return;const o=we(n,i=>ke(i)&&pe(i.getParent())&&ke(i.getPreviousSibling()));if(o===null&&n.getIndent()>0)n.setIndent(0);else if(ke(o)){const i=o.getPreviousSibling();if(ke(i)){const s=(function(l){let c=l,u=c.getFirstChild();for(;pe(u);){const f=u.getLastChild();if(!ke(f))break;c=f,u=c.getFirstChild()}return c})(i),a=s.getParent();if(pe(a)){const l=of(a);l+1<of(r)&&n.setIndent(l)}}}};return e.registerNodeTransform(Uo,n=>{const r=[n];for(;r.length>0;){const o=r.shift();if(pe(o)){for(const i of o.getChildren())if(ke(i)){t(i);const s=i.getFirstChild();pe(s)&&r.push(s)}}}})}function kN(e,t){const n=N1(t)?t.body.childNodes:t.childNodes;let r=[];const o=[];for(const i of n)if(!Tw.has(i.nodeName)){const s=Ew(i,e,o,!1);s!==null&&(r=r.concat(s))}return(function(i){for(const s of i)s.getNextSibling()instanceof Nh&&s.insertAfter(kn());for(const s of i){const a=s.getChildren();for(const l of a)s.insertBefore(l);s.remove()}})(o),r}function AN(e,t){if(typeof document>"u"||typeof window>"u"&&global.window===void 0)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const n=document.createElement("div"),r=qe().getChildren();for(let o=0;o<r.length;o++)_w(e,r[o],n,t);return n.innerHTML}function _w(e,t,n,r=null){let o=r===null||t.isSelected(r);const i=B(t)&&t.excludeFromCopy("html");let s=t;r!==null&&J(t)&&(s=J1(r,t,"clone"));const a=B(s)?s.getChildren():[],l=Ph(e,s.getType());let c;c=l&&l.exportDOM!==void 0?l.exportDOM(e,s):s.exportDOM(e);const{element:u,after:f}=c;if(!u)return!1;const d=document.createDocumentFragment();for(let h=0;h<a.length;h++){const g=a[h],p=_w(e,g,d,r);!o&&B(t)&&p&&t.extractWithChild(g,r,"html")&&(o=!0)}if(o&&!i){if((Be(u)||Qd(u))&&u.append(d),n.append(u),f){const h=f.call(s,u);h&&(Qd(u)?u.replaceChildren(h):u.replaceWith(h))}}else n.append(d);return o}const Tw=new Set(["STYLE","SCRIPT"]);function Ew(e,t,n,r,o=new Map,i){let s=[];if(Tw.has(e.nodeName))return s;let a=null;const l=(function(g,p){const{nodeName:m}=g,v=p._htmlConversions.get(m.toLowerCase());let y=null;if(v!==void 0)for(const x of v){const b=x(g);b!==null&&(y===null||(y.priority||0)<=(b.priority||0))&&(y=b)}return y!==null?y.conversion:null})(e,t),c=l?l(e):null;let u=null;if(c!==null){u=c.after;const g=c.node;if(a=Array.isArray(g)?g[g.length-1]:g,a!==null){for(const[,p]of o)if(a=p(a,i),!a)break;a&&s.push(...Array.isArray(g)?g:[a])}c.forChild!=null&&o.set(e.nodeName,c.forChild)}const f=e.childNodes;let d=[];const h=(a==null||!vt(a))&&(a!=null&&qd(a)||r);for(let g=0;g<f.length;g++)d.push(...Ew(f[g],t,n,h,new Map(o),a));return u!=null&&(d=u(d)),Ll(e)&&(d=NN(e,d,h?()=>{const g=new Nh;return n.push(g),g}:ve)),a==null?d.length>0?s=s.concat(d):Ll(e)&&(function(g){return g.nextSibling==null||g.previousSibling==null?!1:ef(g.nextSibling)&&ef(g.previousSibling)})(e)&&(s=s.concat(kn())):B(a)&&a.append(...d),s}function NN(e,t,n){const r=e.style.textAlign,o=[];let i=[];for(let s=0;s<t.length;s++){const a=t[s];if(qd(a))r&&!a.getFormat()&&a.setFormat(r),o.push(a);else if(i.push(a),s===t.length-1||s<t.length-1&&qd(t[s+1])){const l=n();l.setFormat(r),l.append(...i),o.push(l),i=[]}}return o}function $l(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function MN(e,t=X()){return t==null&&$l(166),W(t)&&t.isCollapsed()||t.getNodes().length===0?"":AN(e,t)}function PN(e,t=X()){return t==null&&$l(166),W(t)&&t.isCollapsed()||t.getNodes().length===0?null:JSON.stringify(LN(e,t))}function vy(e,t,n){const r=e.getData("application/x-lexical-editor");if(r)try{const a=JSON.parse(r);if(a.namespace===n._config.namespace&&Array.isArray(a.nodes))return xy(n,FN(a.nodes),t)}catch(a){console.error(a)}const o=e.getData("text/html"),i=e.getData("text/plain");if(o&&i!==o)try{const a=new DOMParser().parseFromString((function(l){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:c=>c}).createHTML(l):l})(o),"text/html");return xy(n,kN(n,a),t)}catch(a){console.error(a)}const s=i||e.getData("text/uri-list");if(s!=null)if(W(t)){const a=s.split(/(\r?\n|\t)/);a[a.length-1]===""&&a.pop();for(let l=0;l<a.length;l++){const c=X();if(W(c)){const u=a[l];u===`
44
+ `?r.push(kn()):s===" "?r.push(Zi()):r.push(Fe(s))}this.insertNodes(r)}insertText(t){const n=this.anchor,r=this.focus,o=this.format,i=this.style;let s=n,a=r;!this.isCollapsed()&&r.isBefore(n)&&(s=r,a=n),s.type==="element"&&(function(m,v,y,x){const b=m.getNode(),w=b.getChildAtIndex(m.offset),_=Fe();if(_.setFormat(y),_.setStyle(x),Qr(w))w.splice(0,0,[_]);else{const E=at(b)?ye().append(_):_;w===null?b.append(E):w.insertBefore(E)}m.is(v)&&v.set(_.__key,0,"text"),m.set(_.__key,0,"text")})(s,a,o,i),a.type==="element"&&Sn(a,Lt(An(a,"next")));const l=s.offset;let c=a.offset;const u=this.getNodes(),f=u.length;let d=u[0];J(d)||X(26);const h=d.getTextContent().length,g=d.getParentOrThrow();let p=u[f-1];if(f===1&&a.type==="element"&&(c=h,a.set(s.key,c,"text")),this.isCollapsed()&&l===h&&(sr(d)||!d.canInsertTextAfter()||!g.canInsertTextAfter()&&d.getNextSibling()===null)){let m=d.getNextSibling();if(J(m)&&m.canInsertTextBefore()&&!sr(m)||(m=Fe(),m.setFormat(o),m.setStyle(i),g.canInsertTextAfter()?d.insertAfter(m):g.insertAfter(m)),m.select(0,0),d=m,t!=="")return void this.insertText(t)}else if(this.isCollapsed()&&l===0&&(sr(d)||!d.canInsertTextBefore()||!g.canInsertTextBefore()&&d.getPreviousSibling()===null)){let m=d.getPreviousSibling();if(J(m)&&!sr(m)||(m=Fe(),m.setFormat(o),g.canInsertTextBefore()?d.insertBefore(m):g.insertBefore(m)),m.select(),d=m,t!=="")return void this.insertText(t)}else if(d.isSegmented()&&l!==h){const m=Fe(d.getTextContent());m.setFormat(o),d.replace(m),d=m}else if(!this.isCollapsed()&&t!==""){const m=p.getParent();if(!g.canInsertTextBefore()||!g.canInsertTextAfter()||B(m)&&(!m.canInsertTextBefore()||!m.canInsertTextAfter()))return this.insertText(""),$b(this.anchor,this.focus,null),void this.insertText(t)}if(f===1){if(Eo(d)){const x=Fe(t);return x.select(),void d.replace(x)}const m=d.getFormat(),v=d.getStyle();if(l!==c||m===o&&v===i){if(cc(d)){const x=Fe(t);return x.setFormat(o),x.setStyle(i),x.select(),void d.replace(x)}}else{if(d.getTextContent()!==""){const x=Fe(t);if(x.setFormat(o),x.setStyle(i),x.select(),l===0)d.insertBefore(x,!1);else{const[b]=d.splitText(l);b.insertAfter(x,!1)}return void(x.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=t.length))}d.setFormat(o),d.setStyle(i)}const y=c-l;d=d.spliceText(l,y,t,!0),d.getTextContent()===""?d.remove():this.anchor.type==="text"&&(d.isComposing()?this.anchor.offset-=t.length:(this.format=m,this.style=v))}else{const m=new Set([...d.getParentKeys(),...p.getParentKeys()]),v=B(d)?d:d.getParentOrThrow();let y=B(p)?p:p.getParentOrThrow(),x=p;if(!v.is(y)&&y.isInline())do x=y,y=y.getParentOrThrow();while(y.isInline());if(a.type==="text"&&(c!==0||p.getTextContent()==="")||a.type==="element"&&p.getIndexWithinParent()<c)if(J(p)&&!Eo(p)&&c!==p.getTextContentSize()){if(p.isSegmented()){const R=Fe(p.getTextContent());p.replace(R),p=R}at(a.getNode())||a.type!=="text"||(p=p.spliceText(0,c,"")),m.add(p.__key)}else{const R=p.getParentOrThrow();R.canBeEmpty()||R.getChildrenSize()!==1?p.remove():R.remove()}else m.add(p.__key);const b=y.getChildren(),w=new Set(u),_=v.is(y),E=v.isInline()&&d.getNextSibling()===null?v:d;for(let R=b.length-1;R>=0;R--){const k=b[R];if(k.is(d)||B(k)&&k.isParentOf(d))break;k.isAttached()&&(!w.has(k)||k.is(x)?_||E.insertAfter(k,!1):k.remove())}if(!_){let R=y,k=null;for(;R!==null;){const P=R.getChildren(),F=P.length;(F===0||P[F-1].is(k))&&(m.delete(R.__key),k=R),R=R.getParent()}}if(Eo(d))if(l===h)d.select();else{const R=Fe(t);R.select(),d.replace(R)}else d=d.spliceText(l,h-l,t,!0),d.getTextContent()===""?d.remove():d.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=t.length);for(let R=1;R<f;R++){const k=u[R],P=k.__key;m.has(P)||k.remove()}}}removeText(){const t=Z()===this;ll(this,xM(xy(this))),t&&Z()!==this&&Ge(this)}formatText(t,n=null){if(this.isCollapsed())return this.toggleFormat(t),void yt(null);const r=this.getNodes(),o=[];for(const b of r)J(b)&&o.push(b);const i=b=>{r.forEach(w=>{if(B(w)){const _=w.getFormatFlags(t,b);w.setTextFormat(_)}})},s=o.length;if(s===0)return this.toggleFormat(t),yt(null),void i(n);const a=this.anchor,l=this.focus,c=this.isBackward(),u=c?l:a,f=c?a:l;let d=0,h=o[0],g=u.type==="element"?0:u.offset;if(u.type==="text"&&g===h.getTextContentSize()&&(d=1,h=o[1],g=0),h==null)return;const p=h.getFormatFlags(t,n);i(p);const m=s-1;let v=o[m];const y=f.type==="text"?f.offset:v.getTextContentSize();if(h.is(v)){if(g===y)return;if(sr(h)||g===0&&y===h.getTextContentSize())h.setFormat(p);else{const b=h.splitText(g,y),w=g===0?b[0]:b[1];w.setFormat(p),u.type==="text"&&u.set(w.__key,0,"text"),f.type==="text"&&f.set(w.__key,y-g,"text")}return void(this.format=p)}g===0||sr(h)||([,h]=h.splitText(g),g=0),h.setFormat(p);const x=v.getFormatFlags(t,p);y>0&&(y===v.getTextContentSize()||sr(v)||([v]=v.splitText(y)),v.setFormat(x));for(let b=d+1;b<m;b++){const w=o[b],_=w.getFormatFlags(t,x);w.setFormat(_)}u.type==="text"&&u.set(h.__key,g,"text"),f.type==="text"&&f.set(v.__key,y,"text"),this.format=p|x}insertNodes(t){if(t.length===0)return;if(this.isCollapsed()||this.removeText(),this.anchor.key==="root"){this.insertParagraph();const g=Z();return W(g)||X(134),g.insertNodes(t)}const n=(this.isBackward()?this.focus:this.anchor).getNode(),r=we(n,Nr),o=t[t.length-1];if(B(r)&&"__language"in r){if("__language"in t[0])this.insertText(t[0].getTextContent());else{const g=hu(this);r.splice(g,0,t),o.selectEnd()}return}if(!t.some(g=>(B(g)||Te(g))&&!g.isInline())){B(r)||X(211,n.constructor.name,n.getType());const g=hu(this);return r.splice(g,0,t),void o.selectEnd()}const i=(function(g){const p=ye();let m=null;for(let v=0;v<g.length;v++){const y=g[v],x=Un(y);if(x||Te(y)&&y.isInline()||B(y)&&y.isInline()||J(y)||y.isParentRequired()){if(m===null&&(m=y.createParentElementNode(),p.append(m),x))continue;m!==null&&m.append(y)}else p.append(y),m=null}return p})(t),s=i.getLastDescendant(),a=i.getChildren(),l=!B(r)||!r.isEmpty()?this.insertParagraph():null,c=a[a.length-1];let u=a[0];var f;B(f=u)&&Nr(f)&&!f.isEmpty()&&B(r)&&(!r.isEmpty()||r.canMergeWhenEmpty())&&(B(r)||X(211,n.constructor.name,n.getType()),r.append(...u.getChildren()),u=a[1]),u&&(r===null&&X(212,n.constructor.name,n.getType()),(function(g,p){const m=p.getParentOrThrow().getLastChild();let v=p;const y=[p];for(;v!==m;)v.getNextSibling()||X(140),v=v.getNextSibling(),y.push(v);let x=g;for(const b of y)x=x.insertAfter(b)})(r,u));const d=we(s,Nr);l&&B(d)&&(l.canMergeWhenEmpty()||Nr(c))&&(d.append(...l.getChildren()),l.remove()),B(r)&&r.isEmpty()&&r.remove(),s.selectEnd();const h=B(r)?r.getLastChild():null;Un(h)&&d!==r&&h.remove()}insertParagraph(){if(this.anchor.key==="root"){const s=ye();return qe().splice(this.anchor.offset,0,[s]),s.select(),s}const t=hu(this),n=we(this.anchor.getNode(),Nr);B(n)||X(213);const r=n.getChildAtIndex(t),o=r?[r,...r.getNextSiblings()]:[],i=n.insertNewAfter(this,!1);return i?(i.append(...o),i.selectStart(),i):null}insertLineBreak(t){const n=kn();if(this.insertNodes([n]),t){const r=n.getParentOrThrow(),o=n.getIndexWithinParent();r.select(o,o)}}extract(){const t=[...this.getNodes()],n=t.length;let r=t[0],o=t[n-1];const[i,s]=Qd(this),a=this.isBackward(),[l,c]=a?[this.focus,this.anchor]:[this.anchor,this.focus],[u,f]=a?[s,i]:[i,s];if(n===0)return[];if(n===1){if(J(r)&&!this.isCollapsed()){const d=r.splitText(u,f),h=u===0?d[0]:d[1];return h?(l.set(h.getKey(),0,"text"),c.set(h.getKey(),h.getTextContentSize(),"text"),[h]):[]}return[r]}if(J(r)&&(u===r.getTextContentSize()?t.shift():u!==0&&([,r]=r.splitText(u),t[0]=r,l.set(r.getKey(),0,"text"))),J(o)){const d=o.getTextContent().length;f===0?t.pop():f!==d&&([o]=o.splitText(f),t[t.length-1]=o,c.set(o.getKey(),o.getTextContentSize(),"text"))}return t}modify(t,n,r){if(ty(this,t,n,r))return;const o=t==="move",i=$e(),s=Ot(hn(i));if(!s)return;const a=i._blockCursorElement,l=i._rootElement,c=this.focus.getNode();if(l===null||a===null||!B(c)||c.isInline()||c.canBeEmpty()||of(a,i,l),this.dirty){let u=Fo(i,this.anchor.key),f=Fo(i,this.focus.key);this.anchor.type==="text"&&(u=Di(u)),this.focus.type==="text"&&(f=Di(f)),u&&f&&Db(s,u,this.anchor.offset,f,this.focus.offset)}if((function(u,f,d,h){u.modify(f,d,h)})(s,t,n?"backward":"forward",r),s.rangeCount>0){const u=s.getRangeAt(0),f=this.anchor.getNode(),d=at(f)?f:oM(f);if(this.applyDOMRange(u),this.dirty=!0,!o){const h=this.getNodes(),g=[];let p=!1;for(let m=0;m<h.length;m++){const v=h[m];rf(v,d)?g.push(v):p=!0}if(p&&g.length>0)if(n){const m=g[0];B(m)?m.selectStart():m.getParentOrThrow().selectStart()}else{const m=g[g.length-1];B(m)?m.selectEnd():m.getParentOrThrow().selectEnd()}s.anchorNode===u.startContainer&&s.anchorOffset===u.startOffset||(function(m){const v=m.focus,y=m.anchor,x=y.key,b=y.offset,w=y.type;y.set(v.key,v.offset,v.type,!0),v.set(x,b,w,!0)})(this)}}r==="lineboundary"&&ty(this,t,n,r,"decorators")}forwardDeletion(t,n,r){if(!r&&(t.type==="element"&&B(n)&&t.offset===n.getChildrenSize()||t.type==="text"&&t.offset===n.getTextContentSize())){const o=n.getParent(),i=n.getNextSibling()||(o===null?null:o.getNextSibling());if(B(i)&&i.isShadowRoot())return!0}return!1}deleteCharacter(t){const n=this.isCollapsed();if(this.isCollapsed()){const r=this.anchor;let o=r.getNode();if(this.forwardDeletion(r,o,t))return;const i=qs(An(r,t?"previous":"next"));if(i.getTextSlices().every(a=>a===null||a.distance===0)){let a={type:"initial"};for(const l of i.iterNodeCarets("shadowRoot"))if(Ht(l)){if(!l.origin.isInline()){if(l.origin.isShadowRoot()){if(a.type==="merge-block")break;if(B(i.anchor.origin)&&i.anchor.origin.isEmpty()){const c=Lt(l);ll(this,Gr(c,c)),i.anchor.origin.remove()}return}a.type!=="merge-next-block"&&a.type!=="merge-block"||(a={block:a.block,caret:l,type:"merge-block"})}}else{if(a.type==="merge-block")break;if(Ur(l)){if(B(l.origin)){if(l.origin.isInline()){if(!l.origin.isParentOf(i.anchor.origin))break}else a={block:l.origin,type:"merge-next-block"};continue}if(Te(l.origin)){if(!l.origin.isIsolated())if(a.type==="merge-next-block"&&(l.origin.isKeyboardSelectable()||!l.origin.isInline())&&B(i.anchor.origin)&&i.anchor.origin.isEmpty()){i.anchor.origin.remove();const c=Vh();c.add(l.origin.getKey()),Ge(c)}else l.origin.remove();return}break}}if(a.type==="merge-block"){const{caret:l,block:c}=a;return ll(this,Gr(!l.origin.isEmpty()&&c.isEmpty()?da(nt(c,l.direction)):i.anchor,l)),this.removeText()}}const s=this.focus;if(this.modify("extend",t,"character"),this.isCollapsed()){if(t&&r.offset===0&&Ym(this,r.getNode()))return}else{const a=s.type==="text"?s.getNode():null;if(o=r.type==="text"?r.getNode():null,a!==null&&a.isSegmented()){const l=s.offset,c=a.getTextContentSize();if(a.is(o)||t&&l!==c||!t&&l!==0)return void Xm(a,t,l)}else if(o!==null&&o.isSegmented()){const l=r.offset,c=o.getTextContentSize();if(o.is(a)||t&&l!==0||!t&&l!==c)return void Xm(o,t,l)}(function(l,c){const u=l.anchor,f=l.focus,d=u.getNode(),h=f.getNode();if(d===h&&u.type==="text"&&f.type==="text"){const g=u.offset,p=f.offset,m=g<p,v=m?g:p,y=m?p:g,x=y-1;v!==x&&(function(b){return!(tw(b)||BN(b))})(d.getTextContent().slice(v,y))&&(c?f.set(f.key,x,f.type):u.set(u.key,x,u.type))}})(this,t)}}if(this.removeText(),t&&!n&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const r=this.anchor.getNode();r.isEmpty()&&at(r.getParent())&&r.getPreviousSibling()===null&&Ym(this,r)}}deleteLine(t){this.isCollapsed()&&this.modify("extend",t,"lineboundary"),this.isCollapsed()?this.deleteCharacter(t):this.removeText()}deleteWord(t){if(this.isCollapsed()){const n=this.anchor,r=n.getNode();if(this.forwardDeletion(n,r,t))return;this.modify("extend",t,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function Ct(e){return e instanceof uc}function qm(e){const t=e.offset;if(e.type==="text")return t;const n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function Qd(e){const t=e.getStartEndPoints();if(t===null)return[0,0];const[n,r]=t;return n.type==="element"&&r.type==="element"&&n.key===r.key&&n.offset===r.offset?[0,0]:[qm(n),qm(r)]}function Ym(e,t){for(let n=t;n;n=n.getParent()){if(B(n)){if(n.collapseAtStart(e))return!0;if(vt(n))break}if(n.getPreviousSibling())break}return!1}const BN=(()=>{try{const e=new RegExp("\\p{Emoji}","u"),t=e.test.bind(e);if(t("❤️")&&t("#️⃣")&&t("👍"))return t}catch{}return()=>!1})();function Xm(e,t,n){const r=e,o=r.getTextContent().split(/(?=\s)/g),i=o.length;let s=0,a=0;for(let c=0;c<i;c++){const u=c===i-1;if(a=s,s+=o[c].length,t&&s===n||s>n||u){o.splice(c,1),u&&(a=void 0);break}}const l=o.join("").trim();l===""?r.remove():(r.setTextContent(l),r.select(a,a))}function Zm(e,t,n,r){let o,i=t;if(Be(e)){let s=!1;const a=e.childNodes,l=a.length,c=r._blockCursorElement;i===l&&(s=!0,i=l-1);let u=a[i],f=!1;if(u===c)u=a[i+1],f=!0;else if(c!==null){const d=c.parentNode;e===d&&t>Array.prototype.indexOf.call(d.children,c)&&i--}if(o=wi(u),J(o))i=Yn(o,s?"next":"previous");else{let d=wi(e);if(d===null)return null;if(B(d)){const h=r.getElementByKey(d.getKey());h===null&&X(214),[d,i]=d.getDOMSlot(h).resolveChildIndex(d,h,e,t),B(d)||X(215),s&&i>=d.getChildrenSize()&&(i=Math.max(0,d.getChildrenSize()-1));let p=d.getChildAtIndex(i);if(B(p)&&(function(m,v,y){const x=m.getParent();return y===null||x===null||!x.canBeEmpty()||x!==y.getNode()})(p,0,n)){const m=s?p.getLastDescendant():p.getFirstDescendant();m===null?d=p:(p=m,d=B(p)?p:p.getParentOrThrow()),i=0}J(p)?(o=p,d=null,i=Yn(p,s?"next":"previous")):p!==d&&s&&!f&&(B(d)||X(216),i=Math.min(d.getChildrenSize(),i+1))}else{const h=d.getIndexWithinParent();i=t===0&&Te(d)&&wi(e)===d?h:h+1,d=d.getParentOrThrow()}if(B(d))return Kt(d.__key,i,"element")}}else o=wi(e);return J(o)?Kt(o.__key,Yn(o,i,"clamp"),"text"):null}function Jm(e,t,n){const r=e.offset,o=e.getNode();if(r===0){const i=o.getPreviousSibling(),s=o.getParent();if(t){if((n||!t)&&i===null&&B(s)&&s.isInline()){const a=s.getPreviousSibling();J(a)&&e.set(a.__key,a.getTextContent().length,"text")}}else B(i)&&!n&&i.isInline()?e.set(i.__key,i.getChildrenSize(),"element"):J(i)&&e.set(i.__key,i.getTextContent().length,"text")}else if(r===o.getTextContent().length){const i=o.getNextSibling(),s=o.getParent();if(t&&B(i)&&i.isInline())e.set(i.__key,0,"element");else if((n||t)&&i===null&&B(s)&&s.isInline()&&!s.canInsertTextAfter()){const a=s.getNextSibling();J(a)&&e.set(a.__key,0,"text")}}}function $b(e,t,n){if(e.type==="text"&&t.type==="text"){const r=e.isBefore(t),o=e.is(t);Jm(e,r,o),Jm(t,!r,o),o&&t.set(e.key,e.offset,e.type);const i=$e();if(i.isComposing()&&i._compositionKey!==e.key&&W(n)){const s=n.anchor,a=n.focus;e.set(s.key,s.offset,s.type,!0),t.set(a.key,a.offset,a.type,!0)}}}function Ob(e,t,n,r,o,i){if(e===null||n===null||!la(o,e,n))return null;const s=Zm(e,t,W(i)?i.anchor:null,o);if(s===null)return null;const a=Zm(n,r,W(i)?i.focus:null,o);if(a===null)return null;if(s.type==="element"&&a.type==="element"){const l=wi(e),c=wi(n);if(Te(l)&&Te(c))return null}return $b(s,a,i),[s,a]}function ef(e){return B(e)&&!e.isInline()}function Ib(e,t,n,r,o,i){const s=Jr(),a=new Ho(Kt(e,t,o),Kt(n,r,i),0,"");return a.dirty=!0,s._selection=a,a}function dc(){const e=Kt("root",0,"element"),t=Kt("root",0,"element");return new Ho(e,t,0,"")}function Vh(){return new uc(new Set)}function zN(e,t){return fc(null,e,t,null)}function fc(e,t,n,r){const o=n._window;if(o===null)return null;const i=r||o.event,s=i?i.type:void 0,a=s==="selectionchange",l=!Od&&(a||s==="beforeinput"||s==="compositionstart"||s==="compositionend"||s==="click"&&i&&i.detail===3||s==="drop"||s===void 0);let c,u,f,d;if(W(e)&&!l)return e.clone();if(t===null)return null;if(c=t.anchorNode,u=t.focusNode,f=t.anchorOffset,d=t.focusOffset,(a||s===void 0)&&W(e)&&!la(n,c,u))return e.clone();const h=Ob(c,f,u,d,n,e);if(h===null)return null;const[g,p]=h;return new Ho(g,p,W(e)?e.format:0,W(e)?e.style:"")}function Z(){return Jr()._selection}function Zn(){return $e()._editorState._selection}function Fl(e,t,n,r=1){const o=e.anchor,i=e.focus,s=o.getNode(),a=i.getNode();if(!t.is(s)&&!t.is(a))return;const l=t.__key;if(e.isCollapsed()){const c=o.offset;if(n<=c&&r>0||n<c&&r<0){const u=Math.max(0,c+r);o.set(l,u,"element"),i.set(l,u,"element"),Qm(e)}}else{const c=e.isBackward(),u=c?i:o,f=u.getNode(),d=c?o:i,h=d.getNode();if(t.is(f)){const g=u.offset;(n<=g&&r>0||n<g&&r<0)&&u.set(l,Math.max(0,g+r),"element")}if(t.is(h)){const g=d.offset;(n<=g&&r>0||n<g&&r<0)&&d.set(l,Math.max(0,g+r),"element")}}Qm(e)}function Qm(e){const t=e.anchor,n=t.offset,r=e.focus,o=r.offset,i=t.getNode(),s=r.getNode();if(e.isCollapsed()){if(!B(i))return;const a=i.getChildrenSize(),l=n>=a,c=l?i.getChildAtIndex(a-1):i.getChildAtIndex(n);if(J(c)){let u=0;l&&(u=c.getTextContentSize()),t.set(c.__key,u,"text"),r.set(c.__key,u,"text")}return}if(B(i)){const a=i.getChildrenSize(),l=n>=a,c=l?i.getChildAtIndex(a-1):i.getChildAtIndex(n);if(J(c)){let u=0;l&&(u=c.getTextContentSize()),t.set(c.__key,u,"text")}}if(B(s)){const a=s.getChildrenSize(),l=o>=a,c=l?s.getChildAtIndex(a-1):s.getChildAtIndex(o);if(J(c)){let u=0;l&&(u=c.getTextContentSize()),r.set(c.__key,u,"text")}}}function $l(e,t,n,r,o){let i=null,s=0,a=null;r!==null?(i=r.__key,J(r)?(s=r.getTextContentSize(),a="text"):B(r)&&(s=r.getChildrenSize(),a="element")):o!==null&&(i=o.__key,J(o)?a="text":B(o)&&(a="element")),i!==null&&a!==null?e.set(i,s,a):(s=t.getIndexWithinParent(),s===-1&&(s=n.getChildrenSize()),e.set(n.__key,s,"element"))}function ey(e,t,n,r,o){e.type==="text"?e.set(n,e.offset+(t?0:o),"text"):e.offset>r.getIndexWithinParent()&&e.set(e.key,e.offset-1,"element")}function Db(e,t,n,r,o){try{e.setBaseAndExtent(t,n,r,o)}catch{}}function HN(e,t,n,r,o,i,s){const a=r.anchorNode,l=r.focusNode,c=r.anchorOffset,u=r.focusOffset,f=document.activeElement;if(o.has(Pb)&&f!==i||f!==null&&Gh(f))return;if(!W(t))return void(e!==null&&la(n,a,l)&&r.removeAllRanges());const d=t.anchor,h=t.focus,g=d.key,p=h.key,m=Fo(n,g),v=Fo(n,p),y=d.offset,x=h.offset,b=t.format,w=t.style,_=t.isCollapsed();let E=m,R=v,k=!1;if(d.type==="text"){E=Di(m);const D=d.getNode();k=D.getFormat()!==b||D.getStyle()!==w}else W(e)&&e.anchor.type==="text"&&(k=!0);var P,F,$,j,O;if(h.type==="text"&&(R=Di(v)),E!==null&&R!==null&&(_&&(e===null||k||W(e)&&(e.format!==b||e.style!==w))&&(P=b,F=w,$=y,j=g,O=performance.now(),Tb=[P,F,$,j,O]),c!==y||u!==x||a!==E||l!==R||r.type==="Range"&&_||(f!==null&&i.contains(f)||o.has(LN)||i.focus({preventScroll:!0}),d.type==="element"))){if(Db(r,E,y,R,x),!o.has(MN)&&t.isCollapsed()&&i!==null&&i===document.activeElement){const D=W(t)&&t.anchor.type==="element"?E.childNodes[y]||null:r.rangeCount>0?r.getRangeAt(0):null;if(D!==null){let K;if(D instanceof Text){const I=document.createRange();I.selectNode(D),K=I.getBoundingClientRect()}else K=D.getBoundingClientRect();(function(I,M,H){const U=iw(H),re=Qh(U);if(U===null||re===null)return;let{top:G,bottom:Y}=M,Q=0,ne=0,oe=H;for(;oe!==null;){const me=oe===U.body;if(me)Q=0,ne=hn(I).innerHeight;else{const ve=oe.getBoundingClientRect();Q=ve.top,ne=ve.bottom}let ee=0;if(G<Q?ee=-(Q-G):Y>ne&&(ee=Y-ne),ee!==0)if(me)re.scrollBy(0,ee);else{const ve=oe.scrollTop;oe.scrollTop+=ee;const Se=oe.scrollTop-ve;G-=Se,Y-=Se}if(me)break;oe=ca(oe)}})(n,K,i)}}qd=!0}}function Bh(e){let t=Z()||Zn();t===null&&(t=qe().selectEnd()),t.insertNodes(e)}function hu(e){let t=e;e.isCollapsed()||t.removeText();const n=Z();W(n)&&(t=n),W(t)||X(161);const r=t.anchor;let o=r.getNode(),i=r.offset;for(;!Nr(o);){const s=o;if([o,i]=WN(o,i),s.is(o))break}return i}function WN(e,t){const n=e.getParent();if(!n){const o=ye();return qe().append(o),o.select(),[qe(),0]}if(J(e)){const o=e.splitText(t);if(o.length===0)return[n,e.getIndexWithinParent()];const i=t===0?0:1;return[n,o[0].getIndexWithinParent()+i]}if(!B(e)||t===0)return[n,e.getIndexWithinParent()];const r=e.getChildAtIndex(t);if(r){const o=new Ho(Kt(e.__key,t,"element"),Kt(e.__key,t,"element"),0,""),i=e.insertNewAfter(o);i&&i.append(r,...r.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}function ty(e,t,n,r,o="decorators-and-blocks"){if(t==="move"&&r==="character"&&!e.isCollapsed()){const[u,f]=n===e.isBackward()?[e.focus,e.anchor]:[e.anchor,e.focus];return f.set(u.key,u.offset,u.type),!0}const i=An(e.focus,n?"previous":"next"),s=r==="lineboundary",a=t==="move";let l=i,c=o==="decorators-and-blocks";if(!ig(l)){for(const u of l){c=!1;const{origin:f}=u;if(!Te(f)||f.isIsolated()||(l=u,!s||!f.isInline()))break}if(c)for(const u of qs(i).iterNodeCarets(t==="extend"?"shadowRoot":"root")){if(Ht(u))u.origin.isInline()||(l=u);else{if(B(u.origin))continue;Te(u.origin)&&!u.origin.isInline()&&(l=u)}break}}if(l===i)return!1;if(a&&!s&&Te(l.origin)&&l.origin.isKeyboardSelectable()){const u=Vh();return u.add(l.origin.getKey()),Ge(u),!0}return l=Lt(l),a&&Sn(e.anchor,l),Sn(e.focus,l),c||!s}let ht=null,gt=null,zt=!1,gu=!1,sl=0;const ny={characterData:!0,childList:!0,subtree:!0};function Ji(){return zt||ht!==null&&ht._readOnly}function ft(){zt&&X(13)}function jb(){sl>99&&X(14)}function Jr(){return ht===null&&X(195,Vb()),ht}function $e(){return gt===null&&X(196,Vb()),gt}function Vb(){let e=0;const t=new Set,n=Ii.version;if(typeof window<"u")for(const o of document.querySelectorAll("[contenteditable]")){const i=gc(o);if(qh(i))e++;else if(i){let s=String(i.constructor.version||"<0.17.1");s===n&&(s+=" (separately built, likely a bundler configuration issue)"),t.add(s)}}let r=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(r+=` and incompatible editors with versions ${Array.from(t).join(", ")}`),r}function KN(){return gt}function ry(e,t,n){const r=t.__type,o=Ub(e,r);let i=n.get(r);i===void 0&&(i=Array.from(o.transforms),n.set(r,i));const s=i.length;for(let a=0;a<s&&(i[a](t),t.isAttached());a++);}function oy(e,t){return e!==void 0&&e.__key!==t&&e.isAttached()}function Bb(e,t){if(!t)return;const n=e._updateTags;let r=t;Array.isArray(t)||(r=[t]);for(const o of r)n.add(o)}function UN(e){return zh(e,$e()._nodes)}function zh(e,t){const n=e.type,r=t.get(n);r===void 0&&X(17,n);const o=r.klass;e.type!==o.getType()&&X(18,o.name);const i=o.importJSON(e),s=e.children;if(B(i)&&Array.isArray(s))for(let a=0;a<s.length;a++){const l=zh(s[a],t);i.append(l)}return i}function iy(e,t,n){const r=ht,o=zt,i=gt;ht=t,zt=!0,gt=e;try{return n()}finally{ht=r,zt=o,gt=i}}function cr(e,t){const n=e._pendingEditorState,r=e._rootElement,o=e._headless||r===null;if(n===null)return;const i=e._editorState,s=i._selection,a=n._selection,l=e._dirtyType!==0,c=ht,u=zt,f=gt,d=e._updating,h=e._observer;let g=null;if(e._pendingEditorState=null,e._editorState=n,!o&&l&&h!==null){gt=e,ht=n,zt=!1,e._updating=!0;try{const _=e._dirtyType,E=e._dirtyElements,R=e._dirtyLeaves;h.disconnect(),g=pN(i,n,e,_,E,R)}catch(_){if(_ instanceof Error&&e._onError(_),gu)throw _;return Wb(e,null,r,n),nb(e),e._dirtyType=2,gu=!0,cr(e,i),void(gu=!1)}finally{h.observe(r,ny),e._updating=d,ht=c,zt=u,gt=f}}n._readOnly||(n._readOnly=!0);const p=e._dirtyLeaves,m=e._dirtyElements,v=e._normalizedNodes,y=e._updateTags,x=e._deferred;l&&(e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements=new Map,e._normalizedNodes=new Set,e._updateTags=new Set),(function(_,E){const R=_._decorators;let k=_._pendingDecorators||R;const P=E._nodeMap;let F;for(F in k)P.has(F)||(k===R&&(k=Qb(_)),delete k[F])})(e,n);const b=o?null:Ot(hn(e));if(e._editable&&b!==null&&(l||a===null||a.dirty||!a.is(s))&&r!==null&&!y.has(PN)){gt=e,ht=n;try{if(h!==null&&h.disconnect(),l||a===null||a.dirty){const _=e._blockCursorElement;_!==null&&of(_,e,r),HN(s,a,e,b,y,r)}(function(_,E,R){let k=_._blockCursorElement;if(W(R)&&R.isCollapsed()&&R.anchor.type==="element"&&E.contains(document.activeElement)){const P=R.anchor,F=P.getNode(),$=P.offset;let j=!1,O=null;if($===F.getChildrenSize())mu(F.getChildAtIndex($-1))&&(j=!0);else{const D=F.getChildAtIndex($);if(D!==null&&mu(D)){const K=D.getPreviousSibling();(K===null||mu(K))&&(j=!0,O=_.getElementByKey(D.__key))}}if(j){const D=_.getElementByKey(F.__key);return k===null&&(_._blockCursorElement=k=(function(K){const I=K.theme,M=document.createElement("div");M.contentEditable="false",M.setAttribute("data-lexical-cursor","true");let H=I.blockCursor;if(H!==void 0){if(typeof H=="string"){const U=Z1(H);H=I.blockCursor=U}H!==void 0&&M.classList.add(...H)}return M})(_._config)),E.style.caretColor="transparent",void(O===null?D.appendChild(k):D.insertBefore(k,O))}}k!==null&&of(k,_,E)})(e,r,a)}finally{h!==null&&h.observe(r,ny),gt=f,ht=c}}g!==null&&(function(_,E,R,k,P){const F=Array.from(_._listeners.mutation),$=F.length;for(let j=0;j<$;j++){const[O,D]=F[j];for(const K of D){const I=E.get(K);I!==void 0&&O(I,{dirtyLeaves:k,prevEditorState:P,updateTags:R})}}})(e,g,y,p,i),W(a)||a===null||s!==null&&s.is(a)||e.dispatchCommand(hr,void 0);const w=e._pendingDecorators;w!==null&&(e._decorators=w,e._pendingDecorators=null,As("decorator",e,!0,w)),(function(_,E,R){const k=cy(E),P=cy(R);k!==P&&As("textcontent",_,!0,P)})(e,t||i,n),As("update",e,!0,{dirtyElements:m,dirtyLeaves:p,editorState:n,mutatedNodes:g,normalizedNodes:v,prevEditorState:t||i,tags:y}),(function(_,E){if(_._deferred=[],E.length!==0){const R=_._updating;_._updating=!0;try{for(let k=0;k<E.length;k++)E[k]()}finally{_._updating=R}}})(e,x),(function(_){const E=_._updates;if(E.length!==0){const R=E.shift();if(R){const[k,P]=R;hc(_,k,P)}}})(e)}function As(e,t,n,...r){const o=t._updating;t._updating=n;try{const i=Array.from(t._listeners[e]);for(let s=0;s<i.length;s++)i[s].apply(null,r)}finally{t._updating=o}}function sy(e,t){const n=e._updates;let r=t||!1;for(;n.length!==0;){const o=n.shift();if(o){const[i,s]=o,a=e._pendingEditorState;let l;s!==void 0&&(l=s.onUpdate,s.skipTransforms&&(r=!0),s.discrete&&(a===null&&X(191),a._flushSync=!0),l&&e._deferred.push(l),Bb(e,s.tag)),a==null?hc(e,i,s):i()}}return r}function hc(e,t,n){const r=e._updateTags;let o,i=!1,s=!1;n!==void 0&&(o=n.onUpdate,Bb(e,n.tag),i=n.skipTransforms||!1,s=n.discrete||!1),o&&e._deferred.push(o);const a=e._editorState;let l=e._pendingEditorState,c=!1;(l===null||l._readOnly)&&(l=e._pendingEditorState=zb(l||a),c=!0),l._flushSync=s;const u=ht,f=zt,d=gt,h=e._updating;ht=l,zt=!1,e._updating=!0,gt=e;const g=e._headless||e.getRootElement()===null;Kh(null);try{c&&(g?a._selection!==null&&(l._selection=a._selection.clone()):l._selection=(function(y,x){const b=y.getEditorState()._selection,w=Ot(hn(y));return W(b)||b==null?fc(b,w,y,x):b.clone()})(e,n&&n.event||null));const m=e._compositionKey;t(),i=sy(e,i),(function(y,x){const b=x.getEditorState()._selection,w=y._selection;if(W(w)){const _=w.anchor,E=w.focus;let R;if(_.type==="text"&&(R=_.getNode(),R.selectionTransform(b,w)),E.type==="text"){const k=E.getNode();R!==k&&k.selectionTransform(b,w)}}})(l,e),e._dirtyType!==0&&(i?(function(y,x){const b=x._dirtyLeaves,w=y._nodeMap;for(const _ of b){const E=w.get(_);J(E)&&E.isAttached()&&E.isSimpleText()&&!E.isUnmergeable()&&Om(E)}})(l,e):(function(y,x){const b=x._dirtyLeaves,w=x._dirtyElements,_=y._nodeMap,E=Mr(),R=new Map;let k=b,P=k.size,F=w,$=F.size;for(;P>0||$>0;){if(P>0){x._dirtyLeaves=new Set;for(const j of k){const O=_.get(j);J(O)&&O.isAttached()&&O.isSimpleText()&&!O.isUnmergeable()&&Om(O),O!==void 0&&oy(O,E)&&ry(x,O,R),b.add(j)}if(k=x._dirtyLeaves,P=k.size,P>0){sl++;continue}}x._dirtyLeaves=new Set,x._dirtyElements=new Map,F.delete("root")&&F.set("root",!0);for(const j of F){const O=j[0],D=j[1];if(w.set(O,D),!D)continue;const K=_.get(O);K!==void 0&&oy(K,E)&&ry(x,K,R)}k=x._dirtyLeaves,P=k.size,F=x._dirtyElements,$=F.size,sl++}x._dirtyLeaves=b,x._dirtyElements=w})(l,e),sy(e),(function(y,x,b,w){const _=y._nodeMap,E=x._nodeMap,R=[];for(const[k]of w){const P=E.get(k);P!==void 0&&(P.isAttached()||(B(P)&&Q1(P,k,_,E,R,w),_.has(k)||w.delete(k),R.push(k)))}for(const k of R)E.delete(k);for(const k of b){const P=E.get(k);P===void 0||P.isAttached()||(_.has(k)||b.delete(k),E.delete(k))}})(a,l,e._dirtyLeaves,e._dirtyElements)),m!==e._compositionKey&&(l._flushSync=!0);const v=l._selection;if(W(v)){const y=l._nodeMap,x=v.anchor.key,b=v.focus.key;y.get(x)!==void 0&&y.get(b)!==void 0||X(19)}else Ct(v)&&v._nodes.size===0&&(l._selection=null)}catch(m){return m instanceof Error&&e._onError(m),e._pendingEditorState=a,e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),void cr(e)}finally{ht=u,zt=f,gt=d,e._updating=h,sl=0}e._dirtyType!==0||e._deferred.length>0||(function(m,v){const y=v.getEditorState()._selection,x=m._selection;if(x!==null){if(x.dirty||!x.is(y))return!0}else if(y!==null)return!0;return!1})(l,e)?l._flushSync?(l._flushSync=!1,cr(e)):c&&JN(()=>{cr(e)}):(l._flushSync=!1,c&&(r.clear(),e._deferred=[],e._pendingEditorState=null))}function Gn(e,t,n){gt===e&&n===void 0?t():hc(e,t,n)}class Ns{element;before;after;constructor(t,n,r){this.element=t,this.before=n||null,this.after=r||null}withBefore(t){return new Ns(this.element,t,this.after)}withAfter(t){return new Ns(this.element,this.before,t)}withElement(t){return this.element===t?this:new Ns(t,this.before,this.after)}insertChild(t){const n=this.before||this.getManagedLineBreak();return n!==null&&n.parentElement!==this.element&&X(222),this.element.insertBefore(t,n),this}removeChild(t){return t.parentElement!==this.element&&X(223),this.element.removeChild(t),this}replaceChild(t,n){return n.parentElement!==this.element&&X(224),this.element.replaceChild(t,n),this}getFirstChild(){const t=this.after?this.after.nextSibling:this.element.firstChild;return t===this.before||t===this.getManagedLineBreak()?null:t}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(t){if(t===null)this.removeManagedLineBreak();else{const n=t==="decorator"&&(ia||qi||oa);this.insertManagedLineBreak(n)}}removeManagedLineBreak(){const t=this.getManagedLineBreak();if(t){const n=this.element,r=t.nodeName==="IMG"?t.nextSibling:null;r&&n.removeChild(r),n.removeChild(t),n.__lexicalLineBreak=void 0}}insertManagedLineBreak(t){const n=this.getManagedLineBreak();if(n){if(t===(n.nodeName==="IMG"))return;this.removeManagedLineBreak()}const r=this.element,o=this.before,i=document.createElement("br");if(r.insertBefore(i,o),t){const s=document.createElement("img");s.setAttribute("data-lexical-linebreak","true"),s.style.cssText="display: inline !important; border: 0px !important; margin: 0px !important;",s.alt="",r.insertBefore(s,i),r.__lexicalLineBreak=s}else r.__lexicalLineBreak=i}getFirstChildOffset(){let t=0;for(let n=this.after;n!==null;n=n.previousSibling)t++;return t}resolveChildIndex(t,n,r,o){if(r===this.element){const l=this.getFirstChildOffset();return[t,Math.min(l+t.getChildrenSize(),Math.max(l,o))]}const i=ay(n,r);i.push(o);const s=ay(n,this.element);let a=t.getIndexWithinParent();for(let l=0;l<s.length;l++){const c=i[l],u=s[l];if(c===void 0||c<u)break;if(c>u){a+=1;break}}return[t.getParentOrThrow(),a]}}function ay(e,t){const n=[];let r=t;for(;r!==e&&r!==null;r=r.parentNode){let o=0;for(let i=r.previousSibling;i!==null;i=i.previousSibling)o++;n.push(o)}return r!==e&&X(225),n.reverse()}class Tt extends Kn{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;constructor(t){super(t),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=""}afterCloneFrom(t){super.afterCloneFrom(t),this.__key===t.__key&&(this.__first=t.__first,this.__last=t.__last,this.__size=t.__size),this.__indent=t.__indent,this.__format=t.__format,this.__style=t.__style,this.__dir=t.__dir,this.__textFormat=t.__textFormat,this.__textStyle=t.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){const t=this.getFormat();return tN[t]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const t=[];let n=this.getFirstChild();for(;n!==null;)t.push(n),n=n.getNextSibling();return t}getChildrenKeys(){const t=[];let n=this.getFirstChild();for(;n!==null;)t.push(n.__key),n=n.getNextSibling();return t}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){const t=$e()._dirtyElements;return t!==null&&t.has(this.__key)}isLastChild(){const t=this.getLatest(),n=this.getParentOrThrow().getLastChild();return n!==null&&n.is(t)}getAllTextNodes(){const t=[];let n=this.getFirstChild();for(;n!==null;){if(J(n)&&t.push(n),B(n)){const r=n.getAllTextNodes();t.push(...r)}n=n.getNextSibling()}return t}getFirstDescendant(){let t=this.getFirstChild();for(;B(t);){const n=t.getFirstChild();if(n===null)break;t=n}return t}getLastDescendant(){let t=this.getLastChild();for(;B(t);){const n=t.getLastChild();if(n===null)break;t=n}return t}getDescendantByIndex(t){const n=this.getChildren(),r=n.length;if(t>=r){const i=n[r-1];return B(i)&&i.getLastDescendant()||i||null}const o=n[t];return B(o)&&o.getFirstDescendant()||o||null}getFirstChild(){const t=this.getLatest().__first;return t===null?null:Pe(t)}getFirstChildOrThrow(){const t=this.getFirstChild();return t===null&&X(45,this.__key),t}getLastChild(){const t=this.getLatest().__last;return t===null?null:Pe(t)}getLastChildOrThrow(){const t=this.getLastChild();return t===null&&X(96,this.__key),t}getChildAtIndex(t){const n=this.getChildrenSize();let r,o;if(t<n/2){for(r=this.getFirstChild(),o=0;r!==null&&o<=t;){if(o===t)return r;r=r.getNextSibling(),o++}return null}for(r=this.getLastChild(),o=n-1;r!==null&&o>=t;){if(o===t)return r;r=r.getPreviousSibling(),o--}return null}getTextContent(){let t="";const n=this.getChildren(),r=n.length;for(let o=0;o<r;o++){const i=n[o];t+=i.getTextContent(),B(i)&&o!==r-1&&!i.isInline()&&(t+=Wr)}return t}getTextContentSize(){let t=0;const n=this.getChildren(),r=n.length;for(let o=0;o<r;o++){const i=n[o];t+=i.getTextContentSize(),B(i)&&o!==r-1&&!i.isInline()&&(t+=2)}return t}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(t){if(t!==""){const n=km[t];return(this.getFormat()&n)!==0}return!1}hasTextFormat(t){const n=Kr[t];return(this.getTextFormat()&n)!==0}getFormatFlags(t,n){return Ol(this.getLatest().__textFormat,t,n)}getTextStyle(){return this.getLatest().__textStyle}select(t,n){ft();const r=Z();let o=t,i=n;const s=this.getChildrenSize();if(!this.canBeEmpty()){if(t===0&&n===0){const l=this.getFirstChild();if(J(l)||B(l))return l.select(0,0)}else if(!(t!==void 0&&t!==s||n!==void 0&&n!==s)){const l=this.getLastChild();if(J(l)||B(l))return l.select()}}o===void 0&&(o=s),i===void 0&&(i=s);const a=this.__key;return W(r)?(r.anchor.set(a,o,"element"),r.focus.set(a,i,"element"),r.dirty=!0,r):Ib(a,o,a,i,"element","element")}selectStart(){const t=this.getFirstDescendant();return t?t.selectStart():this.select()}selectEnd(){const t=this.getLastDescendant();return t?t.selectEnd():this.select()}clear(){const t=this.getWritable();return this.getChildren().forEach(n=>n.remove()),t}append(...t){return this.splice(this.getChildrenSize(),0,t)}setDirection(t){const n=this.getWritable();return n.__dir=t,n}setFormat(t){return this.getWritable().__format=t!==""?km[t]:0,this}setStyle(t){return this.getWritable().__style=t||"",this}setTextFormat(t){const n=this.getWritable();return n.__textFormat=t,n}setTextStyle(t){const n=this.getWritable();return n.__textStyle=t,n}setIndent(t){return this.getWritable().__indent=t,this}splice(t,n,r){Ll(this)&&X(324,this.__key,this.__type);const o=this.getChildrenSize(),i=this.getWritable();t+n<=o||X(226,String(t),String(n),String(o));const s=i.__key,a=[],l=[],c=this.getChildAtIndex(t+n);let u=null,f=o-n+r.length;if(t!==0)if(t===o)u=this.getLastChild();else{const h=this.getChildAtIndex(t);h!==null&&(u=h.getPreviousSibling())}if(n>0){let h=u===null?this.getFirstChild():u.getNextSibling();for(let g=0;g<n;g++){h===null&&X(100);const p=h.getNextSibling(),m=h.__key;Ro(h.getWritable()),l.push(m),h=p}}let d=u;for(const h of r){d!==null&&h.is(d)&&(u=d=d.getPreviousSibling());const g=h.getWritable();g.__parent===s&&f--,Ro(g);const p=h.__key;if(d===null)i.__first=p,g.__prev=null;else{const m=d.getWritable();m.__next=p,g.__prev=m.__key}h.__key===s&&X(76),g.__parent=s,a.push(p),d=h}if(t+n===o)d!==null&&(d.getWritable().__next=null,i.__last=d.__key);else if(c!==null){const h=c.getWritable();if(d!==null){const g=d.getWritable();h.__prev=d.__key,g.__next=c.__key}else h.__prev=null}if(i.__size=f,l.length){const h=Z();if(W(h)){const g=new Set(l),p=new Set(a),{anchor:m,focus:v}=h;ly(m,g,p)&&$l(m,m.getNode(),this,u,c),ly(v,g,p)&&$l(v,v.getNode(),this,u,c),f!==0||this.canBeEmpty()||vt(this)||this.remove()}}return i}getDOMSlot(t){return new Ns(t)}exportDOM(t){const{element:n}=super.exportDOM(t);if(Be(n)){const r=this.getIndent();r>0&&(n.style.paddingInlineStart=40*r+"px");const o=this.getDirection();o&&(n.dir=o)}return{element:n}}exportJSON(){const t={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},n=this.getTextFormat(),r=this.getTextStyle();return n===0&&r===""||vt(this)||this.getChildren().some(J)||(n!==0&&(t.textFormat=n),r!==""&&(t.textStyle=r)),t}updateFromJSON(t){return super.updateFromJSON(t).setFormat(t.format).setIndent(t.indent).setDirection(t.direction).setTextFormat(t.textFormat||0).setTextStyle(t.textStyle||"")}insertNewAfter(t,n){return null}canIndent(){return!0}collapseAtStart(t){return!1}excludeFromCopy(t){return!1}canReplaceWith(t){return!0}canInsertAfter(t){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(t){return!1}extractWithChild(t,n,r){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(t,n){const r=this.getDOMSlot(t);let o=r.getFirstChild();for(let i=this.getFirstChild();i;i=i.getNextSibling()){const s=n.getElementByKey(i.getKey());s!==null&&(o==null?(r.insertChild(s),o=s):o!==s&&r.replaceChild(s,o),o=o.nextSibling)}}}function B(e){return e instanceof Tt}function ly(e,t,n){let r=e.getNode();for(;r;){const o=r.__key;if(t.has(o)&&!n.has(o))return!0;r=r.getParent()}return!1}class sa extends Kn{decorate(t,n){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function Te(e){return e instanceof sa}class Qi extends Tt{__cachedText;static getType(){return"root"}static clone(){return new Qi}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){X(51)}getTextContent(){const t=this.__cachedText;return!Ji()&&$e()._dirtyType!==0||t===null?super.getTextContent():t}remove(){X(52)}replace(t){X(53)}insertBefore(t){X(54)}insertAfter(t){X(55)}updateDOM(t,n){return!1}splice(t,n,r){for(const o of r)B(o)||Te(o)||X(282);return super.splice(t,n,r)}static importJSON(t){return qe().updateFromJSON(t)}collapseAtStart(){return!0}}function at(e){return e instanceof Qi}function zb(e){return new aa(new Map(e._nodeMap))}function Hh(){return new aa(new Map([["root",new Qi]]))}function Hb(e){const t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&X(130,n.name),B(e)){const r=t.children;Array.isArray(r)||X(59,n.name);const o=e.getChildren();for(let i=0;i<o.length;i++){const s=Hb(o[i]);r.push(s)}}return t}function GN(e){return e instanceof aa}class aa{_nodeMap;_selection;_flushSync;_readOnly;constructor(t,n){this._nodeMap=t,this._selection=n||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(t,n){return iy(n&&n.editor||null,this,t)}clone(t){const n=new aa(this._nodeMap,t===void 0?this._selection:t);return n._readOnly=!0,n}toJSON(){return iy(null,this,()=>({root:Hb(qe())}))}}class Wh extends Tt{static getType(){return"artificial"}createDOM(t){return document.createElement("div")}}class Wo extends Tt{static getType(){return"paragraph"}static clone(t){return new Wo(t.__key)}createDOM(t){const n=document.createElement("p"),r=ki(t.theme,"paragraph");return r!==void 0&&n.classList.add(...r),n}updateDOM(t,n,r){return!1}static importDOM(){return{p:t=>({conversion:qN,priority:0})}}exportDOM(t){const{element:n}=super.exportDOM(t);if(Be(n)){this.isEmpty()&&n.append(document.createElement("br"));const r=this.getFormatType();r&&(n.style.textAlign=r)}return{element:n}}static importJSON(t){return ye().updateFromJSON(t)}exportJSON(){const t=super.exportJSON();if(t.textFormat===void 0||t.textStyle===void 0){const n=this.getChildren().find(J);n?(t.textFormat=n.getFormat(),t.textStyle=n.getStyle()):(t.textFormat=this.getTextFormat(),t.textStyle=this.getTextStyle())}return t}insertNewAfter(t,n){const r=ye();r.setTextFormat(t.format),r.setTextStyle(t.style);const o=this.getDirection();return r.setDirection(o),r.setFormat(this.getFormatType()),r.setStyle(this.getStyle()),this.insertAfter(r,n),r}collapseAtStart(){const t=this.getChildren();if(t.length===0||J(t[0])&&t[0].getTextContent().trim()===""){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}}function qN(e){const t=ye();return e.style&&(t.setFormat(e.style.textAlign),eg(e,t)),{node:t}}function ye(){return Et(new Wo)}function Qr(e){return e instanceof Wo}const be=0,ur=1,Dt=3,YN=4;function Wb(e,t,n,r){const o=e._keyToDOMMap;o.clear(),e._editorState=Hh(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,e._updateTags=new Set,e._updates=[],e._blockCursorElement=null;const i=e._observer;i!==null&&(i.disconnect(),e._observer=null),t!==null&&(t.textContent=""),n!==null&&(n.textContent="",o.set("root",n))}function XN(e){const t=new Set,n=new Set;let r=e;for(;r;){const{ownNodeConfig:o}=yc(r),i=r.transform;if(!n.has(i)){n.add(i);const s=r.transform();s&&t.add(s)}if(o){const s=o.$transform;s&&t.add(s),r=o.extends}else{const s=Object.getPrototypeOf(r);r=s.prototype instanceof Kn&&s!==Kn?s:void 0}}return t}function Kb(e){const t=e||{},n=KN(),r=t.theme||{},o=e===void 0?n:t.parentEditor||null,i=t.disableEvents||!1,s=Hh(),a=t.namespace||(o!==null?o._config.namespace:nw()),l=t.editorState,c=[Qi,fn,Yi,Xi,Wo,Wh,...t.nodes||[]],{onError:u,html:f}=t,d=t.editable===void 0||t.editable;let h;if(e===void 0&&n!==null)h=n._nodes;else{h=new Map;for(let p=0;p<c.length;p++){let m=c[p],v=null,y=null;if(typeof m!="function"){const w=m;m=w.replace,v=w.with,y=w.withKlass||null}yc(m);const x=m.getType(),b=XN(m);h.set(x,{exportDOM:f&&f.export?f.export.get(m):void 0,klass:m,replace:v,replaceWithKlass:y,sharedNodeState:uN(c[p]),transforms:b})}}const g=new Ii(s,o,h,{disableEvents:i,namespace:a,theme:r},u||console.error,(function(p,m){const v=new Map,y=new Set,x=b=>{Object.keys(b).forEach(w=>{let _=v.get(w);_===void 0&&(_=[],v.set(w,_)),_.push(b[w])})};return p.forEach(b=>{const w=b.klass.importDOM;if(w==null||y.has(w))return;y.add(w);const _=w.call(b.klass);_!==null&&x(_)}),m&&x(m),v})(h,f?f.import:void 0),d,e);return l!==void 0&&(g._pendingEditorState=l,g._dirtyType=2),(function(p){p.registerCommand(db,SN,be),p.registerCommand(fb,_N,be),p.registerCommand(hb,TN,be),p.registerCommand(gb,EN,be),p.registerCommand(yb,RN,be)})(g),g}class Ii{static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_htmlConversions;_window;_editable;_blockCursorElement;_createEditorArgs;constructor(t,n,r,o,i,s,a,l){this._createEditorArgs=l,this._parentEditor=n,this._rootElement=null,this._editorState=t,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=o,this._nodes=r,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=nw(),this._onError=i,this._htmlConversions=s,this._editable=a,this._headless=n!==null&&n._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(t){const n=this._listeners.update;return n.add(t),()=>{n.delete(t)}}registerEditableListener(t){const n=this._listeners.editable;return n.add(t),()=>{n.delete(t)}}registerDecoratorListener(t){const n=this._listeners.decorator;return n.add(t),()=>{n.delete(t)}}registerTextContentListener(t){const n=this._listeners.textcontent;return n.add(t),()=>{n.delete(t)}}registerRootListener(t){const n=this._listeners.root;return t(this._rootElement,null),n.add(t),()=>{t(null,this._rootElement),n.delete(t)}}registerCommand(t,n,r){r===void 0&&X(35);const o=this._commands;o.has(t)||o.set(t,[new Set,new Set,new Set,new Set,new Set]);const i=o.get(t);i===void 0&&X(36,String(t));const s=i[r];return s.add(n),()=>{s.delete(n),i.every(a=>a.size===0)&&o.delete(t)}}registerMutationListener(t,n,r){const o=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(t)).klass,i=this._listeners.mutation;let s=i.get(n);s===void 0&&(s=new Set,i.set(n,s)),s.add(o);const a=r&&r.skipInitialization;return a!==void 0&&a||this.initializeMutationListener(n,o),()=>{s.delete(o),s.size===0&&i.delete(n)}}getRegisteredNode(t){const n=this._nodes.get(t.getType());return n===void 0&&X(37,t.name),n}resolveRegisteredNodeAfterReplacements(t){for(;t.replaceWithKlass;)t=this.getRegisteredNode(t.replaceWithKlass);return t}initializeMutationListener(t,n){const r=this._editorState,o=my(r).get(n.getType());if(!o)return;const i=new Map;for(const s of o.keys())i.set(s,"created");i.size>0&&t(i,{dirtyLeaves:new Set,prevEditorState:r,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(t,n){const r=this.getRegisteredNode(t);return r.transforms.add(n),r}registerNodeTransform(t,n){const r=this.registerNodeTransformToKlass(t,n),o=[r],i=r.replaceWithKlass;if(i!=null){const s=this.registerNodeTransformToKlass(i,n);o.push(s)}return(function(s,a){const l=my(s.getEditorState()),c=[];for(const u of a){const f=l.get(u);f&&c.push(f)}c.length!==0&&s.update(()=>{for(const u of c)for(const f of u.keys()){const d=Pe(f);d&&d.markDirty()}},s._pendingEditorState===null?{tag:Ri}:void 0)})(this,o.map(s=>s.klass.getType())),()=>{o.forEach(s=>s.transforms.delete(n))}}hasNode(t){return this._nodes.has(t.getType())}hasNodes(t){return t.every(this.hasNode.bind(this))}dispatchCommand(t,n){return te(this,t,n)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(t){const n=this._rootElement;if(t!==n){const r=ki(this._config.theme,"root"),o=this._pendingEditorState||this._editorState;if(this._rootElement=t,Wb(this,n,t,o),n!==null&&(this._config.disableEvents||kN(n),r!=null&&n.classList.remove(...r)),t!==null){const i=Qh(t),s=t.style;s.userSelect="text",s.whiteSpace="pre-wrap",s.wordBreak="break-word",t.setAttribute("data-lexical-editor","true"),this._window=i,this._dirtyType=2,nb(this),this._updateTags.add(Ri),cr(this),this._config.disableEvents||(function(a,l){const c=a.ownerDocument;Gd.set(a,c);const u=Ml.get(c)??0;u<1&&c.addEventListener("selectionchange",Nb),Ml.set(c,u+1),a.__lexicalEditor=l;const f=Ab(a);for(let d=0;d<Ud.length;d++){const[h,g]=Ud[d],p=typeof g=="function"?m=>{Hm(m)||(zm(m),(l.isEditable()||h==="click")&&g(m,l))}:m=>{if(Hm(m))return;zm(m);const v=l.isEditable();switch(h){case"cut":return v&&te(l,lc,m);case"copy":return te(l,ac,m);case"paste":return v&&te(l,Mh,m);case"dragstart":return v&&te(l,bb,m);case"dragover":return v&&te(l,wb,m);case"dragend":return v&&te(l,bN,m);case"focus":return v&&te(l,Cb,m);case"blur":return v&&te(l,wN,m);case"drop":return v&&te(l,xb,m)}};a.addEventListener(h,p),f.push(()=>{a.removeEventListener(h,p)})}})(t,this),r!=null&&t.classList.add(...r)}else this._window=null,this._updateTags.add(Ri),cr(this);As("root",this,!1,t,n)}}getElementByKey(t){return this._keyToDOMMap.get(t)||null}getEditorState(){return this._editorState}setEditorState(t,n){t.isEmpty()&&X(38);let r=t;r._readOnly&&(r=zb(t),r._selection=t._selection?t._selection.clone():null),tb(this);const o=this._pendingEditorState,i=this._updateTags,s=n!==void 0?n.tag:null;o===null||o.isEmpty()||(s!=null&&i.add(s),cr(this)),this._pendingEditorState=r,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,s!=null&&i.add(s),this._updating||cr(this)}parseEditorState(t,n){return(function(r,o,i){const s=Hh(),a=ht,l=zt,c=gt,u=o._dirtyElements,f=o._dirtyLeaves,d=o._cloneNotNeeded,h=o._dirtyType;o._dirtyElements=new Map,o._dirtyLeaves=new Set,o._cloneNotNeeded=new Set,o._dirtyType=0,ht=s,zt=!1,gt=o,Kh(null);try{const g=o._nodes;zh(r.root,g),i&&i(),s._readOnly=!0}catch(g){g instanceof Error&&o._onError(g)}finally{o._dirtyElements=u,o._dirtyLeaves=f,o._cloneNotNeeded=d,o._dirtyType=h,ht=a,zt=l,gt=c}return s})(typeof t=="string"?JSON.parse(t):t,this,n)}read(t){return cr(this),this.getEditorState().read(t,{editor:this})}update(t,n){(function(r,o,i){r._updating?r._updates.push([o,i]):hc(r,o,i)})(this,t,n)}focus(t,n={}){const r=this._rootElement;r!==null&&(r.setAttribute("autocapitalize","off"),Gn(this,()=>{const o=Z(),i=qe();o!==null?o.dirty||Ge(o.clone()):i.getChildrenSize()!==0&&(n.defaultSelection==="rootStart"?i.selectStart():i.selectEnd()),tM("focus"),nM(()=>{r.removeAttribute("autocapitalize"),t&&t()})}),this._pendingEditorState===null&&r.removeAttribute("autocapitalize"))}blur(){const t=this._rootElement;t!==null&&t.blur();const n=Ot(this._window);n!==null&&n.removeAllRanges()}isEditable(){return this._editable}setEditable(t){this._editable!==t&&(this._editable=t,As("editable",this,!0,t))}toJSON(){return{editorState:this._editorState.toJSON()}}}Ii.version="0.39.0+prod.esm";let tf=null;function Kh(e){tf=e}let ZN=1;function Ub(e,t){const n=Uh(e,t);return n===void 0&&X(30,t),n}function Uh(e,t){return e._nodes.get(t)}const JN=typeof queueMicrotask=="function"?queueMicrotask:e=>{Promise.resolve().then(e)};function Gb(e){return Te(Ut(e))}function Gh(e){const t=document.activeElement;if(!Be(t))return!1;const n=t.nodeName;return Te(Ut(e))&&(n==="INPUT"||n==="TEXTAREA"||t.contentEditable==="true"&&gc(t)==null)}function la(e,t,n){const r=e.getRootElement();try{return r!==null&&r.contains(t)&&r.contains(n)&&t!==null&&!Gh(t)&&qb(t)===e}catch{return!1}}function qh(e){return e instanceof Ii}function qb(e){let t=e;for(;t!=null;){const n=gc(t);if(qh(n))return n;t=ca(t)}return null}function gc(e){return e?e.__lexicalEditor:null}function Eo(e){return cc(e)||e.isToken()}function sr(e){return Eo(e)||e.isSegmented()}function Cr(e){return Cn(e)&&e.nodeType===3}function Yb(e){return Cn(e)&&e.nodeType===9}function Di(e){let t=e;for(;t!=null;){if(Cr(t))return t;t=t.firstChild}return null}function Ol(e,t,n){const r=Kr[t];if(n!==null&&(e&r)===(n&r))return e;let o=e^r;return t==="subscript"?o&=-65:t==="superscript"?o&=-33:t==="lowercase"?(o&=-513,o&=-1025):t==="uppercase"?(o&=-257,o&=-1025):t==="capitalize"&&(o&=-257,o&=-513),o}function Xb(e){return J(e)||Un(e)||Te(e)}function Zb(e,t){const n=(function(){const s=tf;return tf=null,s})();if((t=t||n&&n.__key)!=null)return void(e.__key=t);ft(),jb();const r=$e(),o=Jr(),i=""+ZN++;o._nodeMap.set(i,e),B(e)?r._dirtyElements.set(i,!0):r._dirtyLeaves.add(i),r._cloneNotNeeded.add(i),r._dirtyType=1,e.__key=i}function Ro(e){const t=e.getParent();if(t!==null){const n=e.getWritable(),r=t.getWritable(),o=e.getPreviousSibling(),i=e.getNextSibling(),s=i!==null?i.__key:null,a=o!==null?o.__key:null,l=o!==null?o.getWritable():null,c=i!==null?i.getWritable():null;o===null&&(r.__first=s),i===null&&(r.__last=a),l!==null&&(l.__next=s),c!==null&&(c.__prev=a),n.__prev=null,n.__next=null,n.__parent=null,r.__size--}}function Il(e){jb(),Ll(e)&&X(323,e.__key,e.__type);const t=e.getLatest(),n=t.__parent,r=Jr(),o=$e(),i=r._nodeMap,s=o._dirtyElements;n!==null&&(function(l,c,u){let f=l;for(;f!==null;){if(u.has(f))return;const d=c.get(f);if(d===void 0)break;u.set(f,!1),f=d.__parent}})(n,i,s);const a=t.__key;o._dirtyType=1,B(e)?s.set(a,!0):o._dirtyLeaves.add(a)}function yt(e){ft();const t=$e(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,n!==null){const r=Pe(n);r!==null&&r.getWritable()}if(e!==null){const r=Pe(e);r!==null&&r.getWritable()}}}function Mr(){return Ji()?null:$e()._compositionKey}function Pe(e,t){const n=(t||Jr())._nodeMap.get(e);return n===void 0?null:n}function Jb(e,t){const n=pc(e,$e());return n!==void 0?Pe(n,t):null}function pc(e,t){return e[`__lexicalKey_${t._key}`]}function Ut(e,t){let n=e;for(;n!=null;){const r=Jb(n,t);if(r!==null)return r;n=ca(n)}return null}function Qb(e){const t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function cy(e){return e.read(()=>qe().getTextContent())}function qe(){return ew(Jr())}function ew(e){return e._nodeMap.get("root")}function Ge(e){ft();const t=Jr();e!==null&&(e.dirty=!0,e.setCachedNodes(null)),t._selection=e}function wi(e){const t=$e(),n=(function(r,o){let i=r;for(;i!=null;){const s=pc(i,o);if(s!==void 0)return s;i=ca(i)}return null})(e,t);return n===null?e===t.getRootElement()?Pe("root"):null:Pe(n)}function tw(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function Yh(e){const t=[];let n=e;for(;n!==null;)t.push(n),n=n._parentEditor;return t}function nw(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function rw(e){return Cr(e)?e.nodeValue:null}function Xh(e,t,n){const r=Ot(hn(t));if(r===null)return;const o=r.anchorNode;let{anchorOffset:i,focusOffset:s}=r;if(o!==null){let a=rw(o);const l=Ut(o);if(a!==null&&J(l)){if(a===rc&&n){const c=n.length;a=n,i=c,s=c}a!==null&&Zh(l,a,i,s,e)}}}function Zh(e,t,n,r,o){let i=e;if(i.isAttached()&&(o||!i.isDirty())){const s=i.isComposing();let a=t;(s||o)&&t[t.length-1]===rc&&(a=t.slice(0,-1));const l=i.getTextContent();if(o||a!==l){if(a===""){if(yt(null),oa||qi||ia)i.remove();else{const p=$e();setTimeout(()=>{p.update(()=>{i.isAttached()&&i.remove()})},20)}return}const c=i.getParent(),u=Zn(),f=i.getTextContentSize(),d=Mr(),h=i.getKey();if(i.isToken()||d!==null&&h===d&&!s||W(u)&&(c!==null&&!c.canInsertTextBefore()&&u.anchor.offset===0||u.anchor.key===e.__key&&u.anchor.offset===0&&!i.canInsertTextBefore()&&!s||u.focus.key===e.__key&&u.focus.offset===f&&!i.canInsertTextAfter()&&!s))return void i.markDirty();const g=Z();if(!W(g)||n===null||r===null)return void uy(i,a,g);if(g.setTextNodeRange(i,n,i,r),i.isSegmented()){const p=Fe(i.getTextContent());i.replace(p),i=p}uy(i,a,g)}}}function uy(e,t,n){if(e.setTextContent(t),W(n)){const r=e.getKey();for(const o of["anchor","focus"]){const i=n[o];i.type==="text"&&i.key===r&&(i.offset=Yn(e,i.offset,"clamp"))}}}function Fa(e,t,n){const r=t[n]||!1;return r==="any"||r===e[n]}function QN(e,t){return Fa(e,t,"altKey")&&Fa(e,t,"ctrlKey")&&Fa(e,t,"shiftKey")&&Fa(e,t,"metaKey")}function Me(e,t,n){return QN(e,n)&&e.key.toLowerCase()===t.toLowerCase()}const rr={ctrlKey:!wn,metaKey:wn},dy={altKey:wn,ctrlKey:!wn};function fy(e){return e.key==="Backspace"}function hy(e){return Me(e,"a",rr)}function eM(e){const t=qe();if(W(e)){const n=e.anchor,r=e.focus,o=n.getNode().getTopLevelElementOrThrow().getParentOrThrow();return n.set(o.getKey(),0,"element"),r.set(o.getKey(),o.getChildrenSize(),"element"),Hs(e),e}{const n=t.select(0,t.getChildrenSize());return Ge(Hs(n)),n}}function ki(e,t){e.__lexicalClassNameCache===void 0&&(e.__lexicalClassNameCache={});const n=e.__lexicalClassNameCache,r=n[t];if(r!==void 0)return r;const o=e[t];if(typeof o=="string"){const i=Z1(o);return n[t]=i,i}return o}function Jh(e,t,n,r,o){if(n.size===0)return;const i=r.__type,s=r.__key,a=t.get(i);a===void 0&&X(33,i);const l=a.klass;let c=e.get(l);c===void 0&&(c=new Map,e.set(l,c));const u=c.get(s),f=u==="destroyed"&&o==="created";(u===void 0||f)&&c.set(s,f?"updated":o)}function gy(e,t,n){const r=e.getParent();let o=n,i=e;return r!==null&&(t&&n===0?(o=i.getIndexWithinParent(),i=r):t||n!==i.getChildrenSize()||(o=i.getIndexWithinParent()+1,i=r)),i.getChildAtIndex(t?o-1:o)}function nf(e,t){const n=e.offset;if(e.type==="element")return gy(e.getNode(),t,n);{const r=e.getNode();if(t&&n===0||!t&&n===r.getTextContentSize()){const o=t?r.getPreviousSibling():r.getNextSibling();return o===null?gy(r.getParentOrThrow(),t,r.getIndexWithinParent()+(t?0:1)):o}}return null}function ow(e){const t=hn(e).event,n=t&&t.inputType;return n==="insertFromPaste"||n==="insertFromPasteAsQuotation"}function te(e,t,n){return(function(r,o,i){const s=Yh(r);for(let a=4;a>=0;a--)for(let l=0;l<s.length;l++){const c=s[l],u=c._commands.get(o);if(u!==void 0){const f=u[a];if(f!==void 0){const d=Array.from(f),h=d.length;let g=!1;if(Gn(c,()=>{for(let p=0;p<h;p++)if(d[p](i,r))return void(g=!0)}),g)return g}}}return!1})(e,t,n)}function mc(e){return!at(e)&&!e.isLastChild()&&!e.isInline()}function Fo(e,t){const n=e._keyToDOMMap.get(t);return n===void 0&&X(75,t),n}function ca(e){const t=e.assignedSlot||e.parentElement;return sf(t)?t.host:t}function iw(e){return Yb(e)?e:Be(e)?e.ownerDocument:null}function tM(e){ft(),$e()._updateTags.add(e)}function nM(e){ft(),$e()._deferred.push(e)}function rf(e,t){let n=e.getParent();for(;n!==null;){if(n.is(t))return!0;n=n.getParent()}return!1}function Qh(e){const t=iw(e);return t?t.defaultView:null}function hn(e){const t=e._window;return t===null&&X(78),t}function rM(e){return B(e)&&e.isInline()||Te(e)&&e.isInline()}function oM(e){let t=e.getParentOrThrow();for(;t!==null;){if(vt(t))return t;t=t.getParentOrThrow()}return t}function vt(e){return at(e)||B(e)&&e.isShadowRoot()}function iM(e){const t=e.constructor.clone(e);return Zb(t,null),t.afterCloneFrom(e),t}function Et(e){const t=$e(),n=e.getType(),r=Uh(t,n);r===void 0&&X(200,e.constructor.name,n);const{replace:o,replaceWithKlass:i}=r;if(o!==null){const s=o(e),a=s.constructor;return i!==null?s instanceof i||X(201,i.name,i.getType(),a.name,a.getType(),e.constructor.name,n):s instanceof e.constructor&&a!==e.constructor||X(202,a.name,a.getType(),e.constructor.name,n),s.__key===e.__key&&X(203,e.constructor.name,n,a.name,a.getType()),s}return e}function pu(e,t){!at(e.getParent())||B(t)||Te(t)||X(99)}function sM(e){const t=Pe(e);return t===null&&X(63,e),t}function mu(e){return(Te(e)||B(e)&&!e.canBeEmpty())&&!e.isInline()}function of(e,t,n){n.style.removeProperty("caret-color"),t._blockCursorElement=null;const r=e.parentElement;r!==null&&r.removeChild(e)}function Ot(e){return Ln?(e||window).getSelection():null}function aM(e){const t=Qh(e);return t?t.getSelection():null}function sw(e){return Be(e)&&e.tagName==="A"}function Be(e){return Cn(e)&&e.nodeType===1}function Cn(e){return typeof e=="object"&&e!==null&&"nodeType"in e&&typeof e.nodeType=="number"}function sf(e){return Cn(e)&&e.nodeType===11}function af(e){const t=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return e.nodeName.match(t)!==null}function Dl(e){const t=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return e.nodeName.match(t)!==null}function Nr(e){if(Te(e)&&!e.isInline())return!0;if(!B(e)||vt(e))return!1;const t=e.getFirstChild(),n=t===null||Un(t)||J(t)||t.isInline();return!e.isInline()&&e.canBeEmpty()!==!1&&n}function es(){return $e()}const py=new WeakMap,lM=new Map;function my(e){if(!e._readOnly&&e.isEmpty())return lM;e._readOnly||X(192);let t=py.get(e);return t||(t=(function(n){const r=new Map;for(const[o,i]of n._nodeMap){const s=i.__type;let a=r.get(s);a||(a=new Map,r.set(s,a)),a.set(o,i)}return r})(e),py.set(e,t)),t}function aw(e){const t=e.constructor.clone(e);return t.afterCloneFrom(e),t}function cM(e){return(t=aw(e))[Mb]=!0,t;var t}function eg(e,t){const n=parseInt(e.style.paddingInlineStart,10)||0,r=Math.round(n/40);t.setIndent(r)}function uM(e){e.__lexicalUnmanaged=!0}function dM(e){return e.__lexicalUnmanaged===!0}function cs(e,t){return(function(n,r){return Object.prototype.hasOwnProperty.call(n,r)})(e,t)&&e[t]!==Kn[t]}function yc(e){const t=Am in e.prototype?e.prototype[Am]():void 0,n=(function(s){if(!(s===Kn||s.prototype instanceof Kn)){let a="<unknown>",l="<unknown>";try{a=s.getType()}catch{}try{Ii.version&&(l=JSON.parse(Ii.version))}catch{}X(290,s.name,a,l)}return s===sa||s===Tt||s===Kn})(e),r=!n&&cs(e,"getType")?e.getType():void 0;let o,i=r;if(t)if(r)o=t[r];else for(const[s,a]of Object.entries(t))i=s,o=a;if(!n&&i&&(cs(e,"getType")||(e.getType=()=>i),cs(e,"clone")||(e.clone=s=>(Kh(s),new e)),cs(e,"importJSON")||(e.importJSON=o&&o.$importJSON||(s=>new e().updateFromJSON(s))),!cs(e,"importDOM")&&o)){const{importDOM:s}=o;s&&(e.importDOM=()=>s)}return{ownNodeConfig:o,ownNodeType:i}}function lw(e){const t=es();return ft(),new(t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e))).klass}const we=(e,t)=>{let n=e;for(;n!=null&&!at(n);){if(t(n))return n;n=n.getParent()}return null},fM={next:"previous",previous:"next"};class tg{origin;constructor(t){this.origin=t}[Symbol.iterator](){return og({hasNext:Ur,initial:this.getAdjacentCaret(),map:t=>t,step:t=>t.getAdjacentCaret()})}getAdjacentCaret(){return nt(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return nt(this.origin,this.direction)}remove(){const t=this.getNodeAtCaret();return t&&t.remove(),this}replaceOrInsert(t,n){const r=this.getNodeAtCaret();return t.is(this.origin)||t.is(r)||(r===null?this.insert(t):r.replace(t,n)),this}splice(t,n,r="next"){const o=r===this.direction?n:Array.from(n).reverse();let i=this;const s=this.getParentAtCaret(),a=new Map;for(let l=i.getAdjacentCaret();l!==null&&a.size<t;l=l.getAdjacentCaret()){const c=l.origin.getWritable();a.set(c.getKey(),c)}for(const l of o){if(a.size>0){const c=i.getNodeAtCaret();if(c){if(a.delete(c.getKey()),a.delete(l.getKey()),!(c.is(l)||i.origin.is(l))){const u=l.getParent();u&&u.is(s)&&l.remove(),c.replace(l)}}else c===null&&X(263,Array.from(a).join(" "))}else i.insert(l);i=nt(l,this.direction)}for(const l of a.values())l.remove();return this}}class Gs extends tg{type="child";getLatest(){const t=this.origin.getLatest();return t===this.origin?this:$t(t,this.direction)}getParentCaret(t="root"){return nt(ng(this.getParentAtCaret(),t),this.direction)}getFlipped(){const t=Ko(this.direction);return nt(this.getNodeAtCaret(),t)||$t(this.origin,t)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(t){return t instanceof Gs&&this.direction===t.direction&&this.origin.is(t.origin)}isSamePointCaret(t){return this.isSameNodeCaret(t)}}const hM={root:at,shadowRoot:vt};function Ko(e){return fM[e]}function ng(e,t="root"){return hM[t](e)?null:e}class $o extends tg{type="sibling";getLatest(){const t=this.origin.getLatest();return t===this.origin?this:nt(t,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return B(this.origin)?$t(this.origin,this.direction):null}getParentCaret(t="root"){return nt(ng(this.getParentAtCaret(),t),this.direction)}getFlipped(){const t=Ko(this.direction);return nt(this.getNodeAtCaret(),t)||$t(this.origin.getParentOrThrow(),t)}isSamePointCaret(t){return t instanceof $o&&this.direction===t.direction&&this.origin.is(t.origin)}isSameNodeCaret(t){return(t instanceof $o||t instanceof Oo)&&this.direction===t.direction&&this.origin.is(t.origin)}}class Oo extends tg{type="text";offset;constructor(t,n){super(t),this.offset=n}getLatest(){const t=this.origin.getLatest();return t===this.origin?this:Io(t,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(t="root"){return nt(ng(this.getParentAtCaret(),t),this.direction)}getFlipped(){return Io(this.origin,Ko(this.direction),this.offset)}isSamePointCaret(t){return t instanceof Oo&&this.direction===t.direction&&this.origin.is(t.origin)&&this.offset===t.offset}isSameNodeCaret(t){return(t instanceof $o||t instanceof Oo)&&this.direction===t.direction&&this.origin.is(t.origin)}getSiblingCaret(){return nt(this.origin,this.direction)}}function qn(e){return e instanceof Oo}function Ur(e){return e instanceof $o}function Ht(e){return e instanceof Gs}const gM={next:class extends Oo{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends Oo{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},pM={next:class extends $o{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends $o{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},mM={next:class extends Gs{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends Gs{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function nt(e,t){return e?new pM[t](e):null}function Io(e,t,n){return e?new gM[t](e,Yn(e,n)):null}function Yn(e,t,n="error"){const r=e.getTextContentSize();let o=t==="next"?r:t==="previous"?0:t;return(o<0||o>r)&&(n!=="clamp"&&Y1(284,String(t),String(r),e.getKey()),o=o<0?0:r),o}function yy(e,t){return new vM(e,t)}function $t(e,t){return B(e)?new mM[t](e):null}function yM(e){return e&&e.getChildCaret()||e}function ua(e){return e&&yM(e.getAdjacentCaret())}class rg{type="node-caret-range";direction;anchor;focus;constructor(t,n,r){this.anchor=t,this.focus=n,this.direction=r}getLatest(){const t=this.anchor.getLatest(),n=this.focus.getLatest();return t===this.anchor&&n===this.focus?this:new rg(t,n,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){const t=o=>{const i=this[o].getLatest();return qn(i)?(function(s,a){const{direction:l,origin:c}=s,u=Yn(c,a==="focus"?Ko(l):l);return yy(s,u-s.offset)})(i,o):null},n=t("anchor"),r=t("focus");if(n&&r){const{caret:o}=n,{caret:i}=r;if(o.isSameNodeCaret(i))return[yy(o,i.offset-o.offset),null]}return[n,r]}iterNodeCarets(t="root"){const n=qn(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),r=this.focus.getLatest(),o=qn(r),i=s=>s.isSameNodeCaret(r)?null:ua(s)||s.getParentCaret(t);return og({hasNext:s=>s!==null&&!(o&&r.isSameNodeCaret(s)),initial:n.isSameNodeCaret(r)?null:i(n),map:s=>s,step:i})}[Symbol.iterator](){return this.iterNodeCarets("root")}}class vM{type="slice";caret;distance;constructor(t,n){this.caret=t,this.distance=n}getSliceIndices(){const{distance:t,caret:{offset:n}}=this,r=n+t;return r<n?[r,n]:[n,r]}getTextContent(){const[t,n]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(t,n)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){const{caret:{origin:t,direction:n}}=this,[r,o]=this.getSliceIndices(),i=t.getTextContent();return Io(t.setTextContent(i.slice(0,r)+i.slice(o)),n,r)}}function qs(e){return Gr(e,nt(qe(),e.direction))}function cw(e){return Gr(e,e)}function Gr(e,t){return e.direction!==t.direction&&X(265),new rg(e,t,e.direction)}function og(e){const{initial:t,hasNext:n,step:r,map:o}=e;let i=t;return{[Symbol.iterator](){return this},next(){if(!n(i))return{done:!0,value:void 0};const s={done:!1,value:o(i)};return i=r(i),s}}}function uw(e,t){const n=al(e.origin,t.origin);switch(n===null&&X(275,e.origin.getKey(),t.origin.getKey()),n.type){case"same":{const r=e.type==="text",o=t.type==="text";return r&&o?(function(i,s){return Math.sign(i-s)})(e.offset,t.offset):e.type===t.type?0:r?-1:o?1:e.type==="child"?-1:1}case"ancestor":return e.type==="child"?-1:1;case"descendant":return t.type==="child"?1:-1;case"branch":return dw(n)}}function dw(e){const{a:t,b:n}=e,r=t.__key,o=n.__key;let i=t,s=n;for(;i&&s;i=i.getNextSibling(),s=s.getNextSibling()){if(i.__key===o)return-1;if(s.__key===r)return 1}return i===null?1:-1}function $a(e,t){return t.is(e)}function vy(e){return B(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function al(e,t){if(e.is(t))return{commonAncestor:e,type:"same"};const n=new Map;for(let[r,o]=vy(e);r;o=r,r=r.getParent())n.set(r,o);for(let[r,o]=vy(t);r;o=r,r=r.getParent()){const i=n.get(r);if(i!==void 0)return i===null?($a(e,r)||X(276),{commonAncestor:r,type:"ancestor"}):o===null?($a(t,r)||X(277),{commonAncestor:r,type:"descendant"}):((B(i)||$a(e,i))&&(B(o)||$a(t,o))&&r.is(i.getParent())&&r.is(o.getParent())||X(278),{a:i,b:o,commonAncestor:r,type:"branch"})}return null}function An(e,t){const{type:n,key:r,offset:o}=e,i=sM(e.key);return n==="text"?(J(i)||X(266,i.getType(),r),Io(i,t,o)):(B(i)||X(267,i.getType(),r),bM(i,e.offset,t))}function Sn(e,t){const{origin:n,direction:r}=t,o=r==="next";qn(t)?e.set(n.getKey(),t.offset,"text"):Ur(t)?J(n)?e.set(n.getKey(),Yn(n,r),"text"):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+(o?1:0),"element"):(Ht(t)&&B(n)||X(268),e.set(n.getKey(),o?0:n.getChildrenSize(),"element"))}function fw(e){const t=Z(),n=W(t)?t:dc();return ll(n,e),Ge(n),n}function ll(e,t){Sn(e.anchor,t.anchor),Sn(e.focus,t.focus)}function xy(e){const{anchor:t,focus:n}=e,r=An(t,"next"),o=An(n,"next"),i=uw(r,o)<=0?"next":"previous";return Gr(wr(r,i),wr(o,i))}function da(e){const{direction:t,origin:n}=e,r=nt(n,Ko(t)).getNodeAtCaret();return r?nt(r,t):$t(n.getParentOrThrow(),t)}function by(e,t="root"){const n=[e];for(let r=Ht(e)?e.getParentCaret(t):e.getSiblingCaret();r!==null;r=r.getParentCaret(t))n.push(da(r));return n}function yu(e){return!!e&&e.origin.isAttached()}function xM(e,t="removeEmptySlices"){if(e.isCollapsed())return e;const n="root",r="next";let o=t;const i=hw(e,r),s=by(i.anchor,n),a=by(i.focus.getFlipped(),n),l=new Set,c=[];for(const g of i.iterNodeCarets(n))if(Ht(g))l.add(g.origin.getKey());else if(Ur(g)){const{origin:p}=g;B(p)&&!l.has(p.getKey())||c.push(p)}for(const g of c)g.remove();for(const g of i.getTextSlices()){if(!g)continue;const{origin:p}=g.caret,m=p.getTextContentSize(),v=da(nt(p,r)),y=p.getMode();if(Math.abs(g.distance)===m&&o==="removeEmptySlices"||y==="token"&&g.distance!==0)v.remove();else if(g.distance!==0){o="removeEmptySlices";let x=g.removeTextSlice();const b=g.caret.origin;if(y==="segmented"){const w=x.origin,_=Fe(w.getTextContent()).setStyle(w.getStyle()).setFormat(w.getFormat());v.replaceOrInsert(_),x=Io(_,r,x.offset)}b.is(s[0].origin)&&(s[0]=x),b.is(a[0].origin)&&(a[0]=x.getFlipped())}}let u,f;for(const g of s)if(yu(g)){u=Lt(g);break}for(const g of a)if(yu(g)){f=Lt(g);break}const d=(function(g,p,m){if(!g||!p)return null;const v=g.getParentAtCaret(),y=p.getParentAtCaret();if(!v||!y)return null;const x=v.getParents().reverse();x.push(v);const b=y.getParents().reverse();b.push(y);const w=Math.min(x.length,b.length);let _;for(_=0;_<w&&x[_]===b[_];_++);const E=(P,F)=>{let $;for(let j=_;j<P.length;j++){const O=P[j];if(vt(O))return;!$&&F(O)&&($=O)}return $},R=E(x,Nr),k=R&&E(b,P=>m.has(P.getKey())&&Nr(P));return R&&k?[R,k]:null})(u,f,l);if(d){const[g,p]=d;$t(g,"previous").splice(0,p.getChildren()),p.remove()}const h=[u,f,...s,...a].find(yu);if(h)return cw(wr(Lt(h),e.direction));X(269,JSON.stringify(s.map(g=>g.origin.__key)))}function Lt(e){const t=(function(o){let i=o;for(;Ht(i);){const s=ua(i);if(!Ht(s))break;i=s}return i})(e.getLatest()),{direction:n}=t;if(J(t.origin))return qn(t)?t:Io(t.origin,n,n);const r=t.getAdjacentCaret();return Ur(r)&&J(r.origin)?Io(r.origin,n,Ko(n)):t}function ig(e){return qn(e)&&e.offset!==Yn(e.origin,e.direction)}function wr(e,t){return e.direction===t?e:e.getFlipped()}function hw(e,t){return e.direction===t?e:Gr(wr(e.focus,t),wr(e.anchor,t))}function bM(e,t,n){let r=$t(e,"next");for(let o=0;o<t;o++){const i=r.getAdjacentCaret();if(i===null)break;r=i}return wr(r,n)}function wM(e){const{origin:t,offset:n,direction:r}=e;if(n===Yn(t,r))return e.getSiblingCaret();if(n===Yn(t,Ko(r)))return da(e.getSiblingCaret());const[o]=t.splitText(n);return J(o)||X(281),wr(nt(o,"next"),r)}function CM(e,t){return!0}function SM(e,{$copyElementNode:t=iM,$splitTextPointCaretNext:n=wM,rootMode:r="shadowRoot",$shouldSplit:o=CM}={}){if(qn(e))return n(e);const i=e.getParentCaret(r);if(i){const{origin:s}=i;if(Ht(e)&&(!s.canBeEmpty()||!o(s,"first")))return da(i);const a=(function(l){const c=[];for(let u=l.getAdjacentCaret();u;u=u.getAdjacentCaret())c.push(u.origin);return c})(e);(a.length>0||s.canBeEmpty()&&o(s,"last"))&&i.insert(t(s).splice(0,0,a))}return i}function _M(e,t){if(!t||e===t)return e;for(const n in t)if(e[n]!==t[n])return{...e,...t};return e}const lf=new Map;function gw(e){const t={};if(!e)return t;const n=e.split(";");for(const r of n)if(r!==""){const[o,i]=r.split(/:([^]+)/);o&&i&&(t[o.trim()]=i.trim())}return t}function wy(e){let t=lf.get(e);return t===void 0&&(t=gw(e),lf.set(e,t)),t}function pw(e){const t=es().getElementByKey(e.getKey());if(t===null)return null;const n=t.ownerDocument.defaultView;return n===null?null:n.getComputedStyle(t)}function mw(e){return pw(at(e)?e:e.getParentOrThrow())}function Cy(e){const t=mw(e);return t!==null&&t.direction==="rtl"}function yw(e,t,n="self"){const r=e.getStartEndPoints();if(t.isSelected(e)&&!sr(t)&&r!==null){const[o,i]=r,s=e.isBackward(),a=o.getNode(),l=i.getNode(),c=t.is(a),u=t.is(l);if(c||u){const[f,d]=Qd(e),h=a.is(l),g=t.is(s?l:a),p=t.is(s?a:l);let m,v=0;h?(v=f>d?d:f,m=f>d?f:d):g?(v=s?d:f,m=void 0):p&&(v=0,m=s?f:d);const y=t.__text.slice(v,m);y!==t.__text&&(n==="clone"&&(t=cM(t)),t.__text=y)}}return t}function TM(e){const t=e.getStyle(),n=gw(t);lf.set(t,n)}function vw(e){const t=xw(e);return t!==null&&t.writingMode==="vertical-rl"}function xw(e){const t=e.anchor.getNode();return B(t)?pw(t):mw(t)}function Sy(e,t){let n=vw(e)?!t:t;bw(e)&&(n=!n);const r=An(e.focus,n?"previous":"next");if(ig(r))return!1;for(const o of qs(r)){if(Ht(o))return!o.origin.isInline();if(!B(o.origin)){if(Te(o.origin))return!0;break}}return!1}function EM(e,t,n,r){e.modify(t?"extend":"move",n,r)}function bw(e){const t=xw(e);return t!==null&&t.direction==="rtl"}function _y(e,t,n){const r=bw(e);let o;o=vw(e)||r?!n:n,EM(e,t,o,"character")}function ww(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const Cw=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,RM=Cw&&"documentMode"in document?document.documentMode:null;!(!Cw||!("InputEvent"in window)||RM)&&"getTargetRanges"in new window.InputEvent("input");function Sw(...e){const t=[];for(const n of e)if(n&&typeof n=="string")for(const[r]of n.matchAll(/\S+/g))t.push(r);return t}function Nn(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function et(e,...t){const n=Sw(...t);n.length>0&&e.classList.add(...n)}function Xn(e,...t){const n=Sw(...t);n.length>0&&e.classList.remove(...n)}function kM(e){return e?e.getAdjacentCaret():null}function AM(e,t){let n=e;for(;n!=null;){if(n instanceof t)return n;n=n.getParent()}return null}function NM(e){const t=we(e,n=>B(n)&&!n.isInline());return B(t)||ww(4,e.__key),t}function MM(e){const t=Z()||Zn();let n;if(W(t))n=An(t.focus,"next");else{if(t!=null){const s=t.getNodes(),a=s[s.length-1];a&&(n=nt(a,"next"))}n=n||$t(qe(),"previous").getFlipped().insert(ye())}const r=PM(e,n),o=ua(r),i=Ht(o)?Lt(o):r;return fw(cw(i)),e.getLatest()}function PM(e,t,n){let r=wr(t,"next");for(let o=r;o;o=SM(o,n))r=o;return qn(r)&&ww(283),r.insert(e.isInline()?ye().append(e):e),wr(nt(e.getLatest(),"next"),t.direction)}function Pr(e,t){return e!==null&&Object.getPrototypeOf(e).constructor.name===t.name}function LM(e,t){$t(e,"next").insert(t)}function _w(e,t){return Tw(e,t,null)}function Tw(e,t,n){let r=!1;for(const o of Rw(e))t(o)?n!==null&&n(o):(r=!0,B(o)&&Tw(o,t,n||(i=>o.insertAfter(i))),o.remove());return r}function Ew(e,t){const n=[],r=Array.from(e).reverse();for(let o=r.pop();o!==void 0;o=r.pop())if(t(o))n.push(o);else if(B(o))for(const i of Rw(o))r.push(i);return n}function Rw(e){return FM($t(e,"previous"))}function FM(e){return og({hasNext:Ur,initial:e.getAdjacentCaret(),map:t=>t.origin.getLatest(),step:t=>t.getAdjacentCaret()})}function kw(){const[e]=lt(),[t,n]=S.useState(!1),[r,o]=S.useState(!1),[i,s]=S.useState(!1),[a,l]=S.useState(!1),[c,u]=S.useState("left"),f=c==="left",d=c==="center",h=c==="right",g=S.useCallback(()=>{const v=Z();W(v)&&(n(v.hasFormat("bold")),o(v.hasFormat("italic")),s(v.hasFormat("underline")),l(v.hasFormat("strikethrough")))},[]),p=S.useCallback(v=>{u(v)},[]),m=S.useCallback(()=>{const v=Z();if(!W(v))return;const y=v.anchor.getNode(),x=y.getKey()==="root"?y:y.getTopLevelElementOrThrow();if(B(x)){const b=x.getFormatType();p(b)}},[p]);return S.useEffect(()=>{const v=Nn(e.registerCommand(Vt,(y,x)=>(e.read(()=>{g()}),!1),ur),e.registerCommand(Ti,(y,x)=>(e.read(()=>{p(y)}),!1),ur),e.registerCommand(hr,(y,x)=>(e.read(()=>{g(),m()}),!1),ur));return()=>{v()}},[e,g,p,m]),{isBold:t,isItalic:r,isUnderline:i,isStrikethrough:a,alignment:c,isAlignLeft:f,isAlignCenter:d,isAlignRight:h}}var ae=(e=>(e.BOLD="font-bold",e.ITALIC="font-italic",e.UNDERLINE="font-underline",e.STRIKETHROUGH="font-strikethrough",e.ALIGN_LEFT="align-left",e.ALIGN_CENTER="align-center",e.ALIGN_RIGHT="align-right",e.LINK="insert-link",e.IMAGE="insert-image",e.TABLE="insert-table",e.BULLET_LIST="insert-bullet-list",e.NUMBERED_LIST="insert-numbered-list",e))(ae||{});function $M(){const{isBold:e,isItalic:t,isUnderline:n,isStrikethrough:r,isAlignLeft:o,isAlignCenter:i,isAlignRight:s}=kw(),l=ra().toolbar.actions,{availableActions:c}=PA(),u=S.useMemo(()=>({id:ae.BOLD,IconComponent:SA,label:l.bold,isActive:e}),[l.bold,e]),f=S.useMemo(()=>({id:ae.ITALIC,IconComponent:TA,label:l.italic,isActive:t}),[l.italic,t]),d=S.useMemo(()=>({id:ae.UNDERLINE,IconComponent:MA,label:l.underline,isActive:n}),[l.underline,n]),h=S.useMemo(()=>({id:ae.STRIKETHROUGH,IconComponent:AA,label:l.strikethrough,isActive:r}),[l.strikethrough,r]),g=S.useMemo(()=>({id:ae.ALIGN_LEFT,IconComponent:wA,label:l.alignLeft,isActive:o}),[l.alignLeft,o]),p=S.useMemo(()=>({id:ae.ALIGN_CENTER,IconComponent:bA,label:l.alignCenter,isActive:i}),[l.alignCenter,i]),m=S.useMemo(()=>({id:ae.ALIGN_RIGHT,IconComponent:CA,label:l.alignRight,isActive:s}),[l.alignRight,s]),v=S.useMemo(()=>({id:ae.BULLET_LIST,IconComponent:RA,label:l.bulletList}),[l.bulletList]),y=S.useMemo(()=>({id:ae.NUMBERED_LIST,IconComponent:kA,label:l.numberedList}),[l.numberedList]),x=S.useMemo(()=>({id:ae.LINK,IconComponent:EA,label:l.link}),[l.link]),b=S.useMemo(()=>({id:ae.IMAGE,IconComponent:_A,label:l.image}),[l.image]),w=S.useMemo(()=>({id:ae.TABLE,IconComponent:NA,label:l.table}),[l.table]),_=S.useMemo(()=>({[ae.BOLD]:u,[ae.ITALIC]:f,[ae.UNDERLINE]:d,[ae.STRIKETHROUGH]:h,[ae.ALIGN_LEFT]:g,[ae.ALIGN_CENTER]:p,[ae.ALIGN_RIGHT]:m,[ae.BULLET_LIST]:v,[ae.NUMBERED_LIST]:y,[ae.LINK]:x,[ae.IMAGE]:b,[ae.TABLE]:w}),[u,f,d,h,g,p,m,v,y,x,b,w]),E=S.useMemo(()=>c.map(k=>k.map(P=>_[P])),[c,_]);return{availableActions:S.useMemo(()=>E.flat(),[E]),availableActionGroups:E}}const OM=Symbol.for("preact-signals");function sg(){if(Ai>1)return void Ai--;let e,t=!1;for(;Ms!==void 0;){let n=Ms;for(Ms=void 0,cf++;n!==void 0;){const r=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&Nw(n))try{n.c()}catch(o){t||(e=o,t=!0)}n=r}}if(cf=0,Ai--,t)throw e}let Ne,Ms;function Ty(e){const t=Ne;Ne=void 0;try{return e()}finally{Ne=t}}let Ai=0,cf=0,cl=0;function Ey(e){if(Ne===void 0)return;let t=e.n;return t===void 0||t.t!==Ne?(t={i:0,S:e,p:Ne.s,n:void 0,t:Ne,e:void 0,x:void 0,r:t},Ne.s!==void 0&&(Ne.s.n=t),Ne.s=t,e.n=t,32&Ne.f&&e.S(t),t):t.i===-1?(t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=Ne.s,t.n=void 0,Ne.s.n=t,Ne.s=t),t):void 0}function Nt(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function Aw(e,t){return new Nt(e,t)}function Nw(e){for(let t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function Ry(e){for(let t=e.s;t!==void 0;t=t.n){const n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function Mw(e){let t,n=e.s;for(;n!==void 0;){const r=n.p;n.i===-1?(n.S.U(n),r!==void 0&&(r.n=n.n),n.n!==void 0&&(n.n.p=r)):t=n,n.S.n=n.r,n.r!==void 0&&(n.r=void 0),n=r}e.s=t}function Jo(e,t){Nt.call(this,void 0),this.x=e,this.s=void 0,this.g=cl-1,this.f=4,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function Pw(e){const t=e.u;if(e.u=void 0,typeof t=="function"){Ai++;const n=Ne;Ne=void 0;try{t()}catch(r){throw e.f&=-2,e.f|=8,ag(e),r}finally{Ne=n,sg()}}}function ag(e){for(let t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Pw(e)}function IM(e){if(Ne!==this)throw new Error("Out-of-order effect");Mw(this),Ne=e,this.f&=-2,8&this.f&&ag(this),sg()}function fi(e,t){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=t?.name}function DM(e,t){const n=new fi(e,t);try{n.c()}catch(o){throw n.d(),o}const r=n.d.bind(n);return r[Symbol.dispose]=r,r}Nt.prototype.brand=OM,Nt.prototype.h=function(){return!0},Nt.prototype.S=function(e){const t=this.t;t!==e&&e.e===void 0&&(e.x=t,this.t=e,t!==void 0?t.e=e:Ty(()=>{var n;(n=this.W)==null||n.call(this)}))},Nt.prototype.U=function(e){if(this.t!==void 0){const t=e.e,n=e.x;t!==void 0&&(t.x=n,e.e=void 0),n!==void 0&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n,n===void 0&&Ty(()=>{var r;(r=this.Z)==null||r.call(this)}))}},Nt.prototype.subscribe=function(e){return DM(()=>{const t=this.value,n=Ne;Ne=void 0;try{e(t)}finally{Ne=n}},{name:"sub"})},Nt.prototype.valueOf=function(){return this.value},Nt.prototype.toString=function(){return this.value+""},Nt.prototype.toJSON=function(){return this.value},Nt.prototype.peek=function(){const e=Ne;Ne=void 0;try{return this.value}finally{Ne=e}},Object.defineProperty(Nt.prototype,"value",{get(){const e=Ey(this);return e!==void 0&&(e.i=this.i),this.v},set(e){if(e!==this.v){if(cf>100)throw new Error("Cycle detected");this.v=e,this.i++,cl++,Ai++;try{for(let t=this.t;t!==void 0;t=t.x)t.t.N()}finally{sg()}}}}),Jo.prototype=new Nt,Jo.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===cl))return!0;if(this.g=cl,this.f|=1,this.i>0&&!Nw(this))return this.f&=-2,!0;const e=Ne;try{Ry(this),Ne=this;const t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(t){this.v=t,this.f|=16,this.i++}return Ne=e,Mw(this),this.f&=-2,!0},Jo.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(let t=this.s;t!==void 0;t=t.n)t.S.S(t)}Nt.prototype.S.call(this,e)},Jo.prototype.U=function(e){if(this.t!==void 0&&(Nt.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(let t=this.s;t!==void 0;t=t.n)t.S.U(t)}},Jo.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(Jo.prototype,"value",{get(){if(1&this.f)throw new Error("Cycle detected");const e=Ey(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),fi.prototype.c=function(){const e=this.S();try{if(8&this.f||this.x===void 0)return;const t=this.x();typeof t=="function"&&(this.u=t)}finally{e()}},fi.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Pw(this),Ry(this),Ai++;const e=Ne;return Ne=this,IM.bind(this,e)},fi.prototype.N=function(){2&this.f||(this.f|=2,this.o=Ms,Ms=this)},fi.prototype.d=function(){this.f|=8,1&this.f||ag(this)},fi.prototype.dispose=function(){this.d()};function jM(e){return(typeof e.nodes=="function"?e.nodes():e.nodes)||[]}function Ie(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Lw(e,t){if(e&&t&&!Array.isArray(t)&&typeof e=="object"&&typeof t=="object"){const n=e,r=t;for(const o in r)n[o]=Lw(n[o],r[o]);return e}return t}const lg=0,uf=1,Fw=2,vu=3,Oa=4,Qo=5,xu=6,us=7;function bu(e){return e.id===lg}function $w(e){return e.id===Fw}function VM(e){return(function(t){return t.id===uf})(e)||Ie(305,String(e.id),String(uf)),Object.assign(e,{id:Fw})}const BM=new Set;let zM=class{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(t,n){this.builder=t,this.extension=n,this.configs=new Set,this.state={id:lg}}mergeConfigs(){let t=this.extension.config||{};const n=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):_M;for(const r of this.configs)t=n(t,r);return t}init(t){const n=this.state;$w(n)||Ie(306,String(n.id));const r={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},o={...r,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},i=(function(a,l,c){return Object.assign(a,{config:l,id:vu,registerState:c})})(n,this.mergeConfigs(),r);let s;this.state=i,this.extension.init&&(s=this.extension.init(t,i.config,r)),this.state=(function(a,l,c){return Object.assign(a,{id:Oa,initResult:l,registerState:c})})(i,s,o)}build(t){const n=this.state;let r;n.id!==Oa&&Ie(307,String(n.id),String(Qo)),this.extension.build&&(r=this.extension.build(t,n.config,n.registerState));const o={...n.registerState,getOutput:()=>r,getSignal:this.getSignal.bind(this)};this.state=(function(i,s,a){return Object.assign(i,{id:Qo,output:s,registerState:a})})(n,r,o)}register(t,n){this._signal=n;const r=this.state;r.id!==Qo&&Ie(308,String(r.id),String(Qo));const o=this.extension.register&&this.extension.register(t,r.config,r.registerState);return this.state=(function(i){return Object.assign(i,{id:xu})})(r),()=>{const i=this.state;i.id!==us&&Ie(309,String(r.id),String(us)),this.state=(function(s){return Object.assign(s,{id:Qo})})(i),o&&o()}}afterRegistration(t){const n=this.state;let r;return n.id!==xu&&Ie(310,String(n.id),String(xu)),this.extension.afterRegistration&&(r=this.extension.afterRegistration(t,n.config,n.registerState)),this.state=(function(o){return Object.assign(o,{id:us})})(n),r}getSignal(){return this._signal===void 0&&Ie(311),this._signal}getInitResult(){this.extension.init===void 0&&Ie(312,this.extension.name);const t=this.state;return(function(n){return n.id>=Oa})(t)||Ie(313,String(t.id),String(Oa)),t.initResult}getInitPeer(t){const n=this.builder.extensionNameMap.get(t);return n?n.getExtensionInitDependency():void 0}getExtensionInitDependency(){const t=this.state;return(function(n){return n.id>=vu})(t)||Ie(314,String(t.id),String(vu)),{config:t.config}}getPeer(t){const n=this.builder.extensionNameMap.get(t);return n?n.getExtensionDependency():void 0}getInitDependency(t){const n=this.builder.getExtensionRep(t);return n===void 0&&Ie(315,this.extension.name,t.name),n.getExtensionInitDependency()}getDependency(t){const n=this.builder.getExtensionRep(t);return n===void 0&&Ie(315,this.extension.name,t.name),n.getExtensionDependency()}getState(){const t=this.state;return(function(n){return n.id>=us})(t)||Ie(316,String(t.id),String(us)),t}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||BM}getPeerNameSet(){let t=this._peerNameSet;return t||(t=new Set((this.extension.peerDependencies||[]).map(([n])=>n)),this._peerNameSet=t),t}getExtensionDependency(){if(!this._dependency){const t=this.state;(function(n){return n.id>=Qo})(t)||Ie(317,this.extension.name),this._dependency={config:t.config,init:t.initResult,output:t.output}}return this._dependency}};const ky={tag:Ri};function HM(){const e=qe();e.isEmpty()&&e.append(ye())}const WM={config:{setOptions:ky,updateOptions:ky},init:({$initialEditorState:e=HM})=>({$initialEditorState:e,initialized:!1}),afterRegistration(e,{updateOptions:t,setOptions:n},r){const o=r.getInitResult();if(!o.initialized){o.initialized=!0;const{$initialEditorState:i}=o;if(GN(i))e.setEditorState(i,n);else if(typeof i=="function")e.update(()=>{i(e)},t);else if(i&&(typeof i=="string"||typeof i=="object")){const s=e.parseEditorState(i);e.setEditorState(s,n)}}return()=>{}},name:"@lexical/extension/InitialState",nodes:[Qi,fn,Yi,Xi,Wo]},Ay=Symbol.for("@lexical/extension/LexicalBuilder");function Ny(){}function KM(e){throw e}function Ia(e){return Array.isArray(e)?e:[e]}const wu="0.39.0+prod.esm";let UM=class ul{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(t){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=wu,this.roots=t;for(const n of t)this.addExtension(n)}static fromExtensions(t){const n=[Ia(WM)];for(const r of t)n.push(Ia(r));return new ul(n)}static maybeFromEditor(t){const n=t[Ay];return n&&(n.PACKAGE_VERSION!==wu&&Ie(292,n.PACKAGE_VERSION,wu),n instanceof ul||Ie(293)),n}static fromEditor(t){const n=ul.maybeFromEditor(t);return n===void 0&&Ie(294),n}constructEditor(){const{$initialEditorState:t,onError:n,...r}=this.buildCreateEditorArgs(),o=Object.assign(Kb({...r,...n?{onError:i=>{n(i,o)}}:{}}),{[Ay]:this});for(const i of this.sortedExtensionReps())i.build(o);return o}buildEditor(){let t=Ny;function n(){try{t()}finally{t=Ny}}const r=Object.assign(this.constructEditor(),{dispose:n,[Symbol.dispose]:n});return t=Nn(this.registerEditor(r),()=>r.setRootElement(null)),r}hasExtensionByName(t){return this.extensionNameMap.has(t)}getExtensionRep(t){const n=this.extensionNameMap.get(t.name);if(n)return n.extension!==t&&Ie(295,t.name),n}addEdge(t,n,r){const o=this.outgoingConfigEdges.get(t);o?o.set(n,r):this.outgoingConfigEdges.set(t,new Map([[n,r]]));const i=this.incomingEdges.get(n);i?i.add(t):this.incomingEdges.set(n,new Set([t]))}addExtension(t){this._sortedExtensionReps!==void 0&&Ie(296);const n=Ia(t),[r]=n;typeof r.name!="string"&&Ie(297,typeof r.name);let o=this.extensionNameMap.get(r.name);if(o!==void 0&&o.extension!==r&&Ie(298,r.name),!o){o=new zM(this,r),this.extensionNameMap.set(r.name,o);const i=this.conflicts.get(r.name);typeof i=="string"&&Ie(299,r.name,i);for(const s of r.conflictsWith||[])this.extensionNameMap.has(s)&&Ie(299,r.name,s),this.conflicts.set(s,r.name);for(const s of r.dependencies||[]){const a=Ia(s);this.addEdge(r.name,a[0].name,a.slice(1)),this.addExtension(a)}for(const[s,a]of r.peerDependencies||[])this.addEdge(r.name,s,a?[a]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;const t=[],n=(r,o)=>{let i=r.state;if($w(i))return;const s=r.extension.name;var a;bu(i)||Ie(300,s,o||"[unknown]"),bu(a=i)||Ie(304,String(a.id),String(lg)),i=Object.assign(a,{id:uf}),r.state=i;const l=this.outgoingConfigEdges.get(s);if(l)for(const c of l.keys()){const u=this.extensionNameMap.get(c);u&&n(u,s)}i=VM(i),r.state=i,t.push(r)};for(const r of this.extensionNameMap.values())bu(r.state)&&n(r);for(const r of t)for(const[o,i]of this.outgoingConfigEdges.get(r.extension.name)||[])if(i.length>0){const s=this.extensionNameMap.get(o);if(s)for(const a of i)s.configs.add(a)}for(const[r,...o]of this.roots)if(o.length>0){const i=this.extensionNameMap.get(r.name);i===void 0&&Ie(301,r.name);for(const s of o)i.configs.add(s)}return this._sortedExtensionReps=t,this._sortedExtensionReps}registerEditor(t){const n=this.sortedExtensionReps(),r=new AbortController,o=[()=>r.abort()],i=r.signal;for(const s of n){const a=s.register(t,i);a&&o.push(a)}for(const s of n){const a=s.afterRegistration(t);a&&o.push(a)}return Nn(...o)}buildCreateEditorArgs(){const t={},n=new Set,r=new Map,o=new Map,i={},s={},a=this.sortedExtensionReps();for(const u of a){const{extension:f}=u;if(f.onError!==void 0&&(t.onError=f.onError),f.disableEvents!==void 0&&(t.disableEvents=f.disableEvents),f.parentEditor!==void 0&&(t.parentEditor=f.parentEditor),f.editable!==void 0&&(t.editable=f.editable),f.namespace!==void 0&&(t.namespace=f.namespace),f.$initialEditorState!==void 0&&(t.$initialEditorState=f.$initialEditorState),f.nodes)for(const d of jM(f)){if(typeof d!="function"){const h=r.get(d.replace);h&&Ie(302,f.name,d.replace.name,h.extension.name),r.set(d.replace,u)}n.add(d)}if(f.html){if(f.html.export)for(const[d,h]of f.html.export.entries())o.set(d,h);f.html.import&&Object.assign(i,f.html.import)}f.theme&&Lw(s,f.theme)}Object.keys(s).length>0&&(t.theme=s),n.size&&(t.nodes=[...n]);const l=Object.keys(i).length>0,c=o.size>0;(l||c)&&(t.html={},l&&(t.html.import=i),c&&(t.html.export=o));for(const u of a)u.init(t);return t.onError||(t.onError=KM),t}},cg=class Ow extends sa{static getType(){return"horizontalrule"}static clone(t){return new Ow(t.__key)}static importJSON(t){return Iw().updateFromJSON(t)}static importDOM(){return{hr:()=>({conversion:GM,priority:0})}}exportDOM(){return{element:document.createElement("hr")}}createDOM(t){const n=document.createElement("hr");return et(n,t.theme.hr),n}getTextContent(){return`
45
+ `}isInline(){return!1}updateDOM(){return!1}};function GM(){return{node:Iw()}}function Iw(){return lw(cg)}function qM(e){return e instanceof cg}function Lr(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function df(e){let t=1,n=e.getParent();for(;n!=null;){if(ke(n)){const r=n.getParent();if(pe(r)){t++,n=r.getParent();continue}Lr(40)}return t}return t}function ff(e){let t=e.getParent();pe(t)||Lr(40);let n=t;for(;n!==null;)n=n.getParent(),pe(n)&&(t=n);return t}function Dw(e){let t=[];const n=e.getChildren().filter(ke);for(let r=0;r<n.length;r++){const o=n[r],i=o.getFirstChild();pe(i)?t=t.concat(Dw(i)):t.push(o)}return t}function Vn(e){return ke(e)&&pe(e.getFirstChild())}function My(e){return Zt().append(e)}function jw(e,t){return ke(e)&&(t.length===0||t.length===1&&e.is(t[0])&&e.getChildrenSize()===0)}function Py(e){const t=Z();if(t!==null){let n=t.getNodes();if(W(t)){const o=t.getStartEndPoints();o===null&&Lr(143);const[i]=o,s=i.getNode(),a=s.getParent();if(vt(s)){const l=s.getFirstChild();if(l)n=l.selectStart().getNodes();else{const c=ye();s.append(c),n=c.select().getNodes()}}else if(jw(s,n)){const l=Wt(e);if(vt(a)){s.replace(l);const c=Zt();B(s)&&(c.setFormat(s.getFormatType()),c.setIndent(s.getIndent())),l.append(c)}else if(ke(s)){const c=s.getParentOrThrow();Do(l,c.getChildren()),c.replace(l)}return}}const r=new Set;for(let o=0;o<n.length;o++){const i=n[o];if(B(i)&&i.isEmpty()&&!ke(i)&&!r.has(i.getKey())){Ly(i,e);continue}let s=Xb(i)?i.getParent():ke(i)&&i.isEmpty()?i:null;for(;s!=null;){const a=s.getKey();if(pe(s)){if(!r.has(a)){const l=Wt(e);Do(l,s.getChildren()),s.replace(l),r.add(a)}break}{const l=s.getParent();if(vt(l)&&!r.has(a)){r.add(a),Ly(s,e);break}s=l}}}}}function Do(e,t){e.splice(e.getChildrenSize(),0,t)}function Ly(e,t){if(pe(e))return e;const n=e.getPreviousSibling(),r=e.getNextSibling(),o=Zt();let i;if(Do(o,e.getChildren()),pe(n)&&t===n.getListType())n.append(o),pe(r)&&t===r.getListType()&&(Do(n,r.getChildren()),r.remove()),i=n;else if(pe(r)&&t===r.getListType())r.getFirstChildOrThrow().insertBefore(o),i=r;else{const s=Wt(t);s.append(o),e.replace(s),i=s}return o.setFormat(e.getFormatType()),o.setIndent(e.getIndent()),e.remove(),i}function ug(e,t){const n=e.getLastChild(),r=t.getFirstChild();n&&r&&Vn(n)&&Vn(r)&&(ug(n.getFirstChild(),r.getFirstChild()),r.remove());const o=t.getChildren();o.length>0&&e.append(...o),t.remove()}function YM(){const e=Z();if(W(e)){const t=new Set,n=e.getNodes(),r=e.anchor.getNode();if(jw(r,n))t.add(ff(r));else for(let o=0;o<n.length;o++){const i=n[o];if(Xb(i)){const s=AM(i,eo);s!=null&&t.add(ff(s))}}for(const o of t){let i=o;const s=Dw(o);for(const a of s){const l=ye().setTextStyle(e.style).setTextFormat(e.format);Do(l,a.getChildren()),i.insertAfter(l),i=l,a.__key===e.anchor.key&&Sn(e.anchor,Lt($t(l,"next"))),a.__key===e.focus.key&&Sn(e.focus,Lt($t(l,"next"))),a.remove()}o.remove()}}}function Vw(e){const t=e.getListType()!=="check";let n=e.getStart();for(const r of e.getChildren())ke(r)&&(r.getValue()!==n&&r.setValue(n),t&&r.getLatest().__checked!=null&&r.setChecked(void 0),pe(r.getFirstChild())||n++)}function XM(e){const t=new Set;if(Vn(e)||t.has(e.getKey()))return;const n=e.getParent(),r=e.getNextSibling(),o=e.getPreviousSibling();if(Vn(r)&&Vn(o)){const i=o.getFirstChild();if(pe(i)){i.append(e);const s=r.getFirstChild();pe(s)&&(Do(i,s.getChildren()),r.remove(),t.add(r.getKey()))}}else if(Vn(r)){const i=r.getFirstChild();if(pe(i)){const s=i.getFirstChild();s!==null&&s.insertBefore(e)}}else if(Vn(o)){const i=o.getFirstChild();pe(i)&&i.append(e)}else if(pe(n)){const i=Zt().setTextFormat(e.getTextFormat()).setTextStyle(e.getTextStyle()),s=Wt(n.getListType()).setTextFormat(n.getTextFormat()).setTextStyle(n.getTextStyle());i.append(s),s.append(e),o?o.insertAfter(i):r?r.insertBefore(i):n.append(i)}}function ZM(e){if(Vn(e))return;const t=e.getParent(),n=t?t.getParent():void 0;if(pe(n?n.getParent():void 0)&&ke(n)&&pe(t)){const r=t?t.getFirstChild():void 0,o=t?t.getLastChild():void 0;if(e.is(r))n.insertBefore(e),t.isEmpty()&&n.remove();else if(e.is(o))n.insertAfter(e),t.isEmpty()&&n.remove();else{const i=t.getListType(),s=Zt(),a=Wt(i);s.append(a),e.getPreviousSiblings().forEach(u=>a.append(u));const l=Zt(),c=Wt(i);l.append(c),Do(c,e.getNextSiblings()),n.insertBefore(s),n.insertAfter(l),n.replace(e)}}}function JM(){const e=Z();if(!W(e)||!e.isCollapsed())return!1;const t=e.anchor.getNode();if(!ke(t)||t.getChildrenSize()!==0)return!1;const n=ff(t),r=t.getParent();pe(r)||Lr(40);const o=r.getParent();let i;if(vt(o))i=ye(),n.insertAfter(i);else{if(!ke(o))return!1;i=Zt(),o.insertAfter(i)}i.setTextStyle(e.style).setTextFormat(e.format).select();const s=t.getNextSiblings();if(s.length>0){const a=Wt(r.getListType());if(ke(i)){const l=Zt();l.append(a),i.insertAfter(l)}else i.insertAfter(a);a.append(...s)}return(function(a){let l=a;for(;l.getNextSibling()==null&&l.getPreviousSibling()==null;){const c=l.getParent();if(c==null||!ke(c)&&!pe(c))break;l=c}l.remove()})(t),!0}function jl(...e){const t=[];for(const n of e)if(n&&typeof n=="string")for(const[r]of n.matchAll(/\S+/g))t.push(r);return t}let eo=class extends Tt{__value;__checked;$config(){return this.config("listitem",{$transform:t=>{if(t.__checked==null)return;const n=t.getParent();pe(n)&&n.getListType()!=="check"&&t.getChecked()!=null&&t.setChecked(void 0)},extends:Tt,importDOM:{li:()=>({conversion:QM,priority:0})}})}constructor(t=1,n=void 0,r){super(r),this.__value=t===void 0?1:t,this.__checked=n}afterCloneFrom(t){super.afterCloneFrom(t),this.__value=t.__value,this.__checked=t.__checked}createDOM(t){const n=document.createElement("li");return this.updateListItemDOM(null,n,t),n}updateListItemDOM(t,n,r){(function(s,a,l){const c=a.getParent();!pe(c)||c.getListType()!=="check"||pe(a.getFirstChild())?(s.removeAttribute("role"),s.removeAttribute("tabIndex"),s.removeAttribute("aria-checked")):(s.setAttribute("role","checkbox"),s.setAttribute("tabIndex","-1"),l&&a.__checked===l.__checked||s.setAttribute("aria-checked",a.getChecked()?"true":"false"))})(n,this,t),n.value=this.__value,(function(s,a,l){const c=[],u=[],f=a.list,d=f?f.listitem:void 0;let h;if(f&&f.nested&&(h=f.nested.listitem),d!==void 0&&c.push(...jl(d)),f){const g=l.getParent(),p=pe(g)&&g.getListType()==="check",m=l.getChecked();p&&!m||u.push(f.listitemUnchecked),p&&m||u.push(f.listitemChecked),p&&c.push(m?f.listitemChecked:f.listitemUnchecked)}if(h!==void 0){const g=jl(h);l.getChildren().some(p=>pe(p))?c.push(...g):u.push(...g)}u.length>0&&Xn(s,...u),c.length>0&&et(s,...c)})(n,r.theme,this);const o=t?t.__style:"",i=this.__style;o!==i&&(i===""?n.removeAttribute("style"):n.style.cssText=i),(function(s,a,l){const c=wy(a.__textStyle);for(const u in c)s.style.setProperty(`--listitem-marker-${u}`,c[u]);if(l)for(const u in wy(l.__textStyle))u in c||s.style.removeProperty(`--listitem-marker-${u}`)})(n,this,t)}updateDOM(t,n,r){const o=n;return this.updateListItemDOM(t,o,r),!1}updateFromJSON(t){return super.updateFromJSON(t).setValue(t.value).setChecked(t.checked)}exportDOM(t){const n=this.createDOM(t._config),r=this.getFormatType();r&&(n.style.textAlign=r);const o=this.getDirection();return o&&(n.dir=o),{element:n}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...t){for(let n=0;n<t.length;n++){const r=t[n];if(B(r)&&this.canMergeWith(r)){const o=r.getChildren();this.append(...o),r.remove()}else super.append(r)}return this}replace(t,n){if(ke(t))return super.replace(t);this.setIndent(0);const r=this.getParentOrThrow();if(!pe(r))return t;if(r.__first===this.getKey())r.insertBefore(t);else if(r.__last===this.getKey())r.insertAfter(t);else{const o=Wt(r.getListType());let i=this.getNextSibling();for(;i;){const s=i;i=i.getNextSibling(),o.append(s)}r.insertAfter(t),t.insertAfter(o)}return n&&(B(t)||Lr(139),this.getChildren().forEach(o=>{t.append(o)})),this.remove(),r.getChildrenSize()===0&&r.remove(),t}insertAfter(t,n=!0){const r=this.getParentOrThrow();if(pe(r)||Lr(39),ke(t))return super.insertAfter(t,n);const o=this.getNextSiblings();if(r.insertAfter(t,n),o.length!==0){const i=Wt(r.getListType());o.forEach(s=>i.append(s)),t.insertAfter(i,n)}return t}remove(t){const n=this.getPreviousSibling(),r=this.getNextSibling();super.remove(t),n&&r&&Vn(n)&&Vn(r)&&(ug(n.getFirstChild(),r.getFirstChild()),r.remove())}insertNewAfter(t,n=!0){const r=Zt().updateFromJSON(this.exportJSON()).setChecked(!this.getChecked()&&void 0);return this.insertAfter(r,n),r}collapseAtStart(t){const n=ye();this.getChildren().forEach(s=>n.append(s));const r=this.getParentOrThrow(),o=r.getParentOrThrow(),i=ke(o);if(r.getChildrenSize()===1)if(i)r.remove(),o.select();else{r.insertBefore(n),r.remove();const s=t.anchor,a=t.focus,l=n.getKey();s.type==="element"&&s.getNode().is(this)&&s.set(l,s.offset,"element"),a.type==="element"&&a.getNode().is(this)&&a.set(l,a.offset,"element")}else r.insertBefore(n),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(t){const n=this.getWritable();return n.__value=t,n}getChecked(){const t=this.getLatest();let n;const r=this.getParent();return pe(r)&&(n=r.getListType()),n==="check"?!!t.__checked:void 0}setChecked(t){const n=this.getWritable();return n.__checked=t,n}toggleChecked(){const t=this.getWritable();return t.setChecked(!t.__checked)}getIndent(){const t=this.getParent();if(t===null||!this.isAttached())return this.getLatest().__indent;let n=t.getParentOrThrow(),r=0;for(;ke(n);)n=n.getParentOrThrow().getParentOrThrow(),r++;return r}setIndent(t){typeof t!="number"&&Lr(117),(t=Math.floor(t))>=0||Lr(199);let n=this.getIndent();for(;n!==t;)n<t?(XM(this),n++):(ZM(this),n--);return this}canInsertAfter(t){return ke(t)}canReplaceWith(t){return ke(t)}canMergeWith(t){return ke(t)||Qr(t)}extractWithChild(t,n){if(!W(n))return!1;const r=n.anchor.getNode(),o=n.focus.getNode();return this.isParentOf(r)&&this.isParentOf(o)&&this.getTextContent().length===n.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return Wt("bullet")}canMergeWhenEmpty(){return!0}};function QM(e){if(e.classList.contains("task-list-item")){for(const n of e.children)if(n.tagName==="INPUT")return Fy(n)}if(e.classList.contains("joplin-checkbox")){for(const n of e.children)if(n.classList.contains("checkbox-wrapper")&&n.children.length>0&&n.children[0].tagName==="INPUT")return Fy(n.children[0])}const t=e.getAttribute("aria-checked");return{node:Zt(t==="true"||t!=="false"&&void 0)}}function Fy(e){return e.getAttribute("type")!=="checkbox"?{node:null}:{node:Zt(e.hasAttribute("checked"))}}function Zt(e){return Et(new eo(void 0,e))}function ke(e){return e instanceof eo}let Uo=class extends Tt{__tag;__start;__listType;$config(){return this.config("list",{$transform:t=>{(function(n){const r=n.getNextSibling();pe(r)&&n.getListType()===r.getListType()&&ug(n,r)})(t),Vw(t)},extends:Tt,importDOM:{ol:()=>({conversion:Oy,priority:0}),ul:()=>({conversion:Oy,priority:0})}})}constructor(t="number",n=1,r){super(r);const o=tP[t]||t;this.__listType=o,this.__tag=o==="number"?"ol":"ul",this.__start=n}afterCloneFrom(t){super.afterCloneFrom(t),this.__listType=t.__listType,this.__tag=t.__tag,this.__start=t.__start}getTag(){return this.getLatest().__tag}setListType(t){const n=this.getWritable();return n.__listType=t,n.__tag=t==="number"?"ol":"ul",n}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(t){const n=this.getWritable();return n.__start=t,n}createDOM(t,n){const r=this.__tag,o=document.createElement(r);return this.__start!==1&&o.setAttribute("start",String(this.__start)),o.__lexicalListType=this.__listType,$y(o,t.theme,this),o}updateDOM(t,n,r){return t.__tag!==this.__tag||t.__listType!==this.__listType||($y(n,r.theme,this),!1)}updateFromJSON(t){return super.updateFromJSON(t).setListType(t.listType).setStart(t.start)}exportDOM(t){const n=this.createDOM(t._config,t);return Be(n)&&(this.__start!==1&&n.setAttribute("start",String(this.__start)),this.__listType==="check"&&n.setAttribute("__lexicalListType","check")),{element:n}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}splice(t,n,r){let o=r;for(let i=0;i<r.length;i++){const s=r[i];ke(s)||(o===r&&(o=[...r]),o[i]=Zt().append(!B(s)||pe(s)||s.isInline()?s:Fe(s.getTextContent())))}return super.splice(t,n,o)}extractWithChild(t){return ke(t)}};function $y(e,t,n){const r=[],o=[],i=t.list;if(i!==void 0){const s=i[`${n.__tag}Depth`]||[],a=df(n)-1,l=a%s.length,c=s[l],u=i[n.__tag];let f;const d=i.nested,h=i.checklist;if(d!==void 0&&d.list&&(f=d.list),u!==void 0&&r.push(u),h!==void 0&&n.__listType==="check"&&r.push(h),c!==void 0){r.push(...jl(c));for(let g=0;g<s.length;g++)g!==l&&o.push(n.__tag+g)}if(f!==void 0){const g=jl(f);a>1?r.push(...g):o.push(...g)}}o.length>0&&Xn(e,...o),r.length>0&&et(e,...r)}function eP(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n];if(ke(r)){t.push(r);const o=r.getChildren();o.length>1&&o.forEach(i=>{pe(i)&&t.push(My(i))})}else t.push(My(r))}return t}function Oy(e){const t=e.nodeName.toLowerCase();let n=null;return t==="ol"?n=Wt("number",e.start):t==="ul"&&(n=(function(r){if(r.getAttribute("__lexicallisttype")==="check"||r.classList.contains("contains-task-list")||r.getAttribute("data-is-checklist")==="1")return!0;for(const o of r.childNodes)if(Be(o)&&o.hasAttribute("aria-checked"))return!0;return!1})(e)?Wt("check"):Wt("bullet")),{after:eP,node:n}}const tP={ol:"number",ul:"bullet"};function Wt(e="number",t=1){return Et(new Uo(e,t))}function pe(e){return e instanceof Uo}const nP=ce("UPDATE_LIST_START_COMMAND"),Bw=ce("INSERT_UNORDERED_LIST_COMMAND"),zw=ce("INSERT_ORDERED_LIST_COMMAND"),rP=ce("REMOVE_LIST_COMMAND");function oP(e){return Nn(e.registerCommand(zw,()=>(Py("number"),!0),ur),e.registerCommand(nP,t=>{const{listNodeKey:n,newStart:r}=t,o=Pe(n);return!!pe(o)&&(o.getListType()==="number"&&(o.setStart(r),Vw(o)),!0)},ur),e.registerCommand(Bw,()=>(Py("bullet"),!0),ur),e.registerCommand(rP,()=>(YM(),!0),ur),e.registerCommand(Po,()=>JM(),ur),e.registerNodeTransform(eo,t=>{const n=t.getFirstChild();if(n){if(J(n)){const r=n.getStyle(),o=n.getFormat();t.getTextStyle()!==r&&t.setTextStyle(r),t.getTextFormat()!==o&&t.setTextFormat(o)}}else{const r=Z();W(r)&&(r.style!==t.getTextStyle()||r.format!==t.getTextFormat())&&r.isCollapsed()&&t.is(r.anchor.getNode())&&t.setTextStyle(r.style).setTextFormat(r.format)}}),e.registerNodeTransform(fn,t=>{const n=t.getParent();if(ke(n)&&t.is(n.getFirstChild())){const r=t.getStyle(),o=t.getFormat();r===n.getTextStyle()&&o===n.getTextFormat()||n.setTextStyle(r).setTextFormat(o)}}))}function iP(e){const t=n=>{const r=n.getParent();if(pe(n.getFirstChild())||!pe(r))return;const o=we(n,i=>ke(i)&&pe(i.getParent())&&ke(i.getPreviousSibling()));if(o===null&&n.getIndent()>0)n.setIndent(0);else if(ke(o)){const i=o.getPreviousSibling();if(ke(i)){const s=(function(l){let c=l,u=c.getFirstChild();for(;pe(u);){const f=u.getLastChild();if(!ke(f))break;c=f,u=c.getFirstChild()}return c})(i),a=s.getParent();if(pe(a)){const l=df(a);l+1<df(r)&&n.setIndent(l)}}}};return e.registerNodeTransform(Uo,n=>{const r=[n];for(;r.length>0;){const o=r.shift();if(pe(o)){for(const i of o.getChildren())if(ke(i)){t(i);const s=i.getFirstChild();pe(s)&&r.push(s)}}}})}function sP(e,t){const n=Yb(t)?t.body.childNodes:t.childNodes;let r=[];const o=[];for(const i of n)if(!Ww.has(i.nodeName)){const s=Kw(i,e,o,!1);s!==null&&(r=r.concat(s))}return(function(i){for(const s of i)s.getNextSibling()instanceof Wh&&s.insertAfter(kn());for(const s of i){const a=s.getChildren();for(const l of a)s.insertBefore(l);s.remove()}})(o),r}function aP(e,t){if(typeof document>"u"||typeof window>"u"&&global.window===void 0)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const n=document.createElement("div"),r=qe().getChildren();for(let o=0;o<r.length;o++)Hw(e,r[o],n,t);return n.innerHTML}function Hw(e,t,n,r=null){let o=r===null||t.isSelected(r);const i=B(t)&&t.excludeFromCopy("html");let s=t;r!==null&&J(t)&&(s=yw(r,t,"clone"));const a=B(s)?s.getChildren():[],l=Uh(e,s.getType());let c;c=l&&l.exportDOM!==void 0?l.exportDOM(e,s):s.exportDOM(e);const{element:u,after:f}=c;if(!u)return!1;const d=document.createDocumentFragment();for(let h=0;h<a.length;h++){const g=a[h],p=Hw(e,g,d,r);!o&&B(t)&&p&&t.extractWithChild(g,r,"html")&&(o=!0)}if(o&&!i){if((Be(u)||sf(u))&&u.append(d),n.append(u),f){const h=f.call(s,u);h&&(sf(u)?u.replaceChildren(h):u.replaceWith(h))}}else n.append(d);return o}const Ww=new Set(["STYLE","SCRIPT"]);function Kw(e,t,n,r,o=new Map,i){let s=[];if(Ww.has(e.nodeName))return s;let a=null;const l=(function(g,p){const{nodeName:m}=g,v=p._htmlConversions.get(m.toLowerCase());let y=null;if(v!==void 0)for(const x of v){const b=x(g);b!==null&&(y===null||(y.priority||0)<=(b.priority||0))&&(y=b)}return y!==null?y.conversion:null})(e,t),c=l?l(e):null;let u=null;if(c!==null){u=c.after;const g=c.node;if(a=Array.isArray(g)?g[g.length-1]:g,a!==null){for(const[,p]of o)if(a=p(a,i),!a)break;a&&s.push(...Array.isArray(g)?g:[a])}c.forChild!=null&&o.set(e.nodeName,c.forChild)}const f=e.childNodes;let d=[];const h=(a==null||!vt(a))&&(a!=null&&ef(a)||r);for(let g=0;g<f.length;g++)d.push(...Kw(f[g],t,n,h,new Map(o),a));return u!=null&&(d=u(d)),Dl(e)&&(d=lP(e,d,h?()=>{const g=new Wh;return n.push(g),g}:ye)),a==null?d.length>0?s=s.concat(d):Dl(e)&&(function(g){return g.nextSibling==null||g.previousSibling==null?!1:af(g.nextSibling)&&af(g.previousSibling)})(e)&&(s=s.concat(kn())):B(a)&&a.append(...d),s}function lP(e,t,n){const r=e.style.textAlign,o=[];let i=[];for(let s=0;s<t.length;s++){const a=t[s];if(ef(a))r&&!a.getFormat()&&a.setFormat(r),o.push(a);else if(i.push(a),s===t.length-1||s<t.length-1&&ef(t[s+1])){const l=n();l.setFormat(r),l.append(...i),o.push(l),i=[]}}return o}function Vl(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function cP(e,t=Z()){return t==null&&Vl(166),W(t)&&t.isCollapsed()||t.getNodes().length===0?"":aP(e,t)}function uP(e,t=Z()){return t==null&&Vl(166),W(t)&&t.isCollapsed()||t.getNodes().length===0?null:JSON.stringify(dP(e,t))}function Iy(e,t,n){const r=e.getData("application/x-lexical-editor");if(r)try{const a=JSON.parse(r);if(a.namespace===n._config.namespace&&Array.isArray(a.nodes))return Dy(n,fP(a.nodes),t)}catch(a){console.error(a)}const o=e.getData("text/html"),i=e.getData("text/plain");if(o&&i!==o)try{const a=new DOMParser().parseFromString((function(l){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:c=>c}).createHTML(l):l})(o),"text/html");return Dy(n,sP(n,a),t)}catch(a){console.error(a)}const s=i||e.getData("text/uri-list");if(s!=null)if(W(t)){const a=s.split(/(\r?\n|\t)/);a[a.length-1]===""&&a.pop();for(let l=0;l<a.length;l++){const c=Z();if(W(c)){const u=a[l];u===`
46
46
  `||u===`\r
47
- `?c.insertParagraph():u===" "?c.insertNodes([qi()]):c.insertText(u)}}}else t.insertRawText(s)}function xy(e,t,n){e.dispatchCommand(mh,{nodes:t,selection:n})||(n.insertNodes(t),(function(r){if(W(r)&&r.isCollapsed()){const o=r.anchor;let i=null;const s=An(o,"previous");if(s)if(Gn(s))i=s.origin;else{const a=Kr(s,Ft(qe(),"next").getFlipped());for(const l of a){if(J(l.origin)){i=l.origin;break}if(B(l.origin)&&!l.origin.isInline())break}}if(i&&J(i)){const a=i.getFormat(),l=i.getStyle();r.format===a&&r.style===l||(r.format=a,r.style=l,r.dirty=!0)}}})(n))}function Rw(e,t,n,r=[]){let o=t===null||n.isSelected(t);const i=B(n)&&n.excludeFromCopy("html");let s=n;t!==null&&J(s)&&(s=J1(t,s,"clone"));const a=B(s)?s.getChildren():[],l=(function(c){const u=c.exportJSON(),f=c.constructor;if(u.type!==f.getType()&&$l(58,f.name),B(c)){const d=u.children;Array.isArray(d)||$l(59,f.name)}return u})(s);J(s)&&s.getTextContentSize()===0&&(o=!1);for(let c=0;c<a.length;c++){const u=a[c],f=Rw(e,t,u,l.children);!o&&B(n)&&f&&n.extractWithChild(u,t,"clone")&&(o=!0)}if(o&&!i)r.push(l);else if(Array.isArray(l.children))for(let c=0;c<l.children.length;c++){const u=l.children[c];r.push(u)}return o}function LN(e,t){const n=[],r=qe().getChildren();for(let o=0;o<r.length;o++)Rw(e,t,r[o],n);return{namespace:e._config.namespace,nodes:n}}function FN(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n],o=gA(r);J(o)&&GA(o),t.push(o)}return t}let ei=null;async function af(e,t,n){if(ei!==null)return!1;if(t!==null)return new Promise((c,u)=>{e.update(()=>{c(by(e,t,n))})});const r=e.getRootElement(),o=e._window||window,i=o.document,s=Ot(o);if(r===null||s===null)return!1;const a=i.createElement("span");a.style.cssText="position: fixed; top: -1000px;",a.append(i.createTextNode("#")),r.append(a);const l=new Range;return l.setStart(a,0),l.setEnd(a,1),s.removeAllRanges(),s.addRange(l),new Promise((c,u)=>{const f=e.registerCommand(tc,d=>(Pr(d,ClipboardEvent)&&(f(),ei!==null&&(o.clearTimeout(ei),ei=null),c(by(e,d,n))),!0),yA);ei=o.setTimeout(()=>{f(),ei=null,c(!1)},50),i.execCommand("copy"),a.remove()})}function by(e,t,n){if(n===void 0){const o=Ot(e._window),i=X();if(!i||i.isCollapsed()||!o)return!1;const s=o.anchorNode,a=o.focusNode;if(s!==null&&a!==null&&!aa(e,s,a))return!1;n=Aw(i)}t.preventDefault();const r=t.clipboardData;return r!==null&&($N(r,n),!0)}const kw=[["text/html",MN],["application/x-lexical-editor",PN]];function Aw(e=X()){const t={"text/plain":e?e.getTextContent():""};if(e){const n=Zi();for(const[r,o]of kw){const i=o(n,e);i!==null&&(t[r]=i)}}return t}function $N(e,t){for(const[n]of kw)t[n]===void 0&&e.setData(n,"");for(const n in t){const r=t[n];r!==void 0&&e.setData(n,r)}}function ON(e){const t=window.location.origin,n=r=>{if(r.origin!==t)return;const o=e.getRootElement();if(document.activeElement!==o)return;const i=r.data;if(typeof i=="string"){let s;try{s=JSON.parse(i)}catch{return}if(s&&s.protocol==="nuanria_messaging"&&s.type==="request"){const a=s.payload;if(a&&a.functionId==="makeChanges"){const l=a.args;if(l){const[c,u,f,d,h]=l;e.update(()=>{const g=X();if(W(g)){const p=g.anchor;let m=p.getNode(),v=0,y=0;if(J(m)&&c>=0&&u>=0&&(v=c,y=c+u,g.setTextNodeRange(m,v,m,y)),v===y&&f===""||(g.insertRawText(f),m=p.getNode()),J(m)){v=d,y=d+h;const x=m.getTextContentSize();v=v>x?x:v,y=y>x?x:y,g.setTextNodeRange(m,v,m,y)}r.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",n,!0),()=>{window.removeEventListener("message",n,!0)}}function wy(e,t){if(document.caretRangeFromPoint!==void 0){const n=document.caretRangeFromPoint(e,t);return n===null?null:{node:n.startContainer,offset:n.startOffset}}if(document.caretPositionFromPoint!=="undefined"){const n=document.caretPositionFromPoint(e,t);return n===null?null:{node:n.offsetNode,offset:n.offset}}return null}const Go=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,IN=Go&&"documentMode"in document?document.documentMode:null,DN=Go&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),jN=!(!Go||!("InputEvent"in window)||IN)&&"getTargetRanges"in new window.InputEvent("input"),VN=Go&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Cy=Go&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,BN=Go&&/^(?=.*Chrome).*/i.test(navigator.userAgent),zN=Go&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&DN&&!BN,Sy=ce("DRAG_DROP_PASTE_FILE");let fc=class Nw extends Tt{static getType(){return"quote"}static clone(t){return new Nw(t.__key)}createDOM(t){const n=document.createElement("blockquote");return et(n,t.theme.quote),n}updateDOM(t,n){return!1}static importDOM(){return{blockquote:t=>({conversion:HN,priority:0})}}exportDOM(t){const{element:n}=super.exportDOM(t);if(Be(n)){this.isEmpty()&&n.append(document.createElement("br"));const r=this.getFormatType();r&&(n.style.textAlign=r);const o=this.getDirection();o&&(n.dir=o)}return{element:n}}static importJSON(t){return Zh().updateFromJSON(t)}insertNewAfter(t,n){const r=ve(),o=this.getDirection();return r.setDirection(o),this.insertAfter(r,n),r}collapseAtStart(){const t=ve();return this.getChildren().forEach(n=>t.append(n)),this.replace(t),!0}canMergeWhenEmpty(){return!0}};function Zh(){return Et(new fc)}function lf(e){return e instanceof fc}let hc=class Mw extends Tt{__tag;static getType(){return"heading"}static clone(t){return new Mw(t.__tag,t.__key)}constructor(t,n){super(n),this.__tag=t}getTag(){return this.__tag}setTag(t){const n=this.getWritable();return this.__tag=t,n}createDOM(t){const n=this.__tag,r=document.createElement(n),o=t.theme.heading;if(o!==void 0){const i=o[n];et(r,i)}return r}updateDOM(t,n,r){return t.__tag!==this.__tag}static importDOM(){return{h1:t=>({conversion:ti,priority:0}),h2:t=>({conversion:ti,priority:0}),h3:t=>({conversion:ti,priority:0}),h4:t=>({conversion:ti,priority:0}),h5:t=>({conversion:ti,priority:0}),h6:t=>({conversion:ti,priority:0}),p:t=>{const n=t.firstChild;return n!==null&&_y(n)?{conversion:()=>({node:null}),priority:3}:null},span:t=>_y(t)?{conversion:n=>({node:wo("h1")}),priority:3}:null}}exportDOM(t){const{element:n}=super.exportDOM(t);if(Be(n)){this.isEmpty()&&n.append(document.createElement("br"));const r=this.getFormatType();r&&(n.style.textAlign=r);const o=this.getDirection();o&&(n.dir=o)}return{element:n}}static importJSON(t){return wo(t.tag).updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setTag(t.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(t,n=!0){const r=t?t.anchor.offset:0,o=this.getLastDescendant(),i=!o||t&&t.anchor.key===o.getKey()&&r===o.getTextContentSize()||!t?ve():wo(this.getTag()),s=this.getDirection();if(i.setDirection(s),this.insertAfter(i,n),r===0&&!this.isEmpty()&&t){const a=ve();a.select(),this.replace(a,!0)}return i}collapseAtStart(){const t=this.isEmpty()?ve():wo(this.getTag());return this.getChildren().forEach(n=>t.append(n)),this.replace(t),!0}extractWithChild(){return!0}};function _y(e){return e.nodeName.toLowerCase()==="span"&&e.style.fontSize==="26pt"}function ti(e){const t=e.nodeName.toLowerCase();let n=null;return t!=="h1"&&t!=="h2"&&t!=="h3"&&t!=="h4"&&t!=="h5"&&t!=="h6"||(n=wo(t),e.style!==null&&(Vh(e,n),n.setFormat(e.style.textAlign))),{node:n}}function HN(e){const t=Zh();return e.style!==null&&(t.setFormat(e.style.textAlign),Vh(e,t)),{node:t}}function wo(e="h1"){return Et(new hc(e))}function Pw(e){return e instanceof hc}function Oa(e){let t=null;if(Pr(e,DragEvent)?t=e.dataTransfer:Pr(e,ClipboardEvent)&&(t=e.clipboardData),t===null)return[!1,[],!1];const n=t.types,r=n.includes("Files"),o=n.includes("text/html")||n.includes("text/plain");return[r,Array.from(t.files),o]}function Ty(e){const t=X();if(!W(t))return!1;const n=new Set,r=t.getNodes();for(let o=0;o<r.length;o++){const i=r[o],s=i.getKey();if(n.has(s))continue;const a=we(i,c=>B(c)&&!c.isInline());if(a===null)continue;const l=a.getKey();a.canIndent()&&!n.has(l)&&(n.add(l),e(a))}return n.size>0}function Ey(e){const t=Ut(e);return Te(t)}function gu(e){for(const t of["lowercase","uppercase","capitalize"])e.hasFormat(t)&&e.toggleFormat(t)}function WN(e){return Nn(e.registerCommand(Ql,t=>{const n=X();return!!Ct(n)&&(n.clear(),!0)},be),e.registerCommand(Ir,t=>{const n=X();return W(n)?(n.deleteCharacter(t),!0):!!Ct(n)&&(n.deleteNodes(),!0)},be),e.registerCommand($i,t=>{const n=X();return!!W(n)&&(n.deleteWord(t),!0)},be),e.registerCommand(Po,t=>{const n=X();return!!W(n)&&(n.deleteLine(t),!0)},be),e.registerCommand(To,t=>{const n=X();if(typeof t=="string")n!==null&&n.insertText(t);else{if(n===null)return!1;const r=t.dataTransfer;if(r!=null)vy(r,n,e);else if(W(n)){const o=t.data;return o&&n.insertText(o),!0}}return!0},be),e.registerCommand(Dd,()=>{const t=X();return!!W(t)&&(t.removeText(),!0)},be),e.registerCommand(Vt,t=>{const n=X();return!!W(n)&&(n.formatText(t),!0)},be),e.registerCommand(_i,t=>{const n=X();if(!W(n)&&!Ct(n))return!1;const r=n.getNodes();for(const o of r){const i=we(o,s=>B(s)&&!s.isInline());i!==null&&i.setFormat(t)}return!0},be),e.registerCommand(Si,t=>{const n=X();return!!W(n)&&(n.insertLineBreak(t),!0)},be),e.registerCommand(Mo,()=>{const t=X();return!!W(t)&&(t.insertParagraph(),!0)},be),e.registerCommand(V3,()=>(Rh([qi()]),!0),be),e.registerCommand(B3,()=>Ty(t=>{const n=t.getIndent();t.setIndent(n+1)}),be),e.registerCommand(bm,()=>Ty(t=>{const n=t.getIndent();n>0&&t.setIndent(Math.max(0,n-1))}),be),e.registerCommand(bh,t=>{const n=X();if(Ct(n)){const r=n.getNodes();if(r.length>0)return t.preventDefault(),r[0].selectPrevious(),!0}else if(W(n)){const r=Xd(n.focus,!0);if(!t.shiftKey&&Te(r)&&!r.isIsolated()&&!r.isInline())return r.selectPrevious(),t.preventDefault(),!0}return!1},be),e.registerCommand(wh,t=>{const n=X();if(Ct(n)){const r=n.getNodes();if(r.length>0)return t.preventDefault(),r[0].selectNext(0,0),!0}else if(W(n)){if((function(o){const i=o.focus;return i.key==="root"&&i.offset===qe().getChildrenSize()})(n))return t.preventDefault(),!0;const r=Xd(n.focus,!1);if(!t.shiftKey&&Te(r)&&!r.isIsolated()&&!r.isInline())return r.selectNext(),t.preventDefault(),!0}return!1},be),e.registerCommand(xh,t=>{const n=X();if(Ct(n)){const r=n.getNodes();if(r.length>0)return t.preventDefault(),ry(r[0])?r[0].selectNext(0,0):r[0].selectPrevious(),!0}if(!W(n))return!1;if(oy(n,!0)){const r=t.shiftKey;return t.preventDefault(),iy(n,r,!0),!0}return!1},be),e.registerCommand(vh,t=>{const n=X();if(Ct(n)){const o=n.getNodes();if(o.length>0)return t.preventDefault(),ry(o[0])?o[0].selectPrevious():o[0].selectNext(0,0),!0}if(!W(n))return!1;const r=t.shiftKey;return!!oy(n,!1)&&(t.preventDefault(),iy(n,r,!1),!0)},be),e.registerCommand(ec,t=>{if(Ey(t.target))return!1;const n=X();if(W(n)){if((function(r){if(!r.isCollapsed())return!1;const{anchor:o}=r;if(o.offset!==0)return!1;const i=o.getNode();if(at(i))return!1;const s=JA(i);return s.getIndent()>0&&(s.is(i)||i.is(s.getFirstDescendant()))})(n))return t.preventDefault(),e.dispatchCommand(bm,void 0);if(Cy&&navigator.language==="ko-KR")return!1}else if(!Ct(n))return!1;return t.preventDefault(),e.dispatchCommand(Ir,!0)},be),e.registerCommand(Sh,t=>{if(Ey(t.target))return!1;const n=X();return!(!W(n)&&!Ct(n))&&(t.preventDefault(),e.dispatchCommand(Ir,!1))},be),e.registerCommand(Tl,t=>{const n=X();if(!W(n))return!1;if(gu(n),t!==null){if((Cy||VN||zN)&&jN)return!1;if(t.preventDefault(),t.shiftKey)return e.dispatchCommand(Si,!1)}return e.dispatchCommand(Mo,void 0)},be),e.registerCommand(Ch,()=>{const t=X();return!!W(t)&&(e.blur(),!0)},be),e.registerCommand(e1,t=>{const[,n]=Oa(t);if(n.length>0){const o=wy(t.clientX,t.clientY);if(o!==null){const{offset:i,node:s}=o,a=Ut(s);if(a!==null){const l=ic();if(J(a))l.anchor.set(a.getKey(),i,"text"),l.focus.set(a.getKey(),i,"text");else{const u=a.getParentOrThrow().getKey(),f=a.getIndexWithinParent()+1;l.anchor.set(u,f,"element"),l.focus.set(u,f,"element")}const c=Bs(l);Ge(c)}e.dispatchCommand(Sy,n)}return t.preventDefault(),!0}const r=X();return!!W(r)},be),e.registerCommand(t1,t=>{const[n]=Oa(t),r=X();return!(n&&!W(r))},be),e.registerCommand(n1,t=>{const[n]=Oa(t),r=X();if(n&&!W(r))return!1;const o=wy(t.clientX,t.clientY);if(o!==null){const i=Ut(o.node);Te(i)&&t.preventDefault()}return!0},be),e.registerCommand(jd,()=>(CA(),!0),be),e.registerCommand(tc,t=>(af(e,Pr(t,ClipboardEvent)?t:null),!0),be),e.registerCommand(nc,t=>((async function(n,r){await af(r,Pr(n,ClipboardEvent)?n:null),r.update(()=>{const o=X();W(o)?o.removeText():Ct(o)&&o.getNodes().forEach(i=>i.remove())})})(t,e),!0),be),e.registerCommand(yh,t=>{const[,n,r]=Oa(t);return n.length>0&&!r?(e.dispatchCommand(Sy,n),!0):Cn(t.target)&&Lh(t.target)?!1:X()!==null&&((function(o,i){o.preventDefault(),i.update(()=>{const s=X(),a=Pr(o,InputEvent)||Pr(o,KeyboardEvent)?null:o.clipboardData;a!=null&&s!==null&&vy(a,s,i)},{tag:J3})})(t,e),!0)},be),e.registerCommand(Qb,t=>{const n=X();return W(n)&&gu(n),!1},be),e.registerCommand(_h,t=>{const n=X();return W(n)&&gu(n),!1},be))}var pu={exports:{}},Ry;function KN(){return Ry||(Ry=1,(function(e){var t=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};var n=(function(r){var o=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,i=0,s={},a={manual:r.Prism&&r.Prism.manual,disableWorkerMessageHandler:r.Prism&&r.Prism.disableWorkerMessageHandler,util:{encode:function y(x){return x instanceof l?new l(x.type,y(x.content),x.alias):Array.isArray(x)?x.map(y):x.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(y){return Object.prototype.toString.call(y).slice(8,-1)},objId:function(y){return y.__id||Object.defineProperty(y,"__id",{value:++i}),y.__id},clone:function y(x,b){b=b||{};var w,_;switch(a.util.type(x)){case"Object":if(_=a.util.objId(x),b[_])return b[_];w={},b[_]=w;for(var E in x)x.hasOwnProperty(E)&&(w[E]=y(x[E],b));return w;case"Array":return _=a.util.objId(x),b[_]?b[_]:(w=[],b[_]=w,x.forEach(function(R,k){w[k]=y(R,b)}),w);default:return x}},getLanguage:function(y){for(;y;){var x=o.exec(y.className);if(x)return x[1].toLowerCase();y=y.parentElement}return"none"},setLanguage:function(y,x){y.className=y.className.replace(RegExp(o,"gi"),""),y.classList.add("language-"+x)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw new Error}catch(w){var y=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(w.stack)||[])[1];if(y){var x=document.getElementsByTagName("script");for(var b in x)if(x[b].src==y)return x[b]}return null}},isActive:function(y,x,b){for(var w="no-"+x;y;){var _=y.classList;if(_.contains(x))return!0;if(_.contains(w))return!1;y=y.parentElement}return!!b}},languages:{plain:s,plaintext:s,text:s,txt:s,extend:function(y,x){var b=a.util.clone(a.languages[y]);for(var w in x)b[w]=x[w];return b},insertBefore:function(y,x,b,w){w=w||a.languages;var _=w[y],E={};for(var R in _)if(_.hasOwnProperty(R)){if(R==x)for(var k in b)b.hasOwnProperty(k)&&(E[k]=b[k]);b.hasOwnProperty(R)||(E[R]=_[R])}var M=w[y];return w[y]=E,a.languages.DFS(a.languages,function(F,D){D===M&&F!=y&&(this[F]=E)}),E},DFS:function y(x,b,w,_){_=_||{};var E=a.util.objId;for(var R in x)if(x.hasOwnProperty(R)){b.call(x,R,x[R],w||R);var k=x[R],M=a.util.type(k);M==="Object"&&!_[E(k)]?(_[E(k)]=!0,y(k,b,null,_)):M==="Array"&&!_[E(k)]&&(_[E(k)]=!0,y(k,b,R,_))}}},plugins:{},highlightAll:function(y,x){a.highlightAllUnder(document,y,x)},highlightAllUnder:function(y,x,b){var w={callback:b,container:y,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};a.hooks.run("before-highlightall",w),w.elements=Array.prototype.slice.apply(w.container.querySelectorAll(w.selector)),a.hooks.run("before-all-elements-highlight",w);for(var _=0,E;E=w.elements[_++];)a.highlightElement(E,x===!0,w.callback)},highlightElement:function(y,x,b){var w=a.util.getLanguage(y),_=a.languages[w];a.util.setLanguage(y,w);var E=y.parentElement;E&&E.nodeName.toLowerCase()==="pre"&&a.util.setLanguage(E,w);var R=y.textContent,k={element:y,language:w,grammar:_,code:R};function M(D){k.highlightedCode=D,a.hooks.run("before-insert",k),k.element.innerHTML=k.highlightedCode,a.hooks.run("after-highlight",k),a.hooks.run("complete",k),b&&b.call(k.element)}if(a.hooks.run("before-sanity-check",k),E=k.element.parentElement,E&&E.nodeName.toLowerCase()==="pre"&&!E.hasAttribute("tabindex")&&E.setAttribute("tabindex","0"),!k.code){a.hooks.run("complete",k),b&&b.call(k.element);return}if(a.hooks.run("before-highlight",k),!k.grammar){M(a.util.encode(k.code));return}if(x&&r.Worker){var F=new Worker(a.filename);F.onmessage=function(D){M(D.data)},F.postMessage(JSON.stringify({language:k.language,code:k.code,immediateClose:!0}))}else M(a.highlight(k.code,k.grammar,k.language))},highlight:function(y,x,b){var w={code:y,grammar:x,language:b};if(a.hooks.run("before-tokenize",w),!w.grammar)throw new Error('The language "'+w.language+'" has no grammar.');return w.tokens=a.tokenize(w.code,w.grammar),a.hooks.run("after-tokenize",w),l.stringify(a.util.encode(w.tokens),w.language)},tokenize:function(y,x){var b=x.rest;if(b){for(var w in b)x[w]=b[w];delete x.rest}var _=new f;return d(_,_.head,y),u(y,_,x,_.head,0),g(_)},hooks:{all:{},add:function(y,x){var b=a.hooks.all;b[y]=b[y]||[],b[y].push(x)},run:function(y,x){var b=a.hooks.all[y];if(!(!b||!b.length))for(var w=0,_;_=b[w++];)_(x)}},Token:l};r.Prism=a;function l(y,x,b,w){this.type=y,this.content=x,this.alias=b,this.length=(w||"").length|0}l.stringify=function y(x,b){if(typeof x=="string")return x;if(Array.isArray(x)){var w="";return x.forEach(function(M){w+=y(M,b)}),w}var _={type:x.type,content:y(x.content,b),tag:"span",classes:["token",x.type],attributes:{},language:b},E=x.alias;E&&(Array.isArray(E)?Array.prototype.push.apply(_.classes,E):_.classes.push(E)),a.hooks.run("wrap",_);var R="";for(var k in _.attributes)R+=" "+k+'="'+(_.attributes[k]||"").replace(/"/g,"&quot;")+'"';return"<"+_.tag+' class="'+_.classes.join(" ")+'"'+R+">"+_.content+"</"+_.tag+">"};function c(y,x,b,w){y.lastIndex=x;var _=y.exec(b);if(_&&w&&_[1]){var E=_[1].length;_.index+=E,_[0]=_[0].slice(E)}return _}function u(y,x,b,w,_,E){for(var R in b)if(!(!b.hasOwnProperty(R)||!b[R])){var k=b[R];k=Array.isArray(k)?k:[k];for(var M=0;M<k.length;++M){if(E&&E.cause==R+","+M)return;var F=k[M],D=F.inside,j=!!F.lookbehind,I=!!F.greedy,$=F.alias;if(I&&!F.pattern.global){var H=F.pattern.toString().match(/[imsuy]*$/)[0];F.pattern=RegExp(F.pattern.source,H+"g")}for(var O=F.pattern||F,P=w.next,K=_;P!==x.tail&&!(E&&K>=E.reach);K+=P.value.length,P=P.next){var G=P.value;if(x.length>y.length)return;if(!(G instanceof l)){var re=1,U;if(I){if(U=c(O,K,y,j),!U||U.index>=y.length)break;var oe=U.index,Z=U.index+U[0].length,Q=K;for(Q+=P.value.length;oe>=Q;)P=P.next,Q+=P.value.length;if(Q-=P.value.length,K=Q,P.value instanceof l)continue;for(var ne=P;ne!==x.tail&&(Q<Z||typeof ne.value=="string");ne=ne.next)re++,Q+=ne.value.length;re--,G=y.slice(K,Q),U.index-=K}else if(U=c(O,0,G,j),!U)continue;var oe=U.index,me=U[0],ee=G.slice(0,oe),xe=G.slice(oe+me.length),Se=K+G.length;E&&Se>E.reach&&(E.reach=Se);var Ee=P.prev;ee&&(Ee=d(x,Ee,ee),K+=ee.length),h(x,Ee,re);var ze=new l(R,D?a.tokenize(me,D):me,$,me);if(P=d(x,Ee,ze),xe&&d(x,P,xe),re>1){var je={cause:R+","+M,reach:Se};u(y,x,b,P.prev,K,je),E&&je.reach>E.reach&&(E.reach=je.reach)}}}}}}function f(){var y={value:null,prev:null,next:null},x={value:null,prev:y,next:null};y.next=x,this.head=y,this.tail=x,this.length=0}function d(y,x,b){var w=x.next,_={value:b,prev:x,next:w};return x.next=_,w.prev=_,y.length++,_}function h(y,x,b){for(var w=x.next,_=0;_<b&&w!==y.tail;_++)w=w.next;x.next=w,w.prev=x,y.length-=_}function g(y){for(var x=[],b=y.head.next;b!==y.tail;)x.push(b.value),b=b.next;return x}if(!r.document)return r.addEventListener&&(a.disableWorkerMessageHandler||r.addEventListener("message",function(y){var x=JSON.parse(y.data),b=x.language,w=x.code,_=x.immediateClose;r.postMessage(a.highlight(w,a.languages[b],b)),_&&r.close()},!1)),a;var p=a.util.currentScript();p&&(a.filename=p.src,p.hasAttribute("data-manual")&&(a.manual=!0));function m(){a.manual||a.highlightAll()}if(!a.manual){var v=document.readyState;v==="loading"||v==="interactive"&&p&&p.defer?document.addEventListener("DOMContentLoaded",m):window.requestAnimationFrame?window.requestAnimationFrame(m):window.setTimeout(m,16)}return a})(t);e.exports&&(e.exports=n),typeof Bn<"u"&&(Bn.Prism=n),n.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},n.languages.markup.tag.inside["attr-value"].inside.entity=n.languages.markup.entity,n.languages.markup.doctype.inside["internal-subset"].inside=n.languages.markup,n.hooks.add("wrap",function(r){r.type==="entity"&&(r.attributes.title=r.content.replace(/&amp;/,"&"))}),Object.defineProperty(n.languages.markup.tag,"addInlined",{value:function(o,i){var s={};s["language-"+i]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:n.languages[i]},s.cdata=/^<!\[CDATA\[|\]\]>$/i;var a={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:s}};a["language-"+i]={pattern:/[\s\S]+/,inside:n.languages[i]};var l={};l[o]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return o}),"i"),lookbehind:!0,greedy:!0,inside:a},n.languages.insertBefore("markup","cdata",l)}}),Object.defineProperty(n.languages.markup.tag,"addAttribute",{value:function(r,o){n.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+r+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[o,"language-"+o],inside:n.languages[o]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),n.languages.html=n.languages.markup,n.languages.mathml=n.languages.markup,n.languages.svg=n.languages.markup,n.languages.xml=n.languages.extend("markup",{}),n.languages.ssml=n.languages.xml,n.languages.atom=n.languages.xml,n.languages.rss=n.languages.xml,(function(r){var o=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;r.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+o.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+o.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+o.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+o.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:o,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},r.languages.css.atrule.inside.rest=r.languages.css;var i=r.languages.markup;i&&(i.tag.addInlined("style","css"),i.tag.addAttribute("style","css"))})(n),n.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},n.languages.javascript=n.languages.extend("clike",{"class-name":[n.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),n.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,n.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:n.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:n.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:n.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:n.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:n.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),n.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:n.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),n.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),n.languages.markup&&(n.languages.markup.tag.addInlined("script","javascript"),n.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),n.languages.js=n.languages.javascript,(function(){if(typeof n>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var r="Loading…",o=function(p,m){return"✖ Error "+p+" while fetching file: "+m},i="✖ Error: File does not exist or is empty",s={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},a="data-src-status",l="loading",c="loaded",u="failed",f="pre[data-src]:not(["+a+'="'+c+'"]):not(['+a+'="'+l+'"])';function d(p,m,v){var y=new XMLHttpRequest;y.open("GET",p,!0),y.onreadystatechange=function(){y.readyState==4&&(y.status<400&&y.responseText?m(y.responseText):y.status>=400?v(o(y.status,y.statusText)):v(i))},y.send(null)}function h(p){var m=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(p||"");if(m){var v=Number(m[1]),y=m[2],x=m[3];return y?x?[v,Number(x)]:[v,void 0]:[v,v]}}n.hooks.add("before-highlightall",function(p){p.selector+=", "+f}),n.hooks.add("before-sanity-check",function(p){var m=p.element;if(m.matches(f)){p.code="",m.setAttribute(a,l);var v=m.appendChild(document.createElement("CODE"));v.textContent=r;var y=m.getAttribute("data-src"),x=p.language;if(x==="none"){var b=(/\.(\w+)$/.exec(y)||[,"none"])[1];x=s[b]||b}n.util.setLanguage(v,x),n.util.setLanguage(m,x);var w=n.plugins.autoloader;w&&w.loadLanguages(x),d(y,function(_){m.setAttribute(a,c);var E=h(m.getAttribute("data-range"));if(E){var R=_.split(/\r\n?|\n/g),k=E[0],M=E[1]==null?R.length:E[1];k<0&&(k+=R.length),k=Math.max(0,Math.min(k-1,R.length)),M<0&&(M+=R.length),M=Math.max(0,Math.min(M,R.length)),_=R.slice(k,M).join(`
48
- `),m.hasAttribute("data-start")||m.setAttribute("data-start",String(k+1))}v.textContent=_,n.highlightElement(v)},function(_){m.setAttribute(a,u),v.textContent=_})}}),n.plugins.fileHighlight={highlight:function(m){for(var v=(m||document).querySelectorAll(f),y=0,x;x=v[y++];)n.highlightElement(x)}};var g=!1;n.fileHighlight=function(){g||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),g=!0),n.plugins.fileHighlight.highlight.apply(this,arguments)}})()})(pu)),pu.exports}KN();Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/};Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/});Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}});Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}});Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript"));Prism.languages.js=Prism.languages.javascript;Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]};Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity;Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup;Prism.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&amp;/,"&"))});Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(t,n){var r={};r["language-"+n]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[n]},r.cdata=/^<!\[CDATA\[|\]\]>$/i;var o={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};o["language-"+n]={pattern:/[\s\S]+/,inside:Prism.languages[n]};var i={};i[t]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return t}),"i"),lookbehind:!0,greedy:!0,inside:o},Prism.languages.insertBefore("markup","cdata",i)}});Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(e,t){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:Prism.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}});Prism.languages.html=Prism.languages.markup;Prism.languages.mathml=Prism.languages.markup;Prism.languages.svg=Prism.languages.markup;Prism.languages.xml=Prism.languages.extend("markup",{});Prism.languages.ssml=Prism.languages.xml;Prism.languages.atom=Prism.languages.xml;Prism.languages.rss=Prism.languages.xml;(function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(u){return u=u.replace(/<inner>/g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+u+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,o=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return r}),i=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+o+i+"(?:"+o+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+o+i+")(?:"+o+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+o+")"+i+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+o+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(u){["url","bold","italic","strike","code-snippet"].forEach(function(f){u!==f&&(e.languages.markdown[u].inside.content.inside[f]=e.languages.markdown[f])})}),e.hooks.add("after-tokenize",function(u){if(u.language!=="markdown"&&u.language!=="md")return;function f(d){if(!(!d||typeof d=="string"))for(var h=0,g=d.length;h<g;h++){var p=d[h];if(p.type!=="code"){f(p.content);continue}var m=p.content[1],v=p.content[3];if(m&&v&&m.type==="code-language"&&v.type==="code-block"&&typeof m.content=="string"){var y=m.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");y=(/[a-z][\w-]*/i.exec(y)||[""])[0].toLowerCase();var x="language-"+y;v.alias?typeof v.alias=="string"?v.alias=[v.alias,x]:v.alias.push(x):v.alias=[x]}}}f(u.tokens)}),e.hooks.add("wrap",function(u){if(u.type==="code-block"){for(var f="",d=0,h=u.classes.length;d<h;d++){var g=u.classes[d],p=/language-(.+)/.exec(g);if(p){f=p[1];break}}var m=e.languages[f];if(m)u.content=e.highlight(c(u.content),m,f);else if(f&&f!=="none"&&e.plugins.autoloader){var v="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*1e16);u.attributes.id=v,e.plugins.autoloader.loadLanguages(f,function(){var y=document.getElementById(v);y&&(y.innerHTML=e.highlight(y.textContent,e.languages[f],f))})}}});var s=RegExp(e.languages.markup.tag.pattern.source,"gi"),a={amp:"&",lt:"<",gt:">",quot:'"'},l=String.fromCodePoint||String.fromCharCode;function c(u){var f=u.replace(s,"");return f=f.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(d,h){if(h=h.toLowerCase(),h[0]==="#"){var g;return h[1]==="x"?g=parseInt(h.slice(2),16):g=Number(h.slice(1)),l(g)}else{var p=a[h];return p||d}}),f}e.languages.md=e.languages.markdown})(Prism);Prism.languages.c=Prism.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/});Prism.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}});Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}});Prism.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/});delete Prism.languages.c.boolean;(function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))})(Prism);Prism.languages.objectivec=Prism.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/});delete Prism.languages.objectivec["class-name"];Prism.languages.objc=Prism.languages.objectivec;Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/};(function(e){var t=e.languages.powershell={comment:[{pattern:/(^|[^`])<#[\s\S]*?#>/,lookbehind:!0},{pattern:/(^|[^`])#.*/,lookbehind:!0}],string:[{pattern:/"(?:`[\s\S]|[^`"])*"/,greedy:!0,inside:null},{pattern:/'(?:[^']|'')*'/,greedy:!0}],namespace:/\[[a-z](?:\[(?:\[[^\]]*\]|[^\[\]])*\]|[^\[\]])*\]/i,boolean:/\$(?:false|true)\b/i,variable:/\$\w+\b/,function:[/\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\b/i,/\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i],keyword:/\b(?:Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,operator:{pattern:/(^|\W)(?:!|-(?:b?(?:and|x?or)|as|(?:Not)?(?:Contains|In|Like|Match)|eq|ge|gt|is(?:Not)?|Join|le|lt|ne|not|Replace|sh[lr])\b|-[-=]?|\+[+=]?|[*\/%]=?)/i,lookbehind:!0},punctuation:/[|{}[\];(),.]/};t.string[0].inside={function:{pattern:/(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,lookbehind:!0,inside:t},boolean:t.boolean,variable:t.variable}})(Prism);var ky={},Ay;function UN(){return Ay||(Ay=1,Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python),ky}UN();var Ny={},My;function GN(){return My||(My=1,(function(e){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)t=t.replace(/<self>/g,function(){return t});t=t.replace(/<self>/g,function(){return/[^\s\S]/.source}),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string})(Prism)),Ny}GN();Prism.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+(/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+")+"|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/};Prism.languages.swift["string-literal"].forEach(function(e){e.inside.interpolation.inside=Prism.languages.swift});var Py={},Ly;function qN(){return Ly||(Ly=1,(function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript})(Prism)),Py}qN();var Fy={},$y;function YN(){return $y||($y=1,(function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,r={pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:r.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+n+/[A-Z]\w*\b/.source),lookbehind:!0,inside:r.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),e.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+n+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+n+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(Prism)),Fy}YN();var Oy={},Iy;function XN(){return Iy||(Iy=1,(function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return t.source});e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return n})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])})(Prism)),Oy}XN();function Lw(e,t){for(const n of e.childNodes){if(Be(n)&&n.tagName===t)return!0;Lw(n,t)}return!1}const Ss="data-language",ds="data-highlight-language",Ia="data-theme";let gc=class Fw extends Tt{__language;__theme;__isSyntaxHighlightSupported;static getType(){return"code"}static clone(t){return new Fw(t.__language,t.__key)}constructor(t,n){super(n),this.__language=t||void 0,this.__isSyntaxHighlightSupported=!1,this.__theme=void 0}afterCloneFrom(t){super.afterCloneFrom(t),this.__language=t.__language,this.__theme=t.__theme,this.__isSyntaxHighlightSupported=t.__isSyntaxHighlightSupported}createDOM(t){const n=document.createElement("code");et(n,t.theme.code),n.setAttribute("spellcheck","false");const r=this.getLanguage();r&&(n.setAttribute(Ss,r),this.getIsSyntaxHighlightSupported()&&n.setAttribute(ds,r));const o=this.getTheme();o&&n.setAttribute(Ia,o);const i=this.getStyle();return i&&n.setAttribute("style",i),n}updateDOM(t,n,r){const o=this.__language,i=t.__language;o?o!==i&&n.setAttribute(Ss,o):i&&n.removeAttribute(Ss);const s=this.__isSyntaxHighlightSupported;t.__isSyntaxHighlightSupported&&i?s&&o?o!==i&&n.setAttribute(ds,o):n.removeAttribute(ds):s&&o&&n.setAttribute(ds,o);const a=this.__theme,l=t.__theme;a?a!==l&&n.setAttribute(Ia,a):l&&n.removeAttribute(Ia);const c=this.__style,u=t.__style;return c?c!==u&&n.setAttribute("style",c):u&&n.removeAttribute("style"),!1}exportDOM(t){const n=document.createElement("pre");et(n,t._config.theme.code),n.setAttribute("spellcheck","false");const r=this.getLanguage();r&&(n.setAttribute(Ss,r),this.getIsSyntaxHighlightSupported()&&n.setAttribute(ds,r));const o=this.getTheme();o&&n.setAttribute(Ia,o);const i=this.getStyle();return i&&n.setAttribute("style",i),{element:n}}static importDOM(){return{code:t=>t.textContent!=null&&(/\r?\n/.test(t.textContent)||Lw(t,"BR"))?{conversion:Dy,priority:1}:null,div:()=>({conversion:ZN,priority:1}),pre:()=>({conversion:Dy,priority:0}),table:t=>mu(t)?{conversion:JN,priority:3}:null,td:t=>{const n=t,r=n.closest("table");return n.classList.contains("js-file-line")||r&&mu(r)?{conversion:jy,priority:3}:null},tr:t=>{const n=t.closest("table");return n&&mu(n)?{conversion:jy,priority:3}:null}}}static importJSON(t){return hr().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setLanguage(t.language).setTheme(t.theme)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),theme:this.getTheme()}}insertNewAfter(t,n=!0){const r=this.getChildren(),o=r.length;if(o>=2&&r[o-1].getTextContent()===`
47
+ `?c.insertParagraph():u===" "?c.insertNodes([Zi()]):c.insertText(u)}}}else t.insertRawText(s)}function Dy(e,t,n){e.dispatchCommand(Nh,{nodes:t,selection:n})||(n.insertNodes(t),(function(r){if(W(r)&&r.isCollapsed()){const o=r.anchor;let i=null;const s=An(o,"previous");if(s)if(qn(s))i=s.origin;else{const a=Gr(s,$t(qe(),"next").getFlipped());for(const l of a){if(J(l.origin)){i=l.origin;break}if(B(l.origin)&&!l.origin.isInline())break}}if(i&&J(i)){const a=i.getFormat(),l=i.getStyle();r.format===a&&r.style===l||(r.format=a,r.style=l,r.dirty=!0)}}})(n))}function Uw(e,t,n,r=[]){let o=t===null||n.isSelected(t);const i=B(n)&&n.excludeFromCopy("html");let s=n;t!==null&&J(s)&&(s=yw(t,s,"clone"));const a=B(s)?s.getChildren():[],l=(function(c){const u=c.exportJSON(),f=c.constructor;if(u.type!==f.getType()&&Vl(58,f.name),B(c)){const d=u.children;Array.isArray(d)||Vl(59,f.name)}return u})(s);J(s)&&s.getTextContentSize()===0&&(o=!1);for(let c=0;c<a.length;c++){const u=a[c],f=Uw(e,t,u,l.children);!o&&B(n)&&f&&n.extractWithChild(u,t,"clone")&&(o=!0)}if(o&&!i)r.push(l);else if(Array.isArray(l.children))for(let c=0;c<l.children.length;c++){const u=l.children[c];r.push(u)}return o}function dP(e,t){const n=[],r=qe().getChildren();for(let o=0;o<r.length;o++)Uw(e,t,r[o],n);return{namespace:e._config.namespace,nodes:n}}function fP(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n],o=UN(r);J(o)&&TM(o),t.push(o)}return t}let ei=null;async function hf(e,t,n){if(ei!==null)return!1;if(t!==null)return new Promise((c,u)=>{e.update(()=>{c(jy(e,t,n))})});const r=e.getRootElement(),o=e._window||window,i=o.document,s=Ot(o);if(r===null||s===null)return!1;const a=i.createElement("span");a.style.cssText="position: fixed; top: -1000px;",a.append(i.createTextNode("#")),r.append(a);const l=new Range;return l.setStart(a,0),l.setEnd(a,1),s.removeAllRanges(),s.addRange(l),new Promise((c,u)=>{const f=e.registerCommand(ac,d=>(Pr(d,ClipboardEvent)&&(f(),ei!==null&&(o.clearTimeout(ei),ei=null),c(jy(e,d,n))),!0),YN);ei=o.setTimeout(()=>{f(),ei=null,c(!1)},50),i.execCommand("copy"),a.remove()})}function jy(e,t,n){if(n===void 0){const o=Ot(e._window),i=Z();if(!i||i.isCollapsed()||!o)return!1;const s=o.anchorNode,a=o.focusNode;if(s!==null&&a!==null&&!la(e,s,a))return!1;n=qw(i)}t.preventDefault();const r=t.clipboardData;return r!==null&&(hP(r,n),!0)}const Gw=[["text/html",cP],["application/x-lexical-editor",uP]];function qw(e=Z()){const t={"text/plain":e?e.getTextContent():""};if(e){const n=es();for(const[r,o]of Gw){const i=o(n,e);i!==null&&(t[r]=i)}}return t}function hP(e,t){for(const[n]of Gw)t[n]===void 0&&e.setData(n,"");for(const n in t){const r=t[n];r!==void 0&&e.setData(n,r)}}function gP(e){const t=window.location.origin,n=r=>{if(r.origin!==t)return;const o=e.getRootElement();if(document.activeElement!==o)return;const i=r.data;if(typeof i=="string"){let s;try{s=JSON.parse(i)}catch{return}if(s&&s.protocol==="nuanria_messaging"&&s.type==="request"){const a=s.payload;if(a&&a.functionId==="makeChanges"){const l=a.args;if(l){const[c,u,f,d,h]=l;e.update(()=>{const g=Z();if(W(g)){const p=g.anchor;let m=p.getNode(),v=0,y=0;if(J(m)&&c>=0&&u>=0&&(v=c,y=c+u,g.setTextNodeRange(m,v,m,y)),v===y&&f===""||(g.insertRawText(f),m=p.getNode()),J(m)){v=d,y=d+h;const x=m.getTextContentSize();v=v>x?x:v,y=y>x?x:y,g.setTextNodeRange(m,v,m,y)}r.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",n,!0),()=>{window.removeEventListener("message",n,!0)}}function Vy(e,t){if(document.caretRangeFromPoint!==void 0){const n=document.caretRangeFromPoint(e,t);return n===null?null:{node:n.startContainer,offset:n.startOffset}}if(document.caretPositionFromPoint!=="undefined"){const n=document.caretPositionFromPoint(e,t);return n===null?null:{node:n.offsetNode,offset:n.offset}}return null}const Go=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,pP=Go&&"documentMode"in document?document.documentMode:null,mP=Go&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),yP=!(!Go||!("InputEvent"in window)||pP)&&"getTargetRanges"in new window.InputEvent("input"),vP=Go&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),By=Go&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,xP=Go&&/^(?=.*Chrome).*/i.test(navigator.userAgent),bP=Go&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&mP&&!xP,zy=ce("DRAG_DROP_PASTE_FILE");let vc=class Yw extends Tt{static getType(){return"quote"}static clone(t){return new Yw(t.__key)}createDOM(t){const n=document.createElement("blockquote");return et(n,t.theme.quote),n}updateDOM(t,n){return!1}static importDOM(){return{blockquote:t=>({conversion:wP,priority:0})}}exportDOM(t){const{element:n}=super.exportDOM(t);if(Be(n)){this.isEmpty()&&n.append(document.createElement("br"));const r=this.getFormatType();r&&(n.style.textAlign=r);const o=this.getDirection();o&&(n.dir=o)}return{element:n}}static importJSON(t){return dg().updateFromJSON(t)}insertNewAfter(t,n){const r=ye(),o=this.getDirection();return r.setDirection(o),this.insertAfter(r,n),r}collapseAtStart(){const t=ye();return this.getChildren().forEach(n=>t.append(n)),this.replace(t),!0}canMergeWhenEmpty(){return!0}};function dg(){return Et(new vc)}function gf(e){return e instanceof vc}let xc=class Xw extends Tt{__tag;static getType(){return"heading"}static clone(t){return new Xw(t.__tag,t.__key)}constructor(t,n){super(n),this.__tag=t}getTag(){return this.__tag}setTag(t){const n=this.getWritable();return this.__tag=t,n}createDOM(t){const n=this.__tag,r=document.createElement(n),o=t.theme.heading;if(o!==void 0){const i=o[n];et(r,i)}return r}updateDOM(t,n,r){return t.__tag!==this.__tag}static importDOM(){return{h1:t=>({conversion:ti,priority:0}),h2:t=>({conversion:ti,priority:0}),h3:t=>({conversion:ti,priority:0}),h4:t=>({conversion:ti,priority:0}),h5:t=>({conversion:ti,priority:0}),h6:t=>({conversion:ti,priority:0}),p:t=>{const n=t.firstChild;return n!==null&&Hy(n)?{conversion:()=>({node:null}),priority:3}:null},span:t=>Hy(t)?{conversion:n=>({node:Co("h1")}),priority:3}:null}}exportDOM(t){const{element:n}=super.exportDOM(t);if(Be(n)){this.isEmpty()&&n.append(document.createElement("br"));const r=this.getFormatType();r&&(n.style.textAlign=r);const o=this.getDirection();o&&(n.dir=o)}return{element:n}}static importJSON(t){return Co(t.tag).updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setTag(t.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(t,n=!0){const r=t?t.anchor.offset:0,o=this.getLastDescendant(),i=!o||t&&t.anchor.key===o.getKey()&&r===o.getTextContentSize()||!t?ye():Co(this.getTag()),s=this.getDirection();if(i.setDirection(s),this.insertAfter(i,n),r===0&&!this.isEmpty()&&t){const a=ye();a.select(),this.replace(a,!0)}return i}collapseAtStart(){const t=this.isEmpty()?ye():Co(this.getTag());return this.getChildren().forEach(n=>t.append(n)),this.replace(t),!0}extractWithChild(){return!0}};function Hy(e){return e.nodeName.toLowerCase()==="span"&&e.style.fontSize==="26pt"}function ti(e){const t=e.nodeName.toLowerCase();let n=null;return t!=="h1"&&t!=="h2"&&t!=="h3"&&t!=="h4"&&t!=="h5"&&t!=="h6"||(n=Co(t),e.style!==null&&(eg(e,n),n.setFormat(e.style.textAlign))),{node:n}}function wP(e){const t=dg();return e.style!==null&&(t.setFormat(e.style.textAlign),eg(e,t)),{node:t}}function Co(e="h1"){return Et(new xc(e))}function Zw(e){return e instanceof xc}function Da(e){let t=null;if(Pr(e,DragEvent)?t=e.dataTransfer:Pr(e,ClipboardEvent)&&(t=e.clipboardData),t===null)return[!1,[],!1];const n=t.types,r=n.includes("Files"),o=n.includes("text/html")||n.includes("text/plain");return[r,Array.from(t.files),o]}function Wy(e){const t=Z();if(!W(t))return!1;const n=new Set,r=t.getNodes();for(let o=0;o<r.length;o++){const i=r[o],s=i.getKey();if(n.has(s))continue;const a=we(i,c=>B(c)&&!c.isInline());if(a===null)continue;const l=a.getKey();a.canIndent()&&!n.has(l)&&(n.add(l),e(a))}return n.size>0}function Ky(e){const t=Ut(e);return Te(t)}function Cu(e){for(const t of["lowercase","uppercase","capitalize"])e.hasFormat(t)&&e.toggleFormat(t)}function CP(e){return Nn(e.registerCommand(ic,t=>{const n=Z();return!!Ct(n)&&(n.clear(),!0)},be),e.registerCommand(Dr,t=>{const n=Z();return W(n)?(n.deleteCharacter(t),!0):!!Ct(n)&&(n.deleteNodes(),!0)},be),e.registerCommand(Oi,t=>{const n=Z();return!!W(n)&&(n.deleteWord(t),!0)},be),e.registerCommand(Lo,t=>{const n=Z();return!!W(n)&&(n.deleteLine(t),!0)},be),e.registerCommand(To,t=>{const n=Z();if(typeof t=="string")n!==null&&n.insertText(t);else{if(n===null)return!1;const r=t.dataTransfer;if(r!=null)Iy(r,n,e);else if(W(n)){const o=t.data;return o&&n.insertText(o),!0}}return!0},be),e.registerCommand(Wd,()=>{const t=Z();return!!W(t)&&(t.removeText(),!0)},be),e.registerCommand(Vt,t=>{const n=Z();return!!W(n)&&(n.formatText(t),!0)},be),e.registerCommand(Ti,t=>{const n=Z();if(!W(n)&&!Ct(n))return!1;const r=n.getNodes();for(const o of r){const i=we(o,s=>B(s)&&!s.isInline());i!==null&&i.setFormat(t)}return!0},be),e.registerCommand(_i,t=>{const n=Z();return!!W(n)&&(n.insertLineBreak(t),!0)},be),e.registerCommand(Po,()=>{const t=Z();return!!W(t)&&(t.insertParagraph(),!0)},be),e.registerCommand(vN,()=>(Bh([Zi()]),!0),be),e.registerCommand(xN,()=>Wy(t=>{const n=t.getIndent();t.setIndent(n+1)}),be),e.registerCommand(jm,()=>Wy(t=>{const n=t.getIndent();n>0&&t.setIndent(Math.max(0,n-1))}),be),e.registerCommand(Fh,t=>{const n=Z();if(Ct(n)){const r=n.getNodes();if(r.length>0)return t.preventDefault(),r[0].selectPrevious(),!0}else if(W(n)){const r=nf(n.focus,!0);if(!t.shiftKey&&Te(r)&&!r.isIsolated()&&!r.isInline())return r.selectPrevious(),t.preventDefault(),!0}return!1},be),e.registerCommand($h,t=>{const n=Z();if(Ct(n)){const r=n.getNodes();if(r.length>0)return t.preventDefault(),r[0].selectNext(0,0),!0}else if(W(n)){if((function(o){const i=o.focus;return i.key==="root"&&i.offset===qe().getChildrenSize()})(n))return t.preventDefault(),!0;const r=nf(n.focus,!1);if(!t.shiftKey&&Te(r)&&!r.isIsolated()&&!r.isInline())return r.selectNext(),t.preventDefault(),!0}return!1},be),e.registerCommand(Lh,t=>{const n=Z();if(Ct(n)){const r=n.getNodes();if(r.length>0)return t.preventDefault(),Cy(r[0])?r[0].selectNext(0,0):r[0].selectPrevious(),!0}if(!W(n))return!1;if(Sy(n,!0)){const r=t.shiftKey;return t.preventDefault(),_y(n,r,!0),!0}return!1},be),e.registerCommand(Ph,t=>{const n=Z();if(Ct(n)){const o=n.getNodes();if(o.length>0)return t.preventDefault(),Cy(o[0])?o[0].selectPrevious():o[0].selectNext(0,0),!0}if(!W(n))return!1;const r=t.shiftKey;return!!Sy(n,!1)&&(t.preventDefault(),_y(n,r,!1),!0)},be),e.registerCommand(sc,t=>{if(Ky(t.target))return!1;const n=Z();if(W(n)){if((function(r){if(!r.isCollapsed())return!1;const{anchor:o}=r;if(o.offset!==0)return!1;const i=o.getNode();if(at(i))return!1;const s=NM(i);return s.getIndent()>0&&(s.is(i)||i.is(s.getFirstDescendant()))})(n))return t.preventDefault(),e.dispatchCommand(jm,void 0);if(By&&navigator.language==="ko-KR")return!1}else if(!Ct(n))return!1;return t.preventDefault(),e.dispatchCommand(Dr,!0)},be),e.registerCommand(Ih,t=>{if(Ky(t.target))return!1;const n=Z();return!(!W(n)&&!Ct(n))&&(t.preventDefault(),e.dispatchCommand(Dr,!1))},be),e.registerCommand(Nl,t=>{const n=Z();if(!W(n))return!1;if(Cu(n),t!==null){if((By||vP||bP)&&yP)return!1;if(t.preventDefault(),t.shiftKey)return e.dispatchCommand(_i,!1)}return e.dispatchCommand(Po,void 0)},be),e.registerCommand(Oh,()=>{const t=Z();return!!W(t)&&(e.blur(),!0)},be),e.registerCommand(xb,t=>{const[,n]=Da(t);if(n.length>0){const o=Vy(t.clientX,t.clientY);if(o!==null){const{offset:i,node:s}=o,a=Ut(s);if(a!==null){const l=dc();if(J(a))l.anchor.set(a.getKey(),i,"text"),l.focus.set(a.getKey(),i,"text");else{const u=a.getParentOrThrow().getKey(),f=a.getIndexWithinParent()+1;l.anchor.set(u,f,"element"),l.focus.set(u,f,"element")}const c=Hs(l);Ge(c)}e.dispatchCommand(zy,n)}return t.preventDefault(),!0}const r=Z();return!!W(r)},be),e.registerCommand(bb,t=>{const[n]=Da(t),r=Z();return!(n&&!W(r))},be),e.registerCommand(wb,t=>{const[n]=Da(t),r=Z();if(n&&!W(r))return!1;const o=Vy(t.clientX,t.clientY);if(o!==null){const i=Ut(o.node);Te(i)&&t.preventDefault()}return!0},be),e.registerCommand(Kd,()=>(eM(),!0),be),e.registerCommand(ac,t=>(hf(e,Pr(t,ClipboardEvent)?t:null),!0),be),e.registerCommand(lc,t=>((async function(n,r){await hf(r,Pr(n,ClipboardEvent)?n:null),r.update(()=>{const o=Z();W(o)?o.removeText():Ct(o)&&o.getNodes().forEach(i=>i.remove())})})(t,e),!0),be),e.registerCommand(Mh,t=>{const[,n,r]=Da(t);return n.length>0&&!r?(e.dispatchCommand(zy,n),!0):Cn(t.target)&&Gh(t.target)?!1:Z()!==null&&((function(o,i){o.preventDefault(),i.update(()=>{const s=Z(),a=Pr(o,InputEvent)||Pr(o,KeyboardEvent)?null:o.clipboardData;a!=null&&s!==null&&Iy(a,s,i)},{tag:NN})})(t,e),!0)},be),e.registerCommand(vb,t=>{const n=Z();return W(n)&&Cu(n),!1},be),e.registerCommand(Dh,t=>{const n=Z();return W(n)&&Cu(n),!1},be))}var Su={exports:{}},Uy;function SP(){return Uy||(Uy=1,(function(e){var t=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};var n=(function(r){var o=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,i=0,s={},a={manual:r.Prism&&r.Prism.manual,disableWorkerMessageHandler:r.Prism&&r.Prism.disableWorkerMessageHandler,util:{encode:function y(x){return x instanceof l?new l(x.type,y(x.content),x.alias):Array.isArray(x)?x.map(y):x.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(y){return Object.prototype.toString.call(y).slice(8,-1)},objId:function(y){return y.__id||Object.defineProperty(y,"__id",{value:++i}),y.__id},clone:function y(x,b){b=b||{};var w,_;switch(a.util.type(x)){case"Object":if(_=a.util.objId(x),b[_])return b[_];w={},b[_]=w;for(var E in x)x.hasOwnProperty(E)&&(w[E]=y(x[E],b));return w;case"Array":return _=a.util.objId(x),b[_]?b[_]:(w=[],b[_]=w,x.forEach(function(R,k){w[k]=y(R,b)}),w);default:return x}},getLanguage:function(y){for(;y;){var x=o.exec(y.className);if(x)return x[1].toLowerCase();y=y.parentElement}return"none"},setLanguage:function(y,x){y.className=y.className.replace(RegExp(o,"gi"),""),y.classList.add("language-"+x)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw new Error}catch(w){var y=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(w.stack)||[])[1];if(y){var x=document.getElementsByTagName("script");for(var b in x)if(x[b].src==y)return x[b]}return null}},isActive:function(y,x,b){for(var w="no-"+x;y;){var _=y.classList;if(_.contains(x))return!0;if(_.contains(w))return!1;y=y.parentElement}return!!b}},languages:{plain:s,plaintext:s,text:s,txt:s,extend:function(y,x){var b=a.util.clone(a.languages[y]);for(var w in x)b[w]=x[w];return b},insertBefore:function(y,x,b,w){w=w||a.languages;var _=w[y],E={};for(var R in _)if(_.hasOwnProperty(R)){if(R==x)for(var k in b)b.hasOwnProperty(k)&&(E[k]=b[k]);b.hasOwnProperty(R)||(E[R]=_[R])}var P=w[y];return w[y]=E,a.languages.DFS(a.languages,function(F,$){$===P&&F!=y&&(this[F]=E)}),E},DFS:function y(x,b,w,_){_=_||{};var E=a.util.objId;for(var R in x)if(x.hasOwnProperty(R)){b.call(x,R,x[R],w||R);var k=x[R],P=a.util.type(k);P==="Object"&&!_[E(k)]?(_[E(k)]=!0,y(k,b,null,_)):P==="Array"&&!_[E(k)]&&(_[E(k)]=!0,y(k,b,R,_))}}},plugins:{},highlightAll:function(y,x){a.highlightAllUnder(document,y,x)},highlightAllUnder:function(y,x,b){var w={callback:b,container:y,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};a.hooks.run("before-highlightall",w),w.elements=Array.prototype.slice.apply(w.container.querySelectorAll(w.selector)),a.hooks.run("before-all-elements-highlight",w);for(var _=0,E;E=w.elements[_++];)a.highlightElement(E,x===!0,w.callback)},highlightElement:function(y,x,b){var w=a.util.getLanguage(y),_=a.languages[w];a.util.setLanguage(y,w);var E=y.parentElement;E&&E.nodeName.toLowerCase()==="pre"&&a.util.setLanguage(E,w);var R=y.textContent,k={element:y,language:w,grammar:_,code:R};function P($){k.highlightedCode=$,a.hooks.run("before-insert",k),k.element.innerHTML=k.highlightedCode,a.hooks.run("after-highlight",k),a.hooks.run("complete",k),b&&b.call(k.element)}if(a.hooks.run("before-sanity-check",k),E=k.element.parentElement,E&&E.nodeName.toLowerCase()==="pre"&&!E.hasAttribute("tabindex")&&E.setAttribute("tabindex","0"),!k.code){a.hooks.run("complete",k),b&&b.call(k.element);return}if(a.hooks.run("before-highlight",k),!k.grammar){P(a.util.encode(k.code));return}if(x&&r.Worker){var F=new Worker(a.filename);F.onmessage=function($){P($.data)},F.postMessage(JSON.stringify({language:k.language,code:k.code,immediateClose:!0}))}else P(a.highlight(k.code,k.grammar,k.language))},highlight:function(y,x,b){var w={code:y,grammar:x,language:b};if(a.hooks.run("before-tokenize",w),!w.grammar)throw new Error('The language "'+w.language+'" has no grammar.');return w.tokens=a.tokenize(w.code,w.grammar),a.hooks.run("after-tokenize",w),l.stringify(a.util.encode(w.tokens),w.language)},tokenize:function(y,x){var b=x.rest;if(b){for(var w in b)x[w]=b[w];delete x.rest}var _=new f;return d(_,_.head,y),u(y,_,x,_.head,0),g(_)},hooks:{all:{},add:function(y,x){var b=a.hooks.all;b[y]=b[y]||[],b[y].push(x)},run:function(y,x){var b=a.hooks.all[y];if(!(!b||!b.length))for(var w=0,_;_=b[w++];)_(x)}},Token:l};r.Prism=a;function l(y,x,b,w){this.type=y,this.content=x,this.alias=b,this.length=(w||"").length|0}l.stringify=function y(x,b){if(typeof x=="string")return x;if(Array.isArray(x)){var w="";return x.forEach(function(P){w+=y(P,b)}),w}var _={type:x.type,content:y(x.content,b),tag:"span",classes:["token",x.type],attributes:{},language:b},E=x.alias;E&&(Array.isArray(E)?Array.prototype.push.apply(_.classes,E):_.classes.push(E)),a.hooks.run("wrap",_);var R="";for(var k in _.attributes)R+=" "+k+'="'+(_.attributes[k]||"").replace(/"/g,"&quot;")+'"';return"<"+_.tag+' class="'+_.classes.join(" ")+'"'+R+">"+_.content+"</"+_.tag+">"};function c(y,x,b,w){y.lastIndex=x;var _=y.exec(b);if(_&&w&&_[1]){var E=_[1].length;_.index+=E,_[0]=_[0].slice(E)}return _}function u(y,x,b,w,_,E){for(var R in b)if(!(!b.hasOwnProperty(R)||!b[R])){var k=b[R];k=Array.isArray(k)?k:[k];for(var P=0;P<k.length;++P){if(E&&E.cause==R+","+P)return;var F=k[P],$=F.inside,j=!!F.lookbehind,O=!!F.greedy,D=F.alias;if(O&&!F.pattern.global){var K=F.pattern.toString().match(/[imsuy]*$/)[0];F.pattern=RegExp(F.pattern.source,K+"g")}for(var I=F.pattern||F,M=w.next,H=_;M!==x.tail&&!(E&&H>=E.reach);H+=M.value.length,M=M.next){var U=M.value;if(x.length>y.length)return;if(!(U instanceof l)){var re=1,G;if(O){if(G=c(I,H,y,j),!G||G.index>=y.length)break;var oe=G.index,Y=G.index+G[0].length,Q=H;for(Q+=M.value.length;oe>=Q;)M=M.next,Q+=M.value.length;if(Q-=M.value.length,H=Q,M.value instanceof l)continue;for(var ne=M;ne!==x.tail&&(Q<Y||typeof ne.value=="string");ne=ne.next)re++,Q+=ne.value.length;re--,U=y.slice(H,Q),G.index-=H}else if(G=c(I,0,U,j),!G)continue;var oe=G.index,me=G[0],ee=U.slice(0,oe),ve=U.slice(oe+me.length),Se=H+U.length;E&&Se>E.reach&&(E.reach=Se);var Ee=M.prev;ee&&(Ee=d(x,Ee,ee),H+=ee.length),h(x,Ee,re);var ze=new l(R,$?a.tokenize(me,$):me,D,me);if(M=d(x,Ee,ze),ve&&d(x,M,ve),re>1){var je={cause:R+","+P,reach:Se};u(y,x,b,M.prev,H,je),E&&je.reach>E.reach&&(E.reach=je.reach)}}}}}}function f(){var y={value:null,prev:null,next:null},x={value:null,prev:y,next:null};y.next=x,this.head=y,this.tail=x,this.length=0}function d(y,x,b){var w=x.next,_={value:b,prev:x,next:w};return x.next=_,w.prev=_,y.length++,_}function h(y,x,b){for(var w=x.next,_=0;_<b&&w!==y.tail;_++)w=w.next;x.next=w,w.prev=x,y.length-=_}function g(y){for(var x=[],b=y.head.next;b!==y.tail;)x.push(b.value),b=b.next;return x}if(!r.document)return r.addEventListener&&(a.disableWorkerMessageHandler||r.addEventListener("message",function(y){var x=JSON.parse(y.data),b=x.language,w=x.code,_=x.immediateClose;r.postMessage(a.highlight(w,a.languages[b],b)),_&&r.close()},!1)),a;var p=a.util.currentScript();p&&(a.filename=p.src,p.hasAttribute("data-manual")&&(a.manual=!0));function m(){a.manual||a.highlightAll()}if(!a.manual){var v=document.readyState;v==="loading"||v==="interactive"&&p&&p.defer?document.addEventListener("DOMContentLoaded",m):window.requestAnimationFrame?window.requestAnimationFrame(m):window.setTimeout(m,16)}return a})(t);e.exports&&(e.exports=n),typeof Bn<"u"&&(Bn.Prism=n),n.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},n.languages.markup.tag.inside["attr-value"].inside.entity=n.languages.markup.entity,n.languages.markup.doctype.inside["internal-subset"].inside=n.languages.markup,n.hooks.add("wrap",function(r){r.type==="entity"&&(r.attributes.title=r.content.replace(/&amp;/,"&"))}),Object.defineProperty(n.languages.markup.tag,"addInlined",{value:function(o,i){var s={};s["language-"+i]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:n.languages[i]},s.cdata=/^<!\[CDATA\[|\]\]>$/i;var a={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:s}};a["language-"+i]={pattern:/[\s\S]+/,inside:n.languages[i]};var l={};l[o]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return o}),"i"),lookbehind:!0,greedy:!0,inside:a},n.languages.insertBefore("markup","cdata",l)}}),Object.defineProperty(n.languages.markup.tag,"addAttribute",{value:function(r,o){n.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+r+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[o,"language-"+o],inside:n.languages[o]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),n.languages.html=n.languages.markup,n.languages.mathml=n.languages.markup,n.languages.svg=n.languages.markup,n.languages.xml=n.languages.extend("markup",{}),n.languages.ssml=n.languages.xml,n.languages.atom=n.languages.xml,n.languages.rss=n.languages.xml,(function(r){var o=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;r.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+o.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+o.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+o.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+o.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:o,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},r.languages.css.atrule.inside.rest=r.languages.css;var i=r.languages.markup;i&&(i.tag.addInlined("style","css"),i.tag.addAttribute("style","css"))})(n),n.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},n.languages.javascript=n.languages.extend("clike",{"class-name":[n.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),n.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,n.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:n.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:n.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:n.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:n.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:n.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),n.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:n.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),n.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),n.languages.markup&&(n.languages.markup.tag.addInlined("script","javascript"),n.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),n.languages.js=n.languages.javascript,(function(){if(typeof n>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var r="Loading…",o=function(p,m){return"✖ Error "+p+" while fetching file: "+m},i="✖ Error: File does not exist or is empty",s={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},a="data-src-status",l="loading",c="loaded",u="failed",f="pre[data-src]:not(["+a+'="'+c+'"]):not(['+a+'="'+l+'"])';function d(p,m,v){var y=new XMLHttpRequest;y.open("GET",p,!0),y.onreadystatechange=function(){y.readyState==4&&(y.status<400&&y.responseText?m(y.responseText):y.status>=400?v(o(y.status,y.statusText)):v(i))},y.send(null)}function h(p){var m=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(p||"");if(m){var v=Number(m[1]),y=m[2],x=m[3];return y?x?[v,Number(x)]:[v,void 0]:[v,v]}}n.hooks.add("before-highlightall",function(p){p.selector+=", "+f}),n.hooks.add("before-sanity-check",function(p){var m=p.element;if(m.matches(f)){p.code="",m.setAttribute(a,l);var v=m.appendChild(document.createElement("CODE"));v.textContent=r;var y=m.getAttribute("data-src"),x=p.language;if(x==="none"){var b=(/\.(\w+)$/.exec(y)||[,"none"])[1];x=s[b]||b}n.util.setLanguage(v,x),n.util.setLanguage(m,x);var w=n.plugins.autoloader;w&&w.loadLanguages(x),d(y,function(_){m.setAttribute(a,c);var E=h(m.getAttribute("data-range"));if(E){var R=_.split(/\r\n?|\n/g),k=E[0],P=E[1]==null?R.length:E[1];k<0&&(k+=R.length),k=Math.max(0,Math.min(k-1,R.length)),P<0&&(P+=R.length),P=Math.max(0,Math.min(P,R.length)),_=R.slice(k,P).join(`
48
+ `),m.hasAttribute("data-start")||m.setAttribute("data-start",String(k+1))}v.textContent=_,n.highlightElement(v)},function(_){m.setAttribute(a,u),v.textContent=_})}}),n.plugins.fileHighlight={highlight:function(m){for(var v=(m||document).querySelectorAll(f),y=0,x;x=v[y++];)n.highlightElement(x)}};var g=!1;n.fileHighlight=function(){g||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),g=!0),n.plugins.fileHighlight.highlight.apply(this,arguments)}})()})(Su)),Su.exports}SP();Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/};Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/});Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}});Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}});Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript"));Prism.languages.js=Prism.languages.javascript;Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]};Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity;Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup;Prism.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&amp;/,"&"))});Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(t,n){var r={};r["language-"+n]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[n]},r.cdata=/^<!\[CDATA\[|\]\]>$/i;var o={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};o["language-"+n]={pattern:/[\s\S]+/,inside:Prism.languages[n]};var i={};i[t]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return t}),"i"),lookbehind:!0,greedy:!0,inside:o},Prism.languages.insertBefore("markup","cdata",i)}});Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(e,t){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:Prism.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}});Prism.languages.html=Prism.languages.markup;Prism.languages.mathml=Prism.languages.markup;Prism.languages.svg=Prism.languages.markup;Prism.languages.xml=Prism.languages.extend("markup",{});Prism.languages.ssml=Prism.languages.xml;Prism.languages.atom=Prism.languages.xml;Prism.languages.rss=Prism.languages.xml;(function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(u){return u=u.replace(/<inner>/g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+u+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,o=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return r}),i=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+o+i+"(?:"+o+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+o+i+")(?:"+o+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+o+")"+i+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+o+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(u){["url","bold","italic","strike","code-snippet"].forEach(function(f){u!==f&&(e.languages.markdown[u].inside.content.inside[f]=e.languages.markdown[f])})}),e.hooks.add("after-tokenize",function(u){if(u.language!=="markdown"&&u.language!=="md")return;function f(d){if(!(!d||typeof d=="string"))for(var h=0,g=d.length;h<g;h++){var p=d[h];if(p.type!=="code"){f(p.content);continue}var m=p.content[1],v=p.content[3];if(m&&v&&m.type==="code-language"&&v.type==="code-block"&&typeof m.content=="string"){var y=m.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");y=(/[a-z][\w-]*/i.exec(y)||[""])[0].toLowerCase();var x="language-"+y;v.alias?typeof v.alias=="string"?v.alias=[v.alias,x]:v.alias.push(x):v.alias=[x]}}}f(u.tokens)}),e.hooks.add("wrap",function(u){if(u.type==="code-block"){for(var f="",d=0,h=u.classes.length;d<h;d++){var g=u.classes[d],p=/language-(.+)/.exec(g);if(p){f=p[1];break}}var m=e.languages[f];if(m)u.content=e.highlight(c(u.content),m,f);else if(f&&f!=="none"&&e.plugins.autoloader){var v="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*1e16);u.attributes.id=v,e.plugins.autoloader.loadLanguages(f,function(){var y=document.getElementById(v);y&&(y.innerHTML=e.highlight(y.textContent,e.languages[f],f))})}}});var s=RegExp(e.languages.markup.tag.pattern.source,"gi"),a={amp:"&",lt:"<",gt:">",quot:'"'},l=String.fromCodePoint||String.fromCharCode;function c(u){var f=u.replace(s,"");return f=f.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(d,h){if(h=h.toLowerCase(),h[0]==="#"){var g;return h[1]==="x"?g=parseInt(h.slice(2),16):g=Number(h.slice(1)),l(g)}else{var p=a[h];return p||d}}),f}e.languages.md=e.languages.markdown})(Prism);Prism.languages.c=Prism.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/});Prism.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}});Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}});Prism.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/});delete Prism.languages.c.boolean;(function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))})(Prism);Prism.languages.objectivec=Prism.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/});delete Prism.languages.objectivec["class-name"];Prism.languages.objc=Prism.languages.objectivec;Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/};(function(e){var t=e.languages.powershell={comment:[{pattern:/(^|[^`])<#[\s\S]*?#>/,lookbehind:!0},{pattern:/(^|[^`])#.*/,lookbehind:!0}],string:[{pattern:/"(?:`[\s\S]|[^`"])*"/,greedy:!0,inside:null},{pattern:/'(?:[^']|'')*'/,greedy:!0}],namespace:/\[[a-z](?:\[(?:\[[^\]]*\]|[^\[\]])*\]|[^\[\]])*\]/i,boolean:/\$(?:false|true)\b/i,variable:/\$\w+\b/,function:[/\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\b/i,/\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i],keyword:/\b(?:Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,operator:{pattern:/(^|\W)(?:!|-(?:b?(?:and|x?or)|as|(?:Not)?(?:Contains|In|Like|Match)|eq|ge|gt|is(?:Not)?|Join|le|lt|ne|not|Replace|sh[lr])\b|-[-=]?|\+[+=]?|[*\/%]=?)/i,lookbehind:!0},punctuation:/[|{}[\];(),.]/};t.string[0].inside={function:{pattern:/(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,lookbehind:!0,inside:t},boolean:t.boolean,variable:t.variable}})(Prism);var Gy={},qy;function _P(){return qy||(qy=1,Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python),Gy}_P();var Yy={},Xy;function TP(){return Xy||(Xy=1,(function(e){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)t=t.replace(/<self>/g,function(){return t});t=t.replace(/<self>/g,function(){return/[^\s\S]/.source}),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string})(Prism)),Yy}TP();Prism.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+(/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+")+"|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/};Prism.languages.swift["string-literal"].forEach(function(e){e.inside.interpolation.inside=Prism.languages.swift});var Zy={},Jy;function EP(){return Jy||(Jy=1,(function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript})(Prism)),Zy}EP();var Qy={},ev;function RP(){return ev||(ev=1,(function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,r={pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:r.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+n+/[A-Z]\w*\b/.source),lookbehind:!0,inside:r.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),e.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+n+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+n+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(Prism)),Qy}RP();var tv={},nv;function kP(){return nv||(nv=1,(function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return t.source});e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return n})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])})(Prism)),tv}kP();function Jw(e,t){for(const n of e.childNodes){if(Be(n)&&n.tagName===t)return!0;Jw(n,t)}return!1}const Ss="data-language",ds="data-highlight-language",ja="data-theme";let bc=class Qw extends Tt{__language;__theme;__isSyntaxHighlightSupported;static getType(){return"code"}static clone(t){return new Qw(t.__language,t.__key)}constructor(t,n){super(n),this.__language=t||void 0,this.__isSyntaxHighlightSupported=!1,this.__theme=void 0}afterCloneFrom(t){super.afterCloneFrom(t),this.__language=t.__language,this.__theme=t.__theme,this.__isSyntaxHighlightSupported=t.__isSyntaxHighlightSupported}createDOM(t){const n=document.createElement("code");et(n,t.theme.code),n.setAttribute("spellcheck","false");const r=this.getLanguage();r&&(n.setAttribute(Ss,r),this.getIsSyntaxHighlightSupported()&&n.setAttribute(ds,r));const o=this.getTheme();o&&n.setAttribute(ja,o);const i=this.getStyle();return i&&n.setAttribute("style",i),n}updateDOM(t,n,r){const o=this.__language,i=t.__language;o?o!==i&&n.setAttribute(Ss,o):i&&n.removeAttribute(Ss);const s=this.__isSyntaxHighlightSupported;t.__isSyntaxHighlightSupported&&i?s&&o?o!==i&&n.setAttribute(ds,o):n.removeAttribute(ds):s&&o&&n.setAttribute(ds,o);const a=this.__theme,l=t.__theme;a?a!==l&&n.setAttribute(ja,a):l&&n.removeAttribute(ja);const c=this.__style,u=t.__style;return c?c!==u&&n.setAttribute("style",c):u&&n.removeAttribute("style"),!1}exportDOM(t){const n=document.createElement("pre");et(n,t._config.theme.code),n.setAttribute("spellcheck","false");const r=this.getLanguage();r&&(n.setAttribute(Ss,r),this.getIsSyntaxHighlightSupported()&&n.setAttribute(ds,r));const o=this.getTheme();o&&n.setAttribute(ja,o);const i=this.getStyle();return i&&n.setAttribute("style",i),{element:n}}static importDOM(){return{code:t=>t.textContent!=null&&(/\r?\n/.test(t.textContent)||Jw(t,"BR"))?{conversion:rv,priority:1}:null,div:()=>({conversion:AP,priority:1}),pre:()=>({conversion:rv,priority:0}),table:t=>_u(t)?{conversion:NP,priority:3}:null,td:t=>{const n=t,r=n.closest("table");return n.classList.contains("js-file-line")||r&&_u(r)?{conversion:ov,priority:3}:null},tr:t=>{const n=t.closest("table");return n&&_u(n)?{conversion:ov,priority:3}:null}}}static importJSON(t){return gr().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setLanguage(t.language).setTheme(t.theme)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),theme:this.getTheme()}}insertNewAfter(t,n=!0){const r=this.getChildren(),o=r.length;if(o>=2&&r[o-1].getTextContent()===`
49
49
  `&&r[o-2].getTextContent()===`
50
- `&&t.isCollapsed()&&t.anchor.key===this.__key&&t.anchor.offset===o){r[o-1].remove(),r[o-2].remove();const l=ve();return this.insertAfter(l,n),l}const{anchor:i,focus:s}=t,a=(i.isBefore(s)?i:s).getNode();if(J(a)){let l=eM(a);const c=[];for(;;)if(rc(l))c.push(qi()),l=l.getNextSibling();else{if(!Dw(l))break;{let m=0;const v=l.getTextContent(),y=l.getTextContentSize();for(;m<y&&v[m]===" ";)m++;if(m!==0&&c.push(Iw(" ".repeat(m))),m!==y)break;l=l.getNextSibling()}}const u=a.splitText(i.offset)[0],f=i.offset===0?0:1,d=u.getIndexWithinParent()+f,h=a.getParentOrThrow(),g=[kn(),...c];h.splice(d,0,g);const p=c[c.length-1];p?p.select():i.offset===0?u.selectPrevious():u.getNextSibling().selectNext(0,0)}if(Jh(a)){const{offset:l}=t.anchor;a.splice(l,0,[kn()]),a.select(l+1,l+1)}return null}canIndent(){return!1}collapseAtStart(){const t=ve();return this.getChildren().forEach(n=>t.append(n)),this.replace(t),!0}setLanguage(t){const n=this.getWritable();return n.__language=t||void 0,n}getLanguage(){return this.getLatest().__language}setIsSyntaxHighlightSupported(t){const n=this.getWritable();return n.__isSyntaxHighlightSupported=t,n}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}setTheme(t){const n=this.getWritable();return n.__theme=t||void 0,n}getTheme(){return this.getLatest().__theme}};function hr(e,t){return H1(gc).setLanguage(e).setTheme(t)}function Jh(e){return e instanceof gc}function Dy(e){return{node:hr(e.getAttribute(Ss))}}function ZN(e){const t=e,n=Vy(t);return n||(function(r){let o=r.parentElement;for(;o!==null;){if(Vy(o))return!0;o=o.parentElement}return!1})(t)?{node:n?hr():null}:{node:null}}function JN(){return{node:hr()}}function jy(){return{node:null}}function Vy(e){return e.style.fontFamily.match("monospace")!==null}function mu(e){return e.classList.contains("js-file-line-container")}let $w=class Ow extends fn{__highlightType;constructor(t="",n,r){super(t,r),this.__highlightType=n}static getType(){return"code-highlight"}static clone(t){return new Ow(t.__text,t.__highlightType||void 0,t.__key)}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(t){const n=this.getWritable();return n.__highlightType=t||void 0,n}canHaveFormat(){return!1}createDOM(t){const n=super.createDOM(t),r=yu(t.theme,this.__highlightType);return et(n,r),n}updateDOM(t,n,r){const o=super.updateDOM(t,n,r),i=yu(r.theme,t.__highlightType),s=yu(r.theme,this.__highlightType);return i!==s&&(i&&Yn(n,i),s&&et(n,s)),o}static importJSON(t){return Iw().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setHighlightType(t.highlightType)}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType()}}setFormat(t){return this}isParentRequired(){return!0}createParentElementNode(){return hr()}};function yu(e,t){return t&&e&&e.codeHighlight&&e.codeHighlight[t]}function Iw(e="",t){return Et(new $w(e,t))}function Dw(e){return e instanceof $w}function QN(e,t){let n=e;for(let r=nt(e,t);r&&(Dw(r.origin)||rc(r.origin));r=XA(r))n=r.origin;return n}function eM(e){return QN(e,"previous")}(function(e){e.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(t).forEach(function(n){var r=t[n],o=[];/^\w+$/.test(n)||o.push(/\w+/.exec(n)[0]),n==="diff"&&o.push("bold"),e.languages.diff[n]={pattern:RegExp("^(?:["+r+`].*(?:\r
50
+ `&&t.isCollapsed()&&t.anchor.key===this.__key&&t.anchor.offset===o){r[o-1].remove(),r[o-2].remove();const l=ye();return this.insertAfter(l,n),l}const{anchor:i,focus:s}=t,a=(i.isBefore(s)?i:s).getNode();if(J(a)){let l=PP(a);const c=[];for(;;)if(cc(l))c.push(Zi()),l=l.getNextSibling();else{if(!rC(l))break;{let m=0;const v=l.getTextContent(),y=l.getTextContentSize();for(;m<y&&v[m]===" ";)m++;if(m!==0&&c.push(nC(" ".repeat(m))),m!==y)break;l=l.getNextSibling()}}const u=a.splitText(i.offset)[0],f=i.offset===0?0:1,d=u.getIndexWithinParent()+f,h=a.getParentOrThrow(),g=[kn(),...c];h.splice(d,0,g);const p=c[c.length-1];p?p.select():i.offset===0?u.selectPrevious():u.getNextSibling().selectNext(0,0)}if(fg(a)){const{offset:l}=t.anchor;a.splice(l,0,[kn()]),a.select(l+1,l+1)}return null}canIndent(){return!1}collapseAtStart(){const t=ye();return this.getChildren().forEach(n=>t.append(n)),this.replace(t),!0}setLanguage(t){const n=this.getWritable();return n.__language=t||void 0,n}getLanguage(){return this.getLatest().__language}setIsSyntaxHighlightSupported(t){const n=this.getWritable();return n.__isSyntaxHighlightSupported=t,n}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}setTheme(t){const n=this.getWritable();return n.__theme=t||void 0,n}getTheme(){return this.getLatest().__theme}};function gr(e,t){return lw(bc).setLanguage(e).setTheme(t)}function fg(e){return e instanceof bc}function rv(e){return{node:gr(e.getAttribute(Ss))}}function AP(e){const t=e,n=iv(t);return n||(function(r){let o=r.parentElement;for(;o!==null;){if(iv(o))return!0;o=o.parentElement}return!1})(t)?{node:n?gr():null}:{node:null}}function NP(){return{node:gr()}}function ov(){return{node:null}}function iv(e){return e.style.fontFamily.match("monospace")!==null}function _u(e){return e.classList.contains("js-file-line-container")}let eC=class tC extends fn{__highlightType;constructor(t="",n,r){super(t,r),this.__highlightType=n}static getType(){return"code-highlight"}static clone(t){return new tC(t.__text,t.__highlightType||void 0,t.__key)}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(t){const n=this.getWritable();return n.__highlightType=t||void 0,n}canHaveFormat(){return!1}createDOM(t){const n=super.createDOM(t),r=Tu(t.theme,this.__highlightType);return et(n,r),n}updateDOM(t,n,r){const o=super.updateDOM(t,n,r),i=Tu(r.theme,t.__highlightType),s=Tu(r.theme,this.__highlightType);return i!==s&&(i&&Xn(n,i),s&&et(n,s)),o}static importJSON(t){return nC().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setHighlightType(t.highlightType)}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType()}}setFormat(t){return this}isParentRequired(){return!0}createParentElementNode(){return gr()}};function Tu(e,t){return t&&e&&e.codeHighlight&&e.codeHighlight[t]}function nC(e="",t){return Et(new eC(e,t))}function rC(e){return e instanceof eC}function MP(e,t){let n=e;for(let r=nt(e,t);r&&(rC(r.origin)||cc(r.origin));r=kM(r))n=r.origin;return n}function PP(e){return MP(e,"previous")}(function(e){e.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(t).forEach(function(n){var r=t[n],o=[];/^\w+$/.test(n)||o.push(/\w+/.exec(n)[0]),n==="diff"&&o.push("bold"),e.languages.diff[n]={pattern:RegExp("^(?:["+r+`].*(?:\r
51
51
  ?|
52
- |(?![\\s\\S])))+`,"m"),alias:o,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(n)[0]}}}}),Object.defineProperty(e.languages.diff,"PREFIXES",{value:t})})(Prism);const tM=new Set(["http:","https:","mailto:","sms:","tel:"]);let da=class jw extends Tt{__url;__target;__rel;__title;static getType(){return"link"}static clone(t){return new jw(t.__url,{rel:t.__rel,target:t.__target,title:t.__title},t.__key)}constructor(t="",n={},r){super(r);const{target:o=null,rel:i=null,title:s=null}=n;this.__url=t,this.__target=o,this.__rel=i,this.__title=s}createDOM(t){const n=document.createElement("a");return this.updateLinkDOM(null,n,t),et(n,t.theme.link),n}updateLinkDOM(t,n,r){if(B1(n)){t&&t.__url===this.__url||(n.href=this.sanitizeUrl(this.__url));for(const o of["target","rel","title"]){const i=`__${o}`,s=this[i];t&&t[i]===s||(s?n[o]=s:n.removeAttribute(o))}}}updateDOM(t,n,r){return this.updateLinkDOM(t,n,r),!1}static importDOM(){return{a:t=>({conversion:nM,priority:1})}}static importJSON(t){return Ol().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setURL(t.url).setRel(t.rel||null).setTarget(t.target||null).setTitle(t.title||null)}sanitizeUrl(t){t=zy(t);try{const n=new URL(zy(t));if(!tM.has(n.protocol))return"about:blank"}catch{return t}return t}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(t){const n=this.getWritable();return n.__url=t,n}getTarget(){return this.getLatest().__target}setTarget(t){const n=this.getWritable();return n.__target=t,n}getRel(){return this.getLatest().__rel}setRel(t){const n=this.getWritable();return n.__rel=t,n}getTitle(){return this.getLatest().__title}setTitle(t){const n=this.getWritable();return n.__title=t,n}insertNewAfter(t,n=!0){const r=Ol(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(r,n),r}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(t,n,r){if(!W(n))return!1;const o=n.anchor.getNode(),i=n.focus.getNode();return this.isParentOf(o)&&this.isParentOf(i)&&n.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}};function nM(e){let t=null;if(B1(e)){const n=e.textContent;(n!==null&&n!==""||e.children.length>0)&&(t=Ol(e.getAttribute("href")||"",{rel:e.getAttribute("rel"),target:e.getAttribute("target"),title:e.getAttribute("title")}))}return{node:t}}function Ol(e="",t){return Et(new da(e,t))}function rM(e){return e instanceof da}class fa extends da{__isUnlinked;constructor(t="",n={},r){super(t,n,r),this.__isUnlinked=n.isUnlinked!==void 0&&n.isUnlinked!==null&&n.isUnlinked}static getType(){return"autolink"}static clone(t){return new fa(t.__url,{isUnlinked:t.__isUnlinked,rel:t.__rel,target:t.__target,title:t.__title},t.__key)}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(t){const n=this.getWritable();return n.__isUnlinked=t,n}createDOM(t){return this.__isUnlinked?document.createElement("span"):super.createDOM(t)}updateDOM(t,n,r){return super.updateDOM(t,n,r)||t.__isUnlinked!==this.__isUnlinked}static importJSON(t){return By().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setIsUnlinked(t.isUnlinked||!1)}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(t,n=!0){const r=this.getParentOrThrow().insertNewAfter(t,n);if(B(r)){const o=By(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return r.append(o),o}return null}}function By(e="",t){return Et(new fa(e,t))}function oM(e){return e instanceof fa}const iM=/^\+?[0-9\s()-]{5,}$/;function zy(e){return e.match(/^[a-z][a-z0-9+.-]*:/i)||e.match(/^[/#.]/)?e:e.includes("@")?`mailto:${e}`:iM.test(e)?`tel:${e}`:`https://${e}`}function cf(e,t){const n={};for(const r of e){const o=t(r);o&&(n[o]?n[o].push(r):n[o]=[r])}return n}function Qh(e){const t=cf(e,n=>n.type);return{element:t.element||[],multilineElement:t["multiline-element"]||[],textFormat:t["text-format"]||[],textMatch:t["text-match"]||[]}}const Il=/[!-/:-@[-`{-~\s]/,sM=/^\s{0,3}$/;function uf(e){if(!Qr(e))return!1;const t=e.getFirstChild();return t==null||e.getChildrenSize()===1&&J(t)&&sM.test(t.getTextContent())}function aM(e,t,n,r){for(const o of t){if(!o.export)continue;const i=o.export(e,s=>Dl(s,n,r));if(i!=null)return i}return B(e)?Dl(e,n,r):Te(e)?e.getTextContent():null}function Dl(e,t,n,r,o){const i=[],s=e.getChildren();r||(r=[]),o||(o=[]);e:for(const a of s){for(const l of n){if(!l.export)continue;const c=l.export(a,u=>Dl(u,t,n,r,[...o,...r]),(u,f)=>Hy(u,f,t,r,o));if(c!=null){i.push(c);continue e}}Kn(a)?i.push(`
53
- `):J(a)?i.push(Hy(a,a.getTextContent(),t,r,o)):B(a)?i.push(Dl(a,t,n,r,o)):Te(a)&&i.push(a.getTextContent())}return i.join("")}function Hy(e,t,n,r,o){let i=e.getFormat()===0?t:(function(d){return d.replace(/^\s+|\s+$/g,h=>[...h].map(g=>"&#"+g.codePointAt(0)+";").join(""))})(t);e.hasFormat("code")||(i=i.replace(/([*_`~\\])/g,"\\$1"));let s="",a="",l="";const c=Wy(e,!0),u=Wy(e,!1),f=new Set;for(const d of n){const h=d.format[0],g=d.tag;Da(e,h)&&!f.has(h)&&(f.add(h),Da(c,h)&&r.find(p=>p.tag===g)||(r.push({format:h,tag:g}),s+=g))}for(let d=0;d<r.length;d++){const h=Da(e,r[d].format),g=Da(u,r[d].format);if(h&&g)continue;const p=[...r];for(;p.length>d;){const m=p.pop();o&&m&&o.find(v=>v.tag===m.tag)||(m&&typeof m.tag=="string"&&(h?g||(l+=m.tag):a+=m.tag),r.pop())}break}return i=s+i+l,a+i}function Wy(e,t){let n=t?e.getPreviousSibling():e.getNextSibling();if(!n){const r=e.getParentOrThrow();r.isInline()&&(n=t?r.getPreviousSibling():r.getNextSibling())}for(;n;){if(B(n)){if(!n.isInline())break;const r=t?n.getLastDescendant():n.getFirstDescendant();if(J(r))return r;n=t?n.getPreviousSibling():n.getNextSibling()}if(J(n))return n;if(!B(n))return null}return null}function Da(e,t){return J(e)&&e.hasFormat(t)}function lM(e,t){const n=(function(o,i){const s=o.match(i.openTagsRegExp);if(s==null)return null;for(const a of s){const l=a.replace(/^\s/,""),c=i.fullMatchRegExpByTag[l];if(c==null)continue;const u=o.match(c),f=i.transformersByTag[l];if(u!=null&&f!=null){if(f.intraword!==!1)return u;const{index:d=0}=u,h=o[d-1],g=o[d+u[0].length];if((!h||Il.test(h))&&(!g||Il.test(g)))return u}}return null})(e.getTextContent(),t);if(!n)return null;const r=n.index||0;return{endIndex:r+n[0].length,match:n,startIndex:r,transformer:t.transformersByTag[n[1]]}}function ho(e){return J(e)&&!e.hasFormat("code")}function go(e,t,n){let r=lM(e,t),o=(function(s,a){const l=s;let c,u,f,d;for(const h of a){if(!h.replace||!h.importRegExp)continue;const g=l.getTextContent().match(h.importRegExp);if(!g)continue;const p=g.index||0,m=h.getEndIndex?h.getEndIndex(l,g):p+g[0].length;m!==!1&&(c===void 0||u===void 0||p<c&&(m>u||m<=c))&&(c=p,u=m,f=h,d=g)}return c===void 0||u===void 0||f===void 0||d===void 0?null:{endIndex:u,match:d,startIndex:c,transformer:f}})(e,n);if(r&&o&&(r.startIndex<=o.startIndex&&r.endIndex>=o.endIndex||o.startIndex>r.endIndex?o=null:r=null),r){const s=(function(a,l,c,u,f){const d=a.getTextContent();let h,g,p;if(f[0]===d?h=a:l===0?[h,g]=a.splitText(c):[p,h,g]=a.splitText(l,c),h.setTextContent(f[2]),u)for(const m of u.format)h.hasFormat(m)||h.toggleFormat(m);return{nodeAfter:g,nodeBefore:p,transformedNode:h}})(e,r.startIndex,r.endIndex,r.transformer,r.match);ho(s.nodeAfter)&&go(s.nodeAfter,t,n),ho(s.nodeBefore)&&go(s.nodeBefore,t,n),ho(s.transformedNode)&&go(s.transformedNode,t,n)}else if(o){const s=(function(a,l,c,u,f){let d,h,g;return l===0?[d,h]=a.splitText(c):[g,d,h]=a.splitText(l,c),u.replace?{nodeAfter:h,nodeBefore:g,transformedNode:u.replace(d,f)||void 0}:null})(e,o.startIndex,o.endIndex,o.transformer,o.match);if(!s)return;ho(s.nodeAfter)&&go(s.nodeAfter,t,n),ho(s.nodeBefore)&&go(s.nodeBefore,t,n),ho(s.transformedNode)&&go(s.transformedNode,t,n)}const i=e.getTextContent().replace(/\\([*_`~\\])/g,"$1").replace(/&#(\d+);/g,(s,a)=>String.fromCodePoint(a));e.setTextContent(i)}function cM(e,t=!1){const n=Qh(e),r=(function(o){const i={},s={},a=[],l="(?<![\\\\])";for(const c of o){const{tag:u}=c;i[u]=c;const f=u.replace(/(\*|\^|\+)/g,"\\$1");a.push(f),u.length===1?s[u]=u==="`"?new RegExp("(?<![\\\\`])(`)((?:\\\\`|[^`])+?)(`)(?!`)"):new RegExp(`(?<![\\\\${f}])(${f})((\\\\${f})?.*?[^${f}\\s](\\\\${f})?)((?<!\\\\)|(?<=\\\\\\\\))(${f})(?![\\\\${f}])`):s[u]=new RegExp(`(?<!\\\\)(${f})((\\\\${f})?.*?[^\\s](\\\\${f})?)((?<!\\\\)|(?<=\\\\\\\\))(${f})(?!\\\\)`)}return{fullMatchRegExpByTag:s,openTagsRegExp:new RegExp(`${l}(${a.join("|")})`,"g"),transformersByTag:i}})(n.textFormat);return(o,i)=>{const s=o.split(`
54
- `),a=s.length,l=i||qe();l.clear();for(let u=0;u<a;u++){const f=s[u],[d,h]=uM(s,u,n.multilineElement,l);d?u=h:dM(f,l,n.element,r,n.textMatch,t)}const c=l.getChildren();for(const u of c)!t&&uf(u)&&l.getChildrenSize()>1&&u.remove();X()!==null&&l.selectStart()}}function uM(e,t,n,r){for(const o of n){const{handleImportAfterStartMatch:i,regExpEnd:s,regExpStart:a,replace:l}=o,c=e[t].match(a);if(!c)continue;if(i){const g=i({lines:e,rootNode:r,startLineIndex:t,startMatch:c,transformer:o});if(g===null)continue;if(g)return g}const u=typeof s=="object"&&"regExp"in s?s.regExp:s,f=s&&typeof s=="object"&&"optional"in s?s.optional:!s;let d=t;const h=e.length;for(;d<h;){const g=u?e[d].match(u):null;if(!g&&(!f||f&&d<h-1)){d++;continue}if(g&&t===d&&g.index===c.index){d++;continue}const p=[];if(g&&t===d)p.push(e[t].slice(c[0].length,-g[0].length));else for(let m=t;m<=d;m++)if(m===t){const v=e[m].slice(c[0].length);p.push(v)}else if(m===d&&g){const v=e[m].slice(0,-g[0].length);p.push(v)}else p.push(e[m]);if(l(r,null,c,g,p,!0)!==!1)return[!0,d];break}}return[!1,t]}function dM(e,t,n,r,o,i){const s=Fe(e),a=ve();a.append(s),t.append(a);for(const{regExp:l,replace:c}of n){const u=e.match(l);if(u&&(s.setTextContent(e.slice(u[0].length)),c(a,[s],u,!0)!==!1))break}if(go(s,r,o),a.isAttached()&&e.length>0){const l=a.getPreviousSibling();if(!i&&(Qr(l)||lf(l)||pe(l))){let c=l;if(pe(l)){const u=l.getLastDescendant();c=u==null?null:we(u,ke)}c!=null&&c.getTextContentSize()>0&&(c.splice(c.getChildrenSize(),0,[kn(),...a.getChildren()]),a.remove())}}}function fM(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const Vw=/^(\s*)(\d{1,})\.\s/,Bw=/^(\s*)[-*+]\s/,hM=/^(\s*)(?:[-*+]\s)?\s?(\[(\s|x)?\])\s/i,df=/^(#{1,6})\s/,zw=/^>\s/,Hw=/^[ \t]*```([\w-]+)?/,ff=/[ \t]*```$/,gM=/^[ \t]*```[^`]+(?:(?:`{1,2}|`{4,})[^`]+)*```(?:[^`]|$)/,pM=/^(?:\|)(.+)(?:\|)\s?$/,mM=/^(\| ?:?-*:? ?)+\|\s?$/,Ky=/^<[a-z_][\w-]*(?:\s[^<>]*)?\/?>/i,Uy=/^<\/[a-z_][\w-]*\s*>/i,Gy=e=>new RegExp(`(?:${e.source})$`,e.flags),_s=M3("mdListMarker",{parse:e=>typeof e=="string"&&/^[-*+]$/.test(e)?e:"-"}),Ww=e=>(t,n,r,o)=>{const i=e(r);i.append(...n),t.replace(i),o||i.select(0,0)},Kw=e=>(t,n,r,o)=>{const i=t.getPreviousSibling(),s=t.getNextSibling(),a=Zt(e==="check"?r[3]==="x":void 0),l=r[0].trim()[0],c=e!=="bullet"&&e!=="check"||l!==_s.parse(l)?void 0:l;if(pe(s)&&s.getListType()===e){c&&eu(s,_s,c);const f=s.getFirstChild();f!==null?f.insertBefore(a):s.append(a),t.remove()}else if(pe(i)&&i.getListType()===e)c&&eu(i,_s,c),i.append(a),t.remove();else{const f=Ht(e,e==="number"?Number(r[2]):void 0);c&&eu(f,_s,c),f.append(a),t.replace(f)}a.append(...n),o||a.select(0,0);const u=(function(f){const d=f.match(/\t/g),h=f.match(/ /g);let g=0;return d&&(g+=d.length),h&&(g+=Math.floor(h.length/4)),g})(r[1]);u&&a.setIndent(u)},eg=(e,t,n)=>{const r=[],o=e.getChildren();let i=0;for(const s of o)if(ke(s)){if(s.getChildrenSize()===1){const f=s.getFirstChild();if(pe(f)){r.push(eg(f,t,n+1));continue}}const a=" ".repeat(4*n),l=e.getListType(),c=Db(e,_s),u=l==="number"?`${e.getStart()+i}. `:l==="check"?`${c} [${s.getChecked()?"x":" "}] `:c+" ";r.push(a+u+t(s)),i++}return r.join(`
55
- `)},yM={dependencies:[hc],export:(e,t)=>{if(!Pw(e))return null;const n=Number(e.getTag().slice(1));return"#".repeat(n)+" "+t(e)},regExp:df,replace:Ww(e=>{const t="h"+e[1].length;return wo(t)}),type:"element"},vM={dependencies:[fc],export:(e,t)=>{if(!lf(e))return null;const n=t(e).split(`
52
+ |(?![\\s\\S])))+`,"m"),alias:o,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(n)[0]}}}}),Object.defineProperty(e.languages.diff,"PREFIXES",{value:t})})(Prism);const LP=new Set(["http:","https:","mailto:","sms:","tel:"]);let fa=class oC extends Tt{__url;__target;__rel;__title;static getType(){return"link"}static clone(t){return new oC(t.__url,{rel:t.__rel,target:t.__target,title:t.__title},t.__key)}constructor(t="",n={},r){super(r);const{target:o=null,rel:i=null,title:s=null}=n;this.__url=t,this.__target=o,this.__rel=i,this.__title=s}createDOM(t){const n=document.createElement("a");return this.updateLinkDOM(null,n,t),et(n,t.theme.link),n}updateLinkDOM(t,n,r){if(sw(n)){t&&t.__url===this.__url||(n.href=this.sanitizeUrl(this.__url));for(const o of["target","rel","title"]){const i=`__${o}`,s=this[i];t&&t[i]===s||(s?n[o]=s:n.removeAttribute(o))}}}updateDOM(t,n,r){return this.updateLinkDOM(t,n,r),!1}static importDOM(){return{a:t=>({conversion:FP,priority:1})}}static importJSON(t){return Bl().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setURL(t.url).setRel(t.rel||null).setTarget(t.target||null).setTitle(t.title||null)}sanitizeUrl(t){t=av(t);try{const n=new URL(av(t));if(!LP.has(n.protocol))return"about:blank"}catch{return t}return t}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(t){const n=this.getWritable();return n.__url=t,n}getTarget(){return this.getLatest().__target}setTarget(t){const n=this.getWritable();return n.__target=t,n}getRel(){return this.getLatest().__rel}setRel(t){const n=this.getWritable();return n.__rel=t,n}getTitle(){return this.getLatest().__title}setTitle(t){const n=this.getWritable();return n.__title=t,n}insertNewAfter(t,n=!0){const r=Bl(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(r,n),r}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(t,n,r){if(!W(n))return!1;const o=n.anchor.getNode(),i=n.focus.getNode();return this.isParentOf(o)&&this.isParentOf(i)&&n.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}};function FP(e){let t=null;if(sw(e)){const n=e.textContent;(n!==null&&n!==""||e.children.length>0)&&(t=Bl(e.getAttribute("href")||"",{rel:e.getAttribute("rel"),target:e.getAttribute("target"),title:e.getAttribute("title")}))}return{node:t}}function Bl(e="",t){return Et(new fa(e,t))}function $P(e){return e instanceof fa}class ha extends fa{__isUnlinked;constructor(t="",n={},r){super(t,n,r),this.__isUnlinked=n.isUnlinked!==void 0&&n.isUnlinked!==null&&n.isUnlinked}static getType(){return"autolink"}static clone(t){return new ha(t.__url,{isUnlinked:t.__isUnlinked,rel:t.__rel,target:t.__target,title:t.__title},t.__key)}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(t){const n=this.getWritable();return n.__isUnlinked=t,n}createDOM(t){return this.__isUnlinked?document.createElement("span"):super.createDOM(t)}updateDOM(t,n,r){return super.updateDOM(t,n,r)||t.__isUnlinked!==this.__isUnlinked}static importJSON(t){return sv().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setIsUnlinked(t.isUnlinked||!1)}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(t,n=!0){const r=this.getParentOrThrow().insertNewAfter(t,n);if(B(r)){const o=sv(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return r.append(o),o}return null}}function sv(e="",t){return Et(new ha(e,t))}function OP(e){return e instanceof ha}const IP=/^\+?[0-9\s()-]{5,}$/;function av(e){return e.match(/^[a-z][a-z0-9+.-]*:/i)||e.match(/^[/#.]/)?e:e.includes("@")?`mailto:${e}`:IP.test(e)?`tel:${e}`:`https://${e}`}function pf(e,t){const n={};for(const r of e){const o=t(r);o&&(n[o]?n[o].push(r):n[o]=[r])}return n}function hg(e){const t=pf(e,n=>n.type);return{element:t.element||[],multilineElement:t["multiline-element"]||[],textFormat:t["text-format"]||[],textMatch:t["text-match"]||[]}}const zl=/[!-/:-@[-`{-~\s]/,DP=/^\s{0,3}$/;function mf(e){if(!Qr(e))return!1;const t=e.getFirstChild();return t==null||e.getChildrenSize()===1&&J(t)&&DP.test(t.getTextContent())}function jP(e,t,n,r){for(const o of t){if(!o.export)continue;const i=o.export(e,s=>Hl(s,n,r));if(i!=null)return i}return B(e)?Hl(e,n,r):Te(e)?e.getTextContent():null}function Hl(e,t,n,r,o){const i=[],s=e.getChildren();r||(r=[]),o||(o=[]);e:for(const a of s){for(const l of n){if(!l.export)continue;const c=l.export(a,u=>Hl(u,t,n,r,[...o,...r]),(u,f)=>lv(u,f,t,r,o));if(c!=null){i.push(c);continue e}}Un(a)?i.push(`
53
+ `):J(a)?i.push(lv(a,a.getTextContent(),t,r,o)):B(a)?i.push(Hl(a,t,n,r,o)):Te(a)&&i.push(a.getTextContent())}return i.join("")}function lv(e,t,n,r,o){let i=e.getFormat()===0?t:(function(d){return d.replace(/^\s+|\s+$/g,h=>[...h].map(g=>"&#"+g.codePointAt(0)+";").join(""))})(t);e.hasFormat("code")||(i=i.replace(/([*_`~\\])/g,"\\$1"));let s="",a="",l="";const c=cv(e,!0),u=cv(e,!1),f=new Set;for(const d of n){const h=d.format[0],g=d.tag;Va(e,h)&&!f.has(h)&&(f.add(h),Va(c,h)&&r.find(p=>p.tag===g)||(r.push({format:h,tag:g}),s+=g))}for(let d=0;d<r.length;d++){const h=Va(e,r[d].format),g=Va(u,r[d].format);if(h&&g)continue;const p=[...r];for(;p.length>d;){const m=p.pop();o&&m&&o.find(v=>v.tag===m.tag)||(m&&typeof m.tag=="string"&&(h?g||(l+=m.tag):a+=m.tag),r.pop())}break}return i=s+i+l,a+i}function cv(e,t){let n=t?e.getPreviousSibling():e.getNextSibling();if(!n){const r=e.getParentOrThrow();r.isInline()&&(n=t?r.getPreviousSibling():r.getNextSibling())}for(;n;){if(B(n)){if(!n.isInline())break;const r=t?n.getLastDescendant():n.getFirstDescendant();if(J(r))return r;n=t?n.getPreviousSibling():n.getNextSibling()}if(J(n))return n;if(!B(n))return null}return null}function Va(e,t){return J(e)&&e.hasFormat(t)}function VP(e,t){const n=(function(o,i){const s=o.match(i.openTagsRegExp);if(s==null)return null;for(const a of s){const l=a.replace(/^\s/,""),c=i.fullMatchRegExpByTag[l];if(c==null)continue;const u=o.match(c),f=i.transformersByTag[l];if(u!=null&&f!=null){if(f.intraword!==!1)return u;const{index:d=0}=u,h=o[d-1],g=o[d+u[0].length];if((!h||zl.test(h))&&(!g||zl.test(g)))return u}}return null})(e.getTextContent(),t);if(!n)return null;const r=n.index||0;return{endIndex:r+n[0].length,match:n,startIndex:r,transformer:t.transformersByTag[n[1]]}}function ho(e){return J(e)&&!e.hasFormat("code")}function go(e,t,n){let r=VP(e,t),o=(function(s,a){const l=s;let c,u,f,d;for(const h of a){if(!h.replace||!h.importRegExp)continue;const g=l.getTextContent().match(h.importRegExp);if(!g)continue;const p=g.index||0,m=h.getEndIndex?h.getEndIndex(l,g):p+g[0].length;m!==!1&&(c===void 0||u===void 0||p<c&&(m>u||m<=c))&&(c=p,u=m,f=h,d=g)}return c===void 0||u===void 0||f===void 0||d===void 0?null:{endIndex:u,match:d,startIndex:c,transformer:f}})(e,n);if(r&&o&&(r.startIndex<=o.startIndex&&r.endIndex>=o.endIndex||o.startIndex>r.endIndex?o=null:r=null),r){const s=(function(a,l,c,u,f){const d=a.getTextContent();let h,g,p;if(f[0]===d?h=a:l===0?[h,g]=a.splitText(c):[p,h,g]=a.splitText(l,c),h.setTextContent(f[2]),u)for(const m of u.format)h.hasFormat(m)||h.toggleFormat(m);return{nodeAfter:g,nodeBefore:p,transformedNode:h}})(e,r.startIndex,r.endIndex,r.transformer,r.match);ho(s.nodeAfter)&&go(s.nodeAfter,t,n),ho(s.nodeBefore)&&go(s.nodeBefore,t,n),ho(s.transformedNode)&&go(s.transformedNode,t,n)}else if(o){const s=(function(a,l,c,u,f){let d,h,g;return l===0?[d,h]=a.splitText(c):[g,d,h]=a.splitText(l,c),u.replace?{nodeAfter:h,nodeBefore:g,transformedNode:u.replace(d,f)||void 0}:null})(e,o.startIndex,o.endIndex,o.transformer,o.match);if(!s)return;ho(s.nodeAfter)&&go(s.nodeAfter,t,n),ho(s.nodeBefore)&&go(s.nodeBefore,t,n),ho(s.transformedNode)&&go(s.transformedNode,t,n)}const i=e.getTextContent().replace(/\\([*_`~\\])/g,"$1").replace(/&#(\d+);/g,(s,a)=>String.fromCodePoint(a));e.setTextContent(i)}function BP(e,t=!1){const n=hg(e),r=(function(o){const i={},s={},a=[],l="(?<![\\\\])";for(const c of o){const{tag:u}=c;i[u]=c;const f=u.replace(/(\*|\^|\+)/g,"\\$1");a.push(f),u.length===1?s[u]=u==="`"?new RegExp("(?<![\\\\`])(`)((?:\\\\`|[^`])+?)(`)(?!`)"):new RegExp(`(?<![\\\\${f}])(${f})((\\\\${f})?.*?[^${f}\\s](\\\\${f})?)((?<!\\\\)|(?<=\\\\\\\\))(${f})(?![\\\\${f}])`):s[u]=new RegExp(`(?<!\\\\)(${f})((\\\\${f})?.*?[^\\s](\\\\${f})?)((?<!\\\\)|(?<=\\\\\\\\))(${f})(?!\\\\)`)}return{fullMatchRegExpByTag:s,openTagsRegExp:new RegExp(`${l}(${a.join("|")})`,"g"),transformersByTag:i}})(n.textFormat);return(o,i)=>{const s=o.split(`
54
+ `),a=s.length,l=i||qe();l.clear();for(let u=0;u<a;u++){const f=s[u],[d,h]=zP(s,u,n.multilineElement,l);d?u=h:HP(f,l,n.element,r,n.textMatch,t)}const c=l.getChildren();for(const u of c)!t&&mf(u)&&l.getChildrenSize()>1&&u.remove();Z()!==null&&l.selectStart()}}function zP(e,t,n,r){for(const o of n){const{handleImportAfterStartMatch:i,regExpEnd:s,regExpStart:a,replace:l}=o,c=e[t].match(a);if(!c)continue;if(i){const g=i({lines:e,rootNode:r,startLineIndex:t,startMatch:c,transformer:o});if(g===null)continue;if(g)return g}const u=typeof s=="object"&&"regExp"in s?s.regExp:s,f=s&&typeof s=="object"&&"optional"in s?s.optional:!s;let d=t;const h=e.length;for(;d<h;){const g=u?e[d].match(u):null;if(!g&&(!f||f&&d<h-1)){d++;continue}if(g&&t===d&&g.index===c.index){d++;continue}const p=[];if(g&&t===d)p.push(e[t].slice(c[0].length,-g[0].length));else for(let m=t;m<=d;m++)if(m===t){const v=e[m].slice(c[0].length);p.push(v)}else if(m===d&&g){const v=e[m].slice(0,-g[0].length);p.push(v)}else p.push(e[m]);if(l(r,null,c,g,p,!0)!==!1)return[!0,d];break}}return[!1,t]}function HP(e,t,n,r,o,i){const s=Fe(e),a=ye();a.append(s),t.append(a);for(const{regExp:l,replace:c}of n){const u=e.match(l);if(u&&(s.setTextContent(e.slice(u[0].length)),c(a,[s],u,!0)!==!1))break}if(go(s,r,o),a.isAttached()&&e.length>0){const l=a.getPreviousSibling();if(!i&&(Qr(l)||gf(l)||pe(l))){let c=l;if(pe(l)){const u=l.getLastDescendant();c=u==null?null:we(u,ke)}c!=null&&c.getTextContentSize()>0&&(c.splice(c.getChildrenSize(),0,[kn(),...a.getChildren()]),a.remove())}}}function WP(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const iC=/^(\s*)(\d{1,})\.\s/,sC=/^(\s*)[-*+]\s/,KP=/^(\s*)(?:[-*+]\s)?\s?(\[(\s|x)?\])\s/i,yf=/^(#{1,6})\s/,aC=/^>\s/,lC=/^[ \t]*```([\w-]+)?/,vf=/[ \t]*```$/,UP=/^[ \t]*```[^`]+(?:(?:`{1,2}|`{4,})[^`]+)*```(?:[^`]|$)/,GP=/^(?:\|)(.+)(?:\|)\s?$/,qP=/^(\| ?:?-*:? ?)+\|\s?$/,uv=/^<[a-z_][\w-]*(?:\s[^<>]*)?\/?>/i,dv=/^<\/[a-z_][\w-]*\s*>/i,fv=e=>new RegExp(`(?:${e.source})$`,e.flags),_s=cN("mdListMarker",{parse:e=>typeof e=="string"&&/^[-*+]$/.test(e)?e:"-"}),cC=e=>(t,n,r,o)=>{const i=e(r);i.append(...n),t.replace(i),o||i.select(0,0)},uC=e=>(t,n,r,o)=>{const i=t.getPreviousSibling(),s=t.getNextSibling(),a=Zt(e==="check"?r[3]==="x":void 0),l=r[0].trim()[0],c=e!=="bullet"&&e!=="check"||l!==_s.parse(l)?void 0:l;if(pe(s)&&s.getListType()===e){c&&lu(s,_s,c);const f=s.getFirstChild();f!==null?f.insertBefore(a):s.append(a),t.remove()}else if(pe(i)&&i.getListType()===e)c&&lu(i,_s,c),i.append(a),t.remove();else{const f=Wt(e,e==="number"?Number(r[2]):void 0);c&&lu(f,_s,c),f.append(a),t.replace(f)}a.append(...n),o||a.select(0,0);const u=(function(f){const d=f.match(/\t/g),h=f.match(/ /g);let g=0;return d&&(g+=d.length),h&&(g+=Math.floor(h.length/4)),g})(r[1]);u&&a.setIndent(u)},gg=(e,t,n)=>{const r=[],o=e.getChildren();let i=0;for(const s of o)if(ke(s)){if(s.getChildrenSize()===1){const f=s.getFirstChild();if(pe(f)){r.push(gg(f,t,n+1));continue}}const a=" ".repeat(4*n),l=e.getListType(),c=rb(e,_s),u=l==="number"?`${e.getStart()+i}. `:l==="check"?`${c} [${s.getChecked()?"x":" "}] `:c+" ";r.push(a+u+t(s)),i++}return r.join(`
55
+ `)},YP={dependencies:[xc],export:(e,t)=>{if(!Zw(e))return null;const n=Number(e.getTag().slice(1));return"#".repeat(n)+" "+t(e)},regExp:yf,replace:cC(e=>{const t="h"+e[1].length;return Co(t)}),type:"element"},XP={dependencies:[vc],export:(e,t)=>{if(!gf(e))return null;const n=t(e).split(`
56
56
  `),r=[];for(const o of n)r.push("> "+o);return r.join(`
57
- `)},regExp:zw,replace:(e,t,n,r)=>{if(r){const i=e.getPreviousSibling();if(lf(i))return i.splice(i.getChildrenSize(),0,[kn(),...t]),void e.remove()}const o=Zh();o.append(...t),e.replace(o),r||o.select(0,0)},type:"element"},xM={dependencies:[gc],export:e=>{if(!Jh(e))return null;const t=e.getTextContent();return"```"+(e.getLanguage()||"")+(t?`
58
- `+t:"")+"\n```"},regExpEnd:{optional:!0,regExp:ff},regExpStart:Hw,replace:(e,t,n,r,o,i)=>{let s,a;if(!t&&o){if(o.length===1)r?(s=hr(),a=n[1]+o[0]):(s=hr(n[1]),a=o[0].startsWith(" ")?o[0].slice(1):o[0]);else{if(s=hr(n[1]),o[0].trim().length===0)for(;o.length>0&&!o[0].length;)o.shift();else o[0]=o[0].startsWith(" ")?o[0].slice(1):o[0];for(;o.length>0&&!o[o.length-1].length;)o.pop();a=o.join(`
59
- `)}const l=Fe(a);s.append(l),e.append(s)}else t&&Ww(l=>hr(l?l[1]:void 0))(e,t,n,i)},type:"multiline-element"},bM={dependencies:[Uo,eo],export:(e,t)=>pe(e)?eg(e,t,0):null,regExp:Bw,replace:Kw("bullet"),type:"element"},wM={dependencies:[Uo,eo],export:(e,t)=>pe(e)?eg(e,t,0):null,regExp:Vw,replace:Kw("number"),type:"element"},CM={format:["code"],tag:"`",type:"text-format"},SM={format:["highlight"],tag:"==",type:"text-format"},_M={format:["bold","italic"],tag:"***",type:"text-format"},TM={format:["bold","italic"],intraword:!1,tag:"___",type:"text-format"},EM={format:["bold"],tag:"**",type:"text-format"},RM={format:["bold"],intraword:!1,tag:"__",type:"text-format"},kM={format:["strikethrough"],tag:"~~",type:"text-format"},AM={format:["italic"],tag:"*",type:"text-format"},NM={format:["italic"],intraword:!1,tag:"_",type:"text-format"},MM={dependencies:[da],export:(e,t,n)=>{if(!rM(e)||oM(e))return null;const r=e.getTitle(),o=t(e);return r?`[${o}](${e.getURL()} "${r}")`:`[${o}](${e.getURL()})`},importRegExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(e,t)=>{const[,n,r,o]=t,i=Ol(r,{title:o}),s=n.split("[").length-1,a=n.split("]").length-1;let l=n,c="";if(s<a)return;if(s>a){const f=n.split("[");c="["+f[0],l=f.slice(1).join("[")}const u=Fe(l);return u.setFormat(e.getFormat()),i.append(u),e.replace(i),c&&i.insertBefore(Fe(c)),u},trigger:")",type:"text-match"},PM=[yM,vM,bM,wM],LM=[xM],FM=[CM,_M,TM,EM,RM,SM,AM,NM,kM],$M=[MM],ha=[...PM,...LM,...FM,...$M];function qy(e,t,n){const r=n.length;for(let o=t;o>=r;o--){const i=o-r;if(Uw(e,i,n,0,r)&&e[i+r]!==" ")return i}return-1}function Uw(e,t,n,r,o){for(let i=0;i<o;i++)if(e[t+i]!==n[r+i])return!1;return!0}function OM(e,t=ha){const n=Qh(t),r=cf(n.textFormat,({tag:s})=>s[s.length-1]),o=cf(n.textMatch,({trigger:s})=>s);for(const s of t){const a=s.type;if(a==="element"||a==="text-match"||a==="multiline-element"){const l=s.dependencies;for(const c of l)e.hasNode(c)||fM(173,c.getType())}}const i=(s,a,l)=>{(function(c,u,f,d){const h=c.getParent();if(!vt(h)||c.getFirstChild()!==u)return!1;const g=u.getTextContent();if(g[f-1]!==" ")return!1;for(const{regExp:p,replace:m}of d){const v=g.match(p);if(v&&v[0].length===(v[0].endsWith(" ")?f:f-1)){const y=u.getNextSiblings(),[x,b]=u.splitText(f);if(m(c,b?[b,...y]:y,v,!1)!==!1)return x.remove(),!0}}return!1})(s,a,l,n.element)||(function(c,u,f,d){const h=c.getParent();if(!vt(h)||c.getFirstChild()!==u)return!1;const g=u.getTextContent();if(g[f-1]!==" ")return!1;for(const{regExpStart:p,replace:m,regExpEnd:v}of d){if(v&&!("optional"in v)||v&&"optional"in v&&!v.optional)continue;const y=g.match(p);if(y&&y[0].length===(y[0].endsWith(" ")?f:f-1)){const x=u.getNextSiblings(),[b,w]=u.splitText(f);if(m(c,w?[w,...x]:x,y,null,null,!1)!==!1)return b.remove(),!0}}return!1})(s,a,l,n.multilineElement)||(function(c,u,f){let d=c.getTextContent();const h=f[d[u-1]];if(h==null)return!1;u<d.length&&(d=d.slice(0,u));for(const g of h){if(!g.replace||!g.regExp)continue;const p=d.match(g.regExp);if(p===null)continue;const m=p.index||0,v=m+p[0].length;let y;return m===0?[y]=c.splitText(v):[,y]=c.splitText(m,v),y.selectNext(0,0),g.replace(y,p),!0}return!1})(a,l,o)||(function(c,u,f){const d=c.getTextContent(),h=u-1,g=d[h],p=f[g];if(!p)return!1;for(const m of p){const{tag:v}=m,y=v.length,x=h-y+1;if(y>1&&!Uw(d,x,v,0,y)||d[x-1]===" ")continue;const b=d[h+1];if(m.intraword===!1&&b&&!Il.test(b))continue;const w=c;let _=w,E=qy(d,x,v),R=_;for(;E<0&&(R=R.getPreviousSibling())&&!Kn(R);)if(J(R)){if(R.hasFormat("code"))continue;const O=R.getTextContent();_=R,E=qy(O,O.length,v)}if(E<0||_===w&&E+y===x)continue;const k=_.getTextContent();if(E>0&&k[E-1]===g)continue;const M=k[E-1];if(m.intraword===!1&&M&&!Il.test(M))continue;const F=w.getTextContent(),D=F.slice(0,x)+F.slice(h+1);w.setTextContent(D);const j=_===w?D:k;_.setTextContent(j.slice(0,E)+j.slice(E+y));const I=X(),$=ic();Ge($);const H=h-y*(_===w?2:1)+1;$.anchor.set(_.__key,E,"text"),$.focus.set(w.__key,H,"text");for(const O of m.format)$.hasFormat(O)||$.formatText(O);$.anchor.set($.focus.key,$.focus.offset,$.focus.type);for(const O of m.format)$.hasFormat(O)&&$.toggleFormat(O);return W(I)&&($.format=I.format),!0}})(a,l,r)};return e.registerUpdateListener(({tags:s,dirtyLeaves:a,editorState:l,prevEditorState:c})=>{if(s.has(h1)||s.has(Z3)||e.isComposing())return;const u=l.read(X),f=c.read(X);if(!W(f)||!W(u)||!u.isCollapsed()||u.is(f))return;const d=u.anchor.key,h=u.anchor.offset,g=l._nodeMap.get(d);!J(g)||!a.has(d)||h!==1&&h>f.anchor.offset+1||e.update(()=>{if(!ho(g))return;const p=g.getParent();p===null||Jh(p)||i(p,g,u.anchor.offset)})})}function Gw(e,t=ha,n,r=!1,o=!1){const i=r?e:(function(s,a=!1){const l=s.split(`
60
- `);let c=!1;const u=[];for(let f=0;f<l.length;f++){const d=l[f].trimEnd(),h=u[u.length-1];gM.test(d)?u.push(d):Hw.test(d)||ff.test(d)?(c=!c,u.push(d)):c||d===""||h===""||!h||df.test(h)||df.test(d)||zw.test(d)||Vw.test(d)||Bw.test(d)||hM.test(d)||pM.test(d)||mM.test(d)||!a||Ky.test(d)||Uy.test(d)||Gy(Uy).test(h)||Gy(Ky).test(h)||ff.test(h)?u.push(d):u[u.length-1]=h+" "+d.trimStart()}return u.join(`
61
- `)})(e,o);return cM(t,r)(i,n)}function IM(e=ha,t,n=!1){return(function(o,i=!1){const s=Qh(o),a=[...s.multilineElement,...s.element],l=!i,c=s.textFormat.filter(u=>u.format.length===1).sort((u,f)=>Number(u.format.includes("code"))-Number(f.format.includes("code")));return u=>{const f=[],d=(u||qe()).getChildren();for(let h=0;h<d.length;h++){const g=d[h],p=aM(g,a,c,s.textMatch);p!=null&&f.push(l&&h>0&&!uf(g)&&!uf(d[h-1])?`
57
+ `)},regExp:aC,replace:(e,t,n,r)=>{if(r){const i=e.getPreviousSibling();if(gf(i))return i.splice(i.getChildrenSize(),0,[kn(),...t]),void e.remove()}const o=dg();o.append(...t),e.replace(o),r||o.select(0,0)},type:"element"},ZP={dependencies:[bc],export:e=>{if(!fg(e))return null;const t=e.getTextContent();return"```"+(e.getLanguage()||"")+(t?`
58
+ `+t:"")+"\n```"},regExpEnd:{optional:!0,regExp:vf},regExpStart:lC,replace:(e,t,n,r,o,i)=>{let s,a;if(!t&&o){if(o.length===1)r?(s=gr(),a=n[1]+o[0]):(s=gr(n[1]),a=o[0].startsWith(" ")?o[0].slice(1):o[0]);else{if(s=gr(n[1]),o[0].trim().length===0)for(;o.length>0&&!o[0].length;)o.shift();else o[0]=o[0].startsWith(" ")?o[0].slice(1):o[0];for(;o.length>0&&!o[o.length-1].length;)o.pop();a=o.join(`
59
+ `)}const l=Fe(a);s.append(l),e.append(s)}else t&&cC(l=>gr(l?l[1]:void 0))(e,t,n,i)},type:"multiline-element"},JP={dependencies:[Uo,eo],export:(e,t)=>pe(e)?gg(e,t,0):null,regExp:sC,replace:uC("bullet"),type:"element"},QP={dependencies:[Uo,eo],export:(e,t)=>pe(e)?gg(e,t,0):null,regExp:iC,replace:uC("number"),type:"element"},e6={format:["code"],tag:"`",type:"text-format"},t6={format:["highlight"],tag:"==",type:"text-format"},n6={format:["bold","italic"],tag:"***",type:"text-format"},r6={format:["bold","italic"],intraword:!1,tag:"___",type:"text-format"},o6={format:["bold"],tag:"**",type:"text-format"},i6={format:["bold"],intraword:!1,tag:"__",type:"text-format"},s6={format:["strikethrough"],tag:"~~",type:"text-format"},a6={format:["italic"],tag:"*",type:"text-format"},l6={format:["italic"],intraword:!1,tag:"_",type:"text-format"},c6={dependencies:[fa],export:(e,t,n)=>{if(!$P(e)||OP(e))return null;const r=e.getTitle(),o=t(e);return r?`[${o}](${e.getURL()} "${r}")`:`[${o}](${e.getURL()})`},importRegExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(e,t)=>{const[,n,r,o]=t,i=Bl(r,{title:o}),s=n.split("[").length-1,a=n.split("]").length-1;let l=n,c="";if(s<a)return;if(s>a){const f=n.split("[");c="["+f[0],l=f.slice(1).join("[")}const u=Fe(l);return u.setFormat(e.getFormat()),i.append(u),e.replace(i),c&&i.insertBefore(Fe(c)),u},trigger:")",type:"text-match"},u6=[YP,XP,JP,QP],d6=[ZP],f6=[e6,n6,r6,o6,i6,t6,a6,l6,s6],h6=[c6],ga=[...u6,...d6,...f6,...h6];function hv(e,t,n){const r=n.length;for(let o=t;o>=r;o--){const i=o-r;if(dC(e,i,n,0,r)&&e[i+r]!==" ")return i}return-1}function dC(e,t,n,r,o){for(let i=0;i<o;i++)if(e[t+i]!==n[r+i])return!1;return!0}function g6(e,t=ga){const n=hg(t),r=pf(n.textFormat,({tag:s})=>s[s.length-1]),o=pf(n.textMatch,({trigger:s})=>s);for(const s of t){const a=s.type;if(a==="element"||a==="text-match"||a==="multiline-element"){const l=s.dependencies;for(const c of l)e.hasNode(c)||WP(173,c.getType())}}const i=(s,a,l)=>{(function(c,u,f,d){const h=c.getParent();if(!vt(h)||c.getFirstChild()!==u)return!1;const g=u.getTextContent();if(g[f-1]!==" ")return!1;for(const{regExp:p,replace:m}of d){const v=g.match(p);if(v&&v[0].length===(v[0].endsWith(" ")?f:f-1)){const y=u.getNextSiblings(),[x,b]=u.splitText(f);if(m(c,b?[b,...y]:y,v,!1)!==!1)return x.remove(),!0}}return!1})(s,a,l,n.element)||(function(c,u,f,d){const h=c.getParent();if(!vt(h)||c.getFirstChild()!==u)return!1;const g=u.getTextContent();if(g[f-1]!==" ")return!1;for(const{regExpStart:p,replace:m,regExpEnd:v}of d){if(v&&!("optional"in v)||v&&"optional"in v&&!v.optional)continue;const y=g.match(p);if(y&&y[0].length===(y[0].endsWith(" ")?f:f-1)){const x=u.getNextSiblings(),[b,w]=u.splitText(f);if(m(c,w?[w,...x]:x,y,null,null,!1)!==!1)return b.remove(),!0}}return!1})(s,a,l,n.multilineElement)||(function(c,u,f){let d=c.getTextContent();const h=f[d[u-1]];if(h==null)return!1;u<d.length&&(d=d.slice(0,u));for(const g of h){if(!g.replace||!g.regExp)continue;const p=d.match(g.regExp);if(p===null)continue;const m=p.index||0,v=m+p[0].length;let y;return m===0?[y]=c.splitText(v):[,y]=c.splitText(m,v),y.selectNext(0,0),g.replace(y,p),!0}return!1})(a,l,o)||(function(c,u,f){const d=c.getTextContent(),h=u-1,g=d[h],p=f[g];if(!p)return!1;for(const m of p){const{tag:v}=m,y=v.length,x=h-y+1;if(y>1&&!dC(d,x,v,0,y)||d[x-1]===" ")continue;const b=d[h+1];if(m.intraword===!1&&b&&!zl.test(b))continue;const w=c;let _=w,E=hv(d,x,v),R=_;for(;E<0&&(R=R.getPreviousSibling())&&!Un(R);)if(J(R)){if(R.hasFormat("code"))continue;const I=R.getTextContent();_=R,E=hv(I,I.length,v)}if(E<0||_===w&&E+y===x)continue;const k=_.getTextContent();if(E>0&&k[E-1]===g)continue;const P=k[E-1];if(m.intraword===!1&&P&&!zl.test(P))continue;const F=w.getTextContent(),$=F.slice(0,x)+F.slice(h+1);w.setTextContent($);const j=_===w?$:k;_.setTextContent(j.slice(0,E)+j.slice(E+y));const O=Z(),D=dc();Ge(D);const K=h-y*(_===w?2:1)+1;D.anchor.set(_.__key,E,"text"),D.focus.set(w.__key,K,"text");for(const I of m.format)D.hasFormat(I)||D.formatText(I);D.anchor.set(D.focus.key,D.focus.offset,D.focus.type);for(const I of m.format)D.hasFormat(I)&&D.toggleFormat(I);return W(O)&&(D.format=O.format),!0}})(a,l,r)};return e.registerUpdateListener(({tags:s,dirtyLeaves:a,editorState:l,prevEditorState:c})=>{if(s.has(Pb)||s.has(AN)||e.isComposing())return;const u=l.read(Z),f=c.read(Z);if(!W(f)||!W(u)||!u.isCollapsed()||u.is(f))return;const d=u.anchor.key,h=u.anchor.offset,g=l._nodeMap.get(d);!J(g)||!a.has(d)||h!==1&&h>f.anchor.offset+1||e.update(()=>{if(!ho(g))return;const p=g.getParent();p===null||fg(p)||i(p,g,u.anchor.offset)})})}function fC(e,t=ga,n,r=!1,o=!1){const i=r?e:(function(s,a=!1){const l=s.split(`
60
+ `);let c=!1;const u=[];for(let f=0;f<l.length;f++){const d=l[f].trimEnd(),h=u[u.length-1];UP.test(d)?u.push(d):lC.test(d)||vf.test(d)?(c=!c,u.push(d)):c||d===""||h===""||!h||yf.test(h)||yf.test(d)||aC.test(d)||iC.test(d)||sC.test(d)||KP.test(d)||GP.test(d)||qP.test(d)||!a||uv.test(d)||dv.test(d)||fv(dv).test(h)||fv(uv).test(h)||vf.test(h)?u.push(d):u[u.length-1]=h+" "+d.trimStart()}return u.join(`
61
+ `)})(e,o);return BP(t,r)(i,n)}function p6(e=ga,t,n=!1){return(function(o,i=!1){const s=hg(o),a=[...s.multilineElement,...s.element],l=!i,c=s.textFormat.filter(u=>u.format.length===1).sort((u,f)=>Number(u.format.includes("code"))-Number(f.format.includes("code")));return u=>{const f=[],d=(u||qe()).getChildren();for(let h=0;h<d.length;h++){const g=d[h],p=jP(g,a,c,s.textMatch);p!=null&&f.push(l&&h>0&&!mf(g)&&!mf(d[h-1])?`
62
62
  `.concat(p):p)}return f.join(`
63
- `)}})(e,n)(t)}function DM({defaultSelection:e}){const[t]=lt();return S.useEffect(()=>{t.focus(()=>{const n=document.activeElement,r=t.getRootElement();r===null||n!==null&&r.contains(n)||r.focus({preventScroll:!0})},{defaultSelection:e})},[e,t]),null}const qw=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,jM=qw?S.useLayoutEffect:S.useEffect,ja={tag:Ei};function Yw({initialConfig:e,children:t}){const n=S.useMemo(()=>{const{theme:r,namespace:o,nodes:i,onError:s,editorState:a,html:l}=e,c=c3(null,r),u=E1({editable:e.editable,html:l,namespace:o,nodes:i,onError:f=>s(f,u),theme:r});return(function(f,d){if(d!==null){if(d===void 0)f.update(()=>{const h=qe();if(h.isEmpty()){const g=ve();h.append(g);const p=qw?document.activeElement:null;(X()!==null||p!==null&&p===f.getRootElement())&&g.select()}},ja);else if(d!==null)switch(typeof d){case"string":{const h=f.parseEditorState(d);f.setEditorState(h,ja);break}case"object":f.setEditorState(d,ja);break;case"function":f.update(()=>{qe().isEmpty()&&d(f)},ja)}}})(u,a),[u,c]},[]);return jM(()=>{const r=e.editable,[o]=n;o.setEditable(r===void 0||r)},[]),C.jsx(Ab.Provider,{value:n,children:t})}function VM(){return qe().getTextContent()}function BM(e,t=!0){if(e)return!1;let n=VM();return t&&(n=n.trim()),n===""}function zM(e){if(!BM(e,!1))return!1;const t=qe().getChildren(),n=t.length;if(n>1)return!1;for(let r=0;r<n;r++){const o=t[r];if(Te(o))return!1;if(B(o)){if(!Qr(o)||o.__indent!==0)return!1;const i=o.getChildren(),s=i.length;for(let a=0;a<s;a++){const l=i[r];if(!J(l))return!1}}}return!0}function Xw(e){return()=>zM(e)}function HM(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function WM(e,t,n,r){const o=s=>s instanceof n,i=s=>{const a=Fe(s.getTextContent());a.setFormat(s.getFormat()),s.replace(a)};return[e.registerNodeTransform(fn,s=>{if(!s.isSimpleText())return;let a,l=s.getPreviousSibling(),c=s.getTextContent(),u=s;if(J(l)){const d=l.getTextContent(),h=t(d+c);if(o(l)){if(h===null||(g=>g.getLatest().__mode)(l)!==0)return void i(l);{const g=h.end-d.length;if(g>0){const p=d+c.slice(0,g);if(l.select(),l.setTextContent(p),g===c.length)s.remove();else{const m=c.slice(g);s.setTextContent(m)}return}}}else if(h===null||h.start<d.length)return}let f=0;for(;;){a=t(c);let d,h=a===null?"":c.slice(a.end);if(c=h,h===""){const p=u.getNextSibling();if(J(p)){h=u.getTextContent()+p.getTextContent();const m=t(h);if(m===null)return void(o(p)?i(p):p.markDirty());if(m.start!==0)return}}if(a===null)return;if(a.start===0&&J(l)&&l.isTextEntity()){f+=a.end;continue}a.start===0?[d,u]=u.splitText(a.end):[,d,u]=u.splitText(a.start+f,a.end+f),d===void 0&&HM(165,"nodeToReplace");const g=r(d);if(g.setFormat(d.getFormat()),d.replace(g),u==null)return;f=0,l=g}}),e.registerNodeTransform(n,s=>{const a=s.getTextContent(),l=t(a);if(l===null||l.start!==0)return void i(s);if(a.length>l.end)return void s.splitText(l.end);const c=s.getPreviousSibling();J(c)&&c.isTextEntity()&&(i(c),i(s));const u=s.getNextSibling();J(u)&&u.isTextEntity()&&(i(u),o(s)&&i(s))})]}let pc=class Zw extends fn{static getType(){return"hashtag"}static clone(t){return new Zw(t.__text,t.__key)}createDOM(t){const n=super.createDOM(t);return et(n,t.theme.hashtag),n}static importJSON(t){return Jw().updateFromJSON(t)}canInsertTextBefore(){return!1}isTextEntity(){return!0}};function Jw(e=""){return Et(new pc(e))}const KM=new RegExp((function(){const{alpha:e,alphanumeric:t,hashChars:n}=(function(){const o=String.fromCharCode,i="A-Za-zªµºÀ-ÖØ-öø-Ɂɐ-ˁˆ-ˑˠ-ˤˮͺΆΈ-ΊΌΎ-ΡΣ-ώϐ-ϵϷ-ҁҊ-ӎӐ-ӹԀ-ԏԱ-Ֆՙա-ևא-תװ-ײء-غـ-يٮ-ٯٱ-ۓەۥ-ۦۮ-ۯۺ-ۼۿܐܒ-ܯݍ-ݭހ-ޥޱऄ-हऽॐक़-ॡॽঅ-ঌএ-ঐও-নপ-রলশ-হঽৎড়-ঢ়য়-ৡৰ-ৱਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલ-ળવ-હઽૐૠ-ૡଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହଽଡ଼-ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-ஹఅ-ఌఎ-ఐఒ-నప-ళవ-హౠ-ౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠ-ೡഅ-ഌഎ-ഐഒ-നപ-ഹൠ-ൡඅ-ඖක-නඳ-රලව-ෆก-ะา-ำเ-ๆກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-ະາ-ຳຽເ-ໄໆໜ-ໝༀཀ-ཇཉ-ཪྈ-ྋက-အဣ-ဧဩ-ဪၐ-ၕႠ-Ⴥა-ჺჼᄀ-ᅙᅟ-ᆢᆨ-ᇹሀ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙶᚁ-ᚚᚠ-ᛪᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦩᧁ-ᧇᨀ-ᨖᴀ-ᶿḀ-ẛẠ-ỹἀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₔℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℱℳ-ℹℼ-ℿⅅ-ⅉⰀ-Ⱞⰰ-ⱞⲀ-ⳤⴀ-ⴥⴰ-ⵥⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〆〱-〵〻-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄬㄱ-ㆎㆠ-ㆷㇰ-ㇿ㐀-䶵一-龻ꀀ-ꒌꠀ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢ가-힣豈-鶴侮-頻並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵÀ-ÖØ-öø-ÿĀ-ɏɓ-ɔɖ-ɗəɛɣɨɯɲʉʋʻ̀-ͯḀ-ỿЀ-ӿԀ-ԧⷠ-ⷿꙀ-֑ꚟ-ֿׁ-ׂׄ-ׇׅא-תװ-״﬒-ﬨשׁ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﭏؐ-ؚؠ-ٟٮ-ۓە-ۜ۞-۪ۨ-ۯۺ-ۼۿݐ-ݿࢠࢢ-ࢬࣤ-ࣾﭐ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼ‌-‌ก-ฺเ-๎ᄀ-ᇿ㄰-ㆅꥠ-꥿가-힯ힰ-퟿ᄀ-ᅵァ-ヺー-ヾヲ-゚0-9A-Za-zぁ-ゖ゙-ゞ㐀-䶿一-鿿"+o(173824)+"-"+o(177983)+o(177984)+"-"+o(178207)+o(194560)+"-"+o(195103)+"〃々〻";return{alpha:i,alphanumeric:i+"̀-ͯ҃-֑҆-ֹֻ-ֽֿׁ-ׂׄ-ׇׅؐ-ًؕ-ٰٞۖ-ۜ۟-ۤۧ-۪ۨ-ܑۭܰ-݊ަ-ްँ-ः़ा-्॑-॔ॢ-ॣঁ-ঃ়া-ৄে-ৈো-্ৗৢ-ৣਁ-ਃ਼ਾ-ੂੇ-ੈੋ-੍ੰ-ੱઁ-ઃ઼ા-ૅે-ૉો-્ૢ-ૣଁ-ଃ଼ା-ୃେ-ୈୋ-୍ୖ-ୗஂா-ூெ-ைொ-்ௗఁ-ఃా-ౄె-ైొ-్ౕ-ౖಂ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕ-ೖം-ഃാ-ൃെ-ൈൊ-്ൗං-ඃ්ා-ුූෘ-ෟෲ-ෳัิ-ฺ็-๎ັິ-ູົ-ຼ່-ໍ༘-༹༙༵༷༾-༿ཱ-྄྆-྇ྐ-ྗྙ-ྼ࿆ာ-ဲံ-္ၖ-ၙ፟ᜒ-᜔ᜲ-᜴ᝒ-ᝓᝲ-ᝳា-៓៝᠋-᠍ᢩᤠ-ᤫᤰ-᤻ᦰ-ᧀᧈ-ᧉᨗ-ᨛ᷀-᷃⃐-⃥⃜⃡-⃫〪-゙〯-゚ꠂ꠆ꠋꠣ-ꠧﬞ︀-️︠-︣0-9٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௦-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩၀-၉០-៩᠐-᠙᥆-᥏᧐-᧙0-9_",hashChars:"#\\uFF03"}})(),r="["+t+"]";return"("+("^|$|[^&/"+t+"]")+")("+("["+n+"]")+")("+r+"*"+("["+e+"]")+r+"*)"})(),"i"),UM={getHashtagMatch:function(e){const t=KM.exec(e);if(t===null)return null;const n=t[3].length+1,r=t.index+t[1].length;return{end:r+n,start:r}}};function GM(e,t=UM){return Nn(...WM(e,t.getHashtagMatch,pc,n=>Jw(n.getTextContent())))}function qM(){const[e]=lt();return S.useEffect(()=>{if(!e.hasNodes([pc]))throw new Error("HashtagPlugin: HashtagNode not registered on editor");return GM(e)},[e]),null}function YM({hasStrictIndent:e=!1}){const[t]=lt();return S.useEffect(()=>{if(!t.hasNodes([Uo,eo]))throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[t]),S.useEffect(()=>{if(e)return RN(t)},[t,e]),(function(n){S.useEffect(()=>EN(n),[n])})(t),null}function Yy(e,t){return e.getEditorState().read(()=>{const n=Pe(t);return n!==null&&n.isSelected()})}function XM(e){const[t]=lt(),[n,r]=S.useState(()=>Yy(t,e));return S.useEffect(()=>{let o=!0;const i=t.registerUpdateListener(()=>{o&&r(Yy(t,e))});return()=>{o=!1,i()}},[t,e]),[n,S.useCallback(o=>{t.update(()=>{let i=X();Ct(i)||(i=Eh(),Ge(i)),Ct(i)&&(o?i.add(e):i.delete(e))})},[t,e]),S.useCallback(()=>{t.update(()=>{const o=X();Ct(o)&&o.clear()})},[t])]}function ZM({nodeKey:e}){const[t]=lt(),[n,r,o]=XM(e);return S.useEffect(()=>Nn(t.registerCommand(Ql,i=>{const s=t.getElementByKey(e);return i.target===s&&(i.shiftKey||o(),r(!n),!0)},ur)),[o,t,n,e,r]),S.useEffect(()=>{const i=t.getElementByKey(e),s=t._config.theme.hrSelected??"selected";i!==null&&(n?et(i,s):Yn(i,s))},[t,n,e]),null}let Qw=class eC extends Yh{static getType(){return"horizontalrule"}static clone(t){return new eC(t.__key)}static importJSON(t){return tg().updateFromJSON(t)}static importDOM(){return{hr:()=>({conversion:JM,priority:0})}}decorate(){return C.jsx(ZM,{nodeKey:this.__key})}};function JM(){return{node:tg()}}function tg(){return Et(new Qw)}const QM=[{dependencies:[Qw],export:e=>mN(e)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(e,t,n,r)=>{const o=tg();r||e.getNextSibling()!=null?e.replace(o):e.insertBefore(o),o.selectNext()},type:"element"},...ha];function eP({transformers:e=QM}){const[t]=lt();return S.useEffect(()=>OM(t,e),[t,e]),null}const tP=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?S.useLayoutEffect:S.useEffect;function nP({ignoreHistoryMergeTagChange:e=!0,ignoreSelectionChange:t=!1,onChange:n}){const[r]=lt();return tP(()=>{if(n)return r.registerUpdateListener(({editorState:o,dirtyElements:i,dirtyLeaves:s,prevEditorState:a,tags:l})=>{t&&i.size===0&&s.size===0||e&&l.has(Ei)||a.isEmpty()||n(o,r,l)})},[r,e,t,n]),null}const ng=/^(\d+(?:\.\d+)?)px$/,st={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class Mn extends Tt{__colSpan;__rowSpan;__headerState;__width;__backgroundColor;__verticalAlign;static getType(){return"tablecell"}static clone(t){return new Mn(t.__headerState,t.__colSpan,t.__width,t.__key)}afterCloneFrom(t){super.afterCloneFrom(t),this.__rowSpan=t.__rowSpan,this.__backgroundColor=t.__backgroundColor,this.__verticalAlign=t.__verticalAlign}static importDOM(){return{td:t=>({conversion:Xy,priority:0}),th:t=>({conversion:Xy,priority:0})}}static importJSON(t){return un().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setHeaderStyles(t.headerState).setColSpan(t.colSpan||1).setRowSpan(t.rowSpan||1).setWidth(t.width||void 0).setBackgroundColor(t.backgroundColor||null).setVerticalAlign(t.verticalAlign||void 0)}constructor(t=st.NO_STATUS,n=1,r,o){super(o),this.__colSpan=n,this.__rowSpan=1,this.__headerState=t,this.__width=r,this.__backgroundColor=null,this.__verticalAlign=void 0}createDOM(t){const n=document.createElement(this.getTag());return this.__width&&(n.style.width=`${this.__width}px`),this.__colSpan>1&&(n.colSpan=this.__colSpan),this.__rowSpan>1&&(n.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(n.style.backgroundColor=this.__backgroundColor),hf(this.__verticalAlign)&&(n.style.verticalAlign=this.__verticalAlign),et(n,t.theme.tableCell,this.hasHeader()&&t.theme.tableCellHeader),n}exportDOM(t){const n=super.exportDOM(t);if(Be(n.element)){const r=n.element;r.setAttribute("data-temporary-table-cell-lexical-key",this.getKey()),r.style.border="1px solid black",this.__colSpan>1&&(r.colSpan=this.__colSpan),this.__rowSpan>1&&(r.rowSpan=this.__rowSpan),r.style.width=`${this.getWidth()||75}px`,r.style.verticalAlign=this.getVerticalAlign()||"top",r.style.textAlign="start",this.__backgroundColor===null&&this.hasHeader()&&(r.style.backgroundColor="#f2f3f5")}return n}exportJSON(){return{...super.exportJSON(),...hf(this.__verticalAlign)&&{verticalAlign:this.__verticalAlign},backgroundColor:this.getBackgroundColor(),colSpan:this.__colSpan,headerState:this.__headerState,rowSpan:this.__rowSpan,width:this.getWidth()}}getColSpan(){return this.getLatest().__colSpan}setColSpan(t){const n=this.getWritable();return n.__colSpan=t,n}getRowSpan(){return this.getLatest().__rowSpan}setRowSpan(t){const n=this.getWritable();return n.__rowSpan=t,n}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(t,n=st.BOTH){const r=this.getWritable();return r.__headerState=t&n|r.__headerState&~n,r}getHeaderStyles(){return this.getLatest().__headerState}setWidth(t){const n=this.getWritable();return n.__width=t,n}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(t){const n=this.getWritable();return n.__backgroundColor=t,n}getVerticalAlign(){return this.getLatest().__verticalAlign}setVerticalAlign(t){const n=this.getWritable();return n.__verticalAlign=t||void 0,n}toggleHeaderStyle(t){const n=this.getWritable();return(n.__headerState&t)===t?n.__headerState-=t:n.__headerState+=t,n}hasHeaderState(t){return(this.getHeaderStyles()&t)===t}hasHeader(){return this.getLatest().__headerState!==st.NO_STATUS}updateDOM(t){return t.__headerState!==this.__headerState||t.__width!==this.__width||t.__colSpan!==this.__colSpan||t.__rowSpan!==this.__rowSpan||t.__backgroundColor!==this.__backgroundColor||t.__verticalAlign!==this.__verticalAlign}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function hf(e){return e==="middle"||e==="bottom"}function Xy(e){const t=e,n=e.nodeName.toLowerCase();let r;ng.test(t.style.width)&&(r=parseFloat(t.style.width));const o=un(n==="th"?st.ROW:st.NO_STATUS,t.colSpan,r);o.__rowSpan=t.rowSpan;const i=t.style.backgroundColor;i!==""&&(o.__backgroundColor=i);const s=t.style.verticalAlign;hf(s)&&(o.__verticalAlign=s);const a=t.style,l=(a&&a.textDecoration||"").split(" "),c=a.fontWeight==="700"||a.fontWeight==="bold",u=l.includes("line-through"),f=a.fontStyle==="italic",d=l.includes("underline");return{after:h=>{const g=[];let p=null;const m=()=>{if(p){const v=p.getFirstChild();Kn(v)&&p.getChildrenSize()===1&&v.remove()}};for(const v of h)TA(v)||J(v)||Kn(v)?(J(v)&&(c&&v.toggleFormat("bold"),u&&v.toggleFormat("strikethrough"),f&&v.toggleFormat("italic"),d&&v.toggleFormat("underline")),p?p.append(v):(p=ve().append(v),g.push(p))):(g.push(v),m(),p=null);return m(),g.length===0&&g.push(ve()),g},node:o}}function un(e=st.NO_STATUS,t=1,n){return Et(new Mn(e,t,n))}function ge(e){return e instanceof Mn}const tC=ce("INSERT_TABLE_COMMAND");function fe(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}class Ur extends Tt{__height;static getType(){return"tablerow"}static clone(t){return new Ur(t.__height,t.__key)}static importDOM(){return{tr:t=>({conversion:rP,priority:0})}}static importJSON(t){return Di().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setHeight(t.height)}constructor(t,n){super(n),this.__height=t}exportJSON(){const t=this.getHeight();return{...super.exportJSON(),...t===void 0?void 0:{height:t}}}createDOM(t){const n=document.createElement("tr");return this.__height&&(n.style.height=`${this.__height}px`),et(n,t.theme.tableRow),n}extractWithChild(t,n,r){return r==="html"}isShadowRoot(){return!0}setHeight(t){const n=this.getWritable();return n.__height=t,n}getHeight(){return this.getLatest().__height}updateDOM(t){return t.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function rP(e){const t=e;let n;return ng.test(t.style.height)&&(n=parseFloat(t.style.height)),{after:r=>aw(r,ge),node:Di(n)}}function Di(e){return Et(new Ur(e))}function tt(e){return e instanceof Ur}const rg=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,oP=rg&&"documentMode"in document?document.documentMode:null,Zy=rg&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);function iP(e,t,n=!0){const r=yc();for(let o=0;o<e;o++){const i=Di();for(let s=0;s<t;s++){let a=st.NO_STATUS;typeof n=="object"?(o===0&&n.rows&&(a|=st.ROW),s===0&&n.columns&&(a|=st.COLUMN)):n&&(o===0&&(a|=st.ROW),s===0&&(a|=st.COLUMN));const l=un(a),c=ve();c.append(Fe()),l.append(c),i.append(l)}r.append(i)}return r}function sP(e){const t=we(e,n=>Ze(n));if(Ze(t))return t;throw new Error("Expected table cell to be inside of table.")}rg&&"InputEvent"in window&&!oP&&new window.InputEvent("input");const gf=(e,t)=>e===st.BOTH||e===t?t:st.NO_STATUS;function aP(e,t=!0){const[,,n]=zn(e),[r,o]=an(n,e,e),i=r[0].length,{startRow:s}=o;let a=null;if(t){const l=s+e.__rowSpan-1,c=r[l],u=Di();for(let d=0;d<i;d++){const{cell:h,startRow:g}=c[d];if(g+h.__rowSpan-1<=l){const p=c[d].cell.__headerState,m=gf(p,st.COLUMN);u.append(un(m).append(ve()))}else h.setRowSpan(h.__rowSpan+1)}const f=n.getChildAtIndex(l);tt(f)||fe(256),f.insertAfter(u),a=u}else{const l=s,c=r[l],u=Di();for(let d=0;d<i;d++){const{cell:h,startRow:g}=c[d];if(g===l){const p=c[d].cell.__headerState,m=gf(p,st.COLUMN);u.append(un(m).append(ve()))}else h.setRowSpan(h.__rowSpan+1)}const f=n.getChildAtIndex(l);tt(f)||fe(257),f.insertBefore(u),a=u}return a}function lP(e,t=!0,n=!0){const[,,r]=zn(e),[o,i]=an(r,e,e),s=o.length,{startColumn:a}=i,l=t?a+e.__colSpan-1:a-1,c=r.getFirstChild();tt(c)||fe(120);let u=null;function f(g=st.NO_STATUS){const p=un(g).append(ve());return u===null&&(u=p),p}let d=c;e:for(let g=0;g<s;g++){if(g!==0){const w=d.getNextSibling();tt(w)||fe(121),d=w}const p=o[g],m=p[l<0?0:l].cell.__headerState,v=gf(m,st.ROW);if(l<0){nC(d,f(v));continue}const{cell:y,startColumn:x,startRow:b}=p[l];if(x+y.__colSpan-1<=l){let w=y,_=b,E=l;for(;_!==g&&w.__rowSpan>1;){if(E-=y.__colSpan,!(E>=0)){d.append(f(v));continue e}{const{cell:R,startRow:k}=p[E];w=R,_=k}}w.insertAfter(f(v))}else y.setColSpan(y.__colSpan+1)}u!==null&&n&&cP(u);const h=r.getColWidths();if(h){const g=[...h],p=l<0?0:l,m=g[p];g.splice(p,0,m),r.setColWidths(g)}return u}function cP(e){const t=e.getFirstDescendant();t==null?e.selectStart():t.getParentOrThrow().selectStart()}function nC(e,t){const n=e.getFirstChild();n!==null?n.insertBefore(t):e.append(t)}function uP(e){if(e.length===0)return null;const t=sP(e[0]),[n]=Fr(t,null,null);let r=1/0,o=-1/0,i=1/0,s=-1/0;const a=new Set;for(const h of n)for(const g of h){if(!g||!g.cell)continue;const p=g.cell.getKey();if(!a.has(p)&&e.some(m=>m.is(g.cell))){a.add(p);const m=g.startRow,v=g.startColumn,y=g.cell.__rowSpan||1,x=g.cell.__colSpan||1;r=Math.min(r,m),o=Math.max(o,m+y-1),i=Math.min(i,v),s=Math.max(s,v+x-1)}}if(r===1/0||i===1/0)return null;const l=o-r+1,c=s-i+1,u=n[r][i];if(!u.cell)return null;const f=u.cell;f.setColSpan(c),f.setRowSpan(l);const d=new Set([f.getKey()]);for(let h=r;h<=o;h++)for(let g=i;g<=s;g++){const p=n[h][g];if(!p.cell)continue;const m=p.cell,v=m.getKey();d.has(v)||(d.add(v),dP(m)||f.append(...m.getChildren()),m.remove())}return f.getChildrenSize()===0&&f.append(ve()),f}function dP(e){if(e.getChildrenSize()!==1)return!1;const t=e.getFirstChildOrThrow();return!(!Qr(t)||!t.isEmpty())}function fP(e){const[t,n,r]=zn(e),o=t.__colSpan,i=t.__rowSpan;if(o===1&&i===1)return;const[s,a]=an(r,t,t),{startColumn:l,startRow:c}=a,u=t.__headerState&st.COLUMN,f=Array.from({length:o},(g,p)=>{let m=u;for(let v=0;m!==0&&v<s.length;v++)m&=s[v][p+l].cell.__headerState;return m}),d=t.__headerState&st.ROW,h=Array.from({length:i},(g,p)=>{let m=d;for(let v=0;m!==0&&v<s[0].length;v++)m&=s[p+c][v].cell.__headerState;return m});if(o>1){for(let g=1;g<o;g++)t.insertAfter(un(f[g]|h[0]).append(ve()));t.setColSpan(1)}if(i>1){let g;for(let p=1;p<i;p++){const m=c+p,v=s[m];g=(g||n).getNextSibling(),tt(g)||fe(125);let y=null;for(let x=0;x<l;x++){const b=v[x],w=b.cell;b.startRow===m&&(y=w),w.__colSpan>1&&(x+=w.__colSpan-1)}if(y===null)for(let x=o-1;x>=0;x--)nC(g,un(f[x]|h[p]).append(ve()));else for(let x=o-1;x>=0;x--)y.insertAfter(un(f[x]|h[p]).append(ve()))}t.setRowSpan(1)}}function an(e,t,n){const[r,o,i]=Fr(e,t,n);return o===null&&fe(207),i===null&&fe(208),[r,o,i]}function Fr(e,t,n){const r=[];let o=null,i=null;function s(l){let c=r[l];return c===void 0&&(r[l]=c=[]),c}const a=e.getChildren();for(let l=0;l<a.length;l++){const c=a[l];tt(c)||fe(209);const u=s(l);for(let f=c.getFirstChild(),d=0;f!=null;f=f.getNextSibling()){for(ge(f)||fe(147);u[d]!==void 0;)d++;const h={cell:f,startColumn:d,startRow:l},{__rowSpan:g,__colSpan:p}=f;for(let m=0;m<g&&!(l+m>=a.length);m++){const v=s(l+m);for(let y=0;y<p;y++)v[d+y]=h}t!==null&&o===null&&t.is(f)&&(o=h),n!==null&&i===null&&n.is(f)&&(i=h)}}return[r,o,i]}function zn(e){let t;if(e instanceof Mn)t=e;else if("__type"in e){const o=we(e,ge);ge(o)||fe(148),t=o}else{const o=we(e.getNode(),ge);ge(o)||fe(148),t=o}const n=t.getParent();tt(n)||fe(149);const r=n.getParent();return Ze(r)||fe(210),[t,n,r]}function jl(e,t,n){let r,o=Math.min(t.startColumn,n.startColumn),i=Math.min(t.startRow,n.startRow),s=Math.max(t.startColumn+t.cell.__colSpan-1,n.startColumn+n.cell.__colSpan-1),a=Math.max(t.startRow+t.cell.__rowSpan-1,n.startRow+n.cell.__rowSpan-1);do{r=!1;for(let l=0;l<e.length;l++)for(let c=0;c<e[0].length;c++){const u=e[l][c];if(!u)continue;const f=u.startColumn+u.cell.__colSpan-1,d=u.startRow+u.cell.__rowSpan-1,h=u.startColumn<=s&&f>=o,g=u.startRow<=a&&d>=i;if(h&&g){const p=Math.min(o,u.startColumn),m=Math.max(s,f),v=Math.min(i,u.startRow),y=Math.max(a,d);p===o&&m===s&&v===i&&y===a||(o=p,s=m,i=v,a=y,r=!0)}}}while(r);return{maxColumn:s,maxRow:a,minColumn:o,minRow:i}}function Jy(e){const[t,,n]=zn(e),r=n.getChildren(),o=r.length,i=r[0].getChildren().length,s=new Array(o);for(let a=0;a<o;a++)s[a]=new Array(i);for(let a=0;a<o;a++){const l=r[a].getChildren();let c=0;for(let u=0;u<l.length;u++){for(;s[a][c];)c++;const f=l[u],d=f.__rowSpan||1,h=f.__colSpan||1;for(let g=0;g<d;g++)for(let p=0;p<h;p++)s[a+g][c+p]=f;if(t===f)return{colSpan:h,columnIndex:c,rowIndex:a,rowSpan:d};c+=h}}return null}function Qy(e){const[[t,n,r,o],[i,s,a,l]]=["anchor","focus"].map(c=>{const u=e[c].getNode(),f=we(u,ge);ge(f)||fe(238,c,u.getKey(),u.getType());const d=f.getParent();tt(d)||fe(239,c);const h=d.getParent();return Ze(h)||fe(240,c),[u,f,d,h]});return o.is(l)||fe(241),{anchorCell:n,anchorNode:t,anchorRow:r,anchorTable:o,focusCell:s,focusNode:i,focusRow:a,focusTable:l}}class mc{tableKey;anchor;focus;_cachedNodes;dirty;constructor(t,n,r){this.anchor=n,this.focus=r,n._selection=this,r._selection=this,this._cachedNodes=null,this.dirty=!1,this.tableKey=t}getStartEndPoints(){return[this.anchor,this.focus]}isValid(){if(this.tableKey==="root"||this.anchor.key==="root"||this.anchor.type!=="element"||this.focus.key==="root"||this.focus.type!=="element")return!1;const t=Pe(this.tableKey),n=Pe(this.anchor.key),r=Pe(this.focus.key);return t!==null&&n!==null&&r!==null}isBackward(){return this.focus.isBefore(this.anchor)}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){return Ve(t)&&this.tableKey===t.tableKey&&this.anchor.is(t.anchor)&&this.focus.is(t.focus)}set(t,n,r){this.dirty=this.dirty||t!==this.tableKey||n!==this.anchor.key||r!==this.focus.key,this.tableKey=t,this.anchor.key=n,this.focus.key=r,this._cachedNodes=null}clone(){return new mc(this.tableKey,Kt(this.anchor.key,this.anchor.offset,this.anchor.type),Kt(this.focus.key,this.focus.offset,this.focus.type))}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(t){}insertText(){}hasFormat(t){let n=0;this.getNodes().filter(ge).forEach(o=>{const i=o.getFirstChild();Qr(i)&&(n|=i.getTextFormat())});const r=Hr[t];return(n&r)!==0}insertNodes(t){const n=this.focus.getNode();B(n)||fe(151),Bs(n.select(0,n.getChildrenSize())).insertNodes(t)}getShape(){const{anchorCell:t,focusCell:n}=Qy(this),r=Jy(t);r===null&&fe(153);const o=Jy(n);o===null&&fe(155);const i=Math.min(r.columnIndex,o.columnIndex),s=Math.max(r.columnIndex+r.colSpan-1,o.columnIndex+o.colSpan-1),a=Math.min(r.rowIndex,o.rowIndex),l=Math.max(r.rowIndex+r.rowSpan-1,o.rowIndex+o.rowSpan-1);return{fromX:Math.min(i,s),fromY:Math.min(a,l),toX:Math.max(i,s),toY:Math.max(a,l)}}getNodes(){if(!this.isValid())return[];const t=this._cachedNodes;if(t!==null)return t;const{anchorTable:n,anchorCell:r,focusCell:o}=Qy(this),i=o.getParents()[1];if(i!==n){if(n.isParentOf(o)){const m=i.getParent();m==null&&fe(159),this.set(this.tableKey,o.getKey(),m.getKey())}else{const m=n.getParent();m==null&&fe(158),this.set(this.tableKey,m.getKey(),o.getKey())}return this.getNodes()}const[s,a,l]=an(n,r,o),{minColumn:c,maxColumn:u,minRow:f,maxRow:d}=jl(s,a,l),h=new Map([[n.getKey(),n]]);let g=null;for(let m=f;m<=d;m++)for(let v=c;v<=u;v++){const{cell:y}=s[m][v],x=y.getParent();tt(x)||fe(160),x!==g&&(h.set(x.getKey(),x),g=x),h.has(y.getKey())||gP(y,b=>{h.set(b.getKey(),b)})}const p=Array.from(h.values());return Yi()||(this._cachedNodes=p),p}getTextContent(){const t=this.getNodes().filter(r=>ge(r));let n="";for(let r=0;r<t.length;r++){const o=t[r],i=o.__parent,s=(t[r+1]||{}).__parent;n+=o.getTextContent()+(s!==i?`
64
- `:" ")}return n}}function Ve(e){return e instanceof mc}function rC(){const e=Kt("root",0,"element"),t=Kt("root",0,"element");return new mc("root",e,t)}function hP(e,t,n){e.getKey(),t.getKey(),n.getKey();const r=X(),o=Ve(r)?r.clone():rC();return o.set(e.getKey(),t.getKey(),n.getKey()),o}function gP(e,t){const n=[[e]];for(let r=n.at(-1);r!==void 0&&n.length>0;r=n.at(-1)){const o=r.pop();o===void 0?n.pop():t(o)!==!1&&B(o)&&n.push(o.getChildren())}}function oC(e,t=Zi()){const n=Pe(e);Ze(n)||fe(231,e);const r=Do(n,t.getElementByKey(e));return r===null&&fe(232,e),{tableElement:r,tableNode:n}}class pP{focusX;focusY;listenersToRemove;table;isHighlightingCells;anchorX;anchorY;tableNodeKey;anchorCell;focusCell;anchorCellNodeKey;focusCellNodeKey;editor;tableSelection;hasHijackedSelectionStyles;isSelecting;pointerType;shouldCheckSelection;abortController;listenerOptions;nextFocus;constructor(t,n){this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.listenersToRemove=new Set,this.tableNodeKey=n,this.editor=t,this.table={columns:0,domRows:[],rows:0},this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.isSelecting=!1,this.pointerType=null,this.shouldCheckSelection=!1,this.abortController=new AbortController,this.listenerOptions={signal:this.abortController.signal},this.nextFocus=null,this.trackTable()}getTable(){return this.table}removeListeners(){this.abortController.abort("removeListeners"),Array.from(this.listenersToRemove).forEach(t=>t()),this.listenersToRemove.clear()}$lookup(){return oC(this.tableNodeKey,this.editor)}trackTable(){const t=new MutationObserver(n=>{this.editor.getEditorState().read(()=>{let r=!1;for(let s=0;s<n.length;s++){const a=n[s].target.nodeName;if(a==="TABLE"||a==="TBODY"||a==="THEAD"||a==="TR"){r=!0;break}}if(!r)return;const{tableNode:o,tableElement:i}=this.$lookup();this.table=Ai(o,i)},{editor:this.editor})});this.editor.getEditorState().read(()=>{const{tableNode:n,tableElement:r}=this.$lookup();this.table=Ai(n,r),t.observe(r,{attributes:!0,childList:!0,subtree:!0})},{editor:this.editor})}$clearHighlight(){const t=this.editor;this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.$enableHighlightStyle();const{tableNode:n,tableElement:r}=this.$lookup();Va(t,Ai(n,r),null),X()!==null&&(Ge(null),t.dispatchCommand(fr,void 0))}$enableHighlightStyle(){const t=this.editor,{tableElement:n}=this.$lookup();Yn(n,t._config.theme.tableSelection),n.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1}$disableHighlightStyle(){const{tableElement:t}=this.$lookup();et(t,this.editor._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0}$updateTableTableSelection(t){if(t!==null){t.tableKey!==this.tableNodeKey&&fe(233,t.tableKey,this.tableNodeKey);const n=this.editor;this.tableSelection=t,this.isHighlightingCells=!0,this.$disableHighlightStyle(),this.updateDOMSelection(),Va(n,this.table,this.tableSelection)}else this.$clearHighlight()}setShouldCheckSelection(){this.shouldCheckSelection=!0}getAndClearShouldCheckSelection(){return!!this.shouldCheckSelection&&(this.shouldCheckSelection=!1,!0)}setNextFocus(t){this.nextFocus=t}getAndClearNextFocus(){const{nextFocus:t}=this;return t!==null&&(this.nextFocus=null),t}updateDOMSelection(){if(this.anchorCell!==null&&this.focusCell!==null){const t=Ot(this.editor._window);t&&t.rangeCount>0&&t.removeAllRanges()}}$setFocusCellForSelection(t,n=!1){const r=this.editor,{tableNode:o}=this.$lookup(),i=t.x,s=t.y;if(this.focusCell=t,this.isHighlightingCells||this.anchorX===i&&this.anchorY===s&&!n){if(i===this.focusX&&s===this.focusY)return!1}else this.isHighlightingCells=!0,this.$disableHighlightStyle();if(this.focusX=i,this.focusY=s,this.isHighlightingCells){const a=mf(o,t.elem);if(this.tableSelection!=null&&this.anchorCellNodeKey!=null&&a!==null)return this.focusCellNodeKey=a.getKey(),this.tableSelection=hP(o,this.$getAnchorTableCellOrThrow(),a),Ge(this.tableSelection),r.dispatchCommand(fr,void 0),Va(r,this.table,this.tableSelection),!0}return!1}$getAnchorTableCell(){return this.anchorCellNodeKey?Pe(this.anchorCellNodeKey):null}$getAnchorTableCellOrThrow(){const t=this.$getAnchorTableCell();return t===null&&fe(234),t}$getFocusTableCell(){return this.focusCellNodeKey?Pe(this.focusCellNodeKey):null}$getFocusTableCellOrThrow(){const t=this.$getFocusTableCell();return t===null&&fe(235),t}$setAnchorCellForSelection(t){this.isHighlightingCells=!1,this.anchorCell=t,this.anchorX=t.x,this.anchorY=t.y;const{tableNode:n}=this.$lookup(),r=mf(n,t.elem);if(r!==null){const o=r.getKey();this.tableSelection=this.tableSelection!=null?this.tableSelection.clone():rC(),this.anchorCellNodeKey=o}}$formatCells(t){const n=X();Ve(n)||fe(236);const r=ic(),o=r.anchor,i=r.focus,s=n.getNodes().filter(ge);s.length>0||fe(237);const a=s[0].getFirstChild(),l=Qr(a)?a.getFormatFlags(t,null):null;s.forEach(c=>{o.set(c.getKey(),0,"element"),i.set(c.getKey(),c.getChildrenSize(),"element"),r.formatText(t,l)}),Ge(n),this.editor.dispatchCommand(fr,void 0)}$clearText(){const{editor:t}=this,n=Pe(this.tableNodeKey);if(!Ze(n))throw new Error("Expected TableNode.");const r=X();Ve(r)||fe(253);const o=r.getNodes().filter(ge),i=n.getFirstChild(),s=n.getLastChild();if(o.length>0&&i!==null&&s!==null&&tt(i)&&tt(s)&&o[0]===i.getFirstChild()&&o[o.length-1]===s.getLastChild()){n.selectPrevious();const a=n.getParent();return n.remove(),void(at(a)&&a.isEmpty()&&t.dispatchCommand(Mo,void 0))}o.forEach(a=>{if(B(a)){const l=ve(),c=Fe();l.append(c),a.append(l),a.getChildren().forEach(u=>{u!==l&&u.remove()})}}),Va(t,this.table,null),Ge(null),t.dispatchCommand(fr,void 0)}}const pf="__lexicalTableSelection";function fi(e){return Be(e)&&e.nodeName==="TABLE"}function Do(e,t){if(!t)return t;const n=fi(t)?t:e.getDOMSlot(t).element;return n.nodeName!=="TABLE"&&fe(245,t.nodeName),n}function og(e){return e._window}function Ps(e,t){for(let n=t,r=null;n!==null;n=n.getParent()){if(e.is(n))return r;ge(n)&&(r=n)}return null}const mP=[[wh,"down"],[bh,"up"],[xh,"backward"],[vh,"forward"]],yP=[$i,Po,Ir],vP=[ec,Sh];function xP(e,t,n,r){const o=n.getRootElement(),i=og(n);o!==null&&i!==null||fe(246);const s=new pP(n,e.getKey()),a=Do(e,t);(function(h,g){ev(h)!==null&&fe(205),h[pf]=g})(a,s),s.listenersToRemove.add(()=>(function(h,g){ev(h)===g&&delete h[pf]})(a,s));const l=h=>{if(s.pointerType=h.pointerType,h.button!==0||!Cn(h.target)||!i)return;const g=Vl(h.target);g!==null&&n.update(()=>{const p=Zn();if(Zy&&h.shiftKey&&In(p,e)&&(W(p)||Ve(p))){const m=p.anchor.getNode(),v=Ps(e,p.anchor.getNode());v?(s.$setAnchorCellForSelection(vo(s,v)),s.$setFocusCellForSelection(g),dr(h)):(e.isBefore(m)?e.selectStart():e.selectEnd()).anchor.set(p.anchor.key,p.anchor.offset,p.anchor.type)}else h.pointerType!=="touch"&&s.$setAnchorCellForSelection(g)}),(()=>{if(s.isSelecting)return;const p=()=>{s.isSelecting=!1,i.removeEventListener("pointerup",p),i.removeEventListener("pointermove",m)},m=v=>{if(1&~v.buttons&&s.isSelecting)return s.isSelecting=!1,i.removeEventListener("pointerup",p),void i.removeEventListener("pointermove",m);if(!Cn(v.target))return;let y=null;const x=!(Zy||a.contains(v.target));if(x)y=tv(a,v.target);else for(const b of document.elementsFromPoint(v.clientX,v.clientY))if(y=tv(a,b),y)break;!y||s.focusCell!==null&&y.elem===s.focusCell.elem||(s.setNextFocus({focusCell:y,override:x}),n.dispatchCommand(fr,void 0))};s.isSelecting=!0,i.addEventListener("pointerup",p,s.listenerOptions),i.addEventListener("pointermove",m,s.listenerOptions)})()};a.addEventListener("pointerdown",l,s.listenerOptions),s.listenersToRemove.add(()=>{a.removeEventListener("pointerdown",l)});const c=h=>{h.detail>=3&&Cn(h.target)&&Vl(h.target)!==null&&h.preventDefault()};a.addEventListener("mousedown",c,s.listenerOptions),s.listenersToRemove.add(()=>{a.removeEventListener("mousedown",c)});const u=h=>{const g=h.target;h.button===0&&Cn(g)&&n.update(()=>{const p=X();Ve(p)&&p.tableKey===s.tableNodeKey&&o.contains(g)&&s.$clearHighlight()})};i.addEventListener("pointerdown",u,s.listenerOptions),s.listenersToRemove.add(()=>{i.removeEventListener("pointerdown",u)});for(const[h,g]of mP)s.listenersToRemove.add(n.registerCommand(h,p=>aC(n,p,g,e,s),Dt));s.listenersToRemove.add(n.registerCommand(Ch,h=>{const g=X();if(Ve(g)){const p=Ps(e,g.focus.getNode());if(p!==null)return dr(h),p.selectEnd(),!0}return!1},Dt));const f=h=>()=>{const g=X();if(!In(g,e))return!1;if(Ve(g))return s.$clearText(),!0;if(W(g)){if(!ge(Ps(e,g.anchor.getNode())))return!1;const p=g.anchor.getNode(),m=g.focus.getNode(),v=e.isParentOf(p),y=e.isParentOf(m);if(v&&!y||y&&!v)return s.$clearText(),!0;const x=we(g.anchor.getNode(),w=>B(w)),b=x&&we(x,w=>B(w)&&ge(w.getParent()));if(!B(b)||!B(x))return!1;if(h===Po&&b.getPreviousSibling()===null)return!0}return!1};for(const h of yP)s.listenersToRemove.add(n.registerCommand(h,f(h),Dt));const d=h=>{const g=X();if(!Ve(g)&&!W(g))return!1;const p=e.isParentOf(g.anchor.getNode());if(p!==e.isParentOf(g.focus.getNode())){const m=p?"anchor":"focus",v=p?"focus":"anchor",{key:y,offset:x,type:b}=g[v];return e[g[m].isBefore(g[v])?"selectPrevious":"selectNext"]()[v].set(y,x,b),!1}return!!In(g,e)&&!!Ve(g)&&(h&&(h.preventDefault(),h.stopPropagation()),s.$clearText(),!0)};for(const h of vP)s.listenersToRemove.add(n.registerCommand(h,d,Dt));return s.listenersToRemove.add(n.registerCommand(nc,h=>{const g=X();if(g){if(!Ve(g)&&!W(g))return!1;af(n,Pr(h,ClipboardEvent)?h:null,Aw(g));const p=d(h);return W(g)?(g.removeText(),!0):p}return!1},Dt)),s.listenersToRemove.add(n.registerCommand(Vt,h=>{const g=X();if(!In(g,e))return!1;if(Ve(g))return s.$formatCells(h),!0;if(W(g)){const p=we(g.anchor.getNode(),m=>ge(m));if(!ge(p))return!1}return!1},Dt)),s.listenersToRemove.add(n.registerCommand(_i,h=>{const g=X();if(!Ve(g)||!In(g,e))return!1;const p=g.anchor.getNode(),m=g.focus.getNode();if(!ge(p)||!ge(m))return!1;if((function(k,M){if(Ve(k)){const F=k.anchor.getNode(),D=k.focus.getNode();if(M&&F&&D){const[j]=an(M,F,D);return F.getKey()===j[0][0].cell.getKey()&&D.getKey()===j[j.length-1].at(-1).cell.getKey()}}return!1})(g,e))return e.setFormat(h),!0;const[v,y,x]=an(e,p,m),b=Math.max(y.startRow+y.cell.__rowSpan-1,x.startRow+x.cell.__rowSpan-1),w=Math.max(y.startColumn+y.cell.__colSpan-1,x.startColumn+x.cell.__colSpan-1),_=Math.min(y.startRow,x.startRow),E=Math.min(y.startColumn,x.startColumn),R=new Set;for(let k=_;k<=b;k++)for(let M=E;M<=w;M++){const F=v[k][M].cell;if(R.has(F))continue;R.add(F),F.setFormat(h);const D=F.getChildren();for(let j=0;j<D.length;j++){const I=D[j];B(I)&&!I.isInline()&&I.setFormat(h)}}return!0},Dt)),s.listenersToRemove.add(n.registerCommand(To,h=>{const g=X();if(!In(g,e))return!1;if(Ve(g))return s.$clearHighlight(),!1;if(W(g)){const p=we(g.anchor.getNode(),m=>ge(m));if(!ge(p))return!1;if(typeof h=="string"){const m=ov(n,g,e);if(m)return rv(m,e,[Fe(h)]),!0}}return!1},Dt)),r&&s.listenersToRemove.add(n.registerCommand(_h,h=>{const g=X();if(!W(g)||!g.isCollapsed()||!In(g,e))return!1;const p=fs(g.anchor.getNode());return!(p===null||!e.is(Ni(p)))&&(dr(h),(function(m,v){const y=v==="next"?"getNextSibling":"getPreviousSibling",x=v==="next"?"getFirstChild":"getLastChild",b=m[y]();if(B(b))return b.selectEnd();const w=we(m,tt);w===null&&fe(247);for(let E=w[y]();tt(E);E=E[y]()){const R=E[x]();if(B(R))return R.selectEnd()}const _=we(w,Ze);_===null&&fe(248),v==="next"?_.selectNext():_.selectPrevious()})(p,h.shiftKey?"previous":"next"),!0)},Dt)),s.listenersToRemove.add(n.registerCommand(r1,h=>e.isSelected(),Dt)),s.listenersToRemove.add(n.registerCommand(mh,(h,g)=>{if(n!==g)return!1;const{nodes:p,selection:m}=h,v=m.getStartEndPoints(),y=Ve(m),x=W(m)&&we(m.anchor.getNode(),ee=>ge(ee))!==null&&we(m.focus.getNode(),ee=>ge(ee))!==null||y;if(p.length!==1||!Ze(p[0])||!x||v===null)return!1;const[b,w]=v,[_,E,R]=zn(b),k=we(w.getNode(),ee=>ge(ee));if(!(ge(_)&&ge(k)&&tt(E)&&Ze(R)))return!1;const M=p[0],[F,D,j]=an(R,_,k),[I]=Fr(M,null,null),$=F.length,H=$>0?F[0].length:0;let O=D.startRow,P=D.startColumn,K=I.length,G=K>0?I[0].length:0;if(y){const ee=jl(F,D,j),xe=ee.maxRow-ee.minRow+1,Se=ee.maxColumn-ee.minColumn+1;O=ee.minRow,P=ee.minColumn,K=Math.min(K,xe),G=Math.min(G,Se)}let re=!1;const U=Math.min($,O+K)-1,Z=Math.min(H,P+G)-1,Q=new Set;for(let ee=O;ee<=U;ee++)for(let xe=P;xe<=Z;xe++){const Se=F[ee][xe];Q.has(Se.cell.getKey())||Se.cell.__rowSpan===1&&Se.cell.__colSpan===1||(fP(Se.cell),Q.add(Se.cell.getKey()),re=!0)}let[ne]=Fr(R.getWritable(),null,null);const oe=K-$+O;for(let ee=0;ee<oe;ee++)aP(ne[$-1][0].cell);const me=G-H+P;for(let ee=0;ee<me;ee++)lP(ne[0][H-1].cell,!0,!1);[ne]=Fr(R.getWritable(),null,null);for(let ee=O;ee<O+K;ee++)for(let xe=P;xe<P+G;xe++){const Se=ee-O,Ee=xe-P,ze=I[Se][Ee];if(ze.startRow!==Se||ze.startColumn!==Ee)continue;const je=ze.cell;if(je.__rowSpan!==1||je.__colSpan!==1){const ot=[],Gt=Math.min(ee+je.__rowSpan,O+K)-1,Qt=Math.min(xe+je.__colSpan,P+G)-1;for(let pt=ee;pt<=Gt;pt++)for(let se=xe;se<=Qt;se++){const Re=ne[pt][se];ot.push(Re.cell)}uP(ot),re=!0}const{cell:Rt}=ne[ee][xe],gn=Rt.getChildren();je.getChildren().forEach(ot=>{J(ot)&&ve().append(ot),Rt.append(ot)}),gn.forEach(ot=>ot.remove())}if(y&&re){const[ee]=Fr(R.getWritable(),null,null);ee[D.startRow][D.startColumn].cell.selectEnd()}return!0},Dt)),s.listenersToRemove.add(n.registerCommand(fr,()=>{const h=X(),g=Zn(),p=s.getAndClearNextFocus();if(p!==null){const{focusCell:m}=p;if(Ve(h)&&h.tableKey===s.tableNodeKey)return(m.x!==s.focusX||m.y!==s.focusY)&&(s.$setFocusCellForSelection(m),!0);if(m!==s.anchorCell&&In(h,e))return s.$setFocusCellForSelection(m),!0}if(s.getAndClearShouldCheckSelection()&&W(g)&&W(h)&&h.isCollapsed()){const m=h.anchor.getNode(),v=e.getFirstChild(),y=fs(m);if(y!==null&&tt(v)){const x=v.getFirstChild();if(ge(x)&&e.is(we(y,b=>b.is(e)||b.is(x))))return x.selectStart(),!0}}if(W(h)){const{anchor:m,focus:v}=h,y=m.getNode(),x=v.getNode(),b=fs(y),w=fs(x),_=!(!b||!e.is(Ni(b))),E=!(!w||!e.is(Ni(w))),R=_!==E,k=_&&E,M=h.isBackward();if(R){const F=h.clone();if(E){const[D]=an(e,w,w),j=D[0][0].cell,I=D[D.length-1].at(-1).cell;F.focus.set(M?j.getKey():I.getKey(),M?0:I.getChildrenSize(),"element")}else if(_){const[D]=an(e,b,b),j=D[0][0].cell,I=D[D.length-1].at(-1).cell;F.anchor.set(M?I.getKey():j.getKey(),M?I.getChildrenSize():0,"element")}Ge(F),nv(n,s)}else if(k&&(b.is(w)||(s.$setAnchorCellForSelection(vo(s,b)),s.$setFocusCellForSelection(vo(s,w),!0)),s.pointerType==="touch"&&s.isSelecting&&h.isCollapsed()&&W(g)&&g.isCollapsed())){const F=fs(g.anchor.getNode());F&&!F.is(w)&&(s.$setAnchorCellForSelection(vo(s,F)),s.$setFocusCellForSelection(vo(s,w),!0),s.pointerType=null)}}else if(h&&Ve(h)&&h.is(g)&&h.tableKey===e.getKey()){const m=Ot(i);if(m&&m.anchorNode&&m.focusNode){const v=Ut(m.focusNode),y=v&&!e.isParentOf(v),x=Ut(m.anchorNode),b=x&&e.isParentOf(x);if(y&&b&&m.rangeCount>0){const w=uA(m,n);w&&(w.anchor.set(e.getKey(),h.isBackward()?e.getChildrenSize():0,"element"),m.removeAllRanges(),Ge(w))}}}return h&&!h.is(g)&&(Ve(h)||Ve(g))&&s.tableSelection&&!s.tableSelection.is(g)?(Ve(h)&&h.tableKey===s.tableNodeKey?s.$updateTableTableSelection(h):!Ve(h)&&Ve(g)&&g.tableKey===s.tableNodeKey&&s.$updateTableTableSelection(null),!1):(s.hasHijackedSelectionStyles&&!e.isSelected()?(function(m,v){v.$enableHighlightStyle(),ig(v.table,y=>{const x=y.elem;y.highlighted=!1,sC(m,y),x.getAttribute("style")||x.removeAttribute("style")})})(n,s):!s.hasHijackedSelectionStyles&&e.isSelected()&&nv(n,s),!1)},Dt)),s.listenersToRemove.add(n.registerCommand(Mo,()=>{const h=X();if(!W(h)||!h.isCollapsed()||!In(h,e))return!1;const g=ov(n,h,e);return!!g&&(rv(g,e),!0)},Dt)),s}function ev(e){return e[pf]||null}function Vl(e){let t=e;for(;t!=null;){const n=t.nodeName;if(n==="TD"||n==="TH"){const r=t._cell;return r===void 0?null:r}t=t.parentNode}return null}function tv(e,t){if(!e.contains(t))return null;let n=null;for(let r=t;r!=null;r=r.parentNode){if(r===e)return n;const o=r.nodeName;o!=="TD"&&o!=="TH"||(n=r._cell||null)}return null}function Ai(e,t){const n=[],r={columns:0,domRows:n,rows:0};let o=Do(e,t).querySelector("tr"),i=0,s=0;for(n.length=0;o!=null;){const a=o.nodeName;if(a==="TD"||a==="TH"){const u={elem:o,hasBackgroundColor:o.style.backgroundColor!=="",highlighted:!1,x:i,y:s};o._cell=u;let f=n[s];f===void 0&&(f=n[s]=[]),f[i]=u}else{const u=o.firstChild;if(u!=null){o=u;continue}}const l=o.nextSibling;if(l!=null){i++,o=l;continue}const c=o.parentNode;if(c!=null){const u=c.nextSibling;if(u==null)break;s++,i=0,o=u}}return r.columns=i+1,r.rows=s+1,r}function Va(e,t,n){const r=new Set(n?n.getNodes():[]);ig(t,(o,i)=>{const s=o.elem;r.has(i)?(o.highlighted=!0,iC(e,o)):(o.highlighted=!1,sC(e,o),s.getAttribute("style")||s.removeAttribute("style"))})}function ig(e,t){const{domRows:n}=e;for(let r=0;r<n.length;r++){const o=n[r];if(o)for(let i=0;i<o.length;i++){const s=o[i];if(!s)continue;const a=Ut(s.elem);a!==null&&t(s,a,{x:i,y:r})}}}function nv(e,t){t.$disableHighlightStyle(),ig(t.table,n=>{n.highlighted=!0,iC(e,n)})}const bP=(e,t,n,r,o)=>{const i=o==="forward";switch(o){case"backward":case"forward":return n!==(i?e.table.columns-1:0)?za(t.getCellNodeFromCordsOrThrow(n+(i?1:-1),r,e.table),i):r!==(i?e.table.rows-1:0)?za(t.getCellNodeFromCordsOrThrow(i?0:e.table.columns-1,r+(i?1:-1),e.table),i):i?t.selectNext():t.selectPrevious(),!0;case"up":return r!==0?za(t.getCellNodeFromCordsOrThrow(n,r-1,e.table),!1):t.selectPrevious(),!0;case"down":return r!==e.table.rows-1?za(t.getCellNodeFromCordsOrThrow(n,r+1,e.table),!0):t.selectNext(),!0;default:return!1}};function vu(e,t){let n,r;if(t.startColumn===e.minColumn)n="minColumn";else{if(t.startColumn+t.cell.__colSpan-1!==e.maxColumn)return null;n="maxColumn"}if(t.startRow===e.minRow)r="minRow";else{if(t.startRow+t.cell.__rowSpan-1!==e.maxRow)return null;r="maxRow"}return[n,r]}function Ba([e,t]){return[e==="minColumn"?"maxColumn":"minColumn",t==="minRow"?"maxRow":"minRow"]}function ni(e,t,[n,r]){const o=t[r],i=e[o];i===void 0&&fe(250,r,String(o));const s=t[n],a=i[s];return a===void 0&&fe(250,n,String(s)),a}function wP(e,t,n,r,o){const i=jl(t,n,r),s=(function(_,E){const{minColumn:R,maxColumn:k,minRow:M,maxRow:F}=E;let D=1,j=1,I=1,$=1;const H=_[M],O=_[F];for(let P=R;P<=k;P++)D=Math.max(D,H[P].cell.__rowSpan),$=Math.max($,O[P].cell.__rowSpan);for(let P=M;P<=F;P++)j=Math.max(j,_[P][R].cell.__colSpan),I=Math.max(I,_[P][k].cell.__colSpan);return{bottomSpan:$,leftSpan:j,rightSpan:I,topSpan:D}})(t,i),{topSpan:a,leftSpan:l,bottomSpan:c,rightSpan:u}=s,f=(function(_,E){const R=vu(_,E);return R===null&&fe(249,E.cell.getKey()),R})(i,n),[d,h]=Ba(f);let g=i[d],p=i[h];o==="forward"?g+=d==="maxColumn"?1:l:o==="backward"?g-=d==="minColumn"?1:u:o==="down"?p+=h==="maxRow"?1:a:o==="up"&&(p-=h==="minRow"?1:c);const m=t[p];if(m===void 0)return!1;const v=m[g];if(v===void 0)return!1;const[y,x]=(function(_,E,R){const k=jl(_,E,R),M=vu(k,E);if(M)return[ni(_,k,M),ni(_,k,Ba(M))];const F=vu(k,R);if(F)return[ni(_,k,Ba(F)),ni(_,k,F)];const D=["minColumn","minRow"];return[ni(_,k,D),ni(_,k,Ba(D))]})(t,n,v),b=vo(e,y.cell),w=vo(e,x.cell);return e.$setAnchorCellForSelection(b),e.$setFocusCellForSelection(w,!0),!0}function In(e,t){if(W(e)||Ve(e)){const n=t.isParentOf(e.anchor.getNode()),r=t.isParentOf(e.focus.getNode());return n&&r}return!1}function za(e,t){t?e.selectStart():e.selectEnd()}function iC(e,t){const n=t.elem,r=e._config.theme;ge(Ut(n))||fe(131),et(n,r.tableCellSelected)}function sC(e,t){const n=t.elem;ge(Ut(n))||fe(131);const r=e._config.theme;Yn(n,r.tableCellSelected)}function fs(e){const t=we(e,ge);return ge(t)?t:null}function Ni(e){const t=we(e,Ze);return Ze(t)?t:null}function CP(e,t,n,r,o,i,s){const a=An(n.focus,o?"previous":"next");if(Kh(a))return!1;let l=a;for(const m of Us(a).iterNodeCarets("shadowRoot")){if(!Wr(m)||!B(m.origin))return!1;l=m}const c=l.getParentAtCaret();if(!ge(c))return!1;const u=c,f=(function(m){for(const v of Us(m).iterNodeCarets("root")){const{origin:y}=v;if(ge(y)){if(zt(v))return Ft(y,m.direction)}else if(!tt(y))break}return null})(nt(u,l.direction)),d=we(u,Ze);if(!d||!d.is(i))return!1;const h=e.getElementByKey(u.getKey()),g=Vl(h);if(!h||!g)return!1;const p=_P(e,d);if(s.table=p,f)if(r==="extend"){const m=Vl(e.getElementByKey(f.origin.getKey()));if(!m)return!1;s.$setAnchorCellForSelection(g),s.$setFocusCellForSelection(m,!0)}else{const m=Lt(f);Sn(n.anchor,m),Sn(n.focus,m)}else if(r==="extend")s.$setAnchorCellForSelection(g),s.$setFocusCellForSelection(g,!0);else{const m=(function(v){const y=ca(v);return zt(y)?Lt(y):v})(nt(d,a.direction));Sn(n.anchor,m),Sn(n.focus,m)}return dr(t),!0}function aC(e,t,n,r,o){if((n==="up"||n==="down")&&(function(s){const a=s.getRootElement();return a?a.hasAttribute("aria-controls")&&a.getAttribute("aria-controls")==="typeahead-menu":!1})(e))return!1;const i=X();if(!In(i,r)){if(W(i)){if(n==="backward"){if(i.focus.offset>0)return!1;const s=(function(l){for(let c=l,u=l;u!==null;c=u,u=u.getParent())if(B(u)){if(u!==c&&u.getFirstChild()!==c)return null;if(!u.isInline())return u}return null})(i.focus.getNode());if(!s)return!1;const a=s.getPreviousSibling();return!!Ze(a)&&(dr(t),t.shiftKey?i.focus.set(a.getParentOrThrow().getKey(),a.getIndexWithinParent(),"element"):a.selectEnd(),!0)}if(t.shiftKey&&(n==="up"||n==="down")){const s=i.focus.getNode();if(!i.isCollapsed()&&(n==="up"&&!i.isBackward()||n==="down"&&i.isBackward())){let a=we(s,d=>Ze(d));if(ge(a)&&(a=we(a,Ze)),a!==r||!a)return!1;const l=n==="down"?a.getNextSibling():a.getPreviousSibling();if(!l)return!1;let c=0;n==="up"&&B(l)&&(c=l.getChildrenSize());let u=l;n==="up"&&B(l)&&(u=l.getLastChild()||l,c=J(u)?u.getTextContentSize():0);const f=i.clone();return f.focus.set(u.getKey(),c,J(u)?"text":"element"),Ge(f),dr(t),!0}if(vt(s)){const a=n==="up"?i.getNodes()[i.getNodes().length-1]:i.getNodes()[0];if(a&&Ps(r,a)!==null){const l=r.getFirstDescendant(),c=r.getLastDescendant();if(!l||!c)return!1;const[u]=zn(l),[f]=zn(c),d=r.getCordsFromCellNode(u,o.table),h=r.getCordsFromCellNode(f,o.table),g=r.getDOMCellFromCordsOrThrow(d.x,d.y,o.table),p=r.getDOMCellFromCordsOrThrow(h.x,h.y,o.table);return o.$setAnchorCellForSelection(g),o.$setFocusCellForSelection(p,!0),!0}return!1}{let a=we(s,c=>B(c)&&!c.isInline());if(ge(a)&&(a=we(a,Ze)),!a)return!1;const l=n==="down"?a.getNextSibling():a.getPreviousSibling();if(Ze(l)&&o.tableNodeKey===l.getKey()){const c=l.getFirstDescendant(),u=l.getLastDescendant();if(!c||!u)return!1;const[f]=zn(c),[d]=zn(u),h=i.clone();return h.focus.set((n==="up"?f:d).getKey(),n==="up"?0:d.getChildrenSize(),"element"),dr(t),Ge(h),!0}}}}return n==="down"&&Bl(e)&&o.setShouldCheckSelection(),!1}if(W(i)){if(n==="backward"||n==="forward")return CP(e,t,i,t.shiftKey?"extend":"move",n==="backward",r,o);if(i.isCollapsed()){const{anchor:s,focus:a}=i,l=we(s.getNode(),ge),c=we(a.getNode(),ge);if(!ge(l)||!l.is(c))return!1;const u=Ni(l);if(u!==r&&u!=null){const v=Do(u,e.getElementByKey(u.getKey()));if(v!=null)return o.table=Ai(u,v),aC(e,t,n,u,o)}const f=e.getElementByKey(l.__key),d=e.getElementByKey(s.key);if(d==null||f==null)return!1;let h;if(s.type==="element")h=d.getBoundingClientRect();else{const v=Ot(og(e));if(v===null||v.rangeCount===0)return!1;h=v.getRangeAt(0).getBoundingClientRect()}const g=n==="up"?l.getFirstChild():l.getLastChild();if(g==null)return!1;const p=e.getElementByKey(g.__key);if(p==null)return!1;const m=p.getBoundingClientRect();if(n==="up"?m.top>h.top-h.height:h.bottom+h.height>m.bottom){dr(t);const v=r.getCordsFromCellNode(l,o.table);if(!t.shiftKey)return bP(o,r,v.x,v.y,n);{const y=r.getDOMCellFromCordsOrThrow(v.x,v.y,o.table);o.$setAnchorCellForSelection(y),o.$setFocusCellForSelection(y,!0)}return!0}}}else if(Ve(i)){const{anchor:s,focus:a}=i,l=we(s.getNode(),ge),c=we(a.getNode(),ge),[u]=i.getNodes();Ze(u)||fe(251);const f=Do(u,e.getElementByKey(u.getKey()));if(!ge(l)||!ge(c)||!Ze(u)||f==null)return!1;o.$updateTableTableSelection(i);const d=Ai(u,f),h=r.getCordsFromCellNode(l,d),g=r.getDOMCellFromCordsOrThrow(h.x,h.y,d);if(o.$setAnchorCellForSelection(g),dr(t),t.shiftKey){const[p,m,v]=an(r,l,c);return wP(o,p,m,v,n)}return c.selectEnd(),!0}return!1}function dr(e){e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation()}function rv(e,t,n){const r=ve();e==="first"?t.insertBefore(r):t.insertAfter(r),r.append(...n||[]),r.selectEnd()}function ov(e,t,n){const r=n.getParent();if(!r)return;const o=Ot(og(e));if(!o)return;const i=o.anchorNode,s=e.getElementByKey(r.getKey()),a=Do(n,e.getElementByKey(n.getKey()));if(!i||!s||!a||!s.contains(i)||a.contains(i))return;const l=we(t.anchor.getNode(),y=>ge(y));if(!l)return;const c=we(l,y=>Ze(y));if(!Ze(c)||!c.is(n))return;const[u,f]=an(n,l,l),d=u[0][0],h=u[u.length-1][u[0].length-1],{startRow:g,startColumn:p}=f,m=g===d.startRow&&p===d.startColumn,v=g===h.startRow&&p===h.startColumn;return m?"first":v?"last":void 0}function vo(e,t){const{tableNode:n}=e.$lookup(),r=n.getCordsFromCellNode(t,e.table);return n.getDOMCellFromCordsOrThrow(r.x,r.y,e.table)}function mf(e,t,n){return Ps(e,Ut(t,n))}function iv(e,t,n){if(!t.theme.tableAlignment)return;const r=[],o=[];for(const i of["center","right"]){const s=t.theme.tableAlignment[i];s&&(i===n?o:r).push(s)}Yn(e,...r),et(e,...o)}const yf=new WeakSet;function Bl(e=Zi()){return yf.has(e)}function SP(e,t){t?yf.add(e):yf.delete(e)}class Pn extends Tt{__rowStriping;__frozenColumnCount;__frozenRowCount;__colWidths;static getType(){return"table"}getColWidths(){return this.getLatest().__colWidths}setColWidths(t){const n=this.getWritable();return n.__colWidths=t,n}static clone(t){return new Pn(t.__key)}afterCloneFrom(t){super.afterCloneFrom(t),this.__colWidths=t.__colWidths,this.__rowStriping=t.__rowStriping,this.__frozenColumnCount=t.__frozenColumnCount,this.__frozenRowCount=t.__frozenRowCount}static importDOM(){return{table:t=>({conversion:TP,priority:1})}}static importJSON(t){return yc().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setRowStriping(t.rowStriping||!1).setFrozenColumns(t.frozenColumnCount||0).setFrozenRows(t.frozenRowCount||0).setColWidths(t.colWidths)}constructor(t){super(t),this.__rowStriping=!1,this.__frozenColumnCount=0,this.__frozenRowCount=0,this.__colWidths=void 0}exportJSON(){return{...super.exportJSON(),colWidths:this.getColWidths(),frozenColumnCount:this.__frozenColumnCount?this.__frozenColumnCount:void 0,frozenRowCount:this.__frozenRowCount?this.__frozenRowCount:void 0,rowStriping:this.__rowStriping?this.__rowStriping:void 0}}extractWithChild(t,n,r){return r==="html"}getDOMSlot(t){const n=fi(t)?t:t.querySelector("table");return fi(n)||fe(229),super.getDOMSlot(t).withElement(n).withAfter(n.querySelector("colgroup"))}createDOM(t,n){const r=document.createElement("table");this.__style&&(r.style.cssText=this.__style);const o=document.createElement("colgroup");if(r.appendChild(o),PA(o),et(r,t.theme.table),this.updateTableElement(null,r,t),Bl(n)){const i=document.createElement("div"),s=t.theme.tableScrollableWrapper;return s?et(i,s):i.style.cssText="overflow-x: auto;",i.appendChild(r),this.updateTableWrapper(null,i,r,t),i}return r}updateTableWrapper(t,n,r,o){this.__frozenColumnCount!==(t?t.__frozenColumnCount:0)&&(function(i,s,a,l){l>0?(et(i,a.theme.tableFrozenColumn),s.setAttribute("data-lexical-frozen-column","true")):(Yn(i,a.theme.tableFrozenColumn),s.removeAttribute("data-lexical-frozen-column"))})(n,r,o,this.__frozenColumnCount),this.__frozenRowCount!==(t?t.__frozenRowCount:0)&&(function(i,s,a,l){l>0?(et(i,a.theme.tableFrozenRow),s.setAttribute("data-lexical-frozen-row","true")):(Yn(i,a.theme.tableFrozenRow),s.removeAttribute("data-lexical-frozen-row"))})(n,r,o,this.__frozenRowCount)}updateTableElement(t,n,r){this.__style!==(t?t.__style:"")&&(n.style.cssText=this.__style),this.__rowStriping!==(!!t&&t.__rowStriping)&&(function(o,i,s){s?(et(o,i.theme.tableRowStriping),o.setAttribute("data-lexical-row-striping","true")):(Yn(o,i.theme.tableRowStriping),o.removeAttribute("data-lexical-row-striping"))})(n,r,this.__rowStriping),(function(o,i,s,a){const l=o.querySelector("colgroup");if(!l)return;const c=[];for(let u=0;u<s;u++){const f=document.createElement("col"),d=a&&a[u];d&&(f.style.width=`${d}px`),c.push(f)}l.replaceChildren(...c)})(n,0,this.getColumnCount(),this.getColWidths()),iv(n,r,this.getFormatType())}updateDOM(t,n,r){const o=this.getDOMSlot(n).element;return n===o===Bl()||(Be(i=n)&&i.nodeName==="DIV"&&this.updateTableWrapper(t,n,o,r),this.updateTableElement(t,o,r),!1);var i}exportDOM(t){const n=super.exportDOM(t),{element:r}=n;return{after:o=>{if(n.after&&(o=n.after(o)),!fi(o)&&Be(o)&&(o=o.querySelector("table")),!fi(o))return null;iv(o,t._config,this.getFormatType());const[i]=Fr(this,null,null),s=new Map;for(const u of i)for(const f of u){const d=f.cell.getKey();s.has(d)||s.set(d,{colSpan:f.cell.getColSpan(),startColumn:f.startColumn})}const a=new Set;for(const u of o.querySelectorAll(":scope > tr > [data-temporary-table-cell-lexical-key]")){const f=u.getAttribute("data-temporary-table-cell-lexical-key");if(f){const d=s.get(f);if(u.removeAttribute("data-temporary-table-cell-lexical-key"),d){s.delete(f);for(let h=0;h<d.colSpan;h++)a.add(h+d.startColumn)}}}const l=o.querySelector(":scope > colgroup");if(l){const u=Array.from(o.querySelectorAll(":scope > colgroup > col")).filter((f,d)=>a.has(d));l.replaceChildren(...u)}const c=o.querySelectorAll(":scope > tr");if(c.length>0){const u=document.createElement("tbody");for(const f of c)u.appendChild(f);o.append(u)}return o},element:!fi(r)&&Be(r)?r.querySelector("table"):r}}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(t,n){const{rows:r,domRows:o}=n;for(let i=0;i<r;i++){const s=o[i];if(s!=null)for(let a=0;a<s.length;a++){const l=s[a];if(l==null)continue;const{elem:c}=l,u=mf(this,c);if(u!==null&&t.is(u))return{x:a,y:i}}}throw new Error("Cell not found in table.")}getDOMCellFromCords(t,n,r){const{domRows:o}=r,i=o[n];if(i==null)return null;const s=i[t<i.length?t:i.length-1];return s??null}getDOMCellFromCordsOrThrow(t,n,r){const o=this.getDOMCellFromCords(t,n,r);if(!o)throw new Error("Cell not found at cords.");return o}getCellNodeFromCords(t,n,r){const o=this.getDOMCellFromCords(t,n,r);if(o==null)return null;const i=Ut(o.elem);return ge(i)?i:null}getCellNodeFromCordsOrThrow(t,n,r){const o=this.getCellNodeFromCords(t,n,r);if(!o)throw new Error("Node at cords not TableCellNode.");return o}getRowStriping(){return!!this.getLatest().__rowStriping}setRowStriping(t){const n=this.getWritable();return n.__rowStriping=t,n}setFrozenColumns(t){const n=this.getWritable();return n.__frozenColumnCount=t,n}getFrozenColumns(){return this.getLatest().__frozenColumnCount}setFrozenRows(t){const n=this.getWritable();return n.__frozenRowCount=t,n}getFrozenRows(){return this.getLatest().__frozenRowCount}canSelectBefore(){return!0}canIndent(){return!1}getColumnCount(){const t=this.getFirstChild();if(!t)return 0;let n=0;return t.getChildren().forEach(r=>{ge(r)&&(n+=r.getColSpan())}),n}}function _P(e,t){const n=e.getElementByKey(t.getKey());return n===null&&fe(230),Ai(t,n)}function TP(e){const t=yc();e.hasAttribute("data-lexical-row-striping")&&t.setRowStriping(!0),e.hasAttribute("data-lexical-frozen-column")&&t.setFrozenColumns(1),e.hasAttribute("data-lexical-frozen-row")&&t.setFrozenRows(1);const n=e.querySelector(":scope > colgroup");if(n){let r=[];for(const o of n.querySelectorAll(":scope > col")){let i=o.style.width||"";if(!ng.test(i)&&(i=o.getAttribute("width")||"",!/^\d+$/.test(i))){r=void 0;break}r.push(parseFloat(i))}r&&t.setColWidths(r)}return{after:r=>aw(r,tt),node:t}}function yc(){return Et(new Pn)}function Ze(e){return e instanceof Pn}function EP(e){tt(e.getParent())?e.isEmpty()&&e.append(ve()):e.remove()}function RP(e){Ze(e.getParent())?iw(e,ge):e.remove()}function kP(e){iw(e,tt);const[t]=Fr(e,null,null),n=t.reduce((s,a)=>Math.max(s,a.length),0),r=e.getChildren();for(let s=0;s<t.length;++s){const a=r[s];if(!a)continue;tt(a)||fe(254,a.constructor.name,a.getType());const l=t[s].reduce((c,u)=>u?1+c:c,0);if(l!==n)for(let c=l;c<n;++c){const u=un();u.append(ve()),a.append(u)}}const o=e.getColWidths(),i=e.getColumnCount();if(o&&o.length!==i){let s;if(i<o.length)s=o.slice(0,i);else if(o.length>0){const a=o[o.length-1];s=[...o,...Array(i-o.length).fill(a)]}e.setColWidths(s)}}function AP(e){if(e.detail<3||!Cn(e.target))return!1;const t=Ut(e.target);if(t===null)return!1;const n=we(t,r=>B(r)&&!r.isInline());return n===null?!1:!!ge(n.getParent())&&(n.select(0),!0)}function NP(e){return e.registerNodeTransform(Mn,t=>{if(t.getColSpan()>1||t.getRowSpan()>1){const[,,n]=zn(t),[r]=an(n,t,t),o=r.length,i=r[0].length;let s=n.getFirstChild();tt(s)||fe(175);const a=[];for(let l=0;l<o;l++){l!==0&&(s=s.getNextSibling(),tt(s)||fe(175));let c=null;for(let u=0;u<i;u++){const f=r[l][u],d=f.cell;if(f.startRow===l&&f.startColumn===u)c=d,a.push(d);else if(d.getColSpan()>1||d.getRowSpan()>1){ge(d)||fe(176);const h=un(d.__headerState);c!==null?c.insertAfter(h):tN(s,h)}}}for(const l of a)l.setColSpan(1),l.setRowSpan(1)}})}function MP(e,t=!0){const n=new Map,r=(i,s,a)=>{const l=Do(i,a),c=xP(i,l,e,t);n.set(s,[c,l])},o=e.registerMutationListener(Pn,i=>{e.getEditorState().read(()=>{for(const[s,a]of i){const l=n.get(s);if(a==="created"||a==="updated"){const{tableNode:c,tableElement:u}=oC(s);l===void 0?r(c,s,u):u!==l[1]&&(l[0].removeListeners(),n.delete(s),r(c,s,u))}else a==="destroyed"&&l!==void 0&&(l[0].removeListeners(),n.delete(s))}},{editor:e})},{skipInitialization:!1});return()=>{o();for(const[,[i]]of n)i.removeListeners()}}function PP(e,t){e.hasNodes([Pn])||fe(255);const{hasNestedTables:n=uw(!1)}=t??{};return Nn(e.registerCommand(tC,r=>(function({rows:o,columns:i,includeHeaders:s},a){const l=X()||Zn();if(!l||!W(l)||!a&&Ni(l.anchor.getNode()))return!1;const c=iP(Number(o),Number(i),s);QA(c);const u=c.getFirstDescendant();return J(u)&&u.select(),!0})(r,n.peek()),be),e.registerCommand(mh,({nodes:r,selection:o},i)=>n.peek()||e!==i||!W(o)?!1:Ni(o.anchor.getNode())!==null&&r.some(Ze),be),e.registerCommand(Ql,AP,be),e.registerNodeTransform(Pn,kP),e.registerNodeTransform(Ur,RP),e.registerNodeTransform(Mn,EP))}function LP({hasCellMerge:e=!0,hasCellBackgroundColor:t=!0,hasTabHandler:n=!0,hasHorizontalScroll:r=!1,hasNestedTables:o=!1}){const[i]=lt();S.useEffect(()=>{Bl(i)!==r&&(SP(i,r),i.registerNodeTransform(Pn,()=>{})())},[i,r]);const s=S.useMemo(()=>uw(!1),[]);return s.peek()!==o&&(s.value=o),S.useEffect(()=>PP(i,{hasNestedTables:s}),[i,s]),S.useEffect(()=>MP(i,n),[i,n]),S.useEffect(()=>{if(!e)return NP(i)},[i,e]),S.useEffect(()=>{if(!t)return i.registerNodeTransform(Mn,a=>{a.getBackgroundColor()!==null&&a.setBackgroundColor(null)})},[i,t,e]),null}var xu,sv;function lC(){if(sv)return xu;sv=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return xu=e,xu}var bu,av;function FP(){if(av)return bu;av=1;var e=typeof Bn=="object"&&Bn&&Bn.Object===Object&&Bn;return bu=e,bu}var wu,lv;function cC(){if(lv)return wu;lv=1;var e=FP(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return wu=n,wu}var Cu,cv;function $P(){if(cv)return Cu;cv=1;var e=cC(),t=function(){return e.Date.now()};return Cu=t,Cu}var Su,uv;function OP(){if(uv)return Su;uv=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return Su=t,Su}var _u,dv;function IP(){if(dv)return _u;dv=1;var e=OP(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return _u=n,_u}var Tu,fv;function uC(){if(fv)return Tu;fv=1;var e=cC(),t=e.Symbol;return Tu=t,Tu}var Eu,hv;function DP(){if(hv)return Eu;hv=1;var e=uC(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,o=e?e.toStringTag:void 0;function i(s){var a=n.call(s,o),l=s[o];try{s[o]=void 0;var c=!0}catch{}var u=r.call(s);return c&&(a?s[o]=l:delete s[o]),u}return Eu=i,Eu}var Ru,gv;function jP(){if(gv)return Ru;gv=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return Ru=n,Ru}var ku,pv;function VP(){if(pv)return ku;pv=1;var e=uC(),t=DP(),n=jP(),r="[object Null]",o="[object Undefined]",i=e?e.toStringTag:void 0;function s(a){return a==null?a===void 0?o:r:i&&i in Object(a)?t(a):n(a)}return ku=s,ku}var Au,mv;function BP(){if(mv)return Au;mv=1;function e(t){return t!=null&&typeof t=="object"}return Au=e,Au}var Nu,yv;function zP(){if(yv)return Nu;yv=1;var e=VP(),t=BP(),n="[object Symbol]";function r(o){return typeof o=="symbol"||t(o)&&e(o)==n}return Nu=r,Nu}var Mu,vv;function HP(){if(vv)return Mu;vv=1;var e=IP(),t=lC(),n=zP(),r=NaN,o=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,s=/^0o[0-7]+$/i,a=parseInt;function l(c){if(typeof c=="number")return c;if(n(c))return r;if(t(c)){var u=typeof c.valueOf=="function"?c.valueOf():c;c=t(u)?u+"":u}if(typeof c!="string")return c===0?c:+c;c=e(c);var f=i.test(c);return f||s.test(c)?a(c.slice(2),f?2:8):o.test(c)?r:+c}return Mu=l,Mu}var Pu,xv;function WP(){if(xv)return Pu;xv=1;var e=lC(),t=$P(),n=HP(),r="Expected a function",o=Math.max,i=Math.min;function s(a,l,c){var u,f,d,h,g,p,m=0,v=!1,y=!1,x=!0;if(typeof a!="function")throw new TypeError(r);l=n(l)||0,e(c)&&(v=!!c.leading,y="maxWait"in c,d=y?o(n(c.maxWait)||0,l):d,x="trailing"in c?!!c.trailing:x);function b(j){var I=u,$=f;return u=f=void 0,m=j,h=a.apply($,I),h}function w(j){return m=j,g=setTimeout(R,l),v?b(j):h}function _(j){var I=j-p,$=j-m,H=l-I;return y?i(H,d-$):H}function E(j){var I=j-p,$=j-m;return p===void 0||I>=l||I<0||y&&$>=d}function R(){var j=t();if(E(j))return k(j);g=setTimeout(R,_(j))}function k(j){return g=void 0,x&&u?b(j):(u=f=void 0,h)}function M(){g!==void 0&&clearTimeout(g),m=0,u=p=f=g=void 0}function F(){return g===void 0?h:k(t())}function D(){var j=t(),I=E(j);if(u=arguments,f=this,p=j,I){if(g===void 0)return w(p);if(y)return clearTimeout(g),g=setTimeout(R,l),b(p)}return g===void 0&&(g=setTimeout(R,l)),h}return D.cancel=M,D.flush=F,D}return Pu=s,Pu}var KP=WP();const UP=Lf(KP),GP=e=>N.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M1.61342 8.47549C1.52262 8.33173 1.47723 8.25985 1.45182 8.14898C1.43273 8.06571 1.43273 7.93437 1.45182 7.8511C1.47723 7.74023 1.52262 7.66835 1.61341 7.52459C2.36369 6.3366 4.59693 3.33337 8.00027 3.33337C11.4036 3.33337 13.6369 6.3366 14.3871 7.52459C14.4779 7.66835 14.5233 7.74023 14.5487 7.8511C14.5678 7.93437 14.5678 8.06571 14.5487 8.14898C14.5233 8.25985 14.4779 8.33173 14.3871 8.47549C13.6369 9.66348 11.4036 12.6667 8.00027 12.6667C4.59693 12.6667 2.36369 9.66348 1.61342 8.47549Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),N.createElement("path",{d:"M8.00027 10C9.10484 10 10.0003 9.10461 10.0003 8.00004C10.0003 6.89547 9.10484 6.00004 8.00027 6.00004C6.8957 6.00004 6.00027 6.89547 6.00027 8.00004C6.00027 9.10461 6.8957 10 8.00027 10Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),dC=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M16 6V5.2C16 4.0799 16 3.51984 15.782 3.09202C15.5903 2.71569 15.2843 2.40973 14.908 2.21799C14.4802 2 13.9201 2 12.8 2H11.2C10.0799 2 9.51984 2 9.09202 2.21799C8.71569 2.40973 8.40973 2.71569 8.21799 3.09202C8 3.51984 8 4.0799 8 5.2V6M10 11.5V16.5M14 11.5V16.5M3 6H21M19 6V17.2C19 18.8802 19 19.7202 18.673 20.362C18.3854 20.9265 17.9265 21.3854 17.362 21.673C16.7202 22 15.8802 22 14.2 22H9.8C8.11984 22 7.27976 22 6.63803 21.673C6.07354 21.3854 5.6146 20.9265 5.32698 20.362C5 19.7202 5 18.8802 5 17.2V6",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}));function fC(e){return e instanceof jo}function hC(e){return new jo(e)}const{color:ji,cornerRadius:qP,spacing:YP,transition:XP}=V,ZP=T.css({display:"inline-flex",color:ji.text.accent,textDecoration:"underline",cursor:"pointer"}),JP=T.css({color:ji.text.accent,":hover":{color:ji.text.accentHover}}),QP=T.css({width:"16px",height:"16px",color:ji.icon.negative,cursor:"pointer",transition:XP.general,":hover":{color:ji.icon.negativeHover}}),e6=T.css({boxShadow:`0 2px 10px 4px ${ji.effect.shadowL}`,borderRadius:qP.md,padding:YP.sm});function t6({url:e,text:t,nodeKey:n}){const[r]=lt(),{isEditable:o}=ta(),i=S.useCallback(()=>{r.update(()=>{const s=Pe(n);fC(s)&&s.remove()})},[r,n]);return C.jsx(Or,{content:C.jsxs(q,{flex:!0,row:!0,center:!0,gap:"var(--spacing-xs)",children:[C.jsx("a",{className:JP,target:"_blank",href:e,children:e}),o&&C.jsx(dC,{className:QP,onClick:i})]}),placement:"right-start",trigger:"hover",contentClassName:e6,children:C.jsx(le,{className:ZP,children:t})})}const Lu="custom-link-node";class jo extends ia{_url;_text;constructor({url:t,text:n},r){super(r),this._url=t,this._text=n}getType(){return Lu}getData(){return{url:this._url,text:this._text}}isInline(){return!0}isIsolated(){return!1}createDOM(){const t=document.createElement("span");return t.style.display="inline",t}updateDOM(){return!1}decorate(){return C.jsx(t6,{...this.getData(),nodeKey:this.getKey()})}exportJSON(){return{...super.exportJSON(),format:"left",type:Lu,version:1,text:this._text,url:this._url}}static importJSON(t){return new jo({url:t.url,text:t.text})}static getType(){return Lu}static clone(t){return new jo({url:t._url,text:t._text},t.__key)}}const n6={type:"text-match",dependencies:[jo],regExp:/\[([^\]]+)]\(([^)]+)\)/,trigger:")",importRegExp:/\[([^\]]+)]\(([^)]+)\)/,replace:(e,t)=>{const[,n,r]=t,o=hC({url:r,text:n});e.replace(o)},export:e=>{if(!fC(e))return null;const{text:n,url:r}=e.getData();return!r||!n?"":`[${n}](${r})`}},bv="image-row",r6=T.css({width:"fit-content",display:"flex",alignItems:"center"});function gC(e){return e.length?new Gr(e):null}function pC(e){return e instanceof Gr}const{color:vf,cornerRadius:mC,spacing:o6,transition:i6}=V,s6=T.css({width:"100px",height:"100px",objectFit:"cover",borderRadius:mC.md}),a6=T.css({width:"20px",height:"20px",color:vf.icon.negative,cursor:"pointer",transition:i6.general,":hover":{color:vf.icon.negativeHover}}),l6=T.css({boxShadow:`0 2px 10px 4px ${vf.effect.shadowL}`,borderRadius:mC.xs,padding:o6.xs}),{spacing:c6}=V;function u6({images:e,nodeKey:t}){const[n]=lt(),{isEditable:r}=ta(),o=S.useCallback(()=>{n.update(()=>{const i=Pe(t);pC(i)&&i.remove()})},[n,t]);return C.jsx(Or,{open:r?void 0:!1,content:C.jsx(dC,{className:a6,onClick:o}),placement:"right-start",trigger:"hover",contentClassName:l6,children:C.jsx(q,{w:"full",flex:!0,row:!0,gap:c6.sm,alignItems:"center",children:e.map(({src:i,alt:s})=>C.jsx("img",{src:i,alt:s??"",className:s6},i))})})}class Gr extends ia{images;constructor(t,n){super(n),this.images=t}createDOM(){const t=document.createElement("div");return t.className=r6,t.contentEditable="false",t}updateDOM(){return!1}decorate(){return C.jsx(u6,{images:this.images,nodeKey:this.getKey()})}exportJSON(){return{...super.exportJSON(),format:"left",type:bv,version:1,images:this.images}}static importJSON(t){return new Gr(t.images)}isInline(){return!1}isIsolated(){return!0}isSelectable(){return!0}static getType(){return bv}static clone(t){return new Gr(t.images,t.__key)}}const d6={type:"element",dependencies:[Gr],regExp:/^!\[[^\]]*]\([^)]+\)(?:\s+!\[[^\]]*]\([^)]+\))*$/,replace:(e,t,n)=>{const[r]=n,i=[...r.matchAll(/!\[([^\]]*)]\(([^)]+)\)/g)].map(([a,l,c])=>({alt:l,src:c})),s=gC(i);s&&Rh([s])},export:e=>{if(!(e instanceof Gr))return null;const n=e.images;return n.length?n.map(({src:r,alt:o})=>`![${o}](${r})`).join(" "):""}},f6=e=>N.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("g",null,N.createElement("path",{d:"M8.00008 8.66634C8.36827 8.66634 8.66675 8.36786 8.66675 7.99967C8.66675 7.63148 8.36827 7.33301 8.00008 7.33301C7.63189 7.33301 7.33341 7.63148 7.33341 7.99967C7.33341 8.36786 7.63189 8.66634 8.00008 8.66634Z",fill:"currentColor"}),N.createElement("path",{d:"M12.6667 8.66634C13.0349 8.66634 13.3334 8.36786 13.3334 7.99967C13.3334 7.63148 13.0349 7.33301 12.6667 7.33301C12.2986 7.33301 12.0001 7.63148 12.0001 7.99967C12.0001 8.36786 12.2986 8.66634 12.6667 8.66634Z",fill:"currentColor"}),N.createElement("path",{d:"M3.33341 8.66634C3.7016 8.66634 4.00008 8.36786 4.00008 7.99967C4.00008 7.63148 3.7016 7.33301 3.33341 7.33301C2.96522 7.33301 2.66675 7.63148 2.66675 7.99967C2.66675 8.36786 2.96522 8.66634 3.33341 8.66634Z",fill:"currentColor"}),N.createElement("path",{d:"M8.00008 8.66634C8.36827 8.66634 8.66675 8.36786 8.66675 7.99967C8.66675 7.63148 8.36827 7.33301 8.00008 7.33301C7.63189 7.33301 7.33341 7.63148 7.33341 7.99967C7.33341 8.36786 7.63189 8.66634 8.00008 8.66634Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),N.createElement("path",{d:"M12.6667 8.66634C13.0349 8.66634 13.3334 8.36786 13.3334 7.99967C13.3334 7.63148 13.0349 7.33301 12.6667 7.33301C12.2986 7.33301 12.0001 7.63148 12.0001 7.99967C12.0001 8.36786 12.2986 8.66634 12.6667 8.66634Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),N.createElement("path",{d:"M3.33341 8.66634C3.7016 8.66634 4.00008 8.36786 4.00008 7.99967C4.00008 7.63148 3.7016 7.33301 3.33341 7.33301C2.96522 7.33301 2.66675 7.63148 2.66675 7.99967C2.66675 8.36786 2.96522 8.66634 3.33341 8.66634Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),N.createElement("defs",null)),{color:wv}=V,h6=T.css({cursor:"pointer"}),g6=T.css({":hover":{backgroundColor:wv.fill.bgSecondary},":active":{backgroundColor:wv.fill.bgSecondary}}),{color:Cv,spacing:Sv}=V;function p6({groups:e,toolbarVisibleActionsCount:t,onAction:n,disabled:r}){const[o,i]=S.useState(!1),s=S.useCallback(c=>()=>{r||(c&&c(),i(!1))},[r]),a=S.useCallback(({IconComponent:c,...u},f)=>C.jsxs(q,{className:T.cx(h6,!r&&g6),p:Sv.sm,alignItems:"center",flex:!0,row:!0,gap:Sv.xs,onClick:s(()=>n(u.id,f)),children:[C.jsx(c,{width:20,height:20,color:Cv.icon.tertiary}),C.jsx(le,{variant:"body-2",children:u.label})]},u.id),[r,n,s]),l=S.useMemo(()=>e.map((c,u)=>{const f=u===e.length-1;if(!c.length)return null;const d=c.map((h,g)=>{const m=(u?e.slice(0,u).flat().length:0)+g+t;return a(h,m)});return C.jsxs(S.Fragment,{children:[d,f?null:C.jsx(q,{w:"full",h:1,backgroundColor:Cv.border.neutralAlphaBasic})]},c.flatMap(h=>h.id).join("-"))}),[e,a,t]);return C.jsx(Or,{content:C.jsx(q,{flex:!0,children:l}),placement:"bottom",open:o,onChange:i,children:C.jsx(pr,{size:"xs",color:"no-bg",disabled:r,children:C.jsx(f6,{})})})}const m6=T.css({minWidth:"fit-content"}),y6=e=>{throw new Error("defaultOnImagesUpload function must be overridden")},{spacing:_v}=V;function Tv({onSave:e}){const[t,n]=S.useState(""),[r,o]=S.useState(""),[i,s]=S.useState(null),a=na(),{textPlaceholder:l,linkPlaceholder:c,linkErrorText:u,buttonText:f}=a.toolbar.link,d=S.useMemo(()=>i==="link"?u:null,[i,u]),h=S.useCallback(x=>{try{const b=new URL(x);if(!(b.protocol==="http:"||b.protocol==="https:"))throw new Error("Invalid protocol");return s(null),!0}catch{return s("link"),!1}},[]),g=S.useCallback(x=>{n(x.target.value)},[]),p=S.useCallback(x=>{h(x.target.value),o(x.target.value)},[h]),m=S.useCallback(()=>[()=>h(r)].map(w=>w()).every(Boolean),[r,h]),v=S.useCallback(()=>{n(""),o(""),s(null)},[]),y=S.useCallback(x=>{x.preventDefault(),m()&&(e({text:t||r,url:r}),v())},[r,e,t,m,v]);return S.useEffect(()=>()=>{v()},[]),C.jsx("form",{onSubmit:y,children:C.jsxs(q,{flex:!0,alignItems:"flex-start",p:_v.sm,gap:_v.sm,children:[C.jsx(q,{children:C.jsx(Fi,{placeholder:l,size:"sm",value:t,onChange:g})}),C.jsx(q,{children:C.jsx(Fi,{placeholder:c,size:"sm",value:r,onChange:p,error:!!d,errorText:d||""})}),C.jsx(Br,{size:"xs",width:"auto",type:"submit",children:f})]})})}const Ev=50,Rv=20,kv=1,Av=1;function Nv({onSave:e}){const[t,n]=S.useState(""),[r,o]=S.useState(""),[i,s]=S.useState(null),[a,l]=S.useState(null),c=na(),{maxRowsErrorText:u,maxColumnsErrorText:f,minRowsErrorText:d,minColumnsErrorText:h,rowsPlaceholder:g,columnsPlaceholder:p,buttonText:m}=c.toolbar.table,v=S.useMemo(()=>{switch(i){case"rows-max":return u({current:Number(t),limit:Ev});case"rows-min":return d({current:Number(t),limit:kv});default:return null}},[i,t,u,d]),y=S.useMemo(()=>{switch(a){case"columns-max":return f({current:Number(r),limit:Rv});case"columns-min":return h({current:Number(r),limit:Av});default:return null}},[a,r,f,h]),x=S.useCallback(F=>{try{const D=Number(F);if(D>Ev)throw s("rows-max"),new Error("Rows amount exceeds maximum");if(D<kv)throw s("rows-min"),new Error("Rows amount below minimum");return s(null),!0}catch{return!1}},[]),b=S.useCallback(F=>{try{const D=Number(F);if(D>Rv)throw l("columns-max"),new Error("Columns amount exceeds maximum");if(D<Av)throw l("columns-min"),new Error("Columns amount below minimum");return l(null),!0}catch{return!1}},[]),w=S.useCallback(F=>{const D=Number(F);return!Number.isNaN(D)&&Number.isInteger(D)?D:null},[]),_=S.useCallback(F=>{const D=F.target.value,j=w(D);typeof j=="number"&&(x(D),n(String(j)))},[x,w]),E=S.useCallback(F=>{const D=F.target.value,j=w(D);typeof j=="number"&&(b(D),o(String(j)))},[b,w]),R=S.useCallback(()=>[()=>x(t),()=>b(r)].map(j=>j()).every(Boolean),[r,t,b,x]),k=S.useCallback(()=>{n(""),o(""),s(null),l(null)},[]),M=S.useCallback(F=>{F.preventDefault(),R()&&(e({rows:t,columns:r}),k())},[r,e,t,R,k]);return S.useEffect(()=>()=>{k()},[]),C.jsx("form",{onSubmit:M,children:C.jsxs(q,{flex:!0,alignItems:"flex-start",p:"var(--spacing-sm)",gap:"var(--spacing-sm)",children:[C.jsx(q,{children:C.jsx(Fi,{placeholder:g,size:"sm",value:t,onChange:_,error:!!v,errorText:v||""})}),C.jsx(q,{children:C.jsx(Fi,{placeholder:p,size:"sm",value:r,onChange:E,error:!!y,errorText:y||""})}),C.jsx(Br,{size:"xs",width:"auto",type:"submit",children:m})]})})}function v6({disabled:e=!1}){const[t,n]=S.useState(null),[r]=lt(),o=na(),i=S.useMemo(()=>{const l=o.toolbar.textSize;return[{value:"paragraph",label:l.paragraph,textProps:{variant:"body-2"}},{value:"h1",label:l.h1,textProps:{fontWeight:"semibold",variant:"headline-1"}},{value:"h2",label:l.h2,textProps:{fontWeight:"semibold",variant:"headline-2"}},{value:"h3",label:l.h3,textProps:{fontWeight:"semibold",variant:"headline-3"}}]},[o.toolbar.textSize]),s=S.useCallback(l=>{!l||Array.isArray(l)||r.update(()=>{const c=X();if(!W(c))return;const u=c.anchor.getNode().getTopLevelElement();if(!u)return;const f=l==="paragraph"?ve():wo(l);u.getChildren().forEach(d=>{f.append(d)}),u.replace(f),f.selectEnd()})},[r]),a=S.useCallback(()=>{const l=X();if(!W(l))return null;const c=l.anchor.getNode().getTopLevelElement();return Pw(c)?c.getTag():"paragraph"},[]);return S.useEffect(()=>{const l=r.registerUpdateListener(({editorState:c})=>{c.read(()=>{const u=a();u&&n(u)})});return()=>{l()}},[r,a]),C.jsx(Cg,{size:"xs",items:i,renderDropdownItem:l=>C.jsx(le,{whiteSpace:"nowrap",...l.textProps,children:l.label}),returnedValue:l=>l.value,renderSingleInputItem:l=>l.label,onChange:s,disabled:e,value:t,showDefaultItem:!1})}const{color:hs,cornerRadius:x6,spacing:Fu}=V;function b6({onImagesUpload:e=y6,className:t}){const[n,r]=S.useState(11),[o,i]=S.useState(null),[s,a]=S.useState(null),l=S.useRef(null),{toolbar:c}=na(),u=c.preview,[f]=lt(),{isEditable:d,isPreviewMode:h,setPreviewMode:g}=ta(),{availableActionGroups:p}=rN(),m=S.useRef(null),v=S.useMemo(()=>!d||h,[d,h]),y=S.useMemo(()=>h?u.hide:u.show,[h,u]),{toolbarGroups:x,menuGroups:b}=S.useMemo(()=>{const $=[],H=[];let O=0;for(const P of p){const K=[],G=[];for(const re of P)O+=1,O<=n?K.push(re):G.push(re);K.length&&$.push(K),G.length&&H.push(G)}return{toolbarGroups:$,menuGroups:H}},[p,n]),w=S.useMemo(()=>typeof o=="number"&&o>n-1,[o,n]),_=S.useMemo(()=>typeof s=="number"&&s>n-1,[s,n]),E=S.useCallback($=>{const{text:H,url:O}=$;f.update(()=>{const P=X();if(W(P)){const K=hC({text:H,url:O});P.insertNodes([K]);const G=Fe(" ");K.insertAfter(G),G.select()}}),i(null)},[f]),R=S.useCallback($=>{const{rows:H,columns:O}=$;f.dispatchCommand(tC,{rows:H,columns:O}),a(null)},[f]),k=S.useCallback(()=>{m.current&&m.current.click()},[]),M=S.useCallback(async $=>{try{const H=Array.from($.target.files||[]);if(!H.length)return;const O=await e(H);f.update(()=>{const P=gC(O);P&&Rh([P])})}catch(H){console.error("Error uploading images:",H)}finally{$.target.value=""}},[f,e]),F=S.useCallback(($,H)=>{({[ae.BOLD]:()=>{f.dispatchCommand(Vt,"bold")},[ae.ITALIC]:()=>{f.dispatchCommand(Vt,"italic")},[ae.UNDERLINE]:()=>{f.dispatchCommand(Vt,"underline")},[ae.STRIKETHROUGH]:()=>{f.dispatchCommand(Vt,"strikethrough")},[ae.ALIGN_LEFT]:()=>{f.dispatchCommand(_i,"left")},[ae.ALIGN_CENTER]:()=>{f.dispatchCommand(_i,"center")},[ae.ALIGN_RIGHT]:()=>{f.dispatchCommand(_i,"right")},[ae.LINK]:()=>{i(H)},[ae.IMAGE]:()=>{k()},[ae.TABLE]:()=>{a(H)},[ae.BULLET_LIST]:()=>{f.dispatchCommand(Cw,void 0)},[ae.NUMBERED_LIST]:()=>{f.dispatchCommand(Sw,void 0)}})[$]()},[k,f]),D=S.useMemo(()=>x.map(($,H)=>{const O=x.slice(0,H).reduce((G,re)=>G+re.length,0);if(!$.length)return null;const P=$.map(({IconComponent:G,isActive:re,id:U},Z)=>{const Q=O+Z,ne=re?"neutral":"no-bg";return U===ae.LINK?C.jsx(Or,{content:C.jsx(Tv,{onSave:E}),placement:"bottom",open:o===Q,onChange:oe=>{i(oe?Q:null)},children:C.jsx(pr,{size:"xs",color:"no-bg",disabled:v,children:C.jsx(G,{})})},U):U===ae.TABLE?C.jsx(Or,{content:C.jsx(Nv,{onSave:R}),placement:"bottom",open:s===Q,onChange:oe=>{a(oe?Q:null)},children:C.jsx(pr,{size:"xs",color:ne,disabled:v,children:C.jsx(G,{})})},U):C.jsx(pr,{size:"xs",color:ne,onClick:()=>F(U,Q),disabled:v,children:C.jsx(G,{})},U)});return P.every(G=>!G)?null:C.jsxs(S.Fragment,{children:[P,C.jsx(q,{w:1,h:32,backgroundColor:hs.border.neutralAlphaBasic})]},$.flatMap(G=>G.id).join("-"))}),[x,F,o,v,s,E,R]),j=S.useCallback(()=>{const $=l.current;if(!$)return;const H=$.clientWidth,O=40,P=4,K=1,G=P+K+P+O+P;let re=H-G,U=0;for(const Z of p)if(Z.length){for(const Q of Z){const ne=O+P;if(re-ne>=0)re-=ne,U+=1;else break}re-=K+P}r(U)},[p]),I=S.useMemo(()=>UP(j,20,{}),[j]);return S.useEffect(()=>{if(!l.current)return;const $=new ResizeObserver(()=>{I()});return $.observe(l.current),()=>$.disconnect()},[I]),C.jsxs(q,{backgroundColor:hs.fill.neutralPrimary,border:`1px solid ${hs.border.neutralAlphaBasic}`,borderRadius:x6.md,flex:!0,row:!0,alignItems:"center",justifyContent:"space-between",p:Fu.sm,className:t,children:[C.jsxs(q,{flex:!0,flexGrow:1,row:!0,alignItems:"center",overflow:"hidden",children:[C.jsx("input",{ref:m,type:"file",accept:"image/*",hidden:!0,multiple:!0,onChange:M,disabled:v}),C.jsx(v6,{disabled:v}),C.jsx(Or,{content:C.jsx(Tv,{onSave:E}),placement:"bottom",open:w,onChange:$=>{$||i(null)},children:C.jsx("div",{})}),C.jsx(Or,{content:C.jsx(Nv,{onSave:R}),placement:"bottom",open:_,onChange:$=>{$||a(null)},children:C.jsx("div",{})}),C.jsxs(q,{flex:!0,row:!0,alignItems:"center",gap:Fu.xs,w:"full",ml:Fu.xs,overflow:"hidden",ref:l,children:[D,b.length?C.jsx(p6,{disabled:v,onAction:F,groups:b,toolbarVisibleActionsCount:n}):null]})]}),C.jsx(Br,{width:"auto",size:"xs",color:h?"accent":"neutral",intensity:"secondary",wrapperClassName:m6,onClick:()=>{g($=>!$)},iconLeft:C.jsx(GP,{color:h?hs.icon.accent:hs.icon.secondary}),children:y})]})}const yC=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?S.useLayoutEffect:S.useEffect;function w6({editor:e,ariaActiveDescendant:t,ariaAutoComplete:n,ariaControls:r,ariaDescribedBy:o,ariaErrorMessage:i,ariaExpanded:s,ariaInvalid:a,ariaLabel:l,ariaLabelledBy:c,ariaMultiline:u,ariaOwns:f,ariaRequired:d,autoCapitalize:h,className:g,id:p,role:m="textbox",spellCheck:v=!0,style:y,tabIndex:x,"data-testid":b,...w},_){const[E,R]=S.useState(e.isEditable()),k=S.useCallback(F=>{F&&F.ownerDocument&&F.ownerDocument.defaultView?e.setRootElement(F):e.setRootElement(null)},[e]),M=S.useMemo(()=>(function(...F){return D=>{for(const j of F)typeof j=="function"?j(D):j!=null&&(j.current=D)}})(_,k),[k,_]);return yC(()=>(R(e.isEditable()),e.registerEditableListener(F=>{R(F)})),[e]),C.jsx("div",{"aria-activedescendant":E?t:void 0,"aria-autocomplete":E?n:"none","aria-controls":E?r:void 0,"aria-describedby":o,...i!=null?{"aria-errormessage":i}:{},"aria-expanded":E&&m==="combobox"?!!s:void 0,...a!=null?{"aria-invalid":a}:{},"aria-label":l,"aria-labelledby":c,"aria-multiline":u,"aria-owns":E?f:void 0,"aria-readonly":!E||void 0,"aria-required":d,autoCapitalize:h,className:g,contentEditable:E,"data-testid":b,id:p,ref:M,role:m,spellCheck:v,style:y,tabIndex:x,...w})}const C6=S.forwardRef(w6);function Mv(e){return e.getEditorState().read(Xw(e.isComposing()))}const vC=S.forwardRef(S6);function S6(e,t){const{placeholder:n,...r}=e,[o]=lt();return C.jsxs(C.Fragment,{children:[C.jsx(C6,{editor:o,...r,ref:t}),n!=null&&C.jsx(_6,{editor:o,content:n})]})}function _6({content:e,editor:t}){const n=(function(s){const[a,l]=S.useState(()=>Mv(s));return yC(()=>{function c(){const u=Mv(s);l(u)}return c(),Nn(s.registerUpdateListener(()=>{c()}),s.registerEditableListener(()=>{c()}))},[s]),a})(t),[r,o]=S.useState(t.isEditable());if(S.useLayoutEffect(()=>(o(t.isEditable()),t.registerEditableListener(s=>{o(s)})),[t]),!n)return null;let i=null;return typeof e=="function"?i=e(r):e!==null&&(i=e),i===null?null:C.jsx("div",{"aria-hidden":!0,children:i})}const T6=S.createContext(null),$u={didCatch:!1,error:null};class E6 extends S.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=$u}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(...t){const{error:n}=this.state;n!==null&&(this.props.onReset?.({args:t,reason:"imperative-api"}),this.setState($u))}componentDidCatch(t,n){this.props.onError?.(t,n)}componentDidUpdate(t,n){const{didCatch:r}=this.state,{resetKeys:o}=this.props;r&&n.error!==null&&R6(t.resetKeys,o)&&(this.props.onReset?.({next:o,prev:t.resetKeys,reason:"keys"}),this.setState($u))}render(){const{children:t,fallbackRender:n,FallbackComponent:r,fallback:o}=this.props,{didCatch:i,error:s}=this.state;let a=t;if(i){const l={error:s,resetErrorBoundary:this.resetErrorBoundary};if(typeof n=="function")a=n(l);else if(r)a=S.createElement(r,l);else if(o!==void 0)a=o;else throw s}return S.createElement(T6.Provider,{value:{didCatch:i,error:s,resetErrorBoundary:this.resetErrorBoundary}},a)}}function R6(e=[],t=[]){return e.length!==t.length||e.some((n,r)=>!Object.is(n,t[r]))}function xC({children:e,onError:t}){return C.jsx(E6,{fallback:C.jsx("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:t,children:e})}const k6=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?S.useLayoutEffect:S.useEffect;function A6(e){return{initialValueFn:()=>e.isEditable(),subscribe:t=>e.registerEditableListener(t)}}function N6(){return(function(e){const[t]=lt(),n=S.useMemo(()=>e(t),[t,e]),[r,o]=S.useState(()=>n.initialValueFn()),i=S.useRef(r);return k6(()=>{const{initialValueFn:s,subscribe:a}=n,l=s();return i.current!==l&&(i.current=l,o(l)),a(c=>{i.current=c,o(c)})},[n,e]),r})(A6)}const M6={name:"@lexical/react/ReactProvider"};function P6(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const sg=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?S.useLayoutEffect:S.useEffect;function L6({editor:e,ErrorBoundary:t}){return(function(n,r){const[o,i]=S.useState(()=>n.getDecorators());return sg(()=>n.registerDecoratorListener(s=>{$s.flushSync(()=>{i(s)})}),[n]),S.useEffect(()=>{i(n.getDecorators())},[n]),S.useMemo(()=>{const s=[],a=Object.keys(o);for(let l=0;l<a.length;l++){const c=a[l],u=C.jsx(r,{onError:d=>n._onError(d),children:C.jsx(S.Suspense,{fallback:null,children:o[c]})}),f=n.getElementByKey(c);f!==null&&s.push($s.createPortal(u,f,c))}return s},[r,o,n])})(e,t)}function F6({editor:e,ErrorBoundary:t}){return(function(n){const r=gN.maybeFromEditor(n);if(r&&r.hasExtensionByName(M6.name)){for(const o of["@lexical/plain-text","@lexical/rich-text"])r.hasExtensionByName(o)&&P6(320,o);return!0}return!1})(e)?null:C.jsx(L6,{editor:e,ErrorBoundary:t})}function Pv(e){return e.getEditorState().read(Xw(e.isComposing()))}function bC({contentEditable:e,placeholder:t=null,ErrorBoundary:n}){const[r]=lt();return(function(o){sg(()=>Nn(WN(o),ON(o)),[o])})(r),C.jsxs(C.Fragment,{children:[e,C.jsx($6,{content:t}),C.jsx(F6,{editor:r,ErrorBoundary:n})]})}function $6({content:e}){const[t]=lt(),n=(function(o){const[i,s]=S.useState(()=>Pv(o));return sg(()=>{function a(){const l=Pv(o);s(l)}return a(),Nn(o.registerUpdateListener(()=>{a()}),o.registerEditableListener(()=>{a()}))},[o]),i})(t),r=N6();return n?typeof e=="function"?e(r):e:null}const O6=T.css({width:"100%"}),I6=T.css({pointerEvents:"none"});function D6(e){const{placeholder:t,className:n}=e||{},r=S.useRef(null),{alignment:o}=cw(),i=S.useCallback(a=>{if(!t)return null;const l=typeof t=="string"||typeof t=="object"&&t.hasWrapper,c=typeof t=="string"?t:t.renderContent(a);return l?C.jsx(le,{variant:"body-2",colorName:"tertiary",children:c}):C.jsx(C.Fragment,{children:c})},[t]),s=S.useCallback(a=>{const l=i(a);if(!l)return null;const c={left:"flex-start",center:"center",right:"flex-end"};return C.jsx(q,{absolute:!0,w:"full",top:0,left:0,alignItems:c[o],className:I6,children:l})},[i,o]);return C.jsx(q,{relative:!0,row:!0,w:"full",flexGrow:1,className:n,children:C.jsx(bC,{contentEditable:C.jsx(vC,{ref:r,className:O6,"aria-placeholder":"markdown editor",placeholder:s}),ErrorBoundary:xC})})}const{color:j6,spacing:V6}=V,B6=T.css({counterReset:"line"}),z6=T.css({display:"grid",gridTemplateColumns:"3ch 1fr",columnGap:V6.sm,whiteSpace:"pre-wrap",":before":{counterIncrement:"line",content:"counter(line)",color:j6.text.accent,userSelect:"none",textAlign:"right"}});function H6({className:e,lineClassName:t}={}){const{markdownText:n}=ta(),r=n.split(`
65
- `);return C.jsx("pre",{className:T.cx(B6,e),children:r.map((o,i)=>C.jsx(le,{tag:"span",className:T.cx(z6,t),children:o||" "},i))})}const ri={text:T.css({fontFamily:"Inter, sans-serif"}),paragraph:T.css({...ye.body2}),h1:T.css({...ye.headline1}),h2:T.css({...ye.headline2}),h3:T.css({...ye.headline3}),h4:T.css({...ye.body2})},{color:ag,spacing:Lv}=V,W6=T.css({borderSpacing:"0",borderCollapse:"separate"}),K6=T.css({border:`1px solid ${ag.border.neutralPrimary}`,padding:`${Lv.sm} ${Lv.sm}`}),U6=T.css({color:ag.text.accent}),G6=T.css({fontWeight:"bold"}),q6=T.css({textDecoration:"underline"}),Y6=T.css({textDecoration:"line-through"}),X6=T.css({textDecoration:"underline line-through"}),Z6=T.css({fontStyle:"italic"}),J6=T.css({color:ag.text.accent,textDecoration:"underline"}),Q6={table:W6,tableCell:K6,hashtag:U6,link:J6,text:{base:ri.text,bold:G6,underline:q6,strikethrough:Y6,underlineStrikethrough:X6,italic:Z6},heading:{h1:ri.h1,h2:ri.h2,h3:ri.h3,h4:ri.h4},paragraph:ri.paragraph};function wC(){return{namespace:"ui-kit-markdown-text-editor",nodes:[Wo,fn,Uo,eo,Pn,Mn,Ur,Gr,jo,pc,hc,fc,gc,da,fa],onError(e){throw e},theme:Q6}}const eL=[[ae.BOLD,ae.ITALIC,ae.UNDERLINE,ae.STRIKETHROUGH],[ae.LINK,ae.IMAGE],[ae.ALIGN_LEFT,ae.ALIGN_CENTER,ae.ALIGN_RIGHT],[ae.TABLE],[ae.BULLET_LIST,ae.NUMBERED_LIST]];function tL(){const[e]=lt(),{isEditable:t}=ta();return S.useEffect(()=>{e.setEditable(t)},[e,t]),null}function nL(){const[e]=lt();return S.useEffect(()=>{const t=e.registerCommand(ec,()=>{const n=X();if(!W(n)||!n.isCollapsed()||n.anchor.offset!==0)return!1;const o=n.anchor.getNode().getTopLevelElement();if(!o||o.getType()!=="paragraph"||o.getTextContent()!=="")return!1;const i=o.getPreviousSibling();return pC(i)?(i.remove(),o.select(),!0):!1},Dt);return()=>{t()}},[e]),null}const rL=/^\|(.+)\|$/,oL=/^\|\s*:?-+:?\s*(\|\s*:?-+:?\s*)+\|$/,iL=/^\|(.+)\|$/,sL={type:"multiline-element",dependencies:[Pn,Ur,Mn],regExpStart:rL,handleImportAfterStartMatch({lines:e,rootNode:t,startLineIndex:n}){const r=e[n+1];if(!oL.test(r??""))return null;const o=yc();let i=n;for(;i<e.length&&iL.test(e[i]);){if(i===n+1){i++;continue}const s=Di(),a=e[i].slice(1,-1).split("|").map(c=>c.trim()),l=i===n;a.forEach(c=>{const u=un(l?st.ROW:void 0);u.append(Fe(c)),s.append(u)}),o.append(s),i++}return t.append(o),[!0,i-1]},replace(){return!0},export(e){if(!(e instanceof Pn))return null;const n=e.getChildren();if(!n.length)return"";const r=[];return n.forEach((o,i)=>{if(!(o instanceof Ur))return;const a=o.getChildren().map(l=>l instanceof Mn?l.getTextContent().replace(/\n/g," ").trim():"");r.push(`| ${a.join(" | ")} |`),i||r.push(`| ${a.map(()=>"---").join(" | ")} |`)}),r.join(`
66
- `)}},zl=[sL,d6,n6,...ha];function aL({defaultValue:e}){const[t]=lt();return S.useEffect(()=>{t.update(()=>{e&&Gw(e,zl)})},[t]),null}const{color:Ou,cornerRadius:Fv,spacing:Ha}=V;function lL({label:e,plugins:t,field:n,disabled:r=!1,locale:o,toolbar:i,defaultMarkdown:s,events:a={},className:l,labelClassName:c,toolbarClassName:u,editorClassName:f,fieldClassName:d,previewClassName:h}){const[g,p]=S.useState(""),[m,v]=S.useState(!1),{availableActions:y,onImagesUpload:x}=i||{},b=S.useMemo(()=>wC(),[]),w=S.useMemo(()=>({isEditable:!r,isPreviewMode:m,setPreviewMode:v,markdownText:g}),[r,m,g]),_=S.useMemo(()=>({availableActions:y||eL}),[y]),E=S.useCallback(k=>{p(k),a.onMarkdownChange&&a.onMarkdownChange(k)},[a]),R=S.useCallback(k=>{k.read(()=>{const M=IM(zl);E(M),a.onEditorStateChange&&a.onEditorStateChange(k)})},[E,a]);return C.jsx(l3,{locale:o,children:C.jsx(Yw,{initialConfig:b,children:C.jsx(gh.Provider,{value:w,children:C.jsxs(Eb.Provider,{value:_,children:[C.jsxs(q,{flex:!0,w:"full",borderRadius:Fv.lg,p:Ha.lg,gap:Ha.sm,backgroundColor:Ou.fill.neutralSecondary,className:l,children:[e?C.jsx(le,{variant:"headline-3",fontWeight:"semibold",className:c,children:e}):null,C.jsx(b6,{onImagesUpload:x,className:u}),C.jsx(q,{backgroundColor:Ou.fill.neutralPrimary,border:`1px solid ${Ou.border.neutralAlphaBasic}`,borderRadius:Fv.md,p:`${Ha.md} ${Ha.lg}`,w:"full",h:144,overflow:"auto",className:f,children:m?C.jsx(H6,{className:h}):C.jsx(D6,{...n,className:d})})]}),C.jsx(DM,{}),C.jsx(YM,{}),C.jsx(LP,{}),C.jsx(qM,{}),C.jsx(eP,{transformers:zl}),C.jsx(nP,{onChange:R}),C.jsx(tL,{}),C.jsx(aL,{defaultValue:s}),C.jsx(nL,{}),t]})})})})}const{color:vn}=V,oi={input:T.css({...ye.common,...ye.body1,width:48,height:48,textAlign:"center",borderRadius:12,border:`1px solid ${vn.border.neutralAlphaBasic}`,color:vn.text.primary,outline:"none",transition:"border-color 0.5s ease, background-color 0.5s ease, box-shadow 0.5s ease","&::placeholder":{color:vn.text.tertiary},"&:focus-visible":{borderColor:vn.border.accentPrimary,boxShadow:`0 0 0 1px ${vn.border.accentPrimary}`},"&:not(.disabled):hover":{backgroundColor:vn.fill.neutralPrimaryHover},"&:disabled":{opacity:.6,cursor:"not-allowed"}}),error:T.css({borderColor:vn.border.negativePrimary}),success:T.css({borderColor:vn.border.positivePrimary}),disabled:T.css({pointerEvents:"none",opacity:.5}),white:T.css({background:vn.fill.bgPrimary}),gray:T.css({background:vn.fill.bgSecondary}),glow:T.css({position:"absolute",inset:0,borderRadius:12,pointerEvents:"none",opacity:0,transformOrigin:"center",background:vn.fill.accentPrimary})};function cL(e){const t=S.useRef(void 0);return S.useEffect(()=>{t.current=e},[e]),t.current}const{spacing:$v}=V,CC=S.forwardRef(({length:e=6,label:t,prompt:n,error:r,errorText:o,success:i,disabled:s,autoFocus:a,center:l,secure:c,loading:u,background:f="gray",numeric:d=!0,className:h,inputsContainerClassName:g,inputClassName:p,labelClassName:m,promptClassName:v,errorClassName:y,value:x,defaultValue:b,onChange:w,onComplete:_},E)=>{const R=typeof x=="string",k=R?x:b,M=typeof k=="string"?k.slice(0,e):"",[F,D]=Bo(R?x:void 0,M),[j,I]=S.useState(()=>{const U=M.slice(0,e);return Array.from({length:e},(Z,Q)=>U[Q]??"")}),$=S.useRef(void 0),H=cL(x),O=S.useRef([]);S.useEffect(()=>{if(!R)return;const U=x??"";if(U===H)return;if(U===$.current){$.current=void 0;return}const Z=U.slice(0,e);I(Array.from({length:e},(Q,ne)=>Z[ne]??""))},[R,x,e,H]);const P=S.useCallback((U,Z)=>{const Q=U.slice(0,e);Z?.fromInternal&&($.current=Q),D(Q),w?.(Q),Q.length===e&&_?.(Q)},[e,w,_,D]);S.useImperativeHandle(E,()=>({focus:()=>{O.current[0]?.focus()},blur:()=>{O.current.forEach(U=>U?.blur())},get value(){return F||""},setValue:U=>{const Z=U.slice(0,e);I(Array.from({length:e},(Q,ne)=>Z[ne]??"")),P(Z,{fromInternal:!0})},clear:()=>{I(Array.from({length:e},()=>"")),P("",{fromInternal:!0})}}),[e,P,F]);const K=S.useCallback((U,Z)=>{if(s)return;let Q=Z;if(d&&(Q=Q.replace(/\D/g,"")),Q.length>1){const ee=j.slice(0,U).join("")+Q+j.slice(U+1).join(""),xe=Array.from({length:e},(ze,je)=>ee[je]??"");I(xe),P(ee,{fromInternal:!0});const Se=Math.min(U+Q.length,e-1),Ee=O.current[Se];Ee?.focus(),Ee?.select();return}const ne=j[U],oe=[...j];oe[U]=Q,I(oe);const me=oe.join("");if(P(me,{fromInternal:!0}),!ne&&Q&&U<e-1){const ee=O.current[U+1];ee?.focus(),ee?.select()}},[j,s,e,d,P]),G=S.useCallback((U,Z)=>{if(!s){if(Z.key==="Backspace"){Z.preventDefault();const Q=O.current[U];if(j[U]){const ne=[...j];ne[U]="",I(ne),P(ne.join(""),{fromInternal:!0}),Q?.focus();return}if(U>0){const ne=O.current[U-1];ne?.focus(),ne?.select()}return}Z.key==="ArrowLeft"&&U>0&&(Z.preventDefault(),O.current[U-1]?.focus()),Z.key==="ArrowRight"&&U<e-1&&(Z.preventDefault(),O.current[U+1]?.focus())}},[j,s,e,P]),re=S.useCallback((U,Z)=>{if(s)return;Z.preventDefault();let Q=Z.clipboardData.getData("text");if(d&&(Q=Q.replace(/\D/g,"")),!Q)return;const ne=e-U,oe=Math.min(Q.length,ne),me=Q.slice(0,oe),ee=[...j];for(let ze=0;ze<oe;ze++)ee[U+ze]=me[ze]??"";I(ee);const xe=ee.join("");P(xe,{fromInternal:!0});const Se=Math.min(U+oe-1,e-1),Ee=O.current[Se];Ee?.focus(),Ee?.select()},[j,s,e,d,P]);return C.jsxs(q,{w:"full",gap:$v.sm,className:h,center:l,children:[t&&C.jsx(le,{variant:"body-2",fontWeight:"regular",colorName:"tertiary",className:m,children:t}),C.jsx(q,{row:!0,w:"full",gap:$v.sm,center:l,className:T.cx({[oi.disabled]:s},g),children:Array.from({length:e}).map((U,Z)=>C.jsxs(q,{relative:!0,display:"inline-block",children:[C.jsx("input",{ref:Q=>{O.current[Z]=Q},className:T.cx(oi.input,oi[f],r&&oi.error,i&&oi.success,j[Z]&&T.css({caretColor:"transparent"}),p),inputMode:d?"numeric":"text",type:c?"password":"text",maxLength:1,autoFocus:a&&Z===0,disabled:s||u,value:j[Z],onChange:Q=>K(Z,Q.target.value),onKeyDown:Q=>G(Z,Q),onPaste:Q=>re(Z,Q)}),C.jsx(ea.span,{className:oi.glow,variants:uL,custom:Z,initial:"idle",animate:u?"wave":"idle"})]},Z))}),n&&C.jsx(le,{variant:"caption-1",colorName:"tertiary",className:v,children:n}),o&&r&&C.jsx(le,{variant:"body-2",colorName:"negative",fontWeight:"regular",className:y,children:o})]})}),uL={idle:{opacity:0,scale:1,transition:{duration:.18}},wave:(e=0)=>({opacity:[0,.2,0],scale:[1,1.03,1],transition:{duration:1.5,delay:e*.15,repeat:1/0,ease:[.42,0,.58,1]}})};CC.displayName="OtpInput";const SC=S.createContext(null),dL=()=>S.useContext(SC),{spacing:fL}=V,gs={radio:T.css({display:"flex",alignItems:"flex-start",justifyContent:"flex-start",gap:fL.md,cursor:"pointer"}),disabled:T.css({opacity:.5,cursor:"not-allowed"}),sideRight:T.css({flexDirection:"row-reverse",justifyContent:"space-between"}),readOnly:T.css({cursor:"auto"}),checked:T.css({})},{color:_r,cornerRadius:Ov}=V,Iv={sm:{inner:12,outer:20},md:{inner:16,outer:24}},_C=S.forwardRef(({value:e,children:t,checked:n,defaultChecked:r,onChange:o,disabled:i,className:s,description:a,size:l,side:c,readOnly:u,error:f,outerCircleClassName:d,innerCircleClassName:h,labelContainerClassName:g,labelClassName:p,descriptionClassName:m},v)=>{const y=dL(),x=!!y,b=n!==void 0,[w,_]=Bo(n,r),E=x?y.value===e:b?n:w,R=y?.disabled||i,k=l??y?.size??"md",M=c??y?.side??"left",F=u??y?.readOnly??!1,D=f??y?.error??!1,j=Iv[k].outer,I=Iv[k].inner,$=()=>{R||F||(x?y.setValue?.(e):(b||_(!E),o?.(!E)))},H=E&&D?_r.fill.negativeTint:E?_r.fill.accentTint:_r.fill.bgSecondary,O=E&&D?_r.fill.negativePrimary:E?_r.fill.accentPrimary:void 0,P=E&&D||D&&!E?_r.border.negativeSecondary:_r.border.neutralAlphaLow;return C.jsxs("button",{ref:v,role:"radio",type:"button","data-value":e,"aria-checked":E,"aria-disabled":R||void 0,tabIndex:E?0:-1,className:T.cx([gs.radio,E&&gs.checked,R&&gs.disabled,M==="right"&&gs.sideRight,F&&gs.readOnly,s]),onClick:$,children:[C.jsx(q,{w:j,h:j,backgroundColor:H,borderWidth:E?0:1,borderColor:P,borderStyle:"solid",center:!0,borderRadius:Ov.fullRound,className:d,children:C.jsx(q,{w:I,h:I,backgroundColor:O,borderRadius:Ov.fullRound,"aria-hidden":!0,className:h})}),C.jsxs(q,{alignItems:"flex-start",className:g,children:[C.jsx(le,{variant:k==="sm"?"body-2":"body-1",tag:"span",left:!0,className:p,children:t}),a&&C.jsx(le,{tag:"span",variant:"body-2",colorName:"secondary",className:m,children:a})]})]})});_C.displayName="Radio";const{spacing:Dv}=V,TC=S.forwardRef(({label:e,value:t,defaultValue:n,onChange:r,children:o,className:i,error:s=!1,disabled:a=!1,readOnly:l=!1,side:c="left",size:u="md",labelClassName:f,optionsContainerClassName:d},h)=>{const[g,p]=Bo(t,n),m=t!==void 0,v=m?t:g,y=S.useCallback(b=>{m||p(b),r?.(b)},[m,r,p]),x=S.useRef(null);return S.useImperativeHandle(h,()=>x.current),C.jsx(SC.Provider,{value:{value:v,readOnly:l,disabled:a,setValue:y,size:u,side:c,error:s},children:C.jsxs(q,{gap:Dv.sm,ref:x,role:"radiogroup","aria-invalid":s||void 0,className:i,children:[typeof e=="string"?C.jsx(le,{colorName:"secondary",className:f,children:e}):e,C.jsx(q,{gap:Dv.lg,className:d,children:o})]})})});TC.displayName="RadioGroup";const{color:or}=V,jv=T.css({border:`1px solid ${or.border.neutralAlphaBasic}`}),Vv=T.css({display:"flex",alignItems:"center",justifyContent:"center"}),Tr={primary:T.css({background:or.fill.bgPrimary,border:`1px solid ${or.border.neutralAlphaBasic}`}),secondary:T.css({background:or.fill.bgSecondary,border:`1px solid ${or.border.neutralAlphaBasic}`}),button:T.css({cursor:"pointer",border:"1px solid transparent",borderRadius:8,padding:"8px 12px",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:10,transition:"all 0.15s ease",position:"relative",overflow:"hidden",background:"none",[`&:hover:not(.${jv})`]:{background:or.fill.neutralPrimaryHover},[`& .${Vv} svg`]:{color:or.icon.tertiary},"&:disabled":{cursor:"not-allowed",opacity:.5}}),"button-active":jv,"button-primary":T.css({background:or.fill.bgSecondary}),"button-secondary":T.css({background:or.fill.bgPrimary}),"button-disabled":T.css({opacity:.5,cursor:"not-allowed"}),"full-width":T.css({width:"100%"}),"icon-container":Vv},{color:Bv,cornerRadius:hL,spacing:zv}=V;function gL({value:e,onChange:t,options:n,variant:r="primary",fullWidth:o=!1,className:i,buttonClassName:s,activeButtonClassName:a,disabledButtonClassName:l,iconContainerClassName:c,textClassName:u,separatorClassName:f}){return C.jsx(q,{row:!0,alignItems:"center",borderRadius:hL.md,p:zv.xs,gap:zv.md,className:T.cx(Tr[r],o&&Tr["full-width"],i),children:n.map(d=>{const h=d.value===e,g=d.disabled,p=d.separatorAfter??!1;return C.jsxs(S.Fragment,{children:[C.jsxs("button",{type:"button",disabled:g,className:T.cx(Tr.button,o&&Tr["full-width"],h&&Tr["button-active"],h&&Tr[`button-${r}`],g&&Tr["button-disabled"],s,h&&a,g&&l),onClick:()=>!g&&t(d.value),children:[d.icon&&C.jsx(q,{alignItems:"center",justifyContent:"center",className:T.cx(Tr["icon-container"],c),children:d.icon}),d.label&&C.jsx(le,{colorName:h?"primary":"tertiary",className:u,children:d.label}),!g&&C.jsx(zo,{color:Bv.fill.bgOverlayPrimary})]}),p&&C.jsx(q,{w:1,h:24,backgroundColor:Bv.fill.bgTertiary,className:f})]},d.value)})})}function vc(){return typeof window<"u"}function Ji(e){return EC(e)?(e.nodeName||"").toLowerCase():"#document"}function Wt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Jn(e){var t;return(t=(EC(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function EC(e){return vc()?e instanceof Node||e instanceof Wt(e).Node:!1}function De(e){return vc()?e instanceof Element||e instanceof Wt(e).Element:!1}function $t(e){return vc()?e instanceof HTMLElement||e instanceof Wt(e).HTMLElement:!1}function xf(e){return!vc()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Wt(e).ShadowRoot}const pL=new Set(["inline","contents"]);function ga(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=dn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!pL.has(o)}const mL=new Set(["table","td","th"]);function yL(e){return mL.has(Ji(e))}const vL=[":popover-open",":modal"];function xc(e){return vL.some(t=>{try{return e.matches(t)}catch{return!1}})}const xL=["transform","translate","scale","rotate","perspective"],bL=["transform","translate","scale","rotate","perspective","filter"],wL=["paint","layout","strict","content"];function lg(e){const t=bc(),n=De(e)?dn(e):e;return xL.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||bL.some(r=>(n.willChange||"").includes(r))||wL.some(r=>(n.contain||"").includes(r))}function CL(e){let t=wr(e);for(;$t(t)&&!mr(t);){if(lg(t))return t;if(xc(t))return null;t=wr(t)}return null}function bc(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const SL=new Set(["html","body","#document"]);function mr(e){return SL.has(Ji(e))}function dn(e){return Wt(e).getComputedStyle(e)}function wc(e){return De(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function wr(e){if(Ji(e)==="html")return e;const t=e.assignedSlot||e.parentNode||xf(e)&&e.host||Jn(e);return xf(t)?t.host:t}function RC(e){const t=wr(e);return mr(t)?e.ownerDocument?e.ownerDocument.body:e.body:$t(t)&&ga(t)?t:RC(t)}function Dr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=RC(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=Wt(o);if(i){const a=bf(s);return t.concat(s,s.visualViewport||[],ga(o)?o:[],a&&n?Dr(a):[])}return t.concat(o,Dr(o,[],n))}function bf(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const qr=Math.min,Xt=Math.max,Hl=Math.round,Wa=Math.floor,Xn=e=>({x:e,y:e}),_L={left:"right",right:"left",bottom:"top",top:"bottom"},TL={start:"end",end:"start"};function wf(e,t,n){return Xt(e,qr(t,n))}function Qi(e,t){return typeof e=="function"?e(t):e}function Yr(e){return e.split("-")[0]}function es(e){return e.split("-")[1]}function kC(e){return e==="x"?"y":"x"}function cg(e){return e==="y"?"height":"width"}const EL=new Set(["top","bottom"]);function gr(e){return EL.has(Yr(e))?"y":"x"}function ug(e){return kC(gr(e))}function RL(e,t,n){n===void 0&&(n=!1);const r=es(e),o=ug(e),i=cg(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Wl(s)),[s,Wl(s)]}function kL(e){const t=Wl(e);return[Cf(e),t,Cf(t)]}function Cf(e){return e.replace(/start|end/g,t=>TL[t])}const Hv=["left","right"],Wv=["right","left"],AL=["top","bottom"],NL=["bottom","top"];function ML(e,t,n){switch(e){case"top":case"bottom":return n?t?Wv:Hv:t?Hv:Wv;case"left":case"right":return t?AL:NL;default:return[]}}function PL(e,t,n,r){const o=es(e);let i=ML(Yr(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Cf)))),i}function Wl(e){return e.replace(/left|right|bottom|top/g,t=>_L[t])}function LL(e){return{top:0,right:0,bottom:0,left:0,...e}}function AC(e){return typeof e!="number"?LL(e):{top:e,right:e,bottom:e,left:e}}function Kl(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function FL(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function $L(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function OL(){return/apple/i.test(navigator.vendor)}function IL(){return FL().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function DL(){return $L().includes("jsdom/")}const Kv="data-floating-ui-focusable",jL="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Uv(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function Gs(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&xf(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function hi(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Iu(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function VL(e){return e.matches("html,body")}function Co(e){return e?.ownerDocument||document}function NC(e){return $t(e)&&e.matches(jL)}function BL(e){if(!e||DL())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function zL(e){return e?e.hasAttribute(Kv)?e:e.querySelector("["+Kv+"]")||e:null}function cl(e,t,n){return n===void 0&&(n=!0),e.filter(o=>{var i;return o.parentId===t&&(!n||((i=o.context)==null?void 0:i.open))}).flatMap(o=>[o,...cl(e,o.id,n)])}function HL(e){return"nativeEvent"in e}function qs(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var WL=typeof document<"u",KL=function(){},Vi=WL?S.useLayoutEffect:KL;const UL={...N};function Ka(e){const t=N.useRef(e);return Vi(()=>{t.current=e}),t}const GL=UL.useInsertionEffect,qL=GL||(e=>e());function Vn(e){const t=N.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return qL(()=>{t.current=e}),N.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function Gv(e,t,n){let{reference:r,floating:o}=e;const i=gr(t),s=ug(t),a=cg(s),l=Yr(t),c=i==="y",u=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[a]/2-o[a]/2;let h;switch(l){case"top":h={x:u,y:r.y-o.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-o.width,y:f};break;default:h={x:r.x,y:r.y}}switch(es(t)){case"start":h[s]-=d*(n&&c?-1:1);break;case"end":h[s]+=d*(n&&c?-1:1);break}return h}const YL=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=Gv(c,r,l),d=r,h={},g=0;for(let p=0;p<a.length;p++){const{name:m,fn:v}=a[p],{x:y,y:x,data:b,reset:w}=await v({x:u,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:h,rects:c,platform:s,elements:{reference:e,floating:t}});u=y??u,f=x??f,h={...h,[m]:{...h[m],...b}},w&&g<=50&&(g++,typeof w=="object"&&(w.placement&&(d=w.placement),w.rects&&(c=w.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):w.rects),{x:u,y:f}=Gv(c,d,l)),p=-1)}return{x:u,y:f,placement:d,strategy:o,middlewareData:h}};async function dg(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:d=!1,padding:h=0}=Qi(t,e),g=AC(h),m=a[d?f==="floating"?"reference":"floating":f],v=Kl(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(m)))==null||n?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),y=f==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),b=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},w=Kl(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:x,strategy:l}):y);return{top:(v.top-w.top+g.top)/b.y,bottom:(w.bottom-v.bottom+g.bottom)/b.y,left:(v.left-w.left+g.left)/b.x,right:(w.right-v.right+g.right)/b.x}}const XL=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=Qi(e,t)||{};if(c==null)return{};const f=AC(u),d={x:n,y:r},h=ug(o),g=cg(h),p=await s.getDimensions(c),m=h==="y",v=m?"top":"left",y=m?"bottom":"right",x=m?"clientHeight":"clientWidth",b=i.reference[g]+i.reference[h]-d[h]-i.floating[g],w=d[h]-i.reference[h],_=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let E=_?_[x]:0;(!E||!await(s.isElement==null?void 0:s.isElement(_)))&&(E=a.floating[x]||i.floating[g]);const R=b/2-w/2,k=E/2-p[g]/2-1,M=qr(f[v],k),F=qr(f[y],k),D=M,j=E-p[g]-F,I=E/2-p[g]/2+R,$=wf(D,I,j),H=!l.arrow&&es(o)!=null&&I!==$&&i.reference[g]/2-(I<D?M:F)-p[g]/2<0,O=H?I<D?I-D:I-j:0;return{[h]:d[h]+O,data:{[h]:$,centerOffset:I-$-O,...H&&{alignmentOffset:O}},reset:H}}}),ZL=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:p=!0,...m}=Qi(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const v=Yr(o),y=gr(a),x=Yr(a)===a,b=await(l.isRTL==null?void 0:l.isRTL(c.floating)),w=d||(x||!p?[Wl(a)]:kL(a)),_=g!=="none";!d&&_&&w.push(...PL(a,p,g,b));const E=[a,...w],R=await dg(t,m),k=[];let M=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&k.push(R[v]),f){const I=RL(o,s,b);k.push(R[I[0]],R[I[1]])}if(M=[...M,{placement:o,overflows:k}],!k.every(I=>I<=0)){var F,D;const I=(((F=i.flip)==null?void 0:F.index)||0)+1,$=E[I];if($&&(!(f==="alignment"?y!==gr($):!1)||M.every(P=>gr(P.placement)===y?P.overflows[0]>0:!0)))return{data:{index:I,overflows:M},reset:{placement:$}};let H=(D=M.filter(O=>O.overflows[0]<=0).sort((O,P)=>O.overflows[1]-P.overflows[1])[0])==null?void 0:D.placement;if(!H)switch(h){case"bestFit":{var j;const O=(j=M.filter(P=>{if(_){const K=gr(P.placement);return K===y||K==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(K=>K>0).reduce((K,G)=>K+G,0)]).sort((P,K)=>P[1]-K[1])[0])==null?void 0:j[0];O&&(H=O);break}case"initialPlacement":H=a;break}if(o!==H)return{reset:{placement:H}}}return{}}}},JL=new Set(["left","top"]);async function QL(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Yr(n),a=es(n),l=gr(n)==="y",c=JL.has(s)?-1:1,u=i&&l?-1:1,f=Qi(t,e);let{mainAxis:d,crossAxis:h,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof g=="number"&&(h=a==="end"?g*-1:g),l?{x:h*u,y:d*c}:{x:d*c,y:h*u}}const eF=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await QL(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},tF=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:m=>{let{x:v,y}=m;return{x:v,y}}},...l}=Qi(e,t),c={x:n,y:r},u=await dg(t,l),f=gr(Yr(o)),d=kC(f);let h=c[d],g=c[f];if(i){const m=d==="y"?"top":"left",v=d==="y"?"bottom":"right",y=h+u[m],x=h-u[v];h=wf(y,h,x)}if(s){const m=f==="y"?"top":"left",v=f==="y"?"bottom":"right",y=g+u[m],x=g-u[v];g=wf(y,g,x)}const p=a.fn({...t,[d]:h,[f]:g});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[d]:i,[f]:s}}}}}},nF=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=Qi(e,t),u=await dg(t,c),f=Yr(o),d=es(o),h=gr(o)==="y",{width:g,height:p}=i.floating;let m,v;f==="top"||f==="bottom"?(m=f,v=d===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(v=f,m=d==="end"?"top":"bottom");const y=p-u.top-u.bottom,x=g-u.left-u.right,b=qr(p-u[m],y),w=qr(g-u[v],x),_=!t.middlewareData.shift;let E=b,R=w;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(R=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(E=y),_&&!d){const M=Xt(u.left,0),F=Xt(u.right,0),D=Xt(u.top,0),j=Xt(u.bottom,0);h?R=g-2*(M!==0||F!==0?M+F:Xt(u.left,u.right)):E=p-2*(D!==0||j!==0?D+j:Xt(u.top,u.bottom))}await l({...t,availableWidth:R,availableHeight:E});const k=await s.getDimensions(a.floating);return g!==k.width||p!==k.height?{reset:{rects:!0}}:{}}}};function MC(e){const t=dn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=$t(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Hl(n)!==i||Hl(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function fg(e){return De(e)?e:e.contextElement}function Mi(e){const t=fg(e);if(!$t(t))return Xn(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=MC(t);let s=(i?Hl(n.width):n.width)/r,a=(i?Hl(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const rF=Xn(0);function PC(e){const t=Wt(e);return!bc()||!t.visualViewport?rF:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function oF(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Wt(e)?!1:t}function Vo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=fg(e);let s=Xn(1);t&&(r?De(r)&&(s=Mi(r)):s=Mi(e));const a=oF(i,n,r)?PC(i):Xn(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,f=o.height/s.y;if(i){const d=Wt(i),h=r&&De(r)?Wt(r):r;let g=d,p=bf(g);for(;p&&r&&h!==g;){const m=Mi(p),v=p.getBoundingClientRect(),y=dn(p),x=v.left+(p.clientLeft+parseFloat(y.paddingLeft))*m.x,b=v.top+(p.clientTop+parseFloat(y.paddingTop))*m.y;l*=m.x,c*=m.y,u*=m.x,f*=m.y,l+=x,c+=b,g=Wt(p),p=bf(g)}}return Kl({width:u,height:f,x:l,y:c})}function Cc(e,t){const n=wc(e).scrollLeft;return t?t.left+n:Vo(Jn(e)).left+n}function LC(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Cc(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function iF(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=Jn(r),a=t?xc(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=Xn(1);const u=Xn(0),f=$t(r);if((f||!f&&!i)&&((Ji(r)!=="body"||ga(s))&&(l=wc(r)),$t(r))){const h=Vo(r);c=Mi(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}const d=s&&!f&&!i?LC(s,l):Xn(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+d.x,y:n.y*c.y-l.scrollTop*c.y+u.y+d.y}}function sF(e){return Array.from(e.getClientRects())}function aF(e){const t=Jn(e),n=wc(e),r=e.ownerDocument.body,o=Xt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Xt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Cc(e);const a=-n.scrollTop;return dn(r).direction==="rtl"&&(s+=Xt(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}const qv=25;function lF(e,t){const n=Wt(e),r=Jn(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const u=bc();(!u||u&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const c=Cc(r);if(c<=0){const u=r.ownerDocument,f=u.body,d=getComputedStyle(f),h=u.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,g=Math.abs(r.clientWidth-f.clientWidth-h);g<=qv&&(i-=g)}else c<=qv&&(i+=c);return{width:i,height:s,x:a,y:l}}const cF=new Set(["absolute","fixed"]);function uF(e,t){const n=Vo(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=$t(e)?Mi(e):Xn(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:s,height:a,x:l,y:c}}function Yv(e,t,n){let r;if(t==="viewport")r=lF(e,n);else if(t==="document")r=aF(Jn(e));else if(De(t))r=uF(t,n);else{const o=PC(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Kl(r)}function FC(e,t){const n=wr(e);return n===t||!De(n)||mr(n)?!1:dn(n).position==="fixed"||FC(n,t)}function dF(e,t){const n=t.get(e);if(n)return n;let r=Dr(e,[],!1).filter(a=>De(a)&&Ji(a)!=="body"),o=null;const i=dn(e).position==="fixed";let s=i?wr(e):e;for(;De(s)&&!mr(s);){const a=dn(s),l=lg(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&cF.has(o.position)||ga(s)&&!l&&FC(e,s))?r=r.filter(u=>u!==s):o=a,s=wr(s)}return t.set(e,r),r}function fF(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?xc(t)?[]:dF(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const f=Yv(t,u,o);return c.top=Xt(f.top,c.top),c.right=qr(f.right,c.right),c.bottom=qr(f.bottom,c.bottom),c.left=Xt(f.left,c.left),c},Yv(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function hF(e){const{width:t,height:n}=MC(e);return{width:t,height:n}}function gF(e,t,n){const r=$t(t),o=Jn(t),i=n==="fixed",s=Vo(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=Xn(0);function c(){l.x=Cc(o)}if(r||!r&&!i)if((Ji(t)!=="body"||ga(o))&&(a=wc(t)),r){const h=Vo(t,!0,i,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else o&&c();i&&!r&&o&&c();const u=o&&!r&&!i?LC(o,a):Xn(0),f=s.left+a.scrollLeft-l.x-u.x,d=s.top+a.scrollTop-l.y-u.y;return{x:f,y:d,width:s.width,height:s.height}}function Du(e){return dn(e).position==="static"}function Xv(e,t){if(!$t(e)||dn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Jn(e)===n&&(n=n.ownerDocument.body),n}function $C(e,t){const n=Wt(e);if(xc(e))return n;if(!$t(e)){let o=wr(e);for(;o&&!mr(o);){if(De(o)&&!Du(o))return o;o=wr(o)}return n}let r=Xv(e,t);for(;r&&yL(r)&&Du(r);)r=Xv(r,t);return r&&mr(r)&&Du(r)&&!lg(r)?n:r||CL(e)||n}const pF=async function(e){const t=this.getOffsetParent||$C,n=this.getDimensions,r=await n(e.floating);return{reference:gF(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function mF(e){return dn(e).direction==="rtl"}const yF={convertOffsetParentRelativeRectToViewportRelativeRect:iF,getDocumentElement:Jn,getClippingRect:fF,getOffsetParent:$C,getElementRects:pF,getClientRects:sF,getDimensions:hF,getScale:Mi,isElement:De,isRTL:mF};function OC(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function vF(e,t){let n=null,r;const o=Jn(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const c=e.getBoundingClientRect(),{left:u,top:f,width:d,height:h}=c;if(a||t(),!d||!h)return;const g=Wa(f),p=Wa(o.clientWidth-(u+d)),m=Wa(o.clientHeight-(f+h)),v=Wa(u),x={rootMargin:-g+"px "+-p+"px "+-m+"px "+-v+"px",threshold:Xt(0,qr(1,l))||1};let b=!0;function w(_){const E=_[0].intersectionRatio;if(E!==l){if(!b)return s();E?s(!1,E):r=setTimeout(()=>{s(!1,1e-7)},1e3)}E===1&&!OC(c,e.getBoundingClientRect())&&s(),b=!1}try{n=new IntersectionObserver(w,{...x,root:o.ownerDocument})}catch{n=new IntersectionObserver(w,x)}n.observe(e)}return s(!0),i}function hg(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=fg(e),u=o||i?[...c?Dr(c):[],...Dr(t)]:[];u.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const f=c&&a?vF(c,n):null;let d=-1,h=null;s&&(h=new ResizeObserver(v=>{let[y]=v;y&&y.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var x;(x=h)==null||x.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let g,p=l?Vo(e):null;l&&m();function m(){const v=Vo(e);p&&!OC(p,v)&&n(),p=v,g=requestAnimationFrame(m)}return n(),()=>{var v;u.forEach(y=>{o&&y.removeEventListener("scroll",n),i&&y.removeEventListener("resize",n)}),f?.(),(v=h)==null||v.disconnect(),h=null,l&&cancelAnimationFrame(g)}}const xF=eF,bF=tF,wF=ZL,CF=nF,Zv=XL,SF=(e,t,n)=>{const r=new Map,o={platform:yF,...n},i={...o.platform,_c:r};return YL(e,t,{...o,platform:i})};var _F=typeof document<"u",TF=function(){},ul=_F?S.useLayoutEffect:TF;function Ul(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Ul(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!Ul(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function IC(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Jv(e,t){const n=IC(e);return Math.round(t*n)/n}function ju(e){const t=N.useRef(e);return ul(()=>{t.current=e}),t}function EF(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,f]=N.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,h]=N.useState(r);Ul(d,r)||h(r);const[g,p]=N.useState(null),[m,v]=N.useState(null),y=N.useCallback(P=>{P!==_.current&&(_.current=P,p(P))},[]),x=N.useCallback(P=>{P!==E.current&&(E.current=P,v(P))},[]),b=i||g,w=s||m,_=N.useRef(null),E=N.useRef(null),R=N.useRef(u),k=l!=null,M=ju(l),F=ju(o),D=ju(c),j=N.useCallback(()=>{if(!_.current||!E.current)return;const P={placement:t,strategy:n,middleware:d};F.current&&(P.platform=F.current),SF(_.current,E.current,P).then(K=>{const G={...K,isPositioned:D.current!==!1};I.current&&!Ul(R.current,G)&&(R.current=G,k_.flushSync(()=>{f(G)}))})},[d,t,n,F,D]);ul(()=>{c===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,f(P=>({...P,isPositioned:!1})))},[c]);const I=N.useRef(!1);ul(()=>(I.current=!0,()=>{I.current=!1}),[]),ul(()=>{if(b&&(_.current=b),w&&(E.current=w),b&&w){if(M.current)return M.current(b,w,j);j()}},[b,w,j,M,k]);const $=N.useMemo(()=>({reference:_,floating:E,setReference:y,setFloating:x}),[y,x]),H=N.useMemo(()=>({reference:b,floating:w}),[b,w]),O=N.useMemo(()=>{const P={position:n,left:0,top:0};if(!H.floating)return P;const K=Jv(H.floating,u.x),G=Jv(H.floating,u.y);return a?{...P,transform:"translate("+K+"px, "+G+"px)",...IC(H.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:K,top:G}},[n,a,H.floating,u.x,u.y]);return N.useMemo(()=>({...u,update:j,refs:$,elements:H,floatingStyles:O}),[u,j,$,H,O])}const RF=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Zv({element:r.current,padding:o}).fn(n):{}:r?Zv({element:r,padding:o}).fn(n):{}}}},gg=(e,t)=>({...xF(e),options:[e,t]}),pg=(e,t)=>({...bF(e),options:[e,t]}),mg=(e,t)=>({...wF(e),options:[e,t]}),kF=(e,t)=>({...CF(e),options:[e,t]}),AF=(e,t)=>({...RF(e),options:[e,t]});function DC(e){const t=N.useRef(void 0),n=N.useCallback(r=>{const o=e.map(i=>{if(i!=null){if(typeof i=="function"){const s=i,a=s(r);return typeof a=="function"?a:()=>{s(null)}}return i.current=r,()=>{i.current=null}}});return()=>{o.forEach(i=>i?.())}},e);return N.useMemo(()=>e.every(r=>r==null)?null:r=>{t.current&&(t.current(),t.current=void 0),r!=null&&(t.current=n(r))},e)}const NF="data-floating-ui-focusable",Qv="active",e0="selected",MF={...N};let t0=!1,PF=0;const n0=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+PF++;function LF(){const[e,t]=N.useState(()=>t0?n0():void 0);return Vi(()=>{e==null&&t(n0())},[]),N.useEffect(()=>{t0=!0},[]),e}const FF=MF.useId,jC=FF||LF;let Sf;process.env.NODE_ENV!=="production"&&(Sf=new Set);function $F(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=Sf)!=null&&e.has(o))){var i;(i=Sf)==null||i.add(o),console.error(o)}}function OF(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}const IF=N.createContext(null),DF=N.createContext(null),yg=()=>{var e;return((e=N.useContext(IF))==null?void 0:e.id)||null},vg=()=>N.useContext(DF);function xg(e){return"data-floating-ui-"+e}function on(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const r0=xg("safe-polygon");function Vu(e,t,n){if(n&&!qs(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const r=e();return typeof r=="number"?r:r?.[t]}return e?.[t]}function Bu(e){return typeof e=="function"?e():e}function VC(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:s}=e,{enabled:a=!0,delay:l=0,handleClose:c=null,mouseOnly:u=!1,restMs:f=0,move:d=!0}=t,h=vg(),g=yg(),p=Ka(c),m=Ka(l),v=Ka(n),y=Ka(f),x=N.useRef(),b=N.useRef(-1),w=N.useRef(),_=N.useRef(-1),E=N.useRef(!0),R=N.useRef(!1),k=N.useRef(()=>{}),M=N.useRef(!1),F=Vn(()=>{var O;const P=(O=o.current.openEvent)==null?void 0:O.type;return P?.includes("mouse")&&P!=="mousedown"});N.useEffect(()=>{if(!a)return;function O(P){let{open:K}=P;K||(on(b),on(_),E.current=!0,M.current=!1)}return i.on("openchange",O),()=>{i.off("openchange",O)}},[a,i]),N.useEffect(()=>{if(!a||!p.current||!n)return;function O(K){F()&&r(!1,K,"hover")}const P=Co(s.floating).documentElement;return P.addEventListener("mouseleave",O),()=>{P.removeEventListener("mouseleave",O)}},[s.floating,n,r,a,p,F]);const D=N.useCallback(function(O,P,K){P===void 0&&(P=!0),K===void 0&&(K="hover");const G=Vu(m.current,"close",x.current);G&&!w.current?(on(b),b.current=window.setTimeout(()=>r(!1,O,K),G)):P&&(on(b),r(!1,O,K))},[m,r]),j=Vn(()=>{k.current(),w.current=void 0}),I=Vn(()=>{if(R.current){const O=Co(s.floating).body;O.style.pointerEvents="",O.removeAttribute(r0),R.current=!1}}),$=Vn(()=>o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1);N.useEffect(()=>{if(!a)return;function O(U){if(on(b),E.current=!1,u&&!qs(x.current)||Bu(y.current)>0&&!Vu(m.current,"open"))return;const Z=Vu(m.current,"open",x.current);Z?b.current=window.setTimeout(()=>{v.current||r(!0,U,"hover")},Z):n||r(!0,U,"hover")}function P(U){if($()){I();return}k.current();const Z=Co(s.floating);if(on(_),M.current=!1,p.current&&o.current.floatingContext){n||on(b),w.current=p.current({...o.current.floatingContext,tree:h,x:U.clientX,y:U.clientY,onClose(){I(),j(),$()||D(U,!0,"safe-polygon")}});const ne=w.current;Z.addEventListener("mousemove",ne),k.current=()=>{Z.removeEventListener("mousemove",ne)};return}(x.current!=="touch"||!Gs(s.floating,U.relatedTarget))&&D(U)}function K(U){$()||o.current.floatingContext&&(p.current==null||p.current({...o.current.floatingContext,tree:h,x:U.clientX,y:U.clientY,onClose(){I(),j(),$()||D(U)}})(U))}function G(){on(b)}function re(U){$()||D(U,!1)}if(De(s.domReference)){const U=s.domReference,Z=s.floating;return n&&U.addEventListener("mouseleave",K),d&&U.addEventListener("mousemove",O,{once:!0}),U.addEventListener("mouseenter",O),U.addEventListener("mouseleave",P),Z&&(Z.addEventListener("mouseleave",K),Z.addEventListener("mouseenter",G),Z.addEventListener("mouseleave",re)),()=>{n&&U.removeEventListener("mouseleave",K),d&&U.removeEventListener("mousemove",O),U.removeEventListener("mouseenter",O),U.removeEventListener("mouseleave",P),Z&&(Z.removeEventListener("mouseleave",K),Z.removeEventListener("mouseenter",G),Z.removeEventListener("mouseleave",re))}}},[s,a,e,u,d,D,j,I,r,n,v,h,m,p,o,$,y]),Vi(()=>{var O;if(a&&n&&(O=p.current)!=null&&(O=O.__options)!=null&&O.blockPointerEvents&&F()){R.current=!0;const K=s.floating;if(De(s.domReference)&&K){var P;const G=Co(s.floating).body;G.setAttribute(r0,"");const re=s.domReference,U=h==null||(P=h.nodesRef.current.find(Z=>Z.id===g))==null||(P=P.context)==null?void 0:P.elements.floating;return U&&(U.style.pointerEvents=""),G.style.pointerEvents="none",re.style.pointerEvents="auto",K.style.pointerEvents="auto",()=>{G.style.pointerEvents="",re.style.pointerEvents="",K.style.pointerEvents=""}}}},[a,n,g,s,h,p,F]),Vi(()=>{n||(x.current=void 0,M.current=!1,j(),I())},[n,j,I]),N.useEffect(()=>()=>{j(),on(b),on(_),I()},[a,s.domReference,j,I]);const H=N.useMemo(()=>{function O(P){x.current=P.pointerType}return{onPointerDown:O,onPointerEnter:O,onMouseMove(P){const{nativeEvent:K}=P;function G(){!E.current&&!v.current&&r(!0,K,"hover")}u&&!qs(x.current)||n||Bu(y.current)===0||M.current&&P.movementX**2+P.movementY**2<2||(on(_),x.current==="touch"?G():(M.current=!0,_.current=window.setTimeout(G,Bu(y.current))))}}},[u,r,n,v,y]);return N.useMemo(()=>a?{reference:H}:{},[a,H])}function o0(e){return $t(e.target)&&e.target.tagName==="BUTTON"}function jF(e){return $t(e.target)&&e.target.tagName==="A"}function i0(e){return NC(e)}function VF(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:i}}=e,{enabled:s=!0,event:a="click",toggle:l=!0,ignoreMouse:c=!1,keyboardHandlers:u=!0,stickIfOpen:f=!0}=t,d=N.useRef(),h=N.useRef(!1),g=N.useMemo(()=>({onPointerDown(p){d.current=p.pointerType},onMouseDown(p){const m=d.current;p.button===0&&a!=="click"&&(qs(m,!0)&&c||(n&&l&&(!(o.current.openEvent&&f)||o.current.openEvent.type==="mousedown")?r(!1,p.nativeEvent,"click"):(p.preventDefault(),r(!0,p.nativeEvent,"click"))))},onClick(p){const m=d.current;if(a==="mousedown"&&d.current){d.current=void 0;return}qs(m,!0)&&c||(n&&l&&(!(o.current.openEvent&&f)||o.current.openEvent.type==="click")?r(!1,p.nativeEvent,"click"):r(!0,p.nativeEvent,"click"))},onKeyDown(p){d.current=void 0,!(p.defaultPrevented||!u||o0(p))&&(p.key===" "&&!i0(i)&&(p.preventDefault(),h.current=!0),!jF(p)&&p.key==="Enter"&&r(!(n&&l),p.nativeEvent,"click"))},onKeyUp(p){p.defaultPrevented||!u||o0(p)||i0(i)||p.key===" "&&h.current&&(h.current=!1,r(!(n&&l),p.nativeEvent,"click"))}}),[o,i,a,c,u,r,n,f,l]);return N.useMemo(()=>s?{reference:g}:{},[s,g])}const BF={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},zF={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},s0=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e?.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e?.outsidePress)!=null?n:!0}};function BC(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:i}=e,{enabled:s=!0,escapeKey:a=!0,outsidePress:l=!0,outsidePressEvent:c="pointerdown",referencePress:u=!1,referencePressEvent:f="pointerdown",ancestorScroll:d=!1,bubbles:h,capture:g}=t,p=vg(),m=Vn(typeof l=="function"?l:()=>!1),v=typeof l=="function"?m:l,y=N.useRef(!1),{escapeKey:x,outsidePress:b}=s0(h),{escapeKey:w,outsidePress:_}=s0(g),E=N.useRef(!1),R=Vn(I=>{var $;if(!n||!s||!a||I.key!=="Escape"||E.current)return;const H=($=i.current.floatingContext)==null?void 0:$.nodeId,O=p?cl(p.nodesRef.current,H):[];if(!x&&(I.stopPropagation(),O.length>0)){let P=!0;if(O.forEach(K=>{var G;if((G=K.context)!=null&&G.open&&!K.context.dataRef.current.__escapeKeyBubbles){P=!1;return}}),!P)return}r(!1,HL(I)?I.nativeEvent:I,"escape-key")}),k=Vn(I=>{var $;const H=()=>{var O;R(I),(O=hi(I))==null||O.removeEventListener("keydown",H)};($=hi(I))==null||$.addEventListener("keydown",H)}),M=Vn(I=>{var $;const H=i.current.insideReactTree;i.current.insideReactTree=!1;const O=y.current;if(y.current=!1,c==="click"&&O||H||typeof v=="function"&&!v(I))return;const P=hi(I),K="["+xg("inert")+"]",G=Co(o.floating).querySelectorAll(K);let re=De(P)?P:null;for(;re&&!mr(re);){const ne=wr(re);if(mr(ne)||!De(ne))break;re=ne}if(G.length&&De(P)&&!VL(P)&&!Gs(P,o.floating)&&Array.from(G).every(ne=>!Gs(re,ne)))return;if($t(P)&&j){const ne=mr(P),oe=dn(P),me=/auto|scroll/,ee=ne||me.test(oe.overflowX),xe=ne||me.test(oe.overflowY),Se=ee&&P.clientWidth>0&&P.scrollWidth>P.clientWidth,Ee=xe&&P.clientHeight>0&&P.scrollHeight>P.clientHeight,ze=oe.direction==="rtl",je=Ee&&(ze?I.offsetX<=P.offsetWidth-P.clientWidth:I.offsetX>P.clientWidth),Rt=Se&&I.offsetY>P.clientHeight;if(je||Rt)return}const U=($=i.current.floatingContext)==null?void 0:$.nodeId,Z=p&&cl(p.nodesRef.current,U).some(ne=>{var oe;return Iu(I,(oe=ne.context)==null?void 0:oe.elements.floating)});if(Iu(I,o.floating)||Iu(I,o.domReference)||Z)return;const Q=p?cl(p.nodesRef.current,U):[];if(Q.length>0){let ne=!0;if(Q.forEach(oe=>{var me;if((me=oe.context)!=null&&me.open&&!oe.context.dataRef.current.__outsidePressBubbles){ne=!1;return}}),!ne)return}r(!1,I,"outside-press")}),F=Vn(I=>{var $;const H=()=>{var O;M(I),(O=hi(I))==null||O.removeEventListener(c,H)};($=hi(I))==null||$.addEventListener(c,H)});N.useEffect(()=>{if(!n||!s)return;i.current.__escapeKeyBubbles=x,i.current.__outsidePressBubbles=b;let I=-1;function $(G){r(!1,G,"ancestor-scroll")}function H(){window.clearTimeout(I),E.current=!0}function O(){I=window.setTimeout(()=>{E.current=!1},bc()?5:0)}const P=Co(o.floating);a&&(P.addEventListener("keydown",w?k:R,w),P.addEventListener("compositionstart",H),P.addEventListener("compositionend",O)),v&&P.addEventListener(c,_?F:M,_);let K=[];return d&&(De(o.domReference)&&(K=Dr(o.domReference)),De(o.floating)&&(K=K.concat(Dr(o.floating))),!De(o.reference)&&o.reference&&o.reference.contextElement&&(K=K.concat(Dr(o.reference.contextElement)))),K=K.filter(G=>{var re;return G!==((re=P.defaultView)==null?void 0:re.visualViewport)}),K.forEach(G=>{G.addEventListener("scroll",$,{passive:!0})}),()=>{a&&(P.removeEventListener("keydown",w?k:R,w),P.removeEventListener("compositionstart",H),P.removeEventListener("compositionend",O)),v&&P.removeEventListener(c,_?F:M,_),K.forEach(G=>{G.removeEventListener("scroll",$)}),window.clearTimeout(I)}},[i,o,a,v,c,n,r,d,s,x,b,R,w,k,M,_,F]),N.useEffect(()=>{i.current.insideReactTree=!1},[i,v,c]);const D=N.useMemo(()=>({onKeyDown:R,...u&&{[BF[f]]:I=>{r(!1,I.nativeEvent,"reference-press")},...f!=="click"&&{onClick(I){r(!1,I.nativeEvent,"reference-press")}}}}),[R,r,u,f]),j=N.useMemo(()=>({onKeyDown:R,onMouseDown(){y.current=!0},onMouseUp(){y.current=!0},[zF[c]]:()=>{i.current.insideReactTree=!0}}),[R,c,i]);return N.useMemo(()=>s?{reference:D,floating:j}:{},[s,D,j])}function HF(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=jC(),i=N.useRef({}),[s]=N.useState(()=>OF()),a=yg()!=null;if(process.env.NODE_ENV!=="production"){const h=r.reference;h&&!De(h)&&$F("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,c]=N.useState(r.reference),u=Vn((h,g,p)=>{i.current.openEvent=h?g:void 0,s.emit("openchange",{open:h,event:g,reason:p,nested:a}),n?.(h,g,p)}),f=N.useMemo(()=>({setPositionReference:c}),[]),d=N.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return N.useMemo(()=>({dataRef:i,open:t,onOpenChange:u,elements:d,events:s,floatingId:o,refs:f}),[t,u,d,s,o,f])}function bg(e){e===void 0&&(e={});const{nodeId:t}=e,n=HF({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,s]=N.useState(null),[a,l]=N.useState(null),u=o?.domReference||i,f=N.useRef(null),d=vg();Vi(()=>{u&&(f.current=u)},[u]);const h=EF({...e,elements:{...o,...a&&{reference:a}}}),g=N.useCallback(x=>{const b=De(x)?{getBoundingClientRect:()=>x.getBoundingClientRect(),getClientRects:()=>x.getClientRects(),contextElement:x}:x;l(b),h.refs.setReference(b)},[h.refs]),p=N.useCallback(x=>{(De(x)||x===null)&&(f.current=x,s(x)),(De(h.refs.reference.current)||h.refs.reference.current===null||x!==null&&!De(x))&&h.refs.setReference(x)},[h.refs]),m=N.useMemo(()=>({...h.refs,setReference:p,setPositionReference:g,domReference:f}),[h.refs,p,g]),v=N.useMemo(()=>({...h.elements,domReference:u}),[h.elements,u]),y=N.useMemo(()=>({...h,...r,refs:m,elements:v,nodeId:t}),[h,m,v,t,r]);return Vi(()=>{r.dataRef.current.floatingContext=y;const x=d?.nodesRef.current.find(b=>b.id===t);x&&(x.context=y)}),N.useMemo(()=>({...h,context:y,refs:m,elements:v}),[h,m,v,y])}function zu(){return IL()&&OL()}function WF(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:i,elements:s}=e,{enabled:a=!0,visibleOnly:l=!0}=t,c=N.useRef(!1),u=N.useRef(-1),f=N.useRef(!0);N.useEffect(()=>{if(!a)return;const h=Wt(s.domReference);function g(){!n&&$t(s.domReference)&&s.domReference===Uv(Co(s.domReference))&&(c.current=!0)}function p(){f.current=!0}function m(){f.current=!1}return h.addEventListener("blur",g),zu()&&(h.addEventListener("keydown",p,!0),h.addEventListener("pointerdown",m,!0)),()=>{h.removeEventListener("blur",g),zu()&&(h.removeEventListener("keydown",p,!0),h.removeEventListener("pointerdown",m,!0))}},[s.domReference,n,a]),N.useEffect(()=>{if(!a)return;function h(g){let{reason:p}=g;(p==="reference-press"||p==="escape-key")&&(c.current=!0)}return o.on("openchange",h),()=>{o.off("openchange",h)}},[o,a]),N.useEffect(()=>()=>{on(u)},[]);const d=N.useMemo(()=>({onMouseLeave(){c.current=!1},onFocus(h){if(c.current)return;const g=hi(h.nativeEvent);if(l&&De(g)){if(zu()&&!h.relatedTarget){if(!f.current&&!NC(g))return}else if(!BL(g))return}r(!0,h.nativeEvent,"focus")},onBlur(h){c.current=!1;const g=h.relatedTarget,p=h.nativeEvent,m=De(g)&&g.hasAttribute(xg("focus-guard"))&&g.getAttribute("data-type")==="outside";u.current=window.setTimeout(()=>{var v;const y=Uv(s.domReference?s.domReference.ownerDocument:document);!g&&y===s.domReference||Gs((v=i.current.floatingContext)==null?void 0:v.refs.floating.current,y)||Gs(s.domReference,y)||m||r(!1,p,"focus")})}}),[i,s.domReference,r,l]);return N.useMemo(()=>a?{reference:d}:{},[a,d])}function Hu(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[Qv]:s,[e0]:a,...l}=e;i=l}return{...n==="floating"&&{tabIndex:-1,[NF]:""},...i,...t.map(s=>{const a=s?s[n]:null;return typeof a=="function"?e?a(e):null:a}).concat(e).reduce((s,a)=>(a&&Object.entries(a).forEach(l=>{let[c,u]=l;if(!(o&&[Qv,e0].includes(c)))if(c.indexOf("on")===0){if(r.has(c)||r.set(c,[]),typeof u=="function"){var f;(f=r.get(c))==null||f.push(u),s[c]=function(){for(var d,h=arguments.length,g=new Array(h),p=0;p<h;p++)g[p]=arguments[p];return(d=r.get(c))==null?void 0:d.map(m=>m(...g)).find(m=>m!==void 0)}}}else s[c]=u}),s),{})}}function zC(e){e===void 0&&(e=[]);const t=e.map(a=>a?.reference),n=e.map(a=>a?.floating),r=e.map(a=>a?.item),o=N.useCallback(a=>Hu(a,e,"reference"),t),i=N.useCallback(a=>Hu(a,e,"floating"),n),s=N.useCallback(a=>Hu(a,e,"item"),r);return N.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:s}),[o,i,s])}const KF=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function HC(e,t){var n,r;t===void 0&&(t={});const{open:o,elements:i,floatingId:s}=e,{enabled:a=!0,role:l="dialog"}=t,c=jC(),u=((n=i.domReference)==null?void 0:n.id)||c,f=N.useMemo(()=>{var y;return((y=zL(i.floating))==null?void 0:y.id)||s},[i.floating,s]),d=(r=KF.get(l))!=null?r:l,g=yg()!=null,p=N.useMemo(()=>d==="tooltip"||l==="label"?{["aria-"+(l==="label"?"labelledby":"describedby")]:o?f:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":d==="alertdialog"?"dialog":d,"aria-controls":o?f:void 0,...d==="listbox"&&{role:"combobox"},...d==="menu"&&{id:u},...d==="menu"&&g&&{role:"menuitem"},...l==="select"&&{"aria-autocomplete":"none"},...l==="combobox"&&{"aria-autocomplete":"list"}},[d,f,g,o,u,l]),m=N.useMemo(()=>{const y={id:f,...d&&{role:d}};return d==="tooltip"||l==="label"?y:{...y,...d==="menu"&&{"aria-labelledby":u}}},[d,f,u,l]),v=N.useCallback(y=>{let{active:x,selected:b}=y;const w={role:"option",...x&&{id:f+"-fui-option"}};switch(l){case"select":case"combobox":return{...w,"aria-selected":b}}return{}},[f,l]);return N.useMemo(()=>a?{reference:p,floating:m,item:v}:{},[a,p,m,v])}const UF=e=>N.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M6 9L12 15L18 9",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),GF=e=>N.createElement("svg",{fill:"currentColor",id:"Capa_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 462.035 462.035",xmlSpace:"preserve",...e},N.createElement("g",null,N.createElement("path",{d:"M457.83,158.441c-0.021-0.028-0.033-0.058-0.057-0.087l-50.184-62.48c-0.564-0.701-1.201-1.305-1.879-1.845 c-2.16-2.562-5.355-4.225-8.967-4.225H65.292c-3.615,0-6.804,1.661-8.965,4.225c-0.678,0.54-1.316,1.138-1.885,1.845l-50.178,62.48 c-0.023,0.029-0.034,0.059-0.057,0.087C1.655,160.602,0,163.787,0,167.39v193.07c0,6.5,5.27,11.771,11.77,11.771h438.496 c6.5,0,11.77-5.271,11.77-11.771V167.39C462.037,163.787,460.381,160.602,457.83,158.441z M408.516,134.615l16.873,21.005h-16.873 V134.615z M384.975,113.345v42.274H296.84c-2.514,0-4.955,0.805-6.979,2.293l-58.837,43.299l-58.849-43.305 c-2.023-1.482-4.466-2.287-6.978-2.287H77.061v-42.274H384.975z M53.523,155.62H36.65l16.873-21.005V155.62z M438.498,348.69H23.54 V179.16h137.796l62.711,46.148c4.15,3.046,9.805,3.052,13.954-0.005l62.698-46.144h137.799V348.69L438.498,348.69z"}))),WC=e=>N.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("g",{opacity:.6},N.createElement("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}))),{color:tn,cornerRadius:qF,spacing:gi}=V,Wu={sm:{h:28,p:`${gi.xs} ${gi.sm}`,text:"body-2"},md:{h:32,p:`6px ${gi.md}`,text:"body-2"},lg:{h:40,p:`${gi.sm} ${gi.lg}`,text:"body-1"}},wg=S.forwardRef(({label:e,color:t="primary",size:n="md",onClick:r,onDelete:o,avatar:i,icon:s,disabled:a,className:l,labelClassName:c,avatarClassName:u,iconClassName:f,deleteButtonClassName:d},h)=>{const g=S.useRef(null),p=S.useMemo(()=>{switch(t){case"primary":return{bg:tn.status.neutralTintLow,color:tn.text.primary};case"accent":return{bg:tn.status.accentTintLow,color:tn.text.accent};case"warning":return{bg:tn.status.warningTintLow,color:tn.text.warning};case"positive":return{bg:tn.status.positiveTintLow,color:tn.text.positive};case"negative":return{bg:tn.status.negativeTintLow,color:tn.text.negative};case"transfer":return{bg:"var(--status-transfer-tint-low)",color:"var(--text-transfer)"};default:return{bg:tn.status.neutralTintLow,color:tn.text.primary}}},[t]),m=T.css({cursor:a?"not-allowed":r?"pointer":"default",opacity:a?.5:1,userSelect:"none",position:"relative",transition:"background-color 0.2s, opacity 0.2s","&:hover":a?void 0:{backgroundColor:p.bg}}),v=T.css({display:"inline-flex",cursor:"pointer",opacity:.6,"&:hover":{opacity:1}});return C.jsxs(q,{ref:y=>{g.current=y,typeof h=="function"?h(y):h&&(h.current=y)},row:!0,alignItems:"center",justifyContent:"center",gap:gi.sm,h:Wu[n].h,p:Wu[n].p,overflow:"hidden",borderRadius:qF.sm,backgroundColor:p.bg,color:p.color,onClick:r,className:T.cx(m,l),children:[r&&C.jsx(zo,{}),i&&C.jsx(q,{w:20,h:20,borderRadius:"50%",overflow:"hidden",className:u,children:i}),s&&C.jsx(q,{className:f,children:s}),typeof e=="string"?C.jsx(le,{variant:Wu[n].text,colorName:t,textOverflow:"ellipsis",overflow:"hidden",className:c,children:e}):e,o&&!a&&C.jsx(le,{className:T.cx(v,d),colorName:t,onClick:y=>{y.stopPropagation(),o(y)},children:C.jsx(WC,{})})]})});wg.displayName="Tag";const{color:At,cornerRadius:ps}=V,a0=T.css({borderColor:At.border.negativePrimary}),Ku=T.css({cursor:"not-allowed",opacity:.5}),KC=T.css({display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",color:"#9ca3af","& svg":{width:20,height:20,transition:"transform 0.2s ease-in"}}),YF=T.css({[`& .${KC} svg`]:{transform:"rotateX(180deg)"}}),dt={"select-container":T.css({position:"relative",display:"inline-block",minWidth:120,"&.full-width":{width:"100%"}}),"full-width":T.css({width:"100%"}),"select-input":T.css({border:`1px solid ${At.border.neutralAlphaBasic}`,borderRadius:ps.md,cursor:"pointer",transition:"all 0.2s ease-in-out",boxSizing:"border-box",[`&:hover:not(.${Ku})`]:{borderColor:At.border.neutralAlphaHigh,backgroundColor:At.fill.neutralPrimaryHover},[`&:focus:not(.${Ku})`]:{outline:"none",borderColor:At.border.accentPrimary},[`&.${a0}:focus`]:{boxShadow:`0 0 0 3px ${At.effect.shadowS}`}}),"size-xs":T.css({minHeight:32,padding:"8px 8px 8px 12px",borderRadius:ps.sm}),"size-sm":T.css({minHeight:40,padding:"10px 12px 10px 16px",borderRadius:ps.sm}),"size-md":T.css({minHeight:48,padding:"14px 12px 14px 16px",borderRadius:ps.md}),"background-primary":T.css({backgroundColor:At.fill.bgPrimary}),"background-secondary":T.css({backgroundColor:At.fill.bgSecondary}),error:a0,disabled:Ku,open:YF,"select-value":T.css({flex:1,color:At.text.primary,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",alignSelf:"center",...ye.common,...ye.body2}),"select-value_xs":T.css({...ye.common,...ye.caption1}),hidden:T.css({visibility:"hidden"}),visible:T.css({visibility:"visible"}),"select-arrow":KC,"select-dropdown":T.css({marginTop:4,backgroundColor:At.fill.bgPrimary,borderRadius:ps.md,boxShadow:`0 4px 20px 0 ${At.effect.shadowS}`,maxHeight:224,overflow:"hidden"}),"select-menu":T.css({maxHeight:224,overflowY:"auto",padding:"4px 0","&::-webkit-scrollbar":{width:3},"&::-webkit-scrollbar-track":{background:"#f1f1f1"},"&::-webkit-scrollbar-thumb":{background:"#c1c1c1",borderRadius:3,"&:hover":{background:At.fill.neutralSecondary}}}),"select-menu-item":T.css({cursor:"pointer",transition:"background-color 0.15s ease-in-out",color:At.text.primary,padding:10,overflow:"hidden",textOverflow:"ellipsis","&:hover":{backgroundColor:At.fill.neutralSecondaryHover}}),"select-menu-item-first":T.css({"&:hover":{cursor:"auto",backgroundColor:"inherit"}}),selected:T.css({backgroundColor:At.fill.neutralSecondary}),"overflow-tooltip-container":T.css({width:"100%",position:"relative"}),"overflow-tooltip-text":T.css({width:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),"empty-block":T.css({textAlign:"center",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",padding:14})},XF={xs:T.css({width:16,height:16,"& svg":{width:16,height:16,transition:"transform 0.2s ease-in"}}),sm:T.css({}),md:T.css({})};function Cg({value:e,onChange:t,multiple:n=!1,returnedValue:r,renderItem:o,renderInputItem:i,renderSingleInputItem:s,renderMultipleInputItem:a,renderDropdownItem:l,placeholder:c,items:u=[],fullWidth:f,size:d="md",showDefaultItem:h,disabled:g,label:p,firstItem:m,lastItem:v,observer:y,emptyText:x,onBlur:b,prompt:w,error:_,errorText:E,dropdownMaxWidth:R=400,dropdownMinWidth:k=120,minWidth:M=120,width:F,background:D="secondary",dropdownClassName:j,className:I,triggerClassName:$,menuClassName:H,itemClassName:O,labelClassName:P,promptClassName:K,errorClassName:G}){const[re,U]=Bo(e,n?[]:null),[Z,Q]=S.useState(!1),{refs:ne,floatingStyles:oe}=bg({open:Z,strategy:"fixed",middleware:[gg(4),mg({crossAxis:!0,fallbackAxisSideDirection:"start"}),pg({crossAxis:!0,padding:8}),kF({apply({availableHeight:se,availableWidth:Re,elements:Ye,rects:rt}){const It=Math.min(typeof Re=="number"?Re-64:R,R),to=rt.reference.width,no=Math.max(to,k);Object.assign(Ye.floating.style,{maxHeight:typeof se=="number"?`${se}px`:"auto",maxWidth:`${It}px`,minWidth:`${no}px`,width:"max-content"})}})],whileElementsMounted:hg}),me=S.useMemo(()=>n?re||[]:re!=null?[re]:[],[re,n]),ee=S.useCallback(se=>r?r(se):se,[r]),xe=S.useMemo(()=>{const se=new Map;return u.forEach(Re=>{se.set(ee(Re),Re)}),se},[u,ee]),Se=!u.length&&!_,Ee=S.useMemo(()=>me.map(se=>xe.get(se)).filter(se=>!!se),[xe,me]);S.useEffect(()=>{process.env.NODE_ENV!=="production"&&o&&!l&&console.warn("[Select] `renderItem` deprecated, use `renderDropdownItem` instead.")},[l,o]);const ze=S.useCallback((se,Re)=>l?l(se,Re):o?o(se):String(se),[l,o]),je=()=>{Q(!1),b?.()},Rt=se=>{const Re=ee(se);if(n){const Ye=me.includes(Re)?me.filter(rt=>rt!==Re):[...me,Re];U(Ye),t?.(Ye)}else U(Re),t?.(Re),je()},gn=se=>{if(!n)return;const Re=me.filter(Ye=>Ye!==se);U(Re),t?.(Re)},ot=()=>{const se=n?[]:null;U(se),t?.(se),n||je()},Gt=()=>typeof c=="string"?C.jsx(le,{variant:d==="xs"?"caption-1":"body-2",textOverflow:"ellipsis",overflow:"hidden",colorName:"tertiary",children:c??"Select..."}):c,Qt=()=>{if(!me.length)return Gt();if(n)return a?a(Ee):i?i({mode:"multiple",selectedItems:Ee}):C.jsx(q,{flexWrap:"wrap",row:!0,gap:10,children:me.map(Ye=>{const rt=xe.get(Ye);return rt?C.jsx(wg,{size:"sm",label:o?o(rt):String(Ye),onDelete:It=>{It.stopPropagation(),gn(Ye)}},Ye):null})});const se=xe.get(me[0])??null;if(!se)return Gt();if(s)return s(se);if(i)return i({mode:"single",selectedItem:se});const Re=o?o(se):String(me[0]);return typeof Re=="string"?C.jsx(le,{variant:d==="xs"?"caption-1":"body-2",tag:"p",textOverflow:"ellipsis",overflow:"hidden",children:Re}):C.jsx(C.Fragment,{children:Re})},pt=Z&&C.jsx(ts,{children:C.jsx(q,{row:!0,top:0,right:0,bottom:0,left:0,position:"fixed",center:!0,flex:1,onClick:je,display:"block",backgroundColor:"transparent",zIndex:1,children:C.jsx(ea.div,{ref:ne.setFloating,className:T.cx(dt["select-dropdown"],j),initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.25,ease:"easeInOut"},style:{...oe,zIndex:1},onMouseDown:se=>se.stopPropagation(),onClick:se=>se.stopPropagation(),children:C.jsxs("ul",{className:T.cx(dt["select-menu"],H),children:[h&&!n&&C.jsx(q,{className:T.cx(dt["select-menu-item"],O),role:"option",onClick:ot,children:C.jsx(le,{variant:"body-2",colorName:"tertiary",children:c})}),m&&C.jsx(q,{className:T.cx(dt["select-menu-item"],dt["select-menu-item-first"],O),children:m}),Se&&C.jsxs(q,{className:dt["empty-block"],children:[C.jsx(q,{w:20,h:20,children:C.jsx(GF,{})}),C.jsx(le,{variant:"body-2",children:x??"There is nothing yet"})]}),u.map((se,Re)=>{const Ye=ee(se),rt=me.includes(Ye),It=ze(se,{item:se,selected:rt,index:Re}),to=typeof It=="string";return C.jsxs(q,{row:!0,gap:10,alignItems:"center",className:T.cx(dt["select-menu-item"],{[dt.selected]:rt},O),role:"option",relative:!0,onClick:()=>Rt(se),children:[n&&C.jsx(hh,{size:"sm",checked:rt}),to?C.jsx(le,{variant:"body-2",tag:"p",wordBreak:"break-all",whiteSpace:"break-spaces",children:It}):It,C.jsx(zo,{})]},Ye)}),y,v&&C.jsx(q,{className:T.cx(dt["select-menu-item"],dt["select-menu-item-first"],O),children:v})]})},"dropdown")})});return C.jsxs(q,{relative:!0,display:"inline-block",minWidth:M,w:F||(f?"full":"auto"),onMouseDown:se=>se.stopPropagation(),onClick:se=>se.stopPropagation(),className:I,children:[typeof p=="string"?C.jsx(le,{variant:"body-2",colorName:"tertiary",fontWeight:"regular",mb:d==="sm"?4:8,className:P,children:p}):p,C.jsxs(q,{ref:ne.setReference,row:!0,gap:10,tabIndex:g?-1:0,role:"button",alignItems:"flex-start","aria-haspopup":"listbox",relative:!0,w:"100%",className:T.cx(dt["select-input"],dt[`size-${d}`],dt[`background-${D}`],{[dt.error]:_,[dt.disabled]:g,[dt.open]:Z},$),onClick:()=>!g&&Q(se=>!se),children:[C.jsx(q,{className:T.cx(dt["select-value"]),children:Qt()}),C.jsx(q,{className:T.cx(dt["select-arrow"],XF[d]),children:C.jsx(UF,{})})]}),typeof w=="string"?C.jsx(le,{variant:"caption-1",colorName:"tertiary",mt:4,className:K,children:w}):w,_&&E&&C.jsx(le,{tag:"p",colorName:"negative",variant:"body-2",mt:5,className:G,children:E}),C.jsx(Dx,{children:pt})]})}const ZF=e=>N.createElement("svg",{width:10,height:10,viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M3.94629 0.220237C3.78013 0.264025 3.64089 0.377624 3.56348 0.53176C3.27371 1.11189 3.05664 1.46395 2.83887 1.74953C2.61807 2.03873 2.38547 2.27579 2.03027 2.63039C1.21079 3.45057 0.799805 4.52619 0.799805 5.60012C0.799838 6.67406 1.21073 7.74968 2.03027 8.56985C3.67062 10.2096 6.32931 10.2095 7.96973 8.56985C8.78929 7.74968 9.20016 6.67408 9.2002 5.60012C9.15131 4.32908 8.43217 3.48543 7.94727 3.05813C7.76902 2.90106 7.40643 3.02424 7.2627 3.2134C7.24031 3.24286 7.21612 3.2739 7.18945 3.30617C6.93211 3.61754 6.56236 3.80807 6.41504 3.83156C6.38264 3.83667 6.36979 3.76513 6.2959 3.58254C5.79455 2.34427 5.78927 2.49365 5.58887 2.01125C5.48847 1.7692 5.05517 1.02727 4.92676 0.828635C4.80206 0.635591 4.64095 0.439873 4.43359 0.301292C4.29028 0.205951 4.1124 0.175957 3.94629 0.220237ZM4.75293 4.17824C5.2689 4.63997 5.60857 5.26651 5.71484 5.95071C6.10631 5.85571 6.46727 5.68318 6.78125 5.45071C6.86578 5.70826 6.89338 5.98123 6.8623 6.25051C6.83115 6.51993 6.74174 6.77966 6.60059 7.01125C6.45944 7.24281 6.27008 7.44117 6.04492 7.59231C5.81977 7.74344 5.56462 7.8443 5.29688 7.88723C5.0292 7.93013 4.75518 7.91446 4.49414 7.84133C4.23299 7.76812 3.99064 7.6383 3.78418 7.46242C3.5778 7.28657 3.41161 7.06792 3.29785 6.8218C3.18419 6.57572 3.12519 6.30771 3.125 6.03664C3.12508 5.58233 3.29054 5.14308 3.58984 4.80129C3.88917 4.4597 4.30271 4.2382 4.75293 4.17824Z",fill:"#FEAD34"})),JF=e=>N.createElement("svg",{width:12,height:12,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M10.1483 8.61509C10.3344 8.26159 9.98299 7.89856 9.58534 7.93723C9.42671 7.95265 9.25857 7.9605 9.07422 7.96035C6.36522 7.9582 4.17129 5.76427 4.16914 3.05527C4.169 2.87115 4.17682 2.70321 4.19221 2.54477C4.23082 2.14712 3.86769 1.79411 3.50976 1.97161C2.03398 2.70343 1.20002 4.02274 1.20002 5.89477C1.20002 8.60377 3.3961 10.7998 6.1051 10.7998C7.97571 10.7998 9.38737 10.06 10.1483 8.61509Z",fill:"white"})),{color:nn,cornerRadius:l0,height:Uu,spacing:QF,transition:c0}=V,$n={container:T.css({width:"100%",cursor:"pointer",outline:"none",userSelect:"none",display:"flex",justifyContent:"space-between",gap:QF.md,"&.disabled":{cursor:"not-allowed",opacity:.5},"&.reverse":{flexDirection:"row-reverse"}}),disabled:T.css({cursor:"not-allowed",opacity:.5}),reverse:T.css({flexDirection:"row-reverse"}),switchContainer:T.css({"--width-switch-sm":"34px","--width-switch-md":"40px","--width-switch-lg":"52px","--size-thumb-sm":"18px","--size-thumb-md":"20px","--size-thumb-lg":"28px","--thumb-translate":"0px","&:has(input:checked)":{"--thumb-translate":"calc(var(--switch-width) - var(--thumb-width) - 4px)"}}),variant_accent:T.css({"&:has(input:not(:checked))":{"--switch-bg-color":nn.fill.bgTertiary,"--thumb-bg-color":nn.fill.bgPrimary},"&:has(input:checked)":{"--switch-bg-color":nn.fill.accentPrimary,"--thumb-bg-color":nn.fill.bgPrimary}}),variant_secondary:T.css({"&:has(input:not(:checked))":{"--switch-bg-color":nn.fill.bgTertiary,"--thumb-bg-color":nn.fill.bgPrimary},"&:has(input:checked)":{"--switch-bg-color":nn.fill.accentSecondary,"--thumb-bg-color":nn.fill.accentPrimary}}),variant_theme:T.css({"&:has(input:not(:checked))":{"--switch-bg-color":nn.fill.bgTertiary,"--thumb-bg-color":nn.fill.bgPrimary},"&:has(input:checked)":{"--switch-bg-color":nn.fill.bgSecondary,"--thumb-bg-color":nn.fill.bgTertiary}}),size_sm:T.css({"--switch-width":"var(--width-switch-sm)","--switch-height":Uu.switch.sm,"--thumb-width":"var(--size-thumb-sm)","--thumb-height":"var(--size-thumb-sm)"}),size_md:T.css({"--switch-width":"var(--width-switch-md)","--switch-height":Uu.switch.md,"--thumb-width":"var(--size-thumb-md)","--thumb-height":"var(--size-thumb-md)"}),size_lg:T.css({"--switch-width":"var(--width-switch-lg)","--switch-height":Uu.switch.lg,"--thumb-width":"var(--size-thumb-lg)","--thumb-height":"var(--size-thumb-lg)"}),switch:T.css({width:"var(--switch-width)",height:"var(--switch-height)",transition:c0.general,display:"flex",alignItems:"center",padding:2,backgroundColor:"var(--switch-bg-color)",borderRadius:l0.xl}),thumb:T.css({display:"flex",alignItems:"center",justifyContent:"center",padding:4,transition:c0.general,transform:"translateX(var(--thumb-translate, 0))",width:"var(--thumb-width)",height:"var(--thumb-height)",backgroundColor:"var(--thumb-bg-color)",borderRadius:l0.fullRound}),moon:T.css({width:"100%",height:"100%"}),fire:T.css({width:"100%",height:"100%"})},{spacing:u0}=V,UC=S.forwardRef(({title:e,text:t,icon:n,disabled:r,onChange:o,checked:i,defaultValue:s,className:a,wrapperClassName:l,switchContainerClassName:c,trackClassName:u,thumbClassName:f,inputClassName:d,labelsContainerClassName:h,titleClassName:g,textClassName:p,size:m="md",variant:v="accent",reverse:y=!1,w:x="auto",...b},w)=>{const[_,E]=Bo(i,s),R=S.useRef(null);S.useImperativeHandle(w,()=>({focus:()=>{R.current?.focus()},blur:()=>{R.current?.blur()},get checked(){return _??!1},setChecked:D=>{E(D),o?.(D)},toggle:()=>{const D=!_;E(D),o?.(D)},isFocused:()=>document.activeElement===R.current,isDisabled:()=>r??!1,getInputElement:()=>R.current,checkValidity:()=>R.current?.checkValidity()??!0,reset:()=>{const D=s??!1;E(D),o?.(D)}}),[_,E,o,r,s]);const k=S.useCallback(D=>{E(D.target.checked),o?.(D.target.checked)},[o]),M=S.useMemo(()=>typeof e=="string"?C.jsx(le,{variant:"body-1",colorName:"primary",fontWeight:"medium",className:g,children:e}):e,[e,g]),F=S.useMemo(()=>typeof t=="string"?C.jsx(le,{variant:"body-2",colorName:"secondary",fontWeight:"regular",className:p,children:t}):t,[t,p]);return C.jsxs(q,{row:!0,w:x,gap:u0.sm,className:l,children:[C.jsxs("label",{className:T.cx($n.container,a,{[$n.disabled]:r,[$n.reverse]:y}),children:[C.jsxs(q,{className:T.cx($n.switchContainer,$n[`size_${m}`],$n[`variant_${v}`],c),children:[C.jsx("input",{ref:R,type:"checkbox",checked:_,hidden:!0,onChange:k,disabled:r,className:d,...b}),C.jsx("div",{className:T.cx($n.switch,u),children:C.jsx("div",{className:T.cx($n.thumb,f),children:v==="theme"&&(_?C.jsx(JF,{className:$n.moon}):C.jsx(ZF,{className:$n.fire}))})})]}),(M||F)&&C.jsxs(q,{gap:u0.xs,className:h,children:[M,F]})]}),n]})});UC.displayName="Switch";const{spacing:d0}=V,e$=T.css({cursor:"pointer",userSelect:"none"}),t$=T.css({cursor:"not-allowed",opacity:.5}),n$=T.css({transition:"color 0.2s ease"}),r$=S.forwardRef(({label:e,selected:t,disabled:n,fullWidth:r,onClick:o,className:i,activeClassName:s,textClassName:a},l)=>C.jsx(q,{w:r?"full":void 0,justifyContent:"center",alignItems:"center",ref:l,py:d0.md,px:d0.xl,onClick:o,className:T.cx(e$,{[t$]:n},i,t&&s),children:C.jsx(le,{className:T.cx(n$,a),colorName:t?"primary":"tertiary",fontWeight:"medium",variant:"body-2",children:e})})),{color:GC}=V,o$=T.css({borderBottom:`1px solid ${GC.border.neutralAlphaBasic}`}),qC=({value:e,onChange:t,options:n,fullWidth:r=!1,className:o,tabClassName:i,activeTabClassName:s,tabTextClassName:a,indicatorClassName:l})=>{const[c,u]=S.useState({left:0,width:0}),f=S.useRef([]),d=g=>p=>{f.current[g]=p};S.useEffect(()=>{const g=n.findIndex(m=>m.value===e),p=f.current[g];p&&u({left:p.offsetLeft,width:p.offsetWidth})},[e,n]);const h=(g,p=!1)=>()=>!p&&t(g);return C.jsxs(q,{row:!0,w:r?"full":"auto",relative:!0,className:T.cx(o$,o),children:[n.map((g,p)=>C.jsx(r$,{selected:e===g.value,onClick:h(g.value,g.disabled),ref:d(p),label:g.label,disabled:g.disabled,fullWidth:r,className:i,activeClassName:s,textClassName:a},g.value)),C.jsx(q,{h:2,w:c.width,absolute:!0,bottom:-1,left:c.left,backgroundColor:GC.border.accentPrimary,className:T.cx(T.css({transition:"left 0.2s ease, width 0.2s ease"}),l)})]})};qC.displayName="Tabs";const YC=S.forwardRef(({title:e,subtitle:t,w:n="full",p:r,py:o,px:i=V.spacing["2xl"],pt:s=V.spacing["2xl"],pb:a=V.spacing.lg,row:l=!0,justifyContent:c="space-between",showCloseButton:u=!1,className:f,titleClassName:d,subtitleClassName:h,closeButtonClassName:g},p)=>{const{onClose:m}=Y_();return C.jsxs(q,{w:n,p:r,py:o,px:i,pt:s,pb:a,row:l,justifyContent:c,ref:p,borderColor:V.color.border.neutralAlphaBasic,borderWidth:0,borderBottomWidth:1,borderStyle:"solid",className:f,children:[C.jsxs(q,{gap:V.spacing.sm,children:[C.jsx(le,{variant:"title-3",colorName:"primary",fontWeight:"semibold",className:d,children:e}),C.jsx(le,{variant:"body-1",colorName:"tertiary",fontWeight:"medium",className:h,children:t})]}),u&&C.jsx(q,{children:C.jsx(pr,{onClick:m,color:"neutral",className:g,children:C.jsx(B0,{})})})]})});YC.displayName="ModalHeader";function ii(e,t,n){let r=n.initialDeps??[],o,i=!0;function s(){var a,l,c;let u;n.key&&((a=n.debug)!=null&&a.call(n))&&(u=Date.now());const f=e();if(!(f.length!==r.length||f.some((g,p)=>r[p]!==g)))return o;r=f;let h;if(n.key&&((l=n.debug)!=null&&l.call(n))&&(h=Date.now()),o=t(...f),n.key&&((c=n.debug)!=null&&c.call(n))){const g=Math.round((Date.now()-u)*100)/100,p=Math.round((Date.now()-h)*100)/100,m=p/16,v=(y,x)=>{for(y=String(y);y.length<x;)y=" "+y;return y};console.info(`%c⏱ ${v(p,5)} /${v(g,5)} ms`,`
63
+ `)}})(e,n)(t)}function m6({defaultSelection:e}){const[t]=lt();return S.useEffect(()=>{t.focus(()=>{const n=document.activeElement,r=t.getRootElement();r===null||n!==null&&r.contains(n)||r.focus({preventScroll:!0})},{defaultSelection:e})},[e,t]),null}const hC=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,y6=hC?S.useLayoutEffect:S.useEffect,Ba={tag:Ri};function gC({initialConfig:e,children:t}){const n=S.useMemo(()=>{const{theme:r,namespace:o,nodes:i,onError:s,editorState:a,html:l}=e,c=BA(null,r),u=Kb({editable:e.editable,html:l,namespace:o,nodes:i,onError:f=>s(f,u),theme:r});return(function(f,d){if(d!==null){if(d===void 0)f.update(()=>{const h=qe();if(h.isEmpty()){const g=ye();h.append(g);const p=hC?document.activeElement:null;(Z()!==null||p!==null&&p===f.getRootElement())&&g.select()}},Ba);else if(d!==null)switch(typeof d){case"string":{const h=f.parseEditorState(d);f.setEditorState(h,Ba);break}case"object":f.setEditorState(d,Ba);break;case"function":f.update(()=>{qe().isEmpty()&&d(f)},Ba)}}})(u,a),[u,c]},[]);return y6(()=>{const r=e.editable,[o]=n;o.setEditable(r===void 0||r)},[]),C.jsx(q1.Provider,{value:n,children:t})}function v6(){return qe().getTextContent()}function x6(e,t=!0){if(e)return!1;let n=v6();return t&&(n=n.trim()),n===""}function b6(e){if(!x6(e,!1))return!1;const t=qe().getChildren(),n=t.length;if(n>1)return!1;for(let r=0;r<n;r++){const o=t[r];if(Te(o))return!1;if(B(o)){if(!Qr(o)||o.__indent!==0)return!1;const i=o.getChildren(),s=i.length;for(let a=0;a<s;a++){const l=i[r];if(!J(l))return!1}}}return!0}function pC(e){return()=>b6(e)}function w6(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function C6(e,t,n,r){const o=s=>s instanceof n,i=s=>{const a=Fe(s.getTextContent());a.setFormat(s.getFormat()),s.replace(a)};return[e.registerNodeTransform(fn,s=>{if(!s.isSimpleText())return;let a,l=s.getPreviousSibling(),c=s.getTextContent(),u=s;if(J(l)){const d=l.getTextContent(),h=t(d+c);if(o(l)){if(h===null||(g=>g.getLatest().__mode)(l)!==0)return void i(l);{const g=h.end-d.length;if(g>0){const p=d+c.slice(0,g);if(l.select(),l.setTextContent(p),g===c.length)s.remove();else{const m=c.slice(g);s.setTextContent(m)}return}}}else if(h===null||h.start<d.length)return}let f=0;for(;;){a=t(c);let d,h=a===null?"":c.slice(a.end);if(c=h,h===""){const p=u.getNextSibling();if(J(p)){h=u.getTextContent()+p.getTextContent();const m=t(h);if(m===null)return void(o(p)?i(p):p.markDirty());if(m.start!==0)return}}if(a===null)return;if(a.start===0&&J(l)&&l.isTextEntity()){f+=a.end;continue}a.start===0?[d,u]=u.splitText(a.end):[,d,u]=u.splitText(a.start+f,a.end+f),d===void 0&&w6(165,"nodeToReplace");const g=r(d);if(g.setFormat(d.getFormat()),d.replace(g),u==null)return;f=0,l=g}}),e.registerNodeTransform(n,s=>{const a=s.getTextContent(),l=t(a);if(l===null||l.start!==0)return void i(s);if(a.length>l.end)return void s.splitText(l.end);const c=s.getPreviousSibling();J(c)&&c.isTextEntity()&&(i(c),i(s));const u=s.getNextSibling();J(u)&&u.isTextEntity()&&(i(u),o(s)&&i(s))})]}let wc=class mC extends fn{static getType(){return"hashtag"}static clone(t){return new mC(t.__text,t.__key)}createDOM(t){const n=super.createDOM(t);return et(n,t.theme.hashtag),n}static importJSON(t){return yC().updateFromJSON(t)}canInsertTextBefore(){return!1}isTextEntity(){return!0}};function yC(e=""){return Et(new wc(e))}const S6=new RegExp((function(){const{alpha:e,alphanumeric:t,hashChars:n}=(function(){const o=String.fromCharCode,i="A-Za-zªµºÀ-ÖØ-öø-Ɂɐ-ˁˆ-ˑˠ-ˤˮͺΆΈ-ΊΌΎ-ΡΣ-ώϐ-ϵϷ-ҁҊ-ӎӐ-ӹԀ-ԏԱ-Ֆՙա-ևא-תװ-ײء-غـ-يٮ-ٯٱ-ۓەۥ-ۦۮ-ۯۺ-ۼۿܐܒ-ܯݍ-ݭހ-ޥޱऄ-हऽॐक़-ॡॽঅ-ঌএ-ঐও-নপ-রলশ-হঽৎড়-ঢ়য়-ৡৰ-ৱਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલ-ળવ-હઽૐૠ-ૡଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହଽଡ଼-ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-ஹఅ-ఌఎ-ఐఒ-నప-ళవ-హౠ-ౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠ-ೡഅ-ഌഎ-ഐഒ-നപ-ഹൠ-ൡඅ-ඖක-නඳ-රලව-ෆก-ะา-ำเ-ๆກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-ະາ-ຳຽເ-ໄໆໜ-ໝༀཀ-ཇཉ-ཪྈ-ྋက-အဣ-ဧဩ-ဪၐ-ၕႠ-Ⴥა-ჺჼᄀ-ᅙᅟ-ᆢᆨ-ᇹሀ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙶᚁ-ᚚᚠ-ᛪᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦩᧁ-ᧇᨀ-ᨖᴀ-ᶿḀ-ẛẠ-ỹἀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₔℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℱℳ-ℹℼ-ℿⅅ-ⅉⰀ-Ⱞⰰ-ⱞⲀ-ⳤⴀ-ⴥⴰ-ⵥⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〆〱-〵〻-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄬㄱ-ㆎㆠ-ㆷㇰ-ㇿ㐀-䶵一-龻ꀀ-ꒌꠀ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢ가-힣豈-鶴侮-頻並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵÀ-ÖØ-öø-ÿĀ-ɏɓ-ɔɖ-ɗəɛɣɨɯɲʉʋʻ̀-ͯḀ-ỿЀ-ӿԀ-ԧⷠ-ⷿꙀ-֑ꚟ-ֿׁ-ׂׄ-ׇׅא-תװ-״﬒-ﬨשׁ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﭏؐ-ؚؠ-ٟٮ-ۓە-ۜ۞-۪ۨ-ۯۺ-ۼۿݐ-ݿࢠࢢ-ࢬࣤ-ࣾﭐ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼ‌-‌ก-ฺเ-๎ᄀ-ᇿ㄰-ㆅꥠ-꥿가-힯ힰ-퟿ᄀ-ᅵァ-ヺー-ヾヲ-゚0-9A-Za-zぁ-ゖ゙-ゞ㐀-䶿一-鿿"+o(173824)+"-"+o(177983)+o(177984)+"-"+o(178207)+o(194560)+"-"+o(195103)+"〃々〻";return{alpha:i,alphanumeric:i+"̀-ͯ҃-֑҆-ֹֻ-ֽֿׁ-ׂׄ-ׇׅؐ-ًؕ-ٰٞۖ-ۜ۟-ۤۧ-۪ۨ-ܑۭܰ-݊ަ-ްँ-ः़ा-्॑-॔ॢ-ॣঁ-ঃ়া-ৄে-ৈো-্ৗৢ-ৣਁ-ਃ਼ਾ-ੂੇ-ੈੋ-੍ੰ-ੱઁ-ઃ઼ા-ૅે-ૉો-્ૢ-ૣଁ-ଃ଼ା-ୃେ-ୈୋ-୍ୖ-ୗஂா-ூெ-ைொ-்ௗఁ-ఃా-ౄె-ైొ-్ౕ-ౖಂ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕ-ೖം-ഃാ-ൃെ-ൈൊ-്ൗං-ඃ්ා-ුූෘ-ෟෲ-ෳัิ-ฺ็-๎ັິ-ູົ-ຼ່-ໍ༘-༹༙༵༷༾-༿ཱ-྄྆-྇ྐ-ྗྙ-ྼ࿆ာ-ဲံ-္ၖ-ၙ፟ᜒ-᜔ᜲ-᜴ᝒ-ᝓᝲ-ᝳា-៓៝᠋-᠍ᢩᤠ-ᤫᤰ-᤻ᦰ-ᧀᧈ-ᧉᨗ-ᨛ᷀-᷃⃐-⃥⃜⃡-⃫〪-゙〯-゚ꠂ꠆ꠋꠣ-ꠧﬞ︀-️︠-︣0-9٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௦-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩၀-၉០-៩᠐-᠙᥆-᥏᧐-᧙0-9_",hashChars:"#\\uFF03"}})(),r="["+t+"]";return"("+("^|$|[^&/"+t+"]")+")("+("["+n+"]")+")("+r+"*"+("["+e+"]")+r+"*)"})(),"i"),_6={getHashtagMatch:function(e){const t=S6.exec(e);if(t===null)return null;const n=t[3].length+1,r=t.index+t[1].length;return{end:r+n,start:r}}};function T6(e,t=_6){return Nn(...C6(e,t.getHashtagMatch,wc,n=>yC(n.getTextContent())))}function E6(){const[e]=lt();return S.useEffect(()=>{if(!e.hasNodes([wc]))throw new Error("HashtagPlugin: HashtagNode not registered on editor");return T6(e)},[e]),null}function R6({hasStrictIndent:e=!1}){const[t]=lt();return S.useEffect(()=>{if(!t.hasNodes([Uo,eo]))throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[t]),S.useEffect(()=>{if(e)return iP(t)},[t,e]),(function(n){S.useEffect(()=>oP(n),[n])})(t),null}function gv(e,t){return e.getEditorState().read(()=>{const n=Pe(t);return n!==null&&n.isSelected()})}function k6(e){const[t]=lt(),[n,r]=S.useState(()=>gv(t,e));return S.useEffect(()=>{let o=!0;const i=t.registerUpdateListener(()=>{o&&r(gv(t,e))});return()=>{o=!1,i()}},[t,e]),[n,S.useCallback(o=>{t.update(()=>{let i=Z();Ct(i)||(i=Vh(),Ge(i)),Ct(i)&&(o?i.add(e):i.delete(e))})},[t,e]),S.useCallback(()=>{t.update(()=>{const o=Z();Ct(o)&&o.clear()})},[t])]}function A6({nodeKey:e}){const[t]=lt(),[n,r,o]=k6(e);return S.useEffect(()=>Nn(t.registerCommand(ic,i=>{const s=t.getElementByKey(e);return i.target===s&&(i.shiftKey||o(),r(!n),!0)},ur)),[o,t,n,e,r]),S.useEffect(()=>{const i=t.getElementByKey(e),s=t._config.theme.hrSelected??"selected";i!==null&&(n?et(i,s):Xn(i,s))},[t,n,e]),null}let vC=class xC extends cg{static getType(){return"horizontalrule"}static clone(t){return new xC(t.__key)}static importJSON(t){return pg().updateFromJSON(t)}static importDOM(){return{hr:()=>({conversion:N6,priority:0})}}decorate(){return C.jsx(A6,{nodeKey:this.__key})}};function N6(){return{node:pg()}}function pg(){return Et(new vC)}const M6=[{dependencies:[vC],export:e=>qM(e)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(e,t,n,r)=>{const o=pg();r||e.getNextSibling()!=null?e.replace(o):e.insertBefore(o),o.selectNext()},type:"element"},...ga];function P6({transformers:e=M6}){const[t]=lt();return S.useEffect(()=>g6(t,e),[t,e]),null}const L6=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?S.useLayoutEffect:S.useEffect;function F6({ignoreHistoryMergeTagChange:e=!0,ignoreSelectionChange:t=!1,onChange:n}){const[r]=lt();return L6(()=>{if(n)return r.registerUpdateListener(({editorState:o,dirtyElements:i,dirtyLeaves:s,prevEditorState:a,tags:l})=>{t&&i.size===0&&s.size===0||e&&l.has(Ri)||a.isEmpty()||n(o,r,l)})},[r,e,t,n]),null}const mg=/^(\d+(?:\.\d+)?)px$/,st={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class Mn extends Tt{__colSpan;__rowSpan;__headerState;__width;__backgroundColor;__verticalAlign;static getType(){return"tablecell"}static clone(t){return new Mn(t.__headerState,t.__colSpan,t.__width,t.__key)}afterCloneFrom(t){super.afterCloneFrom(t),this.__rowSpan=t.__rowSpan,this.__backgroundColor=t.__backgroundColor,this.__verticalAlign=t.__verticalAlign}static importDOM(){return{td:t=>({conversion:pv,priority:0}),th:t=>({conversion:pv,priority:0})}}static importJSON(t){return un().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setHeaderStyles(t.headerState).setColSpan(t.colSpan||1).setRowSpan(t.rowSpan||1).setWidth(t.width||void 0).setBackgroundColor(t.backgroundColor||null).setVerticalAlign(t.verticalAlign||void 0)}constructor(t=st.NO_STATUS,n=1,r,o){super(o),this.__colSpan=n,this.__rowSpan=1,this.__headerState=t,this.__width=r,this.__backgroundColor=null,this.__verticalAlign=void 0}createDOM(t){const n=document.createElement(this.getTag());return this.__width&&(n.style.width=`${this.__width}px`),this.__colSpan>1&&(n.colSpan=this.__colSpan),this.__rowSpan>1&&(n.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(n.style.backgroundColor=this.__backgroundColor),xf(this.__verticalAlign)&&(n.style.verticalAlign=this.__verticalAlign),et(n,t.theme.tableCell,this.hasHeader()&&t.theme.tableCellHeader),n}exportDOM(t){const n=super.exportDOM(t);if(Be(n.element)){const r=n.element;r.setAttribute("data-temporary-table-cell-lexical-key",this.getKey()),r.style.border="1px solid black",this.__colSpan>1&&(r.colSpan=this.__colSpan),this.__rowSpan>1&&(r.rowSpan=this.__rowSpan),r.style.width=`${this.getWidth()||75}px`,r.style.verticalAlign=this.getVerticalAlign()||"top",r.style.textAlign="start",this.__backgroundColor===null&&this.hasHeader()&&(r.style.backgroundColor="#f2f3f5")}return n}exportJSON(){return{...super.exportJSON(),...xf(this.__verticalAlign)&&{verticalAlign:this.__verticalAlign},backgroundColor:this.getBackgroundColor(),colSpan:this.__colSpan,headerState:this.__headerState,rowSpan:this.__rowSpan,width:this.getWidth()}}getColSpan(){return this.getLatest().__colSpan}setColSpan(t){const n=this.getWritable();return n.__colSpan=t,n}getRowSpan(){return this.getLatest().__rowSpan}setRowSpan(t){const n=this.getWritable();return n.__rowSpan=t,n}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(t,n=st.BOTH){const r=this.getWritable();return r.__headerState=t&n|r.__headerState&~n,r}getHeaderStyles(){return this.getLatest().__headerState}setWidth(t){const n=this.getWritable();return n.__width=t,n}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(t){const n=this.getWritable();return n.__backgroundColor=t,n}getVerticalAlign(){return this.getLatest().__verticalAlign}setVerticalAlign(t){const n=this.getWritable();return n.__verticalAlign=t||void 0,n}toggleHeaderStyle(t){const n=this.getWritable();return(n.__headerState&t)===t?n.__headerState-=t:n.__headerState+=t,n}hasHeaderState(t){return(this.getHeaderStyles()&t)===t}hasHeader(){return this.getLatest().__headerState!==st.NO_STATUS}updateDOM(t){return t.__headerState!==this.__headerState||t.__width!==this.__width||t.__colSpan!==this.__colSpan||t.__rowSpan!==this.__rowSpan||t.__backgroundColor!==this.__backgroundColor||t.__verticalAlign!==this.__verticalAlign}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function xf(e){return e==="middle"||e==="bottom"}function pv(e){const t=e,n=e.nodeName.toLowerCase();let r;mg.test(t.style.width)&&(r=parseFloat(t.style.width));const o=un(n==="th"?st.ROW:st.NO_STATUS,t.colSpan,r);o.__rowSpan=t.rowSpan;const i=t.style.backgroundColor;i!==""&&(o.__backgroundColor=i);const s=t.style.verticalAlign;xf(s)&&(o.__verticalAlign=s);const a=t.style,l=(a&&a.textDecoration||"").split(" "),c=a.fontWeight==="700"||a.fontWeight==="bold",u=l.includes("line-through"),f=a.fontStyle==="italic",d=l.includes("underline");return{after:h=>{const g=[];let p=null;const m=()=>{if(p){const v=p.getFirstChild();Un(v)&&p.getChildrenSize()===1&&v.remove()}};for(const v of h)rM(v)||J(v)||Un(v)?(J(v)&&(c&&v.toggleFormat("bold"),u&&v.toggleFormat("strikethrough"),f&&v.toggleFormat("italic"),d&&v.toggleFormat("underline")),p?p.append(v):(p=ye().append(v),g.push(p))):(g.push(v),m(),p=null);return m(),g.length===0&&g.push(ye()),g},node:o}}function un(e=st.NO_STATUS,t=1,n){return Et(new Mn(e,t,n))}function ge(e){return e instanceof Mn}const bC=ce("INSERT_TABLE_COMMAND");function fe(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}class qr extends Tt{__height;static getType(){return"tablerow"}static clone(t){return new qr(t.__height,t.__key)}static importDOM(){return{tr:t=>({conversion:$6,priority:0})}}static importJSON(t){return ji().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setHeight(t.height)}constructor(t,n){super(n),this.__height=t}exportJSON(){const t=this.getHeight();return{...super.exportJSON(),...t===void 0?void 0:{height:t}}}createDOM(t){const n=document.createElement("tr");return this.__height&&(n.style.height=`${this.__height}px`),et(n,t.theme.tableRow),n}extractWithChild(t,n,r){return r==="html"}isShadowRoot(){return!0}setHeight(t){const n=this.getWritable();return n.__height=t,n}getHeight(){return this.getLatest().__height}updateDOM(t){return t.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function $6(e){const t=e;let n;return mg.test(t.style.height)&&(n=parseFloat(t.style.height)),{after:r=>Ew(r,ge),node:ji(n)}}function ji(e){return Et(new qr(e))}function tt(e){return e instanceof qr}const yg=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,O6=yg&&"documentMode"in document?document.documentMode:null,mv=yg&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);function I6(e,t,n=!0){const r=Sc();for(let o=0;o<e;o++){const i=ji();for(let s=0;s<t;s++){let a=st.NO_STATUS;typeof n=="object"?(o===0&&n.rows&&(a|=st.ROW),s===0&&n.columns&&(a|=st.COLUMN)):n&&(o===0&&(a|=st.ROW),s===0&&(a|=st.COLUMN));const l=un(a),c=ye();c.append(Fe()),l.append(c),i.append(l)}r.append(i)}return r}function D6(e){const t=we(e,n=>Ze(n));if(Ze(t))return t;throw new Error("Expected table cell to be inside of table.")}yg&&"InputEvent"in window&&!O6&&new window.InputEvent("input");const bf=(e,t)=>e===st.BOTH||e===t?t:st.NO_STATUS;function j6(e,t=!0){const[,,n]=zn(e),[r,o]=an(n,e,e),i=r[0].length,{startRow:s}=o;let a=null;if(t){const l=s+e.__rowSpan-1,c=r[l],u=ji();for(let d=0;d<i;d++){const{cell:h,startRow:g}=c[d];if(g+h.__rowSpan-1<=l){const p=c[d].cell.__headerState,m=bf(p,st.COLUMN);u.append(un(m).append(ye()))}else h.setRowSpan(h.__rowSpan+1)}const f=n.getChildAtIndex(l);tt(f)||fe(256),f.insertAfter(u),a=u}else{const l=s,c=r[l],u=ji();for(let d=0;d<i;d++){const{cell:h,startRow:g}=c[d];if(g===l){const p=c[d].cell.__headerState,m=bf(p,st.COLUMN);u.append(un(m).append(ye()))}else h.setRowSpan(h.__rowSpan+1)}const f=n.getChildAtIndex(l);tt(f)||fe(257),f.insertBefore(u),a=u}return a}function V6(e,t=!0,n=!0){const[,,r]=zn(e),[o,i]=an(r,e,e),s=o.length,{startColumn:a}=i,l=t?a+e.__colSpan-1:a-1,c=r.getFirstChild();tt(c)||fe(120);let u=null;function f(g=st.NO_STATUS){const p=un(g).append(ye());return u===null&&(u=p),p}let d=c;e:for(let g=0;g<s;g++){if(g!==0){const w=d.getNextSibling();tt(w)||fe(121),d=w}const p=o[g],m=p[l<0?0:l].cell.__headerState,v=bf(m,st.ROW);if(l<0){wC(d,f(v));continue}const{cell:y,startColumn:x,startRow:b}=p[l];if(x+y.__colSpan-1<=l){let w=y,_=b,E=l;for(;_!==g&&w.__rowSpan>1;){if(E-=y.__colSpan,!(E>=0)){d.append(f(v));continue e}{const{cell:R,startRow:k}=p[E];w=R,_=k}}w.insertAfter(f(v))}else y.setColSpan(y.__colSpan+1)}u!==null&&n&&B6(u);const h=r.getColWidths();if(h){const g=[...h],p=l<0?0:l,m=g[p];g.splice(p,0,m),r.setColWidths(g)}return u}function B6(e){const t=e.getFirstDescendant();t==null?e.selectStart():t.getParentOrThrow().selectStart()}function wC(e,t){const n=e.getFirstChild();n!==null?n.insertBefore(t):e.append(t)}function z6(e){if(e.length===0)return null;const t=D6(e[0]),[n]=Fr(t,null,null);let r=1/0,o=-1/0,i=1/0,s=-1/0;const a=new Set;for(const h of n)for(const g of h){if(!g||!g.cell)continue;const p=g.cell.getKey();if(!a.has(p)&&e.some(m=>m.is(g.cell))){a.add(p);const m=g.startRow,v=g.startColumn,y=g.cell.__rowSpan||1,x=g.cell.__colSpan||1;r=Math.min(r,m),o=Math.max(o,m+y-1),i=Math.min(i,v),s=Math.max(s,v+x-1)}}if(r===1/0||i===1/0)return null;const l=o-r+1,c=s-i+1,u=n[r][i];if(!u.cell)return null;const f=u.cell;f.setColSpan(c),f.setRowSpan(l);const d=new Set([f.getKey()]);for(let h=r;h<=o;h++)for(let g=i;g<=s;g++){const p=n[h][g];if(!p.cell)continue;const m=p.cell,v=m.getKey();d.has(v)||(d.add(v),H6(m)||f.append(...m.getChildren()),m.remove())}return f.getChildrenSize()===0&&f.append(ye()),f}function H6(e){if(e.getChildrenSize()!==1)return!1;const t=e.getFirstChildOrThrow();return!(!Qr(t)||!t.isEmpty())}function W6(e){const[t,n,r]=zn(e),o=t.__colSpan,i=t.__rowSpan;if(o===1&&i===1)return;const[s,a]=an(r,t,t),{startColumn:l,startRow:c}=a,u=t.__headerState&st.COLUMN,f=Array.from({length:o},(g,p)=>{let m=u;for(let v=0;m!==0&&v<s.length;v++)m&=s[v][p+l].cell.__headerState;return m}),d=t.__headerState&st.ROW,h=Array.from({length:i},(g,p)=>{let m=d;for(let v=0;m!==0&&v<s[0].length;v++)m&=s[p+c][v].cell.__headerState;return m});if(o>1){for(let g=1;g<o;g++)t.insertAfter(un(f[g]|h[0]).append(ye()));t.setColSpan(1)}if(i>1){let g;for(let p=1;p<i;p++){const m=c+p,v=s[m];g=(g||n).getNextSibling(),tt(g)||fe(125);let y=null;for(let x=0;x<l;x++){const b=v[x],w=b.cell;b.startRow===m&&(y=w),w.__colSpan>1&&(x+=w.__colSpan-1)}if(y===null)for(let x=o-1;x>=0;x--)wC(g,un(f[x]|h[p]).append(ye()));else for(let x=o-1;x>=0;x--)y.insertAfter(un(f[x]|h[p]).append(ye()))}t.setRowSpan(1)}}function an(e,t,n){const[r,o,i]=Fr(e,t,n);return o===null&&fe(207),i===null&&fe(208),[r,o,i]}function Fr(e,t,n){const r=[];let o=null,i=null;function s(l){let c=r[l];return c===void 0&&(r[l]=c=[]),c}const a=e.getChildren();for(let l=0;l<a.length;l++){const c=a[l];tt(c)||fe(209);const u=s(l);for(let f=c.getFirstChild(),d=0;f!=null;f=f.getNextSibling()){for(ge(f)||fe(147);u[d]!==void 0;)d++;const h={cell:f,startColumn:d,startRow:l},{__rowSpan:g,__colSpan:p}=f;for(let m=0;m<g&&!(l+m>=a.length);m++){const v=s(l+m);for(let y=0;y<p;y++)v[d+y]=h}t!==null&&o===null&&t.is(f)&&(o=h),n!==null&&i===null&&n.is(f)&&(i=h)}}return[r,o,i]}function zn(e){let t;if(e instanceof Mn)t=e;else if("__type"in e){const o=we(e,ge);ge(o)||fe(148),t=o}else{const o=we(e.getNode(),ge);ge(o)||fe(148),t=o}const n=t.getParent();tt(n)||fe(149);const r=n.getParent();return Ze(r)||fe(210),[t,n,r]}function Wl(e,t,n){let r,o=Math.min(t.startColumn,n.startColumn),i=Math.min(t.startRow,n.startRow),s=Math.max(t.startColumn+t.cell.__colSpan-1,n.startColumn+n.cell.__colSpan-1),a=Math.max(t.startRow+t.cell.__rowSpan-1,n.startRow+n.cell.__rowSpan-1);do{r=!1;for(let l=0;l<e.length;l++)for(let c=0;c<e[0].length;c++){const u=e[l][c];if(!u)continue;const f=u.startColumn+u.cell.__colSpan-1,d=u.startRow+u.cell.__rowSpan-1,h=u.startColumn<=s&&f>=o,g=u.startRow<=a&&d>=i;if(h&&g){const p=Math.min(o,u.startColumn),m=Math.max(s,f),v=Math.min(i,u.startRow),y=Math.max(a,d);p===o&&m===s&&v===i&&y===a||(o=p,s=m,i=v,a=y,r=!0)}}}while(r);return{maxColumn:s,maxRow:a,minColumn:o,minRow:i}}function yv(e){const[t,,n]=zn(e),r=n.getChildren(),o=r.length,i=r[0].getChildren().length,s=new Array(o);for(let a=0;a<o;a++)s[a]=new Array(i);for(let a=0;a<o;a++){const l=r[a].getChildren();let c=0;for(let u=0;u<l.length;u++){for(;s[a][c];)c++;const f=l[u],d=f.__rowSpan||1,h=f.__colSpan||1;for(let g=0;g<d;g++)for(let p=0;p<h;p++)s[a+g][c+p]=f;if(t===f)return{colSpan:h,columnIndex:c,rowIndex:a,rowSpan:d};c+=h}}return null}function vv(e){const[[t,n,r,o],[i,s,a,l]]=["anchor","focus"].map(c=>{const u=e[c].getNode(),f=we(u,ge);ge(f)||fe(238,c,u.getKey(),u.getType());const d=f.getParent();tt(d)||fe(239,c);const h=d.getParent();return Ze(h)||fe(240,c),[u,f,d,h]});return o.is(l)||fe(241),{anchorCell:n,anchorNode:t,anchorRow:r,anchorTable:o,focusCell:s,focusNode:i,focusRow:a,focusTable:l}}class Cc{tableKey;anchor;focus;_cachedNodes;dirty;constructor(t,n,r){this.anchor=n,this.focus=r,n._selection=this,r._selection=this,this._cachedNodes=null,this.dirty=!1,this.tableKey=t}getStartEndPoints(){return[this.anchor,this.focus]}isValid(){if(this.tableKey==="root"||this.anchor.key==="root"||this.anchor.type!=="element"||this.focus.key==="root"||this.focus.type!=="element")return!1;const t=Pe(this.tableKey),n=Pe(this.anchor.key),r=Pe(this.focus.key);return t!==null&&n!==null&&r!==null}isBackward(){return this.focus.isBefore(this.anchor)}getCachedNodes(){return this._cachedNodes}setCachedNodes(t){this._cachedNodes=t}is(t){return Ve(t)&&this.tableKey===t.tableKey&&this.anchor.is(t.anchor)&&this.focus.is(t.focus)}set(t,n,r){this.dirty=this.dirty||t!==this.tableKey||n!==this.anchor.key||r!==this.focus.key,this.tableKey=t,this.anchor.key=n,this.focus.key=r,this._cachedNodes=null}clone(){return new Cc(this.tableKey,Kt(this.anchor.key,this.anchor.offset,this.anchor.type),Kt(this.focus.key,this.focus.offset,this.focus.type))}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(t){}insertText(){}hasFormat(t){let n=0;this.getNodes().filter(ge).forEach(o=>{const i=o.getFirstChild();Qr(i)&&(n|=i.getTextFormat())});const r=Kr[t];return(n&r)!==0}insertNodes(t){const n=this.focus.getNode();B(n)||fe(151),Hs(n.select(0,n.getChildrenSize())).insertNodes(t)}getShape(){const{anchorCell:t,focusCell:n}=vv(this),r=yv(t);r===null&&fe(153);const o=yv(n);o===null&&fe(155);const i=Math.min(r.columnIndex,o.columnIndex),s=Math.max(r.columnIndex+r.colSpan-1,o.columnIndex+o.colSpan-1),a=Math.min(r.rowIndex,o.rowIndex),l=Math.max(r.rowIndex+r.rowSpan-1,o.rowIndex+o.rowSpan-1);return{fromX:Math.min(i,s),fromY:Math.min(a,l),toX:Math.max(i,s),toY:Math.max(a,l)}}getNodes(){if(!this.isValid())return[];const t=this._cachedNodes;if(t!==null)return t;const{anchorTable:n,anchorCell:r,focusCell:o}=vv(this),i=o.getParents()[1];if(i!==n){if(n.isParentOf(o)){const m=i.getParent();m==null&&fe(159),this.set(this.tableKey,o.getKey(),m.getKey())}else{const m=n.getParent();m==null&&fe(158),this.set(this.tableKey,m.getKey(),o.getKey())}return this.getNodes()}const[s,a,l]=an(n,r,o),{minColumn:c,maxColumn:u,minRow:f,maxRow:d}=Wl(s,a,l),h=new Map([[n.getKey(),n]]);let g=null;for(let m=f;m<=d;m++)for(let v=c;v<=u;v++){const{cell:y}=s[m][v],x=y.getParent();tt(x)||fe(160),x!==g&&(h.set(x.getKey(),x),g=x),h.has(y.getKey())||U6(y,b=>{h.set(b.getKey(),b)})}const p=Array.from(h.values());return Ji()||(this._cachedNodes=p),p}getTextContent(){const t=this.getNodes().filter(r=>ge(r));let n="";for(let r=0;r<t.length;r++){const o=t[r],i=o.__parent,s=(t[r+1]||{}).__parent;n+=o.getTextContent()+(s!==i?`
64
+ `:" ")}return n}}function Ve(e){return e instanceof Cc}function CC(){const e=Kt("root",0,"element"),t=Kt("root",0,"element");return new Cc("root",e,t)}function K6(e,t,n){e.getKey(),t.getKey(),n.getKey();const r=Z(),o=Ve(r)?r.clone():CC();return o.set(e.getKey(),t.getKey(),n.getKey()),o}function U6(e,t){const n=[[e]];for(let r=n.at(-1);r!==void 0&&n.length>0;r=n.at(-1)){const o=r.pop();o===void 0?n.pop():t(o)!==!1&&B(o)&&n.push(o.getChildren())}}function SC(e,t=es()){const n=Pe(e);Ze(n)||fe(231,e);const r=jo(n,t.getElementByKey(e));return r===null&&fe(232,e),{tableElement:r,tableNode:n}}class G6{focusX;focusY;listenersToRemove;table;isHighlightingCells;anchorX;anchorY;tableNodeKey;anchorCell;focusCell;anchorCellNodeKey;focusCellNodeKey;editor;tableSelection;hasHijackedSelectionStyles;isSelecting;pointerType;shouldCheckSelection;abortController;listenerOptions;nextFocus;constructor(t,n){this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.listenersToRemove=new Set,this.tableNodeKey=n,this.editor=t,this.table={columns:0,domRows:[],rows:0},this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.isSelecting=!1,this.pointerType=null,this.shouldCheckSelection=!1,this.abortController=new AbortController,this.listenerOptions={signal:this.abortController.signal},this.nextFocus=null,this.trackTable()}getTable(){return this.table}removeListeners(){this.abortController.abort("removeListeners"),Array.from(this.listenersToRemove).forEach(t=>t()),this.listenersToRemove.clear()}$lookup(){return SC(this.tableNodeKey,this.editor)}trackTable(){const t=new MutationObserver(n=>{this.editor.getEditorState().read(()=>{let r=!1;for(let s=0;s<n.length;s++){const a=n[s].target.nodeName;if(a==="TABLE"||a==="TBODY"||a==="THEAD"||a==="TR"){r=!0;break}}if(!r)return;const{tableNode:o,tableElement:i}=this.$lookup();this.table=Ni(o,i)},{editor:this.editor})});this.editor.getEditorState().read(()=>{const{tableNode:n,tableElement:r}=this.$lookup();this.table=Ni(n,r),t.observe(r,{attributes:!0,childList:!0,subtree:!0})},{editor:this.editor})}$clearHighlight(){const t=this.editor;this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.$enableHighlightStyle();const{tableNode:n,tableElement:r}=this.$lookup();za(t,Ni(n,r),null),Z()!==null&&(Ge(null),t.dispatchCommand(hr,void 0))}$enableHighlightStyle(){const t=this.editor,{tableElement:n}=this.$lookup();Xn(n,t._config.theme.tableSelection),n.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1}$disableHighlightStyle(){const{tableElement:t}=this.$lookup();et(t,this.editor._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0}$updateTableTableSelection(t){if(t!==null){t.tableKey!==this.tableNodeKey&&fe(233,t.tableKey,this.tableNodeKey);const n=this.editor;this.tableSelection=t,this.isHighlightingCells=!0,this.$disableHighlightStyle(),this.updateDOMSelection(),za(n,this.table,this.tableSelection)}else this.$clearHighlight()}setShouldCheckSelection(){this.shouldCheckSelection=!0}getAndClearShouldCheckSelection(){return!!this.shouldCheckSelection&&(this.shouldCheckSelection=!1,!0)}setNextFocus(t){this.nextFocus=t}getAndClearNextFocus(){const{nextFocus:t}=this;return t!==null&&(this.nextFocus=null),t}updateDOMSelection(){if(this.anchorCell!==null&&this.focusCell!==null){const t=Ot(this.editor._window);t&&t.rangeCount>0&&t.removeAllRanges()}}$setFocusCellForSelection(t,n=!1){const r=this.editor,{tableNode:o}=this.$lookup(),i=t.x,s=t.y;if(this.focusCell=t,this.isHighlightingCells||this.anchorX===i&&this.anchorY===s&&!n){if(i===this.focusX&&s===this.focusY)return!1}else this.isHighlightingCells=!0,this.$disableHighlightStyle();if(this.focusX=i,this.focusY=s,this.isHighlightingCells){const a=Cf(o,t.elem);if(this.tableSelection!=null&&this.anchorCellNodeKey!=null&&a!==null)return this.focusCellNodeKey=a.getKey(),this.tableSelection=K6(o,this.$getAnchorTableCellOrThrow(),a),Ge(this.tableSelection),r.dispatchCommand(hr,void 0),za(r,this.table,this.tableSelection),!0}return!1}$getAnchorTableCell(){return this.anchorCellNodeKey?Pe(this.anchorCellNodeKey):null}$getAnchorTableCellOrThrow(){const t=this.$getAnchorTableCell();return t===null&&fe(234),t}$getFocusTableCell(){return this.focusCellNodeKey?Pe(this.focusCellNodeKey):null}$getFocusTableCellOrThrow(){const t=this.$getFocusTableCell();return t===null&&fe(235),t}$setAnchorCellForSelection(t){this.isHighlightingCells=!1,this.anchorCell=t,this.anchorX=t.x,this.anchorY=t.y;const{tableNode:n}=this.$lookup(),r=Cf(n,t.elem);if(r!==null){const o=r.getKey();this.tableSelection=this.tableSelection!=null?this.tableSelection.clone():CC(),this.anchorCellNodeKey=o}}$formatCells(t){const n=Z();Ve(n)||fe(236);const r=dc(),o=r.anchor,i=r.focus,s=n.getNodes().filter(ge);s.length>0||fe(237);const a=s[0].getFirstChild(),l=Qr(a)?a.getFormatFlags(t,null):null;s.forEach(c=>{o.set(c.getKey(),0,"element"),i.set(c.getKey(),c.getChildrenSize(),"element"),r.formatText(t,l)}),Ge(n),this.editor.dispatchCommand(hr,void 0)}$clearText(){const{editor:t}=this,n=Pe(this.tableNodeKey);if(!Ze(n))throw new Error("Expected TableNode.");const r=Z();Ve(r)||fe(253);const o=r.getNodes().filter(ge),i=n.getFirstChild(),s=n.getLastChild();if(o.length>0&&i!==null&&s!==null&&tt(i)&&tt(s)&&o[0]===i.getFirstChild()&&o[o.length-1]===s.getLastChild()){n.selectPrevious();const a=n.getParent();return n.remove(),void(at(a)&&a.isEmpty()&&t.dispatchCommand(Po,void 0))}o.forEach(a=>{if(B(a)){const l=ye(),c=Fe();l.append(c),a.append(l),a.getChildren().forEach(u=>{u!==l&&u.remove()})}}),za(t,this.table,null),Ge(null),t.dispatchCommand(hr,void 0)}}const wf="__lexicalTableSelection";function hi(e){return Be(e)&&e.nodeName==="TABLE"}function jo(e,t){if(!t)return t;const n=hi(t)?t:e.getDOMSlot(t).element;return n.nodeName!=="TABLE"&&fe(245,t.nodeName),n}function vg(e){return e._window}function Ps(e,t){for(let n=t,r=null;n!==null;n=n.getParent()){if(e.is(n))return r;ge(n)&&(r=n)}return null}const q6=[[$h,"down"],[Fh,"up"],[Lh,"backward"],[Ph,"forward"]],Y6=[Oi,Lo,Dr],X6=[sc,Ih];function Z6(e,t,n,r){const o=n.getRootElement(),i=vg(n);o!==null&&i!==null||fe(246);const s=new G6(n,e.getKey()),a=jo(e,t);(function(h,g){xv(h)!==null&&fe(205),h[wf]=g})(a,s),s.listenersToRemove.add(()=>(function(h,g){xv(h)===g&&delete h[wf]})(a,s));const l=h=>{if(s.pointerType=h.pointerType,h.button!==0||!Cn(h.target)||!i)return;const g=Kl(h.target);g!==null&&n.update(()=>{const p=Zn();if(mv&&h.shiftKey&&In(p,e)&&(W(p)||Ve(p))){const m=p.anchor.getNode(),v=Ps(e,p.anchor.getNode());v?(s.$setAnchorCellForSelection(vo(s,v)),s.$setFocusCellForSelection(g),dr(h)):(e.isBefore(m)?e.selectStart():e.selectEnd()).anchor.set(p.anchor.key,p.anchor.offset,p.anchor.type)}else h.pointerType!=="touch"&&s.$setAnchorCellForSelection(g)}),(()=>{if(s.isSelecting)return;const p=()=>{s.isSelecting=!1,i.removeEventListener("pointerup",p),i.removeEventListener("pointermove",m)},m=v=>{if(1&~v.buttons&&s.isSelecting)return s.isSelecting=!1,i.removeEventListener("pointerup",p),void i.removeEventListener("pointermove",m);if(!Cn(v.target))return;let y=null;const x=!(mv||a.contains(v.target));if(x)y=bv(a,v.target);else for(const b of document.elementsFromPoint(v.clientX,v.clientY))if(y=bv(a,b),y)break;!y||s.focusCell!==null&&y.elem===s.focusCell.elem||(s.setNextFocus({focusCell:y,override:x}),n.dispatchCommand(hr,void 0))};s.isSelecting=!0,i.addEventListener("pointerup",p,s.listenerOptions),i.addEventListener("pointermove",m,s.listenerOptions)})()};a.addEventListener("pointerdown",l,s.listenerOptions),s.listenersToRemove.add(()=>{a.removeEventListener("pointerdown",l)});const c=h=>{h.detail>=3&&Cn(h.target)&&Kl(h.target)!==null&&h.preventDefault()};a.addEventListener("mousedown",c,s.listenerOptions),s.listenersToRemove.add(()=>{a.removeEventListener("mousedown",c)});const u=h=>{const g=h.target;h.button===0&&Cn(g)&&n.update(()=>{const p=Z();Ve(p)&&p.tableKey===s.tableNodeKey&&o.contains(g)&&s.$clearHighlight()})};i.addEventListener("pointerdown",u,s.listenerOptions),s.listenersToRemove.add(()=>{i.removeEventListener("pointerdown",u)});for(const[h,g]of q6)s.listenersToRemove.add(n.registerCommand(h,p=>EC(n,p,g,e,s),Dt));s.listenersToRemove.add(n.registerCommand(Oh,h=>{const g=Z();if(Ve(g)){const p=Ps(e,g.focus.getNode());if(p!==null)return dr(h),p.selectEnd(),!0}return!1},Dt));const f=h=>()=>{const g=Z();if(!In(g,e))return!1;if(Ve(g))return s.$clearText(),!0;if(W(g)){if(!ge(Ps(e,g.anchor.getNode())))return!1;const p=g.anchor.getNode(),m=g.focus.getNode(),v=e.isParentOf(p),y=e.isParentOf(m);if(v&&!y||y&&!v)return s.$clearText(),!0;const x=we(g.anchor.getNode(),w=>B(w)),b=x&&we(x,w=>B(w)&&ge(w.getParent()));if(!B(b)||!B(x))return!1;if(h===Lo&&b.getPreviousSibling()===null)return!0}return!1};for(const h of Y6)s.listenersToRemove.add(n.registerCommand(h,f(h),Dt));const d=h=>{const g=Z();if(!Ve(g)&&!W(g))return!1;const p=e.isParentOf(g.anchor.getNode());if(p!==e.isParentOf(g.focus.getNode())){const m=p?"anchor":"focus",v=p?"focus":"anchor",{key:y,offset:x,type:b}=g[v];return e[g[m].isBefore(g[v])?"selectPrevious":"selectNext"]()[v].set(y,x,b),!1}return!!In(g,e)&&!!Ve(g)&&(h&&(h.preventDefault(),h.stopPropagation()),s.$clearText(),!0)};for(const h of X6)s.listenersToRemove.add(n.registerCommand(h,d,Dt));return s.listenersToRemove.add(n.registerCommand(lc,h=>{const g=Z();if(g){if(!Ve(g)&&!W(g))return!1;hf(n,Pr(h,ClipboardEvent)?h:null,qw(g));const p=d(h);return W(g)?(g.removeText(),!0):p}return!1},Dt)),s.listenersToRemove.add(n.registerCommand(Vt,h=>{const g=Z();if(!In(g,e))return!1;if(Ve(g))return s.$formatCells(h),!0;if(W(g)){const p=we(g.anchor.getNode(),m=>ge(m));if(!ge(p))return!1}return!1},Dt)),s.listenersToRemove.add(n.registerCommand(Ti,h=>{const g=Z();if(!Ve(g)||!In(g,e))return!1;const p=g.anchor.getNode(),m=g.focus.getNode();if(!ge(p)||!ge(m))return!1;if((function(k,P){if(Ve(k)){const F=k.anchor.getNode(),$=k.focus.getNode();if(P&&F&&$){const[j]=an(P,F,$);return F.getKey()===j[0][0].cell.getKey()&&$.getKey()===j[j.length-1].at(-1).cell.getKey()}}return!1})(g,e))return e.setFormat(h),!0;const[v,y,x]=an(e,p,m),b=Math.max(y.startRow+y.cell.__rowSpan-1,x.startRow+x.cell.__rowSpan-1),w=Math.max(y.startColumn+y.cell.__colSpan-1,x.startColumn+x.cell.__colSpan-1),_=Math.min(y.startRow,x.startRow),E=Math.min(y.startColumn,x.startColumn),R=new Set;for(let k=_;k<=b;k++)for(let P=E;P<=w;P++){const F=v[k][P].cell;if(R.has(F))continue;R.add(F),F.setFormat(h);const $=F.getChildren();for(let j=0;j<$.length;j++){const O=$[j];B(O)&&!O.isInline()&&O.setFormat(h)}}return!0},Dt)),s.listenersToRemove.add(n.registerCommand(To,h=>{const g=Z();if(!In(g,e))return!1;if(Ve(g))return s.$clearHighlight(),!1;if(W(g)){const p=we(g.anchor.getNode(),m=>ge(m));if(!ge(p))return!1;if(typeof h=="string"){const m=Sv(n,g,e);if(m)return Cv(m,e,[Fe(h)]),!0}}return!1},Dt)),r&&s.listenersToRemove.add(n.registerCommand(Dh,h=>{const g=Z();if(!W(g)||!g.isCollapsed()||!In(g,e))return!1;const p=fs(g.anchor.getNode());return!(p===null||!e.is(Mi(p)))&&(dr(h),(function(m,v){const y=v==="next"?"getNextSibling":"getPreviousSibling",x=v==="next"?"getFirstChild":"getLastChild",b=m[y]();if(B(b))return b.selectEnd();const w=we(m,tt);w===null&&fe(247);for(let E=w[y]();tt(E);E=E[y]()){const R=E[x]();if(B(R))return R.selectEnd()}const _=we(w,Ze);_===null&&fe(248),v==="next"?_.selectNext():_.selectPrevious()})(p,h.shiftKey?"previous":"next"),!0)},Dt)),s.listenersToRemove.add(n.registerCommand(Cb,h=>e.isSelected(),Dt)),s.listenersToRemove.add(n.registerCommand(Nh,(h,g)=>{if(n!==g)return!1;const{nodes:p,selection:m}=h,v=m.getStartEndPoints(),y=Ve(m),x=W(m)&&we(m.anchor.getNode(),ee=>ge(ee))!==null&&we(m.focus.getNode(),ee=>ge(ee))!==null||y;if(p.length!==1||!Ze(p[0])||!x||v===null)return!1;const[b,w]=v,[_,E,R]=zn(b),k=we(w.getNode(),ee=>ge(ee));if(!(ge(_)&&ge(k)&&tt(E)&&Ze(R)))return!1;const P=p[0],[F,$,j]=an(R,_,k),[O]=Fr(P,null,null),D=F.length,K=D>0?F[0].length:0;let I=$.startRow,M=$.startColumn,H=O.length,U=H>0?O[0].length:0;if(y){const ee=Wl(F,$,j),ve=ee.maxRow-ee.minRow+1,Se=ee.maxColumn-ee.minColumn+1;I=ee.minRow,M=ee.minColumn,H=Math.min(H,ve),U=Math.min(U,Se)}let re=!1;const G=Math.min(D,I+H)-1,Y=Math.min(K,M+U)-1,Q=new Set;for(let ee=I;ee<=G;ee++)for(let ve=M;ve<=Y;ve++){const Se=F[ee][ve];Q.has(Se.cell.getKey())||Se.cell.__rowSpan===1&&Se.cell.__colSpan===1||(W6(Se.cell),Q.add(Se.cell.getKey()),re=!0)}let[ne]=Fr(R.getWritable(),null,null);const oe=H-D+I;for(let ee=0;ee<oe;ee++)j6(ne[D-1][0].cell);const me=U-K+M;for(let ee=0;ee<me;ee++)V6(ne[0][K-1].cell,!0,!1);[ne]=Fr(R.getWritable(),null,null);for(let ee=I;ee<I+H;ee++)for(let ve=M;ve<M+U;ve++){const Se=ee-I,Ee=ve-M,ze=O[Se][Ee];if(ze.startRow!==Se||ze.startColumn!==Ee)continue;const je=ze.cell;if(je.__rowSpan!==1||je.__colSpan!==1){const ot=[],Gt=Math.min(ee+je.__rowSpan,I+H)-1,Qt=Math.min(ve+je.__colSpan,M+U)-1;for(let pt=ee;pt<=Gt;pt++)for(let se=ve;se<=Qt;se++){const Re=ne[pt][se];ot.push(Re.cell)}z6(ot),re=!0}const{cell:Rt}=ne[ee][ve],gn=Rt.getChildren();je.getChildren().forEach(ot=>{J(ot)&&ye().append(ot),Rt.append(ot)}),gn.forEach(ot=>ot.remove())}if(y&&re){const[ee]=Fr(R.getWritable(),null,null);ee[$.startRow][$.startColumn].cell.selectEnd()}return!0},Dt)),s.listenersToRemove.add(n.registerCommand(hr,()=>{const h=Z(),g=Zn(),p=s.getAndClearNextFocus();if(p!==null){const{focusCell:m}=p;if(Ve(h)&&h.tableKey===s.tableNodeKey)return(m.x!==s.focusX||m.y!==s.focusY)&&(s.$setFocusCellForSelection(m),!0);if(m!==s.anchorCell&&In(h,e))return s.$setFocusCellForSelection(m),!0}if(s.getAndClearShouldCheckSelection()&&W(g)&&W(h)&&h.isCollapsed()){const m=h.anchor.getNode(),v=e.getFirstChild(),y=fs(m);if(y!==null&&tt(v)){const x=v.getFirstChild();if(ge(x)&&e.is(we(y,b=>b.is(e)||b.is(x))))return x.selectStart(),!0}}if(W(h)){const{anchor:m,focus:v}=h,y=m.getNode(),x=v.getNode(),b=fs(y),w=fs(x),_=!(!b||!e.is(Mi(b))),E=!(!w||!e.is(Mi(w))),R=_!==E,k=_&&E,P=h.isBackward();if(R){const F=h.clone();if(E){const[$]=an(e,w,w),j=$[0][0].cell,O=$[$.length-1].at(-1).cell;F.focus.set(P?j.getKey():O.getKey(),P?0:O.getChildrenSize(),"element")}else if(_){const[$]=an(e,b,b),j=$[0][0].cell,O=$[$.length-1].at(-1).cell;F.anchor.set(P?O.getKey():j.getKey(),P?O.getChildrenSize():0,"element")}Ge(F),wv(n,s)}else if(k&&(b.is(w)||(s.$setAnchorCellForSelection(vo(s,b)),s.$setFocusCellForSelection(vo(s,w),!0)),s.pointerType==="touch"&&s.isSelecting&&h.isCollapsed()&&W(g)&&g.isCollapsed())){const F=fs(g.anchor.getNode());F&&!F.is(w)&&(s.$setAnchorCellForSelection(vo(s,F)),s.$setFocusCellForSelection(vo(s,w),!0),s.pointerType=null)}}else if(h&&Ve(h)&&h.is(g)&&h.tableKey===e.getKey()){const m=Ot(i);if(m&&m.anchorNode&&m.focusNode){const v=Ut(m.focusNode),y=v&&!e.isParentOf(v),x=Ut(m.anchorNode),b=x&&e.isParentOf(x);if(y&&b&&m.rangeCount>0){const w=zN(m,n);w&&(w.anchor.set(e.getKey(),h.isBackward()?e.getChildrenSize():0,"element"),m.removeAllRanges(),Ge(w))}}}return h&&!h.is(g)&&(Ve(h)||Ve(g))&&s.tableSelection&&!s.tableSelection.is(g)?(Ve(h)&&h.tableKey===s.tableNodeKey?s.$updateTableTableSelection(h):!Ve(h)&&Ve(g)&&g.tableKey===s.tableNodeKey&&s.$updateTableTableSelection(null),!1):(s.hasHijackedSelectionStyles&&!e.isSelected()?(function(m,v){v.$enableHighlightStyle(),xg(v.table,y=>{const x=y.elem;y.highlighted=!1,TC(m,y),x.getAttribute("style")||x.removeAttribute("style")})})(n,s):!s.hasHijackedSelectionStyles&&e.isSelected()&&wv(n,s),!1)},Dt)),s.listenersToRemove.add(n.registerCommand(Po,()=>{const h=Z();if(!W(h)||!h.isCollapsed()||!In(h,e))return!1;const g=Sv(n,h,e);return!!g&&(Cv(g,e),!0)},Dt)),s}function xv(e){return e[wf]||null}function Kl(e){let t=e;for(;t!=null;){const n=t.nodeName;if(n==="TD"||n==="TH"){const r=t._cell;return r===void 0?null:r}t=t.parentNode}return null}function bv(e,t){if(!e.contains(t))return null;let n=null;for(let r=t;r!=null;r=r.parentNode){if(r===e)return n;const o=r.nodeName;o!=="TD"&&o!=="TH"||(n=r._cell||null)}return null}function Ni(e,t){const n=[],r={columns:0,domRows:n,rows:0};let o=jo(e,t).querySelector("tr"),i=0,s=0;for(n.length=0;o!=null;){const a=o.nodeName;if(a==="TD"||a==="TH"){const u={elem:o,hasBackgroundColor:o.style.backgroundColor!=="",highlighted:!1,x:i,y:s};o._cell=u;let f=n[s];f===void 0&&(f=n[s]=[]),f[i]=u}else{const u=o.firstChild;if(u!=null){o=u;continue}}const l=o.nextSibling;if(l!=null){i++,o=l;continue}const c=o.parentNode;if(c!=null){const u=c.nextSibling;if(u==null)break;s++,i=0,o=u}}return r.columns=i+1,r.rows=s+1,r}function za(e,t,n){const r=new Set(n?n.getNodes():[]);xg(t,(o,i)=>{const s=o.elem;r.has(i)?(o.highlighted=!0,_C(e,o)):(o.highlighted=!1,TC(e,o),s.getAttribute("style")||s.removeAttribute("style"))})}function xg(e,t){const{domRows:n}=e;for(let r=0;r<n.length;r++){const o=n[r];if(o)for(let i=0;i<o.length;i++){const s=o[i];if(!s)continue;const a=Ut(s.elem);a!==null&&t(s,a,{x:i,y:r})}}}function wv(e,t){t.$disableHighlightStyle(),xg(t.table,n=>{n.highlighted=!0,_C(e,n)})}const J6=(e,t,n,r,o)=>{const i=o==="forward";switch(o){case"backward":case"forward":return n!==(i?e.table.columns-1:0)?Wa(t.getCellNodeFromCordsOrThrow(n+(i?1:-1),r,e.table),i):r!==(i?e.table.rows-1:0)?Wa(t.getCellNodeFromCordsOrThrow(i?0:e.table.columns-1,r+(i?1:-1),e.table),i):i?t.selectNext():t.selectPrevious(),!0;case"up":return r!==0?Wa(t.getCellNodeFromCordsOrThrow(n,r-1,e.table),!1):t.selectPrevious(),!0;case"down":return r!==e.table.rows-1?Wa(t.getCellNodeFromCordsOrThrow(n,r+1,e.table),!0):t.selectNext(),!0;default:return!1}};function Eu(e,t){let n,r;if(t.startColumn===e.minColumn)n="minColumn";else{if(t.startColumn+t.cell.__colSpan-1!==e.maxColumn)return null;n="maxColumn"}if(t.startRow===e.minRow)r="minRow";else{if(t.startRow+t.cell.__rowSpan-1!==e.maxRow)return null;r="maxRow"}return[n,r]}function Ha([e,t]){return[e==="minColumn"?"maxColumn":"minColumn",t==="minRow"?"maxRow":"minRow"]}function ni(e,t,[n,r]){const o=t[r],i=e[o];i===void 0&&fe(250,r,String(o));const s=t[n],a=i[s];return a===void 0&&fe(250,n,String(s)),a}function Q6(e,t,n,r,o){const i=Wl(t,n,r),s=(function(_,E){const{minColumn:R,maxColumn:k,minRow:P,maxRow:F}=E;let $=1,j=1,O=1,D=1;const K=_[P],I=_[F];for(let M=R;M<=k;M++)$=Math.max($,K[M].cell.__rowSpan),D=Math.max(D,I[M].cell.__rowSpan);for(let M=P;M<=F;M++)j=Math.max(j,_[M][R].cell.__colSpan),O=Math.max(O,_[M][k].cell.__colSpan);return{bottomSpan:D,leftSpan:j,rightSpan:O,topSpan:$}})(t,i),{topSpan:a,leftSpan:l,bottomSpan:c,rightSpan:u}=s,f=(function(_,E){const R=Eu(_,E);return R===null&&fe(249,E.cell.getKey()),R})(i,n),[d,h]=Ha(f);let g=i[d],p=i[h];o==="forward"?g+=d==="maxColumn"?1:l:o==="backward"?g-=d==="minColumn"?1:u:o==="down"?p+=h==="maxRow"?1:a:o==="up"&&(p-=h==="minRow"?1:c);const m=t[p];if(m===void 0)return!1;const v=m[g];if(v===void 0)return!1;const[y,x]=(function(_,E,R){const k=Wl(_,E,R),P=Eu(k,E);if(P)return[ni(_,k,P),ni(_,k,Ha(P))];const F=Eu(k,R);if(F)return[ni(_,k,Ha(F)),ni(_,k,F)];const $=["minColumn","minRow"];return[ni(_,k,$),ni(_,k,Ha($))]})(t,n,v),b=vo(e,y.cell),w=vo(e,x.cell);return e.$setAnchorCellForSelection(b),e.$setFocusCellForSelection(w,!0),!0}function In(e,t){if(W(e)||Ve(e)){const n=t.isParentOf(e.anchor.getNode()),r=t.isParentOf(e.focus.getNode());return n&&r}return!1}function Wa(e,t){t?e.selectStart():e.selectEnd()}function _C(e,t){const n=t.elem,r=e._config.theme;ge(Ut(n))||fe(131),et(n,r.tableCellSelected)}function TC(e,t){const n=t.elem;ge(Ut(n))||fe(131);const r=e._config.theme;Xn(n,r.tableCellSelected)}function fs(e){const t=we(e,ge);return ge(t)?t:null}function Mi(e){const t=we(e,Ze);return Ze(t)?t:null}function eL(e,t,n,r,o,i,s){const a=An(n.focus,o?"previous":"next");if(ig(a))return!1;let l=a;for(const m of qs(a).iterNodeCarets("shadowRoot")){if(!Ur(m)||!B(m.origin))return!1;l=m}const c=l.getParentAtCaret();if(!ge(c))return!1;const u=c,f=(function(m){for(const v of qs(m).iterNodeCarets("root")){const{origin:y}=v;if(ge(y)){if(Ht(v))return $t(y,m.direction)}else if(!tt(y))break}return null})(nt(u,l.direction)),d=we(u,Ze);if(!d||!d.is(i))return!1;const h=e.getElementByKey(u.getKey()),g=Kl(h);if(!h||!g)return!1;const p=nL(e,d);if(s.table=p,f)if(r==="extend"){const m=Kl(e.getElementByKey(f.origin.getKey()));if(!m)return!1;s.$setAnchorCellForSelection(g),s.$setFocusCellForSelection(m,!0)}else{const m=Lt(f);Sn(n.anchor,m),Sn(n.focus,m)}else if(r==="extend")s.$setAnchorCellForSelection(g),s.$setFocusCellForSelection(g,!0);else{const m=(function(v){const y=ua(v);return Ht(y)?Lt(y):v})(nt(d,a.direction));Sn(n.anchor,m),Sn(n.focus,m)}return dr(t),!0}function EC(e,t,n,r,o){if((n==="up"||n==="down")&&(function(s){const a=s.getRootElement();return a?a.hasAttribute("aria-controls")&&a.getAttribute("aria-controls")==="typeahead-menu":!1})(e))return!1;const i=Z();if(!In(i,r)){if(W(i)){if(n==="backward"){if(i.focus.offset>0)return!1;const s=(function(l){for(let c=l,u=l;u!==null;c=u,u=u.getParent())if(B(u)){if(u!==c&&u.getFirstChild()!==c)return null;if(!u.isInline())return u}return null})(i.focus.getNode());if(!s)return!1;const a=s.getPreviousSibling();return!!Ze(a)&&(dr(t),t.shiftKey?i.focus.set(a.getParentOrThrow().getKey(),a.getIndexWithinParent(),"element"):a.selectEnd(),!0)}if(t.shiftKey&&(n==="up"||n==="down")){const s=i.focus.getNode();if(!i.isCollapsed()&&(n==="up"&&!i.isBackward()||n==="down"&&i.isBackward())){let a=we(s,d=>Ze(d));if(ge(a)&&(a=we(a,Ze)),a!==r||!a)return!1;const l=n==="down"?a.getNextSibling():a.getPreviousSibling();if(!l)return!1;let c=0;n==="up"&&B(l)&&(c=l.getChildrenSize());let u=l;n==="up"&&B(l)&&(u=l.getLastChild()||l,c=J(u)?u.getTextContentSize():0);const f=i.clone();return f.focus.set(u.getKey(),c,J(u)?"text":"element"),Ge(f),dr(t),!0}if(vt(s)){const a=n==="up"?i.getNodes()[i.getNodes().length-1]:i.getNodes()[0];if(a&&Ps(r,a)!==null){const l=r.getFirstDescendant(),c=r.getLastDescendant();if(!l||!c)return!1;const[u]=zn(l),[f]=zn(c),d=r.getCordsFromCellNode(u,o.table),h=r.getCordsFromCellNode(f,o.table),g=r.getDOMCellFromCordsOrThrow(d.x,d.y,o.table),p=r.getDOMCellFromCordsOrThrow(h.x,h.y,o.table);return o.$setAnchorCellForSelection(g),o.$setFocusCellForSelection(p,!0),!0}return!1}{let a=we(s,c=>B(c)&&!c.isInline());if(ge(a)&&(a=we(a,Ze)),!a)return!1;const l=n==="down"?a.getNextSibling():a.getPreviousSibling();if(Ze(l)&&o.tableNodeKey===l.getKey()){const c=l.getFirstDescendant(),u=l.getLastDescendant();if(!c||!u)return!1;const[f]=zn(c),[d]=zn(u),h=i.clone();return h.focus.set((n==="up"?f:d).getKey(),n==="up"?0:d.getChildrenSize(),"element"),dr(t),Ge(h),!0}}}}return n==="down"&&Ul(e)&&o.setShouldCheckSelection(),!1}if(W(i)){if(n==="backward"||n==="forward")return eL(e,t,i,t.shiftKey?"extend":"move",n==="backward",r,o);if(i.isCollapsed()){const{anchor:s,focus:a}=i,l=we(s.getNode(),ge),c=we(a.getNode(),ge);if(!ge(l)||!l.is(c))return!1;const u=Mi(l);if(u!==r&&u!=null){const v=jo(u,e.getElementByKey(u.getKey()));if(v!=null)return o.table=Ni(u,v),EC(e,t,n,u,o)}const f=e.getElementByKey(l.__key),d=e.getElementByKey(s.key);if(d==null||f==null)return!1;let h;if(s.type==="element")h=d.getBoundingClientRect();else{const v=Ot(vg(e));if(v===null||v.rangeCount===0)return!1;h=v.getRangeAt(0).getBoundingClientRect()}const g=n==="up"?l.getFirstChild():l.getLastChild();if(g==null)return!1;const p=e.getElementByKey(g.__key);if(p==null)return!1;const m=p.getBoundingClientRect();if(n==="up"?m.top>h.top-h.height:h.bottom+h.height>m.bottom){dr(t);const v=r.getCordsFromCellNode(l,o.table);if(!t.shiftKey)return J6(o,r,v.x,v.y,n);{const y=r.getDOMCellFromCordsOrThrow(v.x,v.y,o.table);o.$setAnchorCellForSelection(y),o.$setFocusCellForSelection(y,!0)}return!0}}}else if(Ve(i)){const{anchor:s,focus:a}=i,l=we(s.getNode(),ge),c=we(a.getNode(),ge),[u]=i.getNodes();Ze(u)||fe(251);const f=jo(u,e.getElementByKey(u.getKey()));if(!ge(l)||!ge(c)||!Ze(u)||f==null)return!1;o.$updateTableTableSelection(i);const d=Ni(u,f),h=r.getCordsFromCellNode(l,d),g=r.getDOMCellFromCordsOrThrow(h.x,h.y,d);if(o.$setAnchorCellForSelection(g),dr(t),t.shiftKey){const[p,m,v]=an(r,l,c);return Q6(o,p,m,v,n)}return c.selectEnd(),!0}return!1}function dr(e){e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation()}function Cv(e,t,n){const r=ye();e==="first"?t.insertBefore(r):t.insertAfter(r),r.append(...n||[]),r.selectEnd()}function Sv(e,t,n){const r=n.getParent();if(!r)return;const o=Ot(vg(e));if(!o)return;const i=o.anchorNode,s=e.getElementByKey(r.getKey()),a=jo(n,e.getElementByKey(n.getKey()));if(!i||!s||!a||!s.contains(i)||a.contains(i))return;const l=we(t.anchor.getNode(),y=>ge(y));if(!l)return;const c=we(l,y=>Ze(y));if(!Ze(c)||!c.is(n))return;const[u,f]=an(n,l,l),d=u[0][0],h=u[u.length-1][u[0].length-1],{startRow:g,startColumn:p}=f,m=g===d.startRow&&p===d.startColumn,v=g===h.startRow&&p===h.startColumn;return m?"first":v?"last":void 0}function vo(e,t){const{tableNode:n}=e.$lookup(),r=n.getCordsFromCellNode(t,e.table);return n.getDOMCellFromCordsOrThrow(r.x,r.y,e.table)}function Cf(e,t,n){return Ps(e,Ut(t,n))}function _v(e,t,n){if(!t.theme.tableAlignment)return;const r=[],o=[];for(const i of["center","right"]){const s=t.theme.tableAlignment[i];s&&(i===n?o:r).push(s)}Xn(e,...r),et(e,...o)}const Sf=new WeakSet;function Ul(e=es()){return Sf.has(e)}function tL(e,t){t?Sf.add(e):Sf.delete(e)}class Pn extends Tt{__rowStriping;__frozenColumnCount;__frozenRowCount;__colWidths;static getType(){return"table"}getColWidths(){return this.getLatest().__colWidths}setColWidths(t){const n=this.getWritable();return n.__colWidths=t,n}static clone(t){return new Pn(t.__key)}afterCloneFrom(t){super.afterCloneFrom(t),this.__colWidths=t.__colWidths,this.__rowStriping=t.__rowStriping,this.__frozenColumnCount=t.__frozenColumnCount,this.__frozenRowCount=t.__frozenRowCount}static importDOM(){return{table:t=>({conversion:rL,priority:1})}}static importJSON(t){return Sc().updateFromJSON(t)}updateFromJSON(t){return super.updateFromJSON(t).setRowStriping(t.rowStriping||!1).setFrozenColumns(t.frozenColumnCount||0).setFrozenRows(t.frozenRowCount||0).setColWidths(t.colWidths)}constructor(t){super(t),this.__rowStriping=!1,this.__frozenColumnCount=0,this.__frozenRowCount=0,this.__colWidths=void 0}exportJSON(){return{...super.exportJSON(),colWidths:this.getColWidths(),frozenColumnCount:this.__frozenColumnCount?this.__frozenColumnCount:void 0,frozenRowCount:this.__frozenRowCount?this.__frozenRowCount:void 0,rowStriping:this.__rowStriping?this.__rowStriping:void 0}}extractWithChild(t,n,r){return r==="html"}getDOMSlot(t){const n=hi(t)?t:t.querySelector("table");return hi(n)||fe(229),super.getDOMSlot(t).withElement(n).withAfter(n.querySelector("colgroup"))}createDOM(t,n){const r=document.createElement("table");this.__style&&(r.style.cssText=this.__style);const o=document.createElement("colgroup");if(r.appendChild(o),uM(o),et(r,t.theme.table),this.updateTableElement(null,r,t),Ul(n)){const i=document.createElement("div"),s=t.theme.tableScrollableWrapper;return s?et(i,s):i.style.cssText="overflow-x: auto;",i.appendChild(r),this.updateTableWrapper(null,i,r,t),i}return r}updateTableWrapper(t,n,r,o){this.__frozenColumnCount!==(t?t.__frozenColumnCount:0)&&(function(i,s,a,l){l>0?(et(i,a.theme.tableFrozenColumn),s.setAttribute("data-lexical-frozen-column","true")):(Xn(i,a.theme.tableFrozenColumn),s.removeAttribute("data-lexical-frozen-column"))})(n,r,o,this.__frozenColumnCount),this.__frozenRowCount!==(t?t.__frozenRowCount:0)&&(function(i,s,a,l){l>0?(et(i,a.theme.tableFrozenRow),s.setAttribute("data-lexical-frozen-row","true")):(Xn(i,a.theme.tableFrozenRow),s.removeAttribute("data-lexical-frozen-row"))})(n,r,o,this.__frozenRowCount)}updateTableElement(t,n,r){this.__style!==(t?t.__style:"")&&(n.style.cssText=this.__style),this.__rowStriping!==(!!t&&t.__rowStriping)&&(function(o,i,s){s?(et(o,i.theme.tableRowStriping),o.setAttribute("data-lexical-row-striping","true")):(Xn(o,i.theme.tableRowStriping),o.removeAttribute("data-lexical-row-striping"))})(n,r,this.__rowStriping),(function(o,i,s,a){const l=o.querySelector("colgroup");if(!l)return;const c=[];for(let u=0;u<s;u++){const f=document.createElement("col"),d=a&&a[u];d&&(f.style.width=`${d}px`),c.push(f)}l.replaceChildren(...c)})(n,0,this.getColumnCount(),this.getColWidths()),_v(n,r,this.getFormatType())}updateDOM(t,n,r){const o=this.getDOMSlot(n).element;return n===o===Ul()||(Be(i=n)&&i.nodeName==="DIV"&&this.updateTableWrapper(t,n,o,r),this.updateTableElement(t,o,r),!1);var i}exportDOM(t){const n=super.exportDOM(t),{element:r}=n;return{after:o=>{if(n.after&&(o=n.after(o)),!hi(o)&&Be(o)&&(o=o.querySelector("table")),!hi(o))return null;_v(o,t._config,this.getFormatType());const[i]=Fr(this,null,null),s=new Map;for(const u of i)for(const f of u){const d=f.cell.getKey();s.has(d)||s.set(d,{colSpan:f.cell.getColSpan(),startColumn:f.startColumn})}const a=new Set;for(const u of o.querySelectorAll(":scope > tr > [data-temporary-table-cell-lexical-key]")){const f=u.getAttribute("data-temporary-table-cell-lexical-key");if(f){const d=s.get(f);if(u.removeAttribute("data-temporary-table-cell-lexical-key"),d){s.delete(f);for(let h=0;h<d.colSpan;h++)a.add(h+d.startColumn)}}}const l=o.querySelector(":scope > colgroup");if(l){const u=Array.from(o.querySelectorAll(":scope > colgroup > col")).filter((f,d)=>a.has(d));l.replaceChildren(...u)}const c=o.querySelectorAll(":scope > tr");if(c.length>0){const u=document.createElement("tbody");for(const f of c)u.appendChild(f);o.append(u)}return o},element:!hi(r)&&Be(r)?r.querySelector("table"):r}}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(t,n){const{rows:r,domRows:o}=n;for(let i=0;i<r;i++){const s=o[i];if(s!=null)for(let a=0;a<s.length;a++){const l=s[a];if(l==null)continue;const{elem:c}=l,u=Cf(this,c);if(u!==null&&t.is(u))return{x:a,y:i}}}throw new Error("Cell not found in table.")}getDOMCellFromCords(t,n,r){const{domRows:o}=r,i=o[n];if(i==null)return null;const s=i[t<i.length?t:i.length-1];return s??null}getDOMCellFromCordsOrThrow(t,n,r){const o=this.getDOMCellFromCords(t,n,r);if(!o)throw new Error("Cell not found at cords.");return o}getCellNodeFromCords(t,n,r){const o=this.getDOMCellFromCords(t,n,r);if(o==null)return null;const i=Ut(o.elem);return ge(i)?i:null}getCellNodeFromCordsOrThrow(t,n,r){const o=this.getCellNodeFromCords(t,n,r);if(!o)throw new Error("Node at cords not TableCellNode.");return o}getRowStriping(){return!!this.getLatest().__rowStriping}setRowStriping(t){const n=this.getWritable();return n.__rowStriping=t,n}setFrozenColumns(t){const n=this.getWritable();return n.__frozenColumnCount=t,n}getFrozenColumns(){return this.getLatest().__frozenColumnCount}setFrozenRows(t){const n=this.getWritable();return n.__frozenRowCount=t,n}getFrozenRows(){return this.getLatest().__frozenRowCount}canSelectBefore(){return!0}canIndent(){return!1}getColumnCount(){const t=this.getFirstChild();if(!t)return 0;let n=0;return t.getChildren().forEach(r=>{ge(r)&&(n+=r.getColSpan())}),n}}function nL(e,t){const n=e.getElementByKey(t.getKey());return n===null&&fe(230),Ni(t,n)}function rL(e){const t=Sc();e.hasAttribute("data-lexical-row-striping")&&t.setRowStriping(!0),e.hasAttribute("data-lexical-frozen-column")&&t.setFrozenColumns(1),e.hasAttribute("data-lexical-frozen-row")&&t.setFrozenRows(1);const n=e.querySelector(":scope > colgroup");if(n){let r=[];for(const o of n.querySelectorAll(":scope > col")){let i=o.style.width||"";if(!mg.test(i)&&(i=o.getAttribute("width")||"",!/^\d+$/.test(i))){r=void 0;break}r.push(parseFloat(i))}r&&t.setColWidths(r)}return{after:r=>Ew(r,tt),node:t}}function Sc(){return Et(new Pn)}function Ze(e){return e instanceof Pn}function oL(e){tt(e.getParent())?e.isEmpty()&&e.append(ye()):e.remove()}function iL(e){Ze(e.getParent())?_w(e,ge):e.remove()}function sL(e){_w(e,tt);const[t]=Fr(e,null,null),n=t.reduce((s,a)=>Math.max(s,a.length),0),r=e.getChildren();for(let s=0;s<t.length;++s){const a=r[s];if(!a)continue;tt(a)||fe(254,a.constructor.name,a.getType());const l=t[s].reduce((c,u)=>u?1+c:c,0);if(l!==n)for(let c=l;c<n;++c){const u=un();u.append(ye()),a.append(u)}}const o=e.getColWidths(),i=e.getColumnCount();if(o&&o.length!==i){let s;if(i<o.length)s=o.slice(0,i);else if(o.length>0){const a=o[o.length-1];s=[...o,...Array(i-o.length).fill(a)]}e.setColWidths(s)}}function aL(e){if(e.detail<3||!Cn(e.target))return!1;const t=Ut(e.target);if(t===null)return!1;const n=we(t,r=>B(r)&&!r.isInline());return n===null?!1:!!ge(n.getParent())&&(n.select(0),!0)}function lL(e){return e.registerNodeTransform(Mn,t=>{if(t.getColSpan()>1||t.getRowSpan()>1){const[,,n]=zn(t),[r]=an(n,t,t),o=r.length,i=r[0].length;let s=n.getFirstChild();tt(s)||fe(175);const a=[];for(let l=0;l<o;l++){l!==0&&(s=s.getNextSibling(),tt(s)||fe(175));let c=null;for(let u=0;u<i;u++){const f=r[l][u],d=f.cell;if(f.startRow===l&&f.startColumn===u)c=d,a.push(d);else if(d.getColSpan()>1||d.getRowSpan()>1){ge(d)||fe(176);const h=un(d.__headerState);c!==null?c.insertAfter(h):LM(s,h)}}}for(const l of a)l.setColSpan(1),l.setRowSpan(1)}})}function cL(e,t=!0){const n=new Map,r=(i,s,a)=>{const l=jo(i,a),c=Z6(i,l,e,t);n.set(s,[c,l])},o=e.registerMutationListener(Pn,i=>{e.getEditorState().read(()=>{for(const[s,a]of i){const l=n.get(s);if(a==="created"||a==="updated"){const{tableNode:c,tableElement:u}=SC(s);l===void 0?r(c,s,u):u!==l[1]&&(l[0].removeListeners(),n.delete(s),r(c,s,u))}else a==="destroyed"&&l!==void 0&&(l[0].removeListeners(),n.delete(s))}},{editor:e})},{skipInitialization:!1});return()=>{o();for(const[,[i]]of n)i.removeListeners()}}function uL(e,t){e.hasNodes([Pn])||fe(255);const{hasNestedTables:n=Aw(!1)}=t??{};return Nn(e.registerCommand(bC,r=>(function({rows:o,columns:i,includeHeaders:s},a){const l=Z()||Zn();if(!l||!W(l)||!a&&Mi(l.anchor.getNode()))return!1;const c=I6(Number(o),Number(i),s);MM(c);const u=c.getFirstDescendant();return J(u)&&u.select(),!0})(r,n.peek()),be),e.registerCommand(Nh,({nodes:r,selection:o},i)=>n.peek()||e!==i||!W(o)?!1:Mi(o.anchor.getNode())!==null&&r.some(Ze),be),e.registerCommand(ic,aL,be),e.registerNodeTransform(Pn,sL),e.registerNodeTransform(qr,iL),e.registerNodeTransform(Mn,oL))}function dL({hasCellMerge:e=!0,hasCellBackgroundColor:t=!0,hasTabHandler:n=!0,hasHorizontalScroll:r=!1,hasNestedTables:o=!1}){const[i]=lt();S.useEffect(()=>{Ul(i)!==r&&(tL(i,r),i.registerNodeTransform(Pn,()=>{})())},[i,r]);const s=S.useMemo(()=>Aw(!1),[]);return s.peek()!==o&&(s.value=o),S.useEffect(()=>uL(i,{hasNestedTables:s}),[i,s]),S.useEffect(()=>cL(i,n),[i,n]),S.useEffect(()=>{if(!e)return lL(i)},[i,e]),S.useEffect(()=>{if(!t)return i.registerNodeTransform(Mn,a=>{a.getBackgroundColor()!==null&&a.setBackgroundColor(null)})},[i,t,e]),null}var Ru,Tv;function RC(){if(Tv)return Ru;Tv=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return Ru=e,Ru}var ku,Ev;function fL(){if(Ev)return ku;Ev=1;var e=typeof Bn=="object"&&Bn&&Bn.Object===Object&&Bn;return ku=e,ku}var Au,Rv;function kC(){if(Rv)return Au;Rv=1;var e=fL(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return Au=n,Au}var Nu,kv;function hL(){if(kv)return Nu;kv=1;var e=kC(),t=function(){return e.Date.now()};return Nu=t,Nu}var Mu,Av;function gL(){if(Av)return Mu;Av=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return Mu=t,Mu}var Pu,Nv;function pL(){if(Nv)return Pu;Nv=1;var e=gL(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return Pu=n,Pu}var Lu,Mv;function AC(){if(Mv)return Lu;Mv=1;var e=kC(),t=e.Symbol;return Lu=t,Lu}var Fu,Pv;function mL(){if(Pv)return Fu;Pv=1;var e=AC(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,o=e?e.toStringTag:void 0;function i(s){var a=n.call(s,o),l=s[o];try{s[o]=void 0;var c=!0}catch{}var u=r.call(s);return c&&(a?s[o]=l:delete s[o]),u}return Fu=i,Fu}var $u,Lv;function yL(){if(Lv)return $u;Lv=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return $u=n,$u}var Ou,Fv;function vL(){if(Fv)return Ou;Fv=1;var e=AC(),t=mL(),n=yL(),r="[object Null]",o="[object Undefined]",i=e?e.toStringTag:void 0;function s(a){return a==null?a===void 0?o:r:i&&i in Object(a)?t(a):n(a)}return Ou=s,Ou}var Iu,$v;function xL(){if($v)return Iu;$v=1;function e(t){return t!=null&&typeof t=="object"}return Iu=e,Iu}var Du,Ov;function bL(){if(Ov)return Du;Ov=1;var e=vL(),t=xL(),n="[object Symbol]";function r(o){return typeof o=="symbol"||t(o)&&e(o)==n}return Du=r,Du}var ju,Iv;function wL(){if(Iv)return ju;Iv=1;var e=pL(),t=RC(),n=bL(),r=NaN,o=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,s=/^0o[0-7]+$/i,a=parseInt;function l(c){if(typeof c=="number")return c;if(n(c))return r;if(t(c)){var u=typeof c.valueOf=="function"?c.valueOf():c;c=t(u)?u+"":u}if(typeof c!="string")return c===0?c:+c;c=e(c);var f=i.test(c);return f||s.test(c)?a(c.slice(2),f?2:8):o.test(c)?r:+c}return ju=l,ju}var Vu,Dv;function CL(){if(Dv)return Vu;Dv=1;var e=RC(),t=hL(),n=wL(),r="Expected a function",o=Math.max,i=Math.min;function s(a,l,c){var u,f,d,h,g,p,m=0,v=!1,y=!1,x=!0;if(typeof a!="function")throw new TypeError(r);l=n(l)||0,e(c)&&(v=!!c.leading,y="maxWait"in c,d=y?o(n(c.maxWait)||0,l):d,x="trailing"in c?!!c.trailing:x);function b(j){var O=u,D=f;return u=f=void 0,m=j,h=a.apply(D,O),h}function w(j){return m=j,g=setTimeout(R,l),v?b(j):h}function _(j){var O=j-p,D=j-m,K=l-O;return y?i(K,d-D):K}function E(j){var O=j-p,D=j-m;return p===void 0||O>=l||O<0||y&&D>=d}function R(){var j=t();if(E(j))return k(j);g=setTimeout(R,_(j))}function k(j){return g=void 0,x&&u?b(j):(u=f=void 0,h)}function P(){g!==void 0&&clearTimeout(g),m=0,u=p=f=g=void 0}function F(){return g===void 0?h:k(t())}function $(){var j=t(),O=E(j);if(u=arguments,f=this,p=j,O){if(g===void 0)return w(p);if(y)return clearTimeout(g),g=setTimeout(R,l),b(p)}return g===void 0&&(g=setTimeout(R,l)),h}return $.cancel=P,$.flush=F,$}return Vu=s,Vu}var SL=CL();const _L=Ff(SL),TL=e=>N.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M1.61342 8.47549C1.52262 8.33173 1.47723 8.25985 1.45182 8.14898C1.43273 8.06571 1.43273 7.93437 1.45182 7.8511C1.47723 7.74023 1.52262 7.66835 1.61341 7.52459C2.36369 6.3366 4.59693 3.33337 8.00027 3.33337C11.4036 3.33337 13.6369 6.3366 14.3871 7.52459C14.4779 7.66835 14.5233 7.74023 14.5487 7.8511C14.5678 7.93437 14.5678 8.06571 14.5487 8.14898C14.5233 8.25985 14.4779 8.33173 14.3871 8.47549C13.6369 9.66348 11.4036 12.6667 8.00027 12.6667C4.59693 12.6667 2.36369 9.66348 1.61342 8.47549Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),N.createElement("path",{d:"M8.00027 10C9.10484 10 10.0003 9.10461 10.0003 8.00004C10.0003 6.89547 9.10484 6.00004 8.00027 6.00004C6.8957 6.00004 6.00027 6.89547 6.00027 8.00004C6.00027 9.10461 6.8957 10 8.00027 10Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),NC=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M16 6V5.2C16 4.0799 16 3.51984 15.782 3.09202C15.5903 2.71569 15.2843 2.40973 14.908 2.21799C14.4802 2 13.9201 2 12.8 2H11.2C10.0799 2 9.51984 2 9.09202 2.21799C8.71569 2.40973 8.40973 2.71569 8.21799 3.09202C8 3.51984 8 4.0799 8 5.2V6M10 11.5V16.5M14 11.5V16.5M3 6H21M19 6V17.2C19 18.8802 19 19.7202 18.673 20.362C18.3854 20.9265 17.9265 21.3854 17.362 21.673C16.7202 22 15.8802 22 14.2 22H9.8C8.11984 22 7.27976 22 6.63803 21.673C6.07354 21.3854 5.6146 20.9265 5.32698 20.362C5 19.7202 5 18.8802 5 17.2V6",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}));function MC(e){return e instanceof Vo}function PC(e){return new Vo(e)}const{color:Vi,cornerRadius:EL,spacing:RL,transition:kL}=V,AL=T.css({display:"inline-flex",color:Vi.text.accent,textDecoration:"underline",cursor:"pointer"}),NL=T.css({color:Vi.text.accent,":hover":{color:Vi.text.accentHover}}),ML=T.css({width:"16px",height:"16px",color:Vi.icon.negative,cursor:"pointer",transition:kL.general,":hover":{color:Vi.icon.negativeHover}}),PL=T.css({boxShadow:`0 2px 10px 4px ${Vi.effect.shadowL}`,borderRadius:EL.md,padding:RL.sm});function LL({url:e,text:t,nodeKey:n}){const[r]=lt(),{isEditable:o}=na(),i=S.useCallback(()=>{r.update(()=>{const s=Pe(n);MC(s)&&s.remove()})},[r,n]);return C.jsx(Or,{content:C.jsxs(q,{flex:!0,row:!0,center:!0,gap:"var(--spacing-xs)",children:[C.jsx("a",{className:NL,target:"_blank",href:e,children:e}),o&&C.jsx(NC,{className:ML,onClick:i})]}),placement:"right-start",trigger:"hover",contentClassName:PL,children:C.jsx(le,{className:AL,children:t})})}const Bu="custom-link-node";class Vo extends sa{_url;_text;constructor({url:t,text:n},r){super(r),this._url=t,this._text=n}getType(){return Bu}getData(){return{url:this._url,text:this._text}}isInline(){return!0}isIsolated(){return!1}createDOM(){const t=document.createElement("span");return t.style.display="inline",t}updateDOM(){return!1}decorate(){return C.jsx(LL,{...this.getData(),nodeKey:this.getKey()})}exportJSON(){return{...super.exportJSON(),format:"left",type:Bu,version:1,text:this._text,url:this._url}}static importJSON(t){return new Vo({url:t.url,text:t.text})}static getType(){return Bu}static clone(t){return new Vo({url:t._url,text:t._text},t.__key)}}const FL={type:"text-match",dependencies:[Vo],regExp:/\[([^\]]+)]\(([^)]+)\)/,trigger:")",importRegExp:/\[([^\]]+)]\(([^)]+)\)/,replace:(e,t)=>{const[,n,r]=t,o=PC({url:r,text:n});e.replace(o)},export:e=>{if(!MC(e))return null;const{text:n,url:r}=e.getData();return!r||!n?"":`[${n}](${r})`}},jv="image-row",$L=T.css({width:"fit-content",display:"flex",alignItems:"center"});function LC(e){return e.length?new Yr(e):null}function FC(e){return e instanceof Yr}const{color:_f,cornerRadius:$C,spacing:OL,transition:IL}=V,DL=T.css({width:"100px",height:"100px",objectFit:"cover",borderRadius:$C.md}),jL=T.css({width:"20px",height:"20px",color:_f.icon.negative,cursor:"pointer",transition:IL.general,":hover":{color:_f.icon.negativeHover}}),VL=T.css({boxShadow:`0 2px 10px 4px ${_f.effect.shadowL}`,borderRadius:$C.xs,padding:OL.xs}),{spacing:BL}=V;function zL({images:e,nodeKey:t}){const[n]=lt(),{isEditable:r}=na(),o=S.useCallback(()=>{n.update(()=>{const i=Pe(t);FC(i)&&i.remove()})},[n,t]);return C.jsx(Or,{open:r?void 0:!1,content:C.jsx(NC,{className:jL,onClick:o}),placement:"right-start",trigger:"hover",contentClassName:VL,children:C.jsx(q,{w:"full",flex:!0,row:!0,gap:BL.sm,alignItems:"center",children:e.map(({src:i,alt:s})=>C.jsx("img",{src:i,alt:s??"",className:DL},i))})})}class Yr extends sa{images;constructor(t,n){super(n),this.images=t}createDOM(){const t=document.createElement("div");return t.className=$L,t.contentEditable="false",t}updateDOM(){return!1}decorate(){return C.jsx(zL,{images:this.images,nodeKey:this.getKey()})}exportJSON(){return{...super.exportJSON(),format:"left",type:jv,version:1,images:this.images}}static importJSON(t){return new Yr(t.images)}isInline(){return!1}isIsolated(){return!0}isSelectable(){return!0}static getType(){return jv}static clone(t){return new Yr(t.images,t.__key)}}const HL={type:"element",dependencies:[Yr],regExp:/^!\[[^\]]*]\([^)]+\)(?:\s+!\[[^\]]*]\([^)]+\))*$/,replace:(e,t,n)=>{const[r]=n,i=[...r.matchAll(/!\[([^\]]*)]\(([^)]+)\)/g)].map(([a,l,c])=>({alt:l,src:c})),s=LC(i);s&&Bh([s])},export:e=>{if(!(e instanceof Yr))return null;const n=e.images;return n.length?n.map(({src:r,alt:o})=>`![${o}](${r})`).join(" "):""}},WL=e=>N.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("g",null,N.createElement("path",{d:"M8.00008 8.66634C8.36827 8.66634 8.66675 8.36786 8.66675 7.99967C8.66675 7.63148 8.36827 7.33301 8.00008 7.33301C7.63189 7.33301 7.33341 7.63148 7.33341 7.99967C7.33341 8.36786 7.63189 8.66634 8.00008 8.66634Z",fill:"currentColor"}),N.createElement("path",{d:"M12.6667 8.66634C13.0349 8.66634 13.3334 8.36786 13.3334 7.99967C13.3334 7.63148 13.0349 7.33301 12.6667 7.33301C12.2986 7.33301 12.0001 7.63148 12.0001 7.99967C12.0001 8.36786 12.2986 8.66634 12.6667 8.66634Z",fill:"currentColor"}),N.createElement("path",{d:"M3.33341 8.66634C3.7016 8.66634 4.00008 8.36786 4.00008 7.99967C4.00008 7.63148 3.7016 7.33301 3.33341 7.33301C2.96522 7.33301 2.66675 7.63148 2.66675 7.99967C2.66675 8.36786 2.96522 8.66634 3.33341 8.66634Z",fill:"currentColor"}),N.createElement("path",{d:"M8.00008 8.66634C8.36827 8.66634 8.66675 8.36786 8.66675 7.99967C8.66675 7.63148 8.36827 7.33301 8.00008 7.33301C7.63189 7.33301 7.33341 7.63148 7.33341 7.99967C7.33341 8.36786 7.63189 8.66634 8.00008 8.66634Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),N.createElement("path",{d:"M12.6667 8.66634C13.0349 8.66634 13.3334 8.36786 13.3334 7.99967C13.3334 7.63148 13.0349 7.33301 12.6667 7.33301C12.2986 7.33301 12.0001 7.63148 12.0001 7.99967C12.0001 8.36786 12.2986 8.66634 12.6667 8.66634Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),N.createElement("path",{d:"M3.33341 8.66634C3.7016 8.66634 4.00008 8.36786 4.00008 7.99967C4.00008 7.63148 3.7016 7.33301 3.33341 7.33301C2.96522 7.33301 2.66675 7.63148 2.66675 7.99967C2.66675 8.36786 2.96522 8.66634 3.33341 8.66634Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),N.createElement("defs",null)),{color:Vv}=V,KL=T.css({cursor:"pointer"}),UL=T.css({":hover":{backgroundColor:Vv.fill.bgSecondary},":active":{backgroundColor:Vv.fill.bgSecondary}}),{color:Bv,spacing:zv}=V;function GL({groups:e,toolbarVisibleActionsCount:t,onAction:n,disabled:r}){const[o,i]=S.useState(!1),s=S.useCallback(c=>()=>{r||(c&&c(),i(!1))},[r]),a=S.useCallback(({IconComponent:c,...u},f)=>C.jsxs(q,{className:T.cx(KL,!r&&UL),p:zv.sm,alignItems:"center",flex:!0,row:!0,gap:zv.xs,onClick:s(()=>n(u.id,f)),children:[C.jsx(c,{width:20,height:20,color:Bv.icon.tertiary}),C.jsx(le,{variant:"body-2",children:u.label})]},u.id),[r,n,s]),l=S.useMemo(()=>e.map((c,u)=>{const f=u===e.length-1;if(!c.length)return null;const d=c.map((h,g)=>{const m=(u?e.slice(0,u).flat().length:0)+g+t;return a(h,m)});return C.jsxs(S.Fragment,{children:[d,f?null:C.jsx(q,{w:"full",h:1,backgroundColor:Bv.border.neutralAlphaBasic})]},c.flatMap(h=>h.id).join("-"))}),[e,a,t]);return C.jsx(Or,{content:C.jsx(q,{flex:!0,children:l}),placement:"bottom",open:o,onChange:i,children:C.jsx(pr,{size:"xs",color:"no-bg",disabled:r,children:C.jsx(WL,{})})})}const qL=T.css({minWidth:"fit-content"}),YL=e=>{throw new Error("defaultOnImagesUpload function must be overridden")},{spacing:Hv}=V;function Wv({onSave:e}){const[t,n]=S.useState(""),[r,o]=S.useState(""),[i,s]=S.useState(null),a=ra(),{textPlaceholder:l,linkPlaceholder:c,linkErrorText:u,buttonText:f}=a.toolbar.link,d=S.useMemo(()=>i==="link"?u:null,[i,u]),h=S.useCallback(x=>{try{const b=new URL(x);if(!(b.protocol==="http:"||b.protocol==="https:"))throw new Error("Invalid protocol");return s(null),!0}catch{return s("link"),!1}},[]),g=S.useCallback(x=>{n(x.target.value)},[]),p=S.useCallback(x=>{h(x.target.value),o(x.target.value)},[h]),m=S.useCallback(()=>[()=>h(r)].map(w=>w()).every(Boolean),[r,h]),v=S.useCallback(()=>{n(""),o(""),s(null)},[]),y=S.useCallback(x=>{x.preventDefault(),m()&&(e({text:t||r,url:r}),v())},[r,e,t,m,v]);return S.useEffect(()=>()=>{v()},[]),C.jsx("form",{onSubmit:y,children:C.jsxs(q,{flex:!0,alignItems:"flex-start",p:Hv.sm,gap:Hv.sm,children:[C.jsx(q,{children:C.jsx($i,{placeholder:l,size:"sm",value:t,onChange:g})}),C.jsx(q,{children:C.jsx($i,{placeholder:c,size:"sm",value:r,onChange:p,error:!!d,errorText:d||""})}),C.jsx(Br,{size:"xs",width:"auto",type:"submit",children:f})]})})}const Kv=50,Uv=20,Gv=1,qv=1;function Yv({onSave:e}){const[t,n]=S.useState(""),[r,o]=S.useState(""),[i,s]=S.useState(null),[a,l]=S.useState(null),c=ra(),{maxRowsErrorText:u,maxColumnsErrorText:f,minRowsErrorText:d,minColumnsErrorText:h,rowsPlaceholder:g,columnsPlaceholder:p,buttonText:m}=c.toolbar.table,v=S.useMemo(()=>{switch(i){case"rows-max":return u({current:Number(t),limit:Kv});case"rows-min":return d({current:Number(t),limit:Gv});default:return null}},[i,t,u,d]),y=S.useMemo(()=>{switch(a){case"columns-max":return f({current:Number(r),limit:Uv});case"columns-min":return h({current:Number(r),limit:qv});default:return null}},[a,r,f,h]),x=S.useCallback(F=>{try{const $=Number(F);if($>Kv)throw s("rows-max"),new Error("Rows amount exceeds maximum");if($<Gv)throw s("rows-min"),new Error("Rows amount below minimum");return s(null),!0}catch{return!1}},[]),b=S.useCallback(F=>{try{const $=Number(F);if($>Uv)throw l("columns-max"),new Error("Columns amount exceeds maximum");if($<qv)throw l("columns-min"),new Error("Columns amount below minimum");return l(null),!0}catch{return!1}},[]),w=S.useCallback(F=>{const $=Number(F);return!Number.isNaN($)&&Number.isInteger($)?$:null},[]),_=S.useCallback(F=>{const $=F.target.value,j=w($);typeof j=="number"&&(x($),n(String(j)))},[x,w]),E=S.useCallback(F=>{const $=F.target.value,j=w($);typeof j=="number"&&(b($),o(String(j)))},[b,w]),R=S.useCallback(()=>[()=>x(t),()=>b(r)].map(j=>j()).every(Boolean),[r,t,b,x]),k=S.useCallback(()=>{n(""),o(""),s(null),l(null)},[]),P=S.useCallback(F=>{F.preventDefault(),R()&&(e({rows:t,columns:r}),k())},[r,e,t,R,k]);return S.useEffect(()=>()=>{k()},[]),C.jsx("form",{onSubmit:P,children:C.jsxs(q,{flex:!0,alignItems:"flex-start",p:"var(--spacing-sm)",gap:"var(--spacing-sm)",children:[C.jsx(q,{children:C.jsx($i,{placeholder:g,size:"sm",value:t,onChange:_,error:!!v,errorText:v||""})}),C.jsx(q,{children:C.jsx($i,{placeholder:p,size:"sm",value:r,onChange:E,error:!!y,errorText:y||""})}),C.jsx(Br,{size:"xs",width:"auto",type:"submit",children:m})]})})}function XL({disabled:e=!1}){const[t,n]=S.useState(null),[r]=lt(),o=ra(),i=S.useMemo(()=>{const l=o.toolbar.textSize;return[{value:"paragraph",label:l.paragraph,textProps:{variant:"body-2"}},{value:"h1",label:l.h1,textProps:{fontWeight:"semibold",variant:"headline-1"}},{value:"h2",label:l.h2,textProps:{fontWeight:"semibold",variant:"headline-2"}},{value:"h3",label:l.h3,textProps:{fontWeight:"semibold",variant:"headline-3"}}]},[o.toolbar.textSize]),s=S.useCallback(l=>{!l||Array.isArray(l)||r.update(()=>{const c=Z();if(!W(c))return;const u=c.anchor.getNode().getTopLevelElement();if(!u)return;const f=l==="paragraph"?ye():Co(l);u.getChildren().forEach(d=>{f.append(d)}),u.replace(f),f.selectEnd()})},[r]),a=S.useCallback(()=>{const l=Z();if(!W(l))return null;const c=l.anchor.getNode().getTopLevelElement();return Zw(c)?c.getTag():"paragraph"},[]);return S.useEffect(()=>{const l=r.registerUpdateListener(({editorState:c})=>{c.read(()=>{const u=a();u&&n(u)})});return()=>{l()}},[r,a]),C.jsx(Sg,{size:"xs",items:i,renderDropdownItem:l=>C.jsx(le,{whiteSpace:"nowrap",...l.textProps,children:l.label}),returnedValue:l=>l.value,renderSingleInputItem:l=>l.label,onChange:s,disabled:e,value:t,showDefaultItem:!1})}const{color:hs,cornerRadius:ZL,spacing:zu}=V;function JL({onImagesUpload:e=YL,className:t}){const[n,r]=S.useState(11),[o,i]=S.useState(null),[s,a]=S.useState(null),l=S.useRef(null),{toolbar:c}=ra(),u=c.preview,[f]=lt(),{isEditable:d,isPreviewMode:h,setPreviewMode:g}=na(),{availableActionGroups:p}=$M(),m=S.useRef(null),v=S.useMemo(()=>!d||h,[d,h]),y=S.useMemo(()=>h?u.hide:u.show,[h,u]),{toolbarGroups:x,menuGroups:b}=S.useMemo(()=>{const D=[],K=[];let I=0;for(const M of p){const H=[],U=[];for(const re of M)I+=1,I<=n?H.push(re):U.push(re);H.length&&D.push(H),U.length&&K.push(U)}return{toolbarGroups:D,menuGroups:K}},[p,n]),w=S.useMemo(()=>typeof o=="number"&&o>n-1,[o,n]),_=S.useMemo(()=>typeof s=="number"&&s>n-1,[s,n]),E=S.useCallback(D=>{const{text:K,url:I}=D;f.update(()=>{const M=Z();if(W(M)){const H=PC({text:K,url:I});M.insertNodes([H]);const U=Fe(" ");H.insertAfter(U),U.select()}}),i(null)},[f]),R=S.useCallback(D=>{const{rows:K,columns:I}=D;f.dispatchCommand(bC,{rows:K,columns:I}),a(null)},[f]),k=S.useCallback(()=>{m.current&&m.current.click()},[]),P=S.useCallback(async D=>{try{const K=Array.from(D.target.files||[]);if(!K.length)return;const I=await e(K);f.update(()=>{const M=LC(I);M&&Bh([M])})}catch(K){console.error("Error uploading images:",K)}finally{D.target.value=""}},[f,e]),F=S.useCallback((D,K)=>{({[ae.BOLD]:()=>{f.dispatchCommand(Vt,"bold")},[ae.ITALIC]:()=>{f.dispatchCommand(Vt,"italic")},[ae.UNDERLINE]:()=>{f.dispatchCommand(Vt,"underline")},[ae.STRIKETHROUGH]:()=>{f.dispatchCommand(Vt,"strikethrough")},[ae.ALIGN_LEFT]:()=>{f.dispatchCommand(Ti,"left")},[ae.ALIGN_CENTER]:()=>{f.dispatchCommand(Ti,"center")},[ae.ALIGN_RIGHT]:()=>{f.dispatchCommand(Ti,"right")},[ae.LINK]:()=>{i(K)},[ae.IMAGE]:()=>{k()},[ae.TABLE]:()=>{a(K)},[ae.BULLET_LIST]:()=>{f.dispatchCommand(Bw,void 0)},[ae.NUMBERED_LIST]:()=>{f.dispatchCommand(zw,void 0)}})[D]()},[k,f]),$=S.useMemo(()=>x.map((D,K)=>{const I=x.slice(0,K).reduce((U,re)=>U+re.length,0);if(!D.length)return null;const M=D.map(({IconComponent:U,isActive:re,id:G},Y)=>{const Q=I+Y,ne=re?"neutral":"no-bg";return G===ae.LINK?C.jsx(Or,{content:C.jsx(Wv,{onSave:E}),placement:"bottom",open:o===Q,onChange:oe=>{i(oe?Q:null)},children:C.jsx(pr,{size:"xs",color:"no-bg",disabled:v,children:C.jsx(U,{})})},G):G===ae.TABLE?C.jsx(Or,{content:C.jsx(Yv,{onSave:R}),placement:"bottom",open:s===Q,onChange:oe=>{a(oe?Q:null)},children:C.jsx(pr,{size:"xs",color:ne,disabled:v,children:C.jsx(U,{})})},G):C.jsx(pr,{size:"xs",color:ne,onClick:()=>F(G,Q),disabled:v,children:C.jsx(U,{})},G)});return M.every(U=>!U)?null:C.jsxs(S.Fragment,{children:[M,C.jsx(q,{w:1,h:32,backgroundColor:hs.border.neutralAlphaBasic})]},D.flatMap(U=>U.id).join("-"))}),[x,F,o,v,s,E,R]),j=S.useCallback(()=>{const D=l.current;if(!D)return;const K=D.clientWidth,I=40,M=4,H=1,U=M+H+M+I+M;let re=K-U,G=0;for(const Y of p)if(Y.length){for(const Q of Y){const ne=I+M;if(re-ne>=0)re-=ne,G+=1;else break}re-=H+M}r(G)},[p]),O=S.useMemo(()=>_L(j,20,{}),[j]);return S.useEffect(()=>{if(!l.current)return;const D=new ResizeObserver(()=>{O()});return D.observe(l.current),()=>D.disconnect()},[O]),C.jsxs(q,{backgroundColor:hs.fill.neutralPrimary,border:`1px solid ${hs.border.neutralAlphaBasic}`,borderRadius:ZL.md,flex:!0,row:!0,alignItems:"center",justifyContent:"space-between",p:zu.sm,className:t,children:[C.jsxs(q,{flex:!0,flexGrow:1,row:!0,alignItems:"center",overflow:"hidden",children:[C.jsx("input",{ref:m,type:"file",accept:"image/*",hidden:!0,multiple:!0,onChange:P,disabled:v}),C.jsx(XL,{disabled:v}),C.jsx(Or,{content:C.jsx(Wv,{onSave:E}),placement:"bottom",open:w,onChange:D=>{D||i(null)},children:C.jsx("div",{})}),C.jsx(Or,{content:C.jsx(Yv,{onSave:R}),placement:"bottom",open:_,onChange:D=>{D||a(null)},children:C.jsx("div",{})}),C.jsxs(q,{flex:!0,row:!0,alignItems:"center",gap:zu.xs,w:"full",ml:zu.xs,overflow:"hidden",ref:l,children:[$,b.length?C.jsx(GL,{disabled:v,onAction:F,groups:b,toolbarVisibleActionsCount:n}):null]})]}),C.jsx(Br,{width:"auto",size:"xs",color:h?"accent":"neutral",intensity:"secondary",wrapperClassName:qL,onClick:()=>{g(D=>!D)},iconLeft:C.jsx(TL,{color:h?hs.icon.accent:hs.icon.secondary}),children:y})]})}const OC=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?S.useLayoutEffect:S.useEffect;function QL({editor:e,ariaActiveDescendant:t,ariaAutoComplete:n,ariaControls:r,ariaDescribedBy:o,ariaErrorMessage:i,ariaExpanded:s,ariaInvalid:a,ariaLabel:l,ariaLabelledBy:c,ariaMultiline:u,ariaOwns:f,ariaRequired:d,autoCapitalize:h,className:g,id:p,role:m="textbox",spellCheck:v=!0,style:y,tabIndex:x,"data-testid":b,...w},_){const[E,R]=S.useState(e.isEditable()),k=S.useCallback(F=>{F&&F.ownerDocument&&F.ownerDocument.defaultView?e.setRootElement(F):e.setRootElement(null)},[e]),P=S.useMemo(()=>(function(...F){return $=>{for(const j of F)typeof j=="function"?j($):j!=null&&(j.current=$)}})(_,k),[k,_]);return OC(()=>(R(e.isEditable()),e.registerEditableListener(F=>{R(F)})),[e]),C.jsx("div",{"aria-activedescendant":E?t:void 0,"aria-autocomplete":E?n:"none","aria-controls":E?r:void 0,"aria-describedby":o,...i!=null?{"aria-errormessage":i}:{},"aria-expanded":E&&m==="combobox"?!!s:void 0,...a!=null?{"aria-invalid":a}:{},"aria-label":l,"aria-labelledby":c,"aria-multiline":u,"aria-owns":E?f:void 0,"aria-readonly":!E||void 0,"aria-required":d,autoCapitalize:h,className:g,contentEditable:E,"data-testid":b,id:p,ref:P,role:m,spellCheck:v,style:y,tabIndex:x,...w})}const eF=S.forwardRef(QL);function Xv(e){return e.getEditorState().read(pC(e.isComposing()))}const IC=S.forwardRef(tF);function tF(e,t){const{placeholder:n,...r}=e,[o]=lt();return C.jsxs(C.Fragment,{children:[C.jsx(eF,{editor:o,...r,ref:t}),n!=null&&C.jsx(nF,{editor:o,content:n})]})}function nF({content:e,editor:t}){const n=(function(s){const[a,l]=S.useState(()=>Xv(s));return OC(()=>{function c(){const u=Xv(s);l(u)}return c(),Nn(s.registerUpdateListener(()=>{c()}),s.registerEditableListener(()=>{c()}))},[s]),a})(t),[r,o]=S.useState(t.isEditable());if(S.useLayoutEffect(()=>(o(t.isEditable()),t.registerEditableListener(s=>{o(s)})),[t]),!n)return null;let i=null;return typeof e=="function"?i=e(r):e!==null&&(i=e),i===null?null:C.jsx("div",{"aria-hidden":!0,children:i})}const rF=S.createContext(null),Hu={didCatch:!1,error:null};class oF extends S.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Hu}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(...t){const{error:n}=this.state;n!==null&&(this.props.onReset?.({args:t,reason:"imperative-api"}),this.setState(Hu))}componentDidCatch(t,n){this.props.onError?.(t,n)}componentDidUpdate(t,n){const{didCatch:r}=this.state,{resetKeys:o}=this.props;r&&n.error!==null&&iF(t.resetKeys,o)&&(this.props.onReset?.({next:o,prev:t.resetKeys,reason:"keys"}),this.setState(Hu))}render(){const{children:t,fallbackRender:n,FallbackComponent:r,fallback:o}=this.props,{didCatch:i,error:s}=this.state;let a=t;if(i){const l={error:s,resetErrorBoundary:this.resetErrorBoundary};if(typeof n=="function")a=n(l);else if(r)a=S.createElement(r,l);else if(o!==void 0)a=o;else throw s}return S.createElement(rF.Provider,{value:{didCatch:i,error:s,resetErrorBoundary:this.resetErrorBoundary}},a)}}function iF(e=[],t=[]){return e.length!==t.length||e.some((n,r)=>!Object.is(n,t[r]))}function DC({children:e,onError:t}){return C.jsx(oF,{fallback:C.jsx("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:t,children:e})}const sF=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?S.useLayoutEffect:S.useEffect;function aF(e){return{initialValueFn:()=>e.isEditable(),subscribe:t=>e.registerEditableListener(t)}}function lF(){return(function(e){const[t]=lt(),n=S.useMemo(()=>e(t),[t,e]),[r,o]=S.useState(()=>n.initialValueFn()),i=S.useRef(r);return sF(()=>{const{initialValueFn:s,subscribe:a}=n,l=s();return i.current!==l&&(i.current=l,o(l)),a(c=>{i.current=c,o(c)})},[n,e]),r})(aF)}const cF={name:"@lexical/react/ReactProvider"};function uF(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const o of t)r.append("v",o);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const bg=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?S.useLayoutEffect:S.useEffect;function dF({editor:e,ErrorBoundary:t}){return(function(n,r){const[o,i]=S.useState(()=>n.getDecorators());return bg(()=>n.registerDecoratorListener(s=>{$s.flushSync(()=>{i(s)})}),[n]),S.useEffect(()=>{i(n.getDecorators())},[n]),S.useMemo(()=>{const s=[],a=Object.keys(o);for(let l=0;l<a.length;l++){const c=a[l],u=C.jsx(r,{onError:d=>n._onError(d),children:C.jsx(S.Suspense,{fallback:null,children:o[c]})}),f=n.getElementByKey(c);f!==null&&s.push($s.createPortal(u,f,c))}return s},[r,o,n])})(e,t)}function fF({editor:e,ErrorBoundary:t}){return(function(n){const r=UM.maybeFromEditor(n);if(r&&r.hasExtensionByName(cF.name)){for(const o of["@lexical/plain-text","@lexical/rich-text"])r.hasExtensionByName(o)&&uF(320,o);return!0}return!1})(e)?null:C.jsx(dF,{editor:e,ErrorBoundary:t})}function Zv(e){return e.getEditorState().read(pC(e.isComposing()))}function jC({contentEditable:e,placeholder:t=null,ErrorBoundary:n}){const[r]=lt();return(function(o){bg(()=>Nn(CP(o),gP(o)),[o])})(r),C.jsxs(C.Fragment,{children:[e,C.jsx(hF,{content:t}),C.jsx(fF,{editor:r,ErrorBoundary:n})]})}function hF({content:e}){const[t]=lt(),n=(function(o){const[i,s]=S.useState(()=>Zv(o));return bg(()=>{function a(){const l=Zv(o);s(l)}return a(),Nn(o.registerUpdateListener(()=>{a()}),o.registerEditableListener(()=>{a()}))},[o]),i})(t),r=lF();return n?typeof e=="function"?e(r):e:null}const gF=T.css({width:"100%"}),pF=T.css({pointerEvents:"none"});function mF(e){const{placeholder:t,className:n}=e||{},r=S.useRef(null),{alignment:o}=kw(),i=S.useCallback(a=>{if(!t)return null;const l=typeof t=="string"||typeof t=="object"&&t.hasWrapper,c=typeof t=="string"?t:t.renderContent(a);return l?C.jsx(le,{variant:"body-2",colorName:"tertiary",children:c}):C.jsx(C.Fragment,{children:c})},[t]),s=S.useCallback(a=>{const l=i(a);if(!l)return null;const c={left:"flex-start",center:"center",right:"flex-end"};return C.jsx(q,{absolute:!0,w:"full",top:0,left:0,alignItems:c[o],className:pF,children:l})},[i,o]);return C.jsx(q,{relative:!0,row:!0,w:"full",flexGrow:1,className:n,children:C.jsx(jC,{contentEditable:C.jsx(IC,{ref:r,className:gF,"aria-placeholder":"markdown editor",placeholder:s}),ErrorBoundary:DC})})}const{color:yF,spacing:vF}=V,xF=T.css({counterReset:"line"}),bF=T.css({display:"grid",gridTemplateColumns:"3ch 1fr",columnGap:vF.sm,whiteSpace:"pre-wrap",":before":{counterIncrement:"line",content:"counter(line)",color:yF.text.accent,userSelect:"none",textAlign:"right"}});function wF({className:e,lineClassName:t}={}){const{markdownText:n}=na(),r=n.split(`
65
+ `);return C.jsx("pre",{className:T.cx(xF,e),children:r.map((o,i)=>C.jsx(le,{tag:"span",className:T.cx(bF,t),children:o||" "},i))})}const ri={text:T.css({fontFamily:"Inter, sans-serif"}),paragraph:T.css({...xe.body2}),h1:T.css({...xe.headline1}),h2:T.css({...xe.headline2}),h3:T.css({...xe.headline3}),h4:T.css({...xe.body2})},{color:wg,spacing:Jv}=V,CF=T.css({borderSpacing:"0",borderCollapse:"separate"}),SF=T.css({border:`1px solid ${wg.border.neutralPrimary}`,padding:`${Jv.sm} ${Jv.sm}`}),_F=T.css({color:wg.text.accent}),TF=T.css({fontWeight:"bold"}),EF=T.css({textDecoration:"underline"}),RF=T.css({textDecoration:"line-through"}),kF=T.css({textDecoration:"underline line-through"}),AF=T.css({fontStyle:"italic"}),NF=T.css({color:wg.text.accent,textDecoration:"underline"}),MF={table:CF,tableCell:SF,hashtag:_F,link:NF,text:{base:ri.text,bold:TF,underline:EF,strikethrough:RF,underlineStrikethrough:kF,italic:AF},heading:{h1:ri.h1,h2:ri.h2,h3:ri.h3,h4:ri.h4},paragraph:ri.paragraph};function VC(){return{namespace:"ui-kit-markdown-text-editor",nodes:[Wo,fn,Uo,eo,Pn,Mn,qr,Yr,Vo,wc,xc,vc,bc,fa,ha],onError(e){throw e},theme:MF}}const PF=[[ae.BOLD,ae.ITALIC,ae.UNDERLINE,ae.STRIKETHROUGH],[ae.LINK,ae.IMAGE],[ae.ALIGN_LEFT,ae.ALIGN_CENTER,ae.ALIGN_RIGHT],[ae.TABLE],[ae.BULLET_LIST,ae.NUMBERED_LIST]];function LF(){const[e]=lt(),{isEditable:t}=na();return S.useEffect(()=>{e.setEditable(t)},[e,t]),null}function FF(){const[e]=lt();return S.useEffect(()=>{const t=e.registerCommand(sc,()=>{const n=Z();if(!W(n)||!n.isCollapsed()||n.anchor.offset!==0)return!1;const o=n.anchor.getNode().getTopLevelElement();if(!o||o.getType()!=="paragraph"||o.getTextContent()!=="")return!1;const i=o.getPreviousSibling();return FC(i)?(i.remove(),o.select(),!0):!1},Dt);return()=>{t()}},[e]),null}const $F=/^\|(.+)\|$/,OF=/^\|\s*:?-+:?\s*(\|\s*:?-+:?\s*)+\|$/,IF=/^\|(.+)\|$/,DF={type:"multiline-element",dependencies:[Pn,qr,Mn],regExpStart:$F,handleImportAfterStartMatch({lines:e,rootNode:t,startLineIndex:n}){const r=e[n+1];if(!OF.test(r??""))return null;const o=Sc();let i=n;for(;i<e.length&&IF.test(e[i]);){if(i===n+1){i++;continue}const s=ji(),a=e[i].slice(1,-1).split("|").map(c=>c.trim()),l=i===n;a.forEach(c=>{const u=un(l?st.ROW:void 0);u.append(Fe(c)),s.append(u)}),o.append(s),i++}return t.append(o),[!0,i-1]},replace(){return!0},export(e){if(!(e instanceof Pn))return null;const n=e.getChildren();if(!n.length)return"";const r=[];return n.forEach((o,i)=>{if(!(o instanceof qr))return;const a=o.getChildren().map(l=>l instanceof Mn?l.getTextContent().replace(/\n/g," ").trim():"");r.push(`| ${a.join(" | ")} |`),i||r.push(`| ${a.map(()=>"---").join(" | ")} |`)}),r.join(`
66
+ `)}},Gl=[DF,HL,FL,...ga];function jF({defaultValue:e}){const[t]=lt();return S.useEffect(()=>{t.update(()=>{e&&fC(e,Gl)})},[t]),null}const{color:Wu,cornerRadius:Qv,spacing:Ka}=V;function VF({label:e,plugins:t,field:n,disabled:r=!1,locale:o,toolbar:i,defaultMarkdown:s,events:a={},className:l,labelClassName:c,toolbarClassName:u,editorClassName:f,fieldClassName:d,previewClassName:h}){const[g,p]=S.useState(""),[m,v]=S.useState(!1),{availableActions:y,onImagesUpload:x}=i||{},b=S.useMemo(()=>VC(),[]),w=S.useMemo(()=>({isEditable:!r,isPreviewMode:m,setPreviewMode:v,markdownText:g}),[r,m,g]),_=S.useMemo(()=>({availableActions:y||PF}),[y]),E=S.useCallback(k=>{p(k),a.onMarkdownChange&&a.onMarkdownChange(k)},[a]),R=S.useCallback(k=>{k.read(()=>{const P=p6(Gl);E(P),a.onEditorStateChange&&a.onEditorStateChange(k)})},[E,a]);return C.jsx(VA,{locale:o,children:C.jsx(gC,{initialConfig:b,children:C.jsx(kh.Provider,{value:w,children:C.jsxs(K1.Provider,{value:_,children:[C.jsxs(q,{flex:!0,w:"full",borderRadius:Qv.lg,p:Ka.lg,gap:Ka.sm,backgroundColor:Wu.fill.neutralSecondary,className:l,children:[e?C.jsx(le,{variant:"headline-3",fontWeight:"semibold",className:c,children:e}):null,C.jsx(JL,{onImagesUpload:x,className:u}),C.jsx(q,{backgroundColor:Wu.fill.neutralPrimary,border:`1px solid ${Wu.border.neutralAlphaBasic}`,borderRadius:Qv.md,p:`${Ka.md} ${Ka.lg}`,w:"full",h:144,overflow:"auto",className:f,children:m?C.jsx(wF,{className:h}):C.jsx(mF,{...n,className:d})})]}),C.jsx(m6,{}),C.jsx(R6,{}),C.jsx(dL,{}),C.jsx(E6,{}),C.jsx(P6,{transformers:Gl}),C.jsx(F6,{onChange:R}),C.jsx(LF,{}),C.jsx(jF,{defaultValue:s}),C.jsx(FF,{}),t]})})})})}const{color:vn}=V,oi={input:T.css({...xe.common,...xe.body1,width:48,height:48,textAlign:"center",borderRadius:12,border:`1px solid ${vn.border.neutralAlphaBasic}`,color:vn.text.primary,outline:"none",transition:"border-color 0.5s ease, background-color 0.5s ease, box-shadow 0.5s ease","&::placeholder":{color:vn.text.tertiary},"&:focus-visible":{borderColor:vn.border.accentPrimary,boxShadow:`0 0 0 1px ${vn.border.accentPrimary}`},"&:not(.disabled):hover":{backgroundColor:vn.fill.neutralPrimaryHover},"&:disabled":{opacity:.6,cursor:"not-allowed"}}),error:T.css({borderColor:vn.border.negativePrimary}),success:T.css({borderColor:vn.border.positivePrimary}),disabled:T.css({pointerEvents:"none",opacity:.5}),white:T.css({background:vn.fill.bgPrimary}),gray:T.css({background:vn.fill.bgSecondary}),glow:T.css({position:"absolute",inset:0,borderRadius:12,pointerEvents:"none",opacity:0,transformOrigin:"center",background:vn.fill.accentPrimary})};function BF(e){const t=S.useRef(void 0);return S.useEffect(()=>{t.current=e},[e]),t.current}const{spacing:e0}=V,BC=S.forwardRef(({length:e=6,label:t,prompt:n,error:r,errorText:o,success:i,disabled:s,autoFocus:a,center:l,secure:c,loading:u,background:f="gray",numeric:d=!0,className:h,inputsContainerClassName:g,inputClassName:p,labelClassName:m,promptClassName:v,errorClassName:y,value:x,defaultValue:b,onChange:w,onComplete:_},E)=>{const R=typeof x=="string",k=R?x:b,P=typeof k=="string"?k.slice(0,e):"",[F,$]=Bo(R?x:void 0,P),[j,O]=S.useState(()=>{const G=P.slice(0,e);return Array.from({length:e},(Y,Q)=>G[Q]??"")}),D=S.useRef(void 0),K=BF(x),I=S.useRef([]);S.useEffect(()=>{if(!R)return;const G=x??"";if(G===K)return;if(G===D.current){D.current=void 0;return}const Y=G.slice(0,e);O(Array.from({length:e},(Q,ne)=>Y[ne]??""))},[R,x,e,K]);const M=S.useCallback((G,Y)=>{const Q=G.slice(0,e);Y?.fromInternal&&(D.current=Q),$(Q),w?.(Q),Q.length===e&&_?.(Q)},[e,w,_,$]);S.useImperativeHandle(E,()=>({focus:()=>{I.current[0]?.focus()},blur:()=>{I.current.forEach(G=>G?.blur())},get value(){return F||""},setValue:G=>{const Y=G.slice(0,e);O(Array.from({length:e},(Q,ne)=>Y[ne]??"")),M(Y,{fromInternal:!0})},clear:()=>{O(Array.from({length:e},()=>"")),M("",{fromInternal:!0})}}),[e,M,F]);const H=S.useCallback((G,Y)=>{if(s)return;let Q=Y;if(d&&(Q=Q.replace(/\D/g,"")),Q.length>1){const ee=j.slice(0,G).join("")+Q+j.slice(G+1).join(""),ve=Array.from({length:e},(ze,je)=>ee[je]??"");O(ve),M(ee,{fromInternal:!0});const Se=Math.min(G+Q.length,e-1),Ee=I.current[Se];Ee?.focus(),Ee?.select();return}const ne=j[G],oe=[...j];oe[G]=Q,O(oe);const me=oe.join("");if(M(me,{fromInternal:!0}),!ne&&Q&&G<e-1){const ee=I.current[G+1];ee?.focus(),ee?.select()}},[j,s,e,d,M]),U=S.useCallback((G,Y)=>{if(!s){if(Y.key==="Backspace"){Y.preventDefault();const Q=I.current[G];if(j[G]){const ne=[...j];ne[G]="",O(ne),M(ne.join(""),{fromInternal:!0}),Q?.focus();return}if(G>0){const ne=I.current[G-1];ne?.focus(),ne?.select()}return}Y.key==="ArrowLeft"&&G>0&&(Y.preventDefault(),I.current[G-1]?.focus()),Y.key==="ArrowRight"&&G<e-1&&(Y.preventDefault(),I.current[G+1]?.focus())}},[j,s,e,M]),re=S.useCallback((G,Y)=>{if(s)return;Y.preventDefault();let Q=Y.clipboardData.getData("text");if(d&&(Q=Q.replace(/\D/g,"")),!Q)return;const ne=e-G,oe=Math.min(Q.length,ne),me=Q.slice(0,oe),ee=[...j];for(let ze=0;ze<oe;ze++)ee[G+ze]=me[ze]??"";O(ee);const ve=ee.join("");M(ve,{fromInternal:!0});const Se=Math.min(G+oe-1,e-1),Ee=I.current[Se];Ee?.focus(),Ee?.select()},[j,s,e,d,M]);return C.jsxs(q,{w:"full",gap:e0.sm,className:h,center:l,children:[t&&C.jsx(le,{variant:"body-2",fontWeight:"regular",colorName:"tertiary",className:m,children:t}),C.jsx(q,{row:!0,w:"full",gap:e0.sm,center:l,className:T.cx({[oi.disabled]:s},g),children:Array.from({length:e}).map((G,Y)=>C.jsxs(q,{relative:!0,display:"inline-block",children:[C.jsx("input",{ref:Q=>{I.current[Y]=Q},className:T.cx(oi.input,oi[f],r&&oi.error,i&&oi.success,j[Y]&&T.css({caretColor:"transparent"}),p),inputMode:d?"numeric":"text",type:c?"password":"text",maxLength:1,autoFocus:a&&Y===0,disabled:s||u,value:j[Y],onChange:Q=>H(Y,Q.target.value),onKeyDown:Q=>U(Y,Q),onPaste:Q=>re(Y,Q)}),C.jsx(ea.span,{className:oi.glow,variants:zF,custom:Y,initial:"idle",animate:u?"wave":"idle"})]},Y))}),n&&C.jsx(le,{variant:"caption-1",colorName:"tertiary",className:v,children:n}),o&&r&&C.jsx(le,{variant:"body-2",colorName:"negative",fontWeight:"regular",className:y,children:o})]})}),zF={idle:{opacity:0,scale:1,transition:{duration:.18}},wave:(e=0)=>({opacity:[0,.2,0],scale:[1,1.03,1],transition:{duration:1.5,delay:e*.15,repeat:1/0,ease:[.42,0,.58,1]}})};BC.displayName="OtpInput";const zC=S.createContext(null),HF=()=>S.useContext(zC),{spacing:WF}=V,gs={radio:T.css({display:"flex",alignItems:"flex-start",justifyContent:"flex-start",gap:WF.md,cursor:"pointer"}),disabled:T.css({opacity:.5,cursor:"not-allowed"}),sideRight:T.css({flexDirection:"row-reverse",justifyContent:"space-between"}),readOnly:T.css({cursor:"auto"}),checked:T.css({})},{color:_r,cornerRadius:t0}=V,n0={sm:{inner:12,outer:20},md:{inner:16,outer:24}},HC=S.forwardRef(({value:e,children:t,checked:n,defaultChecked:r,onChange:o,disabled:i,className:s,description:a,size:l,side:c,readOnly:u,error:f,outerCircleClassName:d,innerCircleClassName:h,labelContainerClassName:g,labelClassName:p,descriptionClassName:m},v)=>{const y=HF(),x=!!y,b=n!==void 0,[w,_]=Bo(n,r),E=x?y.value===e:b?n:w,R=y?.disabled||i,k=l??y?.size??"md",P=c??y?.side??"left",F=u??y?.readOnly??!1,$=f??y?.error??!1,j=n0[k].outer,O=n0[k].inner,D=()=>{R||F||(x?y.setValue?.(e):(b||_(!E),o?.(!E)))},K=E&&$?_r.fill.negativeTint:E?_r.fill.accentTint:_r.fill.bgSecondary,I=E&&$?_r.fill.negativePrimary:E?_r.fill.accentPrimary:void 0,M=E&&$||$&&!E?_r.border.negativeSecondary:_r.border.neutralAlphaLow;return C.jsxs("button",{ref:v,role:"radio",type:"button","data-value":e,"aria-checked":E,"aria-disabled":R||void 0,tabIndex:E?0:-1,className:T.cx([gs.radio,E&&gs.checked,R&&gs.disabled,P==="right"&&gs.sideRight,F&&gs.readOnly,s]),onClick:D,children:[C.jsx(q,{w:j,h:j,backgroundColor:K,borderWidth:E?0:1,borderColor:M,borderStyle:"solid",center:!0,borderRadius:t0.fullRound,className:d,children:C.jsx(q,{w:O,h:O,backgroundColor:I,borderRadius:t0.fullRound,"aria-hidden":!0,className:h})}),C.jsxs(q,{alignItems:"flex-start",className:g,children:[C.jsx(le,{variant:k==="sm"?"body-2":"body-1",tag:"span",left:!0,className:p,children:t}),a&&C.jsx(le,{tag:"span",variant:"body-2",colorName:"secondary",className:m,children:a})]})]})});HC.displayName="Radio";const{spacing:r0}=V,WC=S.forwardRef(({label:e,value:t,defaultValue:n,onChange:r,children:o,className:i,error:s=!1,disabled:a=!1,readOnly:l=!1,side:c="left",size:u="md",labelClassName:f,optionsContainerClassName:d},h)=>{const[g,p]=Bo(t,n),m=t!==void 0,v=m?t:g,y=S.useCallback(b=>{m||p(b),r?.(b)},[m,r,p]),x=S.useRef(null);return S.useImperativeHandle(h,()=>x.current),C.jsx(zC.Provider,{value:{value:v,readOnly:l,disabled:a,setValue:y,size:u,side:c,error:s},children:C.jsxs(q,{gap:r0.sm,ref:x,role:"radiogroup","aria-invalid":s||void 0,className:i,children:[typeof e=="string"?C.jsx(le,{colorName:"secondary",className:f,children:e}):e,C.jsx(q,{gap:r0.lg,className:d,children:o})]})})});WC.displayName="RadioGroup";const{color:or}=V,o0=T.css({border:`1px solid ${or.border.neutralAlphaBasic}`}),i0=T.css({display:"flex",alignItems:"center",justifyContent:"center"}),Tr={primary:T.css({background:or.fill.bgPrimary,border:`1px solid ${or.border.neutralAlphaBasic}`}),secondary:T.css({background:or.fill.bgSecondary,border:`1px solid ${or.border.neutralAlphaBasic}`}),button:T.css({cursor:"pointer",border:"1px solid transparent",borderRadius:8,padding:"8px 12px",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:10,transition:"all 0.15s ease",position:"relative",overflow:"hidden",background:"none",[`&:hover:not(.${o0})`]:{background:or.fill.neutralPrimaryHover},[`& .${i0} svg`]:{color:or.icon.tertiary},"&:disabled":{cursor:"not-allowed",opacity:.5}}),"button-active":o0,"button-primary":T.css({background:or.fill.bgSecondary}),"button-secondary":T.css({background:or.fill.bgPrimary}),"button-disabled":T.css({opacity:.5,cursor:"not-allowed"}),"full-width":T.css({width:"100%"}),"icon-container":i0},{color:s0,cornerRadius:KF,spacing:a0}=V;function UF({value:e,onChange:t,options:n,variant:r="primary",fullWidth:o=!1,className:i,buttonClassName:s,activeButtonClassName:a,disabledButtonClassName:l,iconContainerClassName:c,textClassName:u,separatorClassName:f}){return C.jsx(q,{row:!0,alignItems:"center",borderRadius:KF.md,p:a0.xs,gap:a0.md,className:T.cx(Tr[r],o&&Tr["full-width"],i),children:n.map(d=>{const h=d.value===e,g=d.disabled,p=d.separatorAfter??!1;return C.jsxs(S.Fragment,{children:[C.jsxs("button",{type:"button",disabled:g,className:T.cx(Tr.button,o&&Tr["full-width"],h&&Tr["button-active"],h&&Tr[`button-${r}`],g&&Tr["button-disabled"],s,h&&a,g&&l),onClick:()=>!g&&t(d.value),children:[d.icon&&C.jsx(q,{alignItems:"center",justifyContent:"center",className:T.cx(Tr["icon-container"],c),children:d.icon}),d.label&&C.jsx(le,{colorName:h?"primary":"tertiary",className:u,children:d.label}),!g&&C.jsx(zo,{color:s0.fill.bgOverlayPrimary})]}),p&&C.jsx(q,{w:1,h:24,backgroundColor:s0.fill.bgTertiary,className:f})]},d.value)})})}const GF=e=>N.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M6 9L12 15L18 9",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),qF=e=>N.createElement("svg",{fill:"currentColor",id:"Capa_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 462.035 462.035",xmlSpace:"preserve",...e},N.createElement("g",null,N.createElement("path",{d:"M457.83,158.441c-0.021-0.028-0.033-0.058-0.057-0.087l-50.184-62.48c-0.564-0.701-1.201-1.305-1.879-1.845 c-2.16-2.562-5.355-4.225-8.967-4.225H65.292c-3.615,0-6.804,1.661-8.965,4.225c-0.678,0.54-1.316,1.138-1.885,1.845l-50.178,62.48 c-0.023,0.029-0.034,0.059-0.057,0.087C1.655,160.602,0,163.787,0,167.39v193.07c0,6.5,5.27,11.771,11.77,11.771h438.496 c6.5,0,11.77-5.271,11.77-11.771V167.39C462.037,163.787,460.381,160.602,457.83,158.441z M408.516,134.615l16.873,21.005h-16.873 V134.615z M384.975,113.345v42.274H296.84c-2.514,0-4.955,0.805-6.979,2.293l-58.837,43.299l-58.849-43.305 c-2.023-1.482-4.466-2.287-6.978-2.287H77.061v-42.274H384.975z M53.523,155.62H36.65l16.873-21.005V155.62z M438.498,348.69H23.54 V179.16h137.796l62.711,46.148c4.15,3.046,9.805,3.052,13.954-0.005l62.698-46.144h137.799V348.69L438.498,348.69z"}))),KC=e=>N.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("g",{opacity:.6},N.createElement("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}))),{color:tn,cornerRadius:YF,spacing:gi}=V,Ku={sm:{h:28,p:`${gi.xs} ${gi.sm}`,text:"body-2"},md:{h:32,p:`6px ${gi.md}`,text:"body-2"},lg:{h:40,p:`${gi.sm} ${gi.lg}`,text:"body-1"}},Cg=S.forwardRef(({label:e,color:t="primary",size:n="md",onClick:r,onDelete:o,avatar:i,icon:s,disabled:a,className:l,labelClassName:c,avatarClassName:u,iconClassName:f,deleteButtonClassName:d},h)=>{const g=S.useRef(null),p=S.useMemo(()=>{switch(t){case"primary":return{bg:tn.status.neutralTintLow,color:tn.text.primary};case"accent":return{bg:tn.status.accentTintLow,color:tn.text.accent};case"warning":return{bg:tn.status.warningTintLow,color:tn.text.warning};case"positive":return{bg:tn.status.positiveTintLow,color:tn.text.positive};case"negative":return{bg:tn.status.negativeTintLow,color:tn.text.negative};case"transfer":return{bg:"var(--status-transfer-tint-low)",color:"var(--text-transfer)"};default:return{bg:tn.status.neutralTintLow,color:tn.text.primary}}},[t]),m=T.css({cursor:a?"not-allowed":r?"pointer":"default",opacity:a?.5:1,userSelect:"none",position:"relative",transition:"background-color 0.2s, opacity 0.2s","&:hover":a?void 0:{backgroundColor:p.bg}}),v=T.css({display:"inline-flex",cursor:"pointer",opacity:.6,"&:hover":{opacity:1}});return C.jsxs(q,{ref:y=>{g.current=y,typeof h=="function"?h(y):h&&(h.current=y)},row:!0,alignItems:"center",justifyContent:"center",gap:gi.sm,h:Ku[n].h,p:Ku[n].p,overflow:"hidden",borderRadius:YF.sm,backgroundColor:p.bg,color:p.color,onClick:r,className:T.cx(m,l),children:[r&&C.jsx(zo,{}),i&&C.jsx(q,{w:20,h:20,borderRadius:"50%",overflow:"hidden",className:u,children:i}),s&&C.jsx(q,{className:f,children:s}),typeof e=="string"?C.jsx(le,{variant:Ku[n].text,colorName:t,textOverflow:"ellipsis",overflow:"hidden",className:c,children:e}):e,o&&!a&&C.jsx(le,{className:T.cx(v,d),colorName:t,onClick:y=>{y.stopPropagation(),o(y)},children:C.jsx(KC,{})})]})});Cg.displayName="Tag";const{color:At,cornerRadius:ps}=V,l0=T.css({borderColor:At.border.negativePrimary}),Uu=T.css({cursor:"not-allowed",opacity:.5}),UC=T.css({display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",color:"#9ca3af","& svg":{width:20,height:20,transition:"transform 0.2s ease-in"}}),XF=T.css({[`& .${UC} svg`]:{transform:"rotateX(180deg)"}}),dt={"select-container":T.css({position:"relative",display:"inline-block",minWidth:120,"&.full-width":{width:"100%"}}),"full-width":T.css({width:"100%"}),"select-input":T.css({border:`1px solid ${At.border.neutralAlphaBasic}`,borderRadius:ps.md,cursor:"pointer",transition:"all 0.2s ease-in-out",boxSizing:"border-box",[`&:hover:not(.${Uu})`]:{borderColor:At.border.neutralAlphaHigh,backgroundColor:At.fill.neutralPrimaryHover},[`&:focus:not(.${Uu})`]:{outline:"none",borderColor:At.border.accentPrimary},[`&.${l0}:focus`]:{boxShadow:`0 0 0 3px ${At.effect.shadowS}`}}),"size-xs":T.css({minHeight:32,padding:"8px 8px 8px 12px",borderRadius:ps.sm}),"size-sm":T.css({minHeight:40,padding:"10px 12px 10px 16px",borderRadius:ps.sm}),"size-md":T.css({minHeight:48,padding:"14px 12px 14px 16px",borderRadius:ps.md}),"background-primary":T.css({backgroundColor:At.fill.bgPrimary}),"background-secondary":T.css({backgroundColor:At.fill.bgSecondary}),error:l0,disabled:Uu,open:XF,"select-value":T.css({flex:1,color:At.text.primary,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",alignSelf:"center",...xe.common,...xe.body2}),"select-value_xs":T.css({...xe.common,...xe.caption1}),hidden:T.css({visibility:"hidden"}),visible:T.css({visibility:"visible"}),"select-arrow":UC,"select-dropdown":T.css({marginTop:4,backgroundColor:At.fill.bgPrimary,borderRadius:ps.md,boxShadow:`0 4px 20px 0 ${At.effect.shadowS}`,maxHeight:224,overflow:"hidden"}),"select-menu":T.css({maxHeight:224,overflowY:"auto",padding:"4px 0","&::-webkit-scrollbar":{width:3},"&::-webkit-scrollbar-track":{background:"#f1f1f1"},"&::-webkit-scrollbar-thumb":{background:"#c1c1c1",borderRadius:3,"&:hover":{background:At.fill.neutralSecondary}}}),"select-menu-item":T.css({cursor:"pointer",transition:"background-color 0.15s ease-in-out",color:At.text.primary,padding:10,overflow:"hidden",textOverflow:"ellipsis","&:hover":{backgroundColor:At.fill.neutralSecondaryHover}}),"select-menu-item-first":T.css({"&:hover":{cursor:"auto",backgroundColor:"inherit"}}),selected:T.css({backgroundColor:At.fill.neutralSecondary}),"overflow-tooltip-container":T.css({width:"100%",position:"relative"}),"overflow-tooltip-text":T.css({width:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),"empty-block":T.css({textAlign:"center",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",padding:14})},ZF={xs:T.css({width:16,height:16,"& svg":{width:16,height:16,transition:"transform 0.2s ease-in"}}),sm:T.css({}),md:T.css({})};function Sg({value:e,onChange:t,multiple:n=!1,returnedValue:r,renderItem:o,renderInputItem:i,renderSingleInputItem:s,renderMultipleInputItem:a,renderDropdownItem:l,placeholder:c,items:u=[],fullWidth:f,size:d="md",showDefaultItem:h,disabled:g,label:p,firstItem:m,lastItem:v,observer:y,emptyText:x,onBlur:b,prompt:w,error:_,errorText:E,dropdownMaxWidth:R=400,dropdownMinWidth:k=120,minWidth:P=120,width:F,background:$="secondary",dropdownClassName:j,className:O,triggerClassName:D,menuClassName:K,itemClassName:I,labelClassName:M,promptClassName:H,errorClassName:U}){const[re,G]=Bo(e,n?[]:null),[Y,Q]=S.useState(!1),{refs:ne,floatingStyles:oe}=Rh({open:Y,strategy:"fixed",middleware:[wh(4),Sh({crossAxis:!0,fallbackAxisSideDirection:"start"}),Ch({crossAxis:!0,padding:8}),tA({apply({availableHeight:se,availableWidth:Re,elements:Ye,rects:rt}){const It=Math.min(typeof Re=="number"?Re-64:R,R),to=rt.reference.width,no=Math.max(to,k);Object.assign(Ye.floating.style,{maxHeight:typeof se=="number"?`${se}px`:"auto",maxWidth:`${It}px`,minWidth:`${no}px`,width:"max-content"})}})],whileElementsMounted:bh}),me=S.useMemo(()=>n?re||[]:re!=null?[re]:[],[re,n]),ee=S.useCallback(se=>r?r(se):se,[r]),ve=S.useMemo(()=>{const se=new Map;return u.forEach(Re=>{se.set(ee(Re),Re)}),se},[u,ee]),Se=!u.length&&!_,Ee=S.useMemo(()=>me.map(se=>ve.get(se)).filter(se=>!!se),[ve,me]);S.useEffect(()=>{process.env.NODE_ENV!=="production"&&o&&!l&&console.warn("[Select] `renderItem` deprecated, use `renderDropdownItem` instead.")},[l,o]);const ze=S.useCallback((se,Re)=>l?l(se,Re):o?o(se):String(se),[l,o]),je=()=>{Q(!1),b?.()},Rt=se=>{const Re=ee(se);if(n){const Ye=me.includes(Re)?me.filter(rt=>rt!==Re):[...me,Re];G(Ye),t?.(Ye)}else G(Re),t?.(Re),je()},gn=se=>{if(!n)return;const Re=me.filter(Ye=>Ye!==se);G(Re),t?.(Re)},ot=()=>{const se=n?[]:null;G(se),t?.(se),n||je()},Gt=()=>typeof c=="string"?C.jsx(le,{variant:d==="xs"?"caption-1":"body-2",textOverflow:"ellipsis",overflow:"hidden",colorName:"tertiary",children:c??"Select..."}):c,Qt=()=>{if(!me.length)return Gt();if(n)return a?a(Ee):i?i({mode:"multiple",selectedItems:Ee}):C.jsx(q,{flexWrap:"wrap",row:!0,gap:10,children:me.map(Ye=>{const rt=ve.get(Ye);return rt?C.jsx(Cg,{size:"sm",label:o?o(rt):String(Ye),onDelete:It=>{It.stopPropagation(),gn(Ye)}},Ye):null})});const se=ve.get(me[0])??null;if(!se)return Gt();if(s)return s(se);if(i)return i({mode:"single",selectedItem:se});const Re=o?o(se):String(me[0]);return typeof Re=="string"?C.jsx(le,{variant:d==="xs"?"caption-1":"body-2",tag:"p",textOverflow:"ellipsis",overflow:"hidden",children:Re}):C.jsx(C.Fragment,{children:Re})},pt=Y&&C.jsx(ts,{children:C.jsx(q,{row:!0,top:0,right:0,bottom:0,left:0,position:"fixed",center:!0,flex:1,onClick:je,display:"block",backgroundColor:"transparent",zIndex:1,children:C.jsx(ea.div,{ref:ne.setFloating,className:T.cx(dt["select-dropdown"],j),initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.25,ease:"easeInOut"},style:{...oe,zIndex:1},onMouseDown:se=>se.stopPropagation(),onClick:se=>se.stopPropagation(),children:C.jsxs("ul",{className:T.cx(dt["select-menu"],K),children:[h&&!n&&C.jsx(q,{className:T.cx(dt["select-menu-item"],I),role:"option",onClick:ot,children:C.jsx(le,{variant:"body-2",colorName:"tertiary",children:c})}),m&&C.jsx(q,{className:T.cx(dt["select-menu-item"],dt["select-menu-item-first"],I),children:m}),Se&&C.jsxs(q,{className:dt["empty-block"],children:[C.jsx(q,{w:20,h:20,children:C.jsx(qF,{})}),C.jsx(le,{variant:"body-2",children:x??"There is nothing yet"})]}),u.map((se,Re)=>{const Ye=ee(se),rt=me.includes(Ye),It=ze(se,{item:se,selected:rt,index:Re}),to=typeof It=="string";return C.jsxs(q,{row:!0,gap:10,alignItems:"center",className:T.cx(dt["select-menu-item"],{[dt.selected]:rt},I),role:"option",relative:!0,onClick:()=>Rt(se),children:[n&&C.jsx(gh,{size:"sm",checked:rt}),to?C.jsx(le,{variant:"body-2",tag:"p",wordBreak:"break-all",whiteSpace:"break-spaces",children:It}):It,C.jsx(zo,{})]},Ye)}),y,v&&C.jsx(q,{className:T.cx(dt["select-menu-item"],dt["select-menu-item-first"],I),children:v})]})},"dropdown")})});return C.jsxs(q,{relative:!0,display:"inline-block",minWidth:P,w:F||(f?"full":"auto"),onMouseDown:se=>se.stopPropagation(),onClick:se=>se.stopPropagation(),className:O,children:[typeof p=="string"?C.jsx(le,{variant:"body-2",colorName:"tertiary",fontWeight:"regular",mb:d==="sm"?4:8,className:M,children:p}):p,C.jsxs(q,{ref:ne.setReference,row:!0,gap:10,tabIndex:g?-1:0,role:"button",alignItems:"flex-start","aria-haspopup":"listbox",relative:!0,w:"100%",className:T.cx(dt["select-input"],dt[`size-${d}`],dt[`background-${$}`],{[dt.error]:_,[dt.disabled]:g,[dt.open]:Y},D),onClick:()=>!g&&Q(se=>!se),children:[C.jsx(q,{className:T.cx(dt["select-value"]),children:Qt()}),C.jsx(q,{className:T.cx(dt["select-arrow"],ZF[d]),children:C.jsx(GF,{})})]}),typeof w=="string"?C.jsx(le,{variant:"caption-1",colorName:"tertiary",mt:4,className:H,children:w}):w,_&&E&&C.jsx(le,{tag:"p",colorName:"negative",variant:"body-2",mt:5,className:U,children:E}),C.jsx(Vx,{children:pt})]})}const JF=e=>N.createElement("svg",{width:10,height:10,viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M3.94629 0.220237C3.78013 0.264025 3.64089 0.377624 3.56348 0.53176C3.27371 1.11189 3.05664 1.46395 2.83887 1.74953C2.61807 2.03873 2.38547 2.27579 2.03027 2.63039C1.21079 3.45057 0.799805 4.52619 0.799805 5.60012C0.799838 6.67406 1.21073 7.74968 2.03027 8.56985C3.67062 10.2096 6.32931 10.2095 7.96973 8.56985C8.78929 7.74968 9.20016 6.67408 9.2002 5.60012C9.15131 4.32908 8.43217 3.48543 7.94727 3.05813C7.76902 2.90106 7.40643 3.02424 7.2627 3.2134C7.24031 3.24286 7.21612 3.2739 7.18945 3.30617C6.93211 3.61754 6.56236 3.80807 6.41504 3.83156C6.38264 3.83667 6.36979 3.76513 6.2959 3.58254C5.79455 2.34427 5.78927 2.49365 5.58887 2.01125C5.48847 1.7692 5.05517 1.02727 4.92676 0.828635C4.80206 0.635591 4.64095 0.439873 4.43359 0.301292C4.29028 0.205951 4.1124 0.175957 3.94629 0.220237ZM4.75293 4.17824C5.2689 4.63997 5.60857 5.26651 5.71484 5.95071C6.10631 5.85571 6.46727 5.68318 6.78125 5.45071C6.86578 5.70826 6.89338 5.98123 6.8623 6.25051C6.83115 6.51993 6.74174 6.77966 6.60059 7.01125C6.45944 7.24281 6.27008 7.44117 6.04492 7.59231C5.81977 7.74344 5.56462 7.8443 5.29688 7.88723C5.0292 7.93013 4.75518 7.91446 4.49414 7.84133C4.23299 7.76812 3.99064 7.6383 3.78418 7.46242C3.5778 7.28657 3.41161 7.06792 3.29785 6.8218C3.18419 6.57572 3.12519 6.30771 3.125 6.03664C3.12508 5.58233 3.29054 5.14308 3.58984 4.80129C3.88917 4.4597 4.30271 4.2382 4.75293 4.17824Z",fill:"#FEAD34"})),QF=e=>N.createElement("svg",{width:12,height:12,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M10.1483 8.61509C10.3344 8.26159 9.98299 7.89856 9.58534 7.93723C9.42671 7.95265 9.25857 7.9605 9.07422 7.96035C6.36522 7.9582 4.17129 5.76427 4.16914 3.05527C4.169 2.87115 4.17682 2.70321 4.19221 2.54477C4.23082 2.14712 3.86769 1.79411 3.50976 1.97161C2.03398 2.70343 1.20002 4.02274 1.20002 5.89477C1.20002 8.60377 3.3961 10.7998 6.1051 10.7998C7.97571 10.7998 9.38737 10.06 10.1483 8.61509Z",fill:"white"})),{color:nn,cornerRadius:c0,height:Gu,spacing:e$,transition:u0}=V,$n={container:T.css({width:"100%",cursor:"pointer",outline:"none",userSelect:"none",display:"flex",justifyContent:"space-between",gap:e$.md,"&.disabled":{cursor:"not-allowed",opacity:.5},"&.reverse":{flexDirection:"row-reverse"}}),disabled:T.css({cursor:"not-allowed",opacity:.5}),reverse:T.css({flexDirection:"row-reverse"}),switchContainer:T.css({"--width-switch-sm":"34px","--width-switch-md":"40px","--width-switch-lg":"52px","--size-thumb-sm":"18px","--size-thumb-md":"20px","--size-thumb-lg":"28px","--thumb-translate":"0px","&:has(input:checked)":{"--thumb-translate":"calc(var(--switch-width) - var(--thumb-width) - 4px)"}}),variant_accent:T.css({"&:has(input:not(:checked))":{"--switch-bg-color":nn.fill.bgTertiary,"--thumb-bg-color":nn.fill.bgPrimary},"&:has(input:checked)":{"--switch-bg-color":nn.fill.accentPrimary,"--thumb-bg-color":nn.fill.bgPrimary}}),variant_secondary:T.css({"&:has(input:not(:checked))":{"--switch-bg-color":nn.fill.bgTertiary,"--thumb-bg-color":nn.fill.bgPrimary},"&:has(input:checked)":{"--switch-bg-color":nn.fill.accentSecondary,"--thumb-bg-color":nn.fill.accentPrimary}}),variant_theme:T.css({"&:has(input:not(:checked))":{"--switch-bg-color":nn.fill.bgTertiary,"--thumb-bg-color":nn.fill.bgPrimary},"&:has(input:checked)":{"--switch-bg-color":nn.fill.bgSecondary,"--thumb-bg-color":nn.fill.bgTertiary}}),size_sm:T.css({"--switch-width":"var(--width-switch-sm)","--switch-height":Gu.switch.sm,"--thumb-width":"var(--size-thumb-sm)","--thumb-height":"var(--size-thumb-sm)"}),size_md:T.css({"--switch-width":"var(--width-switch-md)","--switch-height":Gu.switch.md,"--thumb-width":"var(--size-thumb-md)","--thumb-height":"var(--size-thumb-md)"}),size_lg:T.css({"--switch-width":"var(--width-switch-lg)","--switch-height":Gu.switch.lg,"--thumb-width":"var(--size-thumb-lg)","--thumb-height":"var(--size-thumb-lg)"}),switch:T.css({width:"var(--switch-width)",height:"var(--switch-height)",transition:u0.general,display:"flex",alignItems:"center",padding:2,backgroundColor:"var(--switch-bg-color)",borderRadius:c0.xl}),thumb:T.css({display:"flex",alignItems:"center",justifyContent:"center",padding:4,transition:u0.general,transform:"translateX(var(--thumb-translate, 0))",width:"var(--thumb-width)",height:"var(--thumb-height)",backgroundColor:"var(--thumb-bg-color)",borderRadius:c0.fullRound}),moon:T.css({width:"100%",height:"100%"}),fire:T.css({width:"100%",height:"100%"})},{spacing:d0}=V,GC=S.forwardRef(({title:e,text:t,icon:n,disabled:r,onChange:o,checked:i,defaultValue:s,className:a,wrapperClassName:l,switchContainerClassName:c,trackClassName:u,thumbClassName:f,inputClassName:d,labelsContainerClassName:h,titleClassName:g,textClassName:p,size:m="md",variant:v="accent",reverse:y=!1,w:x="auto",...b},w)=>{const[_,E]=Bo(i,s),R=S.useRef(null);S.useImperativeHandle(w,()=>({focus:()=>{R.current?.focus()},blur:()=>{R.current?.blur()},get checked(){return _??!1},setChecked:$=>{E($),o?.($)},toggle:()=>{const $=!_;E($),o?.($)},isFocused:()=>document.activeElement===R.current,isDisabled:()=>r??!1,getInputElement:()=>R.current,checkValidity:()=>R.current?.checkValidity()??!0,reset:()=>{const $=s??!1;E($),o?.($)}}),[_,E,o,r,s]);const k=S.useCallback($=>{E($.target.checked),o?.($.target.checked)},[o]),P=S.useMemo(()=>typeof e=="string"?C.jsx(le,{variant:"body-1",colorName:"primary",fontWeight:"medium",className:g,children:e}):e,[e,g]),F=S.useMemo(()=>typeof t=="string"?C.jsx(le,{variant:"body-2",colorName:"secondary",fontWeight:"regular",className:p,children:t}):t,[t,p]);return C.jsxs(q,{row:!0,w:x,gap:d0.sm,className:l,children:[C.jsxs("label",{className:T.cx($n.container,a,{[$n.disabled]:r,[$n.reverse]:y}),children:[C.jsxs(q,{className:T.cx($n.switchContainer,$n[`size_${m}`],$n[`variant_${v}`],c),children:[C.jsx("input",{ref:R,type:"checkbox",checked:_,hidden:!0,onChange:k,disabled:r,className:d,...b}),C.jsx("div",{className:T.cx($n.switch,u),children:C.jsx("div",{className:T.cx($n.thumb,f),children:v==="theme"&&(_?C.jsx(QF,{className:$n.moon}):C.jsx(JF,{className:$n.fire}))})})]}),(P||F)&&C.jsxs(q,{gap:d0.xs,className:h,children:[P,F]})]}),n]})});GC.displayName="Switch";const{spacing:f0}=V,t$=T.css({cursor:"pointer",userSelect:"none"}),n$=T.css({cursor:"not-allowed",opacity:.5}),r$=T.css({transition:"color 0.2s ease"}),o$=S.forwardRef(({label:e,selected:t,disabled:n,fullWidth:r,onClick:o,className:i,activeClassName:s,textClassName:a},l)=>C.jsx(q,{w:r?"full":void 0,justifyContent:"center",alignItems:"center",ref:l,py:f0.md,px:f0.xl,onClick:o,className:T.cx(t$,{[n$]:n},i,t&&s),children:C.jsx(le,{className:T.cx(r$,a),colorName:t?"primary":"tertiary",fontWeight:"medium",variant:"body-2",children:e})})),{color:qC}=V,i$=T.css({borderBottom:`1px solid ${qC.border.neutralAlphaBasic}`}),YC=({value:e,onChange:t,options:n,fullWidth:r=!1,className:o,tabClassName:i,activeTabClassName:s,tabTextClassName:a,indicatorClassName:l})=>{const[c,u]=S.useState({left:0,width:0}),f=S.useRef([]),d=g=>p=>{f.current[g]=p};S.useEffect(()=>{const g=n.findIndex(m=>m.value===e),p=f.current[g];p&&u({left:p.offsetLeft,width:p.offsetWidth})},[e,n]);const h=(g,p=!1)=>()=>!p&&t(g);return C.jsxs(q,{row:!0,w:r?"full":"auto",relative:!0,className:T.cx(i$,o),children:[n.map((g,p)=>C.jsx(o$,{selected:e===g.value,onClick:h(g.value,g.disabled),ref:d(p),label:g.label,disabled:g.disabled,fullWidth:r,className:i,activeClassName:s,textClassName:a},g.value)),C.jsx(q,{h:2,w:c.width,absolute:!0,bottom:-1,left:c.left,backgroundColor:qC.border.accentPrimary,className:T.cx(T.css({transition:"left 0.2s ease, width 0.2s ease"}),l)})]})};YC.displayName="Tabs";const XC=S.forwardRef(({title:e,subtitle:t,w:n="full",p:r,py:o,px:i=V.spacing["2xl"],pt:s=V.spacing["2xl"],pb:a=V.spacing.lg,row:l=!0,justifyContent:c="space-between",showCloseButton:u=!1,className:f,titleClassName:d,subtitleClassName:h,closeButtonClassName:g},p)=>{const{onClose:m}=X_();return C.jsxs(q,{w:n,p:r,py:o,px:i,pt:s,pb:a,row:l,justifyContent:c,ref:p,borderColor:V.color.border.neutralAlphaBasic,borderWidth:0,borderBottomWidth:1,borderStyle:"solid",className:f,children:[C.jsxs(q,{gap:V.spacing.sm,children:[C.jsx(le,{variant:"title-3",colorName:"primary",fontWeight:"semibold",className:d,children:e}),C.jsx(le,{variant:"body-1",colorName:"tertiary",fontWeight:"medium",className:h,children:t})]}),u&&C.jsx(q,{children:C.jsx(pr,{onClick:m,color:"neutral",className:g,children:C.jsx(H0,{})})})]})});XC.displayName="ModalHeader";function ii(e,t,n){let r=n.initialDeps??[],o,i=!0;function s(){var a,l,c;let u;n.key&&((a=n.debug)!=null&&a.call(n))&&(u=Date.now());const f=e();if(!(f.length!==r.length||f.some((g,p)=>r[p]!==g)))return o;r=f;let h;if(n.key&&((l=n.debug)!=null&&l.call(n))&&(h=Date.now()),o=t(...f),n.key&&((c=n.debug)!=null&&c.call(n))){const g=Math.round((Date.now()-u)*100)/100,p=Math.round((Date.now()-h)*100)/100,m=p/16,v=(y,x)=>{for(y=String(y);y.length<x;)y=" "+y;return y};console.info(`%c⏱ ${v(p,5)} /${v(g,5)} ms`,`
67
67
  font-size: .6rem;
68
68
  font-weight: bold;
69
- color: hsl(${Math.max(0,Math.min(120-120*m,120))}deg 100% 31%);`,n?.key)}return n?.onChange&&!(i&&n.skipInitialOnChange)&&n.onChange(o),i=!1,o}return s.updateDeps=a=>{r=a},s}function f0(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const i$=(e,t)=>Math.abs(e-t)<1.01,s$=(e,t,n)=>{let r;return function(...o){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,o),n)}},h0=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},a$=e=>e,l$=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let o=t;o<=n;o++)r.push(o);return r},c$=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const o=s=>{const{width:a,height:l}=s;t({width:Math.round(a),height:Math.round(l)})};if(o(h0(n)),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(s=>{const a=()=>{const l=s[0];if(l?.borderBoxSize){const c=l.borderBoxSize[0];if(c){o({width:c.inlineSize,height:c.blockSize});return}}o(h0(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},g0={passive:!0},p0=typeof window>"u"?!0:"onscrollend"in window,u$=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let o=0;const i=e.options.useScrollendEvent&&p0?()=>{}:s$(r,()=>{t(o,!1)},e.options.isScrollingResetDelay),s=u=>()=>{const{horizontal:f,isRtl:d}=e.options;o=f?n.scrollLeft*(d&&-1||1):n.scrollTop,i(),t(o,u)},a=s(!0),l=s(!1);l(),n.addEventListener("scroll",a,g0);const c=e.options.useScrollendEvent&&p0;return c&&n.addEventListener("scrollend",l,g0),()=>{n.removeEventListener("scroll",a),c&&n.removeEventListener("scrollend",l)}},d$=(e,t,n)=>{if(t?.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},f$=(e,{adjustments:t=0,behavior:n},r)=>{var o,i;const s=e+t;(i=(o=r.scrollElement)==null?void 0:o.scrollTo)==null||i.call(o,{[r.options.horizontal?"left":"top"]:s,behavior:n})};class h${constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(o=>{o.forEach(i=>{const s=()=>{this._measureElement(i.target,i)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(s):s()})}));return{disconnect:()=>{var o;(o=r())==null||o.disconnect(),n=null},observe:o=>{var i;return(i=r())==null?void 0:i.observe(o,{box:"border-box"})},unobserve:o=>{var i;return(i=r())==null?void 0:i.unobserve(o)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,o])=>{typeof o>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:a$,rangeExtractor:l$,onChange:()=>{},measureElement:d$,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var r,o;(o=(r=this.options).onChange)==null||o.call(r,this,n)},this.maybeNotify=ii(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(o=>{this.observer.observe(o)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,o=>{this.scrollRect=o,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(o,i)=>{this.scrollAdjustments=0,this.scrollDirection=i?this.getScrollOffset()<o?"forward":"backward":null,this.scrollOffset=o,this.isScrolling=i,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,r)=>{const o=new Map,i=new Map;for(let s=r-1;s>=0;s--){const a=n[s];if(o.has(a.lane))continue;const l=i.get(a.lane);if(l==null||a.end>l.end?i.set(a.lane,a):a.end<l.end&&o.set(a.lane,!0),o.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((s,a)=>s.end===a.end?s.index-a.index:s.end-a.end)[0]:void 0},this.getMeasurementOptions=ii(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(n,r,o,i,s,a)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:s,lanes:a}),{key:!1,skipInitialOnChange:!0,onChange:()=>{this.notify(this.isScrolling)}}),this.getMeasurements=ii(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:s,lanes:a},l)=>{if(!s)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const d of this.laneAssignments.keys())d>=n&&this.laneAssignments.delete(d);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(d=>{this.itemSizeCache.set(d.key,d.size)}));const c=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1);const u=this.measurementsCache.slice(0,c),f=new Array(a).fill(void 0);for(let d=0;d<c;d++){const h=u[d];h&&(f[h.lane]=d)}for(let d=c;d<n;d++){const h=i(d),g=this.laneAssignments.get(d);let p,m;if(g!==void 0&&this.options.lanes>1){p=g;const b=f[p],w=b!==void 0?u[b]:void 0;m=w?w.end+this.options.gap:r+o}else{const b=this.options.lanes===1?u[d-1]:this.getFurthestMeasurement(u,d);m=b?b.end+this.options.gap:r+o,p=b?b.lane:d%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(d,p)}const v=l.get(h),y=typeof v=="number"?v:this.options.estimateSize(d),x=m+y;u[d]={index:d,start:m,size:y,end:x,key:h,lane:p},f[p]=d}return this.measurementsCache=u,u},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=ii(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,o,i)=>this.range=n.length>0&&r>0?g$({measurements:n,outerSize:r,scrollOffset:o,lanes:i}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=ii(()=>{let n=null,r=null;const o=this.calculateRange();return o&&(n=o.startIndex,r=o.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,o,i,s)=>i===null||s===null?[]:n({startIndex:i,endIndex:s,overscan:r,count:o}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,o=n.getAttribute(r);return o?parseInt(o,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(n,r)=>{const o=this.indexFromElement(n),i=this.measurementsCache[o];if(!i)return;const s=i.key,a=this.elementsCache.get(s);a!==n&&(a&&this.observer.unobserve(a),this.observer.observe(n),this.elementsCache.set(s,n)),n.isConnected&&this.resizeItem(o,this.options.measureElement(n,r,this))},this.resizeItem=(n,r)=>{const o=this.measurementsCache[n];if(!o)return;const i=this.itemSizeCache.get(o.key)??o.size,s=r-i;s!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(o,s,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",s),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=s,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,r)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((r,o)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(o))});return}this._measureElement(n,void 0)},this.getVirtualItems=ii(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const o=[];for(let i=0,s=n.length;i<s;i++){const a=n[i],l=r[a];o.push(l)}return o},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return f0(r[XC(0,r.length-1,o=>f0(r[o]).start,n)])},this.getOffsetForAlignment=(n,r,o=0)=>{const i=this.getSize(),s=this.getScrollOffset();r==="auto"&&(r=n>=s+i?"end":"start"),r==="center"?n+=(o-i)/2:r==="end"&&(n-=i);const a=this.getTotalSize()+this.options.scrollMargin-i;return Math.max(Math.min(a,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const o=this.measurementsCache[n];if(!o)return;const i=this.getSize(),s=this.getScrollOffset();if(r==="auto")if(o.end>=s+i-this.options.scrollPaddingEnd)r="end";else if(o.start<=s+this.options.scrollPaddingStart)r="start";else return[s,r];const a=r==="end"?o.end+this.options.scrollPaddingEnd:o.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,r,o.size),r]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(n,{align:r="start",behavior:o}={})=>{o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,r),{adjustments:void 0,behavior:o})},this.scrollToIndex=(n,{align:r="auto",behavior:o}={})=>{o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),n=Math.max(0,Math.min(n,this.options.count-1));let i=0;const s=10,a=c=>{if(!this.targetWindow)return;const u=this.getOffsetForIndex(n,c);if(!u){console.warn("Failed to get offset for index:",n);return}const[f,d]=u;this._scrollToOffset(f,{adjustments:void 0,behavior:o}),this.targetWindow.requestAnimationFrame(()=>{const h=this.getScrollOffset(),g=this.getOffsetForIndex(n,d);if(!g){console.warn("Failed to get offset for index:",n);return}i$(g[0],h)||l(d)})},l=c=>{this.targetWindow&&(i++,i<s?(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("Schedule retry",i,s),this.targetWindow.requestAnimationFrame(()=>a(c))):console.warn(`Failed to scroll to index ${n} after ${s} attempts.`))};a(r)},this.scrollBy=(n,{behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let o;if(r.length===0)o=this.options.paddingStart;else if(this.options.lanes===1)o=((n=r[r.length-1])==null?void 0:n.end)??0;else{const i=Array(this.options.lanes).fill(null);let s=r.length-1;for(;s>=0&&i.some(a=>a===null);){const a=r[s];i[a.lane]===null&&(i[a.lane]=a.end),s--}o=Math.max(...i.filter(a=>a!==null))}return Math.max(o-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:o})=>{this.options.scrollToFn(n,{behavior:o,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(t)}}const XC=(e,t,n,r)=>{for(;e<=t;){const o=(e+t)/2|0,i=n(o);if(i<r)e=o+1;else if(i>r)t=o-1;else return o}return e>0?e-1:0};function g$({measurements:e,outerSize:t,scrollOffset:n,lanes:r}){const o=e.length-1,i=l=>e[l].start;if(e.length<=r)return{startIndex:0,endIndex:o};let s=XC(0,o,i,n),a=s;if(r===1)for(;a<o&&e[a].end<n+t;)a++;else if(r>1){const l=Array(r).fill(0);for(;a<o&&l.some(u=>u<n+t);){const u=e[a];l[u.lane]=u.end,a++}const c=Array(r).fill(n+t);for(;s>=0&&c.some(u=>u>=n);){const u=e[s];c[u.lane]=u.start,s--}s=Math.max(0,s-s%r),a=Math.min(o,a+(r-1-a%r))}return{startIndex:s,endIndex:a}}const m0=typeof document<"u"?N.useLayoutEffect:N.useEffect;function p$(e){const t=N.useReducer(()=>({}),{})[1],n={...e,onChange:(o,i)=>{var s;i?$s.flushSync(t):t(),(s=e.onChange)==null||s.call(e,o,i)}},[r]=N.useState(()=>new h$(n));return r.setOptions(n),m0(()=>r._didMount(),[]),m0(()=>r._willUpdate()),r}function m$(e){return p$({observeElementRect:c$,observeElementOffset:u$,scrollToFn:f$,...e})}const y0={main:T.css({flex:0,overflowY:"auto",scrollbarWidth:"thin",scrollbarColor:`${V.color.scrollbar.thumbPrimary} ${V.color.scrollbar.trackPrimary}`,"&::-webkit-scrollbar":{width:6},"&::-webkit-scrollbar-track":{background:V.color.scrollbar.trackPrimary,borderRadius:V.cornerRadius.fullRound},"&::-webkit-scrollbar-thumb":{borderRadius:V.cornerRadius.fullRound,backgroundColor:V.color.scrollbar.thumbPrimary}})},ZC=S.forwardRef(({children:e,className:t,row:n=!1,estimatedItemHeight:r=100,virtualize:o=!1,maxHeight:i=448},s)=>{const a=S.useRef(null),l=S.useMemo(()=>S.Children.toArray(e),[e]),c=m$({count:l.length,getScrollElement:()=>a.current,estimateSize:()=>r,measureElement:f=>f.getBoundingClientRect().height});return S.useImperativeHandle(s,()=>({scrollToTop:()=>c.scrollToOffset(0,{behavior:"smooth"}),scrollToBottom:()=>c.scrollToOffset(c.getTotalSize(),{behavior:"smooth"}),scrollToIndex:(f,d={})=>c.scrollToIndex(f,{behavior:"smooth",...d}),scrollToOffset:(f,d={})=>c.scrollToOffset(f,{behavior:"smooth",...d}),scrollBy:f=>{const d=c.scrollOffset||0;c.scrollToOffset(d+f,{behavior:"smooth"})},getElement:()=>a.current,getScrollOffset:()=>c.scrollOffset||0,getTotalSize:()=>c.getTotalSize()}),[c]),S.useMemo(()=>o||l.length>50,[o,l])&&l.length>0?C.jsx(q,{ref:a,row:n,maxHeight:i,className:T.cx(y0.main,t),w:"full",p:V.spacing["2xl"],children:C.jsx(q,{relative:!0,h:c.getTotalSize(),children:c.getVirtualItems().map(f=>C.jsx(q,{"data-index":f.index,ref:c.measureElement,w:"full",absolute:!0,style:{top:0,left:0,transform:`translateY(${f.start}px)`},children:l[f.index]},f.key))})}):C.jsx(q,{ref:a,className:T.cx(y0.main,t),w:"full",row:n,pl:V.spacing["2xl"],pr:V.spacing.xs,children:C.jsx(q,{py:V.spacing["2xl"],pr:V.spacing.xl,children:e})})});ZC.displayName="ModalMain";const Sc=H0;Sc.Header=YC;Sc.Main=ZC;Sc.Footer=W0;const JC=S.createContext(null),y$=()=>S.useContext(JC),ts=({children:e})=>{const[t,n]=S.useState(null),r=y$();return S.useEffect(()=>{if(typeof document>"u")return;const o=r?.current??document.body;if(!o)return;let i=o.querySelector("[data-portal-root]")??void 0;i||(i=document.createElement("div"),i.setAttribute("data-portal-root","true"),o.appendChild(i)),n(i)},[r]),t?$s.createPortal(e,t):null};function QC(){return{accessor:(e,t)=>typeof e=="function"?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e}}function $r(e,t){return typeof e=="function"?e(t):e}function Jt(e,t){return n=>{t.setState(r=>({...r,[e]:$r(n,r[e])}))}}function _c(e){return e instanceof Function}function v$(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function x$(e,t){const n=[],r=o=>{o.forEach(i=>{n.push(i);const s=t(i);s!=null&&s.length&&r(s)})};return r(e),n}function ue(e,t,n){let r=[],o;return i=>{let s;n.key&&n.debug&&(s=Date.now());const a=e(i);if(!(a.length!==r.length||a.some((u,f)=>r[f]!==u)))return o;r=a;let c;if(n.key&&n.debug&&(c=Date.now()),o=t(...a),n==null||n.onChange==null||n.onChange(o),n.key&&n.debug&&n!=null&&n.debug()){const u=Math.round((Date.now()-s)*100)/100,f=Math.round((Date.now()-c)*100)/100,d=f/16,h=(g,p)=>{for(g=String(g);g.length<p;)g=" "+g;return g};console.info(`%c⏱ ${h(f,5)} /${h(u,5)} ms`,`
69
+ color: hsl(${Math.max(0,Math.min(120-120*m,120))}deg 100% 31%);`,n?.key)}return n?.onChange&&!(i&&n.skipInitialOnChange)&&n.onChange(o),i=!1,o}return s.updateDeps=a=>{r=a},s}function h0(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const s$=(e,t)=>Math.abs(e-t)<1.01,a$=(e,t,n)=>{let r;return function(...o){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,o),n)}},g0=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},l$=e=>e,c$=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let o=t;o<=n;o++)r.push(o);return r},u$=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const o=s=>{const{width:a,height:l}=s;t({width:Math.round(a),height:Math.round(l)})};if(o(g0(n)),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(s=>{const a=()=>{const l=s[0];if(l?.borderBoxSize){const c=l.borderBoxSize[0];if(c){o({width:c.inlineSize,height:c.blockSize});return}}o(g0(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},p0={passive:!0},m0=typeof window>"u"?!0:"onscrollend"in window,d$=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let o=0;const i=e.options.useScrollendEvent&&m0?()=>{}:a$(r,()=>{t(o,!1)},e.options.isScrollingResetDelay),s=u=>()=>{const{horizontal:f,isRtl:d}=e.options;o=f?n.scrollLeft*(d&&-1||1):n.scrollTop,i(),t(o,u)},a=s(!0),l=s(!1);l(),n.addEventListener("scroll",a,p0);const c=e.options.useScrollendEvent&&m0;return c&&n.addEventListener("scrollend",l,p0),()=>{n.removeEventListener("scroll",a),c&&n.removeEventListener("scrollend",l)}},f$=(e,t,n)=>{if(t?.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},h$=(e,{adjustments:t=0,behavior:n},r)=>{var o,i;const s=e+t;(i=(o=r.scrollElement)==null?void 0:o.scrollTo)==null||i.call(o,{[r.options.horizontal?"left":"top"]:s,behavior:n})};class g${constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(o=>{o.forEach(i=>{const s=()=>{this._measureElement(i.target,i)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(s):s()})}));return{disconnect:()=>{var o;(o=r())==null||o.disconnect(),n=null},observe:o=>{var i;return(i=r())==null?void 0:i.observe(o,{box:"border-box"})},unobserve:o=>{var i;return(i=r())==null?void 0:i.unobserve(o)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,o])=>{typeof o>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:l$,rangeExtractor:c$,onChange:()=>{},measureElement:f$,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var r,o;(o=(r=this.options).onChange)==null||o.call(r,this,n)},this.maybeNotify=ii(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(o=>{this.observer.observe(o)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,o=>{this.scrollRect=o,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(o,i)=>{this.scrollAdjustments=0,this.scrollDirection=i?this.getScrollOffset()<o?"forward":"backward":null,this.scrollOffset=o,this.isScrolling=i,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,r)=>{const o=new Map,i=new Map;for(let s=r-1;s>=0;s--){const a=n[s];if(o.has(a.lane))continue;const l=i.get(a.lane);if(l==null||a.end>l.end?i.set(a.lane,a):a.end<l.end&&o.set(a.lane,!0),o.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((s,a)=>s.end===a.end?s.index-a.index:s.end-a.end)[0]:void 0},this.getMeasurementOptions=ii(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(n,r,o,i,s,a)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:s,lanes:a}),{key:!1,skipInitialOnChange:!0,onChange:()=>{this.notify(this.isScrolling)}}),this.getMeasurements=ii(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:s,lanes:a},l)=>{if(!s)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const d of this.laneAssignments.keys())d>=n&&this.laneAssignments.delete(d);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(d=>{this.itemSizeCache.set(d.key,d.size)}));const c=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1);const u=this.measurementsCache.slice(0,c),f=new Array(a).fill(void 0);for(let d=0;d<c;d++){const h=u[d];h&&(f[h.lane]=d)}for(let d=c;d<n;d++){const h=i(d),g=this.laneAssignments.get(d);let p,m;if(g!==void 0&&this.options.lanes>1){p=g;const b=f[p],w=b!==void 0?u[b]:void 0;m=w?w.end+this.options.gap:r+o}else{const b=this.options.lanes===1?u[d-1]:this.getFurthestMeasurement(u,d);m=b?b.end+this.options.gap:r+o,p=b?b.lane:d%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(d,p)}const v=l.get(h),y=typeof v=="number"?v:this.options.estimateSize(d),x=m+y;u[d]={index:d,start:m,size:y,end:x,key:h,lane:p},f[p]=d}return this.measurementsCache=u,u},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=ii(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,o,i)=>this.range=n.length>0&&r>0?p$({measurements:n,outerSize:r,scrollOffset:o,lanes:i}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=ii(()=>{let n=null,r=null;const o=this.calculateRange();return o&&(n=o.startIndex,r=o.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,o,i,s)=>i===null||s===null?[]:n({startIndex:i,endIndex:s,overscan:r,count:o}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,o=n.getAttribute(r);return o?parseInt(o,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(n,r)=>{const o=this.indexFromElement(n),i=this.measurementsCache[o];if(!i)return;const s=i.key,a=this.elementsCache.get(s);a!==n&&(a&&this.observer.unobserve(a),this.observer.observe(n),this.elementsCache.set(s,n)),n.isConnected&&this.resizeItem(o,this.options.measureElement(n,r,this))},this.resizeItem=(n,r)=>{const o=this.measurementsCache[n];if(!o)return;const i=this.itemSizeCache.get(o.key)??o.size,s=r-i;s!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(o,s,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",s),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=s,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,r)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((r,o)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(o))});return}this._measureElement(n,void 0)},this.getVirtualItems=ii(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const o=[];for(let i=0,s=n.length;i<s;i++){const a=n[i],l=r[a];o.push(l)}return o},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return h0(r[ZC(0,r.length-1,o=>h0(r[o]).start,n)])},this.getOffsetForAlignment=(n,r,o=0)=>{const i=this.getSize(),s=this.getScrollOffset();r==="auto"&&(r=n>=s+i?"end":"start"),r==="center"?n+=(o-i)/2:r==="end"&&(n-=i);const a=this.getTotalSize()+this.options.scrollMargin-i;return Math.max(Math.min(a,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const o=this.measurementsCache[n];if(!o)return;const i=this.getSize(),s=this.getScrollOffset();if(r==="auto")if(o.end>=s+i-this.options.scrollPaddingEnd)r="end";else if(o.start<=s+this.options.scrollPaddingStart)r="start";else return[s,r];const a=r==="end"?o.end+this.options.scrollPaddingEnd:o.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,r,o.size),r]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(n,{align:r="start",behavior:o}={})=>{o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,r),{adjustments:void 0,behavior:o})},this.scrollToIndex=(n,{align:r="auto",behavior:o}={})=>{o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),n=Math.max(0,Math.min(n,this.options.count-1));let i=0;const s=10,a=c=>{if(!this.targetWindow)return;const u=this.getOffsetForIndex(n,c);if(!u){console.warn("Failed to get offset for index:",n);return}const[f,d]=u;this._scrollToOffset(f,{adjustments:void 0,behavior:o}),this.targetWindow.requestAnimationFrame(()=>{const h=this.getScrollOffset(),g=this.getOffsetForIndex(n,d);if(!g){console.warn("Failed to get offset for index:",n);return}s$(g[0],h)||l(d)})},l=c=>{this.targetWindow&&(i++,i<s?(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("Schedule retry",i,s),this.targetWindow.requestAnimationFrame(()=>a(c))):console.warn(`Failed to scroll to index ${n} after ${s} attempts.`))};a(r)},this.scrollBy=(n,{behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let o;if(r.length===0)o=this.options.paddingStart;else if(this.options.lanes===1)o=((n=r[r.length-1])==null?void 0:n.end)??0;else{const i=Array(this.options.lanes).fill(null);let s=r.length-1;for(;s>=0&&i.some(a=>a===null);){const a=r[s];i[a.lane]===null&&(i[a.lane]=a.end),s--}o=Math.max(...i.filter(a=>a!==null))}return Math.max(o-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:o})=>{this.options.scrollToFn(n,{behavior:o,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(t)}}const ZC=(e,t,n,r)=>{for(;e<=t;){const o=(e+t)/2|0,i=n(o);if(i<r)e=o+1;else if(i>r)t=o-1;else return o}return e>0?e-1:0};function p$({measurements:e,outerSize:t,scrollOffset:n,lanes:r}){const o=e.length-1,i=l=>e[l].start;if(e.length<=r)return{startIndex:0,endIndex:o};let s=ZC(0,o,i,n),a=s;if(r===1)for(;a<o&&e[a].end<n+t;)a++;else if(r>1){const l=Array(r).fill(0);for(;a<o&&l.some(u=>u<n+t);){const u=e[a];l[u.lane]=u.end,a++}const c=Array(r).fill(n+t);for(;s>=0&&c.some(u=>u>=n);){const u=e[s];c[u.lane]=u.start,s--}s=Math.max(0,s-s%r),a=Math.min(o,a+(r-1-a%r))}return{startIndex:s,endIndex:a}}const y0=typeof document<"u"?N.useLayoutEffect:N.useEffect;function m$(e){const t=N.useReducer(()=>({}),{})[1],n={...e,onChange:(o,i)=>{var s;i?$s.flushSync(t):t(),(s=e.onChange)==null||s.call(e,o,i)}},[r]=N.useState(()=>new g$(n));return r.setOptions(n),y0(()=>r._didMount(),[]),y0(()=>r._willUpdate()),r}function y$(e){return m$({observeElementRect:u$,observeElementOffset:d$,scrollToFn:h$,...e})}const v0={main:T.css({flex:0,overflowY:"auto",scrollbarWidth:"thin",scrollbarColor:`${V.color.scrollbar.thumbPrimary} ${V.color.scrollbar.trackPrimary}`,"&::-webkit-scrollbar":{width:6},"&::-webkit-scrollbar-track":{background:V.color.scrollbar.trackPrimary,borderRadius:V.cornerRadius.fullRound},"&::-webkit-scrollbar-thumb":{borderRadius:V.cornerRadius.fullRound,backgroundColor:V.color.scrollbar.thumbPrimary}})},JC=S.forwardRef(({children:e,className:t,row:n=!1,estimatedItemHeight:r=100,virtualize:o=!1,maxHeight:i=448},s)=>{const a=S.useRef(null),l=S.useMemo(()=>S.Children.toArray(e),[e]),c=y$({count:l.length,getScrollElement:()=>a.current,estimateSize:()=>r,measureElement:f=>f.getBoundingClientRect().height});return S.useImperativeHandle(s,()=>({scrollToTop:()=>c.scrollToOffset(0,{behavior:"smooth"}),scrollToBottom:()=>c.scrollToOffset(c.getTotalSize(),{behavior:"smooth"}),scrollToIndex:(f,d={})=>c.scrollToIndex(f,{behavior:"smooth",...d}),scrollToOffset:(f,d={})=>c.scrollToOffset(f,{behavior:"smooth",...d}),scrollBy:f=>{const d=c.scrollOffset||0;c.scrollToOffset(d+f,{behavior:"smooth"})},getElement:()=>a.current,getScrollOffset:()=>c.scrollOffset||0,getTotalSize:()=>c.getTotalSize()}),[c]),S.useMemo(()=>o||l.length>50,[o,l])&&l.length>0?C.jsx(q,{ref:a,row:n,maxHeight:i,className:T.cx(v0.main,t),w:"full",p:V.spacing["2xl"],children:C.jsx(q,{relative:!0,h:c.getTotalSize(),children:c.getVirtualItems().map(f=>C.jsx(q,{"data-index":f.index,ref:c.measureElement,w:"full",absolute:!0,style:{top:0,left:0,transform:`translateY(${f.start}px)`},children:l[f.index]},f.key))})}):C.jsx(q,{ref:a,className:T.cx(v0.main,t),w:"full",row:n,pl:V.spacing["2xl"],pr:V.spacing.xs,children:C.jsx(q,{py:V.spacing["2xl"],pr:V.spacing.xl,children:e})})});JC.displayName="ModalMain";const _c=K0;_c.Header=XC;_c.Main=JC;_c.Footer=U0;const QC=S.createContext(null),v$=()=>S.useContext(QC),ts=({children:e})=>{const[t,n]=S.useState(null),r=v$();return S.useEffect(()=>{if(typeof document>"u")return;const o=r?.current??document.body;if(!o)return;let i=o.querySelector("[data-portal-root]")??void 0;i||(i=document.createElement("div"),i.setAttribute("data-portal-root","true"),o.appendChild(i)),n(i)},[r]),t?$s.createPortal(e,t):null};function eS(){return{accessor:(e,t)=>typeof e=="function"?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e}}function $r(e,t){return typeof e=="function"?e(t):e}function Jt(e,t){return n=>{t.setState(r=>({...r,[e]:$r(n,r[e])}))}}function Tc(e){return e instanceof Function}function x$(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function b$(e,t){const n=[],r=o=>{o.forEach(i=>{n.push(i);const s=t(i);s!=null&&s.length&&r(s)})};return r(e),n}function ue(e,t,n){let r=[],o;return i=>{let s;n.key&&n.debug&&(s=Date.now());const a=e(i);if(!(a.length!==r.length||a.some((u,f)=>r[f]!==u)))return o;r=a;let c;if(n.key&&n.debug&&(c=Date.now()),o=t(...a),n==null||n.onChange==null||n.onChange(o),n.key&&n.debug&&n!=null&&n.debug()){const u=Math.round((Date.now()-s)*100)/100,f=Math.round((Date.now()-c)*100)/100,d=f/16,h=(g,p)=>{for(g=String(g);g.length<p;)g=" "+g;return g};console.info(`%c⏱ ${h(f,5)} /${h(u,5)} ms`,`
70
70
  font-size: .6rem;
71
71
  font-weight: bold;
72
- color: hsl(${Math.max(0,Math.min(120-120*d,120))}deg 100% 31%);`,n?.key)}return o}}function de(e,t,n,r){return{debug:()=>{var o;return(o=e?.debugAll)!=null?o:e[t]},key:process.env.NODE_ENV==="development"&&n,onChange:r}}function b$(e,t,n,r){const o=()=>{var s;return(s=i.getValue())!=null?s:e.options.renderFallbackValue},i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:o,getContext:ue(()=>[e,n,t,i],(s,a,l,c)=>({table:s,column:a,row:l,cell:c,getValue:c.getValue,renderValue:c.renderValue}),de(e.options,"debugCells","cell.getContext"))};return e._features.forEach(s=>{s.createCell==null||s.createCell(i,n,t,e)},{}),i}function w$(e,t,n,r){var o,i;const a={...e._getDefaultColumnDef(),...t},l=a.accessorKey;let c=(o=(i=a.id)!=null?i:l?typeof String.prototype.replaceAll=="function"?l.replaceAll(".","_"):l.replace(/\./g,"_"):void 0)!=null?o:typeof a.header=="string"?a.header:void 0,u;if(a.accessorFn?u=a.accessorFn:l&&(l.includes(".")?u=d=>{let h=d;for(const p of l.split(".")){var g;h=(g=h)==null?void 0:g[p],process.env.NODE_ENV!=="production"&&h===void 0&&console.warn(`"${p}" in deeply nested key "${l}" returned undefined.`)}return h}:u=d=>d[a.accessorKey]),!c)throw process.env.NODE_ENV!=="production"?new Error(a.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let f={id:`${String(c)}`,accessorFn:u,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:ue(()=>[!0],()=>{var d;return[f,...(d=f.columns)==null?void 0:d.flatMap(h=>h.getFlatColumns())]},de(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:ue(()=>[e._getOrderColumnsFn()],d=>{var h;if((h=f.columns)!=null&&h.length){let g=f.columns.flatMap(p=>p.getLeafColumns());return d(g)}return[f]},de(e.options,"debugColumns","column.getLeafColumns"))};for(const d of e._features)d.createColumn==null||d.createColumn(f,e);return f}const bt="debugHeaders";function v0(e,t,n){var r;let i={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const s=[],a=l=>{l.subHeaders&&l.subHeaders.length&&l.subHeaders.map(a),s.push(l)};return a(i),s},getContext:()=>({table:e,header:i,column:t})};return e._features.forEach(s=>{s.createHeader==null||s.createHeader(i,e)}),i}const C$={createTable:e=>{e.getHeaderGroups=ue(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>{var i,s;const a=(i=r?.map(f=>n.find(d=>d.id===f)).filter(Boolean))!=null?i:[],l=(s=o?.map(f=>n.find(d=>d.id===f)).filter(Boolean))!=null?s:[],c=n.filter(f=>!(r!=null&&r.includes(f.id))&&!(o!=null&&o.includes(f.id)));return Ua(t,[...a,...c,...l],e)},de(e.options,bt,"getHeaderGroups")),e.getCenterHeaderGroups=ue(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>(n=n.filter(i=>!(r!=null&&r.includes(i.id))&&!(o!=null&&o.includes(i.id))),Ua(t,n,e,"center")),de(e.options,bt,"getCenterHeaderGroups")),e.getLeftHeaderGroups=ue(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var o;const i=(o=r?.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?o:[];return Ua(t,i,e,"left")},de(e.options,bt,"getLeftHeaderGroups")),e.getRightHeaderGroups=ue(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var o;const i=(o=r?.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?o:[];return Ua(t,i,e,"right")},de(e.options,bt,"getRightHeaderGroups")),e.getFooterGroups=ue(()=>[e.getHeaderGroups()],t=>[...t].reverse(),de(e.options,bt,"getFooterGroups")),e.getLeftFooterGroups=ue(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),de(e.options,bt,"getLeftFooterGroups")),e.getCenterFooterGroups=ue(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),de(e.options,bt,"getCenterFooterGroups")),e.getRightFooterGroups=ue(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),de(e.options,bt,"getRightFooterGroups")),e.getFlatHeaders=ue(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),de(e.options,bt,"getFlatHeaders")),e.getLeftFlatHeaders=ue(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),de(e.options,bt,"getLeftFlatHeaders")),e.getCenterFlatHeaders=ue(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),de(e.options,bt,"getCenterFlatHeaders")),e.getRightFlatHeaders=ue(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),de(e.options,bt,"getRightFlatHeaders")),e.getCenterLeafHeaders=ue(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),de(e.options,bt,"getCenterLeafHeaders")),e.getLeftLeafHeaders=ue(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),de(e.options,bt,"getLeftLeafHeaders")),e.getRightLeafHeaders=ue(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),de(e.options,bt,"getRightLeafHeaders")),e.getLeafHeaders=ue(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var o,i,s,a,l,c;return[...(o=(i=t[0])==null?void 0:i.headers)!=null?o:[],...(s=(a=n[0])==null?void 0:a.headers)!=null?s:[],...(l=(c=r[0])==null?void 0:c.headers)!=null?l:[]].map(u=>u.getLeafHeaders()).flat()},de(e.options,bt,"getLeafHeaders"))}};function Ua(e,t,n,r){var o,i;let s=0;const a=function(d,h){h===void 0&&(h=1),s=Math.max(s,h),d.filter(g=>g.getIsVisible()).forEach(g=>{var p;(p=g.columns)!=null&&p.length&&a(g.columns,h+1)},0)};a(e);let l=[];const c=(d,h)=>{const g={depth:h,id:[r,`${h}`].filter(Boolean).join("_"),headers:[]},p=[];d.forEach(m=>{const v=[...p].reverse()[0],y=m.column.depth===g.depth;let x,b=!1;if(y&&m.column.parent?x=m.column.parent:(x=m.column,b=!0),v&&v?.column===x)v.subHeaders.push(m);else{const w=v0(n,x,{id:[r,h,x.id,m?.id].filter(Boolean).join("_"),isPlaceholder:b,placeholderId:b?`${p.filter(_=>_.column===x).length}`:void 0,depth:h,index:p.length});w.subHeaders.push(m),p.push(w)}g.headers.push(m),m.headerGroup=g}),l.push(g),h>0&&c(p,h-1)},u=t.map((d,h)=>v0(n,d,{depth:s,index:h}));c(u,s-1),l.reverse();const f=d=>d.filter(g=>g.column.getIsVisible()).map(g=>{let p=0,m=0,v=[0];g.subHeaders&&g.subHeaders.length?(v=[],f(g.subHeaders).forEach(x=>{let{colSpan:b,rowSpan:w}=x;p+=b,v.push(w)})):p=1;const y=Math.min(...v);return m=m+y,g.colSpan=p,g.rowSpan=m,{colSpan:p,rowSpan:m}});return f((o=(i=l[0])==null?void 0:i.headers)!=null?o:[]),l}const S$=(e,t,n,r,o,i,s)=>{let a={id:t,index:r,original:n,depth:o,parentId:s,_valuesCache:{},_uniqueValuesCache:{},getValue:l=>{if(a._valuesCache.hasOwnProperty(l))return a._valuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return a._valuesCache[l]=c.accessorFn(a.original,r),a._valuesCache[l]},getUniqueValues:l=>{if(a._uniqueValuesCache.hasOwnProperty(l))return a._uniqueValuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return c.columnDef.getUniqueValues?(a._uniqueValuesCache[l]=c.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[l]):(a._uniqueValuesCache[l]=[a.getValue(l)],a._uniqueValuesCache[l])},renderValue:l=>{var c;return(c=a.getValue(l))!=null?c:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>x$(a.subRows,l=>l.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let l=[],c=a;for(;;){const u=c.getParentRow();if(!u)break;l.push(u),c=u}return l.reverse()},getAllCells:ue(()=>[e.getAllLeafColumns()],l=>l.map(c=>b$(e,a,c,c.id)),de(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:ue(()=>[a.getAllCells()],l=>l.reduce((c,u)=>(c[u.column.id]=u,c),{}),de(e.options,"debugRows","getAllCellsByColumnId"))};for(let l=0;l<e._features.length;l++){const c=e._features[l];c==null||c.createRow==null||c.createRow(a,e)}return a},_$={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},eS=(e,t,n)=>{var r,o;const i=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((o=e.getValue(t))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(i))};eS.autoRemove=e=>Rn(e);const tS=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};tS.autoRemove=e=>Rn(e);const nS=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===n?.toLowerCase()};nS.autoRemove=e=>Rn(e);const rS=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};rS.autoRemove=e=>Rn(e);const oS=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});oS.autoRemove=e=>Rn(e)||!(e!=null&&e.length);const iS=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});iS.autoRemove=e=>Rn(e)||!(e!=null&&e.length);const sS=(e,t,n)=>e.getValue(t)===n;sS.autoRemove=e=>Rn(e);const aS=(e,t,n)=>e.getValue(t)==n;aS.autoRemove=e=>Rn(e);const Sg=(e,t,n)=>{let[r,o]=n;const i=e.getValue(t);return i>=r&&i<=o};Sg.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,o=typeof n!="number"?parseFloat(n):n,i=t===null||Number.isNaN(r)?-1/0:r,s=n===null||Number.isNaN(o)?1/0:o;if(i>s){const a=i;i=s,s=a}return[i,s]};Sg.autoRemove=e=>Rn(e)||Rn(e[0])&&Rn(e[1]);const ar={includesString:eS,includesStringSensitive:tS,equalsString:nS,arrIncludes:rS,arrIncludesAll:oS,arrIncludesSome:iS,equals:sS,weakEquals:aS,inNumberRange:Sg};function Rn(e){return e==null||e===""}const T$={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Jt("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n?.getValue(e.id);return typeof r=="string"?ar.includesString:typeof r=="number"?ar.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?ar.equals:Array.isArray(r)?ar.arrIncludes:ar.weakEquals},e.getFilterFn=()=>{var n,r;return _c(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:ar[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,o;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const o=e.getFilterFn(),i=r?.find(u=>u.id===e.id),s=$r(n,i?i.value:void 0);if(x0(o,s,e)){var a;return(a=r?.filter(u=>u.id!==e.id))!=null?a:[]}const l={id:e.id,value:s};if(i){var c;return(c=r?.map(u=>u.id===e.id?l:u))!=null?c:[]}return r!=null&&r.length?[...r,l]:[l]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=o=>{var i;return(i=$r(t,o))==null?void 0:i.filter(s=>{const a=n.find(l=>l.id===s.id);if(a){const l=a.getFilterFn();if(x0(l,s.value,a))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function x0(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const E$=(e,t,n)=>n.reduce((r,o)=>{const i=o.getValue(e);return r+(typeof i=="number"?i:0)},0),R$=(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}),r},k$=(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r<i||r===void 0&&i>=i)&&(r=i)}),r},A$=(e,t,n)=>{let r,o;return n.forEach(i=>{const s=i.getValue(e);s!=null&&(r===void 0?s>=s&&(r=o=s):(r>s&&(r=s),o<s&&(o=s)))}),[r,o]},N$=(e,t)=>{let n=0,r=0;if(t.forEach(o=>{let i=o.getValue(e);i!=null&&(i=+i)>=i&&(++n,r+=i)}),n)return r/n},M$=(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!v$(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),o=n.sort((i,s)=>i-s);return n.length%2!==0?o[r]:(o[r-1]+o[r])/2},P$=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),L$=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,F$=(e,t)=>t.length,Gu={sum:E$,min:R$,max:k$,extent:A$,mean:N$,median:M$,unique:P$,uniqueCount:L$,count:F$},$$={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Jt("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n?.getValue(e.id);if(typeof r=="number")return Gu.sum;if(Object.prototype.toString.call(r)==="[object Date]")return Gu.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return _c(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:Gu[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var o;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((o=n.subRows)!=null&&o.length)}}};function O$(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(i=>!t.includes(i.id));return n==="remove"?r:[...t.map(i=>e.find(s=>s.id===i)).filter(Boolean),...r]}const I$={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Jt("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=ue(n=>[Ls(t,n)],n=>n.findIndex(r=>r.id===e.id),de(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var r;return((r=Ls(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const o=Ls(t,n);return((r=o[o.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=ue(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>o=>{let i=[];if(!(t!=null&&t.length))i=o;else{const s=[...t],a=[...o];for(;a.length&&s.length;){const l=s.shift(),c=a.findIndex(u=>u.id===l);c>-1&&i.push(a.splice(c,1)[0])}i=[...i,...a]}return O$(i,n,r)},de(e.options,"debugTable","_getOrderColumnsFn"))}},qu=()=>({left:[],right:[]}),D$={getInitialState:e=>({columnPinning:qu(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Jt("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(o=>o.id).filter(Boolean);t.setColumnPinning(o=>{var i,s;if(n==="right"){var a,l;return{left:((a=o?.left)!=null?a:[]).filter(f=>!(r!=null&&r.includes(f))),right:[...((l=o?.right)!=null?l:[]).filter(f=>!(r!=null&&r.includes(f))),...r]}}if(n==="left"){var c,u;return{left:[...((c=o?.left)!=null?c:[]).filter(f=>!(r!=null&&r.includes(f))),...r],right:((u=o?.right)!=null?u:[]).filter(f=>!(r!=null&&r.includes(f)))}}return{left:((i=o?.left)!=null?i:[]).filter(f=>!(r!=null&&r.includes(f))),right:((s=o?.right)!=null?s:[]).filter(f=>!(r!=null&&r.includes(f)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var o,i,s;return((o=r.columnDef.enablePinning)!=null?o:!0)&&((i=(s=t.options.enableColumnPinning)!=null?s:t.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(a=>a.id),{left:r,right:o}=t.getState().columnPinning,i=n.some(a=>r?.includes(a)),s=n.some(a=>o?.includes(a));return i?"left":s?"right":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();return o?(n=(r=t.getState().columnPinning)==null||(r=r[o])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=ue(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,o)=>{const i=[...r??[],...o??[]];return n.filter(s=>!i.includes(s.column.id))},de(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=ue(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(i=>n.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),de(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=ue(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(i=>n.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),de(t.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?qu():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:qu())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var o,i;return!!((o=r.left)!=null&&o.length||(i=r.right)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=ue(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),de(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=ue(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),de(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=ue(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const o=[...n??[],...r??[]];return t.filter(i=>!o.includes(i.id))},de(e.options,"debugColumns","getCenterLeafColumns"))}};function j$(e){return e||(typeof document<"u"?document:null)}const Ga={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Yu=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),V$={getDefaultColumnDef:()=>Ga,getInitialState:e=>({columnSizing:{},columnSizingInfo:Yu(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Jt("columnSizing",e),onColumnSizingInfoChange:Jt("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,o;const i=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Ga.minSize,(r=i??e.columnDef.size)!=null?r:Ga.size),(o=e.columnDef.maxSize)!=null?o:Ga.maxSize)},e.getStart=ue(n=>[n,Ls(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((o,i)=>o+i.getSize(),0),de(t.options,"debugColumns","getStart")),e.getAfter=ue(n=>[n,Ls(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((o,i)=>o+i.getSize(),0),de(t.options,"debugColumns","getAfter")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...o}=n;return o})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=o=>{if(o.subHeaders.length)o.subHeaders.forEach(r);else{var i;n+=(i=o.column.getSize())!=null?i:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),o=r?.getCanResize();return i=>{if(!r||!o||(i.persist==null||i.persist(),Xu(i)&&i.touches&&i.touches.length>1))return;const s=e.getSize(),a=e?e.getLeafHeaders().map(v=>[v.column.id,v.column.getSize()]):[[r.id,r.getSize()]],l=Xu(i)?Math.round(i.touches[0].clientX):i.clientX,c={},u=(v,y)=>{typeof y=="number"&&(t.setColumnSizingInfo(x=>{var b,w;const _=t.options.columnResizeDirection==="rtl"?-1:1,E=(y-((b=x?.startOffset)!=null?b:0))*_,R=Math.max(E/((w=x?.startSize)!=null?w:0),-.999999);return x.columnSizingStart.forEach(k=>{let[M,F]=k;c[M]=Math.round(Math.max(F+F*R,0)*100)/100}),{...x,deltaOffset:E,deltaPercentage:R}}),(t.options.columnResizeMode==="onChange"||v==="end")&&t.setColumnSizing(x=>({...x,...c})))},f=v=>u("move",v),d=v=>{u("end",v),t.setColumnSizingInfo(y=>({...y,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},h=j$(n),g={moveHandler:v=>f(v.clientX),upHandler:v=>{h?.removeEventListener("mousemove",g.moveHandler),h?.removeEventListener("mouseup",g.upHandler),d(v.clientX)}},p={moveHandler:v=>(v.cancelable&&(v.preventDefault(),v.stopPropagation()),f(v.touches[0].clientX),!1),upHandler:v=>{var y;h?.removeEventListener("touchmove",p.moveHandler),h?.removeEventListener("touchend",p.upHandler),v.cancelable&&(v.preventDefault(),v.stopPropagation()),d((y=v.touches[0])==null?void 0:y.clientX)}},m=B$()?{passive:!1}:!1;Xu(i)?(h?.addEventListener("touchmove",p.moveHandler,m),h?.addEventListener("touchend",p.upHandler,m)):(h?.addEventListener("mousemove",g.moveHandler,m),h?.addEventListener("mouseup",g.upHandler,m)),t.setColumnSizingInfo(v=>({...v,startOffset:l,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?Yu():(n=e.initialState.columnSizingInfo)!=null?n:Yu())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0}}};let qa=null;function B$(){if(typeof qa=="boolean")return qa;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return qa=e,qa}function Xu(e){return e.type==="touchstart"}const z$={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Jt("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const o=e.columns;return(n=o.length?o.some(i=>i.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=ue(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),de(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=ue(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],de(t.options,"debugRows","getVisibleCells"))},createTable:e=>{const t=(n,r)=>ue(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),de(e.options,"debugColumns",n));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((o,i)=>({...o,[i.id]:n||!(i.getCanHide!=null&&i.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function Ls(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const H$={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},W$={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Jt("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,o,i;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&((i=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>ar.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return _c(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:ar[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},K$={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Jt("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var o,i;e.setExpanded(r?{}:(o=(i=e.initialState)==null?void 0:i.expanded)!=null?o:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(o=>!o.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(i=>{const s=i.split(".");r=Math.max(r,s.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var o;const i=r===!0?!0:!!(r!=null&&r[e.id]);let s={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(a=>{s[a]=!0}):s=r,n=(o=n)!=null?o:!i,!i&&n)return{...s,[e.id]:!0};if(i&&!n){const{[e.id]:a,...l}=s;return l}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r?.[e.id])},e.getCanExpand=()=>{var n,r,o;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((o=e.subRows)!=null&&o.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},_f=0,Tf=10,Zu=()=>({pageIndex:_f,pageSize:Tf}),U$={getInitialState:e=>({...e,pagination:{...Zu(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:Jt("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const o=i=>$r(r,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?Zu():(o=e.initialState.pagination)!=null?o:Zu())},e.setPageIndex=r=>{e.setPagination(o=>{let i=$r(r,o.pageIndex);const s=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return i=Math.max(0,Math.min(i,s)),{...o,pageIndex:i}})},e.resetPageIndex=r=>{var o,i;e.setPageIndex(r?_f:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?o:_f)},e.resetPageSize=r=>{var o,i;e.setPageSize(r?Tf:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?o:Tf)},e.setPageSize=r=>{e.setPagination(o=>{const i=Math.max(1,$r(r,o.pageSize)),s=o.pageSize*o.pageIndex,a=Math.floor(s/i);return{...o,pageIndex:a,pageSize:i}})},e.setPageCount=r=>e.setPagination(o=>{var i;let s=$r(r,(i=e.options.pageCount)!=null?i:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...o,pageCount:s}}),e.getPageOptions=ue(()=>[e.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((i,s)=>s)),o},de(e.options,"debugTable","getPageOptions")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,o=e.getPageCount();return o===-1?!0:o===0?!1:r<o-1},e.previousPage=()=>e.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},Ju=()=>({top:[],bottom:[]}),G$={getInitialState:e=>({rowPinning:Ju(),...e}),getDefaultOptions:e=>({onRowPinningChange:Jt("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,o)=>{const i=r?e.getLeafRows().map(l=>{let{id:c}=l;return c}):[],s=o?e.getParentRows().map(l=>{let{id:c}=l;return c}):[],a=new Set([...s,e.id,...i]);t.setRowPinning(l=>{var c,u;if(n==="bottom"){var f,d;return{top:((f=l?.top)!=null?f:[]).filter(p=>!(a!=null&&a.has(p))),bottom:[...((d=l?.bottom)!=null?d:[]).filter(p=>!(a!=null&&a.has(p))),...Array.from(a)]}}if(n==="top"){var h,g;return{top:[...((h=l?.top)!=null?h:[]).filter(p=>!(a!=null&&a.has(p))),...Array.from(a)],bottom:((g=l?.bottom)!=null?g:[]).filter(p=>!(a!=null&&a.has(p)))}}return{top:((c=l?.top)!=null?c:[]).filter(p=>!(a!=null&&a.has(p))),bottom:((u=l?.bottom)!=null?u:[]).filter(p=>!(a!=null&&a.has(p)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:o}=t.options;return typeof r=="function"?r(e):(n=r??o)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:o}=t.getState().rowPinning,i=n.some(a=>r?.includes(a)),s=n.some(a=>o?.includes(a));return i?"top":s?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();if(!o)return-1;const i=(n=o==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(s=>{let{id:a}=s;return a});return(r=i?.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?Ju():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:Ju())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var o,i;return!!((o=r.top)!=null&&o.length||(i=r.bottom)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var o;return((o=e.options.keepPinnedRows)==null||o?(n??[]).map(s=>{const a=e.getRow(s,!0);return a.getIsAllParentsExpanded()?a:null}):(n??[]).map(s=>t.find(a=>a.id===s))).filter(Boolean).map(s=>({...s,position:r}))},e.getTopRows=ue(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),de(e.options,"debugRows","getTopRows")),e.getBottomRows=ue(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),de(e.options,"debugRows","getBottomRows")),e.getCenterRows=ue(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const o=new Set([...n??[],...r??[]]);return t.filter(i=>!o.has(i.id))},de(e.options,"debugRows","getCenterRows"))}},q$={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Jt("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach(i=>{i.getCanSelect()&&(r[i.id]=!0)}):o.forEach(i=>{delete r[i.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach(i=>{Ef(o,i.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=ue(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Qu(e,n):{rows:[],flatRows:[],rowsById:{}},de(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=ue(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Qu(e,n):{rows:[],flatRows:[],rowsById:{}},de(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=ue(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Qu(e,n):{rows:[],flatRows:[],rowsById:{}},de(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(o=>o.getCanSelect()&&!n[o.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(o=>!n[o.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const o=e.getIsSelected();t.setRowSelection(i=>{var s;if(n=typeof n<"u"?n:!o,e.getCanSelect()&&o===n)return i;const a={...i};return Ef(a,e.id,n,(s=r?.selectChildren)!=null?s:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return _g(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return Rf(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return Rf(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var o;n&&e.toggleSelected((o=r.target)==null?void 0:o.checked)}}}},Ef=(e,t,n,r,o)=>{var i;const s=o.getRow(t,!0);n?(s.getCanMultiSelect()||Object.keys(e).forEach(a=>delete e[a]),s.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(i=s.subRows)!=null&&i.length&&s.getCanSelectSubRows()&&s.subRows.forEach(a=>Ef(e,a.id,n,r,o))};function Qu(e,t){const n=e.getState().rowSelection,r=[],o={},i=function(s,a){return s.map(l=>{var c;const u=_g(l,n);if(u&&(r.push(l),o[l.id]=l),(c=l.subRows)!=null&&c.length&&(l={...l,subRows:i(l.subRows)}),u)return l}).filter(Boolean)};return{rows:i(t.rows),flatRows:r,rowsById:o}}function _g(e,t){var n;return(n=t[e.id])!=null?n:!1}function Rf(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let o=!0,i=!1;return e.subRows.forEach(s=>{if(!(i&&!o)&&(s.getCanSelect()&&(_g(s,t)?i=!0:o=!1),s.subRows&&s.subRows.length)){const a=Rf(s,t);a==="all"?i=!0:(a==="some"&&(i=!0),o=!1)}}),o?"all":i?"some":!1}const kf=/([0-9]+)/gm,Y$=(e,t,n)=>lS(Xr(e.getValue(n)).toLowerCase(),Xr(t.getValue(n)).toLowerCase()),X$=(e,t,n)=>lS(Xr(e.getValue(n)),Xr(t.getValue(n))),Z$=(e,t,n)=>Tg(Xr(e.getValue(n)).toLowerCase(),Xr(t.getValue(n)).toLowerCase()),J$=(e,t,n)=>Tg(Xr(e.getValue(n)),Xr(t.getValue(n))),Q$=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},eO=(e,t,n)=>Tg(e.getValue(n),t.getValue(n));function Tg(e,t){return e===t?0:e>t?1:-1}function Xr(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function lS(e,t){const n=e.split(kf).filter(Boolean),r=t.split(kf).filter(Boolean);for(;n.length&&r.length;){const o=n.shift(),i=r.shift(),s=parseInt(o,10),a=parseInt(i,10),l=[s,a].sort();if(isNaN(l[0])){if(o>i)return 1;if(i>o)return-1;continue}if(isNaN(l[1]))return isNaN(s)?-1:1;if(s>a)return 1;if(a>s)return-1}return n.length-r.length}const ms={alphanumeric:Y$,alphanumericCaseSensitive:X$,text:Z$,textCaseSensitive:J$,datetime:Q$,basic:eO},tO={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Jt("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const o of n){const i=o?.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return ms.datetime;if(typeof i=="string"&&(r=!0,i.split(kf).length>1))return ms.alphanumeric}return r?ms.text:ms.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof n?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return _c(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:ms[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const o=e.getNextSortingOrder(),i=typeof n<"u"&&n!==null;t.setSorting(s=>{const a=s?.find(h=>h.id===e.id),l=s?.findIndex(h=>h.id===e.id);let c=[],u,f=i?n:o==="desc";if(s!=null&&s.length&&e.getCanMultiSort()&&r?a?u="toggle":u="add":s!=null&&s.length&&l!==s.length-1?u="replace":a?u="toggle":u="replace",u==="toggle"&&(i||o||(u="remove")),u==="add"){var d;c=[...s,{id:e.id,desc:f}],c.splice(0,c.length-((d=t.options.maxMultiSortColCount)!=null?d:Number.MAX_SAFE_INTEGER))}else u==="toggle"?c=s.map(h=>h.id===e.id?{...h,desc:f}:h):u==="remove"?c=s.filter(h=>h.id!==e.id):c=[{id:e.id,desc:f}];return c})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,o;const i=e.getFirstSortDir(),s=e.getIsSorted();return s?s!==i&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(o=t.options.enableMultiRemove)!=null)||o)?!1:s==="desc"?"asc":"desc":i},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(o=>o.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},nO=[C$,z$,I$,D$,_$,T$,H$,W$,tO,$$,K$,U$,G$,q$,V$];function rO(e){var t,n;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const r=[...nO,...(t=e._features)!=null?t:[]];let o={_features:r};const i=o._features.reduce((d,h)=>Object.assign(d,h.getDefaultOptions==null?void 0:h.getDefaultOptions(o)),{}),s=d=>o.options.mergeOptions?o.options.mergeOptions(i,d):{...i,...d};let l={...{},...(n=e.initialState)!=null?n:{}};o._features.forEach(d=>{var h;l=(h=d.getInitialState==null?void 0:d.getInitialState(l))!=null?h:l});const c=[];let u=!1;const f={_features:r,options:{...i,...e},initialState:l,_queue:d=>{c.push(d),u||(u=!0,Promise.resolve().then(()=>{for(;c.length;)c.shift()();u=!1}).catch(h=>setTimeout(()=>{throw h})))},reset:()=>{o.setState(o.initialState)},setOptions:d=>{const h=$r(d,o.options);o.options=s(h)},getState:()=>o.options.state,setState:d=>{o.options.onStateChange==null||o.options.onStateChange(d)},_getRowId:(d,h,g)=>{var p;return(p=o.options.getRowId==null?void 0:o.options.getRowId(d,h,g))!=null?p:`${g?[g.id,h].join("."):h}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(d,h)=>{let g=(h?o.getPrePaginationRowModel():o.getRowModel()).rowsById[d];if(!g&&(g=o.getCoreRowModel().rowsById[d],!g))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${d}`):new Error;return g},_getDefaultColumnDef:ue(()=>[o.options.defaultColumn],d=>{var h;return d=(h=d)!=null?h:{},{header:g=>{const p=g.header.column.columnDef;return p.accessorKey?p.accessorKey:p.accessorFn?p.id:null},cell:g=>{var p,m;return(p=(m=g.renderValue())==null||m.toString==null?void 0:m.toString())!=null?p:null},...o._features.reduce((g,p)=>Object.assign(g,p.getDefaultColumnDef==null?void 0:p.getDefaultColumnDef()),{}),...d}},de(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>o.options.columns,getAllColumns:ue(()=>[o._getColumnDefs()],d=>{const h=function(g,p,m){return m===void 0&&(m=0),g.map(v=>{const y=w$(o,v,m,p),x=v;return y.columns=x.columns?h(x.columns,y,m+1):[],y})};return h(d)},de(e,"debugColumns","getAllColumns")),getAllFlatColumns:ue(()=>[o.getAllColumns()],d=>d.flatMap(h=>h.getFlatColumns()),de(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:ue(()=>[o.getAllFlatColumns()],d=>d.reduce((h,g)=>(h[g.id]=g,h),{}),de(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:ue(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(d,h)=>{let g=d.flatMap(p=>p.getLeafColumns());return h(g)},de(e,"debugColumns","getAllLeafColumns")),getColumn:d=>{const h=o._getAllFlatColumnsById()[d];return process.env.NODE_ENV!=="production"&&!h&&console.error(`[Table] Column with id '${d}' does not exist.`),h}};Object.assign(o,f);for(let d=0;d<o._features.length;d++){const h=o._features[d];h==null||h.createTable==null||h.createTable(o)}return o}function oO(){return e=>ue(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(o,i,s){i===void 0&&(i=0);const a=[];for(let c=0;c<o.length;c++){const u=S$(e,e._getRowId(o[c],c,s),o[c],c,i,void 0,s?.id);if(n.flatRows.push(u),n.rowsById[u.id]=u,a.push(u),e.options.getSubRows){var l;u.originalSubRows=e.options.getSubRows(o[c],c),(l=u.originalSubRows)!=null&&l.length&&(u.subRows=r(u.originalSubRows,i+1,u))}}return a};return n.rows=r(t),n},de(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function iO(e){const t=[],n=r=>{var o;t.push(r),(o=r.subRows)!=null&&o.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function sO(e){return t=>ue(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:o,pageIndex:i}=n;let{rows:s,flatRows:a,rowsById:l}=r;const c=o*i,u=c+o;s=s.slice(c,u);let f;t.options.paginateExpandedRows?f={rows:s,flatRows:a,rowsById:l}:f=iO({rows:s,flatRows:a,rowsById:l}),f.flatRows=[];const d=h=>{f.flatRows.push(h),h.subRows.length&&h.subRows.forEach(d)};return f.rows.forEach(d),f},de(t.options,"debugTable","getPaginationRowModel"))}function aO(){return e=>ue(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,o=[],i=r.filter(l=>{var c;return(c=e.getColumn(l.id))==null?void 0:c.getCanSort()}),s={};i.forEach(l=>{const c=e.getColumn(l.id);c&&(s[l.id]={sortUndefined:c.columnDef.sortUndefined,invertSorting:c.columnDef.invertSorting,sortingFn:c.getSortingFn()})});const a=l=>{const c=l.map(u=>({...u}));return c.sort((u,f)=>{for(let h=0;h<i.length;h+=1){var d;const g=i[h],p=s[g.id],m=p.sortUndefined,v=(d=g?.desc)!=null?d:!1;let y=0;if(m){const x=u.getValue(g.id),b=f.getValue(g.id),w=x===void 0,_=b===void 0;if(w||_){if(m==="first")return w?-1:1;if(m==="last")return w?1:-1;y=w&&_?0:w?m:-m}}if(y===0&&(y=p.sortingFn(u,f,g.id)),y!==0)return v&&(y*=-1),p.invertSorting&&(y*=-1),y}return u.index-f.index}),c.forEach(u=>{var f;o.push(u),(f=u.subRows)!=null&&f.length&&(u.subRows=a(u.subRows))}),c};return{rows:a(n.rows),flatRows:o,rowsById:n.rowsById}},de(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}function b0(e,t){return e?lO(e)?N.createElement(e,t):e:null}function lO(e){return cO(e)||typeof e=="function"||uO(e)}function cO(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function uO(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function dO(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=N.useState(()=>({current:rO(t)})),[r,o]=N.useState(()=>n.current.initialState);return n.current.setOptions(i=>({...i,...e,state:{...r,...e.state},onStateChange:s=>{o(s),e.onStateChange==null||e.onStateChange(s)}})),n.current}const fO=e=>N.createElement("svg",{width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("style",null,`
72
+ color: hsl(${Math.max(0,Math.min(120-120*d,120))}deg 100% 31%);`,n?.key)}return o}}function de(e,t,n,r){return{debug:()=>{var o;return(o=e?.debugAll)!=null?o:e[t]},key:process.env.NODE_ENV==="development"&&n,onChange:r}}function w$(e,t,n,r){const o=()=>{var s;return(s=i.getValue())!=null?s:e.options.renderFallbackValue},i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:o,getContext:ue(()=>[e,n,t,i],(s,a,l,c)=>({table:s,column:a,row:l,cell:c,getValue:c.getValue,renderValue:c.renderValue}),de(e.options,"debugCells","cell.getContext"))};return e._features.forEach(s=>{s.createCell==null||s.createCell(i,n,t,e)},{}),i}function C$(e,t,n,r){var o,i;const a={...e._getDefaultColumnDef(),...t},l=a.accessorKey;let c=(o=(i=a.id)!=null?i:l?typeof String.prototype.replaceAll=="function"?l.replaceAll(".","_"):l.replace(/\./g,"_"):void 0)!=null?o:typeof a.header=="string"?a.header:void 0,u;if(a.accessorFn?u=a.accessorFn:l&&(l.includes(".")?u=d=>{let h=d;for(const p of l.split(".")){var g;h=(g=h)==null?void 0:g[p],process.env.NODE_ENV!=="production"&&h===void 0&&console.warn(`"${p}" in deeply nested key "${l}" returned undefined.`)}return h}:u=d=>d[a.accessorKey]),!c)throw process.env.NODE_ENV!=="production"?new Error(a.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let f={id:`${String(c)}`,accessorFn:u,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:ue(()=>[!0],()=>{var d;return[f,...(d=f.columns)==null?void 0:d.flatMap(h=>h.getFlatColumns())]},de(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:ue(()=>[e._getOrderColumnsFn()],d=>{var h;if((h=f.columns)!=null&&h.length){let g=f.columns.flatMap(p=>p.getLeafColumns());return d(g)}return[f]},de(e.options,"debugColumns","column.getLeafColumns"))};for(const d of e._features)d.createColumn==null||d.createColumn(f,e);return f}const bt="debugHeaders";function x0(e,t,n){var r;let i={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const s=[],a=l=>{l.subHeaders&&l.subHeaders.length&&l.subHeaders.map(a),s.push(l)};return a(i),s},getContext:()=>({table:e,header:i,column:t})};return e._features.forEach(s=>{s.createHeader==null||s.createHeader(i,e)}),i}const S$={createTable:e=>{e.getHeaderGroups=ue(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>{var i,s;const a=(i=r?.map(f=>n.find(d=>d.id===f)).filter(Boolean))!=null?i:[],l=(s=o?.map(f=>n.find(d=>d.id===f)).filter(Boolean))!=null?s:[],c=n.filter(f=>!(r!=null&&r.includes(f.id))&&!(o!=null&&o.includes(f.id)));return Ua(t,[...a,...c,...l],e)},de(e.options,bt,"getHeaderGroups")),e.getCenterHeaderGroups=ue(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>(n=n.filter(i=>!(r!=null&&r.includes(i.id))&&!(o!=null&&o.includes(i.id))),Ua(t,n,e,"center")),de(e.options,bt,"getCenterHeaderGroups")),e.getLeftHeaderGroups=ue(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var o;const i=(o=r?.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?o:[];return Ua(t,i,e,"left")},de(e.options,bt,"getLeftHeaderGroups")),e.getRightHeaderGroups=ue(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var o;const i=(o=r?.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?o:[];return Ua(t,i,e,"right")},de(e.options,bt,"getRightHeaderGroups")),e.getFooterGroups=ue(()=>[e.getHeaderGroups()],t=>[...t].reverse(),de(e.options,bt,"getFooterGroups")),e.getLeftFooterGroups=ue(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),de(e.options,bt,"getLeftFooterGroups")),e.getCenterFooterGroups=ue(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),de(e.options,bt,"getCenterFooterGroups")),e.getRightFooterGroups=ue(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),de(e.options,bt,"getRightFooterGroups")),e.getFlatHeaders=ue(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),de(e.options,bt,"getFlatHeaders")),e.getLeftFlatHeaders=ue(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),de(e.options,bt,"getLeftFlatHeaders")),e.getCenterFlatHeaders=ue(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),de(e.options,bt,"getCenterFlatHeaders")),e.getRightFlatHeaders=ue(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),de(e.options,bt,"getRightFlatHeaders")),e.getCenterLeafHeaders=ue(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),de(e.options,bt,"getCenterLeafHeaders")),e.getLeftLeafHeaders=ue(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),de(e.options,bt,"getLeftLeafHeaders")),e.getRightLeafHeaders=ue(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),de(e.options,bt,"getRightLeafHeaders")),e.getLeafHeaders=ue(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var o,i,s,a,l,c;return[...(o=(i=t[0])==null?void 0:i.headers)!=null?o:[],...(s=(a=n[0])==null?void 0:a.headers)!=null?s:[],...(l=(c=r[0])==null?void 0:c.headers)!=null?l:[]].map(u=>u.getLeafHeaders()).flat()},de(e.options,bt,"getLeafHeaders"))}};function Ua(e,t,n,r){var o,i;let s=0;const a=function(d,h){h===void 0&&(h=1),s=Math.max(s,h),d.filter(g=>g.getIsVisible()).forEach(g=>{var p;(p=g.columns)!=null&&p.length&&a(g.columns,h+1)},0)};a(e);let l=[];const c=(d,h)=>{const g={depth:h,id:[r,`${h}`].filter(Boolean).join("_"),headers:[]},p=[];d.forEach(m=>{const v=[...p].reverse()[0],y=m.column.depth===g.depth;let x,b=!1;if(y&&m.column.parent?x=m.column.parent:(x=m.column,b=!0),v&&v?.column===x)v.subHeaders.push(m);else{const w=x0(n,x,{id:[r,h,x.id,m?.id].filter(Boolean).join("_"),isPlaceholder:b,placeholderId:b?`${p.filter(_=>_.column===x).length}`:void 0,depth:h,index:p.length});w.subHeaders.push(m),p.push(w)}g.headers.push(m),m.headerGroup=g}),l.push(g),h>0&&c(p,h-1)},u=t.map((d,h)=>x0(n,d,{depth:s,index:h}));c(u,s-1),l.reverse();const f=d=>d.filter(g=>g.column.getIsVisible()).map(g=>{let p=0,m=0,v=[0];g.subHeaders&&g.subHeaders.length?(v=[],f(g.subHeaders).forEach(x=>{let{colSpan:b,rowSpan:w}=x;p+=b,v.push(w)})):p=1;const y=Math.min(...v);return m=m+y,g.colSpan=p,g.rowSpan=m,{colSpan:p,rowSpan:m}});return f((o=(i=l[0])==null?void 0:i.headers)!=null?o:[]),l}const _$=(e,t,n,r,o,i,s)=>{let a={id:t,index:r,original:n,depth:o,parentId:s,_valuesCache:{},_uniqueValuesCache:{},getValue:l=>{if(a._valuesCache.hasOwnProperty(l))return a._valuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return a._valuesCache[l]=c.accessorFn(a.original,r),a._valuesCache[l]},getUniqueValues:l=>{if(a._uniqueValuesCache.hasOwnProperty(l))return a._uniqueValuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return c.columnDef.getUniqueValues?(a._uniqueValuesCache[l]=c.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[l]):(a._uniqueValuesCache[l]=[a.getValue(l)],a._uniqueValuesCache[l])},renderValue:l=>{var c;return(c=a.getValue(l))!=null?c:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>b$(a.subRows,l=>l.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let l=[],c=a;for(;;){const u=c.getParentRow();if(!u)break;l.push(u),c=u}return l.reverse()},getAllCells:ue(()=>[e.getAllLeafColumns()],l=>l.map(c=>w$(e,a,c,c.id)),de(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:ue(()=>[a.getAllCells()],l=>l.reduce((c,u)=>(c[u.column.id]=u,c),{}),de(e.options,"debugRows","getAllCellsByColumnId"))};for(let l=0;l<e._features.length;l++){const c=e._features[l];c==null||c.createRow==null||c.createRow(a,e)}return a},T$={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},tS=(e,t,n)=>{var r,o;const i=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((o=e.getValue(t))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(i))};tS.autoRemove=e=>Rn(e);const nS=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};nS.autoRemove=e=>Rn(e);const rS=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===n?.toLowerCase()};rS.autoRemove=e=>Rn(e);const oS=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};oS.autoRemove=e=>Rn(e);const iS=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});iS.autoRemove=e=>Rn(e)||!(e!=null&&e.length);const sS=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});sS.autoRemove=e=>Rn(e)||!(e!=null&&e.length);const aS=(e,t,n)=>e.getValue(t)===n;aS.autoRemove=e=>Rn(e);const lS=(e,t,n)=>e.getValue(t)==n;lS.autoRemove=e=>Rn(e);const _g=(e,t,n)=>{let[r,o]=n;const i=e.getValue(t);return i>=r&&i<=o};_g.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,o=typeof n!="number"?parseFloat(n):n,i=t===null||Number.isNaN(r)?-1/0:r,s=n===null||Number.isNaN(o)?1/0:o;if(i>s){const a=i;i=s,s=a}return[i,s]};_g.autoRemove=e=>Rn(e)||Rn(e[0])&&Rn(e[1]);const ar={includesString:tS,includesStringSensitive:nS,equalsString:rS,arrIncludes:oS,arrIncludesAll:iS,arrIncludesSome:sS,equals:aS,weakEquals:lS,inNumberRange:_g};function Rn(e){return e==null||e===""}const E$={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Jt("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n?.getValue(e.id);return typeof r=="string"?ar.includesString:typeof r=="number"?ar.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?ar.equals:Array.isArray(r)?ar.arrIncludes:ar.weakEquals},e.getFilterFn=()=>{var n,r;return Tc(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:ar[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,o;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const o=e.getFilterFn(),i=r?.find(u=>u.id===e.id),s=$r(n,i?i.value:void 0);if(b0(o,s,e)){var a;return(a=r?.filter(u=>u.id!==e.id))!=null?a:[]}const l={id:e.id,value:s};if(i){var c;return(c=r?.map(u=>u.id===e.id?l:u))!=null?c:[]}return r!=null&&r.length?[...r,l]:[l]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=o=>{var i;return(i=$r(t,o))==null?void 0:i.filter(s=>{const a=n.find(l=>l.id===s.id);if(a){const l=a.getFilterFn();if(b0(l,s.value,a))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function b0(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const R$=(e,t,n)=>n.reduce((r,o)=>{const i=o.getValue(e);return r+(typeof i=="number"?i:0)},0),k$=(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}),r},A$=(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r<i||r===void 0&&i>=i)&&(r=i)}),r},N$=(e,t,n)=>{let r,o;return n.forEach(i=>{const s=i.getValue(e);s!=null&&(r===void 0?s>=s&&(r=o=s):(r>s&&(r=s),o<s&&(o=s)))}),[r,o]},M$=(e,t)=>{let n=0,r=0;if(t.forEach(o=>{let i=o.getValue(e);i!=null&&(i=+i)>=i&&(++n,r+=i)}),n)return r/n},P$=(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!x$(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),o=n.sort((i,s)=>i-s);return n.length%2!==0?o[r]:(o[r-1]+o[r])/2},L$=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),F$=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,$$=(e,t)=>t.length,qu={sum:R$,min:k$,max:A$,extent:N$,mean:M$,median:P$,unique:L$,uniqueCount:F$,count:$$},O$={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Jt("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n?.getValue(e.id);if(typeof r=="number")return qu.sum;if(Object.prototype.toString.call(r)==="[object Date]")return qu.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return Tc(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:qu[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var o;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((o=n.subRows)!=null&&o.length)}}};function I$(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(i=>!t.includes(i.id));return n==="remove"?r:[...t.map(i=>e.find(s=>s.id===i)).filter(Boolean),...r]}const D$={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Jt("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=ue(n=>[Ls(t,n)],n=>n.findIndex(r=>r.id===e.id),de(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var r;return((r=Ls(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const o=Ls(t,n);return((r=o[o.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=ue(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>o=>{let i=[];if(!(t!=null&&t.length))i=o;else{const s=[...t],a=[...o];for(;a.length&&s.length;){const l=s.shift(),c=a.findIndex(u=>u.id===l);c>-1&&i.push(a.splice(c,1)[0])}i=[...i,...a]}return I$(i,n,r)},de(e.options,"debugTable","_getOrderColumnsFn"))}},Yu=()=>({left:[],right:[]}),j$={getInitialState:e=>({columnPinning:Yu(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Jt("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(o=>o.id).filter(Boolean);t.setColumnPinning(o=>{var i,s;if(n==="right"){var a,l;return{left:((a=o?.left)!=null?a:[]).filter(f=>!(r!=null&&r.includes(f))),right:[...((l=o?.right)!=null?l:[]).filter(f=>!(r!=null&&r.includes(f))),...r]}}if(n==="left"){var c,u;return{left:[...((c=o?.left)!=null?c:[]).filter(f=>!(r!=null&&r.includes(f))),...r],right:((u=o?.right)!=null?u:[]).filter(f=>!(r!=null&&r.includes(f)))}}return{left:((i=o?.left)!=null?i:[]).filter(f=>!(r!=null&&r.includes(f))),right:((s=o?.right)!=null?s:[]).filter(f=>!(r!=null&&r.includes(f)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var o,i,s;return((o=r.columnDef.enablePinning)!=null?o:!0)&&((i=(s=t.options.enableColumnPinning)!=null?s:t.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(a=>a.id),{left:r,right:o}=t.getState().columnPinning,i=n.some(a=>r?.includes(a)),s=n.some(a=>o?.includes(a));return i?"left":s?"right":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();return o?(n=(r=t.getState().columnPinning)==null||(r=r[o])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=ue(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,o)=>{const i=[...r??[],...o??[]];return n.filter(s=>!i.includes(s.column.id))},de(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=ue(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(i=>n.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),de(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=ue(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(i=>n.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),de(t.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?Yu():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:Yu())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var o,i;return!!((o=r.left)!=null&&o.length||(i=r.right)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=ue(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),de(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=ue(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),de(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=ue(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const o=[...n??[],...r??[]];return t.filter(i=>!o.includes(i.id))},de(e.options,"debugColumns","getCenterLeafColumns"))}};function V$(e){return e||(typeof document<"u"?document:null)}const Ga={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Xu=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),B$={getDefaultColumnDef:()=>Ga,getInitialState:e=>({columnSizing:{},columnSizingInfo:Xu(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Jt("columnSizing",e),onColumnSizingInfoChange:Jt("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,o;const i=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Ga.minSize,(r=i??e.columnDef.size)!=null?r:Ga.size),(o=e.columnDef.maxSize)!=null?o:Ga.maxSize)},e.getStart=ue(n=>[n,Ls(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((o,i)=>o+i.getSize(),0),de(t.options,"debugColumns","getStart")),e.getAfter=ue(n=>[n,Ls(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((o,i)=>o+i.getSize(),0),de(t.options,"debugColumns","getAfter")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...o}=n;return o})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=o=>{if(o.subHeaders.length)o.subHeaders.forEach(r);else{var i;n+=(i=o.column.getSize())!=null?i:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),o=r?.getCanResize();return i=>{if(!r||!o||(i.persist==null||i.persist(),Zu(i)&&i.touches&&i.touches.length>1))return;const s=e.getSize(),a=e?e.getLeafHeaders().map(v=>[v.column.id,v.column.getSize()]):[[r.id,r.getSize()]],l=Zu(i)?Math.round(i.touches[0].clientX):i.clientX,c={},u=(v,y)=>{typeof y=="number"&&(t.setColumnSizingInfo(x=>{var b,w;const _=t.options.columnResizeDirection==="rtl"?-1:1,E=(y-((b=x?.startOffset)!=null?b:0))*_,R=Math.max(E/((w=x?.startSize)!=null?w:0),-.999999);return x.columnSizingStart.forEach(k=>{let[P,F]=k;c[P]=Math.round(Math.max(F+F*R,0)*100)/100}),{...x,deltaOffset:E,deltaPercentage:R}}),(t.options.columnResizeMode==="onChange"||v==="end")&&t.setColumnSizing(x=>({...x,...c})))},f=v=>u("move",v),d=v=>{u("end",v),t.setColumnSizingInfo(y=>({...y,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},h=V$(n),g={moveHandler:v=>f(v.clientX),upHandler:v=>{h?.removeEventListener("mousemove",g.moveHandler),h?.removeEventListener("mouseup",g.upHandler),d(v.clientX)}},p={moveHandler:v=>(v.cancelable&&(v.preventDefault(),v.stopPropagation()),f(v.touches[0].clientX),!1),upHandler:v=>{var y;h?.removeEventListener("touchmove",p.moveHandler),h?.removeEventListener("touchend",p.upHandler),v.cancelable&&(v.preventDefault(),v.stopPropagation()),d((y=v.touches[0])==null?void 0:y.clientX)}},m=z$()?{passive:!1}:!1;Zu(i)?(h?.addEventListener("touchmove",p.moveHandler,m),h?.addEventListener("touchend",p.upHandler,m)):(h?.addEventListener("mousemove",g.moveHandler,m),h?.addEventListener("mouseup",g.upHandler,m)),t.setColumnSizingInfo(v=>({...v,startOffset:l,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?Xu():(n=e.initialState.columnSizingInfo)!=null?n:Xu())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0}}};let qa=null;function z$(){if(typeof qa=="boolean")return qa;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return qa=e,qa}function Zu(e){return e.type==="touchstart"}const H$={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Jt("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const o=e.columns;return(n=o.length?o.some(i=>i.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=ue(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),de(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=ue(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],de(t.options,"debugRows","getVisibleCells"))},createTable:e=>{const t=(n,r)=>ue(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),de(e.options,"debugColumns",n));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((o,i)=>({...o,[i.id]:n||!(i.getCanHide!=null&&i.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function Ls(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const W$={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},K$={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Jt("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,o,i;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&((i=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>ar.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return Tc(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:ar[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},U$={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Jt("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var o,i;e.setExpanded(r?{}:(o=(i=e.initialState)==null?void 0:i.expanded)!=null?o:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(o=>!o.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(i=>{const s=i.split(".");r=Math.max(r,s.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var o;const i=r===!0?!0:!!(r!=null&&r[e.id]);let s={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(a=>{s[a]=!0}):s=r,n=(o=n)!=null?o:!i,!i&&n)return{...s,[e.id]:!0};if(i&&!n){const{[e.id]:a,...l}=s;return l}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r?.[e.id])},e.getCanExpand=()=>{var n,r,o;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((o=e.subRows)!=null&&o.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},Tf=0,Ef=10,Ju=()=>({pageIndex:Tf,pageSize:Ef}),G$={getInitialState:e=>({...e,pagination:{...Ju(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:Jt("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const o=i=>$r(r,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?Ju():(o=e.initialState.pagination)!=null?o:Ju())},e.setPageIndex=r=>{e.setPagination(o=>{let i=$r(r,o.pageIndex);const s=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return i=Math.max(0,Math.min(i,s)),{...o,pageIndex:i}})},e.resetPageIndex=r=>{var o,i;e.setPageIndex(r?Tf:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?o:Tf)},e.resetPageSize=r=>{var o,i;e.setPageSize(r?Ef:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?o:Ef)},e.setPageSize=r=>{e.setPagination(o=>{const i=Math.max(1,$r(r,o.pageSize)),s=o.pageSize*o.pageIndex,a=Math.floor(s/i);return{...o,pageIndex:a,pageSize:i}})},e.setPageCount=r=>e.setPagination(o=>{var i;let s=$r(r,(i=e.options.pageCount)!=null?i:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...o,pageCount:s}}),e.getPageOptions=ue(()=>[e.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((i,s)=>s)),o},de(e.options,"debugTable","getPageOptions")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,o=e.getPageCount();return o===-1?!0:o===0?!1:r<o-1},e.previousPage=()=>e.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},Qu=()=>({top:[],bottom:[]}),q$={getInitialState:e=>({rowPinning:Qu(),...e}),getDefaultOptions:e=>({onRowPinningChange:Jt("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,o)=>{const i=r?e.getLeafRows().map(l=>{let{id:c}=l;return c}):[],s=o?e.getParentRows().map(l=>{let{id:c}=l;return c}):[],a=new Set([...s,e.id,...i]);t.setRowPinning(l=>{var c,u;if(n==="bottom"){var f,d;return{top:((f=l?.top)!=null?f:[]).filter(p=>!(a!=null&&a.has(p))),bottom:[...((d=l?.bottom)!=null?d:[]).filter(p=>!(a!=null&&a.has(p))),...Array.from(a)]}}if(n==="top"){var h,g;return{top:[...((h=l?.top)!=null?h:[]).filter(p=>!(a!=null&&a.has(p))),...Array.from(a)],bottom:((g=l?.bottom)!=null?g:[]).filter(p=>!(a!=null&&a.has(p)))}}return{top:((c=l?.top)!=null?c:[]).filter(p=>!(a!=null&&a.has(p))),bottom:((u=l?.bottom)!=null?u:[]).filter(p=>!(a!=null&&a.has(p)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:o}=t.options;return typeof r=="function"?r(e):(n=r??o)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:o}=t.getState().rowPinning,i=n.some(a=>r?.includes(a)),s=n.some(a=>o?.includes(a));return i?"top":s?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();if(!o)return-1;const i=(n=o==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(s=>{let{id:a}=s;return a});return(r=i?.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?Qu():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:Qu())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var o,i;return!!((o=r.top)!=null&&o.length||(i=r.bottom)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var o;return((o=e.options.keepPinnedRows)==null||o?(n??[]).map(s=>{const a=e.getRow(s,!0);return a.getIsAllParentsExpanded()?a:null}):(n??[]).map(s=>t.find(a=>a.id===s))).filter(Boolean).map(s=>({...s,position:r}))},e.getTopRows=ue(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),de(e.options,"debugRows","getTopRows")),e.getBottomRows=ue(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),de(e.options,"debugRows","getBottomRows")),e.getCenterRows=ue(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const o=new Set([...n??[],...r??[]]);return t.filter(i=>!o.has(i.id))},de(e.options,"debugRows","getCenterRows"))}},Y$={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Jt("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach(i=>{i.getCanSelect()&&(r[i.id]=!0)}):o.forEach(i=>{delete r[i.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach(i=>{Rf(o,i.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=ue(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?ed(e,n):{rows:[],flatRows:[],rowsById:{}},de(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=ue(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?ed(e,n):{rows:[],flatRows:[],rowsById:{}},de(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=ue(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?ed(e,n):{rows:[],flatRows:[],rowsById:{}},de(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(o=>o.getCanSelect()&&!n[o.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(o=>!n[o.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const o=e.getIsSelected();t.setRowSelection(i=>{var s;if(n=typeof n<"u"?n:!o,e.getCanSelect()&&o===n)return i;const a={...i};return Rf(a,e.id,n,(s=r?.selectChildren)!=null?s:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return Tg(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return kf(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return kf(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var o;n&&e.toggleSelected((o=r.target)==null?void 0:o.checked)}}}},Rf=(e,t,n,r,o)=>{var i;const s=o.getRow(t,!0);n?(s.getCanMultiSelect()||Object.keys(e).forEach(a=>delete e[a]),s.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(i=s.subRows)!=null&&i.length&&s.getCanSelectSubRows()&&s.subRows.forEach(a=>Rf(e,a.id,n,r,o))};function ed(e,t){const n=e.getState().rowSelection,r=[],o={},i=function(s,a){return s.map(l=>{var c;const u=Tg(l,n);if(u&&(r.push(l),o[l.id]=l),(c=l.subRows)!=null&&c.length&&(l={...l,subRows:i(l.subRows)}),u)return l}).filter(Boolean)};return{rows:i(t.rows),flatRows:r,rowsById:o}}function Tg(e,t){var n;return(n=t[e.id])!=null?n:!1}function kf(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let o=!0,i=!1;return e.subRows.forEach(s=>{if(!(i&&!o)&&(s.getCanSelect()&&(Tg(s,t)?i=!0:o=!1),s.subRows&&s.subRows.length)){const a=kf(s,t);a==="all"?i=!0:(a==="some"&&(i=!0),o=!1)}}),o?"all":i?"some":!1}const Af=/([0-9]+)/gm,X$=(e,t,n)=>cS(Xr(e.getValue(n)).toLowerCase(),Xr(t.getValue(n)).toLowerCase()),Z$=(e,t,n)=>cS(Xr(e.getValue(n)),Xr(t.getValue(n))),J$=(e,t,n)=>Eg(Xr(e.getValue(n)).toLowerCase(),Xr(t.getValue(n)).toLowerCase()),Q$=(e,t,n)=>Eg(Xr(e.getValue(n)),Xr(t.getValue(n))),eO=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},tO=(e,t,n)=>Eg(e.getValue(n),t.getValue(n));function Eg(e,t){return e===t?0:e>t?1:-1}function Xr(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function cS(e,t){const n=e.split(Af).filter(Boolean),r=t.split(Af).filter(Boolean);for(;n.length&&r.length;){const o=n.shift(),i=r.shift(),s=parseInt(o,10),a=parseInt(i,10),l=[s,a].sort();if(isNaN(l[0])){if(o>i)return 1;if(i>o)return-1;continue}if(isNaN(l[1]))return isNaN(s)?-1:1;if(s>a)return 1;if(a>s)return-1}return n.length-r.length}const ms={alphanumeric:X$,alphanumericCaseSensitive:Z$,text:J$,textCaseSensitive:Q$,datetime:eO,basic:tO},nO={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Jt("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const o of n){const i=o?.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return ms.datetime;if(typeof i=="string"&&(r=!0,i.split(Af).length>1))return ms.alphanumeric}return r?ms.text:ms.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof n?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return Tc(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:ms[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const o=e.getNextSortingOrder(),i=typeof n<"u"&&n!==null;t.setSorting(s=>{const a=s?.find(h=>h.id===e.id),l=s?.findIndex(h=>h.id===e.id);let c=[],u,f=i?n:o==="desc";if(s!=null&&s.length&&e.getCanMultiSort()&&r?a?u="toggle":u="add":s!=null&&s.length&&l!==s.length-1?u="replace":a?u="toggle":u="replace",u==="toggle"&&(i||o||(u="remove")),u==="add"){var d;c=[...s,{id:e.id,desc:f}],c.splice(0,c.length-((d=t.options.maxMultiSortColCount)!=null?d:Number.MAX_SAFE_INTEGER))}else u==="toggle"?c=s.map(h=>h.id===e.id?{...h,desc:f}:h):u==="remove"?c=s.filter(h=>h.id!==e.id):c=[{id:e.id,desc:f}];return c})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,o;const i=e.getFirstSortDir(),s=e.getIsSorted();return s?s!==i&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(o=t.options.enableMultiRemove)!=null)||o)?!1:s==="desc"?"asc":"desc":i},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(o=>o.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},rO=[S$,H$,D$,j$,T$,E$,W$,K$,nO,O$,U$,G$,q$,Y$,B$];function oO(e){var t,n;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const r=[...rO,...(t=e._features)!=null?t:[]];let o={_features:r};const i=o._features.reduce((d,h)=>Object.assign(d,h.getDefaultOptions==null?void 0:h.getDefaultOptions(o)),{}),s=d=>o.options.mergeOptions?o.options.mergeOptions(i,d):{...i,...d};let l={...{},...(n=e.initialState)!=null?n:{}};o._features.forEach(d=>{var h;l=(h=d.getInitialState==null?void 0:d.getInitialState(l))!=null?h:l});const c=[];let u=!1;const f={_features:r,options:{...i,...e},initialState:l,_queue:d=>{c.push(d),u||(u=!0,Promise.resolve().then(()=>{for(;c.length;)c.shift()();u=!1}).catch(h=>setTimeout(()=>{throw h})))},reset:()=>{o.setState(o.initialState)},setOptions:d=>{const h=$r(d,o.options);o.options=s(h)},getState:()=>o.options.state,setState:d=>{o.options.onStateChange==null||o.options.onStateChange(d)},_getRowId:(d,h,g)=>{var p;return(p=o.options.getRowId==null?void 0:o.options.getRowId(d,h,g))!=null?p:`${g?[g.id,h].join("."):h}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(d,h)=>{let g=(h?o.getPrePaginationRowModel():o.getRowModel()).rowsById[d];if(!g&&(g=o.getCoreRowModel().rowsById[d],!g))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${d}`):new Error;return g},_getDefaultColumnDef:ue(()=>[o.options.defaultColumn],d=>{var h;return d=(h=d)!=null?h:{},{header:g=>{const p=g.header.column.columnDef;return p.accessorKey?p.accessorKey:p.accessorFn?p.id:null},cell:g=>{var p,m;return(p=(m=g.renderValue())==null||m.toString==null?void 0:m.toString())!=null?p:null},...o._features.reduce((g,p)=>Object.assign(g,p.getDefaultColumnDef==null?void 0:p.getDefaultColumnDef()),{}),...d}},de(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>o.options.columns,getAllColumns:ue(()=>[o._getColumnDefs()],d=>{const h=function(g,p,m){return m===void 0&&(m=0),g.map(v=>{const y=C$(o,v,m,p),x=v;return y.columns=x.columns?h(x.columns,y,m+1):[],y})};return h(d)},de(e,"debugColumns","getAllColumns")),getAllFlatColumns:ue(()=>[o.getAllColumns()],d=>d.flatMap(h=>h.getFlatColumns()),de(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:ue(()=>[o.getAllFlatColumns()],d=>d.reduce((h,g)=>(h[g.id]=g,h),{}),de(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:ue(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(d,h)=>{let g=d.flatMap(p=>p.getLeafColumns());return h(g)},de(e,"debugColumns","getAllLeafColumns")),getColumn:d=>{const h=o._getAllFlatColumnsById()[d];return process.env.NODE_ENV!=="production"&&!h&&console.error(`[Table] Column with id '${d}' does not exist.`),h}};Object.assign(o,f);for(let d=0;d<o._features.length;d++){const h=o._features[d];h==null||h.createTable==null||h.createTable(o)}return o}function iO(){return e=>ue(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(o,i,s){i===void 0&&(i=0);const a=[];for(let c=0;c<o.length;c++){const u=_$(e,e._getRowId(o[c],c,s),o[c],c,i,void 0,s?.id);if(n.flatRows.push(u),n.rowsById[u.id]=u,a.push(u),e.options.getSubRows){var l;u.originalSubRows=e.options.getSubRows(o[c],c),(l=u.originalSubRows)!=null&&l.length&&(u.subRows=r(u.originalSubRows,i+1,u))}}return a};return n.rows=r(t),n},de(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function sO(e){const t=[],n=r=>{var o;t.push(r),(o=r.subRows)!=null&&o.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function aO(e){return t=>ue(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:o,pageIndex:i}=n;let{rows:s,flatRows:a,rowsById:l}=r;const c=o*i,u=c+o;s=s.slice(c,u);let f;t.options.paginateExpandedRows?f={rows:s,flatRows:a,rowsById:l}:f=sO({rows:s,flatRows:a,rowsById:l}),f.flatRows=[];const d=h=>{f.flatRows.push(h),h.subRows.length&&h.subRows.forEach(d)};return f.rows.forEach(d),f},de(t.options,"debugTable","getPaginationRowModel"))}function lO(){return e=>ue(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,o=[],i=r.filter(l=>{var c;return(c=e.getColumn(l.id))==null?void 0:c.getCanSort()}),s={};i.forEach(l=>{const c=e.getColumn(l.id);c&&(s[l.id]={sortUndefined:c.columnDef.sortUndefined,invertSorting:c.columnDef.invertSorting,sortingFn:c.getSortingFn()})});const a=l=>{const c=l.map(u=>({...u}));return c.sort((u,f)=>{for(let h=0;h<i.length;h+=1){var d;const g=i[h],p=s[g.id],m=p.sortUndefined,v=(d=g?.desc)!=null?d:!1;let y=0;if(m){const x=u.getValue(g.id),b=f.getValue(g.id),w=x===void 0,_=b===void 0;if(w||_){if(m==="first")return w?-1:1;if(m==="last")return w?1:-1;y=w&&_?0:w?m:-m}}if(y===0&&(y=p.sortingFn(u,f,g.id)),y!==0)return v&&(y*=-1),p.invertSorting&&(y*=-1),y}return u.index-f.index}),c.forEach(u=>{var f;o.push(u),(f=u.subRows)!=null&&f.length&&(u.subRows=a(u.subRows))}),c};return{rows:a(n.rows),flatRows:o,rowsById:n.rowsById}},de(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}function w0(e,t){return e?cO(e)?N.createElement(e,t):e:null}function cO(e){return uO(e)||typeof e=="function"||dO(e)}function uO(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function dO(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function fO(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=N.useState(()=>({current:oO(t)})),[r,o]=N.useState(()=>n.current.initialState);return n.current.setOptions(i=>({...i,...e,state:{...r,...e.state},onStateChange:s=>{o(s),e.onStateChange==null||e.onStateChange(s)}})),n.current}const hO=e=>N.createElement("svg",{width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("style",null,`
73
73
  @keyframes spin {
74
74
  from {
75
75
  transform: rotate(0deg);
@@ -82,15 +82,15 @@
82
82
  transform-origin: center;
83
83
  animation: spin 1s linear infinite;
84
84
  }
85
- `),N.createElement("g",{className:"spinner"},N.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.0003 6.83317C13.5692 6.83317 11.2376 7.79894 9.51851 9.51803C7.79943 11.2371 6.83366 13.5687 6.83366 15.9998C6.83366 18.431 7.79943 20.7626 9.51851 22.4817C11.2376 24.2007 13.5692 25.1665 16.0003 25.1665C18.4315 25.1665 20.7631 24.2007 22.4821 22.4817C24.2012 20.7626 25.167 18.431 25.167 15.9998C25.167 13.5687 24.2012 11.2371 22.4821 9.51803C20.7631 7.79894 18.4315 6.83317 16.0003 6.83317ZM3.16699 15.9998C3.16699 8.91217 8.91266 3.1665 16.0003 3.1665C23.088 3.1665 28.8337 8.91217 28.8337 15.9998C28.8337 23.0875 23.088 28.8332 16.0003 28.8332C8.91266 28.8332 3.16699 23.0875 3.16699 15.9998Z",fill:"currentColor",fillOpacity:.12}),N.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.9997 6.83319C13.6363 6.82787 11.3633 7.74068 9.65999 9.37907C9.30711 9.70535 8.84021 9.88001 8.35982 9.86545C7.87943 9.85089 7.42396 9.64827 7.09149 9.30122C6.75902 8.95416 6.57612 8.49043 6.58218 8.00985C6.58823 7.52928 6.78276 7.07031 7.12388 6.73174C9.50956 4.43941 12.6912 3.16143 15.9997 3.16652C16.4859 3.16652 16.9522 3.35967 17.296 3.70349C17.6398 4.04731 17.833 4.51362 17.833 4.99985C17.833 5.48608 17.6398 5.9524 17.296 6.29621C16.9522 6.64003 16.4859 6.83319 15.9997 6.83319Z",fill:"currentColor"}))),hO=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("g",{clipPath:"url(#clip0_2074_3858)"},N.createElement("path",{d:"M21 21L16.65 16.65M19 11C19 15.4183 15.4183 19 11 19C6.58172 19 3 15.4183 3 11C3 6.58172 6.58172 3 11 3C15.4183 3 19 6.58172 19 11Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),N.createElement("defs",null,N.createElement("clipPath",{id:"clip0_2074_3858"},N.createElement("rect",{width:24,height:24,fill:"white"})))),gO={table:T.css({...ye.body2,fontWeight:500})},cS=S.forwardRef(({children:e,className:t,style:n,...r},o)=>C.jsx("td",{ref:o,className:T.cx(t),style:n,...r,children:e}));cS.displayName="TableBodyCell";const{spacing:w0}=V,uS=S.forwardRef(({children:e,row:t=!0,justifyContent:n="flex-start",alignItems:r="center",py:o=w0.sm,px:i=w0.md,minHeight:s="56px",...a},l)=>C.jsx(q,{row:t,justifyContent:n,alignItems:r,py:o,px:i,minHeight:s,ref:l,...a,children:e}));uS.displayName="TableBodyCellContent";const{color:pO}=V,dS=S.forwardRef(({children:e,className:t,showBorders:n=!1,isSelected:r=!1,...o},i)=>{const s=T.css({borderBottom:n?`1px solid ${pO.border.neutralAlphaLow}`:"none"});return C.jsx("tr",{ref:i,className:T.cx(s,t),...o,children:e})});dS.displayName="TableBodyRow";const mO=S.forwardRef(({children:e,className:t,style:n,justifyContent:r="flex-start",alignItems:o="flex-start",...i},s)=>{const a=T.css({justifyContent:r,alignItems:o,fontWeight:"inherit"});return C.jsx("th",{ref:s,className:T.cx(a,t),style:n,...i,children:e})}),{spacing:C0}=V,Eg=S.forwardRef(({children:e,row:t=!0,justifyContent:n="flex-start",alignItems:r="center",py:o=C0.sm,px:i=C0.md,minHeight:s="56px",className:a,center:l,...c},u)=>C.jsx(q,{ref:u,row:t,justifyContent:n,alignItems:r,py:o,px:i,minHeight:s,center:l,className:T.cx(a,T.css({textAlign:l?"center":"left"})),...c,children:e}));Eg.displayName="TableHeadCellContent";const yO=e=>N.createElement("svg",{width:10,height:6,viewBox:"0 0 10 6",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M8.75 0.75L4.75 4.75L0.75 0.75",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),vO=e=>N.createElement("svg",{width:10,height:6,viewBox:"0 0 10 6",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M8.75 4.75L4.75 0.75L0.75 4.75",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),{color:Ya}=V,xO=({sortDirection:e,gap:t="5px",...n})=>C.jsxs(q,{gap:t,...n,children:[C.jsx(vO,{style:{color:e==="asc"?Ya.icon.accent:Ya.icon.tertiary}}),C.jsx(yO,{style:{color:e==="desc"?Ya.icon.accent:Ya.icon.tertiary}})]}),fS=({children:e,tableProps:t,gap:n="10px",...r})=>{const o=t.column.getIsSorted();return C.jsxs(Eg,{style:{cursor:"pointer",userSelect:"none"},gap:n,...r,children:[e,C.jsx(xO,{sortDirection:o})]})};fS.displayName="TableHeadCellContentSortable";const{color:S0}=V,hS=S.forwardRef(({children:e,className:t,showBorders:n=!1,...r},o)=>{const i=T.css({backgroundColor:S0.fill.bgSecondary,borderBottom:n?`1px solid ${S0.border.neutralAlphaLow}`:"none"});return C.jsx("tr",{ref:o,className:T.cx(i,t),...r,children:e})});hS.displayName="TableHeadRow";const _0=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M15 18L9 12L15 6",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),T0=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M9 18L15 12L9 6",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),bO=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M12 13C12.5523 13 13 12.5523 13 12C13 11.4477 12.5523 11 12 11C11.4477 11 11 11.4477 11 12C11 12.5523 11.4477 13 12 13Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),N.createElement("path",{d:"M19 13C19.5523 13 20 12.5523 20 12C20 11.4477 19.5523 11 19 11C18.4477 11 18 11.4477 18 12C18 12.5523 18.4477 13 19 13Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),N.createElement("path",{d:"M5 13C5.55228 13 6 12.5523 6 12C6 11.4477 5.55228 11 5 11C4.44772 11 4 11.4477 4 12C4 12.5523 4.44772 13 5 13Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),ed=(e,t)=>{const n=t-e+1;return Array.from({length:n},(r,o)=>e+o)};function wO(e){const{count:t=1,page:n,maxVisiblePages:r=10}=e;let o=1,i=1;if(r<=2)return[n];r<=4?(o=0,i=0):r<=6?(o=1,i=0):r<=7?(o=1,i=Math.max(0,Math.floor((r-4)/2))):(o=1,i=Math.max(1,Math.floor((r-5)/2)));const s=ed(1,Math.min(o,t)),a=ed(Math.max(t-o+1,o+1),t),l=Math.max(Math.min(n-i,t-o-i*2-1),o+2),c=Math.min(Math.max(n+i,o+i*2+2),t-o-1);return[...s,...l>o+2?["start-dots"]:o+1<t-o?[o+1]:[],...ed(l,c),...c<t-o-1?["end-dots"]:t-o>o?[t-o]:[],...a]}const{color:si,cornerRadius:CO,spacing:td}=V,SO=({pageIndex:e,pageSize:t,totalCount:n,onPageChange:r,onPageSizeChange:o,variant:i="numbered",labels:s,pageSizeOptions:a=[10,20,50,100],showPageSizeSelector:l=!0,renderPageSizeSelectorDropdownItem:c=p=>p.label,renderPageSizeSelectorInputItem:u,className:f,itemClassName:d,activeItemClassName:h,pageSizeSelectorClassName:g})=>{const{prev:p="Previous",next:m="Next"}=s??{},v=S.useRef(null),[y,x]=S.useState(0),b=Math.ceil(n/t),w=e>0,_=e<b-1;S.useEffect(()=>{const $=v.current;if(!$)return;const H=new ResizeObserver(O=>{for(const P of O)x(P.contentRect.width)});return H.observe($),()=>{H.disconnect()}},[]);const R=($=>{if($<=0)return 1;const G=$-96;if(G<=40)return 1;const re=Math.floor((G+8)/48);return Math.max(1,Math.min(10,re))})(y),k=wO({page:e+1,count:b,maxVisiblePages:R}),M=()=>{w&&r(e-1)},F=()=>{_&&r(e+1)},D=$=>{o(Number($))};if(n===0)return null;const j=()=>C.jsxs(q,{ref:v,flex:1,row:!0,overflow:"hidden",gap:td.sm,children:[C.jsx(pr,{onClick:M,disabled:!w,color:"neutral",size:"sm",children:C.jsx(_0,{})}),C.jsx(q,{row:!0,gap:td.sm,children:k.map($=>C.jsx(E0,{isDots:$==="start-dots"||$==="end-dots",isCurrentPage:$===e+1,disabled:$==="start-dots"||$==="end-dots",onClick:()=>r($-1),className:d,activeClassName:h,children:$},$))}),C.jsx(pr,{color:"neutral",size:"sm",onClick:F,disabled:!_,children:C.jsx(T0,{})})]}),I=()=>C.jsxs(q,{flex:1,row:!0,gap:td.sm,alignItems:"center",className:f,children:[C.jsx(Br,{width:"auto",size:"sm",color:"neutral",iconLeft:C.jsx(_0,{width:20,height:20}),disabled:!w,onClick:M,children:p}),C.jsx(E0,{className:d,activeClassName:h,children:e+1}),C.jsx(Br,{width:"auto",size:"sm",color:"neutral",iconRight:C.jsx(T0,{width:20,height:20}),disabled:!_,onClick:F,children:m})]});return C.jsxs(q,{flex:1,row:!0,justifyContent:"space-between",children:[i==="simple"?I():j(),l&&C.jsx(q,{alignItems:"flex-end",className:g,children:C.jsx(Cg,{width:"fit-content",value:t.toString(),size:"sm",items:a.map($=>({value:$.toString(),label:$.toString()})),returnedValue:$=>$.value,renderDropdownItem:c,renderSingleInputItem:u,onChange:$=>D($)})})]})},E0=({children:e,isCurrentPage:t=!1,onClick:n,isDots:r=!1,disabled:o=!1,className:i,activeClassName:s})=>{const a=T.css({cursor:o?"not-allowed":"pointer",userSelect:"none",width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:t?si.fill.accentSecondary:si.fill.bgSecondary,borderRadius:CO.sm,border:t?`1px solid ${si.fill.accentSecondaryHover}`:`1px solid ${si.border.neutralAlphaBasic}`}),l=T.css({width:"24px",height:"24px",color:t?si.icon.secondary:si.icon.tertiary});return C.jsx(q,{className:T.cx(a,i,t&&s),onClick:o?void 0:n,children:r?C.jsx(bO,{className:l}):C.jsx(le,{center:!0,variant:"body-2",fontWeight:"medium",children:e})})},{color:Af,cornerRadius:_O}=V,TO=T.css({position:"relative",borderRadius:_O.md,overflow:"hidden","&::before, &::after":{content:'""',position:"absolute",top:0,bottom:14,width:96,pointerEvents:"none",zIndex:1,transition:"opacity 0.2s ease"},"&::before":{left:0,background:"linear-gradient(to left, rgba(255, 255, 255, 0.00) 0%, #FFF 100%)"},"&::after":{right:0,background:"linear-gradient(to right, rgba(255, 255, 255, 0.00) 0%, #FFF 100%)"}}),EO=T.css({overflowX:"auto",scrollbarWidth:"thin",scrollbarColor:`${Af.scrollbar.thumbPrimary} ${Af.scrollbar.trackPrimary}`}),gS=S.memo(({data:e,children:t,className:n,scrollContainerClassName:r,showBorders:o=!1,...i})=>{const[s,a]=S.useState(!1),[l,c]=S.useState(!1),u=S.useRef(null),f=S.useCallback(()=>{const h=u.current;if(!h)return;const{scrollLeft:g,scrollWidth:p,clientWidth:m}=h,v=p>m;a(v&&g>0),c(v&&g<p-m-1)},[]);S.useEffect(()=>{const h=u.current;if(!h)return;f();const g=new ResizeObserver(f);return g.observe(h),h.addEventListener("scroll",f),()=>{g.disconnect(),h.removeEventListener("scroll",f)}},[f,e]);const d=T.css({border:o?`1px solid ${Af.border.neutralAlphaLow}`:"transparent","&::before":{opacity:s?1:0},"&::after":{opacity:l?1:0}});return C.jsx(q,{className:T.cx(TO,d,n),...i,children:C.jsx(q,{ref:u,className:T.cx(EO,r),children:t})})});gS.displayName="TableWrapper";const{spacing:xn,cornerRadius:R0,color:Ys}=V,RO=T.css({width:"100%",maxWidth:"100%",minWidth:"max-content",borderCollapse:"collapse",borderSpacing:0,backgroundColor:Ys.fill.bgPrimary}),kO=T.css({backgroundColor:Ys.fill.bgSecondary,color:Ys.text.tertiary}),ns=({ref:e,data:t,columns:n,showBorders:r=!0,enableSorting:o=!1,enablePagination:i=!1,enableRowSelection:s=!1,enableMultiRowSelection:a=!1,sorting:l,onSortingChange:c,columnFilters:u,onColumnFiltersChange:f,columnVisibility:d,onColumnVisibilityChange:h,pagination:g,onPaginationChange:p,rowSelection:m,onRowSelectionChange:v,totalCount:y,loading:x=!1,emptyLabels:b={title:"Nothing found",description:"No results found for “result”",action:"Reset"},loadingLabels:w={title:"Loading...",description:"Please wait or reset your promt",action:"Reset"},className:_,containerClassName:E,theadClassName:R,tbodyClassName:k,emptyStateClassName:M,emptyStateTitleClassName:F,emptyStateDescriptionClassName:D,paginationClassName:j,tableOptions:I={},onRowClick:$,getRowId:H,headCellComponent:O=mO,bodyCellComponent:P=cS,headRowComponent:K=hS,bodyRowComponent:G=dS,onReset:re,paginationVariant:U,paginationLabels:Z,renderPageSizeSelectorDropdownItem:Q,renderPageSizeSelectorInputItem:ne})=>{const[oe,me]=S.useState([]),[ee,xe]=S.useState([]),[Se,Ee]=S.useState({}),[ze,je]=S.useState({pageIndex:0,pageSize:10}),[Rt,gn]=S.useState({}),ot=l??oe,Gt=u??ee,Qt=d??Se,pt=g??ze,se=m??Rt,Re=Ce=>{const Le=typeof Ce=="function"?Ce(ot):Ce;c?c(Le):me(Le)},Ye=Ce=>{const Le=typeof Ce=="function"?Ce(Gt):Ce;f?f(Le):xe(Le)},rt=Ce=>{const Le=typeof Ce=="function"?Ce(Qt):Ce;h?h(Le):Ee(Le)},It=Ce=>{const Le=typeof Ce=="function"?Ce(pt):Ce;p?p(Le):je(Le)},no=dO({data:t,columns:n,state:{sorting:ot,columnFilters:Gt,columnVisibility:Qt,pagination:pt,rowSelection:se},onSortingChange:Re,onColumnFiltersChange:Ye,onColumnVisibilityChange:rt,onPaginationChange:It,onRowSelectionChange:Ce=>{const Le=typeof Ce=="function"?Ce(se):Ce;v?v(Le):gn(Le)},getCoreRowModel:oO(),getSortedRowModel:o?aO():void 0,getPaginationRowModel:i?sO():void 0,enableRowSelection:s,enableMultiRowSelection:a,getRowId:H,manualPagination:!!y,pageCount:y?Math.ceil(y/pt.pageSize):void 0,...I});S.useImperativeHandle(e,()=>no);const{rows:pa}=no.getRowModel(),qo=(Ce,Le)=>{$&&$(Ce.original,Le)};return x?C.jsxs(q,{w:"full",borderRadius:R0.md,py:xn["5xl"],px:xn["10xl"],alignItems:"center",className:T.cx(E,M),children:[C.jsx(fO,{width:32,height:32,style:{color:Ys.icon.tertiary,marginBottom:xn.sm}}),C.jsx(le,{mb:xn.xs,variant:"title-3",fontWeight:"semibold",className:F,children:w.title}),C.jsx(le,{mb:xn.md,colorName:"tertiary",variant:"body-1",fontWeight:"medium",className:D,children:w.description}),typeof w.action=="string"?C.jsx(Br,{width:"auto",onClick:re,intensity:"secondary",color:"accent",children:w.action}):w.action]}):pa.length?C.jsxs(q,{w:"full",gap:xn.xl,className:T.cx(E),children:[C.jsx(gS,{data:t,showBorders:r,children:C.jsxs("table",{className:T.cx(RO,gO.table,_),children:[C.jsx("thead",{className:T.cx(kO,R),children:no.getHeaderGroups().map(Ce=>C.jsx(K,{showBorders:r,children:Ce.headers.map(Le=>C.jsx(O,{style:{width:Le.getSize()},onClick:Le.column.getToggleSortingHandler(),children:Le.isPlaceholder?null:b0(Le.column.columnDef.header,Le.getContext())},Le.id))},Ce.id))}),C.jsx("tbody",{className:k,children:pa.map((Ce,Le)=>C.jsx(G,{showBorders:r,isSelected:Ce.getIsSelected(),onClick:()=>qo(Ce,Le),children:Ce.getVisibleCells().map(Yo=>C.jsx(P,{children:b0(Yo.column.columnDef.cell,Yo.getContext())},Yo.id))},Ce.id))})]})}),i&&!x&&C.jsx(SO,{pageIndex:pt.pageIndex,pageSize:pt.pageSize,totalCount:y||t.length,variant:U,labels:Z,renderPageSizeSelectorDropdownItem:Q,renderPageSizeSelectorInputItem:ne,onPageChange:Ce=>It({...pt,pageIndex:Ce}),onPageSizeChange:Ce=>It({...pt,pageSize:Ce,pageIndex:0}),className:j})]}):C.jsxs(q,{w:"full",borderRadius:R0.md,py:xn["5xl"],px:xn["10xl"],alignItems:"center",className:T.cx(E,M),children:[C.jsx(hO,{width:24,height:24,style:{color:Ys.icon.tertiary,marginBottom:xn.sm}}),C.jsx(le,{mb:xn.xs,variant:"title-3",fontWeight:"semibold",className:F,children:b.title}),C.jsx(le,{mb:xn.md,colorName:"tertiary",variant:"body-1",fontWeight:"medium",className:D,children:b.description}),typeof b.action=="string"?C.jsx(Br,{width:"auto",onClick:re,intensity:"secondary",color:"accent",children:b.action}):b.action]})};ns.displayName="Table";ns.HeadCellContent=Eg;ns.BodyCellContent=uS;ns.HeadCellContentSortable=fS;ns.createColumnHelper=QC;const{color:rn}=V,nd={chart:{type:"areaspline",backgroundColor:"transparent",spacing:[0,0,0,0],margin:[0,0,0,0]},xAxis:{gridLineWidth:0,lineWidth:0,tickWidth:0,labels:{enabled:!1},title:{text:""}},yAxis:{gridLineWidth:0,lineWidth:0,tickWidth:0,labels:{enabled:!1},title:{text:""}},legend:{enabled:!1},credits:{enabled:!1}},AO={positive:{color:rn.fill.positivePrimary,fillColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,rn.fill.positiveTintHigh],[1,rn.fill.positiveTransparent]]}},negative:{color:rn.fill.negativePrimary,fillColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,rn.fill.negativeTintHigh],[1,rn.fill.negativeTransparent]]}},accent:{color:rn.fill.accentPrimary,fillColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,rn.fill.accentTintHigh],[1,rn.fill.accentTransparent]]}},warning:{color:rn.fill.warningPrimary,fillColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,rn.fill.warningTintHigh],[1,rn.fill.warningTransparent]]}},transfer:{color:"var(--fill-transfer-primary)",fillColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,"var(--fill-transfer-tint-high)"],[1,"var(--fill-transfer-transparent)"]]}}},{color:k0}=V,NO=(e,t,n,r,o)=>({...nd,plotOptions:{areaspline:{marker:{enabled:!1,states:{hover:{enabled:o}}},allowPointSelect:!1}},xAxis:{...nd.xAxis,...n},yAxis:{...nd.yAxis,...r},series:[{type:"areaspline",data:t,...AO[e]}]}),MO=e=>({outside:!0,enabled:!!e,padding:0,position:{alignByTranslate:!0},shadow:{color:k0.effect.shadowM,offsetX:0,offsetY:0},borderRadius:8,backgroundColor:k0.fill.bgPrimary,useHTML:!0,...e}),pS=({color:e="positive",data:t=[],xAxis:n,yAxis:r,containerProps:o,highcharts:i,tooltip:s,className:a,style:l})=>{const c=S.useRef(null);S.useEffect(()=>()=>{typeof c=="object"&&c?.current?.chart&&c.current.chart.destroy()},[]);const u=S.useMemo(()=>NO(e,t,n,r,!!s),[e,t,n,r,s]),f=S.useMemo(()=>s?MO(s):{enabled:!1},[s]),d=S.useMemo(()=>({...o,className:T.cx(o?.className,a),style:{...o?.style,...l}}),[o,a,l]);return C.jsx(hl.Chart,{highcharts:i,ref:c,options:u,containerProps:d,children:C.jsx(hl.Tooltip,{...f})})};pS.displayName="LineChart";const{color:ir}=V,PO={chart:{type:"pie",backgroundColor:"transparent",spacing:[0,0,0,0],margin:[0,0,0,0],events:{click:void 0}},title:{align:"center",verticalAlign:"middle",floating:!0,style:{fontSize:"24px",fontWeight:"600",color:ir.text.primary}},plotOptions:{pie:{allowPointSelect:!0,cursor:"pointer",dataLabels:{enabled:!1},startAngle:90,endAngle:-90,innerSize:"90%",borderWidth:0,states:{hover:{enabled:!1},select:{enabled:!1},inactive:{enabled:!1}},enableMouseTracking:!1}},tooltip:{enabled:!1},legend:{enabled:!1},credits:{enabled:!1}},LO={positive:{colors:[ir.fill.positivePrimary,ir.fill.positiveTintHigh]},negative:{colors:[ir.fill.negativePrimary,ir.fill.negativeTintHigh]},accent:{colors:[ir.fill.accentPrimary,ir.fill.accentTintHigh]},warning:{colors:[ir.fill.warningPrimary,ir.fill.warningTintHigh]},transfer:{colors:["var(--fill-transfer-primary)","var(--fill-transfer-tint-high)"]}},FO=(e,t)=>({...PO,series:[{type:"pie",data:[{name:"",y:Math.min(e,100)},{name:"",y:Math.max(100-e,0)}],...LO[t]}]}),mS=S.forwardRef(({highcharts:e,color:t="positive",percentage:n,label:r=l=>`${l}%`,containerProps:o,className:i,style:s},a)=>{const l=S.useRef(null),c=a||l;S.useEffect(()=>()=>{typeof c=="object"&&c?.current?.chart&&c.current.chart.destroy()},[c]);const u=S.useMemo(()=>FO(n,t),[n,t]),f=S.useMemo(()=>({...o,className:T.cx(o?.className,i),style:{...o?.style,...s}}),[o,i,s]);return C.jsx(hl.Chart,{highcharts:e,ref:c,options:u,containerProps:f,children:C.jsx(hl.Title,{children:r?.(n)})})});mS.displayName="PieProgressChart";const $O=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M9 17L14 12L9 7",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),{color:A0}=V,dl={link:T.css({...ye.body2,color:A0.text.tertiary,textDecoration:"none",transition:"color 0.2s ease","&:hover":{textDecoration:"underline"}}),separator:T.css({color:A0.icon.tertiary}),nav:T.css({display:"flex",alignItems:"center",flexWrap:"wrap"}),navItem:T.css({display:"inline-flex",alignItems:"center"})},Rg=({children:e,separator:t,className:n,itemClassName:r,separatorClassName:o})=>{const i=S.Children.toArray(e).filter(a=>S.isValidElement(a)),s=t??C.jsx($O,{className:T.cx(dl.separator,o)});return C.jsx("nav",{"aria-label":"breadcrumb",className:T.cx(dl.nav,n),children:i.map((a,l)=>{const c=l===i.length-1;return C.jsxs(le,{tag:"span",className:T.cx(dl.navItem,r),children:[S.cloneElement(a,{active:a.props.active??c}),!c&&s]},l)})})},OO=({children:e,href:t,active:n,className:r,activeClassName:o,activeElement:i,onClick:s})=>n?i||C.jsx(le,{tag:"span",variant:"body-2",fontWeight:"medium",colorName:"primary",className:T.cx(r,o),onClick:s,children:e}):C.jsx("a",{href:t,className:T.cx(dl.link,r),onClick:s,children:e});Rg.Item=OO;Rg.displayName="Breadcrumbs";const IO=Rg,{color:Qe,cornerRadius:Er,height:wt,transition:N0}=V,DO={primary:{bg:Qe.fill.accentTint,text:Qe.text.accent,icon:Qe.icon.accent},secondary:{bg:Qe.fill.neutralTint,text:Qe.text.secondary,icon:Qe.icon.tertiary},negative:{bg:Qe.fill.negativeTint,text:Qe.text.negative,icon:Qe.icon.negative},positive:{bg:Qe.fill.positiveTint,text:Qe.text.positive,icon:Qe.icon.positive},warning:{bg:Qe.fill.warningTint,text:Qe.text.warning,icon:Qe.icon.warning},neutral:{bg:Qe.fill.neutralTint,text:Qe.text.tertiary,icon:Qe.icon.tertiary},transfer:{bg:"var(--fill-transfer-tint)",text:"var(--text-transfer)",icon:"var(--icon-transfer)"},custom:{bg:Qe.fill.accentTint,text:Qe.text.accent,icon:Qe.icon.accent}},jO={"2xs":{size:wt.avatar["2xs"],borderRadius:Er.xs,iconSize:wt.icon["2xs"],fontSize:10,fontWeight:"var(--fw-medium)"},xs:{size:wt.avatar.xs,borderRadius:Er.sm,iconSize:wt.icon.xs,fontSize:12,fontWeight:"var(--fw-medium)"},sm:{size:wt.avatar.sm,borderRadius:Er.sm,iconSize:wt.icon.xs,fontSize:14,fontWeight:"var(--fw-medium)"},md:{size:wt.avatar.md,borderRadius:Er.sm,iconSize:wt.icon.sm,fontSize:14,fontWeight:"var(--fw-medium)"},lg:{size:wt.avatar.lg,borderRadius:Er.md,iconSize:wt.icon.md,fontSize:16,fontWeight:"var(--fw-semibold)"},xl:{size:wt.avatar.xl,borderRadius:Er.md,iconSize:wt.icon.md,fontSize:16,fontWeight:"var(--fw-semibold)"},"2xl":{size:wt.avatar["2xl"],borderRadius:Er.md,iconSize:wt.icon.md,fontSize:18,fontWeight:"var(--fw-semibold)"},custom:{size:wt.avatar.md,borderRadius:Er.sm,iconSize:wt.icon.sm,fontSize:14,fontWeight:"var(--fw-medium)"}},yS=S.forwardRef(({children:e,color:t="primary",size:n="md",fullRound:r=!1,className:o},i)=>{const s=S.useMemo(()=>DO[t],[t]),a=S.useMemo(()=>jO[n],[n]),l=S.useMemo(()=>T.css({width:a.size,height:a.size,borderRadius:r?"var(--corner-full-round)":a.borderRadius,backgroundColor:s.bg,color:s.text,fontSize:a.fontSize,fontWeight:a.fontWeight,lineHeight:1,transition:N0.general,"& svg":{width:a.iconSize,height:a.iconSize,color:s.icon,transition:N0.general},"& img":{width:"100%",height:"100%",objectFit:"cover"},"&:has(img)":{backgroundColor:"transparent",border:`1px solid ${Qe.border.neutralAlphaLow}`}}),[s,a,r]);return C.jsx(q,{ref:i,center:!0,overflow:"hidden",className:T.cx(l,o),children:e})});yS.displayName="Avatar";const{color:kt,cornerRadius:rd,spacing:fl}=V,Nf={neutral:{border:kt.border.neutralAlphaLow,bg:kt.status.neutralTint,color:kt.text.secondary,colorName:"secondary"},accent:{border:kt.border.accentSecondary,bg:kt.status.accentTintLow,color:kt.text.accent,colorName:"accent"},warning:{border:kt.border.warningSecondary,bg:kt.status.warningTintLow,color:kt.text.warning,colorName:"warning"},positive:{border:kt.border.positiveSecondary,bg:kt.status.positiveTintLow,color:kt.text.positive,colorName:"positive"},negative:{border:kt.border.negativeSecondary,bg:kt.status.negativeTintLow,color:kt.text.negative,colorName:"negative"},transfer:{border:"var(--border-transfer-secondary)",bg:"var(--status-transfer-tint-low)",color:"var(--text-transfer)",colorName:"transfer"}},Xa={sm:{h:24,text:"caption-1",corner:rd.xs,p:`6px ${fl.sm}`},md:{h:32,text:"body-2",corner:rd.sm,p:`6px ${fl.md}`},lg:{h:40,text:"body-2",corner:rd.md,p:`6px ${fl.lg}`}},VO=(e,t,n,r)=>{const o=Nf[t];let i=o.bg,s="none";const a=o.color;switch(e){case"outline":i="transparent",s=`1px solid ${o.border}`;break;case"clear":i="transparent";break;default:i=o.bg;break}return T.css({cursor:n?"not-allowed":r?"pointer":"default",opacity:n?.5:1,userSelect:"none",position:"relative",transition:"background-color 0.2s, opacity 0.2s",backgroundColor:i,color:a,border:s})},BO=T.css({display:"inline-flex",cursor:"pointer",opacity:.6,"&:hover":{opacity:1}}),vS=({label:e,color:t="neutral",size:n="md",variant:r="filled",leftElement:o,rightElement:i,disabled:s,onClick:a,onDelete:l,className:c,labelClassName:u,deleteButtonClassName:f})=>{const d=VO(r,t,s,a);return C.jsxs(q,{row:!0,alignItems:"center",gap:fl.sm,p:Xa[n].p,h:Xa[n].h,overflow:"hidden",borderRadius:Xa[n].corner,onClick:a,className:T.cx(d,c),children:[a&&C.jsx(zo,{}),o,C.jsx(le,{variant:Xa[n].text,colorName:Nf[t].colorName,textOverflow:"ellipsis",className:u,children:e}),i,l&&!s&&C.jsx(le,{className:T.cx(BO,f),colorName:Nf[t].colorName,onClick:h=>{h.stopPropagation(),l(h)},children:C.jsx(WC,{})})]})};vS.displayName="Badge";const zO=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("circle",{cx:12,cy:12,r:10,fill:"currentColor",fillOpacity:.15}),N.createElement("path",{d:"M16 9L10.0337 15L8 12.9548",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),od=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z",fill:"currentColor",fillOpacity:.15}),N.createElement("path",{d:"M12 6C11.4477 6 11 6.44772 11 7V13C11 13.5523 11.4477 14 12 14C12.5523 14 13 13.5523 13 13V7C13 6.44772 12.5523 6 12 6Z",fill:"currentColor"}),N.createElement("path",{d:"M12 15C11.4477 15 11 15.4477 11 16V17C11 17.5523 11.4477 18 12 18C12.5523 18 13 17.5523 13 17V16C13 15.4477 12.5523 15 12 15Z",fill:"currentColor"})),HO=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("circle",{cx:12,cy:12,r:10,fill:"currentColor",fillOpacity:.12}),N.createElement("path",{d:"M16 8L8 16M16 16L8 8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"})),WO=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:"currentColor",...e},N.createElement("path",{d:"M12 2V22M19.0711 4.92893L4.92893 19.0711M22 12H2M19.0711 19.0711L4.92893 4.92893",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),{color:Ke,cornerRadius:KO,spacing:Fs}=V,ai={hint:T.css({display:"flex",alignItems:"flex-start",gap:Fs.md,padding:Fs.lg,minHeight:48,width:"100%",borderRadius:KO.md,transition:"background 0.2s, color 0.2s"}),icon:T.css({flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center","& svg":{width:24,height:24}}),content:T.css({display:"flex",flexDirection:"column",gap:Fs.xs}),title:T.css({verticalAlign:"middle",color:"inherit"}),subtitle:T.css({verticalAlign:"middle",opacity:.8,color:"inherit"}),disabled:T.css({opacity:.5,pointerEvents:"none"})},UO={solid:{warning:T.css({background:Ke.status.warning,color:Ke.text.inverse}),negative:T.css({background:Ke.status.negative,color:Ke.text.inverse}),positive:T.css({background:Ke.status.positive,color:Ke.text.inverse}),accent:T.css({background:Ke.status.accent,color:Ke.text.inverse}),neutral:T.css({background:Ke.status.neutral,color:Ke.text.inverse}),transfer:T.css({background:Ke.status.transfer,color:Ke.text.inverse})},soft:{warning:T.css({background:Ke.status.warningTintLow,color:Ke.text.warning}),negative:T.css({background:Ke.status.negativeTintLow,color:Ke.text.negative}),positive:T.css({background:Ke.status.positiveTintLow,color:Ke.text.positive}),accent:T.css({background:Ke.status.accentTintLow,color:Ke.text.accent}),neutral:T.css({background:Ke.status.neutralTintLow,color:Ke.text.tertiary}),transfer:T.css({background:Ke.status.transferTintLow,color:Ke.text.transfer})}},GO={md:T.css({minHeight:48,padding:Fs.lg}),sm:T.css({minHeight:32,padding:Fs.md})},qO={negative:C.jsx(HO,{}),positive:C.jsx(zO,{}),accent:C.jsx(od,{}),warning:C.jsx(od,{}),transfer:C.jsx(od,{}),neutral:C.jsx(WO,{})},YO=({title:e,subtitle:t,color:n="warning",variant:r="soft",size:o="md",icon:i,disabled:s=!1,className:a,iconClassName:l,contentClassName:c,titleClassName:u,subtitleClassName:f,style:d})=>{const h=i||qO[n];return C.jsxs("div",{className:mo(ai.hint,GO[o],UO[r][n],s&&ai.disabled,a),style:d,"aria-disabled":s,children:[h&&C.jsx("span",{className:mo(ai.icon,l),children:h}),C.jsxs("div",{className:mo(ai.content,c),children:[e&&C.jsx(le,{className:mo(ai.title,u),variant:o==="md"?"body-1":"caption-2",children:e}),t&&C.jsx(le,{className:mo(ai.subtitle,f),variant:o==="md"?"body-2":"caption-1",children:t})]})]})},{color:co,cornerRadius:XO,spacing:On}=V,ZO=T.css({width:"100%",cursor:"default",userSelect:"text",outline:"none",...ye.body2,color:co.text.primary,overflowWrap:"anywhere","p, ul, ol, pre, blockquote, table":{margin:`${On.sm} 0`},"h1, h2, h3, h4, h5, h6":{margin:`${On.md} 0 ${On.sm}`,fontWeight:600},h1:{fontSize:ye.title1.fontSize,lineHeight:ye.title1.lineHeight},h2:{fontSize:ye.title2.fontSize,lineHeight:ye.title2.lineHeight},h3:{fontSize:ye.title3.fontSize,lineHeight:ye.title3.lineHeight},h4:{fontSize:ye.headline2.fontSize,lineHeight:ye.headline2.lineHeight},h5:{fontSize:ye.headline3.fontSize,lineHeight:ye.headline3.lineHeight},h6:{fontSize:ye.body1.fontSize,lineHeight:ye.body1.lineHeight},ul:{paddingLeft:On.xl,listStyleType:"disc"},ol:{paddingLeft:On.xl,listStyleType:"decimal"},li:{margin:`${On.xs} 0`},a:{color:co.text.accent,textDecoration:"underline"},code:{padding:`0 ${On.xs}`,borderRadius:XO.xs,backgroundColor:co.fill.neutralSecondary,fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},"pre code":{display:"block",padding:On.md,overflowX:"auto"},blockquote:{marginLeft:0,paddingLeft:On.md,borderLeft:`3px solid ${co.border.neutralAlphaBasic}`,color:co.text.secondary},table:{width:"100%",borderCollapse:"collapse"},"th, td":{border:`1px solid ${co.border.neutralAlphaBasic}`,padding:On.sm,textAlign:"left"},th:{backgroundColor:co.fill.neutralSecondary}});function JO({markdown:e,className:t,emptyStateClassName:n,emptyState:r=null}){const o=e.trim(),i=S.useMemo(()=>({isEditable:!1,isPreviewMode:!0,setPreviewMode:()=>{},markdownText:o}),[o]);return o?C.jsx(gh.Provider,{value:i,children:C.jsx(Yw,{initialConfig:{...wC(),editable:!1,namespace:"ui-kit-markdown-text-viewer",editorState:()=>{Gw(o,zl)}},children:C.jsx(bC,{contentEditable:C.jsx(vC,{className:T.cx(ZO,t),"aria-placeholder":"markdown text",placeholder:()=>null}),placeholder:null,ErrorBoundary:xC})},o)}):typeof r=="string"?C.jsx(le,{variant:"body-2",colorName:"tertiary",className:n,children:r}):r}const{color:xS,cornerRadius:QO}=V,e5=T.keyframes`
85
+ `),N.createElement("g",{className:"spinner"},N.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.0003 6.83317C13.5692 6.83317 11.2376 7.79894 9.51851 9.51803C7.79943 11.2371 6.83366 13.5687 6.83366 15.9998C6.83366 18.431 7.79943 20.7626 9.51851 22.4817C11.2376 24.2007 13.5692 25.1665 16.0003 25.1665C18.4315 25.1665 20.7631 24.2007 22.4821 22.4817C24.2012 20.7626 25.167 18.431 25.167 15.9998C25.167 13.5687 24.2012 11.2371 22.4821 9.51803C20.7631 7.79894 18.4315 6.83317 16.0003 6.83317ZM3.16699 15.9998C3.16699 8.91217 8.91266 3.1665 16.0003 3.1665C23.088 3.1665 28.8337 8.91217 28.8337 15.9998C28.8337 23.0875 23.088 28.8332 16.0003 28.8332C8.91266 28.8332 3.16699 23.0875 3.16699 15.9998Z",fill:"currentColor",fillOpacity:.12}),N.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.9997 6.83319C13.6363 6.82787 11.3633 7.74068 9.65999 9.37907C9.30711 9.70535 8.84021 9.88001 8.35982 9.86545C7.87943 9.85089 7.42396 9.64827 7.09149 9.30122C6.75902 8.95416 6.57612 8.49043 6.58218 8.00985C6.58823 7.52928 6.78276 7.07031 7.12388 6.73174C9.50956 4.43941 12.6912 3.16143 15.9997 3.16652C16.4859 3.16652 16.9522 3.35967 17.296 3.70349C17.6398 4.04731 17.833 4.51362 17.833 4.99985C17.833 5.48608 17.6398 5.9524 17.296 6.29621C16.9522 6.64003 16.4859 6.83319 15.9997 6.83319Z",fill:"currentColor"}))),gO=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("g",{clipPath:"url(#clip0_2074_3858)"},N.createElement("path",{d:"M21 21L16.65 16.65M19 11C19 15.4183 15.4183 19 11 19C6.58172 19 3 15.4183 3 11C3 6.58172 6.58172 3 11 3C15.4183 3 19 6.58172 19 11Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),N.createElement("defs",null,N.createElement("clipPath",{id:"clip0_2074_3858"},N.createElement("rect",{width:24,height:24,fill:"white"})))),pO={table:T.css({...xe.body2,fontWeight:500})},uS=S.forwardRef(({children:e,className:t,style:n,...r},o)=>C.jsx("td",{ref:o,className:T.cx(t),style:n,...r,children:e}));uS.displayName="TableBodyCell";const{spacing:C0}=V,dS=S.forwardRef(({children:e,row:t=!0,justifyContent:n="flex-start",alignItems:r="center",py:o=C0.sm,px:i=C0.md,minHeight:s="56px",...a},l)=>C.jsx(q,{row:t,justifyContent:n,alignItems:r,py:o,px:i,minHeight:s,ref:l,...a,children:e}));dS.displayName="TableBodyCellContent";const{color:mO}=V,fS=S.forwardRef(({children:e,className:t,showBorders:n=!1,isSelected:r=!1,...o},i)=>{const s=T.css({borderBottom:n?`1px solid ${mO.border.neutralAlphaLow}`:"none"});return C.jsx("tr",{ref:i,className:T.cx(s,t),...o,children:e})});fS.displayName="TableBodyRow";const yO=S.forwardRef(({children:e,className:t,style:n,justifyContent:r="flex-start",alignItems:o="flex-start",...i},s)=>{const a=T.css({justifyContent:r,alignItems:o,fontWeight:"inherit"});return C.jsx("th",{ref:s,className:T.cx(a,t),style:n,...i,children:e})}),{spacing:S0}=V,Rg=S.forwardRef(({children:e,row:t=!0,justifyContent:n="flex-start",alignItems:r="center",py:o=S0.sm,px:i=S0.md,minHeight:s="56px",className:a,center:l,...c},u)=>C.jsx(q,{ref:u,row:t,justifyContent:n,alignItems:r,py:o,px:i,minHeight:s,center:l,className:T.cx(a,T.css({textAlign:l?"center":"left"})),...c,children:e}));Rg.displayName="TableHeadCellContent";const vO=e=>N.createElement("svg",{width:10,height:6,viewBox:"0 0 10 6",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M8.75 0.75L4.75 4.75L0.75 0.75",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),xO=e=>N.createElement("svg",{width:10,height:6,viewBox:"0 0 10 6",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M8.75 4.75L4.75 0.75L0.75 4.75",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),{color:Ya}=V,bO=({sortDirection:e,gap:t="5px",...n})=>C.jsxs(q,{gap:t,...n,children:[C.jsx(xO,{style:{color:e==="asc"?Ya.icon.accent:Ya.icon.tertiary}}),C.jsx(vO,{style:{color:e==="desc"?Ya.icon.accent:Ya.icon.tertiary}})]}),hS=({children:e,tableProps:t,gap:n="10px",...r})=>{const o=t.column.getIsSorted();return C.jsxs(Rg,{style:{cursor:"pointer",userSelect:"none"},gap:n,...r,children:[e,C.jsx(bO,{sortDirection:o})]})};hS.displayName="TableHeadCellContentSortable";const{color:_0}=V,gS=S.forwardRef(({children:e,className:t,showBorders:n=!1,...r},o)=>{const i=T.css({backgroundColor:_0.fill.bgSecondary,borderBottom:n?`1px solid ${_0.border.neutralAlphaLow}`:"none"});return C.jsx("tr",{ref:o,className:T.cx(i,t),...r,children:e})});gS.displayName="TableHeadRow";const T0=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M15 18L9 12L15 6",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),E0=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M9 18L15 12L9 6",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),wO=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M12 13C12.5523 13 13 12.5523 13 12C13 11.4477 12.5523 11 12 11C11.4477 11 11 11.4477 11 12C11 12.5523 11.4477 13 12 13Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),N.createElement("path",{d:"M19 13C19.5523 13 20 12.5523 20 12C20 11.4477 19.5523 11 19 11C18.4477 11 18 11.4477 18 12C18 12.5523 18.4477 13 19 13Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),N.createElement("path",{d:"M5 13C5.55228 13 6 12.5523 6 12C6 11.4477 5.55228 11 5 11C4.44772 11 4 11.4477 4 12C4 12.5523 4.44772 13 5 13Z",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),td=(e,t)=>{const n=t-e+1;return Array.from({length:n},(r,o)=>e+o)};function CO(e){const{count:t=1,page:n,maxVisiblePages:r=10}=e;let o=1,i=1;if(r<=2)return[n];r<=4?(o=0,i=0):r<=6?(o=1,i=0):r<=7?(o=1,i=Math.max(0,Math.floor((r-4)/2))):(o=1,i=Math.max(1,Math.floor((r-5)/2)));const s=td(1,Math.min(o,t)),a=td(Math.max(t-o+1,o+1),t),l=Math.max(Math.min(n-i,t-o-i*2-1),o+2),c=Math.min(Math.max(n+i,o+i*2+2),t-o-1);return[...s,...l>o+2?["start-dots"]:o+1<t-o?[o+1]:[],...td(l,c),...c<t-o-1?["end-dots"]:t-o>o?[t-o]:[],...a]}const{color:si,cornerRadius:SO,spacing:nd}=V,_O=({pageIndex:e,pageSize:t,totalCount:n,onPageChange:r,onPageSizeChange:o,variant:i="numbered",labels:s,pageSizeOptions:a=[10,20,50,100],showPageSizeSelector:l=!0,renderPageSizeSelectorDropdownItem:c=p=>p.label,renderPageSizeSelectorInputItem:u,className:f,itemClassName:d,activeItemClassName:h,pageSizeSelectorClassName:g})=>{const{prev:p="Previous",next:m="Next"}=s??{},v=S.useRef(null),[y,x]=S.useState(0),b=Math.ceil(n/t),w=e>0,_=e<b-1;S.useEffect(()=>{const D=v.current;if(!D)return;const K=new ResizeObserver(I=>{for(const M of I)x(M.contentRect.width)});return K.observe(D),()=>{K.disconnect()}},[]);const R=(D=>{if(D<=0)return 1;const U=D-96;if(U<=40)return 1;const re=Math.floor((U+8)/48);return Math.max(1,Math.min(10,re))})(y),k=CO({page:e+1,count:b,maxVisiblePages:R}),P=()=>{w&&r(e-1)},F=()=>{_&&r(e+1)},$=D=>{o(Number(D))};if(n===0)return null;const j=()=>C.jsxs(q,{ref:v,flex:1,row:!0,overflow:"hidden",gap:nd.sm,children:[C.jsx(pr,{onClick:P,disabled:!w,color:"neutral",size:"sm",children:C.jsx(T0,{})}),C.jsx(q,{row:!0,gap:nd.sm,children:k.map(D=>C.jsx(R0,{isDots:D==="start-dots"||D==="end-dots",isCurrentPage:D===e+1,disabled:D==="start-dots"||D==="end-dots",onClick:()=>r(D-1),className:d,activeClassName:h,children:D},D))}),C.jsx(pr,{color:"neutral",size:"sm",onClick:F,disabled:!_,children:C.jsx(E0,{})})]}),O=()=>C.jsxs(q,{flex:1,row:!0,gap:nd.sm,alignItems:"center",className:f,children:[C.jsx(Br,{width:"auto",size:"sm",color:"neutral",iconLeft:C.jsx(T0,{width:20,height:20}),disabled:!w,onClick:P,children:p}),C.jsx(R0,{className:d,activeClassName:h,children:e+1}),C.jsx(Br,{width:"auto",size:"sm",color:"neutral",iconRight:C.jsx(E0,{width:20,height:20}),disabled:!_,onClick:F,children:m})]});return C.jsxs(q,{flex:1,row:!0,justifyContent:"space-between",children:[i==="simple"?O():j(),l&&C.jsx(q,{alignItems:"flex-end",className:g,children:C.jsx(Sg,{width:"fit-content",value:t.toString(),size:"sm",items:a.map(D=>({value:D.toString(),label:D.toString()})),returnedValue:D=>D.value,renderDropdownItem:c,renderSingleInputItem:u,onChange:D=>$(D)})})]})},R0=({children:e,isCurrentPage:t=!1,onClick:n,isDots:r=!1,disabled:o=!1,className:i,activeClassName:s})=>{const a=T.css({cursor:o?"not-allowed":"pointer",userSelect:"none",width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:t?si.fill.accentSecondary:si.fill.bgSecondary,borderRadius:SO.sm,border:t?`1px solid ${si.fill.accentSecondaryHover}`:`1px solid ${si.border.neutralAlphaBasic}`}),l=T.css({width:"24px",height:"24px",color:t?si.icon.secondary:si.icon.tertiary});return C.jsx(q,{className:T.cx(a,i,t&&s),onClick:o?void 0:n,children:r?C.jsx(wO,{className:l}):C.jsx(le,{center:!0,variant:"body-2",fontWeight:"medium",children:e})})},{color:Nf,cornerRadius:TO}=V,EO=T.css({position:"relative",borderRadius:TO.md,overflow:"hidden","&::before, &::after":{content:'""',position:"absolute",top:0,bottom:14,width:96,pointerEvents:"none",zIndex:1,transition:"opacity 0.2s ease"},"&::before":{left:0,background:"linear-gradient(to left, rgba(255, 255, 255, 0.00) 0%, #FFF 100%)"},"&::after":{right:0,background:"linear-gradient(to right, rgba(255, 255, 255, 0.00) 0%, #FFF 100%)"}}),RO=T.css({overflowX:"auto",scrollbarWidth:"thin",scrollbarColor:`${Nf.scrollbar.thumbPrimary} ${Nf.scrollbar.trackPrimary}`}),pS=S.memo(({data:e,children:t,className:n,scrollContainerClassName:r,showBorders:o=!1,...i})=>{const[s,a]=S.useState(!1),[l,c]=S.useState(!1),u=S.useRef(null),f=S.useCallback(()=>{const h=u.current;if(!h)return;const{scrollLeft:g,scrollWidth:p,clientWidth:m}=h,v=p>m;a(v&&g>0),c(v&&g<p-m-1)},[]);S.useEffect(()=>{const h=u.current;if(!h)return;f();const g=new ResizeObserver(f);return g.observe(h),h.addEventListener("scroll",f),()=>{g.disconnect(),h.removeEventListener("scroll",f)}},[f,e]);const d=T.css({border:o?`1px solid ${Nf.border.neutralAlphaLow}`:"transparent","&::before":{opacity:s?1:0},"&::after":{opacity:l?1:0}});return C.jsx(q,{className:T.cx(EO,d,n),...i,children:C.jsx(q,{ref:u,className:T.cx(RO,r),children:t})})});pS.displayName="TableWrapper";const{spacing:xn,cornerRadius:k0,color:Ys}=V,kO=T.css({width:"100%",maxWidth:"100%",minWidth:"max-content",borderCollapse:"collapse",borderSpacing:0,backgroundColor:Ys.fill.bgPrimary}),AO=T.css({backgroundColor:Ys.fill.bgSecondary,color:Ys.text.tertiary}),ns=({ref:e,data:t,columns:n,showBorders:r=!0,enableSorting:o=!1,enablePagination:i=!1,enableRowSelection:s=!1,enableMultiRowSelection:a=!1,sorting:l,onSortingChange:c,columnFilters:u,onColumnFiltersChange:f,columnVisibility:d,onColumnVisibilityChange:h,pagination:g,onPaginationChange:p,rowSelection:m,onRowSelectionChange:v,totalCount:y,loading:x=!1,emptyLabels:b={title:"Nothing found",description:"No results found for “result”",action:"Reset"},loadingLabels:w={title:"Loading...",description:"Please wait or reset your promt",action:"Reset"},className:_,containerClassName:E,theadClassName:R,tbodyClassName:k,emptyStateClassName:P,emptyStateTitleClassName:F,emptyStateDescriptionClassName:$,paginationClassName:j,tableOptions:O={},onRowClick:D,getRowId:K,headCellComponent:I=yO,bodyCellComponent:M=uS,headRowComponent:H=gS,bodyRowComponent:U=fS,onReset:re,paginationVariant:G,paginationLabels:Y,renderPageSizeSelectorDropdownItem:Q,renderPageSizeSelectorInputItem:ne})=>{const[oe,me]=S.useState([]),[ee,ve]=S.useState([]),[Se,Ee]=S.useState({}),[ze,je]=S.useState({pageIndex:0,pageSize:10}),[Rt,gn]=S.useState({}),ot=l??oe,Gt=u??ee,Qt=d??Se,pt=g??ze,se=m??Rt,Re=Ce=>{const Le=typeof Ce=="function"?Ce(ot):Ce;c?c(Le):me(Le)},Ye=Ce=>{const Le=typeof Ce=="function"?Ce(Gt):Ce;f?f(Le):ve(Le)},rt=Ce=>{const Le=typeof Ce=="function"?Ce(Qt):Ce;h?h(Le):Ee(Le)},It=Ce=>{const Le=typeof Ce=="function"?Ce(pt):Ce;p?p(Le):je(Le)},no=fO({data:t,columns:n,state:{sorting:ot,columnFilters:Gt,columnVisibility:Qt,pagination:pt,rowSelection:se},onSortingChange:Re,onColumnFiltersChange:Ye,onColumnVisibilityChange:rt,onPaginationChange:It,onRowSelectionChange:Ce=>{const Le=typeof Ce=="function"?Ce(se):Ce;v?v(Le):gn(Le)},getCoreRowModel:iO(),getSortedRowModel:o?lO():void 0,getPaginationRowModel:i?aO():void 0,enableRowSelection:s,enableMultiRowSelection:a,getRowId:K,manualPagination:!!y,pageCount:y?Math.ceil(y/pt.pageSize):void 0,...O});S.useImperativeHandle(e,()=>no);const{rows:pa}=no.getRowModel(),qo=(Ce,Le)=>{D&&D(Ce.original,Le)};return x?C.jsxs(q,{w:"full",borderRadius:k0.md,py:xn["5xl"],px:xn["10xl"],alignItems:"center",className:T.cx(E,P),children:[C.jsx(hO,{width:32,height:32,style:{color:Ys.icon.tertiary,marginBottom:xn.sm}}),C.jsx(le,{mb:xn.xs,variant:"title-3",fontWeight:"semibold",className:F,children:w.title}),C.jsx(le,{mb:xn.md,colorName:"tertiary",variant:"body-1",fontWeight:"medium",className:$,children:w.description}),typeof w.action=="string"?C.jsx(Br,{width:"auto",onClick:re,intensity:"secondary",color:"accent",children:w.action}):w.action]}):pa.length?C.jsxs(q,{w:"full",gap:xn.xl,className:T.cx(E),children:[C.jsx(pS,{data:t,showBorders:r,children:C.jsxs("table",{className:T.cx(kO,pO.table,_),children:[C.jsx("thead",{className:T.cx(AO,R),children:no.getHeaderGroups().map(Ce=>C.jsx(H,{showBorders:r,children:Ce.headers.map(Le=>C.jsx(I,{style:{width:Le.getSize()},onClick:Le.column.getToggleSortingHandler(),children:Le.isPlaceholder?null:w0(Le.column.columnDef.header,Le.getContext())},Le.id))},Ce.id))}),C.jsx("tbody",{className:k,children:pa.map((Ce,Le)=>C.jsx(U,{showBorders:r,isSelected:Ce.getIsSelected(),onClick:()=>qo(Ce,Le),children:Ce.getVisibleCells().map(Yo=>C.jsx(M,{children:w0(Yo.column.columnDef.cell,Yo.getContext())},Yo.id))},Ce.id))})]})}),i&&!x&&C.jsx(_O,{pageIndex:pt.pageIndex,pageSize:pt.pageSize,totalCount:y||t.length,variant:G,labels:Y,renderPageSizeSelectorDropdownItem:Q,renderPageSizeSelectorInputItem:ne,onPageChange:Ce=>It({...pt,pageIndex:Ce}),onPageSizeChange:Ce=>It({...pt,pageSize:Ce,pageIndex:0}),className:j})]}):C.jsxs(q,{w:"full",borderRadius:k0.md,py:xn["5xl"],px:xn["10xl"],alignItems:"center",className:T.cx(E,P),children:[C.jsx(gO,{width:24,height:24,style:{color:Ys.icon.tertiary,marginBottom:xn.sm}}),C.jsx(le,{mb:xn.xs,variant:"title-3",fontWeight:"semibold",className:F,children:b.title}),C.jsx(le,{mb:xn.md,colorName:"tertiary",variant:"body-1",fontWeight:"medium",className:$,children:b.description}),typeof b.action=="string"?C.jsx(Br,{width:"auto",onClick:re,intensity:"secondary",color:"accent",children:b.action}):b.action]})};ns.displayName="Table";ns.HeadCellContent=Rg;ns.BodyCellContent=dS;ns.HeadCellContentSortable=hS;ns.createColumnHelper=eS;const{color:rn}=V,rd={chart:{type:"areaspline",backgroundColor:"transparent",spacing:[0,0,0,0],margin:[0,0,0,0]},xAxis:{gridLineWidth:0,lineWidth:0,tickWidth:0,labels:{enabled:!1},title:{text:""}},yAxis:{gridLineWidth:0,lineWidth:0,tickWidth:0,labels:{enabled:!1},title:{text:""}},legend:{enabled:!1},credits:{enabled:!1}},NO={positive:{color:rn.fill.positivePrimary,fillColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,rn.fill.positiveTintHigh],[1,rn.fill.positiveTransparent]]}},negative:{color:rn.fill.negativePrimary,fillColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,rn.fill.negativeTintHigh],[1,rn.fill.negativeTransparent]]}},accent:{color:rn.fill.accentPrimary,fillColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,rn.fill.accentTintHigh],[1,rn.fill.accentTransparent]]}},warning:{color:rn.fill.warningPrimary,fillColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,rn.fill.warningTintHigh],[1,rn.fill.warningTransparent]]}},transfer:{color:"var(--fill-transfer-primary)",fillColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,"var(--fill-transfer-tint-high)"],[1,"var(--fill-transfer-transparent)"]]}}},{color:A0}=V,MO=(e,t,n,r,o)=>({...rd,plotOptions:{areaspline:{marker:{enabled:!1,states:{hover:{enabled:o}}},allowPointSelect:!1}},xAxis:{...rd.xAxis,...n},yAxis:{...rd.yAxis,...r},series:[{type:"areaspline",data:t,...NO[e]}]}),PO=e=>({outside:!0,enabled:!!e,padding:0,position:{alignByTranslate:!0},shadow:{color:A0.effect.shadowM,offsetX:0,offsetY:0},borderRadius:8,backgroundColor:A0.fill.bgPrimary,useHTML:!0,...e}),mS=({color:e="positive",data:t=[],xAxis:n,yAxis:r,containerProps:o,highcharts:i,tooltip:s,className:a,style:l})=>{const c=S.useRef(null);S.useEffect(()=>()=>{typeof c=="object"&&c?.current?.chart&&c.current.chart.destroy()},[]);const u=S.useMemo(()=>MO(e,t,n,r,!!s),[e,t,n,r,s]),f=S.useMemo(()=>s?PO(s):{enabled:!1},[s]),d=S.useMemo(()=>({...o,className:T.cx(o?.className,a),style:{...o?.style,...l}}),[o,a,l]);return C.jsx(hl.Chart,{highcharts:i,ref:c,options:u,containerProps:d,children:C.jsx(hl.Tooltip,{...f})})};mS.displayName="LineChart";const{color:ir}=V,LO={chart:{type:"pie",backgroundColor:"transparent",spacing:[0,0,0,0],margin:[0,0,0,0],events:{click:void 0}},title:{align:"center",verticalAlign:"middle",floating:!0,style:{fontSize:"24px",fontWeight:"600",color:ir.text.primary}},plotOptions:{pie:{allowPointSelect:!0,cursor:"pointer",dataLabels:{enabled:!1},startAngle:90,endAngle:-90,innerSize:"90%",borderWidth:0,states:{hover:{enabled:!1},select:{enabled:!1},inactive:{enabled:!1}},enableMouseTracking:!1}},tooltip:{enabled:!1},legend:{enabled:!1},credits:{enabled:!1}},FO={positive:{colors:[ir.fill.positivePrimary,ir.fill.positiveTintHigh]},negative:{colors:[ir.fill.negativePrimary,ir.fill.negativeTintHigh]},accent:{colors:[ir.fill.accentPrimary,ir.fill.accentTintHigh]},warning:{colors:[ir.fill.warningPrimary,ir.fill.warningTintHigh]},transfer:{colors:["var(--fill-transfer-primary)","var(--fill-transfer-tint-high)"]}},$O=(e,t)=>({...LO,series:[{type:"pie",data:[{name:"",y:Math.min(e,100)},{name:"",y:Math.max(100-e,0)}],...FO[t]}]}),yS=S.forwardRef(({highcharts:e,color:t="positive",percentage:n,label:r=l=>`${l}%`,containerProps:o,className:i,style:s},a)=>{const l=S.useRef(null),c=a||l;S.useEffect(()=>()=>{typeof c=="object"&&c?.current?.chart&&c.current.chart.destroy()},[c]);const u=S.useMemo(()=>$O(n,t),[n,t]),f=S.useMemo(()=>({...o,className:T.cx(o?.className,i),style:{...o?.style,...s}}),[o,i,s]);return C.jsx(hl.Chart,{highcharts:e,ref:c,options:u,containerProps:f,children:C.jsx(hl.Title,{children:r?.(n)})})});yS.displayName="PieProgressChart";const OO=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M9 17L14 12L9 7",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),{color:N0}=V,dl={link:T.css({...xe.body2,color:N0.text.tertiary,textDecoration:"none",transition:"color 0.2s ease","&:hover":{textDecoration:"underline"}}),separator:T.css({color:N0.icon.tertiary}),nav:T.css({display:"flex",alignItems:"center",flexWrap:"wrap"}),navItem:T.css({display:"inline-flex",alignItems:"center"})},kg=({children:e,separator:t,className:n,itemClassName:r,separatorClassName:o})=>{const i=S.Children.toArray(e).filter(a=>S.isValidElement(a)),s=t??C.jsx(OO,{className:T.cx(dl.separator,o)});return C.jsx("nav",{"aria-label":"breadcrumb",className:T.cx(dl.nav,n),children:i.map((a,l)=>{const c=l===i.length-1;return C.jsxs(le,{tag:"span",className:T.cx(dl.navItem,r),children:[S.cloneElement(a,{active:a.props.active??c}),!c&&s]},l)})})},IO=({children:e,href:t,active:n,className:r,activeClassName:o,activeElement:i,onClick:s})=>n?i||C.jsx(le,{tag:"span",variant:"body-2",fontWeight:"medium",colorName:"primary",className:T.cx(r,o),onClick:s,children:e}):C.jsx("a",{href:t,className:T.cx(dl.link,r),onClick:s,children:e});kg.Item=IO;kg.displayName="Breadcrumbs";const DO=kg,{color:Qe,cornerRadius:Er,height:wt,transition:M0}=V,jO={primary:{bg:Qe.fill.accentTint,text:Qe.text.accent,icon:Qe.icon.accent},secondary:{bg:Qe.fill.neutralTint,text:Qe.text.secondary,icon:Qe.icon.tertiary},negative:{bg:Qe.fill.negativeTint,text:Qe.text.negative,icon:Qe.icon.negative},positive:{bg:Qe.fill.positiveTint,text:Qe.text.positive,icon:Qe.icon.positive},warning:{bg:Qe.fill.warningTint,text:Qe.text.warning,icon:Qe.icon.warning},neutral:{bg:Qe.fill.neutralTint,text:Qe.text.tertiary,icon:Qe.icon.tertiary},transfer:{bg:"var(--fill-transfer-tint)",text:"var(--text-transfer)",icon:"var(--icon-transfer)"},custom:{bg:Qe.fill.accentTint,text:Qe.text.accent,icon:Qe.icon.accent}},VO={"2xs":{size:wt.avatar["2xs"],borderRadius:Er.xs,iconSize:wt.icon["2xs"],fontSize:10,fontWeight:"var(--fw-medium)"},xs:{size:wt.avatar.xs,borderRadius:Er.sm,iconSize:wt.icon.xs,fontSize:12,fontWeight:"var(--fw-medium)"},sm:{size:wt.avatar.sm,borderRadius:Er.sm,iconSize:wt.icon.xs,fontSize:14,fontWeight:"var(--fw-medium)"},md:{size:wt.avatar.md,borderRadius:Er.sm,iconSize:wt.icon.sm,fontSize:14,fontWeight:"var(--fw-medium)"},lg:{size:wt.avatar.lg,borderRadius:Er.md,iconSize:wt.icon.md,fontSize:16,fontWeight:"var(--fw-semibold)"},xl:{size:wt.avatar.xl,borderRadius:Er.md,iconSize:wt.icon.md,fontSize:16,fontWeight:"var(--fw-semibold)"},"2xl":{size:wt.avatar["2xl"],borderRadius:Er.md,iconSize:wt.icon.md,fontSize:18,fontWeight:"var(--fw-semibold)"},custom:{size:wt.avatar.md,borderRadius:Er.sm,iconSize:wt.icon.sm,fontSize:14,fontWeight:"var(--fw-medium)"}},vS=S.forwardRef(({children:e,color:t="primary",size:n="md",fullRound:r=!1,className:o},i)=>{const s=S.useMemo(()=>jO[t],[t]),a=S.useMemo(()=>VO[n],[n]),l=S.useMemo(()=>T.css({width:a.size,height:a.size,borderRadius:r?"var(--corner-full-round)":a.borderRadius,backgroundColor:s.bg,color:s.text,fontSize:a.fontSize,fontWeight:a.fontWeight,lineHeight:1,transition:M0.general,"& svg":{width:a.iconSize,height:a.iconSize,color:s.icon,transition:M0.general},"& img":{width:"100%",height:"100%",objectFit:"cover"},"&:has(img)":{backgroundColor:"transparent",border:`1px solid ${Qe.border.neutralAlphaLow}`}}),[s,a,r]);return C.jsx(q,{ref:i,center:!0,overflow:"hidden",className:T.cx(l,o),children:e})});vS.displayName="Avatar";const{color:kt,cornerRadius:od,spacing:fl}=V,Mf={neutral:{border:kt.border.neutralAlphaLow,bg:kt.status.neutralTint,color:kt.text.secondary,colorName:"secondary"},accent:{border:kt.border.accentSecondary,bg:kt.status.accentTintLow,color:kt.text.accent,colorName:"accent"},warning:{border:kt.border.warningSecondary,bg:kt.status.warningTintLow,color:kt.text.warning,colorName:"warning"},positive:{border:kt.border.positiveSecondary,bg:kt.status.positiveTintLow,color:kt.text.positive,colorName:"positive"},negative:{border:kt.border.negativeSecondary,bg:kt.status.negativeTintLow,color:kt.text.negative,colorName:"negative"},transfer:{border:"var(--border-transfer-secondary)",bg:"var(--status-transfer-tint-low)",color:"var(--text-transfer)",colorName:"transfer"}},Xa={sm:{h:24,text:"caption-1",corner:od.xs,p:`6px ${fl.sm}`},md:{h:32,text:"body-2",corner:od.sm,p:`6px ${fl.md}`},lg:{h:40,text:"body-2",corner:od.md,p:`6px ${fl.lg}`}},BO=(e,t,n,r)=>{const o=Mf[t];let i=o.bg,s="none";const a=o.color;switch(e){case"outline":i="transparent",s=`1px solid ${o.border}`;break;case"clear":i="transparent";break;default:i=o.bg;break}return T.css({cursor:n?"not-allowed":r?"pointer":"default",opacity:n?.5:1,userSelect:"none",position:"relative",transition:"background-color 0.2s, opacity 0.2s",backgroundColor:i,color:a,border:s})},zO=T.css({display:"inline-flex",cursor:"pointer",opacity:.6,"&:hover":{opacity:1}}),P0=T.css({display:"inline-flex",alignItems:"center",color:"inherit"}),xS=({label:e,color:t="neutral",size:n="md",variant:r="filled",width:o,leftElement:i,rightElement:s,disabled:a,onClick:l,onDelete:c,className:u,labelClassName:f,deleteButtonClassName:d})=>{const h=BO(r,t,a,l);return C.jsxs(q,{row:!0,alignItems:"center",gap:fl.sm,p:Xa[n].p,h:Xa[n].h,w:o,overflow:"hidden",borderRadius:Xa[n].corner,onClick:l,className:T.cx(h,u),children:[l&&C.jsx(zo,{}),i&&C.jsx("span",{className:P0,children:i}),C.jsx(le,{variant:Xa[n].text,colorName:Mf[t].colorName,textOverflow:"ellipsis",className:f,children:e}),s&&C.jsx("span",{className:P0,children:s}),c&&!a&&C.jsx(le,{className:T.cx(zO,d),colorName:Mf[t].colorName,onClick:g=>{g.stopPropagation(),c(g)},children:C.jsx(KC,{})})]})};xS.displayName="Badge";const HO=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("circle",{cx:12,cy:12,r:10,fill:"currentColor",fillOpacity:.15}),N.createElement("path",{d:"M16 9L10.0337 15L8 12.9548",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),id=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z",fill:"currentColor",fillOpacity:.15}),N.createElement("path",{d:"M12 6C11.4477 6 11 6.44772 11 7V13C11 13.5523 11.4477 14 12 14C12.5523 14 13 13.5523 13 13V7C13 6.44772 12.5523 6 12 6Z",fill:"currentColor"}),N.createElement("path",{d:"M12 15C11.4477 15 11 15.4477 11 16V17C11 17.5523 11.4477 18 12 18C12.5523 18 13 17.5523 13 17V16C13 15.4477 12.5523 15 12 15Z",fill:"currentColor"})),WO=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("circle",{cx:12,cy:12,r:10,fill:"currentColor",fillOpacity:.12}),N.createElement("path",{d:"M16 8L8 16M16 16L8 8",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round"})),KO=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",color:"currentColor",...e},N.createElement("path",{d:"M12 2V22M19.0711 4.92893L4.92893 19.0711M22 12H2M19.0711 19.0711L4.92893 4.92893",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})),{color:Ke,cornerRadius:UO,spacing:Fs}=V,ai={hint:T.css({display:"flex",alignItems:"flex-start",gap:Fs.md,padding:Fs.lg,minHeight:48,width:"100%",borderRadius:UO.md,transition:"background 0.2s, color 0.2s"}),icon:T.css({flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center","& svg":{width:24,height:24}}),content:T.css({display:"flex",flexDirection:"column",gap:Fs.xs}),title:T.css({verticalAlign:"middle",color:"inherit"}),subtitle:T.css({verticalAlign:"middle",opacity:.8,color:"inherit"}),disabled:T.css({opacity:.5,pointerEvents:"none"})},GO={solid:{warning:T.css({background:Ke.status.warning,color:Ke.text.inverse}),negative:T.css({background:Ke.status.negative,color:Ke.text.inverse}),positive:T.css({background:Ke.status.positive,color:Ke.text.inverse}),accent:T.css({background:Ke.status.accent,color:Ke.text.inverse}),neutral:T.css({background:Ke.status.neutral,color:Ke.text.inverse}),transfer:T.css({background:Ke.status.transfer,color:Ke.text.inverse})},soft:{warning:T.css({background:Ke.status.warningTintLow,color:Ke.text.warning}),negative:T.css({background:Ke.status.negativeTintLow,color:Ke.text.negative}),positive:T.css({background:Ke.status.positiveTintLow,color:Ke.text.positive}),accent:T.css({background:Ke.status.accentTintLow,color:Ke.text.accent}),neutral:T.css({background:Ke.status.neutralTintLow,color:Ke.text.tertiary}),transfer:T.css({background:Ke.status.transferTintLow,color:Ke.text.transfer})}},qO={md:T.css({minHeight:48,padding:Fs.lg}),sm:T.css({minHeight:32,padding:Fs.md})},YO={negative:C.jsx(WO,{}),positive:C.jsx(HO,{}),accent:C.jsx(id,{}),warning:C.jsx(id,{}),transfer:C.jsx(id,{}),neutral:C.jsx(KO,{})},XO=({title:e,subtitle:t,color:n="warning",variant:r="soft",size:o="md",icon:i,disabled:s=!1,className:a,iconClassName:l,contentClassName:c,titleClassName:u,subtitleClassName:f,style:d})=>{const h=i||YO[n];return C.jsxs("div",{className:mo(ai.hint,qO[o],GO[r][n],s&&ai.disabled,a),style:d,"aria-disabled":s,children:[h&&C.jsx("span",{className:mo(ai.icon,l),children:h}),C.jsxs("div",{className:mo(ai.content,c),children:[e&&C.jsx(le,{className:mo(ai.title,u),variant:o==="md"?"body-1":"caption-2",children:e}),t&&C.jsx(le,{className:mo(ai.subtitle,f),variant:o==="md"?"body-2":"caption-1",children:t})]})]})},{color:co,cornerRadius:ZO,spacing:On}=V,JO=T.css({width:"100%",cursor:"default",userSelect:"text",outline:"none",...xe.body2,color:co.text.primary,overflowWrap:"anywhere","p, ul, ol, pre, blockquote, table":{margin:`${On.sm} 0`},"h1, h2, h3, h4, h5, h6":{margin:`${On.md} 0 ${On.sm}`,fontWeight:600},h1:{fontSize:xe.title1.fontSize,lineHeight:xe.title1.lineHeight},h2:{fontSize:xe.title2.fontSize,lineHeight:xe.title2.lineHeight},h3:{fontSize:xe.title3.fontSize,lineHeight:xe.title3.lineHeight},h4:{fontSize:xe.headline2.fontSize,lineHeight:xe.headline2.lineHeight},h5:{fontSize:xe.headline3.fontSize,lineHeight:xe.headline3.lineHeight},h6:{fontSize:xe.body1.fontSize,lineHeight:xe.body1.lineHeight},ul:{paddingLeft:On.xl,listStyleType:"disc"},ol:{paddingLeft:On.xl,listStyleType:"decimal"},li:{margin:`${On.xs} 0`},a:{color:co.text.accent,textDecoration:"underline"},code:{padding:`0 ${On.xs}`,borderRadius:ZO.xs,backgroundColor:co.fill.neutralSecondary,fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},"pre code":{display:"block",padding:On.md,overflowX:"auto"},blockquote:{marginLeft:0,paddingLeft:On.md,borderLeft:`3px solid ${co.border.neutralAlphaBasic}`,color:co.text.secondary},table:{width:"100%",borderCollapse:"collapse"},"th, td":{border:`1px solid ${co.border.neutralAlphaBasic}`,padding:On.sm,textAlign:"left"},th:{backgroundColor:co.fill.neutralSecondary}});function QO({markdown:e,className:t,emptyStateClassName:n,emptyState:r=null}){const o=e.trim(),i=S.useMemo(()=>({isEditable:!1,isPreviewMode:!0,setPreviewMode:()=>{},markdownText:o}),[o]);return o?C.jsx(kh.Provider,{value:i,children:C.jsx(gC,{initialConfig:{...VC(),editable:!1,namespace:"ui-kit-markdown-text-viewer",editorState:()=>{fC(o,Gl)}},children:C.jsx(jC,{contentEditable:C.jsx(IC,{className:T.cx(JO,t),"aria-placeholder":"markdown text",placeholder:()=>null}),placeholder:null,ErrorBoundary:DC})},o)}):typeof r=="string"?C.jsx(le,{variant:"body-2",colorName:"tertiary",className:n,children:r}):r}const{color:bS,cornerRadius:e5}=V,t5=T.keyframes`
86
86
  from {
87
87
  opacity: 0;
88
88
  }
89
89
  to {
90
90
  opacity: 1;
91
91
  }
92
- `,t5=T.css({animation:`${e5} 0.2s ease-out`,boxShadow:`0 4px 20px 0 ${xS.effect.shadowS}`}),n5=({children:e,className:t,...n})=>C.jsx(q,{relative:!0,backgroundColor:xS.fill.bgPrimary,borderRadius:QO.md,className:T.cx(t5,t),...n,children:e}),Or=({children:e,content:t,initialOpen:n=!1,open:r,onChange:o,placement:i="bottom",trigger:s="click",offset:a=12,closeOnBackdropClick:l=!0,closeOnEsc:c=!0,className:u,contentClassName:f,backdropClassName:d,style:h,openDelay:g=200,closeDelay:p=200,zIndex:m=1,popoverContentComponent:v=n5})=>{const[y,x]=S.useState(n),b=r??y,w=o??x,_=S.useCallback(()=>{l&&w(!1)},[l,w]),{context:E,refs:R,floatingStyles:k}=bg({placement:i,open:b,onOpenChange:w,whileElementsMounted:hg,middleware:[gg(a),mg({crossAxis:i.includes("-"),fallbackAxisSideDirection:i.includes("start")?"start":"end",padding:a}),pg({padding:a})]}),M=VF(E,{enabled:s==="click"}),F=VC(E,{enabled:s==="hover",delay:{open:g,close:p}}),D=BC(E,{escapeKey:c,outsidePress:!1}),j=HC(E),I=zC([M,F,D,j]),$=e.ref,H=DC([R.setReference,$]),O=S.cloneElement(e,I.getReferenceProps({...e.props,ref:H,"data-state":E.open?"open":"closed"}));return C.jsxs(C.Fragment,{children:[O,b&&C.jsxs(ts,{children:[s!=="hover"&&l&&C.jsx(q,{position:"fixed",top:0,right:0,bottom:0,left:0,display:"block",backgroundColor:"transparent",onClick:_,zIndex:m,className:d}),C.jsx(q,{absolute:!0,zIndex:m,className:u,ref:R.setFloating,style:{...k,...h},...I.getFloatingProps(),children:C.jsx(v,{className:f,children:t})})]})]})},{color:r5,cornerRadius:Mt,spacing:o5}=V,M0={xs:{width:16,height:16},sm:{width:24,height:24},md:{width:32,height:32},lg:{width:40,height:40},xl:{width:48,height:48}},i5={zero:Mt.zero,xs:Mt.xs,sm:Mt.sm,md:Mt.md,lg:Mt.lg,xl:Mt.xl,"2xl":Mt["2xl"],"3xl":Mt["3xl"],"4xl":Mt["4xl"],"5xl":Mt["5xl"],"6xl":Mt["6xl"],"full-round":Mt.fullRound,circular:"50%"},P0=T.css({backgroundColor:r5.status.neutralTint,borderRadius:Mt.sm,position:"relative",overflow:"hidden","&::before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,background:"linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent)",transform:"translateX(-100%)"}}),s5=T.css({animation:"skeleton-pulse 1.5s ease-in-out infinite","@keyframes skeleton-pulse":{"0%":{opacity:1},"50%":{opacity:.4},"100%":{opacity:1}}}),a5=T.css({"&::before":{animation:"skeleton-wave 1.6s linear infinite"},"@keyframes skeleton-wave":{"0%":{transform:"translateX(-100%)"},"50%":{transform:"translateX(100%)"},"100%":{transform:"translateX(100%)"}}}),L0=(e,t)=>{if(t!==void 0)return T.css({borderRadius:i5[t]});switch(e){case"circular":return T.css({borderRadius:"50%"});case"text":return T.css({borderRadius:Mt.xs});default:return T.css({borderRadius:Mt.sm})}},F0=e=>{switch(e){case"pulse":return s5;case"wave":return a5;default:return""}},bS=({width:e,height:t,variant:n="rectangular",size:r="md",animation:o="wave",lines:i=1,className:s,lineClassName:a,children:l,loading:c=!0,borderRadius:u})=>{if(!c&&l)return C.jsx(C.Fragment,{children:l});if(!c)return null;const f=e||M0[r].width,d=t||M0[r].height;return n==="text"&&i>1?C.jsx(q,{gap:o5.sm,className:s,children:Array.from({length:i},(h,g)=>C.jsx(q,{className:T.cx(P0,L0(n,u),F0(o),a),w:g===i-1?"70%":f,h:d},g))}):C.jsx(q,{className:T.cx(P0,L0(n,u),F0(o),s),w:f,h:d})};bS.displayName="Skeleton";const $0=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M11.9998 8.99999V13M11.9998 17H12.0098M10.6151 3.89171L2.39019 18.0983C1.93398 18.8863 1.70588 19.2803 1.73959 19.6037C1.769 19.8857 1.91677 20.142 2.14613 20.3088C2.40908 20.5 2.86435 20.5 3.77487 20.5H20.2246C21.1352 20.5 21.5904 20.5 21.8534 20.3088C22.0827 20.142 22.2305 19.8857 22.2599 19.6037C22.2936 19.2803 22.0655 18.8863 21.6093 18.0983L13.3844 3.89171C12.9299 3.10654 12.7026 2.71396 12.4061 2.58211C12.1474 2.4671 11.8521 2.4671 11.5935 2.58211C11.2969 2.71396 11.0696 3.10655 10.6151 3.89171Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),O0=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M7.5 12L10.5 15L16.5 9M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),l5=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M12 16V12M12 8H12.01M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),c5=e=>N.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M17 7L7 17M7 7L17 17",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),u5={positive:C.jsx(O0,{}),negative:C.jsx($0,{}),warning:C.jsx($0,{}),info:C.jsx(l5,{}),neutral:C.jsx(O0,{})},d5=T.css({boxShadow:`0 4px 20px 0 ${V.color.effect.shadowM}`}),f5=T.css({cursor:"pointer","&:hover":{opacity:.8}}),wS=S.forwardRef(({title:e,subtitle:t,icon:n,variant:r="neutral",w:o="full",onClose:i,className:s,iconBoxClassName:a,titleClassName:l,subtitleClassName:c,closeIconClassName:u,...f},d)=>{const h=S.useMemo(()=>r==="neutral"||r==="info"?V.color.icon.accent:r==="positive"?V.color.icon.positive:r==="negative"?V.color.icon.negative:r==="warning"?V.color.icon.warning:V.color.icon.inverse,[r]),g=S.useMemo(()=>r==="neutral"?V.color.icon.tertiary:V.color.icon.inverse,[r]),p=S.useMemo(()=>r==="neutral"?V.color.fill.accentSecondary:V.color.fill.bgPrimary,[r]),m=S.useMemo(()=>r==="neutral"?V.color.fill.bgPrimary:r==="info"?V.color.fill.accentPrimary:r==="positive"?V.color.fill.positivePrimary:r==="negative"?V.color.fill.negativePrimary:r==="warning"?V.color.fill.warningPrimary:V.color.fill.accentPrimary,[r]),v=S.useMemo(()=>r==="neutral"?V.color.text.primary:V.color.text.primaryInverse,[r]),y=S.useMemo(()=>r==="neutral"?V.color.text.tertiaryInverse:V.color.text.primaryInverse,[r]);return C.jsxs(q,{row:!0,w:o,ref:d,p:V.spacing.md,gap:V.spacing.md,backgroundColor:m,borderRadius:V.cornerRadius.lg,className:T.cx(d5,s),...f,children:[C.jsx(q,{w:48,h:48,center:!0,backgroundColor:p,borderRadius:V.cornerRadius.md,style:{color:h},className:a,children:n||u5[r]}),C.jsxs(q,{flex:1,children:[C.jsx(le,{variant:"body-1",fontWeight:"semibold",color:v,className:l,children:e}),t&&C.jsx(le,{variant:"body-2",fontWeight:"medium",color:y,className:c,children:t})]}),C.jsx(q,{onClick:i,children:C.jsx(c5,{width:24,height:24,color:g,className:T.cx(f5,u)})})]})});let li=[];const Mf=new Set,ys=new Map;function id(){for(const e of Mf)e()}function h5(){return Math.random().toString(36).slice(2,9)}const _n={getSnapshot(){return li},subscribe(e){return Mf.add(e),()=>Mf.delete(e)},add(e){const t=e.id??h5(),n=e.duration??5e3;if(li=[...li,{...e,id:t,duration:n}],id(),n>0){const r=setTimeout(()=>_n.remove(t),n);ys.set(t,r)}return t},remove(e){const t=ys.get(e);t&&(clearTimeout(t),ys.delete(e)),li=li.filter(n=>n.id!==e),id()},removeAll(){for(const[,e]of ys)clearTimeout(e);ys.clear(),li=[],id()}};class g5{show(t){return _n.add(t)}dismiss(t){_n.remove(t)}dismissAll(){_n.removeAll()}success(t,n){return this.show({...n,title:t,variant:"positive"})}error(t,n){return this.show({...n,title:t,variant:"negative"})}warning(t,n){return this.show({...n,title:t,variant:"warning"})}info(t,n){return this.show({...n,title:t,variant:"info"})}}const kr=new g5;function p5(){return{toasts:S.useSyncExternalStore(_n.subscribe,_n.getSnapshot,_n.getSnapshot),show:kr.show,success:kr.success,error:kr.error,warning:kr.warning,info:kr.info,dismiss:kr.dismiss,dismissAll:kr.dismissAll}}const m5={"top-left":{top:16,left:16,alignItems:"flex-start"},"top-center":{top:16,left:"50%",transform:"translateX(-50%)",alignItems:"center"},"top-right":{top:16,right:16,alignItems:"flex-end"},"bottom-left":{bottom:16,left:16,alignItems:"flex-start"},"bottom-center":{bottom:16,left:"50%",transform:"translateX(-50%)",alignItems:"center"},"bottom-right":{bottom:16,right:16,alignItems:"flex-end"}},y5=e=>{const t=e.startsWith("top"),n=e.endsWith("left"),r=e.endsWith("right"),o=e.endsWith("center"),i=n?-40:r?40:0;return{initial:{opacity:0,x:i,y:t?-16:16,scale:.95},animate:{opacity:1,x:0,y:0,scale:1},exit:{opacity:0,x:i,scale:.95,transition:{duration:.15}}}},v5=T.css({position:"fixed",zIndex:2,display:"flex",flexDirection:"column",gap:8,pointerEvents:"none",maxWidth:325,width:"100%"}),x5=T.css({pointerEvents:"auto",width:"100%"});function CS({position:e="top-right",className:t,itemClassName:n,toastClassName:r}){const o=S.useSyncExternalStore(_n.subscribe,_n.getSnapshot,_n.getSnapshot),i=y5(e);return C.jsx(ts,{children:C.jsx("div",{className:T.cx(v5,t),style:m5[e],children:C.jsx(Dx,{initial:!1,children:o.map(s=>C.jsx(ea.div,{className:T.cx(x5,n),layout:!0,initial:i.initial,animate:i.animate,exit:i.exit,transition:{type:"spring",stiffness:400,damping:30},children:C.jsx(wS,{title:s.title,subtitle:s.subtitle,icon:s.icon,variant:s.variant,onClose:()=>_n.remove(s.id),className:r})},s.id))})})})}const{color:Za}=V,b5={top:"polygon(100% 0%, 50% 100%, 0% 0%)",bottom:"polygon(0% 100%, 50% 0%, 100% 100%)","top-start":"polygon(0% 0%, 0% 100%, 100% 0%)","top-end":"polygon(100% 0%, 100% 100%, 0% 0%)","bottom-start":"polygon(0% 100%, 0% 0%, 100% 100%)","bottom-end":"polygon(100% 100%, 100% 0%, 0% 100%)",left:"polygon(0% 100%, 100% 50%, 0% 0%)",right:"polygon(100% 100%, 0% 50%, 100% 0%)"},w5=10,C5=6,Ja=1,I0={primary:{backgroundColor:Za.fill.bgPrimary,color:Za.text.primary},inverse:{backgroundColor:Za.fill.bgPrimaryInverse,color:Za.text.primaryInverse}},S5=(e,t)=>(e==="top"||e==="bottom")&&t?`${e}-${t}`:e,_5=(e,t,n)=>n?(e==="top"||e==="bottom")&&t?{[e==="top"?t==="start"?"borderBottomLeftRadius":"borderBottomRightRadius":t==="start"?"borderTopLeftRadius":"borderTopRightRadius"]:0}:{}:{},T5=(e,t,n)=>e==="left"||e==="right"?{width:6,height:n}:t?{width:8,height:6}:{width:n,height:6},E5=(e,t,n)=>e?(t==="top"||t==="bottom")&&n?{x:n==="start"?0:void 0,y:e.y}:{x:e.x,y:e.y}:{x:void 0,y:void 0},{color:R5,cornerRadius:k5,spacing:A5}=V,N5=T.keyframes`
92
+ `,n5=T.css({animation:`${t5} 0.2s ease-out`,boxShadow:`0 4px 20px 0 ${bS.effect.shadowS}`}),r5=({children:e,className:t,...n})=>C.jsx(q,{relative:!0,backgroundColor:bS.fill.bgPrimary,borderRadius:e5.md,className:T.cx(n5,t),...n,children:e}),Or=({children:e,content:t,initialOpen:n=!1,open:r,onChange:o,placement:i="bottom",trigger:s="click",offset:a=12,closeOnBackdropClick:l=!0,closeOnEsc:c=!0,className:u,contentClassName:f,backdropClassName:d,style:h,openDelay:g=200,closeDelay:p=200,zIndex:m=1,popoverContentComponent:v=r5})=>{const[y,x]=S.useState(n),b=r??y,w=o??x,_=S.useCallback(()=>{l&&w(!1)},[l,w]),{context:E,refs:R,floatingStyles:k}=Rh({placement:i,open:b,onOpenChange:w,whileElementsMounted:bh,middleware:[wh(a),Sh({crossAxis:i.includes("-"),fallbackAxisSideDirection:i.includes("start")?"start":"end",padding:a}),Ch({padding:a})]}),P=hA(E,{enabled:s==="click"}),F=B1(E,{enabled:s==="hover",delay:{open:g,close:p}}),$=z1(E,{escapeKey:c,outsidePress:!1}),j=W1(E),O=H1([P,F,$,j]),D=e.ref,K=_l([R.setReference,D]),I=S.cloneElement(e,O.getReferenceProps({...e.props,ref:K,"data-state":E.open?"open":"closed"}));return C.jsxs(C.Fragment,{children:[I,b&&C.jsxs(ts,{children:[s!=="hover"&&l&&C.jsx(q,{position:"fixed",top:0,right:0,bottom:0,left:0,display:"block",backgroundColor:"transparent",onClick:_,zIndex:m,className:d}),C.jsx(q,{absolute:!0,zIndex:m,className:u,ref:R.setFloating,style:{...k,...h},...O.getFloatingProps(),children:C.jsx(v,{className:f,children:t})})]})]})},{color:o5,cornerRadius:Mt,spacing:i5}=V,L0={xs:{width:16,height:16},sm:{width:24,height:24},md:{width:32,height:32},lg:{width:40,height:40},xl:{width:48,height:48}},s5={zero:Mt.zero,xs:Mt.xs,sm:Mt.sm,md:Mt.md,lg:Mt.lg,xl:Mt.xl,"2xl":Mt["2xl"],"3xl":Mt["3xl"],"4xl":Mt["4xl"],"5xl":Mt["5xl"],"6xl":Mt["6xl"],"full-round":Mt.fullRound,circular:"50%"},F0=T.css({backgroundColor:o5.status.neutralTint,borderRadius:Mt.sm,position:"relative",overflow:"hidden","&::before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,background:"linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent)",transform:"translateX(-100%)"}}),a5=T.css({animation:"skeleton-pulse 1.5s ease-in-out infinite","@keyframes skeleton-pulse":{"0%":{opacity:1},"50%":{opacity:.4},"100%":{opacity:1}}}),l5=T.css({"&::before":{animation:"skeleton-wave 1.6s linear infinite"},"@keyframes skeleton-wave":{"0%":{transform:"translateX(-100%)"},"50%":{transform:"translateX(100%)"},"100%":{transform:"translateX(100%)"}}}),$0=(e,t)=>{if(t!==void 0)return T.css({borderRadius:s5[t]});switch(e){case"circular":return T.css({borderRadius:"50%"});case"text":return T.css({borderRadius:Mt.xs});default:return T.css({borderRadius:Mt.sm})}},O0=e=>{switch(e){case"pulse":return a5;case"wave":return l5;default:return""}},wS=({width:e,height:t,variant:n="rectangular",size:r="md",animation:o="wave",lines:i=1,className:s,lineClassName:a,children:l,loading:c=!0,borderRadius:u})=>{if(!c&&l)return C.jsx(C.Fragment,{children:l});if(!c)return null;const f=e||L0[r].width,d=t||L0[r].height;return n==="text"&&i>1?C.jsx(q,{gap:i5.sm,className:s,children:Array.from({length:i},(h,g)=>C.jsx(q,{className:T.cx(F0,$0(n,u),O0(o),a),w:g===i-1?"70%":f,h:d},g))}):C.jsx(q,{className:T.cx(F0,$0(n,u),O0(o),s),w:f,h:d})};wS.displayName="Skeleton";const I0=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M11.9998 8.99999V13M11.9998 17H12.0098M10.6151 3.89171L2.39019 18.0983C1.93398 18.8863 1.70588 19.2803 1.73959 19.6037C1.769 19.8857 1.91677 20.142 2.14613 20.3088C2.40908 20.5 2.86435 20.5 3.77487 20.5H20.2246C21.1352 20.5 21.5904 20.5 21.8534 20.3088C22.0827 20.142 22.2305 19.8857 22.2599 19.6037C22.2936 19.2803 22.0655 18.8863 21.6093 18.0983L13.3844 3.89171C12.9299 3.10654 12.7026 2.71396 12.4061 2.58211C12.1474 2.4671 11.8521 2.4671 11.5935 2.58211C11.2969 2.71396 11.0696 3.10655 10.6151 3.89171Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),D0=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M7.5 12L10.5 15L16.5 9M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),c5=e=>N.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M12 16V12M12 8H12.01M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),u5=e=>N.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},N.createElement("path",{d:"M17 7L7 17M7 7L17 17",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),d5={positive:C.jsx(D0,{}),negative:C.jsx(I0,{}),warning:C.jsx(I0,{}),info:C.jsx(c5,{}),neutral:C.jsx(D0,{})},f5=T.css({boxShadow:`0 4px 20px 0 ${V.color.effect.shadowM}`}),h5=T.css({cursor:"pointer","&:hover":{opacity:.8}}),CS=S.forwardRef(({title:e,subtitle:t,icon:n,variant:r="neutral",w:o="full",onClose:i,className:s,iconBoxClassName:a,titleClassName:l,subtitleClassName:c,closeIconClassName:u,...f},d)=>{const h=S.useMemo(()=>r==="neutral"||r==="info"?V.color.icon.accent:r==="positive"?V.color.icon.positive:r==="negative"?V.color.icon.negative:r==="warning"?V.color.icon.warning:V.color.icon.inverse,[r]),g=S.useMemo(()=>r==="neutral"?V.color.icon.tertiary:V.color.icon.inverse,[r]),p=S.useMemo(()=>r==="neutral"?V.color.fill.accentSecondary:V.color.fill.bgPrimary,[r]),m=S.useMemo(()=>r==="neutral"?V.color.fill.bgPrimary:r==="info"?V.color.fill.accentPrimary:r==="positive"?V.color.fill.positivePrimary:r==="negative"?V.color.fill.negativePrimary:r==="warning"?V.color.fill.warningPrimary:V.color.fill.accentPrimary,[r]),v=S.useMemo(()=>r==="neutral"?V.color.text.primary:V.color.text.primaryInverse,[r]),y=S.useMemo(()=>r==="neutral"?V.color.text.tertiaryInverse:V.color.text.primaryInverse,[r]);return C.jsxs(q,{row:!0,w:o,ref:d,p:V.spacing.md,gap:V.spacing.md,backgroundColor:m,borderRadius:V.cornerRadius.lg,className:T.cx(f5,s),...f,children:[C.jsx(q,{w:48,h:48,center:!0,backgroundColor:p,borderRadius:V.cornerRadius.md,style:{color:h},className:a,children:n||d5[r]}),C.jsxs(q,{flex:1,children:[C.jsx(le,{variant:"body-1",fontWeight:"semibold",color:v,className:l,children:e}),t&&C.jsx(le,{variant:"body-2",fontWeight:"medium",color:y,className:c,children:t})]}),C.jsx(q,{onClick:i,children:C.jsx(u5,{width:24,height:24,color:g,className:T.cx(h5,u)})})]})});let li=[];const Pf=new Set,ys=new Map;function sd(){for(const e of Pf)e()}function g5(){return Math.random().toString(36).slice(2,9)}const _n={getSnapshot(){return li},subscribe(e){return Pf.add(e),()=>Pf.delete(e)},add(e){const t=e.id??g5(),n=e.duration??5e3;if(li=[...li,{...e,id:t,duration:n}],sd(),n>0){const r=setTimeout(()=>_n.remove(t),n);ys.set(t,r)}return t},remove(e){const t=ys.get(e);t&&(clearTimeout(t),ys.delete(e)),li=li.filter(n=>n.id!==e),sd()},removeAll(){for(const[,e]of ys)clearTimeout(e);ys.clear(),li=[],sd()}};class p5{show(t){return _n.add(t)}dismiss(t){_n.remove(t)}dismissAll(){_n.removeAll()}success(t,n){return this.show({...n,title:t,variant:"positive"})}error(t,n){return this.show({...n,title:t,variant:"negative"})}warning(t,n){return this.show({...n,title:t,variant:"warning"})}info(t,n){return this.show({...n,title:t,variant:"info"})}}const kr=new p5;function m5(){return{toasts:S.useSyncExternalStore(_n.subscribe,_n.getSnapshot,_n.getSnapshot),show:kr.show,success:kr.success,error:kr.error,warning:kr.warning,info:kr.info,dismiss:kr.dismiss,dismissAll:kr.dismissAll}}const y5={"top-left":{top:16,left:16,alignItems:"flex-start"},"top-center":{top:16,left:"50%",transform:"translateX(-50%)",alignItems:"center"},"top-right":{top:16,right:16,alignItems:"flex-end"},"bottom-left":{bottom:16,left:16,alignItems:"flex-start"},"bottom-center":{bottom:16,left:"50%",transform:"translateX(-50%)",alignItems:"center"},"bottom-right":{bottom:16,right:16,alignItems:"flex-end"}},v5=e=>{const t=e.startsWith("top"),n=e.endsWith("left"),r=e.endsWith("right"),o=e.endsWith("center"),i=n?-40:r?40:0;return{initial:{opacity:0,x:i,y:t?-16:16,scale:.95},animate:{opacity:1,x:0,y:0,scale:1},exit:{opacity:0,x:i,scale:.95,transition:{duration:.15}}}},x5=T.css({position:"fixed",zIndex:2,display:"flex",flexDirection:"column",gap:8,pointerEvents:"none",maxWidth:325,width:"100%"}),b5=T.css({pointerEvents:"auto",width:"100%"});function SS({position:e="top-right",className:t,itemClassName:n,toastClassName:r}){const o=S.useSyncExternalStore(_n.subscribe,_n.getSnapshot,_n.getSnapshot),i=v5(e);return C.jsx(ts,{children:C.jsx("div",{className:T.cx(x5,t),style:y5[e],children:C.jsx(Vx,{initial:!1,children:o.map(s=>C.jsx(ea.div,{className:T.cx(b5,n),layout:!0,initial:i.initial,animate:i.animate,exit:i.exit,transition:{type:"spring",stiffness:400,damping:30},children:C.jsx(CS,{title:s.title,subtitle:s.subtitle,icon:s.icon,variant:s.variant,onClose:()=>_n.remove(s.id),className:r})},s.id))})})})}const{color:Za}=V,w5={top:"polygon(100% 0%, 50% 100%, 0% 0%)",bottom:"polygon(0% 100%, 50% 0%, 100% 100%)","top-start":"polygon(0% 0%, 0% 100%, 100% 0%)","top-end":"polygon(100% 0%, 100% 100%, 0% 0%)","bottom-start":"polygon(0% 100%, 0% 0%, 100% 100%)","bottom-end":"polygon(100% 100%, 100% 0%, 0% 100%)",left:"polygon(0% 100%, 100% 50%, 0% 0%)",right:"polygon(100% 100%, 0% 50%, 100% 0%)"},C5=10,S5=6,Ja=1,j0={primary:{backgroundColor:Za.fill.bgPrimary,color:Za.text.primary},inverse:{backgroundColor:Za.fill.bgPrimaryInverse,color:Za.text.primaryInverse}},_5=(e,t)=>(e==="top"||e==="bottom")&&t?`${e}-${t}`:e,T5=(e,t,n)=>n?(e==="top"||e==="bottom")&&t?{[e==="top"?t==="start"?"borderBottomLeftRadius":"borderBottomRightRadius":t==="start"?"borderTopLeftRadius":"borderTopRightRadius"]:0}:{}:{},E5=(e,t,n)=>e==="left"||e==="right"?{width:6,height:n}:t?{width:8,height:6}:{width:n,height:6},R5=(e,t,n)=>e?(t==="top"||t==="bottom")&&n?{x:n==="start"?0:void 0,y:e.y}:{x:e.x,y:e.y}:{x:void 0,y:void 0},{color:k5,cornerRadius:A5,spacing:N5}=V,M5=T.keyframes`
93
93
  from { opacity: 0; transform: translateY(2px); }
94
94
  to { opacity: 1; transform: translateY(0); }
95
- `,M5=T.css({boxShadow:`0 4px 20px 0 ${R5.effect.shadowM}`,animation:`${N5} 0.16s ease-out`,fontSize:"12px",lineHeight:"16px",fontWeight:"500",wordBreak:"break-word"}),P5=T.css({position:"absolute",clipPath:"var(--tooltip-arrow-shape)"}),SS=({color:e="primary",children:t,content:n,disabled:r=!1,initialOpen:o=!1,open:i,onChange:s,placement:a="top",trigger:l="hover",offset:c=5,showArrow:u=!0,openDelay:f=400,closeDelay:d=0,closeOnEsc:h=!0,zIndex:g=1,maxWidth:p,className:m,contentClassName:v,arrowClassName:y,textClassName:x,style:b,id:w,p:_=A5.md,borderRadius:E=k5.sm})=>{const[R,k]=S.useState(o),[M,F]=S.useState(null),D=i??R,j=s??k,I=S.useId(),$=w??`tooltip-${I}`,H=n==null||n==="",O=!r&&!H,P=S.useCallback(Ye=>{O&&j(Ye)},[O,j]),K=c+(u?C5:0),{context:G,refs:re,floatingStyles:U,middlewareData:Z,placement:Q}=bg({placement:a,open:O?D:!1,onOpenChange:P,whileElementsMounted:hg,middleware:[gg(K),mg({crossAxis:a.includes("-"),fallbackAxisSideDirection:a.includes("start")?"start":"end",padding:K}),pg({padding:K}),...u&&M?[AF({element:M,padding:0})]:[]]}),ne=Z.arrow,oe=Q.split("-")[0],me=Q.includes("-")?Q.split("-")[1]:null,ee=E5(ne,oe,me),xe=S5(oe,me),Se=_5(oe,me,u),Ee=T5(oe,me,w5),ze=T.css({...Se,...I0[e]}),je=T.css({left:ee.x??void 0,top:ee.y??void 0,width:Ee.width,height:Ee.height,"--tooltip-arrow-shape":b5[xe],...oe==="top"&&{bottom:-Ee.height+Ja},...oe==="bottom"&&{top:-Ee.height+Ja},...oe==="left"&&{right:-Ee.width+Ja},...oe==="right"&&{left:-Ee.width+Ja},...me==="end"&&(oe==="top"||oe==="bottom")&&{left:"auto",right:0},...I0[e]}),Rt=VC(G,{enabled:l==="hover"&&O,delay:{open:f,close:d},move:!1}),gn=WF(G,{enabled:l==="hover"&&O}),ot=BC(G,{enabled:h&&O,escapeKey:!0}),Gt=HC(G,{role:"tooltip"}),Qt=zC([Rt,gn,ot,Gt]),pt=t.ref,se=DC([re.setReference,pt]),Re=S.useMemo(()=>S.cloneElement(t,Qt.getReferenceProps({...t.props,ref:se,"data-state":G.open?"open":"closed",...G.open?{"aria-describedby":$}:{}})),[t,Qt,G.open,$,se]);return C.jsxs(C.Fragment,{children:[Re,O&&D&&C.jsx(ts,{children:C.jsx(q,{absolute:!0,zIndex:g,className:m,ref:re.setFloating,style:{...U,...b},...Qt.getFloatingProps({id:$}),children:C.jsxs(q,{relative:!0,maxWidth:p,p:_,borderRadius:E,className:T.cx(M5,ze,v),children:[u&&C.jsx(q,{ref:F,className:T.cx(P5,je,y)}),typeof n=="string"?C.jsx(le,{colorName:e,variant:"caption-1",fontWeight:"medium",className:x,children:n}):n]})})})]})};SS.displayName="Tooltip";const L5="_themeProviderScoped_8xy1z_9",F5={themeProviderScoped:L5};function $5({className:e,children:t,theme:n,position:r="top-right"}){const o=S.useRef(null);return C.jsx(JC.Provider,{value:o,children:C.jsxs("div",{ref:o,className:mo(F5.themeProviderScoped,e),id:"theme-provider-scoped","data-theme":n,children:[t,C.jsx(CS,{position:r})]})})}exports.AnimatedText=Tb;exports.Avatar=yS;exports.Badge=vS;exports.Box=q;exports.Breadcrumbs=IO;exports.Breakpoints=Ar;exports.BreakpointsBase=po;exports.Button=Br;exports.Checkbox=hh;exports.Hint=YO;exports.IconButton=pr;exports.Input=Fi;exports.LineChart=pS;exports.Loader=V0;exports.MARKDOWN_TEXT_EDITOR_LOCALE_KEY=kb;exports.MarkdownText=JO;exports.MarkdownTextEditor=lL;exports.MarkdownToolbarAction=ae;exports.Modal=Sc;exports.OtpInput=CC;exports.PieProgressChart=mS;exports.Popover=Or;exports.Portal=ts;exports.Radio=_C;exports.RadioGroup=TC;exports.Ripple=zo;exports.SegmentControl=gL;exports.Select=Cg;exports.Skeleton=bS;exports.Switch=UC;exports.Table=ns;exports.Tabs=qC;exports.Tag=wg;exports.Text=le;exports.ThemeProviderScoped=$5;exports.Toast=wS;exports.ToastContainer=CS;exports.Tooltip=SS;exports.UiKitLocaleProvider=i3;exports.createColumnHelper=QC;exports.getFontWeightClass=P_;exports.getSizeClass=L_;exports.getStyleClass=Pf;exports.theme=V;exports.toast=kr;exports.useBreakpoint=M_;exports.useControlled=Bo;exports.useToast=p5;
95
+ `,P5=T.css({boxShadow:`0 4px 20px 0 ${k5.effect.shadowM}`,animation:`${M5} 0.16s ease-out`,fontSize:"12px",lineHeight:"16px",fontWeight:"500",wordBreak:"break-word"}),L5=T.css({position:"absolute",clipPath:"var(--tooltip-arrow-shape)"}),_S=({color:e="primary",children:t,content:n,disabled:r=!1,initialOpen:o=!1,open:i,onChange:s,placement:a="top",trigger:l="hover",offset:c=5,showArrow:u=!0,openDelay:f=400,closeDelay:d=0,closeOnEsc:h=!0,zIndex:g=1,maxWidth:p,className:m,contentClassName:v,arrowClassName:y,textClassName:x,style:b,id:w,p:_=N5.md,borderRadius:E=A5.sm})=>{const[R,k]=S.useState(o),[P,F]=S.useState(null),$=i??R,j=s??k,O=S.useId(),D=w??`tooltip-${O}`,K=n==null||n==="",I=!r&&!K,M=S.useCallback(Ye=>{I&&j(Ye)},[I,j]),H=c+(u?S5:0),{context:U,refs:re,floatingStyles:G,middlewareData:Y,placement:Q}=Rh({placement:a,open:I?$:!1,onOpenChange:M,whileElementsMounted:bh,middleware:[wh(H),Sh({crossAxis:a.includes("-"),fallbackAxisSideDirection:a.includes("start")?"start":"end",padding:H}),Ch({padding:H}),...u&&P?[nA({element:P,padding:0})]:[]]}),ne=Y.arrow,oe=Q.split("-")[0],me=Q.includes("-")?Q.split("-")[1]:null,ee=R5(ne,oe,me),ve=_5(oe,me),Se=T5(oe,me,u),Ee=E5(oe,me,C5),ze=T.css({...Se,...j0[e]}),je=T.css({left:ee.x??void 0,top:ee.y??void 0,width:Ee.width,height:Ee.height,"--tooltip-arrow-shape":w5[ve],...oe==="top"&&{bottom:-Ee.height+Ja},...oe==="bottom"&&{top:-Ee.height+Ja},...oe==="left"&&{right:-Ee.width+Ja},...oe==="right"&&{left:-Ee.width+Ja},...me==="end"&&(oe==="top"||oe==="bottom")&&{left:"auto",right:0},...j0[e]}),Rt=B1(U,{enabled:l==="hover"&&I,delay:{open:f,close:d},move:!1}),gn=yA(U,{enabled:l==="hover"&&I}),ot=z1(U,{enabled:h&&I,escapeKey:!0}),Gt=W1(U,{role:"tooltip"}),Qt=H1([Rt,gn,ot,Gt]),pt=t.ref,se=_l([re.setReference,pt]),Re=S.useMemo(()=>S.cloneElement(t,Qt.getReferenceProps({...t.props,ref:se,"data-state":U.open?"open":"closed",...U.open?{"aria-describedby":D}:{}})),[t,Qt,U.open,D,se]);return C.jsxs(C.Fragment,{children:[Re,I&&$&&C.jsx(ts,{children:C.jsx(q,{absolute:!0,zIndex:g,className:m,ref:re.setFloating,style:{...G,...b},...Qt.getFloatingProps({id:D}),children:C.jsxs(q,{relative:!0,maxWidth:p,p:_,borderRadius:E,className:T.cx(P5,ze,v),children:[u&&C.jsx(q,{ref:F,className:T.cx(L5,je,y)}),typeof n=="string"?C.jsx(le,{colorName:e,variant:"caption-1",fontWeight:"medium",className:x,children:n}):n]})})})]})};_S.displayName="Tooltip";const F5="_themeProviderScoped_8xy1z_9",$5={themeProviderScoped:F5};function O5({className:e,children:t,theme:n,position:r="top-right"}){const o=S.useRef(null);return C.jsx(QC.Provider,{value:o,children:C.jsxs("div",{ref:o,className:mo($5.themeProviderScoped,e),id:"theme-provider-scoped","data-theme":n,children:[t,C.jsx(SS,{position:r})]})})}exports.AnimatedText=R1;exports.Avatar=vS;exports.Badge=xS;exports.Box=q;exports.Breadcrumbs=DO;exports.Breakpoints=Ar;exports.BreakpointsBase=po;exports.Button=Br;exports.Checkbox=gh;exports.Hint=XO;exports.IconButton=pr;exports.Input=$i;exports.LineChart=mS;exports.Loader=z0;exports.MARKDOWN_TEXT_EDITOR_LOCALE_KEY=G1;exports.MarkdownText=QO;exports.MarkdownTextEditor=VF;exports.MarkdownToolbarAction=ae;exports.Modal=_c;exports.OtpInput=BC;exports.PieProgressChart=yS;exports.Popover=Or;exports.Portal=ts;exports.Radio=HC;exports.RadioGroup=WC;exports.Ripple=zo;exports.SegmentControl=UF;exports.Select=Sg;exports.Skeleton=wS;exports.Switch=GC;exports.Table=ns;exports.Tabs=YC;exports.Tag=Cg;exports.Text=le;exports.ThemeProviderScoped=O5;exports.Toast=CS;exports.ToastContainer=SS;exports.Tooltip=_S;exports.UiKitLocaleProvider=IA;exports.createColumnHelper=eS;exports.getFontWeightClass=L_;exports.getSizeClass=F_;exports.getStyleClass=Lf;exports.theme=V;exports.toast=kr;exports.useBreakpoint=P_;exports.useControlled=Bo;exports.useToast=m5;
96
96
  //# sourceMappingURL=ui-kit.cjs.js.map