@seeqdev/qomponents 0.0.230 → 0.0.231

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/index.esm.js +1 -1
  2. package/dist/index.esm.js.map +1 -1
  3. package/dist/index.js +1 -1
  4. package/dist/index.js.map +1 -1
  5. package/dist/src/Accordion/Accordion.d.ts +2 -2
  6. package/dist/src/Alert/Alert.d.ts +2 -2
  7. package/dist/src/Badge/Badge.d.ts +2 -2
  8. package/dist/src/Button/Button.d.ts +2 -2
  9. package/dist/src/ButtonGroup/ButtonGroup.d.ts +2 -2
  10. package/dist/src/ButtonWithDropdown/ButtonWithDropdown.d.ts +3 -3
  11. package/dist/src/ButtonWithPopover/ButtonWithPopover.d.ts +2 -2
  12. package/dist/src/Carousel/Carousel.d.ts +2 -2
  13. package/dist/src/Checkbox/Checkbox.d.ts +2 -2
  14. package/dist/src/Collapse/Collapse.d.ts +2 -2
  15. package/dist/src/ColorPickerControl/ColorPickerControl.d.ts +2 -2
  16. package/dist/src/ColorSwatch/ColorSwatch.d.ts +2 -2
  17. package/dist/src/EditorPanel/EditorPanel.d.ts +2 -2
  18. package/dist/src/ExternalLink/ExternalLink.d.ts +2 -2
  19. package/dist/src/Icon/Icon.d.ts +2 -2
  20. package/dist/src/InputGroup/InputGroup.d.ts +2 -2
  21. package/dist/src/LoadingIndicator/LoadingIndicator.d.ts +2 -2
  22. package/dist/src/Modal/Modal.d.ts +2 -2
  23. package/dist/src/ProgressBar/ProgressBar.d.ts +2 -2
  24. package/dist/src/SeeqActionDropdown/SeeqActionDropdown.d.ts +2 -2
  25. package/dist/src/SeeqActionDropdown/variants.d.ts +4 -4
  26. package/dist/src/SegmentedControl/SegmentedControl.d.ts +2 -2
  27. package/dist/src/Select/Select.d.ts +2 -2
  28. package/dist/src/Slider/Slider.d.ts +2 -2
  29. package/dist/src/SvgIcon/SvgIcon.d.ts +2 -2
  30. package/dist/src/Tabs/Tabs.d.ts +2 -2
  31. package/dist/src/TextArea/TextArea.d.ts +2 -2
  32. package/dist/src/TextField/TextField.d.ts +10 -10
  33. package/dist/src/ToolbarButton/ToolbarButton.d.ts +2 -2
  34. package/dist/src/Tooltip/Qtip.d.ts +2 -2
  35. package/dist/src/Tooltip/Tooltip.d.ts +2 -2
  36. package/dist/src/TriggerWithDropdown/TriggerWithDropdown.d.ts +2 -2
  37. package/package.json +1 -1
package/dist/index.esm.js CHANGED
@@ -55,7 +55,7 @@ http://jedwatson.github.io/classnames
55
55
  ${f}px !important;
56
56
  top: ${l}px !important;
57
57
  }
