From 4ae40c02d2e7a86262e0c9821d1748577453731c Mon Sep 17 00:00:00 2001 From: JelenaTakac Date: Tue, 3 Sep 2024 12:25:24 +0200 Subject: [PATCH] Implement changes regarding PR feedback --- dist/force-ui.asset.php | 2 +- dist/force-ui.js | 2 +- src/components/tabs/tabs.jsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/force-ui.asset.php b/dist/force-ui.asset.php index 61d6b03c..c0211257 100644 --- a/dist/force-ui.asset.php +++ b/dist/force-ui.asset.php @@ -1 +1 @@ - array('react', 'react-dom'), 'version' => '8625e6cad07736f95f4d'); + array('react', 'react-dom'), 'version' => '151998ad1eeddbf93b05'); diff --git a/dist/force-ui.js b/dist/force-ui.js index c90f1af5..5cbb4c87 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 Uh},Avatar:function(){return Ue},Badge:function(){return Le},Button:function(){return ne},ButtonGroup:function(){return ei},Checkbox:function(){return _e},Container:function(){return Wh},EditorInput:function(){return _w},Input:function(){return Ge},Label:function(){return Qe},Loader:function(){return nt},ProgressBar:function(){return rt},RadioButton:function(){return Me},Select:function(){return Jf},Skeleton:function(){return Ew},Switch:function(){return de},Tabs:function(){return Nf},TextArea:function(){return We},Title:function(){return et},Toaster:function(){return Ih},Tooltip:function(){return Yo},toast:function(){return ph}});const o=e=>{const t=l(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{const n=e.split("-");return""===n[0]&&1!==n.length&&n.shift(),i(n,t)||a(e)},getConflictingClassGroupIds:(e,t)=>{const o=n[e]||[];return t&&r[e]?[...o,...r[e]]:o}}},i=(e,t)=>{if(0===e.length)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?i(e.slice(1),r):void 0;if(o)return o;if(0===t.validators.length)return;const s=e.join("-");return t.validators.find((({validator:e})=>e(s)))?.classGroupId},s=/^\[(.+)\]$/,a=e=>{if(s.test(e)){const t=s.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},l=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return f(Object.entries(e.classGroups),n).forEach((([e,n])=>{c(n,r,e,t)})),r},c=(e,t,n,r)=>{e.forEach((e=>{if("string"!=typeof e){if("function"==typeof e)return d(e)?void c(e(r),t,n,r):void t.validators.push({validator:e,classGroupId:n});Object.entries(e).forEach((([e,o])=>{c(o,u(t,e),n,r)}))}else(""===e?t:u(t,e)).classGroupId=n}))},u=(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},d=e=>e.isThemeGetter,f=(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,h=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)}}},p=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},m=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},g=/\s+/;function v(){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:h(e.cacheSize),parseClassName:p(e),...o(e)}))(c),r=n.cache.get,i=n.cache.set,s=a,a(l)};function a(e){const t=r(e);if(t)return t;const o=((e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=[],s=e.trim().split(g);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=m(l).join(":"),g=c?p+"!":p,v=g+h;if(i.includes(v))continue;i.push(v);const y=o(h,f);for(let e=0;e0?" "+a:a)}return a})(e,n);return i(e,o),o}return function(){return s(v.apply(null,arguments))}}const x=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},w=/^\[(?:([a-z-]+):)?(.+)\]$/i,_=/^\d+\/\d+$/,S=new Set(["px","full","screen"]),k=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,E=/\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$/,C=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,T=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,P=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,R=e=>A(e)||S.has(e)||_.test(e),O=e=>K(e,"length",$),A=e=>Boolean(e)&&!Number.isNaN(Number(e)),N=e=>K(e,"number",A),M=e=>Boolean(e)&&Number.isInteger(Number(e)),D=e=>e.endsWith("%")&&A(e.slice(0,-1)),I=e=>w.test(e),j=e=>k.test(e),L=new Set(["length","size","percentage"]),F=e=>K(e,L,H),V=e=>K(e,"position",H),z=new Set(["image","url"]),B=e=>K(e,z,Y),W=e=>K(e,"",q),U=()=>!0,K=(e,t,n)=>{const r=w.exec(e);return!!r&&(r[1]?"string"==typeof t?r[1]===t:t.has(r[1]):n(r[2]))},$=e=>E.test(e)&&!C.test(e),H=()=>!1,q=e=>T.test(e),Y=e=>P.test(e),X=(Symbol.toStringTag,()=>{const e=x("colors"),t=x("spacing"),n=x("blur"),r=x("brightness"),o=x("borderColor"),i=x("borderRadius"),s=x("borderSpacing"),a=x("borderWidth"),l=x("contrast"),c=x("grayscale"),u=x("hueRotate"),d=x("invert"),f=x("gap"),h=x("gradientColorStops"),p=x("gradientColorStopPositions"),m=x("inset"),g=x("margin"),v=x("opacity"),y=x("padding"),b=x("saturate"),w=x("scale"),_=x("sepia"),S=x("skew"),k=x("space"),E=x("translate"),C=()=>["auto",I,t],T=()=>[I,t],P=()=>["",R,O],L=()=>["auto",A,I],z=()=>["","0",I],K=()=>[A,I];return{cacheSize:500,separator:":",theme:{colors:[U],spacing:[R,O],blur:["none","",j,I],brightness:K(),borderColor:[e],borderRadius:["none","","full",j,I],borderSpacing:T(),borderWidth:P(),contrast:K(),grayscale:z(),hueRotate:K(),invert:z(),gap:T(),gradientColorStops:[e],gradientColorStopPositions:[D,O],inset:C(),margin:C(),opacity:K(),padding:T(),saturate:K(),scale:K(),sepia:z(),skew:K(),space:T(),translate:T()},classGroups:{aspect:[{aspect:["auto","square","video",I]}],container:["container"],columns:[{columns:[j]}],"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",I]}],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",M,I]}],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",I]}],grow:[{grow:z()}],shrink:[{shrink:z()}],order:[{order:["first","last","none",M,I]}],"grid-cols":[{"grid-cols":[U]}],"col-start-end":[{col:["auto",{span:["full",M,I]},I]}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":[U]}],"row-start-end":[{row:["auto",{span:[M,I]},I]}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",I]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",I]}],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":[k]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[k]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",I,t]}],"min-w":[{"min-w":[I,t,"min","max","fit"]}],"max-w":[{"max-w":[I,t,"none","full","min","max","fit","prose",{screen:[j]},j]}],h:[{h:[I,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[I,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[I,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[I,t,"auto","min","max","fit"]}],"font-size":[{text:["base",j,O]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",N]}],"font-family":[{font:[U]}],"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",I]}],"line-clamp":[{"line-clamp":["none",A,N]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",R,I]}],"list-image":[{"list-image":["none",I]}],"list-style-type":[{list:["none","disc","decimal",I]}],"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",R,O]}],"underline-offset":[{"underline-offset":["auto",R,I]}],"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",I]}],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",I]}],"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",F]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},B]}],"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":[R,I]}],"outline-w":[{outline:[R,O]}],"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":[R,O]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",j,W]}],"shadow-color":[{shadow:[U]}],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",j,I]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[b]}],sepia:[{sepia:[_]}],"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":[_]}],"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",I]}],duration:[{duration:K()}],ease:[{ease:["linear","in","out","in-out",I]}],delay:[{delay:K()}],animate:[{animate:["none","spin","ping","pulse","bounce",I]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[M,I]}],"translate-x":[{"translate-x":[E]}],"translate-y":[{"translate-y":[E]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",I]}],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",I]}],"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",I]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[R,O,N]}],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"]}}}),G=b(X);function J(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===r?void 0:r[l],T=null,P="";x&&(P="flex items-center justify-center gap-1","left"===_?o=x:T=x);var R=f;return React.createElement(R,te({type:u,className:Q(P,"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",C,k,E,h),disabled:g},S),o,p,T)},re=n(609),oe=n.n(re);let ie=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&n[e]];return t};var se=["id","onChange","value","defaultValue","size","disabled","label","name"];function ae(){return ae=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 he={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 pe=(0,re.forwardRef)((({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:s,...a},l)=>(0,re.createElement)("svg",{ref:l,...he,width:t,height:t,stroke:e,strokeWidth:r?24*Number(n)/Number(t):n,className:fe("lucide",o),...a},[...s.map((([e,t])=>(0,re.createElement)(e,t))),...Array.isArray(i)?i:[i]]))),me=(e,t)=>{const n=(0,re.forwardRef)((({className:n,...r},o)=>{return(0,re.createElement)(pe,{ref:o,iconNode:t,className:fe(`lucide-${i=e,i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,n),...r});var i}));return n.displayName=`${e}`,n},ge=me("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]),ve=me("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);var ye=["id","label","defaultChecked","checked","onChange","value","indeterminate","disabled","size"];function be(){return be=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"}[s],"border-0 border-r border-border-subtle border-solid");return oe().createElement(oe().Fragment,null,oe().createElement("button",Ee({type:"button",id:m,className:Q(y,"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",v&&"bg-button-disabled"),onClick:function(){f&&f(r)},disabled:g},a),oe().createElement("input",{type:"hidden",value:r,name:c,checked:v,onChange:f}),n))},Me={Group:function(e){var t,n,r=e.children,o=e.name,i=e.value,s=e.defaultValue,a=e.by,l=void 0===a?"id":a,c=e.as,u=void 0===c?re.Fragment:c,d=e.onChange,f=e.className,h=e.style,p=void 0===h?"simple":h,m=e.disabled,g=void 0!==m&&m,v=(0,re.useMemo)((function(){return void 0!==i}),[i]),y=(0,re.useMemo)((function(){return o||"radio-button-group-".concat(ie())}),[o]),b=(t=(0,re.useState)(v?i:s),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 Pe(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)?Pe(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.")}()),x=b[0],w=b[1],_=(0,re.useCallback)((function(e){var t;t="tile"===p?e:e.target.value,v||w(t),"function"==typeof d&&d(t)}),[d]),S=Q("tile"===p?"inline-flex border border-border-subtle border-solid rounded shadow-sm":"flex gap-6",f),k=function(){return oe().createElement(Re.Provider,{value:{name:y,value:v?i:x,by:l,onChange:_,isControlled:v,disableAll:g,style:p}},oe().Children.map(r,(function(e){return(0,re.isValidElement)(e)?e:null})))};return oe().createElement(oe().Fragment,null,"tile"===p?oe().createElement("div",{className:S},k()):oe().createElement(u,u===re.Fragment?{}:{className:f},k()))},Button:(0,re.forwardRef)(Ae)};const De=me("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),Ie=me("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);var je=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(De,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"},S="",k="group relative justify-center flex items-center [&>svg]:h-4 [&>svg]:w-4 cursor-pointer";return m?(S=_.disabled,k+=" cursor-not-allowed disabled"):S=_[d],r?React.createElement("span",{className:Q("font-medium border 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],S,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:k,onClick:m?null:v,onMouseDown:w,role:"button",tabIndex:0},React.createElement("span",{className:"sr-only"},"Remove ".concat(r)),React.createElement(Ie,null),React.createElement("span",{className:"absolute -inset-1"}))):null},Le=(0,re.forwardRef)(je),Fe=["id","defaultValue","value","size","className","disabled","onChange","error","onError"];function Ve(){return Ve=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:Q("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 Ke=me("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 $e=["id","type","defaultValue","value","size","className","disabled","onChange","error","onError","prefix","suffix"];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);n0?N(t[0].name):N(null):t=e.target.value,C||"file"===o||R(t),"function"==typeof m&&m(t))},I="border border-solid border-border-subtle bg-field-secondary-background font-normal placeholder-text-tertiary text-text-primary w-full",j={sm:"px-2 py-2 rounded",md:"px-2.5 py-2.5 rounded-md",lg:"px-3 py-3 rounded-lg"},L={sm:"text-xs",md:"text-base",lg:"text-base"},F={sm:w?"pl-8":"",md:w?"pl-9":"",lg:w?"pl-10":""},V={sm:S?"pr-8":"",md:S?"pr-9":"",lg:S?"pr-10":""},z=h?"hover:border-border-disabled":"hover:border-border-strong",B="focus:border-focus-border focus:ring-2 focus:ring-toggle-on focus:ring-offset-2",W=v?"focus:border-focus-error-border focus:ring-field-color-error bg-field-background-error":"",U=v?"focus:border-focus-error-border focus:ring-field-color-error":"",K=h?"border-border-disabled bg-field-background-disabled cursor-not-allowed text-text-disabled":"",$=h?"border-border-disabled cursor-not-allowed text-text-disabled file:text-text-tertiary":"",H="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",q=h?"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",Y=A?"file:border-0 file:bg-transparent":"text-text-tertiary file:border-0 file:bg-transparent";return"file"===o?React.createElement("div",{className:Q("relative flex focus-within:z-10",d)},React.createElement("input",He({ref:t,id:E,type:"file",className:Q(I,$,j[c],L[c],B,z,U,Y),disabled:h,onChange:D,onInvalid:b},k)),React.createElement("div",{className:Q(q,"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"}[c])},React.createElement(Ke,null))):React.createElement("div",{className:Q("relative flex focus-within:z-10",d)},w?React.createElement("div",{className:Q(H,"left-0 pl-3",L[c])},w):null,React.createElement("input",He({ref:t,id:E,type:o,className:Q(I,K,j[c],L[c],F[c],V[c],B,z,W),disabled:h,onChange:D,onInvalid:b,value:M()},k)),S?React.createElement("div",{className:Q(H,"right-0 pr-3",L[c])},S):null)},Ge=(0,re.forwardRef)(Xe),Je=["children","tag","size","className","variant","required"];function Ze(){return Ze=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"}[s],{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"}[u],p,l)},h),n)},et=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:Q("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:Q("flex items-center",m[f])},s,g()),s&&"right"===l&&React.createElement("div",{className:Q("flex items-center",m[f])},g(),s),!s&&g()),React.createElement("span",{className:Q("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:Q("flex items-center",m[f])},s,g()),s&&"right"===l&&React.createElement("div",{className:Q("flex items-center",m[f])},g(),s),!s&&g())};const tt=me("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);var nt=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:Q("flex",f,d,u)},l||React.createElement(tt,{className:"animate-spin"}))},rt=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:Q("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 ot(e){return at(e)?(e.nodeName||"").toLowerCase():"#document"}function it(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function st(e){var t;return null==(t=(at(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function at(e){return e instanceof Node||e instanceof it(e).Node}function lt(e){return e instanceof Element||e instanceof it(e).Element}function ct(e){return e instanceof HTMLElement||e instanceof it(e).HTMLElement}function ut(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof it(e).ShadowRoot)}function dt(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=vt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function ft(e){return["table","td","th"].includes(ot(e))}function ht(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function pt(e){const t=mt(),n=lt(e)?vt(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 mt(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function gt(e){return["html","body","#document"].includes(ot(e))}function vt(e){return it(e).getComputedStyle(e)}function yt(e){return lt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function bt(e){if("html"===ot(e))return e;const t=e.assignedSlot||e.parentNode||ut(e)&&e.host||st(e);return ut(t)?t.host:t}function xt(e){const t=bt(e);return gt(t)?e.ownerDocument?e.ownerDocument.body:e.body:ct(t)&&dt(t)?t:xt(t)}function wt(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=xt(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),s=it(o);if(i){const e=_t(s);return t.concat(s,s.visualViewport||[],dt(o)?o:[],e&&n?wt(e):[])}return t.concat(o,wt(o,[],n))}function _t(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function St(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 kt(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&ut(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Et(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function Ct(){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 Tt(e){return!(0!==e.mozInputSource||!e.isTrusted)||(Ot()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function Pt(e){return!Ct().includes("jsdom/")&&(!Ot()&&0===e.width&&0===e.height||Ot()&&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 Rt(){return/apple/i.test(navigator.vendor)}function Ot(){const e=/android/i;return e.test(Et())||e.test(Ct())}function At(){return Et().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function Nt(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Mt(e){return(null==e?void 0:e.ownerDocument)||document}function Dt(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 It(e){return"composedPath"in e?e.composedPath()[0]:e.target}const jt="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Lt(e){return ct(e)&&e.matches(jt)}function Ft(e){e.preventDefault(),e.stopPropagation()}function Vt(e){return!!e&&"combobox"===e.getAttribute("role")&&Lt(e)}const zt=Math.min,Bt=Math.max,Wt=Math.round,Ut=Math.floor,Kt=e=>({x:e,y:e}),$t={left:"right",right:"left",bottom:"top",top:"bottom"},Ht={start:"end",end:"start"};function qt(e,t,n){return Bt(e,zt(t,n))}function Yt(e,t){return"function"==typeof e?e(t):e}function Xt(e){return e.split("-")[0]}function Gt(e){return e.split("-")[1]}function Jt(e){return"x"===e?"y":"x"}function Zt(e){return"y"===e?"height":"width"}function Qt(e){return["top","bottom"].includes(Xt(e))?"y":"x"}function en(e){return Jt(Qt(e))}function tn(e){return e.replace(/start|end/g,(e=>Ht[e]))}function nn(e){return e.replace(/left|right|bottom|top/g,(e=>$t[e]))}function rn(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 on(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 sn=["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(","),an="undefined"==typeof Element,ln=an?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,cn=!an&&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},un=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)},dn=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var s=i.shift();if(!un(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{ln.call(s,sn)&&r.filter(s)&&(n||!t.includes(s))&&o.push(s);var c=s.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(s),u=!un(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},fn=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},hn=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))&&!fn(e)?0:e.tabIndex},pn=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},mn=function(e){return"INPUT"===e.tagName},gn=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},vn=function(e,t){return!(t.disabled||un(t)||function(e){return mn(e)&&"hidden"===e.type}(t)||function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=ln.call(e,"details>summary:first-of-type")?e.parentElement:e;if(ln.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return gn(e)}else{if("function"==typeof r){for(var i=e;e;){var s=e.parentElement,a=cn(e);if(s&&!s.shadowRoot&&!0===r(s))return gn(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&&cn(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=cn(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)},xn=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=hn(e);return n<0&&t&&!fn(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(pn).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},wn=function(e,t){var n;return n=(t=t||{}).getShadowRoot?dn([e],t.includeContainer,{filter:yn.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:bn}):function(e,t,n){if(un(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(sn));return t&&ln.call(e,sn)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,yn.bind(null,t)),xn(n)},Sn=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==ln.call(e,sn)&&yn(t,e)},kn=window.ReactDOM;function En(e,t,n){let{reference:r,floating:o}=e;const i=Qt(t),s=en(t),a=Zt(s),l=Xt(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(Gt(t)){case"start":h[s]-=f*(n&&c?-1:1);break;case"end":h[s]+=f*(n&&c?-1:1)}return h}async function Cn(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}=Yt(t,e),p=rn(h),m=a[f?"floating"===d?"reference":"floating":d],g=on(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=on(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 Tn(e){const t=vt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ct(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Wt(n)!==i||Wt(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Pn(e){return lt(e)?e:e.contextElement}function Rn(e){const t=Pn(e);if(!ct(t))return Kt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Tn(t);let s=(i?Wt(n.width):n.width)/r,a=(i?Wt(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const On=Kt(0);function An(e){const t=it(e);return mt()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:On}function Nn(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Pn(e);let s=Kt(1);t&&(r?lt(r)&&(s=Rn(r)):s=Rn(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==it(e))&&t}(i,n,r)?An(i):Kt(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=it(i),t=r&<(r)?it(r):r;let n=e,o=_t(n);for(;o&&r&&t!==n;){const e=Rn(o),t=o.getBoundingClientRect(),r=vt(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=it(o),o=_t(n)}}return on({width:u,height:d,x:l,y:c})}function Mn(e){return Nn(st(e)).left+yt(e).scrollLeft}function Dn(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=it(e),r=st(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=mt();(!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=st(e),n=yt(e),r=e.ownerDocument.body,o=Bt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Bt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Mn(e);const a=-n.scrollTop;return"rtl"===vt(r).direction&&(s+=Bt(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}(st(e));else if(lt(t))r=function(e,t){const n=Nn(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=ct(e)?Rn(e):Kt(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=An(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return on(r)}function In(e,t){const n=bt(e);return!(n===t||!lt(n)||gt(n))&&("fixed"===vt(n).position||In(n,t))}function jn(e,t,n){const r=ct(t),o=st(t),i="fixed"===n,s=Nn(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=Kt(0);if(r||!r&&!i)if(("body"!==ot(t)||dt(o))&&(a=yt(t)),r){const e=Nn(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=Mn(o));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function Ln(e){return"static"===vt(e).position}function Fn(e,t){return ct(e)&&"fixed"!==vt(e).position?t?t(e):e.offsetParent:null}function Vn(e,t){const n=it(e);if(ht(e))return n;if(!ct(e)){let t=bt(e);for(;t&&!gt(t);){if(lt(t)&&!Ln(t))return t;t=bt(t)}return n}let r=Fn(e,t);for(;r&&ft(r)&&Ln(r);)r=Fn(r,t);return r&>(r)&&Ln(r)&&!pt(r)?n:r||function(e){let t=bt(e);for(;ct(t)&&!gt(t);){if(pt(t))return t;if(ht(t))return null;t=bt(t)}return null}(e)||n}const zn={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,s=st(r),a=!!t&&ht(t.floating);if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=Kt(1);const u=Kt(0),d=ct(r);if((d||!d&&!i)&&(("body"!==ot(r)||dt(s))&&(l=yt(r)),ct(r))){const e=Nn(r);c=Rn(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:st,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?ht(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=wt(e,[],!1).filter((e=>lt(e)&&"body"!==ot(e))),o=null;const i="fixed"===vt(e).position;let s=i?bt(e):e;for(;lt(s)&&!gt(s);){const t=vt(s),n=pt(s);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||dt(s)&&!n&&In(e,s))?r=r.filter((e=>e!==s)):o=t,s=bt(s)}return t.set(e,r),r}(t,this._c):[].concat(n),r],s=i[0],a=i.reduce(((e,n)=>{const r=Dn(t,n,o);return e.top=Bt(r.top,e.top),e.right=zt(r.right,e.right),e.bottom=zt(r.bottom,e.bottom),e.left=Bt(r.left,e.left),e}),Dn(t,s,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:Vn,getElementRects:async function(e){const t=this.getOffsetParent||Vn,n=this.getDimensions,r=await n(e.floating);return{reference:jn(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}=Tn(e);return{width:t,height:n}},getScale:Rn,isElement:lt,isRTL:function(e){return"rtl"===vt(e).direction}};function Bn(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=Pn(e),u=o||i?[...c?wt(c):[],...wt(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=st(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:-Ut(u)+"px "+-Ut(o.clientWidth-(c+d))+"px "+-Ut(o.clientHeight-(u+f))+"px "+-Ut(c)+"px",threshold:Bt(0,zt(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?Nn(e):null;return l&&function t(){const r=Nn(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 Wn=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=Xt(n),a=Gt(n),l="y"===Qt(n),c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=Yt(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}}}}},Un=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}=Yt(e,t),c={x:n,y:r},u=await Cn(t,l),d=Qt(Xt(o)),f=Jt(d);let h=c[f],p=c[d];if(i){const e="y"===f?"bottom":"right";h=qt(h+u["y"===f?"top":"left"],h,h-u[e])}if(s){const e="y"===d?"bottom":"right";p=qt(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}}}}},Kn=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}=Yt(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=Xt(o),y=Qt(a),b=Xt(a)===a,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=f||(b||!m?[nn(a)]:function(e){const t=nn(e);return[tn(e),t,tn(t)]}(a)),_="none"!==p;!f&&_&&w.push(...function(e,t,n,r){const o=Gt(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[]}}(Xt(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(tn)))),i}(a,m,p,x));const S=[a,...w],k=await Cn(t,g),E=[];let C=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&E.push(k[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=Gt(e),o=en(e),i=Zt(o);let s="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=nn(s)),[s,nn(s)]}(o,s,x);E.push(k[e[0]],k[e[1]])}if(C=[...C,{placement:o,overflows:E}],!E.every((e=>e<=0))){var T,P;const e=((null==(T=i.flip)?void 0:T.index)||0)+1,t=S[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=Qt(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{}}}},$n=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}=Yt(e,t),l=await Cn(t,a),c=Xt(n),u=Gt(n),d="y"===Qt(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=zt(h-l[p],g),b=zt(f-l[m],v),x=!t.middlewareData.shift;let w=y,_=b;if(d?_=u||x?zt(b,v):v:w=u||x?zt(y,g):g,x&&!u){const e=Bt(l.left,0),t=Bt(l.right,0),n=Bt(l.top,0),r=Bt(l.bottom,0);d?_=f-2*(0!==e||0!==t?e+t:Bt(l.left,l.right)):w=h-2*(0!==n||0!==r?n+r:Bt(l.top,l.bottom))}await s({...t,availableWidth:_,availableHeight:w});const S=await o.getDimensions(i.floating);return f!==S.width||h!==S.height?{reset:{rects:!0}}:{}}}},Hn=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}=Yt(e,t)||{};if(null==c)return{};const d=rn(u),f={x:n,y:r},h=en(o),p=Zt(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 S=_?_[b]:0;S&&await(null==s.isElement?void 0:s.isElement(_))||(S=a.floating[b]||i.floating[p]);const k=x/2-w/2,E=S/2-m[p]/2-1,C=zt(d[v],E),T=zt(d[y],E),P=C,R=S-m[p]-T,O=S/2-m[p]/2+k,A=qt(P,O,R),N=!l.arrow&&null!=Gt(o)&&O!==A&&i.reference[p]/2-(O{const r=new Map,o={platform:zn,...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}=En(c,r,l),f=r,h={},p=0;for(let n=0;n{t.current=e})),t}const Qn=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?Hn({element:n.current,padding:r}).fn(t):{}:n?Hn({element:n,padding:r}).fn(t):{};var o}}),er=(e,t)=>({...Wn(e),options:[e,t]}),tr=(e,t)=>({...Kn(e),options:[e,t]}),nr=(e,t)=>({...Qn(e),options:[e,t]}),rr={...re},or=rr.useInsertionEffect||(e=>e());function ir(e){const t=re.useRef((()=>{}));return or((()=>{t.current=e})),re.useCallback((function(){for(var e=arguments.length,n=new Array(e),r=0;r=e.current.length}function fr(e,t){return pr(e,{disabledIndices:t})}function hr(e,t){return pr(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function pr(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&&vr(s,a,o));return a}function mr(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 gr(e,t){return t.flatMap(((t,n)=>e.includes(t)?[n]:[]))}function vr(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 yr=0;function br(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(yr);const i=()=>null==e?void 0:e.focus({preventScroll:n});o?i():yr=requestAnimationFrame(i)}var xr="undefined"!=typeof document?re.useLayoutEffect:re.useEffect;function wr(){return wr=Object.assign?Object.assign.bind():function(e){for(var t=1;t"floating-ui-"+Math.random().toString(36).slice(2,6)+Sr++,Er=rr.useId||function(){const[e,t]=re.useState((()=>_r?kr():void 0));return xr((()=>{null==e&&t(kr())}),[]),re.useEffect((()=>{_r=!0}),[]),e},Cr=re.forwardRef((function(e,t){const{context:{placement:n,elements:{floating:r},middlewareData:{arrow:o}},width:i=14,height:s=7,tipRadius:a=0,strokeWidth:l=0,staticOffset:c,stroke:u,d:d,style:{transform:f,...h}={},...p}=e,m=Er(),[g,v]=re.useState(!1);if(xr((()=>{r&&"rtl"===vt(r).direction&&v(!0)}),[r]),!r)return null;const y=2*l,b=y/2,x=i/2*(a/-8+1),w=s/2*a/4,[_,S]=n.split("-"),k=!!d,E="top"===_||"bottom"===_,C=c&&"end"===S?"bottom":"top";let T=c&&"end"===S?"right":"left";c&&g&&(T="end"===S?"left":"right");const P=null!=(null==o?void 0:o.x)?c||o.x:"",R=null!=(null==o?void 0:o.y)?c||o.y:"",O=d||"M0,0 H"+i+" L"+(i-x)+","+(s-w)+" Q"+i/2+","+s+" "+x+","+(s-w)+" Z",A={top:k?"rotate(180deg)":"",left:k?"rotate(90deg)":"rotate(-90deg)",bottom:k?"":"rotate(180deg)",right:k?"rotate(-90deg)":"rotate(90deg)"}[_];return re.createElement("svg",wr({},p,{"aria-hidden":!0,ref:t,width:k?i:i+y,height:i,viewBox:"0 0 "+i+" "+(s>i?s:i),style:{position:"absolute",pointerEvents:"none",[T]:P,[C]:R,[_]:E||k?"100%":"calc(100% - "+y/2+"px)",transform:""+A+(null!=f?f:""),...h}}),y>0&&re.createElement("path",{clipPath:"url(#"+m+")",fill:"none",stroke:u,strokeWidth:y+(d?0:1),d:O}),re.createElement("path",{stroke:y&&!d?p.fill:"none",d:O}),re.createElement("clipPath",{id:m},re.createElement("rect",{x:-b,y:b*(k?-1:1),width:i+y,height:i})))}));const Tr=re.createContext(null),Pr=re.createContext(null),Rr=()=>{var e;return(null==(e=re.useContext(Tr))?void 0:e.id)||null},Or=()=>re.useContext(Pr);function Ar(e){return"data-floating-ui-"+e}function Nr(e){const t=(0,re.useRef)(e);return xr((()=>{t.current=e})),t}const Mr=Ar("safe-polygon");function Dr(e,t,n){return n&&!Nt(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}function Ir(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 jr=new WeakMap,Lr=new WeakSet,Fr={},Vr=0;const zr=e=>e&&(e.host||zr(e.parentNode)),Br=(e,t)=>t.map((t=>{if(e.contains(t))return t;const n=zr(t);return e.contains(n)?n:null})).filter((e=>null!=e));function Wr(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=Mt(e[0]).body;return function(e,t,n,r){const o="data-floating-ui-inert",i=r?"inert":n?"aria-hidden":null,s=Br(t,e),a=new Set,l=new Set(s),c=[];Fr[o]||(Fr[o]=new WeakMap);const u=Fr[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"!==ot(t))if(a.has(t))e(t);else{const e=i?t.getAttribute(i):null,n=null!==e&&"false"!==e,r=(jr.get(t)||0)+1,s=(u.get(t)||0)+1;jr.set(t,r),u.set(t,s),c.push(t),1===r&&n&&Lr.add(t),1===s&&t.setAttribute(o,""),!n&&i&&t.setAttribute(i,"true")}}))}(t),a.clear(),Vr++,()=>{c.forEach((e=>{const t=(jr.get(e)||0)-1,n=(u.get(e)||0)-1;jr.set(e,t),u.set(e,n),t||(!Lr.has(e)&&i&&e.removeAttribute(i),Lr.delete(e)),n||e.removeAttribute(o)})),Vr--,Vr||(jr=new WeakMap,jr=new WeakMap,Lr=new WeakSet,Fr={})}}(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const Ur=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Kr(e,t){const n=wn(e,Ur());"prev"===t&&n.reverse();const r=n.indexOf(St(Mt(e)));return n.slice(r+1)[0]}function $r(){return Kr(document.body,"next")}function Hr(){return Kr(document.body,"prev")}function qr(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!kt(n,r)}function Yr(e){wn(e,Ur()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function Xr(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 Gr={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 Jr(e){"Tab"===e.key&&(e.target,clearTimeout(void 0))}const Zr=re.forwardRef((function(e,t){const[n,r]=re.useState();xr((()=>(Rt()&&r("button"),document.addEventListener("keydown",Jr),()=>{document.removeEventListener("keydown",Jr)})),[]);const o={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[Ar("focus-guard")]:"",style:Gr};return re.createElement("span",wr({},e,o))})),Qr=re.createContext(null),eo=Ar("portal");function to(e){const{children:t,id:n,root:r=null,preserveTabOrder:o=!0}=e,i=function(e){void 0===e&&(e={});const{id:t,root:n}=e,r=Er(),o=no(),[i,s]=re.useState(null),a=re.useRef(null);return xr((()=>()=>{null==i||i.remove(),queueMicrotask((()=>{a.current=null}))}),[i]),xr((()=>{if(!r)return;if(a.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=r,n.setAttribute(eo,""),e.appendChild(n),a.current=n,s(n)}),[t,r]),xr((()=>{if(!r)return;if(a.current)return;let e=n||(null==o?void 0:o.portalNode);e&&!lt(e)&&(e=e.current),e=e||document.body;let i=null;t&&(i=document.createElement("div"),i.id=t,e.appendChild(i));const l=document.createElement("div");l.id=r,l.setAttribute(eo,""),e=i||e,e.appendChild(l),a.current=l,s(l)}),[t,n,r,o]),i}({id:n,root:r}),[s,a]=re.useState(null),l=re.useRef(null),c=re.useRef(null),u=re.useRef(null),d=re.useRef(null),f=!!s&&!s.modal&&s.open&&o&&!(!r&&!i);return re.useEffect((()=>{if(i&&o&&(null==s||!s.modal))return i.addEventListener("focusin",e,!0),i.addEventListener("focusout",e,!0),()=>{i.removeEventListener("focusin",e,!0),i.removeEventListener("focusout",e,!0)};function e(e){i&&qr(e)&&("focusin"===e.type?Xr:Yr)(i)}}),[i,o,null==s?void 0:s.modal]),re.createElement(Qr.Provider,{value:re.useMemo((()=>({preserveTabOrder:o,beforeOutsideRef:l,afterOutsideRef:c,beforeInsideRef:u,afterInsideRef:d,portalNode:i,setFocusManagerState:a})),[o,i])},f&&i&&re.createElement(Zr,{"data-type":"outside",ref:l,onFocus:e=>{if(qr(e,i)){var t;null==(t=u.current)||t.focus()}else{const e=Hr()||(null==s?void 0:s.refs.domReference.current);null==e||e.focus()}}}),f&&i&&re.createElement("span",{"aria-owns":i.id,style:Gr}),i&&kn.createPortal(t,i),f&&i&&re.createElement(Zr,{"data-type":"outside",ref:c,onFocus:e=>{if(qr(e,i)){var t;null==(t=d.current)||t.focus()}else{const t=$r()||(null==s?void 0:s.refs.domReference.current);null==t||t.focus(),(null==s?void 0:s.closeOnFocusOut)&&(null==s||s.onOpenChange(!1,e.nativeEvent))}}}))}const no=()=>re.useContext(Qr),ro=20;let oo=[];function io(e){oo=oo.filter((e=>e.isConnected));let t=e;if(t&&"body"!==ot(t)){if(!Sn(t,Ur())){const e=wn(t,Ur())[0];e&&(t=e)}oo.push(t),oo.length>ro&&(oo=oo.slice(-ro))}}function so(){return oo.slice().reverse().find((e=>e.isConnected))}const ao=re.forwardRef((function(e,t){return re.createElement("button",wr({},e,{type:"button",ref:t,tabIndex:-1,style:Gr}))}));function lo(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],guards:i=!0,initialFocus:s=0,returnFocus:a=!0,restoreFocus:l=!1,modal:c=!0,visuallyHiddenDismiss:u=!1,closeOnFocusOut:d=!0}=e,{open:f,refs:h,nodeId:p,onOpenChange:m,events:g,dataRef:v,floatingId:y,elements:{domReference:b,floating:x}}=t,w="number"==typeof s&&s<0,_=Vt(b)&&w,S=!("undefined"!=typeof HTMLElement&&"inert"in HTMLElement.prototype)||i,k=Nr(o),E=Nr(s),C=Nr(a),T=Or(),P=no(),R=re.useRef(null),O=re.useRef(null),A=re.useRef(!1),N=re.useRef(!1),M=re.useRef(-1),D=null!=P,I=null==x?void 0:x.firstElementChild,j=(null==I?void 0:I.id)===y?I:x,L=ir((function(e){return void 0===e&&(e=j),e?wn(e,Ur()):[]})),F=ir((e=>{const t=L(e);return k.current.map((e=>b&&"reference"===e?b:j&&"floating"===e?j:t)).filter(Boolean).flat()}));function V(e){return!r&&u&&c?re.createElement(ao,{ref:"start"===e?R:O,onClick:e=>m(!1,e.nativeEvent)},"string"==typeof u?u:"Dismiss"):null}re.useEffect((()=>{if(r)return;if(!c)return;function e(e){if("Tab"===e.key){kt(j,St(Mt(j)))&&0===L().length&&!_&&Ft(e);const t=F(),n=It(e);"reference"===k.current[0]&&n===b&&(Ft(e),e.shiftKey?br(t[t.length-1]):br(t[1])),"floating"===k.current[1]&&n===j&&e.shiftKey&&(Ft(e),br(t[0]))}}const t=Mt(j);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[r,b,j,c,k,_,L,F]),re.useEffect((()=>{if(!r&&x)return x.addEventListener("focusin",e),()=>{x.removeEventListener("focusin",e)};function e(e){const t=It(e),n=L().indexOf(t);-1!==n&&(M.current=n)}}),[r,x,L]),re.useEffect((()=>{if(!r&&d)return x&&ct(b)?(b.addEventListener("focusout",t),b.addEventListener("pointerdown",e),x.addEventListener("focusout",t),()=>{b.removeEventListener("focusout",t),b.removeEventListener("pointerdown",e),x.removeEventListener("focusout",t)}):void 0;function e(){N.current=!0,setTimeout((()=>{N.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=!(kt(b,t)||kt(x,t)||kt(t,x)||kt(null==P?void 0:P.portalNode,t)||null!=t&&t.hasAttribute(Ar("focus-guard"))||T&&(Ir(T.nodesRef.current,p).find((e=>{var n,r;return kt(null==(n=e.context)?void 0:n.elements.floating,t)||kt(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}(T.nodesRef.current,p).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(l&&n&&St(Mt(j))===Mt(j).body){ct(j)&&(null==j||j.focus());const e=M.current,t=L(),n=t[e]||t[t.length-1]||j;ct(n)&&n.focus()}!_&&c||!t||!n||N.current||t===so()||(A.current=!0,m(!1,e))}))}}),[r,b,x,j,c,p,T,P,m,d,l,L,_]),re.useEffect((()=>{var e;if(r)return;const t=Array.from((null==P||null==(e=P.portalNode)?void 0:e.querySelectorAll("["+Ar("portal")+"]"))||[]);if(x){const e=[x,...t,R.current,O.current,k.current.includes("reference")||_?b:null].filter((e=>null!=e)),n=c||_?Wr(e,S,!S):Wr(e);return()=>{n()}}}),[r,b,x,c,k,P,_,S]),xr((()=>{if(r||!ct(j))return;const e=St(Mt(j));queueMicrotask((()=>{const t=F(j),n=E.current,r=("number"==typeof n?t[n]:n.current)||j,o=kt(j,e);w||o||!f||br(r,{preventScroll:r===j})}))}),[r,f,j,w,F,E]),xr((()=>{if(r||!j)return;let e=!1;const t=Mt(j),n=St(t);let o=v.current.openEvent;const i=h.domReference.current;function s(t){let{open:n,reason:r,event:i,nested:s}=t;n&&(o=i),"escape-key"===r&&h.domReference.current&&io(h.domReference.current),"hover"===r&&"mouseleave"===i.type&&(A.current=!0),"outside-press"===r&&(s?(A.current=!1,e=!0):A.current=!(Tt(i)||Pt(i)))}return io(n),g.on("openchange",s),()=>{g.off("openchange",s);const r=St(t),a=kt(x,r)||T&&Ir(T.nodesRef.current,p).some((e=>{var t;return kt(null==(t=e.context)?void 0:t.elements.floating,r)}));(a||o&&["click","mousedown"].includes(o.type))&&h.domReference.current&&io(h.domReference.current);const l=i||n,c=wn(Mt(l).body,Ur());queueMicrotask((()=>{let n=so();!n&&ct(l)&&x&&(n=function(e,t,n){const r=e.indexOf(t);function o(t){const o=Ar("focus-guard");let i=r+(t?1:0),s=e[i];for(;s&&(!s.isConnected||s.hasAttribute(o)||kt(n,s));)t?i++:i--,s=e[i];return s}return o(!0)||o(!1)}(c,l,x)),C.current&&!A.current&&ct(n)&&(n===r||r===t.body||a)&&n.focus({preventScroll:e})}))}}),[r,x,j,C,v,h,g,T,p]),xr((()=>{if(!r&&P)return P.setFocusManagerState({modal:c,closeOnFocusOut:d,open:f,onOpenChange:m,refs:h}),()=>{P.setFocusManagerState(null)}}),[r,P,c,f,m,h,d]),xr((()=>{if(r)return;if(!j)return;if("function"!=typeof MutationObserver)return;if(w)return;const e=()=>{const e=j.getAttribute("tabindex"),t=L(),n=St(Mt(x)),r=t.indexOf(n);-1!==r&&(M.current=r),k.current.includes("floating")||n!==h.domReference.current&&0===t.length?"0"!==e&&j.setAttribute("tabindex","0"):"-1"!==e&&j.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(j,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}}),[r,x,j,h,k,L,w]);const z=!r&&S&&(!c||!_)&&(D||c);return re.createElement(re.Fragment,null,z&&re.createElement(Zr,{"data-type":"inside",ref:null==P?void 0:P.beforeInsideRef,onFocus:e=>{if(c){const e=F();br("reference"===o[0]?e[0]:e[e.length-1])}else if(null!=P&&P.preserveTabOrder&&P.portalNode)if(A.current=!1,qr(e,P.portalNode)){const e=$r()||b;null==e||e.focus()}else{var t;null==(t=P.beforeOutsideRef.current)||t.focus()}}}),!_&&V("start"),n,V("end"),z&&re.createElement(Zr,{"data-type":"inside",ref:null==P?void 0:P.afterInsideRef,onFocus:e=>{if(c)br(F()[0]);else if(null!=P&&P.preserveTabOrder&&P.portalNode)if(d&&(A.current=!0),qr(e,P.portalNode)){const e=Hr()||b;null==e||e.focus()}else{var t;null==(t=P.afterOutsideRef.current)||t.focus()}}}))}function co(e){return ct(e.target)&&"BUTTON"===e.target.tagName}function uo(e){return Lt(e)}function fo(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:i}}=e,{enabled:s=!0,event:a="click",toggle:l=!0,ignoreMouse:c=!1,keyboardHandlers:u=!0}=t,d=re.useRef(),f=re.useRef(!1),h=re.useMemo((()=>({onPointerDown(e){d.current=e.pointerType},onMouseDown(e){const t=d.current;0===e.button&&"click"!==a&&(Nt(t,!0)&&c||(!n||!l||o.current.openEvent&&"mousedown"!==o.current.openEvent.type?(e.preventDefault(),r(!0,e.nativeEvent,"click")):r(!1,e.nativeEvent,"click")))},onClick(e){const t=d.current;"mousedown"===a&&d.current?d.current=void 0:Nt(t,!0)&&c||(!n||!l||o.current.openEvent&&"click"!==o.current.openEvent.type?r(!0,e.nativeEvent,"click"):r(!1,e.nativeEvent,"click"))},onKeyDown(e){d.current=void 0,e.defaultPrevented||!u||co(e)||(" "!==e.key||uo(i)||(e.preventDefault(),f.current=!0),"Enter"===e.key&&r(!n||!l,e.nativeEvent,"click"))},onKeyUp(e){e.defaultPrevented||!u||co(e)||uo(i)||" "===e.key&&f.current&&(f.current=!1,r(!n||!l,e.nativeEvent,"click"))}})),[o,i,a,c,u,r,n,l]);return re.useMemo((()=>s?{reference:h}:{}),[s,h])}const ho={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},po={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},mo=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 go(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:i}=e,{enabled:s=!0,escapeKey:a=!0,outsidePress:l=!0,outsidePressEvent:c="pointerdown",referencePress:u=!1,referencePressEvent:d="pointerdown",ancestorScroll:f=!1,bubbles:h,capture:p}=t,m=Or(),g=ir("function"==typeof l?l:()=>!1),v="function"==typeof l?g:l,y=re.useRef(!1),b=re.useRef(!1),{escapeKey:x,outsidePress:w}=mo(h),{escapeKey:_,outsidePress:S}=mo(p),k=ir((e=>{var t;if(!n||!s||!a||"Escape"!==e.key)return;const o=null==(t=i.current.floatingContext)?void 0:t.nodeId,l=m?Ir(m.nodesRef.current,o):[];if(!x&&(e.stopPropagation(),l.length>0)){let e=!0;if(l.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")})),E=ir((e=>{var t;const n=()=>{var t;k(e),null==(t=It(e))||t.removeEventListener("keydown",n)};null==(t=It(e))||t.addEventListener("keydown",n)})),C=ir((e=>{var t;const n=y.current;y.current=!1;const s=b.current;if(b.current=!1,"click"===c&&s)return;if(n)return;if("function"==typeof v&&!v(e))return;const a=It(e),l="["+Ar("inert")+"]",u=Mt(o.floating).querySelectorAll(l);let d=lt(a)?a:null;for(;d&&!gt(d);){const e=bt(d);if(gt(e)||!lt(e))break;d=e}if(u.length&<(a)&&!a.matches("html,body")&&!kt(a,o.floating)&&Array.from(u).every((e=>!kt(d,e))))return;if(ct(a)&&R){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"===vt(a).direction&&(r=e.offsetX<=a.offsetWidth-a.clientWidth),r||t&&e.offsetY>a.clientHeight)return}const f=null==(t=i.current.floatingContext)?void 0:t.nodeId,h=m&&Ir(m.nodesRef.current,f).some((t=>{var n;return Dt(e,null==(n=t.context)?void 0:n.elements.floating)}));if(Dt(e,o.floating)||Dt(e,o.domReference)||h)return;const p=m?Ir(m.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")})),T=ir((e=>{var t;const n=()=>{var t;C(e),null==(t=It(e))||t.removeEventListener(c,n)};null==(t=It(e))||t.addEventListener(c,n)}));re.useEffect((()=>{if(!n||!s)return;function e(e){r(!1,e,"ancestor-scroll")}i.current.__escapeKeyBubbles=x,i.current.__outsidePressBubbles=w;const t=Mt(o.floating);a&&t.addEventListener("keydown",_?E:k,_),v&&t.addEventListener(c,S?T:C,S);let l=[];return f&&(lt(o.domReference)&&(l=wt(o.domReference)),lt(o.floating)&&(l=l.concat(wt(o.floating))),!lt(o.reference)&&o.reference&&o.reference.contextElement&&(l=l.concat(wt(o.reference.contextElement)))),l=l.filter((e=>{var n;return e!==(null==(n=t.defaultView)?void 0:n.visualViewport)})),l.forEach((t=>{t.addEventListener("scroll",e,{passive:!0})})),()=>{a&&t.removeEventListener("keydown",_?E:k,_),v&&t.removeEventListener(c,S?T:C,S),l.forEach((t=>{t.removeEventListener("scroll",e)}))}}),[i,o,a,v,c,n,r,f,s,x,w,k,_,E,C,S,T]),re.useEffect((()=>{y.current=!1}),[v,c]);const P=re.useMemo((()=>({onKeyDown:k,[ho[d]]:e=>{u&&r(!1,e.nativeEvent,"reference-press")}})),[k,r,u,d]),R=re.useMemo((()=>({onKeyDown:k,onMouseDown(){b.current=!0},onMouseUp(){b.current=!0},[po[c]]:()=>{y.current=!0}})),[k,c]);return re.useMemo((()=>s?{reference:P,floating:R}:{}),[s,P,R])}function vo(e){void 0===e&&(e={});const{nodeId:t}=e,n=function(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=Er(),i=re.useRef({}),[s]=re.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)))||[])}}}())),a=null!=Rr(),[l,c]=re.useState(r.reference),u=ir(((e,t,r)=>{i.current.openEvent=e?t:void 0,s.emit("openchange",{open:e,event:t,reason:r,nested:a}),null==n||n(e,t,r)})),d=re.useMemo((()=>({setPositionReference:c})),[]),f=re.useMemo((()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference})),[l,r.reference,r.floating]);return re.useMemo((()=>({dataRef:i,open:t,onOpenChange:u,elements:f,events:s,floatingId:o,refs:d})),[t,u,f,s,o,d])}({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,s]=re.useState(null),[a,l]=re.useState(null),c=(null==o?void 0:o.reference)||i,u=re.useRef(null),d=Or();xr((()=>{c&&(u.current=c)}),[c]);const f=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,d]=re.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,h]=re.useState(r);Xn(f,r)||h(r);const[p,m]=re.useState(null),[g,v]=re.useState(null),y=re.useCallback((e=>{e!==_.current&&(_.current=e,m(e))}),[]),b=re.useCallback((e=>{e!==S.current&&(S.current=e,v(e))}),[]),x=i||p,w=s||g,_=re.useRef(null),S=re.useRef(null),k=re.useRef(u),E=null!=l,C=Zn(l),T=Zn(o),P=re.useCallback((()=>{if(!_.current||!S.current)return;const e={placement:t,strategy:n,middleware:f};T.current&&(e.platform=T.current),qn(_.current,S.current,e).then((e=>{const t={...e,isPositioned:!0};R.current&&!Xn(k.current,t)&&(k.current=t,kn.flushSync((()=>{d(t)})))}))}),[f,t,n,T]);Yn((()=>{!1===c&&k.current.isPositioned&&(k.current.isPositioned=!1,d((e=>({...e,isPositioned:!1}))))}),[c]);const R=re.useRef(!1);Yn((()=>(R.current=!0,()=>{R.current=!1})),[]),Yn((()=>{if(x&&(_.current=x),w&&(S.current=w),x&&w){if(C.current)return C.current(x,w,P);P()}}),[x,w,P,C,E]);const O=re.useMemo((()=>({reference:_,floating:S,setReference:y,setFloating:b})),[y,b]),A=re.useMemo((()=>({reference:x,floating:w})),[x,w]),N=re.useMemo((()=>{const e={position:n,left:0,top:0};if(!A.floating)return e;const t=Jn(A.floating,u.x),r=Jn(A.floating,u.y);return a?{...e,transform:"translate("+t+"px, "+r+"px)",...Gn(A.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,a,A.floating,u.x,u.y]);return re.useMemo((()=>({...u,update:P,refs:O,elements:A,floatingStyles:N})),[u,P,O,A,N])}({...e,elements:{...o,...a&&{reference:a}}}),h=re.useCallback((e=>{const t=lt(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;l(t),f.refs.setReference(t)}),[f.refs]),p=re.useCallback((e=>{(lt(e)||null===e)&&(u.current=e,s(e)),(lt(f.refs.reference.current)||null===f.refs.reference.current||null!==e&&!lt(e))&&f.refs.setReference(e)}),[f.refs]),m=re.useMemo((()=>({...f.refs,setReference:p,setPositionReference:h,domReference:u})),[f.refs,p,h]),g=re.useMemo((()=>({...f.elements,domReference:c})),[f.elements,c]),v=re.useMemo((()=>({...f,...r,refs:m,elements:g,nodeId:t})),[f,m,g,t,r]);return xr((()=>{r.dataRef.current.floatingContext=v;const e=null==d?void 0:d.nodesRef.current.find((e=>e.id===t));e&&(e.context=v)})),re.useMemo((()=>({...f,context:v,refs:m,elements:g})),[f,m,g,v])}const yo="active",bo="selected";function xo(e,t,n){const r=new Map,o="item"===n;let i=e;if(o&&e){const{[yo]:t,[bo]:__,...n}=e;i=n}return{..."floating"===n&&{tabIndex:-1},...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&&[yo,bo].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 wo(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)),o=re.useCallback((t=>xo(t,e,"reference")),t),i=re.useCallback((t=>xo(t,e,"floating")),n),s=re.useCallback((t=>xo(t,e,"item")),r);return re.useMemo((()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:s})),[o,i,s])}let _o=!1;function So(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function ko(e,t){return So(t,e===sr||e===ar,e===lr||e===cr)}function Eo(e,t,n){return So(t,e===ar,n?e===lr:e===cr)||"Enter"===e||" "===e||""===e}function Co(e,t,n){return So(t,n?e===cr:e===lr,e===sr)}function To(e,t){const{open:n,onOpenChange:r,elements:o}=e,{listRef:i,activeIndex:s,onNavigate:a=()=>{},enabled:l=!0,selectedIndex:c=null,allowEscape:u=!1,loop:d=!1,nested:f=!1,rtl:h=!1,virtual:p=!1,focusItemOnOpen:m="auto",focusItemOnHover:g=!0,openOnArrowKeyDown:v=!0,disabledIndices:y,orientation:b="vertical",cols:x=1,scrollItemIntoView:w=!0,virtualItemRef:_,itemSizes:S,dense:k=!1}=t,E=Rr(),C=Or(),T=ir(a),P=re.useRef(m),R=re.useRef(null!=c?c:-1),O=re.useRef(null),A=re.useRef(!0),N=re.useRef(T),M=re.useRef(!!o.floating),D=re.useRef(n),I=re.useRef(!1),j=re.useRef(!1),L=Nr(y),F=Nr(n),V=Nr(w),z=Nr(o.floating),B=Nr(c),[W,U]=re.useState(),[K,$]=re.useState(),H=ir((function(e,t,n){function r(e){p?(U(e.id),null==C||C.events.emit("virtualfocus",e),_&&(_.current=e)):br(e,{preventScroll:!0,sync:!(!At()||!Rt())&&(_o||I.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&&Y&&(n||!A.current)&&(null==i.scrollIntoView||i.scrollIntoView("boolean"==typeof s?{block:"nearest",inline:"nearest"}:s))}))}));xr((()=>{document.createElement("div").focus({get preventScroll(){return _o=!0,!1}})}),[]),xr((()=>{l&&(n&&o.floating?P.current&&null!=c&&(j.current=!0,R.current=c,T(c)):M.current&&(R.current=-1,N.current(null)))}),[l,n,o.floating,c,T]),xr((()=>{if(l&&n&&o.floating)if(null==s){if(I.current=!1,null!=B.current)return;if(M.current&&(R.current=-1,H(i,R)),(!D.current||!M.current)&&P.current&&(null!=O.current||!0===P.current&&null==O.current)){let e=0;const t=()=>{null==i.current[0]?(e<2&&(e?requestAnimationFrame:queueMicrotask)(t),e++):(R.current=null==O.current||Eo(O.current,b,h)||f?fr(i,L.current):hr(i,L.current),O.current=null,T(R.current))};t()}}else dr(i,s)||(R.current=s,H(i,R,j.current),j.current=!1)}),[l,n,o.floating,s,B,f,i,b,h,T,H,L]),xr((()=>{var e;if(!l||o.floating||!C||p||!M.current)return;const t=C.nodesRef.current,n=null==(e=t.find((e=>e.id===E)))||null==(e=e.context)?void 0:e.elements.floating,r=St(Mt(o.floating)),i=t.some((e=>e.context&&kt(e.context.elements.floating,r)));n&&!i&&A.current&&n.focus({preventScroll:!0})}),[l,o.floating,C,E,p]),xr((()=>{if(l&&C&&p&&!E)return C.events.on("virtualfocus",e),()=>{C.events.off("virtualfocus",e)};function e(e){$(e.id),_&&(_.current=e)}}),[l,C,p,E,_]),xr((()=>{N.current=T,M.current=!!o.floating})),xr((()=>{n||(O.current=null)}),[n]),xr((()=>{D.current=n}),[n]);const q=null!=s,Y=re.useMemo((()=>{function e(e){if(!n)return;const t=i.current.indexOf(e);-1!==t&&T(t)}return{onFocus(t){let{currentTarget:n}=t;e(n)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},...g&&{onMouseMove(t){let{currentTarget:n}=t;e(n)},onPointerLeave(e){let{pointerType:t}=e;A.current&&"touch"!==t&&(R.current=-1,H(i,R),T(null),p||br(z.current,{preventScroll:!0}))}}}}),[n,z,H,g,i,T,p]),X=ir((e=>{if(A.current=!1,I.current=!0,!F.current&&e.currentTarget===z.current)return;if(f&&Co(e.key,b,h))return Ft(e),r(!1,e.nativeEvent,"list-navigation"),void(ct(o.domReference)&&!p&&o.domReference.focus());const t=R.current,s=fr(i,y),a=hr(i,y);if("Home"===e.key&&(Ft(e),R.current=s,T(R.current)),"End"===e.key&&(Ft(e),R.current=a,T(R.current)),x>1){const t=S||Array.from({length:i.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,x,k),r=n.findIndex((e=>null!=e&&!vr(i.current,e,y))),o=n.reduce(((e,t,n)=>null==t||vr(i.current,t,y)?e:n),-1);if(R.current=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===sr){if(u&&Ft(n),-1===c)d=l;else if(d=pr(e,{startingIndex:d,amount:i,decrement:!0,disabledIndices:s}),o&&(c-ie?n:n-i}dr(e,d)&&(d=c)}if(n.key===ar&&(u&&Ft(n),-1===c?d=a:(d=pr(e,{startingIndex:c,amount:i,disabledIndices:s}),o&&c+i>l&&(d=pr(e,{startingIndex:c%i-i,amount:i,disabledIndices:s}))),dr(e,d)&&(d=c)),"both"===r){const t=Ut(c/i);n.key===cr&&(u&&Ft(n),c%i!=i-1?(d=pr(e,{startingIndex:c,disabledIndices:s}),o&&ur(d,i,t)&&(d=pr(e,{startingIndex:c-c%i-1,disabledIndices:s}))):o&&(d=pr(e,{startingIndex:c-c%i-1,disabledIndices:s})),ur(d,i,t)&&(d=c)),n.key===lr&&(u&&Ft(n),c%i!=0?(d=pr(e,{startingIndex:c,decrement:!0,disabledIndices:s}),o&&ur(d,i,t)&&(d=pr(e,{startingIndex:c+(i-c%i),decrement:!0,disabledIndices:s}))):o&&(d=pr(e,{startingIndex:c+(i-c%i),decrement:!0,disabledIndices:s})),ur(d,i,t)&&(d=c));const r=Ut(l/i)===t;dr(e,d)&&(d=o&&r?n.key===lr?l:pr(e,{startingIndex:c-c%i-1,disabledIndices:s}):c)}return d}({current:n.map((e=>null!=e?i.current[e]:null))},{event:e,orientation:b,loop:d,cols:x,disabledIndices:gr([...y||i.current.map(((e,t)=>vr(i.current,t)?t:void 0)),void 0],n),minIndex:r,maxIndex:o,prevIndex:mr(R.current>a?s:R.current,t,n,x,e.key===ar?"bl":e.key===cr?"tr":"tl"),stopEvent:!0})],T(R.current),"both"===b)return}if(ko(e.key,b)){if(Ft(e),n&&!p&&St(e.currentTarget.ownerDocument)===e.currentTarget)return R.current=Eo(e.key,b,h)?s:a,void T(R.current);Eo(e.key,b,h)?R.current=d?t>=a?u&&t!==i.current.length?-1:s:pr(i,{startingIndex:t,disabledIndices:y}):Math.min(a,pr(i,{startingIndex:t,disabledIndices:y})):R.current=d?t<=s?u&&-1!==t?i.current.length:a:pr(i,{startingIndex:t,decrement:!0,disabledIndices:y}):Math.max(s,pr(i,{startingIndex:t,decrement:!0,disabledIndices:y})),dr(i,R.current)?T(null):T(R.current)}})),G=re.useMemo((()=>p&&n&&q&&{"aria-activedescendant":K||W}),[p,n,q,K,W]),J=re.useMemo((()=>({"aria-orientation":"both"===b?void 0:b,...!Vt(o.domReference)&&G,onKeyDown:X,onPointerMove(){A.current=!0}})),[G,X,o.domReference,b]),Z=re.useMemo((()=>{function e(e){"auto"===m&&Tt(e.nativeEvent)&&(P.current=!0)}return{...G,onKeyDown(e){A.current=!1;const t=0===e.key.indexOf("Arrow"),o=function(e,t,n){return So(t,n?e===lr:e===cr,e===ar)}(e.key,b,h),s=Co(e.key,b,h),a=ko(e.key,b),l=(f?o:a)||"Enter"===e.key||""===e.key.trim();if(p&&n){const n=null==C?void 0:C.nodesRef.current.find((e=>null==e.parentId)),r=C&&n?function(e,t){let n,r=-1;return function t(o,i){i>r&&(n=o,r=i),Ir(e,o).forEach((e=>{t(e.id,i+1)}))}(t,0),e.find((e=>e.id===n))}(C.nodesRef.current,n.id):null;if(t&&r&&_){const t=new KeyboardEvent("keydown",{key:e.key,bubbles:!0});if(o||s){var u,d;const n=(null==(u=r.context)?void 0:u.elements.domReference)===e.currentTarget,a=s&&!n?null==(d=r.context)?void 0:d.elements.domReference:o?i.current.find((e=>(null==e?void 0:e.id)===W)):null;a&&(Ft(e),a.dispatchEvent(t),$(void 0))}var m;if(a&&r.context&&r.context.open&&r.parentId&&e.currentTarget!==r.context.elements.domReference)return Ft(e),void(null==(m=r.context.elements.domReference)||m.dispatchEvent(t))}return X(e)}(n||v||!t)&&(l&&(O.current=f&&a?null:e.key),f?o&&(Ft(e),n?(R.current=fr(i,L.current),T(R.current)):r(!0,e.nativeEvent,"list-navigation")):a&&(null!=c&&(R.current=c),Ft(e),!n&&v?r(!0,e.nativeEvent,"list-navigation"):X(e),n&&T(R.current)))},onFocus(){n&&!p&&T(null)},onPointerDown:function(e){P.current=m,"auto"===m&&Pt(e.nativeEvent)&&(P.current=!0)},onMouseDown:e,onClick:e}}),[W,G,X,L,m,i,f,T,r,n,v,b,h,c,C,p,_]);return re.useMemo((()=>l?{reference:Z,floating:J,item:Y}:{}),[l,Z,J,Y])}const Po=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Ro(e,t){var n;void 0===t&&(t={});const{open:r,floatingId:o}=e,{enabled:i=!0,role:s="dialog"}=t,a=null!=(n=Po.get(s))?n:s,l=Er(),c=null!=Rr(),u=re.useMemo((()=>"tooltip"===a||"label"===s?{["aria-"+("label"===s?"labelledby":"describedby")]:r?o:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":"alertdialog"===a?"dialog":a,"aria-controls":r?o:void 0,..."listbox"===a&&{role:"combobox"},..."menu"===a&&{id:l},..."menu"===a&&c&&{role:"menuitem"},..."select"===s&&{"aria-autocomplete":"none"},..."combobox"===s&&{"aria-autocomplete":"list"}}),[a,o,c,r,l,s]),d=re.useMemo((()=>{const e={id:o,...a&&{role:a}};return"tooltip"===a||"label"===s?e:{...e,..."menu"===a&&{"aria-labelledby":l}}}),[a,o,l,s]),f=re.useCallback((e=>{let{active:t,selected:n}=e;const r={role:"option",...t&&{id:o+"-option"}};switch(s){case"select":return{...r,"aria-selected":t&&n};case"combobox":return{...r,...t&&{"aria-selected":!0}}}return{}}),[o,s]);return re.useMemo((()=>i?{reference:u,floating:d,item:f}:{}),[i,u,d,f])}const Oo=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function Ao(e,t){return"function"==typeof e?e(t):e}function No(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 Mo(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=It(e),x="mouseleave"===e.type,w=kt(d.floating,b),_=kt(d.domReference,b),S=d.domReference.getBoundingClientRect(),k=d.floating.getBoundingClientRect(),E=u.split("-")[0],C=n>k.right-k.width/2,T=c>k.bottom-k.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,S),R=k.width>S.width,O=k.height>S.height,A=(R?S:k).left,N=(R?S:k).right,M=(O?S:k).top,D=(O?S:k).bottom;if(w&&(i=!0,!x))return;if(_&&(i=!1),_&&!x)return void(i=!0);if(x&<(e.relatedTarget)&&kt(d.floating,e.relatedTarget))return;if(p&&Ir(p.nodesRef.current,h).some((e=>{let{context:t}=e;return null==t?void 0:t.open})))return;if("top"===E&&c>=S.bottom-1||"bottom"===E&&c<=S.top+1||"left"===E&&n>=S.right-1||"right"===E&&n<=S.left+1)return m();let I=[];switch(E){case"top":I=[[A,S.top+1],[A,k.bottom-1],[N,k.bottom-1],[N,S.top+1]];break;case"bottom":I=[[A,k.top+1],[A,S.bottom-1],[N,S.bottom-1],[N,k.top+1]];break;case"left":I=[[k.right-1,D],[k.right-1,M],[S.left+1,M],[S.left+1,D]];break;case"right":I=[[S.right-1,D],[S.right-1,M],[k.left+1,M],[k.left+1,D]]}if(!No([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()}No([g,v],function(e){let[n,r]=e;switch(E){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],[k.left,C||R?k.bottom-t:k.top],[k.right,C?R?k.bottom-t:k.top:k.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],[k.left,C||R?k.top+t:k.bottom],[k.right,C?R?k.top+t:k.bottom:k.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?k.right-t:k.left,k.top],[T?O?k.right-t:k.left:k.right-t,k.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?k.left+t:k.right,k.top],[T?O?k.left+t:k.right:k.left+t,k.bottom]]}}([n,c]))?!i&&r&&(o=window.setTimeout(m,40)):m()}}};return c.__options={blockPointerEvents:n},c}const Do=me("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"}]]),Io=me("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 jo="light",Lo=function(e){var t=e.icon,n=void 0===t?null:t,r=e.theme,o=void 0===r?jo:r,i=e.variant,s=void 0===i?"neutral":i,a="[&>svg]:h-5 [&>svg]:w-5",l="light"===o?"text-icon-secondary":"text-icon-inverse";if(n&&(0,re.isValidElement)(n))return{updatedIcon:(0,re.cloneElement)(n,{className:Q(a,l,n.props.className)})};switch(s){case"neutral":return React.createElement(De,{className:Q(a,l)});case"info":var c="light"===o?"text-support-info":"text-support-info-inverse";return React.createElement(De,{className:Q(a,c)});case"success":var u="light"===o?"text-support-success":"text-support-success-inverse";return React.createElement(ve,{className:Q(a,u)});case"warning":var d="light"===o?"text-support-warning":"text-support-warning-inverse";return React.createElement(Do,{className:Q(a,d)});case"error":var f="light"===o?"text-support-error":"text-support-error-inverse";return React.createElement(Io,{className:Q(a,f)});default:return null}},Fo=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?jo: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(ne,{variant:"outline",size:"xs",onClick:o,className:Q("rounded",c,u,"dark"===l?"bg-transparent hover:bg-transparent":"bg-white hover:bg-white")},s);case"link":return React.createElement(ne,{variant:"link",size:"xs",onClick:o,className:Q(c,u)},s);default:return null}},Vo=function(e){var t=e.theme,n=void 0===t?jo:t,r=e.title,o=void 0===r?"":r;return!o&&isNaN(o)?null:React.createElement("span",{className:Q("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?jo:t,r=e.content,o=void 0===r?"":r;return!o&&isNaN(o)?null:React.createElement("span",{className:Q({light:"text-text-primary",dark:"text-text-inverse"}[n],"block text-sm [&_*]:text-sm leading-5 [&_*]:leading-5 font-normal")},o)},Bo=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{})),E=re.useCallback((()=>{var e;const t=null==(e=o.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}),[o]);re.useEffect((()=>{if(a)return i.on("openchange",e),()=>{i.off("openchange",e)};function e(e){let{open:t}=e;t||(clearTimeout(b.current),clearTimeout(w.current),_.current=!0)}}),[a,i]),re.useEffect((()=>{if(!a)return;if(!m.current)return;if(!n)return;function e(e){E()&&r(!1,e,"hover")}const t=Mt(s.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[s.floating,n,r,a,m,E]);const C=re.useCallback((function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const o=Dr(g.current,"close",y.current);o&&!x.current?(clearTimeout(b.current),b.current=window.setTimeout((()=>r(!1,e,n)),o)):t&&(clearTimeout(b.current),r(!1,e,n))}),[g,r]),T=ir((()=>{k.current(),x.current=void 0})),P=ir((()=>{if(S.current){const e=Mt(s.floating).body;e.style.pointerEvents="",e.removeAttribute(Mr),S.current=!1}}));re.useEffect((()=>{if(a&<(s.domReference)){var e;const t=s.domReference;return n&&t.addEventListener("mouseleave",c),null==(e=s.floating)||e.addEventListener("mouseleave",c),f&&t.addEventListener("mousemove",i,{once:!0}),t.addEventListener("mouseenter",i),t.addEventListener("mouseleave",l),()=>{var e;n&&t.removeEventListener("mouseleave",c),null==(e=s.floating)||e.removeEventListener("mouseleave",c),f&&t.removeEventListener("mousemove",i),t.removeEventListener("mouseenter",i),t.removeEventListener("mouseleave",l)}}function t(){return!!o.current.openEvent&&["click","mousedown"].includes(o.current.openEvent.type)}function i(e){if(clearTimeout(b.current),_.current=!1,u&&!Nt(y.current)||d>0&&!Dr(g.current,"open"))return;const t=Dr(g.current,"open",y.current);t?b.current=window.setTimeout((()=>{v.current||r(!0,e,"hover")}),t):r(!0,e,"hover")}function l(e){if(t())return;k.current();const r=Mt(s.floating);if(clearTimeout(w.current),m.current&&o.current.floatingContext){n||clearTimeout(b.current),x.current=m.current({...o.current.floatingContext,tree:h,x:e.clientX,y:e.clientY,onClose(){P(),T(),C(e,!0,"safe-polygon")}});const t=x.current;return r.addEventListener("mousemove",t),void(k.current=()=>{r.removeEventListener("mousemove",t)})}("touch"!==y.current||!kt(s.floating,e.relatedTarget))&&C(e)}function c(e){t()||o.current.floatingContext&&(null==m.current||m.current({...o.current.floatingContext,tree:h,x:e.clientX,y:e.clientY,onClose(){P(),T(),C(e)}})(e))}}),[s,a,e,u,d,f,C,T,P,r,n,v,h,g,m,o]),xr((()=>{var e;if(a&&n&&null!=(e=m.current)&&e.__options.blockPointerEvents&&E()){const e=Mt(s.floating).body;e.setAttribute(Mr,""),e.style.pointerEvents="none",S.current=!0;const n=s.floating;if(lt(s.domReference)&&n){var t;const e=s.domReference,r=null==h||null==(t=h.nodesRef.current.find((e=>e.id===p)))||null==(t=t.context)?void 0:t.elements.floating;return r&&(r.style.pointerEvents=""),e.style.pointerEvents="auto",n.style.pointerEvents="auto",()=>{e.style.pointerEvents="",n.style.pointerEvents=""}}}}),[a,n,p,s,h,m,E]),xr((()=>{n||(y.current=void 0,T(),P())}),[n,T,P]),re.useEffect((()=>()=>{T(),clearTimeout(b.current),clearTimeout(w.current),P()}),[a,s.domReference,T,P]);const R=re.useMemo((()=>{function e(e){y.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function o(){_.current||v.current||r(!0,t,"hover")}u&&!Nt(y.current)||n||0===d||(clearTimeout(w.current),"touch"===y.current?o():w.current=window.setTimeout(o,d))}}}),[u,r,n,v,d]),O=re.useMemo((()=>({onMouseEnter(){clearTimeout(b.current)},onMouseLeave(e){C(e.nativeEvent,!1)}})),[C]);return re.useMemo((()=>a?{reference:R,floating:O}:{}),[a,R,O])}(z,$o({move:!1,enabled:!N&&R.includes("hover")},A&&{handleClose:Mo()})),U=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:i,elements:s}=e,{enabled:a=!0,visibleOnly:l=!0}=t,c=re.useRef(!1),u=re.useRef(),d=re.useRef(!0);re.useEffect((()=>{if(!a)return;const e=it(s.domReference);function t(){!n&&ct(s.domReference)&&s.domReference===St(Mt(s.domReference))&&(c.current=!0)}function r(){d.current=!0}return e.addEventListener("blur",t),e.addEventListener("keydown",r,!0),()=>{e.removeEventListener("blur",t),e.removeEventListener("keydown",r,!0)}}),[s.domReference,n,a]),re.useEffect((()=>{if(a)return o.on("openchange",e),()=>{o.off("openchange",e)};function e(e){let{reason:t}=e;"reference-press"!==t&&"escape-key"!==t||(c.current=!0)}}),[o,a]),re.useEffect((()=>()=>{clearTimeout(u.current)}),[]);const f=re.useMemo((()=>({onPointerDown(e){Pt(e.nativeEvent)||(d.current=!1)},onMouseLeave(){c.current=!1},onFocus(e){if(c.current)return;const t=It(e.nativeEvent);if(l&<(t))try{if(Rt()&&At())throw Error();if(!t.matches(":focus-visible"))return}catch(e){if(!d.current&&!Lt(t))return}r(!0,e.nativeEvent,"focus")},onBlur(e){c.current=!1;const t=e.relatedTarget,n=e.nativeEvent,o=lt(t)&&t.hasAttribute(Ar("focus-guard"))&&"outside"===t.getAttribute("data-type");u.current=window.setTimeout((()=>{var e;const a=St(s.domReference?s.domReference.ownerDocument:document);(t||a!==s.domReference)&&(kt(null==(e=i.current.floatingContext)?void 0:e.refs.floating.current,a)||kt(s.domReference,a)||o||r(!1,n,"focus"))}))}})),[i,s.domReference,r,l]);return re.useMemo((()=>a?{reference:f}:{}),[a,f])}(z,{enabled:!N&&R.includes("focus")}),K=wo([B,W,U,go(z),Ro(z,{role:"tooltip"})]),$=K.getReferenceProps,H=K.getFloatingProps,q=function(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:r,close:o,common:i,duration:s=250}=t,a=e.placement,l=a.split("-")[0],c=re.useMemo((()=>({side:l,placement:a})),[l,a]),u="number"==typeof s,d=(u?s:s.open)||0,f=(u?s:s.close)||0,[h,p]=re.useState((()=>({...Ao(i,c),...Ao(n,c)}))),{isMounted:m,status:g}=function(e,t){void 0===t&&(t={});const{open:n,elements:{floating:r}}=e,{duration:o=250}=t,i=("number"==typeof o?o:o.close)||0,[s,a]=re.useState("unmounted"),l=function(e,t){const[n,r]=re.useState(e);return e&&!n&&r(!0),re.useEffect((()=>{if(!e&&n){const e=setTimeout((()=>r(!1)),t);return()=>clearTimeout(e)}}),[e,n,t]),n}(n,i);return l||"close"!==s||a("unmounted"),xr((()=>{if(r){if(n){a("initial");const e=requestAnimationFrame((()=>{a("open")}));return()=>{cancelAnimationFrame(e)}}a("close")}}),[n,r]),{isMounted:l,status:s}}(e,{duration:s}),v=Nr(n),y=Nr(r),b=Nr(o),x=Nr(i);return xr((()=>{const e=Ao(v.current,c),t=Ao(b.current,c),n=Ao(x.current,c),r=Ao(y.current,c)||Object.keys(e).reduce(((e,t)=>(e[t]="",e)),{});if("initial"===g&&p((t=>({transitionProperty:t.transitionProperty,...n,...e}))),"open"===g&&p({transitionProperty:Object.keys(r).map(Oo).join(","),transitionDuration:d+"ms",...n,...r}),"close"===g){const r=t||e;p({transitionProperty:Object.keys(r).map(Oo).join(","),transitionDuration:f+"ms",...n,...r})}}),[f,b,v,y,x,d,g,c]),{isMounted:m,styles:h}}(z,{duration:150,initial:{opacity:0},open:{opacity:1},close:{opacity:0}}),Y=q.isMounted,X=q.styles,G=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[s],J="dark"===s?"text-tooltip-background-dark":"text-tooltip-background-light";return oe().createElement(oe().Fragment,null,(0,re.isValidElement)(g)&&(0,re.cloneElement)(g,$o($o({},g.props),{},{ref:Bo(g.ref,F.setReference),className:Q(g.props.className)},$())),oe().createElement(to,{id:w,root:b},Y&&oe().createElement("div",Uo({className:Q("absolute z-20 py-2 px-3 rounded-md text-xs leading-4 shadow-soft-shadow-lg",G,"max-w-80 w-fit",v),ref:F.setFloating,style:$o($o({},V),X)},H()),oe().createElement("div",null,!!u&&oe().createElement("span",{className:"font-semibold"},u),!!d&&oe().createElement("div",{className:"font-normal"},d)),h&&oe().createElement(Cr,{ref:j,context:z,placement:l,className:Q("fill-current",J)}))))},Xo=["slug","text","icon","className","disabled","isFirstChild","isLastChild"];function Go(){return Go=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"}[p],"border-0 border-r border-border-subtle border-solid",f===r?"bg-button-disabled":"",c?"rounded-tl rounded-bl border-0 border-r border-border-subtle":"",u?"rounded-tr rounded-br border-0":"",s);return oe().createElement("button",Go({ref:t,className:g,disabled:l,onClick:function(e){h(e,{slug:r,text:o})}},d),"left"===m&&i&&oe().createElement("span",{className:"mr-1"},i),o,"right"===m&&i&&oe().createElement("span",{className:"ml-1"},i))},Qo={Group:function(e){var t=e.children,n=e.activeItem,r=void 0===n?null:n,o=e.onChange,i=e.className,s=e.size,a=void 0===s?"md":s,l=e.iconPosition,c=void 0===l?"left":l,u=(0,re.useCallback)((function(e,t){o&&o({event:e,value:t})}),[o]),d=Q("box-border flex border border-border-subtle border-solid rounded",i);return oe().createElement("div",{className:d},oe().createElement(Jo.Provider,{value:{activeItem:r,onChange:u,size:a,iconPosition:c}},oe().Children.map(t,(function(e,n){if(!(0,re.isValidElement)(e))return null;var r=0===n,o=n===oe().Children.count(t)-1;return oe().cloneElement(e,{index:n,isFirstChild:r,isLastChild:o})}))))},Button:(0,re.forwardRef)(Zo)},ei=Qo,ti=n(848);const ni=(0,re.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),ri=(0,re.createContext)({}),oi=(0,re.createContext)(null),ii="undefined"!=typeof window,si=ii?re.useLayoutEffect:re.useEffect,ai=(0,re.createContext)({strict:!1}),li=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),ci="data-"+li("framerAppearId"),ui=["read","resolveKeyframes","update","preRender","render","postRender"];function di(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,s=ui.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:ui.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{d&&d.update(n,l)}));const h=n[ci],p=(0,re.useRef)(Boolean(h)&&!window.MotionHandoffIsComplete&&(null===(i=window.MotionHasOptimisedAnimation)||void 0===i?void 0:i.call(window,h)));return si((()=>{d&&(d.updateFeatures(),fi.render(d.render),p.current&&d.animationState&&d.animationState.animateChanges())})),(0,re.useEffect)((()=>{d&&(!p.current&&d.animationState&&d.animationState.animateChanges(),p.current=!1,gi||(gi=!0,queueMicrotask(yi)))})),d}function yi(){window.MotionHandoffIsComplete=!0}function bi(e){if(e)return!1!==e.options.allowProjection?e.projection:bi(e.parent)}function xi(e,t,n){return(0,re.useCallback)((r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&("function"==typeof n?n(r):pi(n)&&(n.current=r))}),[t])}function wi(e){return"string"==typeof e||Array.isArray(e)}function _i(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}const Si=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ki=["initial",...Si];function Ei(e){return _i(e.animate)||ki.some((t=>wi(e[t])))}function Ci(e){return Boolean(Ei(e)||e.variants)}function Ti(e){return Array.isArray(e)?e.join(" "):e}const Pi={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"]},Ri={};for(const e in Pi)Ri[e]={isEnabled:t=>Pi[e].some((e=>!!t[e]))};const Oi=(0,re.createContext)({}),Ai=Symbol.for("motionComponentSymbol");function Ni({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:o}){e&&function(e){for(const t in e)Ri[t]={...Ri[t],...e[t]}}(e);const i=(0,re.forwardRef)((function(e,i){let s;const a={...(0,re.useContext)(ni),...e,layoutId:Mi(e)},{isStatic:l}=a,c=function(e){const{initial:t,animate:n}=function(e,t){if(Ei(e)){const{initial:t,animate:n}=e;return{initial:!1===t||wi(t)?t:void 0,animate:wi(n)?n:void 0}}return!1!==e.inherit?t:{}}(e,(0,re.useContext)(ri));return(0,re.useMemo)((()=>({initial:t,animate:n})),[Ti(t),Ti(n)])}(e),u=r(e,l);if(!l&&ii){(0,re.useContext)(ai).strict;const e=function(e){const{drag:t,layout:n}=Ri;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}}(a);s=e.MeasureLayout,c.visualElement=vi(o,u,a,t,e.ProjectionNode)}return(0,ti.jsxs)(ri.Provider,{value:c,children:[s&&c.visualElement?(0,ti.jsx)(s,{visualElement:c.visualElement,...a}):null,n(o,e,xi(u,c.visualElement,i),u,l,c.visualElement)]})}));return i[Ai]=o,i}function Mi({layoutId:e}){const t=(0,re.useContext)(Oi).id;return t&&void 0!==e?t+"-"+e:e}function Di(e){function t(t,n={}){return Ni(e(t,n))}if("undefined"==typeof Proxy)return t;const n=new Map;return new Proxy(t,{get:(e,r)=>(n.has(r)||n.set(r,t(r)),n.get(r))})}const Ii=["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 ji(e){return"string"==typeof e&&!e.includes("-")&&!!(Ii.indexOf(e)>-1||/[A-Z]/u.test(e))}const Li={},Fi=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Vi=new Set(Fi);function zi(e,{layout:t,layoutId:n}){return Vi.has(e)||e.startsWith("origin")||(t||void 0!==n)&&(!!Li[e]||"opacity"===e)}const Bi=e=>Boolean(e&&e.getVelocity),Wi=(e,t)=>t&&"number"==typeof e?t.transform(e):e,Ui=(e,t,n)=>n>t?t:n"number"==typeof e,parse:parseFloat,transform:e=>e},$i={...Ki,transform:e=>Ui(0,1,e)},Hi={...Ki,default:1},qi=e=>Math.round(1e5*e)/1e5,Yi=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,Xi=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,Gi=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;function Ji(e){return"string"==typeof e}const Zi=e=>({test:t=>Ji(t)&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),Qi=Zi("deg"),es=Zi("%"),ts=Zi("px"),ns=Zi("vh"),rs=Zi("vw"),os={...es,parse:e=>es.parse(e)/100,transform:e=>es.transform(100*e)},is={...Ki,transform:Math.round},ss={borderWidth:ts,borderTopWidth:ts,borderRightWidth:ts,borderBottomWidth:ts,borderLeftWidth:ts,borderRadius:ts,radius:ts,borderTopLeftRadius:ts,borderTopRightRadius:ts,borderBottomRightRadius:ts,borderBottomLeftRadius:ts,width:ts,maxWidth:ts,height:ts,maxHeight:ts,size:ts,top:ts,right:ts,bottom:ts,left:ts,padding:ts,paddingTop:ts,paddingRight:ts,paddingBottom:ts,paddingLeft:ts,margin:ts,marginTop:ts,marginRight:ts,marginBottom:ts,marginLeft:ts,rotate:Qi,rotateX:Qi,rotateY:Qi,rotateZ:Qi,scale:Hi,scaleX:Hi,scaleY:Hi,scaleZ:Hi,skew:Qi,skewX:Qi,skewY:Qi,distance:ts,translateX:ts,translateY:ts,translateZ:ts,x:ts,y:ts,z:ts,perspective:ts,transformPerspective:ts,opacity:$i,originX:os,originY:os,originZ:ts,zIndex:is,backgroundPositionX:ts,backgroundPositionY:ts,fillOpacity:$i,strokeOpacity:$i,numOctaves:is},as={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ls=Fi.length,cs=e=>t=>"string"==typeof t&&t.startsWith(e),us=cs("--"),ds=cs("var(--"),fs=e=>!!ds(e)&&hs.test(e.split("/*")[0].trim()),hs=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function ps(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(Vi.has(e))s=!0;else if(us(e))o[e]=n;else{const t=Wi(n,ss[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({style:{},transform:{},transformOrigin:{},vars:{}});function gs(e,t,n){for(const r in t)Bi(t[r])||zi(r,n)||(e[r]=t[r])}function vs(e,t){const n={},r=function(e,t){const n={};return gs(n,e.style||{},e),Object.assign(n,function({transformTemplate:e},t){return(0,re.useMemo)((()=>{const n=ms();return ps(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 ys=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 bs(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||ys.has(e)}let xs=e=>!bs(e);try{(ws=n(316).A)&&(xs=e=>e.startsWith("on")?!bs(e):ws(e))}catch(e){}var ws;function _s(e,t,n){return"string"==typeof e?e:ts.transform(t+n*e)}const Ss={offset:"stroke-dashoffset",array:"stroke-dasharray"},ks={offset:"strokeDashoffset",array:"strokeDasharray"};function Es(e,{attrX:t,attrY:n,attrScale:r,originX:o,originY:i,pathLength:s,pathSpacing:a=1,pathOffset:l=0,...c},u,d){if(ps(e,c,d),u)return void(e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox));e.attrs=e.style,e.style={};const{attrs:f,style:h,dimensions:p}=e;f.transform&&(p&&(h.transform=f.transform),delete f.transform),p&&(void 0!==o||void 0!==i||h.transform)&&(h.transformOrigin=function(e,t,n){return`${_s(t,e.x,e.width)} ${_s(n,e.y,e.height)}`}(p,void 0!==o?o:.5,void 0!==i?i:.5)),void 0!==t&&(f.x=t),void 0!==n&&(f.y=n),void 0!==r&&(f.scale=r),void 0!==s&&function(e,t,n=1,r=0,o=!0){e.pathLength=1;const i=o?Ss:ks;e[i.offset]=ts.transform(-r);const s=ts.transform(t),a=ts.transform(n);e[i.array]=`${s} ${a}`}(f,s,a,l,!1)}const Cs=()=>({...ms(),attrs:{}}),Ts=e=>"string"==typeof e&&"svg"===e.toLowerCase();function Ps(e,t,n,r){const o=(0,re.useMemo)((()=>{const n=Cs();return Es(n,t,Ts(r),e.transformTemplate),{...n.attrs,style:{...n.style}}}),[t]);if(e.style){const t={};gs(t,e.style,e),o.style={...t,...o.style}}return o}function Rs(e=!1){return(t,n,r,{latestValues:o},i)=>{const s=(ji(t)?Ps:vs)(n,o,i,t),a=function(e,t,n){const r={};for(const o in e)"values"===o&&"object"==typeof e.values||(xs(o)||!0===n&&bs(o)||!t&&!bs(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}(n,"string"==typeof t,e),l=t!==re.Fragment?{...a,...s,ref:r}:{},{children:c}=n,u=(0,re.useMemo)((()=>Bi(c)?c.get():c),[c]);return(0,re.createElement)(t,{...l,children:u})}}function Os(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 As=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 Ns(e,t,n,r){Os(e,t,void 0,r);for(const n in t.attrs)e.setAttribute(As.has(n)?n:li(n),t.attrs[n])}function Ms(e,t,n){var r;const{style:o}=e,i={};for(const s in o)(Bi(o[s])||t.style&&Bi(t.style[s])||zi(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 Ds(e,t,n){const r=Ms(e,t,n);for(const n in e)(Bi(e[n])||Bi(t[n]))&&(r[-1!==Fi.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=e[n]);return r}function Is(e){const t=[{},{}];return null==e||e.values.forEach(((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()})),t}function js(e,t,n,r){if("function"==typeof t){const[o,i]=Is(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]=Is(r);t=t(void 0!==n?n:e.custom,o,i)}return t}function Ls(e){const t=(0,re.useRef)(null);return null===t.current&&(t.current=e()),t.current}const Fs=e=>Array.isArray(e),Vs=e=>Boolean(e&&"object"==typeof e&&e.mix&&e.toValue),zs=e=>Fs(e)?e[e.length-1]||0:e;function Bs(e){const t=Bi(e)?e.get():e;return Vs(t)?t.toValue():t}const Ws=new Set(["opacity","clipPath","filter","transform"]);function Us(e){return Vi.has(e)?"transform":Ws.has(e)?li(e):void 0}function Ks(e,t){-1===e.indexOf(t)&&e.push(t)}function $s(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Hs=e=>(t,n)=>{const r=(0,re.useContext)(ri),o=(0,re.useContext)(oi),i=()=>function({applyWillChange:e=!1,scrapeMotionValuesFromProps:t,createRenderState:n,onMount:r},o,i,s,a){const l={latestValues:Xs(o,i,s,!a&&e,t),renderState:n()};return r&&(l.mount=e=>r(o,e,l)),l}(e,t,r,o,n);return n?i():Ls(i)};function qs(e,t){const n=Us(t);n&&Ks(e,n)}function Ys(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&&!_i(d)&&Ys(e,d,(e=>{for(const t in e)qs(a,t)})),a.length&&(s.willChange=a.join(","))),s}const Gs=e=>e,{schedule:Js,cancel:Zs,state:Qs,steps:ea}=di("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:Gs,!0),ta={useVisualState:Hs({scrapeMotionValuesFromProps:Ds,createRenderState:Cs,onMount:(e,t,{renderState:n,latestValues:r})=>{Js.read((()=>{try{n.dimensions="function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch(e){n.dimensions={x:0,y:0,width:0,height:0}}})),Js.render((()=>{Es(n,r,Ts(t.tagName),e.transformTemplate),Ns(t,n)}))}})},na={useVisualState:Hs({applyWillChange:!0,scrapeMotionValuesFromProps:Ms,createRenderState:ms})};function ra(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const oa=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary;function ia(e,t="page"){return{point:{x:e[`${t}X`],y:e[`${t}Y`]}}}const sa=e=>t=>oa(t)&&e(t,ia(t));function aa(e,t,n,r){return ra(e,t,sa(n),r)}const la=(e,t)=>n=>t(e(n)),ca=(...e)=>e.reduce(la);function ua(e){let t=null;return()=>null===t&&(t=e,()=>{t=null})}const da=ua("dragHorizontal"),fa=ua("dragVertical");function ha(e){let t=!1;if("y"===e)t=fa();else if("x"===e)t=da();else{const e=da(),n=fa();e&&n?t=()=>{e(),n()}:(e&&e(),n&&n())}return t}function pa(){const e=ha(!0);return!e||(e(),!1)}class ma{constructor(e){this.isMounted=!1,this.node=e}update(){}}function ga(e,t){const n=t?"pointerenter":"pointerleave",r=t?"onHoverStart":"onHoverEnd";return aa(e.current,n,((n,o)=>{if("touch"===n.pointerType||pa())return;const i=e.getProps();e.animationState&&i.whileHover&&e.animationState.setActive("whileHover",t);const s=i[r];s&&Js.postRender((()=>s(n,o)))}),{passive:!e.getProps()[r]})}const va=(e,t)=>!!t&&(e===t||va(e,t.parentElement));function ya(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,ia(n))}const ba=new WeakMap,xa=new WeakMap,wa=e=>{const t=ba.get(e.target);t&&t(e)},_a=e=>{e.forEach(wa)};const Sa={some:0,all:1},ka={inView:{Feature:class extends ma{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:Sa[r]};return function(e,t,n){const r=function({root:e,...t}){const n=e||document;xa.has(n)||xa.set(n,{});const r=xa.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(_a,{root:e,...t})),r[o]}(t);return ba.set(e,n),r.observe(e),()=>{ba.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 ma{constructor(){super(...arguments),this.removeStartListeners=Gs,this.removeEndListeners=Gs,this.removeAccessibleListeners=Gs,this.startPointerPress=(e,t)=>{if(this.isPressing)return;this.removeEndListeners();const n=this.node.getProps(),r=aa(window,"pointerup",((e,t)=>{if(!this.checkPressEnd())return;const{onTap:n,onTapCancel:r,globalTapTarget:o}=this.node.getProps(),i=o||va(this.node.current,e.target)?n:r;i&&Js.update((()=>i(e,t)))}),{passive:!(n.onTap||n.onPointerUp)}),o=aa(window,"pointercancel",((e,t)=>this.cancelPress(e,t)),{passive:!(n.onTapCancel||n.onPointerCancel)});this.removeEndListeners=ca(r,o),this.startPress(e,t)},this.startAccessiblePress=()=>{const e=ra(this.node.current,"keydown",(e=>{"Enter"!==e.key||this.isPressing||(this.removeEndListeners(),this.removeEndListeners=ra(this.node.current,"keyup",(e=>{"Enter"===e.key&&this.checkPressEnd()&&ya("up",((e,t)=>{const{onTap:n}=this.node.getProps();n&&Js.postRender((()=>n(e,t)))}))})),ya("down",((e,t)=>{this.startPress(e,t)})))})),t=ra(this.node.current,"blur",(()=>{this.isPressing&&ya("cancel",((e,t)=>this.cancelPress(e,t)))}));this.removeAccessibleListeners=ca(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&&Js.postRender((()=>n(e,t)))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!pa()}cancelPress(e,t){if(!this.checkPressEnd())return;const{onTapCancel:n}=this.node.getProps();n&&Js.postRender((()=>n(e,t)))}mount(){const e=this.node.getProps(),t=aa(e.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),n=ra(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=ca(t,n)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}},focus:{Feature:class extends ma{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=ca(ra(this.node.current,"focus",(()=>this.onFocus())),ra(this.node.current,"blur",(()=>this.onBlur())))}unmount(){}}},hover:{Feature:class extends ma{mount(){this.unmount=ca(ga(this.node,!0),ga(this.node,!1))}unmount(){}}}};function Ea(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r1e3*e,Pa=e=>e/1e3,Ra={type:"spring",stiffness:500,damping:25,restSpeed:10},Oa={type:"keyframes",duration:.8},Aa={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Na=(e,{keyframes:t})=>t.length>2?Oa:Vi.has(e)?e.startsWith("scale")?{type:"spring",stiffness:550,damping:0===t[1]?2*Math.sqrt(550):30,restSpeed:10}:Ra:Aa;function Ma(e,t){return e[t]||e.default||e}const Da=e=>null!==e;function Ia(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(Da),i=t&&"loop"!==n&&t%2==1?0:o.length-1;return i&&void 0!==r?r:o[i]}const ja=e=>/^0[^.\s]+$/u.test(e);let La=Gs,Fa=Gs;const Va=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),za=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ba(e,t,n=1){Fa(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=za.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 Va(e)?parseFloat(e):e}return fs(o)?Ba(o,t,n+1):o}const Wa=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),Ua=e=>e===Ki||e===ts,Ka=(e,t)=>parseFloat(e.split(", ")[t]),$a=(e,t)=>(n,{transform:r})=>{if("none"===r||!r)return 0;const o=r.match(/^matrix3d\((.+)\)$/u);if(o)return Ka(o[1],t);{const t=r.match(/^matrix\((.+)\)$/u);return t?Ka(t[1],e):0}},Ha=new Set(["x","y","z"]),qa=Fi.filter((e=>!Ha.has(e))),Ya={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:$a(4,13),y:$a(5,14)};Ya.translateX=Ya.x,Ya.translateY=Ya.y;const Xa=e=>t=>t.test(e),Ga=[Ki,ts,es,Qi,rs,ns,{test:e=>"auto"===e,parse:e=>e}],Ja=e=>Ga.find(Xa(e)),Za=new Set;let Qa=!1,el=!1;function tl(){if(el){const e=Array.from(Za).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 qa.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)}))}el=!1,Qa=!1,Za.forEach((e=>e.complete())),Za.clear()}function nl(){Za.forEach((e=>{e.readKeyframes(),e.needsMeasurement&&(el=!0)}))}class rl{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?(Za.add(this),Qa||(Qa=!0,Js.read(nl),Js.resolveKeyframes(tl))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;for(let o=0;on=>Boolean(Ji(n)&&Gi.test(n)&&n.startsWith(e)||t&&!function(e){return null==e}(n)&&Object.prototype.hasOwnProperty.call(n,t)),il=(e,t,n)=>r=>{if(!Ji(r))return r;const[o,i,s,a]=r.match(Yi);return{[e]:parseFloat(o),[t]:parseFloat(i),[n]:parseFloat(s),alpha:void 0!==a?parseFloat(a):1}},sl={...Ki,transform:e=>Math.round((e=>Ui(0,255,e))(e))},al={test:ol("rgb","red"),parse:il("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+sl.transform(e)+", "+sl.transform(t)+", "+sl.transform(n)+", "+qi($i.transform(r))+")"},ll={test:ol("#"),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:al.transform},cl={test:ol("hsl","hue"),parse:il("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+es.transform(qi(t))+", "+es.transform(qi(n))+", "+qi($i.transform(r))+")"},ul={test:e=>al.test(e)||ll.test(e)||cl.test(e),parse:e=>al.test(e)?al.parse(e):cl.test(e)?cl.parse(e):ll.parse(e),transform:e=>Ji(e)?e:e.hasOwnProperty("red")?al.transform(e):cl.transform(e)},dl="number",fl="color",hl="var",pl="var(",ml="${}",gl=/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 vl(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let i=0;const s=t.replace(gl,(e=>(ul.test(e)?(r.color.push(i),o.push(fl),n.push(ul.parse(e))):e.startsWith(pl)?(r.var.push(i),o.push(hl),n.push(e)):(r.number.push(i),o.push(dl),n.push(parseFloat(e))),++i,ml))).split(ml);return{values:n,split:s,indexes:r,types:o}}function yl(e){return vl(e).values}function bl(e){const{split:t,types:n}=vl(e),r=t.length;return e=>{let o="";for(let i=0;i"number"==typeof e?0:e,wl={test:function(e){var t,n;return isNaN(e)&&Ji(e)&&((null===(t=e.match(Yi))||void 0===t?void 0:t.length)||0)+((null===(n=e.match(Xi))||void 0===n?void 0:n.length)||0)>0},parse:yl,createTransformer:bl,getAnimatableNone:function(e){const t=yl(e);return bl(e)(t.map(xl))}},_l=new Set(["brightness","contrast","saturate","opacity"]);function Sl(e){const[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[r]=n.match(Yi)||[];if(!r)return e;const o=n.replace(r,"");let i=_l.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+o+")"}const kl=/\b([a-z-]*)\(.*?\)/gu,El={...wl,getAnimatableNone:e=>{const t=e.match(kl);return t?t.map(Sl).join(" "):e}},Cl={...ss,color:ul,backgroundColor:ul,outlineColor:ul,fill:ul,stroke:ul,borderColor:ul,borderTopColor:ul,borderRightColor:ul,borderBottomColor:ul,borderLeftColor:ul,filter:El,WebkitFilter:El},Tl=e=>Cl[e];function Pl(e,t){let n=Tl(e);return n!==El&&(n=wl),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Rl=new Set(["auto","none","0"]);class Ol extends rl{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 Al(e){let t;return()=>(void 0===t&&(t=e()),t)}let Nl;function Ml(){Nl=void 0}const Dl={now:()=>(void 0===Nl&&Dl.set(Qs.isProcessing?Qs.timestamp:performance.now()),Nl),set:e=>{Nl=e,queueMicrotask(Ml)}},Il=(e,t)=>!("zIndex"===t||"number"!=typeof e&&!Array.isArray(e)&&("string"!=typeof e||!wl.test(e)&&"0"!==e||e.startsWith("url(")));class jl{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=Dl.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||(nl(),tl()),this._resolved}onKeyframesResolved(e,t){this.resolvedAt=Dl.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=Il(o,t),a=Il(i,t);return La(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 Ll(e,t){return t?e*(1e3/t):0}const Fl=5;function Vl(e,t,n){const r=Math.max(t-Fl,0);return Ll(n-e(r),t-r)}const zl=.001,Bl=.01,Wl=10,Ul=.05,Kl=1;const $l=12;function Hl(e,t){return e*Math.sqrt(1-t*t)}const ql=["duration","bounce"],Yl=["stiffness","damping","mass"];function Xl(e,t){return t.some((t=>void 0!==e[t]))}function Gl({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(!Xl(e,Yl)&&Xl(e,ql)){const n=function({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let o,i;La(e<=Ta(Wl),"Spring duration must be 10 seconds or less");let s=1-t;s=Ui(Ul,Kl,s),e=Ui(Bl,Wl,Pa(e)),s<1?(o=t=>{const r=t*s,o=r*e,i=r-n,a=Hl(t,s),l=Math.exp(-o);return zl-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=Hl(Math.pow(t,2),s);return(-o(t)+zl>0?-1:1)*((i-a)*l)/c}):(o=t=>Math.exp(-t*e)*((t-n)*e+1)-zl,i=t=>Math.exp(-t*e)*(e*e*(n-t)));const a=function(e,t,n){let r=n;for(let n=1;n<$l;n++)r-=e(r)/t(r);return r}(o,i,5/e);if(e=Ta(e),isNaN(a))return{stiffness:100,damping:10,duration:e};{const t=Math.pow(a,2)*r;return{stiffness:t,damping:2*s*Math.sqrt(r*t),duration:e}}}(e);t={...t,...n,mass:1},t.isResolvedFromDuration=!0}return t}({...r,velocity:-Pa(r.velocity||0)}),h=d||0,p=l/(2*Math.sqrt(a*c)),m=i-o,g=Pa(Math.sqrt(a/c)),v=Math.abs(m)<5;let y;if(n||(n=v?.01:2),t||(t=v?.005:.5),p<1){const e=Hl(g,p);y=t=>{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?Ta(h):Vl(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 Jl({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=>{var t;t=f.value,(void 0!==a&&tl)&&(x=e,w=Gl({keyframes:[f.value,h(f.value)],velocity:Vl(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 Zl=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function Ql(e,t,n,r){if(e===t&&n===r)return Gs;return o=>0===o||1===o?o:Zl(function(e,t,n,r,o){let i,s,a=0;do{s=t+(n-t)/2,i=Zl(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 ec=Ql(.42,0,1,1),tc=Ql(0,0,.58,1),nc=Ql(.42,0,.58,1),rc=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,oc=e=>t=>1-e(1-t),ic=e=>1-Math.sin(Math.acos(e)),sc=oc(ic),ac=rc(ic),lc=Ql(.33,1.53,.69,.99),cc=oc(lc),uc=rc(cc),dc={linear:Gs,easeIn:ec,easeInOut:nc,easeOut:tc,circIn:ic,circInOut:ac,circOut:sc,backIn:cc,backInOut:uc,backOut:lc,anticipate:e=>(e*=2)<1?.5*cc(e):.5*(2-Math.pow(2,-10*(e-1)))},fc=e=>{if(Array.isArray(e)){Fa(4===e.length,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,o]=e;return Ql(t,n,r,o)}return"string"==typeof e?(Fa(void 0!==dc[e],`Invalid easing type '${e}'`),dc[e]):e},hc=(e,t,n)=>{const r=t-e;return 0===r?1:(n-e)/r},pc=(e,t,n)=>e+(t-e)*n;function mc(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 gc(e,t){return n=>n>0?t:e}const vc=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},yc=[ll,al,cl];function bc(e){const t=(n=e,yc.find((e=>e.test(n))));var n;if(La(Boolean(t),`'${e}' is not an animatable color. Use the equivalent color code instead.`),!Boolean(t))return!1;let r=t.parse(e);return t===cl&&(r=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=mc(a,r,e+1/3),i=mc(a,r,e),s=mc(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}}(r)),r}const xc=(e,t)=>{const n=bc(e),r=bc(t);if(!n||!r)return gc(e,t);const o={...n};return e=>(o.red=vc(n.red,r.red,e),o.green=vc(n.green,r.green,e),o.blue=vc(n.blue,r.blue,e),o.alpha=pc(n.alpha,r.alpha,e),al.transform(o))},wc=new Set(["none","hidden"]);function _c(e,t){return n=>pc(e,t,n)}function Sc(e){return"number"==typeof e?_c:"string"==typeof e?fs(e)?gc:ul.test(e)?xc:Cc:Array.isArray(e)?kc:"object"==typeof e?ul.test(e)?xc:Ec:gc}function kc(e,t){const n=[...e],r=n.length,o=e.map(((e,n)=>Sc(e)(e,t[n])));return e=>{for(let t=0;t{for(const t in r)n[t]=r[t](e);return n}}const Cc=(e,t)=>{const n=wl.createTransformer(t),r=vl(e),o=vl(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?wc.has(e)&&!o.values.length||wc.has(t)&&!r.values.length?function(e,t){return wc.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}(e,t):ca(kc(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(fc):fc(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=hc(0,t,r);e.push(pc(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(Fa(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||Tc,i=e.length-1;for(let n=0;n{let n=0;if(a>1)for(;nl(Ui(e[0],e[i-1],t)):l}(s,t,{ease:Array.isArray(o)?o:(l=t,c=o,l.map((()=>c||nc)).splice(0,l.length-1))});var l,c;return{calculatedDuration:e,next:t=>(i.value=a(t),i.done=t>=e,i)}}const Rc=e=>{const t=({timestamp:t})=>e(t);return{start:()=>Js.update(t,!0),stop:()=>Zs(t),now:()=>Qs.isProcessing?Qs.timestamp:Dl.now()}},Oc={decay:Jl,inertia:Jl,tween:Pc,keyframes:Pc,spring:Gl},Ac=e=>e/100;class Nc extends jl{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)||rl;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=Oc[t]||Pc;let a,l;s!==Pc&&"number"!=typeof e[0]&&(a=ca(Ac,Tc(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=Ui(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=Ia(a,this.options,r)),m&&m(x.value),_&&this.finish(),x}get duration(){const{resolved:e}=this;return e?Pa(e.calculatedDuration):0}get time(){return Pa(this.currentTime)}set time(e){e=Ta(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=Pa(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:e=Rc,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 Mc=e=>Array.isArray(e)&&"number"==typeof e[0];function Dc(e){return Boolean(!e||"string"==typeof e&&e in jc||Mc(e)||Array.isArray(e)&&e.every(Dc))}const Ic=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,jc={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ic([0,.65,.55,1]),circOut:Ic([.55,0,1,.45]),backIn:Ic([.31,.01,.66,-.59]),backOut:Ic([.33,1.53,.69,.99])};function Lc(e){return Fc(e)||jc.easeOut}function Fc(e){return e?Mc(e)?Ic(e):Array.isArray(e)?e.map(Lc):jc[e]:void 0}const Vc=Al((()=>Object.hasOwnProperty.call(Element.prototype,"animate")));class zc extends jl{constructor(e){super(e);const{name:t,motionValue:n,element:r,keyframes:o}=this.options;this.resolver=new Ol(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||!Dc(u.ease)){const{onComplete:t,onUpdate:n,motionValue:a,element:l,...c}=this.options,u=function(e,t){const n=new Nc({...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=Fc(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(Ia(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 Pa(t)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:t}=e;return Pa(t.currentTime||0)}set time(e){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.currentTime=Ta(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 Gs;const{animation:n}=t;n.timeline=e,n.onfinish=null}else this.pendingTimeline=e;return Gs}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 Nc({...c,keyframes:n,duration:r,type:o,ease:i,times:s,isGenerator:!0}),d=Ta(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 Vc()&&n&&Ws.has(n)&&t&&t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate&&!r&&"mirror"!==o&&0!==i&&"inertia"!==s}}const Bc=Al((()=>void 0!==window.ScrollTimeline));class Wc{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(!Bc()||!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 Js.update(o,!0),()=>Zs(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 Uc=(e,t,n,r={},o,i,s)=>a=>{const l=Ma(r,e)||{},c=l.delay||r.delay||0;let{elapsed:u=0}=r;u-=Ta(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,...Na(e,d)}),d.duration&&(d.duration=Ta(d.duration)),d.repeatDelay&&(d.repeatDelay=Ta(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=Ia(d.keyframes,l);if(void 0!==e)return Js.update((()=>{d.onUpdate(e),d.onComplete()})),new Wc([])}return!i&&zc.supports(d)?new zc(d):new Nc(d)};class Kc{constructor(){this.subscriptions=[]}add(e){return Ks(this.subscriptions,e),()=>$s(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=Dl.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=Dl.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 Kc);const n=this.events[e].add(t);return"change"===e?()=>{n(),Js.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 $c.current&&$c.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=Dl.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return Ll(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 qc(e,t){return new Hc(e,t)}function Yc(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,qc(n))}function Xc(e){return e.getProps()[ci]}class Gc extends Hc{constructor(){super(...arguments),this.output=[],this.counts=new Map}add(e){const t=Us(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&&($s(this.output,t),this.update())}}update(){this.set(this.output.length?this.output.join(", "):"auto")}}function Jc(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 Gc("auto"),e.addValue("willChange",r)),o=r,Boolean(Bi(o)&&o.add)?r.add(t):void 0;var o}function Zc({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&!0!==t[n];return t[n]=!1,r}function Qc(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&&Zc(u,t))continue;const a={delay:n,...Ma(s||{},t)};let d=!1;if(window.MotionHandoffAnimation){const n=Xc(e);if(n){const e=window.MotionHandoffAnimation(n,t,Js);null!==e&&(a.startTime=e,d=!0)}}r.start(Uc(t,r,o,e.shouldReduceMotion&&Vi.has(t)?{type:!1}:a,e,d,Jc(e,t)));const f=r.animation;f&&c.push(f)}return a&&Promise.all(c).then((()=>{Js.update((()=>{a&&function(e,t){const n=Ca(e,t);let{transitionEnd:r={},transition:o={},...i}=n||{};i={...i,...r};for(const t in i)Yc(e,t,zs(i[t]))}(e,a)}))})),c}function eu(e,t,n={}){var r;const o=Ca(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(Qc(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(tu).forEach(((e,r)=>{e.notify("AnimationStart",t),s.push(eu(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 tu(e,t){return e.sortNodePosition(t)}const nu=[...Si].reverse(),ru=Si.length;function ou(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function iu(){return{animate:ou(!0),whileInView:ou(),whileHover:ou(),whileTap:ou(),whileDrag:ou(),whileFocus:ou(),exit:ou()}}let su=0;const au={animation:{Feature:class extends ma{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=>eu(e,t,n)));r=Promise.all(o)}else if("string"==typeof t)r=eu(e,t,n);else{const o="function"==typeof t?Ca(e,t,n.custom):t;r=Promise.all(Qc(e,o,n))}return r.then((()=>{e.notify("AnimationComplete",t)}))}(e,t,n))))}(e),n=iu(),r=!0;const o=t=>(n,r)=>{var o;const i=Ca(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 S=_.reduce(o(p),{});!1===y&&(S={});const{prevResolvedValues:k={}}=m,E={...k,...S},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 E){const t=S[e],n=k[e];if(u.hasOwnProperty(e))continue;let r=!1;r=Fs(t)&&Fs(n)?!Ea(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=S,m.isActive&&(u={...u,...S}),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=iu(),r=!0}}}(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();_i(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 ma{constructor(){super(...arguments),this.id=su++}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(){}}}},lu=(e,t)=>Math.abs(e-t);class cu{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=fu(this.lastMoveEventInfo,this.history),t=null!==this.startEvent,n=function(e,t){const n=lu(e.x,t.x),r=lu(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}=Qs;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=uu(t,this.transformPagePoint),Js.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=fu("pointercancel"===e.type?this.lastMoveEventInfo:uu(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,i),r&&r(e,i)},!oa(e))return;this.dragSnapToOrigin=o,this.handlers=t,this.transformPagePoint=n,this.contextWindow=r||window;const i=uu(ia(e),this.transformPagePoint),{point:s}=i,{timestamp:a}=Qs;this.history=[{...s,timestamp:a}];const{onSessionStart:l}=t;l&&l(e,fu(i,this.history)),this.removeListeners=ca(aa(this.contextWindow,"pointermove",this.handlePointerMove),aa(this.contextWindow,"pointerup",this.handlePointerUp),aa(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Zs(this.updatePoint)}}function uu(e,t){return t?{point:t(e.point)}:e}function du(e,t){return{x:e.x-t.x,y:e.y-t.y}}function fu({point:e},t){return{point:e,delta:du(e,pu(t)),offset:du(e,hu(t)),velocity:mu(t,.1)}}function hu(e){return e[0]}function pu(e){return e[e.length-1]}function mu(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=pu(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>Ta(t)));)n--;if(!r)return{x:0,y:0};const i=Pa(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}const gu=.9999,vu=1.0001,yu=-.01,bu=.01;function xu(e){return e.max-e.min}function wu(e,t,n,r=.5){e.origin=r,e.originPoint=pc(t.min,t.max,e.origin),e.scale=xu(n)/xu(t),e.translate=pc(n.min,n.max,e.origin)-e.originPoint,(e.scale>=gu&&e.scale<=vu||isNaN(e.scale))&&(e.scale=1),(e.translate>=yu&&e.translate<=bu||isNaN(e.translate))&&(e.translate=0)}function _u(e,t,n,r){wu(e.x,t.x,n.x,r?r.originX:void 0),wu(e.y,t.y,n.y,r?r.originY:void 0)}function Su(e,t,n){e.min=n.min+t.min,e.max=e.min+xu(t)}function ku(e,t,n){e.min=t.min-n.min,e.max=e.min+xu(t)}function Eu(e,t,n){ku(e.x,t.x,n.x),ku(e.y,t.y,n.y)}function Cu(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 Tu(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}}),Nu=()=>({x:{min:0,max:0},y:{min:0,max:0}});function Mu(e){return[e("x"),e("y")]}function Du({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Iu(e){return void 0===e||1===e}function ju({scale:e,scaleX:t,scaleY:n}){return!Iu(e)||!Iu(t)||!Iu(n)}function Lu(e){return ju(e)||Fu(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Fu(e){return Vu(e.x)||Vu(e.y)}function Vu(e){return e&&"0%"!==e}function zu(e,t,n){return n+t*(e-n)}function Bu(e,t,n,r,o){return void 0!==o&&(e=zu(e,o,r)),zu(e,n,r)+t}function Wu(e,t=0,n=1,r,o){e.min=Bu(e.min,t,n,r,o),e.max=Bu(e.max,t,n,r,o)}function Uu(e,{x:t,y:n}){Wu(e.x,t.translate,t.scale,t.originPoint),Wu(e.y,n.translate,n.scale,n.originPoint)}const Ku=.999999999999,$u=1.0000000000001;function Hu(e,t){e.min=e.min+t,e.max=e.max+t}function qu(e,t,n,r,o=.5){Wu(e,t,n,pc(e.min,e.max,o),r)}function Yu(e,t){qu(e.x,t.x,t.scaleX,t.scale,t.originX),qu(e.y,t.y,t.scaleY,t.scale,t.originY)}function Xu(e,t){return Du(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 Gu=({current:e})=>e?e.ownerDocument.defaultView:null,Ju=new WeakMap;class Zu{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=Nu(),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 cu(e,{onSessionStart:e=>{const{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(ia(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=ha(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),Mu((e=>{let t=this.getAxisMotionValue(e).get()||0;if(es.test(t)){const{projection:n}=this.visualElement;if(n&&n.layout){const r=n.layout.layoutBox[e];r&&(t=xu(r)*(parseFloat(t)/100))}}this.originPoint[e]=t})),i&&Js.postRender((()=>i(e,t))),null===(n=this.removeWillChange)||void 0===n||n.call(this),this.removeWillChange=Jc(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:()=>Mu((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:Gu(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&&Js.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||!Qu(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?pc(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&&pi(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!r)&&function(e,{top:t,left:n,bottom:r,right:o}){return{x:Cu(e.x,n,o),y:Cu(e.y,t,r)}}(r.layoutBox,t),this.elastic=function(e=Pu){return!1===e?e=0:!0===e&&(e=Pu),{x:Ru(e,"left","right"),y:Ru(e,"top","bottom")}}(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Mu((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||!pi(e))return!1;const n=e.current;Fa(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=Xu(e,n),{scroll:o}=t;return o&&(Hu(r.x,o.offset.x),Hu(r.y,o.offset.y)),r}(n,r.root,this.visualElement.getTransformPagePoint());let i=function(e,t){return{x:Tu(e.x,t.x),y:Tu(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=Du(e))}return i}startAnimation(e){const{drag:t,dragMomentum:n,dragElastic:r,dragTransition:o,dragSnapToOrigin:i,onDragTransitionEnd:s}=this.getProps(),a=this.constraints||{},l=Mu((s=>{if(!Qu(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(Uc(e,n,0,t,this.visualElement,!1,Jc(this.visualElement,e)))}stopAnimation(){Mu((e=>this.getAxisMotionValue(e).stop()))}pauseAnimation(){Mu((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){Mu((t=>{const{drag:n}=this.getProps();if(!Qu(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]-pc(n,i,.5))}}))}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!pi(t)||!n||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Mu((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=xu(e),o=xu(t);return o>r?n=hc(t.min,t.max-r,e.min):r>o&&(n=hc(e.min,e.max-o,t.min)),Ui(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(),Mu((t=>{if(!Qu(t,e,null))return;const n=this.getAxisMotionValue(t),{min:o,max:i}=this.constraints[t];n.set(pc(o,i,r[t]))}))}addListeners(){if(!this.visualElement.current)return;Ju.set(this.visualElement,this);const e=aa(this.visualElement.current,"pointerdown",(e=>{const{drag:t,dragListener:n=!0}=this.getProps();t&&n&&this.start(e)})),t=()=>{const{dragConstraints:e}=this.getProps();pi(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()),Js.read(t);const o=ra(window,"resize",(()=>this.scalePositionWithinConstraints())),i=n.addEventListener("didUpdate",(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Mu((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=Pu,dragMomentum:s=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:o,dragElastic:i,dragMomentum:s}}}function Qu(e,t,n){return!(!0!==t&&t!==e||null!==n&&n!==e)}const ed=e=>(t,n)=>{e&&Js.postRender((()=>e(t,n)))},td={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function nd(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const rd={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e){if(!ts.test(e))return e;e=parseFloat(e)}return`${nd(e,t.target.x)}% ${nd(e,t.target.y)}%`}},od={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=wl.parse(e);if(o.length>5)return r;const i=wl.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=pc(a,l,.5);return"number"==typeof o[2+s]&&(o[2+s]/=c),"number"==typeof o[3+s]&&(o[3+s]/=c),i(o)}};class id extends re.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:o}=e;var i;i=ad,Object.assign(Li,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()})),td.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()||Js.postRender((()=>{const e=i.getStack();e&&e.members.length||this.safeToRemove()}))),null):null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),fi.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 sd(e){const[t,n]=function(){const e=(0,re.useContext)(oi);if(null===e)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,o=(0,re.useId)();(0,re.useEffect)((()=>r(o)),[]);const i=(0,re.useCallback)((()=>n&&n(o)),[o,n]);return!t&&n?[!1,i]:[!0]}(),r=(0,re.useContext)(Oi);return(0,ti.jsx)(id,{...e,layoutGroup:r,switchLayoutGroup:(0,re.useContext)(mi),isPresent:t,safeToRemove:n})}const ad={borderRadius:{...rd,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:rd,borderTopRightRadius:rd,borderBottomLeftRadius:rd,borderBottomRightRadius:rd,boxShadow:od},ld=["TopLeft","TopRight","BottomLeft","BottomRight"],cd=ld.length,ud=e=>"string"==typeof e?parseFloat(e):e,dd=e=>"number"==typeof e||ts.test(e);function fd(e,t){return void 0!==e[t]?e[t]:e.borderRadius}const hd=md(0,.5,sc),pd=md(.5,.95,Gs);function md(e,t,n){return r=>rt?1:n(hc(e,t,r))}function gd(e,t){e.min=t.min,e.max=t.max}function vd(e,t){gd(e.x,t.x),gd(e.y,t.y)}function yd(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function bd(e,t,n,r,o){return e=zu(e-=t,1/n,r),void 0!==o&&(e=zu(e,1/o,r)),e}function xd(e,t,[n,r,o],i,s){!function(e,t=0,n=1,r=.5,o,i=e,s=e){if(es.test(t)&&(t=parseFloat(t),t=pc(s.min,s.max,t/100)-s.min),"number"!=typeof t)return;let a=pc(i.min,i.max,r);e===i&&(a-=t),e.min=bd(e.min,t,n,a,o),e.max=bd(e.max,t,n,a,o)}(e,t[n],t[r],t[o],t.scale,i,s)}const wd=["x","scaleX","originX"],_d=["y","scaleY","originY"];function Sd(e,t,n,r){xd(e.x,t,wd,n?n.x:void 0,r?r.x:void 0),xd(e.y,t,_d,n?n.y:void 0,r?r.y:void 0)}function kd(e){return 0===e.translate&&1===e.scale}function Ed(e){return kd(e.x)&&kd(e.y)}function Cd(e,t){return e.min===t.min&&e.max===t.max}function Td(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Pd(e,t){return Td(e.x,t.x)&&Td(e.y,t.y)}function Rd(e){return xu(e.x)/xu(e.y)}function Od(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Ad{constructor(){this.members=[]}add(e){Ks(this.members,e),e.scheduleRender()}remove(e){if($s(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 Nd=(e,t)=>e.depth-t.depth;class Md{constructor(){this.children=[],this.isDirty=!1}add(e){Ks(this.children,e),this.isDirty=!0}remove(e){$s(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Nd),this.isDirty=!1,this.children.forEach(e)}}const Dd={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Id="undefined"!=typeof window&&void 0!==window.MotionDebug,jd=["","X","Y","Z"],Ld={visibility:"hidden"};let Fd=0;function Vd(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function zd(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Xc(t);window.MotionHasOptimisedTransformAnimation(n)&&window.MotionCancelOptimisedTransform(n);const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&zd(r)}function Bd({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(e={},n=(null==t?void 0:t())){this.id=Fd++,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,Id&&(Dd.totalNodes=Dd.resolvedTargetDeltas=Dd.recalculatedProjection=0),this.nodes.forEach(Kd),this.nodes.forEach(Jd),this.nodes.forEach(Zd),this.nodes.forEach($d),Id&&window.MotionDebug.record(Dd)},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=Dl.now(),n=({timestamp:r})=>{const o=r-t;o>=250&&(Zs(n),e(o-250))};return Js.read(n,!0),()=>Zs(n)}(r),td.hasAnimatedSinceResize&&(td.hasAnimatedSinceResize=!1,this.nodes.forEach(Gd))}))}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()||of,{onLayoutAnimationStart:i,onLayoutAnimationComplete:a}=s.getProps(),l=!this.targetLayout||!Pd(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={...Ma(o,"layout"),onPlay:i,onComplete:a};(s.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t)}else t||Gd(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,Zs(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(Qd),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.MotionCancelOptimisedTransform&&!this.hasCheckedOptimisedAppear&&zd(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;eKu&&(t.x=1),t.y<$u&&t.y>Ku&&(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=Nu());const{target:l}=t;l?(this.projectionDelta&&this.prevProjectionDelta?(yd(this.prevProjectionDelta.x,this.projectionDelta.x),yd(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),_u(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.treeScale.x===s&&this.treeScale.y===a&&Od(this.projectionDelta.x,this.prevProjectionDelta.x)&&Od(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l)),Id&&Dd.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=Au(),this.projectionDelta=Au(),this.projectionDeltaWithTransform=Au()}setAnimationOrigin(e,t=!1){const n=this.snapshot,r=n?n.latestValues:{},o={...this.latestValues},i=Au();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;const s=Nu(),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(rf));let d;this.animationProgress=0,this.mixTargetDelta=t=>{const n=t/1e3;var l,f,h,p;tf(i.x,e.x,n),tf(i.y,e.y,n),this.setTargetDelta(i),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Eu(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox),l=this.relativeTarget,f=this.relativeTargetOrigin,h=s,p=n,nf(l.x,f.x,h.x,p),nf(l.y,f.y,h.y,p),d&&function(e,t){return Cd(e.x,t.x)&&Cd(e.y,t.y)}(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||(d=Nu()),vd(d,this.relativeTarget)),a&&(this.animationValues=o,function(e,t,n,r,o,i){o?(e.opacity=pc(0,void 0!==n.opacity?n.opacity:1,hd(r)),e.opacityExit=pc(void 0!==t.opacity?t.opacity:1,0,pd(r))):i&&(e.opacity=pc(void 0!==t.opacity?t.opacity:1,void 0!==n.opacity?n.opacity:1,r));for(let o=0;o{td.hasAnimatedSinceResize=!0,this.currentAnimation=function(e,t,n){const r=Bi(0)?0:qc(0);return r.start(Uc("",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&&cf(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||Nu();const t=xu(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;const r=xu(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}vd(t,n),Yu(t,o),_u(this.projectionDeltaWithTransform,this.layoutCorrected,t,o)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new Ad),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&&Vd("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(qd),this.root.sharedNodes.clear()}}}function Wd(e){e.updateLayout()}function Ud(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?Mu((e=>{const r=i?n.measuredBox[e]:n.layoutBox[e],o=xu(r);r.min=t[e].min,r.max=r.min+o})):cf(o,n.layoutBox,t)&&Mu((r=>{const o=i?n.measuredBox[r]:n.layoutBox[r],s=xu(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=Au();_u(s,t,n.layoutBox);const a=Au();i?_u(a,e.applyTransform(r,!0),n.measuredBox):_u(a,t,n.layoutBox);const l=!Ed(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=Nu();Eu(s,n.layoutBox,o.layoutBox);const a=Nu();Eu(a,t,i.layoutBox),Pd(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 Kd(e){Id&&Dd.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 $d(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Hd(e){e.clearSnapshot()}function qd(e){e.clearMeasurements()}function Yd(e){e.isLayoutDirty=!1}function Xd(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Gd(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Jd(e){e.resolveTargetDelta()}function Zd(e){e.calcProjection()}function Qd(e){e.resetSkewAndRotation()}function ef(e){e.removeLeadSnapshot()}function tf(e,t,n){e.translate=pc(t.translate,0,n),e.scale=pc(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function nf(e,t,n,r){e.min=pc(t.min,n.min,r),e.max=pc(t.max,n.max,r)}function rf(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}const of={duration:.45,ease:[.4,0,.1,1]},sf=e=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),af=sf("applewebkit/")&&!sf("chrome/")?Math.round:Gs;function lf(e){e.min=af(e.min),e.max=af(e.max)}function cf(e,t,n){return"position"===e||"preserve-aspect"===e&&(r=Rd(t),o=Rd(n),!(Math.abs(r-o)<=.2));var r,o}function uf(e){var t;return e!==e.root&&(null===(t=e.scroll)||void 0===t?void 0:t.wasRoot)}const df=Bd({attachResizeListener:(e,t)=>ra(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),ff={current:void 0},hf=Bd({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!ff.current){const e=new df({});e.mount(window),e.setOptions({layoutScroll:!0}),ff.current=e}return ff.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>Boolean("fixed"===window.getComputedStyle(e).position)}),pf={pan:{Feature:class extends ma{constructor(){super(...arguments),this.removePointerDownListener=Gs}onPointerDown(e){this.session=new cu(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Gu(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:ed(e),onStart:ed(t),onMove:n,onEnd:(e,t)=>{delete this.session,r&&Js.postRender((()=>r(e,t)))}}}mount(){this.removePointerDownListener=aa(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 ma{constructor(e){super(e),this.removeGroupControls=Gs,this.removeListeners=Gs,this.controls=new Zu(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Gs}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:hf,MeasureLayout:sd}},mf={current:null},gf={current:!1},vf=new WeakMap,yf=[...Ga,ul,wl],bf=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],xf=ki.length;class wf{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=rl,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,Js.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=Ei(t),this.isVariantNode=Ci(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]&&Bi(t)&&t.set(a[e],!1)}}mount(e){this.current=e,vf.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))),gf.current||function(){if(gf.current=!0,ii)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>mf.current=e.matches;e.addListener(t),t()}else mf.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||mf.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){vf.delete(this.current),this.projection&&this.projection.unmount(),Zs(this.notifyUpdate),Zs(this.render),this.valueSubscriptions.forEach((e=>e())),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){const n=Vi.has(e),r=t.on("change",(t=>{this.latestValues[e]=t,this.props.onUpdate&&Js.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)})),o=t.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(e,(()=>{r(),o(),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 Ri){const t=Ri[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):Nu()}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=qc(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&&(Va(r)||ja(r))?r=parseFloat(r):(o=r,!yf.find(Xa(o))&&wl.test(t)&&(r=Pl(e,t))),this.setBaseTarget(e,Bi(r)?r.get():r)),Bi(r)?r.get():r;var o}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=js(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||Bi(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 Kc),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class _f extends wf{constructor(){super(...arguments),this.KeyframeResolver=Ol}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 Sf extends _f{constructor(){super(...arguments),this.type="html",this.applyWillChange=!0,this.renderInstance=Os}readValueFromInstance(e,t){if(Vi.has(t)){const e=Tl(t);return e&&e.default||0}{const r=(n=e,window.getComputedStyle(n)),o=(us(t)?r.getPropertyValue(t):r[t])||0;return"string"==typeof o?o.trim():o}var n}measureInstanceViewportBox(e,{transformPagePoint:t}){return Xu(e,t)}build(e,t,n){ps(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Ms(e,t,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Bi(e)&&(this.childSubscription=e.on("change",(e=>{this.current&&(this.current.textContent=`${e}`)})))}}class kf extends _f{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Nu}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(Vi.has(t)){const e=Tl(t);return e&&e.default||0}return t=As.has(t)?t:li(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return Ds(e,t,n)}build(e,t,n){Es(e,t,this.isSVGTag,n.transformTemplate)}renderInstance(e,t,n,r){Ns(e,t,0,r)}mount(e){this.isSVGTag=Ts(e.tagName),super.mount(e)}}const Ef=(e,t)=>ji(e)?new kf(t):new Sf(t,{allowProjection:e!==re.Fragment}),Cf={...au,...ka,...pf,layout:{ProjectionNode:hf,MeasureLayout:sd}},Tf=Di(((e,t)=>function(e,{forwardMotionProps:t=!1},n,r){return{...ji(e)?ta:na,preloadedFeatures:n,useRender:Rs(t),createVisualElement:r,Component:e}}(e,t,Cf,Ef)));var Pf=["slug","text","icon","className","disabled","badge"];function Rf(){return Rf=Object.assign?Object.assign.bind():function(e){for(var t=1;tsvg]:size-3",sm:"underline"===m?"py-1.5 text-sm [&>svg]:size-4":"px-3 py-1.5 text-sm [&>svg]:size-4",md:"underline"===m?"py-2 text-base [&>svg]:size-5":"px-3.5 py-1.5 text-base [&>svg]:size-5",lg:"underline"===m?"p-2.5 text-lg [&>svg]:size-6":"px-3.5 py-1.5 text-lg [&>svg]:size-6"}[p],x=Q("relative border-none bg-transparent text-text-tertiary cursor-pointer flex items-center justify-center transition-colors duration-200","full"===y?"flex-1":"","vertical"===g?"w-full justify-between":""),w="rounded-full";"rounded"===m?w="rounded-md":"underline"===m&&(w="rounded-none");var _=Q(x,"border-none",w,"","focus:outline-none",l?"text-text-disabled cursor-not-allowed":"",b,f===r?"bg-background-primary text-text-primary":"",s);return oe().createElement("button",Rf({ref:t,className:_,disabled:l,onClick:function(e){h(e,{slug:r,text:o})}},d),f===r&&"underline"===m&&oe().createElement(Tf.span,{layoutId:"underline",className:"absolute right-0 left-0 -bottom-px h-px bg-border-interactive"}),oe().createElement("span",{className:"flex items-center gap-1"},"left"===v&&i&&oe().createElement("span",{className:"mr-1"},i),o,"right"===v&&i&&oe().createElement("span",{className:"ml-1"},i)),u&&(0,re.isValidElement)(u)&&u)},Nf={Group:function(e){var t,n=e.children,r=e.activeItem,o=void 0===r?null:r,i=e.onChange,s=e.className,a=e.size,l=void 0===a?"sm":a,c=e.orientation,u=void 0===c?"horizontal":c,d=e.variant,f=void 0===d?"pill":d,h=e.iconPosition,p=void 0===h?"left":h,m=e.width,g=void 0===m?"auto":m,v=(0,re.useCallback)((function(e,t){i&&i({event:e,value:t})}),[i]),y="rounded-full",b="p-1",x="border border-tab-border border-solid";"vertical"===u?t="gap-0.5":"rounded"!==f&&"pill"!==f||("xs"===l||"sm"===l?t="gap-0.5":"md"!==l&&"lg"!==l||(t="gap-1")),"rounded"===f||"vertical"===u?y="rounded-md":"underline"===f&&(y="rounded-none",b="p-0",x="border-t-0 border-r-0 border-l-0 border-b border-solid border-tab-border","xs"===l?t="gap-0":"sm"===l?t="gap-2.5":"md"!==l&&"lg"!==l||(t="gap-3"));var w="vertical"===u?"flex-col":"",_="box-border [&>*]:box-border flex items-center ".concat("full"===g?"w-full":""," ").concat(w),S=Q(_,y,b,t,x,s);return oe().createElement("div",{className:S},oe().createElement(Of.Provider,{value:{activeItem:o,onChange:v,size:l,variant:f,orientation:u,iconPosition:p,width:g}},oe().Children.map(n,(function(e){return(0,re.isValidElement)(e)?oe().cloneElement(e):null}))))},Tab:(0,re.forwardRef)(Af)};const Mf=me("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]),Df=me("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),If=me("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);var jf={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"}},Lf="group-disabled:text-field-color-disabled",Ff=["value","selected","children"];function Vf(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)||Wf(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 zf(){return zf=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(p.current),v.current=null,m.current="")}),[r]),xr((()=>{var e;r&&""===m.current&&(g.current=null!=(e=null!=h?h:s)?e:-1)}),[r,h,s]);const _=ir((e=>{e?o.current.typing||(o.current.typing=e,b(e)):o.current.typing&&(o.current.typing=e,b(e))})),S=ir((e=>{function t(e,t,n){const r=x.current?x.current(t,n):t.find((e=>0===(null==e?void 0:e.toLocaleLowerCase().indexOf(n.toLocaleLowerCase()))));return r?e.indexOf(r):-1}const n=i.current;if(m.current.length>0&&" "!==m.current[0]&&(-1===t(n,n,m.current)?_(!1):" "===e.key&&Ft(e)),null==n||w.current.includes(e.key)||1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey)return;r&&" "!==e.key&&(Ft(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())}))&&m.current===e.key&&(m.current="",g.current=v.current),m.current+=e.key,clearTimeout(p.current),p.current=setTimeout((()=>{m.current="",g.current=v.current,_(!1)}),d);const o=g.current,s=t(n,[...n.slice((o||0)+1),...n.slice(0,(o||0)+1)],m.current);-1!==s?(y(s),v.current=s):" "!==e.key&&(m.current="",_(!1))})),k=re.useMemo((()=>({onKeyDown:S})),[S]),E=re.useMemo((()=>({onKeyDown:S,onKeyUp(e){" "===e.key&&_(!1)}})),[S,_]);return re.useMemo((()=>c?{reference:k,floating:E}:{}),[c,k,E])}(V,{listRef:B,activeIndex:O,selectedIndex:M,onMatch:T?A:D,onTypingChange:function(e){W.current=e}}),Y=wo([K,$,H,U].concat(Bf(p?[]:[q]))),X=Y.getReferenceProps,G=Y.getFloatingProps,J=Y.getItemProps,Z=function(e,t){if(f)return function(e,t){var n,r=Bf(null!==(n=E())&&void 0!==n?n:[]);-1===r.findIndex((function(e){return"object"===Kf(e)?e[c]===t[c]:e===t}))&&(r.push(t),y||w(r),D(e),L.reference.current.focus(),P(!1),k(""),"function"==typeof a&&a(r))}(e,t);D(e),y||w(t),L.reference.current.focus(),P(!1),k(""),"function"==typeof a&&a(t)},Q=(0,re.useCallback)((function(e,t){z.current[e]=t}),[]);return React.createElement(Yf.Provider,{value:{selectedIndex:M,setSelectedIndex:D,activeIndex:O,setActiveIndex:A,selected:x,setSelected:w,handleSelect:Z,combobox:p,sizeValue:o,multiple:f,onChange:a,isTypingRef:W,getItemProps:J,onClickItem:function(e,t){Z(e,t)},onKeyDownItem:function(e,t,n){"Enter"===e.key&&(e.preventDefault(),Z(t,n))," "!==e.key||W.current||(e.preventDefault(),Z(t,n))},getValues:E,selectId:v,getReferenceProps:X,isOpen:T,value:i,updateListRef:Q,refs:L,listContentRef:B,by:c,getFloatingProps:G,floatingStyles:F,context:V,searchKeyword:S,setSearchKeyword:k,disabled:g}},u)};Gf.Button=function(e){var t,n,r,o=e.children,i=e.icon,s=void 0===i?null:i,a=e.placeholder,l=void 0===a?"Select an option":a,c=e.optionIcon,u=void 0===c?null:c,d=e.displayBy,f=void 0===d?"name":d,h=e.label,p=Xf(),m=p.sizeValue,g=p.getReferenceProps,v=p.getValues,y=p.selectId,b=p.refs,x=p.isOpen,w=p.multiple,_=p.combobox,S=p.setSelected,k=p.onChange,E=p.isControlled,C=p.disabled,T=p.by,P=null===(t={sm:"xs",md:"sm",lg:"md"})||void 0===t?void 0:t[m],R=(0,re.useCallback)((function(){if(s)return s;var e="text-field-placeholder group-disabled:text-icon-disabled";return _?React.createElement(Mf,{className:e}):React.createElement(Df,{className:e})}),[s]),O=(0,re.useCallback)((function(){var e=v();if(!e)return null;if("function"==typeof o){var t=Hf({value:e},w?{onClose:A}:{});return o(t)}if(w)return e.map((function(e,t){return React.createElement(Le,{icon:u,type:"rounded",key:t,size:P,onMouseDown:A(e),label:"object"===Kf(e)?e[f]:e,disabled:C})}));var n="object"===Kf(e)?e[f]:e;return(0,re.isValidElement)(o)&&(n=o),React.createElement("span",{className:Q(jf[m].displaySelected,Lf)},n)}),[v]),A=function(e){return function(t){var n;null==t||t.preventDefault(),null==t||t.stopPropagation();var r=Bf(null!==(n=v())&&void 0!==n?n:[]),o=r.findIndex((function(t){return"object"===Kf(t)?t[T]===e[T]:t===e}));-1!==o&&(r.splice(o,1),E||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:Q(null===(n=jf[m])||void 0===n?void 0:n.label,"text-field-label"),htmlFor:y},h),React.createElement("button",zf({id:y,ref:b.setReference,className:Q("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",!x&&"focus:ring-2 focus:ring-offset-4 focus:border-focus-border focus:ring-focus [&:hover:not(:focus):not(:disabled)]:border-border-strong",jf[m].selectButton,w&&jf[m].multiSelect,"group disabled:border-field-border-disabled [&:hover:has(:disabled)]:border-field-border-disabled"),"aria-labelledby":"select-label",tabIndex:0,disabled:C},g()),React.createElement("div",{className:Q("flex-1 grid items-center justify-start gap-1.5 ",v()&&"flex flex-wrap")},O(),(w?!(null!==(r=v())&&void 0!==r&&r.length):!v())&&React.createElement("div",{className:Q("[grid-area:1/1/2/3] text-field-input",jf[m].displaySelected,Lf)},l)),React.createElement("div",{className:Q("flex items-center [&>svg]:shrink-0",jf[m].icon)},R())))},Gf.Options=function(e){var t=e.children,n=e.searchBy,r=void 0===n?"id":n,o=e.searchPlaceholder,i=void 0===o?"Search...":o,s=e.dropdownPortalRoot,a=void 0===s?null:s,l=e.dropdownPortalId,c=void 0===l?"":l,u=Xf(),d=u.isOpen,f=u.context,h=u.refs,p=u.combobox,m=u.floatingStyles,g=u.getFloatingProps,v=u.sizeValue,y=u.setSearchKeyword,b=u.setActiveIndex,x=u.setSelectedIndex,w=u.value,_=u.selected,S=u.getValues,k=u.searchKeyword,E=u.listContentRef,C=u.by,T=(0,re.useMemo)((function(){var e=S(),n=0;return e&&(n=re.Children.toArray(t).findIndex((function(t){return"object"===Kf(t.props.value)?t.props.value[C]===e[C]:t.props.value===e}))),-1===n?0:n}),[w,_,t]);(0,re.useLayoutEffect)((function(){b(T),x(T)}),[]);var P=(0,re.useMemo)((function(){return re.Children.map(t,(function(e,t){if(!(0,re.isValidElement)(e))return null;if(k){var n=e.props.value;if("object"===Kf(n)){if(-1===n[r].toLowerCase().indexOf(k.toLowerCase()))return null}else if(-1===n.toLowerCase().indexOf(k.toLowerCase()))return null}return(0,re.cloneElement)(e,Hf(Hf({},e.props),{},{index:t}))}))}),[k,w,_,t]),R=re.Children.count(P);return(0,re.useEffect)((function(){E.current=[],re.Children.forEach(t,(function(e){if((0,re.isValidElement)(e)&&e.props.value){if(k){var t=e.props.value;if("object"===Kf(t)){if(-1===t[r].toLowerCase().indexOf(k.toLowerCase()))return}else if(-1===t.toLowerCase().indexOf(k.toLowerCase()))return}E.current.push(e.props.value)}}))}),[k]),React.createElement(React.Fragment,null,d&&React.createElement(to,{id:c,root:a},React.createElement(lo,{context:f,modal:!1},React.createElement("div",zf({ref:h.setFloating,className:Q("box-border [&_*]:box-border w-full bg-white outline-none shadow-lg border border-solid border-border-subtle overflow-hidden",p&&"grid grid-cols-1 grid-rows-[auto_1fr] divide-y divide-x-0 divide-solid divide-border-subtle",jf[v].dropdown,!p&&"h-full"),style:Hf({},m)},g()),p&&React.createElement("div",{className:Q(jf[v].searchbarWrapper)},React.createElement(If,{className:Q("text-icon-secondary shrink-0",jf[v].searchbarIcon)}),React.createElement("input",{className:Q("px-1 w-full placeholder:text-field-placeholder border-0 focus:outline-none focus:shadow-none",jf[v].searchbar),type:"search",name:"keyword",placeholder:i,onChange:function(e){return y(e.target.value)},autoComplete:"off"})),React.createElement("div",{className:Q("overflow-y-auto",!p&&"w-full h-full",jf[v].dropdownItemsWrapper)},!!R&&P,!R&&React.createElement("div",{className:"p-2 text-center text-base font-medium text-field-placeholder"},"No items found"))))))},Gf.Option=function(e){var t=e.value,n=e.selected,r=e.children,o=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(th({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(th({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(th({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(th({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(th({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(th({jsx:e,type:"custom"},t))}}],t&&rh(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}(),hh=new fh,ph=Object.seal(Object.assign((function(e,t){return hh.default(e,t)}),{success:hh.success.bind(hh),error:hh.error.bind(hh),warning:hh.warning.bind(hh),info:hh.info.bind(hh),custom:hh.custom.bind(hh),dismiss:hh.dismiss.bind(hh),update:hh.update.bind(hh)},{getHistory:hh.history.bind(hh)})),mh=!1,gh={"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"},vh={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"},yh="bg-background-inverse border-background-inverse",bh={light:"text-icon-secondary",dark:"text-icon-inverse"};class xh extends re.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 wh({children:e,isPresent:t}){const n=(0,re.useId)(),r=(0,re.useRef)(null),o=(0,re.useRef)({width:0,height:0,top:0,left:0}),{nonce:i}=(0,re.useContext)(ni);return(0,re.useInsertionEffect)((()=>{const{width:e,height:s,top:a,left:l}=o.current;if(t||!r.current||!e||!s)return;r.current.dataset.motionPopId=n;const c=document.createElement("style");return i&&(c.nonce=i),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: ${s}px !important;\n top: ${a}px !important;\n left: ${l}px !important;\n }\n `),()=>{document.head.removeChild(c)}}),[t]),(0,ti.jsx)(xh,{isPresent:t,childRef:r,sizeRef:o,children:re.cloneElement(e,{ref:r})})}const _h=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:i,mode:s})=>{const a=Ls(Sh),l=(0,re.useId)(),c=(0,re.useMemo)((()=>({id:l,initial:t,isPresent:n,custom:o,onExitComplete:e=>{a.set(e,!0);for(const e of a.values())if(!e)return;r&&r()},register:e=>(a.set(e,!1),()=>a.delete(e))})),i?[Math.random()]:[n]);return(0,re.useMemo)((()=>{a.forEach(((e,t)=>a.set(t,!1)))}),[n]),re.useEffect((()=>{!n&&!a.size&&r&&r()}),[n]),"popLayout"===s&&(e=(0,ti.jsx)(wh,{isPresent:n,children:e})),(0,ti.jsx)(oi.Provider,{value:c,children:e})};function Sh(){return new Map}const kh=e=>e.key||"";function Eh(e){const t=[];return re.Children.forEach(e,(e=>{(0,re.isValidElement)(e)&&t.push(e)})),t}const Ch=({children:e,exitBeforeEnter:t,custom:n,initial:r=!0,onExitComplete:o,presenceAffectsLayout:i=!0,mode:s="sync"})=>{Fa(!t,"Replace exitBeforeEnter with mode='wait'");const a=(0,re.useMemo)((()=>Eh(e)),[e]),l=a.map(kh),c=(0,re.useRef)(!0),u=(0,re.useRef)(a),d=Ls((()=>new Map)),[f,h]=(0,re.useState)(a),[p,m]=(0,re.useState)(a);si((()=>{c.current=!1,u.current=a;for(let e=0;e{const t=kh(e),f=a===p||l.includes(t);return(0,ti.jsx)(_h,{isPresent:f,initial:!(c.current&&!r)&&void 0,custom:f?void 0:n,presenceAffectsLayout:i,mode:s,onExitComplete:f?void 0:()=>{if(!d.has(t))return;d.set(t,!0);let e=!0;d.forEach((t=>{t||(e=!1)})),e&&(null==v||v(),m(u.current),o&&o())},children:e},t)}))})};function Th(e){return Th="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},Th(e)}function Ph(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 Rh(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n1&&void 0!==arguments[1]?arguments[1]:c;if(a&&!(c<0))return b.current=(new Date).getTime(),setTimeout((function(){y(e.id)}),t)};(0,re.useEffect)((function(){var e=c;return w.current=_(t,e),function(){clearTimeout(w.current)}}),[]),(0,re.useEffect)((function(){null!=t&&t.dismiss&&y(t.id)}),[t]);var S,k,E,C,T,P,R,O,A,N,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 y(t.id)}))},D=null;return"stack"===h&&(D=React.createElement("div",{className:Q("flex items-center justify-start p-4 gap-2 relative border border-solid rounded-md shadow-lg","dark"===d?yh:null===(S=vh)||void 0===S?void 0:S[v],"w-[22.5rem]"),onMouseEnter:function(){clearTimeout(w.current),x.current=(new Date).getTime()},onMouseLeave:function(){w.current=_(t,c-(x.current-b.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"},Lo({variant:v,icon:m,theme:d})),React.createElement("div",{className:"flex flex-col items-start justify-start gap-0.5"},Vo({title:r,theme:d}),zo({content:i,theme:d}),(null==t||null===(k=t.action)||void 0===k?void 0:k.label)&&"function"==typeof(null==t||null===(E=t.action)||void 0===E?void 0:E.onClick)&&React.createElement("div",{className:"mt-2.5"},Fo({actionLabel:null==t||null===(C=t.action)||void 0===C?void 0:C.label,actionType:null!==(T=null==t||null===(P=t.action)||void 0===P?void 0:P.type)&&void 0!==T?T:"button",onAction:M,theme:d}))),React.createElement("div",{className:"absolute right-4 top-4 [&_svg]:size-5"},React.createElement("button",{className:Q("bg-transparent m-0 p-0 border-none focus:outline-none active:outline-none cursor-pointer",null!==(R=bh[d])&&void 0!==R?R:bh.light),onClick:function(){return y(t.id)}},React.createElement(Ie,null)))):null==t||null===(O=t.jsx)||void 0===O?void 0:O.call(t,{close:function(){return y(t.id)},action:null!=t&&t.action?Rh(Rh({},null==t?void 0:t.action),{},{onClick:M}):null}))),"inline"===h&&(D=React.createElement("div",{className:Q("flex items-center justify-start p-3 gap-2 relative border border-solid rounded-md shadow-lg","dark"===d?yh:null===(A=vh)||void 0===A?void 0:A[v],"lg:w-[47.5rem] w-full")},React.createElement("div",{className:"self-start flex items-center justify-center [&_svg]:size-5 shrink-0"},Lo({variant:v,icon:m,theme:d})),React.createElement("div",{className:"flex items-start justify-start gap-1 mr-10 [&>span:first-child]:shrink-0"},Vo({title:r,theme:d}),zo({content:i,theme:d})),React.createElement("div",{className:"absolute right-3 top-3 [&_svg]:size-5"},React.createElement("button",{className:Q("bg-transparent m-0 p-0 border-none focus:outline-none active:outline-none cursor-pointer",null!==(N=bh[d])&&void 0!==N?N:bh.light),onClick:function(){return y(t.id)}},React.createElement(Ie,null))))),D},Ih=(Mh=function(e){var t,n,r,o=e.position,i=void 0===o?"top-right":o,s=e.design,a=void 0===s?"stack":s,l=e.theme,c=void 0===l?"light":l,u=e.className,d=void 0===u?"":u,f=e.autoDismiss,h=void 0===f||f,p=e.dismissAfter,m=void 0===p?5e3:p,g=(n=(0,re.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)||Ah(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.")}()),v=g[0],y=g[1];(0,re.useEffect)((function(){hh.subscribe((function(e){null!=e&&e.dismiss?y((function(t){return t.map((function(t){return t.id===e.id?Rh(Rh({},t),{},{dismiss:!0}):t}))})):setTimeout((function(){(0,kn.flushSync)((function(){return y((function(t){return-1!==t.findIndex((function(t){return t.id===e.id}))?t.map((function(t){return t.id===e.id?Rh(Rh({},t),e):t})):[].concat(function(e){return function(e){if(Array.isArray(e))return Nh(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Ah(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 b=function(e){y((function(t){return t.filter((function(t){return t.id!==e}))}))};return React.createElement("ul",{className:Q("fixed flex flex-col list-none z-20 p-10 pointer-events-none [&>li]:pointer-events-auto gap-3",null!==(t=gh[i])&&void 0!==t?t:gh["top-right"],d)},React.createElement(Ch,{initial:!1},v.map((function(e){var t,n,r,o,i;return React.createElement(Tf.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(Dh,{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:a,autoDismiss:null!==(r=null==e?void 0:e.autoDismiss)&&void 0!==r?r:h,dismissAfter:null!==(o=null==e?void 0:e.dismissAfter)&&void 0!==o?o:m,removeToast:b,variant:e.type,theme:null!==(i=null==e?void 0:e.theme)&&void 0!==i?i:c}))}))))},(0,re.memo)((function(e){return mh?null:(mh=!0,React.createElement(Mh,e))}))),jh=["containerType","gap","direction","justify","align","wrap","cols","tabCols","mCols","className","children"],Lh=["grow","shrink","order","alignSelf","className","children"];function Fh(){return Fh=Object.assign?Object.assign.bind():function(e){for(var t=1;tspan:first-child]:shrink-0"},Vo({title:g,theme:u}),zo({content:y,theme:u}))),React.createElement("div",{className:"flex items-center justify-start gap-4"},(null==k?void 0:k.label)&&"function"==typeof(null==k?void 0:k.onClick)&&React.createElement("div",null,Fo({actionLabel:null==k?void 0:k.label,actionType:null!==(n=null==k?void 0:k.type)&&void 0!==n?n:"button",onAction:O,theme:u})),React.createElement("button",{className:Q("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 E()}},React.createElement(Ie,null))))},Kh=(Bh=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 Yh={},Xh={},Gh={},Jh={},Zh={},Qh={},ep={},tp={},np={},rp={},op={},ip={},sp={},ap={},lp={},cp={},up={},dp={},fp={},hp={},pp={},mp={},gp={},vp={},yp={},bp={},xp={},wp={},_p={},Sp={},kp={},Ep={},Cp={},Tp={},Pp={},Rp={},Op={},Ap={},Np={},Mp={},Dp="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Ip=Dp&&"documentMode"in document?document.documentMode:null,jp=Dp&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Lp=Dp&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Fp=!(!Dp||!("InputEvent"in window)||Ip)&&"getTargetRanges"in new window.InputEvent("input"),Vp=Dp&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),zp=Dp&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Bp=Dp&&/Android/.test(navigator.userAgent),Wp=Dp&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Up=Dp&&Bp&&Wp,Kp=Dp&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Wp,$p=1,Hp=3,qp=0,Yp=2,Xp=0,Gp=1,Jp=2,Zp=4,Qp=8,em=3|Zp|Qp|240,tm=1,nm=2,rm=3,om=4,im=5,sm=6,am=Vp||zp||Kp?" ":"​",lm="\n\n",cm=Lp?" ":am,um="֑-߿יִ-﷽ﹰ-ﻼ",dm="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",fm=new RegExp("^[^"+dm+"]*["+um+"]"),hm=new RegExp("^[^"+um+"]*["+dm+"]"),pm={bold:1,code:16,highlight:128,italic:2,strikethrough:Zp,subscript:32,superscript:64,underline:Qp},mm={directionless:1,unmergeable:2},gm={center:nm,end:sm,justify:om,left:tm,right:rm,start:im},vm={[nm]:"center",[sm]:"end",[om]:"justify",[tm]:"left",[rm]:"right",[im]:"start"},ym={normal:0,segmented:2,token:1},bm={[Xp]:"normal",[Jp]:"segmented",[Gp]:"token"};var xm,wm=(xm=function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;eSm;try{fb(e,(()=>{const o=Fy()||function(e){return e.getEditorState().read((()=>{const e=Fy();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(pb(n)){const r=n.getChildrenKeys();let o=t.firstChild;for(let n=0;n0){for(let t=0;t{Om(e,t,n)}))}function Mm(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 Dm(e,t){const n=e.mergeWithSibling(t),r=nb()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function Im(e){let t,n,r=e;if(""!==r.__text||!r.isSimpleText()||r.isUnmergeable()){for(;null!==(t=r.getPreviousSibling())&&my(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(""!==t.__text){if(Mm(t,r)){r=Dm(t,r);break}break}t.remove()}for(;null!==(n=r.getNextSibling())&&my(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(""!==n.__text){if(Mm(r,n)){r=Dm(r,n);break}break}n.remove()}}else r.remove()}function jm(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),my(r)){e.set(r.__key,o?r.getTextContentSize():0,"text");break}if(!pb(r))break;e.set(r.__key,o?r.getChildrenSize():0,"element")}}let Lm=1;const Fm="function"==typeof queueMicrotask?queueMicrotask:e=>{Promise.resolve().then(e)};function Vm(e){const t=document.activeElement;if(null===t)return!1;const n=t.nodeName;return vb(Zm(e))&&("INPUT"===n||"TEXTAREA"===n||"true"===t.contentEditable&&null==t.__lexicalEditor)}function zm(e,t,n){const r=e.getRootElement();try{return null!==r&&r.contains(t)&&r.contains(n)&&null!==t&&!Vm(t)&&Bm(t)===e}catch(e){return!1}}function Bm(e){let t=e;for(;null!=t;){const e=t.__lexicalEditor;if(null!=e)return e;t=Tg(t)}return null}function Wm(e){return e.isToken()||e.isSegmented()}function Um(e){return e.nodeType===Hp}function Km(e){let t=e;for(;null!=t;){if(Um(t))return t;t=t.firstChild}return null}function $m(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 Hm(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 qm(e){eb();const t=e.getLatest(),n=t.__parent,r=tb(),o=nb(),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,pb(e)?s.set(a,!0):o._dirtyLeaves.add(a)}function Ym(e){Qy();const t=nb(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,null!==n){const e=Gm(n);null!==e&&e.getWritable()}if(null!==e){const t=Gm(e);null!==t&&t.getWritable()}}}function Xm(){return Zy()?null:nb()._compositionKey}function Gm(e,t){const n=(t||tb())._nodeMap.get(e);return void 0===n?null:n}function Jm(e,t){const n=e[`__lexicalKey_${nb()._key}`];return void 0!==n?Gm(n,t):null}function Zm(e,t){let n=e;for(;null!=n;){const e=Jm(n,t);if(null!==e)return e;n=Tg(n)}return null}function Qm(e){const t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function eg(e){return e.read((()=>tg().getTextContent()))}function tg(){return ng(tb())}function ng(e){return e._nodeMap.get("root")}function rg(e){Qy();const t=tb();null!==e&&(e.dirty=!0,e.setCachedNodes(null)),t._selection=e}function og(e){const t=nb(),n=function(e,t){let n=e;for(;null!=n;){const e=n[`__lexicalKey_${t._key}`];if(void 0!==e)return e;n=Tg(n)}return null}(e,t);return null===n?e===t.getRootElement()?Gm("root"):null:Gm(n)}function ig(e,t){return t?e.getTextContentSize():0}function sg(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function ag(e){const t=[];let n=e;for(;null!==n;)t.push(n),n=n._parentEditor;return t}function lg(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function cg(e){return e.nodeType===Hp?e.nodeValue:null}function ug(e,t,n){const r=_n(t._window);if(null===r)return;const o=r.anchorNode;let{anchorOffset:i,focusOffset:s}=r;if(null!==o){let t=cg(o);const r=Zm(o);if(null!==t&&my(r)){if(t===am&&n){const e=n.length;t=n,i=e,s=e}null!==t&&dg(r,t,i,s,e)}}}function dg(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]===am&&(a=t.slice(0,-1));const l=i.getTextContent();if(o||a!==l){if(""===a){if(Ym(null),Vp||zp||Kp)i.remove();else{const e=nb();setTimeout((()=>{e.update((()=>{i.isAttached()&&i.remove()}))}),20)}return}const t=i.getParent(),o=Vy(),l=i.getTextContentSize(),c=Xm(),u=i.getKey();if(i.isToken()||null!==c&&u===c&&!s||Ey(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=Fy();if(!Ey(d)||null===n||null===r)return void i.setTextContent(a);if(d.setTextNodeRange(i,n,i,r),i.isSegmented()){const e=py(i.getTextContent());i.replace(e),i=e}i.setTextContent(a)}}}function fg(e){return"ArrowLeft"===e}function hg(e){return"ArrowRight"===e}function pg(e,t){return jp?e:t}function mg(e){return"Enter"===e}function gg(e){return"Backspace"===e}function vg(e){return"Delete"===e}function yg(e,t,n){return"a"===e.toLowerCase()&&pg(t,n)}function bg(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=_m(o);return n[t]=e,e}return o}function xg(e,t,n,r,o){if(0===n.size)return;const i=r.__type,s=r.__key,a=t.get(i);void 0===a&&wm(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 wg(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 _g(e,t){const n=e.offset;if("element"===e.type)return wg(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?wg(r.getParentOrThrow(),t,r.getIndexWithinParent()+(t?0:1)):e}}return null}function Sg(e){const t=Rg(e).event,n=t&&t.inputType;return"insertFromPaste"===n||"insertFromPasteAsQuotation"===n}function kg(e,t,n){return cb(e,t,n)}function Eg(e){return!bb(e)&&!e.isLastChild()&&!e.isInline()}function Cg(e,t){const n=e._keyToDOMMap.get(t);return void 0===n&&wm(75,t),n}function Tg(e){const t=e.assignedSlot||e.parentElement;return null!==t&&11===t.nodeType?t.host:t}function Pg(e,t){let n=e.getParent();for(;null!==n;){if(n.is(t))return!0;n=n.getParent()}return!1}function Rg(e){const t=e._window;return null===t&&wm(78),t}function Og(e){return bb(e)||pb(e)&&e.isShadowRoot()}function Ag(e){const t=nb(),n=e.constructor.getType(),r=t._nodes.get(n);void 0===r&&wm(97);const o=r.replace;if(null!==o){const t=o(e);return t instanceof e.constructor||wm(98),t}return e}function Ng(e,t){!bb(e.getParent())||pb(t)||vb(t)||wm(99)}function Mg(e){return(vb(e)||pb(e)&&!e.canBeEmpty())&&!e.isInline()}function Dg(e,t,n){n.style.removeProperty("caret-color"),t._blockCursorElement=null;const r=e.parentElement;null!==r&&r.removeChild(e)}function _n(e){return Dp?(e||window).getSelection():null}function Ig(e){return 1===e.nodeType}function jg(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 Lg(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 Fg(e){if(bb(e)||vb(e)&&!e.isInline())return!0;if(!pb(e)||Og(e))return!1;const t=e.getFirstChild(),n=null===t||Jv(t)||my(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}function Vg(e,t){let n=e;for(;null!==n&&null!==n.getParent()&&!t(n);)n=n.getParentOrThrow();return t(n)?n:null}const zg=new WeakMap,Bg=new Map;function Wg(e){const t=e.constructor.clone(e);return t.__parent=e.__parent,t.__next=e.__next,t.__prev=e.__prev,pb(e)&&pb(t)?(Tb(e)&&Tb(t)&&(t.__textFormat=e.__textFormat,t.__textStyle=e.__textStyle),t.__first=e.__first,t.__last=e.__last,t.__size=e.__size,t.__indent=e.__indent,t.__format=e.__format,t.__style=e.__style,t.__dir=e.__dir):my(e)&&my(t)&&(t.__format=e.__format,t.__style=e.__style,t.__mode=e.__mode,t.__detail=e.__detail),t}function Ug(e,t,n,r,o,i){let s=e.getFirstChild();for(;null!==s;){const e=s.__key;s.__parent===t&&(pb(s)&&Ug(s,e,n,r,o,i),n.has(e)||i.delete(e),o.push(e)),s=s.getNextSibling()}}let Kg,$g,Hg,qg,Yg,Xg,Gg,Jg,Zg,Qg,ev="",tv="",nv=null,rv="",ov="",iv=!1,sv=!1,av=null;function lv(e,t){const n=Gg.get(e);if(null!==t){const n=Sv(e);n.parentNode===t&&t.removeChild(n)}if(Jg.has(e)||$g._keyToDOMMap.delete(e),pb(n)){const e=bv(n,Gg);cv(e,0,e.length-1,null)}void 0!==n&&xg(Qg,Hg,qg,n,"destroyed")}function cv(e,t,n,r){let o=t;for(;o<=n;++o){const t=e[o];void 0!==t&&lv(t,r)}}function uv(e,t){e.setProperty("text-align",t)}const dv="40px";function fv(e,t){const n=Kg.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")||dv;e.style.setProperty("padding-inline-start",0===t?"":`calc(${t} * ${r})`)}function hv(e,t){const n=e.style;0===t?uv(n,""):t===tm?uv(n,"left"):t===nm?uv(n,"center"):t===rm?uv(n,"right"):t===om?uv(n,"justify"):t===im?uv(n,"start"):t===sm&&uv(n,"end")}function pv(e,t,n){const r=Jg.get(e);void 0===r&&wm(60);const o=r.createDOM(Kg,$g);if(function(e,t,n){const r=n._keyToDOMMap;t["__lexicalKey_"+n._key]=e,r.set(e,t)}(e,o,$g),my(r)?o.setAttribute("data-lexical-text","true"):vb(r)&&o.setAttribute("data-lexical-decorator","true"),pb(r)){const e=r.__indent,t=r.__size;if(0!==e&&fv(o,e),0!==t){const e=t-1;!function(e,t,n,r){const o=tv;tv="",mv(e,n,0,t,r,null),yv(n,r),tv=o}(bv(r,Jg),e,r,o)}const n=r.__format;0!==n&&hv(o,n),r.isInline()||vv(null,r,o),Eg(r)&&(ev+=lm,ov+=lm)}else{const t=r.getTextContent();if(vb(r)){const t=r.decorate($g,Kg);null!==t&&wv(e,t),o.contentEditable="false"}else my(r)&&(r.isDirectionless()||(tv+=t));ev+=t,ov+=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 xg(Qg,Hg,qg,r,"created"),o}function mv(e,t,n,r,o,i){const s=ev;ev="";let a=n;for(;a<=r;++a){pv(e[a],o,i);const t=Jg.get(e[a]);null!==t&&my(t)&&(null===nv&&(nv=t.getFormat()),""===rv&&(rv=t.getStyle()))}Eg(t)&&(ev+=lm),o.__lexicalTextContent=ev,ev=s+ev}function gv(e,t){const n=t.get(e);return Jv(n)||vb(n)&&n.isInline()}function vv(e,t,n){const r=null!==e&&(0===e.__size||gv(e.__last,Gg)),o=0===t.__size||gv(t.__last,Jg);if(r){if(!o){const e=n.__lexicalLineBreak;null!=e&&n.removeChild(e),n.__lexicalLineBreak=null}}else if(o){const e=document.createElement("br");n.__lexicalLineBreak=e,n.appendChild(e)}}function yv(e,t){const n=t.__lexicalDirTextContent,r=t.__lexicalDir;if(n!==tv||r!==av){const n=""===tv,i=n?av:(o=tv,fm.test(o)?"rtl":hm.test(o)?"ltr":null);if(i!==r){const o=t.classList,s=Kg.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=_m(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=_m(l);l=s[i]=e}void 0!==l&&o.add(...l)}t.dir=i}sv||(e.getWritable().__dir=i)}av=i,t.__lexicalDirTextContent=tv,t.__lexicalDir=i}var o}function bv(e,t){const n=[];let r=e.__first;for(;null!==r;){const e=t.get(r);void 0===e&&wm(101),n.push(r),r=e.__next}return n}function xv(e,t){const n=Gg.get(e);let r=Jg.get(e);void 0!==n&&void 0!==r||wm(61);const o=iv||Xg.has(e)||Yg.has(e),i=Cg($g,e);if(n===r&&!o){if(pb(n)){const e=i.__lexicalTextContent;void 0!==e&&(ev+=e,ov+=e);const t=i.__lexicalDirTextContent;void 0!==t&&(tv+=t)}else{const e=n.getTextContent();my(n)&&!n.isDirectionless()&&(tv+=e),ov+=e,ev+=e}return i}if(n!==r&&o&&xg(Qg,Hg,qg,r,"updated"),r.updateDOM(n,i,Kg)){const n=pv(e,null,null);return null===t&&wm(62),t.replaceChild(n,i),lv(e,null),n}if(pb(n)&&pb(r)){const e=r.__indent;e!==n.__indent&&fv(i,e);const t=r.__format;t!==n.__format&&hv(i,t),o&&(function(e,t,n){const r=tv;var o;tv="",nv=null,rv="",function(e,t,n){const r=ev,o=e.__size,i=t.__size;if(ev="",1===o&&1===i){const r=e.__first,o=t.__first;if(r===o)xv(r,n);else{const e=Sv(r),t=pv(o,null,null);n.replaceChild(t,e),lv(r,null)}const i=Jg.get(o);my(i)&&(null===nv&&(nv=i.getFormat()),""===rv&&(rv=i.getStyle()))}else{const r=bv(e,Gg),s=bv(t,Jg);if(0===o)0!==i&&mv(s,t,0,i-1,n,null);else if(0===i){if(0!==o){const e=null==n.__lexicalLineBreak;cv(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=_v(xv(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=Cg($g,r);e===u?u=_v(xv(r,i)):(null!=u?i.insertBefore(e,u):i.appendChild(e),xv(r,i)),d++,f++}else pv(r,i,u),f++;else u=_v(Sv(e)),lv(e,i),d++}const o=Jg.get(r);null!==o&&my(o)&&(null===nv&&(nv=o.getFormat()),""===rv&&(rv=o.getStyle()))}const h=d>s,p=f>a;if(h&&!p){const t=n[a+1];mv(n,e,f,a,i,void 0===t?null:$g.getElementByKey(t))}else p&&!h&&cv(t,d,s,i)}(t,r,s,o,i,n)}Eg(t)&&(ev+=lm),n.__lexicalTextContent=ev,ev=r+ev}(e,t,n),yv(t,n),Tb(o=t)&&null!=nv&&nv!==o.__textFormat&&!sv&&(o.setTextFormat(nv),o.setTextStyle(rv)),function(e){Tb(e)&&""!==rv&&rv!==e.__textStyle&&!sv&&e.setTextStyle(rv)}(t),tv=r}(n,r,i),bb(r)||r.isInline()||vv(n,r,i)),Eg(r)&&(ev+=lm,ov+=lm)}else{const t=r.getTextContent();if(vb(r)){const t=r.decorate($g,Kg);null!==t&&wv(e,t)}else my(r)&&!r.isDirectionless()&&(tv+=t);ev+=t,ov+=t}if(!sv&&bb(r)&&r.__cachedText!==ov){const e=r.getWritable();e.__cachedText=ov,r=e}return i}function wv(e,t){let n=$g._pendingDecorators;const r=$g._decorators;if(null===n){if(r[e]===t)return;n=Qm($g)}n[e]=t}function _v(e){let t=e.nextSibling;return null!==t&&t===$g._blockCursorElement&&(t=t.nextSibling),t}function Sv(e){const t=Zg.get(e);return void 0===t&&wm(75,e),t}const kv=Object.freeze({}),Ev=[["keydown",function(e,t){if(Cv=e.timeStamp,Tv=e.key,t.isComposing())return;const{key:n,shiftKey:r,ctrlKey:o,metaKey:i,altKey:s}=e;kg(t,ap,e)||null!=n&&(function(e,t,n,r){return hg(e)&&!t&&!r&&!n}(n,o,s,i)?kg(t,lp,e):function(e,t,n,r,o){return hg(e)&&!r&&!n&&(t||o)}(n,o,r,s,i)?kg(t,cp,e):function(e,t,n,r){return fg(e)&&!t&&!r&&!n}(n,o,s,i)?kg(t,up,e):function(e,t,n,r,o){return fg(e)&&!r&&!n&&(t||o)}(n,o,r,s,i)?kg(t,dp,e):function(e,t,n){return function(e){return"ArrowUp"===e}(e)&&!t&&!n}(n,o,i)?kg(t,fp,e):function(e,t,n){return function(e){return"ArrowDown"===e}(e)&&!t&&!n}(n,o,i)?kg(t,hp,e):function(e,t){return mg(e)&&t}(n,r)?(Mv=!0,kg(t,pp,e)):function(e){return" "===e}(n)?kg(t,mp,e):function(e,t){return jp&&t&&"o"===e.toLowerCase()}(n,o)?(e.preventDefault(),Mv=!0,kg(t,Jh,!0)):function(e,t){return mg(e)&&!t}(n,r)?(Mv=!1,kg(t,pp,e)):function(e,t,n,r){return jp?!t&&!n&&(gg(e)||"h"===e.toLowerCase()&&r):!(r||t||n)&&gg(e)}(n,s,i,o)?gg(n)?kg(t,gp,e):(e.preventDefault(),kg(t,Gh,!0)):function(e){return"Escape"===e}(n)?kg(t,vp,e):function(e,t,n,r,o){return jp?!(n||r||o)&&(vg(e)||"d"===e.toLowerCase()&&t):!(t||r||o)&&vg(e)}(n,o,r,s,i)?vg(n)?kg(t,yp,e):(e.preventDefault(),kg(t,Gh,!1)):function(e,t,n){return gg(e)&&(jp?t:n)}(n,s,o)?(e.preventDefault(),kg(t,np,!0)):function(e,t,n){return vg(e)&&(jp?t:n)}(n,s,o)?(e.preventDefault(),kg(t,np,!1)):function(e,t){return jp&&t&&gg(e)}(n,i)?(e.preventDefault(),kg(t,rp,!0)):function(e,t){return jp&&t&&vg(e)}(n,i)?(e.preventDefault(),kg(t,rp,!1)):function(e,t,n,r){return"b"===e.toLowerCase()&&!t&&pg(n,r)}(n,s,i,o)?(e.preventDefault(),kg(t,op,"bold")):function(e,t,n,r){return"u"===e.toLowerCase()&&!t&&pg(n,r)}(n,s,i,o)?(e.preventDefault(),kg(t,op,"underline")):function(e,t,n,r){return"i"===e.toLowerCase()&&!t&&pg(n,r)}(n,s,i,o)?(e.preventDefault(),kg(t,op,"italic")):function(e,t,n,r){return"Tab"===e&&!t&&!n&&!r}(n,s,o,i)?kg(t,bp,e):function(e,t,n,r){return"z"===e.toLowerCase()&&!t&&pg(n,r)}(n,r,i,o)?(e.preventDefault(),kg(t,ip,void 0)):function(e,t,n,r){return jp?"z"===e.toLowerCase()&&n&&t:"y"===e.toLowerCase()&&r||"z"===e.toLowerCase()&&r&&t}(n,r,i,o)?(e.preventDefault(),kg(t,sp,void 0)):Ty(t._editorState._selection)?function(e,t,n,r){return!t&&"c"===e.toLowerCase()&&(jp?n:r)}(n,r,i,o)?(e.preventDefault(),kg(t,kp,e)):function(e,t,n,r){return!t&&"x"===e.toLowerCase()&&(jp?n:r)}(n,r,i,o)?(e.preventDefault(),kg(t,Ep,e)):yg(n,i,o)&&(e.preventDefault(),kg(t,Cp,e)):!Lp&&yg(n,i,o)&&(e.preventDefault(),kg(t,Cp,e)),function(e,t,n,r){return e||t||n||r}(o,r,s,i)&&kg(t,Mp,e))}],["pointerdown",function(e,t){const n=e.target,r=e.pointerType;n instanceof Node&&"touch"!==r&&fb(t,(()=>{vb(Zm(n))||(Nv=!0)}))}],["compositionstart",function(e,t){fb(t,(()=>{const n=Fy();if(Ey(n)&&!t.isComposing()){const r=n.anchor,o=n.anchor.getNode();Ym(r.key),(e.timeStamp{zv(t,e.data)}))}],["input",function(e,t){e.stopPropagation(),fb(t,(()=>{const n=Fy(),r=e.data,o=Vv(e);if(null!=r&&Ey(n)&&jv(n,o,r,e.timeStamp,!1)){Dv&&(zv(t,r),Dv=!1);const o=n.anchor.getNode(),i=_n(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;Fp&&!n.isCollapsed()&&my(o)&&null!==i.anchorNode&&o.getTextContent().slice(0,a)+r+o.getTextContent().slice(a+l)===cg(i.anchorNode)||kg(t,Qh,r);const c=r.length;Lp&&c>1&&"insertCompositionText"===e.inputType&&!t.isComposing()&&(n.anchor.offset-=c),Vp||zp||Kp||!t.isComposing()||(Cv=0,Ym(null))}else ug(!1,t,null!==r?r:void 0),Dv&&(zv(t,r||void 0),Dv=!1);Qy(),Am(nb())})),Rv=null}],["click",function(e,t){fb(t,(()=>{const n=Fy(),r=_n(t._window),o=Vy();if(r)if(Ey(n)){const t=n.anchor,i=t.getNode();"element"===t.type&&0===t.offset&&n.isCollapsed()&&!bb(i)&&1===tg().getChildrenSize()&&i.getTopLevelElementOrThrow().isEmpty()&&null!==o&&n.is(o)?(r.removeAllRanges(),n.dirty=!0):3!==e.detail||n.isCollapsed()||i!==n.focus.getNode()&&(pb(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!==$p&&i!==Hp||rg(Ly(o,r,t,e))}}kg(t,Xh,e)}))}],["cut",kv],["copy",kv],["dragstart",kv],["dragover",kv],["dragend",kv],["paste",kv],["focus",kv],["blur",kv],["drop",kv]];Fp&&Ev.push(["beforeinput",(e,t)=>function(e,t){const n=e.inputType,r=Vv(e);"deleteCompositionText"===n||Lp&&Sg(t)||"insertCompositionText"!==n&&fb(t,(()=>{const o=Fy();if("deleteContentBackward"===n){if(null===o){const e=Vy();if(!Ey(e))return;rg(e.clone())}if(Ey(o)){const n=o.anchor.key===o.focus.key;if(i=e.timeStamp,"MediaLast"===Tv&&i{fb(t,(()=>{Ym(null)}))}),30),Ey(o)){const e=o.anchor.getNode();e.markDirty(),o.format=e.getFormat(),my(e)||wm(142),o.style=e.getStyle()}}else{Ym(null),e.preventDefault();const r=o.anchor.getNode().getTextContent(),i=0===o.anchor.offset&&o.focus.offset===r.length;Up&&n&&!i||kg(t,Gh,!0)}return}}var i;if(!Ey(o))return;const s=e.data;null!==Rv&&ug(!1,t,Rv),o.dirty&&null===Rv||!o.isCollapsed()||bb(o.anchor.getNode())||null===r||o.applyDOMRange(r),Rv=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":kg(t,Qh,e);break;case"insertFromComposition":Ym(null),kg(t,Qh,e);break;case"insertLineBreak":Ym(null),kg(t,Jh,!1);break;case"insertParagraph":Ym(null),Mv&&!zp?(Mv=!1,kg(t,Jh,!1)):kg(t,Zh,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":kg(t,ep,e);break;case"deleteByComposition":(function(e,t){return e!==t||pb(e)||pb(t)||!e.isToken()||!t.isToken()})(c,u)&&kg(t,tp,e);break;case"deleteByDrag":case"deleteByCut":kg(t,tp,e);break;case"deleteContent":kg(t,Gh,!1);break;case"deleteWordBackward":kg(t,np,!0);break;case"deleteWordForward":kg(t,np,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":kg(t,rp,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":kg(t,rp,!1);break;case"formatStrikeThrough":kg(t,op,"strikethrough");break;case"formatBold":kg(t,op,"bold");break;case"formatItalic":kg(t,op,"italic");break;case"formatUnderline":kg(t,op,"underline");break;case"historyUndo":kg(t,ip,void 0);break;case"historyRedo":kg(t,sp,void 0)}else{if("\n"===s)e.preventDefault(),kg(t,Jh,!1);else if(s===lm)e.preventDefault(),kg(t,Zh,void 0);else if(null==s&&e.dataTransfer){const t=e.dataTransfer.getData("text/plain");e.preventDefault(),o.insertRawText(t)}else null!=s&&jv(o,r,s,e.timeStamp,!0)?(e.preventDefault(),kg(t,Qh,s)):Rv=s;Pv=e.timeStamp}}))}(e,t)]);let Cv=0,Tv=null,Pv=0,Rv=null;const Ov=new WeakMap;let Av=!1,Nv=!1,Mv=!1,Dv=!1,Iv=[0,"",0,"root",0];function jv(e,t,n,r,o){const i=e.anchor,s=e.focus,a=i.getNode(),l=nb(),c=_n(l._window),u=null!==c?c.anchorNode:null,d=i.key,f=l.getElementByKey(d),h=n.length;return d!==s.key||!my(a)||(!o&&(!Fp||Pv1||(o||!Fp)&&null!==f&&!a.isComposing()&&u!==Km(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(my(t)||pb(t)&&t.isInline())&&!t.canInsertTextAfter()}(t):n===t.getTextContentSize()&&(!t.canInsertTextAfter()||!r.canInsertTextAfter()&&!t.isComposing()||o)}(e,a)}function Lv(e,t){return null!==e&&null!==e.nodeValue&&e.nodeType===Hp&&0!==t&&t!==e.nodeValue.length}function Fv(e,t,n){const{anchorNode:r,anchorOffset:o,focusNode:i,focusOffset:s}=e;Av&&(Av=!1,Lv(r,o)&&Lv(i,s))||fb(t,(()=>{if(!n)return void rg(null);if(!zm(t,r,i))return;const a=Fy();if(Ey(a)){const n=a.anchor,r=n.getNode();if(a.isCollapsed()){"Range"===e.type&&e.anchorNode===e.focusNode&&(a.dirty=!0);const o=Rg(t).event,i=o?o.timeStamp:performance.now(),[s,l,c,u,d]=Iv,f=tg(),h=!1===t.isComposing()&&""===f.getTextContent();if(i{const t=Vy(),o=n.anchorNode;if(null===o)return;const i=o.nodeType;i!==$p&&i!==Hp||rg(Ly(t,n,r,e))})));const o=ag(r),i=o[o.length-1],s=i._key,a=Wv.get(s),l=a||i;l!==r&&Fv(n,l,!1),Fv(n,r,!0),r!==i?Wv.set(s,r):a&&Wv.delete(s)}function Kv(e){e._lexicalHandled=!0}function $v(e){return!0===e._lexicalHandled}function Hv(e,t,n){Qy();const r=e.__key,o=e.getParent();if(null===o)return;const i=function(e){const t=Fy();if(!Ey(t)||!pb(e))return t;const{anchor:n,focus:r}=t,o=n.getNode(),i=r.getNode();return Pg(o,e)&&n.set(e.__key,0,"element"),Pg(i,e)&&r.set(e.__key,0,"element"),t}(e);let s=!1;if(Ey(i)&&t){const t=i.anchor,n=i.focus;t.key===r&&(Wy(t,e,o,e.getPreviousSibling(),e.getNextSibling()),s=!0),n.key===r&&(Wy(n,e,o,e.getPreviousSibling(),e.getNextSibling()),s=!0)}else Ty(i)&&t&&e.isSelected()&&e.selectPrevious();if(Ey(i)&&t&&!s){const t=e.getIndexWithinParent();Hm(e),zy(i,o,t,-1)}else Hm(e);n||Og(o)||o.canBeEmpty()||!o.isEmpty()||Hv(o,t),t&&bb(o)&&o.isEmpty()&&o.selectEnd()}class qv{static getType(){wm(64,this.name)}static clone(e){wm(65,this.name)}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);Qy(),eb();const n=nb(),r=tb(),o=""+Lm++;r._nodeMap.set(o,e),pb(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(){wm(137,this.constructor.name)}isAttached(){let e=this.__key;for(;null!==e;){if("root"===e)return!0;const t=Gm(e);if(null===t)break;e=t.__parent}return!1}isSelected(e){const t=e||Fy();if(null==t)return!1;const n=t.getNodes().some((e=>e.__key===this.__key));if(my(this))return n;if(Ey(t)&&"element"===t.anchor.type&&"element"===t.focus.type){if(t.isCollapsed())return!1;const e=this.getParent();if(vb(this)&&this.isInline()&&e){const{anchor:n,focus:r}=t;if(n.isBefore(r)){const t=n.getNode(),r=n.offset===t.getChildrenSize(),o=t.is(e),i=t.getLastChildOrThrow().is(this);if(r&&o&&i)return!1}else{const t=r.getNode(),n=r.offset===t.getChildrenSize(),o=t.is(e),i=t.getLastChildOrThrow().is(this);if(n&&o&&i)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:Gm(e)}getParentOrThrow(){const e=this.getParent();return null===e&&wm(66,this.__key),e}getTopLevelElement(){let e=this;for(;null!==e;){const t=e.getParent();if(Og(t))return pb(e)||e===this&&vb(e)||wm(194),e;e=t}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();return null===e&&wm(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:Gm(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:Gm(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();pb(this)&&t.unshift(this),pb(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)}))),Ey(n)){rg(n);const e=n.anchor,t=n.focus;e.key===o&&_y(e,s),t.key===o&&_y(t,s)}return Xm()===o&&Ym(i),s}insertAfter(e,t=!0){Qy(),Ng(this,e);const n=this.getWritable(),r=e.getWritable(),o=r.getParent(),i=Fy();let s=!1,a=!1;if(null!==o){const t=e.getIndexWithinParent();if(Hm(r),Ey(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&&Ey(i)){const e=this.getIndexWithinParent();zy(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){Qy(),Ng(this,e);const n=this.getWritable(),r=e.getWritable(),o=r.__key;Hm(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=Fy();return t&&Ey(c)&&zy(c,this.getParentOrThrow(),l),e}isParentRequired(){return!1}createParentElementNode(){return Cb()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){Qy();const n=this.getPreviousSibling(),r=this.getParentOrThrow();if(null===n)return r.select(0,0);if(pb(n))return n.select();if(!my(n)){const e=n.getIndexWithinParent()+1;return r.select(e,e)}return n.select(e,t)}selectNext(e,t){Qy();const n=this.getNextSibling(),r=this.getParentOrThrow();if(null===n)return r.select();if(pb(n))return n.select(0,0);if(!my(n)){const e=n.getIndexWithinParent();return r.select(e,e)}return n.select(e,t)}markDirty(){this.getWritable()}}class Yv extends qv{static getType(){return"linebreak"}static clone(e){return new Yv(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&&Lg(t)){const n=t.firstChild;if(n===e||n.nextSibling===e&&Zv(n)){const n=t.lastChild;if(n===e||n.previousSibling===e&&Zv(n))return!0}}return!1}(e)||function(e){const t=e.parentElement;if(null!==t&&Lg(t)){const n=t.firstChild;if(n===e||n.nextSibling===e&&Zv(n))return!1;const r=t.lastChild;if(r===e||r.previousSibling===e&&Zv(r))return!0}return!1}(e)?null:{conversion:Xv,priority:0}}}static importJSON(e){return Gv()}exportJSON(){return{type:"linebreak",version:1}}}function Xv(e){return{node:Gv()}}function Gv(){return Ag(new Yv)}function Jv(e){return e instanceof Yv}function Zv(e){return e.nodeType===Hp&&/^( |\t|\r?\n)+$/.test(e.textContent||"")}function Qv(e,t){return 16&t?"code":128&t?"mark":32&t?"sub":64&t?"sup":null}function ey(e,t){return 1&t?"strong":2&t?"em":"span"}function ty(e,t,n,r,o){const i=r.classList;let s=bg(o,"base");void 0!==s&&i.add(...s),s=bg(o,"underlineStrikethrough");let a=!1;const l=t&Qp&&t&Zp;void 0!==s&&(n&Qp&&n&Zp?(a=!0,l||i.add(...s)):l&&i.remove(...s));for(const e in pm){const r=pm[e];if(s=bg(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 ny(e,t,n){const r=t.firstChild,o=n.isComposing(),i=e+(o?am:"");if(null==r)t.textContent=i;else{const e=r.nodeValue;if(e!==i)if(o||Lp){const[t,n,o]=function(e,t){const n=e.length,r=t.length;let o=0,i=0;for(;o({conversion:uy,priority:0}),b:()=>({conversion:ay,priority:0}),code:()=>({conversion:hy,priority:0}),em:()=>({conversion:hy,priority:0}),i:()=>({conversion:hy,priority:0}),s:()=>({conversion:hy,priority:0}),span:()=>({conversion:sy,priority:0}),strong:()=>({conversion:hy,priority:0}),sub:()=>({conversion:hy,priority:0}),sup:()=>({conversion:hy,priority:0}),u:()=>({conversion:hy,priority:0})}}static importJSON(e){const t=py(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&&Ig(t)||wm(132),t.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(t=oy(t,"b")),this.hasFormat("italic")&&(t=oy(t,"i")),this.hasFormat("strikethrough")&&(t=oy(t,"s")),this.hasFormat("underline")&&(t=oy(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?mm[e]:e,t}setStyle(e){const t=this.getWritable();return t.__style=e,t}toggleFormat(e){const t=$m(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=ym[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){Qy();let n=e,r=t;const o=Fy(),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(!Ey(o))return Iy(s,n,s,r,"text","text");{const e=Xm();e!==o.anchor.key&&e!==o.focus.key||Ym(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=Fy();if(r&&Ey(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){Qy();const t=this.getLatest(),n=t.getTextContent(),r=t.__key,o=Xm(),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&&Ym(a),b=l,y.push(i)}!function(e){const t=e.getPreviousSibling(),n=e.getNextSibling();null!==t&&qm(t),null!==n&&qm(n)}(this);const x=d.getWritable(),w=this.getIndexWithinParent();return g?(x.splice(w,0,y),this.remove()):x.splice(w,1,y),Ey(v)&&zy(v,d,w,c-1),y}mergeWithSibling(e){const t=e===this.getPreviousSibling();t||e===this.getNextSibling()||wm(50);const n=this.__key,r=e.__key,o=this.__text,i=o.length;Xm()===r&&Ym(n);const s=Fy();if(Ey(s)){const o=s.anchor,a=s.focus;null!==o&&o.key===r&&(Uy(o,t,n,e,i),s.dirty=!0),null!==a&&a.key===r&&(Uy(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 sy(e){return{forChild:gy(e.style),node:null}}function ay(e){const t=e,n="normal"===t.style.fontWeight;return{forChild:gy(t.style,n?void 0:"bold"),node:null}}const ly=new WeakMap;function cy(e){return"PRE"===e.nodeName||e.nodeType===$p&&void 0!==e.style&&void 0!==e.style.whiteSpace&&e.style.whiteSpace.startsWith("pre")}function uy(e){const t=e;null===e.parentElement&&wm(129);let n=t.textContent||"";if(null!==function(e){let t,n=e.parentNode;const r=[e];for(;null!==n&&void 0===(t=ly.get(n))&&!cy(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=dy(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:py(n)}}function dy(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===$p){const e=n.style.display;if(""===e&&!jg(n)||""!==e&&!e.startsWith("inline"))return null}let r=n;for(;null!==(r=t?n.firstChild:n.lastChild);)n=r;if(n.nodeType===Hp)return n;if("BR"===n.nodeName)return null}}const fy={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function hy(e){const t=fy[e.nodeName.toLowerCase()];return void 0===t?{node:null}:{forChild:gy(e.style,t),node:null}}function py(e=""){return Ag(new iy(e))}function my(e){return e instanceof iy}function gy(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=>my(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 vy extends iy{static getType(){return"tab"}static clone(e){const t=new vy(e.__key);return t.__text=e.__text,t.__format=e.__format,t.__style=e.__style,t}constructor(e){super("\t",e),this.__detail=2}static importDOM(){return null}static importJSON(e){const t=yy();return t.setFormat(e.format),t.setStyle(e.style),t}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(e){wm(126)}setDetail(e){wm(127)}setMode(e){wm(128)}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function yy(){return Ag(new vy)}class by{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(pb(t)){const e=t.getDescendantByIndex(r);t=null!=e?e:t}if(pb(n)){const e=n.getDescendantByIndex(o);n=null!=e?e:n}return t===n?re&&(r=e)}else if(!pb(t)){const e=t.getNextSibling();if(my(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 _y(e,t){if(pb(t)){const n=t.getLastDescendant();pb(n)||my(n)?wy(e,n):wy(e,t)}else wy(e,t)}function Sy(e,t,n,r){e.key=t,e.offset=n,e.type=r}class ky{constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!Ty(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 ky(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(my(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),Zy()||(this._cachedNodes=u),u}setTextNodeRange(e,t,n,r){Sy(this.anchor,e.__key,t,"text"),Sy(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]=Ry(this);let l="",c=!0;for(let u=0;u=0;e--){const t=i[e];if(t.is(d)||pb(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=py(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()||Wm(p)||([p]=p.splitText(m)),p.setFormat(g));for(let t=c+1;t(pb(e)||vb(e))&&!e.isInline()))){pb(t)||wm(135);const r=Ky(this);return t.splice(r,0,e),void n.selectEnd()}const r=function(e){const t=Cb();let n=null;for(let r=0;r"__value"in e&&"__checked"in e,a=pb(t)&&t.isEmpty()?null:this.insertParagraph(),l=i[i.length-1];let c=i[0];var u;pb(u=c)&&Fg(u)&&!u.isEmpty()&&pb(t)&&(!t.isEmpty()||s(t))&&(pb(t)||wm(135),t.append(...c.getChildren()),c=i[1]),c&&function(e,t){const n=t.getParentOrThrow().getLastChild();let r=t;const o=[t];for(;r!==n;)r.getNextSibling()||wm(140),r=r.getNextSibling(),o.push(r);let i=e;for(const e of o)i=i.insertAfter(e)}(t,c);const d=Vg(o,Fg);a&&pb(d)&&(s(a)||Fg(l))&&(d.append(...a.getChildren()),a.remove()),pb(t)&&t.isEmpty()&&t.remove(),o.selectEnd();const f=pb(t)?t.getLastChild():null;Jv(f)&&d!==t&&f.remove()}insertParagraph(){if("root"===this.anchor.key){const e=Cb();return tg().splice(this.anchor.offset,0,[e]),e.select(),e}const e=Ky(this),t=Vg(this.anchor.getNode(),Fg);pb(t)||wm(136);const n=t.getChildAtIndex(e),r=n?[n,...n.getNextSiblings()]:[],o=t.insertNewAfter(this,!1);return o?(o.append(...r),o.selectStart(),o):null}insertLineBreak(e){const t=Gv();if(this.insertNodes([t]),e){const e=t.getParentOrThrow(),n=t.getIndexWithinParent();e.select(n,n)}}extract(){const e=this.getNodes(),t=e.length,n=t-1,r=this.anchor,o=this.focus;let i=e[0],s=e[n];const[a,l]=Ry(this);if(0===t)return[];if(1===t){if(my(i)&&!this.isCollapsed()){const e=a>l?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(my(i)){const t=c?a:l;t===i.getTextContentSize()?e.shift():0!==t&&([,i]=i.splitText(t),e[0]=i)}if(my(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=_g(r,t);if(vb(s)&&!s.isIsolated()){if(i&&s.isKeyboardSelectable()){const e=jy();return e.add(s.__key),void rg(e)}const e=t?s.getPreviousSibling():s.getNextSibling();if(my(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 pb(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=nb(),l=_n(a._window);if(!l)return;const c=a._blockCursorElement,u=a._rootElement;if(null===u||null===c||!pb(s)||s.isInline()||s.canBeEmpty()||Dg(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=bb(n)?n:function(e){let t=e.getParentOrThrow();for(;null!==t;){if(Og(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];pb(e)?e.selectStart():e.getParentOrThrow().selectStart()}else{const e=o[o.length-1];pb(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;Sy(n,t.key,t.offset,t.type),Sy(t,r,o,i),e._cachedNodes=null}(this)}}}forwardDeletion(e,t,n){if(!n&&("element"===e.type&&pb(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(pb(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=_g(r,e);if(vb(o)&&!o.isIsolated()){if(o.isKeyboardSelectable()&&pb(n)&&0===n.getChildrenSize()){n.remove();const e=jy();e.add(o.__key),rg(e)}else o.remove(),nb().dispatchCommand(Yh,void 0);return}if(!e&&pb(o)&&pb(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 Oy(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 Oy(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 Ay(e,t,n,r){let o,i=t;if(e.nodeType===$p){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=og(u),my(o))i=ig(o,s);else{let r=og(e);if(null===r)return null;if(pb(r)){i=Math.min(r.getChildrenSize(),i);let e=r.getChildAtIndex(i);if(pb(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=pb(e)?e:e.getParentOrThrow()),i=0}my(e)?(o=e,r=null,i=ig(e,s)):e!==r&&s&&!d&&i++}else{const n=r.getIndexWithinParent();i=0===t&&vb(r)&&og(e)===r?n:n+1,r=r.getParentOrThrow()}if(pb(r))return xy(r.__key,i,"element")}}else o=og(e);return my(o)?xy(o.__key,i,"text"):null}function Ny(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&&pb(i)&&i.isInline()){const t=i.getPreviousSibling();my(t)&&(e.key=t.__key,e.offset=t.getTextContent().length)}}else pb(r)&&!n&&r.isInline()?(e.key=r.__key,e.offset=r.getChildrenSize(),e.type="element"):my(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&&pb(r)&&r.isInline())e.key=r.__key,e.offset=0,e.type="element";else if((n||t)&&null===r&&pb(i)&&i.isInline()&&!i.canInsertTextAfter()){const t=i.getNextSibling();my(t)&&(e.key=t.__key,e.offset=0)}}}function My(e,t,n){if("text"===e.type&&"text"===t.type){const r=e.isBefore(t),o=e.is(t);Ny(e,r,o),Ny(t,!r,o),o&&(t.key=e.key,t.offset=e.offset,t.type=e.type);const i=nb();if(i.isComposing()&&i._compositionKey!==e.key&&Ey(n)){const r=n.anchor,o=n.focus;Sy(e,r.key,r.offset,r.type),Sy(t,o.key,o.offset,o.type)}}}function Dy(e,t,n,r,o,i){if(null===e||null===n||!zm(o,e,n))return null;const s=Ay(e,t,Ey(i)?i.anchor:null,o);if(null===s)return null;const a=Ay(n,r,Ey(i)?i.focus:null,o);if(null===a)return null;if("element"===s.type&&"element"===a.type){const t=og(e),r=og(n);if(vb(t)&&vb(r))return null}return My(s,a,i),[s,a]}function Iy(e,t,n,r,o,i){const s=tb(),a=new Cy(xy(e,t,o),xy(n,r,i),0,"");return a.dirty=!0,s._selection=a,a}function jy(){return new ky(new Set)}function Ly(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=!km&&(a||"beforeinput"===s||"compositionstart"===s||"compositionend"===s||"click"===s&&i&&3===i.detail||"drop"===s||void 0===s);let c,u,d,f;if(Ey(e)&&!l)return e.clone();if(null===t)return null;if(c=t.anchorNode,u=t.focusNode,d=t.anchorOffset,f=t.focusOffset,a&&Ey(e)&&!zm(n,c,u))return e.clone();const h=Dy(c,d,u,f,n,e);if(null===h)return null;const[p,m]=h;return new Cy(p,m,Ey(e)?e.format:0,Ey(e)?e.style:"")}function Fy(){return tb()._selection}function Vy(){return nb()._editorState._selection}function zy(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(my(s)){let e=0;o&&(e=s.getTextContentSize()),t.set(s.__key,e,"text"),r.set(s.__key,e,"text")}}else{if(pb(i)){const e=i.getChildrenSize(),r=n>=e,o=r?i.getChildAtIndex(e-1):i.getChildAtIndex(n);if(my(o)){let e=0;r&&(e=o.getTextContentSize()),t.set(o.__key,e,"text")}}if(pb(s)){const e=s.getChildrenSize(),t=o>=e,n=t?s.getChildAtIndex(e-1):s.getChildAtIndex(o);if(my(n)){let e=0;t&&(e=n.getTextContentSize()),r.set(n.__key,e,"text")}}}}function Wy(e,t,n,r,o){let i=null,s=0,a=null;null!==r?(i=r.__key,my(r)?(s=r.getTextContentSize(),a="text"):pb(r)&&(s=r.getChildrenSize(),a="element")):null!==o&&(i=o.__key,my(o)?a="text":pb(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 Uy(e,t,n,r,o){"text"===e.type?(e.key=n,t||(e.offset+=o)):e.offset>r.getIndexWithinParent()&&(e.offset-=1)}function Ky(e){let t=e;e.isCollapsed()||t.removeText();const n=Fy();Ey(n)&&(t=n),Ey(t)||wm(161);const r=t.anchor;let o=r.getNode(),i=r.offset;for(;!Fg(o);)[o,i]=$y(o,i);return i}function $y(e,t){const n=e.getParent();if(!n){const e=Cb();return tg().append(e),e.select(),[tg(),0]}if(my(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(!pb(e)||0===t)return[n,e.getIndexWithinParent()];const r=e.getChildAtIndex(t);if(r){const n=new Cy(xy(e.__key,t,"element"),xy(e.__key,t,"element"),0,""),o=e.insertNewAfter(n);o&&o.append(r,...r.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}let Hy=null,qy=null,Yy=!1,Xy=!1,Gy=0;const Jy={characterData:!0,childList:!0,subtree:!0};function Zy(){return Yy||null!==Hy&&Hy._readOnly}function Qy(){Yy&&wm(13)}function eb(){Gy>99&&wm(14)}function tb(){return null===Hy&&wm(189),Hy}function nb(){return null===qy&&wm(190),qy}function rb(e,t,n){const r=t.__type,o=function(e,t){const n=e._nodes.get(t);return void 0===n&&wm(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=Rg(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=Tg(c)}}(n,t,i)}}Av=!0}}(s,a,e,x,y,r)}(function(e,t,n){let r=e._blockCursorElement;if(Ey(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())Mg(i.getChildAtIndex(s-1))&&(a=!0);else{const t=i.getChildAtIndex(s);if(Mg(t)){const n=t.getPreviousSibling();(null===n||Mg(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=_m(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&&Dg(r,e,t)})(e,r,a),null!==h&&h.observe(r,Jy)}finally{qy=d,Hy=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=ag(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);my(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&Im(r),void 0!==r&&ob(r,i)&&rb(t,r,s),n.add(e)}if(a=t._dirtyLeaves,l=a.size,l>0){Gy++;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&&ob(l,i)&&rb(t,l,s),r.set(n,a)}a=t._dirtyLeaves,l=a.size,c=t._dirtyElements,u=c.size,Gy++}t._dirtyLeaves=n,t._dirtyElements=r}(c,e),ub(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()||(pb(t)&&Ug(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(Ey(r)){const e=c._nodeMap,t=r.anchor.key,n=r.focus.key;void 0!==e.get(t)&&void 0!==e.get(n)||wm(19)}else Ty(r)&&0===r._nodes.size&&(c._selection=null)}catch(t){return t instanceof Error&&e._onError(t),e._pendingEditorState=l,e._dirtyType=Yp,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),void ab(e)}finally{Hy=d,Yy=f,qy=h,e._updating=p,Gy=0}const m=e._dirtyType!==qp||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,ab(e)):u&&Fm((()=>{ab(e)})):(c._flushSync=!1,u&&(r.clear(),e._deferred=[],e._pendingEditorState=null))}function fb(e,t,n){e._updating?e._updates.push([t,n]):db(e,t,n)}class hb extends qv{constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null}getFormat(){return this.getLatest().__format}getFormatType(){const e=this.getFormat();return vm[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=nb()._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(my(t)&&e.push(t),pb(t)){const n=t.getAllTextNodes();e.push(...n)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;pb(e);){const t=e.getFirstChild();if(null===t)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;pb(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 pb(e)&&e.getLastDescendant()||e||null}const r=t[e];return pb(r)&&r.getFirstDescendant()||r||null}getFirstChild(){const e=this.getLatest().__first;return null===e?null:Gm(e)}getFirstChildOrThrow(){const e=this.getFirstChild();return null===e&&wm(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return null===e?null:Gm(e)}getLastChildOrThrow(){const e=this.getLastChild();return null===e&&wm(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?gm[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:wb(tg())})))}}class Sb extends hb{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class kb extends hb{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 kb(e.__key)}createDOM(e){const t=document.createElement("p"),n=bg(e.theme,"paragraph");return void 0!==n&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}static importDOM(){return{p:e=>({conversion:Eb,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&Ig(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=Cb();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=Cb();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||my(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 Eb(e){const t=Cb();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 Cb(){return Ag(new kb)}function Tb(e){return e instanceof kb}const Pb=1;function Rb(e,t,n,r){const o=e._keyToDOMMap;o.clear(),e._editorState=xb(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=qp,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 Ob{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=qp,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=lg(),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&&wm(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&&wm(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&&wm(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 Bg;e._readOnly||wm(192);let t=zg.get(e);if(!t){t=new Map,zg.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(),fb(this,(()=>{const e=tb();if(e.isEmpty())return;if("root"===i)return void tg().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 kg(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=bg(this._config.theme,"root"),r=this._pendingEditorState||this._editorState;if(this._rootElement=e,Rb(this,t,e,r),null!==t&&(this._config.disableEvents||function(e){const t=e.ownerDocument,n=Ov.get(t);void 0===n&&wm(162);const r=n-1;r>=0||wm(164),Ov.set(t,r),0===r&&t.removeEventListener("selectionchange",Uv);const o=e.__lexicalEditor;null!=o&&(function(e){if(null!==e._parentEditor){const t=ag(e),n=t[t.length-1]._key;Wv.get(n)===e&&Wv.delete(n)}else Wv.delete(e._key)}(o),e.__lexicalEditor=null);const i=Bv(e);for(let e=0;e{$v(e)||(Kv(e),(t.isEditable()||"click"===r)&&i(e,t))}:e=>{if($v(e))return;Kv(e);const n=t.isEditable();switch(r){case"cut":return n&&kg(t,Ep,e);case"copy":return kg(t,kp,e);case"paste":return n&&kg(t,ep,e);case"dragstart":return n&&kg(t,wp,e);case"dragover":return n&&kg(t,_p,e);case"dragend":return n&&kg(t,Sp,e);case"focus":return n&&kg(t,Ap,e);case"blur":return n&&kg(t,Np,e);case"drop":return n&&kg(t,xp,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;lb("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&wm(38),Am(this);const n=this._pendingEditorState,r=this._updateTags,o=void 0!==t?t.tag:null;null===n||n.isEmpty()||(null!=o&&r.add(o),ab(this)),this._pendingEditorState=e,this._dirtyType=Yp,this._dirtyElements.set("root",!1),this._compositionKey=null,null!=o&&r.add(o),ab(this)}parseEditorState(e,t){return function(e,t,n){const r=xb(),o=Hy,i=Yy,s=qy,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,Hy=r,Yy=!1,qy=t;try{const o=t._nodes;ib(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,Hy=o,Yy=i,qy=s}return r}("string"==typeof e?JSON.parse(e):e,this,t)}read(e){return ab(this),this.getEditorState().read(e,{editor:this})}update(e,t){fb(this,e,t)}focus(e,t={}){const n=this._rootElement;null!==n&&(n.setAttribute("autocapitalize","off"),fb(this,(()=>{const e=Fy(),n=tg();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=_n(this._window);null!==t&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,lb("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}const Ab="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Nb=Ab?re.useLayoutEffect:re.useEffect,Mb={tag:"history-merge"};function Db({initialConfig:e,children:t}){const n=(0,re.useMemo)((()=>{const{theme:t,namespace:n,editor__DEPRECATED:r,nodes:o,onError:i,editorState:s,html:a}=e,l=function(e,t){let n=null;return{getTheme:function(){return null!=t?t:null!=n?n.getTheme():null}}}(0,t);let c=r||null;if(null===c){const r=function(e){const t=e||{},n=qy,r=t.theme||{},o=void 0===e?n:t.parentEditor||null,i=t.disableEvents||!1,s=xb(),a=t.namespace||(null!==o?o._config.namespace:lg()),l=t.editorState,c=[yb,iy,Yv,vy,kb,Sb,...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=Yp),p}({editable:e.editable,html:a,namespace:n,nodes:o,onError:e=>i(e,r),theme:t});!function(e,t){if(null!==t)if(void 0===t)e.update((()=>{const t=tg();if(t.isEmpty()){const n=Cb();t.append(n);const r=Ab?document.activeElement:null;(null!==Fy()||null!==r&&r===e.getRootElement())&&n.select()}}),Mb);else if(null!==t)switch(typeof t){case"string":{const n=e.parseEditorState(t);e.setEditorState(n,Mb);break}case"object":e.setEditorState(t,Mb);break;case"function":e.update((()=>{tg().isEmpty()&&t(e)}),Mb)}}(r,s),c=r}return[c,l]}),[]);return Nb((()=>{const t=e.editable,[r]=n;r.setEditable(void 0===t||t)}),[]),(0,ti.jsx)($h.Provider,{value:n,children:t})}const Ib="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?re.useLayoutEffect:re.useEffect;function jb(e){return{initialValueFn:()=>e.isEditable(),subscribe:t=>e.registerEditableListener(t)}}function Lb(e){return()=>function(e){if(!function(e,t=!0){if(e)return!1;let n=tg().getTextContent();return t&&(n=n.trim()),""===n}(e,!1))return!1;const t=tg().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 Bb(e,t){const n=_g(e.focus,t);return vb(n)&&!n.isIsolated()||pb(n)&&!n.isInline()&&!n.canBeEmpty()}function Wb(e,t,n){const r=function(e){const t=e.anchor.getNode();return"rtl"===(bb(t)?t:t.getParentOrThrow()).getDirection()}(e);!function(e,t,n){e.modify(t?"extend":"move",n,"character")}(e,t,n?!r:r)}function Ub(e,t,n,r=null){let o=null===r||t.isSelected(r);const i=pb(t)&&t.excludeFromCopy("html");let s=t;if(null!==r){let e=Wg(t);e=my(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]=Ry(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=pb(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=Fy();if(null!==o&&null!=r){e.preventDefault();const i=function(e){const t=Fy();return null==t&&Kb(166),Ey(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=tg().getChildren();for(let n=0;ne.getDecorators()));return ex((()=>e.registerDecoratorListener((e=>{(0,kn.flushSync)((()=>{r(e)}))}))),[e]),(0,re.useEffect)((()=>{r(e.getDecorators())}),[e]),(0,re.useMemo)((()=>{const r=[],o=Object.keys(n);for(let i=0;ie._onError(t),children:(0,ti.jsx)(re.Suspense,{fallback:null,children:n[s]})}),l=e.getElementByKey(s);null!==l&&r.push((0,kn.createPortal)(a,l,s))}return r}),[t,n,e])}(r,n);return function(e){ex((()=>zb(function(e){return zb(e.registerCommand(Gh,(e=>{const t=Fy();return!!Ey(t)&&(t.deleteCharacter(e),!0)}),0),e.registerCommand(np,(e=>{const t=Fy();return!!Ey(t)&&(t.deleteWord(e),!0)}),0),e.registerCommand(rp,(e=>{const t=Fy();return!!Ey(t)&&(t.deleteLine(e),!0)}),0),e.registerCommand(Qh,(e=>{const t=Fy();if(!Ey(t))return!1;if("string"==typeof e)t.insertText(e);else{const n=e.dataTransfer;if(null!=n)$b(n,t);else{const n=e.data;n&&t.insertText(n)}}return!0}),0),e.registerCommand(tp,(()=>{const e=Fy();return!!Ey(e)&&(e.removeText(),!0)}),0),e.registerCommand(Jh,(e=>{const t=Fy();return!!Ey(t)&&(t.insertLineBreak(e),!0)}),0),e.registerCommand(Zh,(()=>{const e=Fy();return!!Ey(e)&&(e.insertLineBreak(),!0)}),0),e.registerCommand(up,(e=>{const t=Fy();if(!Ey(t))return!1;const n=e,r=n.shiftKey;return!!Bb(t,!0)&&(n.preventDefault(),Wb(t,r,!0),!0)}),0),e.registerCommand(lp,(e=>{const t=Fy();if(!Ey(t))return!1;const n=e,r=n.shiftKey;return!!Bb(t,!1)&&(n.preventDefault(),Wb(t,r,!1),!0)}),0),e.registerCommand(gp,(t=>!!Ey(Fy())&&(t.preventDefault(),e.dispatchCommand(Gh,!0))),0),e.registerCommand(yp,(t=>!!Ey(Fy())&&(t.preventDefault(),e.dispatchCommand(Gh,!1))),0),e.registerCommand(pp,(t=>{if(!Ey(Fy()))return!1;if(null!==t){if((Gb||Xb||Zb)&&Yb)return!1;t.preventDefault()}return e.dispatchCommand(Jh,!1)}),0),e.registerCommand(Cp,(()=>(function(){const e=tg();rg(function(e){return jm(e.anchor),jm(e.focus),e}(e.select(0,e.getChildrenSize())))}(),!0)),0),e.registerCommand(kp,(t=>!!Ey(Fy())&&(Qb(t,e),!0)),0),e.registerCommand(Ep,(t=>!!Ey(Fy())&&(function(e,t){Qb(e,t),t.update((()=>{const e=Fy();Ey(e)&&e.removeText()}))}(t,e),!0)),0),e.registerCommand(ep,(t=>!!Ey(Fy())&&(function(e,t){e.preventDefault(),t.update((()=>{const t=Fy(),{clipboardData:n}=e;null!=n&&Ey(t)&&$b(n,t)}),{tag:"paste"})}(t,e),!0)),0),e.registerCommand(xp,(e=>!!Ey(Fy())&&(e.preventDefault(),!0)),0),e.registerCommand(wp,(e=>!!Ey(Fy())&&(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=Fy();if(Ey(e)){const t=e.anchor;let l=t.getNode(),c=0,u=0;if(my(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()),my(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,ti.jsxs)(ti.Fragment,{children:[e,(0,ti.jsx)(rx,{content:t}),o]})}function rx({content:e}){const[t]=Hh(),n=function(e){const[t,n]=(0,re.useState)((()=>tx(e)));return ex((()=>{function t(){const t=tx(e);n(t)}return t(),zb(e.registerUpdateListener((()=>{t()})),e.registerEditableListener((()=>{t()})))}),[e]),t}(t),r=function(e){const[t]=Hh(),n=(0,re.useMemo)((()=>e(t)),[t,e]),r=(0,re.useRef)(n.initialValueFn()),[o,i]=(0,re.useState)(r.current);return Ib((()=>{const{initialValueFn:e,subscribe:t}=n,o=e();return r.current!==o&&(r.current=o,i(o)),t((e=>{r.current=e,i(e)}))}),[n,e]),o}(jb);return n?"function"==typeof e?e(r):e:null}const ox="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?re.useLayoutEffect:re.useEffect,ix=(0,re.forwardRef)((function({editor:e,ariaActiveDescendant:t,ariaAutoComplete:n,ariaControls:r,ariaDescribedBy:o,ariaExpanded:i,ariaLabel:s,ariaLabelledBy:a,ariaMultiline:l,ariaOwns:c,ariaRequired:u,autoCapitalize:d,className:f,id:h,role:p="textbox",spellCheck:m=!0,style:g,tabIndex:v,"data-testid":y,...b},x){const[w,_]=(0,re.useState)(e.isEditable()),S=(0,re.useCallback)((t=>{t&&t.ownerDocument&&t.ownerDocument.defaultView?e.setRootElement(t):e.setRootElement(null)}),[e]),k=(0,re.useMemo)((()=>function(...e){return t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}}(x,S)),[S,x]);return ox((()=>(_(e.isEditable()),e.registerEditableListener((e=>{_(e)})))),[e]),(0,ti.jsx)("div",{...b,"aria-activedescendant":w?t:void 0,"aria-autocomplete":w?n:"none","aria-controls":w?r:void 0,"aria-describedby":o,"aria-expanded":w&&"combobox"===p?!!i:void 0,"aria-label":s,"aria-labelledby":a,"aria-multiline":l,"aria-owns":w?c:void 0,"aria-readonly":!w||void 0,"aria-required":u,autoCapitalize:d,className:f,contentEditable:w,"data-testid":y,id:h,ref:k,role:w?p:void 0,spellCheck:m,style:g,tabIndex:v})}));function sx(e){return e.getEditorState().read(Lb(e.isComposing()))}const ax=(0,re.forwardRef)((function(e,t){const{placeholder:n,editor__DEPRECATED:r,...o}=e,i=r||Hh()[0];return(0,ti.jsxs)(ti.Fragment,{children:[(0,ti.jsx)(ix,{editor:i,...o,ref:t}),null!=n&&(0,ti.jsx)(lx,{editor:i,content:n})]})}));function lx({content:e,editor:t}){const n=function(e){const[t,n]=(0,re.useState)((()=>sx(e)));return ox((()=>{function t(){const t=sx(e);n(t)}return t(),zb(e.registerUpdateListener((()=>{t()})),e.registerEditableListener((()=>{t()})))}),[e]),t}(t),[r,o]=(0,re.useState)(t.isEditable());if((0,re.useLayoutEffect)((()=>(o(t.isEditable()),t.registerEditableListener((e=>{o(e)})))),[t]),!n)return null;let i=null;return"function"==typeof e?i=e(r):null!==e&&(i=e),null===i?null:(0,ti.jsx)("div",{"aria-hidden":!0,children:i})}const cx=0,ux=1,dx=2,fx=0,hx=1,px=2,mx=3,gx=4;function vx(e){e.undoStack=[],e.redoStack=[],e.current=null}function yx({delay:e,externalHistoryState:t}){const[n]=Hh();return function(e,t,n=1e3){const r=(0,re.useMemo)((()=>t||{current:null,redoStack:[],undoStack:[]}),[t]);(0,re.useEffect)((()=>function(e,t,n){const r=function(e,t){let n=Date.now(),r=fx;return(o,i,s,a,l,c)=>{const u=Date.now();if(c.has("historic"))return r=fx,n=u,dx;const d=function(e,t,n,r,o){if(null===e||0===n.size&&0===r.size&&!o)return fx;const i=t._selection,s=e._selection;if(o)return hx;if(!(Ey(i)&&Ey(s)&&s.isCollapsed()&&i.isCollapsed()))return fx;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||bb(n)||o.push(n)}return o}(t,n,r);if(0===a.length)return fx;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)&&my(r)&&1===r.__text.length&&1===i.anchor.offset?px:fx}const l=a[0],c=e._nodeMap.get(l.__key);if(!my(c)||!my(l)||c.__mode!==l.__mode)return fx;const u=c.__text,d=l.__text;if(u===d)return fx;const f=i.anchor,h=s.anchor;if(f.key!==h.key||"text"!==f.type)return fx;const p=f.offset,m=h.offset,g=d.length-u.length;return 1===g&&m===p-1?px:-1===g&&m===p+1?mx:-1===g&&m===p?gx:fx}(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 cx;if(null===o)return ux;const p=i._selection;return a.size>0||l.size>0?!1===h&&d!==fx&&d===r&&ur.exportJSON())))===JSON.stringify(n.read((()=>o.exportJSON())))}(Array.from(a)[0],o,i)?cx:ux:null!==p?cx:dx})();return n=u,r=d,f}}(e,n),o=zb(e.registerCommand(ip,(()=>(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(Rp,!0)),0===r.length&&e.dispatchCommand(Op,!1),t.current=i||null,i&&i.editor.setEditorState(i.editorState,{tag:"historic"})}}(e,t),!0)),0),e.registerCommand(sp,(()=>(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(Op,!0));const i=n.pop();0===n.length&&e.dispatchCommand(Rp,!1),t.current=i||null,i&&i.editor.setEditorState(i.editorState,{tag:"historic"})}}(e,t),!0)),0),e.registerCommand(Tp,(()=>(vx(t),!1)),0),e.registerCommand(Pp,(()=>(vx(t),e.dispatchCommand(Rp,!1),e.dispatchCommand(Op,!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===ux)0!==c.length&&(t.redoStack=[],e.dispatchCommand(Rp,!1)),null!==l&&(u.push({...l}),e.dispatchCommand(Op,!0));else if(f===dx)return;t.current={editor:e,editorState:n}})));return o}(e,r,n)),[n,e,r])}(n,t,e),null}function bx(e,t){return bx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},bx(e,t)}var xx={error:null},wx=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}var Cx={sm:"py-1.5 px-2 rounded [&_.editor-content>p]:text-xs [&_.editor-content>p]:font-medium [&_.editor-content>p]:leading-[1.625rem]",md:"py-2 px-2.5 rounded-md [&_.editor-content>p]:text-xs [&_.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]"},Tx={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]"},Px={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 Rx="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?re.useLayoutEffect:re.useEffect,Ox=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 Ax(e,t){const n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return n.top>r.top&&n.top{u(0)}),[d]);const f=(0,re.useCallback)((n=>{t.update((()=>{const t=null!=r.match&&a?function(e){const t=Fy();if(!Ey(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;s(n,t,e,r.match?r.match.matchingString:"")}))}),[t,a,r.match,s,e]),h=(0,re.useCallback)((e=>{const n=t.getRootElement();null!==n&&(n.setAttribute("aria-activedescendant","typeahead-item-"+e),u(e))}),[t]);return(0,re.useEffect)((()=>()=>{const e=t.getRootElement();null!==e&&e.removeAttribute("aria-activedescendant")}),[t]),Rx((()=>{null===o?u(null):null===c&&h(0)}),[o,c,h]),(0,re.useEffect)((()=>zb(t.registerCommand(Nx,(({option:e})=>!(!e.ref||null==e.ref.current||(Ox(e.ref.current),0))),l))),[t,h,l]),(0,re.useEffect)((()=>zb(t.registerCommand(hp,(e=>{const n=e;if(null!==o&&o.length&&null!==c){const e=c!==o.length-1?c+1:0;h(e);const r=o[e];null!=r.ref&&r.ref.current&&t.dispatchCommand(Nx,{index:e,option:r}),n.preventDefault(),n.stopImmediatePropagation()}return!0}),l),t.registerCommand(fp,(e=>{const t=e;if(null!==o&&o.length&&null!==c){const e=0!==c?c-1:o.length-1;h(e);const n=o[e];null!=n.ref&&n.ref.current&&Ox(n.ref.current),t.preventDefault(),t.stopImmediatePropagation()}return!0}),l),t.registerCommand(vp,(t=>{const n=t;return n.preventDefault(),n.stopImmediatePropagation(),e(),!0}),l),t.registerCommand(bp,(e=>{const t=e;return null!==o&&null!==c&&null!=o[c]&&(t.preventDefault(),t.stopImmediatePropagation(),f(o[c]),!0)}),l),t.registerCommand(pp,(e=>null!==o&&null!==c&&null!=o[c]&&(null!==e&&(e.preventDefault(),e.stopImmediatePropagation()),f(o[c]),!0)),l))),[f,e,t,o,c,h,l]),i(n,(0,re.useMemo)((()=>({options:o,selectOptionAndCleanUp:f,selectedIndex:c,setHighlightedIndex:u})),[f,c,o]),r.match?r.match.matchingString:"")}function Dx({options:e,onQueryChange:t,onSelectOption:n,onOpen:r,onClose:o,menuRenderFn:i,triggerFn:s,anchorClassName:a,commandPriority:l=Pb,parent:c}){const[u]=Hh(),[d,f]=(0,re.useState)(null),h=function(e,t,n,r=document.body){const[o]=Hh(),i=(0,re.useRef)(document.createElement("div")),s=(0,re.useCallback)((()=>{i.current.style.top=i.current.style.bottom;const t=o.getRootElement(),s=i.current,a=s.firstChild;if(null!==t&&null!==e){const{left:o,top:l,width:c,height:u}=e.getRect(),d=i.current.offsetHeight;if(s.style.top=`${l+window.pageYOffset+d+3}px`,s.style.left=`${o+window.pageXOffset}px`,s.style.height=`${u}px`,s.style.width=`${c}px`,null!==a){a.style.top=`${l}`;const e=a.getBoundingClientRect(),n=e.height,r=e.width,i=t.getBoundingClientRect();o+r>i.right&&(s.style.left=`${i.right-r+window.pageXOffset}px`),(l+n>window.innerHeight||l+n>i.bottom)&&l-i.top>n+u&&(s.style.top=l-n+window.pageYOffset-u+"px")}s.isConnected||(null!=n&&(s.className=n),s.setAttribute("aria-label","Typeahead menu"),s.setAttribute("id","typeahead-menu"),s.setAttribute("role","listbox"),s.style.display="block",s.style.position="absolute",r.append(s)),i.current=s,t.setAttribute("aria-controls","typeahead-menu")}}),[o,e,n,r]);(0,re.useEffect)((()=>{const t=o.getRootElement();if(null!==e)return s(),()=>{null!==t&&t.removeAttribute("aria-controls");const e=i.current;null!==e&&e.isConnected&&e.remove()}}),[o,s,e]);const a=(0,re.useCallback)((n=>{null!==e&&(n||t(null))}),[e,t]);return function(e,t,n,r){const[o]=Hh();(0,re.useEffect)((()=>{if(null!=t&&null!=e){const e=o.getRootElement(),i=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=Ax(t,i);const l=function(){s||(window.requestAnimationFrame((function(){n(),s=!1})),s=!0);const e=Ax(t,i);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,o,r,n,e])}(e,i.current,s,a),i}(d,f,a,c),p=(0,re.useCallback)((()=>{f(null),null!=o&&null!==d&&o()}),[o,d]),m=(0,re.useCallback)((e=>{f(e),null!=r&&null===d&&r(e)}),[r,d]);return(0,re.useEffect)((()=>{const e=u.registerUpdateListener((()=>{u.getEditorState().read((()=>{const e=u._window||window,n=e.document.createRange(),r=Fy(),o=function(e){let t=null;return e.getEditorState().read((()=>{const e=Fy();Ey(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}(u);if(!Ey(r)||!r.isCollapsed()||null===o||null===n)return void p();const i=s(o,u);if(t(i?i.matchingString:null),null!==i&&!function(e,t){return 0===t&&e.getEditorState().read((()=>{const e=Fy();if(Ey(e)){const t=e.anchor.getNode().getPreviousSibling();return my(t)&&t.isTextEntity()}return!1}))}(u,i.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}(i.leadOffset,n,e);if(null!==t)return a=()=>m({getRect:()=>n.getBoundingClientRect(),match:i}),void(re.startTransition?re.startTransition(a):a())}var a;p()}))}));return()=>{e()}}),[u,s,t,d,p,m]),null===d||null===u?null:(0,ti.jsx)(Mx,{close:p,resolution:d,editor:u,anchorElementRef:h,options:e,menuRenderFn:i,shouldSplitNodeWithQuery:!0,onSelectOption:n,commandPriority:l})}function Ix(e){return Ix="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},Ix(e)}function jx(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 nw(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)?nw(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,re.useState)([]),2),o=r[0],i=r[1];return(0,re.useEffect)((function(){if(null!==t){var r=rw.get(t);null!==r&&(void 0===r?(rw.set(t,null),ow(e,t,(function(e){rw.set(t,e),i(e)}),n)):i(r))}else i([])}),[t]),o},sw=["size","children","selected","className"];function aw(){return aw=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n_:;",hw=["@"].join(""),pw="[^"+hw+fw+"\\s]",mw=new RegExp("(^|\\s|\\()(["+hw+"]((?:"+pw+"(?:\\.[ |$]| |["+fw+"]|)){0,75}))$"),gw=new RegExp("(^|\\s|\\()(["+hw+"]((?:"+pw+"){0,50}))$");function vw(e){var t=mw.exec(e);if(null===t&&(t=gw.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}var yw=function(e){var t=e.optionsArray,n=e.by,r=void 0===n?"name":n,o=e.size,i=void 0===o?"md":o,s=e.menuComponent,a=void 0===s?cw:s,l=e.menuItemComponent,c=void 0===l?cw.Item:l,u=uw(Hh(),1)[0],d=uw((0,re.useState)(null),2),f=d[0],h=d[1],p=iw(t,f,r),m=(0,re.useCallback)((function(e,t,n){u.update((function(){var o=Yx(e.data,r,i);t&&t.replace(o),n()}))}),[u]),g=(0,re.useMemo)((function(){return p.map((function(e){return new tw(e)}))}),[u,p]);return React.createElement(Dx,{onQueryChange:h,onSelectOption:m,triggerFn:vw,options:g,menuRenderFn:function(e,t){var n=t.selectedIndex,o=t.selectOptionAndCleanUp,s=t.setHighlightedIndex;return e.current&&!(null==g||!g.length)&&React.createElement(a,{size:i},g.map((function(e,t){var a;return React.createElement(c,{key:t,ref:e.ref,size:i,selected:t===n,onMouseEnter:function(){s(t)},onClick:function(){return o(e)}},"string"==typeof e.data?e.data:null===(a=e.data)||void 0===a?void 0:a[r])})))}})},bw={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"}},xw=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 ww(e){console.error(e)}var _w=function(e){var t,n,r=e.defaultValue,o=void 0===r?"":r,i=e.placeholder,s=void 0===i?"Press @ to view variable suggestions":i,a=e.onChange,l=e.size,c=void 0===l?"md":l,u=e.autoFocus,d=void 0!==u&&u,f=e.options,h=void 0===f?[]:f,p=e.by,m=void 0===p?"name":p,g=e.menuComponent,v=e.menuItemComponent,y=e.className,b=e.disabled,x=void 0!==b&&b,w={namespace:"Editor",editorTheme:bw,onError:ww,nodes:[Xx],editorState:o||'{\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:!x};return(0,re.isValidElement)(g)&&(t=g),(0,re.isValidElement)(v)&&(n=v),React.createElement("div",{className:Q("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",Cx[c],x&&"bg-field-secondary-background border-field-border-disabled hover:border-field-border-disabled [&_p]:text-badge-color-disabled cursor-not-allowed")},React.createElement(Db,{initialConfig:w},React.createElement("div",{className:"relative w-full [&_p]:m-0"},React.createElement(nx,{contentEditable:React.createElement(ax,{className:Q("editor-content","w-full min-h-[1.625rem] [&>p]:w-full [&>p]:m-0",y)}),placeholder:React.createElement(xw,{content:s}),ErrorBoundary:Sx})),React.createElement(yx,null),React.createElement(yw,{menuComponent:t,menuItemComponent:n,size:c,by:m,optionsArray:h}),React.createElement(Ex,{onChange:function(e,t){"function"==typeof a&&a(e,t)},ignoreSelectionChange:!0}),d&&React.createElement(qh,null)))},Sw=["variant","className"];function kw(){return kw=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const t=l(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{const n=e.split("-");return""===n[0]&&1!==n.length&&n.shift(),i(n,t)||a(e)},getConflictingClassGroupIds:(e,t)=>{const o=n[e]||[];return t&&r[e]?[...o,...r[e]]:o}}},i=(e,t)=>{if(0===e.length)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?i(e.slice(1),r):void 0;if(o)return o;if(0===t.validators.length)return;const s=e.join("-");return t.validators.find((({validator:e})=>e(s)))?.classGroupId},s=/^\[(.+)\]$/,a=e=>{if(s.test(e)){const t=s.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},l=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return f(Object.entries(e.classGroups),n).forEach((([e,n])=>{c(n,r,e,t)})),r},c=(e,t,n,r)=>{e.forEach((e=>{if("string"!=typeof e){if("function"==typeof e)return d(e)?void c(e(r),t,n,r):void t.validators.push({validator:e,classGroupId:n});Object.entries(e).forEach((([e,o])=>{c(o,u(t,e),n,r)}))}else(""===e?t:u(t,e)).classGroupId=n}))},u=(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},d=e=>e.isThemeGetter,f=(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,h=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)}}},p=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},m=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},g=/\s+/;function v(){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:h(e.cacheSize),parseClassName:p(e),...o(e)}))(c),r=n.cache.get,i=n.cache.set,s=a,a(l)};function a(e){const t=r(e);if(t)return t;const o=((e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=[],s=e.trim().split(g);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=m(l).join(":"),g=c?p+"!":p,v=g+h;if(i.includes(v))continue;i.push(v);const y=o(h,f);for(let e=0;e0?" "+a:a)}return a})(e,n);return i(e,o),o}return function(){return s(v.apply(null,arguments))}}const x=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},w=/^\[(?:([a-z-]+):)?(.+)\]$/i,_=/^\d+\/\d+$/,S=new Set(["px","full","screen"]),k=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,E=/\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$/,C=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,T=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,P=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,R=e=>A(e)||S.has(e)||_.test(e),O=e=>K(e,"length",$),A=e=>Boolean(e)&&!Number.isNaN(Number(e)),N=e=>K(e,"number",A),M=e=>Boolean(e)&&Number.isInteger(Number(e)),D=e=>e.endsWith("%")&&A(e.slice(0,-1)),I=e=>w.test(e),j=e=>k.test(e),L=new Set(["length","size","percentage"]),F=e=>K(e,L,H),V=e=>K(e,"position",H),z=new Set(["image","url"]),B=e=>K(e,z,Y),W=e=>K(e,"",q),U=()=>!0,K=(e,t,n)=>{const r=w.exec(e);return!!r&&(r[1]?"string"==typeof t?r[1]===t:t.has(r[1]):n(r[2]))},$=e=>E.test(e)&&!C.test(e),H=()=>!1,q=e=>T.test(e),Y=e=>P.test(e),X=(Symbol.toStringTag,()=>{const e=x("colors"),t=x("spacing"),n=x("blur"),r=x("brightness"),o=x("borderColor"),i=x("borderRadius"),s=x("borderSpacing"),a=x("borderWidth"),l=x("contrast"),c=x("grayscale"),u=x("hueRotate"),d=x("invert"),f=x("gap"),h=x("gradientColorStops"),p=x("gradientColorStopPositions"),m=x("inset"),g=x("margin"),v=x("opacity"),y=x("padding"),b=x("saturate"),w=x("scale"),_=x("sepia"),S=x("skew"),k=x("space"),E=x("translate"),C=()=>["auto",I,t],T=()=>[I,t],P=()=>["",R,O],L=()=>["auto",A,I],z=()=>["","0",I],K=()=>[A,I];return{cacheSize:500,separator:":",theme:{colors:[U],spacing:[R,O],blur:["none","",j,I],brightness:K(),borderColor:[e],borderRadius:["none","","full",j,I],borderSpacing:T(),borderWidth:P(),contrast:K(),grayscale:z(),hueRotate:K(),invert:z(),gap:T(),gradientColorStops:[e],gradientColorStopPositions:[D,O],inset:C(),margin:C(),opacity:K(),padding:T(),saturate:K(),scale:K(),sepia:z(),skew:K(),space:T(),translate:T()},classGroups:{aspect:[{aspect:["auto","square","video",I]}],container:["container"],columns:[{columns:[j]}],"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",I]}],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",M,I]}],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",I]}],grow:[{grow:z()}],shrink:[{shrink:z()}],order:[{order:["first","last","none",M,I]}],"grid-cols":[{"grid-cols":[U]}],"col-start-end":[{col:["auto",{span:["full",M,I]},I]}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":[U]}],"row-start-end":[{row:["auto",{span:[M,I]},I]}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",I]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",I]}],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":[k]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[k]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",I,t]}],"min-w":[{"min-w":[I,t,"min","max","fit"]}],"max-w":[{"max-w":[I,t,"none","full","min","max","fit","prose",{screen:[j]},j]}],h:[{h:[I,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[I,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[I,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[I,t,"auto","min","max","fit"]}],"font-size":[{text:["base",j,O]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",N]}],"font-family":[{font:[U]}],"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",I]}],"line-clamp":[{"line-clamp":["none",A,N]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",R,I]}],"list-image":[{"list-image":["none",I]}],"list-style-type":[{list:["none","disc","decimal",I]}],"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",R,O]}],"underline-offset":[{"underline-offset":["auto",R,I]}],"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",I]}],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",I]}],"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",F]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},B]}],"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":[R,I]}],"outline-w":[{outline:[R,O]}],"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":[R,O]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",j,W]}],"shadow-color":[{shadow:[U]}],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",j,I]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[b]}],sepia:[{sepia:[_]}],"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":[_]}],"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",I]}],duration:[{duration:K()}],ease:[{ease:["linear","in","out","in-out",I]}],delay:[{delay:K()}],animate:[{animate:["none","spin","ping","pulse","bounce",I]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[M,I]}],"translate-x":[{"translate-x":[E]}],"translate-y":[{"translate-y":[E]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",I]}],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",I]}],"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",I]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[R,O,N]}],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"]}}}),G=b(X);function J(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===r?void 0:r[l],T=null,P="";x&&(P="flex items-center justify-center gap-1","left"===_?o=x:T=x);var R=f;return React.createElement(R,te({type:u,className:Q(P,"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",C,k,E,h),disabled:g},S),o,p,T)},re=n(609),oe=n.n(re);let ie=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&n[e]];return t};var se=["id","onChange","value","defaultValue","size","disabled","label","name"];function ae(){return ae=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 he={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 pe=(0,re.forwardRef)((({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:s,...a},l)=>(0,re.createElement)("svg",{ref:l,...he,width:t,height:t,stroke:e,strokeWidth:r?24*Number(n)/Number(t):n,className:fe("lucide",o),...a},[...s.map((([e,t])=>(0,re.createElement)(e,t))),...Array.isArray(i)?i:[i]]))),me=(e,t)=>{const n=(0,re.forwardRef)((({className:n,...r},o)=>{return(0,re.createElement)(pe,{ref:o,iconNode:t,className:fe(`lucide-${i=e,i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,n),...r});var i}));return n.displayName=`${e}`,n},ge=me("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]),ve=me("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);var ye=["id","label","defaultChecked","checked","onChange","value","indeterminate","disabled","size"];function be(){return be=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"}[s],"border-0 border-r border-border-subtle border-solid");return oe().createElement(oe().Fragment,null,oe().createElement("button",Ee({type:"button",id:m,className:Q(y,"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",v&&"bg-button-disabled"),onClick:function(){f&&f(r)},disabled:g},a),oe().createElement("input",{type:"hidden",value:r,name:c,checked:v,onChange:f}),n))},Me={Group:function(e){var t,n,r=e.children,o=e.name,i=e.value,s=e.defaultValue,a=e.by,l=void 0===a?"id":a,c=e.as,u=void 0===c?re.Fragment:c,d=e.onChange,f=e.className,h=e.style,p=void 0===h?"simple":h,m=e.disabled,g=void 0!==m&&m,v=(0,re.useMemo)((function(){return void 0!==i}),[i]),y=(0,re.useMemo)((function(){return o||"radio-button-group-".concat(ie())}),[o]),b=(t=(0,re.useState)(v?i:s),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 Pe(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)?Pe(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.")}()),x=b[0],w=b[1],_=(0,re.useCallback)((function(e){var t;t="tile"===p?e:e.target.value,v||w(t),"function"==typeof d&&d(t)}),[d]),S=Q("tile"===p?"inline-flex border border-border-subtle border-solid rounded shadow-sm":"flex gap-6",f),k=function(){return oe().createElement(Re.Provider,{value:{name:y,value:v?i:x,by:l,onChange:_,isControlled:v,disableAll:g,style:p}},oe().Children.map(r,(function(e){return(0,re.isValidElement)(e)?e:null})))};return oe().createElement(oe().Fragment,null,"tile"===p?oe().createElement("div",{className:S},k()):oe().createElement(u,u===re.Fragment?{}:{className:f},k()))},Button:(0,re.forwardRef)(Ae)};const De=me("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),Ie=me("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);var je=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(De,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"},S="",k="group relative justify-center flex items-center [&>svg]:h-4 [&>svg]:w-4 cursor-pointer";return m?(S=_.disabled,k+=" cursor-not-allowed disabled"):S=_[d],r?React.createElement("span",{className:Q("font-medium border 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],S,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:k,onClick:m?null:v,onMouseDown:w,role:"button",tabIndex:0},React.createElement("span",{className:"sr-only"},"Remove ".concat(r)),React.createElement(Ie,null),React.createElement("span",{className:"absolute -inset-1"}))):null},Le=(0,re.forwardRef)(je),Fe=["id","defaultValue","value","size","className","disabled","onChange","error","onError"];function Ve(){return Ve=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:Q("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 Ke=me("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 $e=["id","type","defaultValue","value","size","className","disabled","onChange","error","onError","prefix","suffix"];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);n0?N(t[0].name):N(null):t=e.target.value,C||"file"===o||R(t),"function"==typeof m&&m(t))},I="border border-solid border-border-subtle bg-field-secondary-background font-normal placeholder-text-tertiary text-text-primary w-full",j={sm:"px-2 py-2 rounded",md:"px-2.5 py-2.5 rounded-md",lg:"px-3 py-3 rounded-lg"},L={sm:"text-xs",md:"text-base",lg:"text-base"},F={sm:w?"pl-8":"",md:w?"pl-9":"",lg:w?"pl-10":""},V={sm:S?"pr-8":"",md:S?"pr-9":"",lg:S?"pr-10":""},z=h?"hover:border-border-disabled":"hover:border-border-strong",B="focus:border-focus-border focus:ring-2 focus:ring-toggle-on focus:ring-offset-2",W=v?"focus:border-focus-error-border focus:ring-field-color-error bg-field-background-error":"",U=v?"focus:border-focus-error-border focus:ring-field-color-error":"",K=h?"border-border-disabled bg-field-background-disabled cursor-not-allowed text-text-disabled":"",$=h?"border-border-disabled cursor-not-allowed text-text-disabled file:text-text-tertiary":"",H="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",q=h?"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",Y=A?"file:border-0 file:bg-transparent":"text-text-tertiary file:border-0 file:bg-transparent";return"file"===o?React.createElement("div",{className:Q("relative flex focus-within:z-10",d)},React.createElement("input",He({ref:t,id:E,type:"file",className:Q(I,$,j[c],L[c],B,z,U,Y),disabled:h,onChange:D,onInvalid:b},k)),React.createElement("div",{className:Q(q,"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"}[c])},React.createElement(Ke,null))):React.createElement("div",{className:Q("relative flex focus-within:z-10",d)},w?React.createElement("div",{className:Q(H,"left-0 pl-3",L[c])},w):null,React.createElement("input",He({ref:t,id:E,type:o,className:Q(I,K,j[c],L[c],F[c],V[c],B,z,W),disabled:h,onChange:D,onInvalid:b,value:M()},k)),S?React.createElement("div",{className:Q(H,"right-0 pr-3",L[c])},S):null)},Ge=(0,re.forwardRef)(Xe),Je=["children","tag","size","className","variant","required"];function Ze(){return Ze=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"}[s],{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"}[u],p,l)},h),n)},et=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:Q("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:Q("flex items-center",m[f])},s,g()),s&&"right"===l&&React.createElement("div",{className:Q("flex items-center",m[f])},g(),s),!s&&g()),React.createElement("span",{className:Q("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:Q("flex items-center",m[f])},s,g()),s&&"right"===l&&React.createElement("div",{className:Q("flex items-center",m[f])},g(),s),!s&&g())};const tt=me("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);var nt=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:Q("flex",f,d,u)},l||React.createElement(tt,{className:"animate-spin"}))},rt=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:Q("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 ot(e){return at(e)?(e.nodeName||"").toLowerCase():"#document"}function it(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function st(e){var t;return null==(t=(at(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function at(e){return e instanceof Node||e instanceof it(e).Node}function lt(e){return e instanceof Element||e instanceof it(e).Element}function ct(e){return e instanceof HTMLElement||e instanceof it(e).HTMLElement}function ut(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof it(e).ShadowRoot)}function dt(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=vt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function ft(e){return["table","td","th"].includes(ot(e))}function ht(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function pt(e){const t=mt(),n=lt(e)?vt(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 mt(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function gt(e){return["html","body","#document"].includes(ot(e))}function vt(e){return it(e).getComputedStyle(e)}function yt(e){return lt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function bt(e){if("html"===ot(e))return e;const t=e.assignedSlot||e.parentNode||ut(e)&&e.host||st(e);return ut(t)?t.host:t}function xt(e){const t=bt(e);return gt(t)?e.ownerDocument?e.ownerDocument.body:e.body:ct(t)&&dt(t)?t:xt(t)}function wt(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=xt(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),s=it(o);if(i){const e=_t(s);return t.concat(s,s.visualViewport||[],dt(o)?o:[],e&&n?wt(e):[])}return t.concat(o,wt(o,[],n))}function _t(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function St(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 kt(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&ut(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Et(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function Ct(){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 Tt(e){return!(0!==e.mozInputSource||!e.isTrusted)||(Ot()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function Pt(e){return!Ct().includes("jsdom/")&&(!Ot()&&0===e.width&&0===e.height||Ot()&&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 Rt(){return/apple/i.test(navigator.vendor)}function Ot(){const e=/android/i;return e.test(Et())||e.test(Ct())}function At(){return Et().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function Nt(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Mt(e){return(null==e?void 0:e.ownerDocument)||document}function Dt(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 It(e){return"composedPath"in e?e.composedPath()[0]:e.target}const jt="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Lt(e){return ct(e)&&e.matches(jt)}function Ft(e){e.preventDefault(),e.stopPropagation()}function Vt(e){return!!e&&"combobox"===e.getAttribute("role")&&Lt(e)}const zt=Math.min,Bt=Math.max,Wt=Math.round,Ut=Math.floor,Kt=e=>({x:e,y:e}),$t={left:"right",right:"left",bottom:"top",top:"bottom"},Ht={start:"end",end:"start"};function qt(e,t,n){return Bt(e,zt(t,n))}function Yt(e,t){return"function"==typeof e?e(t):e}function Xt(e){return e.split("-")[0]}function Gt(e){return e.split("-")[1]}function Jt(e){return"x"===e?"y":"x"}function Zt(e){return"y"===e?"height":"width"}function Qt(e){return["top","bottom"].includes(Xt(e))?"y":"x"}function en(e){return Jt(Qt(e))}function tn(e){return e.replace(/start|end/g,(e=>Ht[e]))}function nn(e){return e.replace(/left|right|bottom|top/g,(e=>$t[e]))}function rn(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 on(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 sn=["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(","),an="undefined"==typeof Element,ln=an?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,cn=!an&&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},un=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)},dn=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var s=i.shift();if(!un(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{ln.call(s,sn)&&r.filter(s)&&(n||!t.includes(s))&&o.push(s);var c=s.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(s),u=!un(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},fn=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},hn=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))&&!fn(e)?0:e.tabIndex},pn=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},mn=function(e){return"INPUT"===e.tagName},gn=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},vn=function(e,t){return!(t.disabled||un(t)||function(e){return mn(e)&&"hidden"===e.type}(t)||function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=ln.call(e,"details>summary:first-of-type")?e.parentElement:e;if(ln.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return gn(e)}else{if("function"==typeof r){for(var i=e;e;){var s=e.parentElement,a=cn(e);if(s&&!s.shadowRoot&&!0===r(s))return gn(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&&cn(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=cn(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)},xn=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=hn(e);return n<0&&t&&!fn(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(pn).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},wn=function(e,t){var n;return n=(t=t||{}).getShadowRoot?dn([e],t.includeContainer,{filter:yn.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:bn}):function(e,t,n){if(un(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(sn));return t&&ln.call(e,sn)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,yn.bind(null,t)),xn(n)},Sn=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==ln.call(e,sn)&&yn(t,e)},kn=window.ReactDOM;function En(e,t,n){let{reference:r,floating:o}=e;const i=Qt(t),s=en(t),a=Zt(s),l=Xt(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(Gt(t)){case"start":h[s]-=f*(n&&c?-1:1);break;case"end":h[s]+=f*(n&&c?-1:1)}return h}async function Cn(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}=Yt(t,e),p=rn(h),m=a[f?"floating"===d?"reference":"floating":d],g=on(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=on(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 Tn(e){const t=vt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ct(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Wt(n)!==i||Wt(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Pn(e){return lt(e)?e:e.contextElement}function Rn(e){const t=Pn(e);if(!ct(t))return Kt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Tn(t);let s=(i?Wt(n.width):n.width)/r,a=(i?Wt(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const On=Kt(0);function An(e){const t=it(e);return mt()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:On}function Nn(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Pn(e);let s=Kt(1);t&&(r?lt(r)&&(s=Rn(r)):s=Rn(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==it(e))&&t}(i,n,r)?An(i):Kt(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=it(i),t=r&<(r)?it(r):r;let n=e,o=_t(n);for(;o&&r&&t!==n;){const e=Rn(o),t=o.getBoundingClientRect(),r=vt(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=it(o),o=_t(n)}}return on({width:u,height:d,x:l,y:c})}function Mn(e){return Nn(st(e)).left+yt(e).scrollLeft}function Dn(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=it(e),r=st(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=mt();(!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=st(e),n=yt(e),r=e.ownerDocument.body,o=Bt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Bt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Mn(e);const a=-n.scrollTop;return"rtl"===vt(r).direction&&(s+=Bt(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}(st(e));else if(lt(t))r=function(e,t){const n=Nn(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=ct(e)?Rn(e):Kt(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=An(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return on(r)}function In(e,t){const n=bt(e);return!(n===t||!lt(n)||gt(n))&&("fixed"===vt(n).position||In(n,t))}function jn(e,t,n){const r=ct(t),o=st(t),i="fixed"===n,s=Nn(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=Kt(0);if(r||!r&&!i)if(("body"!==ot(t)||dt(o))&&(a=yt(t)),r){const e=Nn(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=Mn(o));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function Ln(e){return"static"===vt(e).position}function Fn(e,t){return ct(e)&&"fixed"!==vt(e).position?t?t(e):e.offsetParent:null}function Vn(e,t){const n=it(e);if(ht(e))return n;if(!ct(e)){let t=bt(e);for(;t&&!gt(t);){if(lt(t)&&!Ln(t))return t;t=bt(t)}return n}let r=Fn(e,t);for(;r&&ft(r)&&Ln(r);)r=Fn(r,t);return r&>(r)&&Ln(r)&&!pt(r)?n:r||function(e){let t=bt(e);for(;ct(t)&&!gt(t);){if(pt(t))return t;if(ht(t))return null;t=bt(t)}return null}(e)||n}const zn={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,s=st(r),a=!!t&&ht(t.floating);if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=Kt(1);const u=Kt(0),d=ct(r);if((d||!d&&!i)&&(("body"!==ot(r)||dt(s))&&(l=yt(r)),ct(r))){const e=Nn(r);c=Rn(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:st,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?ht(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=wt(e,[],!1).filter((e=>lt(e)&&"body"!==ot(e))),o=null;const i="fixed"===vt(e).position;let s=i?bt(e):e;for(;lt(s)&&!gt(s);){const t=vt(s),n=pt(s);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||dt(s)&&!n&&In(e,s))?r=r.filter((e=>e!==s)):o=t,s=bt(s)}return t.set(e,r),r}(t,this._c):[].concat(n),r],s=i[0],a=i.reduce(((e,n)=>{const r=Dn(t,n,o);return e.top=Bt(r.top,e.top),e.right=zt(r.right,e.right),e.bottom=zt(r.bottom,e.bottom),e.left=Bt(r.left,e.left),e}),Dn(t,s,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:Vn,getElementRects:async function(e){const t=this.getOffsetParent||Vn,n=this.getDimensions,r=await n(e.floating);return{reference:jn(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}=Tn(e);return{width:t,height:n}},getScale:Rn,isElement:lt,isRTL:function(e){return"rtl"===vt(e).direction}};function Bn(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=Pn(e),u=o||i?[...c?wt(c):[],...wt(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=st(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:-Ut(u)+"px "+-Ut(o.clientWidth-(c+d))+"px "+-Ut(o.clientHeight-(u+f))+"px "+-Ut(c)+"px",threshold:Bt(0,zt(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?Nn(e):null;return l&&function t(){const r=Nn(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 Wn=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=Xt(n),a=Gt(n),l="y"===Qt(n),c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=Yt(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}}}}},Un=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}=Yt(e,t),c={x:n,y:r},u=await Cn(t,l),d=Qt(Xt(o)),f=Jt(d);let h=c[f],p=c[d];if(i){const e="y"===f?"bottom":"right";h=qt(h+u["y"===f?"top":"left"],h,h-u[e])}if(s){const e="y"===d?"bottom":"right";p=qt(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}}}}},Kn=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}=Yt(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=Xt(o),y=Qt(a),b=Xt(a)===a,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=f||(b||!m?[nn(a)]:function(e){const t=nn(e);return[tn(e),t,tn(t)]}(a)),_="none"!==p;!f&&_&&w.push(...function(e,t,n,r){const o=Gt(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[]}}(Xt(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(tn)))),i}(a,m,p,x));const S=[a,...w],k=await Cn(t,g),E=[];let C=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&E.push(k[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=Gt(e),o=en(e),i=Zt(o);let s="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=nn(s)),[s,nn(s)]}(o,s,x);E.push(k[e[0]],k[e[1]])}if(C=[...C,{placement:o,overflows:E}],!E.every((e=>e<=0))){var T,P;const e=((null==(T=i.flip)?void 0:T.index)||0)+1,t=S[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=Qt(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{}}}},$n=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}=Yt(e,t),l=await Cn(t,a),c=Xt(n),u=Gt(n),d="y"===Qt(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=zt(h-l[p],g),b=zt(f-l[m],v),x=!t.middlewareData.shift;let w=y,_=b;if(d?_=u||x?zt(b,v):v:w=u||x?zt(y,g):g,x&&!u){const e=Bt(l.left,0),t=Bt(l.right,0),n=Bt(l.top,0),r=Bt(l.bottom,0);d?_=f-2*(0!==e||0!==t?e+t:Bt(l.left,l.right)):w=h-2*(0!==n||0!==r?n+r:Bt(l.top,l.bottom))}await s({...t,availableWidth:_,availableHeight:w});const S=await o.getDimensions(i.floating);return f!==S.width||h!==S.height?{reset:{rects:!0}}:{}}}},Hn=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}=Yt(e,t)||{};if(null==c)return{};const d=rn(u),f={x:n,y:r},h=en(o),p=Zt(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 S=_?_[b]:0;S&&await(null==s.isElement?void 0:s.isElement(_))||(S=a.floating[b]||i.floating[p]);const k=x/2-w/2,E=S/2-m[p]/2-1,C=zt(d[v],E),T=zt(d[y],E),P=C,R=S-m[p]-T,O=S/2-m[p]/2+k,A=qt(P,O,R),N=!l.arrow&&null!=Gt(o)&&O!==A&&i.reference[p]/2-(O{const r=new Map,o={platform:zn,...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}=En(c,r,l),f=r,h={},p=0;for(let n=0;n{t.current=e})),t}const Qn=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?Hn({element:n.current,padding:r}).fn(t):{}:n?Hn({element:n,padding:r}).fn(t):{};var o}}),er=(e,t)=>({...Wn(e),options:[e,t]}),tr=(e,t)=>({...Kn(e),options:[e,t]}),nr=(e,t)=>({...Qn(e),options:[e,t]}),rr={...re},or=rr.useInsertionEffect||(e=>e());function ir(e){const t=re.useRef((()=>{}));return or((()=>{t.current=e})),re.useCallback((function(){for(var e=arguments.length,n=new Array(e),r=0;r=e.current.length}function fr(e,t){return pr(e,{disabledIndices:t})}function hr(e,t){return pr(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function pr(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&&vr(s,a,o));return a}function mr(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 gr(e,t){return t.flatMap(((t,n)=>e.includes(t)?[n]:[]))}function vr(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 yr=0;function br(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(yr);const i=()=>null==e?void 0:e.focus({preventScroll:n});o?i():yr=requestAnimationFrame(i)}var xr="undefined"!=typeof document?re.useLayoutEffect:re.useEffect;function wr(){return wr=Object.assign?Object.assign.bind():function(e){for(var t=1;t"floating-ui-"+Math.random().toString(36).slice(2,6)+Sr++,Er=rr.useId||function(){const[e,t]=re.useState((()=>_r?kr():void 0));return xr((()=>{null==e&&t(kr())}),[]),re.useEffect((()=>{_r=!0}),[]),e},Cr=re.forwardRef((function(e,t){const{context:{placement:n,elements:{floating:r},middlewareData:{arrow:o}},width:i=14,height:s=7,tipRadius:a=0,strokeWidth:l=0,staticOffset:c,stroke:u,d:d,style:{transform:f,...h}={},...p}=e,m=Er(),[g,v]=re.useState(!1);if(xr((()=>{r&&"rtl"===vt(r).direction&&v(!0)}),[r]),!r)return null;const y=2*l,b=y/2,x=i/2*(a/-8+1),w=s/2*a/4,[_,S]=n.split("-"),k=!!d,E="top"===_||"bottom"===_,C=c&&"end"===S?"bottom":"top";let T=c&&"end"===S?"right":"left";c&&g&&(T="end"===S?"left":"right");const P=null!=(null==o?void 0:o.x)?c||o.x:"",R=null!=(null==o?void 0:o.y)?c||o.y:"",O=d||"M0,0 H"+i+" L"+(i-x)+","+(s-w)+" Q"+i/2+","+s+" "+x+","+(s-w)+" Z",A={top:k?"rotate(180deg)":"",left:k?"rotate(90deg)":"rotate(-90deg)",bottom:k?"":"rotate(180deg)",right:k?"rotate(-90deg)":"rotate(90deg)"}[_];return re.createElement("svg",wr({},p,{"aria-hidden":!0,ref:t,width:k?i:i+y,height:i,viewBox:"0 0 "+i+" "+(s>i?s:i),style:{position:"absolute",pointerEvents:"none",[T]:P,[C]:R,[_]:E||k?"100%":"calc(100% - "+y/2+"px)",transform:""+A+(null!=f?f:""),...h}}),y>0&&re.createElement("path",{clipPath:"url(#"+m+")",fill:"none",stroke:u,strokeWidth:y+(d?0:1),d:O}),re.createElement("path",{stroke:y&&!d?p.fill:"none",d:O}),re.createElement("clipPath",{id:m},re.createElement("rect",{x:-b,y:b*(k?-1:1),width:i+y,height:i})))}));const Tr=re.createContext(null),Pr=re.createContext(null),Rr=()=>{var e;return(null==(e=re.useContext(Tr))?void 0:e.id)||null},Or=()=>re.useContext(Pr);function Ar(e){return"data-floating-ui-"+e}function Nr(e){const t=(0,re.useRef)(e);return xr((()=>{t.current=e})),t}const Mr=Ar("safe-polygon");function Dr(e,t,n){return n&&!Nt(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}function Ir(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 jr=new WeakMap,Lr=new WeakSet,Fr={},Vr=0;const zr=e=>e&&(e.host||zr(e.parentNode)),Br=(e,t)=>t.map((t=>{if(e.contains(t))return t;const n=zr(t);return e.contains(n)?n:null})).filter((e=>null!=e));function Wr(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=Mt(e[0]).body;return function(e,t,n,r){const o="data-floating-ui-inert",i=r?"inert":n?"aria-hidden":null,s=Br(t,e),a=new Set,l=new Set(s),c=[];Fr[o]||(Fr[o]=new WeakMap);const u=Fr[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"!==ot(t))if(a.has(t))e(t);else{const e=i?t.getAttribute(i):null,n=null!==e&&"false"!==e,r=(jr.get(t)||0)+1,s=(u.get(t)||0)+1;jr.set(t,r),u.set(t,s),c.push(t),1===r&&n&&Lr.add(t),1===s&&t.setAttribute(o,""),!n&&i&&t.setAttribute(i,"true")}}))}(t),a.clear(),Vr++,()=>{c.forEach((e=>{const t=(jr.get(e)||0)-1,n=(u.get(e)||0)-1;jr.set(e,t),u.set(e,n),t||(!Lr.has(e)&&i&&e.removeAttribute(i),Lr.delete(e)),n||e.removeAttribute(o)})),Vr--,Vr||(jr=new WeakMap,jr=new WeakMap,Lr=new WeakSet,Fr={})}}(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const Ur=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Kr(e,t){const n=wn(e,Ur());"prev"===t&&n.reverse();const r=n.indexOf(St(Mt(e)));return n.slice(r+1)[0]}function $r(){return Kr(document.body,"next")}function Hr(){return Kr(document.body,"prev")}function qr(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!kt(n,r)}function Yr(e){wn(e,Ur()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function Xr(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 Gr={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 Jr(e){"Tab"===e.key&&(e.target,clearTimeout(void 0))}const Zr=re.forwardRef((function(e,t){const[n,r]=re.useState();xr((()=>(Rt()&&r("button"),document.addEventListener("keydown",Jr),()=>{document.removeEventListener("keydown",Jr)})),[]);const o={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[Ar("focus-guard")]:"",style:Gr};return re.createElement("span",wr({},e,o))})),Qr=re.createContext(null),eo=Ar("portal");function to(e){const{children:t,id:n,root:r=null,preserveTabOrder:o=!0}=e,i=function(e){void 0===e&&(e={});const{id:t,root:n}=e,r=Er(),o=no(),[i,s]=re.useState(null),a=re.useRef(null);return xr((()=>()=>{null==i||i.remove(),queueMicrotask((()=>{a.current=null}))}),[i]),xr((()=>{if(!r)return;if(a.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=r,n.setAttribute(eo,""),e.appendChild(n),a.current=n,s(n)}),[t,r]),xr((()=>{if(!r)return;if(a.current)return;let e=n||(null==o?void 0:o.portalNode);e&&!lt(e)&&(e=e.current),e=e||document.body;let i=null;t&&(i=document.createElement("div"),i.id=t,e.appendChild(i));const l=document.createElement("div");l.id=r,l.setAttribute(eo,""),e=i||e,e.appendChild(l),a.current=l,s(l)}),[t,n,r,o]),i}({id:n,root:r}),[s,a]=re.useState(null),l=re.useRef(null),c=re.useRef(null),u=re.useRef(null),d=re.useRef(null),f=!!s&&!s.modal&&s.open&&o&&!(!r&&!i);return re.useEffect((()=>{if(i&&o&&(null==s||!s.modal))return i.addEventListener("focusin",e,!0),i.addEventListener("focusout",e,!0),()=>{i.removeEventListener("focusin",e,!0),i.removeEventListener("focusout",e,!0)};function e(e){i&&qr(e)&&("focusin"===e.type?Xr:Yr)(i)}}),[i,o,null==s?void 0:s.modal]),re.createElement(Qr.Provider,{value:re.useMemo((()=>({preserveTabOrder:o,beforeOutsideRef:l,afterOutsideRef:c,beforeInsideRef:u,afterInsideRef:d,portalNode:i,setFocusManagerState:a})),[o,i])},f&&i&&re.createElement(Zr,{"data-type":"outside",ref:l,onFocus:e=>{if(qr(e,i)){var t;null==(t=u.current)||t.focus()}else{const e=Hr()||(null==s?void 0:s.refs.domReference.current);null==e||e.focus()}}}),f&&i&&re.createElement("span",{"aria-owns":i.id,style:Gr}),i&&kn.createPortal(t,i),f&&i&&re.createElement(Zr,{"data-type":"outside",ref:c,onFocus:e=>{if(qr(e,i)){var t;null==(t=d.current)||t.focus()}else{const t=$r()||(null==s?void 0:s.refs.domReference.current);null==t||t.focus(),(null==s?void 0:s.closeOnFocusOut)&&(null==s||s.onOpenChange(!1,e.nativeEvent))}}}))}const no=()=>re.useContext(Qr),ro=20;let oo=[];function io(e){oo=oo.filter((e=>e.isConnected));let t=e;if(t&&"body"!==ot(t)){if(!Sn(t,Ur())){const e=wn(t,Ur())[0];e&&(t=e)}oo.push(t),oo.length>ro&&(oo=oo.slice(-ro))}}function so(){return oo.slice().reverse().find((e=>e.isConnected))}const ao=re.forwardRef((function(e,t){return re.createElement("button",wr({},e,{type:"button",ref:t,tabIndex:-1,style:Gr}))}));function lo(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],guards:i=!0,initialFocus:s=0,returnFocus:a=!0,restoreFocus:l=!1,modal:c=!0,visuallyHiddenDismiss:u=!1,closeOnFocusOut:d=!0}=e,{open:f,refs:h,nodeId:p,onOpenChange:m,events:g,dataRef:v,floatingId:y,elements:{domReference:b,floating:x}}=t,w="number"==typeof s&&s<0,_=Vt(b)&&w,S=!("undefined"!=typeof HTMLElement&&"inert"in HTMLElement.prototype)||i,k=Nr(o),E=Nr(s),C=Nr(a),T=Or(),P=no(),R=re.useRef(null),O=re.useRef(null),A=re.useRef(!1),N=re.useRef(!1),M=re.useRef(-1),D=null!=P,I=null==x?void 0:x.firstElementChild,j=(null==I?void 0:I.id)===y?I:x,L=ir((function(e){return void 0===e&&(e=j),e?wn(e,Ur()):[]})),F=ir((e=>{const t=L(e);return k.current.map((e=>b&&"reference"===e?b:j&&"floating"===e?j:t)).filter(Boolean).flat()}));function V(e){return!r&&u&&c?re.createElement(ao,{ref:"start"===e?R:O,onClick:e=>m(!1,e.nativeEvent)},"string"==typeof u?u:"Dismiss"):null}re.useEffect((()=>{if(r)return;if(!c)return;function e(e){if("Tab"===e.key){kt(j,St(Mt(j)))&&0===L().length&&!_&&Ft(e);const t=F(),n=It(e);"reference"===k.current[0]&&n===b&&(Ft(e),e.shiftKey?br(t[t.length-1]):br(t[1])),"floating"===k.current[1]&&n===j&&e.shiftKey&&(Ft(e),br(t[0]))}}const t=Mt(j);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[r,b,j,c,k,_,L,F]),re.useEffect((()=>{if(!r&&x)return x.addEventListener("focusin",e),()=>{x.removeEventListener("focusin",e)};function e(e){const t=It(e),n=L().indexOf(t);-1!==n&&(M.current=n)}}),[r,x,L]),re.useEffect((()=>{if(!r&&d)return x&&ct(b)?(b.addEventListener("focusout",t),b.addEventListener("pointerdown",e),x.addEventListener("focusout",t),()=>{b.removeEventListener("focusout",t),b.removeEventListener("pointerdown",e),x.removeEventListener("focusout",t)}):void 0;function e(){N.current=!0,setTimeout((()=>{N.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=!(kt(b,t)||kt(x,t)||kt(t,x)||kt(null==P?void 0:P.portalNode,t)||null!=t&&t.hasAttribute(Ar("focus-guard"))||T&&(Ir(T.nodesRef.current,p).find((e=>{var n,r;return kt(null==(n=e.context)?void 0:n.elements.floating,t)||kt(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}(T.nodesRef.current,p).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(l&&n&&St(Mt(j))===Mt(j).body){ct(j)&&(null==j||j.focus());const e=M.current,t=L(),n=t[e]||t[t.length-1]||j;ct(n)&&n.focus()}!_&&c||!t||!n||N.current||t===so()||(A.current=!0,m(!1,e))}))}}),[r,b,x,j,c,p,T,P,m,d,l,L,_]),re.useEffect((()=>{var e;if(r)return;const t=Array.from((null==P||null==(e=P.portalNode)?void 0:e.querySelectorAll("["+Ar("portal")+"]"))||[]);if(x){const e=[x,...t,R.current,O.current,k.current.includes("reference")||_?b:null].filter((e=>null!=e)),n=c||_?Wr(e,S,!S):Wr(e);return()=>{n()}}}),[r,b,x,c,k,P,_,S]),xr((()=>{if(r||!ct(j))return;const e=St(Mt(j));queueMicrotask((()=>{const t=F(j),n=E.current,r=("number"==typeof n?t[n]:n.current)||j,o=kt(j,e);w||o||!f||br(r,{preventScroll:r===j})}))}),[r,f,j,w,F,E]),xr((()=>{if(r||!j)return;let e=!1;const t=Mt(j),n=St(t);let o=v.current.openEvent;const i=h.domReference.current;function s(t){let{open:n,reason:r,event:i,nested:s}=t;n&&(o=i),"escape-key"===r&&h.domReference.current&&io(h.domReference.current),"hover"===r&&"mouseleave"===i.type&&(A.current=!0),"outside-press"===r&&(s?(A.current=!1,e=!0):A.current=!(Tt(i)||Pt(i)))}return io(n),g.on("openchange",s),()=>{g.off("openchange",s);const r=St(t),a=kt(x,r)||T&&Ir(T.nodesRef.current,p).some((e=>{var t;return kt(null==(t=e.context)?void 0:t.elements.floating,r)}));(a||o&&["click","mousedown"].includes(o.type))&&h.domReference.current&&io(h.domReference.current);const l=i||n,c=wn(Mt(l).body,Ur());queueMicrotask((()=>{let n=so();!n&&ct(l)&&x&&(n=function(e,t,n){const r=e.indexOf(t);function o(t){const o=Ar("focus-guard");let i=r+(t?1:0),s=e[i];for(;s&&(!s.isConnected||s.hasAttribute(o)||kt(n,s));)t?i++:i--,s=e[i];return s}return o(!0)||o(!1)}(c,l,x)),C.current&&!A.current&&ct(n)&&(n===r||r===t.body||a)&&n.focus({preventScroll:e})}))}}),[r,x,j,C,v,h,g,T,p]),xr((()=>{if(!r&&P)return P.setFocusManagerState({modal:c,closeOnFocusOut:d,open:f,onOpenChange:m,refs:h}),()=>{P.setFocusManagerState(null)}}),[r,P,c,f,m,h,d]),xr((()=>{if(r)return;if(!j)return;if("function"!=typeof MutationObserver)return;if(w)return;const e=()=>{const e=j.getAttribute("tabindex"),t=L(),n=St(Mt(x)),r=t.indexOf(n);-1!==r&&(M.current=r),k.current.includes("floating")||n!==h.domReference.current&&0===t.length?"0"!==e&&j.setAttribute("tabindex","0"):"-1"!==e&&j.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(j,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}}),[r,x,j,h,k,L,w]);const z=!r&&S&&(!c||!_)&&(D||c);return re.createElement(re.Fragment,null,z&&re.createElement(Zr,{"data-type":"inside",ref:null==P?void 0:P.beforeInsideRef,onFocus:e=>{if(c){const e=F();br("reference"===o[0]?e[0]:e[e.length-1])}else if(null!=P&&P.preserveTabOrder&&P.portalNode)if(A.current=!1,qr(e,P.portalNode)){const e=$r()||b;null==e||e.focus()}else{var t;null==(t=P.beforeOutsideRef.current)||t.focus()}}}),!_&&V("start"),n,V("end"),z&&re.createElement(Zr,{"data-type":"inside",ref:null==P?void 0:P.afterInsideRef,onFocus:e=>{if(c)br(F()[0]);else if(null!=P&&P.preserveTabOrder&&P.portalNode)if(d&&(A.current=!0),qr(e,P.portalNode)){const e=Hr()||b;null==e||e.focus()}else{var t;null==(t=P.afterOutsideRef.current)||t.focus()}}}))}function co(e){return ct(e.target)&&"BUTTON"===e.target.tagName}function uo(e){return Lt(e)}function fo(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:i}}=e,{enabled:s=!0,event:a="click",toggle:l=!0,ignoreMouse:c=!1,keyboardHandlers:u=!0}=t,d=re.useRef(),f=re.useRef(!1),h=re.useMemo((()=>({onPointerDown(e){d.current=e.pointerType},onMouseDown(e){const t=d.current;0===e.button&&"click"!==a&&(Nt(t,!0)&&c||(!n||!l||o.current.openEvent&&"mousedown"!==o.current.openEvent.type?(e.preventDefault(),r(!0,e.nativeEvent,"click")):r(!1,e.nativeEvent,"click")))},onClick(e){const t=d.current;"mousedown"===a&&d.current?d.current=void 0:Nt(t,!0)&&c||(!n||!l||o.current.openEvent&&"click"!==o.current.openEvent.type?r(!0,e.nativeEvent,"click"):r(!1,e.nativeEvent,"click"))},onKeyDown(e){d.current=void 0,e.defaultPrevented||!u||co(e)||(" "!==e.key||uo(i)||(e.preventDefault(),f.current=!0),"Enter"===e.key&&r(!n||!l,e.nativeEvent,"click"))},onKeyUp(e){e.defaultPrevented||!u||co(e)||uo(i)||" "===e.key&&f.current&&(f.current=!1,r(!n||!l,e.nativeEvent,"click"))}})),[o,i,a,c,u,r,n,l]);return re.useMemo((()=>s?{reference:h}:{}),[s,h])}const ho={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},po={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},mo=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 go(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:i}=e,{enabled:s=!0,escapeKey:a=!0,outsidePress:l=!0,outsidePressEvent:c="pointerdown",referencePress:u=!1,referencePressEvent:d="pointerdown",ancestorScroll:f=!1,bubbles:h,capture:p}=t,m=Or(),g=ir("function"==typeof l?l:()=>!1),v="function"==typeof l?g:l,y=re.useRef(!1),b=re.useRef(!1),{escapeKey:x,outsidePress:w}=mo(h),{escapeKey:_,outsidePress:S}=mo(p),k=ir((e=>{var t;if(!n||!s||!a||"Escape"!==e.key)return;const o=null==(t=i.current.floatingContext)?void 0:t.nodeId,l=m?Ir(m.nodesRef.current,o):[];if(!x&&(e.stopPropagation(),l.length>0)){let e=!0;if(l.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")})),E=ir((e=>{var t;const n=()=>{var t;k(e),null==(t=It(e))||t.removeEventListener("keydown",n)};null==(t=It(e))||t.addEventListener("keydown",n)})),C=ir((e=>{var t;const n=y.current;y.current=!1;const s=b.current;if(b.current=!1,"click"===c&&s)return;if(n)return;if("function"==typeof v&&!v(e))return;const a=It(e),l="["+Ar("inert")+"]",u=Mt(o.floating).querySelectorAll(l);let d=lt(a)?a:null;for(;d&&!gt(d);){const e=bt(d);if(gt(e)||!lt(e))break;d=e}if(u.length&<(a)&&!a.matches("html,body")&&!kt(a,o.floating)&&Array.from(u).every((e=>!kt(d,e))))return;if(ct(a)&&R){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"===vt(a).direction&&(r=e.offsetX<=a.offsetWidth-a.clientWidth),r||t&&e.offsetY>a.clientHeight)return}const f=null==(t=i.current.floatingContext)?void 0:t.nodeId,h=m&&Ir(m.nodesRef.current,f).some((t=>{var n;return Dt(e,null==(n=t.context)?void 0:n.elements.floating)}));if(Dt(e,o.floating)||Dt(e,o.domReference)||h)return;const p=m?Ir(m.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")})),T=ir((e=>{var t;const n=()=>{var t;C(e),null==(t=It(e))||t.removeEventListener(c,n)};null==(t=It(e))||t.addEventListener(c,n)}));re.useEffect((()=>{if(!n||!s)return;function e(e){r(!1,e,"ancestor-scroll")}i.current.__escapeKeyBubbles=x,i.current.__outsidePressBubbles=w;const t=Mt(o.floating);a&&t.addEventListener("keydown",_?E:k,_),v&&t.addEventListener(c,S?T:C,S);let l=[];return f&&(lt(o.domReference)&&(l=wt(o.domReference)),lt(o.floating)&&(l=l.concat(wt(o.floating))),!lt(o.reference)&&o.reference&&o.reference.contextElement&&(l=l.concat(wt(o.reference.contextElement)))),l=l.filter((e=>{var n;return e!==(null==(n=t.defaultView)?void 0:n.visualViewport)})),l.forEach((t=>{t.addEventListener("scroll",e,{passive:!0})})),()=>{a&&t.removeEventListener("keydown",_?E:k,_),v&&t.removeEventListener(c,S?T:C,S),l.forEach((t=>{t.removeEventListener("scroll",e)}))}}),[i,o,a,v,c,n,r,f,s,x,w,k,_,E,C,S,T]),re.useEffect((()=>{y.current=!1}),[v,c]);const P=re.useMemo((()=>({onKeyDown:k,[ho[d]]:e=>{u&&r(!1,e.nativeEvent,"reference-press")}})),[k,r,u,d]),R=re.useMemo((()=>({onKeyDown:k,onMouseDown(){b.current=!0},onMouseUp(){b.current=!0},[po[c]]:()=>{y.current=!0}})),[k,c]);return re.useMemo((()=>s?{reference:P,floating:R}:{}),[s,P,R])}function vo(e){void 0===e&&(e={});const{nodeId:t}=e,n=function(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=Er(),i=re.useRef({}),[s]=re.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)))||[])}}}())),a=null!=Rr(),[l,c]=re.useState(r.reference),u=ir(((e,t,r)=>{i.current.openEvent=e?t:void 0,s.emit("openchange",{open:e,event:t,reason:r,nested:a}),null==n||n(e,t,r)})),d=re.useMemo((()=>({setPositionReference:c})),[]),f=re.useMemo((()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference})),[l,r.reference,r.floating]);return re.useMemo((()=>({dataRef:i,open:t,onOpenChange:u,elements:f,events:s,floatingId:o,refs:d})),[t,u,f,s,o,d])}({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,s]=re.useState(null),[a,l]=re.useState(null),c=(null==o?void 0:o.reference)||i,u=re.useRef(null),d=Or();xr((()=>{c&&(u.current=c)}),[c]);const f=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,d]=re.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,h]=re.useState(r);Xn(f,r)||h(r);const[p,m]=re.useState(null),[g,v]=re.useState(null),y=re.useCallback((e=>{e!==_.current&&(_.current=e,m(e))}),[]),b=re.useCallback((e=>{e!==S.current&&(S.current=e,v(e))}),[]),x=i||p,w=s||g,_=re.useRef(null),S=re.useRef(null),k=re.useRef(u),E=null!=l,C=Zn(l),T=Zn(o),P=re.useCallback((()=>{if(!_.current||!S.current)return;const e={placement:t,strategy:n,middleware:f};T.current&&(e.platform=T.current),qn(_.current,S.current,e).then((e=>{const t={...e,isPositioned:!0};R.current&&!Xn(k.current,t)&&(k.current=t,kn.flushSync((()=>{d(t)})))}))}),[f,t,n,T]);Yn((()=>{!1===c&&k.current.isPositioned&&(k.current.isPositioned=!1,d((e=>({...e,isPositioned:!1}))))}),[c]);const R=re.useRef(!1);Yn((()=>(R.current=!0,()=>{R.current=!1})),[]),Yn((()=>{if(x&&(_.current=x),w&&(S.current=w),x&&w){if(C.current)return C.current(x,w,P);P()}}),[x,w,P,C,E]);const O=re.useMemo((()=>({reference:_,floating:S,setReference:y,setFloating:b})),[y,b]),A=re.useMemo((()=>({reference:x,floating:w})),[x,w]),N=re.useMemo((()=>{const e={position:n,left:0,top:0};if(!A.floating)return e;const t=Jn(A.floating,u.x),r=Jn(A.floating,u.y);return a?{...e,transform:"translate("+t+"px, "+r+"px)",...Gn(A.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,a,A.floating,u.x,u.y]);return re.useMemo((()=>({...u,update:P,refs:O,elements:A,floatingStyles:N})),[u,P,O,A,N])}({...e,elements:{...o,...a&&{reference:a}}}),h=re.useCallback((e=>{const t=lt(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;l(t),f.refs.setReference(t)}),[f.refs]),p=re.useCallback((e=>{(lt(e)||null===e)&&(u.current=e,s(e)),(lt(f.refs.reference.current)||null===f.refs.reference.current||null!==e&&!lt(e))&&f.refs.setReference(e)}),[f.refs]),m=re.useMemo((()=>({...f.refs,setReference:p,setPositionReference:h,domReference:u})),[f.refs,p,h]),g=re.useMemo((()=>({...f.elements,domReference:c})),[f.elements,c]),v=re.useMemo((()=>({...f,...r,refs:m,elements:g,nodeId:t})),[f,m,g,t,r]);return xr((()=>{r.dataRef.current.floatingContext=v;const e=null==d?void 0:d.nodesRef.current.find((e=>e.id===t));e&&(e.context=v)})),re.useMemo((()=>({...f,context:v,refs:m,elements:g})),[f,m,g,v])}const yo="active",bo="selected";function xo(e,t,n){const r=new Map,o="item"===n;let i=e;if(o&&e){const{[yo]:t,[bo]:__,...n}=e;i=n}return{..."floating"===n&&{tabIndex:-1},...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&&[yo,bo].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 wo(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)),o=re.useCallback((t=>xo(t,e,"reference")),t),i=re.useCallback((t=>xo(t,e,"floating")),n),s=re.useCallback((t=>xo(t,e,"item")),r);return re.useMemo((()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:s})),[o,i,s])}let _o=!1;function So(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function ko(e,t){return So(t,e===sr||e===ar,e===lr||e===cr)}function Eo(e,t,n){return So(t,e===ar,n?e===lr:e===cr)||"Enter"===e||" "===e||""===e}function Co(e,t,n){return So(t,n?e===cr:e===lr,e===sr)}function To(e,t){const{open:n,onOpenChange:r,elements:o}=e,{listRef:i,activeIndex:s,onNavigate:a=()=>{},enabled:l=!0,selectedIndex:c=null,allowEscape:u=!1,loop:d=!1,nested:f=!1,rtl:h=!1,virtual:p=!1,focusItemOnOpen:m="auto",focusItemOnHover:g=!0,openOnArrowKeyDown:v=!0,disabledIndices:y,orientation:b="vertical",cols:x=1,scrollItemIntoView:w=!0,virtualItemRef:_,itemSizes:S,dense:k=!1}=t,E=Rr(),C=Or(),T=ir(a),P=re.useRef(m),R=re.useRef(null!=c?c:-1),O=re.useRef(null),A=re.useRef(!0),N=re.useRef(T),M=re.useRef(!!o.floating),D=re.useRef(n),I=re.useRef(!1),j=re.useRef(!1),L=Nr(y),F=Nr(n),V=Nr(w),z=Nr(o.floating),B=Nr(c),[W,U]=re.useState(),[K,$]=re.useState(),H=ir((function(e,t,n){function r(e){p?(U(e.id),null==C||C.events.emit("virtualfocus",e),_&&(_.current=e)):br(e,{preventScroll:!0,sync:!(!At()||!Rt())&&(_o||I.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&&Y&&(n||!A.current)&&(null==i.scrollIntoView||i.scrollIntoView("boolean"==typeof s?{block:"nearest",inline:"nearest"}:s))}))}));xr((()=>{document.createElement("div").focus({get preventScroll(){return _o=!0,!1}})}),[]),xr((()=>{l&&(n&&o.floating?P.current&&null!=c&&(j.current=!0,R.current=c,T(c)):M.current&&(R.current=-1,N.current(null)))}),[l,n,o.floating,c,T]),xr((()=>{if(l&&n&&o.floating)if(null==s){if(I.current=!1,null!=B.current)return;if(M.current&&(R.current=-1,H(i,R)),(!D.current||!M.current)&&P.current&&(null!=O.current||!0===P.current&&null==O.current)){let e=0;const t=()=>{null==i.current[0]?(e<2&&(e?requestAnimationFrame:queueMicrotask)(t),e++):(R.current=null==O.current||Eo(O.current,b,h)||f?fr(i,L.current):hr(i,L.current),O.current=null,T(R.current))};t()}}else dr(i,s)||(R.current=s,H(i,R,j.current),j.current=!1)}),[l,n,o.floating,s,B,f,i,b,h,T,H,L]),xr((()=>{var e;if(!l||o.floating||!C||p||!M.current)return;const t=C.nodesRef.current,n=null==(e=t.find((e=>e.id===E)))||null==(e=e.context)?void 0:e.elements.floating,r=St(Mt(o.floating)),i=t.some((e=>e.context&&kt(e.context.elements.floating,r)));n&&!i&&A.current&&n.focus({preventScroll:!0})}),[l,o.floating,C,E,p]),xr((()=>{if(l&&C&&p&&!E)return C.events.on("virtualfocus",e),()=>{C.events.off("virtualfocus",e)};function e(e){$(e.id),_&&(_.current=e)}}),[l,C,p,E,_]),xr((()=>{N.current=T,M.current=!!o.floating})),xr((()=>{n||(O.current=null)}),[n]),xr((()=>{D.current=n}),[n]);const q=null!=s,Y=re.useMemo((()=>{function e(e){if(!n)return;const t=i.current.indexOf(e);-1!==t&&T(t)}return{onFocus(t){let{currentTarget:n}=t;e(n)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},...g&&{onMouseMove(t){let{currentTarget:n}=t;e(n)},onPointerLeave(e){let{pointerType:t}=e;A.current&&"touch"!==t&&(R.current=-1,H(i,R),T(null),p||br(z.current,{preventScroll:!0}))}}}}),[n,z,H,g,i,T,p]),X=ir((e=>{if(A.current=!1,I.current=!0,!F.current&&e.currentTarget===z.current)return;if(f&&Co(e.key,b,h))return Ft(e),r(!1,e.nativeEvent,"list-navigation"),void(ct(o.domReference)&&!p&&o.domReference.focus());const t=R.current,s=fr(i,y),a=hr(i,y);if("Home"===e.key&&(Ft(e),R.current=s,T(R.current)),"End"===e.key&&(Ft(e),R.current=a,T(R.current)),x>1){const t=S||Array.from({length:i.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,x,k),r=n.findIndex((e=>null!=e&&!vr(i.current,e,y))),o=n.reduce(((e,t,n)=>null==t||vr(i.current,t,y)?e:n),-1);if(R.current=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===sr){if(u&&Ft(n),-1===c)d=l;else if(d=pr(e,{startingIndex:d,amount:i,decrement:!0,disabledIndices:s}),o&&(c-ie?n:n-i}dr(e,d)&&(d=c)}if(n.key===ar&&(u&&Ft(n),-1===c?d=a:(d=pr(e,{startingIndex:c,amount:i,disabledIndices:s}),o&&c+i>l&&(d=pr(e,{startingIndex:c%i-i,amount:i,disabledIndices:s}))),dr(e,d)&&(d=c)),"both"===r){const t=Ut(c/i);n.key===cr&&(u&&Ft(n),c%i!=i-1?(d=pr(e,{startingIndex:c,disabledIndices:s}),o&&ur(d,i,t)&&(d=pr(e,{startingIndex:c-c%i-1,disabledIndices:s}))):o&&(d=pr(e,{startingIndex:c-c%i-1,disabledIndices:s})),ur(d,i,t)&&(d=c)),n.key===lr&&(u&&Ft(n),c%i!=0?(d=pr(e,{startingIndex:c,decrement:!0,disabledIndices:s}),o&&ur(d,i,t)&&(d=pr(e,{startingIndex:c+(i-c%i),decrement:!0,disabledIndices:s}))):o&&(d=pr(e,{startingIndex:c+(i-c%i),decrement:!0,disabledIndices:s})),ur(d,i,t)&&(d=c));const r=Ut(l/i)===t;dr(e,d)&&(d=o&&r?n.key===lr?l:pr(e,{startingIndex:c-c%i-1,disabledIndices:s}):c)}return d}({current:n.map((e=>null!=e?i.current[e]:null))},{event:e,orientation:b,loop:d,cols:x,disabledIndices:gr([...y||i.current.map(((e,t)=>vr(i.current,t)?t:void 0)),void 0],n),minIndex:r,maxIndex:o,prevIndex:mr(R.current>a?s:R.current,t,n,x,e.key===ar?"bl":e.key===cr?"tr":"tl"),stopEvent:!0})],T(R.current),"both"===b)return}if(ko(e.key,b)){if(Ft(e),n&&!p&&St(e.currentTarget.ownerDocument)===e.currentTarget)return R.current=Eo(e.key,b,h)?s:a,void T(R.current);Eo(e.key,b,h)?R.current=d?t>=a?u&&t!==i.current.length?-1:s:pr(i,{startingIndex:t,disabledIndices:y}):Math.min(a,pr(i,{startingIndex:t,disabledIndices:y})):R.current=d?t<=s?u&&-1!==t?i.current.length:a:pr(i,{startingIndex:t,decrement:!0,disabledIndices:y}):Math.max(s,pr(i,{startingIndex:t,decrement:!0,disabledIndices:y})),dr(i,R.current)?T(null):T(R.current)}})),G=re.useMemo((()=>p&&n&&q&&{"aria-activedescendant":K||W}),[p,n,q,K,W]),J=re.useMemo((()=>({"aria-orientation":"both"===b?void 0:b,...!Vt(o.domReference)&&G,onKeyDown:X,onPointerMove(){A.current=!0}})),[G,X,o.domReference,b]),Z=re.useMemo((()=>{function e(e){"auto"===m&&Tt(e.nativeEvent)&&(P.current=!0)}return{...G,onKeyDown(e){A.current=!1;const t=0===e.key.indexOf("Arrow"),o=function(e,t,n){return So(t,n?e===lr:e===cr,e===ar)}(e.key,b,h),s=Co(e.key,b,h),a=ko(e.key,b),l=(f?o:a)||"Enter"===e.key||""===e.key.trim();if(p&&n){const n=null==C?void 0:C.nodesRef.current.find((e=>null==e.parentId)),r=C&&n?function(e,t){let n,r=-1;return function t(o,i){i>r&&(n=o,r=i),Ir(e,o).forEach((e=>{t(e.id,i+1)}))}(t,0),e.find((e=>e.id===n))}(C.nodesRef.current,n.id):null;if(t&&r&&_){const t=new KeyboardEvent("keydown",{key:e.key,bubbles:!0});if(o||s){var u,d;const n=(null==(u=r.context)?void 0:u.elements.domReference)===e.currentTarget,a=s&&!n?null==(d=r.context)?void 0:d.elements.domReference:o?i.current.find((e=>(null==e?void 0:e.id)===W)):null;a&&(Ft(e),a.dispatchEvent(t),$(void 0))}var m;if(a&&r.context&&r.context.open&&r.parentId&&e.currentTarget!==r.context.elements.domReference)return Ft(e),void(null==(m=r.context.elements.domReference)||m.dispatchEvent(t))}return X(e)}(n||v||!t)&&(l&&(O.current=f&&a?null:e.key),f?o&&(Ft(e),n?(R.current=fr(i,L.current),T(R.current)):r(!0,e.nativeEvent,"list-navigation")):a&&(null!=c&&(R.current=c),Ft(e),!n&&v?r(!0,e.nativeEvent,"list-navigation"):X(e),n&&T(R.current)))},onFocus(){n&&!p&&T(null)},onPointerDown:function(e){P.current=m,"auto"===m&&Pt(e.nativeEvent)&&(P.current=!0)},onMouseDown:e,onClick:e}}),[W,G,X,L,m,i,f,T,r,n,v,b,h,c,C,p,_]);return re.useMemo((()=>l?{reference:Z,floating:J,item:Y}:{}),[l,Z,J,Y])}const Po=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Ro(e,t){var n;void 0===t&&(t={});const{open:r,floatingId:o}=e,{enabled:i=!0,role:s="dialog"}=t,a=null!=(n=Po.get(s))?n:s,l=Er(),c=null!=Rr(),u=re.useMemo((()=>"tooltip"===a||"label"===s?{["aria-"+("label"===s?"labelledby":"describedby")]:r?o:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":"alertdialog"===a?"dialog":a,"aria-controls":r?o:void 0,..."listbox"===a&&{role:"combobox"},..."menu"===a&&{id:l},..."menu"===a&&c&&{role:"menuitem"},..."select"===s&&{"aria-autocomplete":"none"},..."combobox"===s&&{"aria-autocomplete":"list"}}),[a,o,c,r,l,s]),d=re.useMemo((()=>{const e={id:o,...a&&{role:a}};return"tooltip"===a||"label"===s?e:{...e,..."menu"===a&&{"aria-labelledby":l}}}),[a,o,l,s]),f=re.useCallback((e=>{let{active:t,selected:n}=e;const r={role:"option",...t&&{id:o+"-option"}};switch(s){case"select":return{...r,"aria-selected":t&&n};case"combobox":return{...r,...t&&{"aria-selected":!0}}}return{}}),[o,s]);return re.useMemo((()=>i?{reference:u,floating:d,item:f}:{}),[i,u,d,f])}const Oo=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function Ao(e,t){return"function"==typeof e?e(t):e}function No(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 Mo(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=It(e),x="mouseleave"===e.type,w=kt(d.floating,b),_=kt(d.domReference,b),S=d.domReference.getBoundingClientRect(),k=d.floating.getBoundingClientRect(),E=u.split("-")[0],C=n>k.right-k.width/2,T=c>k.bottom-k.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,S),R=k.width>S.width,O=k.height>S.height,A=(R?S:k).left,N=(R?S:k).right,M=(O?S:k).top,D=(O?S:k).bottom;if(w&&(i=!0,!x))return;if(_&&(i=!1),_&&!x)return void(i=!0);if(x&<(e.relatedTarget)&&kt(d.floating,e.relatedTarget))return;if(p&&Ir(p.nodesRef.current,h).some((e=>{let{context:t}=e;return null==t?void 0:t.open})))return;if("top"===E&&c>=S.bottom-1||"bottom"===E&&c<=S.top+1||"left"===E&&n>=S.right-1||"right"===E&&n<=S.left+1)return m();let I=[];switch(E){case"top":I=[[A,S.top+1],[A,k.bottom-1],[N,k.bottom-1],[N,S.top+1]];break;case"bottom":I=[[A,k.top+1],[A,S.bottom-1],[N,S.bottom-1],[N,k.top+1]];break;case"left":I=[[k.right-1,D],[k.right-1,M],[S.left+1,M],[S.left+1,D]];break;case"right":I=[[S.right-1,D],[S.right-1,M],[k.left+1,M],[k.left+1,D]]}if(!No([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()}No([g,v],function(e){let[n,r]=e;switch(E){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],[k.left,C||R?k.bottom-t:k.top],[k.right,C?R?k.bottom-t:k.top:k.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],[k.left,C||R?k.top+t:k.bottom],[k.right,C?R?k.top+t:k.bottom:k.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?k.right-t:k.left,k.top],[T?O?k.right-t:k.left:k.right-t,k.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?k.left+t:k.right,k.top],[T?O?k.left+t:k.right:k.left+t,k.bottom]]}}([n,c]))?!i&&r&&(o=window.setTimeout(m,40)):m()}}};return c.__options={blockPointerEvents:n},c}const Do=me("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"}]]),Io=me("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 jo="light",Lo=function(e){var t=e.icon,n=void 0===t?null:t,r=e.theme,o=void 0===r?jo:r,i=e.variant,s=void 0===i?"neutral":i,a="[&>svg]:h-5 [&>svg]:w-5",l="light"===o?"text-icon-secondary":"text-icon-inverse";if(n&&(0,re.isValidElement)(n))return{updatedIcon:(0,re.cloneElement)(n,{className:Q(a,l,n.props.className)})};switch(s){case"neutral":return React.createElement(De,{className:Q(a,l)});case"info":var c="light"===o?"text-support-info":"text-support-info-inverse";return React.createElement(De,{className:Q(a,c)});case"success":var u="light"===o?"text-support-success":"text-support-success-inverse";return React.createElement(ve,{className:Q(a,u)});case"warning":var d="light"===o?"text-support-warning":"text-support-warning-inverse";return React.createElement(Do,{className:Q(a,d)});case"error":var f="light"===o?"text-support-error":"text-support-error-inverse";return React.createElement(Io,{className:Q(a,f)});default:return null}},Fo=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?jo: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(ne,{variant:"outline",size:"xs",onClick:o,className:Q("rounded",c,u,"dark"===l?"bg-transparent hover:bg-transparent":"bg-white hover:bg-white")},s);case"link":return React.createElement(ne,{variant:"link",size:"xs",onClick:o,className:Q(c,u)},s);default:return null}},Vo=function(e){var t=e.theme,n=void 0===t?jo:t,r=e.title,o=void 0===r?"":r;return!o&&isNaN(o)?null:React.createElement("span",{className:Q("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?jo:t,r=e.content,o=void 0===r?"":r;return!o&&isNaN(o)?null:React.createElement("span",{className:Q({light:"text-text-primary",dark:"text-text-inverse"}[n],"block text-sm [&_*]:text-sm leading-5 [&_*]:leading-5 font-normal")},o)},Bo=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{})),E=re.useCallback((()=>{var e;const t=null==(e=o.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}),[o]);re.useEffect((()=>{if(a)return i.on("openchange",e),()=>{i.off("openchange",e)};function e(e){let{open:t}=e;t||(clearTimeout(b.current),clearTimeout(w.current),_.current=!0)}}),[a,i]),re.useEffect((()=>{if(!a)return;if(!m.current)return;if(!n)return;function e(e){E()&&r(!1,e,"hover")}const t=Mt(s.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[s.floating,n,r,a,m,E]);const C=re.useCallback((function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const o=Dr(g.current,"close",y.current);o&&!x.current?(clearTimeout(b.current),b.current=window.setTimeout((()=>r(!1,e,n)),o)):t&&(clearTimeout(b.current),r(!1,e,n))}),[g,r]),T=ir((()=>{k.current(),x.current=void 0})),P=ir((()=>{if(S.current){const e=Mt(s.floating).body;e.style.pointerEvents="",e.removeAttribute(Mr),S.current=!1}}));re.useEffect((()=>{if(a&<(s.domReference)){var e;const t=s.domReference;return n&&t.addEventListener("mouseleave",c),null==(e=s.floating)||e.addEventListener("mouseleave",c),f&&t.addEventListener("mousemove",i,{once:!0}),t.addEventListener("mouseenter",i),t.addEventListener("mouseleave",l),()=>{var e;n&&t.removeEventListener("mouseleave",c),null==(e=s.floating)||e.removeEventListener("mouseleave",c),f&&t.removeEventListener("mousemove",i),t.removeEventListener("mouseenter",i),t.removeEventListener("mouseleave",l)}}function t(){return!!o.current.openEvent&&["click","mousedown"].includes(o.current.openEvent.type)}function i(e){if(clearTimeout(b.current),_.current=!1,u&&!Nt(y.current)||d>0&&!Dr(g.current,"open"))return;const t=Dr(g.current,"open",y.current);t?b.current=window.setTimeout((()=>{v.current||r(!0,e,"hover")}),t):r(!0,e,"hover")}function l(e){if(t())return;k.current();const r=Mt(s.floating);if(clearTimeout(w.current),m.current&&o.current.floatingContext){n||clearTimeout(b.current),x.current=m.current({...o.current.floatingContext,tree:h,x:e.clientX,y:e.clientY,onClose(){P(),T(),C(e,!0,"safe-polygon")}});const t=x.current;return r.addEventListener("mousemove",t),void(k.current=()=>{r.removeEventListener("mousemove",t)})}("touch"!==y.current||!kt(s.floating,e.relatedTarget))&&C(e)}function c(e){t()||o.current.floatingContext&&(null==m.current||m.current({...o.current.floatingContext,tree:h,x:e.clientX,y:e.clientY,onClose(){P(),T(),C(e)}})(e))}}),[s,a,e,u,d,f,C,T,P,r,n,v,h,g,m,o]),xr((()=>{var e;if(a&&n&&null!=(e=m.current)&&e.__options.blockPointerEvents&&E()){const e=Mt(s.floating).body;e.setAttribute(Mr,""),e.style.pointerEvents="none",S.current=!0;const n=s.floating;if(lt(s.domReference)&&n){var t;const e=s.domReference,r=null==h||null==(t=h.nodesRef.current.find((e=>e.id===p)))||null==(t=t.context)?void 0:t.elements.floating;return r&&(r.style.pointerEvents=""),e.style.pointerEvents="auto",n.style.pointerEvents="auto",()=>{e.style.pointerEvents="",n.style.pointerEvents=""}}}}),[a,n,p,s,h,m,E]),xr((()=>{n||(y.current=void 0,T(),P())}),[n,T,P]),re.useEffect((()=>()=>{T(),clearTimeout(b.current),clearTimeout(w.current),P()}),[a,s.domReference,T,P]);const R=re.useMemo((()=>{function e(e){y.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function o(){_.current||v.current||r(!0,t,"hover")}u&&!Nt(y.current)||n||0===d||(clearTimeout(w.current),"touch"===y.current?o():w.current=window.setTimeout(o,d))}}}),[u,r,n,v,d]),O=re.useMemo((()=>({onMouseEnter(){clearTimeout(b.current)},onMouseLeave(e){C(e.nativeEvent,!1)}})),[C]);return re.useMemo((()=>a?{reference:R,floating:O}:{}),[a,R,O])}(z,$o({move:!1,enabled:!N&&R.includes("hover")},A&&{handleClose:Mo()})),U=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:i,elements:s}=e,{enabled:a=!0,visibleOnly:l=!0}=t,c=re.useRef(!1),u=re.useRef(),d=re.useRef(!0);re.useEffect((()=>{if(!a)return;const e=it(s.domReference);function t(){!n&&ct(s.domReference)&&s.domReference===St(Mt(s.domReference))&&(c.current=!0)}function r(){d.current=!0}return e.addEventListener("blur",t),e.addEventListener("keydown",r,!0),()=>{e.removeEventListener("blur",t),e.removeEventListener("keydown",r,!0)}}),[s.domReference,n,a]),re.useEffect((()=>{if(a)return o.on("openchange",e),()=>{o.off("openchange",e)};function e(e){let{reason:t}=e;"reference-press"!==t&&"escape-key"!==t||(c.current=!0)}}),[o,a]),re.useEffect((()=>()=>{clearTimeout(u.current)}),[]);const f=re.useMemo((()=>({onPointerDown(e){Pt(e.nativeEvent)||(d.current=!1)},onMouseLeave(){c.current=!1},onFocus(e){if(c.current)return;const t=It(e.nativeEvent);if(l&<(t))try{if(Rt()&&At())throw Error();if(!t.matches(":focus-visible"))return}catch(e){if(!d.current&&!Lt(t))return}r(!0,e.nativeEvent,"focus")},onBlur(e){c.current=!1;const t=e.relatedTarget,n=e.nativeEvent,o=lt(t)&&t.hasAttribute(Ar("focus-guard"))&&"outside"===t.getAttribute("data-type");u.current=window.setTimeout((()=>{var e;const a=St(s.domReference?s.domReference.ownerDocument:document);(t||a!==s.domReference)&&(kt(null==(e=i.current.floatingContext)?void 0:e.refs.floating.current,a)||kt(s.domReference,a)||o||r(!1,n,"focus"))}))}})),[i,s.domReference,r,l]);return re.useMemo((()=>a?{reference:f}:{}),[a,f])}(z,{enabled:!N&&R.includes("focus")}),K=wo([B,W,U,go(z),Ro(z,{role:"tooltip"})]),$=K.getReferenceProps,H=K.getFloatingProps,q=function(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:r,close:o,common:i,duration:s=250}=t,a=e.placement,l=a.split("-")[0],c=re.useMemo((()=>({side:l,placement:a})),[l,a]),u="number"==typeof s,d=(u?s:s.open)||0,f=(u?s:s.close)||0,[h,p]=re.useState((()=>({...Ao(i,c),...Ao(n,c)}))),{isMounted:m,status:g}=function(e,t){void 0===t&&(t={});const{open:n,elements:{floating:r}}=e,{duration:o=250}=t,i=("number"==typeof o?o:o.close)||0,[s,a]=re.useState("unmounted"),l=function(e,t){const[n,r]=re.useState(e);return e&&!n&&r(!0),re.useEffect((()=>{if(!e&&n){const e=setTimeout((()=>r(!1)),t);return()=>clearTimeout(e)}}),[e,n,t]),n}(n,i);return l||"close"!==s||a("unmounted"),xr((()=>{if(r){if(n){a("initial");const e=requestAnimationFrame((()=>{a("open")}));return()=>{cancelAnimationFrame(e)}}a("close")}}),[n,r]),{isMounted:l,status:s}}(e,{duration:s}),v=Nr(n),y=Nr(r),b=Nr(o),x=Nr(i);return xr((()=>{const e=Ao(v.current,c),t=Ao(b.current,c),n=Ao(x.current,c),r=Ao(y.current,c)||Object.keys(e).reduce(((e,t)=>(e[t]="",e)),{});if("initial"===g&&p((t=>({transitionProperty:t.transitionProperty,...n,...e}))),"open"===g&&p({transitionProperty:Object.keys(r).map(Oo).join(","),transitionDuration:d+"ms",...n,...r}),"close"===g){const r=t||e;p({transitionProperty:Object.keys(r).map(Oo).join(","),transitionDuration:f+"ms",...n,...r})}}),[f,b,v,y,x,d,g,c]),{isMounted:m,styles:h}}(z,{duration:150,initial:{opacity:0},open:{opacity:1},close:{opacity:0}}),Y=q.isMounted,X=q.styles,G=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[s],J="dark"===s?"text-tooltip-background-dark":"text-tooltip-background-light";return oe().createElement(oe().Fragment,null,(0,re.isValidElement)(g)&&(0,re.cloneElement)(g,$o($o({},g.props),{},{ref:Bo(g.ref,F.setReference),className:Q(g.props.className)},$())),oe().createElement(to,{id:w,root:b},Y&&oe().createElement("div",Uo({className:Q("absolute z-20 py-2 px-3 rounded-md text-xs leading-4 shadow-soft-shadow-lg",G,"max-w-80 w-fit",v),ref:F.setFloating,style:$o($o({},V),X)},H()),oe().createElement("div",null,!!u&&oe().createElement("span",{className:"font-semibold"},u),!!d&&oe().createElement("div",{className:"font-normal"},d)),h&&oe().createElement(Cr,{ref:j,context:z,placement:l,className:Q("fill-current",J)}))))},Xo=["slug","text","icon","className","disabled","isFirstChild","isLastChild"];function Go(){return Go=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"}[p],"border-0 border-r border-border-subtle border-solid",f===r?"bg-button-disabled":"",c?"rounded-tl rounded-bl border-0 border-r border-border-subtle":"",u?"rounded-tr rounded-br border-0":"",s);return oe().createElement("button",Go({ref:t,className:g,disabled:l,onClick:function(e){h(e,{slug:r,text:o})}},d),"left"===m&&i&&oe().createElement("span",{className:"mr-1"},i),o,"right"===m&&i&&oe().createElement("span",{className:"ml-1"},i))},Qo={Group:function(e){var t=e.children,n=e.activeItem,r=void 0===n?null:n,o=e.onChange,i=e.className,s=e.size,a=void 0===s?"md":s,l=e.iconPosition,c=void 0===l?"left":l,u=(0,re.useCallback)((function(e,t){o&&o({event:e,value:t})}),[o]),d=Q("box-border flex border border-border-subtle border-solid rounded",i);return oe().createElement("div",{className:d},oe().createElement(Jo.Provider,{value:{activeItem:r,onChange:u,size:a,iconPosition:c}},oe().Children.map(t,(function(e,n){if(!(0,re.isValidElement)(e))return null;var r=0===n,o=n===oe().Children.count(t)-1;return oe().cloneElement(e,{index:n,isFirstChild:r,isLastChild:o})}))))},Button:(0,re.forwardRef)(Zo)},ei=Qo,ti=n(848);const ni=(0,re.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),ri=(0,re.createContext)({}),oi=(0,re.createContext)(null),ii="undefined"!=typeof window,si=ii?re.useLayoutEffect:re.useEffect,ai=(0,re.createContext)({strict:!1}),li=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),ci="data-"+li("framerAppearId"),ui=["read","resolveKeyframes","update","preRender","render","postRender"];function di(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,s=ui.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:ui.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{d&&d.update(n,l)}));const h=n[ci],p=(0,re.useRef)(Boolean(h)&&!window.MotionHandoffIsComplete&&(null===(i=window.MotionHasOptimisedAnimation)||void 0===i?void 0:i.call(window,h)));return si((()=>{d&&(d.updateFeatures(),fi.render(d.render),p.current&&d.animationState&&d.animationState.animateChanges())})),(0,re.useEffect)((()=>{d&&(!p.current&&d.animationState&&d.animationState.animateChanges(),p.current=!1,gi||(gi=!0,queueMicrotask(yi)))})),d}function yi(){window.MotionHandoffIsComplete=!0}function bi(e){if(e)return!1!==e.options.allowProjection?e.projection:bi(e.parent)}function xi(e,t,n){return(0,re.useCallback)((r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&("function"==typeof n?n(r):pi(n)&&(n.current=r))}),[t])}function wi(e){return"string"==typeof e||Array.isArray(e)}function _i(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}const Si=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ki=["initial",...Si];function Ei(e){return _i(e.animate)||ki.some((t=>wi(e[t])))}function Ci(e){return Boolean(Ei(e)||e.variants)}function Ti(e){return Array.isArray(e)?e.join(" "):e}const Pi={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"]},Ri={};for(const e in Pi)Ri[e]={isEnabled:t=>Pi[e].some((e=>!!t[e]))};const Oi=(0,re.createContext)({}),Ai=Symbol.for("motionComponentSymbol");function Ni({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:o}){e&&function(e){for(const t in e)Ri[t]={...Ri[t],...e[t]}}(e);const i=(0,re.forwardRef)((function(e,i){let s;const a={...(0,re.useContext)(ni),...e,layoutId:Mi(e)},{isStatic:l}=a,c=function(e){const{initial:t,animate:n}=function(e,t){if(Ei(e)){const{initial:t,animate:n}=e;return{initial:!1===t||wi(t)?t:void 0,animate:wi(n)?n:void 0}}return!1!==e.inherit?t:{}}(e,(0,re.useContext)(ri));return(0,re.useMemo)((()=>({initial:t,animate:n})),[Ti(t),Ti(n)])}(e),u=r(e,l);if(!l&&ii){(0,re.useContext)(ai).strict;const e=function(e){const{drag:t,layout:n}=Ri;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}}(a);s=e.MeasureLayout,c.visualElement=vi(o,u,a,t,e.ProjectionNode)}return(0,ti.jsxs)(ri.Provider,{value:c,children:[s&&c.visualElement?(0,ti.jsx)(s,{visualElement:c.visualElement,...a}):null,n(o,e,xi(u,c.visualElement,i),u,l,c.visualElement)]})}));return i[Ai]=o,i}function Mi({layoutId:e}){const t=(0,re.useContext)(Oi).id;return t&&void 0!==e?t+"-"+e:e}function Di(e){function t(t,n={}){return Ni(e(t,n))}if("undefined"==typeof Proxy)return t;const n=new Map;return new Proxy(t,{get:(e,r)=>(n.has(r)||n.set(r,t(r)),n.get(r))})}const Ii=["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 ji(e){return"string"==typeof e&&!e.includes("-")&&!!(Ii.indexOf(e)>-1||/[A-Z]/u.test(e))}const Li={},Fi=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Vi=new Set(Fi);function zi(e,{layout:t,layoutId:n}){return Vi.has(e)||e.startsWith("origin")||(t||void 0!==n)&&(!!Li[e]||"opacity"===e)}const Bi=e=>Boolean(e&&e.getVelocity),Wi=(e,t)=>t&&"number"==typeof e?t.transform(e):e,Ui=(e,t,n)=>n>t?t:n"number"==typeof e,parse:parseFloat,transform:e=>e},$i={...Ki,transform:e=>Ui(0,1,e)},Hi={...Ki,default:1},qi=e=>Math.round(1e5*e)/1e5,Yi=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,Xi=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,Gi=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;function Ji(e){return"string"==typeof e}const Zi=e=>({test:t=>Ji(t)&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),Qi=Zi("deg"),es=Zi("%"),ts=Zi("px"),ns=Zi("vh"),rs=Zi("vw"),os={...es,parse:e=>es.parse(e)/100,transform:e=>es.transform(100*e)},is={...Ki,transform:Math.round},ss={borderWidth:ts,borderTopWidth:ts,borderRightWidth:ts,borderBottomWidth:ts,borderLeftWidth:ts,borderRadius:ts,radius:ts,borderTopLeftRadius:ts,borderTopRightRadius:ts,borderBottomRightRadius:ts,borderBottomLeftRadius:ts,width:ts,maxWidth:ts,height:ts,maxHeight:ts,size:ts,top:ts,right:ts,bottom:ts,left:ts,padding:ts,paddingTop:ts,paddingRight:ts,paddingBottom:ts,paddingLeft:ts,margin:ts,marginTop:ts,marginRight:ts,marginBottom:ts,marginLeft:ts,rotate:Qi,rotateX:Qi,rotateY:Qi,rotateZ:Qi,scale:Hi,scaleX:Hi,scaleY:Hi,scaleZ:Hi,skew:Qi,skewX:Qi,skewY:Qi,distance:ts,translateX:ts,translateY:ts,translateZ:ts,x:ts,y:ts,z:ts,perspective:ts,transformPerspective:ts,opacity:$i,originX:os,originY:os,originZ:ts,zIndex:is,backgroundPositionX:ts,backgroundPositionY:ts,fillOpacity:$i,strokeOpacity:$i,numOctaves:is},as={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ls=Fi.length,cs=e=>t=>"string"==typeof t&&t.startsWith(e),us=cs("--"),ds=cs("var(--"),fs=e=>!!ds(e)&&hs.test(e.split("/*")[0].trim()),hs=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function ps(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(Vi.has(e))s=!0;else if(us(e))o[e]=n;else{const t=Wi(n,ss[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({style:{},transform:{},transformOrigin:{},vars:{}});function gs(e,t,n){for(const r in t)Bi(t[r])||zi(r,n)||(e[r]=t[r])}function vs(e,t){const n={},r=function(e,t){const n={};return gs(n,e.style||{},e),Object.assign(n,function({transformTemplate:e},t){return(0,re.useMemo)((()=>{const n=ms();return ps(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 ys=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 bs(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||ys.has(e)}let xs=e=>!bs(e);try{(ws=n(316).A)&&(xs=e=>e.startsWith("on")?!bs(e):ws(e))}catch(e){}var ws;function _s(e,t,n){return"string"==typeof e?e:ts.transform(t+n*e)}const Ss={offset:"stroke-dashoffset",array:"stroke-dasharray"},ks={offset:"strokeDashoffset",array:"strokeDasharray"};function Es(e,{attrX:t,attrY:n,attrScale:r,originX:o,originY:i,pathLength:s,pathSpacing:a=1,pathOffset:l=0,...c},u,d){if(ps(e,c,d),u)return void(e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox));e.attrs=e.style,e.style={};const{attrs:f,style:h,dimensions:p}=e;f.transform&&(p&&(h.transform=f.transform),delete f.transform),p&&(void 0!==o||void 0!==i||h.transform)&&(h.transformOrigin=function(e,t,n){return`${_s(t,e.x,e.width)} ${_s(n,e.y,e.height)}`}(p,void 0!==o?o:.5,void 0!==i?i:.5)),void 0!==t&&(f.x=t),void 0!==n&&(f.y=n),void 0!==r&&(f.scale=r),void 0!==s&&function(e,t,n=1,r=0,o=!0){e.pathLength=1;const i=o?Ss:ks;e[i.offset]=ts.transform(-r);const s=ts.transform(t),a=ts.transform(n);e[i.array]=`${s} ${a}`}(f,s,a,l,!1)}const Cs=()=>({...ms(),attrs:{}}),Ts=e=>"string"==typeof e&&"svg"===e.toLowerCase();function Ps(e,t,n,r){const o=(0,re.useMemo)((()=>{const n=Cs();return Es(n,t,Ts(r),e.transformTemplate),{...n.attrs,style:{...n.style}}}),[t]);if(e.style){const t={};gs(t,e.style,e),o.style={...t,...o.style}}return o}function Rs(e=!1){return(t,n,r,{latestValues:o},i)=>{const s=(ji(t)?Ps:vs)(n,o,i,t),a=function(e,t,n){const r={};for(const o in e)"values"===o&&"object"==typeof e.values||(xs(o)||!0===n&&bs(o)||!t&&!bs(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}(n,"string"==typeof t,e),l=t!==re.Fragment?{...a,...s,ref:r}:{},{children:c}=n,u=(0,re.useMemo)((()=>Bi(c)?c.get():c),[c]);return(0,re.createElement)(t,{...l,children:u})}}function Os(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 As=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 Ns(e,t,n,r){Os(e,t,void 0,r);for(const n in t.attrs)e.setAttribute(As.has(n)?n:li(n),t.attrs[n])}function Ms(e,t,n){var r;const{style:o}=e,i={};for(const s in o)(Bi(o[s])||t.style&&Bi(t.style[s])||zi(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 Ds(e,t,n){const r=Ms(e,t,n);for(const n in e)(Bi(e[n])||Bi(t[n]))&&(r[-1!==Fi.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=e[n]);return r}function Is(e){const t=[{},{}];return null==e||e.values.forEach(((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()})),t}function js(e,t,n,r){if("function"==typeof t){const[o,i]=Is(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]=Is(r);t=t(void 0!==n?n:e.custom,o,i)}return t}function Ls(e){const t=(0,re.useRef)(null);return null===t.current&&(t.current=e()),t.current}const Fs=e=>Array.isArray(e),Vs=e=>Boolean(e&&"object"==typeof e&&e.mix&&e.toValue),zs=e=>Fs(e)?e[e.length-1]||0:e;function Bs(e){const t=Bi(e)?e.get():e;return Vs(t)?t.toValue():t}const Ws=new Set(["opacity","clipPath","filter","transform"]);function Us(e){return Vi.has(e)?"transform":Ws.has(e)?li(e):void 0}function Ks(e,t){-1===e.indexOf(t)&&e.push(t)}function $s(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Hs=e=>(t,n)=>{const r=(0,re.useContext)(ri),o=(0,re.useContext)(oi),i=()=>function({applyWillChange:e=!1,scrapeMotionValuesFromProps:t,createRenderState:n,onMount:r},o,i,s,a){const l={latestValues:Xs(o,i,s,!a&&e,t),renderState:n()};return r&&(l.mount=e=>r(o,e,l)),l}(e,t,r,o,n);return n?i():Ls(i)};function qs(e,t){const n=Us(t);n&&Ks(e,n)}function Ys(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&&!_i(d)&&Ys(e,d,(e=>{for(const t in e)qs(a,t)})),a.length&&(s.willChange=a.join(","))),s}const Gs=e=>e,{schedule:Js,cancel:Zs,state:Qs,steps:ea}=di("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:Gs,!0),ta={useVisualState:Hs({scrapeMotionValuesFromProps:Ds,createRenderState:Cs,onMount:(e,t,{renderState:n,latestValues:r})=>{Js.read((()=>{try{n.dimensions="function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch(e){n.dimensions={x:0,y:0,width:0,height:0}}})),Js.render((()=>{Es(n,r,Ts(t.tagName),e.transformTemplate),Ns(t,n)}))}})},na={useVisualState:Hs({applyWillChange:!0,scrapeMotionValuesFromProps:Ms,createRenderState:ms})};function ra(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const oa=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary;function ia(e,t="page"){return{point:{x:e[`${t}X`],y:e[`${t}Y`]}}}const sa=e=>t=>oa(t)&&e(t,ia(t));function aa(e,t,n,r){return ra(e,t,sa(n),r)}const la=(e,t)=>n=>t(e(n)),ca=(...e)=>e.reduce(la);function ua(e){let t=null;return()=>null===t&&(t=e,()=>{t=null})}const da=ua("dragHorizontal"),fa=ua("dragVertical");function ha(e){let t=!1;if("y"===e)t=fa();else if("x"===e)t=da();else{const e=da(),n=fa();e&&n?t=()=>{e(),n()}:(e&&e(),n&&n())}return t}function pa(){const e=ha(!0);return!e||(e(),!1)}class ma{constructor(e){this.isMounted=!1,this.node=e}update(){}}function ga(e,t){const n=t?"pointerenter":"pointerleave",r=t?"onHoverStart":"onHoverEnd";return aa(e.current,n,((n,o)=>{if("touch"===n.pointerType||pa())return;const i=e.getProps();e.animationState&&i.whileHover&&e.animationState.setActive("whileHover",t);const s=i[r];s&&Js.postRender((()=>s(n,o)))}),{passive:!e.getProps()[r]})}const va=(e,t)=>!!t&&(e===t||va(e,t.parentElement));function ya(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,ia(n))}const ba=new WeakMap,xa=new WeakMap,wa=e=>{const t=ba.get(e.target);t&&t(e)},_a=e=>{e.forEach(wa)};const Sa={some:0,all:1},ka={inView:{Feature:class extends ma{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:Sa[r]};return function(e,t,n){const r=function({root:e,...t}){const n=e||document;xa.has(n)||xa.set(n,{});const r=xa.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(_a,{root:e,...t})),r[o]}(t);return ba.set(e,n),r.observe(e),()=>{ba.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 ma{constructor(){super(...arguments),this.removeStartListeners=Gs,this.removeEndListeners=Gs,this.removeAccessibleListeners=Gs,this.startPointerPress=(e,t)=>{if(this.isPressing)return;this.removeEndListeners();const n=this.node.getProps(),r=aa(window,"pointerup",((e,t)=>{if(!this.checkPressEnd())return;const{onTap:n,onTapCancel:r,globalTapTarget:o}=this.node.getProps(),i=o||va(this.node.current,e.target)?n:r;i&&Js.update((()=>i(e,t)))}),{passive:!(n.onTap||n.onPointerUp)}),o=aa(window,"pointercancel",((e,t)=>this.cancelPress(e,t)),{passive:!(n.onTapCancel||n.onPointerCancel)});this.removeEndListeners=ca(r,o),this.startPress(e,t)},this.startAccessiblePress=()=>{const e=ra(this.node.current,"keydown",(e=>{"Enter"!==e.key||this.isPressing||(this.removeEndListeners(),this.removeEndListeners=ra(this.node.current,"keyup",(e=>{"Enter"===e.key&&this.checkPressEnd()&&ya("up",((e,t)=>{const{onTap:n}=this.node.getProps();n&&Js.postRender((()=>n(e,t)))}))})),ya("down",((e,t)=>{this.startPress(e,t)})))})),t=ra(this.node.current,"blur",(()=>{this.isPressing&&ya("cancel",((e,t)=>this.cancelPress(e,t)))}));this.removeAccessibleListeners=ca(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&&Js.postRender((()=>n(e,t)))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!pa()}cancelPress(e,t){if(!this.checkPressEnd())return;const{onTapCancel:n}=this.node.getProps();n&&Js.postRender((()=>n(e,t)))}mount(){const e=this.node.getProps(),t=aa(e.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),n=ra(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=ca(t,n)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}},focus:{Feature:class extends ma{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=ca(ra(this.node.current,"focus",(()=>this.onFocus())),ra(this.node.current,"blur",(()=>this.onBlur())))}unmount(){}}},hover:{Feature:class extends ma{mount(){this.unmount=ca(ga(this.node,!0),ga(this.node,!1))}unmount(){}}}};function Ea(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r1e3*e,Pa=e=>e/1e3,Ra={type:"spring",stiffness:500,damping:25,restSpeed:10},Oa={type:"keyframes",duration:.8},Aa={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Na=(e,{keyframes:t})=>t.length>2?Oa:Vi.has(e)?e.startsWith("scale")?{type:"spring",stiffness:550,damping:0===t[1]?2*Math.sqrt(550):30,restSpeed:10}:Ra:Aa;function Ma(e,t){return e[t]||e.default||e}const Da=e=>null!==e;function Ia(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(Da),i=t&&"loop"!==n&&t%2==1?0:o.length-1;return i&&void 0!==r?r:o[i]}const ja=e=>/^0[^.\s]+$/u.test(e);let La=Gs,Fa=Gs;const Va=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),za=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ba(e,t,n=1){Fa(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=za.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 Va(e)?parseFloat(e):e}return fs(o)?Ba(o,t,n+1):o}const Wa=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),Ua=e=>e===Ki||e===ts,Ka=(e,t)=>parseFloat(e.split(", ")[t]),$a=(e,t)=>(n,{transform:r})=>{if("none"===r||!r)return 0;const o=r.match(/^matrix3d\((.+)\)$/u);if(o)return Ka(o[1],t);{const t=r.match(/^matrix\((.+)\)$/u);return t?Ka(t[1],e):0}},Ha=new Set(["x","y","z"]),qa=Fi.filter((e=>!Ha.has(e))),Ya={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:$a(4,13),y:$a(5,14)};Ya.translateX=Ya.x,Ya.translateY=Ya.y;const Xa=e=>t=>t.test(e),Ga=[Ki,ts,es,Qi,rs,ns,{test:e=>"auto"===e,parse:e=>e}],Ja=e=>Ga.find(Xa(e)),Za=new Set;let Qa=!1,el=!1;function tl(){if(el){const e=Array.from(Za).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 qa.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)}))}el=!1,Qa=!1,Za.forEach((e=>e.complete())),Za.clear()}function nl(){Za.forEach((e=>{e.readKeyframes(),e.needsMeasurement&&(el=!0)}))}class rl{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?(Za.add(this),Qa||(Qa=!0,Js.read(nl),Js.resolveKeyframes(tl))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;for(let o=0;on=>Boolean(Ji(n)&&Gi.test(n)&&n.startsWith(e)||t&&!function(e){return null==e}(n)&&Object.prototype.hasOwnProperty.call(n,t)),il=(e,t,n)=>r=>{if(!Ji(r))return r;const[o,i,s,a]=r.match(Yi);return{[e]:parseFloat(o),[t]:parseFloat(i),[n]:parseFloat(s),alpha:void 0!==a?parseFloat(a):1}},sl={...Ki,transform:e=>Math.round((e=>Ui(0,255,e))(e))},al={test:ol("rgb","red"),parse:il("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+sl.transform(e)+", "+sl.transform(t)+", "+sl.transform(n)+", "+qi($i.transform(r))+")"},ll={test:ol("#"),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:al.transform},cl={test:ol("hsl","hue"),parse:il("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+es.transform(qi(t))+", "+es.transform(qi(n))+", "+qi($i.transform(r))+")"},ul={test:e=>al.test(e)||ll.test(e)||cl.test(e),parse:e=>al.test(e)?al.parse(e):cl.test(e)?cl.parse(e):ll.parse(e),transform:e=>Ji(e)?e:e.hasOwnProperty("red")?al.transform(e):cl.transform(e)},dl="number",fl="color",hl="var",pl="var(",ml="${}",gl=/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 vl(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let i=0;const s=t.replace(gl,(e=>(ul.test(e)?(r.color.push(i),o.push(fl),n.push(ul.parse(e))):e.startsWith(pl)?(r.var.push(i),o.push(hl),n.push(e)):(r.number.push(i),o.push(dl),n.push(parseFloat(e))),++i,ml))).split(ml);return{values:n,split:s,indexes:r,types:o}}function yl(e){return vl(e).values}function bl(e){const{split:t,types:n}=vl(e),r=t.length;return e=>{let o="";for(let i=0;i"number"==typeof e?0:e,wl={test:function(e){var t,n;return isNaN(e)&&Ji(e)&&((null===(t=e.match(Yi))||void 0===t?void 0:t.length)||0)+((null===(n=e.match(Xi))||void 0===n?void 0:n.length)||0)>0},parse:yl,createTransformer:bl,getAnimatableNone:function(e){const t=yl(e);return bl(e)(t.map(xl))}},_l=new Set(["brightness","contrast","saturate","opacity"]);function Sl(e){const[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[r]=n.match(Yi)||[];if(!r)return e;const o=n.replace(r,"");let i=_l.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+o+")"}const kl=/\b([a-z-]*)\(.*?\)/gu,El={...wl,getAnimatableNone:e=>{const t=e.match(kl);return t?t.map(Sl).join(" "):e}},Cl={...ss,color:ul,backgroundColor:ul,outlineColor:ul,fill:ul,stroke:ul,borderColor:ul,borderTopColor:ul,borderRightColor:ul,borderBottomColor:ul,borderLeftColor:ul,filter:El,WebkitFilter:El},Tl=e=>Cl[e];function Pl(e,t){let n=Tl(e);return n!==El&&(n=wl),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Rl=new Set(["auto","none","0"]);class Ol extends rl{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 Al(e){let t;return()=>(void 0===t&&(t=e()),t)}let Nl;function Ml(){Nl=void 0}const Dl={now:()=>(void 0===Nl&&Dl.set(Qs.isProcessing?Qs.timestamp:performance.now()),Nl),set:e=>{Nl=e,queueMicrotask(Ml)}},Il=(e,t)=>!("zIndex"===t||"number"!=typeof e&&!Array.isArray(e)&&("string"!=typeof e||!wl.test(e)&&"0"!==e||e.startsWith("url(")));class jl{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=Dl.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||(nl(),tl()),this._resolved}onKeyframesResolved(e,t){this.resolvedAt=Dl.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=Il(o,t),a=Il(i,t);return La(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 Ll(e,t){return t?e*(1e3/t):0}const Fl=5;function Vl(e,t,n){const r=Math.max(t-Fl,0);return Ll(n-e(r),t-r)}const zl=.001,Bl=.01,Wl=10,Ul=.05,Kl=1;const $l=12;function Hl(e,t){return e*Math.sqrt(1-t*t)}const ql=["duration","bounce"],Yl=["stiffness","damping","mass"];function Xl(e,t){return t.some((t=>void 0!==e[t]))}function Gl({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(!Xl(e,Yl)&&Xl(e,ql)){const n=function({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let o,i;La(e<=Ta(Wl),"Spring duration must be 10 seconds or less");let s=1-t;s=Ui(Ul,Kl,s),e=Ui(Bl,Wl,Pa(e)),s<1?(o=t=>{const r=t*s,o=r*e,i=r-n,a=Hl(t,s),l=Math.exp(-o);return zl-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=Hl(Math.pow(t,2),s);return(-o(t)+zl>0?-1:1)*((i-a)*l)/c}):(o=t=>Math.exp(-t*e)*((t-n)*e+1)-zl,i=t=>Math.exp(-t*e)*(e*e*(n-t)));const a=function(e,t,n){let r=n;for(let n=1;n<$l;n++)r-=e(r)/t(r);return r}(o,i,5/e);if(e=Ta(e),isNaN(a))return{stiffness:100,damping:10,duration:e};{const t=Math.pow(a,2)*r;return{stiffness:t,damping:2*s*Math.sqrt(r*t),duration:e}}}(e);t={...t,...n,mass:1},t.isResolvedFromDuration=!0}return t}({...r,velocity:-Pa(r.velocity||0)}),h=d||0,p=l/(2*Math.sqrt(a*c)),m=i-o,g=Pa(Math.sqrt(a/c)),v=Math.abs(m)<5;let y;if(n||(n=v?.01:2),t||(t=v?.005:.5),p<1){const e=Hl(g,p);y=t=>{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?Ta(h):Vl(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 Jl({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=>{var t;t=f.value,(void 0!==a&&tl)&&(x=e,w=Gl({keyframes:[f.value,h(f.value)],velocity:Vl(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 Zl=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function Ql(e,t,n,r){if(e===t&&n===r)return Gs;return o=>0===o||1===o?o:Zl(function(e,t,n,r,o){let i,s,a=0;do{s=t+(n-t)/2,i=Zl(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 ec=Ql(.42,0,1,1),tc=Ql(0,0,.58,1),nc=Ql(.42,0,.58,1),rc=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,oc=e=>t=>1-e(1-t),ic=e=>1-Math.sin(Math.acos(e)),sc=oc(ic),ac=rc(ic),lc=Ql(.33,1.53,.69,.99),cc=oc(lc),uc=rc(cc),dc={linear:Gs,easeIn:ec,easeInOut:nc,easeOut:tc,circIn:ic,circInOut:ac,circOut:sc,backIn:cc,backInOut:uc,backOut:lc,anticipate:e=>(e*=2)<1?.5*cc(e):.5*(2-Math.pow(2,-10*(e-1)))},fc=e=>{if(Array.isArray(e)){Fa(4===e.length,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,o]=e;return Ql(t,n,r,o)}return"string"==typeof e?(Fa(void 0!==dc[e],`Invalid easing type '${e}'`),dc[e]):e},hc=(e,t,n)=>{const r=t-e;return 0===r?1:(n-e)/r},pc=(e,t,n)=>e+(t-e)*n;function mc(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 gc(e,t){return n=>n>0?t:e}const vc=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},yc=[ll,al,cl];function bc(e){const t=(n=e,yc.find((e=>e.test(n))));var n;if(La(Boolean(t),`'${e}' is not an animatable color. Use the equivalent color code instead.`),!Boolean(t))return!1;let r=t.parse(e);return t===cl&&(r=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=mc(a,r,e+1/3),i=mc(a,r,e),s=mc(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}}(r)),r}const xc=(e,t)=>{const n=bc(e),r=bc(t);if(!n||!r)return gc(e,t);const o={...n};return e=>(o.red=vc(n.red,r.red,e),o.green=vc(n.green,r.green,e),o.blue=vc(n.blue,r.blue,e),o.alpha=pc(n.alpha,r.alpha,e),al.transform(o))},wc=new Set(["none","hidden"]);function _c(e,t){return n=>pc(e,t,n)}function Sc(e){return"number"==typeof e?_c:"string"==typeof e?fs(e)?gc:ul.test(e)?xc:Cc:Array.isArray(e)?kc:"object"==typeof e?ul.test(e)?xc:Ec:gc}function kc(e,t){const n=[...e],r=n.length,o=e.map(((e,n)=>Sc(e)(e,t[n])));return e=>{for(let t=0;t{for(const t in r)n[t]=r[t](e);return n}}const Cc=(e,t)=>{const n=wl.createTransformer(t),r=vl(e),o=vl(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?wc.has(e)&&!o.values.length||wc.has(t)&&!r.values.length?function(e,t){return wc.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}(e,t):ca(kc(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(fc):fc(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=hc(0,t,r);e.push(pc(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(Fa(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||Tc,i=e.length-1;for(let n=0;n{let n=0;if(a>1)for(;nl(Ui(e[0],e[i-1],t)):l}(s,t,{ease:Array.isArray(o)?o:(l=t,c=o,l.map((()=>c||nc)).splice(0,l.length-1))});var l,c;return{calculatedDuration:e,next:t=>(i.value=a(t),i.done=t>=e,i)}}const Rc=e=>{const t=({timestamp:t})=>e(t);return{start:()=>Js.update(t,!0),stop:()=>Zs(t),now:()=>Qs.isProcessing?Qs.timestamp:Dl.now()}},Oc={decay:Jl,inertia:Jl,tween:Pc,keyframes:Pc,spring:Gl},Ac=e=>e/100;class Nc extends jl{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)||rl;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=Oc[t]||Pc;let a,l;s!==Pc&&"number"!=typeof e[0]&&(a=ca(Ac,Tc(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=Ui(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=Ia(a,this.options,r)),m&&m(x.value),_&&this.finish(),x}get duration(){const{resolved:e}=this;return e?Pa(e.calculatedDuration):0}get time(){return Pa(this.currentTime)}set time(e){e=Ta(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=Pa(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:e=Rc,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 Mc=e=>Array.isArray(e)&&"number"==typeof e[0];function Dc(e){return Boolean(!e||"string"==typeof e&&e in jc||Mc(e)||Array.isArray(e)&&e.every(Dc))}const Ic=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,jc={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ic([0,.65,.55,1]),circOut:Ic([.55,0,1,.45]),backIn:Ic([.31,.01,.66,-.59]),backOut:Ic([.33,1.53,.69,.99])};function Lc(e){return Fc(e)||jc.easeOut}function Fc(e){return e?Mc(e)?Ic(e):Array.isArray(e)?e.map(Lc):jc[e]:void 0}const Vc=Al((()=>Object.hasOwnProperty.call(Element.prototype,"animate")));class zc extends jl{constructor(e){super(e);const{name:t,motionValue:n,element:r,keyframes:o}=this.options;this.resolver=new Ol(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||!Dc(u.ease)){const{onComplete:t,onUpdate:n,motionValue:a,element:l,...c}=this.options,u=function(e,t){const n=new Nc({...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=Fc(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(Ia(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 Pa(t)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:t}=e;return Pa(t.currentTime||0)}set time(e){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.currentTime=Ta(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 Gs;const{animation:n}=t;n.timeline=e,n.onfinish=null}else this.pendingTimeline=e;return Gs}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 Nc({...c,keyframes:n,duration:r,type:o,ease:i,times:s,isGenerator:!0}),d=Ta(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 Vc()&&n&&Ws.has(n)&&t&&t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate&&!r&&"mirror"!==o&&0!==i&&"inertia"!==s}}const Bc=Al((()=>void 0!==window.ScrollTimeline));class Wc{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(!Bc()||!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 Js.update(o,!0),()=>Zs(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 Uc=(e,t,n,r={},o,i,s)=>a=>{const l=Ma(r,e)||{},c=l.delay||r.delay||0;let{elapsed:u=0}=r;u-=Ta(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,...Na(e,d)}),d.duration&&(d.duration=Ta(d.duration)),d.repeatDelay&&(d.repeatDelay=Ta(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=Ia(d.keyframes,l);if(void 0!==e)return Js.update((()=>{d.onUpdate(e),d.onComplete()})),new Wc([])}return!i&&zc.supports(d)?new zc(d):new Nc(d)};class Kc{constructor(){this.subscriptions=[]}add(e){return Ks(this.subscriptions,e),()=>$s(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=Dl.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=Dl.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 Kc);const n=this.events[e].add(t);return"change"===e?()=>{n(),Js.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 $c.current&&$c.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=Dl.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return Ll(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 qc(e,t){return new Hc(e,t)}function Yc(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,qc(n))}function Xc(e){return e.getProps()[ci]}class Gc extends Hc{constructor(){super(...arguments),this.output=[],this.counts=new Map}add(e){const t=Us(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&&($s(this.output,t),this.update())}}update(){this.set(this.output.length?this.output.join(", "):"auto")}}function Jc(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 Gc("auto"),e.addValue("willChange",r)),o=r,Boolean(Bi(o)&&o.add)?r.add(t):void 0;var o}function Zc({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&!0!==t[n];return t[n]=!1,r}function Qc(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&&Zc(u,t))continue;const a={delay:n,...Ma(s||{},t)};let d=!1;if(window.MotionHandoffAnimation){const n=Xc(e);if(n){const e=window.MotionHandoffAnimation(n,t,Js);null!==e&&(a.startTime=e,d=!0)}}r.start(Uc(t,r,o,e.shouldReduceMotion&&Vi.has(t)?{type:!1}:a,e,d,Jc(e,t)));const f=r.animation;f&&c.push(f)}return a&&Promise.all(c).then((()=>{Js.update((()=>{a&&function(e,t){const n=Ca(e,t);let{transitionEnd:r={},transition:o={},...i}=n||{};i={...i,...r};for(const t in i)Yc(e,t,zs(i[t]))}(e,a)}))})),c}function eu(e,t,n={}){var r;const o=Ca(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(Qc(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(tu).forEach(((e,r)=>{e.notify("AnimationStart",t),s.push(eu(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 tu(e,t){return e.sortNodePosition(t)}const nu=[...Si].reverse(),ru=Si.length;function ou(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function iu(){return{animate:ou(!0),whileInView:ou(),whileHover:ou(),whileTap:ou(),whileDrag:ou(),whileFocus:ou(),exit:ou()}}let su=0;const au={animation:{Feature:class extends ma{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=>eu(e,t,n)));r=Promise.all(o)}else if("string"==typeof t)r=eu(e,t,n);else{const o="function"==typeof t?Ca(e,t,n.custom):t;r=Promise.all(Qc(e,o,n))}return r.then((()=>{e.notify("AnimationComplete",t)}))}(e,t,n))))}(e),n=iu(),r=!0;const o=t=>(n,r)=>{var o;const i=Ca(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 S=_.reduce(o(p),{});!1===y&&(S={});const{prevResolvedValues:k={}}=m,E={...k,...S},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 E){const t=S[e],n=k[e];if(u.hasOwnProperty(e))continue;let r=!1;r=Fs(t)&&Fs(n)?!Ea(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=S,m.isActive&&(u={...u,...S}),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=iu(),r=!0}}}(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();_i(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 ma{constructor(){super(...arguments),this.id=su++}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(){}}}},lu=(e,t)=>Math.abs(e-t);class cu{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=fu(this.lastMoveEventInfo,this.history),t=null!==this.startEvent,n=function(e,t){const n=lu(e.x,t.x),r=lu(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}=Qs;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=uu(t,this.transformPagePoint),Js.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=fu("pointercancel"===e.type?this.lastMoveEventInfo:uu(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,i),r&&r(e,i)},!oa(e))return;this.dragSnapToOrigin=o,this.handlers=t,this.transformPagePoint=n,this.contextWindow=r||window;const i=uu(ia(e),this.transformPagePoint),{point:s}=i,{timestamp:a}=Qs;this.history=[{...s,timestamp:a}];const{onSessionStart:l}=t;l&&l(e,fu(i,this.history)),this.removeListeners=ca(aa(this.contextWindow,"pointermove",this.handlePointerMove),aa(this.contextWindow,"pointerup",this.handlePointerUp),aa(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Zs(this.updatePoint)}}function uu(e,t){return t?{point:t(e.point)}:e}function du(e,t){return{x:e.x-t.x,y:e.y-t.y}}function fu({point:e},t){return{point:e,delta:du(e,pu(t)),offset:du(e,hu(t)),velocity:mu(t,.1)}}function hu(e){return e[0]}function pu(e){return e[e.length-1]}function mu(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=pu(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>Ta(t)));)n--;if(!r)return{x:0,y:0};const i=Pa(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}const gu=.9999,vu=1.0001,yu=-.01,bu=.01;function xu(e){return e.max-e.min}function wu(e,t,n,r=.5){e.origin=r,e.originPoint=pc(t.min,t.max,e.origin),e.scale=xu(n)/xu(t),e.translate=pc(n.min,n.max,e.origin)-e.originPoint,(e.scale>=gu&&e.scale<=vu||isNaN(e.scale))&&(e.scale=1),(e.translate>=yu&&e.translate<=bu||isNaN(e.translate))&&(e.translate=0)}function _u(e,t,n,r){wu(e.x,t.x,n.x,r?r.originX:void 0),wu(e.y,t.y,n.y,r?r.originY:void 0)}function Su(e,t,n){e.min=n.min+t.min,e.max=e.min+xu(t)}function ku(e,t,n){e.min=t.min-n.min,e.max=e.min+xu(t)}function Eu(e,t,n){ku(e.x,t.x,n.x),ku(e.y,t.y,n.y)}function Cu(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 Tu(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}}),Nu=()=>({x:{min:0,max:0},y:{min:0,max:0}});function Mu(e){return[e("x"),e("y")]}function Du({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Iu(e){return void 0===e||1===e}function ju({scale:e,scaleX:t,scaleY:n}){return!Iu(e)||!Iu(t)||!Iu(n)}function Lu(e){return ju(e)||Fu(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Fu(e){return Vu(e.x)||Vu(e.y)}function Vu(e){return e&&"0%"!==e}function zu(e,t,n){return n+t*(e-n)}function Bu(e,t,n,r,o){return void 0!==o&&(e=zu(e,o,r)),zu(e,n,r)+t}function Wu(e,t=0,n=1,r,o){e.min=Bu(e.min,t,n,r,o),e.max=Bu(e.max,t,n,r,o)}function Uu(e,{x:t,y:n}){Wu(e.x,t.translate,t.scale,t.originPoint),Wu(e.y,n.translate,n.scale,n.originPoint)}const Ku=.999999999999,$u=1.0000000000001;function Hu(e,t){e.min=e.min+t,e.max=e.max+t}function qu(e,t,n,r,o=.5){Wu(e,t,n,pc(e.min,e.max,o),r)}function Yu(e,t){qu(e.x,t.x,t.scaleX,t.scale,t.originX),qu(e.y,t.y,t.scaleY,t.scale,t.originY)}function Xu(e,t){return Du(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 Gu=({current:e})=>e?e.ownerDocument.defaultView:null,Ju=new WeakMap;class Zu{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=Nu(),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 cu(e,{onSessionStart:e=>{const{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(ia(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=ha(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),Mu((e=>{let t=this.getAxisMotionValue(e).get()||0;if(es.test(t)){const{projection:n}=this.visualElement;if(n&&n.layout){const r=n.layout.layoutBox[e];r&&(t=xu(r)*(parseFloat(t)/100))}}this.originPoint[e]=t})),i&&Js.postRender((()=>i(e,t))),null===(n=this.removeWillChange)||void 0===n||n.call(this),this.removeWillChange=Jc(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:()=>Mu((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:Gu(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&&Js.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||!Qu(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?pc(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&&pi(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!r)&&function(e,{top:t,left:n,bottom:r,right:o}){return{x:Cu(e.x,n,o),y:Cu(e.y,t,r)}}(r.layoutBox,t),this.elastic=function(e=Pu){return!1===e?e=0:!0===e&&(e=Pu),{x:Ru(e,"left","right"),y:Ru(e,"top","bottom")}}(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Mu((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||!pi(e))return!1;const n=e.current;Fa(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=Xu(e,n),{scroll:o}=t;return o&&(Hu(r.x,o.offset.x),Hu(r.y,o.offset.y)),r}(n,r.root,this.visualElement.getTransformPagePoint());let i=function(e,t){return{x:Tu(e.x,t.x),y:Tu(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=Du(e))}return i}startAnimation(e){const{drag:t,dragMomentum:n,dragElastic:r,dragTransition:o,dragSnapToOrigin:i,onDragTransitionEnd:s}=this.getProps(),a=this.constraints||{},l=Mu((s=>{if(!Qu(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(Uc(e,n,0,t,this.visualElement,!1,Jc(this.visualElement,e)))}stopAnimation(){Mu((e=>this.getAxisMotionValue(e).stop()))}pauseAnimation(){Mu((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){Mu((t=>{const{drag:n}=this.getProps();if(!Qu(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]-pc(n,i,.5))}}))}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!pi(t)||!n||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Mu((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=xu(e),o=xu(t);return o>r?n=hc(t.min,t.max-r,e.min):r>o&&(n=hc(e.min,e.max-o,t.min)),Ui(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(),Mu((t=>{if(!Qu(t,e,null))return;const n=this.getAxisMotionValue(t),{min:o,max:i}=this.constraints[t];n.set(pc(o,i,r[t]))}))}addListeners(){if(!this.visualElement.current)return;Ju.set(this.visualElement,this);const e=aa(this.visualElement.current,"pointerdown",(e=>{const{drag:t,dragListener:n=!0}=this.getProps();t&&n&&this.start(e)})),t=()=>{const{dragConstraints:e}=this.getProps();pi(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()),Js.read(t);const o=ra(window,"resize",(()=>this.scalePositionWithinConstraints())),i=n.addEventListener("didUpdate",(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Mu((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=Pu,dragMomentum:s=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:o,dragElastic:i,dragMomentum:s}}}function Qu(e,t,n){return!(!0!==t&&t!==e||null!==n&&n!==e)}const ed=e=>(t,n)=>{e&&Js.postRender((()=>e(t,n)))},td={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function nd(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const rd={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e){if(!ts.test(e))return e;e=parseFloat(e)}return`${nd(e,t.target.x)}% ${nd(e,t.target.y)}%`}},od={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=wl.parse(e);if(o.length>5)return r;const i=wl.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=pc(a,l,.5);return"number"==typeof o[2+s]&&(o[2+s]/=c),"number"==typeof o[3+s]&&(o[3+s]/=c),i(o)}};class id extends re.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:o}=e;var i;i=ad,Object.assign(Li,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()})),td.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()||Js.postRender((()=>{const e=i.getStack();e&&e.members.length||this.safeToRemove()}))),null):null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),fi.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 sd(e){const[t,n]=function(){const e=(0,re.useContext)(oi);if(null===e)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,o=(0,re.useId)();(0,re.useEffect)((()=>r(o)),[]);const i=(0,re.useCallback)((()=>n&&n(o)),[o,n]);return!t&&n?[!1,i]:[!0]}(),r=(0,re.useContext)(Oi);return(0,ti.jsx)(id,{...e,layoutGroup:r,switchLayoutGroup:(0,re.useContext)(mi),isPresent:t,safeToRemove:n})}const ad={borderRadius:{...rd,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:rd,borderTopRightRadius:rd,borderBottomLeftRadius:rd,borderBottomRightRadius:rd,boxShadow:od},ld=["TopLeft","TopRight","BottomLeft","BottomRight"],cd=ld.length,ud=e=>"string"==typeof e?parseFloat(e):e,dd=e=>"number"==typeof e||ts.test(e);function fd(e,t){return void 0!==e[t]?e[t]:e.borderRadius}const hd=md(0,.5,sc),pd=md(.5,.95,Gs);function md(e,t,n){return r=>rt?1:n(hc(e,t,r))}function gd(e,t){e.min=t.min,e.max=t.max}function vd(e,t){gd(e.x,t.x),gd(e.y,t.y)}function yd(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function bd(e,t,n,r,o){return e=zu(e-=t,1/n,r),void 0!==o&&(e=zu(e,1/o,r)),e}function xd(e,t,[n,r,o],i,s){!function(e,t=0,n=1,r=.5,o,i=e,s=e){if(es.test(t)&&(t=parseFloat(t),t=pc(s.min,s.max,t/100)-s.min),"number"!=typeof t)return;let a=pc(i.min,i.max,r);e===i&&(a-=t),e.min=bd(e.min,t,n,a,o),e.max=bd(e.max,t,n,a,o)}(e,t[n],t[r],t[o],t.scale,i,s)}const wd=["x","scaleX","originX"],_d=["y","scaleY","originY"];function Sd(e,t,n,r){xd(e.x,t,wd,n?n.x:void 0,r?r.x:void 0),xd(e.y,t,_d,n?n.y:void 0,r?r.y:void 0)}function kd(e){return 0===e.translate&&1===e.scale}function Ed(e){return kd(e.x)&&kd(e.y)}function Cd(e,t){return e.min===t.min&&e.max===t.max}function Td(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Pd(e,t){return Td(e.x,t.x)&&Td(e.y,t.y)}function Rd(e){return xu(e.x)/xu(e.y)}function Od(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Ad{constructor(){this.members=[]}add(e){Ks(this.members,e),e.scheduleRender()}remove(e){if($s(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 Nd=(e,t)=>e.depth-t.depth;class Md{constructor(){this.children=[],this.isDirty=!1}add(e){Ks(this.children,e),this.isDirty=!0}remove(e){$s(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Nd),this.isDirty=!1,this.children.forEach(e)}}const Dd={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Id="undefined"!=typeof window&&void 0!==window.MotionDebug,jd=["","X","Y","Z"],Ld={visibility:"hidden"};let Fd=0;function Vd(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function zd(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Xc(t);window.MotionHasOptimisedTransformAnimation(n)&&window.MotionCancelOptimisedTransform(n);const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&zd(r)}function Bd({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(e={},n=(null==t?void 0:t())){this.id=Fd++,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,Id&&(Dd.totalNodes=Dd.resolvedTargetDeltas=Dd.recalculatedProjection=0),this.nodes.forEach(Kd),this.nodes.forEach(Jd),this.nodes.forEach(Zd),this.nodes.forEach($d),Id&&window.MotionDebug.record(Dd)},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=Dl.now(),n=({timestamp:r})=>{const o=r-t;o>=250&&(Zs(n),e(o-250))};return Js.read(n,!0),()=>Zs(n)}(r),td.hasAnimatedSinceResize&&(td.hasAnimatedSinceResize=!1,this.nodes.forEach(Gd))}))}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()||of,{onLayoutAnimationStart:i,onLayoutAnimationComplete:a}=s.getProps(),l=!this.targetLayout||!Pd(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={...Ma(o,"layout"),onPlay:i,onComplete:a};(s.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t)}else t||Gd(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,Zs(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(Qd),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.MotionCancelOptimisedTransform&&!this.hasCheckedOptimisedAppear&&zd(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;eKu&&(t.x=1),t.y<$u&&t.y>Ku&&(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=Nu());const{target:l}=t;l?(this.projectionDelta&&this.prevProjectionDelta?(yd(this.prevProjectionDelta.x,this.projectionDelta.x),yd(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),_u(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.treeScale.x===s&&this.treeScale.y===a&&Od(this.projectionDelta.x,this.prevProjectionDelta.x)&&Od(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l)),Id&&Dd.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=Au(),this.projectionDelta=Au(),this.projectionDeltaWithTransform=Au()}setAnimationOrigin(e,t=!1){const n=this.snapshot,r=n?n.latestValues:{},o={...this.latestValues},i=Au();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;const s=Nu(),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(rf));let d;this.animationProgress=0,this.mixTargetDelta=t=>{const n=t/1e3;var l,f,h,p;tf(i.x,e.x,n),tf(i.y,e.y,n),this.setTargetDelta(i),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Eu(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox),l=this.relativeTarget,f=this.relativeTargetOrigin,h=s,p=n,nf(l.x,f.x,h.x,p),nf(l.y,f.y,h.y,p),d&&function(e,t){return Cd(e.x,t.x)&&Cd(e.y,t.y)}(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||(d=Nu()),vd(d,this.relativeTarget)),a&&(this.animationValues=o,function(e,t,n,r,o,i){o?(e.opacity=pc(0,void 0!==n.opacity?n.opacity:1,hd(r)),e.opacityExit=pc(void 0!==t.opacity?t.opacity:1,0,pd(r))):i&&(e.opacity=pc(void 0!==t.opacity?t.opacity:1,void 0!==n.opacity?n.opacity:1,r));for(let o=0;o{td.hasAnimatedSinceResize=!0,this.currentAnimation=function(e,t,n){const r=Bi(0)?0:qc(0);return r.start(Uc("",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&&cf(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||Nu();const t=xu(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;const r=xu(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}vd(t,n),Yu(t,o),_u(this.projectionDeltaWithTransform,this.layoutCorrected,t,o)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new Ad),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&&Vd("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(qd),this.root.sharedNodes.clear()}}}function Wd(e){e.updateLayout()}function Ud(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?Mu((e=>{const r=i?n.measuredBox[e]:n.layoutBox[e],o=xu(r);r.min=t[e].min,r.max=r.min+o})):cf(o,n.layoutBox,t)&&Mu((r=>{const o=i?n.measuredBox[r]:n.layoutBox[r],s=xu(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=Au();_u(s,t,n.layoutBox);const a=Au();i?_u(a,e.applyTransform(r,!0),n.measuredBox):_u(a,t,n.layoutBox);const l=!Ed(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=Nu();Eu(s,n.layoutBox,o.layoutBox);const a=Nu();Eu(a,t,i.layoutBox),Pd(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 Kd(e){Id&&Dd.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 $d(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Hd(e){e.clearSnapshot()}function qd(e){e.clearMeasurements()}function Yd(e){e.isLayoutDirty=!1}function Xd(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Gd(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Jd(e){e.resolveTargetDelta()}function Zd(e){e.calcProjection()}function Qd(e){e.resetSkewAndRotation()}function ef(e){e.removeLeadSnapshot()}function tf(e,t,n){e.translate=pc(t.translate,0,n),e.scale=pc(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function nf(e,t,n,r){e.min=pc(t.min,n.min,r),e.max=pc(t.max,n.max,r)}function rf(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}const of={duration:.45,ease:[.4,0,.1,1]},sf=e=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),af=sf("applewebkit/")&&!sf("chrome/")?Math.round:Gs;function lf(e){e.min=af(e.min),e.max=af(e.max)}function cf(e,t,n){return"position"===e||"preserve-aspect"===e&&(r=Rd(t),o=Rd(n),!(Math.abs(r-o)<=.2));var r,o}function uf(e){var t;return e!==e.root&&(null===(t=e.scroll)||void 0===t?void 0:t.wasRoot)}const df=Bd({attachResizeListener:(e,t)=>ra(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),ff={current:void 0},hf=Bd({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!ff.current){const e=new df({});e.mount(window),e.setOptions({layoutScroll:!0}),ff.current=e}return ff.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>Boolean("fixed"===window.getComputedStyle(e).position)}),pf={pan:{Feature:class extends ma{constructor(){super(...arguments),this.removePointerDownListener=Gs}onPointerDown(e){this.session=new cu(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Gu(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:ed(e),onStart:ed(t),onMove:n,onEnd:(e,t)=>{delete this.session,r&&Js.postRender((()=>r(e,t)))}}}mount(){this.removePointerDownListener=aa(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 ma{constructor(e){super(e),this.removeGroupControls=Gs,this.removeListeners=Gs,this.controls=new Zu(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Gs}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:hf,MeasureLayout:sd}},mf={current:null},gf={current:!1},vf=new WeakMap,yf=[...Ga,ul,wl],bf=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],xf=ki.length;class wf{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=rl,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,Js.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=Ei(t),this.isVariantNode=Ci(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]&&Bi(t)&&t.set(a[e],!1)}}mount(e){this.current=e,vf.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))),gf.current||function(){if(gf.current=!0,ii)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>mf.current=e.matches;e.addListener(t),t()}else mf.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||mf.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){vf.delete(this.current),this.projection&&this.projection.unmount(),Zs(this.notifyUpdate),Zs(this.render),this.valueSubscriptions.forEach((e=>e())),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){const n=Vi.has(e),r=t.on("change",(t=>{this.latestValues[e]=t,this.props.onUpdate&&Js.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)})),o=t.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(e,(()=>{r(),o(),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 Ri){const t=Ri[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):Nu()}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=qc(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&&(Va(r)||ja(r))?r=parseFloat(r):(o=r,!yf.find(Xa(o))&&wl.test(t)&&(r=Pl(e,t))),this.setBaseTarget(e,Bi(r)?r.get():r)),Bi(r)?r.get():r;var o}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=js(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||Bi(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 Kc),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class _f extends wf{constructor(){super(...arguments),this.KeyframeResolver=Ol}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 Sf extends _f{constructor(){super(...arguments),this.type="html",this.applyWillChange=!0,this.renderInstance=Os}readValueFromInstance(e,t){if(Vi.has(t)){const e=Tl(t);return e&&e.default||0}{const r=(n=e,window.getComputedStyle(n)),o=(us(t)?r.getPropertyValue(t):r[t])||0;return"string"==typeof o?o.trim():o}var n}measureInstanceViewportBox(e,{transformPagePoint:t}){return Xu(e,t)}build(e,t,n){ps(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Ms(e,t,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Bi(e)&&(this.childSubscription=e.on("change",(e=>{this.current&&(this.current.textContent=`${e}`)})))}}class kf extends _f{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Nu}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(Vi.has(t)){const e=Tl(t);return e&&e.default||0}return t=As.has(t)?t:li(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return Ds(e,t,n)}build(e,t,n){Es(e,t,this.isSVGTag,n.transformTemplate)}renderInstance(e,t,n,r){Ns(e,t,0,r)}mount(e){this.isSVGTag=Ts(e.tagName),super.mount(e)}}const Ef=(e,t)=>ji(e)?new kf(t):new Sf(t,{allowProjection:e!==re.Fragment}),Cf={...au,...ka,...pf,layout:{ProjectionNode:hf,MeasureLayout:sd}},Tf=Di(((e,t)=>function(e,{forwardMotionProps:t=!1},n,r){return{...ji(e)?ta:na,preloadedFeatures:n,useRender:Rs(t),createVisualElement:r,Component:e}}(e,t,Cf,Ef)));var Pf=["slug","text","icon","className","disabled","badge"];function Rf(){return Rf=Object.assign?Object.assign.bind():function(e){for(var t=1;tsvg]:size-3",sm:"underline"===m?"py-1.5 text-sm [&>svg]:size-4":"px-3 py-1.5 text-sm [&>svg]:size-4",md:"underline"===m?"py-2 text-base [&>svg]:size-5":"px-3.5 py-1.5 text-base [&>svg]:size-5",lg:"underline"===m?"p-2.5 text-lg [&>svg]:size-6":"px-3.5 py-1.5 text-lg [&>svg]:size-6"}[p],x=Q("relative border-none bg-transparent text-text-tertiary cursor-pointer flex items-center justify-center transition-colors duration-200","full"===y?"flex-1":"","vertical"===g?"w-full justify-between":""),w="rounded-full";"rounded"===m?w="rounded-md":"underline"===m&&(w="rounded-none w-fit max-w-fit");var _=Q(x,"border-none",w,"","focus:outline-none",l?"text-text-disabled cursor-not-allowed":"",b,f===r?"bg-background-primary text-text-primary":"",s);return oe().createElement("button",Rf({ref:t,className:_,disabled:l,onClick:function(e){h(e,{slug:r,text:o})}},d),f===r&&"underline"===m&&oe().createElement(Tf.span,{layoutId:"underline",className:"absolute right-0 left-0 -bottom-px h-px bg-border-interactive"}),oe().createElement("span",{className:"flex items-center gap-1"},"left"===v&&i&&oe().createElement("span",{className:"mr-1"},i),o,"right"===v&&i&&oe().createElement("span",{className:"ml-1"},i)),u&&(0,re.isValidElement)(u)&&u)},Nf={Group:function(e){var t,n=e.children,r=e.activeItem,o=void 0===r?null:r,i=e.onChange,s=e.className,a=e.size,l=void 0===a?"sm":a,c=e.orientation,u=void 0===c?"horizontal":c,d=e.variant,f=void 0===d?"pill":d,h=e.iconPosition,p=void 0===h?"left":h,m=e.width,g=void 0===m?"auto":m,v=(0,re.useCallback)((function(e,t){i&&i({event:e,value:t})}),[i]),y="rounded-full",b="p-1",x="border border-tab-border border-solid";"vertical"===u?t="gap-0.5":"rounded"!==f&&"pill"!==f||("xs"===l||"sm"===l?t="gap-0.5":"md"!==l&&"lg"!==l||(t="gap-1")),"rounded"===f||"vertical"===u?y="rounded-md":"underline"===f&&(y="rounded-none",b="p-0",x="border-t-0 border-r-0 border-l-0 border-b border-solid border-tab-border","xs"===l?t="gap-0":"sm"===l?t="gap-2.5":"md"!==l&&"lg"!==l||(t="gap-3"));var w="vertical"===u?"flex-col":"",_="box-border [&>*]:box-border flex items-center ".concat("full"===g?"w-full":""," ").concat(w),S=Q(_,y,b,t,x,s);return oe().createElement("div",{className:S},oe().createElement(Of.Provider,{value:{activeItem:o,onChange:v,size:l,variant:f,orientation:u,iconPosition:p,width:g}},oe().Children.map(n,(function(e){return(0,re.isValidElement)(e)?oe().cloneElement(e):null}))))},Tab:(0,re.forwardRef)(Af)};const Mf=me("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]),Df=me("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),If=me("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);var jf={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"}},Lf="group-disabled:text-field-color-disabled",Ff=["value","selected","children"];function Vf(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)||Wf(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 zf(){return zf=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(p.current),v.current=null,m.current="")}),[r]),xr((()=>{var e;r&&""===m.current&&(g.current=null!=(e=null!=h?h:s)?e:-1)}),[r,h,s]);const _=ir((e=>{e?o.current.typing||(o.current.typing=e,b(e)):o.current.typing&&(o.current.typing=e,b(e))})),S=ir((e=>{function t(e,t,n){const r=x.current?x.current(t,n):t.find((e=>0===(null==e?void 0:e.toLocaleLowerCase().indexOf(n.toLocaleLowerCase()))));return r?e.indexOf(r):-1}const n=i.current;if(m.current.length>0&&" "!==m.current[0]&&(-1===t(n,n,m.current)?_(!1):" "===e.key&&Ft(e)),null==n||w.current.includes(e.key)||1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey)return;r&&" "!==e.key&&(Ft(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())}))&&m.current===e.key&&(m.current="",g.current=v.current),m.current+=e.key,clearTimeout(p.current),p.current=setTimeout((()=>{m.current="",g.current=v.current,_(!1)}),d);const o=g.current,s=t(n,[...n.slice((o||0)+1),...n.slice(0,(o||0)+1)],m.current);-1!==s?(y(s),v.current=s):" "!==e.key&&(m.current="",_(!1))})),k=re.useMemo((()=>({onKeyDown:S})),[S]),E=re.useMemo((()=>({onKeyDown:S,onKeyUp(e){" "===e.key&&_(!1)}})),[S,_]);return re.useMemo((()=>c?{reference:k,floating:E}:{}),[c,k,E])}(V,{listRef:B,activeIndex:O,selectedIndex:M,onMatch:T?A:D,onTypingChange:function(e){W.current=e}}),Y=wo([K,$,H,U].concat(Bf(p?[]:[q]))),X=Y.getReferenceProps,G=Y.getFloatingProps,J=Y.getItemProps,Z=function(e,t){if(f)return function(e,t){var n,r=Bf(null!==(n=E())&&void 0!==n?n:[]);-1===r.findIndex((function(e){return"object"===Kf(e)?e[c]===t[c]:e===t}))&&(r.push(t),y||w(r),D(e),L.reference.current.focus(),P(!1),k(""),"function"==typeof a&&a(r))}(e,t);D(e),y||w(t),L.reference.current.focus(),P(!1),k(""),"function"==typeof a&&a(t)},Q=(0,re.useCallback)((function(e,t){z.current[e]=t}),[]);return React.createElement(Yf.Provider,{value:{selectedIndex:M,setSelectedIndex:D,activeIndex:O,setActiveIndex:A,selected:x,setSelected:w,handleSelect:Z,combobox:p,sizeValue:o,multiple:f,onChange:a,isTypingRef:W,getItemProps:J,onClickItem:function(e,t){Z(e,t)},onKeyDownItem:function(e,t,n){"Enter"===e.key&&(e.preventDefault(),Z(t,n))," "!==e.key||W.current||(e.preventDefault(),Z(t,n))},getValues:E,selectId:v,getReferenceProps:X,isOpen:T,value:i,updateListRef:Q,refs:L,listContentRef:B,by:c,getFloatingProps:G,floatingStyles:F,context:V,searchKeyword:S,setSearchKeyword:k,disabled:g}},u)};Gf.Button=function(e){var t,n,r,o=e.children,i=e.icon,s=void 0===i?null:i,a=e.placeholder,l=void 0===a?"Select an option":a,c=e.optionIcon,u=void 0===c?null:c,d=e.displayBy,f=void 0===d?"name":d,h=e.label,p=Xf(),m=p.sizeValue,g=p.getReferenceProps,v=p.getValues,y=p.selectId,b=p.refs,x=p.isOpen,w=p.multiple,_=p.combobox,S=p.setSelected,k=p.onChange,E=p.isControlled,C=p.disabled,T=p.by,P=null===(t={sm:"xs",md:"sm",lg:"md"})||void 0===t?void 0:t[m],R=(0,re.useCallback)((function(){if(s)return s;var e="text-field-placeholder group-disabled:text-icon-disabled";return _?React.createElement(Mf,{className:e}):React.createElement(Df,{className:e})}),[s]),O=(0,re.useCallback)((function(){var e=v();if(!e)return null;if("function"==typeof o){var t=Hf({value:e},w?{onClose:A}:{});return o(t)}if(w)return e.map((function(e,t){return React.createElement(Le,{icon:u,type:"rounded",key:t,size:P,onMouseDown:A(e),label:"object"===Kf(e)?e[f]:e,disabled:C})}));var n="object"===Kf(e)?e[f]:e;return(0,re.isValidElement)(o)&&(n=o),React.createElement("span",{className:Q(jf[m].displaySelected,Lf)},n)}),[v]),A=function(e){return function(t){var n;null==t||t.preventDefault(),null==t||t.stopPropagation();var r=Bf(null!==(n=v())&&void 0!==n?n:[]),o=r.findIndex((function(t){return"object"===Kf(t)?t[T]===e[T]:t===e}));-1!==o&&(r.splice(o,1),E||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:Q(null===(n=jf[m])||void 0===n?void 0:n.label,"text-field-label"),htmlFor:y},h),React.createElement("button",zf({id:y,ref:b.setReference,className:Q("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",!x&&"focus:ring-2 focus:ring-offset-4 focus:border-focus-border focus:ring-focus [&:hover:not(:focus):not(:disabled)]:border-border-strong",jf[m].selectButton,w&&jf[m].multiSelect,"group disabled:border-field-border-disabled [&:hover:has(:disabled)]:border-field-border-disabled"),"aria-labelledby":"select-label",tabIndex:0,disabled:C},g()),React.createElement("div",{className:Q("flex-1 grid items-center justify-start gap-1.5 ",v()&&"flex flex-wrap")},O(),(w?!(null!==(r=v())&&void 0!==r&&r.length):!v())&&React.createElement("div",{className:Q("[grid-area:1/1/2/3] text-field-input",jf[m].displaySelected,Lf)},l)),React.createElement("div",{className:Q("flex items-center [&>svg]:shrink-0",jf[m].icon)},R())))},Gf.Options=function(e){var t=e.children,n=e.searchBy,r=void 0===n?"id":n,o=e.searchPlaceholder,i=void 0===o?"Search...":o,s=e.dropdownPortalRoot,a=void 0===s?null:s,l=e.dropdownPortalId,c=void 0===l?"":l,u=Xf(),d=u.isOpen,f=u.context,h=u.refs,p=u.combobox,m=u.floatingStyles,g=u.getFloatingProps,v=u.sizeValue,y=u.setSearchKeyword,b=u.setActiveIndex,x=u.setSelectedIndex,w=u.value,_=u.selected,S=u.getValues,k=u.searchKeyword,E=u.listContentRef,C=u.by,T=(0,re.useMemo)((function(){var e=S(),n=0;return e&&(n=re.Children.toArray(t).findIndex((function(t){return"object"===Kf(t.props.value)?t.props.value[C]===e[C]:t.props.value===e}))),-1===n?0:n}),[w,_,t]);(0,re.useLayoutEffect)((function(){b(T),x(T)}),[]);var P=(0,re.useMemo)((function(){return re.Children.map(t,(function(e,t){if(!(0,re.isValidElement)(e))return null;if(k){var n=e.props.value;if("object"===Kf(n)){if(-1===n[r].toLowerCase().indexOf(k.toLowerCase()))return null}else if(-1===n.toLowerCase().indexOf(k.toLowerCase()))return null}return(0,re.cloneElement)(e,Hf(Hf({},e.props),{},{index:t}))}))}),[k,w,_,t]),R=re.Children.count(P);return(0,re.useEffect)((function(){E.current=[],re.Children.forEach(t,(function(e){if((0,re.isValidElement)(e)&&e.props.value){if(k){var t=e.props.value;if("object"===Kf(t)){if(-1===t[r].toLowerCase().indexOf(k.toLowerCase()))return}else if(-1===t.toLowerCase().indexOf(k.toLowerCase()))return}E.current.push(e.props.value)}}))}),[k]),React.createElement(React.Fragment,null,d&&React.createElement(to,{id:c,root:a},React.createElement(lo,{context:f,modal:!1},React.createElement("div",zf({ref:h.setFloating,className:Q("box-border [&_*]:box-border w-full bg-white outline-none shadow-lg border border-solid border-border-subtle overflow-hidden",p&&"grid grid-cols-1 grid-rows-[auto_1fr] divide-y divide-x-0 divide-solid divide-border-subtle",jf[v].dropdown,!p&&"h-full"),style:Hf({},m)},g()),p&&React.createElement("div",{className:Q(jf[v].searchbarWrapper)},React.createElement(If,{className:Q("text-icon-secondary shrink-0",jf[v].searchbarIcon)}),React.createElement("input",{className:Q("px-1 w-full placeholder:text-field-placeholder border-0 focus:outline-none focus:shadow-none",jf[v].searchbar),type:"search",name:"keyword",placeholder:i,onChange:function(e){return y(e.target.value)},autoComplete:"off"})),React.createElement("div",{className:Q("overflow-y-auto",!p&&"w-full h-full",jf[v].dropdownItemsWrapper)},!!R&&P,!R&&React.createElement("div",{className:"p-2 text-center text-base font-medium text-field-placeholder"},"No items found"))))))},Gf.Option=function(e){var t=e.value,n=e.selected,r=e.children,o=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(th({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(th({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(th({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(th({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(th({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(th({jsx:e,type:"custom"},t))}}],t&&rh(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}(),hh=new fh,ph=Object.seal(Object.assign((function(e,t){return hh.default(e,t)}),{success:hh.success.bind(hh),error:hh.error.bind(hh),warning:hh.warning.bind(hh),info:hh.info.bind(hh),custom:hh.custom.bind(hh),dismiss:hh.dismiss.bind(hh),update:hh.update.bind(hh)},{getHistory:hh.history.bind(hh)})),mh=!1,gh={"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"},vh={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"},yh="bg-background-inverse border-background-inverse",bh={light:"text-icon-secondary",dark:"text-icon-inverse"};class xh extends re.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 wh({children:e,isPresent:t}){const n=(0,re.useId)(),r=(0,re.useRef)(null),o=(0,re.useRef)({width:0,height:0,top:0,left:0}),{nonce:i}=(0,re.useContext)(ni);return(0,re.useInsertionEffect)((()=>{const{width:e,height:s,top:a,left:l}=o.current;if(t||!r.current||!e||!s)return;r.current.dataset.motionPopId=n;const c=document.createElement("style");return i&&(c.nonce=i),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: ${s}px !important;\n top: ${a}px !important;\n left: ${l}px !important;\n }\n `),()=>{document.head.removeChild(c)}}),[t]),(0,ti.jsx)(xh,{isPresent:t,childRef:r,sizeRef:o,children:re.cloneElement(e,{ref:r})})}const _h=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:i,mode:s})=>{const a=Ls(Sh),l=(0,re.useId)(),c=(0,re.useMemo)((()=>({id:l,initial:t,isPresent:n,custom:o,onExitComplete:e=>{a.set(e,!0);for(const e of a.values())if(!e)return;r&&r()},register:e=>(a.set(e,!1),()=>a.delete(e))})),i?[Math.random()]:[n]);return(0,re.useMemo)((()=>{a.forEach(((e,t)=>a.set(t,!1)))}),[n]),re.useEffect((()=>{!n&&!a.size&&r&&r()}),[n]),"popLayout"===s&&(e=(0,ti.jsx)(wh,{isPresent:n,children:e})),(0,ti.jsx)(oi.Provider,{value:c,children:e})};function Sh(){return new Map}const kh=e=>e.key||"";function Eh(e){const t=[];return re.Children.forEach(e,(e=>{(0,re.isValidElement)(e)&&t.push(e)})),t}const Ch=({children:e,exitBeforeEnter:t,custom:n,initial:r=!0,onExitComplete:o,presenceAffectsLayout:i=!0,mode:s="sync"})=>{Fa(!t,"Replace exitBeforeEnter with mode='wait'");const a=(0,re.useMemo)((()=>Eh(e)),[e]),l=a.map(kh),c=(0,re.useRef)(!0),u=(0,re.useRef)(a),d=Ls((()=>new Map)),[f,h]=(0,re.useState)(a),[p,m]=(0,re.useState)(a);si((()=>{c.current=!1,u.current=a;for(let e=0;e{const t=kh(e),f=a===p||l.includes(t);return(0,ti.jsx)(_h,{isPresent:f,initial:!(c.current&&!r)&&void 0,custom:f?void 0:n,presenceAffectsLayout:i,mode:s,onExitComplete:f?void 0:()=>{if(!d.has(t))return;d.set(t,!0);let e=!0;d.forEach((t=>{t||(e=!1)})),e&&(null==v||v(),m(u.current),o&&o())},children:e},t)}))})};function Th(e){return Th="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},Th(e)}function Ph(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 Rh(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n1&&void 0!==arguments[1]?arguments[1]:c;if(a&&!(c<0))return b.current=(new Date).getTime(),setTimeout((function(){y(e.id)}),t)};(0,re.useEffect)((function(){var e=c;return w.current=_(t,e),function(){clearTimeout(w.current)}}),[]),(0,re.useEffect)((function(){null!=t&&t.dismiss&&y(t.id)}),[t]);var S,k,E,C,T,P,R,O,A,N,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 y(t.id)}))},D=null;return"stack"===h&&(D=React.createElement("div",{className:Q("flex items-center justify-start p-4 gap-2 relative border border-solid rounded-md shadow-lg","dark"===d?yh:null===(S=vh)||void 0===S?void 0:S[v],"w-[22.5rem]"),onMouseEnter:function(){clearTimeout(w.current),x.current=(new Date).getTime()},onMouseLeave:function(){w.current=_(t,c-(x.current-b.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"},Lo({variant:v,icon:m,theme:d})),React.createElement("div",{className:"flex flex-col items-start justify-start gap-0.5"},Vo({title:r,theme:d}),zo({content:i,theme:d}),(null==t||null===(k=t.action)||void 0===k?void 0:k.label)&&"function"==typeof(null==t||null===(E=t.action)||void 0===E?void 0:E.onClick)&&React.createElement("div",{className:"mt-2.5"},Fo({actionLabel:null==t||null===(C=t.action)||void 0===C?void 0:C.label,actionType:null!==(T=null==t||null===(P=t.action)||void 0===P?void 0:P.type)&&void 0!==T?T:"button",onAction:M,theme:d}))),React.createElement("div",{className:"absolute right-4 top-4 [&_svg]:size-5"},React.createElement("button",{className:Q("bg-transparent m-0 p-0 border-none focus:outline-none active:outline-none cursor-pointer",null!==(R=bh[d])&&void 0!==R?R:bh.light),onClick:function(){return y(t.id)}},React.createElement(Ie,null)))):null==t||null===(O=t.jsx)||void 0===O?void 0:O.call(t,{close:function(){return y(t.id)},action:null!=t&&t.action?Rh(Rh({},null==t?void 0:t.action),{},{onClick:M}):null}))),"inline"===h&&(D=React.createElement("div",{className:Q("flex items-center justify-start p-3 gap-2 relative border border-solid rounded-md shadow-lg","dark"===d?yh:null===(A=vh)||void 0===A?void 0:A[v],"lg:w-[47.5rem] w-full")},React.createElement("div",{className:"self-start flex items-center justify-center [&_svg]:size-5 shrink-0"},Lo({variant:v,icon:m,theme:d})),React.createElement("div",{className:"flex items-start justify-start gap-1 mr-10 [&>span:first-child]:shrink-0"},Vo({title:r,theme:d}),zo({content:i,theme:d})),React.createElement("div",{className:"absolute right-3 top-3 [&_svg]:size-5"},React.createElement("button",{className:Q("bg-transparent m-0 p-0 border-none focus:outline-none active:outline-none cursor-pointer",null!==(N=bh[d])&&void 0!==N?N:bh.light),onClick:function(){return y(t.id)}},React.createElement(Ie,null))))),D},Ih=(Mh=function(e){var t,n,r,o=e.position,i=void 0===o?"top-right":o,s=e.design,a=void 0===s?"stack":s,l=e.theme,c=void 0===l?"light":l,u=e.className,d=void 0===u?"":u,f=e.autoDismiss,h=void 0===f||f,p=e.dismissAfter,m=void 0===p?5e3:p,g=(n=(0,re.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)||Ah(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.")}()),v=g[0],y=g[1];(0,re.useEffect)((function(){hh.subscribe((function(e){null!=e&&e.dismiss?y((function(t){return t.map((function(t){return t.id===e.id?Rh(Rh({},t),{},{dismiss:!0}):t}))})):setTimeout((function(){(0,kn.flushSync)((function(){return y((function(t){return-1!==t.findIndex((function(t){return t.id===e.id}))?t.map((function(t){return t.id===e.id?Rh(Rh({},t),e):t})):[].concat(function(e){return function(e){if(Array.isArray(e))return Nh(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Ah(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 b=function(e){y((function(t){return t.filter((function(t){return t.id!==e}))}))};return React.createElement("ul",{className:Q("fixed flex flex-col list-none z-20 p-10 pointer-events-none [&>li]:pointer-events-auto gap-3",null!==(t=gh[i])&&void 0!==t?t:gh["top-right"],d)},React.createElement(Ch,{initial:!1},v.map((function(e){var t,n,r,o,i;return React.createElement(Tf.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(Dh,{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:a,autoDismiss:null!==(r=null==e?void 0:e.autoDismiss)&&void 0!==r?r:h,dismissAfter:null!==(o=null==e?void 0:e.dismissAfter)&&void 0!==o?o:m,removeToast:b,variant:e.type,theme:null!==(i=null==e?void 0:e.theme)&&void 0!==i?i:c}))}))))},(0,re.memo)((function(e){return mh?null:(mh=!0,React.createElement(Mh,e))}))),jh=["containerType","gap","direction","justify","align","wrap","cols","tabCols","mCols","className","children"],Lh=["grow","shrink","order","alignSelf","className","children"];function Fh(){return Fh=Object.assign?Object.assign.bind():function(e){for(var t=1;tspan:first-child]:shrink-0"},Vo({title:g,theme:u}),zo({content:y,theme:u}))),React.createElement("div",{className:"flex items-center justify-start gap-4"},(null==k?void 0:k.label)&&"function"==typeof(null==k?void 0:k.onClick)&&React.createElement("div",null,Fo({actionLabel:null==k?void 0:k.label,actionType:null!==(n=null==k?void 0:k.type)&&void 0!==n?n:"button",onAction:O,theme:u})),React.createElement("button",{className:Q("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 E()}},React.createElement(Ie,null))))},Kh=(Bh=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 Yh={},Xh={},Gh={},Jh={},Zh={},Qh={},ep={},tp={},np={},rp={},op={},ip={},sp={},ap={},lp={},cp={},up={},dp={},fp={},hp={},pp={},mp={},gp={},vp={},yp={},bp={},xp={},wp={},_p={},Sp={},kp={},Ep={},Cp={},Tp={},Pp={},Rp={},Op={},Ap={},Np={},Mp={},Dp="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Ip=Dp&&"documentMode"in document?document.documentMode:null,jp=Dp&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Lp=Dp&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Fp=!(!Dp||!("InputEvent"in window)||Ip)&&"getTargetRanges"in new window.InputEvent("input"),Vp=Dp&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),zp=Dp&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Bp=Dp&&/Android/.test(navigator.userAgent),Wp=Dp&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Up=Dp&&Bp&&Wp,Kp=Dp&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Wp,$p=1,Hp=3,qp=0,Yp=2,Xp=0,Gp=1,Jp=2,Zp=4,Qp=8,em=3|Zp|Qp|240,tm=1,nm=2,rm=3,om=4,im=5,sm=6,am=Vp||zp||Kp?" ":"​",lm="\n\n",cm=Lp?" ":am,um="֑-߿יִ-﷽ﹰ-ﻼ",dm="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",fm=new RegExp("^[^"+dm+"]*["+um+"]"),hm=new RegExp("^[^"+um+"]*["+dm+"]"),pm={bold:1,code:16,highlight:128,italic:2,strikethrough:Zp,subscript:32,superscript:64,underline:Qp},mm={directionless:1,unmergeable:2},gm={center:nm,end:sm,justify:om,left:tm,right:rm,start:im},vm={[nm]:"center",[sm]:"end",[om]:"justify",[tm]:"left",[rm]:"right",[im]:"start"},ym={normal:0,segmented:2,token:1},bm={[Xp]:"normal",[Jp]:"segmented",[Gp]:"token"};var xm,wm=(xm=function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;eSm;try{fb(e,(()=>{const o=Fy()||function(e){return e.getEditorState().read((()=>{const e=Fy();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(pb(n)){const r=n.getChildrenKeys();let o=t.firstChild;for(let n=0;n0){for(let t=0;t{Om(e,t,n)}))}function Mm(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 Dm(e,t){const n=e.mergeWithSibling(t),r=nb()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function Im(e){let t,n,r=e;if(""!==r.__text||!r.isSimpleText()||r.isUnmergeable()){for(;null!==(t=r.getPreviousSibling())&&my(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(""!==t.__text){if(Mm(t,r)){r=Dm(t,r);break}break}t.remove()}for(;null!==(n=r.getNextSibling())&&my(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(""!==n.__text){if(Mm(r,n)){r=Dm(r,n);break}break}n.remove()}}else r.remove()}function jm(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),my(r)){e.set(r.__key,o?r.getTextContentSize():0,"text");break}if(!pb(r))break;e.set(r.__key,o?r.getChildrenSize():0,"element")}}let Lm=1;const Fm="function"==typeof queueMicrotask?queueMicrotask:e=>{Promise.resolve().then(e)};function Vm(e){const t=document.activeElement;if(null===t)return!1;const n=t.nodeName;return vb(Zm(e))&&("INPUT"===n||"TEXTAREA"===n||"true"===t.contentEditable&&null==t.__lexicalEditor)}function zm(e,t,n){const r=e.getRootElement();try{return null!==r&&r.contains(t)&&r.contains(n)&&null!==t&&!Vm(t)&&Bm(t)===e}catch(e){return!1}}function Bm(e){let t=e;for(;null!=t;){const e=t.__lexicalEditor;if(null!=e)return e;t=Tg(t)}return null}function Wm(e){return e.isToken()||e.isSegmented()}function Um(e){return e.nodeType===Hp}function Km(e){let t=e;for(;null!=t;){if(Um(t))return t;t=t.firstChild}return null}function $m(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 Hm(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 qm(e){eb();const t=e.getLatest(),n=t.__parent,r=tb(),o=nb(),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,pb(e)?s.set(a,!0):o._dirtyLeaves.add(a)}function Ym(e){Qy();const t=nb(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,null!==n){const e=Gm(n);null!==e&&e.getWritable()}if(null!==e){const t=Gm(e);null!==t&&t.getWritable()}}}function Xm(){return Zy()?null:nb()._compositionKey}function Gm(e,t){const n=(t||tb())._nodeMap.get(e);return void 0===n?null:n}function Jm(e,t){const n=e[`__lexicalKey_${nb()._key}`];return void 0!==n?Gm(n,t):null}function Zm(e,t){let n=e;for(;null!=n;){const e=Jm(n,t);if(null!==e)return e;n=Tg(n)}return null}function Qm(e){const t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function eg(e){return e.read((()=>tg().getTextContent()))}function tg(){return ng(tb())}function ng(e){return e._nodeMap.get("root")}function rg(e){Qy();const t=tb();null!==e&&(e.dirty=!0,e.setCachedNodes(null)),t._selection=e}function og(e){const t=nb(),n=function(e,t){let n=e;for(;null!=n;){const e=n[`__lexicalKey_${t._key}`];if(void 0!==e)return e;n=Tg(n)}return null}(e,t);return null===n?e===t.getRootElement()?Gm("root"):null:Gm(n)}function ig(e,t){return t?e.getTextContentSize():0}function sg(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function ag(e){const t=[];let n=e;for(;null!==n;)t.push(n),n=n._parentEditor;return t}function lg(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function cg(e){return e.nodeType===Hp?e.nodeValue:null}function ug(e,t,n){const r=_n(t._window);if(null===r)return;const o=r.anchorNode;let{anchorOffset:i,focusOffset:s}=r;if(null!==o){let t=cg(o);const r=Zm(o);if(null!==t&&my(r)){if(t===am&&n){const e=n.length;t=n,i=e,s=e}null!==t&&dg(r,t,i,s,e)}}}function dg(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]===am&&(a=t.slice(0,-1));const l=i.getTextContent();if(o||a!==l){if(""===a){if(Ym(null),Vp||zp||Kp)i.remove();else{const e=nb();setTimeout((()=>{e.update((()=>{i.isAttached()&&i.remove()}))}),20)}return}const t=i.getParent(),o=Vy(),l=i.getTextContentSize(),c=Xm(),u=i.getKey();if(i.isToken()||null!==c&&u===c&&!s||Ey(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=Fy();if(!Ey(d)||null===n||null===r)return void i.setTextContent(a);if(d.setTextNodeRange(i,n,i,r),i.isSegmented()){const e=py(i.getTextContent());i.replace(e),i=e}i.setTextContent(a)}}}function fg(e){return"ArrowLeft"===e}function hg(e){return"ArrowRight"===e}function pg(e,t){return jp?e:t}function mg(e){return"Enter"===e}function gg(e){return"Backspace"===e}function vg(e){return"Delete"===e}function yg(e,t,n){return"a"===e.toLowerCase()&&pg(t,n)}function bg(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=_m(o);return n[t]=e,e}return o}function xg(e,t,n,r,o){if(0===n.size)return;const i=r.__type,s=r.__key,a=t.get(i);void 0===a&&wm(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 wg(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 _g(e,t){const n=e.offset;if("element"===e.type)return wg(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?wg(r.getParentOrThrow(),t,r.getIndexWithinParent()+(t?0:1)):e}}return null}function Sg(e){const t=Rg(e).event,n=t&&t.inputType;return"insertFromPaste"===n||"insertFromPasteAsQuotation"===n}function kg(e,t,n){return cb(e,t,n)}function Eg(e){return!bb(e)&&!e.isLastChild()&&!e.isInline()}function Cg(e,t){const n=e._keyToDOMMap.get(t);return void 0===n&&wm(75,t),n}function Tg(e){const t=e.assignedSlot||e.parentElement;return null!==t&&11===t.nodeType?t.host:t}function Pg(e,t){let n=e.getParent();for(;null!==n;){if(n.is(t))return!0;n=n.getParent()}return!1}function Rg(e){const t=e._window;return null===t&&wm(78),t}function Og(e){return bb(e)||pb(e)&&e.isShadowRoot()}function Ag(e){const t=nb(),n=e.constructor.getType(),r=t._nodes.get(n);void 0===r&&wm(97);const o=r.replace;if(null!==o){const t=o(e);return t instanceof e.constructor||wm(98),t}return e}function Ng(e,t){!bb(e.getParent())||pb(t)||vb(t)||wm(99)}function Mg(e){return(vb(e)||pb(e)&&!e.canBeEmpty())&&!e.isInline()}function Dg(e,t,n){n.style.removeProperty("caret-color"),t._blockCursorElement=null;const r=e.parentElement;null!==r&&r.removeChild(e)}function _n(e){return Dp?(e||window).getSelection():null}function Ig(e){return 1===e.nodeType}function jg(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 Lg(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 Fg(e){if(bb(e)||vb(e)&&!e.isInline())return!0;if(!pb(e)||Og(e))return!1;const t=e.getFirstChild(),n=null===t||Jv(t)||my(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}function Vg(e,t){let n=e;for(;null!==n&&null!==n.getParent()&&!t(n);)n=n.getParentOrThrow();return t(n)?n:null}const zg=new WeakMap,Bg=new Map;function Wg(e){const t=e.constructor.clone(e);return t.__parent=e.__parent,t.__next=e.__next,t.__prev=e.__prev,pb(e)&&pb(t)?(Tb(e)&&Tb(t)&&(t.__textFormat=e.__textFormat,t.__textStyle=e.__textStyle),t.__first=e.__first,t.__last=e.__last,t.__size=e.__size,t.__indent=e.__indent,t.__format=e.__format,t.__style=e.__style,t.__dir=e.__dir):my(e)&&my(t)&&(t.__format=e.__format,t.__style=e.__style,t.__mode=e.__mode,t.__detail=e.__detail),t}function Ug(e,t,n,r,o,i){let s=e.getFirstChild();for(;null!==s;){const e=s.__key;s.__parent===t&&(pb(s)&&Ug(s,e,n,r,o,i),n.has(e)||i.delete(e),o.push(e)),s=s.getNextSibling()}}let Kg,$g,Hg,qg,Yg,Xg,Gg,Jg,Zg,Qg,ev="",tv="",nv=null,rv="",ov="",iv=!1,sv=!1,av=null;function lv(e,t){const n=Gg.get(e);if(null!==t){const n=Sv(e);n.parentNode===t&&t.removeChild(n)}if(Jg.has(e)||$g._keyToDOMMap.delete(e),pb(n)){const e=bv(n,Gg);cv(e,0,e.length-1,null)}void 0!==n&&xg(Qg,Hg,qg,n,"destroyed")}function cv(e,t,n,r){let o=t;for(;o<=n;++o){const t=e[o];void 0!==t&&lv(t,r)}}function uv(e,t){e.setProperty("text-align",t)}const dv="40px";function fv(e,t){const n=Kg.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")||dv;e.style.setProperty("padding-inline-start",0===t?"":`calc(${t} * ${r})`)}function hv(e,t){const n=e.style;0===t?uv(n,""):t===tm?uv(n,"left"):t===nm?uv(n,"center"):t===rm?uv(n,"right"):t===om?uv(n,"justify"):t===im?uv(n,"start"):t===sm&&uv(n,"end")}function pv(e,t,n){const r=Jg.get(e);void 0===r&&wm(60);const o=r.createDOM(Kg,$g);if(function(e,t,n){const r=n._keyToDOMMap;t["__lexicalKey_"+n._key]=e,r.set(e,t)}(e,o,$g),my(r)?o.setAttribute("data-lexical-text","true"):vb(r)&&o.setAttribute("data-lexical-decorator","true"),pb(r)){const e=r.__indent,t=r.__size;if(0!==e&&fv(o,e),0!==t){const e=t-1;!function(e,t,n,r){const o=tv;tv="",mv(e,n,0,t,r,null),yv(n,r),tv=o}(bv(r,Jg),e,r,o)}const n=r.__format;0!==n&&hv(o,n),r.isInline()||vv(null,r,o),Eg(r)&&(ev+=lm,ov+=lm)}else{const t=r.getTextContent();if(vb(r)){const t=r.decorate($g,Kg);null!==t&&wv(e,t),o.contentEditable="false"}else my(r)&&(r.isDirectionless()||(tv+=t));ev+=t,ov+=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 xg(Qg,Hg,qg,r,"created"),o}function mv(e,t,n,r,o,i){const s=ev;ev="";let a=n;for(;a<=r;++a){pv(e[a],o,i);const t=Jg.get(e[a]);null!==t&&my(t)&&(null===nv&&(nv=t.getFormat()),""===rv&&(rv=t.getStyle()))}Eg(t)&&(ev+=lm),o.__lexicalTextContent=ev,ev=s+ev}function gv(e,t){const n=t.get(e);return Jv(n)||vb(n)&&n.isInline()}function vv(e,t,n){const r=null!==e&&(0===e.__size||gv(e.__last,Gg)),o=0===t.__size||gv(t.__last,Jg);if(r){if(!o){const e=n.__lexicalLineBreak;null!=e&&n.removeChild(e),n.__lexicalLineBreak=null}}else if(o){const e=document.createElement("br");n.__lexicalLineBreak=e,n.appendChild(e)}}function yv(e,t){const n=t.__lexicalDirTextContent,r=t.__lexicalDir;if(n!==tv||r!==av){const n=""===tv,i=n?av:(o=tv,fm.test(o)?"rtl":hm.test(o)?"ltr":null);if(i!==r){const o=t.classList,s=Kg.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=_m(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=_m(l);l=s[i]=e}void 0!==l&&o.add(...l)}t.dir=i}sv||(e.getWritable().__dir=i)}av=i,t.__lexicalDirTextContent=tv,t.__lexicalDir=i}var o}function bv(e,t){const n=[];let r=e.__first;for(;null!==r;){const e=t.get(r);void 0===e&&wm(101),n.push(r),r=e.__next}return n}function xv(e,t){const n=Gg.get(e);let r=Jg.get(e);void 0!==n&&void 0!==r||wm(61);const o=iv||Xg.has(e)||Yg.has(e),i=Cg($g,e);if(n===r&&!o){if(pb(n)){const e=i.__lexicalTextContent;void 0!==e&&(ev+=e,ov+=e);const t=i.__lexicalDirTextContent;void 0!==t&&(tv+=t)}else{const e=n.getTextContent();my(n)&&!n.isDirectionless()&&(tv+=e),ov+=e,ev+=e}return i}if(n!==r&&o&&xg(Qg,Hg,qg,r,"updated"),r.updateDOM(n,i,Kg)){const n=pv(e,null,null);return null===t&&wm(62),t.replaceChild(n,i),lv(e,null),n}if(pb(n)&&pb(r)){const e=r.__indent;e!==n.__indent&&fv(i,e);const t=r.__format;t!==n.__format&&hv(i,t),o&&(function(e,t,n){const r=tv;var o;tv="",nv=null,rv="",function(e,t,n){const r=ev,o=e.__size,i=t.__size;if(ev="",1===o&&1===i){const r=e.__first,o=t.__first;if(r===o)xv(r,n);else{const e=Sv(r),t=pv(o,null,null);n.replaceChild(t,e),lv(r,null)}const i=Jg.get(o);my(i)&&(null===nv&&(nv=i.getFormat()),""===rv&&(rv=i.getStyle()))}else{const r=bv(e,Gg),s=bv(t,Jg);if(0===o)0!==i&&mv(s,t,0,i-1,n,null);else if(0===i){if(0!==o){const e=null==n.__lexicalLineBreak;cv(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=_v(xv(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=Cg($g,r);e===u?u=_v(xv(r,i)):(null!=u?i.insertBefore(e,u):i.appendChild(e),xv(r,i)),d++,f++}else pv(r,i,u),f++;else u=_v(Sv(e)),lv(e,i),d++}const o=Jg.get(r);null!==o&&my(o)&&(null===nv&&(nv=o.getFormat()),""===rv&&(rv=o.getStyle()))}const h=d>s,p=f>a;if(h&&!p){const t=n[a+1];mv(n,e,f,a,i,void 0===t?null:$g.getElementByKey(t))}else p&&!h&&cv(t,d,s,i)}(t,r,s,o,i,n)}Eg(t)&&(ev+=lm),n.__lexicalTextContent=ev,ev=r+ev}(e,t,n),yv(t,n),Tb(o=t)&&null!=nv&&nv!==o.__textFormat&&!sv&&(o.setTextFormat(nv),o.setTextStyle(rv)),function(e){Tb(e)&&""!==rv&&rv!==e.__textStyle&&!sv&&e.setTextStyle(rv)}(t),tv=r}(n,r,i),bb(r)||r.isInline()||vv(n,r,i)),Eg(r)&&(ev+=lm,ov+=lm)}else{const t=r.getTextContent();if(vb(r)){const t=r.decorate($g,Kg);null!==t&&wv(e,t)}else my(r)&&!r.isDirectionless()&&(tv+=t);ev+=t,ov+=t}if(!sv&&bb(r)&&r.__cachedText!==ov){const e=r.getWritable();e.__cachedText=ov,r=e}return i}function wv(e,t){let n=$g._pendingDecorators;const r=$g._decorators;if(null===n){if(r[e]===t)return;n=Qm($g)}n[e]=t}function _v(e){let t=e.nextSibling;return null!==t&&t===$g._blockCursorElement&&(t=t.nextSibling),t}function Sv(e){const t=Zg.get(e);return void 0===t&&wm(75,e),t}const kv=Object.freeze({}),Ev=[["keydown",function(e,t){if(Cv=e.timeStamp,Tv=e.key,t.isComposing())return;const{key:n,shiftKey:r,ctrlKey:o,metaKey:i,altKey:s}=e;kg(t,ap,e)||null!=n&&(function(e,t,n,r){return hg(e)&&!t&&!r&&!n}(n,o,s,i)?kg(t,lp,e):function(e,t,n,r,o){return hg(e)&&!r&&!n&&(t||o)}(n,o,r,s,i)?kg(t,cp,e):function(e,t,n,r){return fg(e)&&!t&&!r&&!n}(n,o,s,i)?kg(t,up,e):function(e,t,n,r,o){return fg(e)&&!r&&!n&&(t||o)}(n,o,r,s,i)?kg(t,dp,e):function(e,t,n){return function(e){return"ArrowUp"===e}(e)&&!t&&!n}(n,o,i)?kg(t,fp,e):function(e,t,n){return function(e){return"ArrowDown"===e}(e)&&!t&&!n}(n,o,i)?kg(t,hp,e):function(e,t){return mg(e)&&t}(n,r)?(Mv=!0,kg(t,pp,e)):function(e){return" "===e}(n)?kg(t,mp,e):function(e,t){return jp&&t&&"o"===e.toLowerCase()}(n,o)?(e.preventDefault(),Mv=!0,kg(t,Jh,!0)):function(e,t){return mg(e)&&!t}(n,r)?(Mv=!1,kg(t,pp,e)):function(e,t,n,r){return jp?!t&&!n&&(gg(e)||"h"===e.toLowerCase()&&r):!(r||t||n)&&gg(e)}(n,s,i,o)?gg(n)?kg(t,gp,e):(e.preventDefault(),kg(t,Gh,!0)):function(e){return"Escape"===e}(n)?kg(t,vp,e):function(e,t,n,r,o){return jp?!(n||r||o)&&(vg(e)||"d"===e.toLowerCase()&&t):!(t||r||o)&&vg(e)}(n,o,r,s,i)?vg(n)?kg(t,yp,e):(e.preventDefault(),kg(t,Gh,!1)):function(e,t,n){return gg(e)&&(jp?t:n)}(n,s,o)?(e.preventDefault(),kg(t,np,!0)):function(e,t,n){return vg(e)&&(jp?t:n)}(n,s,o)?(e.preventDefault(),kg(t,np,!1)):function(e,t){return jp&&t&&gg(e)}(n,i)?(e.preventDefault(),kg(t,rp,!0)):function(e,t){return jp&&t&&vg(e)}(n,i)?(e.preventDefault(),kg(t,rp,!1)):function(e,t,n,r){return"b"===e.toLowerCase()&&!t&&pg(n,r)}(n,s,i,o)?(e.preventDefault(),kg(t,op,"bold")):function(e,t,n,r){return"u"===e.toLowerCase()&&!t&&pg(n,r)}(n,s,i,o)?(e.preventDefault(),kg(t,op,"underline")):function(e,t,n,r){return"i"===e.toLowerCase()&&!t&&pg(n,r)}(n,s,i,o)?(e.preventDefault(),kg(t,op,"italic")):function(e,t,n,r){return"Tab"===e&&!t&&!n&&!r}(n,s,o,i)?kg(t,bp,e):function(e,t,n,r){return"z"===e.toLowerCase()&&!t&&pg(n,r)}(n,r,i,o)?(e.preventDefault(),kg(t,ip,void 0)):function(e,t,n,r){return jp?"z"===e.toLowerCase()&&n&&t:"y"===e.toLowerCase()&&r||"z"===e.toLowerCase()&&r&&t}(n,r,i,o)?(e.preventDefault(),kg(t,sp,void 0)):Ty(t._editorState._selection)?function(e,t,n,r){return!t&&"c"===e.toLowerCase()&&(jp?n:r)}(n,r,i,o)?(e.preventDefault(),kg(t,kp,e)):function(e,t,n,r){return!t&&"x"===e.toLowerCase()&&(jp?n:r)}(n,r,i,o)?(e.preventDefault(),kg(t,Ep,e)):yg(n,i,o)&&(e.preventDefault(),kg(t,Cp,e)):!Lp&&yg(n,i,o)&&(e.preventDefault(),kg(t,Cp,e)),function(e,t,n,r){return e||t||n||r}(o,r,s,i)&&kg(t,Mp,e))}],["pointerdown",function(e,t){const n=e.target,r=e.pointerType;n instanceof Node&&"touch"!==r&&fb(t,(()=>{vb(Zm(n))||(Nv=!0)}))}],["compositionstart",function(e,t){fb(t,(()=>{const n=Fy();if(Ey(n)&&!t.isComposing()){const r=n.anchor,o=n.anchor.getNode();Ym(r.key),(e.timeStamp{zv(t,e.data)}))}],["input",function(e,t){e.stopPropagation(),fb(t,(()=>{const n=Fy(),r=e.data,o=Vv(e);if(null!=r&&Ey(n)&&jv(n,o,r,e.timeStamp,!1)){Dv&&(zv(t,r),Dv=!1);const o=n.anchor.getNode(),i=_n(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;Fp&&!n.isCollapsed()&&my(o)&&null!==i.anchorNode&&o.getTextContent().slice(0,a)+r+o.getTextContent().slice(a+l)===cg(i.anchorNode)||kg(t,Qh,r);const c=r.length;Lp&&c>1&&"insertCompositionText"===e.inputType&&!t.isComposing()&&(n.anchor.offset-=c),Vp||zp||Kp||!t.isComposing()||(Cv=0,Ym(null))}else ug(!1,t,null!==r?r:void 0),Dv&&(zv(t,r||void 0),Dv=!1);Qy(),Am(nb())})),Rv=null}],["click",function(e,t){fb(t,(()=>{const n=Fy(),r=_n(t._window),o=Vy();if(r)if(Ey(n)){const t=n.anchor,i=t.getNode();"element"===t.type&&0===t.offset&&n.isCollapsed()&&!bb(i)&&1===tg().getChildrenSize()&&i.getTopLevelElementOrThrow().isEmpty()&&null!==o&&n.is(o)?(r.removeAllRanges(),n.dirty=!0):3!==e.detail||n.isCollapsed()||i!==n.focus.getNode()&&(pb(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!==$p&&i!==Hp||rg(Ly(o,r,t,e))}}kg(t,Xh,e)}))}],["cut",kv],["copy",kv],["dragstart",kv],["dragover",kv],["dragend",kv],["paste",kv],["focus",kv],["blur",kv],["drop",kv]];Fp&&Ev.push(["beforeinput",(e,t)=>function(e,t){const n=e.inputType,r=Vv(e);"deleteCompositionText"===n||Lp&&Sg(t)||"insertCompositionText"!==n&&fb(t,(()=>{const o=Fy();if("deleteContentBackward"===n){if(null===o){const e=Vy();if(!Ey(e))return;rg(e.clone())}if(Ey(o)){const n=o.anchor.key===o.focus.key;if(i=e.timeStamp,"MediaLast"===Tv&&i{fb(t,(()=>{Ym(null)}))}),30),Ey(o)){const e=o.anchor.getNode();e.markDirty(),o.format=e.getFormat(),my(e)||wm(142),o.style=e.getStyle()}}else{Ym(null),e.preventDefault();const r=o.anchor.getNode().getTextContent(),i=0===o.anchor.offset&&o.focus.offset===r.length;Up&&n&&!i||kg(t,Gh,!0)}return}}var i;if(!Ey(o))return;const s=e.data;null!==Rv&&ug(!1,t,Rv),o.dirty&&null===Rv||!o.isCollapsed()||bb(o.anchor.getNode())||null===r||o.applyDOMRange(r),Rv=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":kg(t,Qh,e);break;case"insertFromComposition":Ym(null),kg(t,Qh,e);break;case"insertLineBreak":Ym(null),kg(t,Jh,!1);break;case"insertParagraph":Ym(null),Mv&&!zp?(Mv=!1,kg(t,Jh,!1)):kg(t,Zh,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":kg(t,ep,e);break;case"deleteByComposition":(function(e,t){return e!==t||pb(e)||pb(t)||!e.isToken()||!t.isToken()})(c,u)&&kg(t,tp,e);break;case"deleteByDrag":case"deleteByCut":kg(t,tp,e);break;case"deleteContent":kg(t,Gh,!1);break;case"deleteWordBackward":kg(t,np,!0);break;case"deleteWordForward":kg(t,np,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":kg(t,rp,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":kg(t,rp,!1);break;case"formatStrikeThrough":kg(t,op,"strikethrough");break;case"formatBold":kg(t,op,"bold");break;case"formatItalic":kg(t,op,"italic");break;case"formatUnderline":kg(t,op,"underline");break;case"historyUndo":kg(t,ip,void 0);break;case"historyRedo":kg(t,sp,void 0)}else{if("\n"===s)e.preventDefault(),kg(t,Jh,!1);else if(s===lm)e.preventDefault(),kg(t,Zh,void 0);else if(null==s&&e.dataTransfer){const t=e.dataTransfer.getData("text/plain");e.preventDefault(),o.insertRawText(t)}else null!=s&&jv(o,r,s,e.timeStamp,!0)?(e.preventDefault(),kg(t,Qh,s)):Rv=s;Pv=e.timeStamp}}))}(e,t)]);let Cv=0,Tv=null,Pv=0,Rv=null;const Ov=new WeakMap;let Av=!1,Nv=!1,Mv=!1,Dv=!1,Iv=[0,"",0,"root",0];function jv(e,t,n,r,o){const i=e.anchor,s=e.focus,a=i.getNode(),l=nb(),c=_n(l._window),u=null!==c?c.anchorNode:null,d=i.key,f=l.getElementByKey(d),h=n.length;return d!==s.key||!my(a)||(!o&&(!Fp||Pv1||(o||!Fp)&&null!==f&&!a.isComposing()&&u!==Km(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(my(t)||pb(t)&&t.isInline())&&!t.canInsertTextAfter()}(t):n===t.getTextContentSize()&&(!t.canInsertTextAfter()||!r.canInsertTextAfter()&&!t.isComposing()||o)}(e,a)}function Lv(e,t){return null!==e&&null!==e.nodeValue&&e.nodeType===Hp&&0!==t&&t!==e.nodeValue.length}function Fv(e,t,n){const{anchorNode:r,anchorOffset:o,focusNode:i,focusOffset:s}=e;Av&&(Av=!1,Lv(r,o)&&Lv(i,s))||fb(t,(()=>{if(!n)return void rg(null);if(!zm(t,r,i))return;const a=Fy();if(Ey(a)){const n=a.anchor,r=n.getNode();if(a.isCollapsed()){"Range"===e.type&&e.anchorNode===e.focusNode&&(a.dirty=!0);const o=Rg(t).event,i=o?o.timeStamp:performance.now(),[s,l,c,u,d]=Iv,f=tg(),h=!1===t.isComposing()&&""===f.getTextContent();if(i{const t=Vy(),o=n.anchorNode;if(null===o)return;const i=o.nodeType;i!==$p&&i!==Hp||rg(Ly(t,n,r,e))})));const o=ag(r),i=o[o.length-1],s=i._key,a=Wv.get(s),l=a||i;l!==r&&Fv(n,l,!1),Fv(n,r,!0),r!==i?Wv.set(s,r):a&&Wv.delete(s)}function Kv(e){e._lexicalHandled=!0}function $v(e){return!0===e._lexicalHandled}function Hv(e,t,n){Qy();const r=e.__key,o=e.getParent();if(null===o)return;const i=function(e){const t=Fy();if(!Ey(t)||!pb(e))return t;const{anchor:n,focus:r}=t,o=n.getNode(),i=r.getNode();return Pg(o,e)&&n.set(e.__key,0,"element"),Pg(i,e)&&r.set(e.__key,0,"element"),t}(e);let s=!1;if(Ey(i)&&t){const t=i.anchor,n=i.focus;t.key===r&&(Wy(t,e,o,e.getPreviousSibling(),e.getNextSibling()),s=!0),n.key===r&&(Wy(n,e,o,e.getPreviousSibling(),e.getNextSibling()),s=!0)}else Ty(i)&&t&&e.isSelected()&&e.selectPrevious();if(Ey(i)&&t&&!s){const t=e.getIndexWithinParent();Hm(e),zy(i,o,t,-1)}else Hm(e);n||Og(o)||o.canBeEmpty()||!o.isEmpty()||Hv(o,t),t&&bb(o)&&o.isEmpty()&&o.selectEnd()}class qv{static getType(){wm(64,this.name)}static clone(e){wm(65,this.name)}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);Qy(),eb();const n=nb(),r=tb(),o=""+Lm++;r._nodeMap.set(o,e),pb(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(){wm(137,this.constructor.name)}isAttached(){let e=this.__key;for(;null!==e;){if("root"===e)return!0;const t=Gm(e);if(null===t)break;e=t.__parent}return!1}isSelected(e){const t=e||Fy();if(null==t)return!1;const n=t.getNodes().some((e=>e.__key===this.__key));if(my(this))return n;if(Ey(t)&&"element"===t.anchor.type&&"element"===t.focus.type){if(t.isCollapsed())return!1;const e=this.getParent();if(vb(this)&&this.isInline()&&e){const{anchor:n,focus:r}=t;if(n.isBefore(r)){const t=n.getNode(),r=n.offset===t.getChildrenSize(),o=t.is(e),i=t.getLastChildOrThrow().is(this);if(r&&o&&i)return!1}else{const t=r.getNode(),n=r.offset===t.getChildrenSize(),o=t.is(e),i=t.getLastChildOrThrow().is(this);if(n&&o&&i)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:Gm(e)}getParentOrThrow(){const e=this.getParent();return null===e&&wm(66,this.__key),e}getTopLevelElement(){let e=this;for(;null!==e;){const t=e.getParent();if(Og(t))return pb(e)||e===this&&vb(e)||wm(194),e;e=t}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();return null===e&&wm(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:Gm(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:Gm(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();pb(this)&&t.unshift(this),pb(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)}))),Ey(n)){rg(n);const e=n.anchor,t=n.focus;e.key===o&&_y(e,s),t.key===o&&_y(t,s)}return Xm()===o&&Ym(i),s}insertAfter(e,t=!0){Qy(),Ng(this,e);const n=this.getWritable(),r=e.getWritable(),o=r.getParent(),i=Fy();let s=!1,a=!1;if(null!==o){const t=e.getIndexWithinParent();if(Hm(r),Ey(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&&Ey(i)){const e=this.getIndexWithinParent();zy(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){Qy(),Ng(this,e);const n=this.getWritable(),r=e.getWritable(),o=r.__key;Hm(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=Fy();return t&&Ey(c)&&zy(c,this.getParentOrThrow(),l),e}isParentRequired(){return!1}createParentElementNode(){return Cb()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){Qy();const n=this.getPreviousSibling(),r=this.getParentOrThrow();if(null===n)return r.select(0,0);if(pb(n))return n.select();if(!my(n)){const e=n.getIndexWithinParent()+1;return r.select(e,e)}return n.select(e,t)}selectNext(e,t){Qy();const n=this.getNextSibling(),r=this.getParentOrThrow();if(null===n)return r.select();if(pb(n))return n.select(0,0);if(!my(n)){const e=n.getIndexWithinParent();return r.select(e,e)}return n.select(e,t)}markDirty(){this.getWritable()}}class Yv extends qv{static getType(){return"linebreak"}static clone(e){return new Yv(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&&Lg(t)){const n=t.firstChild;if(n===e||n.nextSibling===e&&Zv(n)){const n=t.lastChild;if(n===e||n.previousSibling===e&&Zv(n))return!0}}return!1}(e)||function(e){const t=e.parentElement;if(null!==t&&Lg(t)){const n=t.firstChild;if(n===e||n.nextSibling===e&&Zv(n))return!1;const r=t.lastChild;if(r===e||r.previousSibling===e&&Zv(r))return!0}return!1}(e)?null:{conversion:Xv,priority:0}}}static importJSON(e){return Gv()}exportJSON(){return{type:"linebreak",version:1}}}function Xv(e){return{node:Gv()}}function Gv(){return Ag(new Yv)}function Jv(e){return e instanceof Yv}function Zv(e){return e.nodeType===Hp&&/^( |\t|\r?\n)+$/.test(e.textContent||"")}function Qv(e,t){return 16&t?"code":128&t?"mark":32&t?"sub":64&t?"sup":null}function ey(e,t){return 1&t?"strong":2&t?"em":"span"}function ty(e,t,n,r,o){const i=r.classList;let s=bg(o,"base");void 0!==s&&i.add(...s),s=bg(o,"underlineStrikethrough");let a=!1;const l=t&Qp&&t&Zp;void 0!==s&&(n&Qp&&n&Zp?(a=!0,l||i.add(...s)):l&&i.remove(...s));for(const e in pm){const r=pm[e];if(s=bg(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 ny(e,t,n){const r=t.firstChild,o=n.isComposing(),i=e+(o?am:"");if(null==r)t.textContent=i;else{const e=r.nodeValue;if(e!==i)if(o||Lp){const[t,n,o]=function(e,t){const n=e.length,r=t.length;let o=0,i=0;for(;o({conversion:uy,priority:0}),b:()=>({conversion:ay,priority:0}),code:()=>({conversion:hy,priority:0}),em:()=>({conversion:hy,priority:0}),i:()=>({conversion:hy,priority:0}),s:()=>({conversion:hy,priority:0}),span:()=>({conversion:sy,priority:0}),strong:()=>({conversion:hy,priority:0}),sub:()=>({conversion:hy,priority:0}),sup:()=>({conversion:hy,priority:0}),u:()=>({conversion:hy,priority:0})}}static importJSON(e){const t=py(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&&Ig(t)||wm(132),t.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(t=oy(t,"b")),this.hasFormat("italic")&&(t=oy(t,"i")),this.hasFormat("strikethrough")&&(t=oy(t,"s")),this.hasFormat("underline")&&(t=oy(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?mm[e]:e,t}setStyle(e){const t=this.getWritable();return t.__style=e,t}toggleFormat(e){const t=$m(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=ym[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){Qy();let n=e,r=t;const o=Fy(),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(!Ey(o))return Iy(s,n,s,r,"text","text");{const e=Xm();e!==o.anchor.key&&e!==o.focus.key||Ym(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=Fy();if(r&&Ey(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){Qy();const t=this.getLatest(),n=t.getTextContent(),r=t.__key,o=Xm(),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&&Ym(a),b=l,y.push(i)}!function(e){const t=e.getPreviousSibling(),n=e.getNextSibling();null!==t&&qm(t),null!==n&&qm(n)}(this);const x=d.getWritable(),w=this.getIndexWithinParent();return g?(x.splice(w,0,y),this.remove()):x.splice(w,1,y),Ey(v)&&zy(v,d,w,c-1),y}mergeWithSibling(e){const t=e===this.getPreviousSibling();t||e===this.getNextSibling()||wm(50);const n=this.__key,r=e.__key,o=this.__text,i=o.length;Xm()===r&&Ym(n);const s=Fy();if(Ey(s)){const o=s.anchor,a=s.focus;null!==o&&o.key===r&&(Uy(o,t,n,e,i),s.dirty=!0),null!==a&&a.key===r&&(Uy(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 sy(e){return{forChild:gy(e.style),node:null}}function ay(e){const t=e,n="normal"===t.style.fontWeight;return{forChild:gy(t.style,n?void 0:"bold"),node:null}}const ly=new WeakMap;function cy(e){return"PRE"===e.nodeName||e.nodeType===$p&&void 0!==e.style&&void 0!==e.style.whiteSpace&&e.style.whiteSpace.startsWith("pre")}function uy(e){const t=e;null===e.parentElement&&wm(129);let n=t.textContent||"";if(null!==function(e){let t,n=e.parentNode;const r=[e];for(;null!==n&&void 0===(t=ly.get(n))&&!cy(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=dy(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:py(n)}}function dy(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===$p){const e=n.style.display;if(""===e&&!jg(n)||""!==e&&!e.startsWith("inline"))return null}let r=n;for(;null!==(r=t?n.firstChild:n.lastChild);)n=r;if(n.nodeType===Hp)return n;if("BR"===n.nodeName)return null}}const fy={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function hy(e){const t=fy[e.nodeName.toLowerCase()];return void 0===t?{node:null}:{forChild:gy(e.style,t),node:null}}function py(e=""){return Ag(new iy(e))}function my(e){return e instanceof iy}function gy(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=>my(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 vy extends iy{static getType(){return"tab"}static clone(e){const t=new vy(e.__key);return t.__text=e.__text,t.__format=e.__format,t.__style=e.__style,t}constructor(e){super("\t",e),this.__detail=2}static importDOM(){return null}static importJSON(e){const t=yy();return t.setFormat(e.format),t.setStyle(e.style),t}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(e){wm(126)}setDetail(e){wm(127)}setMode(e){wm(128)}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function yy(){return Ag(new vy)}class by{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(pb(t)){const e=t.getDescendantByIndex(r);t=null!=e?e:t}if(pb(n)){const e=n.getDescendantByIndex(o);n=null!=e?e:n}return t===n?re&&(r=e)}else if(!pb(t)){const e=t.getNextSibling();if(my(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 _y(e,t){if(pb(t)){const n=t.getLastDescendant();pb(n)||my(n)?wy(e,n):wy(e,t)}else wy(e,t)}function Sy(e,t,n,r){e.key=t,e.offset=n,e.type=r}class ky{constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!Ty(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 ky(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(my(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),Zy()||(this._cachedNodes=u),u}setTextNodeRange(e,t,n,r){Sy(this.anchor,e.__key,t,"text"),Sy(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]=Ry(this);let l="",c=!0;for(let u=0;u=0;e--){const t=i[e];if(t.is(d)||pb(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=py(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()||Wm(p)||([p]=p.splitText(m)),p.setFormat(g));for(let t=c+1;t(pb(e)||vb(e))&&!e.isInline()))){pb(t)||wm(135);const r=Ky(this);return t.splice(r,0,e),void n.selectEnd()}const r=function(e){const t=Cb();let n=null;for(let r=0;r"__value"in e&&"__checked"in e,a=pb(t)&&t.isEmpty()?null:this.insertParagraph(),l=i[i.length-1];let c=i[0];var u;pb(u=c)&&Fg(u)&&!u.isEmpty()&&pb(t)&&(!t.isEmpty()||s(t))&&(pb(t)||wm(135),t.append(...c.getChildren()),c=i[1]),c&&function(e,t){const n=t.getParentOrThrow().getLastChild();let r=t;const o=[t];for(;r!==n;)r.getNextSibling()||wm(140),r=r.getNextSibling(),o.push(r);let i=e;for(const e of o)i=i.insertAfter(e)}(t,c);const d=Vg(o,Fg);a&&pb(d)&&(s(a)||Fg(l))&&(d.append(...a.getChildren()),a.remove()),pb(t)&&t.isEmpty()&&t.remove(),o.selectEnd();const f=pb(t)?t.getLastChild():null;Jv(f)&&d!==t&&f.remove()}insertParagraph(){if("root"===this.anchor.key){const e=Cb();return tg().splice(this.anchor.offset,0,[e]),e.select(),e}const e=Ky(this),t=Vg(this.anchor.getNode(),Fg);pb(t)||wm(136);const n=t.getChildAtIndex(e),r=n?[n,...n.getNextSiblings()]:[],o=t.insertNewAfter(this,!1);return o?(o.append(...r),o.selectStart(),o):null}insertLineBreak(e){const t=Gv();if(this.insertNodes([t]),e){const e=t.getParentOrThrow(),n=t.getIndexWithinParent();e.select(n,n)}}extract(){const e=this.getNodes(),t=e.length,n=t-1,r=this.anchor,o=this.focus;let i=e[0],s=e[n];const[a,l]=Ry(this);if(0===t)return[];if(1===t){if(my(i)&&!this.isCollapsed()){const e=a>l?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(my(i)){const t=c?a:l;t===i.getTextContentSize()?e.shift():0!==t&&([,i]=i.splitText(t),e[0]=i)}if(my(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=_g(r,t);if(vb(s)&&!s.isIsolated()){if(i&&s.isKeyboardSelectable()){const e=jy();return e.add(s.__key),void rg(e)}const e=t?s.getPreviousSibling():s.getNextSibling();if(my(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 pb(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=nb(),l=_n(a._window);if(!l)return;const c=a._blockCursorElement,u=a._rootElement;if(null===u||null===c||!pb(s)||s.isInline()||s.canBeEmpty()||Dg(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=bb(n)?n:function(e){let t=e.getParentOrThrow();for(;null!==t;){if(Og(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];pb(e)?e.selectStart():e.getParentOrThrow().selectStart()}else{const e=o[o.length-1];pb(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;Sy(n,t.key,t.offset,t.type),Sy(t,r,o,i),e._cachedNodes=null}(this)}}}forwardDeletion(e,t,n){if(!n&&("element"===e.type&&pb(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(pb(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=_g(r,e);if(vb(o)&&!o.isIsolated()){if(o.isKeyboardSelectable()&&pb(n)&&0===n.getChildrenSize()){n.remove();const e=jy();e.add(o.__key),rg(e)}else o.remove(),nb().dispatchCommand(Yh,void 0);return}if(!e&&pb(o)&&pb(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 Oy(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 Oy(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 Ay(e,t,n,r){let o,i=t;if(e.nodeType===$p){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=og(u),my(o))i=ig(o,s);else{let r=og(e);if(null===r)return null;if(pb(r)){i=Math.min(r.getChildrenSize(),i);let e=r.getChildAtIndex(i);if(pb(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=pb(e)?e:e.getParentOrThrow()),i=0}my(e)?(o=e,r=null,i=ig(e,s)):e!==r&&s&&!d&&i++}else{const n=r.getIndexWithinParent();i=0===t&&vb(r)&&og(e)===r?n:n+1,r=r.getParentOrThrow()}if(pb(r))return xy(r.__key,i,"element")}}else o=og(e);return my(o)?xy(o.__key,i,"text"):null}function Ny(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&&pb(i)&&i.isInline()){const t=i.getPreviousSibling();my(t)&&(e.key=t.__key,e.offset=t.getTextContent().length)}}else pb(r)&&!n&&r.isInline()?(e.key=r.__key,e.offset=r.getChildrenSize(),e.type="element"):my(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&&pb(r)&&r.isInline())e.key=r.__key,e.offset=0,e.type="element";else if((n||t)&&null===r&&pb(i)&&i.isInline()&&!i.canInsertTextAfter()){const t=i.getNextSibling();my(t)&&(e.key=t.__key,e.offset=0)}}}function My(e,t,n){if("text"===e.type&&"text"===t.type){const r=e.isBefore(t),o=e.is(t);Ny(e,r,o),Ny(t,!r,o),o&&(t.key=e.key,t.offset=e.offset,t.type=e.type);const i=nb();if(i.isComposing()&&i._compositionKey!==e.key&&Ey(n)){const r=n.anchor,o=n.focus;Sy(e,r.key,r.offset,r.type),Sy(t,o.key,o.offset,o.type)}}}function Dy(e,t,n,r,o,i){if(null===e||null===n||!zm(o,e,n))return null;const s=Ay(e,t,Ey(i)?i.anchor:null,o);if(null===s)return null;const a=Ay(n,r,Ey(i)?i.focus:null,o);if(null===a)return null;if("element"===s.type&&"element"===a.type){const t=og(e),r=og(n);if(vb(t)&&vb(r))return null}return My(s,a,i),[s,a]}function Iy(e,t,n,r,o,i){const s=tb(),a=new Cy(xy(e,t,o),xy(n,r,i),0,"");return a.dirty=!0,s._selection=a,a}function jy(){return new ky(new Set)}function Ly(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=!km&&(a||"beforeinput"===s||"compositionstart"===s||"compositionend"===s||"click"===s&&i&&3===i.detail||"drop"===s||void 0===s);let c,u,d,f;if(Ey(e)&&!l)return e.clone();if(null===t)return null;if(c=t.anchorNode,u=t.focusNode,d=t.anchorOffset,f=t.focusOffset,a&&Ey(e)&&!zm(n,c,u))return e.clone();const h=Dy(c,d,u,f,n,e);if(null===h)return null;const[p,m]=h;return new Cy(p,m,Ey(e)?e.format:0,Ey(e)?e.style:"")}function Fy(){return tb()._selection}function Vy(){return nb()._editorState._selection}function zy(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(my(s)){let e=0;o&&(e=s.getTextContentSize()),t.set(s.__key,e,"text"),r.set(s.__key,e,"text")}}else{if(pb(i)){const e=i.getChildrenSize(),r=n>=e,o=r?i.getChildAtIndex(e-1):i.getChildAtIndex(n);if(my(o)){let e=0;r&&(e=o.getTextContentSize()),t.set(o.__key,e,"text")}}if(pb(s)){const e=s.getChildrenSize(),t=o>=e,n=t?s.getChildAtIndex(e-1):s.getChildAtIndex(o);if(my(n)){let e=0;t&&(e=n.getTextContentSize()),r.set(n.__key,e,"text")}}}}function Wy(e,t,n,r,o){let i=null,s=0,a=null;null!==r?(i=r.__key,my(r)?(s=r.getTextContentSize(),a="text"):pb(r)&&(s=r.getChildrenSize(),a="element")):null!==o&&(i=o.__key,my(o)?a="text":pb(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 Uy(e,t,n,r,o){"text"===e.type?(e.key=n,t||(e.offset+=o)):e.offset>r.getIndexWithinParent()&&(e.offset-=1)}function Ky(e){let t=e;e.isCollapsed()||t.removeText();const n=Fy();Ey(n)&&(t=n),Ey(t)||wm(161);const r=t.anchor;let o=r.getNode(),i=r.offset;for(;!Fg(o);)[o,i]=$y(o,i);return i}function $y(e,t){const n=e.getParent();if(!n){const e=Cb();return tg().append(e),e.select(),[tg(),0]}if(my(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(!pb(e)||0===t)return[n,e.getIndexWithinParent()];const r=e.getChildAtIndex(t);if(r){const n=new Cy(xy(e.__key,t,"element"),xy(e.__key,t,"element"),0,""),o=e.insertNewAfter(n);o&&o.append(r,...r.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}let Hy=null,qy=null,Yy=!1,Xy=!1,Gy=0;const Jy={characterData:!0,childList:!0,subtree:!0};function Zy(){return Yy||null!==Hy&&Hy._readOnly}function Qy(){Yy&&wm(13)}function eb(){Gy>99&&wm(14)}function tb(){return null===Hy&&wm(189),Hy}function nb(){return null===qy&&wm(190),qy}function rb(e,t,n){const r=t.__type,o=function(e,t){const n=e._nodes.get(t);return void 0===n&&wm(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=Rg(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=Tg(c)}}(n,t,i)}}Av=!0}}(s,a,e,x,y,r)}(function(e,t,n){let r=e._blockCursorElement;if(Ey(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())Mg(i.getChildAtIndex(s-1))&&(a=!0);else{const t=i.getChildAtIndex(s);if(Mg(t)){const n=t.getPreviousSibling();(null===n||Mg(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=_m(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&&Dg(r,e,t)})(e,r,a),null!==h&&h.observe(r,Jy)}finally{qy=d,Hy=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=ag(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);my(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&Im(r),void 0!==r&&ob(r,i)&&rb(t,r,s),n.add(e)}if(a=t._dirtyLeaves,l=a.size,l>0){Gy++;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&&ob(l,i)&&rb(t,l,s),r.set(n,a)}a=t._dirtyLeaves,l=a.size,c=t._dirtyElements,u=c.size,Gy++}t._dirtyLeaves=n,t._dirtyElements=r}(c,e),ub(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()||(pb(t)&&Ug(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(Ey(r)){const e=c._nodeMap,t=r.anchor.key,n=r.focus.key;void 0!==e.get(t)&&void 0!==e.get(n)||wm(19)}else Ty(r)&&0===r._nodes.size&&(c._selection=null)}catch(t){return t instanceof Error&&e._onError(t),e._pendingEditorState=l,e._dirtyType=Yp,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),void ab(e)}finally{Hy=d,Yy=f,qy=h,e._updating=p,Gy=0}const m=e._dirtyType!==qp||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,ab(e)):u&&Fm((()=>{ab(e)})):(c._flushSync=!1,u&&(r.clear(),e._deferred=[],e._pendingEditorState=null))}function fb(e,t,n){e._updating?e._updates.push([t,n]):db(e,t,n)}class hb extends qv{constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null}getFormat(){return this.getLatest().__format}getFormatType(){const e=this.getFormat();return vm[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=nb()._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(my(t)&&e.push(t),pb(t)){const n=t.getAllTextNodes();e.push(...n)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;pb(e);){const t=e.getFirstChild();if(null===t)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;pb(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 pb(e)&&e.getLastDescendant()||e||null}const r=t[e];return pb(r)&&r.getFirstDescendant()||r||null}getFirstChild(){const e=this.getLatest().__first;return null===e?null:Gm(e)}getFirstChildOrThrow(){const e=this.getFirstChild();return null===e&&wm(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return null===e?null:Gm(e)}getLastChildOrThrow(){const e=this.getLastChild();return null===e&&wm(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?gm[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:wb(tg())})))}}class Sb extends hb{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class kb extends hb{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 kb(e.__key)}createDOM(e){const t=document.createElement("p"),n=bg(e.theme,"paragraph");return void 0!==n&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}static importDOM(){return{p:e=>({conversion:Eb,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(t&&Ig(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=Cb();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=Cb();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||my(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 Eb(e){const t=Cb();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 Cb(){return Ag(new kb)}function Tb(e){return e instanceof kb}const Pb=1;function Rb(e,t,n,r){const o=e._keyToDOMMap;o.clear(),e._editorState=xb(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=qp,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 Ob{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=qp,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=lg(),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&&wm(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&&wm(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&&wm(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 Bg;e._readOnly||wm(192);let t=zg.get(e);if(!t){t=new Map,zg.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(),fb(this,(()=>{const e=tb();if(e.isEmpty())return;if("root"===i)return void tg().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 kg(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=bg(this._config.theme,"root"),r=this._pendingEditorState||this._editorState;if(this._rootElement=e,Rb(this,t,e,r),null!==t&&(this._config.disableEvents||function(e){const t=e.ownerDocument,n=Ov.get(t);void 0===n&&wm(162);const r=n-1;r>=0||wm(164),Ov.set(t,r),0===r&&t.removeEventListener("selectionchange",Uv);const o=e.__lexicalEditor;null!=o&&(function(e){if(null!==e._parentEditor){const t=ag(e),n=t[t.length-1]._key;Wv.get(n)===e&&Wv.delete(n)}else Wv.delete(e._key)}(o),e.__lexicalEditor=null);const i=Bv(e);for(let e=0;e{$v(e)||(Kv(e),(t.isEditable()||"click"===r)&&i(e,t))}:e=>{if($v(e))return;Kv(e);const n=t.isEditable();switch(r){case"cut":return n&&kg(t,Ep,e);case"copy":return kg(t,kp,e);case"paste":return n&&kg(t,ep,e);case"dragstart":return n&&kg(t,wp,e);case"dragover":return n&&kg(t,_p,e);case"dragend":return n&&kg(t,Sp,e);case"focus":return n&&kg(t,Ap,e);case"blur":return n&&kg(t,Np,e);case"drop":return n&&kg(t,xp,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;lb("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&wm(38),Am(this);const n=this._pendingEditorState,r=this._updateTags,o=void 0!==t?t.tag:null;null===n||n.isEmpty()||(null!=o&&r.add(o),ab(this)),this._pendingEditorState=e,this._dirtyType=Yp,this._dirtyElements.set("root",!1),this._compositionKey=null,null!=o&&r.add(o),ab(this)}parseEditorState(e,t){return function(e,t,n){const r=xb(),o=Hy,i=Yy,s=qy,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,Hy=r,Yy=!1,qy=t;try{const o=t._nodes;ib(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,Hy=o,Yy=i,qy=s}return r}("string"==typeof e?JSON.parse(e):e,this,t)}read(e){return ab(this),this.getEditorState().read(e,{editor:this})}update(e,t){fb(this,e,t)}focus(e,t={}){const n=this._rootElement;null!==n&&(n.setAttribute("autocapitalize","off"),fb(this,(()=>{const e=Fy(),n=tg();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=_n(this._window);null!==t&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,lb("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}const Ab="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Nb=Ab?re.useLayoutEffect:re.useEffect,Mb={tag:"history-merge"};function Db({initialConfig:e,children:t}){const n=(0,re.useMemo)((()=>{const{theme:t,namespace:n,editor__DEPRECATED:r,nodes:o,onError:i,editorState:s,html:a}=e,l=function(e,t){let n=null;return{getTheme:function(){return null!=t?t:null!=n?n.getTheme():null}}}(0,t);let c=r||null;if(null===c){const r=function(e){const t=e||{},n=qy,r=t.theme||{},o=void 0===e?n:t.parentEditor||null,i=t.disableEvents||!1,s=xb(),a=t.namespace||(null!==o?o._config.namespace:lg()),l=t.editorState,c=[yb,iy,Yv,vy,kb,Sb,...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=Yp),p}({editable:e.editable,html:a,namespace:n,nodes:o,onError:e=>i(e,r),theme:t});!function(e,t){if(null!==t)if(void 0===t)e.update((()=>{const t=tg();if(t.isEmpty()){const n=Cb();t.append(n);const r=Ab?document.activeElement:null;(null!==Fy()||null!==r&&r===e.getRootElement())&&n.select()}}),Mb);else if(null!==t)switch(typeof t){case"string":{const n=e.parseEditorState(t);e.setEditorState(n,Mb);break}case"object":e.setEditorState(t,Mb);break;case"function":e.update((()=>{tg().isEmpty()&&t(e)}),Mb)}}(r,s),c=r}return[c,l]}),[]);return Nb((()=>{const t=e.editable,[r]=n;r.setEditable(void 0===t||t)}),[]),(0,ti.jsx)($h.Provider,{value:n,children:t})}const Ib="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?re.useLayoutEffect:re.useEffect;function jb(e){return{initialValueFn:()=>e.isEditable(),subscribe:t=>e.registerEditableListener(t)}}function Lb(e){return()=>function(e){if(!function(e,t=!0){if(e)return!1;let n=tg().getTextContent();return t&&(n=n.trim()),""===n}(e,!1))return!1;const t=tg().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 Bb(e,t){const n=_g(e.focus,t);return vb(n)&&!n.isIsolated()||pb(n)&&!n.isInline()&&!n.canBeEmpty()}function Wb(e,t,n){const r=function(e){const t=e.anchor.getNode();return"rtl"===(bb(t)?t:t.getParentOrThrow()).getDirection()}(e);!function(e,t,n){e.modify(t?"extend":"move",n,"character")}(e,t,n?!r:r)}function Ub(e,t,n,r=null){let o=null===r||t.isSelected(r);const i=pb(t)&&t.excludeFromCopy("html");let s=t;if(null!==r){let e=Wg(t);e=my(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]=Ry(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=pb(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=Fy();if(null!==o&&null!=r){e.preventDefault();const i=function(e){const t=Fy();return null==t&&Kb(166),Ey(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=tg().getChildren();for(let n=0;ne.getDecorators()));return ex((()=>e.registerDecoratorListener((e=>{(0,kn.flushSync)((()=>{r(e)}))}))),[e]),(0,re.useEffect)((()=>{r(e.getDecorators())}),[e]),(0,re.useMemo)((()=>{const r=[],o=Object.keys(n);for(let i=0;ie._onError(t),children:(0,ti.jsx)(re.Suspense,{fallback:null,children:n[s]})}),l=e.getElementByKey(s);null!==l&&r.push((0,kn.createPortal)(a,l,s))}return r}),[t,n,e])}(r,n);return function(e){ex((()=>zb(function(e){return zb(e.registerCommand(Gh,(e=>{const t=Fy();return!!Ey(t)&&(t.deleteCharacter(e),!0)}),0),e.registerCommand(np,(e=>{const t=Fy();return!!Ey(t)&&(t.deleteWord(e),!0)}),0),e.registerCommand(rp,(e=>{const t=Fy();return!!Ey(t)&&(t.deleteLine(e),!0)}),0),e.registerCommand(Qh,(e=>{const t=Fy();if(!Ey(t))return!1;if("string"==typeof e)t.insertText(e);else{const n=e.dataTransfer;if(null!=n)$b(n,t);else{const n=e.data;n&&t.insertText(n)}}return!0}),0),e.registerCommand(tp,(()=>{const e=Fy();return!!Ey(e)&&(e.removeText(),!0)}),0),e.registerCommand(Jh,(e=>{const t=Fy();return!!Ey(t)&&(t.insertLineBreak(e),!0)}),0),e.registerCommand(Zh,(()=>{const e=Fy();return!!Ey(e)&&(e.insertLineBreak(),!0)}),0),e.registerCommand(up,(e=>{const t=Fy();if(!Ey(t))return!1;const n=e,r=n.shiftKey;return!!Bb(t,!0)&&(n.preventDefault(),Wb(t,r,!0),!0)}),0),e.registerCommand(lp,(e=>{const t=Fy();if(!Ey(t))return!1;const n=e,r=n.shiftKey;return!!Bb(t,!1)&&(n.preventDefault(),Wb(t,r,!1),!0)}),0),e.registerCommand(gp,(t=>!!Ey(Fy())&&(t.preventDefault(),e.dispatchCommand(Gh,!0))),0),e.registerCommand(yp,(t=>!!Ey(Fy())&&(t.preventDefault(),e.dispatchCommand(Gh,!1))),0),e.registerCommand(pp,(t=>{if(!Ey(Fy()))return!1;if(null!==t){if((Gb||Xb||Zb)&&Yb)return!1;t.preventDefault()}return e.dispatchCommand(Jh,!1)}),0),e.registerCommand(Cp,(()=>(function(){const e=tg();rg(function(e){return jm(e.anchor),jm(e.focus),e}(e.select(0,e.getChildrenSize())))}(),!0)),0),e.registerCommand(kp,(t=>!!Ey(Fy())&&(Qb(t,e),!0)),0),e.registerCommand(Ep,(t=>!!Ey(Fy())&&(function(e,t){Qb(e,t),t.update((()=>{const e=Fy();Ey(e)&&e.removeText()}))}(t,e),!0)),0),e.registerCommand(ep,(t=>!!Ey(Fy())&&(function(e,t){e.preventDefault(),t.update((()=>{const t=Fy(),{clipboardData:n}=e;null!=n&&Ey(t)&&$b(n,t)}),{tag:"paste"})}(t,e),!0)),0),e.registerCommand(xp,(e=>!!Ey(Fy())&&(e.preventDefault(),!0)),0),e.registerCommand(wp,(e=>!!Ey(Fy())&&(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=Fy();if(Ey(e)){const t=e.anchor;let l=t.getNode(),c=0,u=0;if(my(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()),my(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,ti.jsxs)(ti.Fragment,{children:[e,(0,ti.jsx)(rx,{content:t}),o]})}function rx({content:e}){const[t]=Hh(),n=function(e){const[t,n]=(0,re.useState)((()=>tx(e)));return ex((()=>{function t(){const t=tx(e);n(t)}return t(),zb(e.registerUpdateListener((()=>{t()})),e.registerEditableListener((()=>{t()})))}),[e]),t}(t),r=function(e){const[t]=Hh(),n=(0,re.useMemo)((()=>e(t)),[t,e]),r=(0,re.useRef)(n.initialValueFn()),[o,i]=(0,re.useState)(r.current);return Ib((()=>{const{initialValueFn:e,subscribe:t}=n,o=e();return r.current!==o&&(r.current=o,i(o)),t((e=>{r.current=e,i(e)}))}),[n,e]),o}(jb);return n?"function"==typeof e?e(r):e:null}const ox="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?re.useLayoutEffect:re.useEffect,ix=(0,re.forwardRef)((function({editor:e,ariaActiveDescendant:t,ariaAutoComplete:n,ariaControls:r,ariaDescribedBy:o,ariaExpanded:i,ariaLabel:s,ariaLabelledBy:a,ariaMultiline:l,ariaOwns:c,ariaRequired:u,autoCapitalize:d,className:f,id:h,role:p="textbox",spellCheck:m=!0,style:g,tabIndex:v,"data-testid":y,...b},x){const[w,_]=(0,re.useState)(e.isEditable()),S=(0,re.useCallback)((t=>{t&&t.ownerDocument&&t.ownerDocument.defaultView?e.setRootElement(t):e.setRootElement(null)}),[e]),k=(0,re.useMemo)((()=>function(...e){return t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}}(x,S)),[S,x]);return ox((()=>(_(e.isEditable()),e.registerEditableListener((e=>{_(e)})))),[e]),(0,ti.jsx)("div",{...b,"aria-activedescendant":w?t:void 0,"aria-autocomplete":w?n:"none","aria-controls":w?r:void 0,"aria-describedby":o,"aria-expanded":w&&"combobox"===p?!!i:void 0,"aria-label":s,"aria-labelledby":a,"aria-multiline":l,"aria-owns":w?c:void 0,"aria-readonly":!w||void 0,"aria-required":u,autoCapitalize:d,className:f,contentEditable:w,"data-testid":y,id:h,ref:k,role:w?p:void 0,spellCheck:m,style:g,tabIndex:v})}));function sx(e){return e.getEditorState().read(Lb(e.isComposing()))}const ax=(0,re.forwardRef)((function(e,t){const{placeholder:n,editor__DEPRECATED:r,...o}=e,i=r||Hh()[0];return(0,ti.jsxs)(ti.Fragment,{children:[(0,ti.jsx)(ix,{editor:i,...o,ref:t}),null!=n&&(0,ti.jsx)(lx,{editor:i,content:n})]})}));function lx({content:e,editor:t}){const n=function(e){const[t,n]=(0,re.useState)((()=>sx(e)));return ox((()=>{function t(){const t=sx(e);n(t)}return t(),zb(e.registerUpdateListener((()=>{t()})),e.registerEditableListener((()=>{t()})))}),[e]),t}(t),[r,o]=(0,re.useState)(t.isEditable());if((0,re.useLayoutEffect)((()=>(o(t.isEditable()),t.registerEditableListener((e=>{o(e)})))),[t]),!n)return null;let i=null;return"function"==typeof e?i=e(r):null!==e&&(i=e),null===i?null:(0,ti.jsx)("div",{"aria-hidden":!0,children:i})}const cx=0,ux=1,dx=2,fx=0,hx=1,px=2,mx=3,gx=4;function vx(e){e.undoStack=[],e.redoStack=[],e.current=null}function yx({delay:e,externalHistoryState:t}){const[n]=Hh();return function(e,t,n=1e3){const r=(0,re.useMemo)((()=>t||{current:null,redoStack:[],undoStack:[]}),[t]);(0,re.useEffect)((()=>function(e,t,n){const r=function(e,t){let n=Date.now(),r=fx;return(o,i,s,a,l,c)=>{const u=Date.now();if(c.has("historic"))return r=fx,n=u,dx;const d=function(e,t,n,r,o){if(null===e||0===n.size&&0===r.size&&!o)return fx;const i=t._selection,s=e._selection;if(o)return hx;if(!(Ey(i)&&Ey(s)&&s.isCollapsed()&&i.isCollapsed()))return fx;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||bb(n)||o.push(n)}return o}(t,n,r);if(0===a.length)return fx;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)&&my(r)&&1===r.__text.length&&1===i.anchor.offset?px:fx}const l=a[0],c=e._nodeMap.get(l.__key);if(!my(c)||!my(l)||c.__mode!==l.__mode)return fx;const u=c.__text,d=l.__text;if(u===d)return fx;const f=i.anchor,h=s.anchor;if(f.key!==h.key||"text"!==f.type)return fx;const p=f.offset,m=h.offset,g=d.length-u.length;return 1===g&&m===p-1?px:-1===g&&m===p+1?mx:-1===g&&m===p?gx:fx}(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 cx;if(null===o)return ux;const p=i._selection;return a.size>0||l.size>0?!1===h&&d!==fx&&d===r&&ur.exportJSON())))===JSON.stringify(n.read((()=>o.exportJSON())))}(Array.from(a)[0],o,i)?cx:ux:null!==p?cx:dx})();return n=u,r=d,f}}(e,n),o=zb(e.registerCommand(ip,(()=>(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(Rp,!0)),0===r.length&&e.dispatchCommand(Op,!1),t.current=i||null,i&&i.editor.setEditorState(i.editorState,{tag:"historic"})}}(e,t),!0)),0),e.registerCommand(sp,(()=>(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(Op,!0));const i=n.pop();0===n.length&&e.dispatchCommand(Rp,!1),t.current=i||null,i&&i.editor.setEditorState(i.editorState,{tag:"historic"})}}(e,t),!0)),0),e.registerCommand(Tp,(()=>(vx(t),!1)),0),e.registerCommand(Pp,(()=>(vx(t),e.dispatchCommand(Rp,!1),e.dispatchCommand(Op,!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===ux)0!==c.length&&(t.redoStack=[],e.dispatchCommand(Rp,!1)),null!==l&&(u.push({...l}),e.dispatchCommand(Op,!0));else if(f===dx)return;t.current={editor:e,editorState:n}})));return o}(e,r,n)),[n,e,r])}(n,t,e),null}function bx(e,t){return bx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},bx(e,t)}var xx={error:null},wx=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}var Cx={sm:"py-1.5 px-2 rounded [&_.editor-content>p]:text-xs [&_.editor-content>p]:font-medium [&_.editor-content>p]:leading-[1.625rem]",md:"py-2 px-2.5 rounded-md [&_.editor-content>p]:text-xs [&_.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]"},Tx={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]"},Px={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 Rx="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?re.useLayoutEffect:re.useEffect,Ox=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 Ax(e,t){const n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return n.top>r.top&&n.top{u(0)}),[d]);const f=(0,re.useCallback)((n=>{t.update((()=>{const t=null!=r.match&&a?function(e){const t=Fy();if(!Ey(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;s(n,t,e,r.match?r.match.matchingString:"")}))}),[t,a,r.match,s,e]),h=(0,re.useCallback)((e=>{const n=t.getRootElement();null!==n&&(n.setAttribute("aria-activedescendant","typeahead-item-"+e),u(e))}),[t]);return(0,re.useEffect)((()=>()=>{const e=t.getRootElement();null!==e&&e.removeAttribute("aria-activedescendant")}),[t]),Rx((()=>{null===o?u(null):null===c&&h(0)}),[o,c,h]),(0,re.useEffect)((()=>zb(t.registerCommand(Nx,(({option:e})=>!(!e.ref||null==e.ref.current||(Ox(e.ref.current),0))),l))),[t,h,l]),(0,re.useEffect)((()=>zb(t.registerCommand(hp,(e=>{const n=e;if(null!==o&&o.length&&null!==c){const e=c!==o.length-1?c+1:0;h(e);const r=o[e];null!=r.ref&&r.ref.current&&t.dispatchCommand(Nx,{index:e,option:r}),n.preventDefault(),n.stopImmediatePropagation()}return!0}),l),t.registerCommand(fp,(e=>{const t=e;if(null!==o&&o.length&&null!==c){const e=0!==c?c-1:o.length-1;h(e);const n=o[e];null!=n.ref&&n.ref.current&&Ox(n.ref.current),t.preventDefault(),t.stopImmediatePropagation()}return!0}),l),t.registerCommand(vp,(t=>{const n=t;return n.preventDefault(),n.stopImmediatePropagation(),e(),!0}),l),t.registerCommand(bp,(e=>{const t=e;return null!==o&&null!==c&&null!=o[c]&&(t.preventDefault(),t.stopImmediatePropagation(),f(o[c]),!0)}),l),t.registerCommand(pp,(e=>null!==o&&null!==c&&null!=o[c]&&(null!==e&&(e.preventDefault(),e.stopImmediatePropagation()),f(o[c]),!0)),l))),[f,e,t,o,c,h,l]),i(n,(0,re.useMemo)((()=>({options:o,selectOptionAndCleanUp:f,selectedIndex:c,setHighlightedIndex:u})),[f,c,o]),r.match?r.match.matchingString:"")}function Dx({options:e,onQueryChange:t,onSelectOption:n,onOpen:r,onClose:o,menuRenderFn:i,triggerFn:s,anchorClassName:a,commandPriority:l=Pb,parent:c}){const[u]=Hh(),[d,f]=(0,re.useState)(null),h=function(e,t,n,r=document.body){const[o]=Hh(),i=(0,re.useRef)(document.createElement("div")),s=(0,re.useCallback)((()=>{i.current.style.top=i.current.style.bottom;const t=o.getRootElement(),s=i.current,a=s.firstChild;if(null!==t&&null!==e){const{left:o,top:l,width:c,height:u}=e.getRect(),d=i.current.offsetHeight;if(s.style.top=`${l+window.pageYOffset+d+3}px`,s.style.left=`${o+window.pageXOffset}px`,s.style.height=`${u}px`,s.style.width=`${c}px`,null!==a){a.style.top=`${l}`;const e=a.getBoundingClientRect(),n=e.height,r=e.width,i=t.getBoundingClientRect();o+r>i.right&&(s.style.left=`${i.right-r+window.pageXOffset}px`),(l+n>window.innerHeight||l+n>i.bottom)&&l-i.top>n+u&&(s.style.top=l-n+window.pageYOffset-u+"px")}s.isConnected||(null!=n&&(s.className=n),s.setAttribute("aria-label","Typeahead menu"),s.setAttribute("id","typeahead-menu"),s.setAttribute("role","listbox"),s.style.display="block",s.style.position="absolute",r.append(s)),i.current=s,t.setAttribute("aria-controls","typeahead-menu")}}),[o,e,n,r]);(0,re.useEffect)((()=>{const t=o.getRootElement();if(null!==e)return s(),()=>{null!==t&&t.removeAttribute("aria-controls");const e=i.current;null!==e&&e.isConnected&&e.remove()}}),[o,s,e]);const a=(0,re.useCallback)((n=>{null!==e&&(n||t(null))}),[e,t]);return function(e,t,n,r){const[o]=Hh();(0,re.useEffect)((()=>{if(null!=t&&null!=e){const e=o.getRootElement(),i=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=Ax(t,i);const l=function(){s||(window.requestAnimationFrame((function(){n(),s=!1})),s=!0);const e=Ax(t,i);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,o,r,n,e])}(e,i.current,s,a),i}(d,f,a,c),p=(0,re.useCallback)((()=>{f(null),null!=o&&null!==d&&o()}),[o,d]),m=(0,re.useCallback)((e=>{f(e),null!=r&&null===d&&r(e)}),[r,d]);return(0,re.useEffect)((()=>{const e=u.registerUpdateListener((()=>{u.getEditorState().read((()=>{const e=u._window||window,n=e.document.createRange(),r=Fy(),o=function(e){let t=null;return e.getEditorState().read((()=>{const e=Fy();Ey(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}(u);if(!Ey(r)||!r.isCollapsed()||null===o||null===n)return void p();const i=s(o,u);if(t(i?i.matchingString:null),null!==i&&!function(e,t){return 0===t&&e.getEditorState().read((()=>{const e=Fy();if(Ey(e)){const t=e.anchor.getNode().getPreviousSibling();return my(t)&&t.isTextEntity()}return!1}))}(u,i.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}(i.leadOffset,n,e);if(null!==t)return a=()=>m({getRect:()=>n.getBoundingClientRect(),match:i}),void(re.startTransition?re.startTransition(a):a())}var a;p()}))}));return()=>{e()}}),[u,s,t,d,p,m]),null===d||null===u?null:(0,ti.jsx)(Mx,{close:p,resolution:d,editor:u,anchorElementRef:h,options:e,menuRenderFn:i,shouldSplitNodeWithQuery:!0,onSelectOption:n,commandPriority:l})}function Ix(e){return Ix="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},Ix(e)}function jx(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 nw(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)?nw(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,re.useState)([]),2),o=r[0],i=r[1];return(0,re.useEffect)((function(){if(null!==t){var r=rw.get(t);null!==r&&(void 0===r?(rw.set(t,null),ow(e,t,(function(e){rw.set(t,e),i(e)}),n)):i(r))}else i([])}),[t]),o},sw=["size","children","selected","className"];function aw(){return aw=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n_:;",hw=["@"].join(""),pw="[^"+hw+fw+"\\s]",mw=new RegExp("(^|\\s|\\()(["+hw+"]((?:"+pw+"(?:\\.[ |$]| |["+fw+"]|)){0,75}))$"),gw=new RegExp("(^|\\s|\\()(["+hw+"]((?:"+pw+"){0,50}))$");function vw(e){var t=mw.exec(e);if(null===t&&(t=gw.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}var yw=function(e){var t=e.optionsArray,n=e.by,r=void 0===n?"name":n,o=e.size,i=void 0===o?"md":o,s=e.menuComponent,a=void 0===s?cw:s,l=e.menuItemComponent,c=void 0===l?cw.Item:l,u=uw(Hh(),1)[0],d=uw((0,re.useState)(null),2),f=d[0],h=d[1],p=iw(t,f,r),m=(0,re.useCallback)((function(e,t,n){u.update((function(){var o=Yx(e.data,r,i);t&&t.replace(o),n()}))}),[u]),g=(0,re.useMemo)((function(){return p.map((function(e){return new tw(e)}))}),[u,p]);return React.createElement(Dx,{onQueryChange:h,onSelectOption:m,triggerFn:vw,options:g,menuRenderFn:function(e,t){var n=t.selectedIndex,o=t.selectOptionAndCleanUp,s=t.setHighlightedIndex;return e.current&&!(null==g||!g.length)&&React.createElement(a,{size:i},g.map((function(e,t){var a;return React.createElement(c,{key:t,ref:e.ref,size:i,selected:t===n,onMouseEnter:function(){s(t)},onClick:function(){return o(e)}},"string"==typeof e.data?e.data:null===(a=e.data)||void 0===a?void 0:a[r])})))}})},bw={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"}},xw=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 ww(e){console.error(e)}var _w=function(e){var t,n,r=e.defaultValue,o=void 0===r?"":r,i=e.placeholder,s=void 0===i?"Press @ to view variable suggestions":i,a=e.onChange,l=e.size,c=void 0===l?"md":l,u=e.autoFocus,d=void 0!==u&&u,f=e.options,h=void 0===f?[]:f,p=e.by,m=void 0===p?"name":p,g=e.menuComponent,v=e.menuItemComponent,y=e.className,b=e.disabled,x=void 0!==b&&b,w={namespace:"Editor",editorTheme:bw,onError:ww,nodes:[Xx],editorState:o||'{\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:!x};return(0,re.isValidElement)(g)&&(t=g),(0,re.isValidElement)(v)&&(n=v),React.createElement("div",{className:Q("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",Cx[c],x&&"bg-field-secondary-background border-field-border-disabled hover:border-field-border-disabled [&_p]:text-badge-color-disabled cursor-not-allowed")},React.createElement(Db,{initialConfig:w},React.createElement("div",{className:"relative w-full [&_p]:m-0"},React.createElement(nx,{contentEditable:React.createElement(ax,{className:Q("editor-content","w-full min-h-[1.625rem] [&>p]:w-full [&>p]:m-0",y)}),placeholder:React.createElement(xw,{content:s}),ErrorBoundary:Sx})),React.createElement(yx,null),React.createElement(yw,{menuComponent:t,menuItemComponent:n,size:c,by:m,optionsArray:h}),React.createElement(Ex,{onChange:function(e,t){"function"==typeof a&&a(e,t)},ignoreSelectionChange:!0}),d&&React.createElement(qh,null)))},Sw=["variant","className"];function kw(){return kw=Object.assign?Object.assign.bind():function(e){for(var t=1;t { if ( variant === 'rounded' ) { variantClasses = 'rounded-md'; } else if ( variant === 'underline' ) { - variantClasses = 'rounded-none'; + variantClasses = 'rounded-none w-fit max-w-fit'; } // Additional classes.