diff --git a/dist/force-ui.asset.php b/dist/force-ui.asset.php index 83b710a8..629a8b16 100644 --- a/dist/force-ui.asset.php +++ b/dist/force-ui.asset.php @@ -1 +1 @@ - array('react', 'react-dom'), 'version' => '826a91be3e2c7572e3a3'); + array('react', 'react-dom'), 'version' => '8b50556bb9e94f18f3fd'); diff --git a/dist/force-ui.js b/dist/force-ui.js index 34e618e7..b7af8009 100644 --- a/dist/force-ui.js +++ b/dist/force-ui.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["force-ui.[file].js"]=t():e["force-ui.[file].js"]=t()}("undefined"!=typeof self?self:this,(function(){return function(){"use strict";var e={316:function(e,t,n){function r(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}n.d(t,{A:function(){return i}});var o=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,i=r((function(e){return o.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}))},20:function(e,t,n){var r=n(609),o=Symbol.for("react.element"),i=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,i={},c=null,u=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)s.call(t,r)&&!l.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:o,type:e,key:c,ref:u,props:i,_owner:a.current}}t.Fragment=i,t.jsx=c,t.jsxs=c},848:function(e,t,n){e.exports=n(20)},609:function(e){e.exports=window.React}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};n.r(r),n.d(r,{Alert:function(){return rp},Avatar:function(){return Je},Badge:function(){return $e},Breadcrumb:function(){return s_},BreadcrumbEllipsis:function(){return d_},BreadcrumbItem:function(){return l_},BreadcrumbLink:function(){return c_},BreadcrumbList:function(){return a_},BreadcrumbPage:function(){return f_},BreadcrumbSeparator:function(){return u_},Button:function(){return ae},ButtonGroup:function(){return hi},Checkbox:function(){return Te},Container:function(){return np},Dialog:function(){return F_},Drawer:function(){return yE},EditorInput:function(){return Lw},Input:function(){return it},Label:function(){return ct},Loader:function(){return ft},Menu:function(){return Qw},ProgressBar:function(){return ht},ProgressSteps:function(){return Kw},RadioButton:function(){return ze},Select:function(){return dh},Skeleton:function(){return Yw},Switch:function(){return me},Tabs:function(){return Hf},TextArea:function(){return Ge},Title:function(){return ut},Toaster:function(){return Xh},Tooltip:function(){return si},Topbar:function(){return W_},toast:function(){return Ph}});var o=n(609),i=n.n(o);const s=e=>{const t=u(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{const n=e.split("-");return""===n[0]&&1!==n.length&&n.shift(),a(n,t)||c(e)},getConflictingClassGroupIds:(e,t)=>{const o=n[e]||[];return t&&r[e]?[...o,...r[e]]:o}}},a=(e,t)=>{if(0===e.length)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?a(e.slice(1),r):void 0;if(o)return o;if(0===t.validators.length)return;const i=e.join("-");return t.validators.find((({validator:e})=>e(i)))?.classGroupId},l=/^\[(.+)\]$/,c=e=>{if(l.test(e)){const t=l.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},u=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return p(Object.entries(e.classGroups),n).forEach((([e,n])=>{d(n,r,e,t)})),r},d=(e,t,n,r)=>{e.forEach((e=>{if("string"!=typeof e){if("function"==typeof e)return h(e)?void d(e(r),t,n,r):void t.validators.push({validator:e,classGroupId:n});Object.entries(e).forEach((([e,o])=>{d(o,f(t,e),n,r)}))}else(""===e?t:f(t,e)).classGroupId=n}))},f=(e,t)=>{let n=e;return t.split("-").forEach((e=>{n.nextPart.has(e)||n.nextPart.set(e,{nextPart:new Map,validators:[]}),n=n.nextPart.get(e)})),n},h=e=>e.isThemeGetter,p=(e,t)=>t?e.map((([e,n])=>[e,n.map((e=>"string"==typeof e?t+e:"object"==typeof e?Object.fromEntries(Object.entries(e).map((([e,n])=>[t+e,n]))):e))])):e,m=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(o,i)=>{n.set(o,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(e){let t=n.get(e);return void 0!==t?t:void 0!==(t=r.get(e))?(o(e,t),t):void 0},set(e,t){n.has(e)?n.set(e,t):o(e,t)}}},g=e=>{const{separator:t,experimentalParseClassName:n}=e,r=1===t.length,o=t[0],i=t.length,s=e=>{const n=[];let s,a=0,l=0;for(let c=0;cl?s-l:void 0}};return n?e=>n({className:e,parseClassName:s}):s},v=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach((e=>{"["===e[0]?(t.push(...n.sort(),e),n=[]):n.push(e)})),t.push(...n.sort()),t},y=/\s+/;function b(){let e,t,n=0,r="";for(;n{if("string"==typeof e)return e;let t,n="";for(let r=0;rt(e)),e());return n=(e=>({cache:m(e.cacheSize),parseClassName:g(e),...s(e)}))(c),r=n.cache.get,o=n.cache.set,i=a,a(l)};function a(e){const t=r(e);if(t)return t;const i=((e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=[],s=e.trim().split(y);let a="";for(let e=s.length-1;e>=0;e-=1){const t=s[e],{modifiers:l,hasImportantModifier:c,baseClassName:u,maybePostfixModifierPosition:d}=n(t);let f=Boolean(d),h=r(f?u.substring(0,d):u);if(!h){if(!f){a=t+(a.length>0?" "+a:a);continue}if(h=r(u),!h){a=t+(a.length>0?" "+a:a);continue}f=!1}const p=v(l).join(":"),m=c?p+"!":p,g=m+h;if(i.includes(g))continue;i.push(g);const y=o(h,f);for(let e=0;e0?" "+a:a)}return a})(e,n);return o(e,i),i}return function(){return i(b.apply(null,arguments))}}const _=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},E=/^\[(?:([a-z-]+):)?(.+)\]$/i,S=/^\d+\/\d+$/,k=new Set(["px","full","screen"]),C=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,T=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,P=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,R=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,O=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,N=e=>j(e)||k.has(e)||S.test(e),A=e=>H(e,"length",q),j=e=>Boolean(e)&&!Number.isNaN(Number(e)),M=e=>H(e,"number",j),I=e=>Boolean(e)&&Number.isInteger(Number(e)),D=e=>e.endsWith("%")&&j(e.slice(0,-1)),L=e=>E.test(e),F=e=>C.test(e),z=new Set(["length","size","percentage"]),B=e=>H(e,z,Y),V=e=>H(e,"position",Y),W=new Set(["image","url"]),U=e=>H(e,W,G),$=e=>H(e,"",X),K=()=>!0,H=(e,t,n)=>{const r=E.exec(e);return!!r&&(r[1]?"string"==typeof t?r[1]===t:t.has(r[1]):n(r[2]))},q=e=>T.test(e)&&!P.test(e),Y=()=>!1,X=e=>R.test(e),G=e=>O.test(e),J=(Symbol.toStringTag,()=>{const e=_("colors"),t=_("spacing"),n=_("blur"),r=_("brightness"),o=_("borderColor"),i=_("borderRadius"),s=_("borderSpacing"),a=_("borderWidth"),l=_("contrast"),c=_("grayscale"),u=_("hueRotate"),d=_("invert"),f=_("gap"),h=_("gradientColorStops"),p=_("gradientColorStopPositions"),m=_("inset"),g=_("margin"),v=_("opacity"),y=_("padding"),b=_("saturate"),x=_("scale"),w=_("sepia"),E=_("skew"),S=_("space"),k=_("translate"),C=()=>["auto",L,t],T=()=>[L,t],P=()=>["",N,A],R=()=>["auto",j,L],O=()=>["","0",L],z=()=>[j,L];return{cacheSize:500,separator:":",theme:{colors:[K],spacing:[N,A],blur:["none","",F,L],brightness:z(),borderColor:[e],borderRadius:["none","","full",F,L],borderSpacing:T(),borderWidth:P(),contrast:z(),grayscale:O(),hueRotate:z(),invert:O(),gap:T(),gradientColorStops:[e],gradientColorStopPositions:[D,A],inset:C(),margin:C(),opacity:z(),padding:T(),saturate:z(),scale:z(),sepia:O(),skew:z(),space:T(),translate:T()},classGroups:{aspect:[{aspect:["auto","square","video",L]}],container:["container"],columns:[{columns:[F]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",L]}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",I,L]}],basis:[{basis:C()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",L]}],grow:[{grow:O()}],shrink:[{shrink:O()}],order:[{order:["first","last","none",I,L]}],"grid-cols":[{"grid-cols":[K]}],"col-start-end":[{col:["auto",{span:["full",I,L]},L]}],"col-start":[{"col-start":R()}],"col-end":[{"col-end":R()}],"grid-rows":[{"grid-rows":[K]}],"row-start-end":[{row:["auto",{span:[I,L]},L]}],"row-start":[{"row-start":R()}],"row-end":[{"row-end":R()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",L]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",L]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal","start","end","center","between","around","evenly","stretch"]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[S]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[S]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",L,t]}],"min-w":[{"min-w":[L,t,"min","max","fit"]}],"max-w":[{"max-w":[L,t,"none","full","min","max","fit","prose",{screen:[F]},F]}],h:[{h:[L,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[L,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[L,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[L,t,"auto","min","max","fit"]}],"font-size":[{text:["base",F,A]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",M]}],"font-family":[{font:[K]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",L]}],"line-clamp":[{"line-clamp":["none",j,M]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",N,L]}],"list-image":[{"list-image":["none",L]}],"list-style-type":[{list:["none","disc","decimal",L]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","none","wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",N,A]}],"underline-offset":[{"underline-offset":["auto",N,L]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",L]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",L]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",V]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",B]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},U]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[p]}],"gradient-via-pos":[{via:[p]}],"gradient-to-pos":[{to:[p]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:["solid","dashed","dotted","double","none","hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:["solid","dashed","dotted","double","none"]}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["","solid","dashed","dotted","double","none"]}],"outline-offset":[{"outline-offset":[N,L]}],"outline-w":[{outline:[N,A]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:P()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[N,A]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",F,$]}],"shadow-color":[{shadow:[K]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",F,L]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[b]}],sepia:[{sepia:[w]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[w]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",L]}],duration:[{duration:z()}],ease:[{ease:["linear","in","out","in-out",L]}],delay:[{delay:z()}],animate:[{animate:["none","spin","ping","pulse","bounce",L]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[I,L]}],"translate-x":[{"translate-x":[k]}],"translate-y":[{"translate-y":[k]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",L]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",L]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",L]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[N,A,M]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}),Z=w(J);function Q(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;tsvg]:h-4 [&>svg]:w-4",sm:"p-2 rounded-sm [&>svg]:h-4 [&>svg]:w-4",md:"p-2.5 rounded-md text-sm [&>svg]:h-5 [&>svg]:w-5",lg:"p-3 rounded-lg text-base [&>svg]:h-6 [&>svg]:w-6"})||void 0===o?void 0:o[u],A=null,j="";_&&(j="flex items-center justify-center gap-1","left"===S?s=_:A=_);var M=p;return i().createElement(M,ie({ref:t,type:f,className:te(j,"border border-solid cursor-pointer transition-colors duration-300 ease-in-out text-xs font-semibold focus:ring-2 focus:ring-toggle-on focus:ring-offset-2 disabled:text-text-disabled",N,R,O,P,m),disabled:y},T),s,g,A)})),ae=se;let le=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&n[e]];return t};var ce=["id","onChange","value","defaultValue","size","disabled","label","name","className"];function ue(){return ue=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);ne.filter(((e,t,n)=>Boolean(e)&&n.indexOf(e)===t)).join(" ");var ve={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const ye=(0,o.forwardRef)((({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:a,...l},c)=>(0,o.createElement)("svg",{ref:c,...ve,width:t,height:t,stroke:e,strokeWidth:r?24*Number(n)/Number(t):n,className:ge("lucide",i),...l},[...a.map((([e,t])=>(0,o.createElement)(e,t))),...Array.isArray(s)?s:[s]]))),be=(e,t)=>{const n=(0,o.forwardRef)((({className:n,...r},i)=>{return(0,o.createElement)(ye,{ref:i,iconNode:t,className:ge(`lucide-${s=e,s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,n),...r});var s}));return n.displayName=`${e}`,n},xe=be("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]),we=be("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);var _e=["id","label","defaultChecked","checked","onChange","value","indeterminate","disabled","size"];function Ee(){return Ee=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);nsvg]:h-4 [&>svg]:w-4",sm:"py-2 px-2 text-base gap-1 [&>svg]:h-4 [&>svg]:w-4",md:"py-2.5 px-2.5 text-base gap-1 [&>svg]:h-5 [&>svg]:w-5"}[l],"border-0 border-r border-border-subtle border-solid");return i().createElement(i().Fragment,null,i().createElement("button",Oe({type:"button",id:v,className:te(x,"first:rounded-tl first:rounded-bl first:border-0 first:border-r first:border-border-subtle last:rounded-tr last:rounded-br last:border-0",b&&"bg-button-disabled"),onClick:function(){p&&p(r)},disabled:y},c),i().createElement("input",{type:"hidden",value:r,name:d,checked:b,onChange:p}),n))},ze={Group:function(e){var t,n,r=e.children,s=e.name,a=e.value,l=e.defaultValue,c=e.by,u=void 0===c?"id":c,d=e.as,f=void 0===d?o.Fragment:d,h=e.onChange,p=e.className,m=e.style,g=void 0===m?"simple":m,v=e.disabled,y=void 0!==v&&v,b=(0,o.useMemo)((function(){return void 0!==a}),[a]),x=(0,o.useMemo)((function(){return s||"radio-button-group-".concat(le())}),[s]),w=(t=(0,o.useState)(b?a:l),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,s,a=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}(t,n)||function(e,t){if(e){if("string"==typeof e)return je(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?je(e,t):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),_=w[0],E=w[1],S=(0,o.useCallback)((function(e){var t;t="tile"===g?e:e.target.value,b||E(t),"function"==typeof h&&h(t)}),[h]),k=te("tile"===g?"inline-flex border border-border-subtle border-solid rounded shadow-sm":"flex gap-6",p),C=function(){return i().createElement(Me.Provider,{value:{name:x,value:b?a:_,by:u,onChange:S,isControlled:b,disableAll:y,style:g}},i().Children.map(r,(function(e){return(0,o.isValidElement)(e)?e:null})))};return i().createElement(i().Fragment,null,"tile"===g?i().createElement("div",{className:k},C()):i().createElement(f,f===o.Fragment?{}:{className:p},C()))},Button:Le};const Be=be("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),Ve=be("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);var We=function(e,t){var n=e.label,r=void 0===n?"":n,o=e.size,i=void 0===o?"sm":o,s=e.className,a=void 0===s?"":s,l=e.type,c=void 0===l?"pill":l,u=e.variant,d=void 0===u?"neutral":u,f=e.icon,h=void 0===f?React.createElement(Be,null):f,p=e.disabled,m=void 0!==p&&p,g=e.onClose,v=void 0===g?function(){}:g,y=e.closable,b=void 0===y||y,x=e.onMouseDown,w=void 0===x?function(){}:x,_={neutral:"bg-badge-background-gray hover:bg-badge-hover-gray text-badge-color-gray border-badge-border-gray",red:"bg-badge-background-red hover:bg-badge-hover-red text-badge-color-red border-badge-border-red",yellow:"bg-badge-background-yellow hover:bg-badge-hover-yellow text-badge-color-yellow border-badge-border-yellow",green:"bg-badge-background-green hover:bg-badge-hover-green text-badge-color-green border-badge-border-green",blue:"bg-badge-background-sky hover:bg-badge-hover-sky text-badge-color-sky border-badge-border-sky",inverse:"bg-background-inverse hover:bg-badge-hover-inverse text-text-inverse border-background-inverse",disabled:"bg-badge-background-disabled hover:bg-badge-hover-disabled text-badge-color-disabled border-badge-border-disabled disabled cursor-not-allowed"},E="",S="group relative justify-center flex items-center [&>svg]:h-4 [&>svg]:w-4 cursor-pointer";return m?(E=_.disabled,S+=" cursor-not-allowed disabled"):E=_[d],r?React.createElement("span",{className:te("font-medium border-badge-border-gray flex gap-1 items-center justify-center border border-solid",{xs:"py-0.5 px-1 text-xs",sm:"py-1 px-1.5 text-xs",md:"py-1 px-1.5 text-sm",lg:"py-1 px-1.5 text-base"}[i],{pill:"rounded-full",rounded:"rounded"}[c],E,a),ref:t},h?React.createElement("span",{className:"justify-center flex items-center [&>svg]:h-4 [&>svg]:w-4"},h):null,r,b&&React.createElement("span",{className:S,onClick:m?null:v,onMouseDown:w,role:"button",tabIndex:0},React.createElement("span",{className:"sr-only"},"Remove ".concat(r)),React.createElement(Ve,null),React.createElement("span",{className:"absolute -inset-1"}))):null},Ue=(0,o.forwardRef)(We);Ue.displayName="Badge";var $e=Ue,Ke=["id","defaultValue","value","size","className","disabled","onChange","error","onError"];function He(){return He=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);nsvg]:h-3 [&>svg]:w-3 text-xs",sm:"w-6 h-6 [&>svg]:h-4 [&>svg]:w-4 text-sm",md:"w-8 h-8 [&>svg]:h-5 [&>svg]:w-5 text-base",lg:"w-10 h-10 [&>svg]:h-6 [&>svg]:w-6 text-lg"})||void 0===n?void 0:n[l],v=null===(r={none:"",subtle:"border border-solid border-border-transparent-subtle",ring:"border-4 border-solid border-border-white"})||void 0===r?void 0:r[f&&"none"===u?"subtle":u],y=f?"bg-cover bg-center bg-no-repeat":"";return React.createElement("div",{className:te("rounded-full overflow-hidden flex items-center justify-center",!f&&m,g,v,y,p),style:f?{backgroundImage:"url(".concat(f,")")}:{}},h?"string"==typeof h?null==h||null===(o=h[0])||void 0===o?void 0:o.toUpperCase():h:null)};const Ze=be("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);var Qe=["id","type","defaultValue","value","size","className","disabled","onChange","error","onError","prefix","suffix"];function et(){return et=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n0?j(t[0].name):j(null):t=e.target.value,T||"file"===i||O(t),"function"==typeof g&&g(t))},D="border border-solid border-border-subtle bg-field-secondary-background font-normal placeholder-text-tertiary text-text-primary w-full focus:outline-none",L={sm:"px-2 py-2 rounded",md:"px-2.5 py-2.5 rounded-md",lg:"px-3 py-3 rounded-lg"},F={sm:"text-xs",md:"text-base",lg:"text-base"},z={sm:_?"pl-8":"",md:_?"pl-9":"",lg:_?"pl-10":""},B={sm:S?"pr-8":"",md:S?"pr-9":"",lg:S?"pr-10":""},V=p?"hover:border-border-disabled":"hover:border-border-strong",W="focus:border-focus-border focus:ring-2 focus:ring-toggle-on focus:ring-offset-2",U=y?"focus:border-focus-error-border focus:ring-field-color-error bg-field-background-error":"",$=y?"focus:border-focus-error-border focus:ring-field-color-error":"",K=p?"border-border-disabled bg-field-background-disabled cursor-not-allowed text-text-disabled":"",H=p?"border-border-disabled cursor-not-allowed text-text-disabled file:text-text-tertiary":"",q="font-normal placeholder-text-tertiary text-text-primary pointer-events-none absolute inset-y-0 flex flex-1 items-center [&>svg]:h-4 [&>svg]:w-4",Y=p?"font-normal placeholder-text-tertiary text-icon-disabled pointer-events-none absolute inset-y-0 flex flex-1 items-center":"font-normal placeholder-text-tertiary text-field-placeholder pointer-events-none absolute inset-y-0 flex flex-1 items-center",X=A?"file:border-0 file:bg-transparent":"text-text-tertiary file:border-0 file:bg-transparent";return"file"===i?React.createElement("div",{className:te("relative flex focus-within:z-10",f)},React.createElement("input",et({ref:t,id:C,type:"file",className:te(D,H,L[u],F[u],W,V,$,X),disabled:p,onChange:I,onInvalid:x},k)),React.createElement("div",{className:te(Y,"right-0 pr-3",{sm:"[&>svg]:h-4 [&>svg]:w-4",md:"[&>svg]:h-5 [&>svg]:w-5",lg:"[&>svg]:h-6 [&>svg]:w-6"}[u])},React.createElement(Ze,null))):React.createElement("div",{className:te("relative flex focus-within:z-10",f)},_?React.createElement("div",{className:te(q,"left-0 pl-3",F[u])},_):null,React.createElement("input",et({ref:t,id:C,type:i,className:te(D,K,L[u],F[u],z[u],B[u],W,V,U),disabled:p,onChange:I,onInvalid:x,value:M()},k)),S?React.createElement("div",{className:te(q,"right-0 pr-3",F[u])},S):null)},ot=(0,o.forwardRef)(rt);ot.displayName="Input";var it=ot,st=["children","tag","size","className","variant","required"];function at(){return at=Object.assign?Object.assign.bind():function(e){for(var t=1;t*]:text-xs [&>svg]:h-3 [&>svg]:w-3",sm:"text-sm [&>*]:text-sm [&>svg]:h-4 [&>svg]:w-4",md:"text-base [&>*]:text-base [&>svg]:h-5 [&>svg]:w-5"}[l],{neutral:"text-field-label [&>*]:text-field-label",help:"text-field-helper [&>*]:text-field-helper",error:"text-support-error [&>*]:text-support-error",disabled:"text-field-color-disabled disabled cursor-not-allowed [&>*]:text-field-color-disabled"}[f],g,u)},m),r)})),ct=lt,ut=function(e){var t=e.title,n=void 0===t?null:t,r=e.description,o=void 0===r?null:r,i=e.icon,s=void 0===i?null:i,a=e.iconPosition,l=void 0===a?"right":a,c=e.tag,u=void 0===c?"h2":c,d=e.size,f=void 0===d?"sm":d,h=e.className,p=void 0===h?"":h,m={xs:"gap-1 [&>svg]:size-3.5",sm:"gap-1 [&>svg]:size-4",md:"gap-1.5 [&>svg]:size-5",lg:"gap-1.5 [&>svg]:size-5"};if(!n)return null;var g=function(){var e=u;return React.createElement(e,{className:te("font-semibold p-0 m-0",{xs:"text-base [&>*]:text-base gap-1",sm:"text-lg [&>*]:text-lg gap-1",md:"text-xl [&>*]:text-xl gap-1.5",lg:"text-2xl [&>*]:text-2xl gap-1.5"}[f])},n)};return o?React.createElement("div",{className:p},React.createElement("div",null,s&&"left"===l&&React.createElement("div",{className:te("flex items-center",m[f])},s,g()),s&&"right"===l&&React.createElement("div",{className:te("flex items-center",m[f])},g(),s),!s&&g()),React.createElement("span",{className:te("text-text-secondary font-normal",{xs:"text-base",sm:"text-lg",md:"text-xl",lg:"text-2xl"}[f])},o)):React.createElement("div",{className:p},s&&"left"===l&&React.createElement("div",{className:te("flex items-center",m[f])},s,g()),s&&"right"===l&&React.createElement("div",{className:te("flex items-center",m[f])},g(),s),!s&&g())};const dt=be("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);var ft=function(e){var t,n,r=e.variant,o=void 0===r?"primary":r,i=e.size,s=void 0===i?"md":i,a=e.icon,l=void 0===a?null:a,c=e.className,u=void 0===c?"":c,d=null===(t={primary:"text-brand-primary-600 bg-background-primary",secondary:"text-background-primary bg-brand-primary-600"})||void 0===t?void 0:t[o],f=null===(n={sm:"[&>svg]:h-4 [&>svg]:w-4",md:"[&>svg]:h-5 [&>svg]:w-5",lg:"[&>svg]:h-6 [&>svg]:w-6",xl:"[&>svg]:h-8 [&>svg]:w-8"})||void 0===n?void 0:n[s];return React.createElement("span",{className:te("flex",f,d,u)},l||React.createElement(dt,{className:"animate-spin"}))},ht=function(e){var t=e.progress,n=void 0===t?0:t,r=e.speed,o=void 0===r?200:r,i=e.className,s=void 0===i?"":i;if(!n)return null;var a=n;n<0&&(a=0),n>100&&(a=100);var l="translateX(-".concat(100-a,"%)"),c="h-2 rounded-full bg-background-brand absolute left-0 top-0 w-full bottom-0 origin-left transition-transform duration-".concat(o," ease-linear");return React.createElement("div",{className:te("h-2 rounded-full bg-misc-progress-background overflow-hidden relative",s),role:"progressbar","aria-valuenow":a,"aria-valuemin":"0","aria-valuemax":"100"},React.createElement("div",{className:c,style:{transform:l}}))};function pt(e){return vt(e)?(e.nodeName||"").toLowerCase():"#document"}function mt(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function gt(e){var t;return null==(t=(vt(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function vt(e){return e instanceof Node||e instanceof mt(e).Node}function yt(e){return e instanceof Element||e instanceof mt(e).Element}function bt(e){return e instanceof HTMLElement||e instanceof mt(e).HTMLElement}function xt(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof mt(e).ShadowRoot)}function wt(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Tt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function _t(e){return["table","td","th"].includes(pt(e))}function Et(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function St(e){const t=kt(),n=yt(e)?Tt(e):e;return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function kt(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Ct(e){return["html","body","#document"].includes(pt(e))}function Tt(e){return mt(e).getComputedStyle(e)}function Pt(e){return yt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Rt(e){if("html"===pt(e))return e;const t=e.assignedSlot||e.parentNode||xt(e)&&e.host||gt(e);return xt(t)?t.host:t}function Ot(e){const t=Rt(e);return Ct(t)?e.ownerDocument?e.ownerDocument.body:e.body:bt(t)&&wt(t)?t:Ot(t)}function Nt(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=Ot(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),s=mt(o);if(i){const e=At(s);return t.concat(s,s.visualViewport||[],wt(o)?o:[],e&&n?Nt(e):[])}return t.concat(o,Nt(o,[],n))}function At(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function jt(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement}return t}function Mt(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&xt(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function It(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function Dt(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map((e=>{let{brand:t,version:n}=e;return t+"/"+n})).join(" "):navigator.userAgent}function Lt(e){return!(0!==e.mozInputSource||!e.isTrusted)||(Bt()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function Ft(e){return!Dt().includes("jsdom/")&&(!Bt()&&0===e.width&&0===e.height||Bt()&&1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"===e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail&&"touch"===e.pointerType)}function zt(){return/apple/i.test(navigator.vendor)}function Bt(){const e=/android/i;return e.test(It())||e.test(Dt())}function Vt(){return It().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function Wt(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Ut(e){return(null==e?void 0:e.ownerDocument)||document}function $t(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}function Kt(e){return"composedPath"in e?e.composedPath()[0]:e.target}const Ht="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function qt(e){return bt(e)&&e.matches(Ht)}function Yt(e){e.preventDefault(),e.stopPropagation()}function Xt(e){return!!e&&"combobox"===e.getAttribute("role")&&qt(e)}const Gt=Math.min,Jt=Math.max,Zt=Math.round,Qt=Math.floor,en=e=>({x:e,y:e}),tn={left:"right",right:"left",bottom:"top",top:"bottom"},nn={start:"end",end:"start"};function rn(e,t,n){return Jt(e,Gt(t,n))}function on(e,t){return"function"==typeof e?e(t):e}function sn(e){return e.split("-")[0]}function an(e){return e.split("-")[1]}function ln(e){return"x"===e?"y":"x"}function cn(e){return"y"===e?"height":"width"}function un(e){return["top","bottom"].includes(sn(e))?"y":"x"}function dn(e){return ln(un(e))}function fn(e){return e.replace(/start|end/g,(e=>nn[e]))}function hn(e){return e.replace(/left|right|bottom|top/g,(e=>tn[e]))}function pn(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function mn(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}}var gn=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),vn="undefined"==typeof Element,yn=vn?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,bn=!vn&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},xn=function e(t,n){var r;void 0===n&&(n=!0);var o=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===o||"true"===o||n&&t&&e(t.parentNode)},wn=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var s=i.shift();if(!xn(s,!1))if("SLOT"===s.tagName){var a=s.assignedElements(),l=e(a.length?a:s.children,!0,r);r.flatten?o.push.apply(o,l):o.push({scopeParent:s,candidates:l})}else{yn.call(s,gn)&&r.filter(s)&&(n||!t.includes(s))&&o.push(s);var c=s.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(s),u=!xn(c,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(c&&u){var d=e(!0===c?s.children:c.children,!0,r);r.flatten?o.push.apply(o,d):o.push({scopeParent:s,candidates:d})}else i.unshift.apply(i,s.children)}}return o},En=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Sn=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!En(e)?0:e.tabIndex},kn=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Cn=function(e){return"INPUT"===e.tagName},Tn=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},Pn=function(e,t){return!(t.disabled||xn(t)||function(e){return Cn(e)&&"hidden"===e.type}(t)||function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=yn.call(e,"details>summary:first-of-type")?e.parentElement:e;if(yn.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Tn(e)}else{if("function"==typeof r){for(var i=e;e;){var s=e.parentElement,a=bn(e);if(s&&!s.shadowRoot&&!0===r(s))return Tn(e);e=e.assignedSlot?e.assignedSlot:s||a===e.ownerDocument?s:a.host}e=i}if(function(e){var t,n,r,o,i=e&&bn(e),s=null===(t=i)||void 0===t?void 0:t.host,a=!1;if(i&&i!==e)for(a=!!(null!==(n=s)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(s)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!a&&s;){var l,c,u;a=!(null===(c=s=null===(l=i=bn(s))||void 0===l?void 0:l.host)||void 0===c||null===(u=c.ownerDocument)||void 0===u||!u.contains(s))}return a}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1}(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n=0)},Nn=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,s=i?t.scopeParent:t,a=function(e,t){var n=Sn(e);return n<0&&t&&!En(e)?0:n}(s,i),l=i?e(t.candidates):s;0===a?i?n.push.apply(n,l):n.push(s):r.push({documentOrder:o,tabIndex:a,item:t,isScope:i,content:l})})),r.sort(kn).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},An=function(e,t){var n;return n=(t=t||{}).getShadowRoot?wn([e],t.includeContainer,{filter:Rn.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:On}):function(e,t,n){if(xn(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(gn));return t&&yn.call(e,gn)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,Rn.bind(null,t)),Nn(n)},jn=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==yn.call(e,gn)&&Rn(t,e)},Mn=window.ReactDOM;function In(e,t,n){let{reference:r,floating:o}=e;const i=un(t),s=dn(t),a=cn(s),l=sn(t),c="y"===i,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=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:d};break;case"left":h={x:r.x-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch(an(t)){case"start":h[s]-=f*(n&&c?-1:1);break;case"end":h[s]+=f*(n&&c?-1:1)}return h}async function Dn(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=on(t,e),p=pn(h),m=a[f?"floating"===d?"reference":"floating":d],g=mn(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),v="floating"===d?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),b=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},x=mn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:y,strategy:l}):v);return{top:(g.top-x.top+p.top)/b.y,bottom:(x.bottom-g.bottom+p.bottom)/b.y,left:(g.left-x.left+p.left)/b.x,right:(x.right-g.right+p.right)/b.x}}function Ln(e){const t=Tt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=bt(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Zt(n)!==i||Zt(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Fn(e){return yt(e)?e:e.contextElement}function zn(e){const t=Fn(e);if(!bt(t))return en(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Ln(t);let s=(i?Zt(n.width):n.width)/r,a=(i?Zt(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const Bn=en(0);function Vn(e){const t=mt(e);return kt()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Bn}function Wn(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Fn(e);let s=en(1);t&&(r?yt(r)&&(s=zn(r)):s=zn(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==mt(e))&&t}(i,n,r)?Vn(i):en(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const e=mt(i),t=r&&yt(r)?mt(r):r;let n=e,o=At(n);for(;o&&r&&t!==n;){const e=zn(o),t=o.getBoundingClientRect(),r=Tt(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,s=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=i,c+=s,n=mt(o),o=At(n)}}return mn({width:u,height:d,x:l,y:c})}function Un(e){return Wn(gt(e)).left+Pt(e).scrollLeft}function $n(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=mt(e),r=gt(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const e=kt();(!e||e&&"fixed"===t)&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}(e,n);else if("document"===t)r=function(e){const t=gt(e),n=Pt(e),r=e.ownerDocument.body,o=Jt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Jt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Un(e);const a=-n.scrollTop;return"rtl"===Tt(r).direction&&(s+=Jt(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}(gt(e));else if(yt(t))r=function(e,t){const n=Wn(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=bt(e)?zn(e):en(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=Vn(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return mn(r)}function Kn(e,t){const n=Rt(e);return!(n===t||!yt(n)||Ct(n))&&("fixed"===Tt(n).position||Kn(n,t))}function Hn(e,t,n){const r=bt(t),o=gt(t),i="fixed"===n,s=Wn(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=en(0);if(r||!r&&!i)if(("body"!==pt(t)||wt(o))&&(a=Pt(t)),r){const e=Wn(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=Un(o));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function qn(e){return"static"===Tt(e).position}function Yn(e,t){return bt(e)&&"fixed"!==Tt(e).position?t?t(e):e.offsetParent:null}function Xn(e,t){const n=mt(e);if(Et(e))return n;if(!bt(e)){let t=Rt(e);for(;t&&!Ct(t);){if(yt(t)&&!qn(t))return t;t=Rt(t)}return n}let r=Yn(e,t);for(;r&&_t(r)&&qn(r);)r=Yn(r,t);return r&&Ct(r)&&qn(r)&&!St(r)?n:r||function(e){let t=Rt(e);for(;bt(t)&&!Ct(t);){if(St(t))return t;if(Et(t))return null;t=Rt(t)}return null}(e)||n}const Gn={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,s=gt(r),a=!!t&&Et(t.floating);if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=en(1);const u=en(0),d=bt(r);if((d||!d&&!i)&&(("body"!==pt(r)||wt(s))&&(l=Pt(r)),bt(r))){const e=Wn(r);c=zn(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}},getDocumentElement:gt,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?Et(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=Nt(e,[],!1).filter((e=>yt(e)&&"body"!==pt(e))),o=null;const i="fixed"===Tt(e).position;let s=i?Rt(e):e;for(;yt(s)&&!Ct(s);){const t=Tt(s),n=St(s);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||wt(s)&&!n&&Kn(e,s))?r=r.filter((e=>e!==s)):o=t,s=Rt(s)}return t.set(e,r),r}(t,this._c):[].concat(n),r],s=i[0],a=i.reduce(((e,n)=>{const r=$n(t,n,o);return e.top=Jt(r.top,e.top),e.right=Gt(r.right,e.right),e.bottom=Gt(r.bottom,e.bottom),e.left=Jt(r.left,e.left),e}),$n(t,s,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:Xn,getElementRects:async function(e){const t=this.getOffsetParent||Xn,n=this.getDimensions,r=await n(e.floating);return{reference:Hn(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Ln(e);return{width:t,height:n}},getScale:zn,isElement:yt,isRTL:function(e){return"rtl"===Tt(e).direction}};function Jn(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=Fn(e),u=o||i?[...c?Nt(c):[],...Nt(t)]:[];u.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=c&&a?function(e,t){let n,r=null;const o=gt(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function s(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),i();const{left:c,top:u,width:d,height:f}=e.getBoundingClientRect();if(a||t(),!d||!f)return;const h={rootMargin:-Qt(u)+"px "+-Qt(o.clientWidth-(c+d))+"px "+-Qt(o.clientHeight-(u+f))+"px "+-Qt(c)+"px",threshold:Jt(0,Gt(1,l))||1};let p=!0;function m(e){const t=e[0].intersectionRatio;if(t!==l){if(!p)return s();t?s(!1,t):n=setTimeout((()=>{s(!1,1e-7)}),1e3)}p=!1}try{r=new IntersectionObserver(m,{...h,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(m,h)}r.observe(e)}(!0),i}(c,n):null;let f,h=-1,p=null;s&&(p=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame((()=>{var e;null==(e=p)||e.observe(t)}))),n()})),c&&!l&&p.observe(c),p.observe(t));let m=l?Wn(e):null;return l&&function t(){const r=Wn(e);!m||r.x===m.x&&r.y===m.y&&r.width===m.width&&r.height===m.height||n(),m=r,f=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=p)||e.disconnect(),p=null,l&&cancelAnimationFrame(f)}}const Zn=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),s=sn(n),a=an(n),l="y"===un(n),c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=on(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:p}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&"number"==typeof p&&(h="end"===a?-1*p:p),l?{x:h*u,y:f*c}:{x:f*c,y:h*u}}(t,e);return s===(null==(n=a.offset)?void 0:n.placement)&&null!=(r=a.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},Qn=function(e){return void 0===e&&(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:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=on(e,t),c={x:n,y:r},u=await Dn(t,l),d=un(sn(o)),f=ln(d);let h=c[f],p=c[d];if(i){const e="y"===f?"bottom":"right";h=rn(h+u["y"===f?"top":"left"],h,h-u[e])}if(s){const e="y"===d?"bottom":"right";p=rn(p+u["y"===d?"top":"left"],p,p-u[e])}const m=a.fn({...t,[f]:h,[d]:p});return{...m,data:{x:m.x-n,y:m.y-r}}}}},er=function(e){return void 0===e&&(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:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...g}=on(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=sn(o),y=un(a),b=sn(a)===a,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=f||(b||!m?[hn(a)]:function(e){const t=hn(e);return[fn(e),t,fn(t)]}(a)),_="none"!==p;!f&&_&&w.push(...function(e,t,n,r){const o=an(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}(sn(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(fn)))),i}(a,m,p,x));const E=[a,...w],S=await Dn(t,g),k=[];let C=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&k.push(S[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=an(e),o=dn(e),i=cn(o);let s="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=hn(s)),[s,hn(s)]}(o,s,x);k.push(S[e[0]],S[e[1]])}if(C=[...C,{placement:o,overflows:k}],!k.every((e=>e<=0))){var T,P;const e=((null==(T=i.flip)?void 0:T.index)||0)+1,t=E[e];if(t)return{data:{index:e,overflows:C},reset:{placement:t}};let n=null==(P=C.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:P.placement;if(!n)switch(h){case"bestFit":{var R;const e=null==(R=C.filter((e=>{if(_){const t=un(e.placement);return t===y||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:R[0];e&&(n=e);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},tr=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:s=()=>{},...a}=on(e,t),l=await Dn(t,a),c=sn(n),u=an(n),d="y"===un(n),{width:f,height:h}=r.floating;let p,m;"top"===c||"bottom"===c?(p=c,m=u===(await(null==o.isRTL?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(m=c,p="end"===u?"top":"bottom");const g=h-l.top-l.bottom,v=f-l.left-l.right,y=Gt(h-l[p],g),b=Gt(f-l[m],v),x=!t.middlewareData.shift;let w=y,_=b;if(d?_=u||x?Gt(b,v):v:w=u||x?Gt(y,g):g,x&&!u){const e=Jt(l.left,0),t=Jt(l.right,0),n=Jt(l.top,0),r=Jt(l.bottom,0);d?_=f-2*(0!==e||0!==t?e+t:Jt(l.left,l.right)):w=h-2*(0!==n||0!==r?n+r:Jt(l.top,l.bottom))}await s({...t,availableWidth:_,availableHeight:w});const E=await o.getDimensions(i.floating);return f!==E.width||h!==E.height?{reset:{rects:!0}}:{}}}},nr=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}=on(e,t)||{};if(null==c)return{};const d=pn(u),f={x:n,y:r},h=dn(o),p=cn(h),m=await s.getDimensions(c),g="y"===h,v=g?"top":"left",y=g?"bottom":"right",b=g?"clientHeight":"clientWidth",x=i.reference[p]+i.reference[h]-f[h]-i.floating[p],w=f[h]-i.reference[h],_=await(null==s.getOffsetParent?void 0:s.getOffsetParent(c));let E=_?_[b]:0;E&&await(null==s.isElement?void 0:s.isElement(_))||(E=a.floating[b]||i.floating[p]);const S=x/2-w/2,k=E/2-m[p]/2-1,C=Gt(d[v],k),T=Gt(d[y],k),P=C,R=E-m[p]-T,O=E/2-m[p]/2+S,N=rn(P,O,R),A=!l.arrow&&null!=an(o)&&O!==N&&i.reference[p]/2-(O{const r=new Map,o={platform:Gn,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=In(c,r,l),f=r,h={},p=0;for(let n=0;n{t.current=e})),t}const cr=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?nr({element:n.current,padding:r}).fn(t):{}:n?nr({element:n,padding:r}).fn(t):{};var o}}),ur=(e,t)=>({...Zn(e),options:[e,t]}),dr=(e,t)=>({...er(e),options:[e,t]}),fr=(e,t)=>({...cr(e),options:[e,t]}),hr={...o},pr=hr.useInsertionEffect||(e=>e());function mr(e){const t=o.useRef((()=>{}));return pr((()=>{t.current=e})),o.useCallback((function(){for(var e=arguments.length,n=new Array(e),r=0;r=e.current.length}function _r(e,t){return Sr(e,{disabledIndices:t})}function Er(e,t){return Sr(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Sr(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:o,amount:i=1}=void 0===t?{}:t;const s=e.current;let a=n;do{a+=r?-i:i}while(a>=0&&a<=s.length-1&&Tr(s,a,o));return a}function kr(e,t,n,r,o){if(-1===e)return-1;const i=n.indexOf(e),s=t[e];switch(o){case"tl":return i;case"tr":return s?i+s.width-1:i;case"bl":return s?i+(s.height-1)*r:i;case"br":return n.lastIndexOf(e)}}function Cr(e,t){return t.flatMap(((t,n)=>e.includes(t)?[n]:[]))}function Tr(e,t,n){if(n)return n.includes(t);const r=e[t];return null==r||r.hasAttribute("disabled")||"true"===r.getAttribute("aria-disabled")}let Pr=0;function Rr(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Pr);const i=()=>null==e?void 0:e.focus({preventScroll:n});o?i():Pr=requestAnimationFrame(i)}var Or="undefined"!=typeof document?o.useLayoutEffect:o.useEffect;function Nr(){return Nr=Object.assign?Object.assign.bind():function(e){for(var t=1;t"floating-ui-"+Math.random().toString(36).slice(2,6)+jr++,Ir=hr.useId||function(){const[e,t]=o.useState((()=>Ar?Mr():void 0));return Or((()=>{null==e&&t(Mr())}),[]),o.useEffect((()=>{Ar=!0}),[]),e},Dr=o.forwardRef((function(e,t){const{context:{placement:n,elements:{floating:r},middlewareData:{arrow:i,shift:s}},width:a=14,height:l=7,tipRadius:c=0,strokeWidth:u=0,staticOffset:d,stroke:f,d:h,style:{transform:p,...m}={},...g}=e,v=Ir(),[y,b]=o.useState(!1);if(Or((()=>{r&&"rtl"===Tt(r).direction&&b(!0)}),[r]),!r)return null;const[x,w]=n.split("-"),_="top"===x||"bottom"===x;let E=d;(_&&null!=s&&s.x||!_&&null!=s&&s.y)&&(E=null);const S=2*u,k=S/2,C=a/2*(c/-8+1),T=l/2*c/4,P=!!h,R=E&&"end"===w?"bottom":"top";let O=E&&"end"===w?"right":"left";E&&y&&(O="end"===w?"left":"right");const N=null!=(null==i?void 0:i.x)?E||i.x:"",A=null!=(null==i?void 0:i.y)?E||i.y:"",j=h||"M0,0 H"+a+" L"+(a-C)+","+(l-T)+" Q"+a/2+","+l+" "+C+","+(l-T)+" Z",M={top:P?"rotate(180deg)":"",left:P?"rotate(90deg)":"rotate(-90deg)",bottom:P?"":"rotate(180deg)",right:P?"rotate(-90deg)":"rotate(90deg)"}[x];return o.createElement("svg",Nr({},g,{"aria-hidden":!0,ref:t,width:P?a:a+S,height:a,viewBox:"0 0 "+a+" "+(l>a?l:a),style:{position:"absolute",pointerEvents:"none",[O]:N,[R]:A,[x]:_||P?"100%":"calc(100% - "+S/2+"px)",transform:""+M+(null!=p?p:""),...m}}),S>0&&o.createElement("path",{clipPath:"url(#"+v+")",fill:"none",stroke:f,strokeWidth:S+(h?0:1),d:j}),o.createElement("path",{stroke:S&&!h?g.fill:"none",d:j}),o.createElement("clipPath",{id:v},o.createElement("rect",{x:-k,y:k*(P?-1:1),width:a+S,height:a})))}));const Lr=o.createContext(null),Fr=o.createContext(null),zr=()=>{var e;return(null==(e=o.useContext(Lr))?void 0:e.id)||null},Br=()=>o.useContext(Fr);function Vr(e){return"data-floating-ui-"+e}function Wr(e){const t=(0,o.useRef)(e);return Or((()=>{t.current=e})),t}const Ur=Vr("safe-polygon");function $r(e,t,n){return n&&!Wt(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}function Kr(e,t){let n=e.filter((e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)})),r=n;for(;r.length;)r=e.filter((e=>{var t;return null==(t=r)?void 0:t.some((t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)}))})),n=n.concat(r);return n}let Hr=new WeakMap,qr=new WeakSet,Yr={},Xr=0;const Gr=e=>e&&(e.host||Gr(e.parentNode)),Jr=(e,t)=>t.map((t=>{if(e.contains(t))return t;const n=Gr(t);return e.contains(n)?n:null})).filter((e=>null!=e));function Zr(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=Ut(e[0]).body;return function(e,t,n,r){const o="data-floating-ui-inert",i=r?"inert":n?"aria-hidden":null,s=Jr(t,e),a=new Set,l=new Set(s),c=[];Yr[o]||(Yr[o]=new WeakMap);const u=Yr[o];return s.forEach((function e(t){t&&!a.has(t)&&(a.add(t),t.parentNode&&e(t.parentNode))})),function e(t){t&&!l.has(t)&&[].forEach.call(t.children,(t=>{if("script"!==pt(t))if(a.has(t))e(t);else{const e=i?t.getAttribute(i):null,n=null!==e&&"false"!==e,r=(Hr.get(t)||0)+1,s=(u.get(t)||0)+1;Hr.set(t,r),u.set(t,s),c.push(t),1===r&&n&&qr.add(t),1===s&&t.setAttribute(o,""),!n&&i&&t.setAttribute(i,"true")}}))}(t),a.clear(),Xr++,()=>{c.forEach((e=>{const t=(Hr.get(e)||0)-1,n=(u.get(e)||0)-1;Hr.set(e,t),u.set(e,n),t||(!qr.has(e)&&i&&e.removeAttribute(i),qr.delete(e)),n||e.removeAttribute(o)})),Xr--,Xr||(Hr=new WeakMap,Hr=new WeakMap,qr=new WeakSet,Yr={})}}(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const Qr=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function eo(e,t){const n=An(e,Qr());"prev"===t&&n.reverse();const r=n.indexOf(jt(Ut(e)));return n.slice(r+1)[0]}function to(){return eo(document.body,"next")}function no(){return eo(document.body,"prev")}function ro(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Mt(n,r)}function oo(e){An(e,Qr()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function io(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}const so={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function ao(e){"Tab"===e.key&&(e.target,clearTimeout(void 0))}const lo=o.forwardRef((function(e,t){const[n,r]=o.useState();Or((()=>(zt()&&r("button"),document.addEventListener("keydown",ao),()=>{document.removeEventListener("keydown",ao)})),[]);const i={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[Vr("focus-guard")]:"",style:so};return o.createElement("span",Nr({},e,i))})),co=o.createContext(null),uo=Vr("portal");function fo(e){const{children:t,id:n,root:r=null,preserveTabOrder:i=!0}=e,s=function(e){void 0===e&&(e={});const{id:t,root:n}=e,r=Ir(),i=ho(),[s,a]=o.useState(null),l=o.useRef(null);return Or((()=>()=>{null==s||s.remove(),queueMicrotask((()=>{l.current=null}))}),[s]),Or((()=>{if(!r)return;if(l.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=r,n.setAttribute(uo,""),e.appendChild(n),l.current=n,a(n)}),[t,r]),Or((()=>{if(!r)return;if(l.current)return;let e=n||(null==i?void 0:i.portalNode);e&&!yt(e)&&(e=e.current),e=e||document.body;let o=null;t&&(o=document.createElement("div"),o.id=t,e.appendChild(o));const s=document.createElement("div");s.id=r,s.setAttribute(uo,""),e=o||e,e.appendChild(s),l.current=s,a(s)}),[t,n,r,i]),s}({id:n,root:r}),[a,l]=o.useState(null),c=o.useRef(null),u=o.useRef(null),d=o.useRef(null),f=o.useRef(null),h=null==a?void 0:a.modal,p=null==a?void 0:a.open,m=!!a&&!a.modal&&a.open&&i&&!(!r&&!s);return o.useEffect((()=>{if(s&&i&&!h)return s.addEventListener("focusin",e,!0),s.addEventListener("focusout",e,!0),()=>{s.removeEventListener("focusin",e,!0),s.removeEventListener("focusout",e,!0)};function e(e){s&&ro(e)&&("focusin"===e.type?io:oo)(s)}}),[s,i,h]),o.useEffect((()=>{s&&(p||io(s))}),[p,s]),o.createElement(co.Provider,{value:o.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:c,afterOutsideRef:u,beforeInsideRef:d,afterInsideRef:f,portalNode:s,setFocusManagerState:l})),[i,s])},m&&s&&o.createElement(lo,{"data-type":"outside",ref:c,onFocus:e=>{if(ro(e,s)){var t;null==(t=d.current)||t.focus()}else{const e=no()||(null==a?void 0:a.refs.domReference.current);null==e||e.focus()}}}),m&&s&&o.createElement("span",{"aria-owns":s.id,style:so}),s&&Mn.createPortal(t,s),m&&s&&o.createElement(lo,{"data-type":"outside",ref:u,onFocus:e=>{if(ro(e,s)){var t;null==(t=f.current)||t.focus()}else{const t=to()||(null==a?void 0:a.refs.domReference.current);null==t||t.focus(),(null==a?void 0:a.closeOnFocusOut)&&(null==a||a.onOpenChange(!1,e.nativeEvent,"focus-out"))}}}))}const ho=()=>o.useContext(co),po="data-floating-ui-focusable";function mo(e){return e?e.hasAttribute(po)?e:e.querySelector("["+po+"]")||e:null}const go=20;let vo=[];function yo(e){vo=vo.filter((e=>e.isConnected));let t=e;if(t&&"body"!==pt(t)){if(!jn(t,Qr())){const e=An(t,Qr())[0];e&&(t=e)}vo.push(t),vo.length>go&&(vo=vo.slice(-go))}}function bo(){return vo.slice().reverse().find((e=>e.isConnected))}const xo=o.forwardRef((function(e,t){return o.createElement("button",Nr({},e,{type:"button",ref:t,tabIndex:-1,style:so}))}));function wo(e){const{context:t,children:n,disabled:r=!1,order:i=["content"],guards:s=!0,initialFocus:a=0,returnFocus:l=!0,restoreFocus:c=!1,modal:u=!0,visuallyHiddenDismiss:d=!1,closeOnFocusOut:f=!0}=e,{open:h,refs:p,nodeId:m,onOpenChange:g,events:v,dataRef:y,floatingId:b,elements:{domReference:x,floating:w}}=t,_="number"==typeof a&&a<0,E=Xt(x)&&_,S=!("undefined"!=typeof HTMLElement&&"inert"in HTMLElement.prototype)||s,k=Wr(i),C=Wr(a),T=Wr(l),P=Br(),R=ho(),O=o.useRef(null),N=o.useRef(null),A=o.useRef(!1),j=o.useRef(!1),M=o.useRef(-1),I=null!=R,D=mo(w),L=mr((function(e){return void 0===e&&(e=D),e?An(e,Qr()):[]})),F=mr((e=>{const t=L(e);return k.current.map((e=>x&&"reference"===e?x:D&&"floating"===e?D:t)).filter(Boolean).flat()}));function z(e){return!r&&d&&u?o.createElement(xo,{ref:"start"===e?O:N,onClick:e=>g(!1,e.nativeEvent)},"string"==typeof d?d:"Dismiss"):null}o.useEffect((()=>{A.current=!1}),[r]),o.useEffect((()=>{if(r)return;if(!u)return;function e(e){if("Tab"===e.key){Mt(D,jt(Ut(D)))&&0===L().length&&!E&&Yt(e);const t=F(),n=Kt(e);"reference"===k.current[0]&&n===x&&(Yt(e),e.shiftKey?Rr(t[t.length-1]):Rr(t[1])),"floating"===k.current[1]&&n===D&&e.shiftKey&&(Yt(e),Rr(t[0]))}}const t=Ut(D);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[r,x,D,u,k,E,L,F]),o.useEffect((()=>{if(!r&&w)return w.addEventListener("focusin",e),()=>{w.removeEventListener("focusin",e)};function e(e){const t=Kt(e),n=L().indexOf(t);-1!==n&&(M.current=n)}}),[r,w,L]),o.useEffect((()=>{if(!r&&f)return w&&bt(x)?(x.addEventListener("focusout",t),x.addEventListener("pointerdown",e),w.addEventListener("focusout",t),()=>{x.removeEventListener("focusout",t),x.removeEventListener("pointerdown",e),w.removeEventListener("focusout",t)}):void 0;function e(){j.current=!0,setTimeout((()=>{j.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=!(Mt(x,t)||Mt(w,t)||Mt(t,w)||Mt(null==R?void 0:R.portalNode,t)||null!=t&&t.hasAttribute(Vr("focus-guard"))||P&&(Kr(P.nodesRef.current,m).find((e=>{var n,r;return Mt(null==(n=e.context)?void 0:n.elements.floating,t)||Mt(null==(r=e.context)?void 0:r.elements.domReference,t)}))||function(e,t){var n;let r=[],o=null==(n=e.find((e=>e.id===t)))?void 0:n.parentId;for(;o;){const t=e.find((e=>e.id===o));o=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}(P.nodesRef.current,m).find((e=>{var n,r;return(null==(n=e.context)?void 0:n.elements.floating)===t||(null==(r=e.context)?void 0:r.elements.domReference)===t}))));if(c&&n&&jt(Ut(D))===Ut(D).body){bt(D)&&D.focus();const e=M.current,t=L(),n=t[e]||t[t.length-1]||D;bt(n)&&n.focus()}!E&&u||!t||!n||j.current||t===bo()||(A.current=!0,g(!1,e,"focus-out"))}))}}),[r,x,w,D,u,m,P,R,g,f,c,L,E]),o.useEffect((()=>{var e;if(r)return;const t=Array.from((null==R||null==(e=R.portalNode)?void 0:e.querySelectorAll("["+Vr("portal")+"]"))||[]);if(w){const e=[w,...t,O.current,N.current,k.current.includes("reference")||E?x:null].filter((e=>null!=e)),n=u||E?Zr(e,S,!S):Zr(e);return()=>{n()}}}),[r,x,w,u,k,R,E,S]),Or((()=>{if(r||!bt(D))return;const e=jt(Ut(D));queueMicrotask((()=>{const t=F(D),n=C.current,r=("number"==typeof n?t[n]:n.current)||D,o=Mt(D,e);_||o||!h||Rr(r,{preventScroll:r===D})}))}),[r,h,D,_,F,C]),Or((()=>{if(r||!D)return;let e=!1;const t=Ut(D),n=jt(t);let o=y.current.openEvent;const i=p.domReference.current;function s(t){let{open:n,reason:r,event:i,nested:s}=t;n&&(o=i),"escape-key"===r&&p.domReference.current&&yo(p.domReference.current),"hover"===r&&"mouseleave"===i.type&&(A.current=!0),"outside-press"===r&&(s?(A.current=!1,e=!0):A.current=!(Lt(i)||Ft(i)))}return yo(n),v.on("openchange",s),()=>{v.off("openchange",s);const r=jt(t),a=Mt(w,r)||P&&Kr(P.nodesRef.current,m).some((e=>{var t;return Mt(null==(t=e.context)?void 0:t.elements.floating,r)}));(a||o&&["click","mousedown"].includes(o.type))&&p.domReference.current&&yo(p.domReference.current);const l=i||n,c=An(Ut(l).body,Qr());queueMicrotask((()=>{let n=bo();!n&&bt(l)&&w&&(n=function(e,t,n){const r=e.indexOf(t);function o(t){const o=Vr("focus-guard");let i=r+(t?1:0),s=e[i];for(;s&&(!s.isConnected||s.hasAttribute(o)||Mt(n,s));)t?i++:i--,s=e[i];return s}return o(!0)||o(!1)}(c,l,w)),T.current&&!A.current&&bt(n)&&(n===r||r===t.body||a)&&n.focus({preventScroll:e})}))}}),[r,w,D,T,y,p,v,P,m]),Or((()=>{if(!r&&R)return R.setFocusManagerState({modal:u,closeOnFocusOut:f,open:h,onOpenChange:g,refs:p}),()=>{R.setFocusManagerState(null)}}),[r,R,u,h,g,p,f]),Or((()=>{if(r)return;if(!D)return;if("function"!=typeof MutationObserver)return;if(_)return;const e=()=>{const e=D.getAttribute("tabindex"),t=L(),n=jt(Ut(w)),r=t.indexOf(n);-1!==r&&(M.current=r),k.current.includes("floating")||n!==p.domReference.current&&0===t.length?"0"!==e&&D.setAttribute("tabindex","0"):"-1"!==e&&D.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(D,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}}),[r,w,D,p,k,L,_]);const B=!r&&S&&(!u||!E)&&(I||u);return o.createElement(o.Fragment,null,B&&o.createElement(lo,{"data-type":"inside",ref:null==R?void 0:R.beforeInsideRef,onFocus:e=>{if(u){const e=F();Rr("reference"===i[0]?e[0]:e[e.length-1])}else if(null!=R&&R.preserveTabOrder&&R.portalNode)if(A.current=!1,ro(e,R.portalNode)){const e=to()||x;null==e||e.focus()}else{var t;null==(t=R.beforeOutsideRef.current)||t.focus()}}}),!E&&z("start"),n,z("end"),B&&o.createElement(lo,{"data-type":"inside",ref:null==R?void 0:R.afterInsideRef,onFocus:e=>{if(u)Rr(F()[0]);else if(null!=R&&R.preserveTabOrder&&R.portalNode)if(f&&(A.current=!0),ro(e,R.portalNode)){const e=no()||x;null==e||e.focus()}else{var t;null==(t=R.afterOutsideRef.current)||t.focus()}}}))}function _o(e){return bt(e.target)&&"BUTTON"===e.target.tagName}function Eo(e){return qt(e)}function So(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:i,elements:{domReference:s}}=e,{enabled:a=!0,event:l="click",toggle:c=!0,ignoreMouse:u=!1,keyboardHandlers:d=!0}=t,f=o.useRef(),h=o.useRef(!1),p=o.useMemo((()=>({onPointerDown(e){f.current=e.pointerType},onMouseDown(e){const t=f.current;0===e.button&&"click"!==l&&(Wt(t,!0)&&u||(!n||!c||i.current.openEvent&&"mousedown"!==i.current.openEvent.type?(e.preventDefault(),r(!0,e.nativeEvent,"click")):r(!1,e.nativeEvent,"click")))},onClick(e){const t=f.current;"mousedown"===l&&f.current?f.current=void 0:Wt(t,!0)&&u||(!n||!c||i.current.openEvent&&"click"!==i.current.openEvent.type?r(!0,e.nativeEvent,"click"):r(!1,e.nativeEvent,"click"))},onKeyDown(e){f.current=void 0,e.defaultPrevented||!d||_o(e)||(" "!==e.key||Eo(s)||(e.preventDefault(),h.current=!0),"Enter"===e.key&&r(!n||!c,e.nativeEvent,"click"))},onKeyUp(e){e.defaultPrevented||!d||_o(e)||Eo(s)||" "===e.key&&h.current&&(h.current=!1,r(!n||!c,e.nativeEvent,"click"))}})),[i,s,l,u,d,r,n,c]);return o.useMemo((()=>a?{reference:p}:{}),[a,p])}const ko={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Co={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},To=e=>{var t,n;return{escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};function Po(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,elements:i,dataRef:s}=e,{enabled:a=!0,escapeKey:l=!0,outsidePress:c=!0,outsidePressEvent:u="pointerdown",referencePress:d=!1,referencePressEvent:f="pointerdown",ancestorScroll:h=!1,bubbles:p,capture:m}=t,g=Br(),v=mr("function"==typeof c?c:()=>!1),y="function"==typeof c?v:c,b=o.useRef(!1),x=o.useRef(!1),{escapeKey:w,outsidePress:_}=To(p),{escapeKey:E,outsidePress:S}=To(m),k=mr((e=>{var t;if(!n||!a||!l||"Escape"!==e.key)return;const o=null==(t=s.current.floatingContext)?void 0:t.nodeId,i=g?Kr(g.nodesRef.current,o):[];if(!w&&(e.stopPropagation(),i.length>0)){let e=!0;if(i.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}r(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")})),C=mr((e=>{var t;const n=()=>{var t;k(e),null==(t=Kt(e))||t.removeEventListener("keydown",n)};null==(t=Kt(e))||t.addEventListener("keydown",n)})),T=mr((e=>{var t;const n=b.current;b.current=!1;const o=x.current;if(x.current=!1,"click"===u&&o)return;if(n)return;if("function"==typeof y&&!y(e))return;const a=Kt(e),l="["+Vr("inert")+"]",c=Ut(i.floating).querySelectorAll(l);let d=yt(a)?a:null;for(;d&&!Ct(d);){const e=Rt(d);if(Ct(e)||!yt(e))break;d=e}if(c.length&&yt(a)&&!a.matches("html,body")&&!Mt(a,i.floating)&&Array.from(c).every((e=>!Mt(d,e))))return;if(bt(a)&&O){const t=a.clientWidth>0&&a.scrollWidth>a.clientWidth,n=a.clientHeight>0&&a.scrollHeight>a.clientHeight;let r=n&&e.offsetX>a.clientWidth;if(n&&"rtl"===Tt(a).direction&&(r=e.offsetX<=a.offsetWidth-a.clientWidth),r||t&&e.offsetY>a.clientHeight)return}const f=null==(t=s.current.floatingContext)?void 0:t.nodeId,h=g&&Kr(g.nodesRef.current,f).some((t=>{var n;return $t(e,null==(n=t.context)?void 0:n.elements.floating)}));if($t(e,i.floating)||$t(e,i.domReference)||h)return;const p=g?Kr(g.nodesRef.current,f):[];if(p.length>0){let e=!0;if(p.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}r(!1,e,"outside-press")})),P=mr((e=>{var t;const n=()=>{var t;T(e),null==(t=Kt(e))||t.removeEventListener(u,n)};null==(t=Kt(e))||t.addEventListener(u,n)}));o.useEffect((()=>{if(!n||!a)return;function e(e){r(!1,e,"ancestor-scroll")}s.current.__escapeKeyBubbles=w,s.current.__outsidePressBubbles=_;const t=Ut(i.floating);l&&t.addEventListener("keydown",E?C:k,E),y&&t.addEventListener(u,S?P:T,S);let o=[];return h&&(yt(i.domReference)&&(o=Nt(i.domReference)),yt(i.floating)&&(o=o.concat(Nt(i.floating))),!yt(i.reference)&&i.reference&&i.reference.contextElement&&(o=o.concat(Nt(i.reference.contextElement)))),o=o.filter((e=>{var n;return e!==(null==(n=t.defaultView)?void 0:n.visualViewport)})),o.forEach((t=>{t.addEventListener("scroll",e,{passive:!0})})),()=>{l&&t.removeEventListener("keydown",E?C:k,E),y&&t.removeEventListener(u,S?P:T,S),o.forEach((t=>{t.removeEventListener("scroll",e)}))}}),[s,i,l,y,u,n,r,h,a,w,_,k,E,C,T,S,P]),o.useEffect((()=>{b.current=!1}),[y,u]);const R=o.useMemo((()=>({onKeyDown:k,[ko[f]]:e=>{d&&r(!1,e.nativeEvent,"reference-press")}})),[k,r,d,f]),O=o.useMemo((()=>({onKeyDown:k,onMouseDown(){x.current=!0},onMouseUp(){x.current=!0},[Co[u]]:()=>{b.current=!0}})),[k,u]);return o.useMemo((()=>a?{reference:R,floating:O}:{}),[a,R,O])}function Ro(e){void 0===e&&(e={});const{nodeId:t}=e,n=function(e){const{open:t=!1,onOpenChange:n,elements:r}=e,i=Ir(),s=o.useRef({}),[a]=o.useState((()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}())),l=null!=zr(),[c,u]=o.useState(r.reference),d=mr(((e,t,r)=>{s.current.openEvent=e?t:void 0,a.emit("openchange",{open:e,event:t,reason:r,nested:l}),null==n||n(e,t,r)})),f=o.useMemo((()=>({setPositionReference:u})),[]),h=o.useMemo((()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference})),[c,r.reference,r.floating]);return o.useMemo((()=>({dataRef:s,open:t,onOpenChange:d,elements:h,events:a,floatingId:i,refs:f})),[t,d,h,a,i,f])}({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,i=r.elements,[s,a]=o.useState(null),[l,c]=o.useState(null),u=(null==i?void 0:i.reference)||s,d=o.useRef(null),f=Br();Or((()=>{u&&(d.current=u)}),[u]);const h=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:a}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=o.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=o.useState(r);ir(h,r)||p(r);const[m,g]=o.useState(null),[v,y]=o.useState(null),b=o.useCallback((e=>{e!==E.current&&(E.current=e,g(e))}),[]),x=o.useCallback((e=>{e!==S.current&&(S.current=e,y(e))}),[]),w=s||m,_=a||v,E=o.useRef(null),S=o.useRef(null),k=o.useRef(d),C=null!=c,T=lr(c),P=lr(i),R=o.useCallback((()=>{if(!E.current||!S.current)return;const e={placement:t,strategy:n,middleware:h};P.current&&(e.platform=P.current),rr(E.current,S.current,e).then((e=>{const t={...e,isPositioned:!0};O.current&&!ir(k.current,t)&&(k.current=t,Mn.flushSync((()=>{f(t)})))}))}),[h,t,n,P]);or((()=>{!1===u&&k.current.isPositioned&&(k.current.isPositioned=!1,f((e=>({...e,isPositioned:!1}))))}),[u]);const O=o.useRef(!1);or((()=>(O.current=!0,()=>{O.current=!1})),[]),or((()=>{if(w&&(E.current=w),_&&(S.current=_),w&&_){if(T.current)return T.current(w,_,R);R()}}),[w,_,R,T,C]);const N=o.useMemo((()=>({reference:E,floating:S,setReference:b,setFloating:x})),[b,x]),A=o.useMemo((()=>({reference:w,floating:_})),[w,_]),j=o.useMemo((()=>{const e={position:n,left:0,top:0};if(!A.floating)return e;const t=ar(A.floating,d.x),r=ar(A.floating,d.y);return l?{...e,transform:"translate("+t+"px, "+r+"px)",...sr(A.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,l,A.floating,d.x,d.y]);return o.useMemo((()=>({...d,update:R,refs:N,elements:A,floatingStyles:j})),[d,R,N,A,j])}({...e,elements:{...i,...l&&{reference:l}}}),p=o.useCallback((e=>{const t=yt(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;c(t),h.refs.setReference(t)}),[h.refs]),m=o.useCallback((e=>{(yt(e)||null===e)&&(d.current=e,a(e)),(yt(h.refs.reference.current)||null===h.refs.reference.current||null!==e&&!yt(e))&&h.refs.setReference(e)}),[h.refs]),g=o.useMemo((()=>({...h.refs,setReference:m,setPositionReference:p,domReference:d})),[h.refs,m,p]),v=o.useMemo((()=>({...h.elements,domReference:u})),[h.elements,u]),y=o.useMemo((()=>({...h,...r,refs:g,elements:v,nodeId:t})),[h,g,v,t,r]);return Or((()=>{r.dataRef.current.floatingContext=y;const e=null==f?void 0:f.nodesRef.current.find((e=>e.id===t));e&&(e.context=y)})),o.useMemo((()=>({...h,context:y,refs:g,elements:v})),[h,g,v,y])}const Oo="active",No="selected";function Ao(e,t,n){const r=new Map,o="item"===n;let i=e;if(o&&e){const{[Oo]:t,[No]:__,...n}=e;i=n}return{..."floating"===n&&{tabIndex:-1,[po]:""},...i,...t.map((t=>{const r=t?t[n]:null;return"function"==typeof r?e?r(e):null:r})).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,i]=t;var s;o&&[Oo,No].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof i&&(null==(s=r.get(n))||s.push(i),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),i=0;ie(...o))).find((e=>void 0!==e))})):e[n]=i)})),e):e),{})}}function jo(e){void 0===e&&(e=[]);const t=e.map((e=>null==e?void 0:e.reference)),n=e.map((e=>null==e?void 0:e.floating)),r=e.map((e=>null==e?void 0:e.item)),i=o.useCallback((t=>Ao(t,e,"reference")),t),s=o.useCallback((t=>Ao(t,e,"floating")),n),a=o.useCallback((t=>Ao(t,e,"item")),r);return o.useMemo((()=>({getReferenceProps:i,getFloatingProps:s,getItemProps:a})),[i,s,a])}let Mo=!1;function Io(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Do(e,t){return Io(t,e===gr||e===vr,e===yr||e===br)}function Lo(e,t,n){return Io(t,e===vr,n?e===yr:e===br)||"Enter"===e||" "===e||""===e}function Fo(e,t,n){return Io(t,n?e===br:e===yr,e===gr)}function zo(e,t){const{open:n,onOpenChange:r,elements:i}=e,{listRef:s,activeIndex:a,onNavigate:l=()=>{},enabled:c=!0,selectedIndex:u=null,allowEscape:d=!1,loop:f=!1,nested:h=!1,rtl:p=!1,virtual:m=!1,focusItemOnOpen:g="auto",focusItemOnHover:v=!0,openOnArrowKeyDown:y=!0,disabledIndices:b,orientation:x="vertical",cols:w=1,scrollItemIntoView:_=!0,virtualItemRef:E,itemSizes:S,dense:k=!1}=t,C=Wr(mo(i.floating)),T=zr(),P=Br(),R=mr(l),O=o.useRef(g),N=o.useRef(null!=u?u:-1),A=o.useRef(null),j=o.useRef(!0),M=o.useRef(R),I=o.useRef(!!i.floating),D=o.useRef(n),L=o.useRef(!1),F=o.useRef(!1),z=Wr(b),B=Wr(n),V=Wr(_),W=Wr(u),[U,$]=o.useState(),[K,H]=o.useState(),q=mr((function(e,t,n){function r(e){m?($(e.id),null==P||P.events.emit("virtualfocus",e),E&&(E.current=e)):Rr(e,{preventScroll:!0,sync:!(!Vt()||!zt())&&(Mo||L.current)})}void 0===n&&(n=!1);const o=e.current[t.current];o&&r(o),requestAnimationFrame((()=>{const i=e.current[t.current]||o;if(!i)return;o||r(i);const s=V.current;s&&X&&(n||!j.current)&&(null==i.scrollIntoView||i.scrollIntoView("boolean"==typeof s?{block:"nearest",inline:"nearest"}:s))}))}));Or((()=>{document.createElement("div").focus({get preventScroll(){return Mo=!0,!1}})}),[]),Or((()=>{c&&(n&&i.floating?O.current&&null!=u&&(F.current=!0,N.current=u,R(u)):I.current&&(N.current=-1,M.current(null)))}),[c,n,i.floating,u,R]),Or((()=>{if(c&&n&&i.floating)if(null==a){if(L.current=!1,null!=W.current)return;if(I.current&&(N.current=-1,q(s,N)),(!D.current||!I.current)&&O.current&&(null!=A.current||!0===O.current&&null==A.current)){let e=0;const t=()=>{null==s.current[0]?(e<2&&(e?requestAnimationFrame:queueMicrotask)(t),e++):(N.current=null==A.current||Lo(A.current,x,p)||h?_r(s,z.current):Er(s,z.current),A.current=null,R(N.current))};t()}}else wr(s,a)||(N.current=a,q(s,N,F.current),F.current=!1)}),[c,n,i.floating,a,W,h,s,x,p,R,q,z]),Or((()=>{var e;if(!c||i.floating||!P||m||!I.current)return;const t=P.nodesRef.current,n=null==(e=t.find((e=>e.id===T)))||null==(e=e.context)?void 0:e.elements.floating,r=jt(Ut(i.floating)),o=t.some((e=>e.context&&Mt(e.context.elements.floating,r)));n&&!o&&j.current&&n.focus({preventScroll:!0})}),[c,i.floating,P,T,m]),Or((()=>{if(c&&P&&m&&!T)return P.events.on("virtualfocus",e),()=>{P.events.off("virtualfocus",e)};function e(e){H(e.id),E&&(E.current=e)}}),[c,P,m,T,E]),Or((()=>{M.current=R,I.current=!!i.floating})),Or((()=>{n||(A.current=null)}),[n]),Or((()=>{D.current=n}),[n]);const Y=null!=a,X=o.useMemo((()=>{function e(e){if(!n)return;const t=s.current.indexOf(e);-1!==t&&R(t)}return{onFocus(t){let{currentTarget:n}=t;e(n)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},...v&&{onMouseMove(t){let{currentTarget:n}=t;e(n)},onPointerLeave(e){let{pointerType:t}=e;j.current&&"touch"!==t&&(N.current=-1,q(s,N),R(null),m||Rr(C.current,{preventScroll:!0}))}}}}),[n,C,q,v,s,R,m]),G=mr((e=>{if(j.current=!1,L.current=!0,!B.current&&e.currentTarget===C.current)return;if(h&&Fo(e.key,x,p))return Yt(e),r(!1,e.nativeEvent,"list-navigation"),void(bt(i.domReference)&&!m&&i.domReference.focus());const t=N.current,o=_r(s,b),a=Er(s,b);if("Home"===e.key&&(Yt(e),N.current=o,R(N.current)),"End"===e.key&&(Yt(e),N.current=a,R(N.current)),w>1){const t=S||Array.from({length:s.current.length},(()=>({width:1,height:1}))),n=function(e,t,n){const r=[];let o=0;return e.forEach(((e,i)=>{let{width:s,height:a}=e,l=!1;for(n&&(o=0);!l;){const e=[];for(let n=0;nnull==r[e]))?(e.forEach((e=>{r[e]=i})),l=!0):o++}})),[...r]}(t,w,k),r=n.findIndex((e=>null!=e&&!Tr(s.current,e,b))),i=n.reduce(((e,t,n)=>null==t||Tr(s.current,t,b)?e:n),-1),l=n[function(e,t){let{event:n,orientation:r,loop:o,cols:i,disabledIndices:s,minIndex:a,maxIndex:l,prevIndex:c,stopEvent:u=!1}=t,d=c;if(n.key===gr){if(u&&Yt(n),-1===c)d=l;else if(d=Sr(e,{startingIndex:d,amount:i,decrement:!0,disabledIndices:s}),o&&(c-ie?n:n-i}wr(e,d)&&(d=c)}if(n.key===vr&&(u&&Yt(n),-1===c?d=a:(d=Sr(e,{startingIndex:c,amount:i,disabledIndices:s}),o&&c+i>l&&(d=Sr(e,{startingIndex:c%i-i,amount:i,disabledIndices:s}))),wr(e,d)&&(d=c)),"both"===r){const t=Qt(c/i);n.key===br&&(u&&Yt(n),c%i!=i-1?(d=Sr(e,{startingIndex:c,disabledIndices:s}),o&&xr(d,i,t)&&(d=Sr(e,{startingIndex:c-c%i-1,disabledIndices:s}))):o&&(d=Sr(e,{startingIndex:c-c%i-1,disabledIndices:s})),xr(d,i,t)&&(d=c)),n.key===yr&&(u&&Yt(n),c%i!=0?(d=Sr(e,{startingIndex:c,decrement:!0,disabledIndices:s}),o&&xr(d,i,t)&&(d=Sr(e,{startingIndex:c+(i-c%i),decrement:!0,disabledIndices:s}))):o&&(d=Sr(e,{startingIndex:c+(i-c%i),decrement:!0,disabledIndices:s})),xr(d,i,t)&&(d=c));const r=Qt(l/i)===t;wr(e,d)&&(d=o&&r?n.key===yr?l:Sr(e,{startingIndex:c-c%i-1,disabledIndices:s}):c)}return d}({current:n.map((e=>null!=e?s.current[e]:null))},{event:e,orientation:x,loop:f,cols:w,disabledIndices:Cr([...b||s.current.map(((e,t)=>Tr(s.current,t)?t:void 0)),void 0],n),minIndex:r,maxIndex:i,prevIndex:kr(N.current>a?o:N.current,t,n,w,e.key===vr?"bl":e.key===br?"tr":"tl"),stopEvent:!0})];if(null!=l&&(N.current=l,R(N.current)),"both"===x)return}if(Do(e.key,x)){if(Yt(e),n&&!m&&jt(e.currentTarget.ownerDocument)===e.currentTarget)return N.current=Lo(e.key,x,p)?o:a,void R(N.current);Lo(e.key,x,p)?N.current=f?t>=a?d&&t!==s.current.length?-1:o:Sr(s,{startingIndex:t,disabledIndices:b}):Math.min(a,Sr(s,{startingIndex:t,disabledIndices:b})):N.current=f?t<=o?d&&-1!==t?s.current.length:a:Sr(s,{startingIndex:t,decrement:!0,disabledIndices:b}):Math.max(o,Sr(s,{startingIndex:t,decrement:!0,disabledIndices:b})),wr(s,N.current)?R(null):R(N.current)}})),J=o.useMemo((()=>m&&n&&Y&&{"aria-activedescendant":K||U}),[m,n,Y,K,U]),Z=o.useMemo((()=>({"aria-orientation":"both"===x?void 0:x,...!Xt(i.domReference)&&J,onKeyDown:G,onPointerMove(){j.current=!0}})),[J,G,i.domReference,x]),Q=o.useMemo((()=>{function e(e){"auto"===g&&Lt(e.nativeEvent)&&(O.current=!0)}return{...J,onKeyDown(e){j.current=!1;const t=0===e.key.indexOf("Arrow"),o=function(e,t,n){return Io(t,n?e===yr:e===br,e===vr)}(e.key,x,p),i=Fo(e.key,x,p),a=Do(e.key,x),l=(h?o:a)||"Enter"===e.key||""===e.key.trim();if(m&&n){const n=null==P?void 0:P.nodesRef.current.find((e=>null==e.parentId)),r=P&&n?function(e,t){let n,r=-1;return function t(o,i){i>r&&(n=o,r=i),Kr(e,o).forEach((e=>{t(e.id,i+1)}))}(t,0),e.find((e=>e.id===n))}(P.nodesRef.current,n.id):null;if(t&&r&&E){const t=new KeyboardEvent("keydown",{key:e.key,bubbles:!0});if(o||i){var c,d;const n=(null==(c=r.context)?void 0:c.elements.domReference)===e.currentTarget,a=i&&!n?null==(d=r.context)?void 0:d.elements.domReference:o?s.current.find((e=>(null==e?void 0:e.id)===U)):null;a&&(Yt(e),a.dispatchEvent(t),H(void 0))}var f;if(a&&r.context&&r.context.open&&r.parentId&&e.currentTarget!==r.context.elements.domReference)return Yt(e),void(null==(f=r.context.elements.domReference)||f.dispatchEvent(t))}return G(e)}(n||y||!t)&&(l&&(A.current=h&&a?null:e.key),h?o&&(Yt(e),n?(N.current=_r(s,z.current),R(N.current)):r(!0,e.nativeEvent,"list-navigation")):a&&(null!=u&&(N.current=u),Yt(e),!n&&y?r(!0,e.nativeEvent,"list-navigation"):G(e),n&&R(N.current)))},onFocus(){n&&!m&&R(null)},onPointerDown:function(e){O.current=g,"auto"===g&&Ft(e.nativeEvent)&&(O.current=!0)},onMouseDown:e,onClick:e}}),[U,J,G,z,g,s,h,R,r,n,y,x,p,u,P,m,E]);return o.useMemo((()=>c?{reference:Q,floating:Z,item:X}:{}),[c,Q,Z,X])}const Bo=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Vo(e,t){var n;void 0===t&&(t={});const{open:r,floatingId:i}=e,{enabled:s=!0,role:a="dialog"}=t,l=null!=(n=Bo.get(a))?n:a,c=Ir(),u=null!=zr(),d=o.useMemo((()=>"tooltip"===l||"label"===a?{["aria-"+("label"===a?"labelledby":"describedby")]:r?i:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":"alertdialog"===l?"dialog":l,"aria-controls":r?i:void 0,..."listbox"===l&&{role:"combobox"},..."menu"===l&&{id:c},..."menu"===l&&u&&{role:"menuitem"},..."select"===a&&{"aria-autocomplete":"none"},..."combobox"===a&&{"aria-autocomplete":"list"}}),[l,i,u,r,c,a]),f=o.useMemo((()=>{const e={id:i,...l&&{role:l}};return"tooltip"===l||"label"===a?e:{...e,..."menu"===l&&{"aria-labelledby":c}}}),[l,i,c,a]),h=o.useCallback((e=>{let{active:t,selected:n}=e;const r={role:"option",...t&&{id:i+"-option"}};switch(a){case"select":return{...r,"aria-selected":t&&n};case"combobox":return{...r,...t&&{"aria-selected":!0}}}return{}}),[i,a]);return o.useMemo((()=>s?{reference:d,floating:f,item:h}:{}),[s,d,f,h])}const Wo=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function Uo(e,t){return"function"==typeof e?e(t):e}function $o(e,t){const[n,r]=e;let o=!1;const i=t.length;for(let e=0,s=i-1;e=r!=c>=r&&n<=(l-i)*(r-a)/(c-a)+i&&(o=!o)}return o}function Ko(e){void 0===e&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e;let o,i=!1,s=null,a=null,l=performance.now();const c=e=>{let{x:n,y:c,placement:u,elements:d,onClose:f,nodeId:h,tree:p}=e;return function(e){function m(){clearTimeout(o),f()}if(clearTimeout(o),!d.domReference||!d.floating||null==u||null==n||null==c)return;const{clientX:g,clientY:v}=e,y=[g,v],b=Kt(e),x="mouseleave"===e.type,w=Mt(d.floating,b),_=Mt(d.domReference,b),E=d.domReference.getBoundingClientRect(),S=d.floating.getBoundingClientRect(),k=u.split("-")[0],C=n>S.right-S.width/2,T=c>S.bottom-S.height/2,P=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(y,E),R=S.width>E.width,O=S.height>E.height,N=(R?E:S).left,A=(R?E:S).right,j=(O?E:S).top,M=(O?E:S).bottom;if(w&&(i=!0,!x))return;if(_&&(i=!1),_&&!x)return void(i=!0);if(x&&yt(e.relatedTarget)&&Mt(d.floating,e.relatedTarget))return;if(p&&Kr(p.nodesRef.current,h).some((e=>{let{context:t}=e;return null==t?void 0:t.open})))return;if("top"===k&&c>=E.bottom-1||"bottom"===k&&c<=E.top+1||"left"===k&&n>=E.right-1||"right"===k&&n<=E.left+1)return m();let I=[];switch(k){case"top":I=[[N,E.top+1],[N,S.bottom-1],[A,S.bottom-1],[A,E.top+1]];break;case"bottom":I=[[N,S.top+1],[N,E.bottom-1],[A,E.bottom-1],[A,S.top+1]];break;case"left":I=[[S.right-1,M],[S.right-1,j],[E.left+1,j],[E.left+1,M]];break;case"right":I=[[E.right-1,M],[E.right-1,j],[S.left+1,j],[S.left+1,M]]}if(!$o([g,v],I)){if(i&&!P)return m();if(!x&&r){const t=function(e,t){const n=performance.now(),r=n-l;if(null===s||null===a||0===r)return s=e,a=t,l=n,null;const o=e-s,i=t-a,c=Math.sqrt(o*o+i*i);return s=e,a=t,l=n,c/r}(e.clientX,e.clientY);if(null!==t&&t<.1)return m()}$o([g,v],function(e){let[n,r]=e;switch(k){case"top":return[[R?n+t/2:C?n+4*t:n-4*t,r+t+1],[R?n-t/2:C?n+4*t:n-4*t,r+t+1],[S.left,C||R?S.bottom-t:S.top],[S.right,C?R?S.bottom-t:S.top:S.bottom-t]];case"bottom":return[[R?n+t/2:C?n+4*t:n-4*t,r-t],[R?n-t/2:C?n+4*t:n-4*t,r-t],[S.left,C||R?S.top+t:S.bottom],[S.right,C?R?S.top+t:S.bottom:S.top+t]];case"left":{const e=[n+t+1,O?r+t/2:T?r+4*t:r-4*t],o=[n+t+1,O?r-t/2:T?r+4*t:r-4*t];return[[T||O?S.right-t:S.left,S.top],[T?O?S.right-t:S.left:S.right-t,S.bottom],e,o]}case"right":return[[n-t,O?r+t/2:T?r+4*t:r-4*t],[n-t,O?r-t/2:T?r+4*t:r-4*t],[T||O?S.left+t:S.right,S.top],[T?O?S.left+t:S.right:S.left+t,S.bottom]]}}([n,c]))?!i&&r&&(o=window.setTimeout(m,40)):m()}}};return c.__options={blockPointerEvents:n},c}const Ho=be("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),qo=be("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);var Yo="light",Xo=function(e){var t=e.icon,n=void 0===t?null:t,r=e.theme,i=void 0===r?Yo:r,s=e.variant,a=void 0===s?"neutral":s,l="[&>svg]:h-5 [&>svg]:w-5",c="light"===i?"text-icon-secondary":"text-icon-inverse";if(n&&(0,o.isValidElement)(n))return{updatedIcon:(0,o.cloneElement)(n,{className:te(l,c,n.props.className)})};switch(a){case"neutral":return React.createElement(Be,{className:te(l,c)});case"info":var u="light"===i?"text-support-info":"text-support-info-inverse";return React.createElement(Be,{className:te(l,u)});case"success":var d="light"===i?"text-support-success":"text-support-success-inverse";return React.createElement(we,{className:te(l,d)});case"warning":var f="light"===i?"text-support-warning":"text-support-warning-inverse";return React.createElement(Ho,{className:te(l,f)});case"error":var h="light"===i?"text-support-error":"text-support-error-inverse";return React.createElement(qo,{className:te(l,h)});default:return null}},Go=function(e){var t=e.actionType,n=void 0===t?"button":t,r=e.onAction,o=void 0===r?function(){}:r,i=e.actionLabel,s=void 0===i?"":i,a=e.theme,l=void 0===a?Yo:a,c="focus:ring-0 focus:ring-offset-0 ring-offset-0 focus:outline-none",u="text-button-primary border-button-primary hover:border-button-primary hover:text-button-primary-hover";switch("dark"===l&&(u="text-text-inverse border-text-inverse hover:border-text-inverse hover:text-text-inverse"),n){case"button":return React.createElement(ae,{variant:"outline",size:"xs",onClick:o,className:te("rounded",c,u,"dark"===l?"bg-transparent hover:bg-transparent":"bg-white hover:bg-white")},s);case"link":return React.createElement(ae,{variant:"link",size:"xs",onClick:o,className:te(c,u)},s);default:return null}},Jo=function(e){var t=e.theme,n=void 0===t?Yo:t,r=e.title,o=void 0===r?"":r;return!o&&isNaN(o)?null:React.createElement("span",{className:te("block",{light:"text-text-primary",dark:"text-text-inverse"}[n],"text-sm leading-5 font-semibold")},o)},Zo=function(e){var t=e.theme,n=void 0===t?Yo:t,r=e.content,o=void 0===r?"":r;return!o&&isNaN(o)?null:React.createElement("span",{className:te({light:"text-text-primary",dark:"text-text-inverse"}[n],"block text-sm [&_*]:text-sm leading-5 [&_*]:leading-5 font-normal")},o)},Qo=function(){for(var e=arguments.length,t=new Array(e),n=0;ne.length)&&(t=e.length);for(var n=0,r=Array(t);n{})),C=o.useCallback((()=>{var e;const t=null==(e=i.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}),[i]);o.useEffect((()=>{if(l)return s.on("openchange",e),()=>{s.off("openchange",e)};function e(e){let{open:t}=e;t||(clearTimeout(x.current),clearTimeout(_.current),E.current=!0)}}),[l,s]),o.useEffect((()=>{if(!l)return;if(!g.current)return;if(!n)return;function e(e){C()&&r(!1,e,"hover")}const t=Ut(a.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[a.floating,n,r,l,g,C]);const T=o.useCallback((function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const o=$r(v.current,"close",b.current);o&&!w.current?(clearTimeout(x.current),x.current=window.setTimeout((()=>r(!1,e,n)),o)):t&&(clearTimeout(x.current),r(!1,e,n))}),[v,r]),P=mr((()=>{k.current(),w.current=void 0})),R=mr((()=>{if(S.current){const e=Ut(a.floating).body;e.style.pointerEvents="",e.removeAttribute(Ur),S.current=!1}}));o.useEffect((()=>{if(l&&yt(a.domReference)){var e;const t=a.domReference;return n&&t.addEventListener("mouseleave",c),null==(e=a.floating)||e.addEventListener("mouseleave",c),h&&t.addEventListener("mousemove",o,{once:!0}),t.addEventListener("mouseenter",o),t.addEventListener("mouseleave",s),()=>{var e;n&&t.removeEventListener("mouseleave",c),null==(e=a.floating)||e.removeEventListener("mouseleave",c),h&&t.removeEventListener("mousemove",o),t.removeEventListener("mouseenter",o),t.removeEventListener("mouseleave",s)}}function t(){return!!i.current.openEvent&&["click","mousedown"].includes(i.current.openEvent.type)}function o(e){if(clearTimeout(x.current),E.current=!1,d&&!Wt(b.current)||f>0&&!$r(v.current,"open"))return;const t=$r(v.current,"open",b.current);t?x.current=window.setTimeout((()=>{y.current||r(!0,e,"hover")}),t):r(!0,e,"hover")}function s(e){if(t())return;k.current();const r=Ut(a.floating);if(clearTimeout(_.current),g.current&&i.current.floatingContext){n||clearTimeout(x.current),w.current=g.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){R(),P(),T(e,!0,"safe-polygon")}});const t=w.current;return r.addEventListener("mousemove",t),void(k.current=()=>{r.removeEventListener("mousemove",t)})}("touch"!==b.current||!Mt(a.floating,e.relatedTarget))&&T(e)}function c(e){t()||i.current.floatingContext&&(null==g.current||g.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){R(),P(),T(e)}})(e))}}),[a,l,e,d,f,h,T,P,R,r,n,y,p,v,g,i]),Or((()=>{var e;if(l&&n&&null!=(e=g.current)&&e.__options.blockPointerEvents&&C()){S.current=!0;const e=a.floating;if(yt(a.domReference)&&e){var t;const n=Ut(a.floating).body;n.setAttribute(Ur,"");const r=a.domReference,o=null==p||null==(t=p.nodesRef.current.find((e=>e.id===m)))||null==(t=t.context)?void 0:t.elements.floating;return o&&(o.style.pointerEvents=""),n.style.pointerEvents="none",r.style.pointerEvents="auto",e.style.pointerEvents="auto",()=>{n.style.pointerEvents="",r.style.pointerEvents="",e.style.pointerEvents=""}}}}),[l,n,m,a,p,g,C]),Or((()=>{n||(b.current=void 0,P(),R())}),[n,P,R]),o.useEffect((()=>()=>{P(),clearTimeout(x.current),clearTimeout(_.current),R()}),[l,a.domReference,P,R]);const O=o.useMemo((()=>{function e(e){b.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function o(){E.current||y.current||r(!0,t,"hover")}d&&!Wt(b.current)||n||0===f||(clearTimeout(_.current),"touch"===b.current?o():_.current=window.setTimeout(o,f))}}}),[d,r,n,y,f]),N=o.useMemo((()=>({onMouseEnter(){clearTimeout(x.current)},onMouseLeave(e){T(e.nativeEvent,!1)}})),[T]);return o.useMemo((()=>l?{reference:O,floating:N}:{}),[l,O,N])}(W,ri({move:!1,enabled:!M&&N.includes("hover")},j&&{handleClose:Ko()})),K=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,events:i,dataRef:s,elements:a}=e,{enabled:l=!0,visibleOnly:c=!0}=t,u=o.useRef(!1),d=o.useRef(),f=o.useRef(!0);o.useEffect((()=>{if(!l)return;const e=mt(a.domReference);function t(){!n&&bt(a.domReference)&&a.domReference===jt(Ut(a.domReference))&&(u.current=!0)}function r(){f.current=!0}return e.addEventListener("blur",t),e.addEventListener("keydown",r,!0),()=>{e.removeEventListener("blur",t),e.removeEventListener("keydown",r,!0)}}),[a.domReference,n,l]),o.useEffect((()=>{if(l)return i.on("openchange",e),()=>{i.off("openchange",e)};function e(e){let{reason:t}=e;"reference-press"!==t&&"escape-key"!==t||(u.current=!0)}}),[i,l]),o.useEffect((()=>()=>{clearTimeout(d.current)}),[]);const h=o.useMemo((()=>({onPointerDown(e){Ft(e.nativeEvent)||(f.current=!1)},onMouseLeave(){u.current=!1},onFocus(e){if(u.current)return;const t=Kt(e.nativeEvent);if(c&&yt(t))try{if(zt()&&Vt())throw Error();if(!t.matches(":focus-visible"))return}catch(e){if(!f.current&&!qt(t))return}r(!0,e.nativeEvent,"focus")},onBlur(e){u.current=!1;const t=e.relatedTarget,n=e.nativeEvent,o=yt(t)&&t.hasAttribute(Vr("focus-guard"))&&"outside"===t.getAttribute("data-type");d.current=window.setTimeout((()=>{var e;const i=jt(a.domReference?a.domReference.ownerDocument:document);(t||i!==a.domReference)&&(Mt(null==(e=s.current.floatingContext)?void 0:e.refs.floating.current,i)||Mt(a.domReference,i)||o||r(!1,n,"focus"))}))}})),[s,a.domReference,r,c]);return o.useMemo((()=>l?{reference:h}:{}),[l,h])}(W,{enabled:!M&&N.includes("focus")}),H=jo([U,$,K,Po(W),Vo(W,{role:"tooltip"})]),q=H.getReferenceProps,Y=H.getFloatingProps,X=function(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:r,close:i,common:s,duration:a=250}=t,l=e.placement,c=l.split("-")[0],u=o.useMemo((()=>({side:c,placement:l})),[c,l]),d="number"==typeof a,f=(d?a:a.open)||0,h=(d?a:a.close)||0,[p,m]=o.useState((()=>({...Uo(s,u),...Uo(n,u)}))),{isMounted:g,status:v}=function(e,t){void 0===t&&(t={});const{open:n,elements:{floating:r}}=e,{duration:i=250}=t,s=("number"==typeof i?i:i.close)||0,[a,l]=o.useState("unmounted"),c=function(e,t){const[n,r]=o.useState(e);return e&&!n&&r(!0),o.useEffect((()=>{if(!e&&n){const e=setTimeout((()=>r(!1)),t);return()=>clearTimeout(e)}}),[e,n,t]),n}(n,s);return c||"close"!==a||l("unmounted"),Or((()=>{if(r){if(n){l("initial");const e=requestAnimationFrame((()=>{l("open")}));return()=>{cancelAnimationFrame(e)}}l("close")}}),[n,r]),{isMounted:c,status:a}}(e,{duration:a}),y=Wr(n),b=Wr(r),x=Wr(i),w=Wr(s);return Or((()=>{const e=Uo(y.current,u),t=Uo(x.current,u),n=Uo(w.current,u),r=Uo(b.current,u)||Object.keys(e).reduce(((e,t)=>(e[t]="",e)),{});if("initial"===v&&m((t=>({transitionProperty:t.transitionProperty,...n,...e}))),"open"===v&&m({transitionProperty:Object.keys(r).map(Wo).join(","),transitionDuration:f+"ms",...n,...r}),"close"===v){const r=t||e;m({transitionProperty:Object.keys(r).map(Wo).join(","),transitionDuration:h+"ms",...n,...r})}}),[h,x,y,b,w,f,v,u]),{isMounted:g,styles:p}}(W,{duration:150,initial:{opacity:0},open:{opacity:1},close:{opacity:0}}),G=X.isMounted,J=X.styles,Z=null===(t={light:"bg-tooltip-background-light text-text-primary",dark:"bg-tooltip-background-dark text-text-on-color"})||void 0===t?void 0:t[l],Q="dark"===l?"text-tooltip-background-dark":"text-tooltip-background-light";return i().createElement(i().Fragment,null,(0,o.isValidElement)(y)&&(0,o.cloneElement)(y,ri(ri({},y.props),{},{ref:Qo(y.ref,B.setReference),className:te(y.props.className)},q())),i().createElement(fo,{id:E,root:w},G&&i().createElement("div",ti({className:te("absolute z-20 py-2 px-3 rounded-md text-xs leading-4 shadow-soft-shadow-lg",Z,"max-w-80 w-fit",b),ref:B.setFloating,style:ri(ri({},V),J)},Y()),i().createElement("div",null,!!f&&i().createElement("span",{className:"font-semibold"},f),!!h&&i().createElement("div",{className:"font-normal"},h)),m&&i().createElement(Dr,{ref:F,context:W,placement:u,className:te("fill-current",Q)}))))},ai=["slug","text","icon","className","disabled","isFirstChild","isLastChild"];function li(){return li=Object.assign?Object.assign.bind():function(e){for(var t=1;tsvg]:h-4 [&>svg]:w-4",sm:"py-2 px-2 text-base gap-1 [&>svg]:h-4 [&>svg]:w-4",md:"py-2.5 px-2.5 text-base gap-1 [&>svg]:h-5 [&>svg]:w-5"}[g],"border-0 border-r border-border-subtle border-solid",p===r?"bg-button-disabled":"",d?"rounded-tl rounded-bl border-0 border-r border-border-subtle":"",f?"rounded-tr rounded-br border-0":"",l);return i().createElement("button",li({ref:t,className:y,disabled:u,onClick:function(e){m(e,{slug:r,text:s})}},h),"left"===v&&a&&i().createElement("span",{className:"mr-1"},a),s,"right"===v&&a&&i().createElement("span",{className:"ml-1"},a))},di=(0,o.forwardRef)(ui);di.displayName="Button";var fi={Group:function(e){var t=e.children,n=e.activeItem,r=void 0===n?null:n,s=e.onChange,a=e.className,l=e.size,c=void 0===l?"md":l,u=e.iconPosition,d=void 0===u?"left":u,f=(0,o.useCallback)((function(e,t){s&&s({event:e,value:t})}),[s]),h=te("box-border flex border border-border-subtle border-solid rounded",a);return i().createElement("div",{className:h},i().createElement(ci.Provider,{value:{activeItem:r,onChange:f,size:c,iconPosition:d}},i().Children.map(t,(function(e,n){if(!(0,o.isValidElement)(e))return null;var r=0===n,s=n===i().Children.count(t)-1;return i().cloneElement(e,{index:n,isFirstChild:r,isLastChild:s})}))))},Button:di},hi=fi;function pi(e){if("undefined"==typeof Proxy)return e;const t=new Map;return new Proxy(e,{get:(n,r)=>(t.has(r)||t.set(r,e(r)),t.get(r))})}function mi(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}const gi=e=>Array.isArray(e);function vi(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r{t[0][n]=e.get(),t[1][n]=e.getVelocity()})),t}function xi(e,t,n,r){if("function"==typeof t){const[o,i]=bi(r);t=t(void 0!==n?n:e.custom,o,i)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){const[o,i]=bi(r);t=t(void 0!==n?n:e.custom,o,i)}return t}function wi(e,t,n){const r=e.getProps();return xi(r,t,void 0!==n?n:r.custom,e)}const _i=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ei=["initial",..._i],Si=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ki=new Set(Si),Ci=e=>1e3*e,Ti=e=>e/1e3,Pi={type:"spring",stiffness:500,damping:25,restSpeed:10},Ri={type:"keyframes",duration:.8},Oi={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Ni=(e,{keyframes:t})=>t.length>2?Ri:ki.has(e)?e.startsWith("scale")?{type:"spring",stiffness:550,damping:0===t[1]?2*Math.sqrt(550):30,restSpeed:10}:Pi:Oi;function Ai(e,t){return e[t]||e.default||e}const ji=e=>null!==e;function Mi(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(ji),i=t&&"loop"!==n&&t%2==1?0:o.length-1;return i&&void 0!==r?r:o[i]}const Ii=e=>e,Di=["read","resolveKeyframes","update","preRender","render","postRender"];function Li(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,s=Di.reduce(((e,t)=>(e[t]=function(e){let t=new Set,n=new Set,r=!1,o=!1;const i=new WeakSet;let s={delta:0,timestamp:0,isProcessing:!1};function a(t){i.has(t)&&(l.schedule(t),e()),t(s)}const l={schedule:(e,o=!1,s=!1)=>{const a=s&&r?t:n;return o&&i.add(e),a.has(e)||a.add(e),e},cancel:e=>{n.delete(e),i.delete(e)},process:e=>{s=e,r?o=!0:(r=!0,[t,n]=[n,t],n.clear(),t.forEach(a),r=!1,o&&(o=!1,l.process(e)))}};return l}(i),e)),{}),{read:a,resolveKeyframes:l,update:c,preRender:u,render:d,postRender:f}=s,h=()=>{const i=performance.now();n=!1,o.delta=r?1e3/60:Math.max(Math.min(i-o.timestamp,40),1),o.timestamp=i,o.isProcessing=!0,a.process(o),l.process(o),c.process(o),u.process(o),d.process(o),f.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(h))};return{schedule:Di.reduce(((t,i)=>{const a=s[i];return t[i]=(t,i=!1,s=!1)=>(n||(n=!0,r=!0,o.isProcessing||e(h)),a.schedule(t,i,s)),t}),{}),cancel:e=>{for(let t=0;t/^0[^.\s]+$/u.test(e);let Ui=Ii,$i=Ii;const Ki=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Hi=e=>t=>"string"==typeof t&&t.startsWith(e),qi=Hi("--"),Yi=Hi("var(--"),Xi=e=>!!Yi(e)&&Gi.test(e.split("/*")[0].trim()),Gi=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Ji=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Zi(e,t,n=1){$i(n<=4,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,o]=function(e){const t=Ji.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${null!=n?n:r}`,o]}(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const e=i.trim();return Ki(e)?parseFloat(e):e}return Xi(o)?Zi(o,t,n+1):o}const Qi=(e,t,n)=>n>t?t:n"number"==typeof e,parse:parseFloat,transform:e=>e},ts={...es,transform:e=>Qi(0,1,e)},ns={...es,default:1},rs=e=>Math.round(1e5*e)/1e5,os=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,is=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,ss=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;function as(e){return"string"==typeof e}const ls=e=>({test:t=>as(t)&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),cs=ls("deg"),us=ls("%"),ds=ls("px"),fs=ls("vh"),hs=ls("vw"),ps={...us,parse:e=>us.parse(e)/100,transform:e=>us.transform(100*e)},ms=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),gs=e=>e===es||e===ds,vs=(e,t)=>parseFloat(e.split(", ")[t]),ys=(e,t)=>(n,{transform:r})=>{if("none"===r||!r)return 0;const o=r.match(/^matrix3d\((.+)\)$/u);if(o)return vs(o[1],t);{const t=r.match(/^matrix\((.+)\)$/u);return t?vs(t[1],e):0}},bs=new Set(["x","y","z"]),xs=Si.filter((e=>!bs.has(e))),ws={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:ys(4,13),y:ys(5,14)};ws.translateX=ws.x,ws.translateY=ws.y;const _s=e=>t=>t.test(e),Es=[es,ds,us,cs,hs,fs,{test:e=>"auto"===e,parse:e=>e}],Ss=e=>Es.find(_s(e)),ks=new Set;let Cs=!1,Ts=!1;function Ps(){if(Ts){const e=Array.from(ks).filter((e=>e.needsMeasurement)),t=new Set(e.map((e=>e.element))),n=new Map;t.forEach((e=>{const t=function(e){const t=[];return xs.forEach((n=>{const r=e.getValue(n);void 0!==r&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))})),t}(e);t.length&&(n.set(e,t),e.render())})),e.forEach((e=>e.measureInitialState())),t.forEach((e=>{e.render();const t=n.get(e);t&&t.forEach((([t,n])=>{var r;null===(r=e.getValue(t))||void 0===r||r.set(n)}))})),e.forEach((e=>e.measureEndState())),e.forEach((e=>{void 0!==e.suspendedScrollY&&window.scrollTo(0,e.suspendedScrollY)}))}Ts=!1,Cs=!1,ks.forEach((e=>e.complete())),ks.clear()}function Rs(){ks.forEach((e=>{e.readKeyframes(),e.needsMeasurement&&(Ts=!0)}))}class Os{constructor(e,t,n,r,o,i=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=o,this.isAsync=i}scheduleResolve(){this.isScheduled=!0,this.isAsync?(ks.add(this),Cs||(Cs=!0,Fi.read(Rs),Fi.resolveKeyframes(Ps))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;for(let o=0;on=>Boolean(as(n)&&ss.test(n)&&n.startsWith(e)||t&&!function(e){return null==e}(n)&&Object.prototype.hasOwnProperty.call(n,t)),As=(e,t,n)=>r=>{if(!as(r))return r;const[o,i,s,a]=r.match(os);return{[e]:parseFloat(o),[t]:parseFloat(i),[n]:parseFloat(s),alpha:void 0!==a?parseFloat(a):1}},js={...es,transform:e=>Math.round((e=>Qi(0,255,e))(e))},Ms={test:Ns("rgb","red"),parse:As("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+js.transform(e)+", "+js.transform(t)+", "+js.transform(n)+", "+rs(ts.transform(r))+")"},Is={test:Ns("#"),parse:function(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}},transform:Ms.transform},Ds={test:Ns("hsl","hue"),parse:As("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+us.transform(rs(t))+", "+us.transform(rs(n))+", "+rs(ts.transform(r))+")"},Ls={test:e=>Ms.test(e)||Is.test(e)||Ds.test(e),parse:e=>Ms.test(e)?Ms.parse(e):Ds.test(e)?Ds.parse(e):Is.parse(e),transform:e=>as(e)?e:e.hasOwnProperty("red")?Ms.transform(e):Ds.transform(e)},Fs="number",zs="color",Bs="var",Vs="var(",Ws="${}",Us=/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 $s(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let i=0;const s=t.replace(Us,(e=>(Ls.test(e)?(r.color.push(i),o.push(zs),n.push(Ls.parse(e))):e.startsWith(Vs)?(r.var.push(i),o.push(Bs),n.push(e)):(r.number.push(i),o.push(Fs),n.push(parseFloat(e))),++i,Ws))).split(Ws);return{values:n,split:s,indexes:r,types:o}}function Ks(e){return $s(e).values}function Hs(e){const{split:t,types:n}=$s(e),r=t.length;return e=>{let o="";for(let i=0;i"number"==typeof e?0:e,Ys={test:function(e){var t,n;return isNaN(e)&&as(e)&&((null===(t=e.match(os))||void 0===t?void 0:t.length)||0)+((null===(n=e.match(is))||void 0===n?void 0:n.length)||0)>0},parse:Ks,createTransformer:Hs,getAnimatableNone:function(e){const t=Ks(e);return Hs(e)(t.map(qs))}},Xs=new Set(["brightness","contrast","saturate","opacity"]);function Gs(e){const[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[r]=n.match(os)||[];if(!r)return e;const o=n.replace(r,"");let i=Xs.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+o+")"}const Js=/\b([a-z-]*)\(.*?\)/gu,Zs={...Ys,getAnimatableNone:e=>{const t=e.match(Js);return t?t.map(Gs).join(" "):e}},Qs={...es,transform:Math.round},ea={borderWidth:ds,borderTopWidth:ds,borderRightWidth:ds,borderBottomWidth:ds,borderLeftWidth:ds,borderRadius:ds,radius:ds,borderTopLeftRadius:ds,borderTopRightRadius:ds,borderBottomRightRadius:ds,borderBottomLeftRadius:ds,width:ds,maxWidth:ds,height:ds,maxHeight:ds,size:ds,top:ds,right:ds,bottom:ds,left:ds,padding:ds,paddingTop:ds,paddingRight:ds,paddingBottom:ds,paddingLeft:ds,margin:ds,marginTop:ds,marginRight:ds,marginBottom:ds,marginLeft:ds,rotate:cs,rotateX:cs,rotateY:cs,rotateZ:cs,scale:ns,scaleX:ns,scaleY:ns,scaleZ:ns,skew:cs,skewX:cs,skewY:cs,distance:ds,translateX:ds,translateY:ds,translateZ:ds,x:ds,y:ds,z:ds,perspective:ds,transformPerspective:ds,opacity:ts,originX:ps,originY:ps,originZ:ds,zIndex:Qs,backgroundPositionX:ds,backgroundPositionY:ds,fillOpacity:ts,strokeOpacity:ts,numOctaves:Qs},ta={...ea,color:Ls,backgroundColor:Ls,outlineColor:Ls,fill:Ls,stroke:Ls,borderColor:Ls,borderTopColor:Ls,borderRightColor:Ls,borderBottomColor:Ls,borderLeftColor:Ls,filter:Zs,WebkitFilter:Zs},na=e=>ta[e];function ra(e,t){let n=na(e);return n!==Zs&&(n=Ys),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const oa=new Set(["auto","none","0"]);class ia extends Os{constructor(e,t,n,r,o){super(e,t,n,r,o,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n{t.getValue(e).set(n)})),this.resolveNoneKeyframes()}}function sa(e){let t;return()=>(void 0===t&&(t=e()),t)}let aa;function la(){aa=void 0}const ca={now:()=>(void 0===aa&&ca.set(Bi.isProcessing?Bi.timestamp:performance.now()),aa),set:e=>{aa=e,queueMicrotask(la)}},ua=(e,t)=>!("zIndex"===t||"number"!=typeof e&&!Array.isArray(e)&&("string"!=typeof e||!Ys.test(e)&&"0"!==e||e.startsWith("url(")));class da{constructor({autoplay:e=!0,delay:t=0,type:n="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:i="loop",...s}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=ca.now(),this.options={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:o,repeatType:i,...s},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return this._resolved||this.hasAttemptedResolve||(Rs(),Ps()),this._resolved}onKeyframesResolved(e,t){this.resolvedAt=ca.now(),this.hasAttemptedResolve=!0;const{name:n,type:r,velocity:o,delay:i,onComplete:s,onUpdate:a,isGenerator:l}=this.options;if(!l&&!function(e,t,n,r){const o=e[0];if(null===o)return!1;if("display"===t||"visibility"===t)return!0;const i=e[e.length-1],s=ua(o,t),a=ua(i,t);return Ui(s===a,`You are trying to animate ${t} from "${o}" to "${i}". ${o} is not an animatable value - to enable this animation set ${o} to a value animatable to ${i} via the \`style\` property.`),!(!s||!a)&&(function(e){const t=e[0];if(1===e.length)return!0;for(let n=0;n{this.resolveFinishedPromise=e}))}}function fa(e,t){return t?e*(1e3/t):0}const ha=5;function pa(e,t,n){const r=Math.max(t-ha,0);return fa(n-e(r),t-r)}const ma=.001,ga=.01,va=10,ya=.05,ba=1;const xa=12;function wa(e,t){return e*Math.sqrt(1-t*t)}const _a=["duration","bounce"],Ea=["stiffness","damping","mass"];function Sa(e,t){return t.some((t=>void 0!==e[t]))}function ka({keyframes:e,restDelta:t,restSpeed:n,...r}){const o=e[0],i=e[e.length-1],s={done:!1,value:o},{stiffness:a,damping:l,mass:c,duration:u,velocity:d,isResolvedFromDuration:f}=function(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!Sa(e,Ea)&&Sa(e,_a)){const n=function({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let o,i;Ui(e<=Ci(va),"Spring duration must be 10 seconds or less");let s=1-t;s=Qi(ya,ba,s),e=Qi(ga,va,Ti(e)),s<1?(o=t=>{const r=t*s,o=r*e,i=r-n,a=wa(t,s),l=Math.exp(-o);return ma-i/a*l},i=t=>{const r=t*s*e,i=r*n+n,a=Math.pow(s,2)*Math.pow(t,2)*e,l=Math.exp(-r),c=wa(Math.pow(t,2),s);return(-o(t)+ma>0?-1:1)*((i-a)*l)/c}):(o=t=>Math.exp(-t*e)*((t-n)*e+1)-ma,i=t=>Math.exp(-t*e)*(e*e*(n-t)));const a=function(e,t,n){let r=n;for(let n=1;n{const n=Math.exp(-p*g*t);return i-n*((h+p*g*m)/e*Math.sin(e*t)+m*Math.cos(e*t))}}else if(1===p)y=e=>i-Math.exp(-g*e)*(m+(h+g*m)*e);else{const e=g*Math.sqrt(p*p-1);y=t=>{const n=Math.exp(-p*g*t),r=Math.min(e*t,300);return i-n*((h+p*g*m)*Math.sinh(r)+e*m*Math.cosh(r))/e}}return{calculatedDuration:f&&u||null,next:e=>{const r=y(e);if(f)s.done=e>=u;else{let o=0;p<1&&(o=0===e?Ci(h):pa(y,e,r));const a=Math.abs(o)<=n,l=Math.abs(i-r)<=t;s.done=a&&l}return s.value=s.done?i:r,s}}}function Ca({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 d=e[0],f={done:!1,value:d},h=e=>void 0===a?l:void 0===l||Math.abs(a-e)-p*Math.exp(-e/r),y=e=>g+v(e),b=e=>{const t=v(e),n=y(e);f.done=Math.abs(t)<=c,f.value=f.done?g:n};let x,w;const _=e=>{(e=>void 0!==a&&el)(f.value)&&(x=e,w=ka({keyframes:[f.value,h(f.value)],velocity:pa(y,e,f.value),damping:o,stiffness:i,restDelta:c,restSpeed:u}))};return _(0),{calculatedDuration:null,next:e=>{let t=!1;return w||void 0!==x||(t=!0,b(e),_(e)),void 0!==x&&e>=x?w.next(e-x):(!t&&b(e),f)}}}const Ta=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function Pa(e,t,n,r){if(e===t&&n===r)return Ii;return o=>0===o||1===o?o:Ta(function(e,t,n,r,o){let i,s,a=0;do{s=t+(n-t)/2,i=Ta(s,r,o)-e,i>0?n=s:t=s}while(Math.abs(i)>1e-7&&++a<12);return s}(o,0,1,e,n),t,r)}const Ra=Pa(.42,0,1,1),Oa=Pa(0,0,.58,1),Na=Pa(.42,0,.58,1),Aa=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,ja=e=>t=>1-e(1-t),Ma=e=>1-Math.sin(Math.acos(e)),Ia=ja(Ma),Da=Aa(Ma),La=Pa(.33,1.53,.69,.99),Fa=ja(La),za=Aa(Fa),Ba={linear:Ii,easeIn:Ra,easeInOut:Na,easeOut:Oa,circIn:Ma,circInOut:Da,circOut:Ia,backIn:Fa,backInOut:za,backOut:La,anticipate:e=>(e*=2)<1?.5*Fa(e):.5*(2-Math.pow(2,-10*(e-1)))},Va=e=>{if(Array.isArray(e)){$i(4===e.length,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,o]=e;return Pa(t,n,r,o)}return"string"==typeof e?($i(void 0!==Ba[e],`Invalid easing type '${e}'`),Ba[e]):e},Wa=(e,t)=>n=>t(e(n)),Ua=(...e)=>e.reduce(Wa),$a=(e,t,n)=>{const r=t-e;return 0===r?1:(n-e)/r},Ka=(e,t,n)=>e+(t-e)*n;function Ha(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function qa(e,t){return n=>n>0?t:e}const Ya=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},Xa=[Is,Ms,Ds];function Ga(e){const t=(e=>Xa.find((t=>t.test(e))))(e);if(Ui(Boolean(t),`'${e}' is not an animatable color. Use the equivalent color code instead.`),!Boolean(t))return!1;let n=t.parse(e);return t===Ds&&(n=function({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,n/=100;let o=0,i=0,s=0;if(t/=100){const r=n<.5?n*(1+t):n+t-n*t,a=2*n-r;o=Ha(a,r,e+1/3),i=Ha(a,r,e),s=Ha(a,r,e-1/3)}else o=i=s=n;return{red:Math.round(255*o),green:Math.round(255*i),blue:Math.round(255*s),alpha:r}}(n)),n}const Ja=(e,t)=>{const n=Ga(e),r=Ga(t);if(!n||!r)return qa(e,t);const o={...n};return e=>(o.red=Ya(n.red,r.red,e),o.green=Ya(n.green,r.green,e),o.blue=Ya(n.blue,r.blue,e),o.alpha=Ka(n.alpha,r.alpha,e),Ms.transform(o))},Za=new Set(["none","hidden"]);function Qa(e,t){return n=>Ka(e,t,n)}function el(e){return"number"==typeof e?Qa:"string"==typeof e?Xi(e)?qa:Ls.test(e)?Ja:rl:Array.isArray(e)?tl:"object"==typeof e?Ls.test(e)?Ja:nl:qa}function tl(e,t){const n=[...e],r=n.length,o=e.map(((e,n)=>el(e)(e,t[n])));return e=>{for(let t=0;t{for(const t in r)n[t]=r[t](e);return n}}const rl=(e,t)=>{const n=Ys.createTransformer(t),r=$s(e),o=$s(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?Za.has(e)&&!o.values.length||Za.has(t)&&!r.values.length?function(e,t){return Za.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}(e,t):Ua(tl(function(e,t){var n;const r=[],o={color:0,var:0,number:0};for(let i=0;iArray.isArray(e)&&"number"!=typeof e[0])(r)?r.map(Va):Va(r),i={done:!1,value:t[0]},s=function(e,t){return e.map((e=>e*t))}(n&&n.length===t.length?n:function(e){const t=[0];return function(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=$a(0,t,r);e.push(Ka(n,1,o))}}(t,e.length-1),t}(t),e),a=function(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const i=e.length;if($i(i===t.length,"Both input and output ranges must be the same length"),1===i)return()=>t[0];if(2===i&&e[0]===e[1])return()=>t[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=function(e,t,n){const r=[],o=n||ol,i=e.length-1;for(let n=0;n{let n=0;if(a>1)for(;nl(Qi(e[0],e[i-1],t)):l}(s,t,{ease:Array.isArray(o)?o:(l=t,c=o,l.map((()=>c||Na)).splice(0,l.length-1))});var l,c;return{calculatedDuration:e,next:t=>(i.value=a(t),i.done=t>=e,i)}}const sl=e=>{const t=({timestamp:t})=>e(t);return{start:()=>Fi.update(t,!0),stop:()=>zi(t),now:()=>Bi.isProcessing?Bi.timestamp:ca.now()}},al={decay:Ca,inertia:Ca,tween:il,keyframes:il,spring:ka},ll=e=>e/100;class cl extends da{constructor(e){super(e),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:e}=this.options;e&&e()};const{name:t,motionValue:n,element:r,keyframes:o}=this.options,i=(null==r?void 0:r.KeyframeResolver)||Os;this.resolver=new i(o,((e,t)=>this.onKeyframesResolved(e,t)),t,n,r),this.resolver.scheduleResolve()}initPlayback(e){const{type:t="keyframes",repeat:n=0,repeatDelay:r=0,repeatType:o,velocity:i=0}=this.options,s=al[t]||il;let a,l;s!==il&&"number"!=typeof e[0]&&(a=Ua(ll,ol(e[0],e[1])),e=[0,100]);const c=s({...this.options,keyframes:e});"mirror"===o&&(l=s({...this.options,keyframes:[...e].reverse(),velocity:-i})),null===c.calculatedDuration&&(c.calculatedDuration=function(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}(c));const{calculatedDuration:u}=c,d=u+r;return{generator:c,mirroredGenerator:l,mapPercentToKeyframes:a,calculatedDuration:u,resolvedDuration:d,totalDuration:d*(n+1)-r}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&e?this.state=this.pendingPlayState:this.pause()}tick(e,t=!1){const{resolved:n}=this;if(!n){const{keyframes:e}=this.options;return{done:!0,value:e[e.length-1]}}const{finalKeyframe:r,generator:o,mirroredGenerator:i,mapPercentToKeyframes:s,keyframes:a,calculatedDuration:l,totalDuration:c,resolvedDuration:u}=n;if(null===this.startTime)return o.next(0);const{delay:d,repeat:f,repeatType:h,repeatDelay:p,onUpdate:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-c/this.speed,this.startTime)),t?this.currentTime=e:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const g=this.currentTime-d*(this.speed>=0?1:-1),v=this.speed>=0?g<0:g>c;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=c);let y=this.currentTime,b=o;if(f){const e=Math.min(this.currentTime,c)/u;let t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),1===n&&t--,t=Math.min(t,f+1),Boolean(t%2)&&("reverse"===h?(n=1-n,p&&(n-=p/u)):"mirror"===h&&(b=i)),y=Qi(0,1,n)*u}const x=v?{done:!1,value:a[0]}:b.next(y);s&&(x.value=s(x.value));let{done:w}=x;v||null===l||(w=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const _=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return _&&void 0!==r&&(x.value=Mi(a,this.options,r)),m&&m(x.value),_&&this.finish(),x}get duration(){const{resolved:e}=this;return e?Ti(e.calculatedDuration):0}get time(){return Ti(this.currentTime)}set time(e){e=Ci(e),this.currentTime=e,null!==this.holdTime||0===this.speed?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=Ti(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:e=sl,onPlay:t,startTime:n}=this.options;this.driver||(this.driver=e((e=>this.tick(e)))),t&&t();const r=this.driver.now();null!==this.holdTime?this.startTime=r-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=r):this.startTime=null!=n?n:this.calcStartTime(),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;this._resolved?(this.state="paused",this.holdTime=null!==(e=this.currentTime)&&void 0!==e?e:0):this.pendingPlayState="paused"}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}const ul=new Set(["opacity","clipPath","filter","transform"]),dl=e=>Array.isArray(e)&&"number"==typeof e[0];function fl(e){return Boolean(!e||"string"==typeof e&&e in pl||dl(e)||Array.isArray(e)&&e.every(fl))}const hl=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,pl={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:hl([0,.65,.55,1]),circOut:hl([.55,0,1,.45]),backIn:hl([.31,.01,.66,-.59]),backOut:hl([.33,1.53,.69,.99])};function ml(e){return gl(e)||pl.easeOut}function gl(e){return e?dl(e)?hl(e):Array.isArray(e)?e.map(ml):pl[e]:void 0}const vl=sa((()=>Object.hasOwnProperty.call(Element.prototype,"animate")));class yl extends da{constructor(e){super(e);const{name:t,motionValue:n,element:r,keyframes:o}=this.options;this.resolver=new ia(o,((e,t)=>this.onKeyframesResolved(e,t)),t,n,r),this.resolver.scheduleResolve()}initPlayback(e,t){var n;let{duration:r=300,times:o,ease:i,type:s,motionValue:a,name:l,startTime:c}=this.options;if(!(null===(n=a.owner)||void 0===n?void 0:n.current))return!1;if("spring"===(u=this.options).type||!fl(u.ease)){const{onComplete:t,onUpdate:n,motionValue:a,element:l,...c}=this.options,u=function(e,t){const n=new cl({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const o=[];let i=0;for(;!r.done&&i<2e4;)r=n.sample(i),o.push(r.value),i+=10;return{times:void 0,keyframes:o,duration:i-10,ease:"linear"}}(e,c);1===(e=u.keyframes).length&&(e[1]=e[0]),r=u.duration,o=u.times,i=u.ease,s="keyframes"}var u;const d=function(e,t,n,{delay:r=0,duration:o=300,repeat:i=0,repeatType:s="loop",ease:a,times:l}={}){const c={[t]:n};l&&(c.offset=l);const u=gl(a);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:r,duration:o,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:i+1,direction:"reverse"===s?"alternate":"normal"})}(a.owner.current,l,e,{...this.options,duration:r,times:o,ease:i});return d.startTime=null!=c?c:this.calcStartTime(),this.pendingTimeline?(d.timeline=this.pendingTimeline,this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:n}=this.options;a.set(Mi(e,this.options,t)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:r,times:o,type:s,ease:i,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:t}=e;return Ti(t)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:t}=e;return Ti(t.currentTime||0)}set time(e){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.currentTime=Ci(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:t}=e;return t.playbackRate}set speed(e){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:t}=e;return t.playState}get startTime(){const{resolved:e}=this;if(!e)return null;const{animation:t}=e;return t.startTime}attachTimeline(e){if(this._resolved){const{resolved:t}=this;if(!t)return Ii;const{animation:n}=t;n.timeline=e,n.onfinish=null}else this.pendingTimeline=e;return Ii}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:t}=e;"finished"===t.playState&&this.updateFinishedPromise(),t.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:t}=e;t.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:e}=this;if(!e)return;const{animation:t,keyframes:n,duration:r,type:o,ease:i,times:s}=e;if("idle"===t.playState||"finished"===t.playState)return;if(this.time){const{motionValue:e,onUpdate:t,onComplete:a,element:l,...c}=this.options,u=new cl({...c,keyframes:n,duration:r,type:o,ease:i,times:s,isGenerator:!0}),d=Ci(this.time);e.setWithVelocity(u.sample(d-10).value,u.sample(d).value,10)}const{onStop:a}=this.options;a&&a(),this.cancel()}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:t,name:n,repeatDelay:r,repeatType:o,damping:i,type:s}=e;return vl()&&n&&ul.has(n)&&t&&t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate&&!r&&"mirror"!==o&&0!==i&&"inertia"!==s}}const bl=sa((()=>void 0!==window.ScrollTimeline));class xl{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}then(e,t){return Promise.all(this.animations).then(e).catch(t)}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n{if(!bl()||!t.attachTimeline)return t.pause(),function(e,n){let r;const o=()=>{const{currentTime:e}=n,o=(null===e?0:e.value)/100;r!==o&&(e=>{t.time=t.duration*e})(o),r=o};return Fi.update(o,!0),()=>zi(o)}(0,e);t.attachTimeline(e)}));return()=>{t.forEach(((e,t)=>{e&&e(),this.animations[t].stop()}))}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let t=0;tt[e]()))}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}const wl=(e,t,n,r={},o,i,s)=>a=>{const l=Ai(r,e)||{},c=l.delay||r.delay||0;let{elapsed:u=0}=r;u-=Ci(c);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-u,onUpdate:e=>{t.set(e),l.onUpdate&&l.onUpdate(e)},onComplete:()=>{a(),l.onComplete&&l.onComplete(),s&&s()},onStop:s,name:e,motionValue:t,element:i?void 0:o};(function({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})(l)||(d={...d,...Ni(e,d)}),d.duration&&(d.duration=Ci(d.duration)),d.repeatDelay&&(d.repeatDelay=Ci(d.repeatDelay)),void 0!==d.from&&(d.keyframes[0]=d.from);let f=!1;if((!1===d.type||0===d.duration&&!d.repeatDelay)&&(d.duration=0,0===d.delay&&(f=!0)),f&&!i&&void 0!==t.get()){const e=Mi(d.keyframes,l);if(void 0!==e)return Fi.update((()=>{d.onUpdate(e),d.onComplete()})),new xl([])}return!i&&yl.supports(d)?new yl(d):new cl(d)},_l=e=>Boolean(e&&"object"==typeof e&&e.mix&&e.toValue),El=e=>gi(e)?e[e.length-1]||0:e;function Sl(e,t){-1===e.indexOf(t)&&e.push(t)}function kl(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Cl{constructor(){this.subscriptions=[]}add(e){return Sl(this.subscriptions,e),()=>kl(this.subscriptions,e)}notify(e,t,n){const r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](e,t,n);else for(let o=0;o{const n=ca.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),t&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){var t;this.current=e,this.updatedAt=ca.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=(t=this.current,!isNaN(parseFloat(t))))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new Cl);const n=this.events[e].add(t);return"change"===e?()=>{n(),Fi.read((()=>{this.events.change.getSize()||this.stop()}))}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){t&&this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e,t)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return Tl.current&&Tl.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=ca.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return fa(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise((t=>{this.hasAnimated=!0,this.animation=e(t),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.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Rl(e,t){return new Pl(e,t)}function Ol(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Rl(n))}const Nl=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Al="data-"+Nl("framerAppearId");function jl(e){return e.props[Al]}function Ml(e){return ki.has(e)?"transform":ul.has(e)?Nl(e):void 0}class Il extends Pl{constructor(){super(...arguments),this.output=[],this.counts=new Map}add(e){const t=Ml(e);if(!t)return;const n=this.counts.get(t)||0;this.counts.set(t,n+1),0===n&&(this.output.push(t),this.update());let r=!1;return()=>{if(r)return;r=!0;const e=this.counts.get(t)-1;this.counts.set(t,e),0===e&&(kl(this.output,t),this.update())}}update(){this.set(this.output.length?this.output.join(", "):"auto")}}const Dl=e=>Boolean(e&&e.getVelocity);function Ll(e,t){var n;if(!e.applyWillChange)return;let r=e.getValue("willChange");return r||(null===(n=e.props.style)||void 0===n?void 0:n.willChange)||(r=new Il("auto"),e.addValue("willChange",r)),o=r,Boolean(Dl(o)&&o.add)?r.add(t):void 0;var o}function Fl({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&!0!==t[n];return t[n]=!1,r}function zl(e,t,{delay:n=0,transitionOverride:r,type:o}={}){var i;let{transition:s=e.getDefaultTransition(),transitionEnd:a,...l}=t;r&&(s=r);const c=[],u=o&&e.animationState&&e.animationState.getState()[o];for(const t in l){const r=e.getValue(t,null!==(i=e.latestValues[t])&&void 0!==i?i:null),o=l[t];if(void 0===o||u&&Fl(u,t))continue;const a={delay:n,...Ai(s||{},t)};let d=!1;if(window.MotionHandoffAnimation){const n=jl(e);if(n){const e=window.MotionHandoffAnimation(n,t,Fi);null!==e&&(a.startTime=e,d=!0)}}r.start(wl(t,r,o,e.shouldReduceMotion&&ki.has(t)?{type:!1}:a,e,d,Ll(e,t)));const f=r.animation;f&&c.push(f)}return a&&Promise.all(c).then((()=>{Fi.update((()=>{a&&function(e,t){const n=wi(e,t);let{transitionEnd:r={},transition:o={},...i}=n||{};i={...i,...r};for(const t in i)Ol(e,t,El(i[t]))}(e,a)}))})),c}function Bl(e,t,n={}){var r;const o=wi(e,t,"exit"===n.type?null===(r=e.presenceContext)||void 0===r?void 0:r.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=o||{};n.transitionOverride&&(i=n.transitionOverride);const s=o?()=>Promise.all(zl(e,o,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(r=0)=>{const{delayChildren:o=0,staggerChildren:s,staggerDirection:a}=i;return function(e,t,n=0,r=0,o=1,i){const s=[],a=(e.variantChildren.size-1)*r,l=1===o?(e=0)=>e*r:(e=0)=>a-e*r;return Array.from(e.variantChildren).sort(Vl).forEach(((e,r)=>{e.notify("AnimationStart",t),s.push(Bl(e,t,{...i,delay:n+l(r)}).then((()=>e.notify("AnimationComplete",t))))})),Promise.all(s)}(e,t,o+r,s,a,n)}:()=>Promise.resolve(),{when:l}=i;if(l){const[e,t]="beforeChildren"===l?[s,a]:[a,s];return e().then((()=>t()))}return Promise.all([s(),a(n.delay)])}function Vl(e,t){return e.sortNodePosition(t)}const Wl=[..._i].reverse(),Ul=_i.length;function $l(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Kl(){return{animate:$l(!0),whileInView:$l(),whileHover:$l(),whileTap:$l(),whileDrag:$l(),whileFocus:$l(),exit:$l()}}class Hl{constructor(e){this.isMounted=!1,this.node=e}update(){}}let ql=0;const Yl={animation:{Feature:class extends Hl{constructor(e){super(e),e.animationState||(e.animationState=function(e){let t=function(e){return t=>Promise.all(t.map((({animation:t,options:n})=>function(e,t,n={}){let r;if(e.notify("AnimationStart",t),Array.isArray(t)){const o=t.map((t=>Bl(e,t,n)));r=Promise.all(o)}else if("string"==typeof t)r=Bl(e,t,n);else{const o="function"==typeof t?wi(e,t,n.custom):t;r=Promise.all(zl(e,o,n))}return r.then((()=>{e.notify("AnimationComplete",t)}))}(e,t,n))))}(e),n=Kl(),r=!0;const o=t=>(n,r)=>{var o;const i=wi(e,r,"exit"===t?null===(o=e.presenceContext)||void 0===o?void 0:o.custom:void 0);if(i){const{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function i(i){const s=e.getProps(),a=e.getVariantContext(!0)||{},l=[],c=new Set;let u={},d=1/0;for(let t=0;td&&v),w=!1;const _=Array.isArray(g)?g:[g];let E=_.reduce(o(p),{});!1===y&&(E={});const{prevResolvedValues:S={}}=m,k={...S,...E},C=t=>{x=!0,c.has(t)&&(w=!0,c.delete(t)),m.needsAnimating[t]=!0;const n=e.getValue(t);n&&(n.liveStyle=!1)};for(const e in k){const t=E[e],n=S[e];if(u.hasOwnProperty(e))continue;let r=!1;r=gi(t)&&gi(n)?!vi(t,n):t!==n,r?null!=t?C(e):c.add(e):void 0!==t&&c.has(e)?C(e):m.protectedKeys[e]=!0}m.prevProp=g,m.prevResolvedValues=E,m.isActive&&(u={...u,...E}),r&&e.blockInitialAnimation&&(x=!1),!x||b&&!w||l.push(..._.map((e=>({animation:e,options:{type:p}}))))}var f,h;if(c.size){const t={};c.forEach((n=>{const r=e.getBaseTarget(n),o=e.getValue(n);o&&(o.liveStyle=!0),t[n]=null!=r?r:null})),l.push({animation:t})}let p=Boolean(l.length);return!r||!1!==s.initial&&s.initial!==s.animate||e.manuallyAnimateOnMount||(p=!1),r=!1,p?t(l):Promise.resolve()}return{animateChanges:i,setActive:function(t,r){var o;if(n[t].isActive===r)return Promise.resolve();null===(o=e.variantChildren)||void 0===o||o.forEach((e=>{var n;return null===(n=e.animationState)||void 0===n?void 0:n.setActive(t,r)})),n[t].isActive=r;const s=i(t);for(const e in n)n[e].protectedKeys={};return s},setAnimateFunction:function(n){t=n(e)},getState:()=>n,reset:()=>{n=Kl(),r=!0}}}(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();mi(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),null===(e=this.unmountControls)||void 0===e||e.call(this)}}},exit:{Feature:class extends Hl{constructor(){super(...arguments),this.id=ql++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;const r=this.node.animationState.setActive("exit",!e);t&&!e&&r.then((()=>t(this.id)))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}}},Xl=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary;function Gl(e,t="page"){return{point:{x:e[`${t}X`],y:e[`${t}Y`]}}}const Jl=e=>t=>Xl(t)&&e(t,Gl(t));function Zl(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Ql(e,t,n,r){return Zl(e,t,Jl(n),r)}const ec=(e,t)=>Math.abs(e-t);class tc{constructor(e,t,{transformPagePoint:n,contextWindow:r,dragSnapToOrigin:o=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const e=oc(this.lastMoveEventInfo,this.history),t=null!==this.startEvent,n=function(e,t){const n=ec(e.x,t.x),r=ec(e.y,t.y);return Math.sqrt(n**2+r**2)}(e.offset,{x:0,y:0})>=3;if(!t&&!n)return;const{point:r}=e,{timestamp:o}=Bi;this.history.push({...r,timestamp:o});const{onStart:i,onMove:s}=this.handlers;t||(i&&i(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),s&&s(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=nc(t,this.transformPagePoint),Fi.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();const{onEnd:n,onSessionEnd:r,resumeAnimation:o}=this.handlers;if(this.dragSnapToOrigin&&o&&o(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const i=oc("pointercancel"===e.type?this.lastMoveEventInfo:nc(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,i),r&&r(e,i)},!Xl(e))return;this.dragSnapToOrigin=o,this.handlers=t,this.transformPagePoint=n,this.contextWindow=r||window;const i=nc(Gl(e),this.transformPagePoint),{point:s}=i,{timestamp:a}=Bi;this.history=[{...s,timestamp:a}];const{onSessionStart:l}=t;l&&l(e,oc(i,this.history)),this.removeListeners=Ua(Ql(this.contextWindow,"pointermove",this.handlePointerMove),Ql(this.contextWindow,"pointerup",this.handlePointerUp),Ql(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),zi(this.updatePoint)}}function nc(e,t){return t?{point:t(e.point)}:e}function rc(e,t){return{x:e.x-t.x,y:e.y-t.y}}function oc({point:e},t){return{point:e,delta:rc(e,sc(t)),offset:rc(e,ic(t)),velocity:ac(t,.1)}}function ic(e){return e[0]}function sc(e){return e[e.length-1]}function ac(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=sc(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>Ci(t)));)n--;if(!r)return{x:0,y:0};const i=Ti(o.timestamp-r.timestamp);if(0===i)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 lc(e){let t=null;return()=>null===t&&(t=e,()=>{t=null})}const cc=lc("dragHorizontal"),uc=lc("dragVertical");function dc(e){let t=!1;if("y"===e)t=uc();else if("x"===e)t=cc();else{const e=cc(),n=uc();e&&n?t=()=>{e(),n()}:(e&&e(),n&&n())}return t}function fc(){const e=dc(!0);return!e||(e(),!1)}function hc(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}const pc=.9999,mc=1.0001,gc=-.01,vc=.01;function yc(e){return e.max-e.min}function bc(e,t,n,r=.5){e.origin=r,e.originPoint=Ka(t.min,t.max,e.origin),e.scale=yc(n)/yc(t),e.translate=Ka(n.min,n.max,e.origin)-e.originPoint,(e.scale>=pc&&e.scale<=mc||isNaN(e.scale))&&(e.scale=1),(e.translate>=gc&&e.translate<=vc||isNaN(e.translate))&&(e.translate=0)}function xc(e,t,n,r){bc(e.x,t.x,n.x,r?r.originX:void 0),bc(e.y,t.y,n.y,r?r.originY:void 0)}function wc(e,t,n){e.min=n.min+t.min,e.max=e.min+yc(t)}function _c(e,t,n){e.min=t.min-n.min,e.max=e.min+yc(t)}function Ec(e,t,n){_c(e.x,t.x,n.x),_c(e.y,t.y,n.y)}function Sc(e,t,n){return{min:void 0!==t?e.min+t:void 0,max:void 0!==n?e.max+n-(e.max-e.min):void 0}}function kc(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min({x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}),Oc=()=>({x:{min:0,max:0},y:{min:0,max:0}});function Nc(e){return[e("x"),e("y")]}function Ac({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function jc(e){return void 0===e||1===e}function Mc({scale:e,scaleX:t,scaleY:n}){return!jc(e)||!jc(t)||!jc(n)}function Ic(e){return Mc(e)||Dc(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Dc(e){return Lc(e.x)||Lc(e.y)}function Lc(e){return e&&"0%"!==e}function Fc(e,t,n){return n+t*(e-n)}function zc(e,t,n,r,o){return void 0!==o&&(e=Fc(e,o,r)),Fc(e,n,r)+t}function Bc(e,t=0,n=1,r,o){e.min=zc(e.min,t,n,r,o),e.max=zc(e.max,t,n,r,o)}function Vc(e,{x:t,y:n}){Bc(e.x,t.translate,t.scale,t.originPoint),Bc(e.y,n.translate,n.scale,n.originPoint)}const Wc=.999999999999,Uc=1.0000000000001;function $c(e,t){e.min=e.min+t,e.max=e.max+t}function Kc(e,t,n,r,o=.5){Bc(e,t,n,Ka(e.min,e.max,o),r)}function Hc(e,t){Kc(e.x,t.x,t.scaleX,t.scale,t.originX),Kc(e.y,t.y,t.scaleY,t.scale,t.originY)}function qc(e,t){return Ac(function(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}}(e.getBoundingClientRect(),t))}const Yc=({current:e})=>e?e.ownerDocument.defaultView:null,Xc=new WeakMap;class Gc{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Oc(),this.visualElement=e}start(e,{snapToCursor:t=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;const{dragSnapToOrigin:r}=this.getProps();this.panSession=new tc(e,{onSessionStart:e=>{const{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(Gl(e,"page").point)},onStart:(e,t)=>{var n;const{drag:r,dragPropagation:o,onDragStart:i}=this.getProps();if(r&&!o&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=dc(r),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Nc((e=>{let t=this.getAxisMotionValue(e).get()||0;if(us.test(t)){const{projection:n}=this.visualElement;if(n&&n.layout){const r=n.layout.layoutBox[e];r&&(t=yc(r)*(parseFloat(t)/100))}}this.originPoint[e]=t})),i&&Fi.postRender((()=>i(e,t))),null===(n=this.removeWillChange)||void 0===n||n.call(this),this.removeWillChange=Ll(this.visualElement,"transform");const{animationState:s}=this.visualElement;s&&s.setActive("whileDrag",!0)},onMove:(e,t)=>{const{dragPropagation:n,dragDirectionLock:r,onDirectionLock:o,onDrag:i}=this.getProps();if(!n&&!this.openGlobalLock)return;const{offset:s}=t;if(r&&null===this.currentDirection)return this.currentDirection=function(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}(s),void(null!==this.currentDirection&&o&&o(this.currentDirection));this.updateAxis("x",t.point,s),this.updateAxis("y",t.point,s),this.visualElement.render(),i&&i(e,t)},onSessionEnd:(e,t)=>this.stop(e,t),resumeAnimation:()=>Nc((e=>{var t;return"paused"===this.getAnimationState(e)&&(null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.play())}))},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:r,contextWindow:Yc(this.visualElement)})}stop(e,t){var n;null===(n=this.removeWillChange)||void 0===n||n.call(this);const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:o}=t;this.startAnimation(o);const{onDragEnd:i}=this.getProps();i&&Fi.postRender((()=>i(e,t)))}cancel(){this.isDragging=!1;const{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),t&&t.setActive("whileDrag",!1)}updateAxis(e,t,n){const{drag:r}=this.getProps();if(!n||!Jc(e,r,this.currentDirection))return;const o=this.getAxisMotionValue(e);let i=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(i=function(e,{min:t,max:n},r){return void 0!==t&&en&&(e=r?Ka(n,e,r.max):Math.min(e,n)),e}(i,this.constraints[e],this.elastic[e])),o.set(i)}resolveConstraints(){var e;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout,o=this.constraints;t&&hc(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!r)&&function(e,{top:t,left:n,bottom:r,right:o}){return{x:Sc(e.x,n,o),y:Sc(e.y,t,r)}}(r.layoutBox,t),this.elastic=function(e=Cc){return!1===e?e=0:!0===e&&(e=Cc),{x:Tc(e,"left","right"),y:Tc(e,"top","bottom")}}(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Nc((e=>{!1!==this.constraints&&this.getAxisMotionValue(e)&&(this.constraints[e]=function(e,t){const n={};return void 0!==t.min&&(n.min=t.min-e.min),void 0!==t.max&&(n.max=t.max-e.min),n}(r.layoutBox[e],this.constraints[e]))}))}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!hc(e))return!1;const n=e.current;$i(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const o=function(e,t,n){const r=qc(e,n),{scroll:o}=t;return o&&($c(r.x,o.offset.x),$c(r.y,o.offset.y)),r}(n,r.root,this.visualElement.getTransformPagePoint());let i=function(e,t){return{x:kc(e.x,t.x),y:kc(e.y,t.y)}}(r.layout.layoutBox,o);if(t){const e=t(function({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}(i));this.hasMutatedConstraints=!!e,e&&(i=Ac(e))}return i}startAnimation(e){const{drag:t,dragMomentum:n,dragElastic:r,dragTransition:o,dragSnapToOrigin:i,onDragTransitionEnd:s}=this.getProps(),a=this.constraints||{},l=Nc((s=>{if(!Jc(s,t,this.currentDirection))return;let l=a&&a[s]||{};i&&(l={min:0,max:0});const c=r?200:1e6,u=r?40:1e7,d={type:"inertia",velocity:n?e[s]:0,bounceStiffness:c,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...o,...l};return this.startAxisValueAnimation(s,d)}));return Promise.all(l).then(s)}startAxisValueAnimation(e,t){const n=this.getAxisMotionValue(e);return n.start(wl(e,n,0,t,this.visualElement,!1,Ll(this.visualElement,e)))}stopAnimation(){Nc((e=>this.getAxisMotionValue(e).stop()))}pauseAnimation(){Nc((e=>{var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.pause()}))}getAnimationState(e){var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.state}getAxisMotionValue(e){const t=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps();return n[t]||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){Nc((t=>{const{drag:n}=this.getProps();if(!Jc(t,n,this.currentDirection))return;const{projection:r}=this.visualElement,o=this.getAxisMotionValue(t);if(r&&r.layout){const{min:n,max:i}=r.layout.layoutBox[t];o.set(e[t]-Ka(n,i,.5))}}))}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!hc(t)||!n||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Nc((e=>{const t=this.getAxisMotionValue(e);if(t&&!1!==this.constraints){const n=t.get();r[e]=function(e,t){let n=.5;const r=yc(e),o=yc(t);return o>r?n=$a(t.min,t.max-r,e.min):r>o&&(n=$a(e.min,e.max-o,t.min)),Qi(0,1,n)}({min:n,max:n},this.constraints[e])}}));const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),Nc((t=>{if(!Jc(t,e,null))return;const n=this.getAxisMotionValue(t),{min:o,max:i}=this.constraints[t];n.set(Ka(o,i,r[t]))}))}addListeners(){if(!this.visualElement.current)return;Xc.set(this.visualElement,this);const e=Ql(this.visualElement.current,"pointerdown",(e=>{const{drag:t,dragListener:n=!0}=this.getProps();t&&n&&this.start(e)})),t=()=>{const{dragConstraints:e}=this.getProps();hc(e)&&e.current&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,r=n.addEventListener("measure",t);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),Fi.read(t);const o=Zl(window,"resize",(()=>this.scalePositionWithinConstraints())),i=n.addEventListener("didUpdate",(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Nc((t=>{const n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))})),this.visualElement.render())}));return()=>{o(),e(),r(),i&&i()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:o=!1,dragElastic:i=Cc,dragMomentum:s=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:o,dragElastic:i,dragMomentum:s}}}function Jc(e,t,n){return!(!0!==t&&t!==e||null!==n&&n!==e)}const Zc=e=>(t,n)=>{e&&Fi.postRender((()=>e(t,n)))};var Qc=n(848);const eu=(0,o.createContext)(null),tu=(0,o.createContext)({}),nu=(0,o.createContext)({}),ru={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function ou(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const iu={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e){if(!ds.test(e))return e;e=parseFloat(e)}return`${ou(e,t.target.x)}% ${ou(e,t.target.y)}%`}},su={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=Ys.parse(e);if(o.length>5)return r;const i=Ys.createTransformer(e),s="number"!=typeof o[0]?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;o[0+s]/=a,o[1+s]/=l;const c=Ka(a,l,.5);return"number"==typeof o[2+s]&&(o[2+s]/=c),"number"==typeof o[3+s]&&(o[3+s]/=c),i(o)}},au={},{schedule:lu,cancel:cu}=Li(queueMicrotask,!1);class uu extends o.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:o}=e;var i;i=fu,Object.assign(au,i),o&&(t.group&&t.group.add(o),n&&n.register&&r&&n.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",(()=>{this.safeToRemove()})),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),ru.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:n,drag:r,isPresent:o}=this.props,i=n.projection;return i?(i.isPresent=o,r||e.layoutDependency!==t||void 0===t?i.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?i.promote():i.relegate()||Fi.postRender((()=>{const e=i.getStack();e&&e.members.length||this.safeToRemove()}))),null):null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),lu.postRender((()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()})))}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function du(e){const[t,n]=function(){const e=(0,o.useContext)(eu);if(null===e)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,i=(0,o.useId)();(0,o.useEffect)((()=>r(i)),[]);const s=(0,o.useCallback)((()=>n&&n(i)),[i,n]);return!t&&n?[!1,s]:[!0]}(),r=(0,o.useContext)(tu);return(0,Qc.jsx)(uu,{...e,layoutGroup:r,switchLayoutGroup:(0,o.useContext)(nu),isPresent:t,safeToRemove:n})}const fu={borderRadius:{...iu,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:iu,borderTopRightRadius:iu,borderBottomLeftRadius:iu,borderBottomRightRadius:iu,boxShadow:su},hu=["TopLeft","TopRight","BottomLeft","BottomRight"],pu=hu.length,mu=e=>"string"==typeof e?parseFloat(e):e,gu=e=>"number"==typeof e||ds.test(e);function vu(e,t){return void 0!==e[t]?e[t]:e.borderRadius}const yu=xu(0,.5,Ia),bu=xu(.5,.95,Ii);function xu(e,t,n){return r=>rt?1:n($a(e,t,r))}function wu(e,t){e.min=t.min,e.max=t.max}function _u(e,t){wu(e.x,t.x),wu(e.y,t.y)}function Eu(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Su(e,t,n,r,o){return e=Fc(e-=t,1/n,r),void 0!==o&&(e=Fc(e,1/o,r)),e}function ku(e,t,[n,r,o],i,s){!function(e,t=0,n=1,r=.5,o,i=e,s=e){if(us.test(t)&&(t=parseFloat(t),t=Ka(s.min,s.max,t/100)-s.min),"number"!=typeof t)return;let a=Ka(i.min,i.max,r);e===i&&(a-=t),e.min=Su(e.min,t,n,a,o),e.max=Su(e.max,t,n,a,o)}(e,t[n],t[r],t[o],t.scale,i,s)}const Cu=["x","scaleX","originX"],Tu=["y","scaleY","originY"];function Pu(e,t,n,r){ku(e.x,t,Cu,n?n.x:void 0,r?r.x:void 0),ku(e.y,t,Tu,n?n.y:void 0,r?r.y:void 0)}function Ru(e){return 0===e.translate&&1===e.scale}function Ou(e){return Ru(e.x)&&Ru(e.y)}function Nu(e,t){return e.min===t.min&&e.max===t.max}function Au(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function ju(e,t){return Au(e.x,t.x)&&Au(e.y,t.y)}function Mu(e){return yc(e.x)/yc(e.y)}function Iu(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Du{constructor(){this.members=[]}add(e){Sl(this.members,e),e.scheduleRender()}remove(e){if(kl(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){const t=this.members.findIndex((t=>e===t));if(0===t)return!1;let n;for(let e=t;e>=0;e--){const t=this.members[e];if(!1!==t.isPresent){n=t;break}}return!!n&&(this.promote(n),!0)}promote(e,t){const n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.instance&&n.scheduleRender(),e.scheduleRender(),e.resumeFrom=n,t&&(e.resumeFrom.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:r}=e.options;!1===r&&n.hide()}}exitAnimationComplete(){this.members.forEach((e=>{const{options:t,resumingFrom:n}=e;t.onExitComplete&&t.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()}))}scheduleRender(){this.members.forEach((e=>{e.instance&&e.scheduleRender(!1)}))}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const Lu=(e,t)=>e.depth-t.depth;class Fu{constructor(){this.children=[],this.isDirty=!1}add(e){Sl(this.children,e),this.isDirty=!0}remove(e){kl(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Lu),this.isDirty=!1,this.children.forEach(e)}}function zu(e){const t=Dl(e)?e.get():e;return _l(t)?t.toValue():t}const Bu={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Vu="undefined"!=typeof window&&void 0!==window.MotionDebug,Wu=["","X","Y","Z"],Uu={visibility:"hidden"};let $u=0;function Ku(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Hu(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=jl(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Fi,!(t||r))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Hu(r)}function qu({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(e={},n=(null==t?void 0:t())){this.id=$u++,this.animationId=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.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Vu&&(Bu.totalNodes=Bu.resolvedTargetDeltas=Bu.recalculatedProjection=0),this.nodes.forEach(Gu),this.nodes.forEach(rd),this.nodes.forEach(od),this.nodes.forEach(Ju),Vu&&window.MotionDebug.record(Bu)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;ethis.root.updateBlockedByResize=!1;e(t,(()=>{this.root.updateBlockedByResize=!0,n&&n(),n=function(e){const t=ca.now(),n=({timestamp:r})=>{const o=r-t;o>=250&&(zi(n),e(o-250))};return Fi.read(n,!0),()=>zi(n)}(r),ru.hasAnimatedSinceResize&&(ru.hasAnimatedSinceResize=!1,this.nodes.forEach(nd))}))}o&&this.root.registerSharedNode(o,this),!1!==this.options.animate&&s&&(o||i)&&this.addEventListener("didUpdate",(({delta:e,hasLayoutChanged:t,hasRelativeTargetChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const o=this.options.transition||s.getDefaultTransition()||ud,{onLayoutAnimationStart:i,onLayoutAnimationComplete:a}=s.getProps(),l=!this.targetLayout||!ju(this.targetLayout,r)||n,c=!t&&n;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||c||t&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(e,c);const t={...Ai(o,"layout"),onPlay:i,onComplete:a};(s.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t)}else t||nd(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r}))}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,zi(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(id),this.animationId++)}getTransformTemplate(){const{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Hu(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()}))}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;eWc&&(t.x=1),t.yWc&&(t.y=1)}(this.layoutCorrected,this.treeScale,this.path,n),!t.layout||t.target||1===this.treeScale.x&&1===this.treeScale.y||(t.target=t.layout.layoutBox,t.targetWithTransforms=Oc());const{target:l}=t;l?(this.projectionDelta&&this.prevProjectionDelta?(Eu(this.prevProjectionDelta.x,this.projectionDelta.x),Eu(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),xc(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.treeScale.x===s&&this.treeScale.y===a&&Iu(this.projectionDelta.x,this.prevProjectionDelta.x)&&Iu(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l)),Vu&&Bu.recalculatedProjection++):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){var t;if(null===(t=this.options.visualElement)||void 0===t||t.scheduleRender(),e){const e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Rc(),this.projectionDelta=Rc(),this.projectionDeltaWithTransform=Rc()}setAnimationOrigin(e,t=!1){const n=this.snapshot,r=n?n.latestValues:{},o={...this.latestValues},i=Rc();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;const s=Oc(),a=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),c=!l||l.members.length<=1,u=Boolean(a&&!c&&!0===this.options.crossfade&&!this.path.some(cd));let d;this.animationProgress=0,this.mixTargetDelta=t=>{const n=t/1e3;var l,f,h,p,m,g;ad(i.x,e.x,n),ad(i.y,e.y,n),this.setTargetDelta(i),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ec(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox),h=this.relativeTarget,p=this.relativeTargetOrigin,m=s,g=n,ld(h.x,p.x,m.x,g),ld(h.y,p.y,m.y,g),d&&(l=this.relativeTarget,f=d,Nu(l.x,f.x)&&Nu(l.y,f.y))&&(this.isProjectionDirty=!1),d||(d=Oc()),_u(d,this.relativeTarget)),a&&(this.animationValues=o,function(e,t,n,r,o,i){o?(e.opacity=Ka(0,void 0!==n.opacity?n.opacity:1,yu(r)),e.opacityExit=Ka(void 0!==t.opacity?t.opacity:1,0,bu(r))):i&&(e.opacity=Ka(void 0!==t.opacity?t.opacity:1,void 0!==n.opacity?n.opacity:1,r));for(let o=0;o{ru.hasAnimatedSinceResize=!0,this.currentAnimation=function(e,t,n){const r=Dl(0)?0:Rl(0);return r.start(wl("",r,1e3,n)),r.animation}(0,0,{...e,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.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 e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const e=this.getLead();let{targetWithTransforms:t,target:n,layout:r,latestValues:o}=e;if(t&&n&&r){if(this!==e&&this.layout&&r&&pd(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||Oc();const t=yc(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;const r=yc(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}_u(t,n),Hc(t,o),xc(this.projectionDeltaWithTransform,this.layoutCorrected,t,o)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new Du),this.sharedNodes.get(e).add(t);const n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){const e=this.getStack();return!e||e.lead===this}getLead(){var e;const{layoutId:t}=this.options;return t&&(null===(e=this.getStack())||void 0===e?void 0:e.lead)||this}getPrevLead(){var e;const{layoutId:t}=this.options;return t?null===(e=this.getStack())||void 0===e?void 0:e.prevLead:void 0}getStack(){const{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){const r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){const e=this.getStack();return!!e&&e.relegate(this)}resetSkewAndRotation(){const{visualElement:e}=this.options;if(!e)return;let t=!1;const{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;const r={};n.z&&Ku("z",e,r,this.animationValues);for(let t=0;t{var t;return null===(t=e.currentAnimation)||void 0===t?void 0:t.stop()})),this.root.nodes.forEach(Qu),this.root.sharedNodes.clear()}}}function Yu(e){e.updateLayout()}function Xu(e){var t;const n=(null===(t=e.resumeFrom)||void 0===t?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:t,measuredBox:r}=e.layout,{animationType:o}=e.options,i=n.source!==e.layout.source;"size"===o?Nc((e=>{const r=i?n.measuredBox[e]:n.layoutBox[e],o=yc(r);r.min=t[e].min,r.max=r.min+o})):pd(o,n.layoutBox,t)&&Nc((r=>{const o=i?n.measuredBox[r]:n.layoutBox[r],s=yc(t[r]);o.max=o.min+s,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+s)}));const s=Rc();xc(s,t,n.layoutBox);const a=Rc();i?xc(a,e.applyTransform(r,!0),n.measuredBox):xc(a,t,n.layoutBox);const l=!Ou(s);let c=!1;if(!e.resumeFrom){const r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){const{snapshot:o,layout:i}=r;if(o&&i){const s=Oc();Ec(s,n.layoutBox,o.layoutBox);const a=Oc();Ec(a,t,i.layoutBox),ju(s,a)||(c=!0),r.options.layoutRoot&&(e.relativeTarget=a,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners("didUpdate",{layout:t,snapshot:n,delta:a,layoutDelta:s,hasLayoutChanged:l,hasRelativeTargetChanged:c})}else if(e.isLead()){const{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function Gu(e){Vu&&Bu.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=Boolean(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Ju(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Zu(e){e.clearSnapshot()}function Qu(e){e.clearMeasurements()}function ed(e){e.isLayoutDirty=!1}function td(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function nd(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function rd(e){e.resolveTargetDelta()}function od(e){e.calcProjection()}function id(e){e.resetSkewAndRotation()}function sd(e){e.removeLeadSnapshot()}function ad(e,t,n){e.translate=Ka(t.translate,0,n),e.scale=Ka(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function ld(e,t,n,r){e.min=Ka(t.min,n.min,r),e.max=Ka(t.max,n.max,r)}function cd(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}const ud={duration:.45,ease:[.4,0,.1,1]},dd=e=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),fd=dd("applewebkit/")&&!dd("chrome/")?Math.round:Ii;function hd(e){e.min=fd(e.min),e.max=fd(e.max)}function pd(e,t,n){return"position"===e||"preserve-aspect"===e&&(r=Mu(t),o=Mu(n),!(Math.abs(r-o)<=.2));var r,o}function md(e){var t;return e!==e.root&&(null===(t=e.scroll)||void 0===t?void 0:t.wasRoot)}const gd=qu({attachResizeListener:(e,t)=>Zl(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),vd={current:void 0},yd=qu({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!vd.current){const e=new gd({});e.mount(window),e.setOptions({layoutScroll:!0}),vd.current=e}return vd.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>Boolean("fixed"===window.getComputedStyle(e).position)}),bd={pan:{Feature:class extends Hl{constructor(){super(...arguments),this.removePointerDownListener=Ii}onPointerDown(e){this.session=new tc(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Yc(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Zc(e),onStart:Zc(t),onMove:n,onEnd:(e,t)=>{delete this.session,r&&Fi.postRender((()=>r(e,t)))}}}mount(){this.removePointerDownListener=Ql(this.node.current,"pointerdown",(e=>this.onPointerDown(e)))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends Hl{constructor(e){super(e),this.removeGroupControls=Ii,this.removeListeners=Ii,this.controls=new Gc(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Ii}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:yd,MeasureLayout:du}};function xd(e,t){const n=t?"pointerenter":"pointerleave",r=t?"onHoverStart":"onHoverEnd";return Ql(e.current,n,((n,o)=>{if("touch"===n.pointerType||fc())return;const i=e.getProps();e.animationState&&i.whileHover&&e.animationState.setActive("whileHover",t);const s=i[r];s&&Fi.postRender((()=>s(n,o)))}),{passive:!e.getProps()[r]})}const wd=(e,t)=>!!t&&(e===t||wd(e,t.parentElement));function _d(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,Gl(n))}const Ed=new WeakMap,Sd=new WeakMap,kd=e=>{const t=Ed.get(e.target);t&&t(e)},Cd=e=>{e.forEach(kd)};const Td={some:0,all:1},Pd={inView:{Feature:class extends Hl{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r="some",once:o}=e,i={root:t?t.current:void 0,rootMargin:n,threshold:"number"==typeof r?r:Td[r]};return function(e,t,n){const r=function({root:e,...t}){const n=e||document;Sd.has(n)||Sd.set(n,{});const r=Sd.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(Cd,{root:e,...t})),r[o]}(t);return Ed.set(e,n),r.observe(e),()=>{Ed.delete(e),r.unobserve(e)}}(this.node.current,i,(e=>{const{isIntersecting:t}=e;if(this.isInView===t)return;if(this.isInView=t,o&&!t&&this.hasEnteredView)return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);const{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),i=t?n:r;i&&i(e)}))}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}(e,t))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends Hl{constructor(){super(...arguments),this.removeStartListeners=Ii,this.removeEndListeners=Ii,this.removeAccessibleListeners=Ii,this.startPointerPress=(e,t)=>{if(this.isPressing)return;this.removeEndListeners();const n=this.node.getProps(),r=Ql(window,"pointerup",((e,t)=>{if(!this.checkPressEnd())return;const{onTap:n,onTapCancel:r,globalTapTarget:o}=this.node.getProps(),i=o||wd(this.node.current,e.target)?n:r;i&&Fi.update((()=>i(e,t)))}),{passive:!(n.onTap||n.onPointerUp)}),o=Ql(window,"pointercancel",((e,t)=>this.cancelPress(e,t)),{passive:!(n.onTapCancel||n.onPointerCancel)});this.removeEndListeners=Ua(r,o),this.startPress(e,t)},this.startAccessiblePress=()=>{const e=Zl(this.node.current,"keydown",(e=>{"Enter"!==e.key||this.isPressing||(this.removeEndListeners(),this.removeEndListeners=Zl(this.node.current,"keyup",(e=>{"Enter"===e.key&&this.checkPressEnd()&&_d("up",((e,t)=>{const{onTap:n}=this.node.getProps();n&&Fi.postRender((()=>n(e,t)))}))})),_d("down",((e,t)=>{this.startPress(e,t)})))})),t=Zl(this.node.current,"blur",(()=>{this.isPressing&&_d("cancel",((e,t)=>this.cancelPress(e,t)))}));this.removeAccessibleListeners=Ua(e,t)}}startPress(e,t){this.isPressing=!0;const{onTapStart:n,whileTap:r}=this.node.getProps();r&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),n&&Fi.postRender((()=>n(e,t)))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!fc()}cancelPress(e,t){if(!this.checkPressEnd())return;const{onTapCancel:n}=this.node.getProps();n&&Fi.postRender((()=>n(e,t)))}mount(){const e=this.node.getProps(),t=Ql(e.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),n=Zl(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=Ua(t,n)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}},focus:{Feature:class extends Hl{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(t){e=!0}e&&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=Ua(Zl(this.node.current,"focus",(()=>this.onFocus())),Zl(this.node.current,"blur",(()=>this.onBlur())))}unmount(){}}},hover:{Feature:class extends Hl{mount(){this.unmount=Ua(xd(this.node,!0),xd(this.node,!1))}unmount(){}}}},Rd={layout:{ProjectionNode:yd,MeasureLayout:du}},Od=(0,o.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),Nd=(0,o.createContext)({}),Ad="undefined"!=typeof window,jd=Ad?o.useLayoutEffect:o.useEffect,Md=(0,o.createContext)({strict:!1});let Id=!1;function Dd(e,t,n,r,i){var s;const{visualElement:a}=(0,o.useContext)(Nd),l=(0,o.useContext)(Md),c=(0,o.useContext)(eu),u=(0,o.useContext)(Od).reducedMotion,d=(0,o.useRef)();r=r||l.renderer,!d.current&&r&&(d.current=r(e,{visualState:t,parent:a,props:n,presenceContext:c,blockInitialAnimation:!!c&&!1===c.initial,reducedMotionConfig:u}));const f=d.current,h=(0,o.useContext)(nu);!f||f.projection||!i||"html"!==f.type&&"svg"!==f.type||function(e,t,n,r){const{layoutId:o,layout:i,drag:s,dragConstraints:a,layoutScroll:l,layoutRoot:c}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Fd(e.parent)),e.projection.setOptions({layoutId:o,layout:i,alwaysMeasureLayout:Boolean(s)||a&&hc(a),visualElement:e,animationType:"string"==typeof i?i:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:c})}(d.current,n,i,h),(0,o.useInsertionEffect)((()=>{f&&f.update(n,c)}));const p=n[Al],m=(0,o.useRef)(Boolean(p)&&!window.MotionHandoffIsComplete&&(null===(s=window.MotionHasOptimisedAnimation)||void 0===s?void 0:s.call(window,p)));return jd((()=>{f&&(f.updateFeatures(),lu.render(f.render),m.current&&f.animationState&&f.animationState.animateChanges())})),(0,o.useEffect)((()=>{f&&(!m.current&&f.animationState&&f.animationState.animateChanges(),m.current=!1,Id||(Id=!0,queueMicrotask(Ld)))})),f}function Ld(){window.MotionHandoffIsComplete=!0}function Fd(e){if(e)return!1!==e.options.allowProjection?e.projection:Fd(e.parent)}function zd(e,t,n){return(0,o.useCallback)((r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&("function"==typeof n?n(r):hc(n)&&(n.current=r))}),[t])}function Bd(e){return mi(e.animate)||Ei.some((t=>yi(e[t])))}function Vd(e){return Boolean(Bd(e)||e.variants)}function Wd(e){return Array.isArray(e)?e.join(" "):e}const Ud={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"]},$d={};for(const e in Ud)$d[e]={isEnabled:t=>Ud[e].some((e=>!!t[e]))};const Kd=Symbol.for("motionComponentSymbol");function Hd({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){e&&function(e){for(const t in e)$d[t]={...$d[t],...e[t]}}(e);const s=(0,o.forwardRef)((function(e,s){let a;const l={...(0,o.useContext)(Od),...e,layoutId:qd(e)},{isStatic:c}=l,u=function(e){const{initial:t,animate:n}=function(e,t){if(Bd(e)){const{initial:t,animate:n}=e;return{initial:!1===t||yi(t)?t:void 0,animate:yi(n)?n:void 0}}return!1!==e.inherit?t:{}}(e,(0,o.useContext)(Nd));return(0,o.useMemo)((()=>({initial:t,animate:n})),[Wd(t),Wd(n)])}(e),d=r(e,c);if(!c&&Ad){(0,o.useContext)(Md).strict;const e=function(e){const{drag:t,layout:n}=$d;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:(null==t?void 0:t.isEnabled(e))||(null==n?void 0:n.isEnabled(e))?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}(l);a=e.MeasureLayout,u.visualElement=Dd(i,d,l,t,e.ProjectionNode)}return(0,Qc.jsxs)(Nd.Provider,{value:u,children:[a&&u.visualElement?(0,Qc.jsx)(a,{visualElement:u.visualElement,...l}):null,n(i,e,zd(d,u.visualElement,s),d,c,u.visualElement)]})}));return s[Kd]=i,s}function qd({layoutId:e}){const t=(0,o.useContext)(tu).id;return t&&void 0!==e?t+"-"+e:e}const Yd=["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 Xd(e){return"string"==typeof e&&!e.includes("-")&&!!(Yd.indexOf(e)>-1||/[A-Z]/u.test(e))}function Gd(e,{style:t,vars:n},r,o){Object.assign(e.style,t,o&&o.getProjectionStyles(r));for(const t in n)e.style.setProperty(t,n[t])}const Jd=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 Zd(e,t,n,r){Gd(e,t,void 0,r);for(const n in t.attrs)e.setAttribute(Jd.has(n)?n:Nl(n),t.attrs[n])}function Qd(e,{layout:t,layoutId:n}){return ki.has(e)||e.startsWith("origin")||(t||void 0!==n)&&(!!au[e]||"opacity"===e)}function ef(e,t,n){var r;const{style:o}=e,i={};for(const s in o)(Dl(o[s])||t.style&&Dl(t.style[s])||Qd(s,e)||void 0!==(null===(r=null==n?void 0:n.getValue(s))||void 0===r?void 0:r.liveStyle))&&(i[s]=o[s]);return n&&o&&"string"==typeof o.willChange&&(n.applyWillChange=!1),i}function tf(e,t,n){const r=ef(e,t,n);for(const n in e)(Dl(e[n])||Dl(t[n]))&&(r[-1!==Si.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=e[n]);return r}function nf(e){const t=(0,o.useRef)(null);return null===t.current&&(t.current=e()),t.current}const rf=e=>(t,n)=>{const r=(0,o.useContext)(Nd),i=(0,o.useContext)(eu),s=()=>function({applyWillChange:e=!1,scrapeMotionValuesFromProps:t,createRenderState:n,onMount:r},o,i,s,a){const l={latestValues:af(o,i,s,!a&&e,t),renderState:n()};return r&&(l.mount=e=>r(o,e,l)),l}(e,t,r,i,n);return n?s():nf(s)};function of(e,t){const n=Ml(t);n&&Sl(e,n)}function sf(e,t,n){const r=Array.isArray(t)?t:[t];for(let t=0;t{for(const t in e){let n=e[t];Array.isArray(n)&&(n=n[p?n.length-1:0]),null!==n&&(s[t]=n)}for(const e in t)s[e]=t[e]})),l&&(d&&!1!==u&&!mi(d)&&sf(e,d,(e=>{for(const t in e)of(a,t)})),a.length&&(s.willChange=a.join(","))),s}const lf=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),cf=()=>({...lf(),attrs:{}}),uf=(e,t)=>t&&"number"==typeof e?t.transform(e):e,df={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ff=Si.length;function hf(e,t,n){const{style:r,vars:o,transformOrigin:i}=e;let s=!1,a=!1;for(const e in t){const n=t[e];if(ki.has(e))s=!0;else if(qi(e))o[e]=n;else{const t=uf(n,ea[e]);e.startsWith("origin")?(a=!0,i[e]=t):r[e]=t}}if(t.transform||(s||n?r.transform=function(e,t,n){let r="",o=!0;for(let i=0;i"string"==typeof e&&"svg"===e.toLowerCase(),bf={useVisualState:rf({scrapeMotionValuesFromProps:tf,createRenderState:cf,onMount:(e,t,{renderState:n,latestValues:r})=>{Fi.read((()=>{try{n.dimensions="function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch(e){n.dimensions={x:0,y:0,width:0,height:0}}})),Fi.render((()=>{vf(n,r,yf(t.tagName),e.transformTemplate),Zd(t,n)}))}})},xf={useVisualState:rf({applyWillChange:!0,scrapeMotionValuesFromProps:ef,createRenderState:lf})};function wf(e,t,n){for(const r in t)Dl(t[r])||Qd(r,n)||(e[r]=t[r])}function _f(e,t){const n={},r=function(e,t){const n={};return wf(n,e.style||{},e),Object.assign(n,function({transformTemplate:e},t){return(0,o.useMemo)((()=>{const n=lf();return hf(n,t,e),Object.assign({},n.vars,n.style)}),[t])}(e,t)),n}(e,t);return e.drag&&!1!==e.dragListener&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=!0===e.drag?"none":"pan-"+("x"===e.drag?"y":"x")),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const Ef=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 Sf(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Ef.has(e)}let kf=e=>!Sf(e);try{(Cf=n(316).A)&&(kf=e=>e.startsWith("on")?!Sf(e):Cf(e))}catch(e){}var Cf;function Tf(e,t,n,r){const i=(0,o.useMemo)((()=>{const n=cf();return vf(n,t,yf(r),e.transformTemplate),{...n.attrs,style:{...n.style}}}),[t]);if(e.style){const t={};wf(t,e.style,e),i.style={...t,...i.style}}return i}function Pf(e=!1){return(t,n,r,{latestValues:i},s)=>{const a=(Xd(t)?Tf:_f)(n,i,s,t),l=function(e,t,n){const r={};for(const o in e)"values"===o&&"object"==typeof e.values||(kf(o)||!0===n&&Sf(o)||!t&&!Sf(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}(n,"string"==typeof t,e),c=t!==o.Fragment?{...l,...a,ref:r}:{},{children:u}=n,d=(0,o.useMemo)((()=>Dl(u)?u.get():u),[u]);return(0,o.createElement)(t,{...c,children:d})}}function Rf(e,t){return function(n,{forwardMotionProps:r}={forwardMotionProps:!1}){return Hd({...Xd(n)?bf:xf,preloadedFeatures:e,useRender:Pf(r),createVisualElement:t,Component:n})}}const Of={current:null},Nf={current:!1},Af=new WeakMap,jf=[...Es,Ls,Ys],Mf=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],If=Ei.length;class Df{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,blockInitialAnimation:o,visualState:i},s={}){this.applyWillChange=!1,this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Os,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.isRenderScheduled=!1,this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.isRenderScheduled=!1,this.scheduleRender=()=>{this.isRenderScheduled||(this.isRenderScheduled=!0,Fi.render(this.render,!1,!0))};const{latestValues:a,renderState:l}=i;this.latestValues=a,this.baseTarget={...a},this.initialValues=t.initial?{...a}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.options=s,this.blockInitialAnimation=Boolean(o),this.isControllingVariants=Bd(t),this.isVariantNode=Vd(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(e&&e.current);const{willChange:c,...u}=this.scrapeMotionValuesFromProps(t,{},this);for(const e in u){const t=u[e];void 0!==a[e]&&Dl(t)&&t.set(a[e],!1)}}mount(e){this.current=e,Af.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach(((e,t)=>this.bindToMotionValue(t,e))),Nf.current||function(){if(Nf.current=!0,Ad)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Of.current=e.matches;e.addListener(t),t()}else Of.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Of.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Af.delete(this.current),this.projection&&this.projection.unmount(),zi(this.notifyUpdate),zi(this.render),this.valueSubscriptions.forEach((e=>e())),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}bindToMotionValue(e,t){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const n=ki.has(e),r=t.on("change",(t=>{this.latestValues[e]=t,this.props.onUpdate&&Fi.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)})),o=t.on("renderRequest",this.scheduleRender);let i;window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,(()=>{r(),o(),i&&i(),t.owner&&t.stop()}))}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}updateFeatures(){let e="animation";for(e in $d){const t=$d[e];if(!t)continue;const{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){const t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Oc()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;tt.variantChildren.delete(e)}addValue(e,t){const n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return void 0===n&&void 0!==t&&(n=Rl(null===t?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){var n;let r=void 0===this.latestValues[e]&&this.current?null!==(n=this.getBaseTargetFromProps(this.props,e))&&void 0!==n?n:this.readValueFromInstance(this.current,e,this.options):this.latestValues[e];return null!=r&&("string"==typeof r&&(Ki(r)||Wi(r))?r=parseFloat(r):!(e=>jf.find(_s(e)))(r)&&Ys.test(t)&&(r=ra(e,t)),this.setBaseTarget(e,Dl(r)?r.get():r)),Dl(r)?r.get():r}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;const{initial:n}=this.props;let r;if("string"==typeof n||"object"==typeof n){const o=xi(this.props,n,null===(t=this.presenceContext)||void 0===t?void 0:t.custom);o&&(r=o[e])}if(n&&void 0!==r)return r;const o=this.getBaseTargetFromProps(this.props,e);return void 0===o||Dl(o)?void 0!==this.initialValues[e]&&void 0===r?void 0:this.baseTarget[e]:o}on(e,t){return this.events[e]||(this.events[e]=new Cl),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class Lf extends Df{constructor(){super(...arguments),this.KeyframeResolver=ia}sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}}class Ff extends Lf{constructor(){super(...arguments),this.type="html",this.applyWillChange=!0,this.renderInstance=Gd}readValueFromInstance(e,t){if(ki.has(t)){const e=na(t);return e&&e.default||0}{const r=(n=e,window.getComputedStyle(n)),o=(qi(t)?r.getPropertyValue(t):r[t])||0;return"string"==typeof o?o.trim():o}var n}measureInstanceViewportBox(e,{transformPagePoint:t}){return qc(e,t)}build(e,t,n){hf(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return ef(e,t,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Dl(e)&&(this.childSubscription=e.on("change",(e=>{this.current&&(this.current.textContent=`${e}`)})))}}class zf extends Lf{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Oc}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(ki.has(t)){const e=na(t);return e&&e.default||0}return t=Jd.has(t)?t:Nl(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return tf(e,t,n)}build(e,t,n){vf(e,t,this.isSVGTag,n.transformTemplate)}renderInstance(e,t,n,r){Zd(e,t,0,r)}mount(e){this.isSVGTag=yf(e.tagName),super.mount(e)}}const Bf=pi(Rf({...Yl,...Pd,...bd,...Rd},((e,t)=>Xd(e)?new zf(t):new Ff(t,{allowProjection:e!==o.Fragment}))));var Vf=["slug","text","icon","className","disabled","badge"];function Wf(){return Wf=Object.assign?Object.assign.bind():function(e){for(var t=1;t*]:box-border flex items-center ".concat("full"===y?"w-full":""," ").concat(E),k=te(S,x,w,t,_,"underline"!==p?"bg-tab-background":"",l);return i().createElement("div",{className:k},i().createElement(Uf.Provider,{value:{activeItem:s,onChange:b,size:u,variant:p,orientation:f,iconPosition:g,width:y}},i().Children.map(n,(function(e){return(0,o.isValidElement)(e)?i().cloneElement(e):null}))))},Tab:Kf};const qf=be("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]),Yf=be("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),Xf=be("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);var Gf={sm:{icon:"[&>svg]:size-4",searchIcon:"[&>svg]:size-4",selectButton:"px-2 py-2 rounded text-xs font-medium leading-4 min-h-[2.25rem]",multiSelect:"pl-2 pr-2 py-1.5",displaySelected:"text-xs font-normal",dropdown:"rounded-md",dropdownItemsWrapper:"p-1.5",searchbarWrapper:"p-3 flex items-center gap-0.5",searchbar:"font-medium text-xs",searchbarIcon:"[&>svg]:size-4",label:"text-xs font-medium"},md:{icon:"[&>svg]:size-5",searchIcon:"[&>svg]:size-5",selectButton:"px-2.5 py-2.5 rounded-md text-xs font-medium leading-4 min-h-[2.5rem]",multiSelect:"pl-2 pr-2.5 py-2",displaySelected:"text-sm font-normal",dropdown:"rounded-lg",dropdownItemsWrapper:"p-2",searchbarWrapper:"p-2.5 flex items-center gap-1",searchbar:"font-medium text-sm",searchbarIcon:"[&>svg]:size-5",label:"text-sm font-medium"},lg:{icon:"[&>svg]:size-6",searchIcon:"[&>svg]:size-5",selectButton:"px-3 py-3 rounded-lg text-sm font-medium leading-5 min-h-[3rem]",multiSelect:"pl-2.5 pr-3 py-2.5",displaySelected:"text-sm font-normal",dropdown:"rounded-lg",dropdownItemsWrapper:"p-2",searchbarWrapper:"p-2.5 flex items-center gap-1",searchbar:"font-medium text-sm",searchbarIcon:"[&>svg]:size-5",label:"text-base font-medium"}},Jf="group-disabled:text-field-color-disabled",Zf=["value","selected","children"];function Qf(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,s,a=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}(e,t)||nh(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function eh(){return eh=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n{r&&(clearTimeout(m.current),y.current=null,g.current="")}),[r]),Or((()=>{var e;r&&""===g.current&&(v.current=null!=(e=null!=p?p:a)?e:-1)}),[r,p,a]);const E=mr((e=>{e?i.current.typing||(i.current.typing=e,x(e)):i.current.typing&&(i.current.typing=e,x(e))})),S=mr((e=>{function t(e,t,n){const r=w.current?w.current(t,n):t.find((e=>0===(null==e?void 0:e.toLocaleLowerCase().indexOf(n.toLocaleLowerCase()))));return r?e.indexOf(r):-1}const n=s.current;if(g.current.length>0&&" "!==g.current[0]&&(-1===t(n,n,g.current)?E(!1):" "===e.key&&Yt(e)),null==n||_.current.includes(e.key)||1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey)return;r&&" "!==e.key&&(Yt(e),E(!0)),n.every((e=>{var t,n;return!e||(null==(t=e[0])?void 0:t.toLocaleLowerCase())!==(null==(n=e[1])?void 0:n.toLocaleLowerCase())}))&&g.current===e.key&&(g.current="",v.current=y.current),g.current+=e.key,clearTimeout(m.current),m.current=setTimeout((()=>{g.current="",v.current=y.current,E(!1)}),f);const o=v.current,i=t(n,[...n.slice((o||0)+1),...n.slice(0,(o||0)+1)],g.current);-1!==i?(b(i),y.current=i):" "!==e.key&&(g.current="",E(!1))})),k=o.useMemo((()=>({onKeyDown:S})),[S]),C=o.useMemo((()=>({onKeyDown:S,onKeyUp(e){" "===e.key&&E(!1)}})),[S,E]);return o.useMemo((()=>u?{reference:k,floating:C}:{}),[u,k,C])}(B,{listRef:W,activeIndex:N,selectedIndex:M,onMatch:P?A:I,onTypingChange:function(e){U.current=e}}),X=jo([K,H,q,$].concat(th(m?[]:[Y]))),G=X.getReferenceProps,J=X.getFloatingProps,Z=X.getItemProps,Q=function(e,t){if(h)return function(e,t){var n,r=th(null!==(n=C())&&void 0!==n?n:[]);-1===r.findIndex((function(e){return"object"===oh(e)?e[u]===t[u]:e===t}))&&(r.push(t),b||_(r),I(e),F.reference.current.focus(),R(!1),k(""),"function"==typeof l&&l(r))}(e,t);I(e),b||_(t),F.reference.current.focus(),R(!1),k(""),"function"==typeof l&&l(t)},ee=(0,o.useCallback)((function(e,t){V.current[e]=t}),[]);return React.createElement(lh.Provider,{value:{selectedIndex:M,setSelectedIndex:I,activeIndex:N,setActiveIndex:A,selected:w,setSelected:_,handleSelect:Q,combobox:m,sizeValue:i,multiple:h,onChange:l,isTypingRef:U,getItemProps:Z,onClickItem:function(e,t){Q(e,t)},onKeyDownItem:function(e,t,n){"Enter"===e.key&&(e.preventDefault(),Q(t,n))," "!==e.key||U.current||(e.preventDefault(),Q(t,n))},getValues:C,selectId:y,getReferenceProps:G,isOpen:P,value:s,updateListRef:ee,refs:F,listContentRef:W,by:u,getFloatingProps:J,floatingStyles:z,context:B,searchKeyword:S,setSearchKeyword:k,disabled:v}},d)};uh.Button=function(e){var t,n,r,i=e.children,s=e.icon,a=void 0===s?null:s,l=e.placeholder,c=void 0===l?"Select an option":l,u=e.optionIcon,d=void 0===u?null:u,f=e.displayBy,h=void 0===f?"name":f,p=e.label,m=ch(),g=m.sizeValue,v=m.getReferenceProps,y=m.getValues,b=m.selectId,x=m.refs,w=m.isOpen,_=m.multiple,E=m.combobox,S=m.setSelected,k=m.onChange,C=m.isControlled,T=m.disabled,P=m.by,R=null===(t={sm:"xs",md:"sm",lg:"md"})||void 0===t?void 0:t[g],O=(0,o.useCallback)((function(){if(a)return a;var e="text-field-placeholder group-disabled:text-icon-disabled";return E?React.createElement(qf,{className:e}):React.createElement(Yf,{className:e})}),[a]),N=(0,o.useCallback)((function(){var e=y();if(!e)return null;if("function"==typeof i){var t=sh({value:e},_?{onClose:A}:{});return i(t)}if(_)return e.map((function(e,t){return React.createElement($e,{icon:d,type:"rounded",key:t,size:R,onMouseDown:A(e),label:"object"===oh(e)?e[h]:e,disabled:T})}));var n="object"===oh(e)?e[h]:e;return(0,o.isValidElement)(i)&&(n=i),React.createElement("span",{className:te(Gf[g].displaySelected,Jf)},n)}),[y]),A=function(e){return function(t){var n;null==t||t.preventDefault(),null==t||t.stopPropagation();var r=th(null!==(n=y())&&void 0!==n?n:[]),o=r.findIndex((function(t){return"object"===oh(t)?t[P]===e[P]:t===e}));-1!==o&&(r.splice(o,1),C||S(r),"function"==typeof k&&k(r))}};return React.createElement("div",{className:"flex flex-col items-start gap-1.5 [&_*]:box-border box-border"},React.createElement("label",{className:te(null===(n=Gf[g])||void 0===n?void 0:n.label,"text-field-label"),htmlFor:b},p),React.createElement("button",eh({id:b,ref:x.setReference,className:te("flex items-center justify-between border border-solid w-full box-border transition-colors duration-150 bg-white","border focus-visible:outline-none border-solid border-field-border",!w&&"focus:ring-2 focus:ring-offset-4 focus:border-focus-border focus:ring-focus [&:hover:not(:focus):not(:disabled)]:border-border-strong",Gf[g].selectButton,_&&Gf[g].multiSelect,"group disabled:border-field-border-disabled [&:hover:has(:disabled)]:border-field-border-disabled"),"aria-labelledby":"select-label",tabIndex:0,disabled:T},v()),React.createElement("div",{className:te("flex-1 grid items-center justify-start gap-1.5 ",y()&&"flex flex-wrap")},N(),(_?!(null!==(r=y())&&void 0!==r&&r.length):!y())&&React.createElement("div",{className:te("[grid-area:1/1/2/3] text-field-input",Gf[g].displaySelected,Jf)},c)),React.createElement("div",{className:te("flex items-center [&>svg]:shrink-0",Gf[g].icon)},O())))},uh.Options=function(e){var t=e.children,n=e.searchBy,r=void 0===n?"id":n,i=e.searchPlaceholder,s=void 0===i?"Search...":i,a=e.dropdownPortalRoot,l=void 0===a?null:a,c=e.dropdownPortalId,u=void 0===c?"":c,d=ch(),f=d.isOpen,h=d.context,p=d.refs,m=d.combobox,g=d.floatingStyles,v=d.getFloatingProps,y=d.sizeValue,b=d.setSearchKeyword,x=d.setActiveIndex,w=d.setSelectedIndex,_=d.value,E=d.selected,S=d.getValues,k=d.searchKeyword,C=d.listContentRef,T=d.by,P=(0,o.useMemo)((function(){var e=S(),n=0;return e&&(n=o.Children.toArray(t).findIndex((function(t){return"object"===oh(t.props.value)?t.props.value[T]===e[T]:t.props.value===e}))),-1===n?0:n}),[_,E,t]);(0,o.useLayoutEffect)((function(){x(P),w(P)}),[]);var R=(0,o.useMemo)((function(){return o.Children.map(t,(function(e,t){if(!(0,o.isValidElement)(e))return null;if(k){var n=e.props.value;if("object"===oh(n)){if(-1===n[r].toLowerCase().indexOf(k.toLowerCase()))return null}else if(-1===n.toLowerCase().indexOf(k.toLowerCase()))return null}return(0,o.cloneElement)(e,sh(sh({},e.props),{},{index:t}))}))}),[k,_,E,t]),O=o.Children.count(R);return(0,o.useEffect)((function(){C.current=[],o.Children.forEach(t,(function(e){if((0,o.isValidElement)(e)&&e.props.value){if(k){var t=e.props.value;if("object"===oh(t)){if(-1===t[r].toLowerCase().indexOf(k.toLowerCase()))return}else if(-1===t.toLowerCase().indexOf(k.toLowerCase()))return}C.current.push(e.props.value)}}))}),[k]),React.createElement(React.Fragment,null,f&&React.createElement(fo,{id:u,root:l},React.createElement(wo,{context:h,modal:!1},React.createElement("div",eh({ref:p.setFloating,className:te("box-border [&_*]:box-border w-full bg-white outline-none shadow-lg border border-solid border-border-subtle overflow-hidden",m&&"grid grid-cols-1 grid-rows-[auto_1fr] divide-y divide-x-0 divide-solid divide-border-subtle",Gf[y].dropdown,!m&&"h-full"),style:sh({},g)},v()),m&&React.createElement("div",{className:te(Gf[y].searchbarWrapper)},React.createElement(Xf,{className:te("text-icon-secondary shrink-0",Gf[y].searchbarIcon)}),React.createElement("input",{className:te("px-1 w-full placeholder:text-field-placeholder border-0 focus:outline-none focus:shadow-none",Gf[y].searchbar),type:"search",name:"keyword",placeholder:s,onChange:function(e){return b(e.target.value)},autoComplete:"off"})),React.createElement("div",{className:te("overflow-y-auto",!m&&"w-full h-full",Gf[y].dropdownItemsWrapper)},!!O&&R,!O&&React.createElement("div",{className:"p-2 text-center text-base font-medium text-field-placeholder"},"No items found"))))))},uh.Option=function(e){var t=e.value,n=e.selected,r=e.children,i=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.create(mh({message:e,type:"neutral"},t))}},{key:"success",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.create(mh({message:e,type:"success"},t))}},{key:"error",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.create(mh({message:e,type:"error"},t))}},{key:"warning",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.create(mh({message:e,type:"warning"},t))}},{key:"info",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.create(mh({message:e,type:"info"},t))}},{key:"custom",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.create(mh({jsx:e,type:"custom"},t))}}],t&&vh(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}(),Th=new Ch,Ph=Object.seal(Object.assign((function(e,t){return Th.default(e,t)}),{success:Th.success.bind(Th),error:Th.error.bind(Th),warning:Th.warning.bind(Th),info:Th.info.bind(Th),custom:Th.custom.bind(Th),dismiss:Th.dismiss.bind(Th),update:Th.update.bind(Th)},{getHistory:Th.history.bind(Th)})),Rh=!1,Oh={"top-left":"top-0 bottom-0 left-0 justify-start items-start","top-right":"top-0 bottom-0 right-0 justify-start items-end","bottom-left":"top-0 bottom-0 left-0 justify-end items-start","bottom-right":"top-0 bottom-0 right-0 justify-end items-end"},Nh={neutral:"border-alert-border-neutral bg-alert-background-neutral",custom:"border-alert-border-neutral bg-alert-background-neutral",info:"border-alert-border-info bg-alert-background-info",success:"border-alert-border-green bg-alert-background-green",warning:"border-alert-border-warning bg-alert-background-warning",error:"border-alert-border-danger bg-alert-background-danger"},Ah="bg-background-inverse border-background-inverse",jh={light:"text-icon-secondary",dark:"text-icon-inverse"};class Mh extends o.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){const e=this.props.sizeRef.current;e.height=t.offsetHeight||0,e.width=t.offsetWidth||0,e.top=t.offsetTop,e.left=t.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function Ih({children:e,isPresent:t}){const n=(0,o.useId)(),r=(0,o.useRef)(null),i=(0,o.useRef)({width:0,height:0,top:0,left:0}),{nonce:s}=(0,o.useContext)(Od);return(0,o.useInsertionEffect)((()=>{const{width:e,height:o,top:a,left:l}=i.current;if(t||!r.current||!e||!o)return;r.current.dataset.motionPopId=n;const c=document.createElement("style");return s&&(c.nonce=s),document.head.appendChild(c),c.sheet&&c.sheet.insertRule(`\n [data-motion-pop-id="${n}"] {\n position: absolute !important;\n width: ${e}px !important;\n height: ${o}px !important;\n top: ${a}px !important;\n left: ${l}px !important;\n }\n `),()=>{document.head.removeChild(c)}}),[t]),(0,Qc.jsx)(Mh,{isPresent:t,childRef:r,sizeRef:i,children:o.cloneElement(e,{ref:r})})}const Dh=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:a})=>{const l=nf(Lh),c=(0,o.useId)(),u=(0,o.useMemo)((()=>({id:c,initial:t,isPresent:n,custom:i,onExitComplete:e=>{l.set(e,!0);for(const e of l.values())if(!e)return;r&&r()},register:e=>(l.set(e,!1),()=>l.delete(e))})),s?[Math.random()]:[n]);return(0,o.useMemo)((()=>{l.forEach(((e,t)=>l.set(t,!1)))}),[n]),o.useEffect((()=>{!n&&!l.size&&r&&r()}),[n]),"popLayout"===a&&(e=(0,Qc.jsx)(Ih,{isPresent:n,children:e})),(0,Qc.jsx)(eu.Provider,{value:u,children:e})};function Lh(){return new Map}const Fh=e=>e.key||"";function zh(e){const t=[];return o.Children.forEach(e,(e=>{(0,o.isValidElement)(e)&&t.push(e)})),t}const Bh=({children:e,exitBeforeEnter:t,custom:n,initial:r=!0,onExitComplete:i,presenceAffectsLayout:s=!0,mode:a="sync"})=>{$i(!t,"Replace exitBeforeEnter with mode='wait'");const l=(0,o.useMemo)((()=>zh(e)),[e]),c=l.map(Fh),u=(0,o.useRef)(!0),d=(0,o.useRef)(l),f=nf((()=>new Map)),[h,p]=(0,o.useState)(l),[m,g]=(0,o.useState)(l);jd((()=>{u.current=!1,d.current=l;for(let e=0;e{const t=Fh(e),o=l===m||c.includes(t);return(0,Qc.jsx)(Dh,{isPresent:o,initial:!(u.current&&!r)&&void 0,custom:o?void 0:n,presenceAffectsLayout:s,mode:a,onExitComplete:o?void 0:()=>{if(!f.has(t))return;f.set(t,!0);let e=!0;f.forEach((t=>{t||(e=!1)})),e&&(null==y||y(),g(d.current),i&&i())},children:e},t)}))})};function Vh(e){return Vh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vh(e)}function Wh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Uh(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n1&&void 0!==arguments[1]?arguments[1]:u;if(l&&!(u<0))return x.current=(new Date).getTime(),setTimeout((function(){b(e.id)}),t)};(0,o.useEffect)((function(){var e=u;return _.current=E(t,e),function(){clearTimeout(_.current)}}),[]),(0,o.useEffect)((function(){null!=t&&t.dismiss&&b(t.id)}),[t]);var S,k,C,T,P,R,O,N,A,j,M=function(){var e,n;null==t||null===(e=t.action)||void 0===e||null===(n=e.onClick)||void 0===n||n.call(e,(function(){return b(t.id)}))},I=null;return"stack"===p&&(I=React.createElement("div",{className:te("flex items-center justify-start p-4 gap-2 relative border border-solid rounded-md shadow-lg","dark"===f?Ah:null===(S=Nh)||void 0===S?void 0:S[y],"w-[22.5rem]"),onMouseEnter:function(){clearTimeout(_.current),w.current=(new Date).getTime()},onMouseLeave:function(){_.current=E(t,u-(w.current-x.current))}},"custom"!==t.type?React.createElement(React.Fragment,null,React.createElement("div",{className:"self-start flex items-center justify-center [&_svg]:size-5 shrink-0"},Xo({variant:y,icon:g,theme:f})),React.createElement("div",{className:"flex flex-col items-start justify-start gap-0.5"},Jo({title:r,theme:f}),Zo({content:s,theme:f}),(null==t||null===(k=t.action)||void 0===k?void 0:k.label)&&"function"==typeof(null==t||null===(C=t.action)||void 0===C?void 0:C.onClick)&&React.createElement("div",{className:"mt-2.5"},Go({actionLabel:null==t||null===(T=t.action)||void 0===T?void 0:T.label,actionType:null!==(P=null==t||null===(R=t.action)||void 0===R?void 0:R.type)&&void 0!==P?P:"button",onAction:M,theme:f}))),React.createElement("div",{className:"absolute right-4 top-4 [&_svg]:size-5"},React.createElement("button",{className:te("bg-transparent m-0 p-0 border-none focus:outline-none active:outline-none cursor-pointer",null!==(O=jh[f])&&void 0!==O?O:jh.light),onClick:function(){return b(t.id)}},React.createElement(Ve,null)))):null==t||null===(N=t.jsx)||void 0===N?void 0:N.call(t,{close:function(){return b(t.id)},action:null!=t&&t.action?Uh(Uh({},null==t?void 0:t.action),{},{onClick:M}):null}))),"inline"===p&&(I=React.createElement("div",{className:te("flex items-center justify-start p-3 gap-2 relative border border-solid rounded-md shadow-lg","dark"===f?Ah:null===(A=Nh)||void 0===A?void 0:A[y],"lg:w-[47.5rem] w-full")},React.createElement("div",{className:"self-start flex items-center justify-center [&_svg]:size-5 shrink-0"},Xo({variant:y,icon:g,theme:f})),React.createElement("div",{className:"flex items-start justify-start gap-1 mr-10 [&>span:first-child]:shrink-0"},Jo({title:r,theme:f}),Zo({content:s,theme:f})),React.createElement("div",{className:"absolute right-3 top-3 [&_svg]:size-5"},React.createElement("button",{className:te("bg-transparent m-0 p-0 border-none focus:outline-none active:outline-none cursor-pointer",null!==(j=jh[f])&&void 0!==j?j:jh.light),onClick:function(){return b(t.id)}},React.createElement(Ve,null))))),I},Xh=(qh=function(e){var t,n,r,i=e.position,s=void 0===i?"top-right":i,a=e.design,l=void 0===a?"stack":a,c=e.theme,u=void 0===c?"light":c,d=e.className,f=void 0===d?"":d,h=e.autoDismiss,p=void 0===h||h,m=e.dismissAfter,g=void 0===m?5e3:m,v=(n=(0,o.useState)([]),r=2,function(e){if(Array.isArray(e))return e}(n)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,s,a=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}(n,r)||Kh(n,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),y=v[0],b=v[1];(0,o.useEffect)((function(){Th.subscribe((function(e){null!=e&&e.dismiss?b((function(t){return t.map((function(t){return t.id===e.id?Uh(Uh({},t),{},{dismiss:!0}):t}))})):setTimeout((function(){(0,Mn.flushSync)((function(){return b((function(t){return-1!==t.findIndex((function(t){return t.id===e.id}))?t.map((function(t){return t.id===e.id?Uh(Uh({},t),e):t})):[].concat(function(e){return function(e){if(Array.isArray(e))return Hh(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Kh(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t),[e])}))}))}))}))}),[]);var x=function(e){b((function(t){return t.filter((function(t){return t.id!==e}))}))};return React.createElement("ul",{className:te("fixed flex flex-col list-none z-20 p-10 pointer-events-none [&>li]:pointer-events-auto gap-3",null!==(t=Oh[s])&&void 0!==t?t:Oh["top-right"],f)},React.createElement(Bh,{initial:!1},y.map((function(e){var t,n,r,o,i;return React.createElement(Bf.li,{key:e.id,positionTransition:!0,initial:{opacity:0,y:50,scale:.7},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,scale:.6,transition:{duration:.15}},layoutId:"toast-".concat(e.id)},React.createElement(Yh,{toastItem:e,title:e.title,content:null==e?void 0:e.description,icon:null!==(t=null==e?void 0:e.icon)&&void 0!==t?t:null,design:null!==(n=null==e?void 0:e.design)&&void 0!==n?n:l,autoDismiss:null!==(r=null==e?void 0:e.autoDismiss)&&void 0!==r?r:p,dismissAfter:null!==(o=null==e?void 0:e.dismissAfter)&&void 0!==o?o:g,removeToast:x,variant:e.type,theme:null!==(i=null==e?void 0:e.theme)&&void 0!==i?i:u}))}))))},(0,o.memo)((function(e){var t=e.singleTon;return Rh&&t?null:(Rh=!0,React.createElement(qh,e))}))),Gh=["containerType","gap","direction","justify","align","wrap","cols","tabCols","mCols","className","children"],Jh=["grow","shrink","order","alignSelf","className","children"];function Zh(){return Zh=Object.assign?Object.assign.bind():function(e){for(var t=1;tspan:first-child]:shrink-0"},Jo({title:g,theme:u}),Zo({content:y,theme:u}))),React.createElement("div",{className:"flex items-center justify-start gap-4 [&_svg]:size-5"},(null==S?void 0:S.label)&&"function"==typeof(null==S?void 0:S.onClick)&&React.createElement("div",{className:"flex"},Go({actionLabel:null==S?void 0:S.label,actionType:null!==(n=null==S?void 0:S.type)&&void 0!==n?n:"button",onAction:O,theme:u})),React.createElement("button",{className:te("bg-transparent m-0 p-0 border-none focus:outline-none active:outline-none cursor-pointer",null!==(r=R[u])&&void 0!==r?r:R.light),onClick:function(){return k()}},React.createElement(Ve,null))))},op=(tp=function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e{t.focus((()=>{const e=document.activeElement,n=t.getRootElement();null===n||null!==e&&n.contains(e)||n.focus({preventScroll:!0})}),{defaultSelection:e})}),[e,t]),null}const lp={},cp={},up={},dp={},fp={},hp={},pp={},mp={},gp={},vp={},yp={},bp={},xp={},wp={},_p={},Ep={},Sp={},kp={},Cp={},Tp={},Pp={},Rp={},Op={},Np={},Ap={},jp={},Mp={},Ip={},Dp={},Lp={},Fp={},zp={},Bp={},Vp={},Wp={},Up={},$p={},Kp={},Hp={},qp={},Yp="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Xp=Yp&&"documentMode"in document?document.documentMode:null,Gp=Yp&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Jp=Yp&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Zp=!(!Yp||!("InputEvent"in window)||Xp)&&"getTargetRanges"in new window.InputEvent("input"),Qp=Yp&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),em=Yp&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,tm=Yp&&/Android/.test(navigator.userAgent),nm=Yp&&/^(?=.*Chrome).*/i.test(navigator.userAgent),rm=Yp&&tm&&nm,om=Yp&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!nm,im=1,sm=3,am=0,lm=2,cm=0,um=1,dm=2,fm=4,hm=8,pm=3|fm|hm|240,mm=1,gm=2,vm=3,ym=4,bm=5,xm=6,wm=Qp||em||om?" ":"​",_m="\n\n",Em=Jp?" ":wm,Sm="֑-߿יִ-﷽ﹰ-ﻼ",km="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",Cm=new RegExp("^[^"+km+"]*["+Sm+"]"),Tm=new RegExp("^[^"+Sm+"]*["+km+"]"),Pm={bold:1,code:16,highlight:128,italic:2,strikethrough:fm,subscript:32,superscript:64,underline:hm},Rm={directionless:1,unmergeable:2},Om={center:gm,end:xm,justify:ym,left:mm,right:vm,start:bm},Nm={[gm]:"center",[xm]:"end",[ym]:"justify",[mm]:"left",[vm]:"right",[bm]:"start"},Am={normal:0,segmented:2,token:1},jm={[cm]:"normal",[dm]:"segmented",[um]:"token"};var Mm,Im=(Mm=function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;eLm;try{Rb(e,(()=>{const o=eb()||function(e){return e.getEditorState().read((()=>{const e=eb();return null!==e?e.clone():null}))}(e),i=new Map,s=e.getRootElement(),a=e._editorState,l=e._blockCursorElement;let c=!1,u="";for(let n=0;n0){let t=0;for(let o=0;o0)for(const[t,n]of i)if(Nb(n)){const r=n.getChildrenKeys();let o=t.firstChild;for(let n=0;n0){for(let t=0;t{$m(e,t,n)}))}function qm(e,t){const n=e.__mode,r=e.__format,o=e.__style,i=t.__mode,s=t.__format,a=t.__style;return!(null!==n&&n!==i||null!==r&&r!==s||null!==o&&o!==a)}function Ym(e,t){const n=e.mergeWithSibling(t),r=yb()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function Xm(e){let t,n,r=e;if(""!==r.__text||!r.isSimpleText()||r.isUnmergeable()){for(;null!==(t=r.getPreviousSibling())&&Ny(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(""!==t.__text){if(qm(t,r)){r=Ym(t,r);break}break}t.remove()}for(;null!==(n=r.getNextSibling())&&Ny(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(""!==n.__text){if(qm(r,n)){r=Ym(r,n);break}break}n.remove()}}else r.remove()}function Gm(e){for(;"element"===e.type;){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),Ny(r)){e.set(r.__key,o?r.getTextContentSize():0,"text");break}if(!Nb(r))break;e.set(r.__key,o?r.getChildrenSize():0,"element")}}let Jm=1;const Zm="function"==typeof queueMicrotask?queueMicrotask:e=>{Promise.resolve().then(e)};function Qm(e){const t=document.activeElement;if(null===t)return!1;const n=t.nodeName;return Mb(pg(e))&&("INPUT"===n||"TEXTAREA"===n||"true"===t.contentEditable&&null==rg(t))}function eg(e,t,n){const r=e.getRootElement();try{return null!==r&&r.contains(t)&&r.contains(n)&&null!==t&&!Qm(t)&&ng(t)===e}catch(e){return!1}}function tg(e){return e instanceof qb}function ng(e){let t=e;for(;null!=t;){const e=rg(t);if(tg(e))return e;t=Ug(t)}return null}function rg(e){return e?e.__lexicalEditor:null}function og(e){return e.isToken()||e.isSegmented()}function ig(e){return e.nodeType===sm}function sg(e){let t=e;for(;null!=t;){if(ig(t))return t;t=t.firstChild}return null}function ag(e,t,n){const r=Pm[t];if(null!==n&&(e&r)==(n&r))return e;let o=e^r;return"subscript"===t?o&=~Pm.superscript:"superscript"===t&&(o&=~Pm.subscript),o}function lg(e){const t=e.getParent();if(null!==t){const n=e.getWritable(),r=t.getWritable(),o=e.getPreviousSibling(),i=e.getNextSibling();if(null===o)if(null!==i){const e=i.getWritable();r.__first=i.__key,e.__prev=null}else r.__first=null;else{const e=o.getWritable();if(null!==i){const t=i.getWritable();t.__prev=e.__key,e.__next=t.__key}else e.__next=null;n.__prev=null}if(null===i)if(null!==o){const e=o.getWritable();r.__last=o.__key,e.__next=null}else r.__last=null;else{const e=i.getWritable();if(null!==o){const t=o.getWritable();t.__next=e.__key,e.__prev=t.__key}else e.__prev=null;n.__next=null}r.__size--,n.__parent=null}}function cg(e){gb();const t=e.getLatest(),n=t.__parent,r=vb(),o=yb(),i=r._nodeMap,s=o._dirtyElements;null!==n&&function(e,t,n){let r=e;for(;null!==r;){if(n.has(r))return;const e=t.get(r);if(void 0===e)break;n.set(r,!1),r=e.__parent}}(n,i,s);const a=t.__key;o._dirtyType=1,Nb(e)?s.set(a,!0):o._dirtyLeaves.add(a)}function ug(e){mb();const t=yb(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,null!==n){const e=fg(n);null!==e&&e.getWritable()}if(null!==e){const t=fg(e);null!==t&&t.getWritable()}}}function dg(){return pb()?null:yb()._compositionKey}function fg(e,t){const n=(t||vb())._nodeMap.get(e);return void 0===n?null:n}function hg(e,t){const n=e[`__lexicalKey_${yb()._key}`];return void 0!==n?fg(n,t):null}function pg(e,t){let n=e;for(;null!=n;){const e=hg(n,t);if(null!==e)return e;n=Ug(n)}return null}function mg(e){const t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function gg(e){return e.read((()=>vg().getTextContent()))}function vg(){return yg(vb())}function yg(e){return e._nodeMap.get("root")}function bg(e){mb();const t=vb();null!==e&&(e.dirty=!0,e.setCachedNodes(null)),t._selection=e}function xg(e){const t=yb(),n=function(e,t){let n=e;for(;null!=n;){const e=n[`__lexicalKey_${t._key}`];if(void 0!==e)return e;n=Ug(n)}return null}(e,t);return null===n?e===t.getRootElement()?fg("root"):null:fg(n)}function wg(e,t){return t?e.getTextContentSize():0}function _g(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function Eg(e){const t=[];let n=e;for(;null!==n;)t.push(n),n=n._parentEditor;return t}function Sg(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function kg(e){return e.nodeType===sm?e.nodeValue:null}function Cg(e,t,n){const r=Gg(t._window);if(null===r)return;const o=r.anchorNode;let{anchorOffset:i,focusOffset:s}=r;if(null!==o){let t=kg(o);const r=pg(o);if(null!==t&&Ny(r)){if(t===wm&&n){const e=n.length;t=n,i=e,s=e}null!==t&&Tg(r,t,i,s,e)}}}function Tg(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]===wm&&(a=t.slice(0,-1));const l=i.getTextContent();if(o||a!==l){if(""===a){if(ug(null),Qp||em||om)i.remove();else{const e=yb();setTimeout((()=>{e.update((()=>{i.isAttached()&&i.remove()}))}),20)}return}const t=i.getParent(),o=tb(),l=i.getTextContentSize(),c=dg(),u=i.getKey();if(i.isToken()||null!==c&&u===c&&!s||Vy(o)&&(null!==t&&!t.canInsertTextBefore()&&0===o.anchor.offset||o.anchor.key===e.__key&&0===o.anchor.offset&&!i.canInsertTextBefore()&&!s||o.focus.key===e.__key&&o.focus.offset===l&&!i.canInsertTextAfter()&&!s))return void i.markDirty();const d=eb();if(!Vy(d)||null===n||null===r)return void i.setTextContent(a);if(d.setTextNodeRange(i,n,i,r),i.isSegmented()){const e=Oy(i.getTextContent());i.replace(e),i=e}i.setTextContent(a)}}}function Pg(e){return"ArrowLeft"===e}function Rg(e){return"ArrowRight"===e}function Og(e,t){return Gp?e:t}function Ng(e){return"Enter"===e}function Ag(e){return"Backspace"===e}function jg(e){return"Delete"===e}function Mg(e,t,n){return"a"===e.toLowerCase()&&Og(t,n)}function Ig(e,t){void 0===e.__lexicalClassNameCache&&(e.__lexicalClassNameCache={});const n=e.__lexicalClassNameCache,r=n[t];if(void 0!==r)return r;const o=e[t];if("string"==typeof o){const e=Dm(o);return n[t]=e,e}return o}function Dg(e,t,n,r,o){if(0===n.size)return;const i=r.__type,s=r.__key,a=t.get(i);void 0===a&&Im(33,i);const l=a.klass;let c=e.get(l);void 0===c&&(c=new Map,e.set(l,c));const u=c.get(s),d="destroyed"===u&&"created"===o;(void 0===u||d)&&c.set(s,d?"updated":o)}function Lg(e,t,n){const r=e.getParent();let o=n,i=e;return null!==r&&(t&&0===n?(o=i.getIndexWithinParent(),i=r):t||n!==i.getChildrenSize()||(o=i.getIndexWithinParent()+1,i=r)),i.getChildAtIndex(t?o-1:o)}function Fg(e,t){const n=e.offset;if("element"===e.type)return Lg(e.getNode(),t,n);{const r=e.getNode();if(t&&0===n||!t&&n===r.getTextContentSize()){const e=t?r.getPreviousSibling():r.getNextSibling();return null===e?Lg(r.getParentOrThrow(),t,r.getIndexWithinParent()+(t?0:1)):e}}return null}function zg(e){const t=Kg(e).event,n=t&&t.inputType;return"insertFromPaste"===n||"insertFromPasteAsQuotation"===n}function Bg(e,t,n){return Cb(e,t,n)}function Vg(e){return!Db(e)&&!e.isLastChild()&&!e.isInline()}function Wg(e,t){const n=e._keyToDOMMap.get(t);return void 0===n&&Im(75,t),n}function Ug(e){const t=e.assignedSlot||e.parentElement;return null!==t&&11===t.nodeType?t.host:t}function $g(e,t){let n=e.getParent();for(;null!==n;){if(n.is(t))return!0;n=n.getParent()}return!1}function Kg(e){const t=e._window;return null===t&&Im(78),t}function Hg(e){return Db(e)||Nb(e)&&e.isShadowRoot()}function qg(e){const t=yb(),n=e.constructor.getType(),r=t._nodes.get(n);void 0===r&&Im(97);const o=r.replace;if(null!==o){const t=o(e);return t instanceof e.constructor||Im(98),t}return e}function Yg(e,t){!Db(e.getParent())||Nb(t)||Mb(t)||Im(99)}function Xg(e){return(Mb(e)||Nb(e)&&!e.canBeEmpty())&&!e.isInline()}function _n(e,t,n){n.style.removeProperty("caret-color"),t._blockCursorElement=null;const r=e.parentElement;null!==r&&r.removeChild(e)}function Gg(e){return Yp?(e||window).getSelection():null}function Jg(e){return 1===e.nodeType}function Zg(e){const t=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return null!==e.nodeName.match(t)}function Qg(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 null!==e.nodeName.match(t)}function ev(e){if(Db(e)||Mb(e)&&!e.isInline())return!0;if(!Nb(e)||Hg(e))return!1;const t=e.getFirstChild(),n=null===t||hy(t)||Ny(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}function tv(e,t){let n=e;for(;null!==n&&null!==n.getParent()&&!t(n);)n=n.getParentOrThrow();return t(n)?n:null}const nv=new WeakMap,rv=new Map;function ov(e){const t=e.constructor.clone(e);return t.afterCloneFrom(e),t}function iv(e,t,n,r,o,i){let s=e.getFirstChild();for(;null!==s;){const e=s.__key;s.__parent===t&&(Nb(s)&&iv(s,e,n,r,o,i),n.has(e)||i.delete(e),o.push(e)),s=s.getNextSibling()}}let sv,av,lv,cv,uv,dv,fv,hv,pv,mv,gv="",vv="",yv=null,bv="",xv="",wv=!1,_v=!1,Ev=null;function Sv(e,t){const n=fv.get(e);if(null!==t){const n=zv(e);n.parentNode===t&&t.removeChild(n)}if(hv.has(e)||av._keyToDOMMap.delete(e),Nb(n)){const e=Iv(n,fv);kv(e,0,e.length-1,null)}void 0!==n&&Dg(mv,lv,cv,n,"destroyed")}function kv(e,t,n,r){let o=t;for(;o<=n;++o){const t=e[o];void 0!==t&&Sv(t,r)}}function Cv(e,t){e.setProperty("text-align",t)}const Tv="40px";function Pv(e,t){const n=sv.theme.indent;if("string"==typeof n){const r=e.classList.contains(n);t>0&&!r?e.classList.add(n):t<1&&r&&e.classList.remove(n)}const r=getComputedStyle(e).getPropertyValue("--lexical-indent-base-value")||Tv;e.style.setProperty("padding-inline-start",0===t?"":`calc(${t} * ${r})`)}function Rv(e,t){const n=e.style;0===t?Cv(n,""):t===mm?Cv(n,"left"):t===gm?Cv(n,"center"):t===vm?Cv(n,"right"):t===ym?Cv(n,"justify"):t===bm?Cv(n,"start"):t===xm&&Cv(n,"end")}function Ov(e,t,n){const r=hv.get(e);void 0===r&&Im(60);const o=r.createDOM(sv,av);if(function(e,t,n){const r=n._keyToDOMMap;t["__lexicalKey_"+n._key]=e,r.set(e,t)}(e,o,av),Ny(r)?o.setAttribute("data-lexical-text","true"):Mb(r)&&o.setAttribute("data-lexical-decorator","true"),Nb(r)){const e=r.__indent,t=r.__size;if(0!==e&&Pv(o,e),0!==t){const e=t-1;!function(e,t,n,r){const o=vv;vv="",Nv(e,n,0,t,r,null),Mv(n,r),vv=o}(Iv(r,hv),e,r,o)}const n=r.__format;0!==n&&Rv(o,n),r.isInline()||jv(null,r,o),Vg(r)&&(gv+=_m,xv+=_m)}else{const t=r.getTextContent();if(Mb(r)){const t=r.decorate(av,sv);null!==t&&Lv(e,t),o.contentEditable="false"}else Ny(r)&&(r.isDirectionless()||(vv+=t));gv+=t,xv+=t}if(null!==t)if(null!=n)t.insertBefore(o,n);else{const e=t.__lexicalLineBreak;null!=e?t.insertBefore(o,e):t.appendChild(o)}return Dg(mv,lv,cv,r,"created"),o}function Nv(e,t,n,r,o,i){const s=gv;gv="";let a=n;for(;a<=r;++a){Ov(e[a],o,i);const t=hv.get(e[a]);null!==t&&Ny(t)&&(null===yv&&(yv=t.getFormat()),""===bv&&(bv=t.getStyle()))}Vg(t)&&(gv+=_m),o.__lexicalTextContent=gv,gv=s+gv}function Av(e,t){const n=t.get(e);return hy(n)||Mb(n)&&n.isInline()}function jv(e,t,n){const r=null!==e&&(0===e.__size||Av(e.__last,fv)),o=0===t.__size||Av(t.__last,hv);if(r){if(!o){const e=n.__lexicalLineBreak;if(null!=e)try{n.removeChild(e)}catch(t){if("object"==typeof t&&null!=t){const r=`${t.toString()} Parent: ${n.tagName}, child: ${e.tagName}.`;throw new Error(r)}throw t}n.__lexicalLineBreak=null}}else if(o){const e=document.createElement("br");n.__lexicalLineBreak=e,n.appendChild(e)}}function Mv(e,t){const n=t.__lexicalDirTextContent,r=t.__lexicalDir;if(n!==vv||r!==Ev){const n=""===vv,i=n?Ev:(o=vv,Cm.test(o)?"rtl":Tm.test(o)?"ltr":null);if(i!==r){const o=t.classList,s=sv.theme;let a=null!==r?s[r]:void 0,l=null!==i?s[i]:void 0;if(void 0!==a){if("string"==typeof a){const e=Dm(a);a=s[r]=e}o.remove(...a)}if(null===i||n&&"ltr"===i)t.removeAttribute("dir");else{if(void 0!==l){if("string"==typeof l){const e=Dm(l);l=s[i]=e}void 0!==l&&o.add(...l)}t.dir=i}_v||(e.getWritable().__dir=i)}Ev=i,t.__lexicalDirTextContent=vv,t.__lexicalDir=i}var o}function Iv(e,t){const n=[];let r=e.__first;for(;null!==r;){const e=t.get(r);void 0===e&&Im(101),n.push(r),r=e.__next}return n}function Dv(e,t){const n=fv.get(e);let r=hv.get(e);void 0!==n&&void 0!==r||Im(61);const o=wv||dv.has(e)||uv.has(e),i=Wg(av,e);if(n===r&&!o){if(Nb(n)){const e=i.__lexicalTextContent;void 0!==e&&(gv+=e,xv+=e);const t=i.__lexicalDirTextContent;void 0!==t&&(vv+=t)}else{const e=n.getTextContent();Ny(n)&&!n.isDirectionless()&&(vv+=e),xv+=e,gv+=e}return i}if(n!==r&&o&&Dg(mv,lv,cv,r,"updated"),r.updateDOM(n,i,sv)){const n=Ov(e,null,null);return null===t&&Im(62),t.replaceChild(n,i),Sv(e,null),n}if(Nb(n)&&Nb(r)){const e=r.__indent;e!==n.__indent&&Pv(i,e);const t=r.__format;t!==n.__format&&Rv(i,t),o&&(function(e,t,n){const r=vv;var o;vv="",yv=null,bv="",function(e,t,n){const r=gv,o=e.__size,i=t.__size;if(gv="",1===o&&1===i){const r=e.__first,o=t.__first;if(r===o)Dv(r,n);else{const e=zv(r),t=Ov(o,null,null);try{n.replaceChild(t,e)}catch(i){if("object"==typeof i&&null!=i){const s=`${i.toString()} Parent: ${n.tagName}, new child: {tag: ${t.tagName} key: ${o}}, old child: {tag: ${e.tagName}, key: ${r}}.`;throw new Error(s)}throw i}Sv(r,null)}const s=hv.get(o);Ny(s)&&(null===yv&&(yv=s.getFormat()),""===bv&&(bv=s.getStyle()))}else{const r=Iv(e,fv),s=Iv(t,hv);if(0===o)0!==i&&Nv(s,t,0,i-1,n,null);else if(0===i){if(0!==o){const e=null==n.__lexicalLineBreak;kv(r,0,o-1,e?null:n),e&&(n.textContent="")}}else!function(e,t,n,r,o,i){const s=r-1,a=o-1;let l,c,u=i.firstChild,d=0,f=0;for(;d<=s&&f<=a;){const e=t[d],r=n[f];if(e===r)u=Fv(Dv(r,i)),d++,f++;else{void 0===l&&(l=new Set(t)),void 0===c&&(c=new Set(n));const o=c.has(e),s=l.has(r);if(o)if(s){const e=Wg(av,r);e===u?u=Fv(Dv(r,i)):(null!=u?i.insertBefore(e,u):i.appendChild(e),Dv(r,i)),d++,f++}else Ov(r,i,u),f++;else u=Fv(zv(e)),Sv(e,i),d++}const o=hv.get(r);null!==o&&Ny(o)&&(null===yv&&(yv=o.getFormat()),""===bv&&(bv=o.getStyle()))}const h=d>s,p=f>a;if(h&&!p){const t=n[a+1];Nv(n,e,f,a,i,void 0===t?null:av.getElementByKey(t))}else p&&!h&&kv(t,d,s,i)}(t,r,s,o,i,n)}Vg(t)&&(gv+=_m),n.__lexicalTextContent=gv,gv=r+gv}(e,t,n),Mv(t,n),$b(o=t)&&null!=yv&&yv!==o.__textFormat&&!_v&&(o.setTextFormat(yv),o.setTextStyle(bv)),function(e){$b(e)&&""!==bv&&bv!==e.__textStyle&&!_v&&e.setTextStyle(bv)}(t),vv=r}(n,r,i),Db(r)||r.isInline()||jv(n,r,i)),Vg(r)&&(gv+=_m,xv+=_m)}else{const t=r.getTextContent();if(Mb(r)){const t=r.decorate(av,sv);null!==t&&Lv(e,t)}else Ny(r)&&!r.isDirectionless()&&(vv+=t);gv+=t,xv+=t}if(!_v&&Db(r)&&r.__cachedText!==xv){const e=r.getWritable();e.__cachedText=xv,r=e}return i}function Lv(e,t){let n=av._pendingDecorators;const r=av._decorators;if(null===n){if(r[e]===t)return;n=mg(av)}n[e]=t}function Fv(e){let t=e.nextSibling;return null!==t&&t===av._blockCursorElement&&(t=t.nextSibling),t}function zv(e){const t=pv.get(e);return void 0===t&&Im(75,e),t}const Bv=Object.freeze({}),Vv=[["keydown",function(e,t){if(Wv=e.timeStamp,Uv=e.key,t.isComposing())return;const{key:n,shiftKey:r,ctrlKey:o,metaKey:i,altKey:s}=e;Bg(t,wp,e)||null!=n&&(function(e,t,n,r){return Rg(e)&&!t&&!r&&!n}(n,o,s,i)?Bg(t,_p,e):function(e,t,n,r,o){return Rg(e)&&!r&&!n&&(t||o)}(n,o,r,s,i)?Bg(t,Ep,e):function(e,t,n,r){return Pg(e)&&!t&&!r&&!n}(n,o,s,i)?Bg(t,Sp,e):function(e,t,n,r,o){return Pg(e)&&!r&&!n&&(t||o)}(n,o,r,s,i)?Bg(t,kp,e):function(e,t,n){return function(e){return"ArrowUp"===e}(e)&&!t&&!n}(n,o,i)?Bg(t,Cp,e):function(e,t,n){return function(e){return"ArrowDown"===e}(e)&&!t&&!n}(n,o,i)?Bg(t,Tp,e):function(e,t){return Ng(e)&&t}(n,r)?(Xv=!0,Bg(t,Pp,e)):function(e){return" "===e}(n)?Bg(t,Rp,e):function(e,t){return Gp&&t&&"o"===e.toLowerCase()}(n,o)?(e.preventDefault(),Xv=!0,Bg(t,dp,!0)):function(e,t){return Ng(e)&&!t}(n,r)?(Xv=!1,Bg(t,Pp,e)):function(e,t,n,r){return Gp?!t&&!n&&(Ag(e)||"h"===e.toLowerCase()&&r):!(r||t||n)&&Ag(e)}(n,s,i,o)?Ag(n)?Bg(t,Op,e):(e.preventDefault(),Bg(t,up,!0)):function(e){return"Escape"===e}(n)?Bg(t,Np,e):function(e,t,n,r,o){return Gp?!(n||r||o)&&(jg(e)||"d"===e.toLowerCase()&&t):!(t||r||o)&&jg(e)}(n,o,r,s,i)?jg(n)?Bg(t,Ap,e):(e.preventDefault(),Bg(t,up,!1)):function(e,t,n){return Ag(e)&&(Gp?t:n)}(n,s,o)?(e.preventDefault(),Bg(t,gp,!0)):function(e,t,n){return jg(e)&&(Gp?t:n)}(n,s,o)?(e.preventDefault(),Bg(t,gp,!1)):function(e,t){return Gp&&t&&Ag(e)}(n,i)?(e.preventDefault(),Bg(t,vp,!0)):function(e,t){return Gp&&t&&jg(e)}(n,i)?(e.preventDefault(),Bg(t,vp,!1)):function(e,t,n,r){return"b"===e.toLowerCase()&&!t&&Og(n,r)}(n,s,i,o)?(e.preventDefault(),Bg(t,yp,"bold")):function(e,t,n,r){return"u"===e.toLowerCase()&&!t&&Og(n,r)}(n,s,i,o)?(e.preventDefault(),Bg(t,yp,"underline")):function(e,t,n,r){return"i"===e.toLowerCase()&&!t&&Og(n,r)}(n,s,i,o)?(e.preventDefault(),Bg(t,yp,"italic")):function(e,t,n,r){return"Tab"===e&&!t&&!n&&!r}(n,s,o,i)?Bg(t,jp,e):function(e,t,n,r){return"z"===e.toLowerCase()&&!t&&Og(n,r)}(n,r,i,o)?(e.preventDefault(),Bg(t,bp,void 0)):function(e,t,n,r){return Gp?"z"===e.toLowerCase()&&n&&t:"y"===e.toLowerCase()&&r||"z"===e.toLowerCase()&&r&&t}(n,r,i,o)?(e.preventDefault(),Bg(t,xp,void 0)):Uy(t._editorState._selection)?function(e,t,n,r){return!t&&"c"===e.toLowerCase()&&(Gp?n:r)}(n,r,i,o)?(e.preventDefault(),Bg(t,Fp,e)):function(e,t,n,r){return!t&&"x"===e.toLowerCase()&&(Gp?n:r)}(n,r,i,o)?(e.preventDefault(),Bg(t,zp,e)):Mg(n,i,o)&&(e.preventDefault(),Bg(t,Bp,e)):!Jp&&Mg(n,i,o)&&(e.preventDefault(),Bg(t,Bp,e)),function(e,t,n,r){return e||t||n||r}(o,r,s,i)&&Bg(t,qp,e))}],["pointerdown",function(e,t){const n=e.target,r=e.pointerType;n instanceof Node&&"touch"!==r&&Rb(t,(()=>{Mb(pg(n))||(Yv=!0)}))}],["compositionstart",function(e,t){Rb(t,(()=>{const n=eb();if(Vy(n)&&!t.isComposing()){const r=n.anchor,o=n.anchor.getNode();ug(r.key),(e.timeStamp{ny(t,e.data)}))}],["input",function(e,t){e.stopPropagation(),Rb(t,(()=>{const n=eb(),r=e.data,o=ty(e);if(null!=r&&Vy(n)&&Zv(n,o,r,e.timeStamp,!1)){Gv&&(ny(t,r),Gv=!1);const o=n.anchor.getNode(),i=Gg(t._window);if(null===i)return;const s=n.isBackward(),a=s?n.anchor.offset:n.focus.offset,l=s?n.focus.offset:n.anchor.offset;Zp&&!n.isCollapsed()&&Ny(o)&&null!==i.anchorNode&&o.getTextContent().slice(0,a)+r+o.getTextContent().slice(a+l)===kg(i.anchorNode)||Bg(t,hp,r);const c=r.length;Jp&&c>1&&"insertCompositionText"===e.inputType&&!t.isComposing()&&(n.anchor.offset-=c),Qp||em||om||!t.isComposing()||(Wv=0,ug(null))}else Cg(!1,t,null!==r?r:void 0),Gv&&(ny(t,r||void 0),Gv=!1);mb(),Km(yb())})),Kv=null}],["click",function(e,t){Rb(t,(()=>{const n=eb(),r=Gg(t._window),o=tb();if(r)if(Vy(n)){const t=n.anchor,i=t.getNode();"element"===t.type&&0===t.offset&&n.isCollapsed()&&!Db(i)&&1===vg().getChildrenSize()&&i.getTopLevelElementOrThrow().isEmpty()&&null!==o&&n.is(o)?(r.removeAllRanges(),n.dirty=!0):3!==e.detail||n.isCollapsed()||i!==n.focus.getNode()&&(Nb(i)?i.select(0):i.getParentOrThrow().select(0))}else if("touch"===e.pointerType){const n=r.anchorNode;if(null!==n){const i=n.nodeType;i!==im&&i!==sm||bg(Qy(o,r,t,e))}}Bg(t,cp,e)}))}],["cut",Bv],["copy",Bv],["dragstart",Bv],["dragover",Bv],["dragend",Bv],["paste",Bv],["focus",Bv],["blur",Bv],["drop",Bv]];Zp&&Vv.push(["beforeinput",(e,t)=>function(e,t){const n=e.inputType,r=ty(e);"deleteCompositionText"===n||Jp&&zg(t)||"insertCompositionText"!==n&&Rb(t,(()=>{const o=eb();if("deleteContentBackward"===n){if(null===o){const e=tb();if(!Vy(e))return;bg(e.clone())}if(Vy(o)){const n=o.anchor.key===o.focus.key;if(i=e.timeStamp,"MediaLast"===Uv&&i{Rb(t,(()=>{ug(null)}))}),30),Vy(o)){const e=o.anchor.getNode();e.markDirty(),o.format=e.getFormat(),Ny(e)||Im(142),o.style=e.getStyle()}}else{ug(null),e.preventDefault();const r=o.anchor.getNode().getTextContent(),i=0===o.anchor.offset&&o.focus.offset===r.length;rm&&n&&!i||Bg(t,up,!0)}return}}var i;if(!Vy(o))return;const s=e.data;null!==Kv&&Cg(!1,t,Kv),o.dirty&&null===Kv||!o.isCollapsed()||Db(o.anchor.getNode())||null===r||o.applyDOMRange(r),Kv=null;const a=o.anchor,l=o.focus,c=a.getNode(),u=l.getNode();if("insertText"!==n&&"insertTranspose"!==n)switch(e.preventDefault(),n){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":Bg(t,hp,e);break;case"insertFromComposition":ug(null),Bg(t,hp,e);break;case"insertLineBreak":ug(null),Bg(t,dp,!1);break;case"insertParagraph":ug(null),Xv&&!em?(Xv=!1,Bg(t,dp,!1)):Bg(t,fp,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":Bg(t,pp,e);break;case"deleteByComposition":(function(e,t){return e!==t||Nb(e)||Nb(t)||!e.isToken()||!t.isToken()})(c,u)&&Bg(t,mp,e);break;case"deleteByDrag":case"deleteByCut":Bg(t,mp,e);break;case"deleteContent":Bg(t,up,!1);break;case"deleteWordBackward":Bg(t,gp,!0);break;case"deleteWordForward":Bg(t,gp,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":Bg(t,vp,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":Bg(t,vp,!1);break;case"formatStrikeThrough":Bg(t,yp,"strikethrough");break;case"formatBold":Bg(t,yp,"bold");break;case"formatItalic":Bg(t,yp,"italic");break;case"formatUnderline":Bg(t,yp,"underline");break;case"historyUndo":Bg(t,bp,void 0);break;case"historyRedo":Bg(t,xp,void 0)}else{if("\n"===s)e.preventDefault(),Bg(t,dp,!1);else if(s===_m)e.preventDefault(),Bg(t,fp,void 0);else if(null==s&&e.dataTransfer){const t=e.dataTransfer.getData("text/plain");e.preventDefault(),o.insertRawText(t)}else null!=s&&Zv(o,r,s,e.timeStamp,!0)?(e.preventDefault(),Bg(t,hp,s)):Kv=s;$v=e.timeStamp}}))}(e,t)]);let Wv=0,Uv=null,$v=0,Kv=null;const Hv=new WeakMap;let qv=!1,Yv=!1,Xv=!1,Gv=!1,Jv=[0,"",0,"root",0];function Zv(e,t,n,r,o){const i=e.anchor,s=e.focus,a=i.getNode(),l=yb(),c=Gg(l._window),u=null!==c?c.anchorNode:null,d=i.key,f=l.getElementByKey(d),h=n.length;return d!==s.key||!Ny(a)||(!o&&(!Zp||$v1||(o||!Zp)&&null!==f&&!a.isComposing()&&u!==sg(f)||null!==c&&null!==t&&(!t.collapsed||t.startContainer!==c.anchorNode||t.startOffset!==c.anchorOffset)||a.getFormat()!==e.format||a.getStyle()!==e.style||function(e,t){if(t.isSegmented())return!0;if(!e.isCollapsed())return!1;const n=e.anchor.offset,r=t.getParentOrThrow(),o=t.isToken();return 0===n?!t.canInsertTextBefore()||!r.canInsertTextBefore()&&!t.isComposing()||o||function(e){const t=e.getPreviousSibling();return(Ny(t)||Nb(t)&&t.isInline())&&!t.canInsertTextAfter()}(t):n===t.getTextContentSize()&&(!t.canInsertTextAfter()||!r.canInsertTextAfter()&&!t.isComposing()||o)}(e,a)}function Qv(e,t){return null!==e&&null!==e.nodeValue&&e.nodeType===sm&&0!==t&&t!==e.nodeValue.length}function ey(e,t,n){const{anchorNode:r,anchorOffset:o,focusNode:i,focusOffset:s}=e;qv&&(qv=!1,Qv(r,o)&&Qv(i,s))||Rb(t,(()=>{if(!n)return void bg(null);if(!eg(t,r,i))return;const a=eb();if(Vy(a)){const n=a.anchor,r=n.getNode();if(a.isCollapsed()){"Range"===e.type&&e.anchorNode===e.focusNode&&(a.dirty=!0);const o=Kg(t).event,i=o?o.timeStamp:performance.now(),[s,l,c,u,d]=Jv,f=vg(),h=!1===t.isComposing()&&""===f.getTextContent();if(i{const t=tb(),o=n.anchorNode;if(null===o)return;const i=o.nodeType;i!==im&&i!==sm||bg(Qy(t,n,r,e))})));const o=Eg(r),i=o[o.length-1],s=i._key,a=oy.get(s),l=a||i;l!==r&&ey(n,l,!1),ey(n,r,!0),r!==i?oy.set(s,r):a&&oy.delete(s)}function sy(e){e._lexicalHandled=!0}function ay(e){return!0===e._lexicalHandled}function ly(e,t,n){mb();const r=e.__key,o=e.getParent();if(null===o)return;const i=function(e){const t=eb();if(!Vy(t)||!Nb(e))return t;const{anchor:n,focus:r}=t,o=n.getNode(),i=r.getNode();return $g(o,e)&&n.set(e.__key,0,"element"),$g(i,e)&&r.set(e.__key,0,"element"),t}(e);let s=!1;if(Vy(i)&&t){const t=i.anchor,n=i.focus;t.key===r&&(ob(t,e,o,e.getPreviousSibling(),e.getNextSibling()),s=!0),n.key===r&&(ob(n,e,o,e.getPreviousSibling(),e.getNextSibling()),s=!0)}else Uy(i)&&t&&e.isSelected()&&e.selectPrevious();if(Vy(i)&&t&&!s){const t=e.getIndexWithinParent();lg(e),nb(i,o,t,-1)}else lg(e);n||Hg(o)||o.canBeEmpty()||!o.isEmpty()||ly(o,t),t&&Db(o)&&o.isEmpty()&&o.selectEnd()}class cy{static getType(){Im(64,this.name)}static clone(e){Im(65,this.name)}afterCloneFrom(e){this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev}constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,function(e,t){if(null!=t)return void(e.__key=t);mb(),gb();const n=yb(),r=vb(),o=""+Jm++;r._nodeMap.set(o,e),Nb(e)?n._dirtyElements.set(o,!0):n._dirtyLeaves.add(o),n._cloneNotNeeded.add(o),n._dirtyType=1,e.__key=o}(this,e)}getType(){return this.__type}isInline(){Im(137,this.constructor.name)}isAttached(){let e=this.__key;for(;null!==e;){if("root"===e)return!0;const t=fg(e);if(null===t)break;e=t.__parent}return!1}isSelected(e){const t=e||eb();if(null==t)return!1;const n=t.getNodes().some((e=>e.__key===this.__key));if(Ny(this))return n;if(Vy(t)&&"element"===t.anchor.type&&"element"===t.focus.type){if(t.isCollapsed())return!1;const e=this.getParent();if(Mb(this)&&this.isInline()&&e){const n=t.isBackward()?t.focus:t.anchor,r=n.getNode();if(n.offset===r.getChildrenSize()&&r.is(e)&&r.getLastChildOrThrow().is(this))return!1}}return n}getKey(){return this.__key}getIndexWithinParent(){const e=this.getParent();if(null===e)return-1;let t=e.getFirstChild(),n=0;for(;null!==t;){if(this.is(t))return n;n++,t=t.getNextSibling()}return-1}getParent(){const e=this.getLatest().__parent;return null===e?null:fg(e)}getParentOrThrow(){const e=this.getParent();return null===e&&Im(66,this.__key),e}getTopLevelElement(){let e=this;for(;null!==e;){const t=e.getParent();if(Hg(t))return Nb(e)||e===this&&Mb(e)||Im(194),e;e=t}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();return null===e&&Im(67,this.__key),e}getParents(){const e=[];let t=this.getParent();for(;null!==t;)e.push(t),t=t.getParent();return e}getParentKeys(){const e=[];let t=this.getParent();for(;null!==t;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){const e=this.getLatest().__prev;return null===e?null:fg(e)}getPreviousSiblings(){const e=[],t=this.getParent();if(null===t)return e;let n=t.getFirstChild();for(;null!==n&&!n.is(this);)e.push(n),n=n.getNextSibling();return e}getNextSibling(){const e=this.getLatest().__next;return null===e?null:fg(e)}getNextSiblings(){const e=[];let t=this.getNextSibling();for(;null!==t;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){const t=this.getParents(),n=e.getParents();Nb(this)&&t.unshift(this),Nb(e)&&n.unshift(e);const r=t.length,o=n.length;if(0===r||0===o||t[r-1]!==n[o-1])return null;const i=new Set(n);for(let e=0;e{s.append(e)}))),Vy(n)){bg(n);const e=n.anchor,t=n.focus;e.key===o&&Fy(e,s),t.key===o&&Fy(t,s)}return dg()===o&&ug(i),s}insertAfter(e,t=!0){mb(),Yg(this,e);const n=this.getWritable(),r=e.getWritable(),o=r.getParent(),i=eb();let s=!1,a=!1;if(null!==o){const t=e.getIndexWithinParent();if(lg(r),Vy(i)){const e=o.__key,n=i.anchor,r=i.focus;s="element"===n.type&&n.key===e&&n.offset===t+1,a="element"===r.type&&r.key===e&&r.offset===t+1}}const l=this.getNextSibling(),c=this.getParentOrThrow().getWritable(),u=r.__key,d=n.__next;if(null===l?c.__last=u:l.getWritable().__prev=u,c.__size++,n.__next=u,r.__next=d,r.__prev=n.__key,r.__parent=n.__parent,t&&Vy(i)){const e=this.getIndexWithinParent();nb(i,c,e+1);const t=c.__key;s&&i.anchor.set(t,e+2,"element"),a&&i.focus.set(t,e+2,"element")}return e}insertBefore(e,t=!0){mb(),Yg(this,e);const n=this.getWritable(),r=e.getWritable(),o=r.__key;lg(r);const i=this.getPreviousSibling(),s=this.getParentOrThrow().getWritable(),a=n.__prev,l=this.getIndexWithinParent();null===i?s.__first=o:i.getWritable().__next=o,s.__size++,n.__prev=o,r.__prev=a,r.__next=n.__key,r.__parent=n.__parent;const c=eb();return t&&Vy(c)&&nb(c,this.getParentOrThrow(),l),e}isParentRequired(){return!1}createParentElementNode(){return Ub()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){mb();const n=this.getPreviousSibling(),r=this.getParentOrThrow();if(null===n)return r.select(0,0);if(Nb(n))return n.select();if(!Ny(n)){const e=n.getIndexWithinParent()+1;return r.select(e,e)}return n.select(e,t)}selectNext(e,t){mb();const n=this.getNextSibling(),r=this.getParentOrThrow();if(null===n)return r.select();if(Nb(n))return n.select(0,0);if(!Ny(n)){const e=n.getIndexWithinParent();return r.select(e,e)}return n.select(e,t)}markDirty(){this.getWritable()}}class uy extends cy{static getType(){return"linebreak"}static clone(e){return new uy(e.__key)}constructor(e){super(e)}getTextContent(){return"\n"}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:e=>function(e){const t=e.parentElement;if(null!==t&&Qg(t)){const n=t.firstChild;if(n===e||n.nextSibling===e&&py(n)){const n=t.lastChild;if(n===e||n.previousSibling===e&&py(n))return!0}}return!1}(e)||function(e){const t=e.parentElement;if(null!==t&&Qg(t)){const n=t.firstChild;if(n===e||n.nextSibling===e&&py(n))return!1;const r=t.lastChild;if(r===e||r.previousSibling===e&&py(r))return!0}return!1}(e)?null:{conversion:dy,priority:0}}}static importJSON(e){return fy()}exportJSON(){return{type:"linebreak",version:1}}}function dy(e){return{node:fy()}}function fy(){return qg(new uy)}function hy(e){return e instanceof uy}function py(e){return e.nodeType===sm&&/^( |\t|\r?\n)+$/.test(e.textContent||"")}function my(e,t){return 16&t?"code":128&t?"mark":32&t?"sub":64&t?"sup":null}function gy(e,t){return 1&t?"strong":2&t?"em":"span"}function vy(e,t,n,r,o){const i=r.classList;let s=Ig(o,"base");void 0!==s&&i.add(...s),s=Ig(o,"underlineStrikethrough");let a=!1;const l=t&hm&&t&fm;void 0!==s&&(n&hm&&n&fm?(a=!0,l||i.add(...s)):l&&i.remove(...s));for(const e in Pm){const r=Pm[e];if(s=Ig(o,e),void 0!==s)if(n&r){if(a&&("underline"===e||"strikethrough"===e)){t&r&&i.remove(...s);continue}t&r&&(!l||"underline"!==e)&&"strikethrough"!==e||i.add(...s)}else t&r&&i.remove(...s)}}function yy(e,t,n){const r=t.firstChild,o=n.isComposing(),i=e+(o?wm:"");if(null==r)t.textContent=i;else{const e=r.nodeValue;if(e!==i)if(o||Jp){const[t,n,o]=function(e,t){const n=e.length,r=t.length;let o=0,i=0;for(;o({conversion:Cy,priority:0}),b:()=>({conversion:Ey,priority:0}),code:()=>({conversion:Ry,priority:0}),em:()=>({conversion:Ry,priority:0}),i:()=>({conversion:Ry,priority:0}),s:()=>({conversion:Ry,priority:0}),span:()=>({conversion:_y,priority:0}),strong:()=>({conversion:Ry,priority:0}),sub:()=>({conversion:Ry,priority:0}),sup:()=>({conversion:Ry,priority:0}),u:()=>({conversion:Ry,priority:0})}}static importJSON(e){const t=Oy(e.text);return t.setFormat(e.format),t.setDetail(e.detail),t.setMode(e.mode),t.setStyle(e.style),t}exportDOM(e){let{element:t}=super.exportDOM(e);return null!==t&&Jg(t)||Im(132),t.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(t=xy(t,"b")),this.hasFormat("italic")&&(t=xy(t,"i")),this.hasFormat("strikethrough")&&(t=xy(t,"s")),this.hasFormat("underline")&&(t=xy(t,"u")),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),type:"text",version:1}}selectionTransform(e,t){}setFormat(e){const t=this.getWritable();return t.__format="string"==typeof e?Pm[e]:e,t}setDetail(e){const t=this.getWritable();return t.__detail="string"==typeof e?Rm[e]:e,t}setStyle(e){const t=this.getWritable();return t.__style=e,t}toggleFormat(e){const t=ag(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){const e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){const e=this.getWritable();return e.__detail^=2,e}setMode(e){const t=Am[e];if(this.__mode===t)return this;const n=this.getWritable();return n.__mode=t,n}setTextContent(e){if(this.__text===e)return this;const t=this.getWritable();return t.__text=e,t}select(e,t){mb();let n=e,r=t;const o=eb(),i=this.getTextContent(),s=this.__key;if("string"==typeof i){const e=i.length;void 0===n&&(n=e),void 0===r&&(r=e)}else n=0,r=0;if(!Vy(o))return Jy(s,n,s,r,"text","text");{const e=dg();e!==o.anchor.key&&e!==o.focus.key||ug(s),o.setTextNodeRange(this,n,this,r)}return o}selectStart(){return this.select(0,0)}selectEnd(){const e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,n,r){const o=this.getWritable(),i=o.__text,s=n.length;let a=e;a<0&&(a=s+a,a<0&&(a=0));const l=eb();if(r&&Vy(l)){const t=e+s;l.setTextNodeRange(o,t,o,t)}const c=i.slice(0,a)+n+i.slice(a+t);return o.__text=c,o}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){mb();const t=this.getLatest(),n=t.getTextContent(),r=t.__key,o=dg(),i=new Set(e),s=[],a=n.length;let l="";for(let e=0;eb&&e.offset<=l&&(e.key=a,e.offset-=b,v.dirty=!0),t.key===r&&"text"===t.type&&t.offset>b&&t.offset<=l&&(t.key=a,t.offset-=b,v.dirty=!0)}o===r&&ug(a),b=l,y.push(i)}if(null!==d){!function(e){const t=e.getPreviousSibling(),n=e.getNextSibling();null!==t&&cg(t),null!==n&&cg(n)}(this);const e=d.getWritable(),t=this.getIndexWithinParent();g?(e.splice(t,0,y),this.remove()):e.splice(t,1,y),Vy(v)&&nb(v,d,t,c-1)}return y}mergeWithSibling(e){const t=e===this.getPreviousSibling();t||e===this.getNextSibling()||Im(50);const n=this.__key,r=e.__key,o=this.__text,i=o.length;dg()===r&&ug(n);const s=eb();if(Vy(s)){const o=s.anchor,a=s.focus;null!==o&&o.key===r&&(ib(o,t,n,e,i),s.dirty=!0),null!==a&&a.key===r&&(ib(a,t,n,e,i),s.dirty=!0)}const a=e.__text,l=t?a+o:o+a;this.setTextContent(l);const c=this.getWritable();return e.remove(),c}isTextEntity(){return!1}}function _y(e){return{forChild:Ay(e.style),node:null}}function Ey(e){const t=e,n="normal"===t.style.fontWeight;return{forChild:Ay(t.style,n?void 0:"bold"),node:null}}const Sy=new WeakMap;function ky(e){return"PRE"===e.nodeName||e.nodeType===im&&void 0!==e.style&&void 0!==e.style.whiteSpace&&e.style.whiteSpace.startsWith("pre")}function Cy(e){const t=e;null===e.parentElement&&Im(129);let n=t.textContent||"";if(null!==function(e){let t,n=e.parentNode;const r=[e];for(;null!==n&&void 0===(t=Sy.get(n))&&!ky(n);)r.push(n),n=n.parentNode;const o=void 0===t?n:t;for(let e=0;e0){/[ \t\n]$/.test(t)&&(n=n.slice(1)),r=!1;break}}r&&(n=n.slice(1))}if(" "===n[n.length-1]){let e=t,r=!0;for(;null!==e&&null!==(e=Ty(e,!0));)if((e.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){r=!1;break}r&&(n=n.slice(0,n.length-1))}return""===n?{node:null}:{node:Oy(n)}}function Ty(e,t){let n=e;for(;;){let e;for(;null===(e=t?n.nextSibling:n.previousSibling);){const e=n.parentElement;if(null===e)return null;n=e}if(n=e,n.nodeType===im){const e=n.style.display;if(""===e&&!Zg(n)||""!==e&&!e.startsWith("inline"))return null}let r=n;for(;null!==(r=t?n.firstChild:n.lastChild);)n=r;if(n.nodeType===sm)return n;if("BR"===n.nodeName)return null}}const Py={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function Ry(e){const t=Py[e.nodeName.toLowerCase()];return void 0===t?{node:null}:{forChild:Ay(e.style,t),node:null}}function Oy(e=""){return qg(new wy(e))}function Ny(e){return e instanceof wy}function Ay(e,t){const n=e.fontWeight,r=e.textDecoration.split(" "),o="700"===n||"bold"===n,i=r.includes("line-through"),s="italic"===e.fontStyle,a=r.includes("underline"),l=e.verticalAlign;return e=>Ny(e)?(o&&!e.hasFormat("bold")&&e.toggleFormat("bold"),i&&!e.hasFormat("strikethrough")&&e.toggleFormat("strikethrough"),s&&!e.hasFormat("italic")&&e.toggleFormat("italic"),a&&!e.hasFormat("underline")&&e.toggleFormat("underline"),"sub"!==l||e.hasFormat("subscript")||e.toggleFormat("subscript"),"super"!==l||e.hasFormat("superscript")||e.toggleFormat("superscript"),t&&!e.hasFormat(t)&&e.toggleFormat(t),e):e}class jy extends wy{static getType(){return"tab"}static clone(e){return new jy(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text}constructor(e){super("\t",e),this.__detail=2}static importDOM(){return null}static importJSON(e){const t=My();return t.setFormat(e.format),t.setStyle(e.style),t}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(e){Im(126)}setDetail(e){Im(127)}setMode(e){Im(128)}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function My(){return qg(new jy)}class Iy{constructor(e,t,n){this._selection=null,this.key=e,this.offset=t,this.type=n}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){let t=this.getNode(),n=e.getNode();const r=this.offset,o=e.offset;if(Nb(t)){const e=t.getDescendantByIndex(r);t=null!=e?e:t}if(Nb(n)){const e=n.getDescendantByIndex(o);n=null!=e?e:n}return t===n?re&&(r=e)}else if(!Nb(t)){const e=t.getNextSibling();if(Ny(e))n=e.__key,r=0,o="text";else{const e=t.getParent();e&&(n=e.__key,r=t.getIndexWithinParent()+1)}}e.set(n,r,o)}function Fy(e,t){if(Nb(t)){const n=t.getLastDescendant();Nb(n)||Ny(n)?Ly(e,n):Ly(e,t)}else Ly(e,t)}function zy(e,t,n,r){e.key=t,e.offset=n,e.type=r}class By{constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!Uy(e))return!1;const t=this._nodes,n=e._nodes;return t.size===n.size&&Array.from(t).every((e=>n.has(e)))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new By(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){const t=this.getNodes(),n=t.length,r=t[n-1];let o;if(Ny(r))o=r.select();else{const e=r.getIndexWithinParent()+1;o=r.getParentOrThrow().select(e,e)}o.insertNodes(e);for(let e=0;e0?[]:[s]:s.getNodesBetween(a),pb()||(this._cachedNodes=u),u}setTextNodeRange(e,t,n,r){zy(this.anchor,e.__key,t,"text"),zy(this.focus,n.__key,r,"text"),this._cachedNodes=null,this.dirty=!0}getTextContent(){const e=this.getNodes();if(0===e.length)return"";const t=e[0],n=e[e.length-1],r=this.anchor,o=this.focus,i=r.isBefore(o),[s,a]=Ky(this);let l="",c=!0;for(let u=0;u=0;e--){const t=i[e];if(t.is(d)||Nb(t)&&t.isParentOf(d))break;t.isAttached()&&(!h.has(t)||t.is(o)?m||g.insertAfter(t,!1):t.remove())}if(!m){let e=r,n=null;for(;null!==e;){const r=e.getChildren(),o=r.length;(0===o||r[o-1].is(n))&&(t.delete(e.__key),n=e),e=e.getParent()}}if(d.isToken())if(a===f)d.select();else{const t=Oy(e);t.select(),d.replace(t)}else d=d.spliceText(a,f-a,e,!0),""===d.getTextContent()?d.remove():d.isComposing()&&"text"===this.anchor.type&&(this.anchor.offset-=e.length);for(let e=1;e0&&(m===p.getTextContentSize()||og(p)||([p]=p.splitText(m)),p.setFormat(g));for(let t=c+1;t(Nb(e)||Mb(e))&&!e.isInline()))){Nb(t)||Im(135);const r=sb(this);return t.splice(r,0,e),void n.selectEnd()}const r=function(e){const t=Ub();let n=null;for(let r=0;rl?l:a,t=a>l?a:l,n=i.splitText(e,t),r=0===e?n[0]:n[1];return null!=r?[r]:[]}return[i]}const c=r.isBefore(o);if(Ny(i)){const t=c?a:l;t===i.getTextContentSize()?e.shift():0!==t&&([,i]=i.splitText(t),e[0]=i)}if(Ny(s)){const t=s.getTextContent().length,r=c?l:a;0===r?e.pop():r!==t&&([s]=s.splitText(r),e[n]=s)}return e}modify(e,t,n){const r=this.focus,o=this.anchor,i="move"===e,s=Fg(r,t);if(Mb(s)&&!s.isIsolated()){if(i&&s.isKeyboardSelectable()){const e=Zy();return e.add(s.__key),void bg(e)}const e=t?s.getPreviousSibling():s.getNextSibling();if(Ny(e)){const n=e.__key,s=t?e.getTextContent().length:0;return r.set(n,s,"text"),void(i&&o.set(n,s,"text"))}{const n=s.getParentOrThrow();let a,l;return Nb(e)?(l=e.__key,a=t?e.getChildrenSize():0):(a=s.getIndexWithinParent(),l=n.__key,t||a++),r.set(l,a,"element"),void(i&&o.set(l,a,"element"))}}const a=yb(),l=Gg(a._window);if(!l)return;const c=a._blockCursorElement,u=a._rootElement;if(null===u||null===c||!Nb(s)||s.isInline()||s.canBeEmpty()||_n(c,a,u),function(e,t,n,r){e.modify(t,n,r)}(l,e,t?"backward":"forward",n),l.rangeCount>0){const e=l.getRangeAt(0),n=this.anchor.getNode(),r=Db(n)?n:function(e){let t=e.getParentOrThrow();for(;null!==t;){if(Hg(t))return t;t=t.getParentOrThrow()}return t}(n);if(this.applyDOMRange(e),this.dirty=!0,!i){const n=this.getNodes(),o=[];let i=!1;for(let e=0;e0)if(t){const e=o[0];Nb(e)?e.selectStart():e.getParentOrThrow().selectStart()}else{const e=o[o.length-1];Nb(e)?e.selectEnd():e.getParentOrThrow().selectEnd()}l.anchorNode===e.startContainer&&l.anchorOffset===e.startOffset||function(e){const t=e.focus,n=e.anchor,r=n.key,o=n.offset,i=n.type;zy(n,t.key,t.offset,t.type),zy(t,r,o,i),e._cachedNodes=null}(this)}}}forwardDeletion(e,t,n){if(!n&&("element"===e.type&&Nb(t)&&e.offset===t.getChildrenSize()||"text"===e.type&&e.offset===t.getTextContentSize())){const e=t.getParent(),n=t.getNextSibling()||(null===e?null:e.getNextSibling());if(Nb(n)&&n.isShadowRoot())return!0}return!1}deleteCharacter(e){const t=this.isCollapsed();if(this.isCollapsed()){const t=this.anchor;let n=t.getNode();if(this.forwardDeletion(t,n,e))return;const r=this.focus,o=Fg(r,e);if(Mb(o)&&!o.isIsolated()){if(o.isKeyboardSelectable()&&Nb(n)&&0===n.getChildrenSize()){n.remove();const e=Zy();e.add(o.__key),bg(e)}else o.remove(),yb().dispatchCommand(lp,void 0);return}if(!e&&Nb(o)&&Nb(n)&&n.isEmpty())return n.remove(),void o.selectStart();if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&0===t.offset&&("element"===t.type?t.getNode():t.getNode().getParentOrThrow()).collapseAtStart(this))return}else{const o="text"===r.type?r.getNode():null;if(n="text"===t.type?t.getNode():null,null!==o&&o.isSegmented()){const t=r.offset,i=o.getTextContentSize();if(o.is(n)||e&&t!==i||!e&&0!==t)return void Hy(o,e,t)}else if(null!==n&&n.isSegmented()){const r=t.offset,i=n.getTextContentSize();if(n.is(o)||e&&0!==r||!e&&r!==i)return void Hy(n,e,r)}!function(e,t){const n=e.anchor,r=e.focus,o=n.getNode();if(o===r.getNode()&&"text"===n.type&&"text"===r.type){const e=n.offset,i=r.offset,s=en||r){o.splice(e,1),r&&(a=void 0);break}}const l=o.join("").trim();""===l?r.remove():(r.setTextContent(l),r.select(a,a))}function qy(e,t,n,r){let o,i=t;if(e.nodeType===im){let s=!1;const a=e.childNodes,l=a.length,c=r._blockCursorElement;i===l&&(s=!0,i=l-1);let u=a[i],d=!1;if(u===c)u=a[i+1],d=!0;else if(null!==c){const n=c.parentNode;e===n&&t>Array.prototype.indexOf.call(n.children,c)&&i--}if(o=xg(u),Ny(o))i=wg(o,s);else{let r=xg(e);if(null===r)return null;if(Nb(r)){i=Math.min(r.getChildrenSize(),i);let e=r.getChildAtIndex(i);if(Nb(e)&&function(e,t,n){const r=e.getParent();return null===n||null===r||!r.canBeEmpty()||r!==n.getNode()}(e,0,n)){const t=s?e.getLastDescendant():e.getFirstDescendant();null===t?r=e:(e=t,r=Nb(e)?e:e.getParentOrThrow()),i=0}Ny(e)?(o=e,r=null,i=wg(e,s)):e!==r&&s&&!d&&i++}else{const n=r.getIndexWithinParent();i=0===t&&Mb(r)&&xg(e)===r?n:n+1,r=r.getParentOrThrow()}if(Nb(r))return Dy(r.__key,i,"element")}}else o=xg(e);return Ny(o)?Dy(o.__key,i,"text"):null}function Yy(e,t,n){const r=e.offset,o=e.getNode();if(0===r){const r=o.getPreviousSibling(),i=o.getParent();if(t){if((n||!t)&&null===r&&Nb(i)&&i.isInline()){const t=i.getPreviousSibling();Ny(t)&&(e.key=t.__key,e.offset=t.getTextContent().length)}}else Nb(r)&&!n&&r.isInline()?(e.key=r.__key,e.offset=r.getChildrenSize(),e.type="element"):Ny(r)&&(e.key=r.__key,e.offset=r.getTextContent().length)}else if(r===o.getTextContent().length){const r=o.getNextSibling(),i=o.getParent();if(t&&Nb(r)&&r.isInline())e.key=r.__key,e.offset=0,e.type="element";else if((n||t)&&null===r&&Nb(i)&&i.isInline()&&!i.canInsertTextAfter()){const t=i.getNextSibling();Ny(t)&&(e.key=t.__key,e.offset=0)}}}function Xy(e,t,n){if("text"===e.type&&"text"===t.type){const r=e.isBefore(t),o=e.is(t);Yy(e,r,o),Yy(t,!r,o),o&&(t.key=e.key,t.offset=e.offset,t.type=e.type);const i=yb();if(i.isComposing()&&i._compositionKey!==e.key&&Vy(n)){const r=n.anchor,o=n.focus;zy(e,r.key,r.offset,r.type),zy(t,o.key,o.offset,o.type)}}}function Gy(e,t,n,r,o,i){if(null===e||null===n||!eg(o,e,n))return null;const s=qy(e,t,Vy(i)?i.anchor:null,o);if(null===s)return null;const a=qy(n,r,Vy(i)?i.focus:null,o);if(null===a)return null;if("element"===s.type&&"element"===a.type){const t=xg(e),r=xg(n);if(Mb(t)&&Mb(r))return null}return Xy(s,a,i),[s,a]}function Jy(e,t,n,r,o,i){const s=vb(),a=new Wy(Dy(e,t,o),Dy(n,r,i),0,"");return a.dirty=!0,s._selection=a,a}function Zy(){return new By(new Set)}function Qy(e,t,n,r){const o=n._window;if(null===o)return null;const i=r||o.event,s=i?i.type:void 0,a="selectionchange"===s,l=!Fm&&(a||"beforeinput"===s||"compositionstart"===s||"compositionend"===s||"click"===s&&i&&3===i.detail||"drop"===s||void 0===s);let c,u,d,f;if(Vy(e)&&!l)return e.clone();if(null===t)return null;if(c=t.anchorNode,u=t.focusNode,d=t.anchorOffset,f=t.focusOffset,a&&Vy(e)&&!eg(n,c,u))return e.clone();const h=Gy(c,d,u,f,n,e);if(null===h)return null;const[p,m]=h;return new Wy(p,m,Vy(e)?e.format:0,Vy(e)?e.style:"")}function eb(){return vb()._selection}function tb(){return yb()._editorState._selection}function nb(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 t=o.offset;if(n<=t&&r>0||n0||n0||n=e,s=o?i.getChildAtIndex(e-1):i.getChildAtIndex(n);if(Ny(s)){let e=0;o&&(e=s.getTextContentSize()),t.set(s.__key,e,"text"),r.set(s.__key,e,"text")}}else{if(Nb(i)){const e=i.getChildrenSize(),r=n>=e,o=r?i.getChildAtIndex(e-1):i.getChildAtIndex(n);if(Ny(o)){let e=0;r&&(e=o.getTextContentSize()),t.set(o.__key,e,"text")}}if(Nb(s)){const e=s.getChildrenSize(),t=o>=e,n=t?s.getChildAtIndex(e-1):s.getChildAtIndex(o);if(Ny(n)){let e=0;t&&(e=n.getTextContentSize()),r.set(n.__key,e,"text")}}}}function ob(e,t,n,r,o){let i=null,s=0,a=null;null!==r?(i=r.__key,Ny(r)?(s=r.getTextContentSize(),a="text"):Nb(r)&&(s=r.getChildrenSize(),a="element")):null!==o&&(i=o.__key,Ny(o)?a="text":Nb(o)&&(a="element")),null!==i&&null!==a?e.set(i,s,a):(s=t.getIndexWithinParent(),-1===s&&(s=n.getChildrenSize()),e.set(n.__key,s,"element"))}function ib(e,t,n,r,o){"text"===e.type?(e.key=n,t||(e.offset+=o)):e.offset>r.getIndexWithinParent()&&(e.offset-=1)}function sb(e){let t=e;e.isCollapsed()||t.removeText();const n=eb();Vy(n)&&(t=n),Vy(t)||Im(161);const r=t.anchor;let o=r.getNode(),i=r.offset;for(;!ev(o);)[o,i]=ab(o,i);return i}function ab(e,t){const n=e.getParent();if(!n){const e=Ub();return vg().append(e),e.select(),[vg(),0]}if(Ny(e)){const r=e.splitText(t);if(0===r.length)return[n,e.getIndexWithinParent()];const o=0===t?0:1;return[n,r[0].getIndexWithinParent()+o]}if(!Nb(e)||0===t)return[n,e.getIndexWithinParent()];const r=e.getChildAtIndex(t);if(r){const n=new Wy(Dy(e.__key,t,"element"),Dy(e.__key,t,"element"),0,""),o=e.insertNewAfter(n);o&&o.append(r,...r.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}let lb=null,cb=null,ub=!1,db=!1,fb=0;const hb={characterData:!0,childList:!0,subtree:!0};function pb(){return ub||null!==lb&&lb._readOnly}function mb(){ub&&Im(13)}function gb(){fb>99&&Im(14)}function vb(){return null===lb&&Im(195,bb()),lb}function yb(){return null===cb&&Im(196,bb()),cb}function bb(){let e=0;const t=new Set,n=qb.version;if("undefined"!=typeof window)for(const r of document.querySelectorAll("[contenteditable]")){const o=rg(r);if(tg(o))e++;else if(o){let e=String(o.constructor.version||"<0.17.1");e===n&&(e+=" (separately built, likely a bundler configuration issue)"),t.add(e)}}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 xb(e,t,n){const r=t.__type,o=function(e,t){const n=e._nodes.get(t);return void 0===n&&Im(30,t),n}(e,r);let i=n.get(r);void 0===i&&(i=Array.from(o.transforms),n.set(r,i));const s=i.length;for(let e=0;e0?r.getRangeAt(0):null;if(null!==e){let t;if(e instanceof Text){const n=document.createRange();n.selectNode(e),t=n.getBoundingClientRect()}else t=e.getBoundingClientRect();!function(e,t,n){const r=n.ownerDocument,o=r.defaultView;if(null===o)return;let{top:i,bottom:s}=t,a=0,l=0,c=n;for(;null!==c;){const t=c===r.body;if(t)a=0,l=Kg(e).innerHeight;else{const e=c.getBoundingClientRect();a=e.top,l=e.bottom}let n=0;if(il&&(n=s-l),0!==n)if(t)o.scrollBy(0,n);else{const e=c.scrollTop;c.scrollTop+=n;const t=c.scrollTop-e;i-=t,s-=t}if(t)break;c=Ug(c)}}(n,t,i)}}qv=!0}}(s,a,e,x,y,r)}(function(e,t,n){let r=e._blockCursorElement;if(Vy(n)&&n.isCollapsed()&&"element"===n.anchor.type&&t.contains(document.activeElement)){const o=n.anchor,i=o.getNode(),s=o.offset;let a=!1,l=null;if(s===i.getChildrenSize())Xg(i.getChildAtIndex(s-1))&&(a=!0);else{const t=i.getChildAtIndex(s);if(Xg(t)){const n=t.getPreviousSibling();(null===n||Xg(n))&&(a=!0,l=e.getElementByKey(t.__key))}}if(a){const n=e.getElementByKey(i.__key);return null===r&&(e._blockCursorElement=r=function(e){const t=e.theme,n=document.createElement("div");n.contentEditable="false",n.setAttribute("data-lexical-cursor","true");let r=t.blockCursor;if(void 0!==r){if("string"==typeof r){const e=Dm(r);r=t.blockCursor=e}void 0!==r&&n.classList.add(...r)}return n}(e._config)),t.style.caretColor="transparent",void(null===l?n.appendChild(r):n.insertBefore(r,l))}}null!==r&&_n(r,e,t)})(e,r,a),null!==h&&h.observe(r,hb)}finally{cb=d,lb=c}}null!==p&&function(e,t,n,r,o){const i=Array.from(e._listeners.mutation),s=i.length;for(let e=0;e{r=Cb(e,t,n)})),r}const r=Eg(e);for(let o=4;o>=0;o--)for(let i=0;i0||u>0;){if(l>0){t._dirtyLeaves=new Set;for(const e of a){const r=o.get(e);Ny(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&Xm(r),void 0!==r&&wb(r,i)&&xb(t,r,s),n.add(e)}if(a=t._dirtyLeaves,l=a.size,l>0){fb++;continue}}t._dirtyLeaves=new Set,t._dirtyElements=new Map;for(const e of c){const n=e[0],a=e[1];if("root"!==n&&!a)continue;const l=o.get(n);void 0!==l&&wb(l,i)&&xb(t,l,s),r.set(n,a)}a=t._dirtyLeaves,l=a.size,c=t._dirtyElements,u=c.size,fb++}t._dirtyLeaves=n,t._dirtyElements=r}(c,e),Tb(e),function(e,t,n,r){const o=e._nodeMap,i=t._nodeMap,s=[];for(const[e]of r){const t=i.get(e);void 0!==t&&(t.isAttached()||(Nb(t)&&iv(t,e,o,i,s,r),o.has(e)||r.delete(e),s.push(e)))}for(const e of s)i.delete(e);for(const e of n){const t=i.get(e);void 0===t||t.isAttached()||(o.has(e)||n.delete(e),i.delete(e))}}(l,c,e._dirtyLeaves,e._dirtyElements)),n!==e._compositionKey&&(c._flushSync=!0);const r=c._selection;if(Vy(r)){const e=c._nodeMap,t=r.anchor.key,n=r.focus.key;void 0!==e.get(t)&&void 0!==e.get(n)||Im(19)}else Uy(r)&&0===r._nodes.size&&(c._selection=null)}catch(t){return t instanceof Error&&e._onError(t),e._pendingEditorState=l,e._dirtyType=lm,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),void Sb(e)}finally{lb=d,ub=f,cb=h,e._updating=p,fb=0}const m=e._dirtyType!==am||function(e,t){const n=t.getEditorState()._selection,r=e._selection;if(null!==r){if(r.dirty||!r.is(n))return!0}else if(null!==n)return!0;return!1}(c,e);m?c._flushSync?(c._flushSync=!1,Sb(e)):u&&Zm((()=>{Sb(e)})):(c._flushSync=!1,u&&(r.clear(),e._deferred=[],e._pendingEditorState=null))}function Rb(e,t,n){e._updating?e._updates.push([t,n]):Pb(e,t,n)}class Ob extends cy{constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__first=e.__first,this.__last=e.__last,this.__size=e.__size,this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir}getFormat(){return this.getLatest().__format}getFormatType(){const e=this.getFormat();return Nm[e]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const e=[];let t=this.getFirstChild();for(;null!==t;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){const e=[];let t=this.getFirstChild();for(;null!==t;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return 0===this.getChildrenSize()}isDirty(){const e=yb()._dirtyElements;return null!==e&&e.has(this.__key)}isLastChild(){const e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return null!==t&&t.is(e)}getAllTextNodes(){const e=[];let t=this.getFirstChild();for(;null!==t;){if(Ny(t)&&e.push(t),Nb(t)){const n=t.getAllTextNodes();e.push(...n)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;Nb(e);){const t=e.getFirstChild();if(null===t)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;Nb(e);){const t=e.getLastChild();if(null===t)break;e=t}return e}getDescendantByIndex(e){const t=this.getChildren(),n=t.length;if(e>=n){const e=t[n-1];return Nb(e)&&e.getLastDescendant()||e||null}const r=t[e];return Nb(r)&&r.getFirstDescendant()||r||null}getFirstChild(){const e=this.getLatest().__first;return null===e?null:fg(e)}getFirstChildOrThrow(){const e=this.getFirstChild();return null===e&&Im(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return null===e?null:fg(e)}getLastChildOrThrow(){const e=this.getLastChild();return null===e&&Im(96,this.__key),e}getChildAtIndex(e){const t=this.getChildrenSize();let n,r;if(e=e;){if(r===e)return n;n=n.getPreviousSibling(),r--}return null}getTextContent(){let e="";const t=this.getChildren(),n=t.length;for(let r=0;re.remove())),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){const t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=""!==e?Om[e]:0,this}setStyle(e){return this.getWritable().__style=e||"",this}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,n){const r=n.length,o=this.getChildrenSize(),i=this.getWritable(),s=i.__key,a=[],l=[],c=this.getChildAtIndex(e+t);let u=null,d=o-t+r;if(0!==e)if(e===o)u=this.getLastChild();else{const t=this.getChildAtIndex(e);null!==t&&(u=t.getPreviousSibling())}if(t>0){let e=null===u?this.getFirstChild():u.getNextSibling();for(let n=0;n({root:Fb(vg())})))}}class Bb extends Ob{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class Vb extends Ob{constructor(e){super(e),this.__textFormat=0,this.__textStyle=""}static getType(){return"paragraph"}getTextFormat(){return this.getLatest().__textFormat}setTextFormat(e){const t=this.getWritable();return t.__textFormat=e,t}hasTextFormat(e){const t=Pm[e];return!!(this.getTextFormat()&t)}getTextStyle(){return this.getLatest().__textStyle}setTextStyle(e){const t=this.getWritable();return t.__textStyle=e,t}static clone(e){return new Vb(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}createDOM(e){const t=document.createElement("p"),n=Ig(e.theme,"paragraph");return void 0!==n&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}static importDOM(){return{p:e=>({conversion:Wb,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&Jg(t)){this.isEmpty()&&t.append(document.createElement("br"));const e=this.getFormatType();t.style.textAlign=e;const n=this.getDirection();n&&(t.dir=n);const r=this.getIndent();r>0&&(t.style.textIndent=20*r+"px")}return{element:t}}static importJSON(e){const t=Ub();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t.setTextFormat(e.textFormat),t}exportJSON(){return{...super.exportJSON(),textFormat:this.getTextFormat(),textStyle:this.getTextStyle(),type:"paragraph",version:1}}insertNewAfter(e,t){const n=Ub();n.setTextFormat(e.format),n.setTextStyle(e.style);const r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),n.setStyle(this.getTextStyle()),this.insertAfter(n,t),n}collapseAtStart(){const e=this.getChildren();if(0===e.length||Ny(e[0])&&""===e[0].getTextContent().trim()){if(null!==this.getNextSibling())return this.selectNext(),this.remove(),!0;if(null!==this.getPreviousSibling())return this.selectPrevious(),this.remove(),!0}return!1}}function Wb(e){const t=Ub();if(e.style){t.setFormat(e.style.textAlign);const n=parseInt(e.style.textIndent,10)/20;n>0&&t.setIndent(n)}return{node:t}}function Ub(){return qg(new Vb)}function $b(e){return e instanceof Vb}const Kb=1;function Hb(e,t,n,r){const o=e._keyToDOMMap;o.clear(),e._editorState=Lb(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=am,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;null!==i&&(i.disconnect(),e._observer=null),null!==t&&(t.textContent=""),null!==n&&(n.textContent="",o.set("root",n))}class qb{constructor(e,t,n,r,o,i,s){this._parentEditor=t,this._rootElement=null,this._editorState=e,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=r,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=am,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=Sg(),this._onError=o,this._htmlConversions=i,this._editable=s,this._headless=null!==t&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return null!=this._compositionKey}registerUpdateListener(e){const t=this._listeners.update;return t.add(e),()=>{t.delete(e)}}registerEditableListener(e){const t=this._listeners.editable;return t.add(e),()=>{t.delete(e)}}registerDecoratorListener(e){const t=this._listeners.decorator;return t.add(e),()=>{t.delete(e)}}registerTextContentListener(e){const t=this._listeners.textcontent;return t.add(e),()=>{t.delete(e)}}registerRootListener(e){const t=this._listeners.root;return e(this._rootElement,null),t.add(e),()=>{e(null,this._rootElement),t.delete(e)}}registerCommand(e,t,n){void 0===n&&Im(35);const r=this._commands;r.has(e)||r.set(e,[new Set,new Set,new Set,new Set,new Set]);const o=r.get(e);void 0===o&&Im(36,String(e));const i=o[n];return i.add(t),()=>{i.delete(t),o.every((e=>0===e.size))&&r.delete(e)}}registerMutationListener(e,t,n){const r=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,o=this._listeners.mutation;o.set(t,r);const i=n&&n.skipInitialization;return void 0===i||i||this.initializeMutationListener(t,r),()=>{o.delete(t)}}getRegisteredNode(e){const t=this._nodes.get(e.getType());return void 0===t&&Im(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){const n=this._editorState,r=function(e){if(!e._readOnly&&e.isEmpty())return rv;e._readOnly||Im(192);let t=nv.get(e);if(!t){t=new Map,nv.set(e,t);for(const[n,r]of e._nodeMap){const e=r.__type;let o=t.get(e);o||(o=new Map,t.set(e,o)),o.set(n,r)}}return t}(n).get(t.getType());if(!r)return;const o=new Map;for(const e of r.keys())o.set(e,"created");o.size>0&&e(o,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(e,t){const n=this.getRegisteredNode(e);return n.transforms.add(t),n}registerNodeTransform(e,t){const n=this.registerNodeTransformToKlass(e,t),r=[n],o=n.replaceWithKlass;if(null!=o){const e=this.registerNodeTransformToKlass(o,t);r.push(e)}var i;return i=e.getType(),Rb(this,(()=>{const e=vb();if(e.isEmpty())return;if("root"===i)return void vg().markDirty();const t=e._nodeMap;for(const[,e]of t)e.markDirty()}),null===this._pendingEditorState?{tag:"history-merge"}:void 0),()=>{r.forEach((e=>e.transforms.delete(t)))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return Bg(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){const t=this._rootElement;if(e!==t){const n=Ig(this._config.theme,"root"),r=this._pendingEditorState||this._editorState;if(this._rootElement=e,Hb(this,t,e,r),null!==t&&(this._config.disableEvents||function(e){const t=e.ownerDocument,n=Hv.get(t);void 0===n&&Im(162);const r=n-1;r>=0||Im(164),Hv.set(t,r),0===r&&t.removeEventListener("selectionchange",iy);const o=rg(e);tg(o)?(function(e){if(null!==e._parentEditor){const t=Eg(e),n=t[t.length-1]._key;oy.get(n)===e&&oy.delete(n)}else oy.delete(e._key)}(o),e.__lexicalEditor=null):o&&Im(198);const i=ry(e);for(let e=0;e{ay(e)||(sy(e),(t.isEditable()||"click"===r)&&i(e,t))}:e=>{if(ay(e))return;sy(e);const n=t.isEditable();switch(r){case"cut":return n&&Bg(t,zp,e);case"copy":return Bg(t,Fp,e);case"paste":return n&&Bg(t,pp,e);case"dragstart":return n&&Bg(t,Ip,e);case"dragover":return n&&Bg(t,Dp,e);case"dragend":return n&&Bg(t,Lp,e);case"focus":return n&&Bg(t,Kp,e);case"blur":return n&&Bg(t,Hp,e);case"drop":return n&&Bg(t,Mp,e)}};e.addEventListener(r,s),o.push((()=>{e.removeEventListener(r,s)}))}}(e,this),null!=n&&e.classList.add(...n)}else this._editorState=r,this._pendingEditorState=null,this._window=null;kb("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&Im(38),Km(this);const n=this._pendingEditorState,r=this._updateTags,o=void 0!==t?t.tag:null;null===n||n.isEmpty()||(null!=o&&r.add(o),Sb(this)),this._pendingEditorState=e,this._dirtyType=lm,this._dirtyElements.set("root",!1),this._compositionKey=null,null!=o&&r.add(o),Sb(this)}parseEditorState(e,t){return function(e,t,n){const r=Lb(),o=lb,i=ub,s=cb,a=t._dirtyElements,l=t._dirtyLeaves,c=t._cloneNotNeeded,u=t._dirtyType;t._dirtyElements=new Map,t._dirtyLeaves=new Set,t._cloneNotNeeded=new Set,t._dirtyType=0,lb=r,ub=!1,cb=t;try{const o=t._nodes;_b(e.root,o),n&&n(),r._readOnly=!0}catch(e){e instanceof Error&&t._onError(e)}finally{t._dirtyElements=a,t._dirtyLeaves=l,t._cloneNotNeeded=c,t._dirtyType=u,lb=o,ub=i,cb=s}return r}("string"==typeof e?JSON.parse(e):e,this,t)}read(e){return Sb(this),this.getEditorState().read(e,{editor:this})}update(e,t){Rb(this,e,t)}focus(e,t={}){const n=this._rootElement;null!==n&&(n.setAttribute("autocapitalize","off"),Rb(this,(()=>{const e=eb(),n=vg();null!==e?e.dirty=!0:0!==n.getChildrenSize()&&("rootStart"===t.defaultSelection?n.selectStart():n.selectEnd())}),{onUpdate:()=>{n.removeAttribute("autocapitalize"),e&&e()},tag:"focus"}),null===this._pendingEditorState&&n.removeAttribute("autocapitalize"))}blur(){const e=this._rootElement;null!==e&&e.blur();const t=Gg(this._window);null!==t&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,kb("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}qb.version="0.17.1+prod.esm";const Yb="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Xb=Yb?o.useLayoutEffect:o.useEffect,Gb={tag:"history-merge"};function Jb({initialConfig:e,children:t}){const n=(0,o.useMemo)((()=>{const{theme:t,namespace:n,nodes:r,onError:o,editorState:i,html:s}=e,a=function(e,t){let n=null;return{getTheme:function(){return null!=t?t:null!=n?n.getTheme():null}}}(0,t),l=function(e){const t=e||{},n=cb,r=t.theme||{},o=void 0===e?n:t.parentEditor||null,i=t.disableEvents||!1,s=Lb(),a=t.namespace||(null!==o?o._config.namespace:Sg()),l=t.editorState,c=[Ib,wy,uy,jy,Vb,Bb,...t.nodes||[]],{onError:u,html:d}=t,f=void 0===t.editable||t.editable;let h;if(void 0===e&&null!==n)h=n._nodes;else{h=new Map;for(let e=0;e{Object.keys(e).forEach((t=>{let r=n.get(t);void 0===r&&(r=[],n.set(t,r)),r.push(e[t])}))};return e.forEach((e=>{const t=e.klass.importDOM;if(null==t||r.has(t))return;r.add(t);const n=t.call(e.klass);null!==n&&o(n)})),t&&o(t),n}(h,d?d.import:void 0),f);return void 0!==l&&(p._pendingEditorState=l,p._dirtyType=lm),p}({editable:e.editable,html:s,namespace:n,nodes:r,onError:e=>o(e,l),theme:t});return function(e,t){if(null!==t)if(void 0===t)e.update((()=>{const t=vg();if(t.isEmpty()){const n=Ub();t.append(n);const r=Yb?document.activeElement:null;(null!==eb()||null!==r&&r===e.getRootElement())&&n.select()}}),Gb);else if(null!==t)switch(typeof t){case"string":{const n=e.parseEditorState(t);e.setEditorState(n,Gb);break}case"object":e.setEditorState(t,Gb);break;case"function":e.update((()=>{vg().isEmpty()&&t(e)}),Gb)}}(l,i),[l,a]}),[]);return Xb((()=>{const t=e.editable,[r]=n;r.setEditable(void 0===t||t)}),[]),(0,Qc.jsx)(ip.Provider,{value:n,children:t})}const Zb="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?o.useLayoutEffect:o.useEffect;function Qb(e){return{initialValueFn:()=>e.isEditable(),subscribe:t=>e.registerEditableListener(t)}}function ex(e){return()=>function(e){if(!function(e,t=!0){if(e)return!1;let n=vg().getTextContent();return t&&(n=n.trim()),""===n}(e,!1))return!1;const t=vg().getChildren(),n=t.length;if(n>1)return!1;for(let e=0;e{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function ox(e,t){const n=Fg(e.focus,t);return Mb(n)&&!n.isIsolated()||Nb(n)&&!n.isInline()&&!n.canBeEmpty()}function ix(e,t,n){const r=function(e){const t=e.anchor.getNode();return"rtl"===(Db(t)?t:t.getParentOrThrow()).getDirection()}(e);!function(e,t,n){e.modify(t?"extend":"move",n,"character")}(e,t,n?!r:r)}function sx(e,t,n,r=null){let o=null===r||t.isSelected(r);const i=Nb(t)&&t.excludeFromCopy("html");let s=t;if(null!==r){let e=ov(t);e=Ny(e)&&null!==r?function(e,t){const n=e.getStartEndPoints();if(t.isSelected(e)&&!t.isSegmented()&&!t.isToken()&&null!==n){const[r,o]=n,i=e.isBackward(),s=r.getNode(),a=o.getNode(),l=t.is(s),c=t.is(a);if(l||c){const[n,r]=Ky(e),o=s.is(a),l=t.is(i?a:s),c=t.is(i?s:a);let u,d=0;return o?(d=n>r?r:n,u=n>r?n:r):l?(d=i?r:n,u=void 0):c&&(d=0,u=i?n:r),t.__text=t.__text.slice(d,u),t}}return t}(r,e):e,s=e}const a=Nb(s)?s.getChildren():[],l=e._nodes.get(s.getType());let c;c=l&&void 0!==l.exportDOM?l.exportDOM(e,s):s.exportDOM(e);const{element:u,after:d}=c;if(!u)return!1;const f=document.createDocumentFragment();for(let n=0;n{if(null!==e){const r=function(e,t){return null!==e&&Object.getPrototypeOf(e).constructor.name===t.name}(e,KeyboardEvent)?null:e.clipboardData,o=eb();if(null!==o&&null!=r){e.preventDefault();const i=function(e,t=eb()){return null==t&&ax(166),Vy(t)&&t.isCollapsed()||0===t.getNodes().length?"":function(e,t){if("undefined"==typeof document||"undefined"==typeof window&&void 0===n.g.window)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const r=document.createElement("div"),o=vg().getChildren();for(let n=0;ne.getDecorators()));return vx((()=>e.registerDecoratorListener((e=>{(0,Mn.flushSync)((()=>{r(e)}))}))),[e]),(0,o.useEffect)((()=>{r(e.getDecorators())}),[e]),(0,o.useMemo)((()=>{const r=[],i=Object.keys(n);for(let s=0;se._onError(t),children:(0,Qc.jsx)(o.Suspense,{fallback:null,children:n[a]})}),c=e.getElementByKey(a);null!==c&&r.push((0,Mn.createPortal)(l,c,a))}return r}),[t,n,e])}(r,n);return function(e){vx((()=>rx(function(e){return rx(e.registerCommand(up,(e=>{const t=eb();return!!Vy(t)&&(t.deleteCharacter(e),!0)}),0),e.registerCommand(gp,(e=>{const t=eb();return!!Vy(t)&&(t.deleteWord(e),!0)}),0),e.registerCommand(vp,(e=>{const t=eb();return!!Vy(t)&&(t.deleteLine(e),!0)}),0),e.registerCommand(hp,(e=>{const t=eb();if(!Vy(t))return!1;if("string"==typeof e)t.insertText(e);else{const n=e.dataTransfer;if(null!=n)lx(n,t);else{const n=e.data;n&&t.insertText(n)}}return!0}),0),e.registerCommand(mp,(()=>{const e=eb();return!!Vy(e)&&(e.removeText(),!0)}),0),e.registerCommand(dp,(e=>{const t=eb();return!!Vy(t)&&(t.insertLineBreak(e),!0)}),0),e.registerCommand(fp,(()=>{const e=eb();return!!Vy(e)&&(e.insertLineBreak(),!0)}),0),e.registerCommand(Sp,(e=>{const t=eb();if(!Vy(t))return!1;const n=e,r=n.shiftKey;return!!ox(t,!0)&&(n.preventDefault(),ix(t,r,!0),!0)}),0),e.registerCommand(_p,(e=>{const t=eb();if(!Vy(t))return!1;const n=e,r=n.shiftKey;return!!ox(t,!1)&&(n.preventDefault(),ix(t,r,!1),!0)}),0),e.registerCommand(Op,(t=>!!Vy(eb())&&(t.preventDefault(),e.dispatchCommand(up,!0))),0),e.registerCommand(Ap,(t=>!!Vy(eb())&&(t.preventDefault(),e.dispatchCommand(up,!1))),0),e.registerCommand(Pp,(t=>{if(!Vy(eb()))return!1;if(null!==t){if((hx||fx||mx)&&dx)return!1;t.preventDefault()}return e.dispatchCommand(dp,!1)}),0),e.registerCommand(Bp,(()=>(function(){const e=vg();bg(function(e){return Gm(e.anchor),Gm(e.focus),e}(e.select(0,e.getChildrenSize())))}(),!0)),0),e.registerCommand(Fp,(t=>!!Vy(eb())&&(gx(t,e),!0)),0),e.registerCommand(zp,(t=>!!Vy(eb())&&(function(e,t){gx(e,t),t.update((()=>{const e=eb();Vy(e)&&e.removeText()}))}(t,e),!0)),0),e.registerCommand(pp,(t=>!!Vy(eb())&&(function(e,t){e.preventDefault(),t.update((()=>{const t=eb(),{clipboardData:n}=e;null!=n&&Vy(t)&&lx(n,t)}),{tag:"paste"})}(t,e),!0)),0),e.registerCommand(Mp,(e=>!!Vy(eb())&&(e.preventDefault(),!0)),0),e.registerCommand(Ip,(e=>!!Vy(eb())&&(e.preventDefault(),!0)),0))}(e),function(e){const t=window.location.origin,n=n=>{if(n.origin!==t)return;const r=e.getRootElement();if(document.activeElement!==r)return;const o=n.data;if("string"==typeof o){let t;try{t=JSON.parse(o)}catch(e){return}if(t&&"nuanria_messaging"===t.protocol&&"request"===t.type){const r=t.payload;if(r&&"makeChanges"===r.functionId){const t=r.args;if(t){const[r,o,i,s,a,l]=t;e.update((()=>{const e=eb();if(Vy(e)){const t=e.anchor;let l=t.getNode(),c=0,u=0;if(Ny(l)&&r>=0&&o>=0&&(c=r,u=r+o,e.setTextNodeRange(l,c,l,u)),c===u&&""===i||(e.insertRawText(i),l=t.getNode()),Ny(l)){c=s,u=s+a;const t=l.getTextContentSize();c=c>t?t:c,u=u>t?t:u,e.setTextNodeRange(l,c,l,u)}n.stopImmediatePropagation()}}))}}}}};return window.addEventListener("message",n,!0),()=>{window.removeEventListener("message",n,!0)}}(e))),[e])}(r),(0,Qc.jsxs)(Qc.Fragment,{children:[e,(0,Qc.jsx)(xx,{content:t}),i]})}function xx({content:e}){const[t]=sp(),n=function(e){const[t,n]=(0,o.useState)((()=>yx(e)));return vx((()=>{function t(){const t=yx(e);n(t)}return t(),rx(e.registerUpdateListener((()=>{t()})),e.registerEditableListener((()=>{t()})))}),[e]),t}(t),r=function(e){const[t]=sp(),n=(0,o.useMemo)((()=>e(t)),[t,e]),r=(0,o.useRef)(n.initialValueFn()),[i,s]=(0,o.useState)(r.current);return Zb((()=>{const{initialValueFn:e,subscribe:t}=n,o=e();return r.current!==o&&(r.current=o,s(o)),t((e=>{r.current=e,s(e)}))}),[n,e]),i}(Qb);return n?"function"==typeof e?e(r):e:null}const wx="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?o.useLayoutEffect:o.useEffect,Ex=(0,o.forwardRef)((function({editor:e,ariaActiveDescendant:t,ariaAutoComplete:n,ariaControls:r,ariaDescribedBy:i,ariaExpanded:s,ariaLabel:a,ariaLabelledBy:l,ariaMultiline:c,ariaOwns:u,ariaRequired:d,autoCapitalize:f,className:h,id:p,role:m="textbox",spellCheck:g=!0,style:v,tabIndex:y,"data-testid":b,...x},w){const[_,E]=(0,o.useState)(e.isEditable()),S=(0,o.useCallback)((t=>{t&&t.ownerDocument&&t.ownerDocument.defaultView?e.setRootElement(t):e.setRootElement(null)}),[e]),k=(0,o.useMemo)((()=>function(...e){return t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}}(w,S)),[S,w]);return wx((()=>(E(e.isEditable()),e.registerEditableListener((e=>{E(e)})))),[e]),(0,Qc.jsx)("div",{...x,"aria-activedescendant":_?t:void 0,"aria-autocomplete":_?n:"none","aria-controls":_?r:void 0,"aria-describedby":i,"aria-expanded":_&&"combobox"===m?!!s:void 0,"aria-label":a,"aria-labelledby":l,"aria-multiline":c,"aria-owns":_?u:void 0,"aria-readonly":!_||void 0,"aria-required":d,autoCapitalize:f,className:h,contentEditable:_,"data-testid":b,id:p,ref:k,role:_?m:void 0,spellCheck:g,style:v,tabIndex:y})}));function Sx(e){return e.getEditorState().read(ex(e.isComposing()))}const kx=(0,o.forwardRef)((function(e,t){const{placeholder:n,...r}=e,[o]=sp();return(0,Qc.jsxs)(Qc.Fragment,{children:[(0,Qc.jsx)(Ex,{editor:o,...r,ref:t}),null!=n&&(0,Qc.jsx)(Cx,{editor:o,content:n})]})}));function Cx({content:e,editor:t}){const n=function(e){const[t,n]=(0,o.useState)((()=>Sx(e)));return wx((()=>{function t(){const t=Sx(e);n(t)}return t(),rx(e.registerUpdateListener((()=>{t()})),e.registerEditableListener((()=>{t()})))}),[e]),t}(t),[r,i]=(0,o.useState)(t.isEditable());if((0,o.useLayoutEffect)((()=>(i(t.isEditable()),t.registerEditableListener((e=>{i(e)})))),[t]),!n)return null;let s=null;return"function"==typeof e?s=e(r):null!==e&&(s=e),null===s?null:(0,Qc.jsx)("div",{"aria-hidden":!0,children:s})}const Tx=0,Px=1,Rx=2,Ox=0,Nx=1,Ax=2,jx=3,Mx=4;function Ix(e){e.undoStack=[],e.redoStack=[],e.current=null}function Dx({delay:e,externalHistoryState:t}){const[n]=sp();return function(e,t,n=1e3){const r=(0,o.useMemo)((()=>t||{current:null,redoStack:[],undoStack:[]}),[t]);(0,o.useEffect)((()=>function(e,t,n){const r=function(e,t){let n=Date.now(),r=Ox;return(o,i,s,a,l,c)=>{const u=Date.now();if(c.has("historic"))return r=Ox,n=u,Rx;const d=function(e,t,n,r,o){if(null===e||0===n.size&&0===r.size&&!o)return Ox;const i=t._selection,s=e._selection;if(o)return Nx;if(!(Vy(i)&&Vy(s)&&s.isCollapsed()&&i.isCollapsed()))return Ox;const a=function(e,t,n){const r=e._nodeMap,o=[];for(const e of t){const t=r.get(e);void 0!==t&&o.push(t)}for(const[e,t]of n){if(!t)continue;const n=r.get(e);void 0===n||Db(n)||o.push(n)}return o}(t,n,r);if(0===a.length)return Ox;if(a.length>1){const n=t._nodeMap,r=n.get(i.anchor.key),o=n.get(s.anchor.key);return r&&o&&!e._nodeMap.has(r.__key)&&Ny(r)&&1===r.__text.length&&1===i.anchor.offset?Ax:Ox}const l=a[0],c=e._nodeMap.get(l.__key);if(!Ny(c)||!Ny(l)||c.__mode!==l.__mode)return Ox;const u=c.__text,d=l.__text;if(u===d)return Ox;const f=i.anchor,h=s.anchor;if(f.key!==h.key||"text"!==f.type)return Ox;const p=f.offset,m=h.offset,g=d.length-u.length;return 1===g&&m===p-1?Ax:-1===g&&m===p+1?jx:-1===g&&m===p?Mx:Ox}(o,i,a,l,e.isComposing()),f=(()=>{const f=null===s||s.editor===e,h=c.has("history-push");if(!h&&f&&c.has("history-merge"))return Tx;if(null===o)return Px;const p=i._selection;return a.size>0||l.size>0?!1===h&&d!==Ox&&d===r&&ur.exportJSON())))===JSON.stringify(n.read((()=>o.exportJSON())))}(Array.from(a)[0],o,i)?Tx:Px:null!==p?Tx:Rx})();return n=u,r=d,f}}(e,n),o=rx(e.registerCommand(bp,(()=>(function(e,t){const n=t.redoStack,r=t.undoStack;if(0!==r.length){const o=t.current,i=r.pop();null!==o&&(n.push(o),e.dispatchCommand(Up,!0)),0===r.length&&e.dispatchCommand($p,!1),t.current=i||null,i&&i.editor.setEditorState(i.editorState,{tag:"historic"})}}(e,t),!0)),0),e.registerCommand(xp,(()=>(function(e,t){const n=t.redoStack,r=t.undoStack;if(0!==n.length){const o=t.current;null!==o&&(r.push(o),e.dispatchCommand($p,!0));const i=n.pop();0===n.length&&e.dispatchCommand(Up,!1),t.current=i||null,i&&i.editor.setEditorState(i.editorState,{tag:"historic"})}}(e,t),!0)),0),e.registerCommand(Vp,(()=>(Ix(t),!1)),0),e.registerCommand(Wp,(()=>(Ix(t),e.dispatchCommand(Up,!1),e.dispatchCommand($p,!1),!0)),0),e.registerUpdateListener((({editorState:n,prevEditorState:o,dirtyLeaves:i,dirtyElements:s,tags:a})=>{const l=t.current,c=t.redoStack,u=t.undoStack,d=null===l?null:l.editorState;if(null!==l&&n===d)return;const f=r(o,n,l,i,s,a);if(f===Px)0!==c.length&&(t.redoStack=[],e.dispatchCommand(Up,!1)),null!==l&&(u.push({...l}),e.dispatchCommand($p,!0));else if(f===Rx)return;t.current={editor:e,editorState:n}})));return o}(e,r,n)),[n,e,r])}(n,t,e),null}function Lx(e,t){return Lx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Lx(e,t)}var Fx={error:null},zx=function(e){var t,n;function r(){for(var t,n=arguments.length,r=new Array(n),o=0;o{if(n)return r.registerUpdateListener((({editorState:o,dirtyElements:i,dirtyLeaves:s,prevEditorState:a,tags:l})=>{t&&0===i.size&&0===s.size||e&&l.has("history-merge")||a.isEmpty()||n(o,r,l)}))}),[r,e,t,n]),null}function Ux({editorRef:e}){const[t]=sp();return o.useEffect((()=>{"function"==typeof e?e(t):"object"==typeof e&&(e.current=t)}),[t]),null}var $x={sm:"py-1.5 px-2 rounded [&_.editor-content>p]:text-sm [&_.editor-content>p]:font-medium [&_.editor-content>p]:leading-[1.625rem]",md:"py-2 px-2.5 rounded-md [&_.editor-content>p]:text-sm [&_.editor-content>p]:font-medium [&_.editor-content>p]:leading-[1.625rem]",lg:"py-2.5 px-3 rounded-md [&_.editor-content>p]:text-sm [&_.editor-content>p]:font-medium [&_.editor-content>p]:leading-[1.6875rem]"},Kx={sm:"p-1.5 rounded-md max-h-[10.75rem]",md:"p-2 rounded-lg max-h-[13.5rem]",lg:"p-2 rounded-lg max-h-[13.5rem]"},Hx={sm:"p-1.5 rounded text-sm leading-5 font-normal",md:"p-2 rounded-md text-base leading-6 font-normal",lg:"p-2 rounded-md text-base leading-6 font-normal"};const qx="startTransition",Yx="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?o.useLayoutEffect:o.useEffect,Xx=e=>{const t=document.getElementById("typeahead-menu");if(!t)return;const n=t.getBoundingClientRect();n.top+n.height>window.innerHeight&&t.scrollIntoView({block:"center"}),n.top<0&&t.scrollIntoView({block:"center"}),e.scrollIntoView({block:"nearest"})};function Gx(e,t){const n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return n.top>r.top&&n.top{d(0)}),[f]);const h=(0,o.useCallback)((n=>{t.update((()=>{const t=null!=r.match&&l?function(e){const t=eb();if(!Vy(t)||!t.isCollapsed())return null;const n=t.anchor;if("text"!==n.type)return null;const r=n.getNode();if(!r.isSimpleText())return null;const o=n.offset,i=r.getTextContent().slice(0,o),s=e.replaceableString.length,a=o-function(e,t,n){let r=n;for(let n=r;n<=t.length;n++)e.substr(-n)===t.substr(0,n)&&(r=n);return r}(i,e.matchingString,s);if(a<0)return null;let l;return 0===a?[l]=r.splitText(o):[,l]=r.splitText(a,o),l}(r.match):null;a(n,t,e,r.match?r.match.matchingString:"")}))}),[t,l,r.match,a,e]),p=(0,o.useCallback)((e=>{const n=t.getRootElement();null!==n&&(n.setAttribute("aria-activedescendant","typeahead-item-"+e),d(e))}),[t]);return(0,o.useEffect)((()=>()=>{const e=t.getRootElement();null!==e&&e.removeAttribute("aria-activedescendant")}),[t]),Yx((()=>{null===i?d(null):null===u&&p(0)}),[i,u,p]),(0,o.useEffect)((()=>rx(t.registerCommand(Jx,(({option:e})=>!(!e.ref||null==e.ref.current||(Xx(e.ref.current),0))),c))),[t,p,c]),(0,o.useEffect)((()=>rx(t.registerCommand(Tp,(e=>{const n=e;if(null!==i&&i.length&&null!==u){const e=u!==i.length-1?u+1:0;p(e);const r=i[e];null!=r.ref&&r.ref.current&&t.dispatchCommand(Jx,{index:e,option:r}),n.preventDefault(),n.stopImmediatePropagation()}return!0}),c),t.registerCommand(Cp,(e=>{const t=e;if(null!==i&&i.length&&null!==u){const e=0!==u?u-1:i.length-1;p(e);const n=i[e];null!=n.ref&&n.ref.current&&Xx(n.ref.current),t.preventDefault(),t.stopImmediatePropagation()}return!0}),c),t.registerCommand(Np,(t=>{const n=t;return n.preventDefault(),n.stopImmediatePropagation(),e(),!0}),c),t.registerCommand(jp,(e=>{const t=e;return null!==i&&null!==u&&null!=i[u]&&(t.preventDefault(),t.stopImmediatePropagation(),h(i[u]),!0)}),c),t.registerCommand(Pp,(e=>null!==i&&null!==u&&null!=i[u]&&(null!==e&&(e.preventDefault(),e.stopImmediatePropagation()),h(i[u]),!0)),c))),[h,e,t,i,u,p,c]),s(n,(0,o.useMemo)((()=>({options:i,selectOptionAndCleanUp:h,selectedIndex:u,setHighlightedIndex:d})),[h,u,i]),r.match?r.match.matchingString:"")}function Qx({options:e,onQueryChange:t,onSelectOption:n,onOpen:r,onClose:s,menuRenderFn:a,triggerFn:l,anchorClassName:c,commandPriority:u=Kb,parent:d}){const[f]=sp(),[h,p]=(0,o.useState)(null),m=function(e,t,n,r=document.body){const[i]=sp(),s=(0,o.useRef)(document.createElement("div")),a=(0,o.useCallback)((()=>{s.current.style.top=s.current.style.bottom;const t=i.getRootElement(),o=s.current,a=o.firstChild;if(null!==t&&null!==e){const{left:i,top:l,width:c,height:u}=e.getRect(),d=s.current.offsetHeight;if(o.style.top=`${l+window.pageYOffset+d+3}px`,o.style.left=`${i+window.pageXOffset}px`,o.style.height=`${u}px`,o.style.width=`${c}px`,null!==a){a.style.top=`${l}`;const e=a.getBoundingClientRect(),n=e.height,r=e.width,s=t.getBoundingClientRect();i+r>s.right&&(o.style.left=`${s.right-r+window.pageXOffset}px`),(l+n>window.innerHeight||l+n>s.bottom)&&l-s.top>n+u&&(o.style.top=l-n+window.pageYOffset-u+"px")}o.isConnected||(null!=n&&(o.className=n),o.setAttribute("aria-label","Typeahead menu"),o.setAttribute("id","typeahead-menu"),o.setAttribute("role","listbox"),o.style.display="block",o.style.position="absolute",r.append(o)),s.current=o,t.setAttribute("aria-controls","typeahead-menu")}}),[i,e,n,r]);(0,o.useEffect)((()=>{const t=i.getRootElement();if(null!==e)return a(),()=>{null!==t&&t.removeAttribute("aria-controls");const e=s.current;null!==e&&e.isConnected&&e.remove()}}),[i,a,e]);const l=(0,o.useCallback)((n=>{null!==e&&(n||t(null))}),[e,t]);return function(e,t,n,r){const[i]=sp();(0,o.useEffect)((()=>{if(null!=t&&null!=e){const e=i.getRootElement(),o=null!=e?function(e){let t=getComputedStyle(e);const n="absolute"===t.position,r=/(auto|scroll)/;if("fixed"===t.position)return document.body;for(let o=e;o=o.parentElement;)if(t=getComputedStyle(o),(!n||"static"!==t.position)&&r.test(t.overflow+t.overflowY+t.overflowX))return o;return document.body}(e):document.body;let s=!1,a=Gx(t,o);const l=function(){s||(window.requestAnimationFrame((function(){n(),s=!1})),s=!0);const e=Gx(t,o);e!==a&&(a=e,null!=r&&r(e))},c=new ResizeObserver(n);return window.addEventListener("resize",n),document.addEventListener("scroll",l,{capture:!0,passive:!0}),c.observe(t),()=>{c.unobserve(t),window.removeEventListener("resize",n),document.removeEventListener("scroll",l,!0)}}}),[t,i,r,n,e])}(e,s.current,a,l),s}(h,p,c,d),g=(0,o.useCallback)((()=>{p(null),null!=s&&null!==h&&s()}),[s,h]),v=(0,o.useCallback)((e=>{p(e),null!=r&&null===h&&r(e)}),[r,h]);return(0,o.useEffect)((()=>{const e=f.registerUpdateListener((()=>{f.getEditorState().read((()=>{const e=f._window||window,n=e.document.createRange(),r=eb(),o=function(e){let t=null;return e.getEditorState().read((()=>{const e=eb();Vy(e)&&(t=function(e){const t=e.anchor;if("text"!==t.type)return null;const n=t.getNode();if(!n.isSimpleText())return null;const r=t.offset;return n.getTextContent().slice(0,r)}(e))})),t}(f);if(!Vy(r)||!r.isCollapsed()||null===o||null===n)return void g();const s=l(o,f);if(t(s?s.matchingString:null),null!==s&&!function(e,t){return 0===t&&e.getEditorState().read((()=>{const e=eb();if(Vy(e)){const t=e.anchor.getNode().getPreviousSibling();return Ny(t)&&t.isTextEntity()}return!1}))}(f,s.leadOffset)){const t=function(e,t,n){const r=n.getSelection();if(null===r||!r.isCollapsed)return!1;const o=r.anchorNode,i=e,s=r.anchorOffset;if(null==o||null==s)return!1;try{t.setStart(o,i),t.setEnd(o,s)}catch(e){return!1}return!0}(s.leadOffset,n,e);if(null!==t)return a=()=>v({getRect:()=>n.getBoundingClientRect(),match:s}),void(qx in i()?i()[qx](a):a())}var a;g()}))}));return()=>{e()}}),[f,l,t,h,g,v]),null===h||null===f?null:(0,Qc.jsx)(Zx,{close:g,resolution:h,editor:f,anchorElementRef:m,options:e,menuRenderFn:a,shouldSplitNodeWithQuery:!0,onSelectOption:n,commandPriority:u})}function ew(e){return ew="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ew(e)}function tw(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n2&&void 0!==arguments[2]?arguments[2]:"name",r=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,s,a=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ww(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ww(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,o.useState)([]),2),i=r[0],s=r[1];return(0,o.useEffect)((function(){if(null!==t){var r=_w.get(t);null!==r&&(void 0===r?(_w.set(t,null),Ew(e,t,(function(e){_w.set(t,e),s(e)}),n)):s(r))}else s([])}),[t]),i},kw=["size","children","selected","className"];function Cw(){return Cw=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n_:;",p=[l].join(""),m="[^"+p+h+"\\s]",g="(?:\\.[ |$]| |["+h+"]|)",v=new RegExp("(^|\\s|\\()([".concat(p,"]((?:").concat(m).concat(g,"){0,").concat(75,"}))$")),y=new RegExp("(^|\\s|\\()([".concat(p,"]((?:").concat(m,"){0,").concat(50,"}))$")),b=Rw(sp(),1)[0],x=Rw((0,o.useState)(null),2),w=x[0],_=x[1],E=Sw(t,w,r),S=(0,o.useCallback)((function(e,t,n){b.update((function(){var o=hw(e.data,r,s);t&&t.replace(o),n()}))}),[b]),k=(0,o.useMemo)((function(){return E.map((function(e){return new xw(e)}))}),[b,E]);return React.createElement(Qx,{onQueryChange:_,onSelectOption:S,triggerFn:function(e){var t=v.exec(e);if(null===t&&(t=y.exec(e)),null!==t){var n=t[1],r=t[3];if(r.length>=0)return{leadOffset:t.index+n.length,matchingString:r,replaceableString:t[2]}}return null},options:k,menuRenderFn:function(e,t){var n=t.selectedIndex,o=t.selectOptionAndCleanUp,i=t.setHighlightedIndex;return e.current&&!(null==k||!k.length)&&React.createElement(u,{size:s},k.map((function(e,t){var a;return React.createElement(f,{key:t,ref:e.ref,size:s,selected:t===n,onMouseEnter:function(){i(t)},onClick:function(){return o(e)}},"string"==typeof e.data?e.data:null===(a=e.data)||void 0===a?void 0:a[r])})))}})},Aw={ltr:"ltr",rtl:"rtl",paragraph:"editor-paragraph",quote:"editor-quote",heading:{h1:"editor-heading-h1",h2:"editor-heading-h2",h3:"editor-heading-h3",h4:"editor-heading-h4",h5:"editor-heading-h5",h6:"editor-heading-h6"},list:{nested:{listitem:"editor-nested-listitem"},ol:"editor-list-ol",ul:"editor-list-ul",listitem:"editor-listItem",listitemChecked:"editor-listItemChecked",listitemUnchecked:"editor-listItemUnchecked"},hashtag:"editor-hashtag",image:"editor-image",link:"editor-link",text:{bold:"editor-textBold",code:"editor-textCode",italic:"editor-textItalic",strikethrough:"editor-textStrikethrough",subscript:"editor-textSubscript",superscript:"editor-textSuperscript",underline:"editor-textUnderline",underlineStrikethrough:"editor-textUnderlineStrikethrough"},code:"editor-code",codeHighlight:{atrule:"editor-tokenAttr",attr:"editor-tokenAttr",boolean:"editor-tokenProperty",builtin:"editor-tokenSelector",cdata:"editor-tokenComment",char:"editor-tokenSelector",class:"editor-tokenFunction","class-name":"editor-tokenFunction",comment:"editor-tokenComment",constant:"editor-tokenProperty",deleted:"editor-tokenProperty",doctype:"editor-tokenComment",entity:"editor-tokenOperator",function:"editor-tokenFunction",important:"editor-tokenVariable",inserted:"editor-tokenSelector",keyword:"editor-tokenAttr",namespace:"editor-tokenVariable",number:"editor-tokenProperty",operator:"editor-tokenOperator",prolog:"editor-tokenComment",property:"editor-tokenProperty",punctuation:"editor-tokenPunctuation",regex:"editor-tokenVariable",selector:"editor-tokenSelector",string:"editor-tokenSelector",symbol:"editor-tokenProperty",tag:"editor-tokenProperty",url:"editor-tokenOperator",variable:"editor-tokenVariable"}},jw=function(e){var t=e.content;return React.createElement("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-start text-field-placeholder"},t)};function Mw(e){console.error(e)}var Iw=function(e,t){var n,r,i=e.defaultValue,s=void 0===i?"":i,a=e.placeholder,l=void 0===a?"Press @ to view variable suggestions":a,c=e.onChange,u=e.size,d=void 0===u?"md":u,f=e.autoFocus,h=void 0!==f&&f,p=e.options,m=void 0===p?[]:p,g=e.by,v=void 0===g?"name":g,y=e.trigger,b=void 0===y?"@":y,x=e.menuComponent,w=e.menuItemComponent,_=e.className,E=e.disabled,S=void 0!==E&&E,k={namespace:"Editor",editorTheme:Aw,onError:Mw,nodes:[pw],editorState:s||'{\n "root": {\n "children": [\n {\n "children": [],\n "direction": null,\n "format": "",\n "indent": 0,\n "type": "paragraph",\n "version": 1,\n "textFormat": 0,\n "textStyle": ""\n }\n ],\n "direction": null,\n "format": "",\n "indent": 0,\n "type": "root",\n "version": 1\n }\n}',editable:!S};return(0,o.isValidElement)(x)&&(n=x),(0,o.isValidElement)(w)&&(r=w),React.createElement("div",{className:te("relative w-full","border border-solid focus-within:ring-2 focus-within:ring-offset-2 border-field-border hover:border-border-strong focus-within:!border-focus-border focus-within:ring-focus transition duration-150 ease-in-out",$x[d],S&&"bg-field-secondary-background border-field-border-disabled hover:border-field-border-disabled [&_p]:text-badge-color-disabled cursor-not-allowed")},React.createElement(Jb,{initialConfig:k},React.createElement("div",{className:"relative w-full [&_p]:m-0"},React.createElement(bx,{contentEditable:React.createElement(kx,{className:te("editor-content focus-visible:outline-none outline-none","w-full min-h-[1.625rem] [&>p]:w-full [&>p]:m-0",_)}),placeholder:React.createElement(jw,{content:l}),ErrorBoundary:Bx})),React.createElement(Dx,null),React.createElement(Nw,{menuComponent:n,menuItemComponent:r,size:d,by:v,optionsArray:m,trigger:b}),React.createElement(Wx,{onChange:function(e,t){"function"==typeof c&&c(e,t)},ignoreSelectionChange:!0}),t&&React.createElement(Ux,{editorRef:t}),h&&React.createElement(ap,null)))},Dw=(0,o.forwardRef)(Iw);Dw.displayName="EditorInput";var Lw=Dw;const Fw=be("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);var zw=function(e,t){return te("rounded-full text-brand-primary-600 transition-colors duration-300",e[t].dot,e[t].ring)},Bw=["variant","size","type","currentStep","children","className"],Vw=["labelText","icon","stepClasses","isCurrent","isCompleted","className","type","variant","sizeClasses","size","isLast","index"];function Ww(){return Ww=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);nsvg]:size-4",md:"[&>svg]:size-5"})||void 0===n?void 0:n[g],b=function(){m(!p),u&&u(!p)};return i().createElement("div",{className:"p-2"},i().createElement("div",{role:"button",tabIndex:"0",onClick:b,onKeyPress:function(e){"Enter"!==e.key&&" "!==e.key||b()},className:te("text-text-primary bg-transparent cursor-pointer flex justify-between items-center p-1 gap-1",v,f),"aria-expanded":p},i().createElement("span",{className:"text-text-tertiary"},r),a&&i().createElement(Bf.span,{variants:{open:{rotate:180},closed:{rotate:0}},animate:p?"open":"closed",transition:{duration:.15},className:te("flex items-center text-border-strong",y)},i().createElement(Yf,null))),i().createElement(Bh,{initial:!1},p&&i().createElement(Bf.ul,{variants:{open:{height:"auto",opacity:1},closed:{height:0,opacity:0}},initial:"closed",animate:"open",exit:"closed",transition:{duration:.3,ease:"easeInOut"},className:"overflow-hidden flex gap-0.5 flex-col m-0 bg-white rounded-md p-0"},d)))},Zw.Item=function(e){var t,n=e.disabled,r=void 0!==n&&n,o=e.active,s=e.onClick,a=e.children,l=e.className,c=Jw().size,u=null===(t={sm:"[&>svg]:size-4 [&>svg]:m-1 [&>*:not(svg)]:mx-1 [&>*:not(svg)]:my-0.5 text-sm",md:"[&>svg]:size-5 [&>svg]:m-1.5 [&>*:not(svg)]:m-1 text-base"})||void 0===t?void 0:t[c],d=r?"text-text-disabled hover:text-text-disabled cursor-not-allowed hover:bg-transparent":"",f=o?"text-icon-primary [&>svg]:text-icon-interactive bg-background-secondary":"";return i().createElement("li",{role:"menuitem",tabIndex:"0",onClick:s,onKeyPress:function(e){"Enter"!==e.key&&" "!==e.key||s()},className:te("flex p-1 gap-1 items-center bg-transparent w-full border-none rounded text-text-secondary cursor-pointer m-0",u,"hover:bg-background-secondary hover:text-text-primary",d,f,"transition-colors duration-300 ease-in-out",l)},a)},Zw.Separator=function(e){var t,n=e.variant,r=void 0===n?"solid":n,o=e.className,s=null===(t={solid:"border-solid",dashed:"border-dashed",dotted:"border-dotted",double:"border-double",hidden:"border-hidden",none:"border-none"})||void 0===t?void 0:t[r];return i().createElement(i().Fragment,null,i().createElement("hr",{className:te("w-full border-0 border-t border-border-subtle",s,o)}))};var Qw=Zw;const e_=be("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),t_=be("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);var n_=["href","children","className","as"];function r_(){return r_=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);nsvg]:block h-full",n)},t)};var W_=V_;function U_(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n{const t=u(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{const n=e.split("-");return""===n[0]&&1!==n.length&&n.shift(),a(n,t)||c(e)},getConflictingClassGroupIds:(e,t)=>{const o=n[e]||[];return t&&r[e]?[...o,...r[e]]:o}}},a=(e,t)=>{if(0===e.length)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?a(e.slice(1),r):void 0;if(o)return o;if(0===t.validators.length)return;const i=e.join("-");return t.validators.find((({validator:e})=>e(i)))?.classGroupId},l=/^\[(.+)\]$/,c=e=>{if(l.test(e)){const t=l.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},u=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return p(Object.entries(e.classGroups),n).forEach((([e,n])=>{d(n,r,e,t)})),r},d=(e,t,n,r)=>{e.forEach((e=>{if("string"!=typeof e){if("function"==typeof e)return h(e)?void d(e(r),t,n,r):void t.validators.push({validator:e,classGroupId:n});Object.entries(e).forEach((([e,o])=>{d(o,f(t,e),n,r)}))}else(""===e?t:f(t,e)).classGroupId=n}))},f=(e,t)=>{let n=e;return t.split("-").forEach((e=>{n.nextPart.has(e)||n.nextPart.set(e,{nextPart:new Map,validators:[]}),n=n.nextPart.get(e)})),n},h=e=>e.isThemeGetter,p=(e,t)=>t?e.map((([e,n])=>[e,n.map((e=>"string"==typeof e?t+e:"object"==typeof e?Object.fromEntries(Object.entries(e).map((([e,n])=>[t+e,n]))):e))])):e,m=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(o,i)=>{n.set(o,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(e){let t=n.get(e);return void 0!==t?t:void 0!==(t=r.get(e))?(o(e,t),t):void 0},set(e,t){n.has(e)?n.set(e,t):o(e,t)}}},g=e=>{const{separator:t,experimentalParseClassName:n}=e,r=1===t.length,o=t[0],i=t.length,s=e=>{const n=[];let s,a=0,l=0;for(let c=0;cl?s-l:void 0}};return n?e=>n({className:e,parseClassName:s}):s},v=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach((e=>{"["===e[0]?(t.push(...n.sort(),e),n=[]):n.push(e)})),t.push(...n.sort()),t},y=/\s+/;function b(){let e,t,n=0,r="";for(;n{if("string"==typeof e)return e;let t,n="";for(let r=0;rt(e)),e());return n=(e=>({cache:m(e.cacheSize),parseClassName:g(e),...s(e)}))(c),r=n.cache.get,o=n.cache.set,i=a,a(l)};function a(e){const t=r(e);if(t)return t;const i=((e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=[],s=e.trim().split(y);let a="";for(let e=s.length-1;e>=0;e-=1){const t=s[e],{modifiers:l,hasImportantModifier:c,baseClassName:u,maybePostfixModifierPosition:d}=n(t);let f=Boolean(d),h=r(f?u.substring(0,d):u);if(!h){if(!f){a=t+(a.length>0?" "+a:a);continue}if(h=r(u),!h){a=t+(a.length>0?" "+a:a);continue}f=!1}const p=v(l).join(":"),m=c?p+"!":p,g=m+h;if(i.includes(g))continue;i.push(g);const y=o(h,f);for(let e=0;e0?" "+a:a)}return a})(e,n);return o(e,i),i}return function(){return i(b.apply(null,arguments))}}const _=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},E=/^\[(?:([a-z-]+):)?(.+)\]$/i,S=/^\d+\/\d+$/,k=new Set(["px","full","screen"]),C=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,T=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,P=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,R=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,O=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,N=e=>j(e)||k.has(e)||S.test(e),A=e=>H(e,"length",q),j=e=>Boolean(e)&&!Number.isNaN(Number(e)),M=e=>H(e,"number",j),I=e=>Boolean(e)&&Number.isInteger(Number(e)),D=e=>e.endsWith("%")&&j(e.slice(0,-1)),L=e=>E.test(e),F=e=>C.test(e),z=new Set(["length","size","percentage"]),B=e=>H(e,z,Y),V=e=>H(e,"position",Y),W=new Set(["image","url"]),U=e=>H(e,W,G),$=e=>H(e,"",X),K=()=>!0,H=(e,t,n)=>{const r=E.exec(e);return!!r&&(r[1]?"string"==typeof t?r[1]===t:t.has(r[1]):n(r[2]))},q=e=>T.test(e)&&!P.test(e),Y=()=>!1,X=e=>R.test(e),G=e=>O.test(e),J=(Symbol.toStringTag,()=>{const e=_("colors"),t=_("spacing"),n=_("blur"),r=_("brightness"),o=_("borderColor"),i=_("borderRadius"),s=_("borderSpacing"),a=_("borderWidth"),l=_("contrast"),c=_("grayscale"),u=_("hueRotate"),d=_("invert"),f=_("gap"),h=_("gradientColorStops"),p=_("gradientColorStopPositions"),m=_("inset"),g=_("margin"),v=_("opacity"),y=_("padding"),b=_("saturate"),x=_("scale"),w=_("sepia"),E=_("skew"),S=_("space"),k=_("translate"),C=()=>["auto",L,t],T=()=>[L,t],P=()=>["",N,A],R=()=>["auto",j,L],O=()=>["","0",L],z=()=>[j,L];return{cacheSize:500,separator:":",theme:{colors:[K],spacing:[N,A],blur:["none","",F,L],brightness:z(),borderColor:[e],borderRadius:["none","","full",F,L],borderSpacing:T(),borderWidth:P(),contrast:z(),grayscale:O(),hueRotate:z(),invert:O(),gap:T(),gradientColorStops:[e],gradientColorStopPositions:[D,A],inset:C(),margin:C(),opacity:z(),padding:T(),saturate:z(),scale:z(),sepia:O(),skew:z(),space:T(),translate:T()},classGroups:{aspect:[{aspect:["auto","square","video",L]}],container:["container"],columns:[{columns:[F]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",L]}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",I,L]}],basis:[{basis:C()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",L]}],grow:[{grow:O()}],shrink:[{shrink:O()}],order:[{order:["first","last","none",I,L]}],"grid-cols":[{"grid-cols":[K]}],"col-start-end":[{col:["auto",{span:["full",I,L]},L]}],"col-start":[{"col-start":R()}],"col-end":[{"col-end":R()}],"grid-rows":[{"grid-rows":[K]}],"row-start-end":[{row:["auto",{span:[I,L]},L]}],"row-start":[{"row-start":R()}],"row-end":[{"row-end":R()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",L]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",L]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal","start","end","center","between","around","evenly","stretch"]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[S]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[S]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",L,t]}],"min-w":[{"min-w":[L,t,"min","max","fit"]}],"max-w":[{"max-w":[L,t,"none","full","min","max","fit","prose",{screen:[F]},F]}],h:[{h:[L,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[L,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[L,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[L,t,"auto","min","max","fit"]}],"font-size":[{text:["base",F,A]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",M]}],"font-family":[{font:[K]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",L]}],"line-clamp":[{"line-clamp":["none",j,M]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",N,L]}],"list-image":[{"list-image":["none",L]}],"list-style-type":[{list:["none","disc","decimal",L]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","none","wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",N,A]}],"underline-offset":[{"underline-offset":["auto",N,L]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",L]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",L]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",V]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",B]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},U]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[p]}],"gradient-via-pos":[{via:[p]}],"gradient-to-pos":[{to:[p]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:["solid","dashed","dotted","double","none","hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:["solid","dashed","dotted","double","none"]}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["","solid","dashed","dotted","double","none"]}],"outline-offset":[{"outline-offset":[N,L]}],"outline-w":[{outline:[N,A]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:P()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[N,A]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",F,$]}],"shadow-color":[{shadow:[K]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",F,L]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[b]}],sepia:[{sepia:[w]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[w]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",L]}],duration:[{duration:z()}],ease:[{ease:["linear","in","out","in-out",L]}],delay:[{delay:z()}],animate:[{animate:["none","spin","ping","pulse","bounce",L]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[I,L]}],"translate-x":[{"translate-x":[k]}],"translate-y":[{"translate-y":[k]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",L]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",L]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",L]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[N,A,M]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}),Z=w(J);function Q(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;tsvg]:h-4 [&>svg]:w-4",sm:"p-2 rounded-sm [&>svg]:h-4 [&>svg]:w-4",md:"p-2.5 rounded-md text-sm [&>svg]:h-5 [&>svg]:w-5",lg:"p-3 rounded-lg text-base [&>svg]:h-6 [&>svg]:w-6"})||void 0===o?void 0:o[u],A=null,j="";_&&(j="flex items-center justify-center gap-1","left"===S?s=_:A=_);var M=p;return i().createElement(M,ie({ref:t,type:f,className:te(j,"border border-solid cursor-pointer transition-colors duration-300 ease-in-out text-xs font-semibold focus:ring-2 focus:ring-toggle-on focus:ring-offset-2 disabled:text-text-disabled",N,R,O,P,m),disabled:y},T),s,g,A)})),ae=se;let le=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&n[e]];return t};var ce=["id","onChange","value","defaultValue","size","disabled","label","name","className"];function ue(){return ue=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);ne.filter(((e,t,n)=>Boolean(e)&&n.indexOf(e)===t)).join(" ");var ve={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const ye=(0,o.forwardRef)((({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:a,...l},c)=>(0,o.createElement)("svg",{ref:c,...ve,width:t,height:t,stroke:e,strokeWidth:r?24*Number(n)/Number(t):n,className:ge("lucide",i),...l},[...a.map((([e,t])=>(0,o.createElement)(e,t))),...Array.isArray(s)?s:[s]]))),be=(e,t)=>{const n=(0,o.forwardRef)((({className:n,...r},i)=>{return(0,o.createElement)(ye,{ref:i,iconNode:t,className:ge(`lucide-${s=e,s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,n),...r});var s}));return n.displayName=`${e}`,n},xe=be("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]),we=be("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);var _e=["id","label","defaultChecked","checked","onChange","value","indeterminate","disabled","size"];function Ee(){return Ee=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);nsvg]:h-4 [&>svg]:w-4",sm:"py-2 px-2 text-base gap-1 [&>svg]:h-4 [&>svg]:w-4",md:"py-2.5 px-2.5 text-base gap-1 [&>svg]:h-5 [&>svg]:w-5"}[l],"border-0 border-r border-border-subtle border-solid");return i().createElement(i().Fragment,null,i().createElement("button",Oe({type:"button",id:v,className:te(x,"first:rounded-tl first:rounded-bl first:border-0 first:border-r first:border-border-subtle last:rounded-tr last:rounded-br last:border-0",b&&"bg-button-disabled"),onClick:function(){p&&p(r)},disabled:y},c),i().createElement("input",{type:"hidden",value:r,name:d,checked:b,onChange:p}),n))},ze={Group:function(e){var t,n,r=e.children,s=e.name,a=e.value,l=e.defaultValue,c=e.by,u=void 0===c?"id":c,d=e.as,f=void 0===d?o.Fragment:d,h=e.onChange,p=e.className,m=e.style,g=void 0===m?"simple":m,v=e.disabled,y=void 0!==v&&v,b=(0,o.useMemo)((function(){return void 0!==a}),[a]),x=(0,o.useMemo)((function(){return s||"radio-button-group-".concat(le())}),[s]),w=(t=(0,o.useState)(b?a:l),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,s,a=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}(t,n)||function(e,t){if(e){if("string"==typeof e)return je(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?je(e,t):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),_=w[0],E=w[1],S=(0,o.useCallback)((function(e){var t;t="tile"===g?e:e.target.value,b||E(t),"function"==typeof h&&h(t)}),[h]),k=te("tile"===g?"inline-flex border border-border-subtle border-solid rounded shadow-sm":"flex gap-6",p),C=function(){return i().createElement(Me.Provider,{value:{name:x,value:b?a:_,by:u,onChange:S,isControlled:b,disableAll:y,style:g}},i().Children.map(r,(function(e){return(0,o.isValidElement)(e)?e:null})))};return i().createElement(i().Fragment,null,"tile"===g?i().createElement("div",{className:k},C()):i().createElement(f,f===o.Fragment?{}:{className:p},C()))},Button:Le};const Be=be("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);var Ve=function(e,t){var n=e.label,r=void 0===n?"":n,o=e.size,i=void 0===o?"sm":o,s=e.className,a=void 0===s?"":s,l=e.type,c=void 0===l?"pill":l,u=e.variant,d=void 0===u?"neutral":u,f=e.icon,h=void 0===f?null:f,p=e.disabled,m=void 0!==p&&p,g=e.onClose,v=void 0===g?function(){}:g,y=e.closable,b=void 0!==y&&y,x=e.onMouseDown,w=void 0===x?function(){}:x,_={neutral:"bg-badge-background-gray hover:bg-badge-hover-gray text-badge-color-gray border-badge-border-gray",red:"bg-badge-background-red hover:bg-badge-hover-red text-badge-color-red border-badge-border-red",yellow:"bg-badge-background-yellow hover:bg-badge-hover-yellow text-badge-color-yellow border-badge-border-yellow",green:"bg-badge-background-green hover:bg-badge-hover-green text-badge-color-green border-badge-border-green",blue:"bg-badge-background-sky hover:bg-badge-hover-sky text-badge-color-sky border-badge-border-sky",inverse:"bg-background-inverse hover:bg-badge-hover-inverse text-text-inverse border-background-inverse",disabled:"bg-badge-background-disabled hover:bg-badge-hover-disabled text-badge-color-disabled border-badge-border-disabled disabled cursor-not-allowed"},E="",S="group relative justify-center flex items-center [&>svg]:h-4 [&>svg]:w-4 cursor-pointer";return m?(E=_.disabled,S+=" cursor-not-allowed disabled"):E=_[d],r?React.createElement("span",{className:te("font-medium border-badge-border-gray flex gap-1 items-center justify-center border border-solid",{xs:"py-0.5 px-1 text-xs",sm:"py-1 px-1.5 text-xs",md:"py-1 px-1.5 text-sm",lg:"py-1 px-1.5 text-base"}[i],{pill:"rounded-full",rounded:"rounded"}[c],E,a),ref:t},h?React.createElement("span",{className:"justify-center flex items-center [&>svg]:h-4 [&>svg]:w-4"},h):null,r,b&&React.createElement("span",{className:S,onClick:m?null:v,onMouseDown:w,role:"button",tabIndex:0},React.createElement("span",{className:"sr-only"},"Remove ".concat(r)),React.createElement(Be,null),React.createElement("span",{className:"absolute -inset-1"}))):null},We=(0,o.forwardRef)(Ve);We.displayName="Badge";var Ue=We,$e=["id","defaultValue","value","size","className","disabled","onChange","error","onError"];function Ke(){return Ke=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);nsvg]:h-3 [&>svg]:w-3 text-xs",sm:"w-6 h-6 [&>svg]:h-4 [&>svg]:w-4 text-sm",md:"w-8 h-8 [&>svg]:h-5 [&>svg]:w-5 text-base",lg:"w-10 h-10 [&>svg]:h-6 [&>svg]:w-6 text-lg"})||void 0===n?void 0:n[l],v=null===(r={none:"",subtle:"border border-solid border-border-transparent-subtle",ring:"border-4 border-solid border-border-white"})||void 0===r?void 0:r[f&&"none"===u?"subtle":u],y=f?"bg-cover bg-center bg-no-repeat":"";return React.createElement("div",{className:te("rounded-full overflow-hidden flex items-center justify-center",!f&&m,g,v,y,p),style:f?{backgroundImage:"url(".concat(f,")")}:{}},h?"string"==typeof h?null==h||null===(o=h[0])||void 0===o?void 0:o.toUpperCase():h:null)};const Je=be("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);var Ze=["id","type","defaultValue","value","size","className","disabled","onChange","error","onError","prefix","suffix"];function Qe(){return Qe=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n0?j(t[0].name):j(null):t=e.target.value,T||"file"===i||O(t),"function"==typeof g&&g(t))},D="border border-solid border-border-subtle bg-field-secondary-background font-normal placeholder-text-tertiary text-text-primary w-full focus:outline-none",L={sm:"px-2 py-2 rounded",md:"px-2.5 py-2.5 rounded-md",lg:"px-3 py-3 rounded-lg"},F={sm:"text-xs",md:"text-base",lg:"text-base"},z={sm:_?"pl-8":"",md:_?"pl-9":"",lg:_?"pl-10":""},B={sm:S?"pr-8":"",md:S?"pr-9":"",lg:S?"pr-10":""},V=p?"hover:border-border-disabled":"hover:border-border-strong",W="focus:border-focus-border focus:ring-2 focus:ring-toggle-on focus:ring-offset-2",U=y?"focus:border-focus-error-border focus:ring-field-color-error bg-field-background-error":"",$=y?"focus:border-focus-error-border focus:ring-field-color-error":"",K=p?"border-border-disabled bg-field-background-disabled cursor-not-allowed text-text-disabled":"",H=p?"border-border-disabled cursor-not-allowed text-text-disabled file:text-text-tertiary":"",q="font-normal placeholder-text-tertiary text-text-primary pointer-events-none absolute inset-y-0 flex flex-1 items-center [&>svg]:h-4 [&>svg]:w-4",Y=p?"font-normal placeholder-text-tertiary text-icon-disabled pointer-events-none absolute inset-y-0 flex flex-1 items-center":"font-normal placeholder-text-tertiary text-field-placeholder pointer-events-none absolute inset-y-0 flex flex-1 items-center",X=A?"file:border-0 file:bg-transparent":"text-text-tertiary file:border-0 file:bg-transparent";return"file"===i?React.createElement("div",{className:te("relative flex focus-within:z-10",f)},React.createElement("input",Qe({ref:t,id:C,type:"file",className:te(D,H,L[u],F[u],W,V,$,X),disabled:p,onChange:I,onInvalid:x},k)),React.createElement("div",{className:te(Y,"right-0 pr-3",{sm:"[&>svg]:h-4 [&>svg]:w-4",md:"[&>svg]:h-5 [&>svg]:w-5",lg:"[&>svg]:h-6 [&>svg]:w-6"}[u])},React.createElement(Je,null))):React.createElement("div",{className:te("relative flex focus-within:z-10",f)},_?React.createElement("div",{className:te(q,"left-0 pl-3",F[u])},_):null,React.createElement("input",Qe({ref:t,id:C,type:i,className:te(D,K,L[u],F[u],z[u],B[u],W,V,U),disabled:p,onChange:I,onInvalid:x,value:M()},k)),S?React.createElement("div",{className:te(q,"right-0 pr-3",F[u])},S):null)},rt=(0,o.forwardRef)(nt);rt.displayName="Input";var ot=rt,it=["children","tag","size","className","variant","required"];function st(){return st=Object.assign?Object.assign.bind():function(e){for(var t=1;t*]:text-xs [&>svg]:h-3 [&>svg]:w-3",sm:"text-sm [&>*]:text-sm [&>svg]:h-4 [&>svg]:w-4",md:"text-base [&>*]:text-base [&>svg]:h-5 [&>svg]:w-5"}[l],{neutral:"text-field-label [&>*]:text-field-label",help:"text-field-helper [&>*]:text-field-helper",error:"text-support-error [&>*]:text-support-error",disabled:"text-field-color-disabled disabled cursor-not-allowed [&>*]:text-field-color-disabled"}[f],g,u)},m),r)})),lt=at,ct=function(e){var t=e.title,n=void 0===t?null:t,r=e.description,o=void 0===r?null:r,i=e.icon,s=void 0===i?null:i,a=e.iconPosition,l=void 0===a?"right":a,c=e.tag,u=void 0===c?"h2":c,d=e.size,f=void 0===d?"sm":d,h=e.className,p=void 0===h?"":h,m={xs:"gap-1 [&>svg]:size-3.5",sm:"gap-1 [&>svg]:size-4",md:"gap-1.5 [&>svg]:size-5",lg:"gap-1.5 [&>svg]:size-5"};if(!n)return null;var g=function(){var e=u;return React.createElement(e,{className:te("font-semibold p-0 m-0",{xs:"text-base [&>*]:text-base gap-1",sm:"text-lg [&>*]:text-lg gap-1",md:"text-xl [&>*]:text-xl gap-1.5",lg:"text-2xl [&>*]:text-2xl gap-1.5"}[f])},n)};return o?React.createElement("div",{className:p},React.createElement("div",null,s&&"left"===l&&React.createElement("div",{className:te("flex items-center",m[f])},s,g()),s&&"right"===l&&React.createElement("div",{className:te("flex items-center",m[f])},g(),s),!s&&g()),React.createElement("span",{className:te("text-text-secondary font-normal",{xs:"text-base",sm:"text-lg",md:"text-xl",lg:"text-2xl"}[f])},o)):React.createElement("div",{className:p},s&&"left"===l&&React.createElement("div",{className:te("flex items-center",m[f])},s,g()),s&&"right"===l&&React.createElement("div",{className:te("flex items-center",m[f])},g(),s),!s&&g())};const ut=be("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);var dt=function(e){var t,n,r=e.variant,o=void 0===r?"primary":r,i=e.size,s=void 0===i?"md":i,a=e.icon,l=void 0===a?null:a,c=e.className,u=void 0===c?"":c,d=null===(t={primary:"text-brand-primary-600 bg-background-primary",secondary:"text-background-primary bg-brand-primary-600"})||void 0===t?void 0:t[o],f=null===(n={sm:"[&>svg]:h-4 [&>svg]:w-4",md:"[&>svg]:h-5 [&>svg]:w-5",lg:"[&>svg]:h-6 [&>svg]:w-6",xl:"[&>svg]:h-8 [&>svg]:w-8"})||void 0===n?void 0:n[s];return React.createElement("span",{className:te("flex",f,d,u)},l||React.createElement(ut,{className:"animate-spin"}))},ft=function(e){var t=e.progress,n=void 0===t?0:t,r=e.speed,o=void 0===r?200:r,i=e.className,s=void 0===i?"":i;if(!n)return null;var a=n;n<0&&(a=0),n>100&&(a=100);var l="translateX(-".concat(100-a,"%)"),c="h-2 rounded-full bg-background-brand absolute left-0 top-0 w-full bottom-0 origin-left transition-transform duration-".concat(o," ease-linear");return React.createElement("div",{className:te("h-2 rounded-full bg-misc-progress-background overflow-hidden relative",s),role:"progressbar","aria-valuenow":a,"aria-valuemin":"0","aria-valuemax":"100"},React.createElement("div",{className:c,style:{transform:l}}))};function ht(e){return gt(e)?(e.nodeName||"").toLowerCase():"#document"}function pt(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function mt(e){var t;return null==(t=(gt(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function gt(e){return e instanceof Node||e instanceof pt(e).Node}function vt(e){return e instanceof Element||e instanceof pt(e).Element}function yt(e){return e instanceof HTMLElement||e instanceof pt(e).HTMLElement}function bt(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof pt(e).ShadowRoot)}function xt(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Ct(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function wt(e){return["table","td","th"].includes(ht(e))}function _t(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function Et(e){const t=St(),n=vt(e)?Ct(e):e;return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function St(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function kt(e){return["html","body","#document"].includes(ht(e))}function Ct(e){return pt(e).getComputedStyle(e)}function Tt(e){return vt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Pt(e){if("html"===ht(e))return e;const t=e.assignedSlot||e.parentNode||bt(e)&&e.host||mt(e);return bt(t)?t.host:t}function Rt(e){const t=Pt(e);return kt(t)?e.ownerDocument?e.ownerDocument.body:e.body:yt(t)&&xt(t)?t:Rt(t)}function Ot(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=Rt(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),s=pt(o);if(i){const e=Nt(s);return t.concat(s,s.visualViewport||[],xt(o)?o:[],e&&n?Ot(e):[])}return t.concat(o,Ot(o,[],n))}function Nt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function At(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement}return t}function jt(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&bt(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Mt(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function It(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map((e=>{let{brand:t,version:n}=e;return t+"/"+n})).join(" "):navigator.userAgent}function Dt(e){return!(0!==e.mozInputSource||!e.isTrusted)||(zt()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function Lt(e){return!It().includes("jsdom/")&&(!zt()&&0===e.width&&0===e.height||zt()&&1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"===e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail&&"touch"===e.pointerType)}function Ft(){return/apple/i.test(navigator.vendor)}function zt(){const e=/android/i;return e.test(Mt())||e.test(It())}function Bt(){return Mt().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function Vt(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Wt(e){return(null==e?void 0:e.ownerDocument)||document}function Ut(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}function $t(e){return"composedPath"in e?e.composedPath()[0]:e.target}const Kt="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Ht(e){return yt(e)&&e.matches(Kt)}function qt(e){e.preventDefault(),e.stopPropagation()}function Yt(e){return!!e&&"combobox"===e.getAttribute("role")&&Ht(e)}const Xt=Math.min,Gt=Math.max,Jt=Math.round,Zt=Math.floor,Qt=e=>({x:e,y:e}),en={left:"right",right:"left",bottom:"top",top:"bottom"},tn={start:"end",end:"start"};function nn(e,t,n){return Gt(e,Xt(t,n))}function rn(e,t){return"function"==typeof e?e(t):e}function on(e){return e.split("-")[0]}function sn(e){return e.split("-")[1]}function an(e){return"x"===e?"y":"x"}function ln(e){return"y"===e?"height":"width"}function cn(e){return["top","bottom"].includes(on(e))?"y":"x"}function un(e){return an(cn(e))}function dn(e){return e.replace(/start|end/g,(e=>tn[e]))}function fn(e){return e.replace(/left|right|bottom|top/g,(e=>en[e]))}function hn(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function pn(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}}var mn=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),gn="undefined"==typeof Element,vn=gn?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,yn=!gn&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},bn=function e(t,n){var r;void 0===n&&(n=!0);var o=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===o||"true"===o||n&&t&&e(t.parentNode)},xn=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var s=i.shift();if(!bn(s,!1))if("SLOT"===s.tagName){var a=s.assignedElements(),l=e(a.length?a:s.children,!0,r);r.flatten?o.push.apply(o,l):o.push({scopeParent:s,candidates:l})}else{vn.call(s,mn)&&r.filter(s)&&(n||!t.includes(s))&&o.push(s);var c=s.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(s),u=!bn(c,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(c&&u){var d=e(!0===c?s.children:c.children,!0,r);r.flatten?o.push.apply(o,d):o.push({scopeParent:s,candidates:d})}else i.unshift.apply(i,s.children)}}return o},wn=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},En=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!wn(e)?0:e.tabIndex},Sn=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},kn=function(e){return"INPUT"===e.tagName},Cn=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},Tn=function(e,t){return!(t.disabled||bn(t)||function(e){return kn(e)&&"hidden"===e.type}(t)||function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=vn.call(e,"details>summary:first-of-type")?e.parentElement:e;if(vn.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Cn(e)}else{if("function"==typeof r){for(var i=e;e;){var s=e.parentElement,a=yn(e);if(s&&!s.shadowRoot&&!0===r(s))return Cn(e);e=e.assignedSlot?e.assignedSlot:s||a===e.ownerDocument?s:a.host}e=i}if(function(e){var t,n,r,o,i=e&&yn(e),s=null===(t=i)||void 0===t?void 0:t.host,a=!1;if(i&&i!==e)for(a=!!(null!==(n=s)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(s)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!a&&s;){var l,c,u;a=!(null===(c=s=null===(l=i=yn(s))||void 0===l?void 0:l.host)||void 0===c||null===(u=c.ownerDocument)||void 0===u||!u.contains(s))}return a}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1}(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n=0)},On=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,s=i?t.scopeParent:t,a=function(e,t){var n=En(e);return n<0&&t&&!wn(e)?0:n}(s,i),l=i?e(t.candidates):s;0===a?i?n.push.apply(n,l):n.push(s):r.push({documentOrder:o,tabIndex:a,item:t,isScope:i,content:l})})),r.sort(Sn).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},Nn=function(e,t){var n;return n=(t=t||{}).getShadowRoot?xn([e],t.includeContainer,{filter:Pn.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Rn}):function(e,t,n){if(bn(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(mn));return t&&vn.call(e,mn)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,Pn.bind(null,t)),On(n)},An=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==vn.call(e,mn)&&Pn(t,e)},jn=window.ReactDOM;function Mn(e,t,n){let{reference:r,floating:o}=e;const i=cn(t),s=un(t),a=ln(s),l=on(t),c="y"===i,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=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:d};break;case"left":h={x:r.x-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch(sn(t)){case"start":h[s]-=f*(n&&c?-1:1);break;case"end":h[s]+=f*(n&&c?-1:1)}return h}async function In(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=rn(t,e),p=hn(h),m=a[f?"floating"===d?"reference":"floating":d],g=pn(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),v="floating"===d?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),b=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},x=pn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:y,strategy:l}):v);return{top:(g.top-x.top+p.top)/b.y,bottom:(x.bottom-g.bottom+p.bottom)/b.y,left:(g.left-x.left+p.left)/b.x,right:(x.right-g.right+p.right)/b.x}}function Dn(e){const t=Ct(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=yt(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Jt(n)!==i||Jt(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Ln(e){return vt(e)?e:e.contextElement}function Fn(e){const t=Ln(e);if(!yt(t))return Qt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Dn(t);let s=(i?Jt(n.width):n.width)/r,a=(i?Jt(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const zn=Qt(0);function Bn(e){const t=pt(e);return St()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:zn}function Vn(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Ln(e);let s=Qt(1);t&&(r?vt(r)&&(s=Fn(r)):s=Fn(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==pt(e))&&t}(i,n,r)?Bn(i):Qt(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const e=pt(i),t=r&&vt(r)?pt(r):r;let n=e,o=Nt(n);for(;o&&r&&t!==n;){const e=Fn(o),t=o.getBoundingClientRect(),r=Ct(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,s=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=i,c+=s,n=pt(o),o=Nt(n)}}return pn({width:u,height:d,x:l,y:c})}function Wn(e){return Vn(mt(e)).left+Tt(e).scrollLeft}function Un(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=pt(e),r=mt(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const e=St();(!e||e&&"fixed"===t)&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}(e,n);else if("document"===t)r=function(e){const t=mt(e),n=Tt(e),r=e.ownerDocument.body,o=Gt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Gt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Wn(e);const a=-n.scrollTop;return"rtl"===Ct(r).direction&&(s+=Gt(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}(mt(e));else if(vt(t))r=function(e,t){const n=Vn(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=yt(e)?Fn(e):Qt(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=Bn(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return pn(r)}function $n(e,t){const n=Pt(e);return!(n===t||!vt(n)||kt(n))&&("fixed"===Ct(n).position||$n(n,t))}function Kn(e,t,n){const r=yt(t),o=mt(t),i="fixed"===n,s=Vn(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=Qt(0);if(r||!r&&!i)if(("body"!==ht(t)||xt(o))&&(a=Tt(t)),r){const e=Vn(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=Wn(o));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function Hn(e){return"static"===Ct(e).position}function qn(e,t){return yt(e)&&"fixed"!==Ct(e).position?t?t(e):e.offsetParent:null}function Yn(e,t){const n=pt(e);if(_t(e))return n;if(!yt(e)){let t=Pt(e);for(;t&&!kt(t);){if(vt(t)&&!Hn(t))return t;t=Pt(t)}return n}let r=qn(e,t);for(;r&&wt(r)&&Hn(r);)r=qn(r,t);return r&&kt(r)&&Hn(r)&&!Et(r)?n:r||function(e){let t=Pt(e);for(;yt(t)&&!kt(t);){if(Et(t))return t;if(_t(t))return null;t=Pt(t)}return null}(e)||n}const Xn={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,s=mt(r),a=!!t&&_t(t.floating);if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=Qt(1);const u=Qt(0),d=yt(r);if((d||!d&&!i)&&(("body"!==ht(r)||xt(s))&&(l=Tt(r)),yt(r))){const e=Vn(r);c=Fn(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}},getDocumentElement:mt,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?_t(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=Ot(e,[],!1).filter((e=>vt(e)&&"body"!==ht(e))),o=null;const i="fixed"===Ct(e).position;let s=i?Pt(e):e;for(;vt(s)&&!kt(s);){const t=Ct(s),n=Et(s);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||xt(s)&&!n&&$n(e,s))?r=r.filter((e=>e!==s)):o=t,s=Pt(s)}return t.set(e,r),r}(t,this._c):[].concat(n),r],s=i[0],a=i.reduce(((e,n)=>{const r=Un(t,n,o);return e.top=Gt(r.top,e.top),e.right=Xt(r.right,e.right),e.bottom=Xt(r.bottom,e.bottom),e.left=Gt(r.left,e.left),e}),Un(t,s,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:Yn,getElementRects:async function(e){const t=this.getOffsetParent||Yn,n=this.getDimensions,r=await n(e.floating);return{reference:Kn(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Dn(e);return{width:t,height:n}},getScale:Fn,isElement:vt,isRTL:function(e){return"rtl"===Ct(e).direction}};function Gn(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=Ln(e),u=o||i?[...c?Ot(c):[],...Ot(t)]:[];u.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=c&&a?function(e,t){let n,r=null;const o=mt(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function s(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),i();const{left:c,top:u,width:d,height:f}=e.getBoundingClientRect();if(a||t(),!d||!f)return;const h={rootMargin:-Zt(u)+"px "+-Zt(o.clientWidth-(c+d))+"px "+-Zt(o.clientHeight-(u+f))+"px "+-Zt(c)+"px",threshold:Gt(0,Xt(1,l))||1};let p=!0;function m(e){const t=e[0].intersectionRatio;if(t!==l){if(!p)return s();t?s(!1,t):n=setTimeout((()=>{s(!1,1e-7)}),1e3)}p=!1}try{r=new IntersectionObserver(m,{...h,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(m,h)}r.observe(e)}(!0),i}(c,n):null;let f,h=-1,p=null;s&&(p=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame((()=>{var e;null==(e=p)||e.observe(t)}))),n()})),c&&!l&&p.observe(c),p.observe(t));let m=l?Vn(e):null;return l&&function t(){const r=Vn(e);!m||r.x===m.x&&r.y===m.y&&r.width===m.width&&r.height===m.height||n(),m=r,f=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=p)||e.disconnect(),p=null,l&&cancelAnimationFrame(f)}}const Jn=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),s=on(n),a=sn(n),l="y"===cn(n),c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=rn(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:p}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&"number"==typeof p&&(h="end"===a?-1*p:p),l?{x:h*u,y:f*c}:{x:f*c,y:h*u}}(t,e);return s===(null==(n=a.offset)?void 0:n.placement)&&null!=(r=a.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},Zn=function(e){return void 0===e&&(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:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=rn(e,t),c={x:n,y:r},u=await In(t,l),d=cn(on(o)),f=an(d);let h=c[f],p=c[d];if(i){const e="y"===f?"bottom":"right";h=nn(h+u["y"===f?"top":"left"],h,h-u[e])}if(s){const e="y"===d?"bottom":"right";p=nn(p+u["y"===d?"top":"left"],p,p-u[e])}const m=a.fn({...t,[f]:h,[d]:p});return{...m,data:{x:m.x-n,y:m.y-r}}}}},Qn=function(e){return void 0===e&&(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:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...g}=rn(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=on(o),y=cn(a),b=on(a)===a,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=f||(b||!m?[fn(a)]:function(e){const t=fn(e);return[dn(e),t,dn(t)]}(a)),_="none"!==p;!f&&_&&w.push(...function(e,t,n,r){const o=sn(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}(on(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(dn)))),i}(a,m,p,x));const E=[a,...w],S=await In(t,g),k=[];let C=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&k.push(S[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=sn(e),o=un(e),i=ln(o);let s="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=fn(s)),[s,fn(s)]}(o,s,x);k.push(S[e[0]],S[e[1]])}if(C=[...C,{placement:o,overflows:k}],!k.every((e=>e<=0))){var T,P;const e=((null==(T=i.flip)?void 0:T.index)||0)+1,t=E[e];if(t)return{data:{index:e,overflows:C},reset:{placement:t}};let n=null==(P=C.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:P.placement;if(!n)switch(h){case"bestFit":{var R;const e=null==(R=C.filter((e=>{if(_){const t=cn(e.placement);return t===y||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:R[0];e&&(n=e);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},er=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:s=()=>{},...a}=rn(e,t),l=await In(t,a),c=on(n),u=sn(n),d="y"===cn(n),{width:f,height:h}=r.floating;let p,m;"top"===c||"bottom"===c?(p=c,m=u===(await(null==o.isRTL?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(m=c,p="end"===u?"top":"bottom");const g=h-l.top-l.bottom,v=f-l.left-l.right,y=Xt(h-l[p],g),b=Xt(f-l[m],v),x=!t.middlewareData.shift;let w=y,_=b;if(d?_=u||x?Xt(b,v):v:w=u||x?Xt(y,g):g,x&&!u){const e=Gt(l.left,0),t=Gt(l.right,0),n=Gt(l.top,0),r=Gt(l.bottom,0);d?_=f-2*(0!==e||0!==t?e+t:Gt(l.left,l.right)):w=h-2*(0!==n||0!==r?n+r:Gt(l.top,l.bottom))}await s({...t,availableWidth:_,availableHeight:w});const E=await o.getDimensions(i.floating);return f!==E.width||h!==E.height?{reset:{rects:!0}}:{}}}},tr=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}=rn(e,t)||{};if(null==c)return{};const d=hn(u),f={x:n,y:r},h=un(o),p=ln(h),m=await s.getDimensions(c),g="y"===h,v=g?"top":"left",y=g?"bottom":"right",b=g?"clientHeight":"clientWidth",x=i.reference[p]+i.reference[h]-f[h]-i.floating[p],w=f[h]-i.reference[h],_=await(null==s.getOffsetParent?void 0:s.getOffsetParent(c));let E=_?_[b]:0;E&&await(null==s.isElement?void 0:s.isElement(_))||(E=a.floating[b]||i.floating[p]);const S=x/2-w/2,k=E/2-m[p]/2-1,C=Xt(d[v],k),T=Xt(d[y],k),P=C,R=E-m[p]-T,O=E/2-m[p]/2+S,N=nn(P,O,R),A=!l.arrow&&null!=sn(o)&&O!==N&&i.reference[p]/2-(O{const r=new Map,o={platform:Xn,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=Mn(c,r,l),f=r,h={},p=0;for(let n=0;n{t.current=e})),t}const lr=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?tr({element:n.current,padding:r}).fn(t):{}:n?tr({element:n,padding:r}).fn(t):{};var o}}),cr=(e,t)=>({...Jn(e),options:[e,t]}),ur=(e,t)=>({...Qn(e),options:[e,t]}),dr=(e,t)=>({...lr(e),options:[e,t]}),fr={...o},hr=fr.useInsertionEffect||(e=>e());function pr(e){const t=o.useRef((()=>{}));return hr((()=>{t.current=e})),o.useCallback((function(){for(var e=arguments.length,n=new Array(e),r=0;r=e.current.length}function wr(e,t){return Er(e,{disabledIndices:t})}function _r(e,t){return Er(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Er(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:o,amount:i=1}=void 0===t?{}:t;const s=e.current;let a=n;do{a+=r?-i:i}while(a>=0&&a<=s.length-1&&Cr(s,a,o));return a}function Sr(e,t,n,r,o){if(-1===e)return-1;const i=n.indexOf(e),s=t[e];switch(o){case"tl":return i;case"tr":return s?i+s.width-1:i;case"bl":return s?i+(s.height-1)*r:i;case"br":return n.lastIndexOf(e)}}function kr(e,t){return t.flatMap(((t,n)=>e.includes(t)?[n]:[]))}function Cr(e,t,n){if(n)return n.includes(t);const r=e[t];return null==r||r.hasAttribute("disabled")||"true"===r.getAttribute("aria-disabled")}let Tr=0;function Pr(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Tr);const i=()=>null==e?void 0:e.focus({preventScroll:n});o?i():Tr=requestAnimationFrame(i)}var Rr="undefined"!=typeof document?o.useLayoutEffect:o.useEffect;function Or(){return Or=Object.assign?Object.assign.bind():function(e){for(var t=1;t"floating-ui-"+Math.random().toString(36).slice(2,6)+Ar++,Mr=fr.useId||function(){const[e,t]=o.useState((()=>Nr?jr():void 0));return Rr((()=>{null==e&&t(jr())}),[]),o.useEffect((()=>{Nr=!0}),[]),e},Ir=o.forwardRef((function(e,t){const{context:{placement:n,elements:{floating:r},middlewareData:{arrow:i,shift:s}},width:a=14,height:l=7,tipRadius:c=0,strokeWidth:u=0,staticOffset:d,stroke:f,d:h,style:{transform:p,...m}={},...g}=e,v=Mr(),[y,b]=o.useState(!1);if(Rr((()=>{r&&"rtl"===Ct(r).direction&&b(!0)}),[r]),!r)return null;const[x,w]=n.split("-"),_="top"===x||"bottom"===x;let E=d;(_&&null!=s&&s.x||!_&&null!=s&&s.y)&&(E=null);const S=2*u,k=S/2,C=a/2*(c/-8+1),T=l/2*c/4,P=!!h,R=E&&"end"===w?"bottom":"top";let O=E&&"end"===w?"right":"left";E&&y&&(O="end"===w?"left":"right");const N=null!=(null==i?void 0:i.x)?E||i.x:"",A=null!=(null==i?void 0:i.y)?E||i.y:"",j=h||"M0,0 H"+a+" L"+(a-C)+","+(l-T)+" Q"+a/2+","+l+" "+C+","+(l-T)+" Z",M={top:P?"rotate(180deg)":"",left:P?"rotate(90deg)":"rotate(-90deg)",bottom:P?"":"rotate(180deg)",right:P?"rotate(-90deg)":"rotate(90deg)"}[x];return o.createElement("svg",Or({},g,{"aria-hidden":!0,ref:t,width:P?a:a+S,height:a,viewBox:"0 0 "+a+" "+(l>a?l:a),style:{position:"absolute",pointerEvents:"none",[O]:N,[R]:A,[x]:_||P?"100%":"calc(100% - "+S/2+"px)",transform:""+M+(null!=p?p:""),...m}}),S>0&&o.createElement("path",{clipPath:"url(#"+v+")",fill:"none",stroke:f,strokeWidth:S+(h?0:1),d:j}),o.createElement("path",{stroke:S&&!h?g.fill:"none",d:j}),o.createElement("clipPath",{id:v},o.createElement("rect",{x:-k,y:k*(P?-1:1),width:a+S,height:a})))}));const Dr=o.createContext(null),Lr=o.createContext(null),Fr=()=>{var e;return(null==(e=o.useContext(Dr))?void 0:e.id)||null},zr=()=>o.useContext(Lr);function Br(e){return"data-floating-ui-"+e}function Vr(e){const t=(0,o.useRef)(e);return Rr((()=>{t.current=e})),t}const Wr=Br("safe-polygon");function Ur(e,t,n){return n&&!Vt(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}function $r(e,t){let n=e.filter((e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)})),r=n;for(;r.length;)r=e.filter((e=>{var t;return null==(t=r)?void 0:t.some((t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)}))})),n=n.concat(r);return n}let Kr=new WeakMap,Hr=new WeakSet,qr={},Yr=0;const Xr=e=>e&&(e.host||Xr(e.parentNode)),Gr=(e,t)=>t.map((t=>{if(e.contains(t))return t;const n=Xr(t);return e.contains(n)?n:null})).filter((e=>null!=e));function Jr(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=Wt(e[0]).body;return function(e,t,n,r){const o="data-floating-ui-inert",i=r?"inert":n?"aria-hidden":null,s=Gr(t,e),a=new Set,l=new Set(s),c=[];qr[o]||(qr[o]=new WeakMap);const u=qr[o];return s.forEach((function e(t){t&&!a.has(t)&&(a.add(t),t.parentNode&&e(t.parentNode))})),function e(t){t&&!l.has(t)&&[].forEach.call(t.children,(t=>{if("script"!==ht(t))if(a.has(t))e(t);else{const e=i?t.getAttribute(i):null,n=null!==e&&"false"!==e,r=(Kr.get(t)||0)+1,s=(u.get(t)||0)+1;Kr.set(t,r),u.set(t,s),c.push(t),1===r&&n&&Hr.add(t),1===s&&t.setAttribute(o,""),!n&&i&&t.setAttribute(i,"true")}}))}(t),a.clear(),Yr++,()=>{c.forEach((e=>{const t=(Kr.get(e)||0)-1,n=(u.get(e)||0)-1;Kr.set(e,t),u.set(e,n),t||(!Hr.has(e)&&i&&e.removeAttribute(i),Hr.delete(e)),n||e.removeAttribute(o)})),Yr--,Yr||(Kr=new WeakMap,Kr=new WeakMap,Hr=new WeakSet,qr={})}}(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const Zr=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Qr(e,t){const n=Nn(e,Zr());"prev"===t&&n.reverse();const r=n.indexOf(At(Wt(e)));return n.slice(r+1)[0]}function eo(){return Qr(document.body,"next")}function to(){return Qr(document.body,"prev")}function no(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!jt(n,r)}function ro(e){Nn(e,Zr()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function oo(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}const io={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function so(e){"Tab"===e.key&&(e.target,clearTimeout(void 0))}const ao=o.forwardRef((function(e,t){const[n,r]=o.useState();Rr((()=>(Ft()&&r("button"),document.addEventListener("keydown",so),()=>{document.removeEventListener("keydown",so)})),[]);const i={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[Br("focus-guard")]:"",style:io};return o.createElement("span",Or({},e,i))})),lo=o.createContext(null),co=Br("portal");function uo(e){const{children:t,id:n,root:r=null,preserveTabOrder:i=!0}=e,s=function(e){void 0===e&&(e={});const{id:t,root:n}=e,r=Mr(),i=fo(),[s,a]=o.useState(null),l=o.useRef(null);return Rr((()=>()=>{null==s||s.remove(),queueMicrotask((()=>{l.current=null}))}),[s]),Rr((()=>{if(!r)return;if(l.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=r,n.setAttribute(co,""),e.appendChild(n),l.current=n,a(n)}),[t,r]),Rr((()=>{if(!r)return;if(l.current)return;let e=n||(null==i?void 0:i.portalNode);e&&!vt(e)&&(e=e.current),e=e||document.body;let o=null;t&&(o=document.createElement("div"),o.id=t,e.appendChild(o));const s=document.createElement("div");s.id=r,s.setAttribute(co,""),e=o||e,e.appendChild(s),l.current=s,a(s)}),[t,n,r,i]),s}({id:n,root:r}),[a,l]=o.useState(null),c=o.useRef(null),u=o.useRef(null),d=o.useRef(null),f=o.useRef(null),h=null==a?void 0:a.modal,p=null==a?void 0:a.open,m=!!a&&!a.modal&&a.open&&i&&!(!r&&!s);return o.useEffect((()=>{if(s&&i&&!h)return s.addEventListener("focusin",e,!0),s.addEventListener("focusout",e,!0),()=>{s.removeEventListener("focusin",e,!0),s.removeEventListener("focusout",e,!0)};function e(e){s&&no(e)&&("focusin"===e.type?oo:ro)(s)}}),[s,i,h]),o.useEffect((()=>{s&&(p||oo(s))}),[p,s]),o.createElement(lo.Provider,{value:o.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:c,afterOutsideRef:u,beforeInsideRef:d,afterInsideRef:f,portalNode:s,setFocusManagerState:l})),[i,s])},m&&s&&o.createElement(ao,{"data-type":"outside",ref:c,onFocus:e=>{if(no(e,s)){var t;null==(t=d.current)||t.focus()}else{const e=to()||(null==a?void 0:a.refs.domReference.current);null==e||e.focus()}}}),m&&s&&o.createElement("span",{"aria-owns":s.id,style:io}),s&&jn.createPortal(t,s),m&&s&&o.createElement(ao,{"data-type":"outside",ref:u,onFocus:e=>{if(no(e,s)){var t;null==(t=f.current)||t.focus()}else{const t=eo()||(null==a?void 0:a.refs.domReference.current);null==t||t.focus(),(null==a?void 0:a.closeOnFocusOut)&&(null==a||a.onOpenChange(!1,e.nativeEvent,"focus-out"))}}}))}const fo=()=>o.useContext(lo),ho="data-floating-ui-focusable";function po(e){return e?e.hasAttribute(ho)?e:e.querySelector("["+ho+"]")||e:null}const mo=20;let go=[];function vo(e){go=go.filter((e=>e.isConnected));let t=e;if(t&&"body"!==ht(t)){if(!An(t,Zr())){const e=Nn(t,Zr())[0];e&&(t=e)}go.push(t),go.length>mo&&(go=go.slice(-mo))}}function yo(){return go.slice().reverse().find((e=>e.isConnected))}const bo=o.forwardRef((function(e,t){return o.createElement("button",Or({},e,{type:"button",ref:t,tabIndex:-1,style:io}))}));function xo(e){const{context:t,children:n,disabled:r=!1,order:i=["content"],guards:s=!0,initialFocus:a=0,returnFocus:l=!0,restoreFocus:c=!1,modal:u=!0,visuallyHiddenDismiss:d=!1,closeOnFocusOut:f=!0}=e,{open:h,refs:p,nodeId:m,onOpenChange:g,events:v,dataRef:y,floatingId:b,elements:{domReference:x,floating:w}}=t,_="number"==typeof a&&a<0,E=Yt(x)&&_,S=!("undefined"!=typeof HTMLElement&&"inert"in HTMLElement.prototype)||s,k=Vr(i),C=Vr(a),T=Vr(l),P=zr(),R=fo(),O=o.useRef(null),N=o.useRef(null),A=o.useRef(!1),j=o.useRef(!1),M=o.useRef(-1),I=null!=R,D=po(w),L=pr((function(e){return void 0===e&&(e=D),e?Nn(e,Zr()):[]})),F=pr((e=>{const t=L(e);return k.current.map((e=>x&&"reference"===e?x:D&&"floating"===e?D:t)).filter(Boolean).flat()}));function z(e){return!r&&d&&u?o.createElement(bo,{ref:"start"===e?O:N,onClick:e=>g(!1,e.nativeEvent)},"string"==typeof d?d:"Dismiss"):null}o.useEffect((()=>{A.current=!1}),[r]),o.useEffect((()=>{if(r)return;if(!u)return;function e(e){if("Tab"===e.key){jt(D,At(Wt(D)))&&0===L().length&&!E&&qt(e);const t=F(),n=$t(e);"reference"===k.current[0]&&n===x&&(qt(e),e.shiftKey?Pr(t[t.length-1]):Pr(t[1])),"floating"===k.current[1]&&n===D&&e.shiftKey&&(qt(e),Pr(t[0]))}}const t=Wt(D);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[r,x,D,u,k,E,L,F]),o.useEffect((()=>{if(!r&&w)return w.addEventListener("focusin",e),()=>{w.removeEventListener("focusin",e)};function e(e){const t=$t(e),n=L().indexOf(t);-1!==n&&(M.current=n)}}),[r,w,L]),o.useEffect((()=>{if(!r&&f)return w&&yt(x)?(x.addEventListener("focusout",t),x.addEventListener("pointerdown",e),w.addEventListener("focusout",t),()=>{x.removeEventListener("focusout",t),x.removeEventListener("pointerdown",e),w.removeEventListener("focusout",t)}):void 0;function e(){j.current=!0,setTimeout((()=>{j.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=!(jt(x,t)||jt(w,t)||jt(t,w)||jt(null==R?void 0:R.portalNode,t)||null!=t&&t.hasAttribute(Br("focus-guard"))||P&&($r(P.nodesRef.current,m).find((e=>{var n,r;return jt(null==(n=e.context)?void 0:n.elements.floating,t)||jt(null==(r=e.context)?void 0:r.elements.domReference,t)}))||function(e,t){var n;let r=[],o=null==(n=e.find((e=>e.id===t)))?void 0:n.parentId;for(;o;){const t=e.find((e=>e.id===o));o=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}(P.nodesRef.current,m).find((e=>{var n,r;return(null==(n=e.context)?void 0:n.elements.floating)===t||(null==(r=e.context)?void 0:r.elements.domReference)===t}))));if(c&&n&&At(Wt(D))===Wt(D).body){yt(D)&&D.focus();const e=M.current,t=L(),n=t[e]||t[t.length-1]||D;yt(n)&&n.focus()}!E&&u||!t||!n||j.current||t===yo()||(A.current=!0,g(!1,e,"focus-out"))}))}}),[r,x,w,D,u,m,P,R,g,f,c,L,E]),o.useEffect((()=>{var e;if(r)return;const t=Array.from((null==R||null==(e=R.portalNode)?void 0:e.querySelectorAll("["+Br("portal")+"]"))||[]);if(w){const e=[w,...t,O.current,N.current,k.current.includes("reference")||E?x:null].filter((e=>null!=e)),n=u||E?Jr(e,S,!S):Jr(e);return()=>{n()}}}),[r,x,w,u,k,R,E,S]),Rr((()=>{if(r||!yt(D))return;const e=At(Wt(D));queueMicrotask((()=>{const t=F(D),n=C.current,r=("number"==typeof n?t[n]:n.current)||D,o=jt(D,e);_||o||!h||Pr(r,{preventScroll:r===D})}))}),[r,h,D,_,F,C]),Rr((()=>{if(r||!D)return;let e=!1;const t=Wt(D),n=At(t);let o=y.current.openEvent;const i=p.domReference.current;function s(t){let{open:n,reason:r,event:i,nested:s}=t;n&&(o=i),"escape-key"===r&&p.domReference.current&&vo(p.domReference.current),"hover"===r&&"mouseleave"===i.type&&(A.current=!0),"outside-press"===r&&(s?(A.current=!1,e=!0):A.current=!(Dt(i)||Lt(i)))}return vo(n),v.on("openchange",s),()=>{v.off("openchange",s);const r=At(t),a=jt(w,r)||P&&$r(P.nodesRef.current,m).some((e=>{var t;return jt(null==(t=e.context)?void 0:t.elements.floating,r)}));(a||o&&["click","mousedown"].includes(o.type))&&p.domReference.current&&vo(p.domReference.current);const l=i||n,c=Nn(Wt(l).body,Zr());queueMicrotask((()=>{let n=yo();!n&&yt(l)&&w&&(n=function(e,t,n){const r=e.indexOf(t);function o(t){const o=Br("focus-guard");let i=r+(t?1:0),s=e[i];for(;s&&(!s.isConnected||s.hasAttribute(o)||jt(n,s));)t?i++:i--,s=e[i];return s}return o(!0)||o(!1)}(c,l,w)),T.current&&!A.current&&yt(n)&&(n===r||r===t.body||a)&&n.focus({preventScroll:e})}))}}),[r,w,D,T,y,p,v,P,m]),Rr((()=>{if(!r&&R)return R.setFocusManagerState({modal:u,closeOnFocusOut:f,open:h,onOpenChange:g,refs:p}),()=>{R.setFocusManagerState(null)}}),[r,R,u,h,g,p,f]),Rr((()=>{if(r)return;if(!D)return;if("function"!=typeof MutationObserver)return;if(_)return;const e=()=>{const e=D.getAttribute("tabindex"),t=L(),n=At(Wt(w)),r=t.indexOf(n);-1!==r&&(M.current=r),k.current.includes("floating")||n!==p.domReference.current&&0===t.length?"0"!==e&&D.setAttribute("tabindex","0"):"-1"!==e&&D.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(D,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}}),[r,w,D,p,k,L,_]);const B=!r&&S&&(!u||!E)&&(I||u);return o.createElement(o.Fragment,null,B&&o.createElement(ao,{"data-type":"inside",ref:null==R?void 0:R.beforeInsideRef,onFocus:e=>{if(u){const e=F();Pr("reference"===i[0]?e[0]:e[e.length-1])}else if(null!=R&&R.preserveTabOrder&&R.portalNode)if(A.current=!1,no(e,R.portalNode)){const e=eo()||x;null==e||e.focus()}else{var t;null==(t=R.beforeOutsideRef.current)||t.focus()}}}),!E&&z("start"),n,z("end"),B&&o.createElement(ao,{"data-type":"inside",ref:null==R?void 0:R.afterInsideRef,onFocus:e=>{if(u)Pr(F()[0]);else if(null!=R&&R.preserveTabOrder&&R.portalNode)if(f&&(A.current=!0),no(e,R.portalNode)){const e=to()||x;null==e||e.focus()}else{var t;null==(t=R.afterOutsideRef.current)||t.focus()}}}))}function wo(e){return yt(e.target)&&"BUTTON"===e.target.tagName}function _o(e){return Ht(e)}function Eo(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:i,elements:{domReference:s}}=e,{enabled:a=!0,event:l="click",toggle:c=!0,ignoreMouse:u=!1,keyboardHandlers:d=!0}=t,f=o.useRef(),h=o.useRef(!1),p=o.useMemo((()=>({onPointerDown(e){f.current=e.pointerType},onMouseDown(e){const t=f.current;0===e.button&&"click"!==l&&(Vt(t,!0)&&u||(!n||!c||i.current.openEvent&&"mousedown"!==i.current.openEvent.type?(e.preventDefault(),r(!0,e.nativeEvent,"click")):r(!1,e.nativeEvent,"click")))},onClick(e){const t=f.current;"mousedown"===l&&f.current?f.current=void 0:Vt(t,!0)&&u||(!n||!c||i.current.openEvent&&"click"!==i.current.openEvent.type?r(!0,e.nativeEvent,"click"):r(!1,e.nativeEvent,"click"))},onKeyDown(e){f.current=void 0,e.defaultPrevented||!d||wo(e)||(" "!==e.key||_o(s)||(e.preventDefault(),h.current=!0),"Enter"===e.key&&r(!n||!c,e.nativeEvent,"click"))},onKeyUp(e){e.defaultPrevented||!d||wo(e)||_o(s)||" "===e.key&&h.current&&(h.current=!1,r(!n||!c,e.nativeEvent,"click"))}})),[i,s,l,u,d,r,n,c]);return o.useMemo((()=>a?{reference:p}:{}),[a,p])}const So={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},ko={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Co=e=>{var t,n;return{escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};function To(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,elements:i,dataRef:s}=e,{enabled:a=!0,escapeKey:l=!0,outsidePress:c=!0,outsidePressEvent:u="pointerdown",referencePress:d=!1,referencePressEvent:f="pointerdown",ancestorScroll:h=!1,bubbles:p,capture:m}=t,g=zr(),v=pr("function"==typeof c?c:()=>!1),y="function"==typeof c?v:c,b=o.useRef(!1),x=o.useRef(!1),{escapeKey:w,outsidePress:_}=Co(p),{escapeKey:E,outsidePress:S}=Co(m),k=pr((e=>{var t;if(!n||!a||!l||"Escape"!==e.key)return;const o=null==(t=s.current.floatingContext)?void 0:t.nodeId,i=g?$r(g.nodesRef.current,o):[];if(!w&&(e.stopPropagation(),i.length>0)){let e=!0;if(i.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}r(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")})),C=pr((e=>{var t;const n=()=>{var t;k(e),null==(t=$t(e))||t.removeEventListener("keydown",n)};null==(t=$t(e))||t.addEventListener("keydown",n)})),T=pr((e=>{var t;const n=b.current;b.current=!1;const o=x.current;if(x.current=!1,"click"===u&&o)return;if(n)return;if("function"==typeof y&&!y(e))return;const a=$t(e),l="["+Br("inert")+"]",c=Wt(i.floating).querySelectorAll(l);let d=vt(a)?a:null;for(;d&&!kt(d);){const e=Pt(d);if(kt(e)||!vt(e))break;d=e}if(c.length&&vt(a)&&!a.matches("html,body")&&!jt(a,i.floating)&&Array.from(c).every((e=>!jt(d,e))))return;if(yt(a)&&O){const t=a.clientWidth>0&&a.scrollWidth>a.clientWidth,n=a.clientHeight>0&&a.scrollHeight>a.clientHeight;let r=n&&e.offsetX>a.clientWidth;if(n&&"rtl"===Ct(a).direction&&(r=e.offsetX<=a.offsetWidth-a.clientWidth),r||t&&e.offsetY>a.clientHeight)return}const f=null==(t=s.current.floatingContext)?void 0:t.nodeId,h=g&&$r(g.nodesRef.current,f).some((t=>{var n;return Ut(e,null==(n=t.context)?void 0:n.elements.floating)}));if(Ut(e,i.floating)||Ut(e,i.domReference)||h)return;const p=g?$r(g.nodesRef.current,f):[];if(p.length>0){let e=!0;if(p.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}r(!1,e,"outside-press")})),P=pr((e=>{var t;const n=()=>{var t;T(e),null==(t=$t(e))||t.removeEventListener(u,n)};null==(t=$t(e))||t.addEventListener(u,n)}));o.useEffect((()=>{if(!n||!a)return;function e(e){r(!1,e,"ancestor-scroll")}s.current.__escapeKeyBubbles=w,s.current.__outsidePressBubbles=_;const t=Wt(i.floating);l&&t.addEventListener("keydown",E?C:k,E),y&&t.addEventListener(u,S?P:T,S);let o=[];return h&&(vt(i.domReference)&&(o=Ot(i.domReference)),vt(i.floating)&&(o=o.concat(Ot(i.floating))),!vt(i.reference)&&i.reference&&i.reference.contextElement&&(o=o.concat(Ot(i.reference.contextElement)))),o=o.filter((e=>{var n;return e!==(null==(n=t.defaultView)?void 0:n.visualViewport)})),o.forEach((t=>{t.addEventListener("scroll",e,{passive:!0})})),()=>{l&&t.removeEventListener("keydown",E?C:k,E),y&&t.removeEventListener(u,S?P:T,S),o.forEach((t=>{t.removeEventListener("scroll",e)}))}}),[s,i,l,y,u,n,r,h,a,w,_,k,E,C,T,S,P]),o.useEffect((()=>{b.current=!1}),[y,u]);const R=o.useMemo((()=>({onKeyDown:k,[So[f]]:e=>{d&&r(!1,e.nativeEvent,"reference-press")}})),[k,r,d,f]),O=o.useMemo((()=>({onKeyDown:k,onMouseDown(){x.current=!0},onMouseUp(){x.current=!0},[ko[u]]:()=>{b.current=!0}})),[k,u]);return o.useMemo((()=>a?{reference:R,floating:O}:{}),[a,R,O])}function Po(e){void 0===e&&(e={});const{nodeId:t}=e,n=function(e){const{open:t=!1,onOpenChange:n,elements:r}=e,i=Mr(),s=o.useRef({}),[a]=o.useState((()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}())),l=null!=Fr(),[c,u]=o.useState(r.reference),d=pr(((e,t,r)=>{s.current.openEvent=e?t:void 0,a.emit("openchange",{open:e,event:t,reason:r,nested:l}),null==n||n(e,t,r)})),f=o.useMemo((()=>({setPositionReference:u})),[]),h=o.useMemo((()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference})),[c,r.reference,r.floating]);return o.useMemo((()=>({dataRef:s,open:t,onOpenChange:d,elements:h,events:a,floatingId:i,refs:f})),[t,d,h,a,i,f])}({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,i=r.elements,[s,a]=o.useState(null),[l,c]=o.useState(null),u=(null==i?void 0:i.reference)||s,d=o.useRef(null),f=zr();Rr((()=>{u&&(d.current=u)}),[u]);const h=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:a}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=o.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=o.useState(r);or(h,r)||p(r);const[m,g]=o.useState(null),[v,y]=o.useState(null),b=o.useCallback((e=>{e!==E.current&&(E.current=e,g(e))}),[]),x=o.useCallback((e=>{e!==S.current&&(S.current=e,y(e))}),[]),w=s||m,_=a||v,E=o.useRef(null),S=o.useRef(null),k=o.useRef(d),C=null!=c,T=ar(c),P=ar(i),R=o.useCallback((()=>{if(!E.current||!S.current)return;const e={placement:t,strategy:n,middleware:h};P.current&&(e.platform=P.current),nr(E.current,S.current,e).then((e=>{const t={...e,isPositioned:!0};O.current&&!or(k.current,t)&&(k.current=t,jn.flushSync((()=>{f(t)})))}))}),[h,t,n,P]);rr((()=>{!1===u&&k.current.isPositioned&&(k.current.isPositioned=!1,f((e=>({...e,isPositioned:!1}))))}),[u]);const O=o.useRef(!1);rr((()=>(O.current=!0,()=>{O.current=!1})),[]),rr((()=>{if(w&&(E.current=w),_&&(S.current=_),w&&_){if(T.current)return T.current(w,_,R);R()}}),[w,_,R,T,C]);const N=o.useMemo((()=>({reference:E,floating:S,setReference:b,setFloating:x})),[b,x]),A=o.useMemo((()=>({reference:w,floating:_})),[w,_]),j=o.useMemo((()=>{const e={position:n,left:0,top:0};if(!A.floating)return e;const t=sr(A.floating,d.x),r=sr(A.floating,d.y);return l?{...e,transform:"translate("+t+"px, "+r+"px)",...ir(A.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,l,A.floating,d.x,d.y]);return o.useMemo((()=>({...d,update:R,refs:N,elements:A,floatingStyles:j})),[d,R,N,A,j])}({...e,elements:{...i,...l&&{reference:l}}}),p=o.useCallback((e=>{const t=vt(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;c(t),h.refs.setReference(t)}),[h.refs]),m=o.useCallback((e=>{(vt(e)||null===e)&&(d.current=e,a(e)),(vt(h.refs.reference.current)||null===h.refs.reference.current||null!==e&&!vt(e))&&h.refs.setReference(e)}),[h.refs]),g=o.useMemo((()=>({...h.refs,setReference:m,setPositionReference:p,domReference:d})),[h.refs,m,p]),v=o.useMemo((()=>({...h.elements,domReference:u})),[h.elements,u]),y=o.useMemo((()=>({...h,...r,refs:g,elements:v,nodeId:t})),[h,g,v,t,r]);return Rr((()=>{r.dataRef.current.floatingContext=y;const e=null==f?void 0:f.nodesRef.current.find((e=>e.id===t));e&&(e.context=y)})),o.useMemo((()=>({...h,context:y,refs:g,elements:v})),[h,g,v,y])}const Ro="active",Oo="selected";function No(e,t,n){const r=new Map,o="item"===n;let i=e;if(o&&e){const{[Ro]:t,[Oo]:__,...n}=e;i=n}return{..."floating"===n&&{tabIndex:-1,[ho]:""},...i,...t.map((t=>{const r=t?t[n]:null;return"function"==typeof r?e?r(e):null:r})).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,i]=t;var s;o&&[Ro,Oo].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof i&&(null==(s=r.get(n))||s.push(i),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),i=0;ie(...o))).find((e=>void 0!==e))})):e[n]=i)})),e):e),{})}}function Ao(e){void 0===e&&(e=[]);const t=e.map((e=>null==e?void 0:e.reference)),n=e.map((e=>null==e?void 0:e.floating)),r=e.map((e=>null==e?void 0:e.item)),i=o.useCallback((t=>No(t,e,"reference")),t),s=o.useCallback((t=>No(t,e,"floating")),n),a=o.useCallback((t=>No(t,e,"item")),r);return o.useMemo((()=>({getReferenceProps:i,getFloatingProps:s,getItemProps:a})),[i,s,a])}let jo=!1;function Mo(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Io(e,t){return Mo(t,e===mr||e===gr,e===vr||e===yr)}function Do(e,t,n){return Mo(t,e===gr,n?e===vr:e===yr)||"Enter"===e||" "===e||""===e}function Lo(e,t,n){return Mo(t,n?e===yr:e===vr,e===mr)}function Fo(e,t){const{open:n,onOpenChange:r,elements:i}=e,{listRef:s,activeIndex:a,onNavigate:l=()=>{},enabled:c=!0,selectedIndex:u=null,allowEscape:d=!1,loop:f=!1,nested:h=!1,rtl:p=!1,virtual:m=!1,focusItemOnOpen:g="auto",focusItemOnHover:v=!0,openOnArrowKeyDown:y=!0,disabledIndices:b,orientation:x="vertical",cols:w=1,scrollItemIntoView:_=!0,virtualItemRef:E,itemSizes:S,dense:k=!1}=t,C=Vr(po(i.floating)),T=Fr(),P=zr(),R=pr(l),O=o.useRef(g),N=o.useRef(null!=u?u:-1),A=o.useRef(null),j=o.useRef(!0),M=o.useRef(R),I=o.useRef(!!i.floating),D=o.useRef(n),L=o.useRef(!1),F=o.useRef(!1),z=Vr(b),B=Vr(n),V=Vr(_),W=Vr(u),[U,$]=o.useState(),[K,H]=o.useState(),q=pr((function(e,t,n){function r(e){m?($(e.id),null==P||P.events.emit("virtualfocus",e),E&&(E.current=e)):Pr(e,{preventScroll:!0,sync:!(!Bt()||!Ft())&&(jo||L.current)})}void 0===n&&(n=!1);const o=e.current[t.current];o&&r(o),requestAnimationFrame((()=>{const i=e.current[t.current]||o;if(!i)return;o||r(i);const s=V.current;s&&X&&(n||!j.current)&&(null==i.scrollIntoView||i.scrollIntoView("boolean"==typeof s?{block:"nearest",inline:"nearest"}:s))}))}));Rr((()=>{document.createElement("div").focus({get preventScroll(){return jo=!0,!1}})}),[]),Rr((()=>{c&&(n&&i.floating?O.current&&null!=u&&(F.current=!0,N.current=u,R(u)):I.current&&(N.current=-1,M.current(null)))}),[c,n,i.floating,u,R]),Rr((()=>{if(c&&n&&i.floating)if(null==a){if(L.current=!1,null!=W.current)return;if(I.current&&(N.current=-1,q(s,N)),(!D.current||!I.current)&&O.current&&(null!=A.current||!0===O.current&&null==A.current)){let e=0;const t=()=>{null==s.current[0]?(e<2&&(e?requestAnimationFrame:queueMicrotask)(t),e++):(N.current=null==A.current||Do(A.current,x,p)||h?wr(s,z.current):_r(s,z.current),A.current=null,R(N.current))};t()}}else xr(s,a)||(N.current=a,q(s,N,F.current),F.current=!1)}),[c,n,i.floating,a,W,h,s,x,p,R,q,z]),Rr((()=>{var e;if(!c||i.floating||!P||m||!I.current)return;const t=P.nodesRef.current,n=null==(e=t.find((e=>e.id===T)))||null==(e=e.context)?void 0:e.elements.floating,r=At(Wt(i.floating)),o=t.some((e=>e.context&&jt(e.context.elements.floating,r)));n&&!o&&j.current&&n.focus({preventScroll:!0})}),[c,i.floating,P,T,m]),Rr((()=>{if(c&&P&&m&&!T)return P.events.on("virtualfocus",e),()=>{P.events.off("virtualfocus",e)};function e(e){H(e.id),E&&(E.current=e)}}),[c,P,m,T,E]),Rr((()=>{M.current=R,I.current=!!i.floating})),Rr((()=>{n||(A.current=null)}),[n]),Rr((()=>{D.current=n}),[n]);const Y=null!=a,X=o.useMemo((()=>{function e(e){if(!n)return;const t=s.current.indexOf(e);-1!==t&&R(t)}return{onFocus(t){let{currentTarget:n}=t;e(n)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},...v&&{onMouseMove(t){let{currentTarget:n}=t;e(n)},onPointerLeave(e){let{pointerType:t}=e;j.current&&"touch"!==t&&(N.current=-1,q(s,N),R(null),m||Pr(C.current,{preventScroll:!0}))}}}}),[n,C,q,v,s,R,m]),G=pr((e=>{if(j.current=!1,L.current=!0,!B.current&&e.currentTarget===C.current)return;if(h&&Lo(e.key,x,p))return qt(e),r(!1,e.nativeEvent,"list-navigation"),void(yt(i.domReference)&&!m&&i.domReference.focus());const t=N.current,o=wr(s,b),a=_r(s,b);if("Home"===e.key&&(qt(e),N.current=o,R(N.current)),"End"===e.key&&(qt(e),N.current=a,R(N.current)),w>1){const t=S||Array.from({length:s.current.length},(()=>({width:1,height:1}))),n=function(e,t,n){const r=[];let o=0;return e.forEach(((e,i)=>{let{width:s,height:a}=e,l=!1;for(n&&(o=0);!l;){const e=[];for(let n=0;nnull==r[e]))?(e.forEach((e=>{r[e]=i})),l=!0):o++}})),[...r]}(t,w,k),r=n.findIndex((e=>null!=e&&!Cr(s.current,e,b))),i=n.reduce(((e,t,n)=>null==t||Cr(s.current,t,b)?e:n),-1),l=n[function(e,t){let{event:n,orientation:r,loop:o,cols:i,disabledIndices:s,minIndex:a,maxIndex:l,prevIndex:c,stopEvent:u=!1}=t,d=c;if(n.key===mr){if(u&&qt(n),-1===c)d=l;else if(d=Er(e,{startingIndex:d,amount:i,decrement:!0,disabledIndices:s}),o&&(c-ie?n:n-i}xr(e,d)&&(d=c)}if(n.key===gr&&(u&&qt(n),-1===c?d=a:(d=Er(e,{startingIndex:c,amount:i,disabledIndices:s}),o&&c+i>l&&(d=Er(e,{startingIndex:c%i-i,amount:i,disabledIndices:s}))),xr(e,d)&&(d=c)),"both"===r){const t=Zt(c/i);n.key===yr&&(u&&qt(n),c%i!=i-1?(d=Er(e,{startingIndex:c,disabledIndices:s}),o&&br(d,i,t)&&(d=Er(e,{startingIndex:c-c%i-1,disabledIndices:s}))):o&&(d=Er(e,{startingIndex:c-c%i-1,disabledIndices:s})),br(d,i,t)&&(d=c)),n.key===vr&&(u&&qt(n),c%i!=0?(d=Er(e,{startingIndex:c,decrement:!0,disabledIndices:s}),o&&br(d,i,t)&&(d=Er(e,{startingIndex:c+(i-c%i),decrement:!0,disabledIndices:s}))):o&&(d=Er(e,{startingIndex:c+(i-c%i),decrement:!0,disabledIndices:s})),br(d,i,t)&&(d=c));const r=Zt(l/i)===t;xr(e,d)&&(d=o&&r?n.key===vr?l:Er(e,{startingIndex:c-c%i-1,disabledIndices:s}):c)}return d}({current:n.map((e=>null!=e?s.current[e]:null))},{event:e,orientation:x,loop:f,cols:w,disabledIndices:kr([...b||s.current.map(((e,t)=>Cr(s.current,t)?t:void 0)),void 0],n),minIndex:r,maxIndex:i,prevIndex:Sr(N.current>a?o:N.current,t,n,w,e.key===gr?"bl":e.key===yr?"tr":"tl"),stopEvent:!0})];if(null!=l&&(N.current=l,R(N.current)),"both"===x)return}if(Io(e.key,x)){if(qt(e),n&&!m&&At(e.currentTarget.ownerDocument)===e.currentTarget)return N.current=Do(e.key,x,p)?o:a,void R(N.current);Do(e.key,x,p)?N.current=f?t>=a?d&&t!==s.current.length?-1:o:Er(s,{startingIndex:t,disabledIndices:b}):Math.min(a,Er(s,{startingIndex:t,disabledIndices:b})):N.current=f?t<=o?d&&-1!==t?s.current.length:a:Er(s,{startingIndex:t,decrement:!0,disabledIndices:b}):Math.max(o,Er(s,{startingIndex:t,decrement:!0,disabledIndices:b})),xr(s,N.current)?R(null):R(N.current)}})),J=o.useMemo((()=>m&&n&&Y&&{"aria-activedescendant":K||U}),[m,n,Y,K,U]),Z=o.useMemo((()=>({"aria-orientation":"both"===x?void 0:x,...!Yt(i.domReference)&&J,onKeyDown:G,onPointerMove(){j.current=!0}})),[J,G,i.domReference,x]),Q=o.useMemo((()=>{function e(e){"auto"===g&&Dt(e.nativeEvent)&&(O.current=!0)}return{...J,onKeyDown(e){j.current=!1;const t=0===e.key.indexOf("Arrow"),o=function(e,t,n){return Mo(t,n?e===vr:e===yr,e===gr)}(e.key,x,p),i=Lo(e.key,x,p),a=Io(e.key,x),l=(h?o:a)||"Enter"===e.key||""===e.key.trim();if(m&&n){const n=null==P?void 0:P.nodesRef.current.find((e=>null==e.parentId)),r=P&&n?function(e,t){let n,r=-1;return function t(o,i){i>r&&(n=o,r=i),$r(e,o).forEach((e=>{t(e.id,i+1)}))}(t,0),e.find((e=>e.id===n))}(P.nodesRef.current,n.id):null;if(t&&r&&E){const t=new KeyboardEvent("keydown",{key:e.key,bubbles:!0});if(o||i){var c,d;const n=(null==(c=r.context)?void 0:c.elements.domReference)===e.currentTarget,a=i&&!n?null==(d=r.context)?void 0:d.elements.domReference:o?s.current.find((e=>(null==e?void 0:e.id)===U)):null;a&&(qt(e),a.dispatchEvent(t),H(void 0))}var f;if(a&&r.context&&r.context.open&&r.parentId&&e.currentTarget!==r.context.elements.domReference)return qt(e),void(null==(f=r.context.elements.domReference)||f.dispatchEvent(t))}return G(e)}(n||y||!t)&&(l&&(A.current=h&&a?null:e.key),h?o&&(qt(e),n?(N.current=wr(s,z.current),R(N.current)):r(!0,e.nativeEvent,"list-navigation")):a&&(null!=u&&(N.current=u),qt(e),!n&&y?r(!0,e.nativeEvent,"list-navigation"):G(e),n&&R(N.current)))},onFocus(){n&&!m&&R(null)},onPointerDown:function(e){O.current=g,"auto"===g&&Lt(e.nativeEvent)&&(O.current=!0)},onMouseDown:e,onClick:e}}),[U,J,G,z,g,s,h,R,r,n,y,x,p,u,P,m,E]);return o.useMemo((()=>c?{reference:Q,floating:Z,item:X}:{}),[c,Q,Z,X])}const zo=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Bo(e,t){var n;void 0===t&&(t={});const{open:r,floatingId:i}=e,{enabled:s=!0,role:a="dialog"}=t,l=null!=(n=zo.get(a))?n:a,c=Mr(),u=null!=Fr(),d=o.useMemo((()=>"tooltip"===l||"label"===a?{["aria-"+("label"===a?"labelledby":"describedby")]:r?i:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":"alertdialog"===l?"dialog":l,"aria-controls":r?i:void 0,..."listbox"===l&&{role:"combobox"},..."menu"===l&&{id:c},..."menu"===l&&u&&{role:"menuitem"},..."select"===a&&{"aria-autocomplete":"none"},..."combobox"===a&&{"aria-autocomplete":"list"}}),[l,i,u,r,c,a]),f=o.useMemo((()=>{const e={id:i,...l&&{role:l}};return"tooltip"===l||"label"===a?e:{...e,..."menu"===l&&{"aria-labelledby":c}}}),[l,i,c,a]),h=o.useCallback((e=>{let{active:t,selected:n}=e;const r={role:"option",...t&&{id:i+"-option"}};switch(a){case"select":return{...r,"aria-selected":t&&n};case"combobox":return{...r,...t&&{"aria-selected":!0}}}return{}}),[i,a]);return o.useMemo((()=>s?{reference:d,floating:f,item:h}:{}),[s,d,f,h])}const Vo=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function Wo(e,t){return"function"==typeof e?e(t):e}function Uo(e,t){const[n,r]=e;let o=!1;const i=t.length;for(let e=0,s=i-1;e=r!=c>=r&&n<=(l-i)*(r-a)/(c-a)+i&&(o=!o)}return o}function $o(e){void 0===e&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e;let o,i=!1,s=null,a=null,l=performance.now();const c=e=>{let{x:n,y:c,placement:u,elements:d,onClose:f,nodeId:h,tree:p}=e;return function(e){function m(){clearTimeout(o),f()}if(clearTimeout(o),!d.domReference||!d.floating||null==u||null==n||null==c)return;const{clientX:g,clientY:v}=e,y=[g,v],b=$t(e),x="mouseleave"===e.type,w=jt(d.floating,b),_=jt(d.domReference,b),E=d.domReference.getBoundingClientRect(),S=d.floating.getBoundingClientRect(),k=u.split("-")[0],C=n>S.right-S.width/2,T=c>S.bottom-S.height/2,P=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(y,E),R=S.width>E.width,O=S.height>E.height,N=(R?E:S).left,A=(R?E:S).right,j=(O?E:S).top,M=(O?E:S).bottom;if(w&&(i=!0,!x))return;if(_&&(i=!1),_&&!x)return void(i=!0);if(x&&vt(e.relatedTarget)&&jt(d.floating,e.relatedTarget))return;if(p&&$r(p.nodesRef.current,h).some((e=>{let{context:t}=e;return null==t?void 0:t.open})))return;if("top"===k&&c>=E.bottom-1||"bottom"===k&&c<=E.top+1||"left"===k&&n>=E.right-1||"right"===k&&n<=E.left+1)return m();let I=[];switch(k){case"top":I=[[N,E.top+1],[N,S.bottom-1],[A,S.bottom-1],[A,E.top+1]];break;case"bottom":I=[[N,S.top+1],[N,E.bottom-1],[A,E.bottom-1],[A,S.top+1]];break;case"left":I=[[S.right-1,M],[S.right-1,j],[E.left+1,j],[E.left+1,M]];break;case"right":I=[[E.right-1,M],[E.right-1,j],[S.left+1,j],[S.left+1,M]]}if(!Uo([g,v],I)){if(i&&!P)return m();if(!x&&r){const t=function(e,t){const n=performance.now(),r=n-l;if(null===s||null===a||0===r)return s=e,a=t,l=n,null;const o=e-s,i=t-a,c=Math.sqrt(o*o+i*i);return s=e,a=t,l=n,c/r}(e.clientX,e.clientY);if(null!==t&&t<.1)return m()}Uo([g,v],function(e){let[n,r]=e;switch(k){case"top":return[[R?n+t/2:C?n+4*t:n-4*t,r+t+1],[R?n-t/2:C?n+4*t:n-4*t,r+t+1],[S.left,C||R?S.bottom-t:S.top],[S.right,C?R?S.bottom-t:S.top:S.bottom-t]];case"bottom":return[[R?n+t/2:C?n+4*t:n-4*t,r-t],[R?n-t/2:C?n+4*t:n-4*t,r-t],[S.left,C||R?S.top+t:S.bottom],[S.right,C?R?S.top+t:S.bottom:S.top+t]];case"left":{const e=[n+t+1,O?r+t/2:T?r+4*t:r-4*t],o=[n+t+1,O?r-t/2:T?r+4*t:r-4*t];return[[T||O?S.right-t:S.left,S.top],[T?O?S.right-t:S.left:S.right-t,S.bottom],e,o]}case"right":return[[n-t,O?r+t/2:T?r+4*t:r-4*t],[n-t,O?r-t/2:T?r+4*t:r-4*t],[T||O?S.left+t:S.right,S.top],[T?O?S.left+t:S.right:S.left+t,S.bottom]]}}([n,c]))?!i&&r&&(o=window.setTimeout(m,40)):m()}}};return c.__options={blockPointerEvents:n},c}const Ko=be("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),Ho=be("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),qo=be("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);var Yo="light",Xo=function(e){var t=e.icon,n=void 0===t?null:t,r=e.theme,i=void 0===r?Yo:r,s=e.variant,a=void 0===s?"neutral":s,l="[&>svg]:h-5 [&>svg]:w-5",c="light"===i?"text-icon-secondary":"text-icon-inverse";if(n&&(0,o.isValidElement)(n))return(0,o.cloneElement)(n,{className:te(l,c,n.props.className)});switch(a){case"neutral":return React.createElement(Ko,{className:te(l,c)});case"info":var u="light"===i?"text-support-info":"text-support-info-inverse";return React.createElement(Ko,{className:te(l,u)});case"success":var d="light"===i?"text-support-success":"text-support-success-inverse";return React.createElement(we,{className:te(l,d)});case"warning":var f="light"===i?"text-support-warning":"text-support-warning-inverse";return React.createElement(Ho,{className:te(l,f)});case"error":var h="light"===i?"text-support-error":"text-support-error-inverse";return React.createElement(qo,{className:te(l,h)});default:return null}},Go=function(e){var t=e.actionType,n=void 0===t?"button":t,r=e.onAction,o=void 0===r?function(){}:r,i=e.actionLabel,s=void 0===i?"":i,a=e.theme,l=void 0===a?Yo:a,c="focus:ring-0 focus:ring-offset-0 ring-offset-0 focus:outline-none",u="text-button-primary border-button-primary hover:border-button-primary hover:text-button-primary-hover";switch("dark"===l&&(u="text-text-inverse border-text-inverse hover:border-text-inverse hover:text-text-inverse"),n){case"button":return React.createElement(ae,{variant:"outline",size:"xs",onClick:o,className:te("rounded",c,u,"dark"===l?"bg-transparent hover:bg-transparent":"bg-white hover:bg-white")},s);case"link":return React.createElement(ae,{variant:"link",size:"xs",onClick:o,className:te(c,u)},s);default:return null}},Jo=function(e){var t=e.theme,n=void 0===t?Yo:t,r=e.title,o=void 0===r?"":r;return!o&&isNaN(o)?null:React.createElement("span",{className:te("block",{light:"text-text-primary",dark:"text-text-inverse"}[n],"text-sm leading-5 font-semibold")},o)},Zo=function(e){var t=e.theme,n=void 0===t?Yo:t,r=e.content,o=void 0===r?"":r;return!o&&isNaN(o)?null:React.createElement("span",{className:te({light:"text-text-primary",dark:"text-text-inverse"}[n],"block text-sm [&_*]:text-sm leading-5 [&_*]:leading-5 font-normal")},o)},Qo=function(){for(var e=arguments.length,t=new Array(e),n=0;ne.length)&&(t=e.length);for(var n=0,r=Array(t);n{})),C=o.useCallback((()=>{var e;const t=null==(e=i.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}),[i]);o.useEffect((()=>{if(l)return s.on("openchange",e),()=>{s.off("openchange",e)};function e(e){let{open:t}=e;t||(clearTimeout(x.current),clearTimeout(_.current),E.current=!0)}}),[l,s]),o.useEffect((()=>{if(!l)return;if(!g.current)return;if(!n)return;function e(e){C()&&r(!1,e,"hover")}const t=Wt(a.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[a.floating,n,r,l,g,C]);const T=o.useCallback((function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const o=Ur(v.current,"close",b.current);o&&!w.current?(clearTimeout(x.current),x.current=window.setTimeout((()=>r(!1,e,n)),o)):t&&(clearTimeout(x.current),r(!1,e,n))}),[v,r]),P=pr((()=>{k.current(),w.current=void 0})),R=pr((()=>{if(S.current){const e=Wt(a.floating).body;e.style.pointerEvents="",e.removeAttribute(Wr),S.current=!1}}));o.useEffect((()=>{if(l&&vt(a.domReference)){var e;const t=a.domReference;return n&&t.addEventListener("mouseleave",c),null==(e=a.floating)||e.addEventListener("mouseleave",c),h&&t.addEventListener("mousemove",o,{once:!0}),t.addEventListener("mouseenter",o),t.addEventListener("mouseleave",s),()=>{var e;n&&t.removeEventListener("mouseleave",c),null==(e=a.floating)||e.removeEventListener("mouseleave",c),h&&t.removeEventListener("mousemove",o),t.removeEventListener("mouseenter",o),t.removeEventListener("mouseleave",s)}}function t(){return!!i.current.openEvent&&["click","mousedown"].includes(i.current.openEvent.type)}function o(e){if(clearTimeout(x.current),E.current=!1,d&&!Vt(b.current)||f>0&&!Ur(v.current,"open"))return;const t=Ur(v.current,"open",b.current);t?x.current=window.setTimeout((()=>{y.current||r(!0,e,"hover")}),t):r(!0,e,"hover")}function s(e){if(t())return;k.current();const r=Wt(a.floating);if(clearTimeout(_.current),g.current&&i.current.floatingContext){n||clearTimeout(x.current),w.current=g.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){R(),P(),T(e,!0,"safe-polygon")}});const t=w.current;return r.addEventListener("mousemove",t),void(k.current=()=>{r.removeEventListener("mousemove",t)})}("touch"!==b.current||!jt(a.floating,e.relatedTarget))&&T(e)}function c(e){t()||i.current.floatingContext&&(null==g.current||g.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){R(),P(),T(e)}})(e))}}),[a,l,e,d,f,h,T,P,R,r,n,y,p,v,g,i]),Rr((()=>{var e;if(l&&n&&null!=(e=g.current)&&e.__options.blockPointerEvents&&C()){S.current=!0;const e=a.floating;if(vt(a.domReference)&&e){var t;const n=Wt(a.floating).body;n.setAttribute(Wr,"");const r=a.domReference,o=null==p||null==(t=p.nodesRef.current.find((e=>e.id===m)))||null==(t=t.context)?void 0:t.elements.floating;return o&&(o.style.pointerEvents=""),n.style.pointerEvents="none",r.style.pointerEvents="auto",e.style.pointerEvents="auto",()=>{n.style.pointerEvents="",r.style.pointerEvents="",e.style.pointerEvents=""}}}}),[l,n,m,a,p,g,C]),Rr((()=>{n||(b.current=void 0,P(),R())}),[n,P,R]),o.useEffect((()=>()=>{P(),clearTimeout(x.current),clearTimeout(_.current),R()}),[l,a.domReference,P,R]);const O=o.useMemo((()=>{function e(e){b.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function o(){E.current||y.current||r(!0,t,"hover")}d&&!Vt(b.current)||n||0===f||(clearTimeout(_.current),"touch"===b.current?o():_.current=window.setTimeout(o,f))}}}),[d,r,n,y,f]),N=o.useMemo((()=>({onMouseEnter(){clearTimeout(x.current)},onMouseLeave(e){T(e.nativeEvent,!1)}})),[T]);return o.useMemo((()=>l?{reference:O,floating:N}:{}),[l,O,N])}(W,ri({move:!1,enabled:!M&&N.includes("hover")},j&&{handleClose:$o()})),K=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,events:i,dataRef:s,elements:a}=e,{enabled:l=!0,visibleOnly:c=!0}=t,u=o.useRef(!1),d=o.useRef(),f=o.useRef(!0);o.useEffect((()=>{if(!l)return;const e=pt(a.domReference);function t(){!n&&yt(a.domReference)&&a.domReference===At(Wt(a.domReference))&&(u.current=!0)}function r(){f.current=!0}return e.addEventListener("blur",t),e.addEventListener("keydown",r,!0),()=>{e.removeEventListener("blur",t),e.removeEventListener("keydown",r,!0)}}),[a.domReference,n,l]),o.useEffect((()=>{if(l)return i.on("openchange",e),()=>{i.off("openchange",e)};function e(e){let{reason:t}=e;"reference-press"!==t&&"escape-key"!==t||(u.current=!0)}}),[i,l]),o.useEffect((()=>()=>{clearTimeout(d.current)}),[]);const h=o.useMemo((()=>({onPointerDown(e){Lt(e.nativeEvent)||(f.current=!1)},onMouseLeave(){u.current=!1},onFocus(e){if(u.current)return;const t=$t(e.nativeEvent);if(c&&vt(t))try{if(Ft()&&Bt())throw Error();if(!t.matches(":focus-visible"))return}catch(e){if(!f.current&&!Ht(t))return}r(!0,e.nativeEvent,"focus")},onBlur(e){u.current=!1;const t=e.relatedTarget,n=e.nativeEvent,o=vt(t)&&t.hasAttribute(Br("focus-guard"))&&"outside"===t.getAttribute("data-type");d.current=window.setTimeout((()=>{var e;const i=At(a.domReference?a.domReference.ownerDocument:document);(t||i!==a.domReference)&&(jt(null==(e=s.current.floatingContext)?void 0:e.refs.floating.current,i)||jt(a.domReference,i)||o||r(!1,n,"focus"))}))}})),[s,a.domReference,r,c]);return o.useMemo((()=>l?{reference:h}:{}),[l,h])}(W,{enabled:!M&&N.includes("focus")}),H=Ao([U,$,K,To(W),Bo(W,{role:"tooltip"})]),q=H.getReferenceProps,Y=H.getFloatingProps,X=function(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:r,close:i,common:s,duration:a=250}=t,l=e.placement,c=l.split("-")[0],u=o.useMemo((()=>({side:c,placement:l})),[c,l]),d="number"==typeof a,f=(d?a:a.open)||0,h=(d?a:a.close)||0,[p,m]=o.useState((()=>({...Wo(s,u),...Wo(n,u)}))),{isMounted:g,status:v}=function(e,t){void 0===t&&(t={});const{open:n,elements:{floating:r}}=e,{duration:i=250}=t,s=("number"==typeof i?i:i.close)||0,[a,l]=o.useState("unmounted"),c=function(e,t){const[n,r]=o.useState(e);return e&&!n&&r(!0),o.useEffect((()=>{if(!e&&n){const e=setTimeout((()=>r(!1)),t);return()=>clearTimeout(e)}}),[e,n,t]),n}(n,s);return c||"close"!==a||l("unmounted"),Rr((()=>{if(r){if(n){l("initial");const e=requestAnimationFrame((()=>{l("open")}));return()=>{cancelAnimationFrame(e)}}l("close")}}),[n,r]),{isMounted:c,status:a}}(e,{duration:a}),y=Vr(n),b=Vr(r),x=Vr(i),w=Vr(s);return Rr((()=>{const e=Wo(y.current,u),t=Wo(x.current,u),n=Wo(w.current,u),r=Wo(b.current,u)||Object.keys(e).reduce(((e,t)=>(e[t]="",e)),{});if("initial"===v&&m((t=>({transitionProperty:t.transitionProperty,...n,...e}))),"open"===v&&m({transitionProperty:Object.keys(r).map(Vo).join(","),transitionDuration:f+"ms",...n,...r}),"close"===v){const r=t||e;m({transitionProperty:Object.keys(r).map(Vo).join(","),transitionDuration:h+"ms",...n,...r})}}),[h,x,y,b,w,f,v,u]),{isMounted:g,styles:p}}(W,{duration:150,initial:{opacity:0},open:{opacity:1},close:{opacity:0}}),G=X.isMounted,J=X.styles,Z=null===(t={light:"bg-tooltip-background-light text-text-primary",dark:"bg-tooltip-background-dark text-text-on-color"})||void 0===t?void 0:t[l],Q="dark"===l?"text-tooltip-background-dark":"text-tooltip-background-light";return i().createElement(i().Fragment,null,(0,o.isValidElement)(y)&&(0,o.cloneElement)(y,ri(ri({},y.props),{},{ref:Qo(y.ref,B.setReference),className:te(y.props.className)},q())),i().createElement(uo,{id:E,root:w},G&&i().createElement("div",ti({className:te("absolute z-20 py-2 px-3 rounded-md text-xs leading-4 shadow-soft-shadow-lg",Z,"max-w-80 w-fit",b),ref:B.setFloating,style:ri(ri({},V),J)},Y()),i().createElement("div",null,!!f&&i().createElement("span",{className:"font-semibold"},f),!!h&&i().createElement("div",{className:"font-normal"},h)),m&&i().createElement(Ir,{ref:F,context:W,placement:u,className:te("fill-current",Q)}))))},ai=["slug","text","icon","className","disabled","isFirstChild","isLastChild"];function li(){return li=Object.assign?Object.assign.bind():function(e){for(var t=1;tsvg]:h-4 [&>svg]:w-4",sm:"py-2 px-2 text-base gap-1 [&>svg]:h-4 [&>svg]:w-4",md:"py-2.5 px-2.5 text-base gap-1 [&>svg]:h-5 [&>svg]:w-5"}[g],"border-0 border-r border-border-subtle border-solid",p===r?"bg-button-disabled":"",d?"rounded-tl rounded-bl border-0 border-r border-border-subtle":"",f?"rounded-tr rounded-br border-0":"",l);return i().createElement("button",li({ref:t,className:y,disabled:u,onClick:function(e){m(e,{slug:r,text:s})}},h),"left"===v&&a&&i().createElement("span",{className:"mr-1"},a),s,"right"===v&&a&&i().createElement("span",{className:"ml-1"},a))},di=(0,o.forwardRef)(ui);di.displayName="Button";var fi={Group:function(e){var t=e.children,n=e.activeItem,r=void 0===n?null:n,s=e.onChange,a=e.className,l=e.size,c=void 0===l?"md":l,u=e.iconPosition,d=void 0===u?"left":u,f=(0,o.useCallback)((function(e,t){s&&s({event:e,value:t})}),[s]),h=te("box-border flex border border-border-subtle border-solid rounded",a);return i().createElement("div",{className:h},i().createElement(ci.Provider,{value:{activeItem:r,onChange:f,size:c,iconPosition:d}},i().Children.map(t,(function(e,n){if(!(0,o.isValidElement)(e))return null;var r=0===n,s=n===i().Children.count(t)-1;return i().cloneElement(e,{index:n,isFirstChild:r,isLastChild:s})}))))},Button:di},hi=fi;function pi(e){if("undefined"==typeof Proxy)return e;const t=new Map;return new Proxy(e,{get:(n,r)=>(t.has(r)||t.set(r,e(r)),t.get(r))})}function mi(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}const gi=e=>Array.isArray(e);function vi(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r{t[0][n]=e.get(),t[1][n]=e.getVelocity()})),t}function xi(e,t,n,r){if("function"==typeof t){const[o,i]=bi(r);t=t(void 0!==n?n:e.custom,o,i)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){const[o,i]=bi(r);t=t(void 0!==n?n:e.custom,o,i)}return t}function wi(e,t,n){const r=e.getProps();return xi(r,t,void 0!==n?n:r.custom,e)}const _i=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ei=["initial",..._i],Si=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ki=new Set(Si),Ci=e=>1e3*e,Ti=e=>e/1e3,Pi={type:"spring",stiffness:500,damping:25,restSpeed:10},Ri={type:"keyframes",duration:.8},Oi={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Ni=(e,{keyframes:t})=>t.length>2?Ri:ki.has(e)?e.startsWith("scale")?{type:"spring",stiffness:550,damping:0===t[1]?2*Math.sqrt(550):30,restSpeed:10}:Pi:Oi;function Ai(e,t){return e[t]||e.default||e}const ji=e=>null!==e;function Mi(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(ji),i=t&&"loop"!==n&&t%2==1?0:o.length-1;return i&&void 0!==r?r:o[i]}const Ii=e=>e,Di=["read","resolveKeyframes","update","preRender","render","postRender"];function Li(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,s=Di.reduce(((e,t)=>(e[t]=function(e){let t=new Set,n=new Set,r=!1,o=!1;const i=new WeakSet;let s={delta:0,timestamp:0,isProcessing:!1};function a(t){i.has(t)&&(l.schedule(t),e()),t(s)}const l={schedule:(e,o=!1,s=!1)=>{const a=s&&r?t:n;return o&&i.add(e),a.has(e)||a.add(e),e},cancel:e=>{n.delete(e),i.delete(e)},process:e=>{s=e,r?o=!0:(r=!0,[t,n]=[n,t],n.clear(),t.forEach(a),r=!1,o&&(o=!1,l.process(e)))}};return l}(i),e)),{}),{read:a,resolveKeyframes:l,update:c,preRender:u,render:d,postRender:f}=s,h=()=>{const i=performance.now();n=!1,o.delta=r?1e3/60:Math.max(Math.min(i-o.timestamp,40),1),o.timestamp=i,o.isProcessing=!0,a.process(o),l.process(o),c.process(o),u.process(o),d.process(o),f.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(h))};return{schedule:Di.reduce(((t,i)=>{const a=s[i];return t[i]=(t,i=!1,s=!1)=>(n||(n=!0,r=!0,o.isProcessing||e(h)),a.schedule(t,i,s)),t}),{}),cancel:e=>{for(let t=0;t/^0[^.\s]+$/u.test(e);let Ui=Ii,$i=Ii;const Ki=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Hi=e=>t=>"string"==typeof t&&t.startsWith(e),qi=Hi("--"),Yi=Hi("var(--"),Xi=e=>!!Yi(e)&&Gi.test(e.split("/*")[0].trim()),Gi=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Ji=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Zi(e,t,n=1){$i(n<=4,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,o]=function(e){const t=Ji.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${null!=n?n:r}`,o]}(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const e=i.trim();return Ki(e)?parseFloat(e):e}return Xi(o)?Zi(o,t,n+1):o}const Qi=(e,t,n)=>n>t?t:n"number"==typeof e,parse:parseFloat,transform:e=>e},ts={...es,transform:e=>Qi(0,1,e)},ns={...es,default:1},rs=e=>Math.round(1e5*e)/1e5,os=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,is=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,ss=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;function as(e){return"string"==typeof e}const ls=e=>({test:t=>as(t)&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),cs=ls("deg"),us=ls("%"),ds=ls("px"),fs=ls("vh"),hs=ls("vw"),ps={...us,parse:e=>us.parse(e)/100,transform:e=>us.transform(100*e)},ms=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),gs=e=>e===es||e===ds,vs=(e,t)=>parseFloat(e.split(", ")[t]),ys=(e,t)=>(n,{transform:r})=>{if("none"===r||!r)return 0;const o=r.match(/^matrix3d\((.+)\)$/u);if(o)return vs(o[1],t);{const t=r.match(/^matrix\((.+)\)$/u);return t?vs(t[1],e):0}},bs=new Set(["x","y","z"]),xs=Si.filter((e=>!bs.has(e))),ws={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:ys(4,13),y:ys(5,14)};ws.translateX=ws.x,ws.translateY=ws.y;const _s=e=>t=>t.test(e),Es=[es,ds,us,cs,hs,fs,{test:e=>"auto"===e,parse:e=>e}],Ss=e=>Es.find(_s(e)),ks=new Set;let Cs=!1,Ts=!1;function Ps(){if(Ts){const e=Array.from(ks).filter((e=>e.needsMeasurement)),t=new Set(e.map((e=>e.element))),n=new Map;t.forEach((e=>{const t=function(e){const t=[];return xs.forEach((n=>{const r=e.getValue(n);void 0!==r&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))})),t}(e);t.length&&(n.set(e,t),e.render())})),e.forEach((e=>e.measureInitialState())),t.forEach((e=>{e.render();const t=n.get(e);t&&t.forEach((([t,n])=>{var r;null===(r=e.getValue(t))||void 0===r||r.set(n)}))})),e.forEach((e=>e.measureEndState())),e.forEach((e=>{void 0!==e.suspendedScrollY&&window.scrollTo(0,e.suspendedScrollY)}))}Ts=!1,Cs=!1,ks.forEach((e=>e.complete())),ks.clear()}function Rs(){ks.forEach((e=>{e.readKeyframes(),e.needsMeasurement&&(Ts=!0)}))}class Os{constructor(e,t,n,r,o,i=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=o,this.isAsync=i}scheduleResolve(){this.isScheduled=!0,this.isAsync?(ks.add(this),Cs||(Cs=!0,Fi.read(Rs),Fi.resolveKeyframes(Ps))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;for(let o=0;on=>Boolean(as(n)&&ss.test(n)&&n.startsWith(e)||t&&!function(e){return null==e}(n)&&Object.prototype.hasOwnProperty.call(n,t)),As=(e,t,n)=>r=>{if(!as(r))return r;const[o,i,s,a]=r.match(os);return{[e]:parseFloat(o),[t]:parseFloat(i),[n]:parseFloat(s),alpha:void 0!==a?parseFloat(a):1}},js={...es,transform:e=>Math.round((e=>Qi(0,255,e))(e))},Ms={test:Ns("rgb","red"),parse:As("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+js.transform(e)+", "+js.transform(t)+", "+js.transform(n)+", "+rs(ts.transform(r))+")"},Is={test:Ns("#"),parse:function(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}},transform:Ms.transform},Ds={test:Ns("hsl","hue"),parse:As("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+us.transform(rs(t))+", "+us.transform(rs(n))+", "+rs(ts.transform(r))+")"},Ls={test:e=>Ms.test(e)||Is.test(e)||Ds.test(e),parse:e=>Ms.test(e)?Ms.parse(e):Ds.test(e)?Ds.parse(e):Is.parse(e),transform:e=>as(e)?e:e.hasOwnProperty("red")?Ms.transform(e):Ds.transform(e)},Fs="number",zs="color",Bs="var",Vs="var(",Ws="${}",Us=/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 $s(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let i=0;const s=t.replace(Us,(e=>(Ls.test(e)?(r.color.push(i),o.push(zs),n.push(Ls.parse(e))):e.startsWith(Vs)?(r.var.push(i),o.push(Bs),n.push(e)):(r.number.push(i),o.push(Fs),n.push(parseFloat(e))),++i,Ws))).split(Ws);return{values:n,split:s,indexes:r,types:o}}function Ks(e){return $s(e).values}function Hs(e){const{split:t,types:n}=$s(e),r=t.length;return e=>{let o="";for(let i=0;i"number"==typeof e?0:e,Ys={test:function(e){var t,n;return isNaN(e)&&as(e)&&((null===(t=e.match(os))||void 0===t?void 0:t.length)||0)+((null===(n=e.match(is))||void 0===n?void 0:n.length)||0)>0},parse:Ks,createTransformer:Hs,getAnimatableNone:function(e){const t=Ks(e);return Hs(e)(t.map(qs))}},Xs=new Set(["brightness","contrast","saturate","opacity"]);function Gs(e){const[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[r]=n.match(os)||[];if(!r)return e;const o=n.replace(r,"");let i=Xs.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+o+")"}const Js=/\b([a-z-]*)\(.*?\)/gu,Zs={...Ys,getAnimatableNone:e=>{const t=e.match(Js);return t?t.map(Gs).join(" "):e}},Qs={...es,transform:Math.round},ea={borderWidth:ds,borderTopWidth:ds,borderRightWidth:ds,borderBottomWidth:ds,borderLeftWidth:ds,borderRadius:ds,radius:ds,borderTopLeftRadius:ds,borderTopRightRadius:ds,borderBottomRightRadius:ds,borderBottomLeftRadius:ds,width:ds,maxWidth:ds,height:ds,maxHeight:ds,size:ds,top:ds,right:ds,bottom:ds,left:ds,padding:ds,paddingTop:ds,paddingRight:ds,paddingBottom:ds,paddingLeft:ds,margin:ds,marginTop:ds,marginRight:ds,marginBottom:ds,marginLeft:ds,rotate:cs,rotateX:cs,rotateY:cs,rotateZ:cs,scale:ns,scaleX:ns,scaleY:ns,scaleZ:ns,skew:cs,skewX:cs,skewY:cs,distance:ds,translateX:ds,translateY:ds,translateZ:ds,x:ds,y:ds,z:ds,perspective:ds,transformPerspective:ds,opacity:ts,originX:ps,originY:ps,originZ:ds,zIndex:Qs,backgroundPositionX:ds,backgroundPositionY:ds,fillOpacity:ts,strokeOpacity:ts,numOctaves:Qs},ta={...ea,color:Ls,backgroundColor:Ls,outlineColor:Ls,fill:Ls,stroke:Ls,borderColor:Ls,borderTopColor:Ls,borderRightColor:Ls,borderBottomColor:Ls,borderLeftColor:Ls,filter:Zs,WebkitFilter:Zs},na=e=>ta[e];function ra(e,t){let n=na(e);return n!==Zs&&(n=Ys),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const oa=new Set(["auto","none","0"]);class ia extends Os{constructor(e,t,n,r,o){super(e,t,n,r,o,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n{t.getValue(e).set(n)})),this.resolveNoneKeyframes()}}function sa(e){let t;return()=>(void 0===t&&(t=e()),t)}let aa;function la(){aa=void 0}const ca={now:()=>(void 0===aa&&ca.set(Bi.isProcessing?Bi.timestamp:performance.now()),aa),set:e=>{aa=e,queueMicrotask(la)}},ua=(e,t)=>!("zIndex"===t||"number"!=typeof e&&!Array.isArray(e)&&("string"!=typeof e||!Ys.test(e)&&"0"!==e||e.startsWith("url(")));class da{constructor({autoplay:e=!0,delay:t=0,type:n="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:i="loop",...s}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=ca.now(),this.options={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:o,repeatType:i,...s},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return this._resolved||this.hasAttemptedResolve||(Rs(),Ps()),this._resolved}onKeyframesResolved(e,t){this.resolvedAt=ca.now(),this.hasAttemptedResolve=!0;const{name:n,type:r,velocity:o,delay:i,onComplete:s,onUpdate:a,isGenerator:l}=this.options;if(!l&&!function(e,t,n,r){const o=e[0];if(null===o)return!1;if("display"===t||"visibility"===t)return!0;const i=e[e.length-1],s=ua(o,t),a=ua(i,t);return Ui(s===a,`You are trying to animate ${t} from "${o}" to "${i}". ${o} is not an animatable value - to enable this animation set ${o} to a value animatable to ${i} via the \`style\` property.`),!(!s||!a)&&(function(e){const t=e[0];if(1===e.length)return!0;for(let n=0;n{this.resolveFinishedPromise=e}))}}function fa(e,t){return t?e*(1e3/t):0}const ha=5;function pa(e,t,n){const r=Math.max(t-ha,0);return fa(n-e(r),t-r)}const ma=.001,ga=.01,va=10,ya=.05,ba=1;const xa=12;function wa(e,t){return e*Math.sqrt(1-t*t)}const _a=["duration","bounce"],Ea=["stiffness","damping","mass"];function Sa(e,t){return t.some((t=>void 0!==e[t]))}function ka({keyframes:e,restDelta:t,restSpeed:n,...r}){const o=e[0],i=e[e.length-1],s={done:!1,value:o},{stiffness:a,damping:l,mass:c,duration:u,velocity:d,isResolvedFromDuration:f}=function(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!Sa(e,Ea)&&Sa(e,_a)){const n=function({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let o,i;Ui(e<=Ci(va),"Spring duration must be 10 seconds or less");let s=1-t;s=Qi(ya,ba,s),e=Qi(ga,va,Ti(e)),s<1?(o=t=>{const r=t*s,o=r*e,i=r-n,a=wa(t,s),l=Math.exp(-o);return ma-i/a*l},i=t=>{const r=t*s*e,i=r*n+n,a=Math.pow(s,2)*Math.pow(t,2)*e,l=Math.exp(-r),c=wa(Math.pow(t,2),s);return(-o(t)+ma>0?-1:1)*((i-a)*l)/c}):(o=t=>Math.exp(-t*e)*((t-n)*e+1)-ma,i=t=>Math.exp(-t*e)*(e*e*(n-t)));const a=function(e,t,n){let r=n;for(let n=1;n{const n=Math.exp(-p*g*t);return i-n*((h+p*g*m)/e*Math.sin(e*t)+m*Math.cos(e*t))}}else if(1===p)y=e=>i-Math.exp(-g*e)*(m+(h+g*m)*e);else{const e=g*Math.sqrt(p*p-1);y=t=>{const n=Math.exp(-p*g*t),r=Math.min(e*t,300);return i-n*((h+p*g*m)*Math.sinh(r)+e*m*Math.cosh(r))/e}}return{calculatedDuration:f&&u||null,next:e=>{const r=y(e);if(f)s.done=e>=u;else{let o=0;p<1&&(o=0===e?Ci(h):pa(y,e,r));const a=Math.abs(o)<=n,l=Math.abs(i-r)<=t;s.done=a&&l}return s.value=s.done?i:r,s}}}function Ca({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 d=e[0],f={done:!1,value:d},h=e=>void 0===a?l:void 0===l||Math.abs(a-e)-p*Math.exp(-e/r),y=e=>g+v(e),b=e=>{const t=v(e),n=y(e);f.done=Math.abs(t)<=c,f.value=f.done?g:n};let x,w;const _=e=>{(e=>void 0!==a&&el)(f.value)&&(x=e,w=ka({keyframes:[f.value,h(f.value)],velocity:pa(y,e,f.value),damping:o,stiffness:i,restDelta:c,restSpeed:u}))};return _(0),{calculatedDuration:null,next:e=>{let t=!1;return w||void 0!==x||(t=!0,b(e),_(e)),void 0!==x&&e>=x?w.next(e-x):(!t&&b(e),f)}}}const Ta=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function Pa(e,t,n,r){if(e===t&&n===r)return Ii;return o=>0===o||1===o?o:Ta(function(e,t,n,r,o){let i,s,a=0;do{s=t+(n-t)/2,i=Ta(s,r,o)-e,i>0?n=s:t=s}while(Math.abs(i)>1e-7&&++a<12);return s}(o,0,1,e,n),t,r)}const Ra=Pa(.42,0,1,1),Oa=Pa(0,0,.58,1),Na=Pa(.42,0,.58,1),Aa=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,ja=e=>t=>1-e(1-t),Ma=e=>1-Math.sin(Math.acos(e)),Ia=ja(Ma),Da=Aa(Ma),La=Pa(.33,1.53,.69,.99),Fa=ja(La),za=Aa(Fa),Ba={linear:Ii,easeIn:Ra,easeInOut:Na,easeOut:Oa,circIn:Ma,circInOut:Da,circOut:Ia,backIn:Fa,backInOut:za,backOut:La,anticipate:e=>(e*=2)<1?.5*Fa(e):.5*(2-Math.pow(2,-10*(e-1)))},Va=e=>{if(Array.isArray(e)){$i(4===e.length,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,o]=e;return Pa(t,n,r,o)}return"string"==typeof e?($i(void 0!==Ba[e],`Invalid easing type '${e}'`),Ba[e]):e},Wa=(e,t)=>n=>t(e(n)),Ua=(...e)=>e.reduce(Wa),$a=(e,t,n)=>{const r=t-e;return 0===r?1:(n-e)/r},Ka=(e,t,n)=>e+(t-e)*n;function Ha(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function qa(e,t){return n=>n>0?t:e}const Ya=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},Xa=[Is,Ms,Ds];function Ga(e){const t=(e=>Xa.find((t=>t.test(e))))(e);if(Ui(Boolean(t),`'${e}' is not an animatable color. Use the equivalent color code instead.`),!Boolean(t))return!1;let n=t.parse(e);return t===Ds&&(n=function({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,n/=100;let o=0,i=0,s=0;if(t/=100){const r=n<.5?n*(1+t):n+t-n*t,a=2*n-r;o=Ha(a,r,e+1/3),i=Ha(a,r,e),s=Ha(a,r,e-1/3)}else o=i=s=n;return{red:Math.round(255*o),green:Math.round(255*i),blue:Math.round(255*s),alpha:r}}(n)),n}const Ja=(e,t)=>{const n=Ga(e),r=Ga(t);if(!n||!r)return qa(e,t);const o={...n};return e=>(o.red=Ya(n.red,r.red,e),o.green=Ya(n.green,r.green,e),o.blue=Ya(n.blue,r.blue,e),o.alpha=Ka(n.alpha,r.alpha,e),Ms.transform(o))},Za=new Set(["none","hidden"]);function Qa(e,t){return n=>Ka(e,t,n)}function el(e){return"number"==typeof e?Qa:"string"==typeof e?Xi(e)?qa:Ls.test(e)?Ja:rl:Array.isArray(e)?tl:"object"==typeof e?Ls.test(e)?Ja:nl:qa}function tl(e,t){const n=[...e],r=n.length,o=e.map(((e,n)=>el(e)(e,t[n])));return e=>{for(let t=0;t{for(const t in r)n[t]=r[t](e);return n}}const rl=(e,t)=>{const n=Ys.createTransformer(t),r=$s(e),o=$s(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?Za.has(e)&&!o.values.length||Za.has(t)&&!r.values.length?function(e,t){return Za.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}(e,t):Ua(tl(function(e,t){var n;const r=[],o={color:0,var:0,number:0};for(let i=0;iArray.isArray(e)&&"number"!=typeof e[0])(r)?r.map(Va):Va(r),i={done:!1,value:t[0]},s=function(e,t){return e.map((e=>e*t))}(n&&n.length===t.length?n:function(e){const t=[0];return function(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=$a(0,t,r);e.push(Ka(n,1,o))}}(t,e.length-1),t}(t),e),a=function(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const i=e.length;if($i(i===t.length,"Both input and output ranges must be the same length"),1===i)return()=>t[0];if(2===i&&e[0]===e[1])return()=>t[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=function(e,t,n){const r=[],o=n||ol,i=e.length-1;for(let n=0;n{let n=0;if(a>1)for(;nl(Qi(e[0],e[i-1],t)):l}(s,t,{ease:Array.isArray(o)?o:(l=t,c=o,l.map((()=>c||Na)).splice(0,l.length-1))});var l,c;return{calculatedDuration:e,next:t=>(i.value=a(t),i.done=t>=e,i)}}const sl=e=>{const t=({timestamp:t})=>e(t);return{start:()=>Fi.update(t,!0),stop:()=>zi(t),now:()=>Bi.isProcessing?Bi.timestamp:ca.now()}},al={decay:Ca,inertia:Ca,tween:il,keyframes:il,spring:ka},ll=e=>e/100;class cl extends da{constructor(e){super(e),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:e}=this.options;e&&e()};const{name:t,motionValue:n,element:r,keyframes:o}=this.options,i=(null==r?void 0:r.KeyframeResolver)||Os;this.resolver=new i(o,((e,t)=>this.onKeyframesResolved(e,t)),t,n,r),this.resolver.scheduleResolve()}initPlayback(e){const{type:t="keyframes",repeat:n=0,repeatDelay:r=0,repeatType:o,velocity:i=0}=this.options,s=al[t]||il;let a,l;s!==il&&"number"!=typeof e[0]&&(a=Ua(ll,ol(e[0],e[1])),e=[0,100]);const c=s({...this.options,keyframes:e});"mirror"===o&&(l=s({...this.options,keyframes:[...e].reverse(),velocity:-i})),null===c.calculatedDuration&&(c.calculatedDuration=function(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}(c));const{calculatedDuration:u}=c,d=u+r;return{generator:c,mirroredGenerator:l,mapPercentToKeyframes:a,calculatedDuration:u,resolvedDuration:d,totalDuration:d*(n+1)-r}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&e?this.state=this.pendingPlayState:this.pause()}tick(e,t=!1){const{resolved:n}=this;if(!n){const{keyframes:e}=this.options;return{done:!0,value:e[e.length-1]}}const{finalKeyframe:r,generator:o,mirroredGenerator:i,mapPercentToKeyframes:s,keyframes:a,calculatedDuration:l,totalDuration:c,resolvedDuration:u}=n;if(null===this.startTime)return o.next(0);const{delay:d,repeat:f,repeatType:h,repeatDelay:p,onUpdate:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-c/this.speed,this.startTime)),t?this.currentTime=e:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const g=this.currentTime-d*(this.speed>=0?1:-1),v=this.speed>=0?g<0:g>c;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=c);let y=this.currentTime,b=o;if(f){const e=Math.min(this.currentTime,c)/u;let t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),1===n&&t--,t=Math.min(t,f+1),Boolean(t%2)&&("reverse"===h?(n=1-n,p&&(n-=p/u)):"mirror"===h&&(b=i)),y=Qi(0,1,n)*u}const x=v?{done:!1,value:a[0]}:b.next(y);s&&(x.value=s(x.value));let{done:w}=x;v||null===l||(w=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const _=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return _&&void 0!==r&&(x.value=Mi(a,this.options,r)),m&&m(x.value),_&&this.finish(),x}get duration(){const{resolved:e}=this;return e?Ti(e.calculatedDuration):0}get time(){return Ti(this.currentTime)}set time(e){e=Ci(e),this.currentTime=e,null!==this.holdTime||0===this.speed?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=Ti(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:e=sl,onPlay:t,startTime:n}=this.options;this.driver||(this.driver=e((e=>this.tick(e)))),t&&t();const r=this.driver.now();null!==this.holdTime?this.startTime=r-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=r):this.startTime=null!=n?n:this.calcStartTime(),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;this._resolved?(this.state="paused",this.holdTime=null!==(e=this.currentTime)&&void 0!==e?e:0):this.pendingPlayState="paused"}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}const ul=new Set(["opacity","clipPath","filter","transform"]),dl=e=>Array.isArray(e)&&"number"==typeof e[0];function fl(e){return Boolean(!e||"string"==typeof e&&e in pl||dl(e)||Array.isArray(e)&&e.every(fl))}const hl=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,pl={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:hl([0,.65,.55,1]),circOut:hl([.55,0,1,.45]),backIn:hl([.31,.01,.66,-.59]),backOut:hl([.33,1.53,.69,.99])};function ml(e){return gl(e)||pl.easeOut}function gl(e){return e?dl(e)?hl(e):Array.isArray(e)?e.map(ml):pl[e]:void 0}const vl=sa((()=>Object.hasOwnProperty.call(Element.prototype,"animate")));class yl extends da{constructor(e){super(e);const{name:t,motionValue:n,element:r,keyframes:o}=this.options;this.resolver=new ia(o,((e,t)=>this.onKeyframesResolved(e,t)),t,n,r),this.resolver.scheduleResolve()}initPlayback(e,t){var n;let{duration:r=300,times:o,ease:i,type:s,motionValue:a,name:l,startTime:c}=this.options;if(!(null===(n=a.owner)||void 0===n?void 0:n.current))return!1;if("spring"===(u=this.options).type||!fl(u.ease)){const{onComplete:t,onUpdate:n,motionValue:a,element:l,...c}=this.options,u=function(e,t){const n=new cl({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const o=[];let i=0;for(;!r.done&&i<2e4;)r=n.sample(i),o.push(r.value),i+=10;return{times:void 0,keyframes:o,duration:i-10,ease:"linear"}}(e,c);1===(e=u.keyframes).length&&(e[1]=e[0]),r=u.duration,o=u.times,i=u.ease,s="keyframes"}var u;const d=function(e,t,n,{delay:r=0,duration:o=300,repeat:i=0,repeatType:s="loop",ease:a,times:l}={}){const c={[t]:n};l&&(c.offset=l);const u=gl(a);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:r,duration:o,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:i+1,direction:"reverse"===s?"alternate":"normal"})}(a.owner.current,l,e,{...this.options,duration:r,times:o,ease:i});return d.startTime=null!=c?c:this.calcStartTime(),this.pendingTimeline?(d.timeline=this.pendingTimeline,this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:n}=this.options;a.set(Mi(e,this.options,t)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:r,times:o,type:s,ease:i,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:t}=e;return Ti(t)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:t}=e;return Ti(t.currentTime||0)}set time(e){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.currentTime=Ci(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:t}=e;return t.playbackRate}set speed(e){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:t}=e;return t.playState}get startTime(){const{resolved:e}=this;if(!e)return null;const{animation:t}=e;return t.startTime}attachTimeline(e){if(this._resolved){const{resolved:t}=this;if(!t)return Ii;const{animation:n}=t;n.timeline=e,n.onfinish=null}else this.pendingTimeline=e;return Ii}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:t}=e;"finished"===t.playState&&this.updateFinishedPromise(),t.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:t}=e;t.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:e}=this;if(!e)return;const{animation:t,keyframes:n,duration:r,type:o,ease:i,times:s}=e;if("idle"===t.playState||"finished"===t.playState)return;if(this.time){const{motionValue:e,onUpdate:t,onComplete:a,element:l,...c}=this.options,u=new cl({...c,keyframes:n,duration:r,type:o,ease:i,times:s,isGenerator:!0}),d=Ci(this.time);e.setWithVelocity(u.sample(d-10).value,u.sample(d).value,10)}const{onStop:a}=this.options;a&&a(),this.cancel()}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:t,name:n,repeatDelay:r,repeatType:o,damping:i,type:s}=e;return vl()&&n&&ul.has(n)&&t&&t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate&&!r&&"mirror"!==o&&0!==i&&"inertia"!==s}}const bl=sa((()=>void 0!==window.ScrollTimeline));class xl{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}then(e,t){return Promise.all(this.animations).then(e).catch(t)}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n{if(!bl()||!t.attachTimeline)return t.pause(),function(e,n){let r;const o=()=>{const{currentTime:e}=n,o=(null===e?0:e.value)/100;r!==o&&(e=>{t.time=t.duration*e})(o),r=o};return Fi.update(o,!0),()=>zi(o)}(0,e);t.attachTimeline(e)}));return()=>{t.forEach(((e,t)=>{e&&e(),this.animations[t].stop()}))}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let t=0;tt[e]()))}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}const wl=(e,t,n,r={},o,i,s)=>a=>{const l=Ai(r,e)||{},c=l.delay||r.delay||0;let{elapsed:u=0}=r;u-=Ci(c);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-u,onUpdate:e=>{t.set(e),l.onUpdate&&l.onUpdate(e)},onComplete:()=>{a(),l.onComplete&&l.onComplete(),s&&s()},onStop:s,name:e,motionValue:t,element:i?void 0:o};(function({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})(l)||(d={...d,...Ni(e,d)}),d.duration&&(d.duration=Ci(d.duration)),d.repeatDelay&&(d.repeatDelay=Ci(d.repeatDelay)),void 0!==d.from&&(d.keyframes[0]=d.from);let f=!1;if((!1===d.type||0===d.duration&&!d.repeatDelay)&&(d.duration=0,0===d.delay&&(f=!0)),f&&!i&&void 0!==t.get()){const e=Mi(d.keyframes,l);if(void 0!==e)return Fi.update((()=>{d.onUpdate(e),d.onComplete()})),new xl([])}return!i&&yl.supports(d)?new yl(d):new cl(d)},_l=e=>Boolean(e&&"object"==typeof e&&e.mix&&e.toValue),El=e=>gi(e)?e[e.length-1]||0:e;function Sl(e,t){-1===e.indexOf(t)&&e.push(t)}function kl(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Cl{constructor(){this.subscriptions=[]}add(e){return Sl(this.subscriptions,e),()=>kl(this.subscriptions,e)}notify(e,t,n){const r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](e,t,n);else for(let o=0;o{const n=ca.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),t&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){var t;this.current=e,this.updatedAt=ca.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=(t=this.current,!isNaN(parseFloat(t))))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new Cl);const n=this.events[e].add(t);return"change"===e?()=>{n(),Fi.read((()=>{this.events.change.getSize()||this.stop()}))}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){t&&this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e,t)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return Tl.current&&Tl.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=ca.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return fa(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise((t=>{this.hasAnimated=!0,this.animation=e(t),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.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Rl(e,t){return new Pl(e,t)}function Ol(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Rl(n))}const Nl=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Al="data-"+Nl("framerAppearId");function jl(e){return e.props[Al]}function Ml(e){return ki.has(e)?"transform":ul.has(e)?Nl(e):void 0}class Il extends Pl{constructor(){super(...arguments),this.output=[],this.counts=new Map}add(e){const t=Ml(e);if(!t)return;const n=this.counts.get(t)||0;this.counts.set(t,n+1),0===n&&(this.output.push(t),this.update());let r=!1;return()=>{if(r)return;r=!0;const e=this.counts.get(t)-1;this.counts.set(t,e),0===e&&(kl(this.output,t),this.update())}}update(){this.set(this.output.length?this.output.join(", "):"auto")}}const Dl=e=>Boolean(e&&e.getVelocity);function Ll(e,t){var n;if(!e.applyWillChange)return;let r=e.getValue("willChange");return r||(null===(n=e.props.style)||void 0===n?void 0:n.willChange)||(r=new Il("auto"),e.addValue("willChange",r)),o=r,Boolean(Dl(o)&&o.add)?r.add(t):void 0;var o}function Fl({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&!0!==t[n];return t[n]=!1,r}function zl(e,t,{delay:n=0,transitionOverride:r,type:o}={}){var i;let{transition:s=e.getDefaultTransition(),transitionEnd:a,...l}=t;r&&(s=r);const c=[],u=o&&e.animationState&&e.animationState.getState()[o];for(const t in l){const r=e.getValue(t,null!==(i=e.latestValues[t])&&void 0!==i?i:null),o=l[t];if(void 0===o||u&&Fl(u,t))continue;const a={delay:n,...Ai(s||{},t)};let d=!1;if(window.MotionHandoffAnimation){const n=jl(e);if(n){const e=window.MotionHandoffAnimation(n,t,Fi);null!==e&&(a.startTime=e,d=!0)}}r.start(wl(t,r,o,e.shouldReduceMotion&&ki.has(t)?{type:!1}:a,e,d,Ll(e,t)));const f=r.animation;f&&c.push(f)}return a&&Promise.all(c).then((()=>{Fi.update((()=>{a&&function(e,t){const n=wi(e,t);let{transitionEnd:r={},transition:o={},...i}=n||{};i={...i,...r};for(const t in i)Ol(e,t,El(i[t]))}(e,a)}))})),c}function Bl(e,t,n={}){var r;const o=wi(e,t,"exit"===n.type?null===(r=e.presenceContext)||void 0===r?void 0:r.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=o||{};n.transitionOverride&&(i=n.transitionOverride);const s=o?()=>Promise.all(zl(e,o,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(r=0)=>{const{delayChildren:o=0,staggerChildren:s,staggerDirection:a}=i;return function(e,t,n=0,r=0,o=1,i){const s=[],a=(e.variantChildren.size-1)*r,l=1===o?(e=0)=>e*r:(e=0)=>a-e*r;return Array.from(e.variantChildren).sort(Vl).forEach(((e,r)=>{e.notify("AnimationStart",t),s.push(Bl(e,t,{...i,delay:n+l(r)}).then((()=>e.notify("AnimationComplete",t))))})),Promise.all(s)}(e,t,o+r,s,a,n)}:()=>Promise.resolve(),{when:l}=i;if(l){const[e,t]="beforeChildren"===l?[s,a]:[a,s];return e().then((()=>t()))}return Promise.all([s(),a(n.delay)])}function Vl(e,t){return e.sortNodePosition(t)}const Wl=[..._i].reverse(),Ul=_i.length;function $l(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Kl(){return{animate:$l(!0),whileInView:$l(),whileHover:$l(),whileTap:$l(),whileDrag:$l(),whileFocus:$l(),exit:$l()}}class Hl{constructor(e){this.isMounted=!1,this.node=e}update(){}}let ql=0;const Yl={animation:{Feature:class extends Hl{constructor(e){super(e),e.animationState||(e.animationState=function(e){let t=function(e){return t=>Promise.all(t.map((({animation:t,options:n})=>function(e,t,n={}){let r;if(e.notify("AnimationStart",t),Array.isArray(t)){const o=t.map((t=>Bl(e,t,n)));r=Promise.all(o)}else if("string"==typeof t)r=Bl(e,t,n);else{const o="function"==typeof t?wi(e,t,n.custom):t;r=Promise.all(zl(e,o,n))}return r.then((()=>{e.notify("AnimationComplete",t)}))}(e,t,n))))}(e),n=Kl(),r=!0;const o=t=>(n,r)=>{var o;const i=wi(e,r,"exit"===t?null===(o=e.presenceContext)||void 0===o?void 0:o.custom:void 0);if(i){const{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function i(i){const s=e.getProps(),a=e.getVariantContext(!0)||{},l=[],c=new Set;let u={},d=1/0;for(let t=0;td&&v),w=!1;const _=Array.isArray(g)?g:[g];let E=_.reduce(o(p),{});!1===y&&(E={});const{prevResolvedValues:S={}}=m,k={...S,...E},C=t=>{x=!0,c.has(t)&&(w=!0,c.delete(t)),m.needsAnimating[t]=!0;const n=e.getValue(t);n&&(n.liveStyle=!1)};for(const e in k){const t=E[e],n=S[e];if(u.hasOwnProperty(e))continue;let r=!1;r=gi(t)&&gi(n)?!vi(t,n):t!==n,r?null!=t?C(e):c.add(e):void 0!==t&&c.has(e)?C(e):m.protectedKeys[e]=!0}m.prevProp=g,m.prevResolvedValues=E,m.isActive&&(u={...u,...E}),r&&e.blockInitialAnimation&&(x=!1),!x||b&&!w||l.push(..._.map((e=>({animation:e,options:{type:p}}))))}var f,h;if(c.size){const t={};c.forEach((n=>{const r=e.getBaseTarget(n),o=e.getValue(n);o&&(o.liveStyle=!0),t[n]=null!=r?r:null})),l.push({animation:t})}let p=Boolean(l.length);return!r||!1!==s.initial&&s.initial!==s.animate||e.manuallyAnimateOnMount||(p=!1),r=!1,p?t(l):Promise.resolve()}return{animateChanges:i,setActive:function(t,r){var o;if(n[t].isActive===r)return Promise.resolve();null===(o=e.variantChildren)||void 0===o||o.forEach((e=>{var n;return null===(n=e.animationState)||void 0===n?void 0:n.setActive(t,r)})),n[t].isActive=r;const s=i(t);for(const e in n)n[e].protectedKeys={};return s},setAnimateFunction:function(n){t=n(e)},getState:()=>n,reset:()=>{n=Kl(),r=!0}}}(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();mi(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),null===(e=this.unmountControls)||void 0===e||e.call(this)}}},exit:{Feature:class extends Hl{constructor(){super(...arguments),this.id=ql++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;const r=this.node.animationState.setActive("exit",!e);t&&!e&&r.then((()=>t(this.id)))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}}},Xl=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary;function Gl(e,t="page"){return{point:{x:e[`${t}X`],y:e[`${t}Y`]}}}const Jl=e=>t=>Xl(t)&&e(t,Gl(t));function Zl(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Ql(e,t,n,r){return Zl(e,t,Jl(n),r)}const ec=(e,t)=>Math.abs(e-t);class tc{constructor(e,t,{transformPagePoint:n,contextWindow:r,dragSnapToOrigin:o=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const e=oc(this.lastMoveEventInfo,this.history),t=null!==this.startEvent,n=function(e,t){const n=ec(e.x,t.x),r=ec(e.y,t.y);return Math.sqrt(n**2+r**2)}(e.offset,{x:0,y:0})>=3;if(!t&&!n)return;const{point:r}=e,{timestamp:o}=Bi;this.history.push({...r,timestamp:o});const{onStart:i,onMove:s}=this.handlers;t||(i&&i(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),s&&s(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=nc(t,this.transformPagePoint),Fi.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();const{onEnd:n,onSessionEnd:r,resumeAnimation:o}=this.handlers;if(this.dragSnapToOrigin&&o&&o(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const i=oc("pointercancel"===e.type?this.lastMoveEventInfo:nc(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,i),r&&r(e,i)},!Xl(e))return;this.dragSnapToOrigin=o,this.handlers=t,this.transformPagePoint=n,this.contextWindow=r||window;const i=nc(Gl(e),this.transformPagePoint),{point:s}=i,{timestamp:a}=Bi;this.history=[{...s,timestamp:a}];const{onSessionStart:l}=t;l&&l(e,oc(i,this.history)),this.removeListeners=Ua(Ql(this.contextWindow,"pointermove",this.handlePointerMove),Ql(this.contextWindow,"pointerup",this.handlePointerUp),Ql(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),zi(this.updatePoint)}}function nc(e,t){return t?{point:t(e.point)}:e}function rc(e,t){return{x:e.x-t.x,y:e.y-t.y}}function oc({point:e},t){return{point:e,delta:rc(e,sc(t)),offset:rc(e,ic(t)),velocity:ac(t,.1)}}function ic(e){return e[0]}function sc(e){return e[e.length-1]}function ac(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=sc(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>Ci(t)));)n--;if(!r)return{x:0,y:0};const i=Ti(o.timestamp-r.timestamp);if(0===i)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 lc(e){let t=null;return()=>null===t&&(t=e,()=>{t=null})}const cc=lc("dragHorizontal"),uc=lc("dragVertical");function dc(e){let t=!1;if("y"===e)t=uc();else if("x"===e)t=cc();else{const e=cc(),n=uc();e&&n?t=()=>{e(),n()}:(e&&e(),n&&n())}return t}function fc(){const e=dc(!0);return!e||(e(),!1)}function hc(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}const pc=.9999,mc=1.0001,gc=-.01,vc=.01;function yc(e){return e.max-e.min}function bc(e,t,n,r=.5){e.origin=r,e.originPoint=Ka(t.min,t.max,e.origin),e.scale=yc(n)/yc(t),e.translate=Ka(n.min,n.max,e.origin)-e.originPoint,(e.scale>=pc&&e.scale<=mc||isNaN(e.scale))&&(e.scale=1),(e.translate>=gc&&e.translate<=vc||isNaN(e.translate))&&(e.translate=0)}function xc(e,t,n,r){bc(e.x,t.x,n.x,r?r.originX:void 0),bc(e.y,t.y,n.y,r?r.originY:void 0)}function wc(e,t,n){e.min=n.min+t.min,e.max=e.min+yc(t)}function _c(e,t,n){e.min=t.min-n.min,e.max=e.min+yc(t)}function Ec(e,t,n){_c(e.x,t.x,n.x),_c(e.y,t.y,n.y)}function Sc(e,t,n){return{min:void 0!==t?e.min+t:void 0,max:void 0!==n?e.max+n-(e.max-e.min):void 0}}function kc(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min({x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}),Oc=()=>({x:{min:0,max:0},y:{min:0,max:0}});function Nc(e){return[e("x"),e("y")]}function Ac({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function jc(e){return void 0===e||1===e}function Mc({scale:e,scaleX:t,scaleY:n}){return!jc(e)||!jc(t)||!jc(n)}function Ic(e){return Mc(e)||Dc(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Dc(e){return Lc(e.x)||Lc(e.y)}function Lc(e){return e&&"0%"!==e}function Fc(e,t,n){return n+t*(e-n)}function zc(e,t,n,r,o){return void 0!==o&&(e=Fc(e,o,r)),Fc(e,n,r)+t}function Bc(e,t=0,n=1,r,o){e.min=zc(e.min,t,n,r,o),e.max=zc(e.max,t,n,r,o)}function Vc(e,{x:t,y:n}){Bc(e.x,t.translate,t.scale,t.originPoint),Bc(e.y,n.translate,n.scale,n.originPoint)}const Wc=.999999999999,Uc=1.0000000000001;function $c(e,t){e.min=e.min+t,e.max=e.max+t}function Kc(e,t,n,r,o=.5){Bc(e,t,n,Ka(e.min,e.max,o),r)}function Hc(e,t){Kc(e.x,t.x,t.scaleX,t.scale,t.originX),Kc(e.y,t.y,t.scaleY,t.scale,t.originY)}function qc(e,t){return Ac(function(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}}(e.getBoundingClientRect(),t))}const Yc=({current:e})=>e?e.ownerDocument.defaultView:null,Xc=new WeakMap;class Gc{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Oc(),this.visualElement=e}start(e,{snapToCursor:t=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;const{dragSnapToOrigin:r}=this.getProps();this.panSession=new tc(e,{onSessionStart:e=>{const{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(Gl(e,"page").point)},onStart:(e,t)=>{var n;const{drag:r,dragPropagation:o,onDragStart:i}=this.getProps();if(r&&!o&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=dc(r),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Nc((e=>{let t=this.getAxisMotionValue(e).get()||0;if(us.test(t)){const{projection:n}=this.visualElement;if(n&&n.layout){const r=n.layout.layoutBox[e];r&&(t=yc(r)*(parseFloat(t)/100))}}this.originPoint[e]=t})),i&&Fi.postRender((()=>i(e,t))),null===(n=this.removeWillChange)||void 0===n||n.call(this),this.removeWillChange=Ll(this.visualElement,"transform");const{animationState:s}=this.visualElement;s&&s.setActive("whileDrag",!0)},onMove:(e,t)=>{const{dragPropagation:n,dragDirectionLock:r,onDirectionLock:o,onDrag:i}=this.getProps();if(!n&&!this.openGlobalLock)return;const{offset:s}=t;if(r&&null===this.currentDirection)return this.currentDirection=function(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}(s),void(null!==this.currentDirection&&o&&o(this.currentDirection));this.updateAxis("x",t.point,s),this.updateAxis("y",t.point,s),this.visualElement.render(),i&&i(e,t)},onSessionEnd:(e,t)=>this.stop(e,t),resumeAnimation:()=>Nc((e=>{var t;return"paused"===this.getAnimationState(e)&&(null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.play())}))},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:r,contextWindow:Yc(this.visualElement)})}stop(e,t){var n;null===(n=this.removeWillChange)||void 0===n||n.call(this);const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:o}=t;this.startAnimation(o);const{onDragEnd:i}=this.getProps();i&&Fi.postRender((()=>i(e,t)))}cancel(){this.isDragging=!1;const{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),t&&t.setActive("whileDrag",!1)}updateAxis(e,t,n){const{drag:r}=this.getProps();if(!n||!Jc(e,r,this.currentDirection))return;const o=this.getAxisMotionValue(e);let i=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(i=function(e,{min:t,max:n},r){return void 0!==t&&en&&(e=r?Ka(n,e,r.max):Math.min(e,n)),e}(i,this.constraints[e],this.elastic[e])),o.set(i)}resolveConstraints(){var e;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout,o=this.constraints;t&&hc(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!r)&&function(e,{top:t,left:n,bottom:r,right:o}){return{x:Sc(e.x,n,o),y:Sc(e.y,t,r)}}(r.layoutBox,t),this.elastic=function(e=Cc){return!1===e?e=0:!0===e&&(e=Cc),{x:Tc(e,"left","right"),y:Tc(e,"top","bottom")}}(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Nc((e=>{!1!==this.constraints&&this.getAxisMotionValue(e)&&(this.constraints[e]=function(e,t){const n={};return void 0!==t.min&&(n.min=t.min-e.min),void 0!==t.max&&(n.max=t.max-e.min),n}(r.layoutBox[e],this.constraints[e]))}))}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!hc(e))return!1;const n=e.current;$i(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const o=function(e,t,n){const r=qc(e,n),{scroll:o}=t;return o&&($c(r.x,o.offset.x),$c(r.y,o.offset.y)),r}(n,r.root,this.visualElement.getTransformPagePoint());let i=function(e,t){return{x:kc(e.x,t.x),y:kc(e.y,t.y)}}(r.layout.layoutBox,o);if(t){const e=t(function({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}(i));this.hasMutatedConstraints=!!e,e&&(i=Ac(e))}return i}startAnimation(e){const{drag:t,dragMomentum:n,dragElastic:r,dragTransition:o,dragSnapToOrigin:i,onDragTransitionEnd:s}=this.getProps(),a=this.constraints||{},l=Nc((s=>{if(!Jc(s,t,this.currentDirection))return;let l=a&&a[s]||{};i&&(l={min:0,max:0});const c=r?200:1e6,u=r?40:1e7,d={type:"inertia",velocity:n?e[s]:0,bounceStiffness:c,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...o,...l};return this.startAxisValueAnimation(s,d)}));return Promise.all(l).then(s)}startAxisValueAnimation(e,t){const n=this.getAxisMotionValue(e);return n.start(wl(e,n,0,t,this.visualElement,!1,Ll(this.visualElement,e)))}stopAnimation(){Nc((e=>this.getAxisMotionValue(e).stop()))}pauseAnimation(){Nc((e=>{var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.pause()}))}getAnimationState(e){var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.state}getAxisMotionValue(e){const t=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps();return n[t]||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){Nc((t=>{const{drag:n}=this.getProps();if(!Jc(t,n,this.currentDirection))return;const{projection:r}=this.visualElement,o=this.getAxisMotionValue(t);if(r&&r.layout){const{min:n,max:i}=r.layout.layoutBox[t];o.set(e[t]-Ka(n,i,.5))}}))}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!hc(t)||!n||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Nc((e=>{const t=this.getAxisMotionValue(e);if(t&&!1!==this.constraints){const n=t.get();r[e]=function(e,t){let n=.5;const r=yc(e),o=yc(t);return o>r?n=$a(t.min,t.max-r,e.min):r>o&&(n=$a(e.min,e.max-o,t.min)),Qi(0,1,n)}({min:n,max:n},this.constraints[e])}}));const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),Nc((t=>{if(!Jc(t,e,null))return;const n=this.getAxisMotionValue(t),{min:o,max:i}=this.constraints[t];n.set(Ka(o,i,r[t]))}))}addListeners(){if(!this.visualElement.current)return;Xc.set(this.visualElement,this);const e=Ql(this.visualElement.current,"pointerdown",(e=>{const{drag:t,dragListener:n=!0}=this.getProps();t&&n&&this.start(e)})),t=()=>{const{dragConstraints:e}=this.getProps();hc(e)&&e.current&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,r=n.addEventListener("measure",t);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),Fi.read(t);const o=Zl(window,"resize",(()=>this.scalePositionWithinConstraints())),i=n.addEventListener("didUpdate",(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Nc((t=>{const n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))})),this.visualElement.render())}));return()=>{o(),e(),r(),i&&i()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:o=!1,dragElastic:i=Cc,dragMomentum:s=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:o,dragElastic:i,dragMomentum:s}}}function Jc(e,t,n){return!(!0!==t&&t!==e||null!==n&&n!==e)}const Zc=e=>(t,n)=>{e&&Fi.postRender((()=>e(t,n)))};var Qc=n(848);const eu=(0,o.createContext)(null),tu=(0,o.createContext)({}),nu=(0,o.createContext)({}),ru={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function ou(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const iu={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e){if(!ds.test(e))return e;e=parseFloat(e)}return`${ou(e,t.target.x)}% ${ou(e,t.target.y)}%`}},su={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=Ys.parse(e);if(o.length>5)return r;const i=Ys.createTransformer(e),s="number"!=typeof o[0]?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;o[0+s]/=a,o[1+s]/=l;const c=Ka(a,l,.5);return"number"==typeof o[2+s]&&(o[2+s]/=c),"number"==typeof o[3+s]&&(o[3+s]/=c),i(o)}},au={},{schedule:lu,cancel:cu}=Li(queueMicrotask,!1);class uu extends o.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:o}=e;var i;i=fu,Object.assign(au,i),o&&(t.group&&t.group.add(o),n&&n.register&&r&&n.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",(()=>{this.safeToRemove()})),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),ru.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:n,drag:r,isPresent:o}=this.props,i=n.projection;return i?(i.isPresent=o,r||e.layoutDependency!==t||void 0===t?i.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?i.promote():i.relegate()||Fi.postRender((()=>{const e=i.getStack();e&&e.members.length||this.safeToRemove()}))),null):null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),lu.postRender((()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()})))}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function du(e){const[t,n]=function(){const e=(0,o.useContext)(eu);if(null===e)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,i=(0,o.useId)();(0,o.useEffect)((()=>r(i)),[]);const s=(0,o.useCallback)((()=>n&&n(i)),[i,n]);return!t&&n?[!1,s]:[!0]}(),r=(0,o.useContext)(tu);return(0,Qc.jsx)(uu,{...e,layoutGroup:r,switchLayoutGroup:(0,o.useContext)(nu),isPresent:t,safeToRemove:n})}const fu={borderRadius:{...iu,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:iu,borderTopRightRadius:iu,borderBottomLeftRadius:iu,borderBottomRightRadius:iu,boxShadow:su},hu=["TopLeft","TopRight","BottomLeft","BottomRight"],pu=hu.length,mu=e=>"string"==typeof e?parseFloat(e):e,gu=e=>"number"==typeof e||ds.test(e);function vu(e,t){return void 0!==e[t]?e[t]:e.borderRadius}const yu=xu(0,.5,Ia),bu=xu(.5,.95,Ii);function xu(e,t,n){return r=>rt?1:n($a(e,t,r))}function wu(e,t){e.min=t.min,e.max=t.max}function _u(e,t){wu(e.x,t.x),wu(e.y,t.y)}function Eu(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Su(e,t,n,r,o){return e=Fc(e-=t,1/n,r),void 0!==o&&(e=Fc(e,1/o,r)),e}function ku(e,t,[n,r,o],i,s){!function(e,t=0,n=1,r=.5,o,i=e,s=e){if(us.test(t)&&(t=parseFloat(t),t=Ka(s.min,s.max,t/100)-s.min),"number"!=typeof t)return;let a=Ka(i.min,i.max,r);e===i&&(a-=t),e.min=Su(e.min,t,n,a,o),e.max=Su(e.max,t,n,a,o)}(e,t[n],t[r],t[o],t.scale,i,s)}const Cu=["x","scaleX","originX"],Tu=["y","scaleY","originY"];function Pu(e,t,n,r){ku(e.x,t,Cu,n?n.x:void 0,r?r.x:void 0),ku(e.y,t,Tu,n?n.y:void 0,r?r.y:void 0)}function Ru(e){return 0===e.translate&&1===e.scale}function Ou(e){return Ru(e.x)&&Ru(e.y)}function Nu(e,t){return e.min===t.min&&e.max===t.max}function Au(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function ju(e,t){return Au(e.x,t.x)&&Au(e.y,t.y)}function Mu(e){return yc(e.x)/yc(e.y)}function Iu(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Du{constructor(){this.members=[]}add(e){Sl(this.members,e),e.scheduleRender()}remove(e){if(kl(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){const t=this.members.findIndex((t=>e===t));if(0===t)return!1;let n;for(let e=t;e>=0;e--){const t=this.members[e];if(!1!==t.isPresent){n=t;break}}return!!n&&(this.promote(n),!0)}promote(e,t){const n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.instance&&n.scheduleRender(),e.scheduleRender(),e.resumeFrom=n,t&&(e.resumeFrom.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:r}=e.options;!1===r&&n.hide()}}exitAnimationComplete(){this.members.forEach((e=>{const{options:t,resumingFrom:n}=e;t.onExitComplete&&t.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()}))}scheduleRender(){this.members.forEach((e=>{e.instance&&e.scheduleRender(!1)}))}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const Lu=(e,t)=>e.depth-t.depth;class Fu{constructor(){this.children=[],this.isDirty=!1}add(e){Sl(this.children,e),this.isDirty=!0}remove(e){kl(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Lu),this.isDirty=!1,this.children.forEach(e)}}function zu(e){const t=Dl(e)?e.get():e;return _l(t)?t.toValue():t}const Bu={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Vu="undefined"!=typeof window&&void 0!==window.MotionDebug,Wu=["","X","Y","Z"],Uu={visibility:"hidden"};let $u=0;function Ku(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Hu(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=jl(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Fi,!(t||r))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Hu(r)}function qu({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(e={},n=(null==t?void 0:t())){this.id=$u++,this.animationId=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.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Vu&&(Bu.totalNodes=Bu.resolvedTargetDeltas=Bu.recalculatedProjection=0),this.nodes.forEach(Gu),this.nodes.forEach(rd),this.nodes.forEach(od),this.nodes.forEach(Ju),Vu&&window.MotionDebug.record(Bu)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;ethis.root.updateBlockedByResize=!1;e(t,(()=>{this.root.updateBlockedByResize=!0,n&&n(),n=function(e){const t=ca.now(),n=({timestamp:r})=>{const o=r-t;o>=250&&(zi(n),e(o-250))};return Fi.read(n,!0),()=>zi(n)}(r),ru.hasAnimatedSinceResize&&(ru.hasAnimatedSinceResize=!1,this.nodes.forEach(nd))}))}o&&this.root.registerSharedNode(o,this),!1!==this.options.animate&&s&&(o||i)&&this.addEventListener("didUpdate",(({delta:e,hasLayoutChanged:t,hasRelativeTargetChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const o=this.options.transition||s.getDefaultTransition()||ud,{onLayoutAnimationStart:i,onLayoutAnimationComplete:a}=s.getProps(),l=!this.targetLayout||!ju(this.targetLayout,r)||n,c=!t&&n;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||c||t&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(e,c);const t={...Ai(o,"layout"),onPlay:i,onComplete:a};(s.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t)}else t||nd(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r}))}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,zi(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(id),this.animationId++)}getTransformTemplate(){const{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Hu(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()}))}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;eWc&&(t.x=1),t.yWc&&(t.y=1)}(this.layoutCorrected,this.treeScale,this.path,n),!t.layout||t.target||1===this.treeScale.x&&1===this.treeScale.y||(t.target=t.layout.layoutBox,t.targetWithTransforms=Oc());const{target:l}=t;l?(this.projectionDelta&&this.prevProjectionDelta?(Eu(this.prevProjectionDelta.x,this.projectionDelta.x),Eu(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),xc(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.treeScale.x===s&&this.treeScale.y===a&&Iu(this.projectionDelta.x,this.prevProjectionDelta.x)&&Iu(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l)),Vu&&Bu.recalculatedProjection++):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){var t;if(null===(t=this.options.visualElement)||void 0===t||t.scheduleRender(),e){const e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Rc(),this.projectionDelta=Rc(),this.projectionDeltaWithTransform=Rc()}setAnimationOrigin(e,t=!1){const n=this.snapshot,r=n?n.latestValues:{},o={...this.latestValues},i=Rc();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;const s=Oc(),a=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),c=!l||l.members.length<=1,u=Boolean(a&&!c&&!0===this.options.crossfade&&!this.path.some(cd));let d;this.animationProgress=0,this.mixTargetDelta=t=>{const n=t/1e3;var l,f,h,p,m,g;ad(i.x,e.x,n),ad(i.y,e.y,n),this.setTargetDelta(i),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ec(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox),h=this.relativeTarget,p=this.relativeTargetOrigin,m=s,g=n,ld(h.x,p.x,m.x,g),ld(h.y,p.y,m.y,g),d&&(l=this.relativeTarget,f=d,Nu(l.x,f.x)&&Nu(l.y,f.y))&&(this.isProjectionDirty=!1),d||(d=Oc()),_u(d,this.relativeTarget)),a&&(this.animationValues=o,function(e,t,n,r,o,i){o?(e.opacity=Ka(0,void 0!==n.opacity?n.opacity:1,yu(r)),e.opacityExit=Ka(void 0!==t.opacity?t.opacity:1,0,bu(r))):i&&(e.opacity=Ka(void 0!==t.opacity?t.opacity:1,void 0!==n.opacity?n.opacity:1,r));for(let o=0;o{ru.hasAnimatedSinceResize=!0,this.currentAnimation=function(e,t,n){const r=Dl(0)?0:Rl(0);return r.start(wl("",r,1e3,n)),r.animation}(0,0,{...e,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.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 e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const e=this.getLead();let{targetWithTransforms:t,target:n,layout:r,latestValues:o}=e;if(t&&n&&r){if(this!==e&&this.layout&&r&&pd(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||Oc();const t=yc(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;const r=yc(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}_u(t,n),Hc(t,o),xc(this.projectionDeltaWithTransform,this.layoutCorrected,t,o)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new Du),this.sharedNodes.get(e).add(t);const n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){const e=this.getStack();return!e||e.lead===this}getLead(){var e;const{layoutId:t}=this.options;return t&&(null===(e=this.getStack())||void 0===e?void 0:e.lead)||this}getPrevLead(){var e;const{layoutId:t}=this.options;return t?null===(e=this.getStack())||void 0===e?void 0:e.prevLead:void 0}getStack(){const{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){const r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){const e=this.getStack();return!!e&&e.relegate(this)}resetSkewAndRotation(){const{visualElement:e}=this.options;if(!e)return;let t=!1;const{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;const r={};n.z&&Ku("z",e,r,this.animationValues);for(let t=0;t{var t;return null===(t=e.currentAnimation)||void 0===t?void 0:t.stop()})),this.root.nodes.forEach(Qu),this.root.sharedNodes.clear()}}}function Yu(e){e.updateLayout()}function Xu(e){var t;const n=(null===(t=e.resumeFrom)||void 0===t?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:t,measuredBox:r}=e.layout,{animationType:o}=e.options,i=n.source!==e.layout.source;"size"===o?Nc((e=>{const r=i?n.measuredBox[e]:n.layoutBox[e],o=yc(r);r.min=t[e].min,r.max=r.min+o})):pd(o,n.layoutBox,t)&&Nc((r=>{const o=i?n.measuredBox[r]:n.layoutBox[r],s=yc(t[r]);o.max=o.min+s,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+s)}));const s=Rc();xc(s,t,n.layoutBox);const a=Rc();i?xc(a,e.applyTransform(r,!0),n.measuredBox):xc(a,t,n.layoutBox);const l=!Ou(s);let c=!1;if(!e.resumeFrom){const r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){const{snapshot:o,layout:i}=r;if(o&&i){const s=Oc();Ec(s,n.layoutBox,o.layoutBox);const a=Oc();Ec(a,t,i.layoutBox),ju(s,a)||(c=!0),r.options.layoutRoot&&(e.relativeTarget=a,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners("didUpdate",{layout:t,snapshot:n,delta:a,layoutDelta:s,hasLayoutChanged:l,hasRelativeTargetChanged:c})}else if(e.isLead()){const{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function Gu(e){Vu&&Bu.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=Boolean(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Ju(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Zu(e){e.clearSnapshot()}function Qu(e){e.clearMeasurements()}function ed(e){e.isLayoutDirty=!1}function td(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function nd(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function rd(e){e.resolveTargetDelta()}function od(e){e.calcProjection()}function id(e){e.resetSkewAndRotation()}function sd(e){e.removeLeadSnapshot()}function ad(e,t,n){e.translate=Ka(t.translate,0,n),e.scale=Ka(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function ld(e,t,n,r){e.min=Ka(t.min,n.min,r),e.max=Ka(t.max,n.max,r)}function cd(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}const ud={duration:.45,ease:[.4,0,.1,1]},dd=e=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),fd=dd("applewebkit/")&&!dd("chrome/")?Math.round:Ii;function hd(e){e.min=fd(e.min),e.max=fd(e.max)}function pd(e,t,n){return"position"===e||"preserve-aspect"===e&&(r=Mu(t),o=Mu(n),!(Math.abs(r-o)<=.2));var r,o}function md(e){var t;return e!==e.root&&(null===(t=e.scroll)||void 0===t?void 0:t.wasRoot)}const gd=qu({attachResizeListener:(e,t)=>Zl(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),vd={current:void 0},yd=qu({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!vd.current){const e=new gd({});e.mount(window),e.setOptions({layoutScroll:!0}),vd.current=e}return vd.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>Boolean("fixed"===window.getComputedStyle(e).position)}),bd={pan:{Feature:class extends Hl{constructor(){super(...arguments),this.removePointerDownListener=Ii}onPointerDown(e){this.session=new tc(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Yc(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Zc(e),onStart:Zc(t),onMove:n,onEnd:(e,t)=>{delete this.session,r&&Fi.postRender((()=>r(e,t)))}}}mount(){this.removePointerDownListener=Ql(this.node.current,"pointerdown",(e=>this.onPointerDown(e)))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends Hl{constructor(e){super(e),this.removeGroupControls=Ii,this.removeListeners=Ii,this.controls=new Gc(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Ii}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:yd,MeasureLayout:du}};function xd(e,t){const n=t?"pointerenter":"pointerleave",r=t?"onHoverStart":"onHoverEnd";return Ql(e.current,n,((n,o)=>{if("touch"===n.pointerType||fc())return;const i=e.getProps();e.animationState&&i.whileHover&&e.animationState.setActive("whileHover",t);const s=i[r];s&&Fi.postRender((()=>s(n,o)))}),{passive:!e.getProps()[r]})}const wd=(e,t)=>!!t&&(e===t||wd(e,t.parentElement));function _d(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,Gl(n))}const Ed=new WeakMap,Sd=new WeakMap,kd=e=>{const t=Ed.get(e.target);t&&t(e)},Cd=e=>{e.forEach(kd)};const Td={some:0,all:1},Pd={inView:{Feature:class extends Hl{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r="some",once:o}=e,i={root:t?t.current:void 0,rootMargin:n,threshold:"number"==typeof r?r:Td[r]};return function(e,t,n){const r=function({root:e,...t}){const n=e||document;Sd.has(n)||Sd.set(n,{});const r=Sd.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(Cd,{root:e,...t})),r[o]}(t);return Ed.set(e,n),r.observe(e),()=>{Ed.delete(e),r.unobserve(e)}}(this.node.current,i,(e=>{const{isIntersecting:t}=e;if(this.isInView===t)return;if(this.isInView=t,o&&!t&&this.hasEnteredView)return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);const{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),i=t?n:r;i&&i(e)}))}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}(e,t))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends Hl{constructor(){super(...arguments),this.removeStartListeners=Ii,this.removeEndListeners=Ii,this.removeAccessibleListeners=Ii,this.startPointerPress=(e,t)=>{if(this.isPressing)return;this.removeEndListeners();const n=this.node.getProps(),r=Ql(window,"pointerup",((e,t)=>{if(!this.checkPressEnd())return;const{onTap:n,onTapCancel:r,globalTapTarget:o}=this.node.getProps(),i=o||wd(this.node.current,e.target)?n:r;i&&Fi.update((()=>i(e,t)))}),{passive:!(n.onTap||n.onPointerUp)}),o=Ql(window,"pointercancel",((e,t)=>this.cancelPress(e,t)),{passive:!(n.onTapCancel||n.onPointerCancel)});this.removeEndListeners=Ua(r,o),this.startPress(e,t)},this.startAccessiblePress=()=>{const e=Zl(this.node.current,"keydown",(e=>{"Enter"!==e.key||this.isPressing||(this.removeEndListeners(),this.removeEndListeners=Zl(this.node.current,"keyup",(e=>{"Enter"===e.key&&this.checkPressEnd()&&_d("up",((e,t)=>{const{onTap:n}=this.node.getProps();n&&Fi.postRender((()=>n(e,t)))}))})),_d("down",((e,t)=>{this.startPress(e,t)})))})),t=Zl(this.node.current,"blur",(()=>{this.isPressing&&_d("cancel",((e,t)=>this.cancelPress(e,t)))}));this.removeAccessibleListeners=Ua(e,t)}}startPress(e,t){this.isPressing=!0;const{onTapStart:n,whileTap:r}=this.node.getProps();r&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),n&&Fi.postRender((()=>n(e,t)))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!fc()}cancelPress(e,t){if(!this.checkPressEnd())return;const{onTapCancel:n}=this.node.getProps();n&&Fi.postRender((()=>n(e,t)))}mount(){const e=this.node.getProps(),t=Ql(e.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),n=Zl(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=Ua(t,n)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}},focus:{Feature:class extends Hl{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(t){e=!0}e&&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=Ua(Zl(this.node.current,"focus",(()=>this.onFocus())),Zl(this.node.current,"blur",(()=>this.onBlur())))}unmount(){}}},hover:{Feature:class extends Hl{mount(){this.unmount=Ua(xd(this.node,!0),xd(this.node,!1))}unmount(){}}}},Rd={layout:{ProjectionNode:yd,MeasureLayout:du}},Od=(0,o.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),Nd=(0,o.createContext)({}),Ad="undefined"!=typeof window,jd=Ad?o.useLayoutEffect:o.useEffect,Md=(0,o.createContext)({strict:!1});let Id=!1;function Dd(e,t,n,r,i){var s;const{visualElement:a}=(0,o.useContext)(Nd),l=(0,o.useContext)(Md),c=(0,o.useContext)(eu),u=(0,o.useContext)(Od).reducedMotion,d=(0,o.useRef)();r=r||l.renderer,!d.current&&r&&(d.current=r(e,{visualState:t,parent:a,props:n,presenceContext:c,blockInitialAnimation:!!c&&!1===c.initial,reducedMotionConfig:u}));const f=d.current,h=(0,o.useContext)(nu);!f||f.projection||!i||"html"!==f.type&&"svg"!==f.type||function(e,t,n,r){const{layoutId:o,layout:i,drag:s,dragConstraints:a,layoutScroll:l,layoutRoot:c}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Fd(e.parent)),e.projection.setOptions({layoutId:o,layout:i,alwaysMeasureLayout:Boolean(s)||a&&hc(a),visualElement:e,animationType:"string"==typeof i?i:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:c})}(d.current,n,i,h),(0,o.useInsertionEffect)((()=>{f&&f.update(n,c)}));const p=n[Al],m=(0,o.useRef)(Boolean(p)&&!window.MotionHandoffIsComplete&&(null===(s=window.MotionHasOptimisedAnimation)||void 0===s?void 0:s.call(window,p)));return jd((()=>{f&&(f.updateFeatures(),lu.render(f.render),m.current&&f.animationState&&f.animationState.animateChanges())})),(0,o.useEffect)((()=>{f&&(!m.current&&f.animationState&&f.animationState.animateChanges(),m.current=!1,Id||(Id=!0,queueMicrotask(Ld)))})),f}function Ld(){window.MotionHandoffIsComplete=!0}function Fd(e){if(e)return!1!==e.options.allowProjection?e.projection:Fd(e.parent)}function zd(e,t,n){return(0,o.useCallback)((r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&("function"==typeof n?n(r):hc(n)&&(n.current=r))}),[t])}function Bd(e){return mi(e.animate)||Ei.some((t=>yi(e[t])))}function Vd(e){return Boolean(Bd(e)||e.variants)}function Wd(e){return Array.isArray(e)?e.join(" "):e}const Ud={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"]},$d={};for(const e in Ud)$d[e]={isEnabled:t=>Ud[e].some((e=>!!t[e]))};const Kd=Symbol.for("motionComponentSymbol");function Hd({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){e&&function(e){for(const t in e)$d[t]={...$d[t],...e[t]}}(e);const s=(0,o.forwardRef)((function(e,s){let a;const l={...(0,o.useContext)(Od),...e,layoutId:qd(e)},{isStatic:c}=l,u=function(e){const{initial:t,animate:n}=function(e,t){if(Bd(e)){const{initial:t,animate:n}=e;return{initial:!1===t||yi(t)?t:void 0,animate:yi(n)?n:void 0}}return!1!==e.inherit?t:{}}(e,(0,o.useContext)(Nd));return(0,o.useMemo)((()=>({initial:t,animate:n})),[Wd(t),Wd(n)])}(e),d=r(e,c);if(!c&&Ad){(0,o.useContext)(Md).strict;const e=function(e){const{drag:t,layout:n}=$d;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:(null==t?void 0:t.isEnabled(e))||(null==n?void 0:n.isEnabled(e))?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}(l);a=e.MeasureLayout,u.visualElement=Dd(i,d,l,t,e.ProjectionNode)}return(0,Qc.jsxs)(Nd.Provider,{value:u,children:[a&&u.visualElement?(0,Qc.jsx)(a,{visualElement:u.visualElement,...l}):null,n(i,e,zd(d,u.visualElement,s),d,c,u.visualElement)]})}));return s[Kd]=i,s}function qd({layoutId:e}){const t=(0,o.useContext)(tu).id;return t&&void 0!==e?t+"-"+e:e}const Yd=["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 Xd(e){return"string"==typeof e&&!e.includes("-")&&!!(Yd.indexOf(e)>-1||/[A-Z]/u.test(e))}function Gd(e,{style:t,vars:n},r,o){Object.assign(e.style,t,o&&o.getProjectionStyles(r));for(const t in n)e.style.setProperty(t,n[t])}const Jd=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 Zd(e,t,n,r){Gd(e,t,void 0,r);for(const n in t.attrs)e.setAttribute(Jd.has(n)?n:Nl(n),t.attrs[n])}function Qd(e,{layout:t,layoutId:n}){return ki.has(e)||e.startsWith("origin")||(t||void 0!==n)&&(!!au[e]||"opacity"===e)}function ef(e,t,n){var r;const{style:o}=e,i={};for(const s in o)(Dl(o[s])||t.style&&Dl(t.style[s])||Qd(s,e)||void 0!==(null===(r=null==n?void 0:n.getValue(s))||void 0===r?void 0:r.liveStyle))&&(i[s]=o[s]);return n&&o&&"string"==typeof o.willChange&&(n.applyWillChange=!1),i}function tf(e,t,n){const r=ef(e,t,n);for(const n in e)(Dl(e[n])||Dl(t[n]))&&(r[-1!==Si.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=e[n]);return r}function nf(e){const t=(0,o.useRef)(null);return null===t.current&&(t.current=e()),t.current}const rf=e=>(t,n)=>{const r=(0,o.useContext)(Nd),i=(0,o.useContext)(eu),s=()=>function({applyWillChange:e=!1,scrapeMotionValuesFromProps:t,createRenderState:n,onMount:r},o,i,s,a){const l={latestValues:af(o,i,s,!a&&e,t),renderState:n()};return r&&(l.mount=e=>r(o,e,l)),l}(e,t,r,i,n);return n?s():nf(s)};function of(e,t){const n=Ml(t);n&&Sl(e,n)}function sf(e,t,n){const r=Array.isArray(t)?t:[t];for(let t=0;t{for(const t in e){let n=e[t];Array.isArray(n)&&(n=n[p?n.length-1:0]),null!==n&&(s[t]=n)}for(const e in t)s[e]=t[e]})),l&&(d&&!1!==u&&!mi(d)&&sf(e,d,(e=>{for(const t in e)of(a,t)})),a.length&&(s.willChange=a.join(","))),s}const lf=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),cf=()=>({...lf(),attrs:{}}),uf=(e,t)=>t&&"number"==typeof e?t.transform(e):e,df={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ff=Si.length;function hf(e,t,n){const{style:r,vars:o,transformOrigin:i}=e;let s=!1,a=!1;for(const e in t){const n=t[e];if(ki.has(e))s=!0;else if(qi(e))o[e]=n;else{const t=uf(n,ea[e]);e.startsWith("origin")?(a=!0,i[e]=t):r[e]=t}}if(t.transform||(s||n?r.transform=function(e,t,n){let r="",o=!0;for(let i=0;i"string"==typeof e&&"svg"===e.toLowerCase(),bf={useVisualState:rf({scrapeMotionValuesFromProps:tf,createRenderState:cf,onMount:(e,t,{renderState:n,latestValues:r})=>{Fi.read((()=>{try{n.dimensions="function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch(e){n.dimensions={x:0,y:0,width:0,height:0}}})),Fi.render((()=>{vf(n,r,yf(t.tagName),e.transformTemplate),Zd(t,n)}))}})},xf={useVisualState:rf({applyWillChange:!0,scrapeMotionValuesFromProps:ef,createRenderState:lf})};function wf(e,t,n){for(const r in t)Dl(t[r])||Qd(r,n)||(e[r]=t[r])}function _f(e,t){const n={},r=function(e,t){const n={};return wf(n,e.style||{},e),Object.assign(n,function({transformTemplate:e},t){return(0,o.useMemo)((()=>{const n=lf();return hf(n,t,e),Object.assign({},n.vars,n.style)}),[t])}(e,t)),n}(e,t);return e.drag&&!1!==e.dragListener&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=!0===e.drag?"none":"pan-"+("x"===e.drag?"y":"x")),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const Ef=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 Sf(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Ef.has(e)}let kf=e=>!Sf(e);try{(Cf=n(316).A)&&(kf=e=>e.startsWith("on")?!Sf(e):Cf(e))}catch(e){}var Cf;function Tf(e,t,n,r){const i=(0,o.useMemo)((()=>{const n=cf();return vf(n,t,yf(r),e.transformTemplate),{...n.attrs,style:{...n.style}}}),[t]);if(e.style){const t={};wf(t,e.style,e),i.style={...t,...i.style}}return i}function Pf(e=!1){return(t,n,r,{latestValues:i},s)=>{const a=(Xd(t)?Tf:_f)(n,i,s,t),l=function(e,t,n){const r={};for(const o in e)"values"===o&&"object"==typeof e.values||(kf(o)||!0===n&&Sf(o)||!t&&!Sf(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}(n,"string"==typeof t,e),c=t!==o.Fragment?{...l,...a,ref:r}:{},{children:u}=n,d=(0,o.useMemo)((()=>Dl(u)?u.get():u),[u]);return(0,o.createElement)(t,{...c,children:d})}}function Rf(e,t){return function(n,{forwardMotionProps:r}={forwardMotionProps:!1}){return Hd({...Xd(n)?bf:xf,preloadedFeatures:e,useRender:Pf(r),createVisualElement:t,Component:n})}}const Of={current:null},Nf={current:!1},Af=new WeakMap,jf=[...Es,Ls,Ys],Mf=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],If=Ei.length;class Df{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,blockInitialAnimation:o,visualState:i},s={}){this.applyWillChange=!1,this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Os,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.isRenderScheduled=!1,this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.isRenderScheduled=!1,this.scheduleRender=()=>{this.isRenderScheduled||(this.isRenderScheduled=!0,Fi.render(this.render,!1,!0))};const{latestValues:a,renderState:l}=i;this.latestValues=a,this.baseTarget={...a},this.initialValues=t.initial?{...a}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.options=s,this.blockInitialAnimation=Boolean(o),this.isControllingVariants=Bd(t),this.isVariantNode=Vd(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(e&&e.current);const{willChange:c,...u}=this.scrapeMotionValuesFromProps(t,{},this);for(const e in u){const t=u[e];void 0!==a[e]&&Dl(t)&&t.set(a[e],!1)}}mount(e){this.current=e,Af.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach(((e,t)=>this.bindToMotionValue(t,e))),Nf.current||function(){if(Nf.current=!0,Ad)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Of.current=e.matches;e.addListener(t),t()}else Of.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Of.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Af.delete(this.current),this.projection&&this.projection.unmount(),zi(this.notifyUpdate),zi(this.render),this.valueSubscriptions.forEach((e=>e())),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}bindToMotionValue(e,t){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const n=ki.has(e),r=t.on("change",(t=>{this.latestValues[e]=t,this.props.onUpdate&&Fi.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)})),o=t.on("renderRequest",this.scheduleRender);let i;window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,(()=>{r(),o(),i&&i(),t.owner&&t.stop()}))}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}updateFeatures(){let e="animation";for(e in $d){const t=$d[e];if(!t)continue;const{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){const t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Oc()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;tt.variantChildren.delete(e)}addValue(e,t){const n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return void 0===n&&void 0!==t&&(n=Rl(null===t?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){var n;let r=void 0===this.latestValues[e]&&this.current?null!==(n=this.getBaseTargetFromProps(this.props,e))&&void 0!==n?n:this.readValueFromInstance(this.current,e,this.options):this.latestValues[e];return null!=r&&("string"==typeof r&&(Ki(r)||Wi(r))?r=parseFloat(r):!(e=>jf.find(_s(e)))(r)&&Ys.test(t)&&(r=ra(e,t)),this.setBaseTarget(e,Dl(r)?r.get():r)),Dl(r)?r.get():r}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;const{initial:n}=this.props;let r;if("string"==typeof n||"object"==typeof n){const o=xi(this.props,n,null===(t=this.presenceContext)||void 0===t?void 0:t.custom);o&&(r=o[e])}if(n&&void 0!==r)return r;const o=this.getBaseTargetFromProps(this.props,e);return void 0===o||Dl(o)?void 0!==this.initialValues[e]&&void 0===r?void 0:this.baseTarget[e]:o}on(e,t){return this.events[e]||(this.events[e]=new Cl),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class Lf extends Df{constructor(){super(...arguments),this.KeyframeResolver=ia}sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}}class Ff extends Lf{constructor(){super(...arguments),this.type="html",this.applyWillChange=!0,this.renderInstance=Gd}readValueFromInstance(e,t){if(ki.has(t)){const e=na(t);return e&&e.default||0}{const r=(n=e,window.getComputedStyle(n)),o=(qi(t)?r.getPropertyValue(t):r[t])||0;return"string"==typeof o?o.trim():o}var n}measureInstanceViewportBox(e,{transformPagePoint:t}){return qc(e,t)}build(e,t,n){hf(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return ef(e,t,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Dl(e)&&(this.childSubscription=e.on("change",(e=>{this.current&&(this.current.textContent=`${e}`)})))}}class zf extends Lf{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Oc}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(ki.has(t)){const e=na(t);return e&&e.default||0}return t=Jd.has(t)?t:Nl(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return tf(e,t,n)}build(e,t,n){vf(e,t,this.isSVGTag,n.transformTemplate)}renderInstance(e,t,n,r){Zd(e,t,0,r)}mount(e){this.isSVGTag=yf(e.tagName),super.mount(e)}}const Bf=pi(Rf({...Yl,...Pd,...bd,...Rd},((e,t)=>Xd(e)?new zf(t):new Ff(t,{allowProjection:e!==o.Fragment}))));var Vf=["slug","text","icon","className","disabled","badge"];function Wf(){return Wf=Object.assign?Object.assign.bind():function(e){for(var t=1;t*]:box-border flex items-center ".concat("full"===y?"w-full":""," ").concat(E),k=te(S,x,w,t,_,"underline"!==p?"bg-tab-background":"",l);return i().createElement("div",{className:k},i().createElement(Uf.Provider,{value:{activeItem:s,onChange:b,size:u,variant:p,orientation:f,iconPosition:g,width:y}},i().Children.map(n,(function(e){return(0,o.isValidElement)(e)?i().cloneElement(e):null}))))},Tab:Kf};const qf=be("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]),Yf=be("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),Xf=be("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);var Gf={sm:{icon:"[&>svg]:size-4",searchIcon:"[&>svg]:size-4",selectButton:"px-2 py-2 rounded text-xs font-medium leading-4 min-h-[2.25rem]",multiSelect:"pl-2 pr-2 py-1.5",displaySelected:"text-xs font-normal",dropdown:"rounded-md",dropdownItemsWrapper:"p-1.5",searchbarWrapper:"p-3 flex items-center gap-0.5",searchbar:"font-medium text-xs",searchbarIcon:"[&>svg]:size-4",label:"text-xs font-medium"},md:{icon:"[&>svg]:size-5",searchIcon:"[&>svg]:size-5",selectButton:"px-2.5 py-2.5 rounded-md text-xs font-medium leading-4 min-h-[2.5rem]",multiSelect:"pl-2 pr-2.5 py-2",displaySelected:"text-sm font-normal",dropdown:"rounded-lg",dropdownItemsWrapper:"p-2",searchbarWrapper:"p-2.5 flex items-center gap-1",searchbar:"font-medium text-sm",searchbarIcon:"[&>svg]:size-5",label:"text-sm font-medium"},lg:{icon:"[&>svg]:size-6",searchIcon:"[&>svg]:size-5",selectButton:"px-3 py-3 rounded-lg text-sm font-medium leading-5 min-h-[3rem]",multiSelect:"pl-2.5 pr-3 py-2.5",displaySelected:"text-sm font-normal",dropdown:"rounded-lg",dropdownItemsWrapper:"p-2",searchbarWrapper:"p-2.5 flex items-center gap-1",searchbar:"font-medium text-sm",searchbarIcon:"[&>svg]:size-5",label:"text-base font-medium"}},Jf="group-disabled:text-field-color-disabled",Zf=["value","selected","children"];function Qf(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,s,a=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}(e,t)||nh(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function eh(){return eh=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n{r&&(clearTimeout(m.current),y.current=null,g.current="")}),[r]),Rr((()=>{var e;r&&""===g.current&&(v.current=null!=(e=null!=p?p:a)?e:-1)}),[r,p,a]);const E=pr((e=>{e?i.current.typing||(i.current.typing=e,x(e)):i.current.typing&&(i.current.typing=e,x(e))})),S=pr((e=>{function t(e,t,n){const r=w.current?w.current(t,n):t.find((e=>0===(null==e?void 0:e.toLocaleLowerCase().indexOf(n.toLocaleLowerCase()))));return r?e.indexOf(r):-1}const n=s.current;if(g.current.length>0&&" "!==g.current[0]&&(-1===t(n,n,g.current)?E(!1):" "===e.key&&qt(e)),null==n||_.current.includes(e.key)||1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey)return;r&&" "!==e.key&&(qt(e),E(!0)),n.every((e=>{var t,n;return!e||(null==(t=e[0])?void 0:t.toLocaleLowerCase())!==(null==(n=e[1])?void 0:n.toLocaleLowerCase())}))&&g.current===e.key&&(g.current="",v.current=y.current),g.current+=e.key,clearTimeout(m.current),m.current=setTimeout((()=>{g.current="",v.current=y.current,E(!1)}),f);const o=v.current,i=t(n,[...n.slice((o||0)+1),...n.slice(0,(o||0)+1)],g.current);-1!==i?(b(i),y.current=i):" "!==e.key&&(g.current="",E(!1))})),k=o.useMemo((()=>({onKeyDown:S})),[S]),C=o.useMemo((()=>({onKeyDown:S,onKeyUp(e){" "===e.key&&E(!1)}})),[S,E]);return o.useMemo((()=>u?{reference:k,floating:C}:{}),[u,k,C])}(B,{listRef:W,activeIndex:N,selectedIndex:M,onMatch:P?A:I,onTypingChange:function(e){U.current=e}}),X=Ao([K,H,q,$].concat(th(m?[]:[Y]))),G=X.getReferenceProps,J=X.getFloatingProps,Z=X.getItemProps,Q=function(e,t){if(h)return function(e,t){var n,r=th(null!==(n=C())&&void 0!==n?n:[]);-1===r.findIndex((function(e){return"object"===oh(e)?e[u]===t[u]:e===t}))&&(r.push(t),b||_(r),I(e),F.reference.current.focus(),R(!1),k(""),"function"==typeof l&&l(r))}(e,t);I(e),b||_(t),F.reference.current.focus(),R(!1),k(""),"function"==typeof l&&l(t)},ee=(0,o.useCallback)((function(e,t){V.current[e]=t}),[]);return React.createElement(lh.Provider,{value:{selectedIndex:M,setSelectedIndex:I,activeIndex:N,setActiveIndex:A,selected:w,setSelected:_,handleSelect:Q,combobox:m,sizeValue:i,multiple:h,onChange:l,isTypingRef:U,getItemProps:Z,onClickItem:function(e,t){Q(e,t)},onKeyDownItem:function(e,t,n){"Enter"===e.key&&(e.preventDefault(),Q(t,n))," "!==e.key||U.current||(e.preventDefault(),Q(t,n))},getValues:C,selectId:y,getReferenceProps:G,isOpen:P,value:s,updateListRef:ee,refs:F,listContentRef:W,by:u,getFloatingProps:J,floatingStyles:z,context:B,searchKeyword:S,setSearchKeyword:k,disabled:v}},d)};uh.Button=function(e){var t,n,r,i=e.children,s=e.icon,a=void 0===s?null:s,l=e.placeholder,c=void 0===l?"Select an option":l,u=e.optionIcon,d=void 0===u?null:u,f=e.displayBy,h=void 0===f?"name":f,p=e.label,m=ch(),g=m.sizeValue,v=m.getReferenceProps,y=m.getValues,b=m.selectId,x=m.refs,w=m.isOpen,_=m.multiple,E=m.combobox,S=m.setSelected,k=m.onChange,C=m.isControlled,T=m.disabled,P=m.by,R=null===(t={sm:"xs",md:"sm",lg:"md"})||void 0===t?void 0:t[g],O=(0,o.useCallback)((function(){if(a)return a;var e="text-field-placeholder group-disabled:text-icon-disabled";return E?React.createElement(qf,{className:e}):React.createElement(Yf,{className:e})}),[a]),N=(0,o.useCallback)((function(){var e=y();if(!e)return null;if("function"==typeof i){var t=sh({value:e},_?{onClose:A}:{});return i(t)}if(_)return e.map((function(e,t){return React.createElement(Ue,{icon:d,type:"rounded",key:t,size:R,onMouseDown:A(e),label:"object"===oh(e)?e[h]:e,closable:!0,disabled:T})}));var n="object"===oh(e)?e[h]:e;return(0,o.isValidElement)(i)&&(n=i),React.createElement("span",{className:te(Gf[g].displaySelected,Jf)},n)}),[y]),A=function(e){return function(t){var n;null==t||t.preventDefault(),null==t||t.stopPropagation();var r=th(null!==(n=y())&&void 0!==n?n:[]),o=r.findIndex((function(t){return"object"===oh(t)?t[P]===e[P]:t===e}));-1!==o&&(r.splice(o,1),C||S(r),"function"==typeof k&&k(r))}};return React.createElement("div",{className:"flex flex-col items-start gap-1.5 [&_*]:box-border box-border"},React.createElement("label",{className:te(null===(n=Gf[g])||void 0===n?void 0:n.label,"text-field-label"),htmlFor:b},p),React.createElement("button",eh({id:b,ref:x.setReference,className:te("flex items-center justify-between border border-solid w-full box-border transition-colors duration-150 bg-white","border focus-visible:outline-none border-solid border-field-border",!w&&"focus:ring-2 focus:ring-offset-4 focus:border-focus-border focus:ring-focus [&:hover:not(:focus):not(:disabled)]:border-border-strong",Gf[g].selectButton,_&&Gf[g].multiSelect,"group disabled:border-field-border-disabled [&:hover:has(:disabled)]:border-field-border-disabled"),"aria-labelledby":"select-label",tabIndex:0,disabled:T},v()),React.createElement("div",{className:te("flex-1 grid items-center justify-start gap-1.5 ",y()&&"flex flex-wrap")},N(),(_?!(null!==(r=y())&&void 0!==r&&r.length):!y())&&React.createElement("div",{className:te("[grid-area:1/1/2/3] text-field-input",Gf[g].displaySelected,Jf)},c)),React.createElement("div",{className:te("flex items-center [&>svg]:shrink-0",Gf[g].icon)},O())))},uh.Options=function(e){var t=e.children,n=e.searchBy,r=void 0===n?"id":n,i=e.searchPlaceholder,s=void 0===i?"Search...":i,a=e.dropdownPortalRoot,l=void 0===a?null:a,c=e.dropdownPortalId,u=void 0===c?"":c,d=ch(),f=d.isOpen,h=d.context,p=d.refs,m=d.combobox,g=d.floatingStyles,v=d.getFloatingProps,y=d.sizeValue,b=d.setSearchKeyword,x=d.setActiveIndex,w=d.setSelectedIndex,_=d.value,E=d.selected,S=d.getValues,k=d.searchKeyword,C=d.listContentRef,T=d.by,P=(0,o.useMemo)((function(){var e=S(),n=0;return e&&(n=o.Children.toArray(t).findIndex((function(t){return"object"===oh(t.props.value)?t.props.value[T]===e[T]:t.props.value===e}))),-1===n?0:n}),[_,E,t]);(0,o.useLayoutEffect)((function(){x(P),w(P)}),[]);var R=(0,o.useMemo)((function(){return o.Children.map(t,(function(e,t){if(!(0,o.isValidElement)(e))return null;if(k){var n=e.props.value;if("object"===oh(n)){if(-1===n[r].toLowerCase().indexOf(k.toLowerCase()))return null}else if(-1===n.toLowerCase().indexOf(k.toLowerCase()))return null}return(0,o.cloneElement)(e,sh(sh({},e.props),{},{index:t}))}))}),[k,_,E,t]),O=o.Children.count(R);return(0,o.useEffect)((function(){C.current=[],o.Children.forEach(t,(function(e){if((0,o.isValidElement)(e)&&e.props.value){if(k){var t=e.props.value;if("object"===oh(t)){if(-1===t[r].toLowerCase().indexOf(k.toLowerCase()))return}else if(-1===t.toLowerCase().indexOf(k.toLowerCase()))return}C.current.push(e.props.value)}}))}),[k]),React.createElement(React.Fragment,null,f&&React.createElement(uo,{id:u,root:l},React.createElement(xo,{context:h,modal:!1},React.createElement("div",eh({ref:p.setFloating,className:te("box-border [&_*]:box-border w-full bg-white outline-none shadow-lg border border-solid border-border-subtle overflow-hidden",m&&"grid grid-cols-1 grid-rows-[auto_1fr] divide-y divide-x-0 divide-solid divide-border-subtle",Gf[y].dropdown,!m&&"h-full"),style:sh({},g)},v()),m&&React.createElement("div",{className:te(Gf[y].searchbarWrapper)},React.createElement(Xf,{className:te("text-icon-secondary shrink-0",Gf[y].searchbarIcon)}),React.createElement("input",{className:te("px-1 w-full placeholder:text-field-placeholder border-0 focus:outline-none focus:shadow-none",Gf[y].searchbar),type:"search",name:"keyword",placeholder:s,onChange:function(e){return b(e.target.value)},autoComplete:"off"})),React.createElement("div",{className:te("overflow-y-auto",!m&&"w-full h-full",Gf[y].dropdownItemsWrapper)},!!O&&R,!O&&React.createElement("div",{className:"p-2 text-center text-base font-medium text-field-placeholder"},"No items found"))))))},uh.Option=function(e){var t=e.value,n=e.selected,r=e.children,i=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.create(mh({message:e,type:"neutral"},t))}},{key:"success",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.create(mh({message:e,type:"success"},t))}},{key:"error",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.create(mh({message:e,type:"error"},t))}},{key:"warning",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.create(mh({message:e,type:"warning"},t))}},{key:"info",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.create(mh({message:e,type:"info"},t))}},{key:"custom",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.create(mh({jsx:e,type:"custom"},t))}}],t&&vh(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}(),Th=new Ch,Ph=Object.seal(Object.assign((function(e,t){return Th.default(e,t)}),{success:Th.success.bind(Th),error:Th.error.bind(Th),warning:Th.warning.bind(Th),info:Th.info.bind(Th),custom:Th.custom.bind(Th),dismiss:Th.dismiss.bind(Th),update:Th.update.bind(Th)},{getHistory:Th.history.bind(Th)})),Rh=!1,Oh={"top-left":"top-0 bottom-0 left-0 justify-start items-start","top-right":"top-0 bottom-0 right-0 justify-start items-end","bottom-left":"top-0 bottom-0 left-0 justify-end items-start","bottom-right":"top-0 bottom-0 right-0 justify-end items-end"},Nh={neutral:"border-alert-border-neutral bg-alert-background-neutral",custom:"border-alert-border-neutral bg-alert-background-neutral",info:"border-alert-border-info bg-alert-background-info",success:"border-alert-border-green bg-alert-background-green",warning:"border-alert-border-warning bg-alert-background-warning",error:"border-alert-border-danger bg-alert-background-danger"},Ah="bg-background-inverse border-background-inverse",jh={light:"text-icon-secondary",dark:"text-icon-inverse"};class Mh extends o.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){const e=this.props.sizeRef.current;e.height=t.offsetHeight||0,e.width=t.offsetWidth||0,e.top=t.offsetTop,e.left=t.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function Ih({children:e,isPresent:t}){const n=(0,o.useId)(),r=(0,o.useRef)(null),i=(0,o.useRef)({width:0,height:0,top:0,left:0}),{nonce:s}=(0,o.useContext)(Od);return(0,o.useInsertionEffect)((()=>{const{width:e,height:o,top:a,left:l}=i.current;if(t||!r.current||!e||!o)return;r.current.dataset.motionPopId=n;const c=document.createElement("style");return s&&(c.nonce=s),document.head.appendChild(c),c.sheet&&c.sheet.insertRule(`\n [data-motion-pop-id="${n}"] {\n position: absolute !important;\n width: ${e}px !important;\n height: ${o}px !important;\n top: ${a}px !important;\n left: ${l}px !important;\n }\n `),()=>{document.head.removeChild(c)}}),[t]),(0,Qc.jsx)(Mh,{isPresent:t,childRef:r,sizeRef:i,children:o.cloneElement(e,{ref:r})})}const Dh=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:a})=>{const l=nf(Lh),c=(0,o.useId)(),u=(0,o.useMemo)((()=>({id:c,initial:t,isPresent:n,custom:i,onExitComplete:e=>{l.set(e,!0);for(const e of l.values())if(!e)return;r&&r()},register:e=>(l.set(e,!1),()=>l.delete(e))})),s?[Math.random()]:[n]);return(0,o.useMemo)((()=>{l.forEach(((e,t)=>l.set(t,!1)))}),[n]),o.useEffect((()=>{!n&&!l.size&&r&&r()}),[n]),"popLayout"===a&&(e=(0,Qc.jsx)(Ih,{isPresent:n,children:e})),(0,Qc.jsx)(eu.Provider,{value:u,children:e})};function Lh(){return new Map}const Fh=e=>e.key||"";function zh(e){const t=[];return o.Children.forEach(e,(e=>{(0,o.isValidElement)(e)&&t.push(e)})),t}const Bh=({children:e,exitBeforeEnter:t,custom:n,initial:r=!0,onExitComplete:i,presenceAffectsLayout:s=!0,mode:a="sync"})=>{$i(!t,"Replace exitBeforeEnter with mode='wait'");const l=(0,o.useMemo)((()=>zh(e)),[e]),c=l.map(Fh),u=(0,o.useRef)(!0),d=(0,o.useRef)(l),f=nf((()=>new Map)),[h,p]=(0,o.useState)(l),[m,g]=(0,o.useState)(l);jd((()=>{u.current=!1,d.current=l;for(let e=0;e{const t=Fh(e),o=l===m||c.includes(t);return(0,Qc.jsx)(Dh,{isPresent:o,initial:!(u.current&&!r)&&void 0,custom:o?void 0:n,presenceAffectsLayout:s,mode:a,onExitComplete:o?void 0:()=>{if(!f.has(t))return;f.set(t,!0);let e=!0;f.forEach((t=>{t||(e=!1)})),e&&(null==y||y(),g(d.current),i&&i())},children:e},t)}))})};function Vh(e){return Vh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vh(e)}function Wh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Uh(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n1&&void 0!==arguments[1]?arguments[1]:u;if(l&&!(u<0))return x.current=(new Date).getTime(),setTimeout((function(){b(e.id)}),t)};(0,o.useEffect)((function(){var e=u;return _.current=E(t,e),function(){clearTimeout(_.current)}}),[]),(0,o.useEffect)((function(){null!=t&&t.dismiss&&b(t.id)}),[t]);var S,k,C,T,P,R,O,N,A,j,M=function(){var e,n;null==t||null===(e=t.action)||void 0===e||null===(n=e.onClick)||void 0===n||n.call(e,(function(){return b(t.id)}))},I=null;return"stack"===p&&(I=React.createElement("div",{className:te("flex items-center justify-start p-4 gap-2 relative border border-solid rounded-md shadow-lg","dark"===f?Ah:null===(S=Nh)||void 0===S?void 0:S[y],"w-[22.5rem]"),onMouseEnter:function(){clearTimeout(_.current),w.current=(new Date).getTime()},onMouseLeave:function(){_.current=E(t,u-(w.current-x.current))}},"custom"!==t.type?React.createElement(React.Fragment,null,React.createElement("div",{className:"self-start flex items-center justify-center [&_svg]:size-5 shrink-0"},Xo({variant:y,icon:g,theme:f})),React.createElement("div",{className:"flex flex-col items-start justify-start gap-0.5"},Jo({title:r,theme:f}),Zo({content:s,theme:f}),(null==t||null===(k=t.action)||void 0===k?void 0:k.label)&&"function"==typeof(null==t||null===(C=t.action)||void 0===C?void 0:C.onClick)&&React.createElement("div",{className:"mt-2.5"},Go({actionLabel:null==t||null===(T=t.action)||void 0===T?void 0:T.label,actionType:null!==(P=null==t||null===(R=t.action)||void 0===R?void 0:R.type)&&void 0!==P?P:"button",onAction:M,theme:f}))),React.createElement("div",{className:"absolute right-4 top-4 [&_svg]:size-5"},React.createElement("button",{className:te("bg-transparent m-0 p-0 border-none focus:outline-none active:outline-none cursor-pointer",null!==(O=jh[f])&&void 0!==O?O:jh.light),onClick:function(){return b(t.id)}},React.createElement(Be,null)))):null==t||null===(N=t.jsx)||void 0===N?void 0:N.call(t,{close:function(){return b(t.id)},action:null!=t&&t.action?Uh(Uh({},null==t?void 0:t.action),{},{onClick:M}):null}))),"inline"===p&&(I=React.createElement("div",{className:te("flex items-center justify-start p-3 gap-2 relative border border-solid rounded-md shadow-lg","dark"===f?Ah:null===(A=Nh)||void 0===A?void 0:A[y],"lg:w-[47.5rem] w-full")},React.createElement("div",{className:"self-start flex items-center justify-center [&_svg]:size-5 shrink-0"},Xo({variant:y,icon:g,theme:f})),React.createElement("div",{className:"flex items-start justify-start gap-1 mr-10 [&>span:first-child]:shrink-0"},Jo({title:r,theme:f}),Zo({content:s,theme:f})),React.createElement("div",{className:"absolute right-3 top-3 [&_svg]:size-5"},React.createElement("button",{className:te("bg-transparent m-0 p-0 border-none focus:outline-none active:outline-none cursor-pointer",null!==(j=jh[f])&&void 0!==j?j:jh.light),onClick:function(){return b(t.id)}},React.createElement(Be,null))))),I},Xh=(qh=function(e){var t,n,r,i=e.position,s=void 0===i?"top-right":i,a=e.design,l=void 0===a?"stack":a,c=e.theme,u=void 0===c?"light":c,d=e.className,f=void 0===d?"":d,h=e.autoDismiss,p=void 0===h||h,m=e.dismissAfter,g=void 0===m?5e3:m,v=(n=(0,o.useState)([]),r=2,function(e){if(Array.isArray(e))return e}(n)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,s,a=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}(n,r)||Kh(n,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),y=v[0],b=v[1];(0,o.useEffect)((function(){Th.subscribe((function(e){null!=e&&e.dismiss?b((function(t){return t.map((function(t){return t.id===e.id?Uh(Uh({},t),{},{dismiss:!0}):t}))})):setTimeout((function(){(0,jn.flushSync)((function(){return b((function(t){return-1!==t.findIndex((function(t){return t.id===e.id}))?t.map((function(t){return t.id===e.id?Uh(Uh({},t),e):t})):[].concat(function(e){return function(e){if(Array.isArray(e))return Hh(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Kh(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t),[e])}))}))}))}))}),[]);var x=function(e){b((function(t){return t.filter((function(t){return t.id!==e}))}))};return React.createElement("ul",{className:te("fixed flex flex-col list-none z-20 p-10 pointer-events-none [&>li]:pointer-events-auto gap-3",null!==(t=Oh[s])&&void 0!==t?t:Oh["top-right"],f)},React.createElement(Bh,{initial:!1},y.map((function(e){var t,n,r,o,i;return React.createElement(Bf.li,{key:e.id,positionTransition:!0,initial:{opacity:0,y:50,scale:.7},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,scale:.6,transition:{duration:.15}},layoutId:"toast-".concat(e.id)},React.createElement(Yh,{toastItem:e,title:e.title,content:null==e?void 0:e.description,icon:null!==(t=null==e?void 0:e.icon)&&void 0!==t?t:null,design:null!==(n=null==e?void 0:e.design)&&void 0!==n?n:l,autoDismiss:null!==(r=null==e?void 0:e.autoDismiss)&&void 0!==r?r:p,dismissAfter:null!==(o=null==e?void 0:e.dismissAfter)&&void 0!==o?o:g,removeToast:x,variant:e.type,theme:null!==(i=null==e?void 0:e.theme)&&void 0!==i?i:u}))}))))},(0,o.memo)((function(e){var t=e.singleTon;return Rh&&t?null:(Rh=!0,React.createElement(qh,e))}))),Gh=["containerType","gap","direction","justify","align","wrap","cols","tabCols","mCols","className","children"],Jh=["grow","shrink","order","alignSelf","className","children"];function Zh(){return Zh=Object.assign?Object.assign.bind():function(e){for(var t=1;tspan:first-child]:shrink-0"},Jo({title:g,theme:u}),Zo({content:y,theme:u}))),React.createElement("div",{className:"flex items-center justify-start gap-4 [&_svg]:size-5"},(null==S?void 0:S.label)&&"function"==typeof(null==S?void 0:S.onClick)&&React.createElement("div",{className:"flex"},Go({actionLabel:null==S?void 0:S.label,actionType:null!==(n=null==S?void 0:S.type)&&void 0!==n?n:"button",onAction:O,theme:u})),React.createElement("button",{className:te("bg-transparent m-0 p-0 border-none focus:outline-none active:outline-none cursor-pointer",null!==(r=R[u])&&void 0!==r?r:R.light),onClick:function(){return k()}},React.createElement(Be,null))))},op=(tp=function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e{t.focus((()=>{const e=document.activeElement,n=t.getRootElement();null===n||null!==e&&n.contains(e)||n.focus({preventScroll:!0})}),{defaultSelection:e})}),[e,t]),null}const lp={},cp={},up={},dp={},fp={},hp={},pp={},mp={},gp={},vp={},yp={},bp={},xp={},wp={},_p={},Ep={},Sp={},kp={},Cp={},Tp={},Pp={},Rp={},Op={},Np={},Ap={},jp={},Mp={},Ip={},Dp={},Lp={},Fp={},zp={},Bp={},Vp={},Wp={},Up={},$p={},Kp={},Hp={},qp={},Yp="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Xp=Yp&&"documentMode"in document?document.documentMode:null,Gp=Yp&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Jp=Yp&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Zp=!(!Yp||!("InputEvent"in window)||Xp)&&"getTargetRanges"in new window.InputEvent("input"),Qp=Yp&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),em=Yp&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,tm=Yp&&/Android/.test(navigator.userAgent),nm=Yp&&/^(?=.*Chrome).*/i.test(navigator.userAgent),rm=Yp&&tm&&nm,om=Yp&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!nm,im=1,sm=3,am=0,lm=2,cm=0,um=1,dm=2,fm=4,hm=8,pm=3|fm|hm|240,mm=1,gm=2,vm=3,ym=4,bm=5,xm=6,wm=Qp||em||om?" ":"​",_m="\n\n",Em=Jp?" ":wm,Sm="֑-߿יִ-﷽ﹰ-ﻼ",km="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",Cm=new RegExp("^[^"+km+"]*["+Sm+"]"),Tm=new RegExp("^[^"+Sm+"]*["+km+"]"),Pm={bold:1,code:16,highlight:128,italic:2,strikethrough:fm,subscript:32,superscript:64,underline:hm},Rm={directionless:1,unmergeable:2},Om={center:gm,end:xm,justify:ym,left:mm,right:vm,start:bm},Nm={[gm]:"center",[xm]:"end",[ym]:"justify",[mm]:"left",[vm]:"right",[bm]:"start"},Am={normal:0,segmented:2,token:1},jm={[cm]:"normal",[dm]:"segmented",[um]:"token"};var Mm,Im=(Mm=function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;eLm;try{Rb(e,(()=>{const o=eb()||function(e){return e.getEditorState().read((()=>{const e=eb();return null!==e?e.clone():null}))}(e),i=new Map,s=e.getRootElement(),a=e._editorState,l=e._blockCursorElement;let c=!1,u="";for(let n=0;n0){let t=0;for(let o=0;o0)for(const[t,n]of i)if(Nb(n)){const r=n.getChildrenKeys();let o=t.firstChild;for(let n=0;n0){for(let t=0;t{$m(e,t,n)}))}function qm(e,t){const n=e.__mode,r=e.__format,o=e.__style,i=t.__mode,s=t.__format,a=t.__style;return!(null!==n&&n!==i||null!==r&&r!==s||null!==o&&o!==a)}function Ym(e,t){const n=e.mergeWithSibling(t),r=yb()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function Xm(e){let t,n,r=e;if(""!==r.__text||!r.isSimpleText()||r.isUnmergeable()){for(;null!==(t=r.getPreviousSibling())&&Ny(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(""!==t.__text){if(qm(t,r)){r=Ym(t,r);break}break}t.remove()}for(;null!==(n=r.getNextSibling())&&Ny(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(""!==n.__text){if(qm(r,n)){r=Ym(r,n);break}break}n.remove()}}else r.remove()}function Gm(e){for(;"element"===e.type;){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),Ny(r)){e.set(r.__key,o?r.getTextContentSize():0,"text");break}if(!Nb(r))break;e.set(r.__key,o?r.getChildrenSize():0,"element")}}let Jm=1;const Zm="function"==typeof queueMicrotask?queueMicrotask:e=>{Promise.resolve().then(e)};function Qm(e){const t=document.activeElement;if(null===t)return!1;const n=t.nodeName;return Mb(pg(e))&&("INPUT"===n||"TEXTAREA"===n||"true"===t.contentEditable&&null==rg(t))}function eg(e,t,n){const r=e.getRootElement();try{return null!==r&&r.contains(t)&&r.contains(n)&&null!==t&&!Qm(t)&&ng(t)===e}catch(e){return!1}}function tg(e){return e instanceof qb}function ng(e){let t=e;for(;null!=t;){const e=rg(t);if(tg(e))return e;t=Ug(t)}return null}function rg(e){return e?e.__lexicalEditor:null}function og(e){return e.isToken()||e.isSegmented()}function ig(e){return e.nodeType===sm}function sg(e){let t=e;for(;null!=t;){if(ig(t))return t;t=t.firstChild}return null}function ag(e,t,n){const r=Pm[t];if(null!==n&&(e&r)==(n&r))return e;let o=e^r;return"subscript"===t?o&=~Pm.superscript:"superscript"===t&&(o&=~Pm.subscript),o}function lg(e){const t=e.getParent();if(null!==t){const n=e.getWritable(),r=t.getWritable(),o=e.getPreviousSibling(),i=e.getNextSibling();if(null===o)if(null!==i){const e=i.getWritable();r.__first=i.__key,e.__prev=null}else r.__first=null;else{const e=o.getWritable();if(null!==i){const t=i.getWritable();t.__prev=e.__key,e.__next=t.__key}else e.__next=null;n.__prev=null}if(null===i)if(null!==o){const e=o.getWritable();r.__last=o.__key,e.__next=null}else r.__last=null;else{const e=i.getWritable();if(null!==o){const t=o.getWritable();t.__next=e.__key,e.__prev=t.__key}else e.__prev=null;n.__next=null}r.__size--,n.__parent=null}}function cg(e){gb();const t=e.getLatest(),n=t.__parent,r=vb(),o=yb(),i=r._nodeMap,s=o._dirtyElements;null!==n&&function(e,t,n){let r=e;for(;null!==r;){if(n.has(r))return;const e=t.get(r);if(void 0===e)break;n.set(r,!1),r=e.__parent}}(n,i,s);const a=t.__key;o._dirtyType=1,Nb(e)?s.set(a,!0):o._dirtyLeaves.add(a)}function ug(e){mb();const t=yb(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,null!==n){const e=fg(n);null!==e&&e.getWritable()}if(null!==e){const t=fg(e);null!==t&&t.getWritable()}}}function dg(){return pb()?null:yb()._compositionKey}function fg(e,t){const n=(t||vb())._nodeMap.get(e);return void 0===n?null:n}function hg(e,t){const n=e[`__lexicalKey_${yb()._key}`];return void 0!==n?fg(n,t):null}function pg(e,t){let n=e;for(;null!=n;){const e=hg(n,t);if(null!==e)return e;n=Ug(n)}return null}function mg(e){const t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function gg(e){return e.read((()=>vg().getTextContent()))}function vg(){return yg(vb())}function yg(e){return e._nodeMap.get("root")}function bg(e){mb();const t=vb();null!==e&&(e.dirty=!0,e.setCachedNodes(null)),t._selection=e}function xg(e){const t=yb(),n=function(e,t){let n=e;for(;null!=n;){const e=n[`__lexicalKey_${t._key}`];if(void 0!==e)return e;n=Ug(n)}return null}(e,t);return null===n?e===t.getRootElement()?fg("root"):null:fg(n)}function wg(e,t){return t?e.getTextContentSize():0}function _g(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function Eg(e){const t=[];let n=e;for(;null!==n;)t.push(n),n=n._parentEditor;return t}function Sg(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function kg(e){return e.nodeType===sm?e.nodeValue:null}function Cg(e,t,n){const r=Gg(t._window);if(null===r)return;const o=r.anchorNode;let{anchorOffset:i,focusOffset:s}=r;if(null!==o){let t=kg(o);const r=pg(o);if(null!==t&&Ny(r)){if(t===wm&&n){const e=n.length;t=n,i=e,s=e}null!==t&&Tg(r,t,i,s,e)}}}function Tg(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]===wm&&(a=t.slice(0,-1));const l=i.getTextContent();if(o||a!==l){if(""===a){if(ug(null),Qp||em||om)i.remove();else{const e=yb();setTimeout((()=>{e.update((()=>{i.isAttached()&&i.remove()}))}),20)}return}const t=i.getParent(),o=tb(),l=i.getTextContentSize(),c=dg(),u=i.getKey();if(i.isToken()||null!==c&&u===c&&!s||Vy(o)&&(null!==t&&!t.canInsertTextBefore()&&0===o.anchor.offset||o.anchor.key===e.__key&&0===o.anchor.offset&&!i.canInsertTextBefore()&&!s||o.focus.key===e.__key&&o.focus.offset===l&&!i.canInsertTextAfter()&&!s))return void i.markDirty();const d=eb();if(!Vy(d)||null===n||null===r)return void i.setTextContent(a);if(d.setTextNodeRange(i,n,i,r),i.isSegmented()){const e=Oy(i.getTextContent());i.replace(e),i=e}i.setTextContent(a)}}}function Pg(e){return"ArrowLeft"===e}function Rg(e){return"ArrowRight"===e}function Og(e,t){return Gp?e:t}function Ng(e){return"Enter"===e}function Ag(e){return"Backspace"===e}function jg(e){return"Delete"===e}function Mg(e,t,n){return"a"===e.toLowerCase()&&Og(t,n)}function Ig(e,t){void 0===e.__lexicalClassNameCache&&(e.__lexicalClassNameCache={});const n=e.__lexicalClassNameCache,r=n[t];if(void 0!==r)return r;const o=e[t];if("string"==typeof o){const e=Dm(o);return n[t]=e,e}return o}function Dg(e,t,n,r,o){if(0===n.size)return;const i=r.__type,s=r.__key,a=t.get(i);void 0===a&&Im(33,i);const l=a.klass;let c=e.get(l);void 0===c&&(c=new Map,e.set(l,c));const u=c.get(s),d="destroyed"===u&&"created"===o;(void 0===u||d)&&c.set(s,d?"updated":o)}function Lg(e,t,n){const r=e.getParent();let o=n,i=e;return null!==r&&(t&&0===n?(o=i.getIndexWithinParent(),i=r):t||n!==i.getChildrenSize()||(o=i.getIndexWithinParent()+1,i=r)),i.getChildAtIndex(t?o-1:o)}function Fg(e,t){const n=e.offset;if("element"===e.type)return Lg(e.getNode(),t,n);{const r=e.getNode();if(t&&0===n||!t&&n===r.getTextContentSize()){const e=t?r.getPreviousSibling():r.getNextSibling();return null===e?Lg(r.getParentOrThrow(),t,r.getIndexWithinParent()+(t?0:1)):e}}return null}function zg(e){const t=Kg(e).event,n=t&&t.inputType;return"insertFromPaste"===n||"insertFromPasteAsQuotation"===n}function Bg(e,t,n){return Cb(e,t,n)}function Vg(e){return!Db(e)&&!e.isLastChild()&&!e.isInline()}function Wg(e,t){const n=e._keyToDOMMap.get(t);return void 0===n&&Im(75,t),n}function Ug(e){const t=e.assignedSlot||e.parentElement;return null!==t&&11===t.nodeType?t.host:t}function $g(e,t){let n=e.getParent();for(;null!==n;){if(n.is(t))return!0;n=n.getParent()}return!1}function Kg(e){const t=e._window;return null===t&&Im(78),t}function Hg(e){return Db(e)||Nb(e)&&e.isShadowRoot()}function qg(e){const t=yb(),n=e.constructor.getType(),r=t._nodes.get(n);void 0===r&&Im(97);const o=r.replace;if(null!==o){const t=o(e);return t instanceof e.constructor||Im(98),t}return e}function Yg(e,t){!Db(e.getParent())||Nb(t)||Mb(t)||Im(99)}function Xg(e){return(Mb(e)||Nb(e)&&!e.canBeEmpty())&&!e.isInline()}function _n(e,t,n){n.style.removeProperty("caret-color"),t._blockCursorElement=null;const r=e.parentElement;null!==r&&r.removeChild(e)}function Gg(e){return Yp?(e||window).getSelection():null}function Jg(e){return 1===e.nodeType}function Zg(e){const t=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return null!==e.nodeName.match(t)}function Qg(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 null!==e.nodeName.match(t)}function ev(e){if(Db(e)||Mb(e)&&!e.isInline())return!0;if(!Nb(e)||Hg(e))return!1;const t=e.getFirstChild(),n=null===t||hy(t)||Ny(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}function tv(e,t){let n=e;for(;null!==n&&null!==n.getParent()&&!t(n);)n=n.getParentOrThrow();return t(n)?n:null}const nv=new WeakMap,rv=new Map;function ov(e){const t=e.constructor.clone(e);return t.afterCloneFrom(e),t}function iv(e,t,n,r,o,i){let s=e.getFirstChild();for(;null!==s;){const e=s.__key;s.__parent===t&&(Nb(s)&&iv(s,e,n,r,o,i),n.has(e)||i.delete(e),o.push(e)),s=s.getNextSibling()}}let sv,av,lv,cv,uv,dv,fv,hv,pv,mv,gv="",vv="",yv=null,bv="",xv="",wv=!1,_v=!1,Ev=null;function Sv(e,t){const n=fv.get(e);if(null!==t){const n=zv(e);n.parentNode===t&&t.removeChild(n)}if(hv.has(e)||av._keyToDOMMap.delete(e),Nb(n)){const e=Iv(n,fv);kv(e,0,e.length-1,null)}void 0!==n&&Dg(mv,lv,cv,n,"destroyed")}function kv(e,t,n,r){let o=t;for(;o<=n;++o){const t=e[o];void 0!==t&&Sv(t,r)}}function Cv(e,t){e.setProperty("text-align",t)}const Tv="40px";function Pv(e,t){const n=sv.theme.indent;if("string"==typeof n){const r=e.classList.contains(n);t>0&&!r?e.classList.add(n):t<1&&r&&e.classList.remove(n)}const r=getComputedStyle(e).getPropertyValue("--lexical-indent-base-value")||Tv;e.style.setProperty("padding-inline-start",0===t?"":`calc(${t} * ${r})`)}function Rv(e,t){const n=e.style;0===t?Cv(n,""):t===mm?Cv(n,"left"):t===gm?Cv(n,"center"):t===vm?Cv(n,"right"):t===ym?Cv(n,"justify"):t===bm?Cv(n,"start"):t===xm&&Cv(n,"end")}function Ov(e,t,n){const r=hv.get(e);void 0===r&&Im(60);const o=r.createDOM(sv,av);if(function(e,t,n){const r=n._keyToDOMMap;t["__lexicalKey_"+n._key]=e,r.set(e,t)}(e,o,av),Ny(r)?o.setAttribute("data-lexical-text","true"):Mb(r)&&o.setAttribute("data-lexical-decorator","true"),Nb(r)){const e=r.__indent,t=r.__size;if(0!==e&&Pv(o,e),0!==t){const e=t-1;!function(e,t,n,r){const o=vv;vv="",Nv(e,n,0,t,r,null),Mv(n,r),vv=o}(Iv(r,hv),e,r,o)}const n=r.__format;0!==n&&Rv(o,n),r.isInline()||jv(null,r,o),Vg(r)&&(gv+=_m,xv+=_m)}else{const t=r.getTextContent();if(Mb(r)){const t=r.decorate(av,sv);null!==t&&Lv(e,t),o.contentEditable="false"}else Ny(r)&&(r.isDirectionless()||(vv+=t));gv+=t,xv+=t}if(null!==t)if(null!=n)t.insertBefore(o,n);else{const e=t.__lexicalLineBreak;null!=e?t.insertBefore(o,e):t.appendChild(o)}return Dg(mv,lv,cv,r,"created"),o}function Nv(e,t,n,r,o,i){const s=gv;gv="";let a=n;for(;a<=r;++a){Ov(e[a],o,i);const t=hv.get(e[a]);null!==t&&Ny(t)&&(null===yv&&(yv=t.getFormat()),""===bv&&(bv=t.getStyle()))}Vg(t)&&(gv+=_m),o.__lexicalTextContent=gv,gv=s+gv}function Av(e,t){const n=t.get(e);return hy(n)||Mb(n)&&n.isInline()}function jv(e,t,n){const r=null!==e&&(0===e.__size||Av(e.__last,fv)),o=0===t.__size||Av(t.__last,hv);if(r){if(!o){const e=n.__lexicalLineBreak;if(null!=e)try{n.removeChild(e)}catch(t){if("object"==typeof t&&null!=t){const r=`${t.toString()} Parent: ${n.tagName}, child: ${e.tagName}.`;throw new Error(r)}throw t}n.__lexicalLineBreak=null}}else if(o){const e=document.createElement("br");n.__lexicalLineBreak=e,n.appendChild(e)}}function Mv(e,t){const n=t.__lexicalDirTextContent,r=t.__lexicalDir;if(n!==vv||r!==Ev){const n=""===vv,i=n?Ev:(o=vv,Cm.test(o)?"rtl":Tm.test(o)?"ltr":null);if(i!==r){const o=t.classList,s=sv.theme;let a=null!==r?s[r]:void 0,l=null!==i?s[i]:void 0;if(void 0!==a){if("string"==typeof a){const e=Dm(a);a=s[r]=e}o.remove(...a)}if(null===i||n&&"ltr"===i)t.removeAttribute("dir");else{if(void 0!==l){if("string"==typeof l){const e=Dm(l);l=s[i]=e}void 0!==l&&o.add(...l)}t.dir=i}_v||(e.getWritable().__dir=i)}Ev=i,t.__lexicalDirTextContent=vv,t.__lexicalDir=i}var o}function Iv(e,t){const n=[];let r=e.__first;for(;null!==r;){const e=t.get(r);void 0===e&&Im(101),n.push(r),r=e.__next}return n}function Dv(e,t){const n=fv.get(e);let r=hv.get(e);void 0!==n&&void 0!==r||Im(61);const o=wv||dv.has(e)||uv.has(e),i=Wg(av,e);if(n===r&&!o){if(Nb(n)){const e=i.__lexicalTextContent;void 0!==e&&(gv+=e,xv+=e);const t=i.__lexicalDirTextContent;void 0!==t&&(vv+=t)}else{const e=n.getTextContent();Ny(n)&&!n.isDirectionless()&&(vv+=e),xv+=e,gv+=e}return i}if(n!==r&&o&&Dg(mv,lv,cv,r,"updated"),r.updateDOM(n,i,sv)){const n=Ov(e,null,null);return null===t&&Im(62),t.replaceChild(n,i),Sv(e,null),n}if(Nb(n)&&Nb(r)){const e=r.__indent;e!==n.__indent&&Pv(i,e);const t=r.__format;t!==n.__format&&Rv(i,t),o&&(function(e,t,n){const r=vv;var o;vv="",yv=null,bv="",function(e,t,n){const r=gv,o=e.__size,i=t.__size;if(gv="",1===o&&1===i){const r=e.__first,o=t.__first;if(r===o)Dv(r,n);else{const e=zv(r),t=Ov(o,null,null);try{n.replaceChild(t,e)}catch(i){if("object"==typeof i&&null!=i){const s=`${i.toString()} Parent: ${n.tagName}, new child: {tag: ${t.tagName} key: ${o}}, old child: {tag: ${e.tagName}, key: ${r}}.`;throw new Error(s)}throw i}Sv(r,null)}const s=hv.get(o);Ny(s)&&(null===yv&&(yv=s.getFormat()),""===bv&&(bv=s.getStyle()))}else{const r=Iv(e,fv),s=Iv(t,hv);if(0===o)0!==i&&Nv(s,t,0,i-1,n,null);else if(0===i){if(0!==o){const e=null==n.__lexicalLineBreak;kv(r,0,o-1,e?null:n),e&&(n.textContent="")}}else!function(e,t,n,r,o,i){const s=r-1,a=o-1;let l,c,u=i.firstChild,d=0,f=0;for(;d<=s&&f<=a;){const e=t[d],r=n[f];if(e===r)u=Fv(Dv(r,i)),d++,f++;else{void 0===l&&(l=new Set(t)),void 0===c&&(c=new Set(n));const o=c.has(e),s=l.has(r);if(o)if(s){const e=Wg(av,r);e===u?u=Fv(Dv(r,i)):(null!=u?i.insertBefore(e,u):i.appendChild(e),Dv(r,i)),d++,f++}else Ov(r,i,u),f++;else u=Fv(zv(e)),Sv(e,i),d++}const o=hv.get(r);null!==o&&Ny(o)&&(null===yv&&(yv=o.getFormat()),""===bv&&(bv=o.getStyle()))}const h=d>s,p=f>a;if(h&&!p){const t=n[a+1];Nv(n,e,f,a,i,void 0===t?null:av.getElementByKey(t))}else p&&!h&&kv(t,d,s,i)}(t,r,s,o,i,n)}Vg(t)&&(gv+=_m),n.__lexicalTextContent=gv,gv=r+gv}(e,t,n),Mv(t,n),$b(o=t)&&null!=yv&&yv!==o.__textFormat&&!_v&&(o.setTextFormat(yv),o.setTextStyle(bv)),function(e){$b(e)&&""!==bv&&bv!==e.__textStyle&&!_v&&e.setTextStyle(bv)}(t),vv=r}(n,r,i),Db(r)||r.isInline()||jv(n,r,i)),Vg(r)&&(gv+=_m,xv+=_m)}else{const t=r.getTextContent();if(Mb(r)){const t=r.decorate(av,sv);null!==t&&Lv(e,t)}else Ny(r)&&!r.isDirectionless()&&(vv+=t);gv+=t,xv+=t}if(!_v&&Db(r)&&r.__cachedText!==xv){const e=r.getWritable();e.__cachedText=xv,r=e}return i}function Lv(e,t){let n=av._pendingDecorators;const r=av._decorators;if(null===n){if(r[e]===t)return;n=mg(av)}n[e]=t}function Fv(e){let t=e.nextSibling;return null!==t&&t===av._blockCursorElement&&(t=t.nextSibling),t}function zv(e){const t=pv.get(e);return void 0===t&&Im(75,e),t}const Bv=Object.freeze({}),Vv=[["keydown",function(e,t){if(Wv=e.timeStamp,Uv=e.key,t.isComposing())return;const{key:n,shiftKey:r,ctrlKey:o,metaKey:i,altKey:s}=e;Bg(t,wp,e)||null!=n&&(function(e,t,n,r){return Rg(e)&&!t&&!r&&!n}(n,o,s,i)?Bg(t,_p,e):function(e,t,n,r,o){return Rg(e)&&!r&&!n&&(t||o)}(n,o,r,s,i)?Bg(t,Ep,e):function(e,t,n,r){return Pg(e)&&!t&&!r&&!n}(n,o,s,i)?Bg(t,Sp,e):function(e,t,n,r,o){return Pg(e)&&!r&&!n&&(t||o)}(n,o,r,s,i)?Bg(t,kp,e):function(e,t,n){return function(e){return"ArrowUp"===e}(e)&&!t&&!n}(n,o,i)?Bg(t,Cp,e):function(e,t,n){return function(e){return"ArrowDown"===e}(e)&&!t&&!n}(n,o,i)?Bg(t,Tp,e):function(e,t){return Ng(e)&&t}(n,r)?(Xv=!0,Bg(t,Pp,e)):function(e){return" "===e}(n)?Bg(t,Rp,e):function(e,t){return Gp&&t&&"o"===e.toLowerCase()}(n,o)?(e.preventDefault(),Xv=!0,Bg(t,dp,!0)):function(e,t){return Ng(e)&&!t}(n,r)?(Xv=!1,Bg(t,Pp,e)):function(e,t,n,r){return Gp?!t&&!n&&(Ag(e)||"h"===e.toLowerCase()&&r):!(r||t||n)&&Ag(e)}(n,s,i,o)?Ag(n)?Bg(t,Op,e):(e.preventDefault(),Bg(t,up,!0)):function(e){return"Escape"===e}(n)?Bg(t,Np,e):function(e,t,n,r,o){return Gp?!(n||r||o)&&(jg(e)||"d"===e.toLowerCase()&&t):!(t||r||o)&&jg(e)}(n,o,r,s,i)?jg(n)?Bg(t,Ap,e):(e.preventDefault(),Bg(t,up,!1)):function(e,t,n){return Ag(e)&&(Gp?t:n)}(n,s,o)?(e.preventDefault(),Bg(t,gp,!0)):function(e,t,n){return jg(e)&&(Gp?t:n)}(n,s,o)?(e.preventDefault(),Bg(t,gp,!1)):function(e,t){return Gp&&t&&Ag(e)}(n,i)?(e.preventDefault(),Bg(t,vp,!0)):function(e,t){return Gp&&t&&jg(e)}(n,i)?(e.preventDefault(),Bg(t,vp,!1)):function(e,t,n,r){return"b"===e.toLowerCase()&&!t&&Og(n,r)}(n,s,i,o)?(e.preventDefault(),Bg(t,yp,"bold")):function(e,t,n,r){return"u"===e.toLowerCase()&&!t&&Og(n,r)}(n,s,i,o)?(e.preventDefault(),Bg(t,yp,"underline")):function(e,t,n,r){return"i"===e.toLowerCase()&&!t&&Og(n,r)}(n,s,i,o)?(e.preventDefault(),Bg(t,yp,"italic")):function(e,t,n,r){return"Tab"===e&&!t&&!n&&!r}(n,s,o,i)?Bg(t,jp,e):function(e,t,n,r){return"z"===e.toLowerCase()&&!t&&Og(n,r)}(n,r,i,o)?(e.preventDefault(),Bg(t,bp,void 0)):function(e,t,n,r){return Gp?"z"===e.toLowerCase()&&n&&t:"y"===e.toLowerCase()&&r||"z"===e.toLowerCase()&&r&&t}(n,r,i,o)?(e.preventDefault(),Bg(t,xp,void 0)):Uy(t._editorState._selection)?function(e,t,n,r){return!t&&"c"===e.toLowerCase()&&(Gp?n:r)}(n,r,i,o)?(e.preventDefault(),Bg(t,Fp,e)):function(e,t,n,r){return!t&&"x"===e.toLowerCase()&&(Gp?n:r)}(n,r,i,o)?(e.preventDefault(),Bg(t,zp,e)):Mg(n,i,o)&&(e.preventDefault(),Bg(t,Bp,e)):!Jp&&Mg(n,i,o)&&(e.preventDefault(),Bg(t,Bp,e)),function(e,t,n,r){return e||t||n||r}(o,r,s,i)&&Bg(t,qp,e))}],["pointerdown",function(e,t){const n=e.target,r=e.pointerType;n instanceof Node&&"touch"!==r&&Rb(t,(()=>{Mb(pg(n))||(Yv=!0)}))}],["compositionstart",function(e,t){Rb(t,(()=>{const n=eb();if(Vy(n)&&!t.isComposing()){const r=n.anchor,o=n.anchor.getNode();ug(r.key),(e.timeStamp{ny(t,e.data)}))}],["input",function(e,t){e.stopPropagation(),Rb(t,(()=>{const n=eb(),r=e.data,o=ty(e);if(null!=r&&Vy(n)&&Zv(n,o,r,e.timeStamp,!1)){Gv&&(ny(t,r),Gv=!1);const o=n.anchor.getNode(),i=Gg(t._window);if(null===i)return;const s=n.isBackward(),a=s?n.anchor.offset:n.focus.offset,l=s?n.focus.offset:n.anchor.offset;Zp&&!n.isCollapsed()&&Ny(o)&&null!==i.anchorNode&&o.getTextContent().slice(0,a)+r+o.getTextContent().slice(a+l)===kg(i.anchorNode)||Bg(t,hp,r);const c=r.length;Jp&&c>1&&"insertCompositionText"===e.inputType&&!t.isComposing()&&(n.anchor.offset-=c),Qp||em||om||!t.isComposing()||(Wv=0,ug(null))}else Cg(!1,t,null!==r?r:void 0),Gv&&(ny(t,r||void 0),Gv=!1);mb(),Km(yb())})),Kv=null}],["click",function(e,t){Rb(t,(()=>{const n=eb(),r=Gg(t._window),o=tb();if(r)if(Vy(n)){const t=n.anchor,i=t.getNode();"element"===t.type&&0===t.offset&&n.isCollapsed()&&!Db(i)&&1===vg().getChildrenSize()&&i.getTopLevelElementOrThrow().isEmpty()&&null!==o&&n.is(o)?(r.removeAllRanges(),n.dirty=!0):3!==e.detail||n.isCollapsed()||i!==n.focus.getNode()&&(Nb(i)?i.select(0):i.getParentOrThrow().select(0))}else if("touch"===e.pointerType){const n=r.anchorNode;if(null!==n){const i=n.nodeType;i!==im&&i!==sm||bg(Qy(o,r,t,e))}}Bg(t,cp,e)}))}],["cut",Bv],["copy",Bv],["dragstart",Bv],["dragover",Bv],["dragend",Bv],["paste",Bv],["focus",Bv],["blur",Bv],["drop",Bv]];Zp&&Vv.push(["beforeinput",(e,t)=>function(e,t){const n=e.inputType,r=ty(e);"deleteCompositionText"===n||Jp&&zg(t)||"insertCompositionText"!==n&&Rb(t,(()=>{const o=eb();if("deleteContentBackward"===n){if(null===o){const e=tb();if(!Vy(e))return;bg(e.clone())}if(Vy(o)){const n=o.anchor.key===o.focus.key;if(i=e.timeStamp,"MediaLast"===Uv&&i{Rb(t,(()=>{ug(null)}))}),30),Vy(o)){const e=o.anchor.getNode();e.markDirty(),o.format=e.getFormat(),Ny(e)||Im(142),o.style=e.getStyle()}}else{ug(null),e.preventDefault();const r=o.anchor.getNode().getTextContent(),i=0===o.anchor.offset&&o.focus.offset===r.length;rm&&n&&!i||Bg(t,up,!0)}return}}var i;if(!Vy(o))return;const s=e.data;null!==Kv&&Cg(!1,t,Kv),o.dirty&&null===Kv||!o.isCollapsed()||Db(o.anchor.getNode())||null===r||o.applyDOMRange(r),Kv=null;const a=o.anchor,l=o.focus,c=a.getNode(),u=l.getNode();if("insertText"!==n&&"insertTranspose"!==n)switch(e.preventDefault(),n){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":Bg(t,hp,e);break;case"insertFromComposition":ug(null),Bg(t,hp,e);break;case"insertLineBreak":ug(null),Bg(t,dp,!1);break;case"insertParagraph":ug(null),Xv&&!em?(Xv=!1,Bg(t,dp,!1)):Bg(t,fp,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":Bg(t,pp,e);break;case"deleteByComposition":(function(e,t){return e!==t||Nb(e)||Nb(t)||!e.isToken()||!t.isToken()})(c,u)&&Bg(t,mp,e);break;case"deleteByDrag":case"deleteByCut":Bg(t,mp,e);break;case"deleteContent":Bg(t,up,!1);break;case"deleteWordBackward":Bg(t,gp,!0);break;case"deleteWordForward":Bg(t,gp,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":Bg(t,vp,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":Bg(t,vp,!1);break;case"formatStrikeThrough":Bg(t,yp,"strikethrough");break;case"formatBold":Bg(t,yp,"bold");break;case"formatItalic":Bg(t,yp,"italic");break;case"formatUnderline":Bg(t,yp,"underline");break;case"historyUndo":Bg(t,bp,void 0);break;case"historyRedo":Bg(t,xp,void 0)}else{if("\n"===s)e.preventDefault(),Bg(t,dp,!1);else if(s===_m)e.preventDefault(),Bg(t,fp,void 0);else if(null==s&&e.dataTransfer){const t=e.dataTransfer.getData("text/plain");e.preventDefault(),o.insertRawText(t)}else null!=s&&Zv(o,r,s,e.timeStamp,!0)?(e.preventDefault(),Bg(t,hp,s)):Kv=s;$v=e.timeStamp}}))}(e,t)]);let Wv=0,Uv=null,$v=0,Kv=null;const Hv=new WeakMap;let qv=!1,Yv=!1,Xv=!1,Gv=!1,Jv=[0,"",0,"root",0];function Zv(e,t,n,r,o){const i=e.anchor,s=e.focus,a=i.getNode(),l=yb(),c=Gg(l._window),u=null!==c?c.anchorNode:null,d=i.key,f=l.getElementByKey(d),h=n.length;return d!==s.key||!Ny(a)||(!o&&(!Zp||$v1||(o||!Zp)&&null!==f&&!a.isComposing()&&u!==sg(f)||null!==c&&null!==t&&(!t.collapsed||t.startContainer!==c.anchorNode||t.startOffset!==c.anchorOffset)||a.getFormat()!==e.format||a.getStyle()!==e.style||function(e,t){if(t.isSegmented())return!0;if(!e.isCollapsed())return!1;const n=e.anchor.offset,r=t.getParentOrThrow(),o=t.isToken();return 0===n?!t.canInsertTextBefore()||!r.canInsertTextBefore()&&!t.isComposing()||o||function(e){const t=e.getPreviousSibling();return(Ny(t)||Nb(t)&&t.isInline())&&!t.canInsertTextAfter()}(t):n===t.getTextContentSize()&&(!t.canInsertTextAfter()||!r.canInsertTextAfter()&&!t.isComposing()||o)}(e,a)}function Qv(e,t){return null!==e&&null!==e.nodeValue&&e.nodeType===sm&&0!==t&&t!==e.nodeValue.length}function ey(e,t,n){const{anchorNode:r,anchorOffset:o,focusNode:i,focusOffset:s}=e;qv&&(qv=!1,Qv(r,o)&&Qv(i,s))||Rb(t,(()=>{if(!n)return void bg(null);if(!eg(t,r,i))return;const a=eb();if(Vy(a)){const n=a.anchor,r=n.getNode();if(a.isCollapsed()){"Range"===e.type&&e.anchorNode===e.focusNode&&(a.dirty=!0);const o=Kg(t).event,i=o?o.timeStamp:performance.now(),[s,l,c,u,d]=Jv,f=vg(),h=!1===t.isComposing()&&""===f.getTextContent();if(i{const t=tb(),o=n.anchorNode;if(null===o)return;const i=o.nodeType;i!==im&&i!==sm||bg(Qy(t,n,r,e))})));const o=Eg(r),i=o[o.length-1],s=i._key,a=oy.get(s),l=a||i;l!==r&&ey(n,l,!1),ey(n,r,!0),r!==i?oy.set(s,r):a&&oy.delete(s)}function sy(e){e._lexicalHandled=!0}function ay(e){return!0===e._lexicalHandled}function ly(e,t,n){mb();const r=e.__key,o=e.getParent();if(null===o)return;const i=function(e){const t=eb();if(!Vy(t)||!Nb(e))return t;const{anchor:n,focus:r}=t,o=n.getNode(),i=r.getNode();return $g(o,e)&&n.set(e.__key,0,"element"),$g(i,e)&&r.set(e.__key,0,"element"),t}(e);let s=!1;if(Vy(i)&&t){const t=i.anchor,n=i.focus;t.key===r&&(ob(t,e,o,e.getPreviousSibling(),e.getNextSibling()),s=!0),n.key===r&&(ob(n,e,o,e.getPreviousSibling(),e.getNextSibling()),s=!0)}else Uy(i)&&t&&e.isSelected()&&e.selectPrevious();if(Vy(i)&&t&&!s){const t=e.getIndexWithinParent();lg(e),nb(i,o,t,-1)}else lg(e);n||Hg(o)||o.canBeEmpty()||!o.isEmpty()||ly(o,t),t&&Db(o)&&o.isEmpty()&&o.selectEnd()}class cy{static getType(){Im(64,this.name)}static clone(e){Im(65,this.name)}afterCloneFrom(e){this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev}constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,function(e,t){if(null!=t)return void(e.__key=t);mb(),gb();const n=yb(),r=vb(),o=""+Jm++;r._nodeMap.set(o,e),Nb(e)?n._dirtyElements.set(o,!0):n._dirtyLeaves.add(o),n._cloneNotNeeded.add(o),n._dirtyType=1,e.__key=o}(this,e)}getType(){return this.__type}isInline(){Im(137,this.constructor.name)}isAttached(){let e=this.__key;for(;null!==e;){if("root"===e)return!0;const t=fg(e);if(null===t)break;e=t.__parent}return!1}isSelected(e){const t=e||eb();if(null==t)return!1;const n=t.getNodes().some((e=>e.__key===this.__key));if(Ny(this))return n;if(Vy(t)&&"element"===t.anchor.type&&"element"===t.focus.type){if(t.isCollapsed())return!1;const e=this.getParent();if(Mb(this)&&this.isInline()&&e){const n=t.isBackward()?t.focus:t.anchor,r=n.getNode();if(n.offset===r.getChildrenSize()&&r.is(e)&&r.getLastChildOrThrow().is(this))return!1}}return n}getKey(){return this.__key}getIndexWithinParent(){const e=this.getParent();if(null===e)return-1;let t=e.getFirstChild(),n=0;for(;null!==t;){if(this.is(t))return n;n++,t=t.getNextSibling()}return-1}getParent(){const e=this.getLatest().__parent;return null===e?null:fg(e)}getParentOrThrow(){const e=this.getParent();return null===e&&Im(66,this.__key),e}getTopLevelElement(){let e=this;for(;null!==e;){const t=e.getParent();if(Hg(t))return Nb(e)||e===this&&Mb(e)||Im(194),e;e=t}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();return null===e&&Im(67,this.__key),e}getParents(){const e=[];let t=this.getParent();for(;null!==t;)e.push(t),t=t.getParent();return e}getParentKeys(){const e=[];let t=this.getParent();for(;null!==t;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){const e=this.getLatest().__prev;return null===e?null:fg(e)}getPreviousSiblings(){const e=[],t=this.getParent();if(null===t)return e;let n=t.getFirstChild();for(;null!==n&&!n.is(this);)e.push(n),n=n.getNextSibling();return e}getNextSibling(){const e=this.getLatest().__next;return null===e?null:fg(e)}getNextSiblings(){const e=[];let t=this.getNextSibling();for(;null!==t;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){const t=this.getParents(),n=e.getParents();Nb(this)&&t.unshift(this),Nb(e)&&n.unshift(e);const r=t.length,o=n.length;if(0===r||0===o||t[r-1]!==n[o-1])return null;const i=new Set(n);for(let e=0;e{s.append(e)}))),Vy(n)){bg(n);const e=n.anchor,t=n.focus;e.key===o&&Fy(e,s),t.key===o&&Fy(t,s)}return dg()===o&&ug(i),s}insertAfter(e,t=!0){mb(),Yg(this,e);const n=this.getWritable(),r=e.getWritable(),o=r.getParent(),i=eb();let s=!1,a=!1;if(null!==o){const t=e.getIndexWithinParent();if(lg(r),Vy(i)){const e=o.__key,n=i.anchor,r=i.focus;s="element"===n.type&&n.key===e&&n.offset===t+1,a="element"===r.type&&r.key===e&&r.offset===t+1}}const l=this.getNextSibling(),c=this.getParentOrThrow().getWritable(),u=r.__key,d=n.__next;if(null===l?c.__last=u:l.getWritable().__prev=u,c.__size++,n.__next=u,r.__next=d,r.__prev=n.__key,r.__parent=n.__parent,t&&Vy(i)){const e=this.getIndexWithinParent();nb(i,c,e+1);const t=c.__key;s&&i.anchor.set(t,e+2,"element"),a&&i.focus.set(t,e+2,"element")}return e}insertBefore(e,t=!0){mb(),Yg(this,e);const n=this.getWritable(),r=e.getWritable(),o=r.__key;lg(r);const i=this.getPreviousSibling(),s=this.getParentOrThrow().getWritable(),a=n.__prev,l=this.getIndexWithinParent();null===i?s.__first=o:i.getWritable().__next=o,s.__size++,n.__prev=o,r.__prev=a,r.__next=n.__key,r.__parent=n.__parent;const c=eb();return t&&Vy(c)&&nb(c,this.getParentOrThrow(),l),e}isParentRequired(){return!1}createParentElementNode(){return Ub()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){mb();const n=this.getPreviousSibling(),r=this.getParentOrThrow();if(null===n)return r.select(0,0);if(Nb(n))return n.select();if(!Ny(n)){const e=n.getIndexWithinParent()+1;return r.select(e,e)}return n.select(e,t)}selectNext(e,t){mb();const n=this.getNextSibling(),r=this.getParentOrThrow();if(null===n)return r.select();if(Nb(n))return n.select(0,0);if(!Ny(n)){const e=n.getIndexWithinParent();return r.select(e,e)}return n.select(e,t)}markDirty(){this.getWritable()}}class uy extends cy{static getType(){return"linebreak"}static clone(e){return new uy(e.__key)}constructor(e){super(e)}getTextContent(){return"\n"}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:e=>function(e){const t=e.parentElement;if(null!==t&&Qg(t)){const n=t.firstChild;if(n===e||n.nextSibling===e&&py(n)){const n=t.lastChild;if(n===e||n.previousSibling===e&&py(n))return!0}}return!1}(e)||function(e){const t=e.parentElement;if(null!==t&&Qg(t)){const n=t.firstChild;if(n===e||n.nextSibling===e&&py(n))return!1;const r=t.lastChild;if(r===e||r.previousSibling===e&&py(r))return!0}return!1}(e)?null:{conversion:dy,priority:0}}}static importJSON(e){return fy()}exportJSON(){return{type:"linebreak",version:1}}}function dy(e){return{node:fy()}}function fy(){return qg(new uy)}function hy(e){return e instanceof uy}function py(e){return e.nodeType===sm&&/^( |\t|\r?\n)+$/.test(e.textContent||"")}function my(e,t){return 16&t?"code":128&t?"mark":32&t?"sub":64&t?"sup":null}function gy(e,t){return 1&t?"strong":2&t?"em":"span"}function vy(e,t,n,r,o){const i=r.classList;let s=Ig(o,"base");void 0!==s&&i.add(...s),s=Ig(o,"underlineStrikethrough");let a=!1;const l=t&hm&&t&fm;void 0!==s&&(n&hm&&n&fm?(a=!0,l||i.add(...s)):l&&i.remove(...s));for(const e in Pm){const r=Pm[e];if(s=Ig(o,e),void 0!==s)if(n&r){if(a&&("underline"===e||"strikethrough"===e)){t&r&&i.remove(...s);continue}t&r&&(!l||"underline"!==e)&&"strikethrough"!==e||i.add(...s)}else t&r&&i.remove(...s)}}function yy(e,t,n){const r=t.firstChild,o=n.isComposing(),i=e+(o?wm:"");if(null==r)t.textContent=i;else{const e=r.nodeValue;if(e!==i)if(o||Jp){const[t,n,o]=function(e,t){const n=e.length,r=t.length;let o=0,i=0;for(;o({conversion:Cy,priority:0}),b:()=>({conversion:Ey,priority:0}),code:()=>({conversion:Ry,priority:0}),em:()=>({conversion:Ry,priority:0}),i:()=>({conversion:Ry,priority:0}),s:()=>({conversion:Ry,priority:0}),span:()=>({conversion:_y,priority:0}),strong:()=>({conversion:Ry,priority:0}),sub:()=>({conversion:Ry,priority:0}),sup:()=>({conversion:Ry,priority:0}),u:()=>({conversion:Ry,priority:0})}}static importJSON(e){const t=Oy(e.text);return t.setFormat(e.format),t.setDetail(e.detail),t.setMode(e.mode),t.setStyle(e.style),t}exportDOM(e){let{element:t}=super.exportDOM(e);return null!==t&&Jg(t)||Im(132),t.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(t=xy(t,"b")),this.hasFormat("italic")&&(t=xy(t,"i")),this.hasFormat("strikethrough")&&(t=xy(t,"s")),this.hasFormat("underline")&&(t=xy(t,"u")),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),type:"text",version:1}}selectionTransform(e,t){}setFormat(e){const t=this.getWritable();return t.__format="string"==typeof e?Pm[e]:e,t}setDetail(e){const t=this.getWritable();return t.__detail="string"==typeof e?Rm[e]:e,t}setStyle(e){const t=this.getWritable();return t.__style=e,t}toggleFormat(e){const t=ag(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){const e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){const e=this.getWritable();return e.__detail^=2,e}setMode(e){const t=Am[e];if(this.__mode===t)return this;const n=this.getWritable();return n.__mode=t,n}setTextContent(e){if(this.__text===e)return this;const t=this.getWritable();return t.__text=e,t}select(e,t){mb();let n=e,r=t;const o=eb(),i=this.getTextContent(),s=this.__key;if("string"==typeof i){const e=i.length;void 0===n&&(n=e),void 0===r&&(r=e)}else n=0,r=0;if(!Vy(o))return Jy(s,n,s,r,"text","text");{const e=dg();e!==o.anchor.key&&e!==o.focus.key||ug(s),o.setTextNodeRange(this,n,this,r)}return o}selectStart(){return this.select(0,0)}selectEnd(){const e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,n,r){const o=this.getWritable(),i=o.__text,s=n.length;let a=e;a<0&&(a=s+a,a<0&&(a=0));const l=eb();if(r&&Vy(l)){const t=e+s;l.setTextNodeRange(o,t,o,t)}const c=i.slice(0,a)+n+i.slice(a+t);return o.__text=c,o}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){mb();const t=this.getLatest(),n=t.getTextContent(),r=t.__key,o=dg(),i=new Set(e),s=[],a=n.length;let l="";for(let e=0;eb&&e.offset<=l&&(e.key=a,e.offset-=b,v.dirty=!0),t.key===r&&"text"===t.type&&t.offset>b&&t.offset<=l&&(t.key=a,t.offset-=b,v.dirty=!0)}o===r&&ug(a),b=l,y.push(i)}if(null!==d){!function(e){const t=e.getPreviousSibling(),n=e.getNextSibling();null!==t&&cg(t),null!==n&&cg(n)}(this);const e=d.getWritable(),t=this.getIndexWithinParent();g?(e.splice(t,0,y),this.remove()):e.splice(t,1,y),Vy(v)&&nb(v,d,t,c-1)}return y}mergeWithSibling(e){const t=e===this.getPreviousSibling();t||e===this.getNextSibling()||Im(50);const n=this.__key,r=e.__key,o=this.__text,i=o.length;dg()===r&&ug(n);const s=eb();if(Vy(s)){const o=s.anchor,a=s.focus;null!==o&&o.key===r&&(ib(o,t,n,e,i),s.dirty=!0),null!==a&&a.key===r&&(ib(a,t,n,e,i),s.dirty=!0)}const a=e.__text,l=t?a+o:o+a;this.setTextContent(l);const c=this.getWritable();return e.remove(),c}isTextEntity(){return!1}}function _y(e){return{forChild:Ay(e.style),node:null}}function Ey(e){const t=e,n="normal"===t.style.fontWeight;return{forChild:Ay(t.style,n?void 0:"bold"),node:null}}const Sy=new WeakMap;function ky(e){return"PRE"===e.nodeName||e.nodeType===im&&void 0!==e.style&&void 0!==e.style.whiteSpace&&e.style.whiteSpace.startsWith("pre")}function Cy(e){const t=e;null===e.parentElement&&Im(129);let n=t.textContent||"";if(null!==function(e){let t,n=e.parentNode;const r=[e];for(;null!==n&&void 0===(t=Sy.get(n))&&!ky(n);)r.push(n),n=n.parentNode;const o=void 0===t?n:t;for(let e=0;e0){/[ \t\n]$/.test(t)&&(n=n.slice(1)),r=!1;break}}r&&(n=n.slice(1))}if(" "===n[n.length-1]){let e=t,r=!0;for(;null!==e&&null!==(e=Ty(e,!0));)if((e.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){r=!1;break}r&&(n=n.slice(0,n.length-1))}return""===n?{node:null}:{node:Oy(n)}}function Ty(e,t){let n=e;for(;;){let e;for(;null===(e=t?n.nextSibling:n.previousSibling);){const e=n.parentElement;if(null===e)return null;n=e}if(n=e,n.nodeType===im){const e=n.style.display;if(""===e&&!Zg(n)||""!==e&&!e.startsWith("inline"))return null}let r=n;for(;null!==(r=t?n.firstChild:n.lastChild);)n=r;if(n.nodeType===sm)return n;if("BR"===n.nodeName)return null}}const Py={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function Ry(e){const t=Py[e.nodeName.toLowerCase()];return void 0===t?{node:null}:{forChild:Ay(e.style,t),node:null}}function Oy(e=""){return qg(new wy(e))}function Ny(e){return e instanceof wy}function Ay(e,t){const n=e.fontWeight,r=e.textDecoration.split(" "),o="700"===n||"bold"===n,i=r.includes("line-through"),s="italic"===e.fontStyle,a=r.includes("underline"),l=e.verticalAlign;return e=>Ny(e)?(o&&!e.hasFormat("bold")&&e.toggleFormat("bold"),i&&!e.hasFormat("strikethrough")&&e.toggleFormat("strikethrough"),s&&!e.hasFormat("italic")&&e.toggleFormat("italic"),a&&!e.hasFormat("underline")&&e.toggleFormat("underline"),"sub"!==l||e.hasFormat("subscript")||e.toggleFormat("subscript"),"super"!==l||e.hasFormat("superscript")||e.toggleFormat("superscript"),t&&!e.hasFormat(t)&&e.toggleFormat(t),e):e}class jy extends wy{static getType(){return"tab"}static clone(e){return new jy(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text}constructor(e){super("\t",e),this.__detail=2}static importDOM(){return null}static importJSON(e){const t=My();return t.setFormat(e.format),t.setStyle(e.style),t}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(e){Im(126)}setDetail(e){Im(127)}setMode(e){Im(128)}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function My(){return qg(new jy)}class Iy{constructor(e,t,n){this._selection=null,this.key=e,this.offset=t,this.type=n}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){let t=this.getNode(),n=e.getNode();const r=this.offset,o=e.offset;if(Nb(t)){const e=t.getDescendantByIndex(r);t=null!=e?e:t}if(Nb(n)){const e=n.getDescendantByIndex(o);n=null!=e?e:n}return t===n?re&&(r=e)}else if(!Nb(t)){const e=t.getNextSibling();if(Ny(e))n=e.__key,r=0,o="text";else{const e=t.getParent();e&&(n=e.__key,r=t.getIndexWithinParent()+1)}}e.set(n,r,o)}function Fy(e,t){if(Nb(t)){const n=t.getLastDescendant();Nb(n)||Ny(n)?Ly(e,n):Ly(e,t)}else Ly(e,t)}function zy(e,t,n,r){e.key=t,e.offset=n,e.type=r}class By{constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!Uy(e))return!1;const t=this._nodes,n=e._nodes;return t.size===n.size&&Array.from(t).every((e=>n.has(e)))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new By(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){const t=this.getNodes(),n=t.length,r=t[n-1];let o;if(Ny(r))o=r.select();else{const e=r.getIndexWithinParent()+1;o=r.getParentOrThrow().select(e,e)}o.insertNodes(e);for(let e=0;e0?[]:[s]:s.getNodesBetween(a),pb()||(this._cachedNodes=u),u}setTextNodeRange(e,t,n,r){zy(this.anchor,e.__key,t,"text"),zy(this.focus,n.__key,r,"text"),this._cachedNodes=null,this.dirty=!0}getTextContent(){const e=this.getNodes();if(0===e.length)return"";const t=e[0],n=e[e.length-1],r=this.anchor,o=this.focus,i=r.isBefore(o),[s,a]=Ky(this);let l="",c=!0;for(let u=0;u=0;e--){const t=i[e];if(t.is(d)||Nb(t)&&t.isParentOf(d))break;t.isAttached()&&(!h.has(t)||t.is(o)?m||g.insertAfter(t,!1):t.remove())}if(!m){let e=r,n=null;for(;null!==e;){const r=e.getChildren(),o=r.length;(0===o||r[o-1].is(n))&&(t.delete(e.__key),n=e),e=e.getParent()}}if(d.isToken())if(a===f)d.select();else{const t=Oy(e);t.select(),d.replace(t)}else d=d.spliceText(a,f-a,e,!0),""===d.getTextContent()?d.remove():d.isComposing()&&"text"===this.anchor.type&&(this.anchor.offset-=e.length);for(let e=1;e0&&(m===p.getTextContentSize()||og(p)||([p]=p.splitText(m)),p.setFormat(g));for(let t=c+1;t(Nb(e)||Mb(e))&&!e.isInline()))){Nb(t)||Im(135);const r=sb(this);return t.splice(r,0,e),void n.selectEnd()}const r=function(e){const t=Ub();let n=null;for(let r=0;rl?l:a,t=a>l?a:l,n=i.splitText(e,t),r=0===e?n[0]:n[1];return null!=r?[r]:[]}return[i]}const c=r.isBefore(o);if(Ny(i)){const t=c?a:l;t===i.getTextContentSize()?e.shift():0!==t&&([,i]=i.splitText(t),e[0]=i)}if(Ny(s)){const t=s.getTextContent().length,r=c?l:a;0===r?e.pop():r!==t&&([s]=s.splitText(r),e[n]=s)}return e}modify(e,t,n){const r=this.focus,o=this.anchor,i="move"===e,s=Fg(r,t);if(Mb(s)&&!s.isIsolated()){if(i&&s.isKeyboardSelectable()){const e=Zy();return e.add(s.__key),void bg(e)}const e=t?s.getPreviousSibling():s.getNextSibling();if(Ny(e)){const n=e.__key,s=t?e.getTextContent().length:0;return r.set(n,s,"text"),void(i&&o.set(n,s,"text"))}{const n=s.getParentOrThrow();let a,l;return Nb(e)?(l=e.__key,a=t?e.getChildrenSize():0):(a=s.getIndexWithinParent(),l=n.__key,t||a++),r.set(l,a,"element"),void(i&&o.set(l,a,"element"))}}const a=yb(),l=Gg(a._window);if(!l)return;const c=a._blockCursorElement,u=a._rootElement;if(null===u||null===c||!Nb(s)||s.isInline()||s.canBeEmpty()||_n(c,a,u),function(e,t,n,r){e.modify(t,n,r)}(l,e,t?"backward":"forward",n),l.rangeCount>0){const e=l.getRangeAt(0),n=this.anchor.getNode(),r=Db(n)?n:function(e){let t=e.getParentOrThrow();for(;null!==t;){if(Hg(t))return t;t=t.getParentOrThrow()}return t}(n);if(this.applyDOMRange(e),this.dirty=!0,!i){const n=this.getNodes(),o=[];let i=!1;for(let e=0;e0)if(t){const e=o[0];Nb(e)?e.selectStart():e.getParentOrThrow().selectStart()}else{const e=o[o.length-1];Nb(e)?e.selectEnd():e.getParentOrThrow().selectEnd()}l.anchorNode===e.startContainer&&l.anchorOffset===e.startOffset||function(e){const t=e.focus,n=e.anchor,r=n.key,o=n.offset,i=n.type;zy(n,t.key,t.offset,t.type),zy(t,r,o,i),e._cachedNodes=null}(this)}}}forwardDeletion(e,t,n){if(!n&&("element"===e.type&&Nb(t)&&e.offset===t.getChildrenSize()||"text"===e.type&&e.offset===t.getTextContentSize())){const e=t.getParent(),n=t.getNextSibling()||(null===e?null:e.getNextSibling());if(Nb(n)&&n.isShadowRoot())return!0}return!1}deleteCharacter(e){const t=this.isCollapsed();if(this.isCollapsed()){const t=this.anchor;let n=t.getNode();if(this.forwardDeletion(t,n,e))return;const r=this.focus,o=Fg(r,e);if(Mb(o)&&!o.isIsolated()){if(o.isKeyboardSelectable()&&Nb(n)&&0===n.getChildrenSize()){n.remove();const e=Zy();e.add(o.__key),bg(e)}else o.remove(),yb().dispatchCommand(lp,void 0);return}if(!e&&Nb(o)&&Nb(n)&&n.isEmpty())return n.remove(),void o.selectStart();if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&0===t.offset&&("element"===t.type?t.getNode():t.getNode().getParentOrThrow()).collapseAtStart(this))return}else{const o="text"===r.type?r.getNode():null;if(n="text"===t.type?t.getNode():null,null!==o&&o.isSegmented()){const t=r.offset,i=o.getTextContentSize();if(o.is(n)||e&&t!==i||!e&&0!==t)return void Hy(o,e,t)}else if(null!==n&&n.isSegmented()){const r=t.offset,i=n.getTextContentSize();if(n.is(o)||e&&0!==r||!e&&r!==i)return void Hy(n,e,r)}!function(e,t){const n=e.anchor,r=e.focus,o=n.getNode();if(o===r.getNode()&&"text"===n.type&&"text"===r.type){const e=n.offset,i=r.offset,s=en||r){o.splice(e,1),r&&(a=void 0);break}}const l=o.join("").trim();""===l?r.remove():(r.setTextContent(l),r.select(a,a))}function qy(e,t,n,r){let o,i=t;if(e.nodeType===im){let s=!1;const a=e.childNodes,l=a.length,c=r._blockCursorElement;i===l&&(s=!0,i=l-1);let u=a[i],d=!1;if(u===c)u=a[i+1],d=!0;else if(null!==c){const n=c.parentNode;e===n&&t>Array.prototype.indexOf.call(n.children,c)&&i--}if(o=xg(u),Ny(o))i=wg(o,s);else{let r=xg(e);if(null===r)return null;if(Nb(r)){i=Math.min(r.getChildrenSize(),i);let e=r.getChildAtIndex(i);if(Nb(e)&&function(e,t,n){const r=e.getParent();return null===n||null===r||!r.canBeEmpty()||r!==n.getNode()}(e,0,n)){const t=s?e.getLastDescendant():e.getFirstDescendant();null===t?r=e:(e=t,r=Nb(e)?e:e.getParentOrThrow()),i=0}Ny(e)?(o=e,r=null,i=wg(e,s)):e!==r&&s&&!d&&i++}else{const n=r.getIndexWithinParent();i=0===t&&Mb(r)&&xg(e)===r?n:n+1,r=r.getParentOrThrow()}if(Nb(r))return Dy(r.__key,i,"element")}}else o=xg(e);return Ny(o)?Dy(o.__key,i,"text"):null}function Yy(e,t,n){const r=e.offset,o=e.getNode();if(0===r){const r=o.getPreviousSibling(),i=o.getParent();if(t){if((n||!t)&&null===r&&Nb(i)&&i.isInline()){const t=i.getPreviousSibling();Ny(t)&&(e.key=t.__key,e.offset=t.getTextContent().length)}}else Nb(r)&&!n&&r.isInline()?(e.key=r.__key,e.offset=r.getChildrenSize(),e.type="element"):Ny(r)&&(e.key=r.__key,e.offset=r.getTextContent().length)}else if(r===o.getTextContent().length){const r=o.getNextSibling(),i=o.getParent();if(t&&Nb(r)&&r.isInline())e.key=r.__key,e.offset=0,e.type="element";else if((n||t)&&null===r&&Nb(i)&&i.isInline()&&!i.canInsertTextAfter()){const t=i.getNextSibling();Ny(t)&&(e.key=t.__key,e.offset=0)}}}function Xy(e,t,n){if("text"===e.type&&"text"===t.type){const r=e.isBefore(t),o=e.is(t);Yy(e,r,o),Yy(t,!r,o),o&&(t.key=e.key,t.offset=e.offset,t.type=e.type);const i=yb();if(i.isComposing()&&i._compositionKey!==e.key&&Vy(n)){const r=n.anchor,o=n.focus;zy(e,r.key,r.offset,r.type),zy(t,o.key,o.offset,o.type)}}}function Gy(e,t,n,r,o,i){if(null===e||null===n||!eg(o,e,n))return null;const s=qy(e,t,Vy(i)?i.anchor:null,o);if(null===s)return null;const a=qy(n,r,Vy(i)?i.focus:null,o);if(null===a)return null;if("element"===s.type&&"element"===a.type){const t=xg(e),r=xg(n);if(Mb(t)&&Mb(r))return null}return Xy(s,a,i),[s,a]}function Jy(e,t,n,r,o,i){const s=vb(),a=new Wy(Dy(e,t,o),Dy(n,r,i),0,"");return a.dirty=!0,s._selection=a,a}function Zy(){return new By(new Set)}function Qy(e,t,n,r){const o=n._window;if(null===o)return null;const i=r||o.event,s=i?i.type:void 0,a="selectionchange"===s,l=!Fm&&(a||"beforeinput"===s||"compositionstart"===s||"compositionend"===s||"click"===s&&i&&3===i.detail||"drop"===s||void 0===s);let c,u,d,f;if(Vy(e)&&!l)return e.clone();if(null===t)return null;if(c=t.anchorNode,u=t.focusNode,d=t.anchorOffset,f=t.focusOffset,a&&Vy(e)&&!eg(n,c,u))return e.clone();const h=Gy(c,d,u,f,n,e);if(null===h)return null;const[p,m]=h;return new Wy(p,m,Vy(e)?e.format:0,Vy(e)?e.style:"")}function eb(){return vb()._selection}function tb(){return yb()._editorState._selection}function nb(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 t=o.offset;if(n<=t&&r>0||n0||n0||n=e,s=o?i.getChildAtIndex(e-1):i.getChildAtIndex(n);if(Ny(s)){let e=0;o&&(e=s.getTextContentSize()),t.set(s.__key,e,"text"),r.set(s.__key,e,"text")}}else{if(Nb(i)){const e=i.getChildrenSize(),r=n>=e,o=r?i.getChildAtIndex(e-1):i.getChildAtIndex(n);if(Ny(o)){let e=0;r&&(e=o.getTextContentSize()),t.set(o.__key,e,"text")}}if(Nb(s)){const e=s.getChildrenSize(),t=o>=e,n=t?s.getChildAtIndex(e-1):s.getChildAtIndex(o);if(Ny(n)){let e=0;t&&(e=n.getTextContentSize()),r.set(n.__key,e,"text")}}}}function ob(e,t,n,r,o){let i=null,s=0,a=null;null!==r?(i=r.__key,Ny(r)?(s=r.getTextContentSize(),a="text"):Nb(r)&&(s=r.getChildrenSize(),a="element")):null!==o&&(i=o.__key,Ny(o)?a="text":Nb(o)&&(a="element")),null!==i&&null!==a?e.set(i,s,a):(s=t.getIndexWithinParent(),-1===s&&(s=n.getChildrenSize()),e.set(n.__key,s,"element"))}function ib(e,t,n,r,o){"text"===e.type?(e.key=n,t||(e.offset+=o)):e.offset>r.getIndexWithinParent()&&(e.offset-=1)}function sb(e){let t=e;e.isCollapsed()||t.removeText();const n=eb();Vy(n)&&(t=n),Vy(t)||Im(161);const r=t.anchor;let o=r.getNode(),i=r.offset;for(;!ev(o);)[o,i]=ab(o,i);return i}function ab(e,t){const n=e.getParent();if(!n){const e=Ub();return vg().append(e),e.select(),[vg(),0]}if(Ny(e)){const r=e.splitText(t);if(0===r.length)return[n,e.getIndexWithinParent()];const o=0===t?0:1;return[n,r[0].getIndexWithinParent()+o]}if(!Nb(e)||0===t)return[n,e.getIndexWithinParent()];const r=e.getChildAtIndex(t);if(r){const n=new Wy(Dy(e.__key,t,"element"),Dy(e.__key,t,"element"),0,""),o=e.insertNewAfter(n);o&&o.append(r,...r.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}let lb=null,cb=null,ub=!1,db=!1,fb=0;const hb={characterData:!0,childList:!0,subtree:!0};function pb(){return ub||null!==lb&&lb._readOnly}function mb(){ub&&Im(13)}function gb(){fb>99&&Im(14)}function vb(){return null===lb&&Im(195,bb()),lb}function yb(){return null===cb&&Im(196,bb()),cb}function bb(){let e=0;const t=new Set,n=qb.version;if("undefined"!=typeof window)for(const r of document.querySelectorAll("[contenteditable]")){const o=rg(r);if(tg(o))e++;else if(o){let e=String(o.constructor.version||"<0.17.1");e===n&&(e+=" (separately built, likely a bundler configuration issue)"),t.add(e)}}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 xb(e,t,n){const r=t.__type,o=function(e,t){const n=e._nodes.get(t);return void 0===n&&Im(30,t),n}(e,r);let i=n.get(r);void 0===i&&(i=Array.from(o.transforms),n.set(r,i));const s=i.length;for(let e=0;e0?r.getRangeAt(0):null;if(null!==e){let t;if(e instanceof Text){const n=document.createRange();n.selectNode(e),t=n.getBoundingClientRect()}else t=e.getBoundingClientRect();!function(e,t,n){const r=n.ownerDocument,o=r.defaultView;if(null===o)return;let{top:i,bottom:s}=t,a=0,l=0,c=n;for(;null!==c;){const t=c===r.body;if(t)a=0,l=Kg(e).innerHeight;else{const e=c.getBoundingClientRect();a=e.top,l=e.bottom}let n=0;if(il&&(n=s-l),0!==n)if(t)o.scrollBy(0,n);else{const e=c.scrollTop;c.scrollTop+=n;const t=c.scrollTop-e;i-=t,s-=t}if(t)break;c=Ug(c)}}(n,t,i)}}qv=!0}}(s,a,e,x,y,r)}(function(e,t,n){let r=e._blockCursorElement;if(Vy(n)&&n.isCollapsed()&&"element"===n.anchor.type&&t.contains(document.activeElement)){const o=n.anchor,i=o.getNode(),s=o.offset;let a=!1,l=null;if(s===i.getChildrenSize())Xg(i.getChildAtIndex(s-1))&&(a=!0);else{const t=i.getChildAtIndex(s);if(Xg(t)){const n=t.getPreviousSibling();(null===n||Xg(n))&&(a=!0,l=e.getElementByKey(t.__key))}}if(a){const n=e.getElementByKey(i.__key);return null===r&&(e._blockCursorElement=r=function(e){const t=e.theme,n=document.createElement("div");n.contentEditable="false",n.setAttribute("data-lexical-cursor","true");let r=t.blockCursor;if(void 0!==r){if("string"==typeof r){const e=Dm(r);r=t.blockCursor=e}void 0!==r&&n.classList.add(...r)}return n}(e._config)),t.style.caretColor="transparent",void(null===l?n.appendChild(r):n.insertBefore(r,l))}}null!==r&&_n(r,e,t)})(e,r,a),null!==h&&h.observe(r,hb)}finally{cb=d,lb=c}}null!==p&&function(e,t,n,r,o){const i=Array.from(e._listeners.mutation),s=i.length;for(let e=0;e{r=Cb(e,t,n)})),r}const r=Eg(e);for(let o=4;o>=0;o--)for(let i=0;i0||u>0;){if(l>0){t._dirtyLeaves=new Set;for(const e of a){const r=o.get(e);Ny(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&Xm(r),void 0!==r&&wb(r,i)&&xb(t,r,s),n.add(e)}if(a=t._dirtyLeaves,l=a.size,l>0){fb++;continue}}t._dirtyLeaves=new Set,t._dirtyElements=new Map;for(const e of c){const n=e[0],a=e[1];if("root"!==n&&!a)continue;const l=o.get(n);void 0!==l&&wb(l,i)&&xb(t,l,s),r.set(n,a)}a=t._dirtyLeaves,l=a.size,c=t._dirtyElements,u=c.size,fb++}t._dirtyLeaves=n,t._dirtyElements=r}(c,e),Tb(e),function(e,t,n,r){const o=e._nodeMap,i=t._nodeMap,s=[];for(const[e]of r){const t=i.get(e);void 0!==t&&(t.isAttached()||(Nb(t)&&iv(t,e,o,i,s,r),o.has(e)||r.delete(e),s.push(e)))}for(const e of s)i.delete(e);for(const e of n){const t=i.get(e);void 0===t||t.isAttached()||(o.has(e)||n.delete(e),i.delete(e))}}(l,c,e._dirtyLeaves,e._dirtyElements)),n!==e._compositionKey&&(c._flushSync=!0);const r=c._selection;if(Vy(r)){const e=c._nodeMap,t=r.anchor.key,n=r.focus.key;void 0!==e.get(t)&&void 0!==e.get(n)||Im(19)}else Uy(r)&&0===r._nodes.size&&(c._selection=null)}catch(t){return t instanceof Error&&e._onError(t),e._pendingEditorState=l,e._dirtyType=lm,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),void Sb(e)}finally{lb=d,ub=f,cb=h,e._updating=p,fb=0}const m=e._dirtyType!==am||function(e,t){const n=t.getEditorState()._selection,r=e._selection;if(null!==r){if(r.dirty||!r.is(n))return!0}else if(null!==n)return!0;return!1}(c,e);m?c._flushSync?(c._flushSync=!1,Sb(e)):u&&Zm((()=>{Sb(e)})):(c._flushSync=!1,u&&(r.clear(),e._deferred=[],e._pendingEditorState=null))}function Rb(e,t,n){e._updating?e._updates.push([t,n]):Pb(e,t,n)}class Ob extends cy{constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__first=e.__first,this.__last=e.__last,this.__size=e.__size,this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir}getFormat(){return this.getLatest().__format}getFormatType(){const e=this.getFormat();return Nm[e]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const e=[];let t=this.getFirstChild();for(;null!==t;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){const e=[];let t=this.getFirstChild();for(;null!==t;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return 0===this.getChildrenSize()}isDirty(){const e=yb()._dirtyElements;return null!==e&&e.has(this.__key)}isLastChild(){const e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return null!==t&&t.is(e)}getAllTextNodes(){const e=[];let t=this.getFirstChild();for(;null!==t;){if(Ny(t)&&e.push(t),Nb(t)){const n=t.getAllTextNodes();e.push(...n)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;Nb(e);){const t=e.getFirstChild();if(null===t)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;Nb(e);){const t=e.getLastChild();if(null===t)break;e=t}return e}getDescendantByIndex(e){const t=this.getChildren(),n=t.length;if(e>=n){const e=t[n-1];return Nb(e)&&e.getLastDescendant()||e||null}const r=t[e];return Nb(r)&&r.getFirstDescendant()||r||null}getFirstChild(){const e=this.getLatest().__first;return null===e?null:fg(e)}getFirstChildOrThrow(){const e=this.getFirstChild();return null===e&&Im(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return null===e?null:fg(e)}getLastChildOrThrow(){const e=this.getLastChild();return null===e&&Im(96,this.__key),e}getChildAtIndex(e){const t=this.getChildrenSize();let n,r;if(e=e;){if(r===e)return n;n=n.getPreviousSibling(),r--}return null}getTextContent(){let e="";const t=this.getChildren(),n=t.length;for(let r=0;re.remove())),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){const t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=""!==e?Om[e]:0,this}setStyle(e){return this.getWritable().__style=e||"",this}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,n){const r=n.length,o=this.getChildrenSize(),i=this.getWritable(),s=i.__key,a=[],l=[],c=this.getChildAtIndex(e+t);let u=null,d=o-t+r;if(0!==e)if(e===o)u=this.getLastChild();else{const t=this.getChildAtIndex(e);null!==t&&(u=t.getPreviousSibling())}if(t>0){let e=null===u?this.getFirstChild():u.getNextSibling();for(let n=0;n({root:Fb(vg())})))}}class Bb extends Ob{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class Vb extends Ob{constructor(e){super(e),this.__textFormat=0,this.__textStyle=""}static getType(){return"paragraph"}getTextFormat(){return this.getLatest().__textFormat}setTextFormat(e){const t=this.getWritable();return t.__textFormat=e,t}hasTextFormat(e){const t=Pm[e];return!!(this.getTextFormat()&t)}getTextStyle(){return this.getLatest().__textStyle}setTextStyle(e){const t=this.getWritable();return t.__textStyle=e,t}static clone(e){return new Vb(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}createDOM(e){const t=document.createElement("p"),n=Ig(e.theme,"paragraph");return void 0!==n&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}static importDOM(){return{p:e=>({conversion:Wb,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&Jg(t)){this.isEmpty()&&t.append(document.createElement("br"));const e=this.getFormatType();t.style.textAlign=e;const n=this.getDirection();n&&(t.dir=n);const r=this.getIndent();r>0&&(t.style.textIndent=20*r+"px")}return{element:t}}static importJSON(e){const t=Ub();return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t.setTextFormat(e.textFormat),t}exportJSON(){return{...super.exportJSON(),textFormat:this.getTextFormat(),textStyle:this.getTextStyle(),type:"paragraph",version:1}}insertNewAfter(e,t){const n=Ub();n.setTextFormat(e.format),n.setTextStyle(e.style);const r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),n.setStyle(this.getTextStyle()),this.insertAfter(n,t),n}collapseAtStart(){const e=this.getChildren();if(0===e.length||Ny(e[0])&&""===e[0].getTextContent().trim()){if(null!==this.getNextSibling())return this.selectNext(),this.remove(),!0;if(null!==this.getPreviousSibling())return this.selectPrevious(),this.remove(),!0}return!1}}function Wb(e){const t=Ub();if(e.style){t.setFormat(e.style.textAlign);const n=parseInt(e.style.textIndent,10)/20;n>0&&t.setIndent(n)}return{node:t}}function Ub(){return qg(new Vb)}function $b(e){return e instanceof Vb}const Kb=1;function Hb(e,t,n,r){const o=e._keyToDOMMap;o.clear(),e._editorState=Lb(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=am,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;null!==i&&(i.disconnect(),e._observer=null),null!==t&&(t.textContent=""),null!==n&&(n.textContent="",o.set("root",n))}class qb{constructor(e,t,n,r,o,i,s){this._parentEditor=t,this._rootElement=null,this._editorState=e,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=r,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=am,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=Sg(),this._onError=o,this._htmlConversions=i,this._editable=s,this._headless=null!==t&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return null!=this._compositionKey}registerUpdateListener(e){const t=this._listeners.update;return t.add(e),()=>{t.delete(e)}}registerEditableListener(e){const t=this._listeners.editable;return t.add(e),()=>{t.delete(e)}}registerDecoratorListener(e){const t=this._listeners.decorator;return t.add(e),()=>{t.delete(e)}}registerTextContentListener(e){const t=this._listeners.textcontent;return t.add(e),()=>{t.delete(e)}}registerRootListener(e){const t=this._listeners.root;return e(this._rootElement,null),t.add(e),()=>{e(null,this._rootElement),t.delete(e)}}registerCommand(e,t,n){void 0===n&&Im(35);const r=this._commands;r.has(e)||r.set(e,[new Set,new Set,new Set,new Set,new Set]);const o=r.get(e);void 0===o&&Im(36,String(e));const i=o[n];return i.add(t),()=>{i.delete(t),o.every((e=>0===e.size))&&r.delete(e)}}registerMutationListener(e,t,n){const r=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,o=this._listeners.mutation;o.set(t,r);const i=n&&n.skipInitialization;return void 0===i||i||this.initializeMutationListener(t,r),()=>{o.delete(t)}}getRegisteredNode(e){const t=this._nodes.get(e.getType());return void 0===t&&Im(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){const n=this._editorState,r=function(e){if(!e._readOnly&&e.isEmpty())return rv;e._readOnly||Im(192);let t=nv.get(e);if(!t){t=new Map,nv.set(e,t);for(const[n,r]of e._nodeMap){const e=r.__type;let o=t.get(e);o||(o=new Map,t.set(e,o)),o.set(n,r)}}return t}(n).get(t.getType());if(!r)return;const o=new Map;for(const e of r.keys())o.set(e,"created");o.size>0&&e(o,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(e,t){const n=this.getRegisteredNode(e);return n.transforms.add(t),n}registerNodeTransform(e,t){const n=this.registerNodeTransformToKlass(e,t),r=[n],o=n.replaceWithKlass;if(null!=o){const e=this.registerNodeTransformToKlass(o,t);r.push(e)}var i;return i=e.getType(),Rb(this,(()=>{const e=vb();if(e.isEmpty())return;if("root"===i)return void vg().markDirty();const t=e._nodeMap;for(const[,e]of t)e.markDirty()}),null===this._pendingEditorState?{tag:"history-merge"}:void 0),()=>{r.forEach((e=>e.transforms.delete(t)))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return Bg(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){const t=this._rootElement;if(e!==t){const n=Ig(this._config.theme,"root"),r=this._pendingEditorState||this._editorState;if(this._rootElement=e,Hb(this,t,e,r),null!==t&&(this._config.disableEvents||function(e){const t=e.ownerDocument,n=Hv.get(t);void 0===n&&Im(162);const r=n-1;r>=0||Im(164),Hv.set(t,r),0===r&&t.removeEventListener("selectionchange",iy);const o=rg(e);tg(o)?(function(e){if(null!==e._parentEditor){const t=Eg(e),n=t[t.length-1]._key;oy.get(n)===e&&oy.delete(n)}else oy.delete(e._key)}(o),e.__lexicalEditor=null):o&&Im(198);const i=ry(e);for(let e=0;e{ay(e)||(sy(e),(t.isEditable()||"click"===r)&&i(e,t))}:e=>{if(ay(e))return;sy(e);const n=t.isEditable();switch(r){case"cut":return n&&Bg(t,zp,e);case"copy":return Bg(t,Fp,e);case"paste":return n&&Bg(t,pp,e);case"dragstart":return n&&Bg(t,Ip,e);case"dragover":return n&&Bg(t,Dp,e);case"dragend":return n&&Bg(t,Lp,e);case"focus":return n&&Bg(t,Kp,e);case"blur":return n&&Bg(t,Hp,e);case"drop":return n&&Bg(t,Mp,e)}};e.addEventListener(r,s),o.push((()=>{e.removeEventListener(r,s)}))}}(e,this),null!=n&&e.classList.add(...n)}else this._editorState=r,this._pendingEditorState=null,this._window=null;kb("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&Im(38),Km(this);const n=this._pendingEditorState,r=this._updateTags,o=void 0!==t?t.tag:null;null===n||n.isEmpty()||(null!=o&&r.add(o),Sb(this)),this._pendingEditorState=e,this._dirtyType=lm,this._dirtyElements.set("root",!1),this._compositionKey=null,null!=o&&r.add(o),Sb(this)}parseEditorState(e,t){return function(e,t,n){const r=Lb(),o=lb,i=ub,s=cb,a=t._dirtyElements,l=t._dirtyLeaves,c=t._cloneNotNeeded,u=t._dirtyType;t._dirtyElements=new Map,t._dirtyLeaves=new Set,t._cloneNotNeeded=new Set,t._dirtyType=0,lb=r,ub=!1,cb=t;try{const o=t._nodes;_b(e.root,o),n&&n(),r._readOnly=!0}catch(e){e instanceof Error&&t._onError(e)}finally{t._dirtyElements=a,t._dirtyLeaves=l,t._cloneNotNeeded=c,t._dirtyType=u,lb=o,ub=i,cb=s}return r}("string"==typeof e?JSON.parse(e):e,this,t)}read(e){return Sb(this),this.getEditorState().read(e,{editor:this})}update(e,t){Rb(this,e,t)}focus(e,t={}){const n=this._rootElement;null!==n&&(n.setAttribute("autocapitalize","off"),Rb(this,(()=>{const e=eb(),n=vg();null!==e?e.dirty=!0:0!==n.getChildrenSize()&&("rootStart"===t.defaultSelection?n.selectStart():n.selectEnd())}),{onUpdate:()=>{n.removeAttribute("autocapitalize"),e&&e()},tag:"focus"}),null===this._pendingEditorState&&n.removeAttribute("autocapitalize"))}blur(){const e=this._rootElement;null!==e&&e.blur();const t=Gg(this._window);null!==t&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,kb("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}qb.version="0.17.1+prod.esm";const Yb="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Xb=Yb?o.useLayoutEffect:o.useEffect,Gb={tag:"history-merge"};function Jb({initialConfig:e,children:t}){const n=(0,o.useMemo)((()=>{const{theme:t,namespace:n,nodes:r,onError:o,editorState:i,html:s}=e,a=function(e,t){let n=null;return{getTheme:function(){return null!=t?t:null!=n?n.getTheme():null}}}(0,t),l=function(e){const t=e||{},n=cb,r=t.theme||{},o=void 0===e?n:t.parentEditor||null,i=t.disableEvents||!1,s=Lb(),a=t.namespace||(null!==o?o._config.namespace:Sg()),l=t.editorState,c=[Ib,wy,uy,jy,Vb,Bb,...t.nodes||[]],{onError:u,html:d}=t,f=void 0===t.editable||t.editable;let h;if(void 0===e&&null!==n)h=n._nodes;else{h=new Map;for(let e=0;e{Object.keys(e).forEach((t=>{let r=n.get(t);void 0===r&&(r=[],n.set(t,r)),r.push(e[t])}))};return e.forEach((e=>{const t=e.klass.importDOM;if(null==t||r.has(t))return;r.add(t);const n=t.call(e.klass);null!==n&&o(n)})),t&&o(t),n}(h,d?d.import:void 0),f);return void 0!==l&&(p._pendingEditorState=l,p._dirtyType=lm),p}({editable:e.editable,html:s,namespace:n,nodes:r,onError:e=>o(e,l),theme:t});return function(e,t){if(null!==t)if(void 0===t)e.update((()=>{const t=vg();if(t.isEmpty()){const n=Ub();t.append(n);const r=Yb?document.activeElement:null;(null!==eb()||null!==r&&r===e.getRootElement())&&n.select()}}),Gb);else if(null!==t)switch(typeof t){case"string":{const n=e.parseEditorState(t);e.setEditorState(n,Gb);break}case"object":e.setEditorState(t,Gb);break;case"function":e.update((()=>{vg().isEmpty()&&t(e)}),Gb)}}(l,i),[l,a]}),[]);return Xb((()=>{const t=e.editable,[r]=n;r.setEditable(void 0===t||t)}),[]),(0,Qc.jsx)(ip.Provider,{value:n,children:t})}const Zb="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?o.useLayoutEffect:o.useEffect;function Qb(e){return{initialValueFn:()=>e.isEditable(),subscribe:t=>e.registerEditableListener(t)}}function ex(e){return()=>function(e){if(!function(e,t=!0){if(e)return!1;let n=vg().getTextContent();return t&&(n=n.trim()),""===n}(e,!1))return!1;const t=vg().getChildren(),n=t.length;if(n>1)return!1;for(let e=0;e{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function ox(e,t){const n=Fg(e.focus,t);return Mb(n)&&!n.isIsolated()||Nb(n)&&!n.isInline()&&!n.canBeEmpty()}function ix(e,t,n){const r=function(e){const t=e.anchor.getNode();return"rtl"===(Db(t)?t:t.getParentOrThrow()).getDirection()}(e);!function(e,t,n){e.modify(t?"extend":"move",n,"character")}(e,t,n?!r:r)}function sx(e,t,n,r=null){let o=null===r||t.isSelected(r);const i=Nb(t)&&t.excludeFromCopy("html");let s=t;if(null!==r){let e=ov(t);e=Ny(e)&&null!==r?function(e,t){const n=e.getStartEndPoints();if(t.isSelected(e)&&!t.isSegmented()&&!t.isToken()&&null!==n){const[r,o]=n,i=e.isBackward(),s=r.getNode(),a=o.getNode(),l=t.is(s),c=t.is(a);if(l||c){const[n,r]=Ky(e),o=s.is(a),l=t.is(i?a:s),c=t.is(i?s:a);let u,d=0;return o?(d=n>r?r:n,u=n>r?n:r):l?(d=i?r:n,u=void 0):c&&(d=0,u=i?n:r),t.__text=t.__text.slice(d,u),t}}return t}(r,e):e,s=e}const a=Nb(s)?s.getChildren():[],l=e._nodes.get(s.getType());let c;c=l&&void 0!==l.exportDOM?l.exportDOM(e,s):s.exportDOM(e);const{element:u,after:d}=c;if(!u)return!1;const f=document.createDocumentFragment();for(let n=0;n{if(null!==e){const r=function(e,t){return null!==e&&Object.getPrototypeOf(e).constructor.name===t.name}(e,KeyboardEvent)?null:e.clipboardData,o=eb();if(null!==o&&null!=r){e.preventDefault();const i=function(e,t=eb()){return null==t&&ax(166),Vy(t)&&t.isCollapsed()||0===t.getNodes().length?"":function(e,t){if("undefined"==typeof document||"undefined"==typeof window&&void 0===n.g.window)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const r=document.createElement("div"),o=vg().getChildren();for(let n=0;ne.getDecorators()));return vx((()=>e.registerDecoratorListener((e=>{(0,jn.flushSync)((()=>{r(e)}))}))),[e]),(0,o.useEffect)((()=>{r(e.getDecorators())}),[e]),(0,o.useMemo)((()=>{const r=[],i=Object.keys(n);for(let s=0;se._onError(t),children:(0,Qc.jsx)(o.Suspense,{fallback:null,children:n[a]})}),c=e.getElementByKey(a);null!==c&&r.push((0,jn.createPortal)(l,c,a))}return r}),[t,n,e])}(r,n);return function(e){vx((()=>rx(function(e){return rx(e.registerCommand(up,(e=>{const t=eb();return!!Vy(t)&&(t.deleteCharacter(e),!0)}),0),e.registerCommand(gp,(e=>{const t=eb();return!!Vy(t)&&(t.deleteWord(e),!0)}),0),e.registerCommand(vp,(e=>{const t=eb();return!!Vy(t)&&(t.deleteLine(e),!0)}),0),e.registerCommand(hp,(e=>{const t=eb();if(!Vy(t))return!1;if("string"==typeof e)t.insertText(e);else{const n=e.dataTransfer;if(null!=n)lx(n,t);else{const n=e.data;n&&t.insertText(n)}}return!0}),0),e.registerCommand(mp,(()=>{const e=eb();return!!Vy(e)&&(e.removeText(),!0)}),0),e.registerCommand(dp,(e=>{const t=eb();return!!Vy(t)&&(t.insertLineBreak(e),!0)}),0),e.registerCommand(fp,(()=>{const e=eb();return!!Vy(e)&&(e.insertLineBreak(),!0)}),0),e.registerCommand(Sp,(e=>{const t=eb();if(!Vy(t))return!1;const n=e,r=n.shiftKey;return!!ox(t,!0)&&(n.preventDefault(),ix(t,r,!0),!0)}),0),e.registerCommand(_p,(e=>{const t=eb();if(!Vy(t))return!1;const n=e,r=n.shiftKey;return!!ox(t,!1)&&(n.preventDefault(),ix(t,r,!1),!0)}),0),e.registerCommand(Op,(t=>!!Vy(eb())&&(t.preventDefault(),e.dispatchCommand(up,!0))),0),e.registerCommand(Ap,(t=>!!Vy(eb())&&(t.preventDefault(),e.dispatchCommand(up,!1))),0),e.registerCommand(Pp,(t=>{if(!Vy(eb()))return!1;if(null!==t){if((hx||fx||mx)&&dx)return!1;t.preventDefault()}return e.dispatchCommand(dp,!1)}),0),e.registerCommand(Bp,(()=>(function(){const e=vg();bg(function(e){return Gm(e.anchor),Gm(e.focus),e}(e.select(0,e.getChildrenSize())))}(),!0)),0),e.registerCommand(Fp,(t=>!!Vy(eb())&&(gx(t,e),!0)),0),e.registerCommand(zp,(t=>!!Vy(eb())&&(function(e,t){gx(e,t),t.update((()=>{const e=eb();Vy(e)&&e.removeText()}))}(t,e),!0)),0),e.registerCommand(pp,(t=>!!Vy(eb())&&(function(e,t){e.preventDefault(),t.update((()=>{const t=eb(),{clipboardData:n}=e;null!=n&&Vy(t)&&lx(n,t)}),{tag:"paste"})}(t,e),!0)),0),e.registerCommand(Mp,(e=>!!Vy(eb())&&(e.preventDefault(),!0)),0),e.registerCommand(Ip,(e=>!!Vy(eb())&&(e.preventDefault(),!0)),0))}(e),function(e){const t=window.location.origin,n=n=>{if(n.origin!==t)return;const r=e.getRootElement();if(document.activeElement!==r)return;const o=n.data;if("string"==typeof o){let t;try{t=JSON.parse(o)}catch(e){return}if(t&&"nuanria_messaging"===t.protocol&&"request"===t.type){const r=t.payload;if(r&&"makeChanges"===r.functionId){const t=r.args;if(t){const[r,o,i,s,a,l]=t;e.update((()=>{const e=eb();if(Vy(e)){const t=e.anchor;let l=t.getNode(),c=0,u=0;if(Ny(l)&&r>=0&&o>=0&&(c=r,u=r+o,e.setTextNodeRange(l,c,l,u)),c===u&&""===i||(e.insertRawText(i),l=t.getNode()),Ny(l)){c=s,u=s+a;const t=l.getTextContentSize();c=c>t?t:c,u=u>t?t:u,e.setTextNodeRange(l,c,l,u)}n.stopImmediatePropagation()}}))}}}}};return window.addEventListener("message",n,!0),()=>{window.removeEventListener("message",n,!0)}}(e))),[e])}(r),(0,Qc.jsxs)(Qc.Fragment,{children:[e,(0,Qc.jsx)(xx,{content:t}),i]})}function xx({content:e}){const[t]=sp(),n=function(e){const[t,n]=(0,o.useState)((()=>yx(e)));return vx((()=>{function t(){const t=yx(e);n(t)}return t(),rx(e.registerUpdateListener((()=>{t()})),e.registerEditableListener((()=>{t()})))}),[e]),t}(t),r=function(e){const[t]=sp(),n=(0,o.useMemo)((()=>e(t)),[t,e]),r=(0,o.useRef)(n.initialValueFn()),[i,s]=(0,o.useState)(r.current);return Zb((()=>{const{initialValueFn:e,subscribe:t}=n,o=e();return r.current!==o&&(r.current=o,s(o)),t((e=>{r.current=e,s(e)}))}),[n,e]),i}(Qb);return n?"function"==typeof e?e(r):e:null}const wx="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?o.useLayoutEffect:o.useEffect,Ex=(0,o.forwardRef)((function({editor:e,ariaActiveDescendant:t,ariaAutoComplete:n,ariaControls:r,ariaDescribedBy:i,ariaExpanded:s,ariaLabel:a,ariaLabelledBy:l,ariaMultiline:c,ariaOwns:u,ariaRequired:d,autoCapitalize:f,className:h,id:p,role:m="textbox",spellCheck:g=!0,style:v,tabIndex:y,"data-testid":b,...x},w){const[_,E]=(0,o.useState)(e.isEditable()),S=(0,o.useCallback)((t=>{t&&t.ownerDocument&&t.ownerDocument.defaultView?e.setRootElement(t):e.setRootElement(null)}),[e]),k=(0,o.useMemo)((()=>function(...e){return t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}}(w,S)),[S,w]);return wx((()=>(E(e.isEditable()),e.registerEditableListener((e=>{E(e)})))),[e]),(0,Qc.jsx)("div",{...x,"aria-activedescendant":_?t:void 0,"aria-autocomplete":_?n:"none","aria-controls":_?r:void 0,"aria-describedby":i,"aria-expanded":_&&"combobox"===m?!!s:void 0,"aria-label":a,"aria-labelledby":l,"aria-multiline":c,"aria-owns":_?u:void 0,"aria-readonly":!_||void 0,"aria-required":d,autoCapitalize:f,className:h,contentEditable:_,"data-testid":b,id:p,ref:k,role:_?m:void 0,spellCheck:g,style:v,tabIndex:y})}));function Sx(e){return e.getEditorState().read(ex(e.isComposing()))}const kx=(0,o.forwardRef)((function(e,t){const{placeholder:n,...r}=e,[o]=sp();return(0,Qc.jsxs)(Qc.Fragment,{children:[(0,Qc.jsx)(Ex,{editor:o,...r,ref:t}),null!=n&&(0,Qc.jsx)(Cx,{editor:o,content:n})]})}));function Cx({content:e,editor:t}){const n=function(e){const[t,n]=(0,o.useState)((()=>Sx(e)));return wx((()=>{function t(){const t=Sx(e);n(t)}return t(),rx(e.registerUpdateListener((()=>{t()})),e.registerEditableListener((()=>{t()})))}),[e]),t}(t),[r,i]=(0,o.useState)(t.isEditable());if((0,o.useLayoutEffect)((()=>(i(t.isEditable()),t.registerEditableListener((e=>{i(e)})))),[t]),!n)return null;let s=null;return"function"==typeof e?s=e(r):null!==e&&(s=e),null===s?null:(0,Qc.jsx)("div",{"aria-hidden":!0,children:s})}const Tx=0,Px=1,Rx=2,Ox=0,Nx=1,Ax=2,jx=3,Mx=4;function Ix(e){e.undoStack=[],e.redoStack=[],e.current=null}function Dx({delay:e,externalHistoryState:t}){const[n]=sp();return function(e,t,n=1e3){const r=(0,o.useMemo)((()=>t||{current:null,redoStack:[],undoStack:[]}),[t]);(0,o.useEffect)((()=>function(e,t,n){const r=function(e,t){let n=Date.now(),r=Ox;return(o,i,s,a,l,c)=>{const u=Date.now();if(c.has("historic"))return r=Ox,n=u,Rx;const d=function(e,t,n,r,o){if(null===e||0===n.size&&0===r.size&&!o)return Ox;const i=t._selection,s=e._selection;if(o)return Nx;if(!(Vy(i)&&Vy(s)&&s.isCollapsed()&&i.isCollapsed()))return Ox;const a=function(e,t,n){const r=e._nodeMap,o=[];for(const e of t){const t=r.get(e);void 0!==t&&o.push(t)}for(const[e,t]of n){if(!t)continue;const n=r.get(e);void 0===n||Db(n)||o.push(n)}return o}(t,n,r);if(0===a.length)return Ox;if(a.length>1){const n=t._nodeMap,r=n.get(i.anchor.key),o=n.get(s.anchor.key);return r&&o&&!e._nodeMap.has(r.__key)&&Ny(r)&&1===r.__text.length&&1===i.anchor.offset?Ax:Ox}const l=a[0],c=e._nodeMap.get(l.__key);if(!Ny(c)||!Ny(l)||c.__mode!==l.__mode)return Ox;const u=c.__text,d=l.__text;if(u===d)return Ox;const f=i.anchor,h=s.anchor;if(f.key!==h.key||"text"!==f.type)return Ox;const p=f.offset,m=h.offset,g=d.length-u.length;return 1===g&&m===p-1?Ax:-1===g&&m===p+1?jx:-1===g&&m===p?Mx:Ox}(o,i,a,l,e.isComposing()),f=(()=>{const f=null===s||s.editor===e,h=c.has("history-push");if(!h&&f&&c.has("history-merge"))return Tx;if(null===o)return Px;const p=i._selection;return a.size>0||l.size>0?!1===h&&d!==Ox&&d===r&&ur.exportJSON())))===JSON.stringify(n.read((()=>o.exportJSON())))}(Array.from(a)[0],o,i)?Tx:Px:null!==p?Tx:Rx})();return n=u,r=d,f}}(e,n),o=rx(e.registerCommand(bp,(()=>(function(e,t){const n=t.redoStack,r=t.undoStack;if(0!==r.length){const o=t.current,i=r.pop();null!==o&&(n.push(o),e.dispatchCommand(Up,!0)),0===r.length&&e.dispatchCommand($p,!1),t.current=i||null,i&&i.editor.setEditorState(i.editorState,{tag:"historic"})}}(e,t),!0)),0),e.registerCommand(xp,(()=>(function(e,t){const n=t.redoStack,r=t.undoStack;if(0!==n.length){const o=t.current;null!==o&&(r.push(o),e.dispatchCommand($p,!0));const i=n.pop();0===n.length&&e.dispatchCommand(Up,!1),t.current=i||null,i&&i.editor.setEditorState(i.editorState,{tag:"historic"})}}(e,t),!0)),0),e.registerCommand(Vp,(()=>(Ix(t),!1)),0),e.registerCommand(Wp,(()=>(Ix(t),e.dispatchCommand(Up,!1),e.dispatchCommand($p,!1),!0)),0),e.registerUpdateListener((({editorState:n,prevEditorState:o,dirtyLeaves:i,dirtyElements:s,tags:a})=>{const l=t.current,c=t.redoStack,u=t.undoStack,d=null===l?null:l.editorState;if(null!==l&&n===d)return;const f=r(o,n,l,i,s,a);if(f===Px)0!==c.length&&(t.redoStack=[],e.dispatchCommand(Up,!1)),null!==l&&(u.push({...l}),e.dispatchCommand($p,!0));else if(f===Rx)return;t.current={editor:e,editorState:n}})));return o}(e,r,n)),[n,e,r])}(n,t,e),null}function Lx(e,t){return Lx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Lx(e,t)}var Fx={error:null},zx=function(e){var t,n;function r(){for(var t,n=arguments.length,r=new Array(n),o=0;o{if(n)return r.registerUpdateListener((({editorState:o,dirtyElements:i,dirtyLeaves:s,prevEditorState:a,tags:l})=>{t&&0===i.size&&0===s.size||e&&l.has("history-merge")||a.isEmpty()||n(o,r,l)}))}),[r,e,t,n]),null}function Ux({editorRef:e}){const[t]=sp();return o.useEffect((()=>{"function"==typeof e?e(t):"object"==typeof e&&(e.current=t)}),[t]),null}var $x={sm:"py-1.5 px-2 rounded [&_.editor-content>p]:text-sm [&_.editor-content>p]:font-medium [&_.editor-content>p]:leading-[1.625rem]",md:"py-2 px-2.5 rounded-md [&_.editor-content>p]:text-sm [&_.editor-content>p]:font-medium [&_.editor-content>p]:leading-[1.625rem]",lg:"py-2.5 px-3 rounded-md [&_.editor-content>p]:text-sm [&_.editor-content>p]:font-medium [&_.editor-content>p]:leading-[1.6875rem]"},Kx={sm:"p-1.5 rounded-md max-h-[10.75rem]",md:"p-2 rounded-lg max-h-[13.5rem]",lg:"p-2 rounded-lg max-h-[13.5rem]"},Hx={sm:"p-1.5 rounded text-sm leading-5 font-normal",md:"p-2 rounded-md text-base leading-6 font-normal",lg:"p-2 rounded-md text-base leading-6 font-normal"};const qx="startTransition",Yx="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?o.useLayoutEffect:o.useEffect,Xx=e=>{const t=document.getElementById("typeahead-menu");if(!t)return;const n=t.getBoundingClientRect();n.top+n.height>window.innerHeight&&t.scrollIntoView({block:"center"}),n.top<0&&t.scrollIntoView({block:"center"}),e.scrollIntoView({block:"nearest"})};function Gx(e,t){const n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return n.top>r.top&&n.top{d(0)}),[f]);const h=(0,o.useCallback)((n=>{t.update((()=>{const t=null!=r.match&&l?function(e){const t=eb();if(!Vy(t)||!t.isCollapsed())return null;const n=t.anchor;if("text"!==n.type)return null;const r=n.getNode();if(!r.isSimpleText())return null;const o=n.offset,i=r.getTextContent().slice(0,o),s=e.replaceableString.length,a=o-function(e,t,n){let r=n;for(let n=r;n<=t.length;n++)e.substr(-n)===t.substr(0,n)&&(r=n);return r}(i,e.matchingString,s);if(a<0)return null;let l;return 0===a?[l]=r.splitText(o):[,l]=r.splitText(a,o),l}(r.match):null;a(n,t,e,r.match?r.match.matchingString:"")}))}),[t,l,r.match,a,e]),p=(0,o.useCallback)((e=>{const n=t.getRootElement();null!==n&&(n.setAttribute("aria-activedescendant","typeahead-item-"+e),d(e))}),[t]);return(0,o.useEffect)((()=>()=>{const e=t.getRootElement();null!==e&&e.removeAttribute("aria-activedescendant")}),[t]),Yx((()=>{null===i?d(null):null===u&&p(0)}),[i,u,p]),(0,o.useEffect)((()=>rx(t.registerCommand(Jx,(({option:e})=>!(!e.ref||null==e.ref.current||(Xx(e.ref.current),0))),c))),[t,p,c]),(0,o.useEffect)((()=>rx(t.registerCommand(Tp,(e=>{const n=e;if(null!==i&&i.length&&null!==u){const e=u!==i.length-1?u+1:0;p(e);const r=i[e];null!=r.ref&&r.ref.current&&t.dispatchCommand(Jx,{index:e,option:r}),n.preventDefault(),n.stopImmediatePropagation()}return!0}),c),t.registerCommand(Cp,(e=>{const t=e;if(null!==i&&i.length&&null!==u){const e=0!==u?u-1:i.length-1;p(e);const n=i[e];null!=n.ref&&n.ref.current&&Xx(n.ref.current),t.preventDefault(),t.stopImmediatePropagation()}return!0}),c),t.registerCommand(Np,(t=>{const n=t;return n.preventDefault(),n.stopImmediatePropagation(),e(),!0}),c),t.registerCommand(jp,(e=>{const t=e;return null!==i&&null!==u&&null!=i[u]&&(t.preventDefault(),t.stopImmediatePropagation(),h(i[u]),!0)}),c),t.registerCommand(Pp,(e=>null!==i&&null!==u&&null!=i[u]&&(null!==e&&(e.preventDefault(),e.stopImmediatePropagation()),h(i[u]),!0)),c))),[h,e,t,i,u,p,c]),s(n,(0,o.useMemo)((()=>({options:i,selectOptionAndCleanUp:h,selectedIndex:u,setHighlightedIndex:d})),[h,u,i]),r.match?r.match.matchingString:"")}function Qx({options:e,onQueryChange:t,onSelectOption:n,onOpen:r,onClose:s,menuRenderFn:a,triggerFn:l,anchorClassName:c,commandPriority:u=Kb,parent:d}){const[f]=sp(),[h,p]=(0,o.useState)(null),m=function(e,t,n,r=document.body){const[i]=sp(),s=(0,o.useRef)(document.createElement("div")),a=(0,o.useCallback)((()=>{s.current.style.top=s.current.style.bottom;const t=i.getRootElement(),o=s.current,a=o.firstChild;if(null!==t&&null!==e){const{left:i,top:l,width:c,height:u}=e.getRect(),d=s.current.offsetHeight;if(o.style.top=`${l+window.pageYOffset+d+3}px`,o.style.left=`${i+window.pageXOffset}px`,o.style.height=`${u}px`,o.style.width=`${c}px`,null!==a){a.style.top=`${l}`;const e=a.getBoundingClientRect(),n=e.height,r=e.width,s=t.getBoundingClientRect();i+r>s.right&&(o.style.left=`${s.right-r+window.pageXOffset}px`),(l+n>window.innerHeight||l+n>s.bottom)&&l-s.top>n+u&&(o.style.top=l-n+window.pageYOffset-u+"px")}o.isConnected||(null!=n&&(o.className=n),o.setAttribute("aria-label","Typeahead menu"),o.setAttribute("id","typeahead-menu"),o.setAttribute("role","listbox"),o.style.display="block",o.style.position="absolute",r.append(o)),s.current=o,t.setAttribute("aria-controls","typeahead-menu")}}),[i,e,n,r]);(0,o.useEffect)((()=>{const t=i.getRootElement();if(null!==e)return a(),()=>{null!==t&&t.removeAttribute("aria-controls");const e=s.current;null!==e&&e.isConnected&&e.remove()}}),[i,a,e]);const l=(0,o.useCallback)((n=>{null!==e&&(n||t(null))}),[e,t]);return function(e,t,n,r){const[i]=sp();(0,o.useEffect)((()=>{if(null!=t&&null!=e){const e=i.getRootElement(),o=null!=e?function(e){let t=getComputedStyle(e);const n="absolute"===t.position,r=/(auto|scroll)/;if("fixed"===t.position)return document.body;for(let o=e;o=o.parentElement;)if(t=getComputedStyle(o),(!n||"static"!==t.position)&&r.test(t.overflow+t.overflowY+t.overflowX))return o;return document.body}(e):document.body;let s=!1,a=Gx(t,o);const l=function(){s||(window.requestAnimationFrame((function(){n(),s=!1})),s=!0);const e=Gx(t,o);e!==a&&(a=e,null!=r&&r(e))},c=new ResizeObserver(n);return window.addEventListener("resize",n),document.addEventListener("scroll",l,{capture:!0,passive:!0}),c.observe(t),()=>{c.unobserve(t),window.removeEventListener("resize",n),document.removeEventListener("scroll",l,!0)}}}),[t,i,r,n,e])}(e,s.current,a,l),s}(h,p,c,d),g=(0,o.useCallback)((()=>{p(null),null!=s&&null!==h&&s()}),[s,h]),v=(0,o.useCallback)((e=>{p(e),null!=r&&null===h&&r(e)}),[r,h]);return(0,o.useEffect)((()=>{const e=f.registerUpdateListener((()=>{f.getEditorState().read((()=>{const e=f._window||window,n=e.document.createRange(),r=eb(),o=function(e){let t=null;return e.getEditorState().read((()=>{const e=eb();Vy(e)&&(t=function(e){const t=e.anchor;if("text"!==t.type)return null;const n=t.getNode();if(!n.isSimpleText())return null;const r=t.offset;return n.getTextContent().slice(0,r)}(e))})),t}(f);if(!Vy(r)||!r.isCollapsed()||null===o||null===n)return void g();const s=l(o,f);if(t(s?s.matchingString:null),null!==s&&!function(e,t){return 0===t&&e.getEditorState().read((()=>{const e=eb();if(Vy(e)){const t=e.anchor.getNode().getPreviousSibling();return Ny(t)&&t.isTextEntity()}return!1}))}(f,s.leadOffset)){const t=function(e,t,n){const r=n.getSelection();if(null===r||!r.isCollapsed)return!1;const o=r.anchorNode,i=e,s=r.anchorOffset;if(null==o||null==s)return!1;try{t.setStart(o,i),t.setEnd(o,s)}catch(e){return!1}return!0}(s.leadOffset,n,e);if(null!==t)return a=()=>v({getRect:()=>n.getBoundingClientRect(),match:s}),void(qx in i()?i()[qx](a):a())}var a;g()}))}));return()=>{e()}}),[f,l,t,h,g,v]),null===h||null===f?null:(0,Qc.jsx)(Zx,{close:g,resolution:h,editor:f,anchorElementRef:m,options:e,menuRenderFn:a,shouldSplitNodeWithQuery:!0,onSelectOption:n,commandPriority:u})}function ew(e){return ew="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ew(e)}function tw(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);n2&&void 0!==arguments[2]?arguments[2]:"name",r=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,s,a=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ww(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ww(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,o.useState)([]),2),i=r[0],s=r[1];return(0,o.useEffect)((function(){if(null!==t){var r=_w.get(t);null!==r&&(void 0===r?(_w.set(t,null),Ew(e,t,(function(e){_w.set(t,e),s(e)}),n)):s(r))}else s([])}),[t]),i},kw=["size","children","selected","className"];function Cw(){return Cw=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n_:;",p=[l].join(""),m="[^"+p+h+"\\s]",g="(?:\\.[ |$]| |["+h+"]|)",v=new RegExp("(^|\\s|\\()([".concat(p,"]((?:").concat(m).concat(g,"){0,").concat(75,"}))$")),y=new RegExp("(^|\\s|\\()([".concat(p,"]((?:").concat(m,"){0,").concat(50,"}))$")),b=Rw(sp(),1)[0],x=Rw((0,o.useState)(null),2),w=x[0],_=x[1],E=Sw(t,w,r),S=(0,o.useCallback)((function(e,t,n){b.update((function(){var o=hw(e.data,r,s);t&&t.replace(o),n()}))}),[b]),k=(0,o.useMemo)((function(){return E.map((function(e){return new xw(e)}))}),[b,E]);return React.createElement(Qx,{onQueryChange:_,onSelectOption:S,triggerFn:function(e){var t=v.exec(e);if(null===t&&(t=y.exec(e)),null!==t){var n=t[1],r=t[3];if(r.length>=0)return{leadOffset:t.index+n.length,matchingString:r,replaceableString:t[2]}}return null},options:k,menuRenderFn:function(e,t){var n=t.selectedIndex,o=t.selectOptionAndCleanUp,i=t.setHighlightedIndex;return e.current&&!(null==k||!k.length)&&React.createElement(u,{size:s},k.map((function(e,t){var a;return React.createElement(f,{key:t,ref:e.ref,size:s,selected:t===n,onMouseEnter:function(){i(t)},onClick:function(){return o(e)}},"string"==typeof e.data?e.data:null===(a=e.data)||void 0===a?void 0:a[r])})))}})},Aw={ltr:"ltr",rtl:"rtl",paragraph:"editor-paragraph",quote:"editor-quote",heading:{h1:"editor-heading-h1",h2:"editor-heading-h2",h3:"editor-heading-h3",h4:"editor-heading-h4",h5:"editor-heading-h5",h6:"editor-heading-h6"},list:{nested:{listitem:"editor-nested-listitem"},ol:"editor-list-ol",ul:"editor-list-ul",listitem:"editor-listItem",listitemChecked:"editor-listItemChecked",listitemUnchecked:"editor-listItemUnchecked"},hashtag:"editor-hashtag",image:"editor-image",link:"editor-link",text:{bold:"editor-textBold",code:"editor-textCode",italic:"editor-textItalic",strikethrough:"editor-textStrikethrough",subscript:"editor-textSubscript",superscript:"editor-textSuperscript",underline:"editor-textUnderline",underlineStrikethrough:"editor-textUnderlineStrikethrough"},code:"editor-code",codeHighlight:{atrule:"editor-tokenAttr",attr:"editor-tokenAttr",boolean:"editor-tokenProperty",builtin:"editor-tokenSelector",cdata:"editor-tokenComment",char:"editor-tokenSelector",class:"editor-tokenFunction","class-name":"editor-tokenFunction",comment:"editor-tokenComment",constant:"editor-tokenProperty",deleted:"editor-tokenProperty",doctype:"editor-tokenComment",entity:"editor-tokenOperator",function:"editor-tokenFunction",important:"editor-tokenVariable",inserted:"editor-tokenSelector",keyword:"editor-tokenAttr",namespace:"editor-tokenVariable",number:"editor-tokenProperty",operator:"editor-tokenOperator",prolog:"editor-tokenComment",property:"editor-tokenProperty",punctuation:"editor-tokenPunctuation",regex:"editor-tokenVariable",selector:"editor-tokenSelector",string:"editor-tokenSelector",symbol:"editor-tokenProperty",tag:"editor-tokenProperty",url:"editor-tokenOperator",variable:"editor-tokenVariable"}},jw=function(e){var t=e.content;return React.createElement("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-start text-field-placeholder"},t)};function Mw(e){console.error(e)}var Iw=function(e,t){var n,r,i=e.defaultValue,s=void 0===i?"":i,a=e.placeholder,l=void 0===a?"Press @ to view variable suggestions":a,c=e.onChange,u=e.size,d=void 0===u?"md":u,f=e.autoFocus,h=void 0!==f&&f,p=e.options,m=void 0===p?[]:p,g=e.by,v=void 0===g?"name":g,y=e.trigger,b=void 0===y?"@":y,x=e.menuComponent,w=e.menuItemComponent,_=e.className,E=e.disabled,S=void 0!==E&&E,k={namespace:"Editor",editorTheme:Aw,onError:Mw,nodes:[pw],editorState:s||'{\n "root": {\n "children": [\n {\n "children": [],\n "direction": null,\n "format": "",\n "indent": 0,\n "type": "paragraph",\n "version": 1,\n "textFormat": 0,\n "textStyle": ""\n }\n ],\n "direction": null,\n "format": "",\n "indent": 0,\n "type": "root",\n "version": 1\n }\n}',editable:!S};return(0,o.isValidElement)(x)&&(n=x),(0,o.isValidElement)(w)&&(r=w),React.createElement("div",{className:te("relative w-full","border border-solid focus-within:ring-2 focus-within:ring-offset-2 border-field-border hover:border-border-strong focus-within:!border-focus-border focus-within:ring-focus transition duration-150 ease-in-out",$x[d],S&&"bg-field-secondary-background border-field-border-disabled hover:border-field-border-disabled [&_p]:text-badge-color-disabled cursor-not-allowed")},React.createElement(Jb,{initialConfig:k},React.createElement("div",{className:"relative w-full [&_p]:m-0"},React.createElement(bx,{contentEditable:React.createElement(kx,{className:te("editor-content focus-visible:outline-none outline-none","w-full min-h-[1.625rem] [&>p]:w-full [&>p]:m-0",_)}),placeholder:React.createElement(jw,{content:l}),ErrorBoundary:Bx})),React.createElement(Dx,null),React.createElement(Nw,{menuComponent:n,menuItemComponent:r,size:d,by:v,optionsArray:m,trigger:b}),React.createElement(Wx,{onChange:function(e,t){"function"==typeof c&&c(e,t)},ignoreSelectionChange:!0}),t&&React.createElement(Ux,{editorRef:t}),h&&React.createElement(ap,null)))},Dw=(0,o.forwardRef)(Iw);Dw.displayName="EditorInput";var Lw=Dw;const Fw=be("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);var zw=function(e,t){return te("rounded-full text-brand-primary-600 transition-colors duration-300",e[t].dot,e[t].ring)},Bw=["variant","size","type","currentStep","children","className"],Vw=["labelText","icon","stepClasses","isCurrent","isCompleted","className","type","variant","sizeClasses","size","isLast","index"];function Ww(){return Ww=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);nsvg]:size-4",md:"[&>svg]:size-5"})||void 0===n?void 0:n[g],b=function(){m(!p),u&&u(!p)};return i().createElement("div",{className:"p-2"},i().createElement("div",{role:"button",tabIndex:"0",onClick:b,onKeyPress:function(e){"Enter"!==e.key&&" "!==e.key||b()},className:te("text-text-primary bg-transparent cursor-pointer flex justify-between items-center p-1 gap-1",v,f),"aria-expanded":p},i().createElement("span",{className:"text-text-tertiary"},r),a&&i().createElement(Bf.span,{variants:{open:{rotate:180},closed:{rotate:0}},animate:p?"open":"closed",transition:{duration:.15},className:te("flex items-center text-border-strong",y)},i().createElement(Yf,null))),i().createElement(Bh,{initial:!1},p&&i().createElement(Bf.ul,{variants:{open:{height:"auto",opacity:1},closed:{height:0,opacity:0}},initial:"closed",animate:"open",exit:"closed",transition:{duration:.3,ease:"easeInOut"},className:"overflow-hidden flex gap-0.5 flex-col m-0 bg-white rounded-md p-0"},d)))},Zw.Item=function(e){var t,n=e.disabled,r=void 0!==n&&n,o=e.active,s=e.onClick,a=e.children,l=e.className,c=Jw().size,u=null===(t={sm:"[&>svg]:size-4 [&>svg]:m-1 [&>*:not(svg)]:mx-1 [&>*:not(svg)]:my-0.5 text-sm",md:"[&>svg]:size-5 [&>svg]:m-1.5 [&>*:not(svg)]:m-1 text-base"})||void 0===t?void 0:t[c],d=r?"text-text-disabled hover:text-text-disabled cursor-not-allowed hover:bg-transparent":"",f=o?"text-icon-primary [&>svg]:text-icon-interactive bg-background-secondary":"";return i().createElement("li",{role:"menuitem",tabIndex:"0",onClick:s,onKeyPress:function(e){"Enter"!==e.key&&" "!==e.key||s()},className:te("flex p-1 gap-1 items-center bg-transparent w-full border-none rounded text-text-secondary cursor-pointer m-0",u,"hover:bg-background-secondary hover:text-text-primary",d,f,"transition-colors duration-300 ease-in-out",l)},a)},Zw.Separator=function(e){var t,n=e.variant,r=void 0===n?"solid":n,o=e.className,s=null===(t={solid:"border-solid",dashed:"border-dashed",dotted:"border-dotted",double:"border-double",hidden:"border-hidden",none:"border-none"})||void 0===t?void 0:t[r];return i().createElement(i().Fragment,null,i().createElement("hr",{className:te("w-full border-0 border-t border-border-subtle",s,o)}))};var Qw=Zw;const e_=be("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),t_=be("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);var n_=["href","children","className","as"];function r_(){return r_=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);nsvg]:block h-full",n)},t)};var W_=V_;function U_(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n {}' }, + }, + }, + icon: { + name: 'Icon', + description: 'Custom Icon for the alert.', + control: 'object', + table: { + type: { summary: 'object' }, + defaultValue: { summary: 'null' }, + }, }, action: { name: 'Action', - description: 'Defines the icon of the alert.', + description: 'Defines the description of the alert.', control: 'object', table: { type: { summary: 'object' }, @@ -64,12 +99,6 @@ export default { }, }, }, - className: { - name: 'Classname', - description: 'Defines the extra classes', - control: 'text', - defaultValue: '', - }, }, }; @@ -77,6 +106,7 @@ export default { export const Neutral = { args: { variant: 'neutral', + onClose: fn(), }, }; @@ -84,24 +114,28 @@ export const Info = { args: { variant: 'info', disabled: true, + onClose: fn(), }, }; export const Warning = { args: { variant: 'warning', + onClose: fn(), }, }; export const Error = { args: { variant: 'error', + onClose: fn(), }, }; export const Success = { args: { variant: 'success', + onClose: fn(), }, }; @@ -109,6 +143,7 @@ export const Stack = { args: { variant: 'info', design: 'stack', + onClose: fn(), }, }; @@ -116,11 +151,13 @@ export const Dark = { args: { variant: 'error', theme: 'dark', + onClose: fn(), }, }; export const WithAction = { args: { + onClose: fn(), variant: 'info', design: 'stack', action: { @@ -133,8 +170,9 @@ export const WithAction = { export const WithCustomIcon = { args: { + onClose: fn(), variant: 'info', - // icon: , + icon: , action: { label: 'My Action', onClick: () => {}, diff --git a/src/components/avatar/avatar.stories.jsx b/src/components/avatar/avatar.stories.jsx index 5b0cea84..0bcb9bfc 100644 --- a/src/components/avatar/avatar.stories.jsx +++ b/src/components/avatar/avatar.stories.jsx @@ -40,9 +40,32 @@ export default { defaultValue: { summary: 'subtle' }, }, }, - className: { name: 'Classname', control: 'text', defaultValue: '' }, - url: { name: 'URL', control: 'text', defaultValue: '' }, - children: { name: 'Children', control: 'text', defaultValue: 'Button' }, + className: { + name: 'Class Name', + description: 'Defines the extra classes', + control: 'text', + table: { + type: { summary: 'string' }, + defaultValue: { summary: '' }, + }, + }, + url: { + name: 'URL', + description: 'The URL of the Avatar image', + control: 'text', + table: { + type: { summary: 'string' }, + defaultValue: { summary: '' }, + }, + }, + children: { + name: 'Children', + control: 'object', + table: { + type: { summary: 'string' }, + defaultValue: { summary: '' }, + }, + }, }, }; diff --git a/src/components/badge/badge.jsx b/src/components/badge/badge.jsx index 0afc8be2..771b4235 100644 --- a/src/components/badge/badge.jsx +++ b/src/components/badge/badge.jsx @@ -1,6 +1,6 @@ import { forwardRef } from 'react'; import { cn } from '@/utilities/functions'; -import { X, Info } from 'lucide-react'; +import { X } from 'lucide-react'; /** * Badge component. @@ -13,10 +13,10 @@ const BadgeComponent = ( props, ref ) => { className = '', type = 'pill', // pill, rounded variant = 'neutral', // neutral, red, yellow, green, blue, inverse - icon = , + icon = null, disabled = false, onClose = () => {}, - closable = true, + closable = false, onMouseDown = () => {}, } = props; diff --git a/src/components/badge/badge.stories.js b/src/components/badge/badge.stories.js index f59ec1e9..84026d2f 100644 --- a/src/components/badge/badge.stories.js +++ b/src/components/badge/badge.stories.js @@ -1,5 +1,5 @@ import Badge from './badge.jsx'; -import { fn } from '@storybook/test'; +import { Info } from 'lucide-react'; // Badge component story configuration export default { @@ -58,7 +58,51 @@ export default { defaultValue: { summary: 'true' }, }, }, - label: { control: 'text', defaultValue: 'Badge' }, + label: { + control: 'text', + name: 'Label', + description: 'Defines the Label of the badge.', + table: { + type: { summary: 'string' }, + defaultValue: { summary: 'Badge' }, + }, + }, + className: { + name: 'Class Name', + description: 'Defines the extra classes', + control: 'text', + table: { + type: { summary: 'string' }, + defaultValue: { summary: '' }, + }, + }, + onClose: { + name: 'On Close Event', + description: 'Callback function for close event', + control: 'function', + table: { + type: { summary: 'function' }, + defaultValue: { summary: '() => {}' }, + }, + }, + onMouseDown: { + name: 'On Mouse Down Event', + description: 'Callback function for mouse down event', + control: 'function', + table: { + type: { summary: 'function' }, + defaultValue: { summary: '() => {}' }, + }, + }, + icon: { + name: 'Icon', + description: 'Custom Icon for the badge.', + control: 'object', + table: { + type: { summary: 'object' }, + defaultValue: { summary: }, + }, + }, }, }; @@ -66,24 +110,19 @@ export default { export const Neutral = { args: { variant: 'neutral', - children: 'Badge', + icon: , type: 'pill', size: 'sm', label: 'Badge', - onClose: fn(), - onMouseDown: fn(), }, }; export const Disabled = { args: { variant: 'neutral', - children: 'Badge', type: 'pill', size: 'sm', label: 'Badge', - onClose: fn(), - onMouseDown: fn(), disabled: true, }, }; @@ -91,59 +130,44 @@ export const Disabled = { export const Red = { args: { variant: 'red', - children: 'Badge', type: 'rounded', size: 'sm', label: 'Badge', - onClose: fn(), - onMouseDown: fn(), }, }; export const Yellow = { args: { variant: 'yellow', - children: 'Badge', type: 'rounded', size: 'sm', label: 'Badge', - onClose: fn(), - onMouseDown: fn(), }, }; export const Green = { args: { variant: 'green', - children: 'Badge', type: 'rounded', size: 'sm', label: 'Badge', - onClose: fn(), - onMouseDown: fn(), }, }; export const Blue = { args: { variant: 'blue', - children: 'Badge', type: 'rounded', size: 'sm', label: 'Badge', - onClose: fn(), - onMouseDown: fn(), }, }; export const Inverse = { args: { variant: 'inverse', - children: 'Badge', type: 'rounded', size: 'sm', label: 'Badge', - onClose: fn(), - onMouseDown: fn(), }, }; diff --git a/src/components/badge/readme.md b/src/components/badge/readme.md index 93b5f886..9383b16c 100644 --- a/src/components/badge/readme.md +++ b/src/components/badge/readme.md @@ -49,11 +49,12 @@ The `Badge` component can show notifications, counts, or status information on n ### `closable` - **Type:** `boolean` -- **Default:** `true` +- **Default:** `false` - **Description:** Defines whether the badge is closable or not. This parameter will decide if the cross icon is shown or not. ### `icon` - **Type:** `ReactNode` +- **Default:** null - **Description:** An icon component to be displayed left of the Badge. ### `onClose` diff --git a/src/components/button/button.stories.js b/src/components/button/button.stories.js index 0c8f75f8..1bbb877f 100644 --- a/src/components/button/button.stories.js +++ b/src/components/button/button.stories.js @@ -79,7 +79,23 @@ export default { defaultValue: { summary: 'false' }, }, }, - children: { control: 'text', defaultValue: 'Button' }, + icon: { + name: 'Icon', + description: 'Custom Icon for the button.', + control: 'object', + table: { + type: { summary: 'object' }, + defaultValue: { summary: 'null' }, + }, + }, + children: { + name: 'Children', + control: 'object', + table: { + type: { summary: 'string' }, + defaultValue: { summary: '' }, + }, + }, }, }; diff --git a/src/components/checkbox/checkbox.stories.jsx b/src/components/checkbox/checkbox.stories.jsx index 385e0e9e..9a9ee8de 100644 --- a/src/components/checkbox/checkbox.stories.jsx +++ b/src/components/checkbox/checkbox.stories.jsx @@ -19,7 +19,7 @@ export default { }, }, label: { - name: 'Name', + name: 'Label', description: 'Defines the label of the checkbox', control: 'object', table: { diff --git a/src/components/container/container.stories.jsx b/src/components/container/container.stories.jsx index 2a31e4ee..9edc0f0d 100644 --- a/src/components/container/container.stories.jsx +++ b/src/components/container/container.stories.jsx @@ -100,6 +100,15 @@ export default { defaultValue: { summary: 'auto' }, }, }, + className: { + name: 'Class Name', + description: 'Defines the extra classes', + control: 'text', + table: { + type: { summary: 'string' }, + defaultValue: { summary: '' }, + }, + }, }, }; diff --git a/src/components/editor-input/editor-input.stories.jsx b/src/components/editor-input/editor-input.stories.jsx index a830bdc9..487572ae 100644 --- a/src/components/editor-input/editor-input.stories.jsx +++ b/src/components/editor-input/editor-input.stories.jsx @@ -4,9 +4,6 @@ import EditorInput from './editor-input.jsx'; export default { title: 'Atoms/EditorInput', component: EditorInput, - parameters: { - layout: 'centered', - }, tags: [ 'autodocs' ], argTypes: { by: { @@ -74,6 +71,15 @@ export default { defaultValue: { summary: 'md' }, }, }, + defaultValue: { + name: 'Default Value', + description: 'Default value for the editor input field.', + control: 'text', + table: { + type: { summary: 'string' }, + defaultValue: { summary: '' }, + }, + }, placeholder: { name: 'Placeholder', description: 'Placeholder text for the editor input field.', @@ -83,6 +89,15 @@ export default { defaultValue: { summary: 'Press @ to view variable suggestions' }, }, }, + trigger: { + name: 'Trigger', + description: 'Trigger text for the editor input field.', + control: 'text', + table: { + type: { summary: 'string' }, + defaultValue: { summary: '@' }, + }, + }, className: { name: 'Class Name', description: 'Custom class name to be added to the editor input.', @@ -93,6 +108,13 @@ export default { }, }, }, + decorators: [ + ( Story ) => ( +
+ +
+ ), + ], }; const options = [ @@ -108,37 +130,25 @@ const options = [ // More on writing stories with args: https://storybook.js.org/docs/writing-stories/args export const Small = { - render: () => ( -
- editorState.toJSON() } - /> -
- ), + args: { + size: 'sm', + options, + onChange: ( editorState ) => editorState.toJSON(), + }, }; export const Medium = { - render: () => ( -
- editorState.toJSON() } - /> -
- ), + args: { + size: 'md', + options, + onChange: ( editorState ) => editorState.toJSON(), + }, }; export const Large = { - render: () => ( -
- editorState.toJSON() } - /> -
- ), + args: { + size: 'lg', + options, + onChange: ( editorState ) => editorState.toJSON(), + }, }; diff --git a/src/components/editor-input/mention-plugin/mention-component.jsx b/src/components/editor-input/mention-plugin/mention-component.jsx index 93428c32..c7d1c50d 100644 --- a/src/components/editor-input/mention-plugin/mention-component.jsx +++ b/src/components/editor-input/mention-plugin/mention-component.jsx @@ -48,6 +48,7 @@ const MentionComponent = ( { data, by, size, nodeKey } ) => { size={ mapSizeToBadgeSize( size ) } label={ renderLabel } icon={ null } + closable={ true } onClose={ removeMention } disabled={ disabled } /> diff --git a/src/components/input/input.stories.js b/src/components/input/input.stories.js index c239c2ee..9f29b21e 100644 --- a/src/components/input/input.stories.js +++ b/src/components/input/input.stories.js @@ -73,6 +73,33 @@ export default { type: { summary: 'ReactNode' }, }, }, + className: { + name: 'Class Name', + description: 'Defines the extra classes', + control: 'text', + table: { + type: { summary: 'string' }, + defaultValue: { summary: '' }, + }, + }, + onChange: { + name: 'On Change Event', + description: 'Callback function for change event', + control: 'function', + table: { + type: { summary: 'function' }, + defaultValue: { summary: '() => {}' }, + }, + }, + onError: { + name: 'On Error Event', + description: 'Callback function for error event', + control: 'function', + table: { + type: { summary: 'function' }, + defaultValue: { summary: '() => {}' }, + }, + }, }, }; diff --git a/src/components/label/label.stories.js b/src/components/label/label.stories.js index c3863802..6e370cfc 100644 --- a/src/components/label/label.stories.js +++ b/src/components/label/label.stories.js @@ -37,11 +37,34 @@ export default { defaultValue: { summary: 'false' }, }, }, + tag: { + name: 'Tag', + description: 'Defines the tag of the button.', + control: 'select', + // Add 6 to 10 closable tags + options: [ 'label', 'p' ], + table: { + type: { summary: 'string' }, + defaultValue: { summary: 'label' }, + }, + }, children: { - name: 'Text', + name: 'Children', description: 'The label text or content.', + control: 'object', + table: { + type: { summary: 'onject' }, + defaultValue: { summary: 'Label Text' }, + }, + }, + className: { + name: 'Class Name', + description: 'Defines the extra classes', control: 'text', - defaultValue: 'Label Text', + table: { + type: { summary: 'string' }, + defaultValue: { summary: '' }, + }, }, }, }; diff --git a/src/components/loader/loader.stories.jsx b/src/components/loader/loader.stories.jsx index 3d37c7fc..e6c2265a 100644 --- a/src/components/loader/loader.stories.jsx +++ b/src/components/loader/loader.stories.jsx @@ -38,6 +38,15 @@ export default { type: { summary: 'ReactNode' }, }, }, + className: { + name: 'Class Name', + description: 'Defines the extra classes', + control: 'text', + table: { + type: { summary: 'string' }, + defaultValue: { summary: '' }, + }, + }, }, }; diff --git a/src/components/select/select.jsx b/src/components/select/select.jsx index 0b6718cf..a128d1c0 100644 --- a/src/components/select/select.jsx +++ b/src/components/select/select.jsx @@ -110,6 +110,7 @@ function SelectButton( { ? valueItem[ displayBy ] : valueItem } + closable={ true } disabled={ disabled } /> ) ); diff --git a/src/components/select/select.stories.js b/src/components/select/select.stories.js index aae6dfab..8f5fad95 100644 --- a/src/components/select/select.stories.js +++ b/src/components/select/select.stories.js @@ -11,6 +11,7 @@ export default { tags: [ 'autodocs' ], argTypes: { size: { + name: 'Size', description: 'Defines the size variant of the select', control: { type: 'select' }, options: [ 'sm', 'md', 'lg' ], @@ -20,6 +21,7 @@ export default { }, }, multiple: { + name: 'Multiple', description: 'If true, it will allow multiple selection.', control: 'boolean', table: { @@ -27,6 +29,7 @@ export default { }, }, combobox: { + name: 'Combobox', description: 'If true, it will show a search box.', control: 'boolean', table: { @@ -34,24 +37,28 @@ export default { }, }, id: { + name: 'ID', description: 'The `id` attribute of the select element.', table: { type: { summary: 'string' }, }, }, onChange: { + name: 'On Change Event', description: 'Callback function to handle the change event.', table: { type: { summary: 'function' }, }, }, by: { + name: 'By', description: 'Used to identify the selected value when value type is an `object`. Default is `"id"`.', table: { type: { summary: 'string' }, }, }, disabled: { + name: 'Disabled', description: 'If true, the select will be disabled.', table: { type: { summary: 'boolean' }, diff --git a/src/components/skeleton/skeleton.stories.js b/src/components/skeleton/skeleton.stories.js index d9a29e64..b82d8c68 100644 --- a/src/components/skeleton/skeleton.stories.js +++ b/src/components/skeleton/skeleton.stories.js @@ -19,8 +19,13 @@ export default { }, }, className: { + name: 'Class Name', description: 'Allows you to pass custom classes to control the size and styles', control: 'text', + table: { + type: { summary: 'string' }, + defaultValue: { summary: '' }, + }, }, }, }; diff --git a/src/components/switch/switch.stories.js b/src/components/switch/switch.stories.js index 7707ab5a..7a396f6d 100644 --- a/src/components/switch/switch.stories.js +++ b/src/components/switch/switch.stories.js @@ -20,7 +20,7 @@ export default { }, }, disabled: { - name: 'disabled', + name: 'Sisabled', description: 'Defines if the switch is disabled.', control: 'boolean', table: { @@ -36,7 +36,7 @@ export default { }, }, name: { - name: 'name', + name: 'Name', description: 'Name attribute of the input element.', control: 'text', table: { @@ -44,14 +44,14 @@ export default { }, }, onChange: { - name: 'onChange', + name: 'On Change Event', description: 'Callback function fired when the switch state changes.', table: { type: { summary: 'function' }, }, }, defaultValue: { - name: 'defaultValue', + name: 'Default Value', description: 'Default value for uncontrolled switch (true/false).', control: 'boolean', table: { @@ -59,6 +59,15 @@ export default { defaultValue: { summary: 'false' }, }, }, + className: { + name: 'Class Name', + description: 'Defines the extra classes', + control: 'text', + table: { + type: { summary: 'string' }, + defaultValue: { summary: '' }, + }, + }, }, }; diff --git a/src/components/tabs/tabs.stories.jsx b/src/components/tabs/tabs.stories.jsx index 97210ccb..6773a5db 100644 --- a/src/components/tabs/tabs.stories.jsx +++ b/src/components/tabs/tabs.stories.jsx @@ -60,6 +60,24 @@ export default { defaultValue: { summary: 'left' }, }, }, + defaultValue: { + name: 'Default Value', + description: 'Default value for Tab (true/false).', + control: 'string', + table: { + type: { summary: 'string' }, + defaultValue: { summary: '' }, + }, + }, + className: { + name: 'Class Name', + description: 'Defines the extra classes', + control: 'string', + table: { + type: { summary: 'string' }, + defaultValue: { summary: '' }, + }, + }, }, }; diff --git a/src/components/textarea/textarea.stories.jsx b/src/components/textarea/textarea.stories.jsx index 755d31ff..a544d56f 100644 --- a/src/components/textarea/textarea.stories.jsx +++ b/src/components/textarea/textarea.stories.jsx @@ -54,13 +54,30 @@ export default { }, }, onChange: { - name: 'onChange', + name: 'On Change Event', description: 'Callback when the value changes.', action: 'changed', table: { type: { summary: 'function' }, }, }, + onError: { + name: 'On Error Event', + description: 'Callback when error occurs.', + action: 'changed', + table: { + type: { summary: 'function' }, + }, + }, + className: { + name: 'Class Name', + description: 'Defines the extra classes', + control: 'string', + table: { + type: { summary: 'string' }, + defaultValue: { summary: '' }, + }, + }, }, }; diff --git a/src/components/title/title.stories.jsx b/src/components/title/title.stories.jsx index ed2da8d3..15b60d99 100644 --- a/src/components/title/title.stories.jsx +++ b/src/components/title/title.stories.jsx @@ -64,7 +64,7 @@ export default { }, }, className: { - name: 'ClassName', + name: 'Class Name', description: 'Additional custom classes for styling.', control: 'text', table: { diff --git a/src/components/toaster/utils.jsx b/src/components/toaster/utils.jsx index 6baf51e9..cb0728c8 100644 --- a/src/components/toaster/utils.jsx +++ b/src/components/toaster/utils.jsx @@ -19,7 +19,7 @@ export const getIcon = ( { const updatedIcon = cloneElement( icon, { className: cn( commonClasses, nColor, icon.props.className ), } ); - return { updatedIcon }; + return updatedIcon; } switch ( variant ) {