@dynamo-caffeina-dev/locator-frontend 0.0.12 → 0.0.13

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.
package/dist/index.umd.js CHANGED
@@ -125,7 +125,7 @@ React keys must be passed directly to JSX without using spread:
125
125
  *
126
126
  * This source code is licensed under the ISC license.
127
127
  * See the LICENSE file in the root directory of this source tree.
128
- */const bo=ue("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),So=g.createContext({});function rc(e){const t=g.useRef(null);return t.current===null&&(t.current=e()),t.current}const Rn=typeof window<"u",oc=Rn?g.useLayoutEffect:g.useEffect,Fn=g.createContext(null),Co=g.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function sc(e=!0){const t=g.useContext(Fn);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=t,s=g.useId();g.useEffect(()=>{if(e)return o(s)},[e]);const i=g.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,i]:[!0]}function Bn(e,t){e.indexOf(t)===-1&&e.push(t)}function $n(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const de=e=>e;let lt=de,je=de;process.env.NODE_ENV!=="production"&&(lt=(e,t)=>{!e&&typeof console<"u"&&console.warn(t)},je=(e,t)=>{if(!e)throw new Error(t)});const ic={useManualTiming:!1};function zn(e){let t;return()=>(t===void 0&&(t=e()),t)}const ct=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class Un{constructor(){this.subscriptions=[]}add(t){return Bn(this.subscriptions,t),()=>$n(this.subscriptions,t)}notify(t,n,r){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,n,r);else for(let s=0;s<o;s++){const i=this.subscriptions[s];i&&i(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const xe=e=>e*1e3,Te=e=>e/1e3;function wo(e,t){return t?e*(1e3/t):0}const To=new Set;function on(e,t,n){e||To.has(t)||(console.warn(t),To.add(t))}const ac=zn(()=>window.ScrollTimeline!==void 0);class lc{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t,n){const r=this.animations.map(o=>{if(ac()&&o.attachTimeline)return o.attachTimeline(t);if(typeof n=="function")return n(o)});return()=>{r.forEach((o,s)=>{o&&o(),this.animations[s].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class cc extends lc{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}function Xn(e,t){return e?e[t]||e.default||e:void 0}const Wn=2e4;function _o(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Wn;)t+=n,r=e.next(t);return t>=Wn?1/0:t}function Kn(e){return typeof e=="function"}function Eo(e,t){e.timeline=t,e.onfinish=null}const Gn=e=>Array.isArray(e)&&typeof e[0]=="number",uc={linearEasing:void 0};function dc(e,t){const n=zn(e);return()=>{var r;return(r=uc[t])!==null&&r!==void 0?r:n()}}const sn=dc(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Po=(e,t,n=10)=>{let r="";const o=Math.max(Math.round(t/n),2);for(let s=0;s<o;s++)r+=e(ct(0,o-1,s))+", ";return`linear(${r.substring(0,r.length-2)})`};function Ao(e){return!!(typeof e=="function"&&sn()||!e||typeof e=="string"&&(e in qn||sn())||Gn(e)||Array.isArray(e)&&e.every(Ao))}const Mt=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,qn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Mt([0,.65,.55,1]),circOut:Mt([.55,0,1,.45]),backIn:Mt([.31,.01,.66,-.59]),backOut:Mt([.33,1.53,.69,.99])};function Mo(e,t){if(e)return typeof e=="function"&&sn()?Po(e,t):Gn(e)?Mt(e):Array.isArray(e)?e.map(n=>Mo(n,t)||qn.easeOut):qn[e]}const an=["read","resolveKeyframes","update","preRender","render","postRender"],Lo={value:null};function fc(e,t){let n=new Set,r=new Set,o=!1,s=!1;const i=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function c(d){i.has(d)&&(u.schedule(d),e()),l++,d(a)}const u={schedule:(d,f=!1,m=!1)=>{const y=m&&o?n:r;return f&&i.add(d),y.has(d)||y.add(d),d},cancel:d=>{r.delete(d),i.delete(d)},process:d=>{if(a=d,o){s=!0;return}o=!0,[n,r]=[r,n],n.forEach(c),t&&Lo.value&&Lo.value.frameloop[t].push(l),l=0,n.clear(),o=!1,s&&(s=!1,u.process(d))}};return u}const hc=40;function Do(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,i=an.reduce((v,b)=>(v[b]=fc(s,t?b:void 0),v),{}),{read:a,resolveKeyframes:l,update:c,preRender:u,render:d,postRender:f}=i,m=()=>{const v=performance.now();n=!1,o.delta=r?1e3/60:Math.max(Math.min(v-o.timestamp,hc),1),o.timestamp=v,o.isProcessing=!0,a.process(o),l.process(o),c.process(o),u.process(o),d.process(o),f.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(m))},p=()=>{n=!0,r=!0,o.isProcessing||e(m)};return{schedule:an.reduce((v,b)=>{const w=i[b];return v[b]=(M,_=!1,L=!1)=>(n||p(),w.schedule(M,_,L)),v},{}),cancel:v=>{for(let b=0;b<an.length;b++)i[an[b]].cancel(v)},state:o,steps:i}}const{schedule:U,cancel:Ne,state:re,steps:Hn}=Do(typeof requestAnimationFrame<"u"?requestAnimationFrame:de,!0),{schedule:Yn}=Do(queueMicrotask,!1);let ln;function pc(){ln=void 0}const be={now:()=>(ln===void 0&&be.set(re.isProcessing||ic.useManualTiming?re.timestamp:performance.now()),ln),set:e=>{ln=e,queueMicrotask(pc)}},ye={x:!1,y:!1};function Oo(){return ye.x||ye.y}function mc(e){return e==="x"||e==="y"?ye[e]?null:(ye[e]=!0,()=>{ye[e]=!1}):ye.x||ye.y?null:(ye.x=ye.y=!0,()=>{ye.x=ye.y=!1})}function gc(e,t,n){var r;if(e instanceof EventTarget)return[e];if(typeof e=="string"){let o=document;const s=(r=void 0)!==null&&r!==void 0?r:o.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e)}function ko(e,t){const n=gc(e),r=new AbortController,o={passive:!0,...t,signal:r.signal};return[n,o,()=>r.abort()]}function jo(e){return!(e.pointerType==="touch"||Oo())}function yc(e,t,n={}){const[r,o,s]=ko(e,n),i=a=>{if(!jo(a))return;const{target:l}=a,c=t(l,a);if(typeof c!="function"||!l)return;const u=d=>{jo(d)&&(c(d),l.removeEventListener("pointerleave",u))};l.addEventListener("pointerleave",u,o)};return r.forEach(a=>{a.addEventListener("pointerenter",i,o)}),s}function No(e,t){const n=`${t}PointerCapture`;if(e.target instanceof Element&&n in e.target&&e.pointerId!==void 0)try{e.target[n](e.pointerId)}catch{}}const Vo=(e,t)=>t?e===t?!0:Vo(e,t.parentElement):!1,Zn=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,vc=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function xc(e){return vc.has(e.tagName)||e.tabIndex!==-1}const Lt=new WeakSet;function Io(e){return t=>{t.key==="Enter"&&e(t)}}function Jn(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const bc=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Io(()=>{if(Lt.has(n))return;Jn(n,"down");const o=Io(()=>{Jn(n,"up")}),s=()=>Jn(n,"cancel");n.addEventListener("keyup",o,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function Ro(e){return Zn(e)&&!Oo()}function Sc(e,t,n={}){const[r,o,s]=ko(e,n),i=a=>{const l=a.currentTarget;if(!l||!Ro(a)||Lt.has(l))return;Lt.add(l),No(a,"set");const c=t(l,a),u=(m,p)=>{l.removeEventListener("pointerup",d),l.removeEventListener("pointercancel",f),No(m,"release"),!(!Ro(m)||!Lt.has(l))&&(Lt.delete(l),typeof c=="function"&&c(m,{success:p}))},d=m=>{(m.isTrusted?Cc(m,l instanceof Element?l.getBoundingClientRect():{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight}):!1)?u(m,!1):u(m,!(l instanceof Element)||Vo(l,m.target))},f=m=>{u(m,!1)};l.addEventListener("pointerup",d,o),l.addEventListener("pointercancel",f,o),l.addEventListener("lostpointercapture",f,o)};return r.forEach(a=>{a=n.useGlobalTarget?window:a;let l=!1;a instanceof HTMLElement&&(l=!0,!xc(a)&&a.getAttribute("tabindex")===null&&(a.tabIndex=0)),a.addEventListener("pointerdown",i,o),l&&a.addEventListener("focus",c=>bc(c,o),o)}),s}function Cc(e,t){return e.clientX<t.left||e.clientX>t.right||e.clientY<t.top||e.clientY>t.bottom}const Fo=30,wc=e=>!isNaN(parseFloat(e));class Tc{constructor(t,n={}){this.version="12.5.0",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,o=!0)=>{const s=be.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),o&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=be.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=wc(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&on(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Un);const r=this.events[t].add(n);return t==="change"?()=>{r(),U.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=be.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Fo)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Fo);return wo(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Dt(e,t){return new Tc(e,t)}const Bo=g.createContext({strict:!1}),$o={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"]},ut={};for(const e in $o)ut[e]={isEnabled:t=>$o[e].some(n=>!!t[n])};function _c(e){for(const t in e)ut[t]={...ut[t],...e[t]}}const Ec=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function cn(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Ec.has(e)}let zo=e=>!cn(e);function Pc(e){e&&(zo=t=>t.startsWith("on")?!cn(t):e(t))}try{Pc(require("@emotion/is-prop-valid").default)}catch{}function Ac(e,t,n){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||(zo(o)||n===!0&&cn(o)||!t&&!cn(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}function Mc(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>(process.env.NODE_ENV!=="production"&&on(!1,"motion() is deprecated. Use motion.create() instead."),e(...r));return new Proxy(n,{get:(r,o)=>o==="create"?e:(t.has(o)||t.set(o,e(o)),t.get(o))})}const un=g.createContext({});function dn(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Ot(e){return typeof e=="string"||Array.isArray(e)}const Qn=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],er=["initial",...Qn];function fn(e){return dn(e.animate)||er.some(t=>Ot(e[t]))}function Uo(e){return!!(fn(e)||e.variants)}function Lc(e,t){if(fn(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Ot(n)?n:void 0,animate:Ot(r)?r:void 0}}return e.inherit!==!1?t:{}}function Dc(e){const{initial:t,animate:n}=Lc(e,g.useContext(un));return g.useMemo(()=>({initial:t,animate:n}),[Xo(t),Xo(n)])}function Xo(e){return Array.isArray(e)?e.join(" "):e}const Oc=Symbol.for("motionComponentSymbol");function dt(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function kc(e,t,n){return g.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):dt(n)&&(n.current=r))},[t])}const tr=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Wo="data-"+tr("framerAppearId"),Ko=g.createContext({});function jc(e,t,n,r,o){var s,i;const{visualElement:a}=g.useContext(un),l=g.useContext(Bo),c=g.useContext(Fn),u=g.useContext(Co).reducedMotion,d=g.useRef(null);r=r||l.renderer,!d.current&&r&&(d.current=r(e,{visualState:t,parent:a,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u}));const f=d.current,m=g.useContext(Ko);f&&!f.projection&&o&&(f.type==="html"||f.type==="svg")&&Nc(d.current,n,o,m);const p=g.useRef(!1);g.useInsertionEffect(()=>{f&&p.current&&f.update(n,c)});const y=n[Wo],S=g.useRef(!!y&&!(!((s=window.MotionHandoffIsComplete)===null||s===void 0)&&s.call(window,y))&&((i=window.MotionHasOptimisedAnimation)===null||i===void 0?void 0:i.call(window,y)));return oc(()=>{f&&(p.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),Yn.render(f.render),S.current&&f.animationState&&f.animationState.animateChanges())}),g.useEffect(()=>{f&&(!S.current&&f.animationState&&f.animationState.animateChanges(),S.current&&(queueMicrotask(()=>{var v;(v=window.MotionHandoffMarkAsComplete)===null||v===void 0||v.call(window,y)}),S.current=!1))}),f}function Nc(e,t,n,r){const{layoutId:o,layout:s,drag:i,dragConstraints:a,layoutScroll:l,layoutRoot:c}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Go(e.parent)),e.projection.setOptions({layoutId:o,layout:s,alwaysMeasureLayout:!!i||a&&dt(a),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:c})}function Go(e){if(e)return e.options.allowProjection!==!1?e.projection:Go(e.parent)}function Vc({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:o}){var s,i;e&&_c(e);function a(c,u){let d;const f={...g.useContext(Co),...c,layoutId:Ic(c)},{isStatic:m}=f,p=Dc(c),y=r(c,m);if(!m&&Rn){Rc(f,e);const S=Fc(f);d=S.MeasureLayout,p.visualElement=jc(o,y,f,t,S.ProjectionNode)}return x.jsxs(un.Provider,{value:p,children:[d&&p.visualElement?x.jsx(d,{visualElement:p.visualElement,...f}):null,n(o,c,kc(y,p.visualElement,u),y,m,p.visualElement)]})}a.displayName=`motion.${typeof o=="string"?o:`create(${(i=(s=o.displayName)!==null&&s!==void 0?s:o.name)!==null&&i!==void 0?i:""})`}`;const l=g.forwardRef(a);return l[Oc]=o,l}function Ic({layoutId:e}){const t=g.useContext(So).id;return t&&e!==void 0?t+"-"+e:e}function Rc(e,t){const n=g.useContext(Bo).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?lt(!1,r):je(!1,r)}}function Fc(e){const{drag:t,layout:n}=ut;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const qo=e=>t=>typeof t=="string"&&t.startsWith(e),nr=qo("--"),Bc=qo("var(--"),rr=e=>Bc(e)?$c.test(e.split("/*")[0].trim()):!1,$c=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,kt={};function zc(e){for(const t in e)kt[t]=e[t],nr(t)&&(kt[t].isCSSVariable=!0)}const ft=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ge=new Set(ft);function Ho(e,{layout:t,layoutId:n}){return Ge.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!kt[e]||e==="opacity")}const se=e=>!!(e&&e.getVelocity),Yo=(e,t)=>t&&typeof e=="number"?t.transform(e):e,_e=(e,t,n)=>n>t?t:n<e?e:n,ht={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},jt={...ht,transform:e=>_e(0,1,e)},hn={...ht,default:1},Nt=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ve=Nt("deg"),Se=Nt("%"),D=Nt("px"),Uc=Nt("vh"),Xc=Nt("vw"),Zo={...Se,parse:e=>Se.parse(e)/100,transform:e=>Se.transform(e*100)},Wc={borderWidth:D,borderTopWidth:D,borderRightWidth:D,borderBottomWidth:D,borderLeftWidth:D,borderRadius:D,radius:D,borderTopLeftRadius:D,borderTopRightRadius:D,borderBottomRightRadius:D,borderBottomLeftRadius:D,width:D,maxWidth:D,height:D,maxHeight:D,top:D,right:D,bottom:D,left:D,padding:D,paddingTop:D,paddingRight:D,paddingBottom:D,paddingLeft:D,margin:D,marginTop:D,marginRight:D,marginBottom:D,marginLeft:D,backgroundPositionX:D,backgroundPositionY:D},Kc={rotate:Ve,rotateX:Ve,rotateY:Ve,rotateZ:Ve,scale:hn,scaleX:hn,scaleY:hn,scaleZ:hn,skew:Ve,skewX:Ve,skewY:Ve,distance:D,translateX:D,translateY:D,translateZ:D,x:D,y:D,z:D,perspective:D,transformPerspective:D,opacity:jt,originX:Zo,originY:Zo,originZ:D},Jo={...ht,transform:Math.round},or={...Wc,...Kc,zIndex:Jo,size:D,fillOpacity:jt,strokeOpacity:jt,numOctaves:Jo},Gc={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},qc=ft.length;function Hc(e,t,n){let r="",o=!0;for(let s=0;s<qc;s++){const i=ft[s],a=e[i];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(i.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=Yo(a,or[i]);if(!l){o=!1;const u=Gc[i]||i;r+=`${u}(${c}) `}n&&(t[i]=c)}}return r=r.trim(),n?r=n(t,o?"":r):o&&(r="none"),r}function sr(e,t,n){const{style:r,vars:o,transformOrigin:s}=e;let i=!1,a=!1;for(const l in t){const c=t[l];if(Ge.has(l)){i=!0;continue}else if(nr(l)){o[l]=c;continue}else{const u=Yo(c,or[l]);l.startsWith("origin")?(a=!0,s[l]=u):r[l]=u}}if(t.transform||(i||n?r.transform=Hc(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=s;r.transformOrigin=`${l} ${c} ${u}`}}const ir=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Qo(e,t,n){for(const r in t)!se(t[r])&&!Ho(r,n)&&(e[r]=t[r])}function Yc({transformTemplate:e},t){return g.useMemo(()=>{const n=ir();return sr(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Zc(e,t){const n=e.style||{},r={};return Qo(r,n,e),Object.assign(r,Yc(e,t)),r}function Jc(e,t){const n={},r=Zc(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 Qc=["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 ar(e){return typeof e!="string"||e.includes("-")?!1:!!(Qc.indexOf(e)>-1||/[A-Z]/u.test(e))}const eu={offset:"stroke-dashoffset",array:"stroke-dasharray"},tu={offset:"strokeDashoffset",array:"strokeDasharray"};function nu(e,t,n=1,r=0,o=!0){e.pathLength=1;const s=o?eu:tu;e[s.offset]=D.transform(-r);const i=D.transform(t),a=D.transform(n);e[s.array]=`${i} ${a}`}function es(e,t,n){return typeof e=="string"?e:D.transform(t+n*e)}function ru(e,t,n){const r=es(t,e.x,e.width),o=es(n,e.y,e.height);return`${r} ${o}`}function lr(e,{attrX:t,attrY:n,attrScale:r,originX:o,originY:s,pathLength:i,pathSpacing:a=1,pathOffset:l=0,...c},u,d){if(sr(e,c,d),u){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:m,dimensions:p}=e;f.transform&&(p&&(m.transform=f.transform),delete f.transform),p&&(o!==void 0||s!==void 0||m.transform)&&(m.transformOrigin=ru(p,o!==void 0?o:.5,s!==void 0?s:.5)),t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),i!==void 0&&nu(f,i,a,l,!1)}const ts=()=>({...ir(),attrs:{}}),cr=e=>typeof e=="string"&&e.toLowerCase()==="svg";function ou(e,t,n,r){const o=g.useMemo(()=>{const s=ts();return lr(s,t,cr(r),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};Qo(s,e.style,e),o.style={...s,...o.style}}return o}function su(e=!1){return(n,r,o,{latestValues:s},i)=>{const l=(ar(n)?ou:Jc)(r,s,i,n),c=Ac(r,typeof n=="string",e),u=n!==g.Fragment?{...c,...l,ref:o}:{},{children:d}=r,f=g.useMemo(()=>se(d)?d.get():d,[d]);return g.createElement(n,{...u,children:f})}}function ns(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function ur(e,t,n,r){if(typeof t=="function"){const[o,s]=ns(r);t=t(n!==void 0?n:e.custom,o,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[o,s]=ns(r);t=t(n!==void 0?n:e.custom,o,s)}return t}const dr=e=>Array.isArray(e),iu=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),au=e=>dr(e)?e[e.length-1]||0:e;function pn(e){const t=se(e)?e.get():e;return iu(t)?t.toValue():t}function lu({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,o,s){const i={latestValues:cu(r,o,s,e),renderState:t()};return n&&(i.onMount=a=>n({props:r,current:a,...i}),i.onUpdate=a=>n(a)),i}const rs=e=>(t,n)=>{const r=g.useContext(un),o=g.useContext(Fn),s=()=>lu(e,t,r,o);return n?s():rc(s)};function cu(e,t,n,r){const o={},s=r(e,{});for(const f in s)o[f]=pn(s[f]);let{initial:i,animate:a}=e;const l=fn(e),c=Uo(e);t&&c&&!l&&e.inherit!==!1&&(i===void 0&&(i=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||i===!1;const d=u?a:i;if(d&&typeof d!="boolean"&&!dn(d)){const f=Array.isArray(d)?d:[d];for(let m=0;m<f.length;m++){const p=ur(e,f[m]);if(p){const{transitionEnd:y,transition:S,...v}=p;for(const b in v){let w=v[b];if(Array.isArray(w)){const M=u?w.length-1:0;w=w[M]}w!==null&&(o[b]=w)}for(const b in y)o[b]=y[b]}}}return o}function fr(e,t,n){var r;const{style:o}=e,s={};for(const i in o)(se(o[i])||t.style&&se(t.style[i])||Ho(i,e)||((r=n==null?void 0:n.getValue(i))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(s[i]=o[i]);return s}const uu={useVisualState:rs({scrapeMotionValuesFromProps:fr,createRenderState:ir})};function os(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}function ss(e,{style:t,vars:n},r,o){Object.assign(e.style,t,o&&o.getProjectionStyles(r));for(const s in n)e.style.setProperty(s,n[s])}const is=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 as(e,t,n,r){ss(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(is.has(o)?o:tr(o),t.attrs[o])}function ls(e,t,n){const r=fr(e,t,n);for(const o in e)if(se(e[o])||se(t[o])){const s=ft.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[s]=e[o]}return r}const cs=["x","y","width","height","cx","cy","r"],du={useVisualState:rs({scrapeMotionValuesFromProps:ls,createRenderState:ts,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:o})=>{if(!n)return;let s=!!e.drag;if(!s){for(const a in o)if(Ge.has(a)){s=!0;break}}if(!s)return;let i=!t;if(t)for(let a=0;a<cs.length;a++){const l=cs[a];e[l]!==t[l]&&(i=!0)}i&&U.read(()=>{os(n,r),U.render(()=>{lr(r,o,cr(n.tagName),e.transformTemplate),as(n,r)})})}})};function fu(e,t){return function(r,{forwardMotionProps:o}={forwardMotionProps:!1}){const i={...ar(r)?du:uu,preloadedFeatures:e,useRender:su(o),createVisualElement:t,Component:r};return Vc(i)}}function Vt(e,t,n){const r=e.getProps();return ur(r,t,n!==void 0?n:r.custom,e)}const us=new Set(["width","height","top","left","right","bottom",...ft]);function hu(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Dt(n))}function pu(e,t){const n=Vt(e,t);let{transitionEnd:r={},transition:o={},...s}=n||{};s={...s,...r};for(const i in s){const a=au(s[i]);hu(e,i,a)}}function mu(e){return!!(se(e)&&e.add)}function hr(e,t){const n=e.getValue("willChange");if(mu(n))return n.add(t)}function ds(e){return e.props[Wo]}const fs=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,gu=1e-7,yu=12;function vu(e,t,n,r,o){let s,i,a=0;do i=t+(n-t)/2,s=fs(i,r,o)-e,s>0?n=i:t=i;while(Math.abs(s)>gu&&++a<yu);return i}function It(e,t,n,r){if(e===t&&n===r)return de;const o=s=>vu(s,0,1,e,n);return s=>s===0||s===1?s:fs(o(s),t,r)}const hs=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,ps=e=>t=>1-e(1-t),ms=It(.33,1.53,.69,.99),pr=ps(ms),gs=hs(pr),ys=e=>(e*=2)<1?.5*pr(e):.5*(2-Math.pow(2,-10*(e-1))),mr=e=>1-Math.sin(Math.acos(e)),vs=ps(mr),xs=hs(mr),bs=e=>/^0[^.\s]+$/u.test(e);function xu(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||bs(e):!0}const Rt=e=>Math.round(e*1e5)/1e5,gr=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function bu(e){return e==null}const Su=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,yr=(e,t)=>n=>!!(typeof n=="string"&&Su.test(n)&&n.startsWith(e)||t&&!bu(n)&&Object.prototype.hasOwnProperty.call(n,t)),Ss=(e,t,n)=>r=>{if(typeof r!="string")return r;const[o,s,i,a]=r.match(gr);return{[e]:parseFloat(o),[t]:parseFloat(s),[n]:parseFloat(i),alpha:a!==void 0?parseFloat(a):1}},Cu=e=>_e(0,255,e),vr={...ht,transform:e=>Math.round(Cu(e))},qe={test:yr("rgb","red"),parse:Ss("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+vr.transform(e)+", "+vr.transform(t)+", "+vr.transform(n)+", "+Rt(jt.transform(r))+")"};function wu(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const xr={test:yr("#"),parse:wu,transform:qe.transform},pt={test:yr("hsl","hue"),parse:Ss("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Se.transform(Rt(t))+", "+Se.transform(Rt(n))+", "+Rt(jt.transform(r))+")"},ie={test:e=>qe.test(e)||xr.test(e)||pt.test(e),parse:e=>qe.test(e)?qe.parse(e):pt.test(e)?pt.parse(e):xr.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?qe.transform(e):pt.transform(e)},Tu=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function _u(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(gr))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(Tu))===null||n===void 0?void 0:n.length)||0)>0}const Cs="number",ws="color",Eu="var",Pu="var(",Ts="${}",Au=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Ft(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let s=0;const a=t.replace(Au,l=>(ie.test(l)?(r.color.push(s),o.push(ws),n.push(ie.parse(l))):l.startsWith(Pu)?(r.var.push(s),o.push(Eu),n.push(l)):(r.number.push(s),o.push(Cs),n.push(parseFloat(l))),++s,Ts)).split(Ts);return{values:n,split:a,indexes:r,types:o}}function _s(e){return Ft(e).values}function Es(e){const{split:t,types:n}=Ft(e),r=t.length;return o=>{let s="";for(let i=0;i<r;i++)if(s+=t[i],o[i]!==void 0){const a=n[i];a===Cs?s+=Rt(o[i]):a===ws?s+=ie.transform(o[i]):s+=o[i]}return s}}const Mu=e=>typeof e=="number"?0:e;function Lu(e){const t=_s(e);return Es(e)(t.map(Mu))}const Ie={test:_u,parse:_s,createTransformer:Es,getAnimatableNone:Lu},Du=new Set(["brightness","contrast","saturate","opacity"]);function Ou(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(gr)||[];if(!r)return e;const o=n.replace(r,"");let s=Du.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+o+")"}const ku=/\b([a-z-]*)\(.*?\)/gu,br={...Ie,getAnimatableNone:e=>{const t=e.match(ku);return t?t.map(Ou).join(" "):e}},ju={...or,color:ie,backgroundColor:ie,outlineColor:ie,fill:ie,stroke:ie,borderColor:ie,borderTopColor:ie,borderRightColor:ie,borderBottomColor:ie,borderLeftColor:ie,filter:br,WebkitFilter:br},Ps=e=>ju[e];function As(e,t){let n=Ps(e);return n!==br&&(n=Ie),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Nu=new Set(["auto","none","0"]);function Vu(e,t,n){let r=0,o;for(;r<e.length&&!o;){const s=e[r];typeof s=="string"&&!Nu.has(s)&&Ft(s).values.length&&(o=e[r]),r++}if(o&&n)for(const s of t)e[s]=As(n,o)}const He=e=>e*180/Math.PI,Sr=e=>{const t=He(Math.atan2(e[1],e[0]));return Cr(t)},Iu={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Sr,rotateZ:Sr,skewX:e=>He(Math.atan(e[1])),skewY:e=>He(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Cr=e=>(e=e%360,e<0&&(e+=360),e),Ms=Sr,Ls=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Ds=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Ru={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ls,scaleY:Ds,scale:e=>(Ls(e)+Ds(e))/2,rotateX:e=>Cr(He(Math.atan2(e[6],e[5]))),rotateY:e=>Cr(He(Math.atan2(-e[2],e[0]))),rotateZ:Ms,rotate:Ms,skewX:e=>He(Math.atan(e[4])),skewY:e=>He(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Os(e){return e.includes("scale")?1:0}function wr(e,t){if(!e||e==="none")return Os(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,o;if(n)r=Ru,o=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Iu,o=a}if(!o)return Os(t);const s=r[t],i=o[1].split(",").map(Bu);return typeof s=="function"?s(i):i[s]}const Fu=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return wr(n,t)};function Bu(e){return parseFloat(e.trim())}const ks=e=>e===ht||e===D,$u=new Set(["x","y","z"]),zu=ft.filter(e=>!$u.has(e));function Uu(e){const t=[];return zu.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const mt={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>wr(t,"x"),y:(e,{transform:t})=>wr(t,"y")};mt.translateX=mt.x,mt.translateY=mt.y;const Ye=new Set;let Tr=!1,_r=!1;function js(){if(_r){const e=Array.from(Ye).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const o=Uu(r);o.length&&(n.set(r,o),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const o=n.get(r);o&&o.forEach(([s,i])=>{var a;(a=r.getValue(s))===null||a===void 0||a.set(i)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}_r=!1,Tr=!1,Ye.forEach(e=>e.complete()),Ye.clear()}function Ns(){Ye.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(_r=!0)})}function Xu(){Ns(),js()}class Er{constructor(t,n,r,o,s,i=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=o,this.element=s,this.isAsync=i}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Ye.add(this),Tr||(Tr=!0,U.read(Ns),U.resolveKeyframes(js))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:o}=this;for(let s=0;s<t.length;s++)if(t[s]===null)if(s===0){const i=o==null?void 0:o.get(),a=t[t.length-1];if(i!==void 0)t[0]=i;else if(r&&n){const l=r.readValue(n,a);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=a),o&&i===void 0&&o.set(t[0])}else t[s]=t[s-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Ye.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Ye.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Vs=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Wu=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ku(e){const t=Wu.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${n??r}`,o]}const Gu=4;function Is(e,t,n=1){je(n<=Gu,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,o]=Ku(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const i=s.trim();return Vs(i)?parseFloat(i):i}return rr(o)?Is(o,t,n+1):o}const Rs=e=>t=>t.test(e),Fs=[ht,D,Se,Ve,Xc,Uc,{test:e=>e==="auto",parse:e=>e}],Bs=e=>Fs.find(Rs(e));class $s extends Er{constructor(t,n,r,o,s){super(t,n,r,o,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let c=t[l];if(typeof c=="string"&&(c=c.trim(),rr(c))){const u=Is(c,n.current);u!==void 0&&(t[l]=u),l===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!us.has(r)||t.length!==2)return;const[o,s]=t,i=Bs(o),a=Bs(s);if(i!==a)if(ks(i)&&ks(a))for(let l=0;l<t.length;l++){const c=t[l];typeof c=="string"&&(t[l]=parseFloat(c))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let o=0;o<t.length;o++)xu(t[o])&&r.push(o);r.length&&Vu(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=mt[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const o=n[n.length-1];o!==void 0&&t.getValue(r,o).jump(o,!1)}measureEndState(){var t;const{element:n,name:r,unresolvedKeyframes:o}=this;if(!n||!n.current)return;const s=n.getValue(r);s&&s.jump(this.measuredOrigin,!1);const i=o.length-1,a=o[i];o[i]=mt[r](n.measureViewportBox(),window.getComputedStyle(n.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([l,c])=>{n.getValue(l).set(c)}),this.resolveNoneKeyframes()}}const zs=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Ie.test(e)||e==="0")&&!e.startsWith("url("));function qu(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Hu(e,t,n,r){const o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;const s=e[e.length-1],i=zs(o,t),a=zs(s,t);return lt(i===a,`You are trying to animate ${t} from "${o}" to "${s}". ${o} is not an animatable value - to enable this animation set ${o} to a value animatable to ${s} via the \`style\` property.`),!i||!a?!1:qu(e)||(n==="spring"||Kn(n))&&r}const Yu=e=>e!==null;function mn(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(Yu),s=t&&n!=="loop"&&t%2===1?0:o.length-1;return!s||r===void 0?o[s]:r}const Zu=40;class Us{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:o=0,repeatDelay:s=0,repeatType:i="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=be.now(),this.options={autoplay:t,delay:n,type:r,repeat:o,repeatDelay:s,repeatType:i,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>Zu?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&Xu(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=be.now(),this.hasAttemptedResolve=!0;const{name:r,type:o,velocity:s,delay:i,onComplete:a,onUpdate:l,isGenerator:c}=this.options;if(!c&&!Hu(t,r,o,s))if(i)this.options.duration=0;else{l&&l(mn(t,this.options,n)),a&&a(),this.resolveFinishedPromise();return}const u=this.initPlayback(t,n);u!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...u},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear")}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const K=(e,t,n)=>e+(t-e)*n;function Pr(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Ju({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let o=0,s=0,i=0;if(!t)o=s=i=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;o=Pr(l,a,e+1/3),s=Pr(l,a,e),i=Pr(l,a,e-1/3)}return{red:Math.round(o*255),green:Math.round(s*255),blue:Math.round(i*255),alpha:r}}function gn(e,t){return n=>n>0?t:e}const Ar=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},Qu=[xr,qe,pt],ed=e=>Qu.find(t=>t.test(e));function Xs(e){const t=ed(e);if(lt(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let n=t.parse(e);return t===pt&&(n=Ju(n)),n}const Ws=(e,t)=>{const n=Xs(e),r=Xs(t);if(!n||!r)return gn(e,t);const o={...n};return s=>(o.red=Ar(n.red,r.red,s),o.green=Ar(n.green,r.green,s),o.blue=Ar(n.blue,r.blue,s),o.alpha=K(n.alpha,r.alpha,s),qe.transform(o))},td=(e,t)=>n=>t(e(n)),Bt=(...e)=>e.reduce(td),Mr=new Set(["none","hidden"]);function nd(e,t){return Mr.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function rd(e,t){return n=>K(e,t,n)}function Lr(e){return typeof e=="number"?rd:typeof e=="string"?rr(e)?gn:ie.test(e)?Ws:id:Array.isArray(e)?Ks:typeof e=="object"?ie.test(e)?Ws:od:gn}function Ks(e,t){const n=[...e],r=n.length,o=e.map((s,i)=>Lr(s)(s,t[i]));return s=>{for(let i=0;i<r;i++)n[i]=o[i](s);return n}}function od(e,t){const n={...e,...t},r={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(r[o]=Lr(e[o])(e[o],t[o]));return o=>{for(const s in r)n[s]=r[s](o);return n}}function sd(e,t){var n;const r=[],o={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const i=t.types[s],a=e.indexes[i][o[i]],l=(n=e.values[a])!==null&&n!==void 0?n:0;r[s]=l,o[i]++}return r}const id=(e,t)=>{const n=Ie.createTransformer(t),r=Ft(e),o=Ft(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?Mr.has(e)&&!o.values.length||Mr.has(t)&&!r.values.length?nd(e,t):Bt(Ks(sd(r,o),o.values),n):(lt(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),gn(e,t))};function Gs(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?K(e,t,n):Lr(e)(e,t)}const ad=5;function qs(e,t,n){const r=Math.max(t-ad,0);return wo(n-e(r),t-r)}const G={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Hs=.001;function ld({duration:e=G.duration,bounce:t=G.bounce,velocity:n=G.velocity,mass:r=G.mass}){let o,s;lt(e<=xe(G.maxDuration),"Spring duration must be 10 seconds or less");let i=1-t;i=_e(G.minDamping,G.maxDamping,i),e=_e(G.minDuration,G.maxDuration,Te(e)),i<1?(o=c=>{const u=c*i,d=u*e,f=u-n,m=Dr(c,i),p=Math.exp(-d);return Hs-f/m*p},s=c=>{const d=c*i*e,f=d*n+n,m=Math.pow(i,2)*Math.pow(c,2)*e,p=Math.exp(-d),y=Dr(Math.pow(c,2),i);return(-o(c)+Hs>0?-1:1)*((f-m)*p)/y}):(o=c=>{const u=Math.exp(-c*e),d=(c-n)*e+1;return-.001+u*d},s=c=>{const u=Math.exp(-c*e),d=(n-c)*(e*e);return u*d});const a=5/e,l=ud(o,s,a);if(e=xe(e),isNaN(l))return{stiffness:G.stiffness,damping:G.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:i*2*Math.sqrt(r*c),duration:e}}}const cd=12;function ud(e,t,n){let r=n;for(let o=1;o<cd;o++)r=r-e(r)/t(r);return r}function Dr(e,t){return e*Math.sqrt(1-t*t)}const dd=["duration","bounce"],fd=["stiffness","damping","mass"];function Ys(e,t){return t.some(n=>e[n]!==void 0)}function hd(e){let t={velocity:G.velocity,stiffness:G.stiffness,damping:G.damping,mass:G.mass,isResolvedFromDuration:!1,...e};if(!Ys(e,fd)&&Ys(e,dd))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),o=r*r,s=2*_e(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:G.mass,stiffness:o,damping:s}}else{const n=ld(e);t={...t,...n,mass:G.mass},t.isResolvedFromDuration=!0}return t}function Zs(e=G.visualDuration,t=G.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:o}=n;const s=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:l,damping:c,mass:u,duration:d,velocity:f,isResolvedFromDuration:m}=hd({...n,velocity:-Te(n.velocity||0)}),p=f||0,y=c/(2*Math.sqrt(l*u)),S=i-s,v=Te(Math.sqrt(l/u)),b=Math.abs(S)<5;r||(r=b?G.restSpeed.granular:G.restSpeed.default),o||(o=b?G.restDelta.granular:G.restDelta.default);let w;if(y<1){const _=Dr(v,y);w=L=>{const k=Math.exp(-y*v*L);return i-k*((p+y*v*S)/_*Math.sin(_*L)+S*Math.cos(_*L))}}else if(y===1)w=_=>i-Math.exp(-v*_)*(S+(p+v*S)*_);else{const _=v*Math.sqrt(y*y-1);w=L=>{const k=Math.exp(-y*v*L),A=Math.min(_*L,300);return i-k*((p+y*v*S)*Math.sinh(A)+_*S*Math.cosh(A))/_}}const M={calculatedDuration:m&&d||null,next:_=>{const L=w(_);if(m)a.done=_>=d;else{let k=0;y<1&&(k=_===0?xe(p):qs(w,_,L));const A=Math.abs(k)<=r,V=Math.abs(i-L)<=o;a.done=A&&V}return a.value=a.done?i:L,a},toString:()=>{const _=Math.min(_o(M),Wn),L=Po(k=>M.next(_*k).value,_,30);return _+"ms "+L}};return M}function Js({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:s=500,modifyTarget:i,min:a,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],f={done:!1,value:d},m=A=>a!==void 0&&A<a||l!==void 0&&A>l,p=A=>a===void 0?l:l===void 0||Math.abs(a-A)<Math.abs(l-A)?a:l;let y=n*t;const S=d+y,v=i===void 0?S:i(S);v!==S&&(y=v-d);const b=A=>-y*Math.exp(-A/r),w=A=>v+b(A),M=A=>{const V=b(A),E=w(A);f.done=Math.abs(V)<=c,f.value=f.done?v:E};let _,L;const k=A=>{m(f.value)&&(_=A,L=Zs({keyframes:[f.value,p(f.value)],velocity:qs(w,A,f.value),damping:o,stiffness:s,restDelta:c,restSpeed:u}))};return k(0),{calculatedDuration:null,next:A=>{let V=!1;return!L&&_===void 0&&(V=!0,M(A),k(A)),_!==void 0&&A>=_?L.next(A-_):(!V&&M(A),f)}}}const pd=It(.42,0,1,1),md=It(0,0,.58,1),Qs=It(.42,0,.58,1),gd=e=>Array.isArray(e)&&typeof e[0]!="number",ei={linear:de,easeIn:pd,easeInOut:Qs,easeOut:md,circIn:mr,circInOut:xs,circOut:vs,backIn:pr,backInOut:gs,backOut:ms,anticipate:ys},ti=e=>{if(Gn(e)){je(e.length===4,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,o]=e;return It(t,n,r,o)}else if(typeof e=="string")return je(ei[e]!==void 0,`Invalid easing type '${e}'`),ei[e];return e};function yd(e,t,n){const r=[],o=n||Gs,s=e.length-1;for(let i=0;i<s;i++){let a=o(e[i],e[i+1]);if(t){const l=Array.isArray(t)?t[i]||de:t;a=Bt(l,a)}r.push(a)}return r}function vd(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const s=e.length;if(je(s===t.length,"Both input and output ranges must be the same length"),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];const i=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=yd(t,r,o),l=a.length,c=u=>{if(i&&u<e[0])return t[0];let d=0;if(l>1)for(;d<e.length-2&&!(u<e[d+1]);d++);const f=ct(e[d],e[d+1],u);return a[d](f)};return n?u=>c(_e(e[0],e[s-1],u)):c}function xd(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=ct(0,t,r);e.push(K(n,1,o))}}function bd(e){const t=[0];return xd(t,e.length-1),t}function Sd(e,t){return e.map(n=>n*t)}function Cd(e,t){return e.map(()=>t||Qs).splice(0,e.length-1)}function $t({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=gd(r)?r.map(ti):ti(r),s={done:!1,value:t[0]},i=Sd(n&&n.length===t.length?n:bd(t),e),a=vd(i,t,{ease:Array.isArray(o)?o:Cd(t,o)});return{calculatedDuration:e,next:l=>(s.value=a(l),s.done=l>=e,s)}}const wd=e=>{const t=({timestamp:n})=>e(n);return{start:()=>U.update(t,!0),stop:()=>Ne(t),now:()=>re.isProcessing?re.timestamp:be.now()}},Td={decay:Js,inertia:Js,tween:$t,keyframes:$t,spring:Zs},_d=e=>e/100;class Or extends Us{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:n,motionValue:r,element:o,keyframes:s}=this.options,i=(o==null?void 0:o.KeyframeResolver)||Er,a=(l,c)=>this.onKeyframesResolved(l,c);this.resolver=new i(s,a,n,r,o),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:s,velocity:i=0}=this.options,a=Kn(n)?n:Td[n]||$t;let l,c;process.env.NODE_ENV!=="production"&&a!==$t&&je(t.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${t}`),a!==$t&&typeof t[0]!="number"&&(l=Bt(_d,Gs(t[0],t[1])),t=[0,100]);const u=a({...this.options,keyframes:t});s==="mirror"&&(c=a({...this.options,keyframes:[...t].reverse(),velocity:-i})),u.calculatedDuration===null&&(u.calculatedDuration=_o(u));const{calculatedDuration:d}=u,f=d+o,m=f*(r+1)-o;return{generator:u,mirroredGenerator:c,mapPercentToKeyframes:l,calculatedDuration:d,resolvedDuration:f,totalDuration:m}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:A}=this.options;return{done:!0,value:A[A.length-1]}}const{finalKeyframe:o,generator:s,mirroredGenerator:i,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:c,totalDuration:u,resolvedDuration:d}=r;if(this.startTime===null)return s.next(0);const{delay:f,repeat:m,repeatType:p,repeatDelay:y,onUpdate:S}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const v=this.currentTime-f*(this.speed>=0?1:-1),b=this.speed>=0?v<0:v>u;this.currentTime=Math.max(v,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=u);let w=this.currentTime,M=s;if(m){const A=Math.min(this.currentTime,u)/d;let V=Math.floor(A),E=A%1;!E&&A>=1&&(E=1),E===1&&V--,V=Math.min(V,m+1),!!(V%2)&&(p==="reverse"?(E=1-E,y&&(E-=y/d)):p==="mirror"&&(M=i)),w=_e(0,1,E)*d}const _=b?{done:!1,value:l[0]}:M.next(w);a&&(_.value=a(_.value));let{done:L}=_;!b&&c!==null&&(L=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const k=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&L);return k&&o!==void 0&&(_.value=mn(l,this.options,o)),S&&S(_.value),k&&this.finish(),_}get duration(){const{resolved:t}=this;return t?Te(t.calculatedDuration):0}get time(){return Te(this.currentTime)}set time(t){t=xe(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=Te(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=wd,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),n&&n();const o=this.driver.now();this.holdTime!==null?this.startTime=o-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=o):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const Ed=new Set(["opacity","clipPath","filter","transform"]);function Pd(e,t,n,{delay:r=0,duration:o=300,repeat:s=0,repeatType:i="loop",ease:a="easeInOut",times:l}={}){const c={[t]:n};l&&(c.offset=l);const u=Mo(a,o);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:r,duration:o,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:s+1,direction:i==="reverse"?"alternate":"normal"})}const Ad=zn(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),yn=10,Md=2e4;function Ld(e){return Kn(e.type)||e.type==="spring"||!Ao(e.ease)}function Dd(e,t){const n=new Or({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const o=[];let s=0;for(;!r.done&&s<Md;)r=n.sample(s),o.push(r.value),s+=yn;return{times:void 0,keyframes:o,duration:s-yn,ease:"linear"}}const ni={anticipate:ys,backInOut:gs,circInOut:xs};function Od(e){return e in ni}class ri extends Us{constructor(t){super(t);const{name:n,motionValue:r,element:o,keyframes:s}=this.options;this.resolver=new $s(s,(i,a)=>this.onKeyframesResolved(i,a),n,r,o),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:o,ease:s,type:i,motionValue:a,name:l,startTime:c}=this.options;if(!a.owner||!a.owner.current)return!1;if(typeof s=="string"&&sn()&&Od(s)&&(s=ni[s]),Ld(this.options)){const{onComplete:d,onUpdate:f,motionValue:m,element:p,...y}=this.options,S=Dd(t,y);t=S.keyframes,t.length===1&&(t[1]=t[0]),r=S.duration,o=S.times,s=S.ease,i="keyframes"}const u=Pd(a.owner.current,l,t,{...this.options,duration:r,times:o,ease:s});return u.startTime=c??this.calcStartTime(),this.pendingTimeline?(Eo(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:d}=this.options;a.set(mn(t,this.options,n)),d&&d(),this.cancel(),this.resolveFinishedPromise()},{animation:u,duration:r,times:o,type:i,ease:s,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return Te(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return Te(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=xe(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return de;const{animation:r}=n;Eo(r,t)}return de}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:o,type:s,ease:i,times:a}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:c,onUpdate:u,onComplete:d,element:f,...m}=this.options,p=new Or({...m,keyframes:r,duration:o,type:s,ease:i,times:a,isGenerator:!0}),y=xe(this.time);c.setWithVelocity(p.sample(y-yn).value,p.sample(y).value,yn)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:o,repeatType:s,damping:i,type:a}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=n.owner.getProps();return Ad()&&r&&Ed.has(r)&&!l&&!c&&!o&&s!=="mirror"&&i!==0&&a!=="inertia"}}const kd={type:"spring",stiffness:500,damping:25,restSpeed:10},jd=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Nd={type:"keyframes",duration:.8},Vd={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Id=(e,{keyframes:t})=>t.length>2?Nd:Ge.has(e)?e.startsWith("scale")?jd(t[1]):kd:Vd;function Rd({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:s,repeatType:i,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const kr=(e,t,n,r={},o,s)=>i=>{const a=Xn(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-xe(l);let u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:f=>{t.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{i(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:s?void 0:o};Rd(a)||(u={...u,...Id(e,u)}),u.duration&&(u.duration=xe(u.duration)),u.repeatDelay&&(u.repeatDelay=xe(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(u.duration=0,u.delay===0&&(d=!0)),u.allowFlatten=!a.type&&!a.ease,d&&!s&&t.get()!==void 0){const f=mn(u.keyframes,a);if(f!==void 0)return U.update(()=>{u.onUpdate(f),u.onComplete()}),new cc([])}return!s&&ri.supports(u)?new ri(u):new Or(u)};function Fd({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function oi(e,t,{delay:n=0,transitionOverride:r,type:o}={}){var s;let{transition:i=e.getDefaultTransition(),transitionEnd:a,...l}=t;r&&(i=r);const c=[],u=o&&e.animationState&&e.animationState.getState()[o];for(const d in l){const f=e.getValue(d,(s=e.latestValues[d])!==null&&s!==void 0?s:null),m=l[d];if(m===void 0||u&&Fd(u,d))continue;const p={delay:n,...Xn(i||{},d)};let y=!1;if(window.MotionHandoffAnimation){const v=ds(e);if(v){const b=window.MotionHandoffAnimation(v,d,U);b!==null&&(p.startTime=b,y=!0)}}hr(e,d),f.start(kr(d,f,m,e.shouldReduceMotion&&us.has(d)?{type:!1}:p,e,y));const S=f.animation;S&&c.push(S)}return a&&Promise.all(c).then(()=>{U.update(()=>{a&&pu(e,a)})}),c}function jr(e,t,n={}){var r;const o=Vt(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=o||{};n.transitionOverride&&(s=n.transitionOverride);const i=o?()=>Promise.all(oi(e,o,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:d,staggerDirection:f}=s;return Bd(e,t,u+c,d,f,n)}:()=>Promise.resolve(),{when:l}=s;if(l){const[c,u]=l==="beforeChildren"?[i,a]:[a,i];return c().then(()=>u())}else return Promise.all([i(),a(n.delay)])}function Bd(e,t,n=0,r=0,o=1,s){const i=[],a=(e.variantChildren.size-1)*r,l=o===1?(c=0)=>c*r:(c=0)=>a-c*r;return Array.from(e.variantChildren).sort($d).forEach((c,u)=>{c.notify("AnimationStart",t),i.push(jr(c,t,{...s,delay:n+l(u)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(i)}function $d(e,t){return e.sortNodePosition(t)}function zd(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(s=>jr(e,s,n));r=Promise.all(o)}else if(typeof t=="string")r=jr(e,t,n);else{const o=typeof t=="function"?Vt(e,t,n.custom):t;r=Promise.all(oi(e,o,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function si(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const Ud=er.length;function ii(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?ii(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Ud;n++){const r=er[n],o=e.props[r];(Ot(o)||o===!1)&&(t[r]=o)}return t}const Xd=[...Qn].reverse(),Wd=Qn.length;function Kd(e){return t=>Promise.all(t.map(({animation:n,options:r})=>zd(e,n,r)))}function Gd(e){let t=Kd(e),n=ai(),r=!0;const o=l=>(c,u)=>{var d;const f=Vt(e,u,l==="exit"?(d=e.presenceContext)===null||d===void 0?void 0:d.custom:void 0);if(f){const{transition:m,transitionEnd:p,...y}=f;c={...c,...y,...p}}return c};function s(l){t=l(e)}function i(l){const{props:c}=e,u=ii(e.parent)||{},d=[],f=new Set;let m={},p=1/0;for(let S=0;S<Wd;S++){const v=Xd[S],b=n[v],w=c[v]!==void 0?c[v]:u[v],M=Ot(w),_=v===l?b.isActive:null;_===!1&&(p=S);let L=w===u[v]&&w!==c[v]&&M;if(L&&r&&e.manuallyAnimateOnMount&&(L=!1),b.protectedKeys={...m},!b.isActive&&_===null||!w&&!b.prevProp||dn(w)||typeof w=="boolean")continue;const k=qd(b.prevProp,w);let A=k||v===l&&b.isActive&&!L&&M||S>p&&M,V=!1;const E=Array.isArray(w)?w:[w];let X=E.reduce(o(v),{});_===!1&&(X={});const{prevResolvedValues:$={}}=b,ee={...$,...X},le=W=>{A=!0,f.has(W)&&(V=!0,f.delete(W)),b.needsAnimating[W]=!0;const C=e.getValue(W);C&&(C.liveStyle=!1)};for(const W in ee){const C=X[W],I=$[W];if(m.hasOwnProperty(W))continue;let B=!1;dr(C)&&dr(I)?B=!si(C,I):B=C!==I,B?C!=null?le(W):f.add(W):C!==void 0&&f.has(W)?le(W):b.protectedKeys[W]=!0}b.prevProp=w,b.prevResolvedValues=X,b.isActive&&(m={...m,...X}),r&&e.blockInitialAnimation&&(A=!1),A&&(!(L&&k)||V)&&d.push(...E.map(W=>({animation:W,options:{type:v}})))}if(f.size){const S={};if(typeof c.initial!="boolean"){const v=Vt(e,Array.isArray(c.initial)?c.initial[0]:c.initial);v&&v.transition&&(S.transition=v.transition)}f.forEach(v=>{const b=e.getBaseTarget(v),w=e.getValue(v);w&&(w.liveStyle=!0),S[v]=b??null}),d.push({animation:S})}let y=!!d.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(y=!1),r=!1,y?t(d):Promise.resolve()}function a(l,c){var u;if(n[l].isActive===c)return Promise.resolve();(u=e.variantChildren)===null||u===void 0||u.forEach(f=>{var m;return(m=f.animationState)===null||m===void 0?void 0:m.setActive(l,c)}),n[l].isActive=c;const d=i(l);for(const f in n)n[f].protectedKeys={};return d}return{animateChanges:i,setActive:a,setAnimateFunction:s,getState:()=>n,reset:()=>{n=ai(),r=!0}}}function qd(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!si(t,e):!1}function Ze(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ai(){return{animate:Ze(!0),whileInView:Ze(),whileHover:Ze(),whileTap:Ze(),whileDrag:Ze(),whileFocus:Ze(),exit:Ze()}}class Re{constructor(t){this.isMounted=!1,this.node=t}update(){}}class Hd extends Re{constructor(t){super(t),t.animationState||(t.animationState=Gd(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();dn(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let Yd=0;class Zd extends Re{constructor(){super(...arguments),this.id=Yd++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const o=this.node.animationState.setActive("exit",!t);n&&!t&&o.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const Jd={animation:{Feature:Hd},exit:{Feature:Zd}};function zt(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Ut(e){return{point:{x:e.pageX,y:e.pageY}}}const Qd=e=>t=>Zn(t)&&e(t,Ut(t));function Xt(e,t,n,r){return zt(e,t,Qd(n),r)}function li({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function ef({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function tf(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}const ci=1e-4,nf=1-ci,rf=1+ci,ui=.01,of=0-ui,sf=0+ui;function ae(e){return e.max-e.min}function af(e,t,n){return Math.abs(e-t)<=n}function di(e,t,n,r=.5){e.origin=r,e.originPoint=K(t.min,t.max,e.origin),e.scale=ae(n)/ae(t),e.translate=K(n.min,n.max,e.origin)-e.originPoint,(e.scale>=nf&&e.scale<=rf||isNaN(e.scale))&&(e.scale=1),(e.translate>=of&&e.translate<=sf||isNaN(e.translate))&&(e.translate=0)}function Wt(e,t,n,r){di(e.x,t.x,n.x,r?r.originX:void 0),di(e.y,t.y,n.y,r?r.originY:void 0)}function fi(e,t,n){e.min=n.min+t.min,e.max=e.min+ae(t)}function lf(e,t,n){fi(e.x,t.x,n.x),fi(e.y,t.y,n.y)}function hi(e,t,n){e.min=t.min-n.min,e.max=e.min+ae(t)}function Kt(e,t,n){hi(e.x,t.x,n.x),hi(e.y,t.y,n.y)}const pi=()=>({translate:0,scale:1,origin:0,originPoint:0}),gt=()=>({x:pi(),y:pi()}),mi=()=>({min:0,max:0}),H=()=>({x:mi(),y:mi()});function pe(e){return[e("x"),e("y")]}function Nr(e){return e===void 0||e===1}function Vr({scale:e,scaleX:t,scaleY:n}){return!Nr(e)||!Nr(t)||!Nr(n)}function Je(e){return Vr(e)||gi(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function gi(e){return yi(e.x)||yi(e.y)}function yi(e){return e&&e!=="0%"}function vn(e,t,n){const r=e-n,o=t*r;return n+o}function vi(e,t,n,r,o){return o!==void 0&&(e=vn(e,o,r)),vn(e,n,r)+t}function Ir(e,t=0,n=1,r,o){e.min=vi(e.min,t,n,r,o),e.max=vi(e.max,t,n,r,o)}function xi(e,{x:t,y:n}){Ir(e.x,t.translate,t.scale,t.originPoint),Ir(e.y,n.translate,n.scale,n.originPoint)}const bi=.999999999999,Si=1.0000000000001;function cf(e,t,n,r=!1){const o=n.length;if(!o)return;t.x=t.y=1;let s,i;for(let a=0;a<o;a++){s=n[a],i=s.projectionDelta;const{visualElement:l}=s.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&vt(e,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),i&&(t.x*=i.x.scale,t.y*=i.y.scale,xi(e,i)),r&&Je(s.latestValues)&&vt(e,s.latestValues))}t.x<Si&&t.x>bi&&(t.x=1),t.y<Si&&t.y>bi&&(t.y=1)}function yt(e,t){e.min=e.min+t,e.max=e.max+t}function Ci(e,t,n,r,o=.5){const s=K(e.min,e.max,o);Ir(e,t,n,s,r)}function vt(e,t){Ci(e.x,t.x,t.scaleX,t.scale,t.originX),Ci(e.y,t.y,t.scaleY,t.scale,t.originY)}function wi(e,t){return li(tf(e.getBoundingClientRect(),t))}function uf(e,t,n){const r=wi(e,n),{scroll:o}=t;return o&&(yt(r.x,o.offset.x),yt(r.y,o.offset.y)),r}const Ti=({current:e})=>e?e.ownerDocument.defaultView:null,_i=(e,t)=>Math.abs(e-t);function df(e,t){const n=_i(e.x,t.x),r=_i(e.y,t.y);return Math.sqrt(n**2+r**2)}class Ei{constructor(t,n,{transformPagePoint:r,contextWindow:o,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=Fr(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,m=df(d.offset,{x:0,y:0})>=3;if(!f&&!m)return;const{point:p}=d,{timestamp:y}=re;this.history.push({...p,timestamp:y});const{onStart:S,onMove:v}=this.handlers;f||(S&&S(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,d)},this.handlePointerMove=(d,f)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=Rr(f,this.transformPagePoint),U.update(this.updatePoint,!0)},this.handlePointerUp=(d,f)=>{this.end();const{onEnd:m,onSessionEnd:p,resumeAnimation:y}=this.handlers;if(this.dragSnapToOrigin&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const S=Fr(d.type==="pointercancel"?this.lastMoveEventInfo:Rr(f,this.transformPagePoint),this.history);this.startEvent&&m&&m(d,S),p&&p(d,S)},!Zn(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.contextWindow=o||window;const i=Ut(t),a=Rr(i,this.transformPagePoint),{point:l}=a,{timestamp:c}=re;this.history=[{...l,timestamp:c}];const{onSessionStart:u}=n;u&&u(t,Fr(a,this.history)),this.removeListeners=Bt(Xt(this.contextWindow,"pointermove",this.handlePointerMove),Xt(this.contextWindow,"pointerup",this.handlePointerUp),Xt(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Ne(this.updatePoint)}}function Rr(e,t){return t?{point:t(e.point)}:e}function Pi(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Fr({point:e},t){return{point:e,delta:Pi(e,Ai(t)),offset:Pi(e,ff(t)),velocity:hf(t,.1)}}function ff(e){return e[0]}function Ai(e){return e[e.length-1]}function hf(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=Ai(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>xe(t)));)n--;if(!r)return{x:0,y:0};const s=Te(o.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const i={x:(o.x-r.x)/s,y:(o.y-r.y)/s};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function pf(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?K(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?K(n,e,r.max):Math.min(e,n)),e}function Mi(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function mf(e,{top:t,left:n,bottom:r,right:o}){return{x:Mi(e.x,n,o),y:Mi(e.y,t,r)}}function Li(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 gf(e,t){return{x:Li(e.x,t.x),y:Li(e.y,t.y)}}function yf(e,t){let n=.5;const r=ae(e),o=ae(t);return o>r?n=ct(t.min,t.max-r,e.min):r>o&&(n=ct(e.min,e.max-o,t.min)),_e(0,1,n)}function vf(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Br=.35;function xf(e=Br){return e===!1?e=0:e===!0&&(e=Br),{x:Di(e,"left","right"),y:Di(e,"top","bottom")}}function Di(e,t,n){return{min:Oi(e,t),max:Oi(e,n)}}function Oi(e,t){return typeof e=="number"?e:e[t]||0}const bf=new WeakMap;class Sf{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=H(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const o=u=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Ut(u).point)},s=(u,d)=>{const{drag:f,dragPropagation:m,onDragStart:p}=this.getProps();if(f&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=mc(f),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),pe(S=>{let v=this.getAxisMotionValue(S).get()||0;if(Se.test(v)){const{projection:b}=this.visualElement;if(b&&b.layout){const w=b.layout.layoutBox[S];w&&(v=ae(w)*(parseFloat(v)/100))}}this.originPoint[S]=v}),p&&U.postRender(()=>p(u,d)),hr(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},i=(u,d)=>{const{dragPropagation:f,dragDirectionLock:m,onDirectionLock:p,onDrag:y}=this.getProps();if(!f&&!this.openDragLock)return;const{offset:S}=d;if(m&&this.currentDirection===null){this.currentDirection=Cf(S),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",d.point,S),this.updateAxis("y",d.point,S),this.visualElement.render(),y&&y(u,d)},a=(u,d)=>this.stop(u,d),l=()=>pe(u=>{var d;return this.getAnimationState(u)==="paused"&&((d=this.getAxisMotionValue(u).animation)===null||d===void 0?void 0:d.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new Ei(t,{onSessionStart:o,onStart:s,onMove:i,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:Ti(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:o}=n;this.startAnimation(o);const{onDragEnd:s}=this.getProps();s&&U.postRender(()=>s(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:o}=this.getProps();if(!r||!xn(t,o,this.currentDirection))return;const s=this.getAxisMotionValue(t);let i=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(i=pf(i,this.constraints[t],this.elastic[t])),s.set(i)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),o=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,s=this.constraints;n&&dt(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&o?this.constraints=mf(o.layoutBox,n):this.constraints=!1,this.elastic=xf(r),s!==this.constraints&&o&&this.constraints&&!this.hasMutatedConstraints&&pe(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=vf(o.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!dt(t))return!1;const r=t.current;je(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const s=uf(r,o.root,this.visualElement.getTransformPagePoint());let i=gf(o.layout.layoutBox,s);if(n){const a=n(ef(i));this.hasMutatedConstraints=!!a,a&&(i=li(a))}return i}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:s,dragSnapToOrigin:i,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=pe(u=>{if(!xn(u,n,this.currentDirection))return;let d=l&&l[u]||{};i&&(d={min:0,max:0});const f=o?200:1e6,m=o?40:1e7,p={type:"inertia",velocity:r?t[u]:0,bounceStiffness:f,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...s,...d};return this.startAxisValueAnimation(u,p)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return hr(this.visualElement,t),r.start(kr(t,r,0,n,this.visualElement,!1))}stopAnimation(){pe(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){pe(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),o=r[n];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){pe(n=>{const{drag:r}=this.getProps();if(!xn(n,r,this.currentDirection))return;const{projection:o}=this.visualElement,s=this.getAxisMotionValue(n);if(o&&o.layout){const{min:i,max:a}=o.layout.layoutBox[n];s.set(t[n]-K(i,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!dt(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};pe(i=>{const a=this.getAxisMotionValue(i);if(a&&this.constraints!==!1){const l=a.get();o[i]=yf({min:l,max:l},this.constraints[i])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),pe(i=>{if(!xn(i,t,null))return;const a=this.getAxisMotionValue(i),{min:l,max:c}=this.constraints[i];a.set(K(l,c,o[i]))})}addListeners(){if(!this.visualElement.current)return;bf.set(this.visualElement,this);const t=this.visualElement.current,n=Xt(t,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();dt(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,s=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),U.read(r);const i=zt(window,"resize",()=>this.scalePositionWithinConstraints()),a=o.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(pe(u=>{const d=this.getAxisMotionValue(u);d&&(this.originPoint[u]+=l[u].translate,d.set(d.get()+l[u].translate))}),this.visualElement.render())});return()=>{i(),n(),s(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:s=!1,dragElastic:i=Br,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:s,dragElastic:i,dragMomentum:a}}}function xn(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Cf(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class wf extends Re{constructor(t){super(t),this.removeGroupControls=de,this.removeListeners=de,this.controls=new Sf(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||de}unmount(){this.removeGroupControls(),this.removeListeners()}}const ki=e=>(t,n)=>{e&&U.postRender(()=>e(t,n))};class Tf extends Re{constructor(){super(...arguments),this.removePointerDownListener=de}onPointerDown(t){this.session=new Ei(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Ti(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:ki(t),onStart:ki(n),onMove:r,onEnd:(s,i)=>{delete this.session,o&&U.postRender(()=>o(s,i))}}}mount(){this.removePointerDownListener=Xt(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const bn={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function ji(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Gt={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(D.test(e))e=parseFloat(e);else return e;const n=ji(e,t.target.x),r=ji(e,t.target.y);return`${n}% ${r}%`}},_f={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=Ie.parse(e);if(o.length>5)return r;const s=Ie.createTransformer(e),i=typeof o[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;o[0+i]/=a,o[1+i]/=l;const c=K(a,l,.5);return typeof o[2+i]=="number"&&(o[2+i]/=c),typeof o[3+i]=="number"&&(o[3+i]/=c),s(o)}};class Ef extends g.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:s}=t;zc(Pf),s&&(n.group&&n.group.add(s),r&&r.register&&o&&r.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),bn.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:o,isPresent:s}=this.props,i=r.projection;return i&&(i.isPresent=s,o||t.layoutDependency!==n||n===void 0||t.isPresent!==s?i.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?i.promote():i.relegate()||U.postRender(()=>{const a=i.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Yn.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=t;o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Ni(e){const[t,n]=sc(),r=g.useContext(So);return x.jsx(Ef,{...e,layoutGroup:r,switchLayoutGroup:g.useContext(Ko),isPresent:t,safeToRemove:n})}const Pf={borderRadius:{...Gt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Gt,borderTopRightRadius:Gt,borderBottomLeftRadius:Gt,borderBottomRightRadius:Gt,boxShadow:_f};function Af(e,t,n){const r=se(e)?e:Dt(e);return r.start(kr("",r,t,n)),r.animation}function Mf(e){return e instanceof SVGElement&&e.tagName!=="svg"}const Lf=(e,t)=>e.depth-t.depth;class Df{constructor(){this.children=[],this.isDirty=!1}add(t){Bn(this.children,t),this.isDirty=!0}remove(t){$n(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Lf),this.isDirty=!1,this.children.forEach(t)}}function Of(e,t){const n=be.now(),r=({timestamp:o})=>{const s=o-n;s>=t&&(Ne(r),e(s-t))};return U.read(r,!0),()=>Ne(r)}const Vi=["TopLeft","TopRight","BottomLeft","BottomRight"],kf=Vi.length,Ii=e=>typeof e=="string"?parseFloat(e):e,Ri=e=>typeof e=="number"||D.test(e);function jf(e,t,n,r,o,s){o?(e.opacity=K(0,n.opacity!==void 0?n.opacity:1,Nf(r)),e.opacityExit=K(t.opacity!==void 0?t.opacity:1,0,Vf(r))):s&&(e.opacity=K(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let i=0;i<kf;i++){const a=`border${Vi[i]}Radius`;let l=Fi(t,a),c=Fi(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||Ri(l)===Ri(c)?(e[a]=Math.max(K(Ii(l),Ii(c),r),0),(Se.test(c)||Se.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=K(t.rotate||0,n.rotate||0,r))}function Fi(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Nf=Bi(0,.5,vs),Vf=Bi(.5,.95,de);function Bi(e,t,n){return r=>r<e?0:r>t?1:n(ct(e,t,r))}function $i(e,t){e.min=t.min,e.max=t.max}function me(e,t){$i(e.x,t.x),$i(e.y,t.y)}function zi(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Ui(e,t,n,r,o){return e-=t,e=vn(e,1/n,r),o!==void 0&&(e=vn(e,1/o,r)),e}function If(e,t=0,n=1,r=.5,o,s=e,i=e){if(Se.test(t)&&(t=parseFloat(t),t=K(i.min,i.max,t/100)-i.min),typeof t!="number")return;let a=K(s.min,s.max,r);e===s&&(a-=t),e.min=Ui(e.min,t,n,a,o),e.max=Ui(e.max,t,n,a,o)}function Xi(e,t,[n,r,o],s,i){If(e,t[n],t[r],t[o],t.scale,s,i)}const Rf=["x","scaleX","originX"],Ff=["y","scaleY","originY"];function Wi(e,t,n,r){Xi(e.x,t,Rf,n?n.x:void 0,r?r.x:void 0),Xi(e.y,t,Ff,n?n.y:void 0,r?r.y:void 0)}function Ki(e){return e.translate===0&&e.scale===1}function Gi(e){return Ki(e.x)&&Ki(e.y)}function qi(e,t){return e.min===t.min&&e.max===t.max}function Bf(e,t){return qi(e.x,t.x)&&qi(e.y,t.y)}function Hi(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Yi(e,t){return Hi(e.x,t.x)&&Hi(e.y,t.y)}function Zi(e){return ae(e.x)/ae(e.y)}function Ji(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class $f{constructor(){this.members=[]}add(t){Bn(this.members,t),t.scheduleRender()}remove(t){if($n(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(o=>t===o);if(n===0)return!1;let r;for(let o=n;o>=0;o--){const s=this.members[o];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;o===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function zf(e,t,n){let r="";const o=e.x.translate/t.x,s=e.y.translate/t.y,i=(n==null?void 0:n.z)||0;if((o||s||i)&&(r=`translate3d(${o}px, ${s}px, ${i}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:d,rotateY:f,skewX:m,skewY:p}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),d&&(r+=`rotateX(${d}deg) `),f&&(r+=`rotateY(${f}deg) `),m&&(r+=`skewX(${m}deg) `),p&&(r+=`skewY(${p}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const $r=["","X","Y","Z"],Uf={visibility:"hidden"},Qi=1e3;let Xf=0;function zr(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function ea(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=ds(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",U,!(o||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&ea(r)}function ta({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(i={},a=t==null?void 0:t()){this.id=Xf++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Gf),this.nodes.forEach(Jf),this.nodes.forEach(Qf),this.nodes.forEach(qf)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=i,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new Df)}addEventListener(i,a){return this.eventHandlers.has(i)||this.eventHandlers.set(i,new Un),this.eventHandlers.get(i).add(a)}notifyListeners(i,...a){const l=this.eventHandlers.get(i);l&&l.notify(...a)}hasListeners(i){return this.eventHandlers.has(i)}mount(i,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=Mf(i),this.instance=i;const{layoutId:l,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(i),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(c||l)&&(this.isLayoutDirty=!0),e){let d;const f=()=>this.root.updateBlockedByResize=!1;e(i,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=Of(f,250),bn.hasAnimatedSinceResize&&(bn.hasAnimatedSinceResize=!1,this.nodes.forEach(ra))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&u&&(l||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeLayoutChanged:m,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||u.getDefaultTransition()||oh,{onLayoutAnimationStart:S,onLayoutAnimationComplete:v}=u.getProps(),b=!this.targetLayout||!Yi(this.targetLayout,p),w=!f&&m;if(this.options.layoutRoot||this.resumeFrom||w||f&&(b||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,w);const M={...Xn(y,"layout"),onPlay:S,onComplete:v};(u.shouldReduceMotion||this.options.layoutRoot)&&(M.delay=0,M.type=!1),this.startAnimation(M)}else f||ra(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const i=this.getStack();i&&i.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Ne(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(eh),this.animationId++)}getTransformTemplate(){const{visualElement:i}=this.options;return i&&i.getProps().transformTemplate}willUpdate(i=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&ea(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const d=this.path[u];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),i&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(na);return}this.isUpdating||this.nodes.forEach(Yf),this.isUpdating=!1,this.nodes.forEach(Zf),this.nodes.forEach(Wf),this.nodes.forEach(Kf),this.clearAllSnapshots();const a=be.now();re.delta=_e(0,1e3/60,a-re.timestamp),re.timestamp=a,re.isProcessing=!0,Hn.update.process(re),Hn.preRender.process(re),Hn.render.process(re),re.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Yn.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Hf),this.sharedNodes.forEach(th)}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&&!ae(this.snapshot.measuredBox.x)&&!ae(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const i=this.layout;this.layout=this.measure(!1),this.layoutCorrected=H(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,i?i.layoutBox:void 0)}updateScroll(i="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===i&&(a=!1),a){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:i,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!o)return;const i=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Gi(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;i&&(a||Je(this.latestValues)||u)&&(o(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(i=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return i&&(l=this.removeTransform(l)),sh(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var i;const{visualElement:a}=this.options;if(!a)return H();const l=a.measureViewportBox();if(!(((i=this.scroll)===null||i===void 0?void 0:i.wasRoot)||this.path.some(ih))){const{scroll:u}=this.root;u&&(yt(l.x,u.offset.x),yt(l.y,u.offset.y))}return l}removeElementScroll(i){var a;const l=H();if(me(l,i),!((a=this.scroll)===null||a===void 0)&&a.wasRoot)return l;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:d,options:f}=u;u!==this.root&&d&&f.layoutScroll&&(d.wasRoot&&me(l,i),yt(l.x,d.offset.x),yt(l.y,d.offset.y))}return l}applyTransform(i,a=!1){const l=H();me(l,i);for(let c=0;c<this.path.length;c++){const u=this.path[c];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&vt(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),Je(u.latestValues)&&vt(l,u.latestValues)}return Je(this.latestValues)&&vt(l,this.latestValues),l}removeTransform(i){const a=H();me(a,i);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!Je(c.latestValues))continue;Vr(c.latestValues)&&c.updateSnapshot();const u=H(),d=c.measurePageBox();me(u,d),Wi(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return Je(this.latestValues)&&Wi(a,this.latestValues),a}setTargetDelta(i){this.targetDelta=i,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(i){this.options={...this.options,...i,crossfade:i.crossfade!==void 0?i.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==re.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(i=!1){var a;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==l;if(!(i||c&&this.isSharedProjectionDirty||this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:f}=this.options;if(!(!this.layout||!(d||f))){if(this.resolvedRelativeTargetAt=re.timestamp,!this.targetDelta&&!this.relativeTarget){const m=this.getClosestProjectingParent();m&&m.layout&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=H(),this.relativeTargetOrigin=H(),Kt(this.relativeTargetOrigin,this.layout.layoutBox,m.layout.layoutBox),me(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=H(),this.targetWithTransforms=H()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),lf(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):me(this.target,this.layout.layoutBox),xi(this.target,this.targetDelta)):me(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const m=this.getClosestProjectingParent();m&&!!m.resumingFrom==!!this.resumingFrom&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=H(),this.relativeTargetOrigin=H(),Kt(this.relativeTargetOrigin,this.target,m.target),me(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||Vr(this.parent.latestValues)||gi(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var i;const a=this.getLead(),l=!!this.resumingFrom||this!==a;let c=!0;if((this.isProjectionDirty||!((i=this.parent)===null||i===void 0)&&i.isProjectionDirty)&&(c=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===re.timestamp&&(c=!1),c)return;const{layout:u,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||d))return;me(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,m=this.treeScale.y;cf(this.layoutCorrected,this.treeScale,this.path,l),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=H());const{target:p}=a;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(zi(this.prevProjectionDelta.x,this.projectionDelta.x),zi(this.prevProjectionDelta.y,this.projectionDelta.y)),Wt(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==m||!Ji(this.projectionDelta.x,this.prevProjectionDelta.x)||!Ji(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(i=!0){var a;if((a=this.options.visualElement)===null||a===void 0||a.scheduleRender(),i){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=gt(),this.projectionDelta=gt(),this.projectionDeltaWithTransform=gt()}setAnimationOrigin(i,a=!1){const l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},d=gt();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=H(),m=l?l.source:void 0,p=this.layout?this.layout.source:void 0,y=m!==p,S=this.getStack(),v=!S||S.members.length<=1,b=!!(y&&!v&&this.options.crossfade===!0&&!this.path.some(rh));this.animationProgress=0;let w;this.mixTargetDelta=M=>{const _=M/1e3;oa(d.x,i.x,_),oa(d.y,i.y,_),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Kt(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),nh(this.relativeTarget,this.relativeTargetOrigin,f,_),w&&Bf(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=H()),me(w,this.relativeTarget)),y&&(this.animationValues=u,jf(u,c,this.latestValues,_,b,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=_},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(i){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Ne(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=U.update(()=>{bn.hasAnimatedSinceResize=!0,this.currentAnimation=Af(0,Qi,{...i,onUpdate:a=>{this.mixTargetDelta(a),i.onUpdate&&i.onUpdate(a)},onStop:()=>{},onComplete:()=>{i.onComplete&&i.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const i=this.getStack();i&&i.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Qi),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const i=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=i;if(!(!a||!l||!c)){if(this!==i&&this.layout&&c&&ca(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||H();const d=ae(this.layout.layoutBox.x);l.x.min=i.target.x.min,l.x.max=l.x.min+d;const f=ae(this.layout.layoutBox.y);l.y.min=i.target.y.min,l.y.max=l.y.min+f}me(a,l),vt(a,u),Wt(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(i,a){this.sharedNodes.has(i)||this.sharedNodes.set(i,new $f),this.sharedNodes.get(i).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const i=this.getStack();return i?i.lead===this:!0}getLead(){var i;const{layoutId:a}=this.options;return a?((i=this.getStack())===null||i===void 0?void 0:i.lead)||this:this}getPrevLead(){var i;const{layoutId:a}=this.options;return a?(i=this.getStack())===null||i===void 0?void 0:i.prevLead:void 0}getStack(){const{layoutId:i}=this.options;if(i)return this.root.sharedNodes.get(i)}promote({needsReset:i,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),i&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const i=this.getStack();return i?i.relegate(this):!1}resetSkewAndRotation(){const{visualElement:i}=this.options;if(!i)return;let a=!1;const{latestValues:l}=i;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&zr("z",i,c,this.animationValues);for(let u=0;u<$r.length;u++)zr(`rotate${$r[u]}`,i,c,this.animationValues),zr(`skew${$r[u]}`,i,c,this.animationValues);i.render();for(const u in c)i.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);i.scheduleRender()}getProjectionStyles(i){var a,l;if(!this.instance||this.isSVG)return;if(!this.isVisible)return Uf;const c={visibility:""},u=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,c.opacity="",c.pointerEvents=pn(i==null?void 0:i.pointerEvents)||"",c.transform=u?u(this.latestValues,""):"none",c;const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){const y={};return this.options.layoutId&&(y.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,y.pointerEvents=pn(i==null?void 0:i.pointerEvents)||""),this.hasProjected&&!Je(this.latestValues)&&(y.transform=u?u({},""):"none",this.hasProjected=!1),y}const f=d.animationValues||d.latestValues;this.applyTransformsToTarget(),c.transform=zf(this.projectionDeltaWithTransform,this.treeScale,f),u&&(c.transform=u(f,c.transform));const{x:m,y:p}=this.projectionDelta;c.transformOrigin=`${m.origin*100}% ${p.origin*100}% 0`,d.animationValues?c.opacity=d===this?(l=(a=f.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:f.opacityExit:c.opacity=d===this?f.opacity!==void 0?f.opacity:"":f.opacityExit!==void 0?f.opacityExit:0;for(const y in kt){if(f[y]===void 0)continue;const{correct:S,applyTo:v,isCSSVariable:b}=kt[y],w=c.transform==="none"?f[y]:S(f[y],d);if(v){const M=v.length;for(let _=0;_<M;_++)c[v[_]]=w}else b?this.options.visualElement.renderState.vars[y]=w:c[y]=w}return this.options.layoutId&&(c.pointerEvents=d===this?pn(i==null?void 0:i.pointerEvents)||"":"none"),c}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(i=>{var a;return(a=i.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(na),this.root.sharedNodes.clear()}}}function Wf(e){e.updateLayout()}function Kf(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:o}=e.layout,{animationType:s}=e.options,i=n.source!==e.layout.source;s==="size"?pe(d=>{const f=i?n.measuredBox[d]:n.layoutBox[d],m=ae(f);f.min=r[d].min,f.max=f.min+m}):ca(s,n.layoutBox,r)&&pe(d=>{const f=i?n.measuredBox[d]:n.layoutBox[d],m=ae(r[d]);f.max=f.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+m)});const a=gt();Wt(a,r,n.layoutBox);const l=gt();i?Wt(l,e.applyTransform(o,!0),n.measuredBox):Wt(l,r,n.layoutBox);const c=!Gi(a);let u=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:f,layout:m}=d;if(f&&m){const p=H();Kt(p,n.layoutBox,f.layoutBox);const y=H();Kt(y,r,m.layoutBox),Yi(p,y)||(u=!0),d.options.layoutRoot&&(e.relativeTarget=y,e.relativeTargetOrigin=p,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function Gf(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function qf(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Hf(e){e.clearSnapshot()}function na(e){e.clearMeasurements()}function Yf(e){e.isLayoutDirty=!1}function Zf(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function ra(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Jf(e){e.resolveTargetDelta()}function Qf(e){e.calcProjection()}function eh(e){e.resetSkewAndRotation()}function th(e){e.removeLeadSnapshot()}function oa(e,t,n){e.translate=K(t.translate,0,n),e.scale=K(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function sa(e,t,n,r){e.min=K(t.min,n.min,r),e.max=K(t.max,n.max,r)}function nh(e,t,n,r){sa(e.x,t.x,n.x,r),sa(e.y,t.y,n.y,r)}function rh(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const oh={duration:.45,ease:[.4,0,.1,1]},ia=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),aa=ia("applewebkit/")&&!ia("chrome/")?Math.round:de;function la(e){e.min=aa(e.min),e.max=aa(e.max)}function sh(e){la(e.x),la(e.y)}function ca(e,t,n){return e==="position"||e==="preserve-aspect"&&!af(Zi(t),Zi(n),.2)}function ih(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const ah=ta({attachResizeListener:(e,t)=>zt(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Ur={current:void 0},ua=ta({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Ur.current){const e=new ah({});e.mount(window),e.setOptions({layoutScroll:!0}),Ur.current=e}return Ur.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),lh={pan:{Feature:Tf},drag:{Feature:wf,ProjectionNode:ua,MeasureLayout:Ni}};function da(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,s=r[o];s&&U.postRender(()=>s(t,Ut(t)))}class ch extends Re{mount(){const{current:t}=this.node;t&&(this.unmount=yc(t,(n,r)=>(da(this.node,r,"Start"),o=>da(this.node,o,"End"))))}unmount(){}}class uh extends Re{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Bt(zt(this.node.current,"focus",()=>this.onFocus()),zt(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function fa(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),s=r[o];s&&U.postRender(()=>s(t,Ut(t)))}class dh extends Re{mount(){const{current:t}=this.node;t&&(this.unmount=Sc(t,(n,r)=>(fa(this.node,r,"Start"),(o,{success:s})=>fa(this.node,o,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Xr=new WeakMap,Wr=new WeakMap,fh=e=>{const t=Xr.get(e.target);t&&t(e)},hh=e=>{e.forEach(fh)};function ph({root:e,...t}){const n=e||document;Wr.has(n)||Wr.set(n,{});const r=Wr.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(hh,{root:e,...t})),r[o]}function mh(e,t,n){const r=ph(t);return Xr.set(e,n),r.observe(e),()=>{Xr.delete(e),r.unobserve(e)}}const gh={some:0,all:1};class yh extends Re{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:s}=t,i={root:n?n.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:gh[o]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,s&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:d}=this.node.getProps(),f=c?u:d;f&&f(l)};return mh(this.node.current,i,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(vh(t,n))&&this.startObserver()}unmount(){}}function vh({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const xh={inView:{Feature:yh},tap:{Feature:dh},focus:{Feature:uh},hover:{Feature:ch}},bh={layout:{ProjectionNode:ua,MeasureLayout:Ni}},Kr={current:null},ha={current:!1};function Sh(){if(ha.current=!0,!!Rn)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Kr.current=e.matches;e.addListener(t),t()}else Kr.current=!1}const Ch=[...Fs,ie,Ie],wh=e=>Ch.find(Rs(e)),Th=new WeakMap;function _h(e,t,n){for(const r in t){const o=t[r],s=n[r];if(se(o))e.addValue(r,o),process.env.NODE_ENV==="development"&&on(o.version==="12.5.0",`Attempting to mix Motion versions ${o.version} with 12.5.0 may not work as expected.`);else if(se(s))e.addValue(r,Dt(o,{owner:e}));else if(s!==o)if(e.hasValue(r)){const i=e.getValue(r);i.liveStyle===!0?i.jump(o):i.hasAnimated||i.set(o)}else{const i=e.getStaticValue(r);e.addValue(r,Dt(i!==void 0?i:o,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const pa=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Eh{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:o,blockInitialAnimation:s,visualState:i},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Er,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const m=be.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,U.render(this.render,!1,!0))};const{latestValues:l,renderState:c,onUpdate:u}=i;this.onUpdate=u,this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=a,this.blockInitialAnimation=!!s,this.isControllingVariants=fn(n),this.isVariantNode=Uo(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:d,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const m in f){const p=f[m];l[m]!==void 0&&se(p)&&p.set(l[m],!1)}}mount(t){this.current=t,Th.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),ha.current||Sh(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Kr.current,process.env.NODE_ENV!=="production"&&on(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Ne(this.notifyUpdate),Ne(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=Ge.has(t);r&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&U.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);let i;window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{o(),s(),i&&i(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in ut){const n=ut[t];if(!n)continue;const{isEnabled:r,Feature:o}=n;if(!this.features[t]&&o&&r(this.props)&&(this.features[t]=new o(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):H()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<pa.length;r++){const o=pa[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const s="on"+o,i=t[s];i&&(this.propEventSubscriptions[o]=this.on(o,i))}this.prevMotionValues=_h(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Dt(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let o=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return o!=null&&(typeof o=="string"&&(Vs(o)||bs(o))?o=parseFloat(o):!wh(o)&&Ie.test(n)&&(o=As(t,n)),this.setBaseTarget(t,se(o)?o.get():o)),se(o)?o.get():o}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let o;if(typeof r=="string"||typeof r=="object"){const i=ur(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);i&&(o=i[t])}if(r&&o!==void 0)return o;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!se(s)?s:this.initialValues[t]!==void 0&&o===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Un),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class ma extends Eh{constructor(){super(...arguments),this.KeyframeResolver=$s}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;se(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Ph(e){return window.getComputedStyle(e)}class Ah extends ma{constructor(){super(...arguments),this.type="html",this.renderInstance=ss}readValueFromInstance(t,n){if(Ge.has(n))return Fu(t,n);{const r=Ph(t),o=(nr(n)?r.getPropertyValue(n):r[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return wi(t,n)}build(t,n,r){sr(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return fr(t,n,r)}}class Mh extends ma{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=H,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&os(this.current,this.renderState)}}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Ge.has(n)){const r=Ps(n);return r&&r.default||0}return n=is.has(n)?n:tr(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return ls(t,n,r)}onBindTransform(){this.current&&!this.renderState.dimensions&&U.postRender(this.updateDimensions)}build(t,n,r){lr(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,o){as(t,n,r,o)}mount(t){this.isSVGTag=cr(t.tagName),super.mount(t)}}const Lh=(e,t)=>ar(e)?new Mh(t):new Ah(t,{allowProjection:e!==g.Fragment}),Dh=fu({...Jd,...xh,...lh,...bh},Lh),Qe=Mc(Dh),Oh={root:"_root_uup2j_1"},ga={bgDefault:"c-corporate-default-bg",cBlack:"c-corporate-default-black",cBlue:"c-corporate-default-blue",bgDark:"c-corporate-default-dark-bg",cDarkBlue:"c-corporate-default-dark-blue",cDarkGreen:"c-corporate-default-dark-green",cGreen:"c-corporate-default-green",cRichBlue:"c-corporate-default-rich-blue",grey050:"c-grey-050",grey100:"c-grey-100",grey200:"c-grey-200",grey300:"c-grey-300",grey400:"c-grey-400",grey500:"c-grey-500",grey600:"c-grey-600",grey700:"c-grey-700",grey800:"c-grey-800",grey900:"c-grey-900",rFull:"radius-full",rL:"radius-l",rM:"radius-m",rNone:"radius-none",rS:"radius-s",rXL:"radius-xl",rXS:"radius-xs",rXXL:"radius-xxl",rXXS:"radius-xxs",pXXS:"p-xxs",pXS:"p-xs",pS:"p-s",pM:"p-m",pL:"p-l",pXL:"p-xl",pXXL:"p-xxl",pxXXS:"px-xxs",pxXS:"px-xs",pxS:"px-s",pxM:"px-m",pxL:"px-l",pxXL:"px-xl",pxXXL:"px-xxl",pyXXS:"py-xxs",pyXS:"py-xs",pyS:"py-s",pyM:"py-m",pyL:"py-l",pyXL:"py-xl",pyXXL:"py-xxl",ptXXS:"pt-xxs",ptXS:"pt-xs",ptS:"pt-s",ptM:"pt-m",ptL:"pt-l",ptXL:"pt-xl",ptXXL:"pt-xxl",prXXS:"pr-xxs",prXS:"pr-xs",prS:"pr-s",prM:"pr-m",prL:"pr-l",prXL:"pr-xl",prXXL:"pr-xxl",pbXXS:"pb-xxs",pbXS:"pb-xs",pbS:"pb-s",pbM:"pb-m",pbL:"pb-l",pbXL:"pb-xl",pbXXL:"pb-xxl",plXXS:"pl-xxs",plXS:"pl-xs",plS:"pl-s",plM:"pl-m",plL:"pl-l",plXL:"pl-xl",plXXL:"pl-xxl",mXXS:"m-xxs",mXS:"m-xs",mS:"m-s",mM:"m-m",mL:"m-l",mXL:"m-xl",mXXL:"m-xxl",mxXXS:"mx-xxs",mxXS:"mx-xs",mxS:"mx-s",mxM:"mx-m",mxL:"mx-l",mxXL:"mx-xl",mxXXL:"mx-xxl",myXXS:"my-xxs",myXS:"my-xs",myS:"my-s",myM:"my-m",myL:"my-l",myXL:"my-xl",myXXL:"my-xxl",mtXXS:"mt-xxs",mtXS:"mt-xs",mtS:"mt-s",mtM:"mt-m",mtL:"mt-l",mtXL:"mt-xl",mtXXL:"mt-xxl",mrXXS:"mr-xxs",mrXS:"mr-xs",mrS:"mr-s",mrM:"mr-m",mrL:"mr-l",mrXL:"mr-xl",mrXXL:"mr-xxl",mbXXS:"mb-xxs",mbXS:"mb-xs",mbS:"mb-s",mbM:"mb-m",mbL:"mb-l",mbXL:"mb-xl",mbXXL:"mb-xxl",mlXXS:"ml-xxs",mlXS:"ml-xs",mlS:"ml-s",mlM:"ml-m",mlL:"ml-l",mlXL:"ml-xl",mlXXL:"ml-xxl",fsXXXS:"fs-xxxs",fsXXS:"fs-xxs",fsXS:"fs-xs",fsS:"fs-s",fsM:"fs-m",fsL:"fs-l",fsXL:"fs-xl",fsXXL:"fs-xxl",fsXXXL:"fs-xxxl",fwRegular:"fw-regular",fwSemibold:"fw-semibold",fwBold:"fw-bold",dBlock:"d-block",dInBlock:"d-in-block",taLeft:"ta-left",taCenter:"ta-center",mwSM:"mw-sm",mwMD:"mw-md",mwLG:"mw-lg",mwXL:"mw-xl",mwXXL:"mw-xxl",mw3XL:"mw-3xl",shNone:"sh-none"};function Fe(e){return e&&Object.keys(e).length?Object.keys(e).filter(t=>Object.keys(ga).includes(t)).filter(t=>e[t]===!0).map(t=>ga[t]):null}const et="Errore: ",kh="Impossibile acquisire la posizione.",Gr="Impossibile caricare i punti di mappa.",jh="Si è verificato un errore.",Nh="Impossibile caricare i suggerimenti.",Vh="Impossibile caricare i dettagli della location.",Ih="Impossibile caricare la mappa.",Rh="Impossibile trovare punti di mappa nell'area di ricerca.",Fh="Ottieni indicazioni di navigazione per questa destinazione",Bh="Condividi questa destinazione",$h="Scarica l'evento",zh=3e3,ya=6,qt={north:47.1,south:36.6,east:18.6,west:6.6},Uh={lat:(qt.north+qt.south)/2,lng:(qt.east+qt.west)/2},Xh=2e4;function Ee(e){if(e)return e.trim().split(" ").filter(t=>t.length)}function Pe(e){return e?e.split("").reduce((t,n)=>(/[A-Z]/.test(n)?e.indexOf(n)===0?t+=n.toLowerCase():t+="-"+n.toLowerCase():t+=n,t),""):""}function qr(e){const{type:t,url:n}=e??{};switch(t){case"navigate":case"directions":return{"aria-label":Fh,as:"a",href:n??"#",target:"_blank",rel:"noopener noreferrer"};case"share":return{"aria-label":Bh,as:"a",href:n??"#",target:"_blank",rel:"noopener noreferrer"};case"event":case"calendar":return{"aria-label":$h,as:"a",href:n??"#",download:!0,target:"_blank",rel:"noopener noreferrer"};case"email":default:return{}}}function Wh(e,t){let n;return(...r)=>{clearTimeout(n),n=setTimeout(()=>e(...r),t)}}const va="Anchor";function xa({as:e,wrapper:t,children:n,variant:r="default",className:o,animate:s=!0,animationDelay:i=0,href:a,target:l,rel:c,linkProps:u={},style:d,...f},m){const p=t||"span",y=s?Qe[p]:p,S=e||"a",v=Fe(f)??[],b=s?{initial:{opacity:0,y:5},animate:{opacity:1,y:0},transition:{delay:i,duration:.2}}:{},M=c||(l==="_blank"?{rel:"noopener noreferrer"}:{}).rel;return x.jsx(y,{className:q(Oh.root,"dyn-locator__"+Pe(va),Ee(o),...v),"data-variant":r,...d?{style:d}:{},...b,...f,children:x.jsx(S,{ref:m,href:a,target:l,rel:M,...u,children:n})})}xa.displayName=va;const ba=g.forwardRef(xa),Sa="ErrorBanner";function Ca({title:e="Si è verificato un errore",message:t="Impossibile completare l'operazione richiesta.",actionText:n="ricaricare la pagina",onAction:r,errorDetails:o,className:s,children:i,...a}){const l=Fe(a)??[];return x.jsxs("div",{className:q("dyn-locator__"+Pe(Sa),At.root,Ee(s),...l??[]),children:[x.jsxs("header",{className:At.header,children:[x.jsx(Hl,{size:28,color:"currentColor",className:At.icon})," ",x.jsx("h3",{children:e})]}),x.jsxs("div",{className:At.body,children:[x.jsx("p",{children:t}),n&&r&&x.jsxs("p",{children:["Prova a"," ",x.jsx(ba,{animate:!1,"aria-label":n,href:"#",onClick:r,children:n})]}),i,o&&x.jsx("div",{className:At.content,children:x.jsx("pre",{children:o})})]})]})}Ca.displayName=Sa;const wa=Ca;class Kh extends g.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,n){console.error("Locator error: ",t,n)}render(){var t;return this.state.hasError?this.props.fallback||x.jsx("div",{className:Bl.container,children:x.jsx(wa,{message:"Something went wrong with the Locator component",errorDetails:(t=this.state.error)==null?void 0:t.message})}):this.props.children}}const Ta={ArrowLeft:Xl,ArrowUpRight:Kl,ChevronUp:ql,ChevronDown:Gl,Close:bo,Expand:Jl,Location:Zl,Search:tc,Share:nc,Target:Yl},Ae={root:"_root_1cmog_4",header:"_header_1cmog_21",body:"_body_1cmog_22",cta:"_cta_1cmog_23",titleContainer:"_titleContainer_1cmog_40",shareButton:"_shareButton_1cmog_51",capabilities:"_capabilities_1cmog_59",tagContainer:"_tagContainer_1cmog_72",tag:"_tag_1cmog_72"},xt={root:"_root_1k1dg_4",container:"_container_1k1dg_10",label:"_label_1k1dg_17",icon:"_icon_1k1dg_27"},Hr={root:"_root_71ove_4",icon:"_icon_71ove_43"};function Gh(e){return g.isValidElement(e)||typeof e=="function"}function qh(e){return e?typeof e=="string"||typeof e=="object"&&"name"in e:!1}function Hh(e){return!!e&&typeof e=="object"&&"path"in e}const _a="Icon";function Ea({as:e,icon:t,iconRef:n,label:r,size:o="S",radius:s,variant:i="default",className:a,animate:l=!0,animationDelay:c=0,style:u,...d},f){const m=e||"span",p=l?Qe[m]:m,{iconMap:y}=np();function S(w){if(qh(w)){const M=typeof w=="string"?w:w.name;return y[M]?g.createElement(y[M],{...n?{ref:n}:{},...r?{title:r,titleId:r.trim().toLowerCase().replace(/[^a-z0-9\s_-]/g,"").replace(/\s+/g,"_")+"_id"}:{},className:Hr.icon}):'No icon found for "'+M+'"!'}return Hh(w)?(i!=="default"&&console.warn("Warning: cannot set icon stroke on a remote asset"),x.jsx("img",{...n?{ref:n}:{},src:w.path,alt:`Icona decorativa${r?" che rappresenta '"+r+"'":""}`,className:Hr.icon})):"No icon provided"}const v=Fe(d)??[],b=l?{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},transition:{delay:c,duration:.2}}:{};return x.jsx(p,{ref:f,className:q(Hr.root,"dyn-locator__"+Pe(_a),Ee(a),...v),...u?{style:u}:{},"data-variant":i,"data-size":o,...s?{"data-radius":s}:{},...b,...d,children:S(t)})}Ea.displayName=_a;const Be=g.forwardRef(Ea),Pa="Tag";function Aa({as:e,iconPosition:t="left",children:n,icon:r,className:o,animate:s=!0,animationDelay:i=0,style:a,...l},c){const u=e||"span",d=s?Qe[u]:u,f=Fe(l)??[],m=s?{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},transition:{delay:i,duration:.2}}:{};return x.jsx(d,{ref:c,className:q(xt.root,"dyn-locator__"+Pe(Pa),Ee(o),...f),"data-icon-position":t,...a?{style:a}:{},...m,...l,children:x.jsxs("div",{className:xt.container,children:[r?x.jsx("div",{className:xt.icon,children:Gh(r)?typeof r=="function"?x.jsx(r,{className:xt.icon}):r:x.jsx(Be,{className:xt.icon,icon:r})}):null,x.jsx("div",{className:xt.label,children:n})]})})}Aa.displayName=Pa;const Yh=g.forwardRef(Aa),Zh={root:"_root_u5v4v_1"},Ma="IconButton";function La({as:e,children:t,className:n,variant:r="default",animate:o=!0,animationDelay:s=0,style:i,ariaLabel:a,href:l,target:c,rel:u,disabled:d=!1,...f},m){const p=e||"button",y=o?Qe[p]:p,S=Fe(f)??[],v=o?{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},transition:{delay:s,duration:.2}}:{},b=p==="a"?{href:l??"/",target:c??"_blank",rel:c==="_blank"?"noopener noreferrer":u}:{};return x.jsx(y,{ref:m,className:q(Zh.root,"dyn-locator__"+Pe(Ma),Ee(n),...S),"data-variant":r,"data-element":p,"aria-label":a,disabled:d,...i?{style:i}:{},...v,...b,...f,children:t})}La.displayName=Ma;const bt=g.forwardRef(La),Da={root:"_root_1fk3z_1",content:"_content_1fk3z_32"},Oa="Card";function ka({as:e,children:t,className:n,variant:r="default",animate:o=!0,animationDelay:s=0,style:i,clickable:a=!1,onClick:l,...c},u){const d=e||"article",f=o?Qe[d]:d,m=Fe(c)??[],p=o?{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{delay:s,duration:.3}}:{};return x.jsx(f,{ref:u,className:q(Da.root,"dyn-locator__"+Pe(Oa),Ee(n),...m),"data-variant":r,"data-clickable":a||!!l,onClick:l,...i?{style:i}:{},...p,...c,children:r==="bare"?t:x.jsx("div",{className:Da.content,children:t})})}ka.displayName=Oa;const Jh=g.forwardRef(ka);function ja(e){const{componentMap:t}=rp();return t[e]}const Na="LocationCard";function Va({title:e,timestamp:t,address:n,capabilities:r,on_share:o,actions:s,className:i,...a},l){const c=ja("ctaButton");return x.jsx(Jh,{ref:l,variant:"bare",clickable:!0,className:q("dyn-locator__"+Pe(Na),Ee(i)),...a,style:{...a.style?a.style:{},padding:"var(--dyn-locator__spacing-xs) 0",borderRadius:"var(--dyn-locator__radius-s)",border:"1px solid var(--dyn-locator__colors-grey-grey-100)",boxShadow:"none"},children:x.jsxs("div",{className:Ae.root,children:[x.jsxs("header",{className:Ae.header,children:[t?x.jsx("time",{children:new Date(t).toLocaleDateString("it",{day:"numeric",month:"long",year:"numeric"})}):null,x.jsxs("div",{className:Ae.titleContainer,children:[e?x.jsx("h4",{children:e}):null,x.jsx(bt,{className:Ae.shareButton,variant:"bare",...qr(o),children:x.jsx(Be,{size:"M",icon:"Share"})})]}),n?x.jsx("address",{children:n}):null]}),r!=null&&r.length?x.jsx("div",{className:Ae.body,children:r.map((u,d)=>x.jsxs("div",{className:Ae.capabilities,children:[x.jsx("h5",{children:u.title}),x.jsx("ul",{className:Ae.tagContainer,children:(u.capabilities??[]).map((f,m)=>x.jsx(Yh,{as:"li",animationDelay:+`.${m+1}`,className:Ae.tag,children:f.label},m))})]},d))}):null,s!=null&&s.length?x.jsx("div",{className:Ae.cta,children:s.map((u,d)=>x.jsx(c,{animate:!1,fullWidth:!0,variant:d===0?"themed":"secondary",...qr(u),children:u.label},d))}):null]})})}Va.displayName=Na;const Qh=g.forwardRef(Va),Ia={root:"_root_o9d55_1",loader:"_loader_o9d55_73"},Ra="Button";function Fa({as:e,children:t,className:n,variant:r="default",size:o="medium",disabled:s=!1,loading:i=!1,fullWidth:a=!1,animate:l=!0,animationDelay:c=0,href:u,target:d,rel:f,style:m,...p},y){const S=e||(u?"a":"button"),v=l?Qe[S]:S,b=Fe(p)??[],w=l?{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},transition:{delay:c,duration:.2}}:{},M=u?{href:u,target:d,rel:d==="_blank"?"noopener noreferrer":f}:{};return x.jsx(v,{ref:y,className:q(Ia.root,"dyn-locator__"+Pe(Ra),Ee(n),...b),"data-variant":r,"data-size":o,"data-full-width":a,disabled:s||i,...m?{style:m}:{},...w,...M,...p,children:i?x.jsxs("span",{style:{display:"flex",gap:10},children:[t,x.jsx("span",{className:Ia.loader,"aria-hidden":"true"})]}):t})}Fa.displayName=Ra;const Ht=g.forwardRef(Fa),Ba={locationCard:Qh,ctaButton:Ht},ep={iconMap:Ta,componentMap:Ba},Yr=g.createContext(ep);function tp({children:e,customIcons:t,customComponents:n}){const r={...Ta,...t??{}},o={...Ba,...n??{}};return x.jsx(Yr.Provider,{value:{iconMap:r,componentMap:o},children:e})}function np(){const{iconMap:e}=g.useContext(Yr);return{iconMap:e}}function rp(){const{componentMap:e}=g.useContext(Yr);return{componentMap:e}}var Yt=(e=>(e.CLUSTERS="clusters",e.MARKERS="markers",e.FIND="find",e))(Yt||{});const $a=g.createContext({endpointMap:{},apiUrl:""});function op({children:e,endpoints:t,apiUrl:n}){var r;if(!n||!((r=Object.keys(t??{}))!=null&&r.length))throw new Error("EndpointProvider requires an apiUrl and endpointMap.");return x.jsx($a.Provider,{value:{endpointMap:t,apiUrl:n},children:e})}function sp(e){const{endpointMap:t,apiUrl:n}=g.useContext($a);return{getEndpoint:(r={})=>{const o=t[e];if(!o)throw new Error(`Endpoint with id "${e}" not configured. Make sure to provide all required endpoints.`);let s="";return o.buildPath?s=o.buildPath(r):(s=o.path,Object.entries(r).forEach(([i,a])=>{s=s.replace(`:${i}`,String(a))})),{url:`${n}${s}`,method:o.method}}}}let ip={data:""},ap=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||ip,lp=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,cp=/\/\*[^]*?\*\/| +/g,za=/\n+/g,$e=(e,t)=>{let n="",r="",o="";for(let s in e){let i=e[s];s[0]=="@"?s[1]=="i"?n=s+" "+i+";":r+=s[1]=="f"?$e(i,s):s+"{"+$e(i,s[1]=="k"?"":t)+"}":typeof i=="object"?r+=$e(i,t?t.replace(/([^,])+/g,a=>s.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,l=>/&/.test(l)?l.replace(/&/g,a):a?a+" "+l:l)):s):i!=null&&(s=/^--/.test(s)?s:s.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=$e.p?$e.p(s,i):s+":"+i+";")}return n+(t&&o?t+"{"+o+"}":o)+r},Me={},Ua=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+Ua(e[n]);return t}return e},up=(e,t,n,r,o)=>{let s=Ua(e),i=Me[s]||(Me[s]=(l=>{let c=0,u=11;for(;c<l.length;)u=101*u+l.charCodeAt(c++)>>>0;return"go"+u})(s));if(!Me[i]){let l=s!==e?e:(c=>{let u,d,f=[{}];for(;u=lp.exec(c.replace(cp,""));)u[4]?f.shift():u[3]?(d=u[3].replace(za," ").trim(),f.unshift(f[0][d]=f[0][d]||{})):f[0][u[1]]=u[2].replace(za," ").trim();return f[0]})(e);Me[i]=$e(o?{["@keyframes "+i]:l}:l,n?"":"."+i)}let a=n&&Me.g?Me.g:null;return n&&(Me.g=Me[i]),((l,c,u,d)=>{d?c.data=c.data.replace(d,l):c.data.indexOf(l)===-1&&(c.data=u?l+c.data:c.data+l)})(Me[i],t,r,a),i},dp=(e,t,n)=>e.reduce((r,o,s)=>{let i=t[s];if(i&&i.call){let a=i(n),l=a&&a.props&&a.props.className||/^go/.test(a)&&a;i=l?"."+l:a&&typeof a=="object"?a.props?"":$e(a,""):a===!1?"":a}return r+o+(i??"")},"");function Sn(e){let t=this||{},n=e.call?e(t.p):e;return up(n.unshift?n.raw?dp(n,[].slice.call(arguments,1),t.p):n.reduce((r,o)=>Object.assign(r,o&&o.call?o(t.p):o),{}):n,ap(t.target),t.g,t.o,t.k)}let Xa,Zr,Jr;Sn.bind({g:1});let Le=Sn.bind({k:1});function fp(e,t,n,r){$e.p=t,Xa=e,Zr=n,Jr=r}function ze(e,t){let n=this||{};return function(){let r=arguments;function o(s,i){let a=Object.assign({},s),l=a.className||o.className;n.p=Object.assign({theme:Zr&&Zr()},a),n.o=/ *go\d+/.test(l),a.className=Sn.apply(n,r)+(l?" "+l:"");let c=e;return e[0]&&(c=a.as||e,delete a.as),Jr&&c[0]&&Jr(a),Xa(c,a)}return t?t(o):o}}var hp=e=>typeof e=="function",Cn=(e,t)=>hp(e)?e(t):e,pp=(()=>{let e=0;return()=>(++e).toString()})(),Wa=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),mp=20,Ka=(e,t)=>{switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,mp)};case 1:return{...e,toasts:e.toasts.map(s=>s.id===t.toast.id?{...s,...t.toast}:s)};case 2:let{toast:n}=t;return Ka(e,{type:e.toasts.find(s=>s.id===n.id)?1:0,toast:n});case 3:let{toastId:r}=t;return{...e,toasts:e.toasts.map(s=>s.id===r||r===void 0?{...s,dismissed:!0,visible:!1}:s)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(s=>s.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let o=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(s=>({...s,pauseDuration:s.pauseDuration+o}))}}},wn=[],tt={toasts:[],pausedAt:void 0},nt=e=>{tt=Ka(tt,e),wn.forEach(t=>{t(tt)})},gp={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},yp=(e={})=>{let[t,n]=g.useState(tt),r=g.useRef(tt);g.useEffect(()=>(r.current!==tt&&n(tt),wn.push(n),()=>{let s=wn.indexOf(n);s>-1&&wn.splice(s,1)}),[]);let o=t.toasts.map(s=>{var i,a,l;return{...e,...e[s.type],...s,removeDelay:s.removeDelay||((i=e[s.type])==null?void 0:i.removeDelay)||(e==null?void 0:e.removeDelay),duration:s.duration||((a=e[s.type])==null?void 0:a.duration)||(e==null?void 0:e.duration)||gp[s.type],style:{...e.style,...(l=e[s.type])==null?void 0:l.style,...s.style}}});return{...t,toasts:o}},vp=(e,t="blank",n)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...n,id:(n==null?void 0:n.id)||pp()}),Zt=e=>(t,n)=>{let r=vp(t,e,n);return nt({type:2,toast:r}),r.id},Y=(e,t)=>Zt("blank")(e,t);Y.error=Zt("error"),Y.success=Zt("success"),Y.loading=Zt("loading"),Y.custom=Zt("custom"),Y.dismiss=e=>{nt({type:3,toastId:e})},Y.remove=e=>nt({type:4,toastId:e}),Y.promise=(e,t,n)=>{let r=Y.loading(t.loading,{...n,...n==null?void 0:n.loading});return typeof e=="function"&&(e=e()),e.then(o=>{let s=t.success?Cn(t.success,o):void 0;return s?Y.success(s,{id:r,...n,...n==null?void 0:n.success}):Y.dismiss(r),o}).catch(o=>{let s=t.error?Cn(t.error,o):void 0;s?Y.error(s,{id:r,...n,...n==null?void 0:n.error}):Y.dismiss(r)}),e};var xp=(e,t)=>{nt({type:1,toast:{id:e,height:t}})},bp=()=>{nt({type:5,time:Date.now()})},Jt=new Map,Sp=1e3,Cp=(e,t=Sp)=>{if(Jt.has(e))return;let n=setTimeout(()=>{Jt.delete(e),nt({type:4,toastId:e})},t);Jt.set(e,n)},wp=e=>{let{toasts:t,pausedAt:n}=yp(e);g.useEffect(()=>{if(n)return;let s=Date.now(),i=t.map(a=>{if(a.duration===1/0)return;let l=(a.duration||0)+a.pauseDuration-(s-a.createdAt);if(l<0){a.visible&&Y.dismiss(a.id);return}return setTimeout(()=>Y.dismiss(a.id),l)});return()=>{i.forEach(a=>a&&clearTimeout(a))}},[t,n]);let r=g.useCallback(()=>{n&&nt({type:6,time:Date.now()})},[n]),o=g.useCallback((s,i)=>{let{reverseOrder:a=!1,gutter:l=8,defaultPosition:c}=i||{},u=t.filter(m=>(m.position||c)===(s.position||c)&&m.height),d=u.findIndex(m=>m.id===s.id),f=u.filter((m,p)=>p<d&&m.visible).length;return u.filter(m=>m.visible).slice(...a?[f+1]:[0,f]).reduce((m,p)=>m+(p.height||0)+l,0)},[t]);return g.useEffect(()=>{t.forEach(s=>{if(s.dismissed)Cp(s.id,s.removeDelay);else{let i=Jt.get(s.id);i&&(clearTimeout(i),Jt.delete(s.id))}})},[t]),{toasts:t,handlers:{updateHeight:xp,startPause:bp,endPause:r,calculateOffset:o}}},Tp=Le`
128
+ */const bo=ue("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),So=g.createContext({});function rc(e){const t=g.useRef(null);return t.current===null&&(t.current=e()),t.current}const Rn=typeof window<"u",oc=Rn?g.useLayoutEffect:g.useEffect,Fn=g.createContext(null),Co=g.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function sc(e=!0){const t=g.useContext(Fn);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=t,s=g.useId();g.useEffect(()=>{if(e)return o(s)},[e]);const i=g.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,i]:[!0]}function Bn(e,t){e.indexOf(t)===-1&&e.push(t)}function $n(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const de=e=>e;let lt=de,je=de;process.env.NODE_ENV!=="production"&&(lt=(e,t)=>{!e&&typeof console<"u"&&console.warn(t)},je=(e,t)=>{if(!e)throw new Error(t)});const ic={useManualTiming:!1};function zn(e){let t;return()=>(t===void 0&&(t=e()),t)}const ct=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class Un{constructor(){this.subscriptions=[]}add(t){return Bn(this.subscriptions,t),()=>$n(this.subscriptions,t)}notify(t,n,r){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,n,r);else for(let s=0;s<o;s++){const i=this.subscriptions[s];i&&i(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const xe=e=>e*1e3,Te=e=>e/1e3;function wo(e,t){return t?e*(1e3/t):0}const To=new Set;function on(e,t,n){e||To.has(t)||(console.warn(t),To.add(t))}const ac=zn(()=>window.ScrollTimeline!==void 0);class lc{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t,n){const r=this.animations.map(o=>{if(ac()&&o.attachTimeline)return o.attachTimeline(t);if(typeof n=="function")return n(o)});return()=>{r.forEach((o,s)=>{o&&o(),this.animations[s].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class cc extends lc{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}function Xn(e,t){return e?e[t]||e.default||e:void 0}const Wn=2e4;function _o(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Wn;)t+=n,r=e.next(t);return t>=Wn?1/0:t}function Kn(e){return typeof e=="function"}function Eo(e,t){e.timeline=t,e.onfinish=null}const Gn=e=>Array.isArray(e)&&typeof e[0]=="number",uc={linearEasing:void 0};function dc(e,t){const n=zn(e);return()=>{var r;return(r=uc[t])!==null&&r!==void 0?r:n()}}const sn=dc(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Po=(e,t,n=10)=>{let r="";const o=Math.max(Math.round(t/n),2);for(let s=0;s<o;s++)r+=e(ct(0,o-1,s))+", ";return`linear(${r.substring(0,r.length-2)})`};function Ao(e){return!!(typeof e=="function"&&sn()||!e||typeof e=="string"&&(e in qn||sn())||Gn(e)||Array.isArray(e)&&e.every(Ao))}const Mt=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,qn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Mt([0,.65,.55,1]),circOut:Mt([.55,0,1,.45]),backIn:Mt([.31,.01,.66,-.59]),backOut:Mt([.33,1.53,.69,.99])};function Mo(e,t){if(e)return typeof e=="function"&&sn()?Po(e,t):Gn(e)?Mt(e):Array.isArray(e)?e.map(n=>Mo(n,t)||qn.easeOut):qn[e]}const an=["read","resolveKeyframes","update","preRender","render","postRender"],Lo={value:null};function fc(e,t){let n=new Set,r=new Set,o=!1,s=!1;const i=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function c(d){i.has(d)&&(u.schedule(d),e()),l++,d(a)}const u={schedule:(d,f=!1,m=!1)=>{const y=m&&o?n:r;return f&&i.add(d),y.has(d)||y.add(d),d},cancel:d=>{r.delete(d),i.delete(d)},process:d=>{if(a=d,o){s=!0;return}o=!0,[n,r]=[r,n],n.forEach(c),t&&Lo.value&&Lo.value.frameloop[t].push(l),l=0,n.clear(),o=!1,s&&(s=!1,u.process(d))}};return u}const hc=40;function Do(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,i=an.reduce((v,b)=>(v[b]=fc(s,t?b:void 0),v),{}),{read:a,resolveKeyframes:l,update:c,preRender:u,render:d,postRender:f}=i,m=()=>{const v=performance.now();n=!1,o.delta=r?1e3/60:Math.max(Math.min(v-o.timestamp,hc),1),o.timestamp=v,o.isProcessing=!0,a.process(o),l.process(o),c.process(o),u.process(o),d.process(o),f.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(m))},p=()=>{n=!0,r=!0,o.isProcessing||e(m)};return{schedule:an.reduce((v,b)=>{const w=i[b];return v[b]=(M,_=!1,L=!1)=>(n||p(),w.schedule(M,_,L)),v},{}),cancel:v=>{for(let b=0;b<an.length;b++)i[an[b]].cancel(v)},state:o,steps:i}}const{schedule:U,cancel:Ne,state:re,steps:Hn}=Do(typeof requestAnimationFrame<"u"?requestAnimationFrame:de,!0),{schedule:Yn}=Do(queueMicrotask,!1);let ln;function pc(){ln=void 0}const be={now:()=>(ln===void 0&&be.set(re.isProcessing||ic.useManualTiming?re.timestamp:performance.now()),ln),set:e=>{ln=e,queueMicrotask(pc)}},ye={x:!1,y:!1};function Oo(){return ye.x||ye.y}function mc(e){return e==="x"||e==="y"?ye[e]?null:(ye[e]=!0,()=>{ye[e]=!1}):ye.x||ye.y?null:(ye.x=ye.y=!0,()=>{ye.x=ye.y=!1})}function gc(e,t,n){var r;if(e instanceof EventTarget)return[e];if(typeof e=="string"){let o=document;const s=(r=void 0)!==null&&r!==void 0?r:o.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e)}function ko(e,t){const n=gc(e),r=new AbortController,o={passive:!0,...t,signal:r.signal};return[n,o,()=>r.abort()]}function jo(e){return!(e.pointerType==="touch"||Oo())}function yc(e,t,n={}){const[r,o,s]=ko(e,n),i=a=>{if(!jo(a))return;const{target:l}=a,c=t(l,a);if(typeof c!="function"||!l)return;const u=d=>{jo(d)&&(c(d),l.removeEventListener("pointerleave",u))};l.addEventListener("pointerleave",u,o)};return r.forEach(a=>{a.addEventListener("pointerenter",i,o)}),s}function No(e,t){const n=`${t}PointerCapture`;if(e.target instanceof Element&&n in e.target&&e.pointerId!==void 0)try{e.target[n](e.pointerId)}catch{}}const Vo=(e,t)=>t?e===t?!0:Vo(e,t.parentElement):!1,Zn=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,vc=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function xc(e){return vc.has(e.tagName)||e.tabIndex!==-1}const Lt=new WeakSet;function Io(e){return t=>{t.key==="Enter"&&e(t)}}function Jn(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const bc=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Io(()=>{if(Lt.has(n))return;Jn(n,"down");const o=Io(()=>{Jn(n,"up")}),s=()=>Jn(n,"cancel");n.addEventListener("keyup",o,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function Ro(e){return Zn(e)&&!Oo()}function Sc(e,t,n={}){const[r,o,s]=ko(e,n),i=a=>{const l=a.currentTarget;if(!l||!Ro(a)||Lt.has(l))return;Lt.add(l),No(a,"set");const c=t(l,a),u=(m,p)=>{l.removeEventListener("pointerup",d),l.removeEventListener("pointercancel",f),No(m,"release"),!(!Ro(m)||!Lt.has(l))&&(Lt.delete(l),typeof c=="function"&&c(m,{success:p}))},d=m=>{(m.isTrusted?Cc(m,l instanceof Element?l.getBoundingClientRect():{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight}):!1)?u(m,!1):u(m,!(l instanceof Element)||Vo(l,m.target))},f=m=>{u(m,!1)};l.addEventListener("pointerup",d,o),l.addEventListener("pointercancel",f,o),l.addEventListener("lostpointercapture",f,o)};return r.forEach(a=>{a=n.useGlobalTarget?window:a;let l=!1;a instanceof HTMLElement&&(l=!0,!xc(a)&&a.getAttribute("tabindex")===null&&(a.tabIndex=0)),a.addEventListener("pointerdown",i,o),l&&a.addEventListener("focus",c=>bc(c,o),o)}),s}function Cc(e,t){return e.clientX<t.left||e.clientX>t.right||e.clientY<t.top||e.clientY>t.bottom}const Fo=30,wc=e=>!isNaN(parseFloat(e));class Tc{constructor(t,n={}){this.version="12.5.0",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,o=!0)=>{const s=be.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),o&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=be.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=wc(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&on(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Un);const r=this.events[t].add(n);return t==="change"?()=>{r(),U.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=be.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Fo)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Fo);return wo(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Dt(e,t){return new Tc(e,t)}const Bo=g.createContext({strict:!1}),$o={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"]},ut={};for(const e in $o)ut[e]={isEnabled:t=>$o[e].some(n=>!!t[n])};function _c(e){for(const t in e)ut[t]={...ut[t],...e[t]}}const Ec=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function cn(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Ec.has(e)}let zo=e=>!cn(e);function Pc(e){e&&(zo=t=>t.startsWith("on")?!cn(t):e(t))}try{Pc(require("@emotion/is-prop-valid").default)}catch{}function Ac(e,t,n){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||(zo(o)||n===!0&&cn(o)||!t&&!cn(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}function Mc(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>(process.env.NODE_ENV!=="production"&&on(!1,"motion() is deprecated. Use motion.create() instead."),e(...r));return new Proxy(n,{get:(r,o)=>o==="create"?e:(t.has(o)||t.set(o,e(o)),t.get(o))})}const un=g.createContext({});function dn(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Ot(e){return typeof e=="string"||Array.isArray(e)}const Qn=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],er=["initial",...Qn];function fn(e){return dn(e.animate)||er.some(t=>Ot(e[t]))}function Uo(e){return!!(fn(e)||e.variants)}function Lc(e,t){if(fn(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Ot(n)?n:void 0,animate:Ot(r)?r:void 0}}return e.inherit!==!1?t:{}}function Dc(e){const{initial:t,animate:n}=Lc(e,g.useContext(un));return g.useMemo(()=>({initial:t,animate:n}),[Xo(t),Xo(n)])}function Xo(e){return Array.isArray(e)?e.join(" "):e}const Oc=Symbol.for("motionComponentSymbol");function dt(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function kc(e,t,n){return g.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):dt(n)&&(n.current=r))},[t])}const tr=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Wo="data-"+tr("framerAppearId"),Ko=g.createContext({});function jc(e,t,n,r,o){var s,i;const{visualElement:a}=g.useContext(un),l=g.useContext(Bo),c=g.useContext(Fn),u=g.useContext(Co).reducedMotion,d=g.useRef(null);r=r||l.renderer,!d.current&&r&&(d.current=r(e,{visualState:t,parent:a,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u}));const f=d.current,m=g.useContext(Ko);f&&!f.projection&&o&&(f.type==="html"||f.type==="svg")&&Nc(d.current,n,o,m);const p=g.useRef(!1);g.useInsertionEffect(()=>{f&&p.current&&f.update(n,c)});const y=n[Wo],S=g.useRef(!!y&&!(!((s=window.MotionHandoffIsComplete)===null||s===void 0)&&s.call(window,y))&&((i=window.MotionHasOptimisedAnimation)===null||i===void 0?void 0:i.call(window,y)));return oc(()=>{f&&(p.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),Yn.render(f.render),S.current&&f.animationState&&f.animationState.animateChanges())}),g.useEffect(()=>{f&&(!S.current&&f.animationState&&f.animationState.animateChanges(),S.current&&(queueMicrotask(()=>{var v;(v=window.MotionHandoffMarkAsComplete)===null||v===void 0||v.call(window,y)}),S.current=!1))}),f}function Nc(e,t,n,r){const{layoutId:o,layout:s,drag:i,dragConstraints:a,layoutScroll:l,layoutRoot:c}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Go(e.parent)),e.projection.setOptions({layoutId:o,layout:s,alwaysMeasureLayout:!!i||a&&dt(a),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:c})}function Go(e){if(e)return e.options.allowProjection!==!1?e.projection:Go(e.parent)}function Vc({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:o}){var s,i;e&&_c(e);function a(c,u){let d;const f={...g.useContext(Co),...c,layoutId:Ic(c)},{isStatic:m}=f,p=Dc(c),y=r(c,m);if(!m&&Rn){Rc(f,e);const S=Fc(f);d=S.MeasureLayout,p.visualElement=jc(o,y,f,t,S.ProjectionNode)}return x.jsxs(un.Provider,{value:p,children:[d&&p.visualElement?x.jsx(d,{visualElement:p.visualElement,...f}):null,n(o,c,kc(y,p.visualElement,u),y,m,p.visualElement)]})}a.displayName=`motion.${typeof o=="string"?o:`create(${(i=(s=o.displayName)!==null&&s!==void 0?s:o.name)!==null&&i!==void 0?i:""})`}`;const l=g.forwardRef(a);return l[Oc]=o,l}function Ic({layoutId:e}){const t=g.useContext(So).id;return t&&e!==void 0?t+"-"+e:e}function Rc(e,t){const n=g.useContext(Bo).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?lt(!1,r):je(!1,r)}}function Fc(e){const{drag:t,layout:n}=ut;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const qo=e=>t=>typeof t=="string"&&t.startsWith(e),nr=qo("--"),Bc=qo("var(--"),rr=e=>Bc(e)?$c.test(e.split("/*")[0].trim()):!1,$c=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,kt={};function zc(e){for(const t in e)kt[t]=e[t],nr(t)&&(kt[t].isCSSVariable=!0)}const ft=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ge=new Set(ft);function Ho(e,{layout:t,layoutId:n}){return Ge.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!kt[e]||e==="opacity")}const se=e=>!!(e&&e.getVelocity),Yo=(e,t)=>t&&typeof e=="number"?t.transform(e):e,_e=(e,t,n)=>n>t?t:n<e?e:n,ht={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},jt={...ht,transform:e=>_e(0,1,e)},hn={...ht,default:1},Nt=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ve=Nt("deg"),Se=Nt("%"),D=Nt("px"),Uc=Nt("vh"),Xc=Nt("vw"),Zo={...Se,parse:e=>Se.parse(e)/100,transform:e=>Se.transform(e*100)},Wc={borderWidth:D,borderTopWidth:D,borderRightWidth:D,borderBottomWidth:D,borderLeftWidth:D,borderRadius:D,radius:D,borderTopLeftRadius:D,borderTopRightRadius:D,borderBottomRightRadius:D,borderBottomLeftRadius:D,width:D,maxWidth:D,height:D,maxHeight:D,top:D,right:D,bottom:D,left:D,padding:D,paddingTop:D,paddingRight:D,paddingBottom:D,paddingLeft:D,margin:D,marginTop:D,marginRight:D,marginBottom:D,marginLeft:D,backgroundPositionX:D,backgroundPositionY:D},Kc={rotate:Ve,rotateX:Ve,rotateY:Ve,rotateZ:Ve,scale:hn,scaleX:hn,scaleY:hn,scaleZ:hn,skew:Ve,skewX:Ve,skewY:Ve,distance:D,translateX:D,translateY:D,translateZ:D,x:D,y:D,z:D,perspective:D,transformPerspective:D,opacity:jt,originX:Zo,originY:Zo,originZ:D},Jo={...ht,transform:Math.round},or={...Wc,...Kc,zIndex:Jo,size:D,fillOpacity:jt,strokeOpacity:jt,numOctaves:Jo},Gc={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},qc=ft.length;function Hc(e,t,n){let r="",o=!0;for(let s=0;s<qc;s++){const i=ft[s],a=e[i];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(i.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=Yo(a,or[i]);if(!l){o=!1;const u=Gc[i]||i;r+=`${u}(${c}) `}n&&(t[i]=c)}}return r=r.trim(),n?r=n(t,o?"":r):o&&(r="none"),r}function sr(e,t,n){const{style:r,vars:o,transformOrigin:s}=e;let i=!1,a=!1;for(const l in t){const c=t[l];if(Ge.has(l)){i=!0;continue}else if(nr(l)){o[l]=c;continue}else{const u=Yo(c,or[l]);l.startsWith("origin")?(a=!0,s[l]=u):r[l]=u}}if(t.transform||(i||n?r.transform=Hc(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=s;r.transformOrigin=`${l} ${c} ${u}`}}const ir=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Qo(e,t,n){for(const r in t)!se(t[r])&&!Ho(r,n)&&(e[r]=t[r])}function Yc({transformTemplate:e},t){return g.useMemo(()=>{const n=ir();return sr(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Zc(e,t){const n=e.style||{},r={};return Qo(r,n,e),Object.assign(r,Yc(e,t)),r}function Jc(e,t){const n={},r=Zc(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 Qc=["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 ar(e){return typeof e!="string"||e.includes("-")?!1:!!(Qc.indexOf(e)>-1||/[A-Z]/u.test(e))}const eu={offset:"stroke-dashoffset",array:"stroke-dasharray"},tu={offset:"strokeDashoffset",array:"strokeDasharray"};function nu(e,t,n=1,r=0,o=!0){e.pathLength=1;const s=o?eu:tu;e[s.offset]=D.transform(-r);const i=D.transform(t),a=D.transform(n);e[s.array]=`${i} ${a}`}function es(e,t,n){return typeof e=="string"?e:D.transform(t+n*e)}function ru(e,t,n){const r=es(t,e.x,e.width),o=es(n,e.y,e.height);return`${r} ${o}`}function lr(e,{attrX:t,attrY:n,attrScale:r,originX:o,originY:s,pathLength:i,pathSpacing:a=1,pathOffset:l=0,...c},u,d){if(sr(e,c,d),u){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:m,dimensions:p}=e;f.transform&&(p&&(m.transform=f.transform),delete f.transform),p&&(o!==void 0||s!==void 0||m.transform)&&(m.transformOrigin=ru(p,o!==void 0?o:.5,s!==void 0?s:.5)),t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),i!==void 0&&nu(f,i,a,l,!1)}const ts=()=>({...ir(),attrs:{}}),cr=e=>typeof e=="string"&&e.toLowerCase()==="svg";function ou(e,t,n,r){const o=g.useMemo(()=>{const s=ts();return lr(s,t,cr(r),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};Qo(s,e.style,e),o.style={...s,...o.style}}return o}function su(e=!1){return(n,r,o,{latestValues:s},i)=>{const l=(ar(n)?ou:Jc)(r,s,i,n),c=Ac(r,typeof n=="string",e),u=n!==g.Fragment?{...c,...l,ref:o}:{},{children:d}=r,f=g.useMemo(()=>se(d)?d.get():d,[d]);return g.createElement(n,{...u,children:f})}}function ns(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function ur(e,t,n,r){if(typeof t=="function"){const[o,s]=ns(r);t=t(n!==void 0?n:e.custom,o,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[o,s]=ns(r);t=t(n!==void 0?n:e.custom,o,s)}return t}const dr=e=>Array.isArray(e),iu=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),au=e=>dr(e)?e[e.length-1]||0:e;function pn(e){const t=se(e)?e.get():e;return iu(t)?t.toValue():t}function lu({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,o,s){const i={latestValues:cu(r,o,s,e),renderState:t()};return n&&(i.onMount=a=>n({props:r,current:a,...i}),i.onUpdate=a=>n(a)),i}const rs=e=>(t,n)=>{const r=g.useContext(un),o=g.useContext(Fn),s=()=>lu(e,t,r,o);return n?s():rc(s)};function cu(e,t,n,r){const o={},s=r(e,{});for(const f in s)o[f]=pn(s[f]);let{initial:i,animate:a}=e;const l=fn(e),c=Uo(e);t&&c&&!l&&e.inherit!==!1&&(i===void 0&&(i=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||i===!1;const d=u?a:i;if(d&&typeof d!="boolean"&&!dn(d)){const f=Array.isArray(d)?d:[d];for(let m=0;m<f.length;m++){const p=ur(e,f[m]);if(p){const{transitionEnd:y,transition:S,...v}=p;for(const b in v){let w=v[b];if(Array.isArray(w)){const M=u?w.length-1:0;w=w[M]}w!==null&&(o[b]=w)}for(const b in y)o[b]=y[b]}}}return o}function fr(e,t,n){var r;const{style:o}=e,s={};for(const i in o)(se(o[i])||t.style&&se(t.style[i])||Ho(i,e)||((r=n==null?void 0:n.getValue(i))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(s[i]=o[i]);return s}const uu={useVisualState:rs({scrapeMotionValuesFromProps:fr,createRenderState:ir})};function os(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}function ss(e,{style:t,vars:n},r,o){Object.assign(e.style,t,o&&o.getProjectionStyles(r));for(const s in n)e.style.setProperty(s,n[s])}const is=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 as(e,t,n,r){ss(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(is.has(o)?o:tr(o),t.attrs[o])}function ls(e,t,n){const r=fr(e,t,n);for(const o in e)if(se(e[o])||se(t[o])){const s=ft.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[s]=e[o]}return r}const cs=["x","y","width","height","cx","cy","r"],du={useVisualState:rs({scrapeMotionValuesFromProps:ls,createRenderState:ts,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:o})=>{if(!n)return;let s=!!e.drag;if(!s){for(const a in o)if(Ge.has(a)){s=!0;break}}if(!s)return;let i=!t;if(t)for(let a=0;a<cs.length;a++){const l=cs[a];e[l]!==t[l]&&(i=!0)}i&&U.read(()=>{os(n,r),U.render(()=>{lr(r,o,cr(n.tagName),e.transformTemplate),as(n,r)})})}})};function fu(e,t){return function(r,{forwardMotionProps:o}={forwardMotionProps:!1}){const i={...ar(r)?du:uu,preloadedFeatures:e,useRender:su(o),createVisualElement:t,Component:r};return Vc(i)}}function Vt(e,t,n){const r=e.getProps();return ur(r,t,n!==void 0?n:r.custom,e)}const us=new Set(["width","height","top","left","right","bottom",...ft]);function hu(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Dt(n))}function pu(e,t){const n=Vt(e,t);let{transitionEnd:r={},transition:o={},...s}=n||{};s={...s,...r};for(const i in s){const a=au(s[i]);hu(e,i,a)}}function mu(e){return!!(se(e)&&e.add)}function hr(e,t){const n=e.getValue("willChange");if(mu(n))return n.add(t)}function ds(e){return e.props[Wo]}const fs=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,gu=1e-7,yu=12;function vu(e,t,n,r,o){let s,i,a=0;do i=t+(n-t)/2,s=fs(i,r,o)-e,s>0?n=i:t=i;while(Math.abs(s)>gu&&++a<yu);return i}function It(e,t,n,r){if(e===t&&n===r)return de;const o=s=>vu(s,0,1,e,n);return s=>s===0||s===1?s:fs(o(s),t,r)}const hs=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,ps=e=>t=>1-e(1-t),ms=It(.33,1.53,.69,.99),pr=ps(ms),gs=hs(pr),ys=e=>(e*=2)<1?.5*pr(e):.5*(2-Math.pow(2,-10*(e-1))),mr=e=>1-Math.sin(Math.acos(e)),vs=ps(mr),xs=hs(mr),bs=e=>/^0[^.\s]+$/u.test(e);function xu(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||bs(e):!0}const Rt=e=>Math.round(e*1e5)/1e5,gr=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function bu(e){return e==null}const Su=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,yr=(e,t)=>n=>!!(typeof n=="string"&&Su.test(n)&&n.startsWith(e)||t&&!bu(n)&&Object.prototype.hasOwnProperty.call(n,t)),Ss=(e,t,n)=>r=>{if(typeof r!="string")return r;const[o,s,i,a]=r.match(gr);return{[e]:parseFloat(o),[t]:parseFloat(s),[n]:parseFloat(i),alpha:a!==void 0?parseFloat(a):1}},Cu=e=>_e(0,255,e),vr={...ht,transform:e=>Math.round(Cu(e))},qe={test:yr("rgb","red"),parse:Ss("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+vr.transform(e)+", "+vr.transform(t)+", "+vr.transform(n)+", "+Rt(jt.transform(r))+")"};function wu(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const xr={test:yr("#"),parse:wu,transform:qe.transform},pt={test:yr("hsl","hue"),parse:Ss("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Se.transform(Rt(t))+", "+Se.transform(Rt(n))+", "+Rt(jt.transform(r))+")"},ie={test:e=>qe.test(e)||xr.test(e)||pt.test(e),parse:e=>qe.test(e)?qe.parse(e):pt.test(e)?pt.parse(e):xr.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?qe.transform(e):pt.transform(e)},Tu=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function _u(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(gr))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(Tu))===null||n===void 0?void 0:n.length)||0)>0}const Cs="number",ws="color",Eu="var",Pu="var(",Ts="${}",Au=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Ft(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let s=0;const a=t.replace(Au,l=>(ie.test(l)?(r.color.push(s),o.push(ws),n.push(ie.parse(l))):l.startsWith(Pu)?(r.var.push(s),o.push(Eu),n.push(l)):(r.number.push(s),o.push(Cs),n.push(parseFloat(l))),++s,Ts)).split(Ts);return{values:n,split:a,indexes:r,types:o}}function _s(e){return Ft(e).values}function Es(e){const{split:t,types:n}=Ft(e),r=t.length;return o=>{let s="";for(let i=0;i<r;i++)if(s+=t[i],o[i]!==void 0){const a=n[i];a===Cs?s+=Rt(o[i]):a===ws?s+=ie.transform(o[i]):s+=o[i]}return s}}const Mu=e=>typeof e=="number"?0:e;function Lu(e){const t=_s(e);return Es(e)(t.map(Mu))}const Ie={test:_u,parse:_s,createTransformer:Es,getAnimatableNone:Lu},Du=new Set(["brightness","contrast","saturate","opacity"]);function Ou(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(gr)||[];if(!r)return e;const o=n.replace(r,"");let s=Du.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+o+")"}const ku=/\b([a-z-]*)\(.*?\)/gu,br={...Ie,getAnimatableNone:e=>{const t=e.match(ku);return t?t.map(Ou).join(" "):e}},ju={...or,color:ie,backgroundColor:ie,outlineColor:ie,fill:ie,stroke:ie,borderColor:ie,borderTopColor:ie,borderRightColor:ie,borderBottomColor:ie,borderLeftColor:ie,filter:br,WebkitFilter:br},Ps=e=>ju[e];function As(e,t){let n=Ps(e);return n!==br&&(n=Ie),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Nu=new Set(["auto","none","0"]);function Vu(e,t,n){let r=0,o;for(;r<e.length&&!o;){const s=e[r];typeof s=="string"&&!Nu.has(s)&&Ft(s).values.length&&(o=e[r]),r++}if(o&&n)for(const s of t)e[s]=As(n,o)}const He=e=>e*180/Math.PI,Sr=e=>{const t=He(Math.atan2(e[1],e[0]));return Cr(t)},Iu={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Sr,rotateZ:Sr,skewX:e=>He(Math.atan(e[1])),skewY:e=>He(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Cr=e=>(e=e%360,e<0&&(e+=360),e),Ms=Sr,Ls=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Ds=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Ru={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ls,scaleY:Ds,scale:e=>(Ls(e)+Ds(e))/2,rotateX:e=>Cr(He(Math.atan2(e[6],e[5]))),rotateY:e=>Cr(He(Math.atan2(-e[2],e[0]))),rotateZ:Ms,rotate:Ms,skewX:e=>He(Math.atan(e[4])),skewY:e=>He(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Os(e){return e.includes("scale")?1:0}function wr(e,t){if(!e||e==="none")return Os(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,o;if(n)r=Ru,o=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Iu,o=a}if(!o)return Os(t);const s=r[t],i=o[1].split(",").map(Bu);return typeof s=="function"?s(i):i[s]}const Fu=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return wr(n,t)};function Bu(e){return parseFloat(e.trim())}const ks=e=>e===ht||e===D,$u=new Set(["x","y","z"]),zu=ft.filter(e=>!$u.has(e));function Uu(e){const t=[];return zu.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const mt={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>wr(t,"x"),y:(e,{transform:t})=>wr(t,"y")};mt.translateX=mt.x,mt.translateY=mt.y;const Ye=new Set;let Tr=!1,_r=!1;function js(){if(_r){const e=Array.from(Ye).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const o=Uu(r);o.length&&(n.set(r,o),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const o=n.get(r);o&&o.forEach(([s,i])=>{var a;(a=r.getValue(s))===null||a===void 0||a.set(i)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}_r=!1,Tr=!1,Ye.forEach(e=>e.complete()),Ye.clear()}function Ns(){Ye.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(_r=!0)})}function Xu(){Ns(),js()}class Er{constructor(t,n,r,o,s,i=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=o,this.element=s,this.isAsync=i}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Ye.add(this),Tr||(Tr=!0,U.read(Ns),U.resolveKeyframes(js))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:o}=this;for(let s=0;s<t.length;s++)if(t[s]===null)if(s===0){const i=o==null?void 0:o.get(),a=t[t.length-1];if(i!==void 0)t[0]=i;else if(r&&n){const l=r.readValue(n,a);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=a),o&&i===void 0&&o.set(t[0])}else t[s]=t[s-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Ye.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Ye.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Vs=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Wu=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ku(e){const t=Wu.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${n??r}`,o]}const Gu=4;function Is(e,t,n=1){je(n<=Gu,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,o]=Ku(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const i=s.trim();return Vs(i)?parseFloat(i):i}return rr(o)?Is(o,t,n+1):o}const Rs=e=>t=>t.test(e),Fs=[ht,D,Se,Ve,Xc,Uc,{test:e=>e==="auto",parse:e=>e}],Bs=e=>Fs.find(Rs(e));class $s extends Er{constructor(t,n,r,o,s){super(t,n,r,o,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let c=t[l];if(typeof c=="string"&&(c=c.trim(),rr(c))){const u=Is(c,n.current);u!==void 0&&(t[l]=u),l===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!us.has(r)||t.length!==2)return;const[o,s]=t,i=Bs(o),a=Bs(s);if(i!==a)if(ks(i)&&ks(a))for(let l=0;l<t.length;l++){const c=t[l];typeof c=="string"&&(t[l]=parseFloat(c))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let o=0;o<t.length;o++)xu(t[o])&&r.push(o);r.length&&Vu(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=mt[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const o=n[n.length-1];o!==void 0&&t.getValue(r,o).jump(o,!1)}measureEndState(){var t;const{element:n,name:r,unresolvedKeyframes:o}=this;if(!n||!n.current)return;const s=n.getValue(r);s&&s.jump(this.measuredOrigin,!1);const i=o.length-1,a=o[i];o[i]=mt[r](n.measureViewportBox(),window.getComputedStyle(n.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([l,c])=>{n.getValue(l).set(c)}),this.resolveNoneKeyframes()}}const zs=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Ie.test(e)||e==="0")&&!e.startsWith("url("));function qu(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Hu(e,t,n,r){const o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;const s=e[e.length-1],i=zs(o,t),a=zs(s,t);return lt(i===a,`You are trying to animate ${t} from "${o}" to "${s}". ${o} is not an animatable value - to enable this animation set ${o} to a value animatable to ${s} via the \`style\` property.`),!i||!a?!1:qu(e)||(n==="spring"||Kn(n))&&r}const Yu=e=>e!==null;function mn(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(Yu),s=t&&n!=="loop"&&t%2===1?0:o.length-1;return!s||r===void 0?o[s]:r}const Zu=40;class Us{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:o=0,repeatDelay:s=0,repeatType:i="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=be.now(),this.options={autoplay:t,delay:n,type:r,repeat:o,repeatDelay:s,repeatType:i,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>Zu?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&Xu(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=be.now(),this.hasAttemptedResolve=!0;const{name:r,type:o,velocity:s,delay:i,onComplete:a,onUpdate:l,isGenerator:c}=this.options;if(!c&&!Hu(t,r,o,s))if(i)this.options.duration=0;else{l&&l(mn(t,this.options,n)),a&&a(),this.resolveFinishedPromise();return}const u=this.initPlayback(t,n);u!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...u},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear")}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const K=(e,t,n)=>e+(t-e)*n;function Pr(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Ju({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let o=0,s=0,i=0;if(!t)o=s=i=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;o=Pr(l,a,e+1/3),s=Pr(l,a,e),i=Pr(l,a,e-1/3)}return{red:Math.round(o*255),green:Math.round(s*255),blue:Math.round(i*255),alpha:r}}function gn(e,t){return n=>n>0?t:e}const Ar=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},Qu=[xr,qe,pt],ed=e=>Qu.find(t=>t.test(e));function Xs(e){const t=ed(e);if(lt(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let n=t.parse(e);return t===pt&&(n=Ju(n)),n}const Ws=(e,t)=>{const n=Xs(e),r=Xs(t);if(!n||!r)return gn(e,t);const o={...n};return s=>(o.red=Ar(n.red,r.red,s),o.green=Ar(n.green,r.green,s),o.blue=Ar(n.blue,r.blue,s),o.alpha=K(n.alpha,r.alpha,s),qe.transform(o))},td=(e,t)=>n=>t(e(n)),Bt=(...e)=>e.reduce(td),Mr=new Set(["none","hidden"]);function nd(e,t){return Mr.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function rd(e,t){return n=>K(e,t,n)}function Lr(e){return typeof e=="number"?rd:typeof e=="string"?rr(e)?gn:ie.test(e)?Ws:id:Array.isArray(e)?Ks:typeof e=="object"?ie.test(e)?Ws:od:gn}function Ks(e,t){const n=[...e],r=n.length,o=e.map((s,i)=>Lr(s)(s,t[i]));return s=>{for(let i=0;i<r;i++)n[i]=o[i](s);return n}}function od(e,t){const n={...e,...t},r={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(r[o]=Lr(e[o])(e[o],t[o]));return o=>{for(const s in r)n[s]=r[s](o);return n}}function sd(e,t){var n;const r=[],o={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const i=t.types[s],a=e.indexes[i][o[i]],l=(n=e.values[a])!==null&&n!==void 0?n:0;r[s]=l,o[i]++}return r}const id=(e,t)=>{const n=Ie.createTransformer(t),r=Ft(e),o=Ft(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?Mr.has(e)&&!o.values.length||Mr.has(t)&&!r.values.length?nd(e,t):Bt(Ks(sd(r,o),o.values),n):(lt(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),gn(e,t))};function Gs(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?K(e,t,n):Lr(e)(e,t)}const ad=5;function qs(e,t,n){const r=Math.max(t-ad,0);return wo(n-e(r),t-r)}const G={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Hs=.001;function ld({duration:e=G.duration,bounce:t=G.bounce,velocity:n=G.velocity,mass:r=G.mass}){let o,s;lt(e<=xe(G.maxDuration),"Spring duration must be 10 seconds or less");let i=1-t;i=_e(G.minDamping,G.maxDamping,i),e=_e(G.minDuration,G.maxDuration,Te(e)),i<1?(o=c=>{const u=c*i,d=u*e,f=u-n,m=Dr(c,i),p=Math.exp(-d);return Hs-f/m*p},s=c=>{const d=c*i*e,f=d*n+n,m=Math.pow(i,2)*Math.pow(c,2)*e,p=Math.exp(-d),y=Dr(Math.pow(c,2),i);return(-o(c)+Hs>0?-1:1)*((f-m)*p)/y}):(o=c=>{const u=Math.exp(-c*e),d=(c-n)*e+1;return-.001+u*d},s=c=>{const u=Math.exp(-c*e),d=(n-c)*(e*e);return u*d});const a=5/e,l=ud(o,s,a);if(e=xe(e),isNaN(l))return{stiffness:G.stiffness,damping:G.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:i*2*Math.sqrt(r*c),duration:e}}}const cd=12;function ud(e,t,n){let r=n;for(let o=1;o<cd;o++)r=r-e(r)/t(r);return r}function Dr(e,t){return e*Math.sqrt(1-t*t)}const dd=["duration","bounce"],fd=["stiffness","damping","mass"];function Ys(e,t){return t.some(n=>e[n]!==void 0)}function hd(e){let t={velocity:G.velocity,stiffness:G.stiffness,damping:G.damping,mass:G.mass,isResolvedFromDuration:!1,...e};if(!Ys(e,fd)&&Ys(e,dd))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),o=r*r,s=2*_e(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:G.mass,stiffness:o,damping:s}}else{const n=ld(e);t={...t,...n,mass:G.mass},t.isResolvedFromDuration=!0}return t}function Zs(e=G.visualDuration,t=G.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:o}=n;const s=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:l,damping:c,mass:u,duration:d,velocity:f,isResolvedFromDuration:m}=hd({...n,velocity:-Te(n.velocity||0)}),p=f||0,y=c/(2*Math.sqrt(l*u)),S=i-s,v=Te(Math.sqrt(l/u)),b=Math.abs(S)<5;r||(r=b?G.restSpeed.granular:G.restSpeed.default),o||(o=b?G.restDelta.granular:G.restDelta.default);let w;if(y<1){const _=Dr(v,y);w=L=>{const k=Math.exp(-y*v*L);return i-k*((p+y*v*S)/_*Math.sin(_*L)+S*Math.cos(_*L))}}else if(y===1)w=_=>i-Math.exp(-v*_)*(S+(p+v*S)*_);else{const _=v*Math.sqrt(y*y-1);w=L=>{const k=Math.exp(-y*v*L),A=Math.min(_*L,300);return i-k*((p+y*v*S)*Math.sinh(A)+_*S*Math.cosh(A))/_}}const M={calculatedDuration:m&&d||null,next:_=>{const L=w(_);if(m)a.done=_>=d;else{let k=0;y<1&&(k=_===0?xe(p):qs(w,_,L));const A=Math.abs(k)<=r,V=Math.abs(i-L)<=o;a.done=A&&V}return a.value=a.done?i:L,a},toString:()=>{const _=Math.min(_o(M),Wn),L=Po(k=>M.next(_*k).value,_,30);return _+"ms "+L}};return M}function Js({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:s=500,modifyTarget:i,min:a,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],f={done:!1,value:d},m=A=>a!==void 0&&A<a||l!==void 0&&A>l,p=A=>a===void 0?l:l===void 0||Math.abs(a-A)<Math.abs(l-A)?a:l;let y=n*t;const S=d+y,v=i===void 0?S:i(S);v!==S&&(y=v-d);const b=A=>-y*Math.exp(-A/r),w=A=>v+b(A),M=A=>{const V=b(A),E=w(A);f.done=Math.abs(V)<=c,f.value=f.done?v:E};let _,L;const k=A=>{m(f.value)&&(_=A,L=Zs({keyframes:[f.value,p(f.value)],velocity:qs(w,A,f.value),damping:o,stiffness:s,restDelta:c,restSpeed:u}))};return k(0),{calculatedDuration:null,next:A=>{let V=!1;return!L&&_===void 0&&(V=!0,M(A),k(A)),_!==void 0&&A>=_?L.next(A-_):(!V&&M(A),f)}}}const pd=It(.42,0,1,1),md=It(0,0,.58,1),Qs=It(.42,0,.58,1),gd=e=>Array.isArray(e)&&typeof e[0]!="number",ei={linear:de,easeIn:pd,easeInOut:Qs,easeOut:md,circIn:mr,circInOut:xs,circOut:vs,backIn:pr,backInOut:gs,backOut:ms,anticipate:ys},ti=e=>{if(Gn(e)){je(e.length===4,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,o]=e;return It(t,n,r,o)}else if(typeof e=="string")return je(ei[e]!==void 0,`Invalid easing type '${e}'`),ei[e];return e};function yd(e,t,n){const r=[],o=n||Gs,s=e.length-1;for(let i=0;i<s;i++){let a=o(e[i],e[i+1]);if(t){const l=Array.isArray(t)?t[i]||de:t;a=Bt(l,a)}r.push(a)}return r}function vd(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const s=e.length;if(je(s===t.length,"Both input and output ranges must be the same length"),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];const i=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=yd(t,r,o),l=a.length,c=u=>{if(i&&u<e[0])return t[0];let d=0;if(l>1)for(;d<e.length-2&&!(u<e[d+1]);d++);const f=ct(e[d],e[d+1],u);return a[d](f)};return n?u=>c(_e(e[0],e[s-1],u)):c}function xd(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=ct(0,t,r);e.push(K(n,1,o))}}function bd(e){const t=[0];return xd(t,e.length-1),t}function Sd(e,t){return e.map(n=>n*t)}function Cd(e,t){return e.map(()=>t||Qs).splice(0,e.length-1)}function $t({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=gd(r)?r.map(ti):ti(r),s={done:!1,value:t[0]},i=Sd(n&&n.length===t.length?n:bd(t),e),a=vd(i,t,{ease:Array.isArray(o)?o:Cd(t,o)});return{calculatedDuration:e,next:l=>(s.value=a(l),s.done=l>=e,s)}}const wd=e=>{const t=({timestamp:n})=>e(n);return{start:()=>U.update(t,!0),stop:()=>Ne(t),now:()=>re.isProcessing?re.timestamp:be.now()}},Td={decay:Js,inertia:Js,tween:$t,keyframes:$t,spring:Zs},_d=e=>e/100;class Or extends Us{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:n,motionValue:r,element:o,keyframes:s}=this.options,i=(o==null?void 0:o.KeyframeResolver)||Er,a=(l,c)=>this.onKeyframesResolved(l,c);this.resolver=new i(s,a,n,r,o),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:s,velocity:i=0}=this.options,a=Kn(n)?n:Td[n]||$t;let l,c;process.env.NODE_ENV!=="production"&&a!==$t&&je(t.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${t}`),a!==$t&&typeof t[0]!="number"&&(l=Bt(_d,Gs(t[0],t[1])),t=[0,100]);const u=a({...this.options,keyframes:t});s==="mirror"&&(c=a({...this.options,keyframes:[...t].reverse(),velocity:-i})),u.calculatedDuration===null&&(u.calculatedDuration=_o(u));const{calculatedDuration:d}=u,f=d+o,m=f*(r+1)-o;return{generator:u,mirroredGenerator:c,mapPercentToKeyframes:l,calculatedDuration:d,resolvedDuration:f,totalDuration:m}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:A}=this.options;return{done:!0,value:A[A.length-1]}}const{finalKeyframe:o,generator:s,mirroredGenerator:i,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:c,totalDuration:u,resolvedDuration:d}=r;if(this.startTime===null)return s.next(0);const{delay:f,repeat:m,repeatType:p,repeatDelay:y,onUpdate:S}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const v=this.currentTime-f*(this.speed>=0?1:-1),b=this.speed>=0?v<0:v>u;this.currentTime=Math.max(v,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=u);let w=this.currentTime,M=s;if(m){const A=Math.min(this.currentTime,u)/d;let V=Math.floor(A),E=A%1;!E&&A>=1&&(E=1),E===1&&V--,V=Math.min(V,m+1),!!(V%2)&&(p==="reverse"?(E=1-E,y&&(E-=y/d)):p==="mirror"&&(M=i)),w=_e(0,1,E)*d}const _=b?{done:!1,value:l[0]}:M.next(w);a&&(_.value=a(_.value));let{done:L}=_;!b&&c!==null&&(L=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const k=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&L);return k&&o!==void 0&&(_.value=mn(l,this.options,o)),S&&S(_.value),k&&this.finish(),_}get duration(){const{resolved:t}=this;return t?Te(t.calculatedDuration):0}get time(){return Te(this.currentTime)}set time(t){t=xe(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=Te(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=wd,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),n&&n();const o=this.driver.now();this.holdTime!==null?this.startTime=o-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=o):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const Ed=new Set(["opacity","clipPath","filter","transform"]);function Pd(e,t,n,{delay:r=0,duration:o=300,repeat:s=0,repeatType:i="loop",ease:a="easeInOut",times:l}={}){const c={[t]:n};l&&(c.offset=l);const u=Mo(a,o);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:r,duration:o,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:s+1,direction:i==="reverse"?"alternate":"normal"})}const Ad=zn(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),yn=10,Md=2e4;function Ld(e){return Kn(e.type)||e.type==="spring"||!Ao(e.ease)}function Dd(e,t){const n=new Or({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const o=[];let s=0;for(;!r.done&&s<Md;)r=n.sample(s),o.push(r.value),s+=yn;return{times:void 0,keyframes:o,duration:s-yn,ease:"linear"}}const ni={anticipate:ys,backInOut:gs,circInOut:xs};function Od(e){return e in ni}class ri extends Us{constructor(t){super(t);const{name:n,motionValue:r,element:o,keyframes:s}=this.options;this.resolver=new $s(s,(i,a)=>this.onKeyframesResolved(i,a),n,r,o),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:o,ease:s,type:i,motionValue:a,name:l,startTime:c}=this.options;if(!a.owner||!a.owner.current)return!1;if(typeof s=="string"&&sn()&&Od(s)&&(s=ni[s]),Ld(this.options)){const{onComplete:d,onUpdate:f,motionValue:m,element:p,...y}=this.options,S=Dd(t,y);t=S.keyframes,t.length===1&&(t[1]=t[0]),r=S.duration,o=S.times,s=S.ease,i="keyframes"}const u=Pd(a.owner.current,l,t,{...this.options,duration:r,times:o,ease:s});return u.startTime=c??this.calcStartTime(),this.pendingTimeline?(Eo(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:d}=this.options;a.set(mn(t,this.options,n)),d&&d(),this.cancel(),this.resolveFinishedPromise()},{animation:u,duration:r,times:o,type:i,ease:s,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return Te(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return Te(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=xe(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return de;const{animation:r}=n;Eo(r,t)}return de}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:o,type:s,ease:i,times:a}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:c,onUpdate:u,onComplete:d,element:f,...m}=this.options,p=new Or({...m,keyframes:r,duration:o,type:s,ease:i,times:a,isGenerator:!0}),y=xe(this.time);c.setWithVelocity(p.sample(y-yn).value,p.sample(y).value,yn)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:o,repeatType:s,damping:i,type:a}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=n.owner.getProps();return Ad()&&r&&Ed.has(r)&&!l&&!c&&!o&&s!=="mirror"&&i!==0&&a!=="inertia"}}const kd={type:"spring",stiffness:500,damping:25,restSpeed:10},jd=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Nd={type:"keyframes",duration:.8},Vd={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Id=(e,{keyframes:t})=>t.length>2?Nd:Ge.has(e)?e.startsWith("scale")?jd(t[1]):kd:Vd;function Rd({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:s,repeatType:i,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const kr=(e,t,n,r={},o,s)=>i=>{const a=Xn(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-xe(l);let u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:f=>{t.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{i(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:s?void 0:o};Rd(a)||(u={...u,...Id(e,u)}),u.duration&&(u.duration=xe(u.duration)),u.repeatDelay&&(u.repeatDelay=xe(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(u.duration=0,u.delay===0&&(d=!0)),u.allowFlatten=!a.type&&!a.ease,d&&!s&&t.get()!==void 0){const f=mn(u.keyframes,a);if(f!==void 0)return U.update(()=>{u.onUpdate(f),u.onComplete()}),new cc([])}return!s&&ri.supports(u)?new ri(u):new Or(u)};function Fd({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function oi(e,t,{delay:n=0,transitionOverride:r,type:o}={}){var s;let{transition:i=e.getDefaultTransition(),transitionEnd:a,...l}=t;r&&(i=r);const c=[],u=o&&e.animationState&&e.animationState.getState()[o];for(const d in l){const f=e.getValue(d,(s=e.latestValues[d])!==null&&s!==void 0?s:null),m=l[d];if(m===void 0||u&&Fd(u,d))continue;const p={delay:n,...Xn(i||{},d)};let y=!1;if(window.MotionHandoffAnimation){const v=ds(e);if(v){const b=window.MotionHandoffAnimation(v,d,U);b!==null&&(p.startTime=b,y=!0)}}hr(e,d),f.start(kr(d,f,m,e.shouldReduceMotion&&us.has(d)?{type:!1}:p,e,y));const S=f.animation;S&&c.push(S)}return a&&Promise.all(c).then(()=>{U.update(()=>{a&&pu(e,a)})}),c}function jr(e,t,n={}){var r;const o=Vt(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=o||{};n.transitionOverride&&(s=n.transitionOverride);const i=o?()=>Promise.all(oi(e,o,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:d,staggerDirection:f}=s;return Bd(e,t,u+c,d,f,n)}:()=>Promise.resolve(),{when:l}=s;if(l){const[c,u]=l==="beforeChildren"?[i,a]:[a,i];return c().then(()=>u())}else return Promise.all([i(),a(n.delay)])}function Bd(e,t,n=0,r=0,o=1,s){const i=[],a=(e.variantChildren.size-1)*r,l=o===1?(c=0)=>c*r:(c=0)=>a-c*r;return Array.from(e.variantChildren).sort($d).forEach((c,u)=>{c.notify("AnimationStart",t),i.push(jr(c,t,{...s,delay:n+l(u)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(i)}function $d(e,t){return e.sortNodePosition(t)}function zd(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(s=>jr(e,s,n));r=Promise.all(o)}else if(typeof t=="string")r=jr(e,t,n);else{const o=typeof t=="function"?Vt(e,t,n.custom):t;r=Promise.all(oi(e,o,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function si(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const Ud=er.length;function ii(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?ii(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Ud;n++){const r=er[n],o=e.props[r];(Ot(o)||o===!1)&&(t[r]=o)}return t}const Xd=[...Qn].reverse(),Wd=Qn.length;function Kd(e){return t=>Promise.all(t.map(({animation:n,options:r})=>zd(e,n,r)))}function Gd(e){let t=Kd(e),n=ai(),r=!0;const o=l=>(c,u)=>{var d;const f=Vt(e,u,l==="exit"?(d=e.presenceContext)===null||d===void 0?void 0:d.custom:void 0);if(f){const{transition:m,transitionEnd:p,...y}=f;c={...c,...y,...p}}return c};function s(l){t=l(e)}function i(l){const{props:c}=e,u=ii(e.parent)||{},d=[],f=new Set;let m={},p=1/0;for(let S=0;S<Wd;S++){const v=Xd[S],b=n[v],w=c[v]!==void 0?c[v]:u[v],M=Ot(w),_=v===l?b.isActive:null;_===!1&&(p=S);let L=w===u[v]&&w!==c[v]&&M;if(L&&r&&e.manuallyAnimateOnMount&&(L=!1),b.protectedKeys={...m},!b.isActive&&_===null||!w&&!b.prevProp||dn(w)||typeof w=="boolean")continue;const k=qd(b.prevProp,w);let A=k||v===l&&b.isActive&&!L&&M||S>p&&M,V=!1;const E=Array.isArray(w)?w:[w];let X=E.reduce(o(v),{});_===!1&&(X={});const{prevResolvedValues:$={}}=b,ee={...$,...X},le=W=>{A=!0,f.has(W)&&(V=!0,f.delete(W)),b.needsAnimating[W]=!0;const C=e.getValue(W);C&&(C.liveStyle=!1)};for(const W in ee){const C=X[W],I=$[W];if(m.hasOwnProperty(W))continue;let B=!1;dr(C)&&dr(I)?B=!si(C,I):B=C!==I,B?C!=null?le(W):f.add(W):C!==void 0&&f.has(W)?le(W):b.protectedKeys[W]=!0}b.prevProp=w,b.prevResolvedValues=X,b.isActive&&(m={...m,...X}),r&&e.blockInitialAnimation&&(A=!1),A&&(!(L&&k)||V)&&d.push(...E.map(W=>({animation:W,options:{type:v}})))}if(f.size){const S={};if(typeof c.initial!="boolean"){const v=Vt(e,Array.isArray(c.initial)?c.initial[0]:c.initial);v&&v.transition&&(S.transition=v.transition)}f.forEach(v=>{const b=e.getBaseTarget(v),w=e.getValue(v);w&&(w.liveStyle=!0),S[v]=b??null}),d.push({animation:S})}let y=!!d.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(y=!1),r=!1,y?t(d):Promise.resolve()}function a(l,c){var u;if(n[l].isActive===c)return Promise.resolve();(u=e.variantChildren)===null||u===void 0||u.forEach(f=>{var m;return(m=f.animationState)===null||m===void 0?void 0:m.setActive(l,c)}),n[l].isActive=c;const d=i(l);for(const f in n)n[f].protectedKeys={};return d}return{animateChanges:i,setActive:a,setAnimateFunction:s,getState:()=>n,reset:()=>{n=ai(),r=!0}}}function qd(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!si(t,e):!1}function Ze(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ai(){return{animate:Ze(!0),whileInView:Ze(),whileHover:Ze(),whileTap:Ze(),whileDrag:Ze(),whileFocus:Ze(),exit:Ze()}}class Re{constructor(t){this.isMounted=!1,this.node=t}update(){}}class Hd extends Re{constructor(t){super(t),t.animationState||(t.animationState=Gd(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();dn(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let Yd=0;class Zd extends Re{constructor(){super(...arguments),this.id=Yd++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const o=this.node.animationState.setActive("exit",!t);n&&!t&&o.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const Jd={animation:{Feature:Hd},exit:{Feature:Zd}};function zt(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Ut(e){return{point:{x:e.pageX,y:e.pageY}}}const Qd=e=>t=>Zn(t)&&e(t,Ut(t));function Xt(e,t,n,r){return zt(e,t,Qd(n),r)}function li({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function ef({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function tf(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}const ci=1e-4,nf=1-ci,rf=1+ci,ui=.01,of=0-ui,sf=0+ui;function ae(e){return e.max-e.min}function af(e,t,n){return Math.abs(e-t)<=n}function di(e,t,n,r=.5){e.origin=r,e.originPoint=K(t.min,t.max,e.origin),e.scale=ae(n)/ae(t),e.translate=K(n.min,n.max,e.origin)-e.originPoint,(e.scale>=nf&&e.scale<=rf||isNaN(e.scale))&&(e.scale=1),(e.translate>=of&&e.translate<=sf||isNaN(e.translate))&&(e.translate=0)}function Wt(e,t,n,r){di(e.x,t.x,n.x,r?r.originX:void 0),di(e.y,t.y,n.y,r?r.originY:void 0)}function fi(e,t,n){e.min=n.min+t.min,e.max=e.min+ae(t)}function lf(e,t,n){fi(e.x,t.x,n.x),fi(e.y,t.y,n.y)}function hi(e,t,n){e.min=t.min-n.min,e.max=e.min+ae(t)}function Kt(e,t,n){hi(e.x,t.x,n.x),hi(e.y,t.y,n.y)}const pi=()=>({translate:0,scale:1,origin:0,originPoint:0}),gt=()=>({x:pi(),y:pi()}),mi=()=>({min:0,max:0}),H=()=>({x:mi(),y:mi()});function pe(e){return[e("x"),e("y")]}function Nr(e){return e===void 0||e===1}function Vr({scale:e,scaleX:t,scaleY:n}){return!Nr(e)||!Nr(t)||!Nr(n)}function Je(e){return Vr(e)||gi(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function gi(e){return yi(e.x)||yi(e.y)}function yi(e){return e&&e!=="0%"}function vn(e,t,n){const r=e-n,o=t*r;return n+o}function vi(e,t,n,r,o){return o!==void 0&&(e=vn(e,o,r)),vn(e,n,r)+t}function Ir(e,t=0,n=1,r,o){e.min=vi(e.min,t,n,r,o),e.max=vi(e.max,t,n,r,o)}function xi(e,{x:t,y:n}){Ir(e.x,t.translate,t.scale,t.originPoint),Ir(e.y,n.translate,n.scale,n.originPoint)}const bi=.999999999999,Si=1.0000000000001;function cf(e,t,n,r=!1){const o=n.length;if(!o)return;t.x=t.y=1;let s,i;for(let a=0;a<o;a++){s=n[a],i=s.projectionDelta;const{visualElement:l}=s.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&vt(e,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),i&&(t.x*=i.x.scale,t.y*=i.y.scale,xi(e,i)),r&&Je(s.latestValues)&&vt(e,s.latestValues))}t.x<Si&&t.x>bi&&(t.x=1),t.y<Si&&t.y>bi&&(t.y=1)}function yt(e,t){e.min=e.min+t,e.max=e.max+t}function Ci(e,t,n,r,o=.5){const s=K(e.min,e.max,o);Ir(e,t,n,s,r)}function vt(e,t){Ci(e.x,t.x,t.scaleX,t.scale,t.originX),Ci(e.y,t.y,t.scaleY,t.scale,t.originY)}function wi(e,t){return li(tf(e.getBoundingClientRect(),t))}function uf(e,t,n){const r=wi(e,n),{scroll:o}=t;return o&&(yt(r.x,o.offset.x),yt(r.y,o.offset.y)),r}const Ti=({current:e})=>e?e.ownerDocument.defaultView:null,_i=(e,t)=>Math.abs(e-t);function df(e,t){const n=_i(e.x,t.x),r=_i(e.y,t.y);return Math.sqrt(n**2+r**2)}class Ei{constructor(t,n,{transformPagePoint:r,contextWindow:o,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=Fr(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,m=df(d.offset,{x:0,y:0})>=3;if(!f&&!m)return;const{point:p}=d,{timestamp:y}=re;this.history.push({...p,timestamp:y});const{onStart:S,onMove:v}=this.handlers;f||(S&&S(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,d)},this.handlePointerMove=(d,f)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=Rr(f,this.transformPagePoint),U.update(this.updatePoint,!0)},this.handlePointerUp=(d,f)=>{this.end();const{onEnd:m,onSessionEnd:p,resumeAnimation:y}=this.handlers;if(this.dragSnapToOrigin&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const S=Fr(d.type==="pointercancel"?this.lastMoveEventInfo:Rr(f,this.transformPagePoint),this.history);this.startEvent&&m&&m(d,S),p&&p(d,S)},!Zn(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.contextWindow=o||window;const i=Ut(t),a=Rr(i,this.transformPagePoint),{point:l}=a,{timestamp:c}=re;this.history=[{...l,timestamp:c}];const{onSessionStart:u}=n;u&&u(t,Fr(a,this.history)),this.removeListeners=Bt(Xt(this.contextWindow,"pointermove",this.handlePointerMove),Xt(this.contextWindow,"pointerup",this.handlePointerUp),Xt(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Ne(this.updatePoint)}}function Rr(e,t){return t?{point:t(e.point)}:e}function Pi(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Fr({point:e},t){return{point:e,delta:Pi(e,Ai(t)),offset:Pi(e,ff(t)),velocity:hf(t,.1)}}function ff(e){return e[0]}function Ai(e){return e[e.length-1]}function hf(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=Ai(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>xe(t)));)n--;if(!r)return{x:0,y:0};const s=Te(o.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const i={x:(o.x-r.x)/s,y:(o.y-r.y)/s};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function pf(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?K(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?K(n,e,r.max):Math.min(e,n)),e}function Mi(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function mf(e,{top:t,left:n,bottom:r,right:o}){return{x:Mi(e.x,n,o),y:Mi(e.y,t,r)}}function Li(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 gf(e,t){return{x:Li(e.x,t.x),y:Li(e.y,t.y)}}function yf(e,t){let n=.5;const r=ae(e),o=ae(t);return o>r?n=ct(t.min,t.max-r,e.min):r>o&&(n=ct(e.min,e.max-o,t.min)),_e(0,1,n)}function vf(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Br=.35;function xf(e=Br){return e===!1?e=0:e===!0&&(e=Br),{x:Di(e,"left","right"),y:Di(e,"top","bottom")}}function Di(e,t,n){return{min:Oi(e,t),max:Oi(e,n)}}function Oi(e,t){return typeof e=="number"?e:e[t]||0}const bf=new WeakMap;class Sf{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=H(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const o=u=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Ut(u).point)},s=(u,d)=>{const{drag:f,dragPropagation:m,onDragStart:p}=this.getProps();if(f&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=mc(f),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),pe(S=>{let v=this.getAxisMotionValue(S).get()||0;if(Se.test(v)){const{projection:b}=this.visualElement;if(b&&b.layout){const w=b.layout.layoutBox[S];w&&(v=ae(w)*(parseFloat(v)/100))}}this.originPoint[S]=v}),p&&U.postRender(()=>p(u,d)),hr(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},i=(u,d)=>{const{dragPropagation:f,dragDirectionLock:m,onDirectionLock:p,onDrag:y}=this.getProps();if(!f&&!this.openDragLock)return;const{offset:S}=d;if(m&&this.currentDirection===null){this.currentDirection=Cf(S),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",d.point,S),this.updateAxis("y",d.point,S),this.visualElement.render(),y&&y(u,d)},a=(u,d)=>this.stop(u,d),l=()=>pe(u=>{var d;return this.getAnimationState(u)==="paused"&&((d=this.getAxisMotionValue(u).animation)===null||d===void 0?void 0:d.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new Ei(t,{onSessionStart:o,onStart:s,onMove:i,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:Ti(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:o}=n;this.startAnimation(o);const{onDragEnd:s}=this.getProps();s&&U.postRender(()=>s(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:o}=this.getProps();if(!r||!xn(t,o,this.currentDirection))return;const s=this.getAxisMotionValue(t);let i=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(i=pf(i,this.constraints[t],this.elastic[t])),s.set(i)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),o=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,s=this.constraints;n&&dt(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&o?this.constraints=mf(o.layoutBox,n):this.constraints=!1,this.elastic=xf(r),s!==this.constraints&&o&&this.constraints&&!this.hasMutatedConstraints&&pe(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=vf(o.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!dt(t))return!1;const r=t.current;je(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const s=uf(r,o.root,this.visualElement.getTransformPagePoint());let i=gf(o.layout.layoutBox,s);if(n){const a=n(ef(i));this.hasMutatedConstraints=!!a,a&&(i=li(a))}return i}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:s,dragSnapToOrigin:i,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=pe(u=>{if(!xn(u,n,this.currentDirection))return;let d=l&&l[u]||{};i&&(d={min:0,max:0});const f=o?200:1e6,m=o?40:1e7,p={type:"inertia",velocity:r?t[u]:0,bounceStiffness:f,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...s,...d};return this.startAxisValueAnimation(u,p)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return hr(this.visualElement,t),r.start(kr(t,r,0,n,this.visualElement,!1))}stopAnimation(){pe(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){pe(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),o=r[n];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){pe(n=>{const{drag:r}=this.getProps();if(!xn(n,r,this.currentDirection))return;const{projection:o}=this.visualElement,s=this.getAxisMotionValue(n);if(o&&o.layout){const{min:i,max:a}=o.layout.layoutBox[n];s.set(t[n]-K(i,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!dt(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};pe(i=>{const a=this.getAxisMotionValue(i);if(a&&this.constraints!==!1){const l=a.get();o[i]=yf({min:l,max:l},this.constraints[i])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),pe(i=>{if(!xn(i,t,null))return;const a=this.getAxisMotionValue(i),{min:l,max:c}=this.constraints[i];a.set(K(l,c,o[i]))})}addListeners(){if(!this.visualElement.current)return;bf.set(this.visualElement,this);const t=this.visualElement.current,n=Xt(t,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();dt(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,s=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),U.read(r);const i=zt(window,"resize",()=>this.scalePositionWithinConstraints()),a=o.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(pe(u=>{const d=this.getAxisMotionValue(u);d&&(this.originPoint[u]+=l[u].translate,d.set(d.get()+l[u].translate))}),this.visualElement.render())});return()=>{i(),n(),s(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:s=!1,dragElastic:i=Br,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:s,dragElastic:i,dragMomentum:a}}}function xn(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Cf(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class wf extends Re{constructor(t){super(t),this.removeGroupControls=de,this.removeListeners=de,this.controls=new Sf(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||de}unmount(){this.removeGroupControls(),this.removeListeners()}}const ki=e=>(t,n)=>{e&&U.postRender(()=>e(t,n))};class Tf extends Re{constructor(){super(...arguments),this.removePointerDownListener=de}onPointerDown(t){this.session=new Ei(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Ti(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:ki(t),onStart:ki(n),onMove:r,onEnd:(s,i)=>{delete this.session,o&&U.postRender(()=>o(s,i))}}}mount(){this.removePointerDownListener=Xt(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const bn={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function ji(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Gt={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(D.test(e))e=parseFloat(e);else return e;const n=ji(e,t.target.x),r=ji(e,t.target.y);return`${n}% ${r}%`}},_f={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=Ie.parse(e);if(o.length>5)return r;const s=Ie.createTransformer(e),i=typeof o[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;o[0+i]/=a,o[1+i]/=l;const c=K(a,l,.5);return typeof o[2+i]=="number"&&(o[2+i]/=c),typeof o[3+i]=="number"&&(o[3+i]/=c),s(o)}};class Ef extends g.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:s}=t;zc(Pf),s&&(n.group&&n.group.add(s),r&&r.register&&o&&r.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),bn.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:o,isPresent:s}=this.props,i=r.projection;return i&&(i.isPresent=s,o||t.layoutDependency!==n||n===void 0||t.isPresent!==s?i.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?i.promote():i.relegate()||U.postRender(()=>{const a=i.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Yn.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=t;o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Ni(e){const[t,n]=sc(),r=g.useContext(So);return x.jsx(Ef,{...e,layoutGroup:r,switchLayoutGroup:g.useContext(Ko),isPresent:t,safeToRemove:n})}const Pf={borderRadius:{...Gt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Gt,borderTopRightRadius:Gt,borderBottomLeftRadius:Gt,borderBottomRightRadius:Gt,boxShadow:_f};function Af(e,t,n){const r=se(e)?e:Dt(e);return r.start(kr("",r,t,n)),r.animation}function Mf(e){return e instanceof SVGElement&&e.tagName!=="svg"}const Lf=(e,t)=>e.depth-t.depth;class Df{constructor(){this.children=[],this.isDirty=!1}add(t){Bn(this.children,t),this.isDirty=!0}remove(t){$n(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Lf),this.isDirty=!1,this.children.forEach(t)}}function Of(e,t){const n=be.now(),r=({timestamp:o})=>{const s=o-n;s>=t&&(Ne(r),e(s-t))};return U.read(r,!0),()=>Ne(r)}const Vi=["TopLeft","TopRight","BottomLeft","BottomRight"],kf=Vi.length,Ii=e=>typeof e=="string"?parseFloat(e):e,Ri=e=>typeof e=="number"||D.test(e);function jf(e,t,n,r,o,s){o?(e.opacity=K(0,n.opacity!==void 0?n.opacity:1,Nf(r)),e.opacityExit=K(t.opacity!==void 0?t.opacity:1,0,Vf(r))):s&&(e.opacity=K(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let i=0;i<kf;i++){const a=`border${Vi[i]}Radius`;let l=Fi(t,a),c=Fi(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||Ri(l)===Ri(c)?(e[a]=Math.max(K(Ii(l),Ii(c),r),0),(Se.test(c)||Se.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=K(t.rotate||0,n.rotate||0,r))}function Fi(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Nf=Bi(0,.5,vs),Vf=Bi(.5,.95,de);function Bi(e,t,n){return r=>r<e?0:r>t?1:n(ct(e,t,r))}function $i(e,t){e.min=t.min,e.max=t.max}function me(e,t){$i(e.x,t.x),$i(e.y,t.y)}function zi(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Ui(e,t,n,r,o){return e-=t,e=vn(e,1/n,r),o!==void 0&&(e=vn(e,1/o,r)),e}function If(e,t=0,n=1,r=.5,o,s=e,i=e){if(Se.test(t)&&(t=parseFloat(t),t=K(i.min,i.max,t/100)-i.min),typeof t!="number")return;let a=K(s.min,s.max,r);e===s&&(a-=t),e.min=Ui(e.min,t,n,a,o),e.max=Ui(e.max,t,n,a,o)}function Xi(e,t,[n,r,o],s,i){If(e,t[n],t[r],t[o],t.scale,s,i)}const Rf=["x","scaleX","originX"],Ff=["y","scaleY","originY"];function Wi(e,t,n,r){Xi(e.x,t,Rf,n?n.x:void 0,r?r.x:void 0),Xi(e.y,t,Ff,n?n.y:void 0,r?r.y:void 0)}function Ki(e){return e.translate===0&&e.scale===1}function Gi(e){return Ki(e.x)&&Ki(e.y)}function qi(e,t){return e.min===t.min&&e.max===t.max}function Bf(e,t){return qi(e.x,t.x)&&qi(e.y,t.y)}function Hi(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Yi(e,t){return Hi(e.x,t.x)&&Hi(e.y,t.y)}function Zi(e){return ae(e.x)/ae(e.y)}function Ji(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class $f{constructor(){this.members=[]}add(t){Bn(this.members,t),t.scheduleRender()}remove(t){if($n(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(o=>t===o);if(n===0)return!1;let r;for(let o=n;o>=0;o--){const s=this.members[o];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;o===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function zf(e,t,n){let r="";const o=e.x.translate/t.x,s=e.y.translate/t.y,i=(n==null?void 0:n.z)||0;if((o||s||i)&&(r=`translate3d(${o}px, ${s}px, ${i}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:d,rotateY:f,skewX:m,skewY:p}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),d&&(r+=`rotateX(${d}deg) `),f&&(r+=`rotateY(${f}deg) `),m&&(r+=`skewX(${m}deg) `),p&&(r+=`skewY(${p}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const $r=["","X","Y","Z"],Uf={visibility:"hidden"},Qi=1e3;let Xf=0;function zr(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function ea(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=ds(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",U,!(o||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&ea(r)}function ta({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(i={},a=t==null?void 0:t()){this.id=Xf++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Gf),this.nodes.forEach(Jf),this.nodes.forEach(Qf),this.nodes.forEach(qf)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=i,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new Df)}addEventListener(i,a){return this.eventHandlers.has(i)||this.eventHandlers.set(i,new Un),this.eventHandlers.get(i).add(a)}notifyListeners(i,...a){const l=this.eventHandlers.get(i);l&&l.notify(...a)}hasListeners(i){return this.eventHandlers.has(i)}mount(i,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=Mf(i),this.instance=i;const{layoutId:l,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(i),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(c||l)&&(this.isLayoutDirty=!0),e){let d;const f=()=>this.root.updateBlockedByResize=!1;e(i,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=Of(f,250),bn.hasAnimatedSinceResize&&(bn.hasAnimatedSinceResize=!1,this.nodes.forEach(ra))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&u&&(l||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeLayoutChanged:m,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||u.getDefaultTransition()||oh,{onLayoutAnimationStart:S,onLayoutAnimationComplete:v}=u.getProps(),b=!this.targetLayout||!Yi(this.targetLayout,p),w=!f&&m;if(this.options.layoutRoot||this.resumeFrom||w||f&&(b||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,w);const M={...Xn(y,"layout"),onPlay:S,onComplete:v};(u.shouldReduceMotion||this.options.layoutRoot)&&(M.delay=0,M.type=!1),this.startAnimation(M)}else f||ra(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const i=this.getStack();i&&i.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Ne(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(eh),this.animationId++)}getTransformTemplate(){const{visualElement:i}=this.options;return i&&i.getProps().transformTemplate}willUpdate(i=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&ea(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const d=this.path[u];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),i&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(na);return}this.isUpdating||this.nodes.forEach(Yf),this.isUpdating=!1,this.nodes.forEach(Zf),this.nodes.forEach(Wf),this.nodes.forEach(Kf),this.clearAllSnapshots();const a=be.now();re.delta=_e(0,1e3/60,a-re.timestamp),re.timestamp=a,re.isProcessing=!0,Hn.update.process(re),Hn.preRender.process(re),Hn.render.process(re),re.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Yn.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Hf),this.sharedNodes.forEach(th)}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&&!ae(this.snapshot.measuredBox.x)&&!ae(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const i=this.layout;this.layout=this.measure(!1),this.layoutCorrected=H(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,i?i.layoutBox:void 0)}updateScroll(i="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===i&&(a=!1),a){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:i,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!o)return;const i=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Gi(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;i&&(a||Je(this.latestValues)||u)&&(o(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(i=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return i&&(l=this.removeTransform(l)),sh(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var i;const{visualElement:a}=this.options;if(!a)return H();const l=a.measureViewportBox();if(!(((i=this.scroll)===null||i===void 0?void 0:i.wasRoot)||this.path.some(ih))){const{scroll:u}=this.root;u&&(yt(l.x,u.offset.x),yt(l.y,u.offset.y))}return l}removeElementScroll(i){var a;const l=H();if(me(l,i),!((a=this.scroll)===null||a===void 0)&&a.wasRoot)return l;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:d,options:f}=u;u!==this.root&&d&&f.layoutScroll&&(d.wasRoot&&me(l,i),yt(l.x,d.offset.x),yt(l.y,d.offset.y))}return l}applyTransform(i,a=!1){const l=H();me(l,i);for(let c=0;c<this.path.length;c++){const u=this.path[c];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&vt(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),Je(u.latestValues)&&vt(l,u.latestValues)}return Je(this.latestValues)&&vt(l,this.latestValues),l}removeTransform(i){const a=H();me(a,i);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!Je(c.latestValues))continue;Vr(c.latestValues)&&c.updateSnapshot();const u=H(),d=c.measurePageBox();me(u,d),Wi(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return Je(this.latestValues)&&Wi(a,this.latestValues),a}setTargetDelta(i){this.targetDelta=i,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(i){this.options={...this.options,...i,crossfade:i.crossfade!==void 0?i.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==re.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(i=!1){var a;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==l;if(!(i||c&&this.isSharedProjectionDirty||this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:f}=this.options;if(!(!this.layout||!(d||f))){if(this.resolvedRelativeTargetAt=re.timestamp,!this.targetDelta&&!this.relativeTarget){const m=this.getClosestProjectingParent();m&&m.layout&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=H(),this.relativeTargetOrigin=H(),Kt(this.relativeTargetOrigin,this.layout.layoutBox,m.layout.layoutBox),me(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=H(),this.targetWithTransforms=H()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),lf(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):me(this.target,this.layout.layoutBox),xi(this.target,this.targetDelta)):me(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const m=this.getClosestProjectingParent();m&&!!m.resumingFrom==!!this.resumingFrom&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=H(),this.relativeTargetOrigin=H(),Kt(this.relativeTargetOrigin,this.target,m.target),me(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||Vr(this.parent.latestValues)||gi(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var i;const a=this.getLead(),l=!!this.resumingFrom||this!==a;let c=!0;if((this.isProjectionDirty||!((i=this.parent)===null||i===void 0)&&i.isProjectionDirty)&&(c=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===re.timestamp&&(c=!1),c)return;const{layout:u,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||d))return;me(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,m=this.treeScale.y;cf(this.layoutCorrected,this.treeScale,this.path,l),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=H());const{target:p}=a;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(zi(this.prevProjectionDelta.x,this.projectionDelta.x),zi(this.prevProjectionDelta.y,this.projectionDelta.y)),Wt(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==m||!Ji(this.projectionDelta.x,this.prevProjectionDelta.x)||!Ji(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(i=!0){var a;if((a=this.options.visualElement)===null||a===void 0||a.scheduleRender(),i){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=gt(),this.projectionDelta=gt(),this.projectionDeltaWithTransform=gt()}setAnimationOrigin(i,a=!1){const l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},d=gt();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=H(),m=l?l.source:void 0,p=this.layout?this.layout.source:void 0,y=m!==p,S=this.getStack(),v=!S||S.members.length<=1,b=!!(y&&!v&&this.options.crossfade===!0&&!this.path.some(rh));this.animationProgress=0;let w;this.mixTargetDelta=M=>{const _=M/1e3;oa(d.x,i.x,_),oa(d.y,i.y,_),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Kt(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),nh(this.relativeTarget,this.relativeTargetOrigin,f,_),w&&Bf(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=H()),me(w,this.relativeTarget)),y&&(this.animationValues=u,jf(u,c,this.latestValues,_,b,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=_},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(i){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Ne(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=U.update(()=>{bn.hasAnimatedSinceResize=!0,this.currentAnimation=Af(0,Qi,{...i,onUpdate:a=>{this.mixTargetDelta(a),i.onUpdate&&i.onUpdate(a)},onStop:()=>{},onComplete:()=>{i.onComplete&&i.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const i=this.getStack();i&&i.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Qi),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const i=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=i;if(!(!a||!l||!c)){if(this!==i&&this.layout&&c&&ca(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||H();const d=ae(this.layout.layoutBox.x);l.x.min=i.target.x.min,l.x.max=l.x.min+d;const f=ae(this.layout.layoutBox.y);l.y.min=i.target.y.min,l.y.max=l.y.min+f}me(a,l),vt(a,u),Wt(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(i,a){this.sharedNodes.has(i)||this.sharedNodes.set(i,new $f),this.sharedNodes.get(i).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const i=this.getStack();return i?i.lead===this:!0}getLead(){var i;const{layoutId:a}=this.options;return a?((i=this.getStack())===null||i===void 0?void 0:i.lead)||this:this}getPrevLead(){var i;const{layoutId:a}=this.options;return a?(i=this.getStack())===null||i===void 0?void 0:i.prevLead:void 0}getStack(){const{layoutId:i}=this.options;if(i)return this.root.sharedNodes.get(i)}promote({needsReset:i,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),i&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const i=this.getStack();return i?i.relegate(this):!1}resetSkewAndRotation(){const{visualElement:i}=this.options;if(!i)return;let a=!1;const{latestValues:l}=i;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&zr("z",i,c,this.animationValues);for(let u=0;u<$r.length;u++)zr(`rotate${$r[u]}`,i,c,this.animationValues),zr(`skew${$r[u]}`,i,c,this.animationValues);i.render();for(const u in c)i.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);i.scheduleRender()}getProjectionStyles(i){var a,l;if(!this.instance||this.isSVG)return;if(!this.isVisible)return Uf;const c={visibility:""},u=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,c.opacity="",c.pointerEvents=pn(i==null?void 0:i.pointerEvents)||"",c.transform=u?u(this.latestValues,""):"none",c;const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){const y={};return this.options.layoutId&&(y.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,y.pointerEvents=pn(i==null?void 0:i.pointerEvents)||""),this.hasProjected&&!Je(this.latestValues)&&(y.transform=u?u({},""):"none",this.hasProjected=!1),y}const f=d.animationValues||d.latestValues;this.applyTransformsToTarget(),c.transform=zf(this.projectionDeltaWithTransform,this.treeScale,f),u&&(c.transform=u(f,c.transform));const{x:m,y:p}=this.projectionDelta;c.transformOrigin=`${m.origin*100}% ${p.origin*100}% 0`,d.animationValues?c.opacity=d===this?(l=(a=f.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:f.opacityExit:c.opacity=d===this?f.opacity!==void 0?f.opacity:"":f.opacityExit!==void 0?f.opacityExit:0;for(const y in kt){if(f[y]===void 0)continue;const{correct:S,applyTo:v,isCSSVariable:b}=kt[y],w=c.transform==="none"?f[y]:S(f[y],d);if(v){const M=v.length;for(let _=0;_<M;_++)c[v[_]]=w}else b?this.options.visualElement.renderState.vars[y]=w:c[y]=w}return this.options.layoutId&&(c.pointerEvents=d===this?pn(i==null?void 0:i.pointerEvents)||"":"none"),c}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(i=>{var a;return(a=i.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(na),this.root.sharedNodes.clear()}}}function Wf(e){e.updateLayout()}function Kf(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:o}=e.layout,{animationType:s}=e.options,i=n.source!==e.layout.source;s==="size"?pe(d=>{const f=i?n.measuredBox[d]:n.layoutBox[d],m=ae(f);f.min=r[d].min,f.max=f.min+m}):ca(s,n.layoutBox,r)&&pe(d=>{const f=i?n.measuredBox[d]:n.layoutBox[d],m=ae(r[d]);f.max=f.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+m)});const a=gt();Wt(a,r,n.layoutBox);const l=gt();i?Wt(l,e.applyTransform(o,!0),n.measuredBox):Wt(l,r,n.layoutBox);const c=!Gi(a);let u=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:f,layout:m}=d;if(f&&m){const p=H();Kt(p,n.layoutBox,f.layoutBox);const y=H();Kt(y,r,m.layoutBox),Yi(p,y)||(u=!0),d.options.layoutRoot&&(e.relativeTarget=y,e.relativeTargetOrigin=p,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function Gf(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function qf(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Hf(e){e.clearSnapshot()}function na(e){e.clearMeasurements()}function Yf(e){e.isLayoutDirty=!1}function Zf(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function ra(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Jf(e){e.resolveTargetDelta()}function Qf(e){e.calcProjection()}function eh(e){e.resetSkewAndRotation()}function th(e){e.removeLeadSnapshot()}function oa(e,t,n){e.translate=K(t.translate,0,n),e.scale=K(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function sa(e,t,n,r){e.min=K(t.min,n.min,r),e.max=K(t.max,n.max,r)}function nh(e,t,n,r){sa(e.x,t.x,n.x,r),sa(e.y,t.y,n.y,r)}function rh(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const oh={duration:.45,ease:[.4,0,.1,1]},ia=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),aa=ia("applewebkit/")&&!ia("chrome/")?Math.round:de;function la(e){e.min=aa(e.min),e.max=aa(e.max)}function sh(e){la(e.x),la(e.y)}function ca(e,t,n){return e==="position"||e==="preserve-aspect"&&!af(Zi(t),Zi(n),.2)}function ih(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const ah=ta({attachResizeListener:(e,t)=>zt(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Ur={current:void 0},ua=ta({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Ur.current){const e=new ah({});e.mount(window),e.setOptions({layoutScroll:!0}),Ur.current=e}return Ur.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),lh={pan:{Feature:Tf},drag:{Feature:wf,ProjectionNode:ua,MeasureLayout:Ni}};function da(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,s=r[o];s&&U.postRender(()=>s(t,Ut(t)))}class ch extends Re{mount(){const{current:t}=this.node;t&&(this.unmount=yc(t,(n,r)=>(da(this.node,r,"Start"),o=>da(this.node,o,"End"))))}unmount(){}}class uh extends Re{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Bt(zt(this.node.current,"focus",()=>this.onFocus()),zt(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function fa(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),s=r[o];s&&U.postRender(()=>s(t,Ut(t)))}class dh extends Re{mount(){const{current:t}=this.node;t&&(this.unmount=Sc(t,(n,r)=>(fa(this.node,r,"Start"),(o,{success:s})=>fa(this.node,o,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Xr=new WeakMap,Wr=new WeakMap,fh=e=>{const t=Xr.get(e.target);t&&t(e)},hh=e=>{e.forEach(fh)};function ph({root:e,...t}){const n=e||document;Wr.has(n)||Wr.set(n,{});const r=Wr.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(hh,{root:e,...t})),r[o]}function mh(e,t,n){const r=ph(t);return Xr.set(e,n),r.observe(e),()=>{Xr.delete(e),r.unobserve(e)}}const gh={some:0,all:1};class yh extends Re{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:s}=t,i={root:n?n.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:gh[o]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,s&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:d}=this.node.getProps(),f=c?u:d;f&&f(l)};return mh(this.node.current,i,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(vh(t,n))&&this.startObserver()}unmount(){}}function vh({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const xh={inView:{Feature:yh},tap:{Feature:dh},focus:{Feature:uh},hover:{Feature:ch}},bh={layout:{ProjectionNode:ua,MeasureLayout:Ni}},Kr={current:null},ha={current:!1};function Sh(){if(ha.current=!0,!!Rn)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Kr.current=e.matches;e.addListener(t),t()}else Kr.current=!1}const Ch=[...Fs,ie,Ie],wh=e=>Ch.find(Rs(e)),Th=new WeakMap;function _h(e,t,n){for(const r in t){const o=t[r],s=n[r];if(se(o))e.addValue(r,o),process.env.NODE_ENV==="development"&&on(o.version==="12.5.0",`Attempting to mix Motion versions ${o.version} with 12.5.0 may not work as expected.`);else if(se(s))e.addValue(r,Dt(o,{owner:e}));else if(s!==o)if(e.hasValue(r)){const i=e.getValue(r);i.liveStyle===!0?i.jump(o):i.hasAnimated||i.set(o)}else{const i=e.getStaticValue(r);e.addValue(r,Dt(i!==void 0?i:o,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const pa=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Eh{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:o,blockInitialAnimation:s,visualState:i},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Er,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const m=be.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,U.render(this.render,!1,!0))};const{latestValues:l,renderState:c,onUpdate:u}=i;this.onUpdate=u,this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=a,this.blockInitialAnimation=!!s,this.isControllingVariants=fn(n),this.isVariantNode=Uo(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:d,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const m in f){const p=f[m];l[m]!==void 0&&se(p)&&p.set(l[m],!1)}}mount(t){this.current=t,Th.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),ha.current||Sh(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Kr.current,process.env.NODE_ENV!=="production"&&on(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Ne(this.notifyUpdate),Ne(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=Ge.has(t);r&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&U.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);let i;window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{o(),s(),i&&i(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in ut){const n=ut[t];if(!n)continue;const{isEnabled:r,Feature:o}=n;if(!this.features[t]&&o&&r(this.props)&&(this.features[t]=new o(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):H()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<pa.length;r++){const o=pa[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const s="on"+o,i=t[s];i&&(this.propEventSubscriptions[o]=this.on(o,i))}this.prevMotionValues=_h(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Dt(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let o=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return o!=null&&(typeof o=="string"&&(Vs(o)||bs(o))?o=parseFloat(o):!wh(o)&&Ie.test(n)&&(o=As(t,n)),this.setBaseTarget(t,se(o)?o.get():o)),se(o)?o.get():o}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let o;if(typeof r=="string"||typeof r=="object"){const i=ur(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);i&&(o=i[t])}if(r&&o!==void 0)return o;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!se(s)?s:this.initialValues[t]!==void 0&&o===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Un),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class ma extends Eh{constructor(){super(...arguments),this.KeyframeResolver=$s}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;se(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Ph(e){return window.getComputedStyle(e)}class Ah extends ma{constructor(){super(...arguments),this.type="html",this.renderInstance=ss}readValueFromInstance(t,n){if(Ge.has(n))return Fu(t,n);{const r=Ph(t),o=(nr(n)?r.getPropertyValue(n):r[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return wi(t,n)}build(t,n,r){sr(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return fr(t,n,r)}}class Mh extends ma{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=H,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&os(this.current,this.renderState)}}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Ge.has(n)){const r=Ps(n);return r&&r.default||0}return n=is.has(n)?n:tr(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return ls(t,n,r)}onBindTransform(){this.current&&!this.renderState.dimensions&&U.postRender(this.updateDimensions)}build(t,n,r){lr(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,o){as(t,n,r,o)}mount(t){this.isSVGTag=cr(t.tagName),super.mount(t)}}const Lh=(e,t)=>ar(e)?new Mh(t):new Ah(t,{allowProjection:e!==g.Fragment}),Dh=fu({...Jd,...xh,...lh,...bh},Lh),Qe=Mc(Dh),Oh={root:"_root_uup2j_1"},ga={bgDefault:"c-corporate-default-bg",cBlack:"c-corporate-default-black",cBlue:"c-corporate-default-blue",bgDark:"c-corporate-default-dark-bg",cDarkBlue:"c-corporate-default-dark-blue",cDarkGreen:"c-corporate-default-dark-green",cGreen:"c-corporate-default-green",cRichBlue:"c-corporate-default-rich-blue",grey050:"c-grey-050",grey100:"c-grey-100",grey200:"c-grey-200",grey300:"c-grey-300",grey400:"c-grey-400",grey500:"c-grey-500",grey600:"c-grey-600",grey700:"c-grey-700",grey800:"c-grey-800",grey900:"c-grey-900",rFull:"radius-full",rL:"radius-l",rM:"radius-m",rNone:"radius-none",rS:"radius-s",rXL:"radius-xl",rXS:"radius-xs",rXXL:"radius-xxl",rXXS:"radius-xxs",pXXS:"p-xxs",pXS:"p-xs",pS:"p-s",pM:"p-m",pL:"p-l",pXL:"p-xl",pXXL:"p-xxl",pxXXS:"px-xxs",pxXS:"px-xs",pxS:"px-s",pxM:"px-m",pxL:"px-l",pxXL:"px-xl",pxXXL:"px-xxl",pyXXS:"py-xxs",pyXS:"py-xs",pyS:"py-s",pyM:"py-m",pyL:"py-l",pyXL:"py-xl",pyXXL:"py-xxl",ptXXS:"pt-xxs",ptXS:"pt-xs",ptS:"pt-s",ptM:"pt-m",ptL:"pt-l",ptXL:"pt-xl",ptXXL:"pt-xxl",prXXS:"pr-xxs",prXS:"pr-xs",prS:"pr-s",prM:"pr-m",prL:"pr-l",prXL:"pr-xl",prXXL:"pr-xxl",pbXXS:"pb-xxs",pbXS:"pb-xs",pbS:"pb-s",pbM:"pb-m",pbL:"pb-l",pbXL:"pb-xl",pbXXL:"pb-xxl",plXXS:"pl-xxs",plXS:"pl-xs",plS:"pl-s",plM:"pl-m",plL:"pl-l",plXL:"pl-xl",plXXL:"pl-xxl",mXXS:"m-xxs",mXS:"m-xs",mS:"m-s",mM:"m-m",mL:"m-l",mXL:"m-xl",mXXL:"m-xxl",mxXXS:"mx-xxs",mxXS:"mx-xs",mxS:"mx-s",mxM:"mx-m",mxL:"mx-l",mxXL:"mx-xl",mxXXL:"mx-xxl",myXXS:"my-xxs",myXS:"my-xs",myS:"my-s",myM:"my-m",myL:"my-l",myXL:"my-xl",myXXL:"my-xxl",mtXXS:"mt-xxs",mtXS:"mt-xs",mtS:"mt-s",mtM:"mt-m",mtL:"mt-l",mtXL:"mt-xl",mtXXL:"mt-xxl",mrXXS:"mr-xxs",mrXS:"mr-xs",mrS:"mr-s",mrM:"mr-m",mrL:"mr-l",mrXL:"mr-xl",mrXXL:"mr-xxl",mbXXS:"mb-xxs",mbXS:"mb-xs",mbS:"mb-s",mbM:"mb-m",mbL:"mb-l",mbXL:"mb-xl",mbXXL:"mb-xxl",mlXXS:"ml-xxs",mlXS:"ml-xs",mlS:"ml-s",mlM:"ml-m",mlL:"ml-l",mlXL:"ml-xl",mlXXL:"ml-xxl",fsXXXS:"fs-xxxs",fsXXS:"fs-xxs",fsXS:"fs-xs",fsS:"fs-s",fsM:"fs-m",fsL:"fs-l",fsXL:"fs-xl",fsXXL:"fs-xxl",fsXXXL:"fs-xxxl",fwRegular:"fw-regular",fwSemibold:"fw-semibold",fwBold:"fw-bold",dBlock:"d-block",dInBlock:"d-in-block",taLeft:"ta-left",taCenter:"ta-center",mwSM:"mw-sm",mwMD:"mw-md",mwLG:"mw-lg",mwXL:"mw-xl",mwXXL:"mw-xxl",mw3XL:"mw-3xl",shNone:"sh-none"};function Fe(e){return e&&Object.keys(e).length?Object.keys(e).filter(t=>Object.keys(ga).includes(t)).filter(t=>e[t]===!0).map(t=>ga[t]):null}const et="Errore: ",kh="Impossibile acquisire la posizione.",Gr="Impossibile caricare i punti di mappa.",jh="Si è verificato un errore.",Nh="Impossibile caricare i suggerimenti.",Vh="Impossibile caricare i dettagli della location.",Ih="Impossibile caricare la mappa.",Rh="Impossibile trovare punti di mappa nell'area di ricerca.",Fh="Ottieni indicazioni di navigazione per questa destinazione",Bh="Condividi questa destinazione",$h="Scarica l'evento",zh=3e3,ya=6,qt={north:47.1,south:36.6,east:18.6,west:6.6},Uh={lat:(qt.north+qt.south)/2,lng:(qt.east+qt.west)/2},Xh=2e4;function Ee(e){if(e)return e.trim().split(" ").filter(t=>t.length)}function Pe(e){return e?e.split("").reduce((t,n)=>(/[A-Z]/.test(n)?e.indexOf(n)===0?t+=n.toLowerCase():t+="-"+n.toLowerCase():t+=n,t),""):""}function qr(e){const{type:t,url:n}=e??{};switch(t){case"navigate":case"directions":return{"aria-label":Fh,as:"a",href:n??"#",target:"_blank",rel:"noopener noreferrer"};case"share":return{"aria-label":Bh,as:"a",href:n??"#",target:"_blank",rel:"noopener noreferrer"};case"event":case"calendar":return{"aria-label":$h,as:"a",href:n??"#",download:!0,target:"_blank",rel:"noopener noreferrer"};case"email":default:return{}}}function Wh(e,t){let n;return(...r)=>{clearTimeout(n),n=setTimeout(()=>e(...r),t)}}const va="Anchor";function xa({as:e,wrapper:t,children:n,variant:r="default",className:o,animate:s=!0,animationDelay:i=0,href:a,target:l,rel:c,linkProps:u={},style:d,...f},m){const p=t||"span",y=s?Qe[p]:p,S=e||"a",v=Fe(f)??[],b=s?{initial:{opacity:0,y:5},animate:{opacity:1,y:0},transition:{delay:i,duration:.2}}:{},M=c||(l==="_blank"?{rel:"noopener noreferrer"}:{}).rel;return x.jsx(y,{className:q(Oh.root,"dyn-locator__"+Pe(va),Ee(o),...v),"data-variant":r,...d?{style:d}:{},...b,...f,children:x.jsx(S,{ref:m,href:a,target:l,rel:M,...u,children:n})})}xa.displayName=va;const ba=g.forwardRef(xa),Sa="ErrorBanner";function Ca({title:e="Si è verificato un errore",message:t="Impossibile completare l'operazione richiesta.",actionText:n="ricaricare la pagina",onAction:r,errorDetails:o,className:s,children:i,...a}){const l=Fe(a)??[];return x.jsxs("div",{className:q("dyn-locator__"+Pe(Sa),At.root,Ee(s),...l??[]),children:[x.jsxs("header",{className:At.header,children:[x.jsx(Hl,{size:28,color:"currentColor",className:At.icon})," ",x.jsx("h3",{children:e})]}),x.jsxs("div",{className:At.body,children:[x.jsx("p",{children:t}),n&&r&&x.jsxs("p",{children:["Prova a"," ",x.jsx(ba,{animate:!1,"aria-label":n,href:"#",onClick:r,children:n})]}),i,o&&x.jsx("div",{className:At.content,children:x.jsx("pre",{children:o})})]})]})}Ca.displayName=Sa;const wa=Ca;class Kh extends g.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,n){console.error("Locator error: ",t,n)}render(){var t;return this.state.hasError?this.props.fallback||x.jsx("div",{className:Bl.container,children:x.jsx(wa,{message:"Something went wrong with the Locator component",errorDetails:(t=this.state.error)==null?void 0:t.message})}):this.props.children}}const Ta={ArrowLeft:Xl,ArrowUpRight:Kl,ChevronUp:ql,ChevronDown:Gl,Close:bo,Expand:Jl,Location:Zl,Search:tc,Share:nc,Target:Yl},Ae={root:"_root_1cmog_4",header:"_header_1cmog_21",body:"_body_1cmog_22",cta:"_cta_1cmog_23",titleContainer:"_titleContainer_1cmog_40",shareButton:"_shareButton_1cmog_51",capabilities:"_capabilities_1cmog_59",tagContainer:"_tagContainer_1cmog_72",tag:"_tag_1cmog_72"},xt={root:"_root_1k1dg_4",container:"_container_1k1dg_10",label:"_label_1k1dg_17",icon:"_icon_1k1dg_27"},Hr={root:"_root_71ove_4",icon:"_icon_71ove_43"};function Gh(e){return g.isValidElement(e)||typeof e=="function"}function qh(e){return e?typeof e=="string"||typeof e=="object"&&"name"in e:!1}function Hh(e){return!!e&&typeof e=="object"&&"path"in e}const _a="Icon";function Ea({as:e,icon:t,iconRef:n,label:r,size:o="S",radius:s,variant:i="default",className:a,animate:l=!0,animationDelay:c=0,style:u,...d},f){const m=e||"span",p=l?Qe[m]:m,{iconMap:y}=np();function S(w){if(qh(w)){const M=typeof w=="string"?w:w.name;return y[M]?g.createElement(y[M],{...n?{ref:n}:{},...r?{title:r,titleId:r.trim().toLowerCase().replace(/[^a-z0-9\s_-]/g,"").replace(/\s+/g,"_")+"_id"}:{},className:Hr.icon}):'No icon found for "'+M+'"!'}return Hh(w)?(i!=="default"&&console.warn("Warning: cannot set icon stroke on a remote asset"),x.jsx("img",{...n?{ref:n}:{},src:w.path,alt:`Icona decorativa${r?" che rappresenta '"+r+"'":""}`,className:Hr.icon})):"No icon provided"}const v=Fe(d)??[],b=l?{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},transition:{delay:c,duration:.2}}:{};return x.jsx(p,{ref:f,className:q(Hr.root,"dyn-locator__"+Pe(_a),Ee(a),...v),...u?{style:u}:{},"data-variant":i,"data-size":o,...s?{"data-radius":s}:{},...b,...d,children:S(t)})}Ea.displayName=_a;const Be=g.forwardRef(Ea),Pa="Tag";function Aa({as:e,iconPosition:t="left",children:n,icon:r,className:o,animate:s=!0,animationDelay:i=0,style:a,...l},c){const u=e||"span",d=s?Qe[u]:u,f=Fe(l)??[],m=s?{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},transition:{delay:i,duration:.2}}:{};return x.jsx(d,{ref:c,className:q(xt.root,"dyn-locator__"+Pe(Pa),Ee(o),...f),"data-icon-position":t,...a?{style:a}:{},...m,...l,children:x.jsxs("div",{className:xt.container,children:[r?x.jsx("div",{className:xt.icon,children:Gh(r)?typeof r=="function"?x.jsx(r,{className:xt.icon}):r:x.jsx(Be,{className:xt.icon,icon:r})}):null,x.jsx("div",{className:xt.label,children:n})]})})}Aa.displayName=Pa;const Yh=g.forwardRef(Aa),Zh={root:"_root_u5v4v_1"},Ma="IconButton";function La({as:e,children:t,className:n,variant:r="default",animate:o=!0,animationDelay:s=0,style:i,ariaLabel:a,href:l,target:c,rel:u,disabled:d=!1,...f},m){const p=e||"button",y=o?Qe[p]:p,S=Fe(f)??[],v=o?{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},transition:{delay:s,duration:.2}}:{},b=p==="a"?{href:l??"/",target:c??"_blank",rel:c==="_blank"?"noopener noreferrer":u}:{};return x.jsx(y,{ref:m,className:q(Zh.root,"dyn-locator__"+Pe(Ma),Ee(n),...S),"data-variant":r,"data-element":p,"aria-label":a,disabled:d,...i?{style:i}:{},...v,...b,...f,children:t})}La.displayName=Ma;const bt=g.forwardRef(La),Da={root:"_root_1fk3z_1",content:"_content_1fk3z_32"},Oa="Card";function ka({as:e,children:t,className:n,variant:r="default",animate:o=!0,animationDelay:s=0,style:i,clickable:a=!1,onClick:l,...c},u){const d=e||"article",f=o?Qe[d]:d,m=Fe(c)??[],p=o?{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{delay:s,duration:.3}}:{};return x.jsx(f,{ref:u,className:q(Da.root,"dyn-locator__"+Pe(Oa),Ee(n),...m),"data-variant":r,"data-clickable":a||!!l,onClick:l,...i?{style:i}:{},...p,...c,children:r==="bare"?t:x.jsx("div",{className:Da.content,children:t})})}ka.displayName=Oa;const Jh=g.forwardRef(ka);function ja(e){const{componentMap:t}=rp();return t[e]}const Na="LocationCard";function Va({title:e,timestamp:t,address:n,capabilities:r,on_share:o,actions:s,className:i,...a},l){const c=ja("ctaButton");return x.jsx(Jh,{ref:l,variant:"bare",clickable:!0,className:q("dyn-locator__"+Pe(Na),Ee(i)),...a,style:{...a.style?a.style:{},padding:"var(--dyn-locator__spacing-xs) 0",borderRadius:"var(--dyn-locator__radius-s)",border:"1px solid var(--dyn-locator__colors-grey-grey-100)",boxShadow:"none"},children:x.jsxs("div",{className:Ae.root,children:[x.jsxs("header",{className:Ae.header,children:[t?x.jsx("time",{children:t}):null,x.jsxs("div",{className:Ae.titleContainer,children:[e?x.jsx("h4",{children:e}):null,x.jsx(bt,{className:Ae.shareButton,variant:"bare",...qr(o),children:x.jsx(Be,{size:"M",icon:"Share"})})]}),n?x.jsx("address",{children:n}):null]}),r!=null&&r.length?x.jsx("div",{className:Ae.body,children:r.map((u,d)=>x.jsxs("div",{className:Ae.capabilities,children:[x.jsx("h5",{children:u.title}),x.jsx("ul",{className:Ae.tagContainer,children:(u.capabilities??[]).map((f,m)=>x.jsx(Yh,{as:"li",animationDelay:+`.${m+1}`,className:Ae.tag,children:f.label},m))})]},d))}):null,s!=null&&s.length?x.jsx("div",{className:Ae.cta,children:s.map((u,d)=>x.jsx(c,{animate:!1,fullWidth:!0,variant:d===0?"themed":"secondary",...qr(u),children:u.label},d))}):null]})})}Va.displayName=Na;const Qh=g.forwardRef(Va),Ia={root:"_root_o9d55_1",loader:"_loader_o9d55_73"},Ra="Button";function Fa({as:e,children:t,className:n,variant:r="default",size:o="medium",disabled:s=!1,loading:i=!1,fullWidth:a=!1,animate:l=!0,animationDelay:c=0,href:u,target:d,rel:f,style:m,...p},y){const S=e||(u?"a":"button"),v=l?Qe[S]:S,b=Fe(p)??[],w=l?{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},transition:{delay:c,duration:.2}}:{},M=u?{href:u,target:d,rel:d==="_blank"?"noopener noreferrer":f}:{};return x.jsx(v,{ref:y,className:q(Ia.root,"dyn-locator__"+Pe(Ra),Ee(n),...b),"data-variant":r,"data-size":o,"data-full-width":a,disabled:s||i,...m?{style:m}:{},...w,...M,...p,children:i?x.jsxs("span",{style:{display:"flex",gap:10},children:[t,x.jsx("span",{className:Ia.loader,"aria-hidden":"true"})]}):t})}Fa.displayName=Ra;const Ht=g.forwardRef(Fa),Ba={locationCard:Qh,ctaButton:Ht},ep={iconMap:Ta,componentMap:Ba},Yr=g.createContext(ep);function tp({children:e,customIcons:t,customComponents:n}){const r={...Ta,...t??{}},o={...Ba,...n??{}};return x.jsx(Yr.Provider,{value:{iconMap:r,componentMap:o},children:e})}function np(){const{iconMap:e}=g.useContext(Yr);return{iconMap:e}}function rp(){const{componentMap:e}=g.useContext(Yr);return{componentMap:e}}var Yt=(e=>(e.CLUSTERS="clusters",e.MARKERS="markers",e.FIND="find",e))(Yt||{});const $a=g.createContext({endpointMap:{},apiUrl:""});function op({children:e,endpoints:t,apiUrl:n}){var r;if(!n||!((r=Object.keys(t??{}))!=null&&r.length))throw new Error("EndpointProvider requires an apiUrl and endpointMap.");return x.jsx($a.Provider,{value:{endpointMap:t,apiUrl:n},children:e})}function sp(e){const{endpointMap:t,apiUrl:n}=g.useContext($a);return{getEndpoint:(r={})=>{const o=t[e];if(!o)throw new Error(`Endpoint with id "${e}" not configured. Make sure to provide all required endpoints.`);let s="";return o.buildPath?s=o.buildPath(r):(s=o.path,Object.entries(r).forEach(([i,a])=>{s=s.replace(`:${i}`,String(a))})),{url:`${n}${s}`,method:o.method}}}}let ip={data:""},ap=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||ip,lp=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,cp=/\/\*[^]*?\*\/| +/g,za=/\n+/g,$e=(e,t)=>{let n="",r="",o="";for(let s in e){let i=e[s];s[0]=="@"?s[1]=="i"?n=s+" "+i+";":r+=s[1]=="f"?$e(i,s):s+"{"+$e(i,s[1]=="k"?"":t)+"}":typeof i=="object"?r+=$e(i,t?t.replace(/([^,])+/g,a=>s.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,l=>/&/.test(l)?l.replace(/&/g,a):a?a+" "+l:l)):s):i!=null&&(s=/^--/.test(s)?s:s.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=$e.p?$e.p(s,i):s+":"+i+";")}return n+(t&&o?t+"{"+o+"}":o)+r},Me={},Ua=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+Ua(e[n]);return t}return e},up=(e,t,n,r,o)=>{let s=Ua(e),i=Me[s]||(Me[s]=(l=>{let c=0,u=11;for(;c<l.length;)u=101*u+l.charCodeAt(c++)>>>0;return"go"+u})(s));if(!Me[i]){let l=s!==e?e:(c=>{let u,d,f=[{}];for(;u=lp.exec(c.replace(cp,""));)u[4]?f.shift():u[3]?(d=u[3].replace(za," ").trim(),f.unshift(f[0][d]=f[0][d]||{})):f[0][u[1]]=u[2].replace(za," ").trim();return f[0]})(e);Me[i]=$e(o?{["@keyframes "+i]:l}:l,n?"":"."+i)}let a=n&&Me.g?Me.g:null;return n&&(Me.g=Me[i]),((l,c,u,d)=>{d?c.data=c.data.replace(d,l):c.data.indexOf(l)===-1&&(c.data=u?l+c.data:c.data+l)})(Me[i],t,r,a),i},dp=(e,t,n)=>e.reduce((r,o,s)=>{let i=t[s];if(i&&i.call){let a=i(n),l=a&&a.props&&a.props.className||/^go/.test(a)&&a;i=l?"."+l:a&&typeof a=="object"?a.props?"":$e(a,""):a===!1?"":a}return r+o+(i??"")},"");function Sn(e){let t=this||{},n=e.call?e(t.p):e;return up(n.unshift?n.raw?dp(n,[].slice.call(arguments,1),t.p):n.reduce((r,o)=>Object.assign(r,o&&o.call?o(t.p):o),{}):n,ap(t.target),t.g,t.o,t.k)}let Xa,Zr,Jr;Sn.bind({g:1});let Le=Sn.bind({k:1});function fp(e,t,n,r){$e.p=t,Xa=e,Zr=n,Jr=r}function ze(e,t){let n=this||{};return function(){let r=arguments;function o(s,i){let a=Object.assign({},s),l=a.className||o.className;n.p=Object.assign({theme:Zr&&Zr()},a),n.o=/ *go\d+/.test(l),a.className=Sn.apply(n,r)+(l?" "+l:"");let c=e;return e[0]&&(c=a.as||e,delete a.as),Jr&&c[0]&&Jr(a),Xa(c,a)}return t?t(o):o}}var hp=e=>typeof e=="function",Cn=(e,t)=>hp(e)?e(t):e,pp=(()=>{let e=0;return()=>(++e).toString()})(),Wa=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),mp=20,Ka=(e,t)=>{switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,mp)};case 1:return{...e,toasts:e.toasts.map(s=>s.id===t.toast.id?{...s,...t.toast}:s)};case 2:let{toast:n}=t;return Ka(e,{type:e.toasts.find(s=>s.id===n.id)?1:0,toast:n});case 3:let{toastId:r}=t;return{...e,toasts:e.toasts.map(s=>s.id===r||r===void 0?{...s,dismissed:!0,visible:!1}:s)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(s=>s.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let o=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(s=>({...s,pauseDuration:s.pauseDuration+o}))}}},wn=[],tt={toasts:[],pausedAt:void 0},nt=e=>{tt=Ka(tt,e),wn.forEach(t=>{t(tt)})},gp={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},yp=(e={})=>{let[t,n]=g.useState(tt),r=g.useRef(tt);g.useEffect(()=>(r.current!==tt&&n(tt),wn.push(n),()=>{let s=wn.indexOf(n);s>-1&&wn.splice(s,1)}),[]);let o=t.toasts.map(s=>{var i,a,l;return{...e,...e[s.type],...s,removeDelay:s.removeDelay||((i=e[s.type])==null?void 0:i.removeDelay)||(e==null?void 0:e.removeDelay),duration:s.duration||((a=e[s.type])==null?void 0:a.duration)||(e==null?void 0:e.duration)||gp[s.type],style:{...e.style,...(l=e[s.type])==null?void 0:l.style,...s.style}}});return{...t,toasts:o}},vp=(e,t="blank",n)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...n,id:(n==null?void 0:n.id)||pp()}),Zt=e=>(t,n)=>{let r=vp(t,e,n);return nt({type:2,toast:r}),r.id},Y=(e,t)=>Zt("blank")(e,t);Y.error=Zt("error"),Y.success=Zt("success"),Y.loading=Zt("loading"),Y.custom=Zt("custom"),Y.dismiss=e=>{nt({type:3,toastId:e})},Y.remove=e=>nt({type:4,toastId:e}),Y.promise=(e,t,n)=>{let r=Y.loading(t.loading,{...n,...n==null?void 0:n.loading});return typeof e=="function"&&(e=e()),e.then(o=>{let s=t.success?Cn(t.success,o):void 0;return s?Y.success(s,{id:r,...n,...n==null?void 0:n.success}):Y.dismiss(r),o}).catch(o=>{let s=t.error?Cn(t.error,o):void 0;s?Y.error(s,{id:r,...n,...n==null?void 0:n.error}):Y.dismiss(r)}),e};var xp=(e,t)=>{nt({type:1,toast:{id:e,height:t}})},bp=()=>{nt({type:5,time:Date.now()})},Jt=new Map,Sp=1e3,Cp=(e,t=Sp)=>{if(Jt.has(e))return;let n=setTimeout(()=>{Jt.delete(e),nt({type:4,toastId:e})},t);Jt.set(e,n)},wp=e=>{let{toasts:t,pausedAt:n}=yp(e);g.useEffect(()=>{if(n)return;let s=Date.now(),i=t.map(a=>{if(a.duration===1/0)return;let l=(a.duration||0)+a.pauseDuration-(s-a.createdAt);if(l<0){a.visible&&Y.dismiss(a.id);return}return setTimeout(()=>Y.dismiss(a.id),l)});return()=>{i.forEach(a=>a&&clearTimeout(a))}},[t,n]);let r=g.useCallback(()=>{n&&nt({type:6,time:Date.now()})},[n]),o=g.useCallback((s,i)=>{let{reverseOrder:a=!1,gutter:l=8,defaultPosition:c}=i||{},u=t.filter(m=>(m.position||c)===(s.position||c)&&m.height),d=u.findIndex(m=>m.id===s.id),f=u.filter((m,p)=>p<d&&m.visible).length;return u.filter(m=>m.visible).slice(...a?[f+1]:[0,f]).reduce((m,p)=>m+(p.height||0)+l,0)},[t]);return g.useEffect(()=>{t.forEach(s=>{if(s.dismissed)Cp(s.id,s.removeDelay);else{let i=Jt.get(s.id);i&&(clearTimeout(i),Jt.delete(s.id))}})},[t]),{toasts:t,handlers:{updateHeight:xp,startPause:bp,endPause:r,calculateOffset:o}}},Tp=Le`
129
129
  from {
130
130
  transform: scale(0) rotate(45deg);
131
131
  opacity: 0;
@@ -301,5 +301,5 @@ to {
301
301
  > * {
302
302
  pointer-events: auto;
303
303
  }
304
- `,Tn=16,qp=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:o,containerStyle:s,containerClassName:i})=>{let{toasts:a,handlers:l}=wp(n);return Q.createElement("div",{id:"_rht_toaster",style:{position:"fixed",zIndex:9999,top:Tn,left:Tn,right:Tn,bottom:Tn,pointerEvents:"none",...s},className:i,onMouseEnter:l.startPause,onMouseLeave:l.endPause},a.map(c=>{let u=c.position||t,d=l.calculateOffset(c,{reverseOrder:e,gutter:r,defaultPosition:t}),f=Kp(u,d);return Q.createElement(Wp,{id:c.id,key:c.id,onHeightUpdate:l.updateHeight,className:c.visible?Gp:"",style:f},c.type==="custom"?Cn(c.message,c):o?o(c):Q.createElement(Ga,{toast:c,position:u}))}))};const Hp={root:"_root_movxa_4"};function qa({className:e,children:t,show:n=!0,variant:r="light",...o}){const s=q("dyn-locator__overlay",Hp.root,e);return n?x.jsx("div",{className:s,"data-variant":r,...o,children:t}):null}function _n(e){const[t,n]=g.useState(!1),[r,o]=g.useState(null),{getEndpoint:s}=sp(e);return{request:async(a={},l={})=>{n(!0),o(null);try{let c;try{c=s(a)}catch{throw new Error(`Endpoint "${e}" is not configured. The host application must provide all required endpoints.`)}const{url:u,method:d}=c,f=await fetch(u,{method:d,headers:{"Content-Type":"application/json",...l.headers},...d!=="GET"&&l.body?{body:JSON.stringify(l.body)}:{}});if(!f.ok)throw new Error(`HTTP error! status: ${f.status}`);return{data:await f.json()}}catch(c){const u=c instanceof Error?c:new Error(String(c));throw o(u),console.error(`Error in API request to "${e}":`,u),u}finally{n(!1)}},loading:t,error:r}}function Yp({children:e,customComponents:t,customIcons:n,featureFlags:r,fetchLocations:o,localizationConfig:s,locations:i=[],mapId:a}){const l=j(E=>E.isFullscreen),c=j(E=>E.setLocations),u=j(E=>E.setMapId),d=j(E=>E.setFeatureFlags),f=j(E=>E.setLocalizationConfig),m=j(E=>E.setMapDetail),p=j(E=>E.shouldRefetch),y=j(E=>E.setShouldRefetch),{request:S,loading:v,error:b}=_n(Yt.CLUSTERS),{request:w,loading:M,error:_}=_n(Yt.MARKERS),L=v||M,k=!!b||!!_;async function A(E){var X;try{if(typeof E!="number"||E<0||isNaN(E))throw new Error("No map ID provided");const{data:$}=await S({mapId:String(E)})??{};if(!$)throw new Error("No cluster data received from the server");c((X=$.map)==null?void 0:X.call($,ee=>({...ee,onMarkerClick:async()=>{await V(E,ee.id)}})))}catch($){console.error("Error fetching clusters: ",$),Y.error(et+Gr),c([])}}async function V(E,X){try{if(typeof E!="number"||E<0||isNaN(E))throw new Error("No map ID provided");const{data:$}=await w({mapId:E,clusterId:X})??{};if(!$)throw new Error("No marker data received from the server");c($),m(Ke.MARKER)}catch($){console.error("Error fetching markers: ",$),Y.error(et+Gr),c([])}}return g.useEffect(()=>{s&&f(s),r&&d(r),typeof a=="number"&&a>0&&!isNaN(a)&&u(a),i!=null&&i.length?c(i):o?o().then(E=>c(E)):A(a)},[]),g.useEffect(()=>{let E=!0;return p&&a&&A(a).finally(()=>{E&&y(!1)}),()=>{E=!1}},[p,a]),x.jsx("div",{id:"dyn-locator",className:q("dyn-locator__locator",yo.root),"data-fullscreen":l,children:x.jsxs(tp,{customIcons:n,customComponents:t,children:[e,x.jsxs(qa,{show:L||k,variant:"light",children:[L?x.jsx(Pt,{size:"large"}):null,k?x.jsx(wa,{title:jh,message:Gr,actionText:"ricaricare la pagina.",errorDetails:(b==null?void 0:b.message)||(_==null?void 0:_.message),onAction:E=>{E.preventDefault(),window.location.reload()}}):null]}),x.jsx(qp,{toastOptions:{position:"top-right",duration:3e3,error:{duration:1/0}},children:E=>x.jsx(Ga,{toast:E,children:({icon:X,message:$})=>x.jsxs(x.Fragment,{children:[X,$,E.type==="error"&&x.jsx(bt,{variant:"bare",onClick:()=>Y.dismiss(E.id),children:x.jsx(Be,{icon:"Close"})})]})})})]})})}function Ha({mapProvider:e,endpoints:t,apiUrl:n,children:r,...o}){return x.jsx(Kh,{children:x.jsx(kl,{children:x.jsx(Fl,{mapProvider:e,children:x.jsx(op,{endpoints:t,apiUrl:n,children:x.jsx(Yp,{children:r,...o})})})})})}Ha.displayName="Locator";var Qr,Ya;function Zp(){return Ya||(Ya=1,Qr=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,o,s;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(o=r;o--!==0;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(s=Object.keys(t),r=s.length,r!==Object.keys(n).length)return!1;for(o=r;o--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[o]))return!1;for(o=r;o--!==0;){var i=s[o];if(!e(t[i],n[i]))return!1}return!0}return t!==t&&n!==n}),Qr}var Jp=Zp();const Qp=lo(Jp);function Ce(){return Ce=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ce.apply(null,arguments)}function rt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function em(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function tm(e){var t=em(e,"string");return typeof t=="symbol"?t:t+""}const he={NOT_LOADED:"NOT_LOADED",LOADING:"LOADING",LOADED:"LOADED",FAILED:"FAILED",AUTH_FAILURE:"AUTH_FAILURE"},nm="https://maps.googleapis.com/maps/api/js";class Qt{static async load(t,n){var r;const o=t.libraries?t.libraries.split(","):[],s=this.serializeParams(t);this.listeners.push(n),(r=window.google)!=null&&(r=r.maps)!=null&&r.importLibrary?(this.serializedApiParams||(this.loadingStatus=he.LOADED),this.notifyLoadingStatusListeners()):(this.serializedApiParams=s,this.initImportLibrary(t)),this.serializedApiParams&&this.serializedApiParams!==s&&console.warn("[google-maps-api-loader] The maps API has already been loaded with different parameters and will not be loaded again. Refresh the page for new values to have effect.");const i=["maps",...o];await Promise.all(i.map(a=>google.maps.importLibrary(a)))}static serializeParams(t){return[t.v,t.key,t.language,t.region,t.authReferrerPolicy,t.solutionChannel].join("/")}static initImportLibrary(t){if(window.google||(window.google={}),window.google.maps||(window.google.maps={}),window.google.maps.importLibrary){console.error("[google-maps-api-loader-internal]: initImportLibrary must only be called once");return}let n=null;const r=()=>n||(n=new Promise((o,s)=>{var i;const a=document.createElement("script"),l=new URLSearchParams;for(const[c,u]of Object.entries(t)){const d=c.replace(/[A-Z]/g,f=>"_"+f[0].toLowerCase());l.set(d,String(u))}l.set("loading","async"),l.set("callback","__googleMapsCallback__"),a.async=!0,a.src=nm+"?"+l.toString(),a.nonce=((i=document.querySelector("script[nonce]"))==null?void 0:i.nonce)||"",a.onerror=()=>{this.loadingStatus=he.FAILED,this.notifyLoadingStatusListeners(),s(new Error("The Google Maps JavaScript API could not load."))},window.__googleMapsCallback__=()=>{this.loadingStatus=he.LOADED,this.notifyLoadingStatusListeners(),o()},window.gm_authFailure=()=>{this.loadingStatus=he.AUTH_FAILURE,this.notifyLoadingStatusListeners()},this.loadingStatus=he.LOADING,this.notifyLoadingStatusListeners(),document.head.append(a)}),n);google.maps.importLibrary=o=>r().then(()=>google.maps.importLibrary(o))}static notifyLoadingStatusListeners(){for(const t of this.listeners)t(this.loadingStatus)}}Qt.loadingStatus=he.NOT_LOADED,Qt.serializedApiParams=void 0,Qt.listeners=[];const rm=["onLoad","onError","apiKey","version","libraries"],om=["children"],sm="GMP_visgl_rgmlibrary_v1_default",en=g.createContext(null);function im(){const[e,t]=g.useState({});return{mapInstances:e,addMapInstance:(s,i="default")=>{t(a=>Ce({},a,{[i]:s}))},removeMapInstance:(s="default")=>{t(i=>rt(i,[s].map(tm)))},clearMapInstances:()=>{t({})}}}function am(e){const{onLoad:t,onError:n,apiKey:r,version:o,libraries:s=[]}=e,i=rt(e,rm),[a,l]=g.useState(Qt.loadingStatus),[c,u]=g.useReducer((p,y)=>p[y.name]?p:Ce({},p,{[y.name]:y.value}),{}),d=g.useMemo(()=>s==null?void 0:s.join(","),[s]),f=g.useMemo(()=>JSON.stringify(Ce({apiKey:r,version:o},i)),[r,o,i]),m=g.useCallback(async p=>{var y;if(c[p])return c[p];if(!((y=google)!=null&&(y=y.maps)!=null&&y.importLibrary))throw new Error("[api-provider-internal] importLibrary was called before google.maps.importLibrary was defined.");const S=await window.google.maps.importLibrary(p);return u({name:p,value:S}),S},[c]);return g.useEffect(()=>{(async()=>{try{const p=Ce({key:r},i);o&&(p.v=o),(d==null?void 0:d.length)>0&&(p.libraries=d),(p.channel===void 0||p.channel<0||p.channel>999)&&delete p.channel,p.solutionChannel===void 0?p.solutionChannel=sm:p.solutionChannel===""&&delete p.solutionChannel,await Qt.load(p,y=>l(y));for(const y of["core","maps",...s])await m(y);t&&t()}catch(p){n?n(p):console.error("<ApiProvider> failed to load the Google Maps JavaScript API",p)}})()},[r,d,f]),{status:a,loadedLibraries:c,importLibrary:m}}const lm=e=>{const{children:t}=e,n=rt(e,om),{mapInstances:r,addMapInstance:o,removeMapInstance:s,clearMapInstances:i}=im(),{status:a,loadedLibraries:l,importLibrary:c}=am(n),u=g.useMemo(()=>({mapInstances:r,addMapInstance:o,removeMapInstance:s,clearMapInstances:i,status:a,loadedLibraries:l,importLibrary:c}),[r,o,s,i,a,l,c]);return g.createElement(en.Provider,{value:u},t)};function cm(e,t){for(const n of hm){const r=t[n],o=Za[n];g.useEffect(()=>{if(!e||!r)return;const s=google.maps.event.addListener(e,o,i=>{r(um(o,e,i))});return()=>s.remove()},[e,o,r])}}function um(e,t,n){const r={type:e,map:t,detail:{},stoppable:!1,stop:()=>{}};if(dm.includes(e)){const s=r,i=t.getCenter(),a=t.getZoom(),l=t.getHeading()||0,c=t.getTilt()||0,u=t.getBounds();return(!i||!u||!Number.isFinite(a))&&console.warn("[createEvent] at least one of the values from the map returned undefined. This is not expected to happen. Please report an issue at https://github.com/visgl/react-google-maps/issues/new"),s.detail={center:(i==null?void 0:i.toJSON())||{lat:0,lng:0},zoom:a||0,heading:l,tilt:c,bounds:(u==null?void 0:u.toJSON())||{north:90,east:180,south:-90,west:-180}},s}else if(fm.includes(e)){var o;if(!n)throw new Error("[createEvent] mouse events must provide a srcEvent");const s=r;return s.domEvent=n.domEvent,s.stoppable=!0,s.stop=()=>n.stop(),s.detail={latLng:((o=n.latLng)==null?void 0:o.toJSON())||null,placeId:n.placeId},s}return r}const Za={onBoundsChanged:"bounds_changed",onCenterChanged:"center_changed",onClick:"click",onContextmenu:"contextmenu",onDblclick:"dblclick",onDrag:"drag",onDragend:"dragend",onDragstart:"dragstart",onHeadingChanged:"heading_changed",onIdle:"idle",onIsFractionalZoomEnabledChanged:"isfractionalzoomenabled_changed",onMapCapabilitiesChanged:"mapcapabilities_changed",onMapTypeIdChanged:"maptypeid_changed",onMousemove:"mousemove",onMouseout:"mouseout",onMouseover:"mouseover",onProjectionChanged:"projection_changed",onRenderingTypeChanged:"renderingtype_changed",onTilesLoaded:"tilesloaded",onTiltChanged:"tilt_changed",onZoomChanged:"zoom_changed",onCameraChanged:"bounds_changed"},dm=["bounds_changed","center_changed","heading_changed","tilt_changed","zoom_changed"],fm=["click","contextmenu","dblclick","mousemove","mouseout","mouseover"],hm=Object.keys(Za);function eo(e,t){const n=g.useRef(void 0);(!n.current||!Qp(t,n.current))&&(n.current=t),g.useEffect(e,n.current)}const pm=new Set(["backgroundColor","clickableIcons","controlSize","disableDefaultUI","disableDoubleClickZoom","draggable","draggableCursor","draggingCursor","fullscreenControl","fullscreenControlOptions","gestureHandling","headingInteractionEnabled","isFractionalZoomEnabled","keyboardShortcuts","mapTypeControl","mapTypeControlOptions","mapTypeId","maxZoom","minZoom","noClear","panControl","panControlOptions","restriction","rotateControl","rotateControlOptions","scaleControl","scaleControlOptions","scrollwheel","streetView","streetViewControl","streetViewControlOptions","styles","tiltInteractionEnabled","zoomControl","zoomControlOptions"]);function mm(e,t){const n={},r=Object.keys(t);for(const o of r)pm.has(o)&&(n[o]=t[o]);eo(()=>{e&&e.setOptions(n)},[n])}function to(){var e;return((e=g.useContext(en))==null?void 0:e.status)||he.NOT_LOADED}function gm(e,t){const{viewport:n,viewState:r}=t,o=!!n;return g.useLayoutEffect(()=>{if(!e||!r)return;const{latitude:s,longitude:i,bearing:a,pitch:l,zoom:c}=r;e.moveCamera({center:{lat:s,lng:i},heading:a,tilt:l,zoom:c+1})},[e,r]),o}function ym(e){return!e||typeof e!="object"||!("lat"in e&&"lng"in e)?!1:Number.isFinite(e.lat)&&Number.isFinite(e.lng)}function Ja(e){return ym(e)?e:e.toJSON()}function vm(e,t,n){const r=n.center?Ja(n.center):null;let o=null,s=null;r&&Number.isFinite(r.lat)&&Number.isFinite(r.lng)&&(o=r.lat,s=r.lng);const i=Number.isFinite(n.zoom)?n.zoom:null,a=Number.isFinite(n.heading)?n.heading:null,l=Number.isFinite(n.tilt)?n.tilt:null;g.useLayoutEffect(()=>{if(!e)return;const c={};let u=!1;o!==null&&s!==null&&(t.current.center.lat!==o||t.current.center.lng!==s)&&(c.center={lat:o,lng:s},u=!0),i!==null&&t.current.zoom!==i&&(c.zoom=i,u=!0),a!==null&&t.current.heading!==a&&(c.heading=a,u=!0),l!==null&&t.current.tilt!==l&&(c.tilt=l,u=!0),u&&e.moveCamera(c)})}const xm=()=>{const e={position:"absolute",top:0,left:0,bottom:0,right:0,zIndex:999,display:"flex",flexFlow:"column nowrap",textAlign:"center",justifyContent:"center",fontSize:".8rem",color:"rgba(0,0,0,0.6)",background:"#dddddd",padding:"1rem 1.5rem"};return g.createElement("div",{style:e},g.createElement("h2",null,"Error: AuthFailure"),g.createElement("p",null,"A problem with your API key prevents the map from rendering correctly. Please make sure the value of the ",g.createElement("code",null,"APIProvider.apiKey")," prop is correct. Check the error-message in the console for further details."))};function bm(){const[e,t]=g.useState(null),n=g.useCallback(r=>t(r),[t]);return[e,n]}function Qa(){return to()===he.LOADED}function Sm(){const[,e]=g.useReducer(t=>t+1,0);return e}function Cm(e,t){const n=e.getCenter(),r=e.getZoom(),o=e.getHeading()||0,s=e.getTilt()||0,i=e.getBounds();(!n||!i||!Number.isFinite(r))&&console.warn("[useTrackedCameraState] at least one of the values from the map returned undefined. This is not expected to happen. Please report an issue at https://github.com/visgl/react-google-maps/issues/new"),Object.assign(t.current,{center:(n==null?void 0:n.toJSON())||{lat:0,lng:0},zoom:r||0,heading:o,tilt:s})}function wm(e){const t=Sm(),n=g.useRef({center:{lat:0,lng:0},heading:0,tilt:0,zoom:0});return g.useEffect(()=>{if(!e)return;const r=google.maps.event.addListener(e,"bounds_changed",()=>{Cm(e,n),t()});return()=>r.remove()},[e,t]),n}const Tm=["id","defaultBounds","defaultCenter","defaultZoom","defaultHeading","defaultTilt","reuseMaps","renderingType","colorScheme"],_m=["padding"];class En{static has(t){return this.entries[t]&&this.entries[t].length>0}static pop(t){return this.entries[t]&&this.entries[t].pop()||null}static push(t,n){this.entries[t]||(this.entries[t]=[]),this.entries[t].push(n)}}En.entries={};function Em(e,t){const n=Qa(),[r,o]=g.useState(null),[s,i]=bm(),a=wm(r),{id:l,defaultBounds:c,defaultCenter:u,defaultZoom:d,defaultHeading:f,defaultTilt:m,reuseMaps:p,renderingType:y,colorScheme:S}=e,v=rt(e,Tm),b=e.zoom!==void 0||e.defaultZoom!==void 0,w=e.center!==void 0||e.defaultCenter!==void 0;!c&&(!b||!w)&&console.warn("<Map> component is missing configuration. You have to provide zoom and center (via the `zoom`/`defaultZoom` and `center`/`defaultCenter` props) or specify the region to show using `defaultBounds`. See https://visgl.github.io/react-google-maps/docs/api-reference/components/map#required"),!v.center&&u&&(v.center=u),!v.zoom&&Number.isFinite(d)&&(v.zoom=d),!v.heading&&Number.isFinite(f)&&(v.heading=f),!v.tilt&&Number.isFinite(m)&&(v.tilt=m);for(const _ of Object.keys(v))v[_]===void 0&&delete v[_];const M=g.useRef(void 0);return g.useEffect(()=>{if(!s||!n)return;const{addMapInstance:_,removeMapInstance:L}=t,{mapId:k}=e,A=`${k||"default"}:${y||"default"}:${S||"LIGHT"}`;let V,E;if(p&&En.has(A)?(E=En.pop(A),V=E.getDiv(),s.appendChild(V),E.setOptions(v),setTimeout(()=>E.setCenter(E.getCenter()),0)):(V=document.createElement("div"),V.style.height="100%",s.appendChild(V),E=new google.maps.Map(V,Ce({},v,y?{renderingType:y}:{},S?{colorScheme:S}:{}))),o(E),_(E,l),c){const{padding:X}=c,$=rt(c,_m);E.fitBounds($,X)}else(!b||!w)&&E.fitBounds({east:180,west:-180,south:-90,north:90});if(M.current){const{mapId:X,cameraState:$}=M.current;X!==k&&E.setOptions($)}return()=>{M.current={mapId:k,cameraState:a.current},V.remove(),p?En.push(A,E):google.maps.event.clearInstanceListeners(E),o(null),L(l)}},[s,n,l,e.mapId,e.renderingType,e.colorScheme]),[r,i,a]}const el=g.createContext(null),tl=e=>{const{children:t,id:n,className:r,style:o}=e,s=g.useContext(en),i=to();if(!s)throw new Error("<Map> can only be used inside an <ApiProvider> component.");const[a,l,c]=Em(e,s);vm(a,c,e),cm(a,e),mm(a,e);const u=gm(a,e),d=!!e.controlled;g.useEffect(()=>{if(a)return u&&a.setOptions({disableDefaultUI:!0}),(u||d)&&a.setOptions({gestureHandling:"none",keyboardShortcuts:!1}),()=>{a.setOptions({gestureHandling:e.gestureHandling,keyboardShortcuts:e.keyboardShortcuts})}},[a,u,d,e.gestureHandling,e.keyboardShortcuts]);const f=e.center?Ja(e.center):null;let m=null,p=null;f&&Number.isFinite(f.lat)&&Number.isFinite(f.lng)&&(m=f.lat,p=f.lng);const y=g.useMemo(()=>{var b,w,M,_,L;return{center:{lat:(b=m)!=null?b:0,lng:(w=p)!=null?w:0},zoom:(M=e.zoom)!=null?M:0,heading:(_=e.heading)!=null?_:0,tilt:(L=e.tilt)!=null?L:0}},[m,p,e.zoom,e.heading,e.tilt]);g.useLayoutEffect(()=>{if(!a||!d)return;a.moveCamera(y);const b=a.addListener("bounds_changed",()=>{a.moveCamera(y)});return()=>b.remove()},[a,d,y]);const S=g.useMemo(()=>Ce({width:"100%",height:"100%",position:"relative",zIndex:u?-1:0},o),[o,u]),v=g.useMemo(()=>({map:a}),[a]);return i===he.AUTH_FAILURE?g.createElement("div",{style:Ce({position:"relative"},r?{}:S),className:r},g.createElement(xm,null)):g.createElement("div",Ce({ref:l,"data-testid":"map",style:r?void 0:S,className:r},n?{id:n}:{}),a?g.createElement(el.Provider,{value:v},t):null)};tl.deckGLViewProps=!0;const nl=new Set;function Pm(...e){const t=JSON.stringify(e);nl.has(t)||(nl.add(t),console.error(...e))}const Pn=(e=null)=>{const t=g.useContext(en),{map:n}=g.useContext(el)||{};if(t===null)return Pm("useMap(): failed to retrieve APIProviderContext. Make sure that the <APIProvider> component exists and that the component you are calling `useMap()` from is a sibling of the <APIProvider>."),null;const{mapInstances:r}=t;return e!==null?r[e]||null:n||r.default||null};function An(e){const t=Qa(),n=g.useContext(en);return g.useEffect(()=>{!t||!n||n.importLibrary(e)},[t,n,e]),(n==null?void 0:n.loadedLibraries[e])||null}function St(e,t,n){g.useEffect(()=>{if(!e||!t||!n)return;const r=google.maps.event.addListener(e,t,n);return()=>r.remove()},[e,t,n])}function Mn(e,t,n){g.useEffect(()=>{e&&(e[t]=n)},[e,t,n])}function rl(e,t,n){g.useEffect(()=>{if(!(!e||!t||!n))return e.addEventListener(t,n),()=>e.removeEventListener(t,n)},[e,t,n])}function Am(e){return e.content!==void 0}function Mm(e){return e.nodeType===Node.ELEMENT_NODE}const Lm=g.createContext(null),Dm={BOTTOM:["50%","100%"]},Om=({children:e,styles:t,className:n,anchorPoint:r})=>{const[o,s]=r??Dm.BOTTOM;let i=`-${o}`,a=`-${s}`;o.trimStart().startsWith("-")&&(i=o.substring(1)),s.trimStart().startsWith("-")&&(a=s.substring(1));const l=`translate(50%, 100%) translate(${i}, ${a})`;return g.createElement("div",{style:{transform:l}},g.createElement("div",{className:n,style:t},e))};function km(e){const[t,n]=g.useState(null),[r,o]=g.useState(null),s=Pn(),i=An("marker"),{children:a,onClick:l,className:c,onMouseEnter:u,onMouseLeave:d,onDrag:f,onDragStart:m,onDragEnd:p,collisionBehavior:y,clickable:S,draggable:v,position:b,title:w,zIndex:M}=e,_=g.Children.count(a);return g.useEffect(()=>{if(!s||!i)return;const L=new i.AdvancedMarkerElement;L.map=s,n(L);let k=null;return _>0&&(k=document.createElement("div"),k.isCustomMarker=!0,L.content=k,o(k)),()=>{var A;L.map=null,(A=k)==null||A.remove(),n(null),o(null)}},[s,i,_]),g.useEffect(()=>{!t||!t.content||_>0||(t.content.className=c||"")},[t,c,_]),Mn(t,"position",b),Mn(t,"title",w??""),Mn(t,"zIndex",M),Mn(t,"collisionBehavior",y),g.useEffect(()=>{t&&(v!==void 0?t.gmpDraggable=v:f||m||p?t.gmpDraggable=!0:t.gmpDraggable=!1)},[t,v,f,p,m]),g.useEffect(()=>{if(!t)return;const L=S!==void 0||!!l||!!u||!!d;t.gmpClickable=L,L&&t!=null&&t.content&&Mm(t.content)&&(t.content.style.pointerEvents="none",t.content.firstElementChild&&(t.content.firstElementChild.style.pointerEvents="all"))},[t,S,l,u,d]),St(t,"click",l),St(t,"drag",f),St(t,"dragstart",m),St(t,"dragend",p),rl(t==null?void 0:t.element,"mouseenter",u),rl(t==null?void 0:t.element,"mouseleave",d),[t,r]}g.forwardRef((e,t)=>{const{children:n,style:r,className:o,anchorPoint:s}=e,[i,a]=km(e),l=g.useMemo(()=>i?{marker:i}:null,[i]);return g.useImperativeHandle(t,()=>i,[i]),a?g.createElement(Lm.Provider,{value:l},jn.createPortal(g.createElement(Om,{anchorPoint:s,styles:r,className:o},n),a)):null});function jm(e,t,n){if(t!=null&&typeof t!="object")throw new Error("The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.");const r=e.style;if(n==null){if(t==null)return;for(const o in t)t.hasOwnProperty(o)&&ol(r,o,t[o]);return}for(const o in n)n.hasOwnProperty(o)&&(t==null||!t.hasOwnProperty(o))&&(o.indexOf("--")===0?r.setProperty(o,""):o==="float"?r.cssFloat="":r[o]="");if(t!=null)for(const o in t){const s=t[o];t.hasOwnProperty(o)&&n[o]!==s&&ol(r,o,s)}}function ol(e,t,n){const r=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,n):typeof n=="number"&&n!==0&&!Vm(t)?e[t]=n+"px":t==="float"?e.cssFloat=n:e[t]=(""+n).trim()}const Nm=new Set(["animationIterationCount","aspectRatio","borderImageOutset","borderImageSlice","borderImageWidth","boxFlex","boxFlexGroup","boxOrdinalGroup","columnCount","columns","flex","flexGrow","flexPositive","flexShrink","flexNegative","flexOrder","gridArea","gridRow","gridRowEnd","gridRowSpan","gridRowStart","gridColumn","gridColumnEnd","gridColumnSpan","gridColumnStart","fontWeight","lineClamp","lineHeight","opacity","order","orphans","scale","tabSize","widows","zIndex","zoom","fillOpacity","floodOpacity","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth"]);function Vm(e){return Nm.has(e)}const Im=["children","headerContent","style","className","pixelOffset","anchor","shouldFocus","onClose","onCloseClick"],Rm=e=>{const{children:t,headerContent:n,style:r,className:o,pixelOffset:s,anchor:i,shouldFocus:a,onClose:l,onCloseClick:c}=e,u=rt(e,Im),d=An("maps"),[f,m]=g.useState(null),p=g.useRef(null),y=g.useRef(null);g.useEffect(()=>{if(!d)return;p.current=document.createElement("div"),y.current=document.createElement("div");const b=u;s&&(b.pixelOffset=new google.maps.Size(s[0],s[1])),n&&(b.headerContent=typeof n=="string"?n:y.current);const w=new google.maps.InfoWindow(u);return w.setContent(p.current),m(w),()=>{var M,_;w.setContent(null),(M=p.current)==null||M.remove(),(_=y.current)==null||_.remove(),p.current=null,y.current=null,m(null)}},[d]);const S=g.useRef(null);g.useEffect(()=>{!f||!p.current||(jm(p.current,r||null,S.current),S.current=r||null,o!==p.current.className&&(p.current.className=o||""))},[f,o,r]),eo(()=>{if(!f)return;const b=u;s?b.pixelOffset=new google.maps.Size(s[0],s[1]):b.pixelOffset=null,n?b.headerContent=typeof n=="string"?n:y.current:b.headerContent=null,f.setOptions(u)},[u,s,n]),St(f,"close",l),St(f,"closeclick",c);const v=Pn();return eo(()=>{if(!v||!f||i===null)return;const b=!!i,w={map:v};if(i&&(w.anchor=i,Am(i)&&i.content instanceof Element)){const _=i.content,L=_==null?void 0:_.getBoundingClientRect();if(L&&_!=null&&_.isCustomMarker){var M;const k=(M=i.content.firstElementChild)==null?void 0:M.firstElementChild,A=k==null?void 0:k.getBoundingClientRect(),V=A.x-L.x+(A.width-L.width)/2,E=A.y-L.y,X=u;X.pixelOffset=new google.maps.Size(s?s[0]+V:V,s?s[1]+E:E),f.setOptions(X)}}return a!==void 0&&(w.shouldFocus=a),f.open(w),()=>{b&&f.set("anchor",null),f.close()}},[f,i,v,a,u,s]),g.createElement(g.Fragment,null,p.current&&jn.createPortal(t,p.current),y.current!==null&&jn.createPortal(n,y.current))},Fm=["onClick","onDrag","onDragStart","onDragEnd","onMouseOver","onMouseOut"];function Bm(e){const[t,n]=g.useState(null),r=Pn(),{onClick:o,onDrag:s,onDragStart:i,onDragEnd:a,onMouseOver:l,onMouseOut:c}=e,u=rt(e,Fm),{position:d,draggable:f}=u;return g.useEffect(()=>{if(!r){r===void 0&&console.error("<Marker> has to be inside a Map component.");return}const m=new google.maps.Marker(u);return m.setMap(r),n(m),()=>{m.setMap(null),n(null)}},[r]),g.useEffect(()=>{if(!t)return;const m=t,p=google.maps.event;return o&&p.addListener(m,"click",o),s&&p.addListener(m,"drag",s),i&&p.addListener(m,"dragstart",i),a&&p.addListener(m,"dragend",a),l&&p.addListener(m,"mouseover",l),c&&p.addListener(m,"mouseout",c),t.setDraggable(!!f),()=>{p.clearInstanceListeners(m)}},[t,f,o,s,i,a,l,c]),g.useEffect(()=>{t&&u&&t.setOptions(u)},[t,u]),g.useEffect(()=>{f||!d||!t||t.setPosition(d)},[f,d,t]),t}const sl=g.forwardRef((e,t)=>{const n=Bm(e);return g.useImperativeHandle(t,()=>n,[n]),g.createElement(g.Fragment,null)});function $m(){const[e,t]=g.useState(null);return[g.useCallback(r=>{t(r)},[]),e]}const Ue={root:"_root_faay1_10",header:"_header_faay1_18",body:"_body_faay1_31",highlighted:"_highlighted_faay1_43",toggleButton:"_toggleButton_faay1_46",toggleButtonIcon:"_toggleButtonIcon_faay1_46"};function zm({onLocationSelect:e}){const t=ja("locationCard"),n=j(p=>p.locations),{labels:r}=j(p=>p.localizationConfig),o=j(p=>p.isLocationListExpanded),s=j(p=>p.setIsLocationListExpanded),i=j(p=>p.selectedLocation),a=j(p=>p.setSelectedLocation),l=g.useRef({}),c=r["LocationList.header"],u=r["LocationList.locationDesignator"],d=c.split(/(\{:\d\})/g),f=g.useMemo(()=>d.map((p,y)=>p==="{:1}"?x.jsx("span",{className:Ue.highlighted,children:(n==null?void 0:n.length)??0},y):p==="{:2}"?x.jsx("span",{className:Ue.highlighted,children:u},y):p),[u,n.length,d]);g.useEffect(()=>{if(i&&o){const p=l.current[i];p!=null&&p.current&&requestAnimationFrame(()=>{p.current.scrollIntoView({behavior:"smooth",block:"start"})})}},[i,o]);function m(p){return()=>{e==null||e(p.coords),a==null||a(p.id)}}return x.jsxs("div",{className:q("dyn-locator__location-list",Ue.root),"data-expanded":o,children:[x.jsxs("header",{className:Ue.header,onClick:()=>s(!o),role:"button","aria-expanded":o,children:[x.jsx("span",{children:f}),x.jsx(bt,{className:Ue.toggleButton,variant:"bare",children:x.jsx(Be,{className:Ue.toggleButtonIcon,animate:!1,icon:"ChevronDown"})})]}),x.jsx("div",{className:Ue.body,children:n!=null&&n.length?n.map(p=>{const y=p.id;l.current[y]||(l.current[y]=g.createRef());const S=l.current[y];return x.jsx(t,{ref:S,"data-active":i===p.id,onClick:m(p),...p},p.id)}):x.jsx("div",{className:Ue.noResults,children:r["LocationList.noResults"]})})]})}const De={root:"_root_b3glo_21",loaderContainer:"_loaderContainer_b3glo_29",fullscreenButton:"_fullscreenButton_b3glo_36",backButton:"_backButton_b3glo_37",areaSearchButton:"_areaSearchButton_b3glo_52",visualCue:"_visualCue_b3glo_77",closeButton:"_closeButton_b3glo_102",searchButton:"_searchButton_b3glo_120"},Ln={root:"_root_e0ns1_4",header:"_header_e0ns1_7",cta:"_cta_e0ns1_24"};function Um({id:e,title:t,address:n,coords:r,actions:o,onClick:s,onZoom:i}){var m;const{labels:a}=j(p=>p.localizationConfig),l=j(p=>p.selectedLocation),c=j(p=>p.setSelectedLocation),[u,d]=$m(),f=g.useCallback(()=>{c==null||c("")},[c]);return x.jsxs(x.Fragment,{children:[x.jsx(sl,{ref:u,position:r,onClick:()=>{s==null||s()}}),l===e?x.jsxs(Rm,{anchor:d,headerContent:t,onCloseClick:f,className:Ln.root,children:[x.jsxs("header",{className:Ln.header,children:[x.jsx("h6",{children:t}),x.jsx("address",{children:n})]}),x.jsx("div",{className:Ln.body,children:x.jsxs("div",{className:Ln.cta,children:[x.jsx(Ht,{animate:!1,variant:"secondary",size:"small",...qr((m=o==null?void 0:o.find)==null?void 0:m.call(o,p=>p.type==="navigate")),children:a["InfoWindow.CTA_1"]}),x.jsx(Ht,{animate:!1,variant:"secondary",size:"small",onClick:i,children:a["InfoWindow.CTA_2"]})]})})]}):null]})}function Xm(e){return"size"in e&&"range"in e&&"onMarkerClick"in e}function Wm(e){return"title"in e&&!("size"in e)}function Km(){var W;const[e,t]=g.useState({zoom:ya}),[n,r]=g.useState(!1),[o,s]=g.useState("inactive"),i=g.useRef(""),a=to(),{request:l,loading:c}=_n(Yt.FIND),u=j(C=>C.locations),d=j(C=>C.featureFlags),{labels:f}=j(C=>C.localizationConfig),m=j(C=>C.targetLocation),p=j(C=>C.clearTargetLocation),y=j(C=>C.mapDetail),S=j(C=>C.setMapDetail),v=j(C=>C.isFullscreen),b=j(C=>C.setFullscreen),w=j(C=>C.isLocationListExpanded),M=j(C=>C.setIsLocationListExpanded),_=j(C=>C.shouldRefetch),L=j(C=>C.setShouldRefetch),k=j(C=>C.setSelectedLocation),A=y===Ke.MARKER;function V({detail:C}){const{center:I,zoom:B}=C;t({center:I,zoom:B}),n||r(!0)}function E(){n&&e.center&&o==="inactive"&&s("active")}function X(C){t(I=>({center:C,zoom:I.zoom}))}function $(){s("inactive"),M(!1),S(Ke.CLUSTER),t({center:Uh,zoom:ya}),L(!0)}const ee=j(C=>C.mapId),le=j(C=>C.setLocations),we=g.useCallback(async()=>{if(!e.center)return;const{lat:C,lng:I}=e.center,B={location:{type:"Feature",geometry:{type:"Point",coordinates:[I,C]},properties:{distance:Xh}}};try{const{data:te}=await l({mapId:ee},{body:B})??{};if(!(te!=null&&te.pins))throw new Error("No locations found");le(te.pins),S(Ke.MARKER),s("inactive")}catch(te){console.error("Error finding locations in this area: ",te),Y.error(et+Rh)}},[e.center,l,S,ee,le]);function Xe(C){function I(){t({center:C.coords,zoom:18}),w||M(!0)}if(Xm(C))return x.jsx(sl,{position:C.coords,icon:{path:google.maps.SymbolPath.CIRCLE,fillColor:i.current||"#00acde",fillOpacity:.6,strokeWeight:0,scale:(C.range??0)/zh,labelOrigin:new google.maps.Point(0,0)},onClick:async()=>{await C.onMarkerClick(),t({center:C.coords,zoom:C.zoom||15})}},C.id);if(Wm(C))return x.jsx(Um,{id:C.id,title:C.title??"No title",address:C.address??"No address",coords:C.coords,actions:C.actions,onZoom:I,onClick:()=>{k(C.id)}},C.id)}if(g.useEffect(()=>{i.current=getComputedStyle(document.documentElement).getPropertyValue("--dyn-locator__colors-accent-500")},[]),g.useEffect(()=>{m&&(t({center:m.coords,zoom:m.zoom}),p())},[m,p]),a===he.LOADING)return x.jsx("div",{className:q("dyn-locator__map",De.root),children:x.jsx("div",{className:De.loaderContainer,children:x.jsx(Pt,{size:"large"})})});if(a===he.FAILED||a===he.AUTH_FAILURE)throw new Error(Ih);if(a===he.LOADED)return x.jsxs("div",{className:q("dyn-locator__map",De.root),children:[d.fullscreen?x.jsx(bt,{className:q(De.fullscreenButton,"dyn-locator__map__fullscreen-button"),variant:"negative",onClick:()=>b==null?void 0:b(!v),children:x.jsx(Be,{size:"M",icon:v?"Close":"Expand"})}):null,A?x.jsx(bt,{className:q(De.backButton,"dyn-locator__map__back-button"),variant:"negative",onClick:$,children:x.jsx(Be,{size:"M",icon:"ArrowLeft"})}):null,o!=="inactive"&&x.jsxs(Ht,{className:q(De.areaSearchButton,"dyn-locator__map__area-search-button",A&&"dyn-locator__map__area-search-button--with-back-button"),disabled:c||o==="select_area",loading:c,onClick:()=>s("select_area"),children:[x.jsx(Ql,{}),f["Map.areaSearchButton"]]}),o==="select_area"&&x.jsxs("div",{className:De.visualCue,children:[x.jsxs("i",{children:[x.jsx("button",{className:De.closeButton,onClick:()=>s("active"),"aria-label":"Close area search",children:x.jsx(bo,{size:16})}),x.jsx(ec,{size:48,strokeWidth:1,color:"currentColor"})]}),x.jsxs(Ht,{className:De.searchButton,disabled:c,loading:c,onClick:we,size:"small",variant:"themed",children:[f["Map.areaSearchVisualCueCTA"]," ",x.jsx(Wl,{size:22,style:{position:"relative",left:-8}})]})]}),x.jsx(tl,{style:{width:"100%",height:"100%"},gestureHandling:"greedy",disableDefaultUI:!0,...e,onCameraChanged:V,onDragend:E,defaultBounds:qt,children:!_&&((W=u==null?void 0:u.map)==null?void 0:W.call(u,Xe))}),A?x.jsx(zm,{onLocationSelect:X}):null]})}const Oe={root:"_root_h6kw7_10",validIcon:"_validIcon_h6kw7_23",errorIcon:"_errorIcon_h6kw7_30",label:"_label_h6kw7_51",input:"_input_h6kw7_61",sideButton:"_sideButton_h6kw7_92",sideOrnament:"_sideOrnament_h6kw7_95",clearButton:"_clearButton_h6kw7_129",dropdown:"_dropdown_h6kw7_169"},il="Input";function al({label:e,className:t,showValidation:n=!0,error:r=!1,valid:o=!1,clearable:s=!1,onClear:i,animate:a=!0,animationDelay:l=0,dropdown:c,dropdownVisible:u=!1,ariaLabel:d,style:f,sideButton:m,sideOrnament:p,...y},S){const v=a?Qe.div:"div",b=Fe(y)??[],w=a?{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{delay:l,duration:.2}}:{};return x.jsxs(v,{className:q("dyn-locator__"+Pe(il),Oe.root,Ee(t),...b??[]),"data-valid":o,"data-error":r,"data-expanded":u,"data-side-button":!!m,...f?{style:f}:{},...w,children:[n&&x.jsxs(x.Fragment,{children:[o&&x.jsx("span",{className:Oe.validIcon}),r&&x.jsx("span",{className:Oe.errorIcon})]}),e?x.jsx("label",{className:Oe.label,...y.id?{htmlFor:y.id}:{},children:e}):null,p?x.jsx("span",{className:Oe.sideOrnament,children:p}):null,x.jsx("input",{ref:S,className:q(Oe.input),"aria-label":d,"aria-invalid":r,"data-side-button":!!m,"data-side-ornament":!!p,...y}),m?x.jsx("span",{className:Oe.sideButton,children:m}):null,s&&(y==null?void 0:y.value)&&x.jsx("button",{className:Oe.clearButton,onClick:i,type:"button","aria-label":"Clear input"}),c&&u&&x.jsx("div",{className:Oe.dropdown,children:c})]})}al.displayName=il;const Gm=g.forwardRef(al),ot={root:"_root_1vbtg_7",input:"_input_1vbtg_7",clearButton:"_clearButton_1vbtg_10",sideOrnament:"_sideOrnament_1vbtg_13",predictionsContainer:"_predictionsContainer_1vbtg_18",predictionItem:"_predictionItem_1vbtg_29",loadingItem:"_loadingItem_1vbtg_47"};function qm(){const[e,t]=g.useState(""),[n,r]=g.useState([]),[o,s]=g.useState(!1),[i,a]=g.useState(!1),[l,c]=g.useState(!1),u=j(C=>C.mapId),d=j(C=>C.setLocations),f=j(C=>C.setMapDetail),m=j(C=>C.zoomToLocation),{labels:p}=j(C=>C.localizationConfig),{search:y}=j(C=>C.featureFlags),{request:S,loading:v}=_n(Yt.FIND),b=An("places"),w=An("geocoding"),M=Pn(),_=g.useRef(null),L=g.useRef(null),k=g.useRef(null),A=g.useRef(null);g.useEffect(()=>{w&&(k.current||(k.current=new w.Geocoder))},[w]),g.useEffect(()=>{b&&(_.current||(_.current=new b.AutocompleteService),A.current||(A.current=new b.AutocompleteSessionToken))},[b]),g.useEffect(()=>{!b||!M||L.current||(L.current=new b.PlacesService(M))},[b,M]);const V=async C=>{var I;if(!C||C.length<3){r([]),s(!1);return}a(!0);try{if(!b||!_.current)throw new Error("Places library or Autocomplete Service not available");const B=await _.current.getPlacePredictions({input:C,...A.current?{sessionToken:A.current}:{}});if(a(!1),!((I=B==null?void 0:B.predictions)!=null&&I.length)){r([]),s(!1);return}r(B.predictions),s(!0)}catch(B){console.error("Error fetching predictions: ",B),a(!1),r([]),s(!1),Y.error(et+Nh)}},E=g.useMemo(()=>Wh(C=>V(C),600),[V]),X=C=>{const I=C.currentTarget.value;if(t(I),!I||I.length<3){r([]),s(!1);return}E(I)},$=async C=>{var I,B,te,ne,ke;t(C.description),s(!1);try{if(!b||!L.current)throw new Error("Places library or Places Service not available");const oe=await new Promise((We,st)=>{L.current.getDetails({placeId:C.place_id,fields:["geometry"],...A.current?{sessionToken:A.current}:{}},(Ct,it)=>{it===b.PlacesServiceStatus.OK&&Ct?We(Ct):st(new Error(`Place details request failed with status: ${it}`))})});if((I=oe==null?void 0:oe.geometry)!=null&&I.location){const We=(te=(B=oe.geometry.location).lat)==null?void 0:te.call(B),st=(ke=(ne=oe.geometry.location).lng)==null?void 0:ke.call(ne);await Xe({lat:We,lng:st})}}catch(oe){console.error("Error getting place details:",oe),Y.error(et+Vh)}finally{b&&(A.current=new b.AutocompleteSessionToken)}},ee=()=>{t(""),r([]),s(!1)},le=()=>!o||n.length===0?null:x.jsx("div",{className:ot.predictionsContainer,children:i?x.jsx("div",{className:ot.loadingItem,children:x.jsx(Pt,{size:"medium"})}):n.map(C=>x.jsx("div",{className:ot.predictionItem,onClick:()=>$(C),children:C.description},C.place_id))});async function we(C){C.preventDefault(),c(!0);try{const I=await new Promise((ne,ke)=>{navigator.geolocation.getCurrentPosition(oe=>ne(oe),oe=>ke(oe),{timeout:5e3})}),B={lat:I.coords.latitude,lng:I.coords.longitude};if(await Xe(B),!w||!(k!=null&&k.current)||!M)throw new Error("Geocoding library or Geocoder not available");const te=await new Promise((ne,ke)=>{k.current.geocode({location:B},(oe,We)=>{We===google.maps.GeocoderStatus.OK&&oe&&oe.length>0?ne(oe):ke(new Error(`Geocoding failed with status: ${We}`))})});te&&te[0]&&t(te[0].formatted_address)}catch(I){console.error("Error getting location: ",I);const B=I instanceof GeolocationPositionError?et+I.message:et+kh;Y.error(B)}finally{c(!1)}}async function Xe(C){const{lng:I,lat:B}=C,te={location:{type:"Feature",geometry:{type:"Point",coordinates:[I,B]},properties:{}}};try{const{data:ne}=await S({mapId:u},{body:te})??{};if(!(ne!=null&&ne.pins))throw new Error("No locations found");d(ne.pins),f(Ke.MARKER),m({lat:B,lng:I},ne.zoom||15)}catch(ne){throw console.error("Error finding locations: ",ne),ne}}const W=v||l;return y?x.jsxs("div",{className:q("dyn-locator__search",ot.root),children:[x.jsx(Gm,{name:"locator_search_field",className:q("dyn-locator__search__field",ot.input),value:e,onChange:X,placeholder:p["Search.placeholder"],dropdown:le(),dropdownVisible:o,disabled:W,sideOrnament:e?void 0:x.jsx(Be,{className:ot.sideOrnament,icon:"Search",size:"M"}),sideButton:e?x.jsx(bt,{variant:"bare",className:ot.clearButton,onClick:ee,"aria-label":"Clear",children:x.jsx(Be,{icon:"Close",size:"M"})}):x.jsx(ba,{href:"#",onClick:we,children:p["Search.geolocationButton"]})}),x.jsx(qa,{show:W,children:x.jsx(Pt,{size:"medium"})})]}):null}function Hm({children:e,apiKey:t,language:n,region:r,libraries:o}){return x.jsx(lm,{apiKey:t,region:r,language:n,libraries:o,children:e})}const Ym=Object.freeze(Object.defineProperty({__proto__:null,default:Hm},Symbol.toStringTag,{value:"Module"}));function Zm(){throw new Error("Mapbox provider is not implemented yet")}const Jm=Object.freeze(Object.defineProperty({__proto__:null,default:Zm},Symbol.toStringTag,{value:"Module"}));function Qm(){throw new Error("HERE Maps provider is not implemented yet")}const eg=Object.freeze(Object.defineProperty({__proto__:null,default:Qm},Symbol.toStringTag,{value:"Module"}));ve.Map=Km,ve.Search=qm,ve.default=Ha,Object.defineProperties(ve,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
304
+ `,Tn=16,qp=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:o,containerStyle:s,containerClassName:i})=>{let{toasts:a,handlers:l}=wp(n);return Q.createElement("div",{id:"_rht_toaster",style:{position:"fixed",zIndex:9999,top:Tn,left:Tn,right:Tn,bottom:Tn,pointerEvents:"none",...s},className:i,onMouseEnter:l.startPause,onMouseLeave:l.endPause},a.map(c=>{let u=c.position||t,d=l.calculateOffset(c,{reverseOrder:e,gutter:r,defaultPosition:t}),f=Kp(u,d);return Q.createElement(Wp,{id:c.id,key:c.id,onHeightUpdate:l.updateHeight,className:c.visible?Gp:"",style:f},c.type==="custom"?Cn(c.message,c):o?o(c):Q.createElement(Ga,{toast:c,position:u}))}))};const Hp={root:"_root_movxa_4"};function qa({className:e,children:t,show:n=!0,variant:r="light",...o}){const s=q("dyn-locator__overlay",Hp.root,e);return n?x.jsx("div",{className:s,"data-variant":r,...o,children:t}):null}function _n(e){const[t,n]=g.useState(!1),[r,o]=g.useState(null),{getEndpoint:s}=sp(e);return{request:async(a={},l={})=>{n(!0),o(null);try{let c;try{c=s(a)}catch{throw new Error(`Endpoint "${e}" is not configured. The host application must provide all required endpoints.`)}const{url:u,method:d}=c,f=await fetch(u,{method:d,headers:{"Content-Type":"application/json",...l.headers},...d!=="GET"&&l.body?{body:JSON.stringify(l.body)}:{}});if(!f.ok)throw new Error(`HTTP error! status: ${f.status}`);return{data:await f.json()}}catch(c){const u=c instanceof Error?c:new Error(String(c));throw o(u),console.error(`Error in API request to "${e}":`,u),u}finally{n(!1)}},loading:t,error:r}}function Yp({children:e,customComponents:t,customIcons:n,featureFlags:r,fetchLocations:o,localizationConfig:s,locations:i=[],mapId:a}){const l=j(E=>E.isFullscreen),c=j(E=>E.setLocations),u=j(E=>E.setMapId),d=j(E=>E.setFeatureFlags),f=j(E=>E.setLocalizationConfig),m=j(E=>E.setMapDetail),p=j(E=>E.shouldRefetch),y=j(E=>E.setShouldRefetch),{request:S,loading:v,error:b}=_n(Yt.CLUSTERS),{request:w,loading:M,error:_}=_n(Yt.MARKERS),L=v||M,k=!!b||!!_;async function A(E){var X;try{if(typeof E!="number"||E<0||isNaN(E))throw new Error("No map ID provided");const{data:$}=await S({mapId:String(E)})??{};if(!$)throw new Error("No cluster data received from the server");c((X=$.map)==null?void 0:X.call($,ee=>({...ee,onMarkerClick:async()=>{await V(E,ee.id)}})))}catch($){console.error("Error fetching clusters: ",$),Y.error(et+Gr),c([])}}async function V(E,X){try{if(typeof E!="number"||E<0||isNaN(E))throw new Error("No map ID provided");const{data:$}=await w({mapId:E,clusterId:X})??{};if(!$)throw new Error("No marker data received from the server");c($),m(Ke.MARKER)}catch($){console.error("Error fetching markers: ",$),Y.error(et+Gr),c([])}}return g.useEffect(()=>{s&&f(s),r&&d(r),typeof a=="number"&&a>0&&!isNaN(a)&&u(a),i!=null&&i.length?c(i):o?o().then(E=>c(E)):A(a)},[]),g.useEffect(()=>{let E=!0;return p&&a&&A(a).finally(()=>{E&&y(!1)}),()=>{E=!1}},[p,a]),x.jsx("div",{id:"dyn-locator",className:q("dyn-locator__locator",yo.root),"data-fullscreen":l,children:x.jsxs(tp,{customIcons:n,customComponents:t,children:[e,x.jsxs(qa,{show:L||k,variant:"light",children:[L?x.jsx(Pt,{size:"large"}):null,k?x.jsx(wa,{title:jh,message:Gr,actionText:"ricaricare la pagina.",errorDetails:(b==null?void 0:b.message)||(_==null?void 0:_.message),onAction:E=>{E.preventDefault(),window.location.reload()}}):null]}),x.jsx(qp,{toastOptions:{position:"top-right",duration:3e3,error:{duration:1/0}},children:E=>x.jsx(Ga,{toast:E,children:({icon:X,message:$})=>x.jsxs(x.Fragment,{children:[X,$,E.type==="error"&&x.jsx(bt,{variant:"bare",onClick:()=>Y.dismiss(E.id),children:x.jsx(Be,{icon:"Close"})})]})})})]})})}function Ha({mapProvider:e,endpoints:t,apiUrl:n,children:r,...o}){return x.jsx(Kh,{children:x.jsx(kl,{children:x.jsx(Fl,{mapProvider:e,children:x.jsx(op,{endpoints:t,apiUrl:n,children:x.jsx(Yp,{children:r,...o})})})})})}Ha.displayName="Locator";var Qr,Ya;function Zp(){return Ya||(Ya=1,Qr=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,o,s;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(o=r;o--!==0;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(s=Object.keys(t),r=s.length,r!==Object.keys(n).length)return!1;for(o=r;o--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[o]))return!1;for(o=r;o--!==0;){var i=s[o];if(!e(t[i],n[i]))return!1}return!0}return t!==t&&n!==n}),Qr}var Jp=Zp();const Qp=lo(Jp);function Ce(){return Ce=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ce.apply(null,arguments)}function rt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function em(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function tm(e){var t=em(e,"string");return typeof t=="symbol"?t:t+""}const he={NOT_LOADED:"NOT_LOADED",LOADING:"LOADING",LOADED:"LOADED",FAILED:"FAILED",AUTH_FAILURE:"AUTH_FAILURE"},nm="https://maps.googleapis.com/maps/api/js";class Qt{static async load(t,n){var r;const o=t.libraries?t.libraries.split(","):[],s=this.serializeParams(t);this.listeners.push(n),(r=window.google)!=null&&(r=r.maps)!=null&&r.importLibrary?(this.serializedApiParams||(this.loadingStatus=he.LOADED),this.notifyLoadingStatusListeners()):(this.serializedApiParams=s,this.initImportLibrary(t)),this.serializedApiParams&&this.serializedApiParams!==s&&console.warn("[google-maps-api-loader] The maps API has already been loaded with different parameters and will not be loaded again. Refresh the page for new values to have effect.");const i=["maps",...o];await Promise.all(i.map(a=>google.maps.importLibrary(a)))}static serializeParams(t){return[t.v,t.key,t.language,t.region,t.authReferrerPolicy,t.solutionChannel].join("/")}static initImportLibrary(t){if(window.google||(window.google={}),window.google.maps||(window.google.maps={}),window.google.maps.importLibrary){console.error("[google-maps-api-loader-internal]: initImportLibrary must only be called once");return}let n=null;const r=()=>n||(n=new Promise((o,s)=>{var i;const a=document.createElement("script"),l=new URLSearchParams;for(const[c,u]of Object.entries(t)){const d=c.replace(/[A-Z]/g,f=>"_"+f[0].toLowerCase());l.set(d,String(u))}l.set("loading","async"),l.set("callback","__googleMapsCallback__"),a.async=!0,a.src=nm+"?"+l.toString(),a.nonce=((i=document.querySelector("script[nonce]"))==null?void 0:i.nonce)||"",a.onerror=()=>{this.loadingStatus=he.FAILED,this.notifyLoadingStatusListeners(),s(new Error("The Google Maps JavaScript API could not load."))},window.__googleMapsCallback__=()=>{this.loadingStatus=he.LOADED,this.notifyLoadingStatusListeners(),o()},window.gm_authFailure=()=>{this.loadingStatus=he.AUTH_FAILURE,this.notifyLoadingStatusListeners()},this.loadingStatus=he.LOADING,this.notifyLoadingStatusListeners(),document.head.append(a)}),n);google.maps.importLibrary=o=>r().then(()=>google.maps.importLibrary(o))}static notifyLoadingStatusListeners(){for(const t of this.listeners)t(this.loadingStatus)}}Qt.loadingStatus=he.NOT_LOADED,Qt.serializedApiParams=void 0,Qt.listeners=[];const rm=["onLoad","onError","apiKey","version","libraries"],om=["children"],sm="GMP_visgl_rgmlibrary_v1_default",en=g.createContext(null);function im(){const[e,t]=g.useState({});return{mapInstances:e,addMapInstance:(s,i="default")=>{t(a=>Ce({},a,{[i]:s}))},removeMapInstance:(s="default")=>{t(i=>rt(i,[s].map(tm)))},clearMapInstances:()=>{t({})}}}function am(e){const{onLoad:t,onError:n,apiKey:r,version:o,libraries:s=[]}=e,i=rt(e,rm),[a,l]=g.useState(Qt.loadingStatus),[c,u]=g.useReducer((p,y)=>p[y.name]?p:Ce({},p,{[y.name]:y.value}),{}),d=g.useMemo(()=>s==null?void 0:s.join(","),[s]),f=g.useMemo(()=>JSON.stringify(Ce({apiKey:r,version:o},i)),[r,o,i]),m=g.useCallback(async p=>{var y;if(c[p])return c[p];if(!((y=google)!=null&&(y=y.maps)!=null&&y.importLibrary))throw new Error("[api-provider-internal] importLibrary was called before google.maps.importLibrary was defined.");const S=await window.google.maps.importLibrary(p);return u({name:p,value:S}),S},[c]);return g.useEffect(()=>{(async()=>{try{const p=Ce({key:r},i);o&&(p.v=o),(d==null?void 0:d.length)>0&&(p.libraries=d),(p.channel===void 0||p.channel<0||p.channel>999)&&delete p.channel,p.solutionChannel===void 0?p.solutionChannel=sm:p.solutionChannel===""&&delete p.solutionChannel,await Qt.load(p,y=>l(y));for(const y of["core","maps",...s])await m(y);t&&t()}catch(p){n?n(p):console.error("<ApiProvider> failed to load the Google Maps JavaScript API",p)}})()},[r,d,f]),{status:a,loadedLibraries:c,importLibrary:m}}const lm=e=>{const{children:t}=e,n=rt(e,om),{mapInstances:r,addMapInstance:o,removeMapInstance:s,clearMapInstances:i}=im(),{status:a,loadedLibraries:l,importLibrary:c}=am(n),u=g.useMemo(()=>({mapInstances:r,addMapInstance:o,removeMapInstance:s,clearMapInstances:i,status:a,loadedLibraries:l,importLibrary:c}),[r,o,s,i,a,l,c]);return g.createElement(en.Provider,{value:u},t)};function cm(e,t){for(const n of hm){const r=t[n],o=Za[n];g.useEffect(()=>{if(!e||!r)return;const s=google.maps.event.addListener(e,o,i=>{r(um(o,e,i))});return()=>s.remove()},[e,o,r])}}function um(e,t,n){const r={type:e,map:t,detail:{},stoppable:!1,stop:()=>{}};if(dm.includes(e)){const s=r,i=t.getCenter(),a=t.getZoom(),l=t.getHeading()||0,c=t.getTilt()||0,u=t.getBounds();return(!i||!u||!Number.isFinite(a))&&console.warn("[createEvent] at least one of the values from the map returned undefined. This is not expected to happen. Please report an issue at https://github.com/visgl/react-google-maps/issues/new"),s.detail={center:(i==null?void 0:i.toJSON())||{lat:0,lng:0},zoom:a||0,heading:l,tilt:c,bounds:(u==null?void 0:u.toJSON())||{north:90,east:180,south:-90,west:-180}},s}else if(fm.includes(e)){var o;if(!n)throw new Error("[createEvent] mouse events must provide a srcEvent");const s=r;return s.domEvent=n.domEvent,s.stoppable=!0,s.stop=()=>n.stop(),s.detail={latLng:((o=n.latLng)==null?void 0:o.toJSON())||null,placeId:n.placeId},s}return r}const Za={onBoundsChanged:"bounds_changed",onCenterChanged:"center_changed",onClick:"click",onContextmenu:"contextmenu",onDblclick:"dblclick",onDrag:"drag",onDragend:"dragend",onDragstart:"dragstart",onHeadingChanged:"heading_changed",onIdle:"idle",onIsFractionalZoomEnabledChanged:"isfractionalzoomenabled_changed",onMapCapabilitiesChanged:"mapcapabilities_changed",onMapTypeIdChanged:"maptypeid_changed",onMousemove:"mousemove",onMouseout:"mouseout",onMouseover:"mouseover",onProjectionChanged:"projection_changed",onRenderingTypeChanged:"renderingtype_changed",onTilesLoaded:"tilesloaded",onTiltChanged:"tilt_changed",onZoomChanged:"zoom_changed",onCameraChanged:"bounds_changed"},dm=["bounds_changed","center_changed","heading_changed","tilt_changed","zoom_changed"],fm=["click","contextmenu","dblclick","mousemove","mouseout","mouseover"],hm=Object.keys(Za);function eo(e,t){const n=g.useRef(void 0);(!n.current||!Qp(t,n.current))&&(n.current=t),g.useEffect(e,n.current)}const pm=new Set(["backgroundColor","clickableIcons","controlSize","disableDefaultUI","disableDoubleClickZoom","draggable","draggableCursor","draggingCursor","fullscreenControl","fullscreenControlOptions","gestureHandling","headingInteractionEnabled","isFractionalZoomEnabled","keyboardShortcuts","mapTypeControl","mapTypeControlOptions","mapTypeId","maxZoom","minZoom","noClear","panControl","panControlOptions","restriction","rotateControl","rotateControlOptions","scaleControl","scaleControlOptions","scrollwheel","streetView","streetViewControl","streetViewControlOptions","styles","tiltInteractionEnabled","zoomControl","zoomControlOptions"]);function mm(e,t){const n={},r=Object.keys(t);for(const o of r)pm.has(o)&&(n[o]=t[o]);eo(()=>{e&&e.setOptions(n)},[n])}function to(){var e;return((e=g.useContext(en))==null?void 0:e.status)||he.NOT_LOADED}function gm(e,t){const{viewport:n,viewState:r}=t,o=!!n;return g.useLayoutEffect(()=>{if(!e||!r)return;const{latitude:s,longitude:i,bearing:a,pitch:l,zoom:c}=r;e.moveCamera({center:{lat:s,lng:i},heading:a,tilt:l,zoom:c+1})},[e,r]),o}function ym(e){return!e||typeof e!="object"||!("lat"in e&&"lng"in e)?!1:Number.isFinite(e.lat)&&Number.isFinite(e.lng)}function Ja(e){return ym(e)?e:e.toJSON()}function vm(e,t,n){const r=n.center?Ja(n.center):null;let o=null,s=null;r&&Number.isFinite(r.lat)&&Number.isFinite(r.lng)&&(o=r.lat,s=r.lng);const i=Number.isFinite(n.zoom)?n.zoom:null,a=Number.isFinite(n.heading)?n.heading:null,l=Number.isFinite(n.tilt)?n.tilt:null;g.useLayoutEffect(()=>{if(!e)return;const c={};let u=!1;o!==null&&s!==null&&(t.current.center.lat!==o||t.current.center.lng!==s)&&(c.center={lat:o,lng:s},u=!0),i!==null&&t.current.zoom!==i&&(c.zoom=i,u=!0),a!==null&&t.current.heading!==a&&(c.heading=a,u=!0),l!==null&&t.current.tilt!==l&&(c.tilt=l,u=!0),u&&e.moveCamera(c)})}const xm=()=>{const e={position:"absolute",top:0,left:0,bottom:0,right:0,zIndex:999,display:"flex",flexFlow:"column nowrap",textAlign:"center",justifyContent:"center",fontSize:".8rem",color:"rgba(0,0,0,0.6)",background:"#dddddd",padding:"1rem 1.5rem"};return g.createElement("div",{style:e},g.createElement("h2",null,"Error: AuthFailure"),g.createElement("p",null,"A problem with your API key prevents the map from rendering correctly. Please make sure the value of the ",g.createElement("code",null,"APIProvider.apiKey")," prop is correct. Check the error-message in the console for further details."))};function bm(){const[e,t]=g.useState(null),n=g.useCallback(r=>t(r),[t]);return[e,n]}function Qa(){return to()===he.LOADED}function Sm(){const[,e]=g.useReducer(t=>t+1,0);return e}function Cm(e,t){const n=e.getCenter(),r=e.getZoom(),o=e.getHeading()||0,s=e.getTilt()||0,i=e.getBounds();(!n||!i||!Number.isFinite(r))&&console.warn("[useTrackedCameraState] at least one of the values from the map returned undefined. This is not expected to happen. Please report an issue at https://github.com/visgl/react-google-maps/issues/new"),Object.assign(t.current,{center:(n==null?void 0:n.toJSON())||{lat:0,lng:0},zoom:r||0,heading:o,tilt:s})}function wm(e){const t=Sm(),n=g.useRef({center:{lat:0,lng:0},heading:0,tilt:0,zoom:0});return g.useEffect(()=>{if(!e)return;const r=google.maps.event.addListener(e,"bounds_changed",()=>{Cm(e,n),t()});return()=>r.remove()},[e,t]),n}const Tm=["id","defaultBounds","defaultCenter","defaultZoom","defaultHeading","defaultTilt","reuseMaps","renderingType","colorScheme"],_m=["padding"];class En{static has(t){return this.entries[t]&&this.entries[t].length>0}static pop(t){return this.entries[t]&&this.entries[t].pop()||null}static push(t,n){this.entries[t]||(this.entries[t]=[]),this.entries[t].push(n)}}En.entries={};function Em(e,t){const n=Qa(),[r,o]=g.useState(null),[s,i]=bm(),a=wm(r),{id:l,defaultBounds:c,defaultCenter:u,defaultZoom:d,defaultHeading:f,defaultTilt:m,reuseMaps:p,renderingType:y,colorScheme:S}=e,v=rt(e,Tm),b=e.zoom!==void 0||e.defaultZoom!==void 0,w=e.center!==void 0||e.defaultCenter!==void 0;!c&&(!b||!w)&&console.warn("<Map> component is missing configuration. You have to provide zoom and center (via the `zoom`/`defaultZoom` and `center`/`defaultCenter` props) or specify the region to show using `defaultBounds`. See https://visgl.github.io/react-google-maps/docs/api-reference/components/map#required"),!v.center&&u&&(v.center=u),!v.zoom&&Number.isFinite(d)&&(v.zoom=d),!v.heading&&Number.isFinite(f)&&(v.heading=f),!v.tilt&&Number.isFinite(m)&&(v.tilt=m);for(const _ of Object.keys(v))v[_]===void 0&&delete v[_];const M=g.useRef(void 0);return g.useEffect(()=>{if(!s||!n)return;const{addMapInstance:_,removeMapInstance:L}=t,{mapId:k}=e,A=`${k||"default"}:${y||"default"}:${S||"LIGHT"}`;let V,E;if(p&&En.has(A)?(E=En.pop(A),V=E.getDiv(),s.appendChild(V),E.setOptions(v),setTimeout(()=>E.setCenter(E.getCenter()),0)):(V=document.createElement("div"),V.style.height="100%",s.appendChild(V),E=new google.maps.Map(V,Ce({},v,y?{renderingType:y}:{},S?{colorScheme:S}:{}))),o(E),_(E,l),c){const{padding:X}=c,$=rt(c,_m);E.fitBounds($,X)}else(!b||!w)&&E.fitBounds({east:180,west:-180,south:-90,north:90});if(M.current){const{mapId:X,cameraState:$}=M.current;X!==k&&E.setOptions($)}return()=>{M.current={mapId:k,cameraState:a.current},V.remove(),p?En.push(A,E):google.maps.event.clearInstanceListeners(E),o(null),L(l)}},[s,n,l,e.mapId,e.renderingType,e.colorScheme]),[r,i,a]}const el=g.createContext(null),tl=e=>{const{children:t,id:n,className:r,style:o}=e,s=g.useContext(en),i=to();if(!s)throw new Error("<Map> can only be used inside an <ApiProvider> component.");const[a,l,c]=Em(e,s);vm(a,c,e),cm(a,e),mm(a,e);const u=gm(a,e),d=!!e.controlled;g.useEffect(()=>{if(a)return u&&a.setOptions({disableDefaultUI:!0}),(u||d)&&a.setOptions({gestureHandling:"none",keyboardShortcuts:!1}),()=>{a.setOptions({gestureHandling:e.gestureHandling,keyboardShortcuts:e.keyboardShortcuts})}},[a,u,d,e.gestureHandling,e.keyboardShortcuts]);const f=e.center?Ja(e.center):null;let m=null,p=null;f&&Number.isFinite(f.lat)&&Number.isFinite(f.lng)&&(m=f.lat,p=f.lng);const y=g.useMemo(()=>{var b,w,M,_,L;return{center:{lat:(b=m)!=null?b:0,lng:(w=p)!=null?w:0},zoom:(M=e.zoom)!=null?M:0,heading:(_=e.heading)!=null?_:0,tilt:(L=e.tilt)!=null?L:0}},[m,p,e.zoom,e.heading,e.tilt]);g.useLayoutEffect(()=>{if(!a||!d)return;a.moveCamera(y);const b=a.addListener("bounds_changed",()=>{a.moveCamera(y)});return()=>b.remove()},[a,d,y]);const S=g.useMemo(()=>Ce({width:"100%",height:"100%",position:"relative",zIndex:u?-1:0},o),[o,u]),v=g.useMemo(()=>({map:a}),[a]);return i===he.AUTH_FAILURE?g.createElement("div",{style:Ce({position:"relative"},r?{}:S),className:r},g.createElement(xm,null)):g.createElement("div",Ce({ref:l,"data-testid":"map",style:r?void 0:S,className:r},n?{id:n}:{}),a?g.createElement(el.Provider,{value:v},t):null)};tl.deckGLViewProps=!0;const nl=new Set;function Pm(...e){const t=JSON.stringify(e);nl.has(t)||(nl.add(t),console.error(...e))}const Pn=(e=null)=>{const t=g.useContext(en),{map:n}=g.useContext(el)||{};if(t===null)return Pm("useMap(): failed to retrieve APIProviderContext. Make sure that the <APIProvider> component exists and that the component you are calling `useMap()` from is a sibling of the <APIProvider>."),null;const{mapInstances:r}=t;return e!==null?r[e]||null:n||r.default||null};function An(e){const t=Qa(),n=g.useContext(en);return g.useEffect(()=>{!t||!n||n.importLibrary(e)},[t,n,e]),(n==null?void 0:n.loadedLibraries[e])||null}function St(e,t,n){g.useEffect(()=>{if(!e||!t||!n)return;const r=google.maps.event.addListener(e,t,n);return()=>r.remove()},[e,t,n])}function Mn(e,t,n){g.useEffect(()=>{e&&(e[t]=n)},[e,t,n])}function rl(e,t,n){g.useEffect(()=>{if(!(!e||!t||!n))return e.addEventListener(t,n),()=>e.removeEventListener(t,n)},[e,t,n])}function Am(e){return e.content!==void 0}function Mm(e){return e.nodeType===Node.ELEMENT_NODE}const Lm=g.createContext(null),Dm={BOTTOM:["50%","100%"]},Om=({children:e,styles:t,className:n,anchorPoint:r})=>{const[o,s]=r??Dm.BOTTOM;let i=`-${o}`,a=`-${s}`;o.trimStart().startsWith("-")&&(i=o.substring(1)),s.trimStart().startsWith("-")&&(a=s.substring(1));const l=`translate(50%, 100%) translate(${i}, ${a})`;return g.createElement("div",{style:{transform:l}},g.createElement("div",{className:n,style:t},e))};function km(e){const[t,n]=g.useState(null),[r,o]=g.useState(null),s=Pn(),i=An("marker"),{children:a,onClick:l,className:c,onMouseEnter:u,onMouseLeave:d,onDrag:f,onDragStart:m,onDragEnd:p,collisionBehavior:y,clickable:S,draggable:v,position:b,title:w,zIndex:M}=e,_=g.Children.count(a);return g.useEffect(()=>{if(!s||!i)return;const L=new i.AdvancedMarkerElement;L.map=s,n(L);let k=null;return _>0&&(k=document.createElement("div"),k.isCustomMarker=!0,L.content=k,o(k)),()=>{var A;L.map=null,(A=k)==null||A.remove(),n(null),o(null)}},[s,i,_]),g.useEffect(()=>{!t||!t.content||_>0||(t.content.className=c||"")},[t,c,_]),Mn(t,"position",b),Mn(t,"title",w??""),Mn(t,"zIndex",M),Mn(t,"collisionBehavior",y),g.useEffect(()=>{t&&(v!==void 0?t.gmpDraggable=v:f||m||p?t.gmpDraggable=!0:t.gmpDraggable=!1)},[t,v,f,p,m]),g.useEffect(()=>{if(!t)return;const L=S!==void 0||!!l||!!u||!!d;t.gmpClickable=L,L&&t!=null&&t.content&&Mm(t.content)&&(t.content.style.pointerEvents="none",t.content.firstElementChild&&(t.content.firstElementChild.style.pointerEvents="all"))},[t,S,l,u,d]),St(t,"click",l),St(t,"drag",f),St(t,"dragstart",m),St(t,"dragend",p),rl(t==null?void 0:t.element,"mouseenter",u),rl(t==null?void 0:t.element,"mouseleave",d),[t,r]}g.forwardRef((e,t)=>{const{children:n,style:r,className:o,anchorPoint:s}=e,[i,a]=km(e),l=g.useMemo(()=>i?{marker:i}:null,[i]);return g.useImperativeHandle(t,()=>i,[i]),a?g.createElement(Lm.Provider,{value:l},jn.createPortal(g.createElement(Om,{anchorPoint:s,styles:r,className:o},n),a)):null});function jm(e,t,n){if(t!=null&&typeof t!="object")throw new Error("The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.");const r=e.style;if(n==null){if(t==null)return;for(const o in t)t.hasOwnProperty(o)&&ol(r,o,t[o]);return}for(const o in n)n.hasOwnProperty(o)&&(t==null||!t.hasOwnProperty(o))&&(o.indexOf("--")===0?r.setProperty(o,""):o==="float"?r.cssFloat="":r[o]="");if(t!=null)for(const o in t){const s=t[o];t.hasOwnProperty(o)&&n[o]!==s&&ol(r,o,s)}}function ol(e,t,n){const r=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,n):typeof n=="number"&&n!==0&&!Vm(t)?e[t]=n+"px":t==="float"?e.cssFloat=n:e[t]=(""+n).trim()}const Nm=new Set(["animationIterationCount","aspectRatio","borderImageOutset","borderImageSlice","borderImageWidth","boxFlex","boxFlexGroup","boxOrdinalGroup","columnCount","columns","flex","flexGrow","flexPositive","flexShrink","flexNegative","flexOrder","gridArea","gridRow","gridRowEnd","gridRowSpan","gridRowStart","gridColumn","gridColumnEnd","gridColumnSpan","gridColumnStart","fontWeight","lineClamp","lineHeight","opacity","order","orphans","scale","tabSize","widows","zIndex","zoom","fillOpacity","floodOpacity","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth"]);function Vm(e){return Nm.has(e)}const Im=["children","headerContent","style","className","pixelOffset","anchor","shouldFocus","onClose","onCloseClick"],Rm=e=>{const{children:t,headerContent:n,style:r,className:o,pixelOffset:s,anchor:i,shouldFocus:a,onClose:l,onCloseClick:c}=e,u=rt(e,Im),d=An("maps"),[f,m]=g.useState(null),p=g.useRef(null),y=g.useRef(null);g.useEffect(()=>{if(!d)return;p.current=document.createElement("div"),y.current=document.createElement("div");const b=u;s&&(b.pixelOffset=new google.maps.Size(s[0],s[1])),n&&(b.headerContent=typeof n=="string"?n:y.current);const w=new google.maps.InfoWindow(u);return w.setContent(p.current),m(w),()=>{var M,_;w.setContent(null),(M=p.current)==null||M.remove(),(_=y.current)==null||_.remove(),p.current=null,y.current=null,m(null)}},[d]);const S=g.useRef(null);g.useEffect(()=>{!f||!p.current||(jm(p.current,r||null,S.current),S.current=r||null,o!==p.current.className&&(p.current.className=o||""))},[f,o,r]),eo(()=>{if(!f)return;const b=u;s?b.pixelOffset=new google.maps.Size(s[0],s[1]):b.pixelOffset=null,n?b.headerContent=typeof n=="string"?n:y.current:b.headerContent=null,f.setOptions(u)},[u,s,n]),St(f,"close",l),St(f,"closeclick",c);const v=Pn();return eo(()=>{if(!v||!f||i===null)return;const b=!!i,w={map:v};if(i&&(w.anchor=i,Am(i)&&i.content instanceof Element)){const _=i.content,L=_==null?void 0:_.getBoundingClientRect();if(L&&_!=null&&_.isCustomMarker){var M;const k=(M=i.content.firstElementChild)==null?void 0:M.firstElementChild,A=k==null?void 0:k.getBoundingClientRect(),V=A.x-L.x+(A.width-L.width)/2,E=A.y-L.y,X=u;X.pixelOffset=new google.maps.Size(s?s[0]+V:V,s?s[1]+E:E),f.setOptions(X)}}return a!==void 0&&(w.shouldFocus=a),f.open(w),()=>{b&&f.set("anchor",null),f.close()}},[f,i,v,a,u,s]),g.createElement(g.Fragment,null,p.current&&jn.createPortal(t,p.current),y.current!==null&&jn.createPortal(n,y.current))},Fm=["onClick","onDrag","onDragStart","onDragEnd","onMouseOver","onMouseOut"];function Bm(e){const[t,n]=g.useState(null),r=Pn(),{onClick:o,onDrag:s,onDragStart:i,onDragEnd:a,onMouseOver:l,onMouseOut:c}=e,u=rt(e,Fm),{position:d,draggable:f}=u;return g.useEffect(()=>{if(!r){r===void 0&&console.error("<Marker> has to be inside a Map component.");return}const m=new google.maps.Marker(u);return m.setMap(r),n(m),()=>{m.setMap(null),n(null)}},[r]),g.useEffect(()=>{if(!t)return;const m=t,p=google.maps.event;return o&&p.addListener(m,"click",o),s&&p.addListener(m,"drag",s),i&&p.addListener(m,"dragstart",i),a&&p.addListener(m,"dragend",a),l&&p.addListener(m,"mouseover",l),c&&p.addListener(m,"mouseout",c),t.setDraggable(!!f),()=>{p.clearInstanceListeners(m)}},[t,f,o,s,i,a,l,c]),g.useEffect(()=>{t&&u&&t.setOptions(u)},[t,u]),g.useEffect(()=>{f||!d||!t||t.setPosition(d)},[f,d,t]),t}const sl=g.forwardRef((e,t)=>{const n=Bm(e);return g.useImperativeHandle(t,()=>n,[n]),g.createElement(g.Fragment,null)});function $m(){const[e,t]=g.useState(null);return[g.useCallback(r=>{t(r)},[]),e]}const Ue={root:"_root_faay1_10",header:"_header_faay1_18",body:"_body_faay1_31",highlighted:"_highlighted_faay1_43",toggleButton:"_toggleButton_faay1_46",toggleButtonIcon:"_toggleButtonIcon_faay1_46"};function zm({onLocationSelect:e}){const t=ja("locationCard"),n=j(p=>p.locations),{labels:r}=j(p=>p.localizationConfig),o=j(p=>p.isLocationListExpanded),s=j(p=>p.setIsLocationListExpanded),i=j(p=>p.selectedLocation),a=j(p=>p.setSelectedLocation),l=g.useRef({}),c=r["LocationList.header"],u=r["LocationList.locationDesignator"],d=c.split(/(\{:\d\})/g),f=g.useMemo(()=>d.map((p,y)=>p==="{:1}"?x.jsx("span",{className:Ue.highlighted,children:(n==null?void 0:n.length)??0},y):p==="{:2}"?x.jsx("span",{className:Ue.highlighted,children:u},y):p),[u,n.length,d]);g.useEffect(()=>{if(i&&o){const p=l.current[i];p!=null&&p.current&&requestAnimationFrame(()=>{const y=window.scrollY;p.current.scrollIntoView({behavior:"smooth",block:"start"}),window.scrollTo({top:y,behavior:"auto"})})}},[i,o]);function m(p){return()=>{e==null||e(p.coords),a==null||a(p.id)}}return x.jsxs("div",{className:q("dyn-locator__location-list",Ue.root),"data-expanded":o,children:[x.jsxs("header",{className:Ue.header,onClick:()=>s(!o),role:"button","aria-expanded":o,children:[x.jsx("span",{children:f}),x.jsx(bt,{className:Ue.toggleButton,variant:"bare",children:x.jsx(Be,{className:Ue.toggleButtonIcon,animate:!1,icon:"ChevronUp"})})]}),x.jsx("div",{className:Ue.body,children:n!=null&&n.length?n.map(p=>{const y=p.id;l.current[y]||(l.current[y]=g.createRef());const S=l.current[y];return x.jsx(t,{ref:S,"data-active":i===p.id,onClick:m(p),...p},p.id)}):x.jsx("div",{className:Ue.noResults,children:r["LocationList.noResults"]})})]})}const De={root:"_root_b3glo_21",loaderContainer:"_loaderContainer_b3glo_29",fullscreenButton:"_fullscreenButton_b3glo_36",backButton:"_backButton_b3glo_37",areaSearchButton:"_areaSearchButton_b3glo_52",visualCue:"_visualCue_b3glo_77",closeButton:"_closeButton_b3glo_102",searchButton:"_searchButton_b3glo_120"},Ln={root:"_root_e0ns1_4",header:"_header_e0ns1_7",cta:"_cta_e0ns1_24"};function Um({id:e,title:t,address:n,coords:r,actions:o,onClick:s,onZoom:i}){var m;const{labels:a}=j(p=>p.localizationConfig),l=j(p=>p.selectedLocation),c=j(p=>p.setSelectedLocation),[u,d]=$m(),f=g.useCallback(()=>{c==null||c("")},[c]);return x.jsxs(x.Fragment,{children:[x.jsx(sl,{ref:u,position:r,onClick:()=>{s==null||s()}}),l===e?x.jsxs(Rm,{anchor:d,headerContent:t,onCloseClick:f,className:Ln.root,children:[x.jsxs("header",{className:Ln.header,children:[x.jsx("h6",{children:t}),x.jsx("address",{children:n})]}),x.jsx("div",{className:Ln.body,children:x.jsxs("div",{className:Ln.cta,children:[x.jsx(Ht,{animate:!1,variant:"secondary",size:"small",...qr((m=o==null?void 0:o.find)==null?void 0:m.call(o,p=>p.type==="navigate")),children:a["InfoWindow.CTA_1"]}),x.jsx(Ht,{animate:!1,variant:"secondary",size:"small",onClick:i,children:a["InfoWindow.CTA_2"]})]})})]}):null]})}function Xm(e){return"size"in e&&"range"in e&&"onMarkerClick"in e}function Wm(e){return"title"in e&&!("size"in e)}function Km(){var W;const[e,t]=g.useState({zoom:ya}),[n,r]=g.useState(!1),[o,s]=g.useState("inactive"),i=g.useRef(""),a=to(),{request:l,loading:c}=_n(Yt.FIND),u=j(C=>C.locations),d=j(C=>C.featureFlags),{labels:f}=j(C=>C.localizationConfig),m=j(C=>C.targetLocation),p=j(C=>C.clearTargetLocation),y=j(C=>C.mapDetail),S=j(C=>C.setMapDetail),v=j(C=>C.isFullscreen),b=j(C=>C.setFullscreen),w=j(C=>C.isLocationListExpanded),M=j(C=>C.setIsLocationListExpanded),_=j(C=>C.shouldRefetch),L=j(C=>C.setShouldRefetch),k=j(C=>C.setSelectedLocation),A=y===Ke.MARKER;function V({detail:C}){const{center:I,zoom:B}=C;t({center:I,zoom:B}),n||r(!0)}function E(){n&&e.center&&o==="inactive"&&s("active")}function X(C){t(I=>({center:C,zoom:I.zoom}))}function $(){s("inactive"),M(!1),S(Ke.CLUSTER),t({center:Uh,zoom:ya}),L(!0)}const ee=j(C=>C.mapId),le=j(C=>C.setLocations),we=g.useCallback(async()=>{if(!e.center)return;const{lat:C,lng:I}=e.center,B={location:{type:"Feature",geometry:{type:"Point",coordinates:[I,C]},properties:{distance:Xh}}};try{const{data:te}=await l({mapId:ee},{body:B})??{};if(!(te!=null&&te.pins))throw new Error("No locations found");le(te.pins),S(Ke.MARKER),s("inactive")}catch(te){console.error("Error finding locations in this area: ",te),Y.error(et+Rh)}},[e.center,l,S,ee,le]);function Xe(C){function I(){t({center:C.coords,zoom:18}),w||M(!0)}if(Xm(C))return x.jsx(sl,{position:C.coords,icon:{path:google.maps.SymbolPath.CIRCLE,fillColor:i.current||"#00acde",fillOpacity:.6,strokeWeight:0,scale:(C.range??0)/zh,labelOrigin:new google.maps.Point(0,0)},onClick:async()=>{await C.onMarkerClick(),t({center:C.coords,zoom:C.zoom||15})}},C.id);if(Wm(C))return x.jsx(Um,{id:C.id,title:C.title??"No title",address:C.address??"No address",coords:C.coords,actions:C.actions,onZoom:I,onClick:()=>{k(C.id)}},C.id)}if(g.useEffect(()=>{i.current=getComputedStyle(document.documentElement).getPropertyValue("--dyn-locator__colors-accent-500")},[]),g.useEffect(()=>{m&&(t({center:m.coords,zoom:m.zoom}),p())},[m,p]),a===he.LOADING)return x.jsx("div",{className:q("dyn-locator__map",De.root),children:x.jsx("div",{className:De.loaderContainer,children:x.jsx(Pt,{size:"large"})})});if(a===he.FAILED||a===he.AUTH_FAILURE)throw new Error(Ih);if(a===he.LOADED)return x.jsxs("div",{className:q("dyn-locator__map",De.root),children:[d.fullscreen?x.jsx(bt,{className:q(De.fullscreenButton,"dyn-locator__map__fullscreen-button"),variant:"negative",onClick:()=>b==null?void 0:b(!v),children:x.jsx(Be,{size:"M",icon:v?"Close":"Expand"})}):null,A?x.jsx(bt,{className:q(De.backButton,"dyn-locator__map__back-button"),variant:"negative",onClick:$,children:x.jsx(Be,{size:"M",icon:"ArrowLeft"})}):null,o!=="inactive"&&x.jsxs(Ht,{className:q(De.areaSearchButton,"dyn-locator__map__area-search-button",A&&"dyn-locator__map__area-search-button--with-back-button"),disabled:c||o==="select_area",loading:c,onClick:()=>s("select_area"),children:[x.jsx(Ql,{}),f["Map.areaSearchButton"]]}),o==="select_area"&&x.jsxs("div",{className:De.visualCue,children:[x.jsxs("i",{children:[x.jsx("button",{className:De.closeButton,onClick:()=>s("active"),"aria-label":"Close area search",children:x.jsx(bo,{size:16})}),x.jsx(ec,{size:48,strokeWidth:1,color:"currentColor"})]}),x.jsxs(Ht,{className:De.searchButton,disabled:c,loading:c,onClick:we,size:"small",variant:"themed",children:[f["Map.areaSearchVisualCueCTA"]," ",x.jsx(Wl,{size:22,style:{position:"relative",left:-8}})]})]}),x.jsx(tl,{style:{width:"100%",height:"100%"},gestureHandling:"greedy",disableDefaultUI:!0,...e,onCameraChanged:V,onDragend:E,defaultBounds:qt,children:!_&&((W=u==null?void 0:u.map)==null?void 0:W.call(u,Xe))}),A?x.jsx(zm,{onLocationSelect:X}):null]})}const Oe={root:"_root_h6kw7_10",validIcon:"_validIcon_h6kw7_23",errorIcon:"_errorIcon_h6kw7_30",label:"_label_h6kw7_51",input:"_input_h6kw7_61",sideButton:"_sideButton_h6kw7_92",sideOrnament:"_sideOrnament_h6kw7_95",clearButton:"_clearButton_h6kw7_129",dropdown:"_dropdown_h6kw7_169"},il="Input";function al({label:e,className:t,showValidation:n=!0,error:r=!1,valid:o=!1,clearable:s=!1,onClear:i,animate:a=!0,animationDelay:l=0,dropdown:c,dropdownVisible:u=!1,ariaLabel:d,style:f,sideButton:m,sideOrnament:p,...y},S){const v=a?Qe.div:"div",b=Fe(y)??[],w=a?{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{delay:l,duration:.2}}:{};return x.jsxs(v,{className:q("dyn-locator__"+Pe(il),Oe.root,Ee(t),...b??[]),"data-valid":o,"data-error":r,"data-expanded":u,"data-side-button":!!m,...f?{style:f}:{},...w,children:[n&&x.jsxs(x.Fragment,{children:[o&&x.jsx("span",{className:Oe.validIcon}),r&&x.jsx("span",{className:Oe.errorIcon})]}),e?x.jsx("label",{className:Oe.label,...y.id?{htmlFor:y.id}:{},children:e}):null,p?x.jsx("span",{className:Oe.sideOrnament,children:p}):null,x.jsx("input",{ref:S,className:q(Oe.input),"aria-label":d,"aria-invalid":r,"data-side-button":!!m,"data-side-ornament":!!p,...y}),m?x.jsx("span",{className:Oe.sideButton,children:m}):null,s&&(y==null?void 0:y.value)&&x.jsx("button",{className:Oe.clearButton,onClick:i,type:"button","aria-label":"Clear input"}),c&&u&&x.jsx("div",{className:Oe.dropdown,children:c})]})}al.displayName=il;const Gm=g.forwardRef(al),ot={root:"_root_1vbtg_7",input:"_input_1vbtg_7",clearButton:"_clearButton_1vbtg_10",sideOrnament:"_sideOrnament_1vbtg_13",predictionsContainer:"_predictionsContainer_1vbtg_18",predictionItem:"_predictionItem_1vbtg_29",loadingItem:"_loadingItem_1vbtg_47"};function qm(){const[e,t]=g.useState(""),[n,r]=g.useState([]),[o,s]=g.useState(!1),[i,a]=g.useState(!1),[l,c]=g.useState(!1),u=j(C=>C.mapId),d=j(C=>C.setLocations),f=j(C=>C.setMapDetail),m=j(C=>C.zoomToLocation),{labels:p}=j(C=>C.localizationConfig),{search:y}=j(C=>C.featureFlags),{request:S,loading:v}=_n(Yt.FIND),b=An("places"),w=An("geocoding"),M=Pn(),_=g.useRef(null),L=g.useRef(null),k=g.useRef(null),A=g.useRef(null);g.useEffect(()=>{w&&(k.current||(k.current=new w.Geocoder))},[w]),g.useEffect(()=>{b&&(_.current||(_.current=new b.AutocompleteService),A.current||(A.current=new b.AutocompleteSessionToken))},[b]),g.useEffect(()=>{!b||!M||L.current||(L.current=new b.PlacesService(M))},[b,M]);const V=async C=>{var I;if(!C||C.length<3){r([]),s(!1);return}a(!0);try{if(!b||!_.current)throw new Error("Places library or Autocomplete Service not available");const B=await _.current.getPlacePredictions({input:C,...A.current?{sessionToken:A.current}:{}});if(a(!1),!((I=B==null?void 0:B.predictions)!=null&&I.length)){r([]),s(!1);return}r(B.predictions),s(!0)}catch(B){console.error("Error fetching predictions: ",B),a(!1),r([]),s(!1),Y.error(et+Nh)}},E=g.useMemo(()=>Wh(C=>V(C),600),[V]),X=C=>{const I=C.currentTarget.value;if(t(I),!I||I.length<3){r([]),s(!1);return}E(I)},$=async C=>{var I,B,te,ne,ke;t(C.description),s(!1);try{if(!b||!L.current)throw new Error("Places library or Places Service not available");const oe=await new Promise((We,st)=>{L.current.getDetails({placeId:C.place_id,fields:["geometry"],...A.current?{sessionToken:A.current}:{}},(Ct,it)=>{it===b.PlacesServiceStatus.OK&&Ct?We(Ct):st(new Error(`Place details request failed with status: ${it}`))})});if((I=oe==null?void 0:oe.geometry)!=null&&I.location){const We=(te=(B=oe.geometry.location).lat)==null?void 0:te.call(B),st=(ke=(ne=oe.geometry.location).lng)==null?void 0:ke.call(ne);await Xe({lat:We,lng:st})}}catch(oe){console.error("Error getting place details:",oe),Y.error(et+Vh)}finally{b&&(A.current=new b.AutocompleteSessionToken)}},ee=()=>{t(""),r([]),s(!1)},le=()=>!o||n.length===0?null:x.jsx("div",{className:ot.predictionsContainer,children:i?x.jsx("div",{className:ot.loadingItem,children:x.jsx(Pt,{size:"medium"})}):n.map(C=>x.jsx("div",{className:ot.predictionItem,onClick:()=>$(C),children:C.description},C.place_id))});async function we(C){C.preventDefault(),c(!0);try{const I=await new Promise((ne,ke)=>{navigator.geolocation.getCurrentPosition(oe=>ne(oe),oe=>ke(oe),{timeout:5e3})}),B={lat:I.coords.latitude,lng:I.coords.longitude};if(await Xe(B),!w||!(k!=null&&k.current)||!M)throw new Error("Geocoding library or Geocoder not available");const te=await new Promise((ne,ke)=>{k.current.geocode({location:B},(oe,We)=>{We===google.maps.GeocoderStatus.OK&&oe&&oe.length>0?ne(oe):ke(new Error(`Geocoding failed with status: ${We}`))})});te&&te[0]&&t(te[0].formatted_address)}catch(I){console.error("Error getting location: ",I);const B=I instanceof GeolocationPositionError?et+I.message:et+kh;Y.error(B)}finally{c(!1)}}async function Xe(C){const{lng:I,lat:B}=C,te={location:{type:"Feature",geometry:{type:"Point",coordinates:[I,B]},properties:{}}};try{const{data:ne}=await S({mapId:u},{body:te})??{};if(!(ne!=null&&ne.pins))throw new Error("No locations found");d(ne.pins),f(Ke.MARKER),m({lat:B,lng:I},ne.zoom||15)}catch(ne){throw console.error("Error finding locations: ",ne),ne}}const W=v||l;return y?x.jsxs("div",{className:q("dyn-locator__search",ot.root),children:[x.jsx(Gm,{name:"locator_search_field",className:q("dyn-locator__search__field",ot.input),value:e,onChange:X,placeholder:p["Search.placeholder"],dropdown:le(),dropdownVisible:o,disabled:W,sideOrnament:e?void 0:x.jsx(Be,{className:ot.sideOrnament,icon:"Search",size:"M"}),sideButton:e?x.jsx(bt,{variant:"bare",className:ot.clearButton,onClick:ee,"aria-label":"Clear",children:x.jsx(Be,{icon:"Close",size:"M"})}):x.jsx(ba,{href:"#",onClick:we,children:p["Search.geolocationButton"]})}),x.jsx(qa,{show:W,children:x.jsx(Pt,{size:"medium"})})]}):null}function Hm({children:e,apiKey:t,language:n,region:r,libraries:o}){return x.jsx(lm,{apiKey:t,region:r,language:n,libraries:o,children:e})}const Ym=Object.freeze(Object.defineProperty({__proto__:null,default:Hm},Symbol.toStringTag,{value:"Module"}));function Zm(){throw new Error("Mapbox provider is not implemented yet")}const Jm=Object.freeze(Object.defineProperty({__proto__:null,default:Zm},Symbol.toStringTag,{value:"Module"}));function Qm(){throw new Error("HERE Maps provider is not implemented yet")}const eg=Object.freeze(Object.defineProperty({__proto__:null,default:Qm},Symbol.toStringTag,{value:"Module"}));ve.Map=Km,ve.Search=qm,ve.default=Ha,Object.defineProperties(ve,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
305
305
  //# sourceMappingURL=index.umd.js.map