58
- `),()=>{m.contains(p)&&m.removeChild(p)}},[n]),b(ch,{isPresent:n,childRef:o,sizeRef:s,children:e.cloneElement(t,{ref:l})})}const uh=({children:t,initial:n,isPresent:r,onExitComplete:i,custom:a,presenceAffectsLayout:o,mode:s,anchorX:c,root:l})=>{let u=Au(dh),d=p(),f=!0,m=g(()=>(f=!1,{id:d,initial:n,isPresent:r,custom:a,onExitComplete:e=>{u.set(e,!0);for(let e of u.values())if(!e)return;i&&i()},register:e=>(u.set(e,!1),()=>u.delete(e))}),[r,u,i]);return o&&f&&(m={...m}),g(()=>{u.forEach((e,t)=>u.set(t,!1))},[r]),e.useEffect(()=>{!r&&!u.size&&i&&i()},[r]),s===`popLayout`&&(t=b(lh,{isPresent:r,anchorX:c,root:l,children:t})),b(Nu.Provider,{value:m,children:t})};function dh(){return new Map}function fh(e=!0){let t=d(Nu);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=p();f(()=>{if(e)return i(a)},[e]);let o=u(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}const ph=e=>e.key||``;function mh(e){let t=[];return n.forEach(e,e=>{l(e)&&t.push(e)}),t}const hh=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a=`sync`,propagate:o=!1,anchorX:s=`left`,root:c})=>{let[l,u]=fh(o),f=g(()=>mh(e),[e]),p=o&&!l?[]:f.map(ph),m=_(!0),h=_(f),x=Au(()=>new Map),[S,C]=v(f),[w,T]=v(f);Mu(()=>{m.current=!1,h.current=f;for(let e=0;e<w.length;e++){let t=ph(w[e]);p.includes(t)?x.delete(t):x.get(t)!==!0&&x.set(t,!1)}},[w,p.length,p.join(`-`)]);let E=[];if(f!==S){let e=[...f];for(let t=0;t<w.length;t++){let n=w[t],r=ph(n);p.includes(r)||(e.splice(t,0,n),E.push(n))}return a===`wait`&&E.length&&(e=E),T(mh(e)),C(f),null}let{forceRender:D}=d(ku);return b(y,{children:w.map(e=>{let d=ph(e),g=o&&!l?!1:f===w||p.includes(d),_=()=>{if(x.has(d))x.set(d,!0);else return;let e=!0;x.forEach(t=>{t||(e=!1)}),e&&(D?.(),T(h.current),o&&u?.(),r&&r())};return b(uh,{isPresent:g,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:a,root:c,onExitComplete:g?void 0:_,anchorX:s,children:e},d)})})},gh=o({strict:!1}),_h={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`]},vh={};for(let e in _h)vh[e]={isEnabled:t=>_h[e].some(e=>!!t[e])};function yh(e){for(let t in e)vh[t]={...vh[t],...e[t]}}const bh=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`.split(`.`));function xh(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||bh.has(e)}function Sh(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var Ch=j((()=>{})),wh={};ee(wh,{default:()=>Eh});var Th,Eh,Dh=j((()=>{Ch(),Th=/^((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|fetchpriority|fetchPriority|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|popover|popoverTarget|popoverTargetAction|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)-.*))$/,Eh=Sh(function(e){return Th.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91})}));let Oh=e=>!xh(e);function kh(e){typeof e==`function`&&(Oh=t=>t.startsWith(`on`)?!xh(t):e(t))}try{kh((Dh(),F(wh)).default)}catch{}function Ah(e,t,n){let r={};for(let i in e){if(i===`values`&&typeof e.values==`object`)continue;(Oh(i)||n===!0&&xh(i)||!t&&!xh(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i])}return r}const jh=o({});function Mh(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function Nh(e){return typeof e==`string`||Array.isArray(e)}const Ph=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],Fh=[`initial`,...Ph];function Ih(e){return Mh(e.animate)||Fh.some(t=>Nh(e[t]))}function Lh(e){return!!(Ih(e)||e.variants)}function Rh(e,t){if(Ih(e)){let{initial:t,animate:n}=e;return{initial:t===!1||Nh(t)?t:void 0,animate:Nh(n)?n:void 0}}return e.inherit===!1?{}:t}function zh(e){let{initial:t,animate:n}=Rh(e,d(jh));return g(()=>({initial:t,animate:n}),[Bh(t),Bh(n)])}function Bh(e){return Array.isArray(e)?e.join(` `):e}function Vh(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Hh={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`)if(W.test(e))e=parseFloat(e);else return e;let n=Vh(e,t.target.x),r=Vh(e,t.target.y);return`${n}% ${r}%`}},Uh={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=ff.parse(e);if(i.length>5)return r;let a=ff.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=G(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},Wh={borderRadius:{...Hh,applyTo:[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`]},borderTopLeftRadius:Hh,borderTopRightRadius:Hh,borderBottomLeftRadius:Hh,borderBottomRightRadius:Hh,boxShadow:Uh};function Gh(e,{layout:t,layoutId:n}){return bp.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!Wh[e]||e===`opacity`)}const Kh={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},qh=yp.length;function Jh(e,t,n){let r=``,i=!0;for(let a=0;a<qh;a++){let o=yp[a],s=e[o];if(s===void 0)continue;let c=!0;if(c=typeof s==`number`?s===(o.startsWith(`scale`)?1:0):parseFloat(s)===0,!c||n){let e=km(s,xm[o]);if(!c){i=!1;let t=Kh[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}return r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function Yh(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(bp.has(e)){o=!0;continue}else if(Od(e)){i[e]=n;continue}else{let t=km(n,xm[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=Jh(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}const Xh=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Zh(e,t,n){for(let r in t)!th(t[r])&&!Gh(r,n)&&(e[r]=t[r])}function Qh({transformTemplate:e},t){return g(()=>{let n=Xh();return Yh(n,t,e),Object.assign({},n.vars,n.style)},[t])}function $h(e,t){let n=e.style||{},r={};return Zh(r,n,e),Object.assign(r,Qh(e,t)),r}function eg(e,t){let n={},r=$h(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const tg={offset:`stroke-dashoffset`,array:`stroke-dasharray`},ng={offset:`strokeDashoffset`,array:`strokeDasharray`};function rg(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?tg:ng;e[a.offset]=W.transform(-r);let o=W.transform(t),s=W.transform(n);e[a.array]=`${o} ${s}`}function ig(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(Yh(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&rg(d,i,a,o,!1)}const ag=()=>({...Xh(),attrs:{}}),og=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function sg(e,t,n,r){let i=g(()=>{let n=ag();return ig(n,t,og(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};Zh(t,e.style,e),i.style={...t,...i.style}}return i}const cg=[`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 lg(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(cg.indexOf(e)>-1||/[A-Z]/u.test(e))}function ug(e,t,n,{latestValues:r},a,o=!1){let c=lg(e)?sg:eg,l=c(t,r,a,e),u=Ah(t,typeof e==`string`,o),d=e===i?{}:{...u,...l,ref:n},{children:f}=t,p=g(()=>th(f)?f.get():f,[f]);return s(e,{...d,children:p})}function dg(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function fg(e,t,n,r){if(typeof t==`function`){let[i,a]=dg(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=dg(r);t=t(n===void 0?e.custom:n,i,a)}return t}function pg(e){return th(e)?e.get():e}function mg({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){let a={latestValues:hg(n,r,i,e),renderState:t()};return a}function hg(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=pg(a[e]);let{initial:o,animate:s}=e,c=Ih(e),l=Lh(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!Mh(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=fg(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}const gg=e=>(t,n)=>{let r=d(jh),i=d(Nu),a=()=>mg(e,t,r,i);return n?a():Au(a)};function _g(e,t,n){let{style:r}=e,i={};for(let a in r)(th(r[a])||t.style&&th(t.style[a])||Gh(a,e)||n?.getValue(a)?.liveStyle!==void 0)&&(i[a]=r[a]);return i}const vg=gg({scrapeMotionValuesFromProps:_g,createRenderState:Xh});function yg(e,t,n){let r=_g(e,t,n);for(let n in e)if(th(e[n])||th(t[n])){let t=yp.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}const bg=gg({scrapeMotionValuesFromProps:yg,createRenderState:ag}),xg=Symbol.for(`motionComponentSymbol`);function Sg(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function Cg(e,t,n){return u(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n==`function`?n(r):Sg(n)&&(n.current=r))},[t])}const wg=e=>e.replace(/([a-z])([A-Z])/gu,`$1-$2`).toLowerCase(),Tg=`data-`+wg(`framerAppearId`),Eg=o({});function Dg(e,t,n,r,i){let{visualElement:a}=d(jh),o=d(gh),s=d(Nu),c=d(ih).reducedMotion,l=_(null);r||=o.renderer,!l.current&&r&&(l.current=r(e,{visualState:t,parent:a,props:n,presenceContext:s,blockInitialAnimation:s?s.initial===!1:!1,reducedMotionConfig:c}));let u=l.current,p=d(Eg);u&&!u.projection&&i&&(u.type===`html`||u.type===`svg`)&&Og(l.current,n,i,p);let h=_(!1);m(()=>{u&&h.current&&u.update(n,s)});let g=n[Tg],v=_(!!g&&!window.MotionHandoffIsComplete?.(g)&&window.MotionHasOptimisedAnimation?.(g));return Mu(()=>{u&&(h.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),v.current&&u.animationState&&u.animationState.animateChanges())}),f(()=>{u&&(!v.current&&u.animationState&&u.animationState.animateChanges(),v.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(g)}),!1),u.enteringChildren=void 0)}),u}function Og(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:kg(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&Sg(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:u,layoutScroll:c,layoutRoot:l})}function kg(e){if(e)return e.options.allowProjection===!1?kg(e.parent):e.projection}function Ag(e,{forwardMotionProps:t=!1}={},n,r){n&&yh(n);let i=lg(e)?bg:vg;function a(a,o){let s,c={...d(ih),...a,layoutId:jg(a)},{isStatic:l}=c,u=zh(a),f=i(a,l);if(!l&&ju){Mg(c,n);let t=Ng(c);s=t.MeasureLayout,u.visualElement=Dg(e,f,c,r,t.ProjectionNode)}return x(jh.Provider,{value:u,children:[s&&u.visualElement?b(s,{visualElement:u.visualElement,...c}):null,ug(e,a,Cg(f,u.visualElement,o),f,l,t)]})}a.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let o=c(a);return o[xg]=e,o}function jg({layoutId:e}){let t=d(ku).id;return t&&e!==void 0?t+`-`+e:e}function Mg(e,t){d(gh).strict}function Ng(e){let{drag:t,layout:n}=vh;if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function Pg(e,t){if(typeof Proxy>`u`)return Ag;let n=new Map,r=(n,r)=>Ag(n,r,e,t),i=(e,t)=>r(e,t);return new Proxy(i,{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,Ag(a,void 0,e,t)),n.get(a))})}function Fg({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Ig({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Lg(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Rg(e){return e===void 0||e===1}function zg({scale:e,scaleX:t,scaleY:n}){return!Rg(e)||!Rg(t)||!Rg(n)}function Bg(e){return zg(e)||Vg(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Vg(e){return Hg(e.x)||Hg(e.y)}function Hg(e){return e&&e!==`0%`}function Ug(e,t,n){let r=e-n,i=t*r;return n+i}function Wg(e,t,n,r,i){return i!==void 0&&(e=Ug(e,i,r)),Ug(e,n,r)+t}function Gg(e,t=0,n=1,r,i){e.min=Wg(e.min,t,n,r,i),e.max=Wg(e.max,t,n,r,i)}function Kg(e,{x:t,y:n}){Gg(e.x,t.translate,t.scale,t.originPoint),Gg(e.y,n.translate,n.scale,n.originPoint)}const qg=.999999999999,Jg=1.0000000000001;function Yg(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&Qg(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Kg(e,o)),r&&Bg(a.latestValues)&&Qg(e,a.latestValues))}t.x<Jg&&t.x>qg&&(t.x=1),t.y<Jg&&t.y>qg&&(t.y=1)}function Xg(e,t){e.min+=t,e.max+=t}function Zg(e,t,n,r,i=.5){let a=G(e.min,e.max,i);Gg(e,t,n,a,r)}function Qg(e,t){Zg(e.x,t.x,t.scaleX,t.scale,t.originX),Zg(e.y,t.y,t.scaleY,t.scale,t.originY)}function $g(e,t){return Fg(Lg(e.getBoundingClientRect(),t))}function e_(e,t,n){let r=$g(e,n),{scroll:i}=t;return i&&(Xg(r.x,i.offset.x),Xg(r.y,i.offset.y)),r}const t_=()=>({translate:0,scale:1,origin:0,originPoint:0}),n_=()=>({x:t_(),y:t_()}),r_=()=>({min:0,max:0}),i_=()=>({x:r_(),y:r_()}),a_={current:null},o_={current:!1};function s_(){if(o_.current=!0,ju)if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>a_.current=e.matches;e.addEventListener(`change`,t),t()}else a_.current=!1}const c_=new WeakMap;function l_(e,t,n){for(let r in t){let i=t[r],a=n[r];if(th(i))e.addValue(r,i);else if(th(a))e.addValue(r,Pm(i,{owner:e}));else if(a!==i)if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,Pm(t===void 0?i:t,{owner:e}))}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}const u_=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`];var d_=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,blockInitialAnimation:i,visualState:a},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Np,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=Td.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,U.render(this.render,!1,!0))};let{latestValues:s,renderState:c}=a;this.latestValues=s,this.baseTarget={...s},this.initialValues=t.initial?{...s}:{},this.renderState=c,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.options=o,this.blockInitialAnimation=!!i,this.isControllingVariants=Ih(t),this.isVariantNode=Lh(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:l,...u}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in u){let t=u[e];s[e]!==void 0&&th(t)&&t.set(s[e])}}mount(e){this.current=e,c_.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)),o_.current||s_(),this.shouldReduceMotion=this.reducedMotionConfig===`never`?!1:this.reducedMotionConfig===`always`?!0:a_.current,this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){for(let e in this.projection&&this.projection.unmount(),bd(this.notifyUpdate),bd(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this),this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();let n=bp.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&U.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i(),t.owner&&t.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in vh){let t=vh[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let 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):i_()}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;t<u_.length;t++){let n=u_[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=`on`+n,i=e[r];i&&(this.propEventSubscriptions[n]=this.on(n,i))}this.prevMotionValues=l_(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let 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);let 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 n===void 0&&t!==void 0&&(n=Pm(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(Ru(n)||Bu(n))?n=parseFloat(n):!rh(n)&&ff.test(t)&&(n=wm(e,t)),this.setBaseTarget(e,th(n)?n.get():n)),th(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=fg(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!th(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new Ku),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){Fm.render(this.render)}},f_=class extends d_{constructor(){super(...arguments),this.KeyframeResolver=Dm}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?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]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;th(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}};function p_(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function m_(e){return window.getComputedStyle(e)}var h_=class extends f_{constructor(){super(...arguments),this.type=`html`,this.renderInstance=p_}readValueFromInstance(e,t){if(bp.has(t))return this.projection?.isProjecting?hp(t):_p(e,t);{let n=m_(e),r=(Od(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return $g(e,t)}build(e,t,n){Yh(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return _g(e,t,n)}};const g_=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 __(e,t,n,r){for(let n in p_(e,t,void 0,r),t.attrs)e.setAttribute(g_.has(n)?n:wg(n),t.attrs[n])}var v_=class extends f_{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=i_}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(bp.has(t)){let e=Cm(t);return e&&e.default||0}return t=g_.has(t)?t:wg(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return yg(e,t,n)}build(e,t,n){ig(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){__(e,t,n,r)}mount(e){this.isSVGTag=og(e.tagName),super.mount(e)}};const y_=(e,t)=>lg(e)?new v_(t):new h_(t,{allowProjection:e!==i});function b_(e,t,n){let r=e.getProps();return fg(r,t,n===void 0?r.custom:n,e)}const x_=e=>Array.isArray(e);function S_(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Pm(n))}function C_(e){return x_(e)?e[e.length-1]||0:e}function w_(e,t){let n=b_(e,t),{transitionEnd:r={},transition:i={},...a}=n||{};for(let t in a={...a,...r},a){let n=C_(a[t]);S_(e,t,n)}}function T_(e){return!!(th(e)&&e.add)}function E_(e,t){let n=e.getValue(`willChange`);if(T_(n))return n.add(t);if(!n&&Lu.WillChange){let n=new Lu.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function D_(e){return e.props[Tg]}const O_=e=>e!==null;function k_(e,{repeat:t,repeatType:n=`loop`},r){let i=e.filter(O_),a=t&&n!==`loop`&&t%2==1?0:i.length-1;return!a||r===void 0?i[a]:r}const A_={type:`spring`,stiffness:500,damping:25,restSpeed:10},j_=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),M_={type:`keyframes`,duration:.8},N_={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},P_=(e,{keyframes:t})=>t.length>2?M_:bp.has(e)?e.startsWith(`scale`)?j_(t[1]):A_:N_;function F_({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:a,repeatType:o,repeatDelay:s,from:c,elapsed:l,...u}){return!!Object.keys(u).length}const I_=(e,t,n,r={},i,a)=>o=>{let s=cm(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=qu(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};F_(s)||Object.assign(u,P_(e,u)),u.duration&&=qu(u.duration),u.repeatDelay&&=qu(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(em(u),u.delay===0&&(d=!0)),(Lu.instantAnimations||Lu.skipAnimations)&&(d=!0,em(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=k_(u.keyframes,s);if(e!==void 0){U.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new ap(u):new im(u)};function L_({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function R_(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a=e.getDefaultTransition(),transitionEnd:o,...s}=t;r&&(a=r);let c=[],l=i&&e.animationState&&e.animationState.getState()[i];for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||l&&L_(l,t))continue;let o={delay:n,...cm(a||{},t)},u=r.get();if(u!==void 0&&!r.isAnimating&&!Array.isArray(i)&&i===u&&!o.velocity)continue;let d=!1;if(window.MotionHandoffAnimation){let n=D_(e);if(n){let e=window.MotionHandoffAnimation(n,t,U);e!==null&&(o.startTime=e,d=!0)}}E_(e,t),r.start(I_(t,r,i,e.shouldReduceMotion&&lm.has(t)?{type:!1}:o,e,d));let f=r.animation;f&&c.push(f)}return o&&Promise.all(c).then(()=>{U.update(()=>{o&&w_(e,o)})}),c}function z_(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r,c=typeof n==`function`;return c?n(a,o):i===1?a*r:s-a*r}function B_(e,t,n={}){let r=b_(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(R_(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return V_(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}else return Promise.all([a(),o(n.delay)])}function V_(e,t,n=0,r=0,i=0,a=1,o){let s=[];for(let c of e.variantChildren)c.notify(`AnimationStart`,t),s.push(B_(c,t,{...o,delay:n+(typeof r==`function`?0:r)+z_(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function H_(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>B_(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=B_(e,t,n);else{let i=typeof t==`function`?b_(e,t,n.custom):t;r=Promise.all(R_(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}function U_(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const W_=Fh.length;function G_(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&G_(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<W_;n++){let r=Fh[n],i=e.props[r];(Nh(i)||i===!1)&&(t[r]=i)}return t}const K_=[...Ph].reverse(),q_=Ph.length;function J_(e){return t=>Promise.all(t.map(({animation:t,options:n})=>H_(e,t,n)))}function Y_(e){let t=J_(e),n=Q_(),r=!0,i=t=>(n,r)=>{let i=b_(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function a(n){t=n(e)}function o(a){let{props:o}=e,s=G_(e.parent)||{},c=[],l=new Set,u={},d=1/0;for(let t=0;t<q_;t++){let f=K_[t],p=n[f],m=o[f]===void 0?s[f]:o[f],h=Nh(m),g=f===a?p.isActive:null;g===!1&&(d=t);let _=m===s[f]&&m!==o[f]&&h;if(_&&r&&e.manuallyAnimateOnMount&&(_=!1),p.protectedKeys={...u},!p.isActive&&g===null||!m&&!p.prevProp||Mh(m)||typeof m==`boolean`)continue;let v=X_(p.prevProp,m),y=v||f===a&&p.isActive&&!_&&h||t>d&&h,b=!1,x=Array.isArray(m)?m:[m],S=x.reduce(i(f),{});g===!1&&(S={});let{prevResolvedValues:C={}}=p,w={...C,...S},T=t=>{y=!0,l.has(t)&&(b=!0,l.delete(t)),p.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in w){let t=S[e],n=C[e];if(u.hasOwnProperty(e))continue;let r=!1;r=x_(t)&&x_(n)?!U_(t,n):t!==n,r?t==null?l.add(e):T(e):t!==void 0&&l.has(e)?T(e):p.protectedKeys[e]=!0}p.prevProp=m,p.prevResolvedValues=S,p.isActive&&(u={...u,...S}),r&&e.blockInitialAnimation&&(y=!1);let E=_&&v,D=!E||b;y&&D&&c.push(...x.map(t=>{let n={type:f};if(typeof t==`string`&&r&&!E&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=b_(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=z_(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(l.size){let t={};if(typeof o.initial!=`boolean`){let n=b_(e,Array.isArray(o.initial)?o.initial[0]:o.initial);n&&n.transition&&(t.transition=n.transition)}l.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),c.push({animation:t})}let f=!!c.length;return r&&(o.initial===!1||o.initial===o.animate)&&!e.manuallyAnimateOnMount&&(f=!1),r=!1,f?t(c):Promise.resolve()}function s(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=o(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:o,setActive:s,setAnimateFunction:a,getState:()=>n,reset:()=>{n=Q_()}}}function X_(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!U_(t,e):!1}function Z_(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Q_(){return{animate:Z_(!0),whileInView:Z_(),whileHover:Z_(),whileTap:Z_(),whileDrag:Z_(),whileFocus:Z_(),exit:Z_()}}var $_=class{constructor(e){this.isMounted=!1,this.node=e}update(){}},ev=class extends $_{constructor(e){super(e),e.animationState||=Y_(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();Mh(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}};let tv=0;var nv=class extends $_{constructor(){super(...arguments),this.id=tv++}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;let r=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}};const rv={animation:{Feature:ev},exit:{Feature:nv}};function iv(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function av(e){return{point:{x:e.pageX,y:e.pageY}}}const ov=e=>t=>Wm(t)&&e(t,av(t));function sv(e,t,n,r){return iv(e,t,ov(n),r)}const cv=1e-4;1-cv,1+cv;const lv=.01;0-lv,0+lv;function uv(e){return e.max-e.min}function dv(e,t,n){return Math.abs(e-t)<=n}function fv(e,t,n,r=.5){e.origin=r,e.originPoint=G(t.min,t.max,e.origin),e.scale=uv(n)/uv(t),e.translate=G(n.min,n.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function pv(e,t,n,r){fv(e.x,t.x,n.x,r?r.originX:void 0),fv(e.y,t.y,n.y,r?r.originY:void 0)}function mv(e,t,n){e.min=n.min+t.min,e.max=e.min+uv(t)}function hv(e,t,n){mv(e.x,t.x,n.x),mv(e.y,t.y,n.y)}function gv(e,t,n){e.min=t.min-n.min,e.max=e.min+uv(t)}function _v(e,t,n){gv(e.x,t.x,n.x),gv(e.y,t.y,n.y)}function vv(e){return[e(`x`),e(`y`)]}const yv=({current:e})=>e?e.ownerDocument.defaultView:null,bv=(e,t)=>Math.abs(e-t);function xv(e,t){let n=bv(e.x,t.x),r=bv(e.y,t.y);return Math.sqrt(n**2+r**2)}var Sv=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let e=Tv(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=xv(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=xd;this.history.push({...r,timestamp:i});let{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=Cv(t,this.transformPagePoint),U.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if(this.dragSnapToOrigin&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=Tv(e.type===`pointercancel`?this.lastMoveEventInfo:Cv(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!Wm(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let o=av(e),s=Cv(o,this.transformPagePoint),{point:c}=s,{timestamp:l}=xd;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,Tv(s,this.history)),this.removeListeners=Wu(sv(this.contextWindow,`pointermove`,this.handlePointerMove),sv(this.contextWindow,`pointerup`,this.handlePointerUp),sv(this.contextWindow,`pointercancel`,this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),bd(this.updatePoint)}};function Cv(e,t){return t?{point:t(e.point)}:e}function wv(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Tv({point:e},t){return{point:e,delta:wv(e,Dv(t)),offset:wv(e,Ev(t)),velocity:Ov(t,.1)}}function Ev(e){return e[0]}function Dv(e){return e[e.length-1]}function Ov(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=Dv(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>qu(t)));)n--;if(!r)return{x:0,y:0};let a=Ju(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function kv(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?G(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?G(n,e,r.max):Math.min(e,n)),e}function Av(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function jv(e,{top:t,left:n,bottom:r,right:i}){return{x:Av(e.x,n,i),y:Av(e.y,t,r)}}function Mv(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function Nv(e,t){return{x:Mv(e.x,t.x),y:Mv(e.y,t.y)}}function Pv(e,t){let n=.5,r=uv(e),i=uv(t);return i>r?n=Gu(t.min,t.max-r,e.min):r>i&&(n=Gu(e.min,e.max-i,t.min)),Iu(0,1,n)}function Fv(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Iv=.35;function Lv(e=Iv){return e===!1?e=0:e===!0&&(e=Iv),{x:Rv(e,`left`,`right`),y:Rv(e,`top`,`bottom`)}}function Rv(e,t,n){return{min:zv(e,t),max:zv(e,n)}}function zv(e,t){return typeof e==`number`?e:e[t]||0}const Bv=new WeakMap;var Vv=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=i_(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{let{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(av(e).point)},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=zm(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),vv(e=>{let t=this.getAxisMotionValue(e).get()||0;if(Jd.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];if(r){let e=uv(r);t=e*(parseFloat(t)/100)}}}this.originPoint[e]=t}),i&&U.postRender(()=>i(e,t)),E_(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=Uv(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&a(e,t)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>vv(e=>this.getAnimationState(e)===`paused`&&this.getAxisMotionValue(e).animation?.play()),{dragSnapToOrigin:l}=this.getProps();this.panSession=new Sv(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:yv(this.visualElement)})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&U.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!Hv(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=kv(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&Sg(e)?this.constraints||=this.resolveRefConstraints():e&&n?this.constraints=jv(n.layoutBox,e):this.constraints=!1,this.elastic=Lv(t),r!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&vv(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=Fv(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!Sg(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;let i=e_(n,r.root,this.visualElement.getTransformPagePoint()),a=Nv(r.layout.layoutBox,i);if(t){let e=t(Ig(a));this.hasMutatedConstraints=!!e,e&&(a=Fg(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=vv(o=>{if(!Hv(o,t,this.currentDirection))return;let c=s&&s[o]||{};a&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return E_(this.visualElement,e),n.start(I_(e,n,0,t,this.visualElement,!1))}stopAnimation(){vv(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){vv(e=>this.getAxisMotionValue(e).animation?.pause())}getAnimationState(e){return this.getAxisMotionValue(e).animation?.state}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps(),r=n[t];return r||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){vv(t=>{let{drag:n}=this.getProps();if(!Hv(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t];i.set(e[t]-G(n,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!Sg(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};vv(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=Pv({min:n,max:n},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),vv(t=>{if(!Hv(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(G(i,a,r[t]))})}addListeners(){if(!this.visualElement.current)return;Bv.set(this.visualElement,this);let e=this.visualElement.current,t=sv(e,`pointerdown`,e=>{let{drag:t,dragListener:n=!0}=this.getProps();t&&n&&this.start(e)}),n=()=>{let{dragConstraints:e}=this.getProps();Sg(e)&&e.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,i=r.addEventListener(`measure`,n);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),U.read(n);let a=iv(window,`resize`,()=>this.scalePositionWithinConstraints()),o=r.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(vv(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{a(),t(),i(),o&&o()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=Iv,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function Hv(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Uv(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var Wv=class extends $_{constructor(e){super(e),this.removeGroupControls=Hu,this.removeListeners=Hu,this.controls=new Vv(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Hu}unmount(){this.removeGroupControls(),this.removeListeners()}};const Gv=e=>(t,n)=>{e&&U.postRender(()=>e(t,n))};var Kv=class extends $_{constructor(){super(...arguments),this.removePointerDownListener=Hu}onPointerDown(e){this.session=new Sv(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:yv(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Gv(e),onStart:Gv(t),onMove:n,onEnd:(e,t)=>{delete this.session,r&&U.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=sv(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}};const qv={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let Jv=!1;var Yv=class extends r{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),Jv&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),qv.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,Jv=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||U.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),Fm.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;Jv=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function Xv(e){let[t,n]=fh(),r=d(ku);return b(Yv,{...e,layoutGroup:r,switchLayoutGroup:d(Eg),isPresent:t,safeToRemove:n})}function Zv(e,t,n){let r=th(e)?e:Pm(e);return r.start(I_(``,r,t,n)),r.animation}const Qv=(e,t)=>e.depth-t.depth;var $v=class{constructor(){this.children=[],this.isDirty=!1}add(e){Pu(this.children,e),this.isDirty=!0}remove(e){Fu(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Qv),this.isDirty=!1,this.children.forEach(e)}};function ey(e,t){let n=Td.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(bd(r),e(a-t))};return U.setup(r,!0),()=>bd(r)}const ty=[`TopLeft`,`TopRight`,`BottomLeft`,`BottomRight`],ny=ty.length,ry=e=>typeof e==`string`?parseFloat(e):e,iy=e=>typeof e==`number`||W.test(e);function ay(e,t,n,r,i,a){i?(e.opacity=G(0,n.opacity??1,sy(r)),e.opacityExit=G(t.opacity??1,0,cy(r))):a&&(e.opacity=G(t.opacity??1,n.opacity??1,r));for(let i=0;i<ny;i++){let a=`border${ty[i]}Radius`,o=oy(t,a),s=oy(n,a);if(o===void 0&&s===void 0)continue;o||=0,s||=0;let c=o===0||s===0||iy(o)===iy(s);c?(e[a]=Math.max(G(ry(o),ry(s),r),0),(Jd.test(s)||Jd.test(o))&&(e[a]+=`%`)):e[a]=s}(t.rotate||n.rotate)&&(e.rotate=G(t.rotate||0,n.rotate||0,r))}function oy(e,t){return e[t]===void 0?e.borderRadius:e[t]}const sy=ly(0,.5,od),cy=ly(.5,.95,Hu);function ly(e,t,n){return r=>r<e?0:r>t?1:n(Gu(e,t,r))}function uy(e,t){e.min=t.min,e.max=t.max}function dy(e,t){uy(e.x,t.x),uy(e.y,t.y)}function fy(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function py(e,t,n,r,i){return e-=t,e=Ug(e,1/n,r),i!==void 0&&(e=Ug(e,1/i,r)),e}function my(e,t=0,n=1,r=.5,i,a=e,o=e){if(Jd.test(t)){t=parseFloat(t);let e=G(o.min,o.max,t/100);t=e-o.min}if(typeof t!=`number`)return;let s=G(a.min,a.max,r);e===a&&(s-=t),e.min=py(e.min,t,n,s,i),e.max=py(e.max,t,n,s,i)}function hy(e,t,[n,r,i],a,o){my(e,t[n],t[r],t[i],t.scale,a,o)}const gy=[`x`,`scaleX`,`originX`],_y=[`y`,`scaleY`,`originY`];function vy(e,t,n,r){hy(e.x,t,gy,n?n.x:void 0,r?r.x:void 0),hy(e.y,t,_y,n?n.y:void 0,r?r.y:void 0)}function yy(e){return e.translate===0&&e.scale===1}function by(e){return yy(e.x)&&yy(e.y)}function xy(e,t){return e.min===t.min&&e.max===t.max}function Sy(e,t){return xy(e.x,t.x)&&xy(e.y,t.y)}function Cy(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function wy(e,t){return Cy(e.x,t.x)&&Cy(e.y,t.y)}function Ty(e){return uv(e.x)/uv(e.y)}function Ey(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var Dy=class{constructor(){this.members=[]}add(e){Pu(this.members,e),e.scheduleRender()}remove(e){if(Fu(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){let t=this.members.findIndex(t=>e===t);if(t===0)return!1;let n;for(let e=t;e>=0;e--){let t=this.members[e];if(t.isPresent!==!1){n=t;break}}return n?(this.promote(n),!0):!1}promote(e,t){let 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);let{crossfade:r}=e.options;r===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{let{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)}};function Oy(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,rotateX:i,rotateY:a,skewX:o,skewY:s}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotateX(${i}deg) `),a&&(r+=`rotateY(${a}deg) `),o&&(r+=`skewX(${o}deg) `),s&&(r+=`skewY(${s}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}const ky={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},Ay=[``,`X`,`Y`,`Z`];let jy=0;function My(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Ny(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=D_(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,U,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Ny(r)}function Py({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=jy++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,_d.value&&(ky.nodes=ky.calculatedTargetDeltas=ky.calculatedProjections=0),this.nodes.forEach(Ly),this.nodes.forEach(Wy),this.nodes.forEach(Gy),this.nodes.forEach(Ry),_d.addProjectionMetrics&&_d.addProjectionMetrics(ky)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=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;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new $v)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new Ku),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=$m(t)&&!eh(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;U.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=ey(i,250),qv.hasAnimatedSinceResize&&(qv.hasAnimatedSinceResize=!1,this.nodes.forEach(Uy)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||Qy,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!wy(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...cm(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l)}else t||Uy(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),bd(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(Ky),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Ny(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){this.updateScheduled=!1;let e=this.isUpdateBlocked();if(e){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(By);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Vy);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Hy),this.nodes.forEach(Fy),this.nodes.forEach(Iy)):this.nodes.forEach(Vy),this.clearAllSnapshots();let t=Td.now();xd.delta=Iu(0,1e3/60,t-xd.timestamp),xd.timestamp=t,xd.isProcessing=!0,Sd.update.process(xd),Sd.preRender.process(xd),Sd.render.process(xd),xd.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Fm.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(zy),this.sharedNodes.forEach(qy)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,U.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){U.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!uv(this.snapshot.measuredBox.x)&&!uv(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++){let t=this.path[e];t.updateScroll()}let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=i_(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!by(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||Bg(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),nb(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return i_();let t=e.measureViewportBox(),n=this.scroll?.wasRoot||this.path.some(ib);if(!n){let{scroll:e}=this.root;e&&(Xg(t.x,e.offset.x),Xg(t.y,e.offset.y))}return t}removeElementScroll(e){let t=i_();if(dy(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&dy(t,e),Xg(t.x,i.offset.x),Xg(t.y,i.offset.y))}return t}applyTransform(e,t=!1){let n=i_();dy(n,e);for(let e=0;e<this.path.length;e++){let r=this.path[e];!t&&r.options.layoutScroll&&r.scroll&&r!==r.root&&Qg(n,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),Bg(r.latestValues)&&Qg(n,r.latestValues)}return Bg(this.latestValues)&&Qg(n,this.latestValues),n}removeTransform(e){let t=i_();dy(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!n.instance||!Bg(n.latestValues))continue;zg(n.latestValues)&&n.updateSnapshot();let r=i_(),i=n.measurePageBox();dy(r,i),vy(t,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,r)}return Bg(this.latestValues)&&vy(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0?!0:e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==xd.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t,r=!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize);if(r)return;let{layout:i,layoutId:a}=this.options;if(!this.layout||!(i||a))return;this.resolvedRelativeTargetAt=xd.timestamp;let o=this.getClosestProjectingParent();o&&this.linkedParentVersion!==o.layoutVersion&&!o.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(o&&o.layout?this.createRelativeTarget(o,this.layout.layoutBox,o.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=i_(),this.targetWithTransforms=i_()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),hv(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):dy(this.target,this.layout.layoutBox),Kg(this.target,this.targetDelta)):dy(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,o&&!!o.resumingFrom==!!this.resumingFrom&&!o.options.layoutScroll&&o.target&&this.animationProgress!==1?this.createRelativeTarget(o,this.target,o.target):this.relativeParent=this.relativeTarget=void 0),_d.value&&ky.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||zg(this.parent.latestValues)||Vg(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=i_(),this.relativeTargetOrigin=i_(),_v(this.relativeTargetOrigin,t,n),dy(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===xd.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;dy(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;Yg(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=i_());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(fy(this.prevProjectionDelta.x,this.projectionDelta.x),fy(this.prevProjectionDelta.y,this.projectionDelta.y)),pv(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!Ey(this.projectionDelta.x,this.prevProjectionDelta.x)||!Ey(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),_d.value&&ky.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=n_(),this.projectionDelta=n_(),this.projectionDeltaWithTransform=n_()}setAnimationOrigin(e,t=!1){let n=this.snapshot,r=n?n.latestValues:{},i={...this.latestValues},a=n_();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let o=i_(),s=n?n.source:void 0,c=this.layout?this.layout.source:void 0,l=s!==c,u=this.getStack(),d=!u||u.members.length<=1,f=!!(l&&!d&&this.options.crossfade===!0&&!this.path.some(Zy));this.animationProgress=0;let p;this.mixTargetDelta=t=>{let n=t/1e3;Jy(a.x,e.x,n),Jy(a.y,e.y,n),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(_v(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Xy(this.relativeTarget,this.relativeTargetOrigin,o,n),p&&Sy(this.relativeTarget,p)&&(this.isProjectionDirty=!1),p||=i_(),dy(p,this.relativeTarget)),l&&(this.animationValues=i,ay(i,r,this.latestValues,n,f,d)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(bd(this.pendingAnimation),void 0),this.pendingAnimation=U.update(()=>{qv.hasAnimatedSinceResize=!0,Ed.layout++,this.motionValue||=Pm(0),this.currentAnimation=Zv(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onStop:()=>{Ed.layout--},onComplete:()=>{Ed.layout--,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);let 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(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(!(!t||!n||!r)){if(this!==e&&this.layout&&r&&rb(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||i_();let t=uv(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=uv(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}dy(t,n),Qg(t,i),pv(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new Dy);let n=this.sharedNodes.get(e);n.add(t);let r=t.options.initialPromotionConfig;t.promote({transition:r?r.transition:void 0,preserveFollowOpacity:r&&r.shouldPreserveFollowOpacity?r.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return e?e.lead===this:!0}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&My(`z`,e,r,this.animationValues);for(let t=0;t<Ay.length;t++)My(`rotate${Ay[t]}`,e,r,this.animationValues),My(`skew${Ay[t]}`,e,r,this.animationValues);for(let t in e.render(),r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=pg(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=pg(t?.pointerEvents)||``),this.hasProjected&&!Bg(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=Oy(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;for(let t in e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,r.animationValues?e.opacity=r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:e.opacity=r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit,Wh){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=Wh[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?pg(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(By),this.root.sharedNodes.clear()}}}function Fy(e){e.updateLayout()}function Iy(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;i===`size`?vv(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=uv(r);r.min=n[e].min,r.max=r.min+i}):rb(i,t.layoutBox,n)&&vv(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=uv(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=n_();pv(o,n,t.layoutBox);let s=n_();a?pv(s,e.applyTransform(r,!0),t.measuredBox):pv(s,n,t.layoutBox);let c=!by(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=i_();_v(o,t.layoutBox,i.layoutBox);let s=i_();_v(s,n,a.layoutBox),wy(o,s)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=s,e.relativeTargetOrigin=o,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function Ly(e){_d.value&&ky.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function Ry(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function zy(e){e.clearSnapshot()}function By(e){e.clearMeasurements()}function Vy(e){e.isLayoutDirty=!1}function Hy(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function Uy(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Wy(e){e.resolveTargetDelta()}function Gy(e){e.calcProjection()}function Ky(e){e.resetSkewAndRotation()}function qy(e){e.removeLeadSnapshot()}function Jy(e,t,n){e.translate=G(t.translate,0,n),e.scale=G(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Yy(e,t,n,r){e.min=G(t.min,n.min,r),e.max=G(t.max,n.max,r)}function Xy(e,t,n,r){Yy(e.x,t.x,n.x,r),Yy(e.y,t.y,n.y,r)}function Zy(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Qy={duration:.45,ease:[.4,0,.1,1]},$y=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),eb=$y(`applewebkit/`)&&!$y(`chrome/`)?Math.round:Hu;function tb(e){e.min=eb(e.min),e.max=eb(e.max)}function nb(e){tb(e.x),tb(e.y)}function rb(e,t,n){return e===`position`||e===`preserve-aspect`&&!dv(Ty(t),Ty(n),.2)}function ib(e){return e!==e.root&&e.scroll?.wasRoot}const ab=Py({attachResizeListener:(e,t)=>iv(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),ob={current:void 0},sb=Py({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!ob.current){let e=new ab({});e.mount(window),e.setOptions({layoutScroll:!0}),ob.current=e}return ob.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),cb={pan:{Feature:Kv},drag:{Feature:Wv,ProjectionNode:sb,MeasureLayout:Xv}};function lb(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=`onHover`+n,a=r[i];a&&U.postRender(()=>a(t,av(t)))}var ub=class extends $_{mount(){let{current:e}=this.node;e&&(this.unmount=Hm(e,(e,t)=>(lb(this.node,t,`Start`),e=>lb(this.node,e,`End`))))}unmount(){}},db=class extends $_{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{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=Wu(iv(this.node.current,`focus`,()=>this.onFocus()),iv(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function fb(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=`onTap`+(n===`End`?``:n),a=r[i];a&&U.postRender(()=>a(t,av(t)))}var pb=class extends $_{mount(){let{current:e}=this.node;e&&(this.unmount=Qm(e,(e,t)=>(fb(this.node,t,`Start`),(e,{success:t})=>fb(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}};const mb=new WeakMap,hb=new WeakMap,gb=e=>{let t=mb.get(e.target);t&&t(e)},_b=e=>{e.forEach(gb)};function vb({root:e,...t}){let n=e||document;hb.has(n)||hb.set(n,{});let r=hb.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(_b,{root:e,...t})),r[i]}function yb(e,t,n){let r=vb(t);return mb.set(e,n),r.observe(e),()=>{mb.delete(e),r.unobserve(e)}}const bb={some:0,all:1};var xb=class extends $_{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:bb[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};return yb(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node,n=[`amount`,`margin`,`root`].some(Sb(e,t));n&&this.startObserver()}unmount(){}};function Sb({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Cb={inView:{Feature:xb},tap:{Feature:pb},focus:{Feature:db},hover:{Feature:ub}},wb={layout:{ProjectionNode:sb,MeasureLayout:Xv}},Tb={...rv,...Cb,...cb,...wb},Eb=Pg(Tb,y_),Db=({testId:e=`carousel-id`,activeIndex:t=0,extraClassNames:n=``,onSlide:r=()=>{},autoSlide:i,showIndicators:a=!0,continuous:o=!0,interval:s=4e3,prevIcon:c=`fc-arrow-dropdown tw:rotate-90`,nextIcon:l=`fc-arrow-dropdown tw:rotate-270`,showArrows:u=!0,iconExtraClassNames:d=``,carouselItems:p=[]})=>{let[m,h]=v(t),g=e=>{let t=(e+p.length)%p.length;h(t),r(t,t>m?`right`:`left`)};f(()=>{if(i){let e=setInterval(()=>{o||m<p.length-1?g(m+1):clearInterval(e)},s);return()=>clearInterval(e)}},[i,m,o,s,p.length]),f(()=>{t!==m&&h(t)},[t]);let _=()=>{if(m===0&&!o)return;let e=m-1;e<0&&(e=p.length-1),g(e)},y=()=>{if(m===p.length-1){if(!o)return;g(0)}else g(m+1)},S={type:`spring`,damping:20,stiffness:100},C={initial:e=>({x:e>0?`100%`:`-100%`,opacity:0}),animate:{x:0,opacity:1,transition:S},exit:e=>({x:e>0?`-100%`:`100%`,opacity:0,transition:S})};return x(`div`,{"data-testid":e,className:`tw:flex tw:flex-col tw:items-center tw:justify-center tw:w-full tw:overflow-hidden ${n}`,children:[x(`div`,{className:`tw:flex tw:items-center tw:w-full tw:h-max tw:gap-1`,children:[u&&b(Kt,{icon:c,size:`lg`,variant:`no-border`,testId:`carousel-prev`,extraClassNames:`${m===0&&!o?`tw:invisible`:``} ${d} tw:animate-fadeIn`,onClick:_}),b(`div`,{className:`tw:h-full tw:w-full tw:overflow-hidden`,children:b(Eb.div,{custom:1,initial:`initial`,animate:`animate`,exit:`exit`,variants:C,className:`tw:w-full`,children:p[m]},m)}),u&&b(Kt,{icon:l,testId:`carousel-next`,size:`lg`,variant:`no-border`,extraClassNames:`${m===p.length-1&&!o?`tw:invisible`:``} ${d} tw:animate-fadeIn`,onClick:y})]}),a&&b(`div`,{className:`tw:flex tw:gap-1 tw:mt-2`,children:p.map((e,t)=>b(`div`,{className:`tw:w-2 tw:h-2 tw:rounded-full tw:cursor-pointer ${t===m?`tw:bg-sq-theme-dark`:`tw:bg-sq-darkish-gray`}`,onClick:()=>g(t)},t))})]})};var Ob=Db;const kb=`tw:appearance-none tw:border tw:h-3.5 tw:w-3.5 tw:shrink-0 tw:focus:ring-0 tw:focus:ring-offset-0 tw:outline-none tw:focus:outline-none tw:dark:bg-sq-dark-background tw:dark:border-sq-dark-text tw:dark:enabled:hover:bg-sq-dark-background tw:checked:text-white tw:checked:border-sq-text-color tw:checked:enabled:hover:border-sq-theme-dark tw:checked:active:border-sq-theme-darker tw:checked:focus:border-sq-theme-dark tw:disabled:border-sq-disabled-gray tw:dark:disabled:border-sq-fairly-dark-gray tw:dark:checked:focus:bg-sq-dark-background`,Ab=`tw:rounded ${kb}`,jb=`tw:rounded-full ${kb}`,Mb=e=>{let{type:t=`checkbox`,value:n,disabled:r=!1,label:i,onChange:a,onClick:o,onKeyDown:s,checked:c,defaultChecked:l,id:u,name:d,extraClassNames:f=``,extraLabelClassNames:m,testId:h,...g}=e,_=p(),v=u??`checkbox${_}`,y=Tt(g);return x(`span`,{className:`tw:flex ${f}`,children:[b(`input`,{value:n,type:t,"data-testid":h,name:d,id:v,readOnly:!a,checked:c,defaultChecked:l,className:`${t===`checkbox`?Ab:jb} ${r?`tw:cursor-not-allowed`:`tw:cursor-pointer`}`,disabled:r,onClick:o,onChange:a,onKeyDown:s,...y}),i&&b(`label`,{htmlFor:v,className:`tw:ml-1.5 tw:text-sm tw:-mt-0.5 ${m} ${r?`tw:cursor-not-allowed tw:dark:text-sq-fairly-dark-gray tw:text-sq-fairly-dark-gray`:`tw:cursor-pointer tw:text-sq-text-color tw:dark:text-sq-dark-text`}`,children:i})]})},Nb=({isVisible:e,children:t})=>{let n=_(null),[r,i]=v(0);return f(()=>{n.current&&setTimeout(()=>{i((n.current?.scrollHeight??0)+5)},0)},[t]),b(hh,{initial:!1,children:e&&b(Eb.div,{initial:{height:0,opacity:0},animate:{height:r,opacity:1},exit:{height:0,opacity:0},transition:{type:`spring`,damping:20,stiffness:100},children:b(`div`,{ref:n,children:t})})})};var Pb=Nb;const Fb={sm:`tw:h-5 tw:w-5 tw:rounded`,md:`tw:h-6 tw:w-6 tw:rounded-md`,lg:`tw:h-8 tw:w-8 tw:rounded-lg`},Ib=c(function({color:e,onClick:t,"aria-label":n,size:r=`lg`,extraClassNames:i=``,id:a,testId:o},s){return b(`button`,{ref:s,"aria-label":n,className:`tw:cursor-pointer tw:border tw:border-gray-700 tw:dark:border-gray-500 tw:shadow-sm tw:focus-visible:outline-none ${Fb[r]} ${i}`,"data-testid":o,id:a,onClick:t,style:{backgroundColor:e},type:`button`})});var Lb=Ib;const Rb=[`tw:bg-sq-white tw:dark:bg-sq-dark-background`,`tw:border tw:border-solid tw:rounded-[0.5rem] tw:border-sq-disabled-gray tw:dark:border-gray-500`,`tw:relative tw:z-[1200] tw:min-w-6`,`tw:focus-visible:outline-none tw:outline-none`,`tw:data-[state=open]:animate-in tw:data-[state=closed]:animate-out`,`tw:data-[side=top]:animate-slideDownAndFade tw:data-[side=right]:animate-slideLeftAndFade`,`tw:data-[side=bottom]:animate-slideUpAndFade tw:data-[side=left]:animate-slideRightAndFade`,`tw:text-sq-text-color tw:dark:text-sq-text-color-dark`].join(` `);function zb({color:e,label:t,children:n,placement:r=`bottom`,align:i=`start`,extraClassNames:a=``,id:o,testId:s,onOpen:c}){let l=p(),u=b(`label`,{className:`tw:cursor-pointer tw:whitespace-nowrap tw:text-sm tw:text-sq-text-color tw:dark:text-sq-text-color-dark`,htmlFor:l,children:t}),d=b(Lb,{"aria-label":t,color:e,id:o??l,size:`sm`,onClick:c});return n?x(`div`,{className:`tw:flex tw:items-center tw:gap-2 ${a}`,children:[u,x(yu,{children:[b(bu,{asChild:!0,children:d}),b(Su,{align:i,className:Rb,"data-testid":s,side:r,sideOffset:2,children:n})]})]}):x(`div`,{className:`tw:flex tw:items-center tw:gap-2 ${a}`,children:[b(`span`,{className:`tw:cursor-pointer tw:whitespace-nowrap tw:text-sm tw:text-sq-text-color tw:dark:text-sq-text-color-dark`,children:t}),d]})}var Bb=zb;const Vb={normal:`tw:gap-2`,spacious:`tw:gap-3`},Hb=({title:e,children:t,onApply:n,onCancel:r,isApplyDisabled:i=!1,applyLabel:a=`Apply`,cancelLabel:o=`Cancel`,spacing:s=`normal`,extraClassNames:c=``,id:l,testId:u})=>x(`div`,{className:`tw:mt-3 tw:mb-1 tw:flex tw:w-full tw:max-w-md tw:flex-col tw:items-start tw:rounded-3xl tw:border tw:border-sq-tool-btn-border tw:dark:border-gray-500 tw:bg-sq-surface tw:dark:bg-sq-tools-background-dark tw:px-4 tw:py-3 tw:shadow-sm ${Vb[s]} ${c}`,"data-testid":u,id:l,children:[b(`span`,{className:`tw:text-xs tw:font-bold tw:uppercase tw:tracking-wide tw:text-sq-theme-dark`,children:e}),t,x(`div`,{className:`tw:flex tw:w-full tw:max-w-full tw:flex-wrap tw:items-center tw:justify-end tw:gap-2`,children:[r&&b(Kt,{label:o,onClick:r,size:`sm`,variant:`outline`}),n&&b(Kt,{disabled:i,label:a,onClick:n,size:`sm`,variant:`theme`})]})]});var Ub=Hb,Wb=P(Pt());const Gb={link:`tw:inline-flex tw:text-sq-theme-link tw:underline tw:underline-offset-2 tw:transition-colors hover:tw:text-sq-theme-dark focus-visible:tw:outline-none focus-visible:tw:ring-2 focus-visible:tw:ring-sq-theme-link focus-visible:tw:ring-offset-2`,icon:``},Kb=({variant:e=`link`,label:t,href:n,children:r,extraClassNames:i=``,testId:a})=>x(y,{children:[t&&b(`span`,{className:`tw:text-sq-text-color tw:dark:text-sq-text-color-dark tw:shrink-0`,children:t}),b(`a`,{href:n,target:`_blank`,rel:`noopener`,className:(0,Wb.default)(Gb[e],i),"data-testid":a,children:r})]});var qb=Kb;function Jb(e,t){if(typeof e==`function`)return e(t);typeof e==`object`&&e&&`current`in e&&(e.current=t)}function Yb(...e){let t=new Map;return n=>{if(e.forEach(e=>{let r=Jb(e,n);r&&t.set(e,r)}),t.size>0)return()=>{e.forEach(e=>{let n=t.get(e);n&&typeof n==`function`?n():Jb(e,null)}),t.clear()}}}function Xb(...e){return u(Yb(...e),e)}const Zb=(e,t)=>{let n;return typeof e==`number`&&e>0&&(n={width:`${e}px`}),typeof t==`number`&&t>0&&(n||={},n.height=`${t}px`),n},Qb=[`tw:border-sq-disabled-gray`,`tw:dark:border-sq-dark-disabled-gray`,`tw:hover:border-sq-theme-dark`,`tw:dark:hover:border-sq-theme-dark-dark`,`tw:dark:focus:border-sq-theme-dark-dark`,`tw:dark:active:border-sq-theme-darker`,`tw:focus:border-sq-theme-dark`,`tw:active:border-sq-theme-dark`].join(` `),$b={sm:`tw:text-sm`,lg:`tw:text-xl`},ex=c((e,t)=>{let{readonly:n=!1,disabled:r=!1,onChange:i,onPaste:a,onKeyUp:o,onFocus:s,onBlur:c,onKeyDown:l,id:u,name:d,size:p=`sm`,value:m,placeholder:h,extraClassNames:g,testId:S,type:C=`text`,inputGroup:w,step:T,showError:E,errorText:D,min:O,max:k,maxLength:A,minLength:j,required:M=!1,autoComplete:ee=`off`,inputWidth:N=void 0,inputHeight:P=void 0,autoFocus:F=!1,...I}=e,L=_(null),R=Xb(t,L),[te,z]=v(null),ne=Tt(I),B=_(F);f(()=>{B.current&&setTimeout(()=>{L.current?.focus()},0)},[]),f(()=>{let e=L.current;e&&C!==`number`&&C!==`email`&&e.setSelectionRange(te,te)},[t,te,m,C]);let re=e=>{z(e.target.selectionStart),i&&i(e)};f(()=>{m!=null&&m!==L.current?.value&&L.current&&(L.current.value=`${m}`)},[m]);let ie=`tw:rounded-md`;w===`left`?ie=`tw:rounded-l-md tw:border-r-0 tw:focus:border-r tw:active:border-r`:w===`right`&&(ie=`tw:rounded-r-md tw:border-l-0 tw:focus:border-l tw:active:border-l`);let ae=`tw:h-8.5 tw:leading-normal tw:outline-none tw:py-1 tw:px-3 tw:disabled:pointer-events-none tw:disabled:bg-sq-light-gray tw:disabled:dark:bg-sq-dark-disabled-gray tw:disabled:cursor-not-allowed tw:p-1 tw:border-solid tw:border tw:placeholder-gray-400! tw:dark:placeholder-sq-dark-text/30! specTextField ${$b[p]} ${g} tw:text-sq-text-color tw:disabled:text-sq-darkish-gray tw:dark:bg-sq-dark-background tw:dark:text-sq-dark-text tw:disabled:dark:text-sq-dark-text/30 ${ie} ${E?`tw:border-sq-danger`:Qb} `,oe=Zb(N,P)?{style:Zb(N,P)}:{},se={};return A&&(se.maxLength=A),j&&(se.minLength=j),x(y,{children:[b(`input`,{ref:R,"data-testid":S,name:d,id:u,type:C,value:m,className:ae,placeholder:h,disabled:r,readOnly:n,autoComplete:ee,onChange:re,onPaste:a,onFocus:s,onBlur:c,onKeyDown:l,onKeyUp:o,step:T,required:M,min:O,max:k,...se,...oe,...ne}),D&&E&&b(`div`,{className:`tw:text-sq-danger tw:text-xs tw:mt-1`,children:D})]})});ex.displayName=`TextField`;const tx=[`tw:border-sq-disabled-gray`,`tw:dark:border-sq-dark-disabled-gray`,`tw:dark:focus:border-sq-theme-darker`,`tw:dark:active:border-sq-theme-darker`,`tw:focus:border-sq-theme-dark`,`tw:active:border-sq-theme-dark`].join(` `),nx=c((e,t)=>{let{readonly:n=!1,onChange:r,onKeyUp:i,onFocus:o,onBlur:s,onKeyDown:c,name:u,value:d,placeholder:f,append:p=[],extraClassNames:m=``,id:h,testId:g,showError:_,required:v,autoComplete:y,autoFocus:S,disabled:C,type:w,step:T,min:E,max:D,field:O,maxLength:k,minLength:A,inputGroup:j,...M}=e,ee=Tt(M),N=`tw:flex tw:outline-none tw:rounded-md tw:w-full tw:relative tw:flex-wrap ${m}`,P=p.filter(Boolean),F=j??(P.length>0?`left`:void 0),I=F===`left`?`tw:rounded-l-md tw:rounded-r-none`:F===`right`?`tw:rounded-r-md tw:rounded-l-none`:`tw:rounded-md`,L=`tw:leading-normal tw:outline-none tw:py-1 tw:px-3 tw:p-1 tw:border-solid tw:border ${m} tw:text-sq-text-color tw:disabled:text-sq-darkish-gray tw:dark:bg-sq-dark-background tw:dark:text-sq-dark-text tw:disabled:dark:text-sq-disabled-gray ${I} ${_?`tw:border-sq-danger`:tx} `,R=l(O)&&typeof O.type!=`string`,te=R?a(O,{inputGroup:F}):O;return x(`div`,{id:`input-group-${h}`,className:N,children:[O?b(`div`,{"data-testid":g,className:`tw:flex tw:flex-1 tw:cursor-pointer tw:active:z-50 ${L}`,children:te}):b(ex,{testId:g,readonly:n,onChange:r,onKeyUp:i,onFocus:o,onBlur:s,onKeyDown:c,name:u,ref:t,showError:_,value:d,required:v,placeholder:f,autoComplete:y,autoFocus:S,id:h,type:w,disabled:C,step:T,min:E,max:D,maxLength:k,minLength:A,inputGroup:F,extraClassNames:`tw:flex tw:flex-1 tw:w-full tw:focus:z-30 ${m}`,...ee}),P.map((e,t)=>e?.variant===`button`?b(Kt,{extraClassNames:`$
58
+ `),()=>{m.contains(p)&&m.removeChild(p)}},[n]),b(ch,{isPresent:n,childRef:o,sizeRef:s,children:e.cloneElement(t,{ref:l})})}const uh=({children:t,initial:n,isPresent:r,onExitComplete:i,custom:a,presenceAffectsLayout:o,mode:s,anchorX:c,root:l})=>{let u=Au(dh),d=p(),f=!0,m=g(()=>(f=!1,{id:d,initial:n,isPresent:r,custom:a,onExitComplete:e=>{u.set(e,!0);for(let e of u.values())if(!e)return;i&&i()},register:e=>(u.set(e,!1),()=>u.delete(e))}),[r,u,i]);return o&&f&&(m={...m}),g(()=>{u.forEach((e,t)=>u.set(t,!1))},[r]),e.useEffect(()=>{!r&&!u.size&&i&&i()},[r]),s===`popLayout`&&(t=b(lh,{isPresent:r,anchorX:c,root:l,children:t})),b(Nu.Provider,{value:m,children:t})};function dh(){return new Map}function fh(e=!0){let t=d(Nu);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=p();f(()=>{if(e)return i(a)},[e]);let o=u(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}const ph=e=>e.key||``;function mh(e){let t=[];return n.forEach(e,e=>{l(e)&&t.push(e)}),t}const hh=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a=`sync`,propagate:o=!1,anchorX:s=`left`,root:c})=>{let[l,u]=fh(o),f=g(()=>mh(e),[e]),p=o&&!l?[]:f.map(ph),m=_(!0),h=_(f),x=Au(()=>new Map),[S,C]=v(f),[w,T]=v(f);Mu(()=>{m.current=!1,h.current=f;for(let e=0;e<w.length;e++){let t=ph(w[e]);p.includes(t)?x.delete(t):x.get(t)!==!0&&x.set(t,!1)}},[w,p.length,p.join(`-`)]);let E=[];if(f!==S){let e=[...f];for(let t=0;t<w.length;t++){let n=w[t],r=ph(n);p.includes(r)||(e.splice(t,0,n),E.push(n))}return a===`wait`&&E.length&&(e=E),T(mh(e)),C(f),null}let{forceRender:D}=d(ku);return b(y,{children:w.map(e=>{let d=ph(e),g=o&&!l?!1:f===w||p.includes(d),_=()=>{if(x.has(d))x.set(d,!0);else return;let e=!0;x.forEach(t=>{t||(e=!1)}),e&&(D?.(),T(h.current),o&&u?.(),r&&r())};return b(uh,{isPresent:g,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:a,root:c,onExitComplete:g?void 0:_,anchorX:s,children:e},d)})})},gh=o({strict:!1}),_h={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`]},vh={};for(let e in _h)vh[e]={isEnabled:t=>_h[e].some(e=>!!t[e])};function yh(e){for(let t in e)vh[t]={...vh[t],...e[t]}}const bh=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`.split(`.`));function xh(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||bh.has(e)}function Sh(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var Ch=j((()=>{})),wh={};ee(wh,{default:()=>Eh});var Th,Eh,Dh=j((()=>{Ch(),Th=/^((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|fetchpriority|fetchPriority|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|popover|popoverTarget|popoverTargetAction|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)-.*))$/,Eh=Sh(function(e){return Th.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91})}));let Oh=e=>!xh(e);function kh(e){typeof e==`function`&&(Oh=t=>t.startsWith(`on`)?!xh(t):e(t))}try{kh((Dh(),F(wh)).default)}catch{}function Ah(e,t,n){let r={};for(let i in e){if(i===`values`&&typeof e.values==`object`)continue;(Oh(i)||n===!0&&xh(i)||!t&&!xh(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i])}return r}const jh=o({});function Mh(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function Nh(e){return typeof e==`string`||Array.isArray(e)}const Ph=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],Fh=[`initial`,...Ph];function Ih(e){return Mh(e.animate)||Fh.some(t=>Nh(e[t]))}function Lh(e){return!!(Ih(e)||e.variants)}function Rh(e,t){if(Ih(e)){let{initial:t,animate:n}=e;return{initial:t===!1||Nh(t)?t:void 0,animate:Nh(n)?n:void 0}}return e.inherit===!1?{}:t}function zh(e){let{initial:t,animate:n}=Rh(e,d(jh));return g(()=>({initial:t,animate:n}),[Bh(t),Bh(n)])}function Bh(e){return Array.isArray(e)?e.join(` `):e}function Vh(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Hh={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`)if(W.test(e))e=parseFloat(e);else return e;let n=Vh(e,t.target.x),r=Vh(e,t.target.y);return`${n}% ${r}%`}},Uh={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=ff.parse(e);if(i.length>5)return r;let a=ff.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=G(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},Wh={borderRadius:{...Hh,applyTo:[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`]},borderTopLeftRadius:Hh,borderTopRightRadius:Hh,borderBottomLeftRadius:Hh,borderBottomRightRadius:Hh,boxShadow:Uh};function Gh(e,{layout:t,layoutId:n}){return bp.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!Wh[e]||e===`opacity`)}const Kh={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},qh=yp.length;function Jh(e,t,n){let r=``,i=!0;for(let a=0;a<qh;a++){let o=yp[a],s=e[o];if(s===void 0)continue;let c=!0;if(c=typeof s==`number`?s===(o.startsWith(`scale`)?1:0):parseFloat(s)===0,!c||n){let e=km(s,xm[o]);if(!c){i=!1;let t=Kh[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}return r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function Yh(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(bp.has(e)){o=!0;continue}else if(Od(e)){i[e]=n;continue}else{let t=km(n,xm[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=Jh(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}const Xh=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Zh(e,t,n){for(let r in t)!th(t[r])&&!Gh(r,n)&&(e[r]=t[r])}function Qh({transformTemplate:e},t){return g(()=>{let n=Xh();return Yh(n,t,e),Object.assign({},n.vars,n.style)},[t])}function $h(e,t){let n=e.style||{},r={};return Zh(r,n,e),Object.assign(r,Qh(e,t)),r}function eg(e,t){let n={},r=$h(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const tg={offset:`stroke-dashoffset`,array:`stroke-dasharray`},ng={offset:`strokeDashoffset`,array:`strokeDasharray`};function rg(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?tg:ng;e[a.offset]=W.transform(-r);let o=W.transform(t),s=W.transform(n);e[a.array]=`${o} ${s}`}function ig(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(Yh(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&rg(d,i,a,o,!1)}const ag=()=>({...Xh(),attrs:{}}),og=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function sg(e,t,n,r){let i=g(()=>{let n=ag();return ig(n,t,og(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};Zh(t,e.style,e),i.style={...t,...i.style}}return i}const cg=[`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 lg(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(cg.indexOf(e)>-1||/[A-Z]/u.test(e))}function ug(e,t,n,{latestValues:r},a,o=!1){let c=lg(e)?sg:eg,l=c(t,r,a,e),u=Ah(t,typeof e==`string`,o),d=e===i?{}:{...u,...l,ref:n},{children:f}=t,p=g(()=>th(f)?f.get():f,[f]);return s(e,{...d,children:p})}function dg(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function fg(e,t,n,r){if(typeof t==`function`){let[i,a]=dg(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=dg(r);t=t(n===void 0?e.custom:n,i,a)}return t}function pg(e){return th(e)?e.get():e}function mg({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){let a={latestValues:hg(n,r,i,e),renderState:t()};return a}function hg(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=pg(a[e]);let{initial:o,animate:s}=e,c=Ih(e),l=Lh(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!Mh(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=fg(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}const gg=e=>(t,n)=>{let r=d(jh),i=d(Nu),a=()=>mg(e,t,r,i);return n?a():Au(a)};function _g(e,t,n){let{style:r}=e,i={};for(let a in r)(th(r[a])||t.style&&th(t.style[a])||Gh(a,e)||n?.getValue(a)?.liveStyle!==void 0)&&(i[a]=r[a]);return i}const vg=gg({scrapeMotionValuesFromProps:_g,createRenderState:Xh});function yg(e,t,n){let r=_g(e,t,n);for(let n in e)if(th(e[n])||th(t[n])){let t=yp.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}const bg=gg({scrapeMotionValuesFromProps:yg,createRenderState:ag}),xg=Symbol.for(`motionComponentSymbol`);function Sg(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function Cg(e,t,n){return u(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n==`function`?n(r):Sg(n)&&(n.current=r))},[t])}const wg=e=>e.replace(/([a-z])([A-Z])/gu,`$1-$2`).toLowerCase(),Tg=`data-`+wg(`framerAppearId`),Eg=o({});function Dg(e,t,n,r,i){let{visualElement:a}=d(jh),o=d(gh),s=d(Nu),c=d(ih).reducedMotion,l=_(null);r||=o.renderer,!l.current&&r&&(l.current=r(e,{visualState:t,parent:a,props:n,presenceContext:s,blockInitialAnimation:s?s.initial===!1:!1,reducedMotionConfig:c}));let u=l.current,p=d(Eg);u&&!u.projection&&i&&(u.type===`html`||u.type===`svg`)&&Og(l.current,n,i,p);let h=_(!1);m(()=>{u&&h.current&&u.update(n,s)});let g=n[Tg],v=_(!!g&&!window.MotionHandoffIsComplete?.(g)&&window.MotionHasOptimisedAnimation?.(g));return Mu(()=>{u&&(h.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),v.current&&u.animationState&&u.animationState.animateChanges())}),f(()=>{u&&(!v.current&&u.animationState&&u.animationState.animateChanges(),v.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(g)}),!1),u.enteringChildren=void 0)}),u}function Og(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:kg(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&Sg(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:u,layoutScroll:c,layoutRoot:l})}function kg(e){if(e)return e.options.allowProjection===!1?kg(e.parent):e.projection}function Ag(e,{forwardMotionProps:t=!1}={},n,r){n&&yh(n);let i=lg(e)?bg:vg;function a(a,o){let s,c={...d(ih),...a,layoutId:jg(a)},{isStatic:l}=c,u=zh(a),f=i(a,l);if(!l&&ju){Mg(c,n);let t=Ng(c);s=t.MeasureLayout,u.visualElement=Dg(e,f,c,r,t.ProjectionNode)}return x(jh.Provider,{value:u,children:[s&&u.visualElement?b(s,{visualElement:u.visualElement,...c}):null,ug(e,a,Cg(f,u.visualElement,o),f,l,t)]})}a.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let o=c(a);return o[xg]=e,o}function jg({layoutId:e}){let t=d(ku).id;return t&&e!==void 0?t+`-`+e:e}function Mg(e,t){d(gh).strict}function Ng(e){let{drag:t,layout:n}=vh;if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function Pg(e,t){if(typeof Proxy>`u`)return Ag;let n=new Map,r=(n,r)=>Ag(n,r,e,t),i=(e,t)=>r(e,t);return new Proxy(i,{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,Ag(a,void 0,e,t)),n.get(a))})}function Fg({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Ig({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Lg(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Rg(e){return e===void 0||e===1}function zg({scale:e,scaleX:t,scaleY:n}){return!Rg(e)||!Rg(t)||!Rg(n)}function Bg(e){return zg(e)||Vg(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Vg(e){return Hg(e.x)||Hg(e.y)}function Hg(e){return e&&e!==`0%`}function Ug(e,t,n){let r=e-n,i=t*r;return n+i}function Wg(e,t,n,r,i){return i!==void 0&&(e=Ug(e,i,r)),Ug(e,n,r)+t}function Gg(e,t=0,n=1,r,i){e.min=Wg(e.min,t,n,r,i),e.max=Wg(e.max,t,n,r,i)}function Kg(e,{x:t,y:n}){Gg(e.x,t.translate,t.scale,t.originPoint),Gg(e.y,n.translate,n.scale,n.originPoint)}const qg=.999999999999,Jg=1.0000000000001;function Yg(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&Qg(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Kg(e,o)),r&&Bg(a.latestValues)&&Qg(e,a.latestValues))}t.x<Jg&&t.x>qg&&(t.x=1),t.y<Jg&&t.y>qg&&(t.y=1)}function Xg(e,t){e.min+=t,e.max+=t}function Zg(e,t,n,r,i=.5){let a=G(e.min,e.max,i);Gg(e,t,n,a,r)}function Qg(e,t){Zg(e.x,t.x,t.scaleX,t.scale,t.originX),Zg(e.y,t.y,t.scaleY,t.scale,t.originY)}function $g(e,t){return Fg(Lg(e.getBoundingClientRect(),t))}function e_(e,t,n){let r=$g(e,n),{scroll:i}=t;return i&&(Xg(r.x,i.offset.x),Xg(r.y,i.offset.y)),r}const t_=()=>({translate:0,scale:1,origin:0,originPoint:0}),n_=()=>({x:t_(),y:t_()}),r_=()=>({min:0,max:0}),i_=()=>({x:r_(),y:r_()}),a_={current:null},o_={current:!1};function s_(){if(o_.current=!0,ju)if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>a_.current=e.matches;e.addEventListener(`change`,t),t()}else a_.current=!1}const c_=new WeakMap;function l_(e,t,n){for(let r in t){let i=t[r],a=n[r];if(th(i))e.addValue(r,i);else if(th(a))e.addValue(r,Pm(i,{owner:e}));else if(a!==i)if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,Pm(t===void 0?i:t,{owner:e}))}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}const u_=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`];var d_=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,blockInitialAnimation:i,visualState:a},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Np,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=Td.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,U.render(this.render,!1,!0))};let{latestValues:s,renderState:c}=a;this.latestValues=s,this.baseTarget={...s},this.initialValues=t.initial?{...s}:{},this.renderState=c,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.options=o,this.blockInitialAnimation=!!i,this.isControllingVariants=Ih(t),this.isVariantNode=Lh(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:l,...u}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in u){let t=u[e];s[e]!==void 0&&th(t)&&t.set(s[e])}}mount(e){this.current=e,c_.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)),o_.current||s_(),this.shouldReduceMotion=this.reducedMotionConfig===`never`?!1:this.reducedMotionConfig===`always`?!0:a_.current,this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){for(let e in this.projection&&this.projection.unmount(),bd(this.notifyUpdate),bd(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this),this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();let n=bp.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&U.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i(),t.owner&&t.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in vh){let t=vh[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let 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):i_()}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;t<u_.length;t++){let n=u_[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=`on`+n,i=e[r];i&&(this.propEventSubscriptions[n]=this.on(n,i))}this.prevMotionValues=l_(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let 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);let 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 n===void 0&&t!==void 0&&(n=Pm(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(Ru(n)||Bu(n))?n=parseFloat(n):!rh(n)&&ff.test(t)&&(n=wm(e,t)),this.setBaseTarget(e,th(n)?n.get():n)),th(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=fg(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!th(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new Ku),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){Fm.render(this.render)}},f_=class extends d_{constructor(){super(...arguments),this.KeyframeResolver=Dm}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?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]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;th(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}};function p_(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function m_(e){return window.getComputedStyle(e)}var h_=class extends f_{constructor(){super(...arguments),this.type=`html`,this.renderInstance=p_}readValueFromInstance(e,t){if(bp.has(t))return this.projection?.isProjecting?hp(t):_p(e,t);{let n=m_(e),r=(Od(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return $g(e,t)}build(e,t,n){Yh(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return _g(e,t,n)}};const g_=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 __(e,t,n,r){for(let n in p_(e,t,void 0,r),t.attrs)e.setAttribute(g_.has(n)?n:wg(n),t.attrs[n])}var v_=class extends f_{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=i_}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(bp.has(t)){let e=Cm(t);return e&&e.default||0}return t=g_.has(t)?t:wg(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return yg(e,t,n)}build(e,t,n){ig(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){__(e,t,n,r)}mount(e){this.isSVGTag=og(e.tagName),super.mount(e)}};const y_=(e,t)=>lg(e)?new v_(t):new h_(t,{allowProjection:e!==i});function b_(e,t,n){let r=e.getProps();return fg(r,t,n===void 0?r.custom:n,e)}const x_=e=>Array.isArray(e);function S_(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Pm(n))}function C_(e){return x_(e)?e[e.length-1]||0:e}function w_(e,t){let n=b_(e,t),{transitionEnd:r={},transition:i={},...a}=n||{};for(let t in a={...a,...r},a){let n=C_(a[t]);S_(e,t,n)}}function T_(e){return!!(th(e)&&e.add)}function E_(e,t){let n=e.getValue(`willChange`);if(T_(n))return n.add(t);if(!n&&Lu.WillChange){let n=new Lu.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function D_(e){return e.props[Tg]}const O_=e=>e!==null;function k_(e,{repeat:t,repeatType:n=`loop`},r){let i=e.filter(O_),a=t&&n!==`loop`&&t%2==1?0:i.length-1;return!a||r===void 0?i[a]:r}const A_={type:`spring`,stiffness:500,damping:25,restSpeed:10},j_=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),M_={type:`keyframes`,duration:.8},N_={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},P_=(e,{keyframes:t})=>t.length>2?M_:bp.has(e)?e.startsWith(`scale`)?j_(t[1]):A_:N_;function F_({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:a,repeatType:o,repeatDelay:s,from:c,elapsed:l,...u}){return!!Object.keys(u).length}const I_=(e,t,n,r={},i,a)=>o=>{let s=cm(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=qu(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};F_(s)||Object.assign(u,P_(e,u)),u.duration&&=qu(u.duration),u.repeatDelay&&=qu(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(em(u),u.delay===0&&(d=!0)),(Lu.instantAnimations||Lu.skipAnimations)&&(d=!0,em(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=k_(u.keyframes,s);if(e!==void 0){U.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new ap(u):new im(u)};function L_({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function R_(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a=e.getDefaultTransition(),transitionEnd:o,...s}=t;r&&(a=r);let c=[],l=i&&e.animationState&&e.animationState.getState()[i];for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||l&&L_(l,t))continue;let o={delay:n,...cm(a||{},t)},u=r.get();if(u!==void 0&&!r.isAnimating&&!Array.isArray(i)&&i===u&&!o.velocity)continue;let d=!1;if(window.MotionHandoffAnimation){let n=D_(e);if(n){let e=window.MotionHandoffAnimation(n,t,U);e!==null&&(o.startTime=e,d=!0)}}E_(e,t),r.start(I_(t,r,i,e.shouldReduceMotion&&lm.has(t)?{type:!1}:o,e,d));let f=r.animation;f&&c.push(f)}return o&&Promise.all(c).then(()=>{U.update(()=>{o&&w_(e,o)})}),c}function z_(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r,c=typeof n==`function`;return c?n(a,o):i===1?a*r:s-a*r}function B_(e,t,n={}){let r=b_(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(R_(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return V_(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}else return Promise.all([a(),o(n.delay)])}function V_(e,t,n=0,r=0,i=0,a=1,o){let s=[];for(let c of e.variantChildren)c.notify(`AnimationStart`,t),s.push(B_(c,t,{...o,delay:n+(typeof r==`function`?0:r)+z_(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function H_(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>B_(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=B_(e,t,n);else{let i=typeof t==`function`?b_(e,t,n.custom):t;r=Promise.all(R_(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}function U_(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const W_=Fh.length;function G_(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&G_(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<W_;n++){let r=Fh[n],i=e.props[r];(Nh(i)||i===!1)&&(t[r]=i)}return t}const K_=[...Ph].reverse(),q_=Ph.length;function J_(e){return t=>Promise.all(t.map(({animation:t,options:n})=>H_(e,t,n)))}function Y_(e){let t=J_(e),n=Q_(),r=!0,i=t=>(n,r)=>{let i=b_(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function a(n){t=n(e)}function o(a){let{props:o}=e,s=G_(e.parent)||{},c=[],l=new Set,u={},d=1/0;for(let t=0;t<q_;t++){let f=K_[t],p=n[f],m=o[f]===void 0?s[f]:o[f],h=Nh(m),g=f===a?p.isActive:null;g===!1&&(d=t);let _=m===s[f]&&m!==o[f]&&h;if(_&&r&&e.manuallyAnimateOnMount&&(_=!1),p.protectedKeys={...u},!p.isActive&&g===null||!m&&!p.prevProp||Mh(m)||typeof m==`boolean`)continue;let v=X_(p.prevProp,m),y=v||f===a&&p.isActive&&!_&&h||t>d&&h,b=!1,x=Array.isArray(m)?m:[m],S=x.reduce(i(f),{});g===!1&&(S={});let{prevResolvedValues:C={}}=p,w={...C,...S},T=t=>{y=!0,l.has(t)&&(b=!0,l.delete(t)),p.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in w){let t=S[e],n=C[e];if(u.hasOwnProperty(e))continue;let r=!1;r=x_(t)&&x_(n)?!U_(t,n):t!==n,r?t==null?l.add(e):T(e):t!==void 0&&l.has(e)?T(e):p.protectedKeys[e]=!0}p.prevProp=m,p.prevResolvedValues=S,p.isActive&&(u={...u,...S}),r&&e.blockInitialAnimation&&(y=!1);let E=_&&v,D=!E||b;y&&D&&c.push(...x.map(t=>{let n={type:f};if(typeof t==`string`&&r&&!E&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=b_(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=z_(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(l.size){let t={};if(typeof o.initial!=`boolean`){let n=b_(e,Array.isArray(o.initial)?o.initial[0]:o.initial);n&&n.transition&&(t.transition=n.transition)}l.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),c.push({animation:t})}let f=!!c.length;return r&&(o.initial===!1||o.initial===o.animate)&&!e.manuallyAnimateOnMount&&(f=!1),r=!1,f?t(c):Promise.resolve()}function s(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=o(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:o,setActive:s,setAnimateFunction:a,getState:()=>n,reset:()=>{n=Q_()}}}function X_(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!U_(t,e):!1}function Z_(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Q_(){return{animate:Z_(!0),whileInView:Z_(),whileHover:Z_(),whileTap:Z_(),whileDrag:Z_(),whileFocus:Z_(),exit:Z_()}}var $_=class{constructor(e){this.isMounted=!1,this.node=e}update(){}},ev=class extends $_{constructor(e){super(e),e.animationState||=Y_(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();Mh(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}};let tv=0;var nv=class extends $_{constructor(){super(...arguments),this.id=tv++}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;let r=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}};const rv={animation:{Feature:ev},exit:{Feature:nv}};function iv(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function av(e){return{point:{x:e.pageX,y:e.pageY}}}const ov=e=>t=>Wm(t)&&e(t,av(t));function sv(e,t,n,r){return iv(e,t,ov(n),r)}const cv=1e-4;1-cv,1+cv;const lv=.01;0-lv,0+lv;function uv(e){return e.max-e.min}function dv(e,t,n){return Math.abs(e-t)<=n}function fv(e,t,n,r=.5){e.origin=r,e.originPoint=G(t.min,t.max,e.origin),e.scale=uv(n)/uv(t),e.translate=G(n.min,n.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function pv(e,t,n,r){fv(e.x,t.x,n.x,r?r.originX:void 0),fv(e.y,t.y,n.y,r?r.originY:void 0)}function mv(e,t,n){e.min=n.min+t.min,e.max=e.min+uv(t)}function hv(e,t,n){mv(e.x,t.x,n.x),mv(e.y,t.y,n.y)}function gv(e,t,n){e.min=t.min-n.min,e.max=e.min+uv(t)}function _v(e,t,n){gv(e.x,t.x,n.x),gv(e.y,t.y,n.y)}function vv(e){return[e(`x`),e(`y`)]}const yv=({current:e})=>e?e.ownerDocument.defaultView:null,bv=(e,t)=>Math.abs(e-t);function xv(e,t){let n=bv(e.x,t.x),r=bv(e.y,t.y);return Math.sqrt(n**2+r**2)}var Sv=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let e=Tv(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=xv(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=xd;this.history.push({...r,timestamp:i});let{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=Cv(t,this.transformPagePoint),U.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if(this.dragSnapToOrigin&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=Tv(e.type===`pointercancel`?this.lastMoveEventInfo:Cv(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!Wm(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let o=av(e),s=Cv(o,this.transformPagePoint),{point:c}=s,{timestamp:l}=xd;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,Tv(s,this.history)),this.removeListeners=Wu(sv(this.contextWindow,`pointermove`,this.handlePointerMove),sv(this.contextWindow,`pointerup`,this.handlePointerUp),sv(this.contextWindow,`pointercancel`,this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),bd(this.updatePoint)}};function Cv(e,t){return t?{point:t(e.point)}:e}function wv(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Tv({point:e},t){return{point:e,delta:wv(e,Dv(t)),offset:wv(e,Ev(t)),velocity:Ov(t,.1)}}function Ev(e){return e[0]}function Dv(e){return e[e.length-1]}function Ov(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=Dv(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>qu(t)));)n--;if(!r)return{x:0,y:0};let a=Ju(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function kv(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?G(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?G(n,e,r.max):Math.min(e,n)),e}function Av(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function jv(e,{top:t,left:n,bottom:r,right:i}){return{x:Av(e.x,n,i),y:Av(e.y,t,r)}}function Mv(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function Nv(e,t){return{x:Mv(e.x,t.x),y:Mv(e.y,t.y)}}function Pv(e,t){let n=.5,r=uv(e),i=uv(t);return i>r?n=Gu(t.min,t.max-r,e.min):r>i&&(n=Gu(e.min,e.max-i,t.min)),Iu(0,1,n)}function Fv(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Iv=.35;function Lv(e=Iv){return e===!1?e=0:e===!0&&(e=Iv),{x:Rv(e,`left`,`right`),y:Rv(e,`top`,`bottom`)}}function Rv(e,t,n){return{min:zv(e,t),max:zv(e,n)}}function zv(e,t){return typeof e==`number`?e:e[t]||0}const Bv=new WeakMap;var Vv=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=i_(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{let{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(av(e).point)},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=zm(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),vv(e=>{let t=this.getAxisMotionValue(e).get()||0;if(Jd.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];if(r){let e=uv(r);t=e*(parseFloat(t)/100)}}}this.originPoint[e]=t}),i&&U.postRender(()=>i(e,t)),E_(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=Uv(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&a(e,t)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>vv(e=>this.getAnimationState(e)===`paused`&&this.getAxisMotionValue(e).animation?.play()),{dragSnapToOrigin:l}=this.getProps();this.panSession=new Sv(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:yv(this.visualElement)})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&U.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!Hv(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=kv(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&Sg(e)?this.constraints||=this.resolveRefConstraints():e&&n?this.constraints=jv(n.layoutBox,e):this.constraints=!1,this.elastic=Lv(t),r!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&vv(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=Fv(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!Sg(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;let i=e_(n,r.root,this.visualElement.getTransformPagePoint()),a=Nv(r.layout.layoutBox,i);if(t){let e=t(Ig(a));this.hasMutatedConstraints=!!e,e&&(a=Fg(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=vv(o=>{if(!Hv(o,t,this.currentDirection))return;let c=s&&s[o]||{};a&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return E_(this.visualElement,e),n.start(I_(e,n,0,t,this.visualElement,!1))}stopAnimation(){vv(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){vv(e=>this.getAxisMotionValue(e).animation?.pause())}getAnimationState(e){return this.getAxisMotionValue(e).animation?.state}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps(),r=n[t];return r||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){vv(t=>{let{drag:n}=this.getProps();if(!Hv(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t];i.set(e[t]-G(n,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!Sg(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};vv(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=Pv({min:n,max:n},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),vv(t=>{if(!Hv(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(G(i,a,r[t]))})}addListeners(){if(!this.visualElement.current)return;Bv.set(this.visualElement,this);let e=this.visualElement.current,t=sv(e,`pointerdown`,e=>{let{drag:t,dragListener:n=!0}=this.getProps();t&&n&&this.start(e)}),n=()=>{let{dragConstraints:e}=this.getProps();Sg(e)&&e.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,i=r.addEventListener(`measure`,n);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),U.read(n);let a=iv(window,`resize`,()=>this.scalePositionWithinConstraints()),o=r.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(vv(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{a(),t(),i(),o&&o()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=Iv,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function Hv(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Uv(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var Wv=class extends $_{constructor(e){super(e),this.removeGroupControls=Hu,this.removeListeners=Hu,this.controls=new Vv(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Hu}unmount(){this.removeGroupControls(),this.removeListeners()}};const Gv=e=>(t,n)=>{e&&U.postRender(()=>e(t,n))};var Kv=class extends $_{constructor(){super(...arguments),this.removePointerDownListener=Hu}onPointerDown(e){this.session=new Sv(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:yv(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Gv(e),onStart:Gv(t),onMove:n,onEnd:(e,t)=>{delete this.session,r&&U.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=sv(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}};const qv={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let Jv=!1;var Yv=class extends r{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),Jv&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),qv.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,Jv=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||U.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),Fm.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;Jv=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function Xv(e){let[t,n]=fh(),r=d(ku);return b(Yv,{...e,layoutGroup:r,switchLayoutGroup:d(Eg),isPresent:t,safeToRemove:n})}function Zv(e,t,n){let r=th(e)?e:Pm(e);return r.start(I_(``,r,t,n)),r.animation}const Qv=(e,t)=>e.depth-t.depth;var $v=class{constructor(){this.children=[],this.isDirty=!1}add(e){Pu(this.children,e),this.isDirty=!0}remove(e){Fu(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Qv),this.isDirty=!1,this.children.forEach(e)}};function ey(e,t){let n=Td.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(bd(r),e(a-t))};return U.setup(r,!0),()=>bd(r)}const ty=[`TopLeft`,`TopRight`,`BottomLeft`,`BottomRight`],ny=ty.length,ry=e=>typeof e==`string`?parseFloat(e):e,iy=e=>typeof e==`number`||W.test(e);function ay(e,t,n,r,i,a){i?(e.opacity=G(0,n.opacity??1,sy(r)),e.opacityExit=G(t.opacity??1,0,cy(r))):a&&(e.opacity=G(t.opacity??1,n.opacity??1,r));for(let i=0;i<ny;i++){let a=`border${ty[i]}Radius`,o=oy(t,a),s=oy(n,a);if(o===void 0&&s===void 0)continue;o||=0,s||=0;let c=o===0||s===0||iy(o)===iy(s);c?(e[a]=Math.max(G(ry(o),ry(s),r),0),(Jd.test(s)||Jd.test(o))&&(e[a]+=`%`)):e[a]=s}(t.rotate||n.rotate)&&(e.rotate=G(t.rotate||0,n.rotate||0,r))}function oy(e,t){return e[t]===void 0?e.borderRadius:e[t]}const sy=ly(0,.5,od),cy=ly(.5,.95,Hu);function ly(e,t,n){return r=>r<e?0:r>t?1:n(Gu(e,t,r))}function uy(e,t){e.min=t.min,e.max=t.max}function dy(e,t){uy(e.x,t.x),uy(e.y,t.y)}function fy(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function py(e,t,n,r,i){return e-=t,e=Ug(e,1/n,r),i!==void 0&&(e=Ug(e,1/i,r)),e}function my(e,t=0,n=1,r=.5,i,a=e,o=e){if(Jd.test(t)){t=parseFloat(t);let e=G(o.min,o.max,t/100);t=e-o.min}if(typeof t!=`number`)return;let s=G(a.min,a.max,r);e===a&&(s-=t),e.min=py(e.min,t,n,s,i),e.max=py(e.max,t,n,s,i)}function hy(e,t,[n,r,i],a,o){my(e,t[n],t[r],t[i],t.scale,a,o)}const gy=[`x`,`scaleX`,`originX`],_y=[`y`,`scaleY`,`originY`];function vy(e,t,n,r){hy(e.x,t,gy,n?n.x:void 0,r?r.x:void 0),hy(e.y,t,_y,n?n.y:void 0,r?r.y:void 0)}function yy(e){return e.translate===0&&e.scale===1}function by(e){return yy(e.x)&&yy(e.y)}function xy(e,t){return e.min===t.min&&e.max===t.max}function Sy(e,t){return xy(e.x,t.x)&&xy(e.y,t.y)}function Cy(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function wy(e,t){return Cy(e.x,t.x)&&Cy(e.y,t.y)}function Ty(e){return uv(e.x)/uv(e.y)}function Ey(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var Dy=class{constructor(){this.members=[]}add(e){Pu(this.members,e),e.scheduleRender()}remove(e){if(Fu(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){let t=this.members.findIndex(t=>e===t);if(t===0)return!1;let n;for(let e=t;e>=0;e--){let t=this.members[e];if(t.isPresent!==!1){n=t;break}}return n?(this.promote(n),!0):!1}promote(e,t){let 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);let{crossfade:r}=e.options;r===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{let{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)}};function Oy(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,rotateX:i,rotateY:a,skewX:o,skewY:s}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotateX(${i}deg) `),a&&(r+=`rotateY(${a}deg) `),o&&(r+=`skewX(${o}deg) `),s&&(r+=`skewY(${s}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}const ky={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},Ay=[``,`X`,`Y`,`Z`];let jy=0;function My(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Ny(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=D_(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,U,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Ny(r)}function Py({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=jy++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,_d.value&&(ky.nodes=ky.calculatedTargetDeltas=ky.calculatedProjections=0),this.nodes.forEach(Ly),this.nodes.forEach(Wy),this.nodes.forEach(Gy),this.nodes.forEach(Ry),_d.addProjectionMetrics&&_d.addProjectionMetrics(ky)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=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;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new $v)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new Ku),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=$m(t)&&!eh(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;U.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=ey(i,250),qv.hasAnimatedSinceResize&&(qv.hasAnimatedSinceResize=!1,this.nodes.forEach(Uy)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||Qy,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!wy(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...cm(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l)}else t||Uy(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),bd(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(Ky),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Ny(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){this.updateScheduled=!1;let e=this.isUpdateBlocked();if(e){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(By);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Vy);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Hy),this.nodes.forEach(Fy),this.nodes.forEach(Iy)):this.nodes.forEach(Vy),this.clearAllSnapshots();let t=Td.now();xd.delta=Iu(0,1e3/60,t-xd.timestamp),xd.timestamp=t,xd.isProcessing=!0,Sd.update.process(xd),Sd.preRender.process(xd),Sd.render.process(xd),xd.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Fm.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(zy),this.sharedNodes.forEach(qy)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,U.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){U.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!uv(this.snapshot.measuredBox.x)&&!uv(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++){let t=this.path[e];t.updateScroll()}let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=i_(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!by(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||Bg(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),nb(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return i_();let t=e.measureViewportBox(),n=this.scroll?.wasRoot||this.path.some(ib);if(!n){let{scroll:e}=this.root;e&&(Xg(t.x,e.offset.x),Xg(t.y,e.offset.y))}return t}removeElementScroll(e){let t=i_();if(dy(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&dy(t,e),Xg(t.x,i.offset.x),Xg(t.y,i.offset.y))}return t}applyTransform(e,t=!1){let n=i_();dy(n,e);for(let e=0;e<this.path.length;e++){let r=this.path[e];!t&&r.options.layoutScroll&&r.scroll&&r!==r.root&&Qg(n,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),Bg(r.latestValues)&&Qg(n,r.latestValues)}return Bg(this.latestValues)&&Qg(n,this.latestValues),n}removeTransform(e){let t=i_();dy(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!n.instance||!Bg(n.latestValues))continue;zg(n.latestValues)&&n.updateSnapshot();let r=i_(),i=n.measurePageBox();dy(r,i),vy(t,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,r)}return Bg(this.latestValues)&&vy(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0?!0:e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==xd.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t,r=!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize);if(r)return;let{layout:i,layoutId:a}=this.options;if(!this.layout||!(i||a))return;this.resolvedRelativeTargetAt=xd.timestamp;let o=this.getClosestProjectingParent();o&&this.linkedParentVersion!==o.layoutVersion&&!o.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(o&&o.layout?this.createRelativeTarget(o,this.layout.layoutBox,o.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=i_(),this.targetWithTransforms=i_()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),hv(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):dy(this.target,this.layout.layoutBox),Kg(this.target,this.targetDelta)):dy(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,o&&!!o.resumingFrom==!!this.resumingFrom&&!o.options.layoutScroll&&o.target&&this.animationProgress!==1?this.createRelativeTarget(o,this.target,o.target):this.relativeParent=this.relativeTarget=void 0),_d.value&&ky.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||zg(this.parent.latestValues)||Vg(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=i_(),this.relativeTargetOrigin=i_(),_v(this.relativeTargetOrigin,t,n),dy(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===xd.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;dy(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;Yg(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=i_());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(fy(this.prevProjectionDelta.x,this.projectionDelta.x),fy(this.prevProjectionDelta.y,this.projectionDelta.y)),pv(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!Ey(this.projectionDelta.x,this.prevProjectionDelta.x)||!Ey(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),_d.value&&ky.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=n_(),this.projectionDelta=n_(),this.projectionDeltaWithTransform=n_()}setAnimationOrigin(e,t=!1){let n=this.snapshot,r=n?n.latestValues:{},i={...this.latestValues},a=n_();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let o=i_(),s=n?n.source:void 0,c=this.layout?this.layout.source:void 0,l=s!==c,u=this.getStack(),d=!u||u.members.length<=1,f=!!(l&&!d&&this.options.crossfade===!0&&!this.path.some(Zy));this.animationProgress=0;let p;this.mixTargetDelta=t=>{let n=t/1e3;Jy(a.x,e.x,n),Jy(a.y,e.y,n),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(_v(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Xy(this.relativeTarget,this.relativeTargetOrigin,o,n),p&&Sy(this.relativeTarget,p)&&(this.isProjectionDirty=!1),p||=i_(),dy(p,this.relativeTarget)),l&&(this.animationValues=i,ay(i,r,this.latestValues,n,f,d)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(bd(this.pendingAnimation),void 0),this.pendingAnimation=U.update(()=>{qv.hasAnimatedSinceResize=!0,Ed.layout++,this.motionValue||=Pm(0),this.currentAnimation=Zv(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onStop:()=>{Ed.layout--},onComplete:()=>{Ed.layout--,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);let 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(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(!(!t||!n||!r)){if(this!==e&&this.layout&&r&&rb(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||i_();let t=uv(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=uv(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}dy(t,n),Qg(t,i),pv(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new Dy);let n=this.sharedNodes.get(e);n.add(t);let r=t.options.initialPromotionConfig;t.promote({transition:r?r.transition:void 0,preserveFollowOpacity:r&&r.shouldPreserveFollowOpacity?r.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return e?e.lead===this:!0}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&My(`z`,e,r,this.animationValues);for(let t=0;t<Ay.length;t++)My(`rotate${Ay[t]}`,e,r,this.animationValues),My(`skew${Ay[t]}`,e,r,this.animationValues);for(let t in e.render(),r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=pg(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=pg(t?.pointerEvents)||``),this.hasProjected&&!Bg(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=Oy(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;for(let t in e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,r.animationValues?e.opacity=r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:e.opacity=r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit,Wh){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=Wh[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?pg(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(By),this.root.sharedNodes.clear()}}}function Fy(e){e.updateLayout()}function Iy(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;i===`size`?vv(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=uv(r);r.min=n[e].min,r.max=r.min+i}):rb(i,t.layoutBox,n)&&vv(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=uv(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=n_();pv(o,n,t.layoutBox);let s=n_();a?pv(s,e.applyTransform(r,!0),t.measuredBox):pv(s,n,t.layoutBox);let c=!by(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=i_();_v(o,t.layoutBox,i.layoutBox);let s=i_();_v(s,n,a.layoutBox),wy(o,s)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=s,e.relativeTargetOrigin=o,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function Ly(e){_d.value&&ky.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function Ry(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function zy(e){e.clearSnapshot()}function By(e){e.clearMeasurements()}function Vy(e){e.isLayoutDirty=!1}function Hy(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function Uy(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Wy(e){e.resolveTargetDelta()}function Gy(e){e.calcProjection()}function Ky(e){e.resetSkewAndRotation()}function qy(e){e.removeLeadSnapshot()}function Jy(e,t,n){e.translate=G(t.translate,0,n),e.scale=G(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Yy(e,t,n,r){e.min=G(t.min,n.min,r),e.max=G(t.max,n.max,r)}function Xy(e,t,n,r){Yy(e.x,t.x,n.x,r),Yy(e.y,t.y,n.y,r)}function Zy(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Qy={duration:.45,ease:[.4,0,.1,1]},$y=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),eb=$y(`applewebkit/`)&&!$y(`chrome/`)?Math.round:Hu;function tb(e){e.min=eb(e.min),e.max=eb(e.max)}function nb(e){tb(e.x),tb(e.y)}function rb(e,t,n){return e===`position`||e===`preserve-aspect`&&!dv(Ty(t),Ty(n),.2)}function ib(e){return e!==e.root&&e.scroll?.wasRoot}const ab=Py({attachResizeListener:(e,t)=>iv(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),ob={current:void 0},sb=Py({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!ob.current){let e=new ab({});e.mount(window),e.setOptions({layoutScroll:!0}),ob.current=e}return ob.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),cb={pan:{Feature:Kv},drag:{Feature:Wv,ProjectionNode:sb,MeasureLayout:Xv}};function lb(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=`onHover`+n,a=r[i];a&&U.postRender(()=>a(t,av(t)))}var ub=class extends $_{mount(){let{current:e}=this.node;e&&(this.unmount=Hm(e,(e,t)=>(lb(this.node,t,`Start`),e=>lb(this.node,e,`End`))))}unmount(){}},db=class extends $_{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{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=Wu(iv(this.node.current,`focus`,()=>this.onFocus()),iv(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function fb(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=`onTap`+(n===`End`?``:n),a=r[i];a&&U.postRender(()=>a(t,av(t)))}var pb=class extends $_{mount(){let{current:e}=this.node;e&&(this.unmount=Qm(e,(e,t)=>(fb(this.node,t,`Start`),(e,{success:t})=>fb(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}};const mb=new WeakMap,hb=new WeakMap,gb=e=>{let t=mb.get(e.target);t&&t(e)},_b=e=>{e.forEach(gb)};function vb({root:e,...t}){let n=e||document;hb.has(n)||hb.set(n,{});let r=hb.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(_b,{root:e,...t})),r[i]}function yb(e,t,n){let r=vb(t);return mb.set(e,n),r.observe(e),()=>{mb.delete(e),r.unobserve(e)}}const bb={some:0,all:1};var xb=class extends $_{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:bb[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};return yb(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node,n=[`amount`,`margin`,`root`].some(Sb(e,t));n&&this.startObserver()}unmount(){}};function Sb({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Cb={inView:{Feature:xb},tap:{Feature:pb},focus:{Feature:db},hover:{Feature:ub}},wb={layout:{ProjectionNode:sb,MeasureLayout:Xv}},Tb={...rv,...Cb,...cb,...wb},Eb=Pg(Tb,y_),Db=({testId:e=`carousel-id`,activeIndex:t=0,extraClassNames:n=``,onSlide:r=()=>{},autoSlide:i,showIndicators:a=!0,continuous:o=!0,interval:s=4e3,prevIcon:c=`fc-arrow-dropdown tw:rotate-90`,nextIcon:l=`fc-arrow-dropdown tw:rotate-270`,showArrows:u=!0,iconExtraClassNames:d=``,carouselItems:p=[]})=>{let[m,h]=v(t),g=e=>{let t=(e+p.length)%p.length;h(t),r(t,t>m?`right`:`left`)};f(()=>{if(i){let e=setInterval(()=>{o||m<p.length-1?g(m+1):clearInterval(e)},s);return()=>clearInterval(e)}},[i,m,o,s,p.length]),f(()=>{t!==m&&h(t)},[t]);let _=()=>{if(m===0&&!o)return;let e=m-1;e<0&&(e=p.length-1),g(e)},y=()=>{if(m===p.length-1){if(!o)return;g(0)}else g(m+1)},S={type:`spring`,damping:20,stiffness:100},C={initial:e=>({x:e>0?`100%`:`-100%`,opacity:0}),animate:{x:0,opacity:1,transition:S},exit:e=>({x:e>0?`-100%`:`100%`,opacity:0,transition:S})};return x(`div`,{"data-testid":e,className:`tw:flex tw:flex-col tw:items-center tw:justify-center tw:w-full tw:overflow-hidden ${n}`,children:[x(`div`,{className:`tw:flex tw:items-center tw:w-full tw:h-max tw:gap-1`,children:[u&&b(Kt,{icon:c,size:`lg`,variant:`no-border`,testId:`carousel-prev`,extraClassNames:`${m===0&&!o?`tw:invisible`:``} ${d} tw:animate-fadeIn`,onClick:_}),b(`div`,{className:`tw:h-full tw:w-full tw:overflow-hidden`,children:b(Eb.div,{custom:1,initial:`initial`,animate:`animate`,exit:`exit`,variants:C,className:`tw:w-full`,children:p[m]},m)}),u&&b(Kt,{icon:l,testId:`carousel-next`,size:`lg`,variant:`no-border`,extraClassNames:`${m===p.length-1&&!o?`tw:invisible`:``} ${d} tw:animate-fadeIn`,onClick:y})]}),a&&b(`div`,{className:`tw:flex tw:gap-1 tw:mt-2`,children:p.map((e,t)=>b(`div`,{className:`tw:w-2 tw:h-2 tw:rounded-full tw:cursor-pointer ${t===m?`tw:bg-sq-theme-dark`:`tw:bg-sq-darkish-gray`}`,onClick:()=>g(t)},t))})]})};var Ob=Db;const kb=`tw:appearance-none tw:border tw:h-3.5 tw:w-3.5 tw:shrink-0 tw:focus:ring-0 tw:focus:ring-offset-0 tw:outline-none tw:focus:outline-none tw:dark:bg-sq-dark-background tw:dark:border-sq-dark-text tw:dark:enabled:hover:bg-sq-dark-background tw:checked:text-white tw:checked:border-sq-text-color tw:checked:enabled:hover:border-sq-theme-dark tw:checked:active:border-sq-theme-darker tw:checked:focus:border-sq-theme-dark tw:disabled:border-sq-disabled-gray tw:dark:disabled:border-sq-fairly-dark-gray tw:dark:checked:focus:bg-sq-dark-background`,Ab=`tw:rounded ${kb}`,jb=`tw:rounded-full ${kb}`,Mb=e=>{let{type:t=`checkbox`,value:n,disabled:r=!1,label:i,onChange:a,onClick:o,onKeyDown:s,checked:c,defaultChecked:l,id:u,name:d,extraClassNames:f=``,extraLabelClassNames:m,testId:h,...g}=e,_=p(),v=u??`checkbox${_}`,y=Tt(g);return x(`span`,{className:`tw:flex ${f}`,children:[b(`input`,{value:n,type:t,"data-testid":h,name:d,id:v,readOnly:!a,checked:c,defaultChecked:l,className:`${t===`checkbox`?Ab:jb} ${r?`tw:cursor-not-allowed`:`tw:cursor-pointer`}`,disabled:r,onClick:o,onChange:a,onKeyDown:s,...y}),i&&b(`label`,{htmlFor:v,className:`tw:ml-1.5 tw:text-sm tw:-mt-0.5 ${m} ${r?`tw:cursor-not-allowed tw:dark:text-sq-fairly-dark-gray tw:text-sq-fairly-dark-gray`:`tw:cursor-pointer tw:text-sq-text-color tw:dark:text-sq-dark-text`}`,children:i})]})},Nb=({isVisible:e,children:t})=>{let n=_(null),[r,i]=v(0);return f(()=>{n.current&&setTimeout(()=>{i((n.current?.scrollHeight??0)+5)},0)},[t]),b(hh,{initial:!1,children:e&&b(Eb.div,{initial:{height:0,opacity:0},animate:{height:r,opacity:1},exit:{height:0,opacity:0},transition:{type:`spring`,damping:20,stiffness:100},children:b(`div`,{ref:n,children:t})})})};var Pb=Nb;const Fb={sm:`tw:h-5 tw:w-5 tw:rounded`,md:`tw:h-6 tw:w-6 tw:rounded-md`,lg:`tw:h-8 tw:w-8 tw:rounded-lg`},Ib=c(function({color:e,onClick:t,"aria-label":n,size:r=`lg`,extraClassNames:i=``,id:a,testId:o},s){return b(`button`,{ref:s,"aria-label":n,className:`tw:cursor-pointer tw:border tw:border-gray-700 tw:dark:border-gray-500 tw:shadow-sm tw:focus-visible:outline-none ${Fb[r]} ${i}`,"data-testid":o,id:a,onClick:t,style:{backgroundColor:e},type:`button`})});var Lb=Ib;const Rb=[`tw:bg-sq-white tw:dark:bg-sq-dark-background`,`tw:border tw:border-solid tw:rounded-[0.5rem] tw:border-sq-disabled-gray tw:dark:border-gray-500`,`tw:relative tw:z-[1200] tw:min-w-6`,`tw:focus-visible:outline-none tw:outline-none`,`tw:data-[state=open]:animate-in tw:data-[state=closed]:animate-out`,`tw:data-[side=top]:animate-slideDownAndFade tw:data-[side=right]:animate-slideLeftAndFade`,`tw:data-[side=bottom]:animate-slideUpAndFade tw:data-[side=left]:animate-slideRightAndFade`,`tw:text-sq-text-color tw:dark:text-sq-text-color-dark`].join(` `);function zb({color:e,label:t,children:n,placement:r=`bottom`,align:i=`start`,extraClassNames:a=``,id:o,testId:s,onOpen:c}){let l=p(),u=b(`label`,{className:`tw:cursor-pointer tw:whitespace-nowrap tw:text-sm tw:text-sq-text-color tw:dark:text-sq-text-color-dark`,htmlFor:l,children:t}),d=b(Lb,{"aria-label":t,color:e,id:o??l,size:`sm`,onClick:c});return n?x(`div`,{className:`tw:flex tw:items-center tw:gap-2 ${a}`,children:[u,x(yu,{children:[b(bu,{asChild:!0,children:d}),b(Su,{align:i,className:Rb,"data-testid":s,side:r,sideOffset:2,children:n})]})]}):x(`div`,{className:`tw:flex tw:items-center tw:gap-2 ${a}`,children:[b(`span`,{className:`tw:cursor-pointer tw:whitespace-nowrap tw:text-sm tw:text-sq-text-color tw:dark:text-sq-text-color-dark`,children:t}),d]})}var Bb=zb;const Vb={normal:`tw:gap-2`,spacious:`tw:gap-3`},Hb=({title:e,children:t,onApply:n,onCancel:r,isApplyDisabled:i=!1,applyLabel:a=`Apply`,cancelLabel:o=`Cancel`,spacing:s=`normal`,extraClassNames:c=``,id:l,testId:u})=>x(`div`,{className:`tw:mt-3 tw:mb-1 tw:flex tw:w-full tw:max-w-md tw:flex-col tw:items-start tw:rounded-3xl tw:border tw:border-sq-tool-btn-border tw:dark:border-gray-500 tw:bg-sq-surface tw:dark:bg-sq-tools-background-dark tw:px-4 tw:py-3 tw:shadow-sm ${Vb[s]} ${c}`,"data-testid":u,id:l,children:[b(`span`,{className:`tw:text-xs tw:font-bold tw:uppercase tw:tracking-wide tw:text-sq-theme-dark`,children:e}),t,x(`div`,{className:`tw:flex tw:w-full tw:max-w-full tw:flex-wrap tw:items-center tw:justify-end tw:gap-2`,children:[r&&b(Kt,{label:o,onClick:r,size:`sm`,variant:`outline`}),n&&b(Kt,{disabled:i,label:a,onClick:n,size:`sm`,variant:`theme`})]})]});var Ub=Hb,Wb=P(Pt());const Gb={link:`tw:inline-flex tw:text-sq-theme-link tw:underline tw:underline-offset-2 tw:transition-colors hover:tw:text-sq-theme-dark focus-visible:tw:outline-none focus-visible:tw:ring-2 focus-visible:tw:ring-sq-theme-link focus-visible:tw:ring-offset-2`,icon:``},Kb=({variant:e=`link`,label:t,href:n,children:r,extraClassNames:i=``,testId:a})=>x(y,{children:[t&&b(`span`,{className:`tw:text-sq-text-color tw:dark:text-sq-text-color-dark tw:shrink-0`,children:t}),b(`a`,{href:n,target:`_blank`,rel:`noopener`,className:(0,Wb.default)(Gb[e],i),"data-testid":a,children:r})]});var qb=Kb;function Jb(e,t){if(typeof e==`function`)return e(t);typeof e==`object`&&e&&`current`in e&&(e.current=t)}function Yb(...e){let t=new Map;return n=>{if(e.forEach(e=>{let r=Jb(e,n);r&&t.set(e,r)}),t.size>0)return()=>{e.forEach(e=>{let n=t.get(e);n&&typeof n==`function`?n():Jb(e,null)}),t.clear()}}}function Xb(...e){return u(Yb(...e),e)}const Zb=(e,t)=>{let n;return typeof e==`number`&&e>0&&(n={width:`${e}px`}),typeof t==`number`&&t>0&&(n||={},n.height=`${t}px`),n},Qb=[`tw:border-sq-disabled-gray`,`tw:dark:border-sq-dark-disabled-gray`,`tw:hover:border-sq-theme-dark`,`tw:dark:hover:border-sq-theme-dark-dark`,`tw:dark:focus:border-sq-theme-dark-dark`,`tw:dark:active:border-sq-theme-darker`,`tw:focus:border-sq-theme-dark`,`tw:active:border-sq-theme-dark`].join(` `),$b={sm:`tw:text-sm`,lg:`tw:text-xl`},ex=c((e,t)=>{let{readonly:n=!1,disabled:r=!1,onChange:i,onPaste:a,onKeyUp:o,onFocus:s,onBlur:c,onKeyDown:l,id:u,name:d,size:p=`sm`,value:m,placeholder:h,extraClassNames:g,testId:S,type:C=`text`,inputGroup:w,step:T,showError:E,errorText:D,min:O,max:k,maxLength:A,minLength:j,required:M=!1,autoComplete:ee=`off`,inputWidth:N=void 0,inputHeight:P=void 0,autoFocus:F=!1,...I}=e,L=_(null),R=Xb(t,L),[te,z]=v(null),ne=Tt(I),B=_(F);f(()=>{B.current&&setTimeout(()=>{L.current?.focus()},0)},[]),f(()=>{let e=L.current;e&&C!==`number`&&C!==`email`&&e.setSelectionRange(te,te)},[t,te,m,C]);let re=e=>{z(e.target.selectionStart),i&&i(e)},ie=()=>C===`number`?O===void 0?!0:O%Number(T??1)===0:!1,ae=e=>{if(ie()){let t=e.currentTarget,n=t.value;t.defaultValue=``,t.value=t.validity.valid&&m!=null?`${m}`:n}c?.(e)};f(()=>{let e=L.current;C===`number`&&m!=null&&m!==e?.value&&e&&(e.value=`${m}`)},[m,C]);let oe=`tw:rounded-md`;w===`left`?oe=`tw:rounded-l-md tw:border-r-0 tw:focus:border-r tw:active:border-r`:w===`right`&&(oe=`tw:rounded-r-md tw:border-l-0 tw:focus:border-l tw:active:border-l`);let se=`tw:h-8.5 tw:leading-normal tw:outline-none tw:py-1 tw:px-3 tw:disabled:pointer-events-none tw:disabled:bg-sq-light-gray tw:disabled:dark:bg-sq-dark-disabled-gray tw:disabled:cursor-not-allowed tw:p-1 tw:border-solid tw:border tw:placeholder-gray-400! tw:dark:placeholder-sq-dark-text/30! specTextField ${$b[p]} ${g} tw:text-sq-text-color tw:disabled:text-sq-darkish-gray tw:dark:bg-sq-dark-background tw:dark:text-sq-dark-text tw:disabled:dark:text-sq-dark-text/30 ${oe} ${E?`tw:border-sq-danger`:Qb} `,ce=Zb(N,P)?{style:Zb(N,P)}:{},le={};A&&(le.maxLength=A),j&&(le.minLength=j);let V=C===`number`?{defaultValue:m}:{value:m};return x(y,{children:[b(`input`,{ref:R,"data-testid":S,name:d,id:u,type:C,...V,className:se,placeholder:h,disabled:r,readOnly:n,autoComplete:ee,onChange:re,onPaste:a,onFocus:s,onBlur:ae,onKeyDown:l,onKeyUp:o,step:T,required:M,min:O,max:k,...le,...ce,...ne}),D&&E&&b(`div`,{className:`tw:text-sq-danger tw:text-xs tw:mt-1`,children:D})]})});ex.displayName=`TextField`;const tx=[`tw:border-sq-disabled-gray`,`tw:dark:border-sq-dark-disabled-gray`,`tw:dark:focus:border-sq-theme-darker`,`tw:dark:active:border-sq-theme-darker`,`tw:focus:border-sq-theme-dark`,`tw:active:border-sq-theme-dark`].join(` `),nx=c((e,t)=>{let{readonly:n=!1,onChange:r,onKeyUp:i,onFocus:o,onBlur:s,onKeyDown:c,name:u,value:d,placeholder:f,append:p=[],extraClassNames:m=``,id:h,testId:g,showError:_,required:v,autoComplete:y,autoFocus:S,disabled:C,type:w,step:T,min:E,max:D,field:O,maxLength:k,minLength:A,inputGroup:j,...M}=e,ee=Tt(M),N=`tw:flex tw:outline-none tw:rounded-md tw:w-full tw:relative tw:flex-wrap ${m}`,P=p.filter(Boolean),F=j??(P.length>0?`left`:void 0),I=F===`left`?`tw:rounded-l-md tw:rounded-r-none`:F===`right`?`tw:rounded-r-md tw:rounded-l-none`:`tw:rounded-md`,L=`tw:leading-normal tw:outline-none tw:py-1 tw:px-3 tw:p-1 tw:border-solid tw:border ${m} tw:text-sq-text-color tw:disabled:text-sq-darkish-gray tw:dark:bg-sq-dark-background tw:dark:text-sq-dark-text tw:disabled:dark:text-sq-disabled-gray ${I} ${_?`tw:border-sq-danger`:tx} `,R=l(O)&&typeof O.type!=`string`,te=R?a(O,{inputGroup:F}):O;return x(`div`,{id:`input-group-${h}`,className:N,children:[O?b(`div`,{"data-testid":g,className:`tw:flex tw:flex-1 tw:cursor-pointer tw:active:z-50 ${L}`,children:te}):b(ex,{testId:g,readonly:n,onChange:r,onKeyUp:i,onFocus:o,onBlur:s,onKeyDown:c,name:u,ref:t,showError:_,value:d,required:v,placeholder:f,autoComplete:y,autoFocus:S,id:h,type:w,disabled:C,step:T,min:E,max:D,maxLength:k,minLength:A,inputGroup:F,extraClassNames:`tw:flex tw:flex-1 tw:w-full tw:focus:z-30 ${m}`,...ee}),P.map((e,t)=>e?.variant===`button`?b(Kt,{extraClassNames:`$
59
59
  index ? 'tw:-ml-px' : 'tw:ml-0'
60
60
  } tw:focus:z-40 tw:focus:border tw:rounded-none tw:last:rounded-r-md`,...e.buttonProps},t):b(`div`,{className:`${tx} ${t?`tw:-ml-px`:`tw:ml-0`} tw:flex tw:items-center tw:justify-center tw:rounded-none tw:last:rounded-r-md tw:active:z-30 tw:active:border tw:border`,children:e?.element},t))]})});nx.displayName=`InputGroup`;var rx=`Dialog`,[ix,ax]=R(rx),[ox,sx]=ix(rx),cx=t=>{let{__scopeDialog:n,children:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=t,c=e.useRef(null),l=e.useRef(null),[u,d]=fe({prop:i,defaultProp:a??!1,onChange:o,caller:rx});return b(ox,{scope:n,triggerRef:c,contentRef:l,contentId:we(),titleId:we(),descriptionId:we(),open:u,onOpenChange:d,onOpenToggle:e.useCallback(()=>d(e=>!e),[d]),modal:s,children:r})};cx.displayName=rx;var lx=`DialogTrigger`,ux=e.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=sx(lx,n),a=B(t,i.triggerRef);return b(H.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Ax(i.open),...r,ref:a,onClick:V(e.onClick,i.onOpenToggle)})});ux.displayName=lx;var dx=`DialogPortal`,[fx,px]=ix(dx,{forceMount:void 0}),mx=t=>{let{__scopeDialog:n,forceMount:r,children:i,container:a}=t,o=sx(dx,n);return b(fx,{scope:n,forceMount:r,children:e.Children.map(i,e=>b(ve,{present:r||o.open,children:b(Sa,{asChild:!0,container:a,children:e})}))})};mx.displayName=dx;var hx=`DialogOverlay`,gx=e.forwardRef((e,t)=>{let n=px(hx,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=sx(hx,e.__scopeDialog);return a.modal?b(ve,{present:r||a.open,children:b(vx,{...i,ref:t})}):null});gx.displayName=hx;var _x=re(`DialogOverlay.RemoveScroll`),vx=e.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=sx(hx,n);return b(ds,{as:_x,allowPinchZoom:!0,shards:[i.contentRef],children:b(H.div,{"data-state":Ax(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),yx=`DialogContent`,bx=e.forwardRef((e,t)=>{let n=px(yx,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=sx(yx,e.__scopeDialog);return b(ve,{present:r||a.open,children:a.modal?b(xx,{...i,ref:t}):b(Sx,{...i,ref:t})})});bx.displayName=yx;var xx=e.forwardRef((t,n)=>{let r=sx(yx,t.__scopeDialog),i=e.useRef(null),a=B(n,r.contentRef,i);return e.useEffect(()=>{let e=i.current;if(e)return Qa(e)},[]),b(Cx,{...t,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:V(t.onCloseAutoFocus,e=>{e.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:V(t.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;r&&e.preventDefault()}),onFocusOutside:V(t.onFocusOutside,e=>e.preventDefault())})}),Sx=e.forwardRef((t,n)=>{let r=sx(yx,t.__scopeDialog),i=e.useRef(!1),a=e.useRef(!1);return b(Cx,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{t.onCloseAutoFocus?.(e),e.defaultPrevented||(i.current||r.triggerRef.current?.focus(),e.preventDefault()),i.current=!1,a.current=!1},onInteractOutside:e=>{t.onInteractOutside?.(e),e.defaultPrevented||(i.current=!0,e.detail.originalEvent.type===`pointerdown`&&(a.current=!0));let n=e.target,o=r.triggerRef.current?.contains(n);o&&e.preventDefault(),e.detail.originalEvent.type===`focusin`&&a.current&&e.preventDefault()}})}),Cx=e.forwardRef((t,n)=>{let{__scopeDialog:r,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,...s}=t,c=sx(yx,r),l=e.useRef(null),u=B(n,l);return pn(),x(y,{children:[b(yn,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:a,onUnmountAutoFocus:o,children:b(an,{role:`dialog`,id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":Ax(c.open),...s,ref:u,onDismiss:()=>c.onOpenChange(!1)})}),x(y,{children:[b(Px,{titleId:c.titleId}),b(Ix,{contentRef:l,descriptionId:c.descriptionId})]})]})}),wx=`DialogTitle`,Tx=e.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=sx(wx,n);return b(H.h2,{id:i.titleId,...r,ref:t})});Tx.displayName=wx;var Ex=`DialogDescription`,Dx=e.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=sx(Ex,n);return b(H.p,{id:i.descriptionId,...r,ref:t})});Dx.displayName=Ex;var Ox=`DialogClose`,kx=e.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=sx(Ox,n);return b(H.button,{type:`button`,...r,ref:t,onClick:V(e.onClick,()=>i.onOpenChange(!1))})});kx.displayName=Ox;function Ax(e){return e?`open`:`closed`}var jx=`DialogTitleWarning`,[Mx,Nx]=L(jx,{contentName:yx,titleName:wx,docsSlug:`dialog`}),Px=({titleId:t})=>{let n=Nx(jx),r=`\`${n.contentName}\` requires a \`${n.titleName}\` for the component to be accessible for screen reader users.
61
61