Files
SnowCatQQ/release-tools/webui-static/assets/layout-Buao20KT.js
T
2026-11-12 06:29:38 +08:00

2 lines
41 KiB
JavaScript

import{i as L,b as et,d as ce,m as x,e as E,f as S,h as ue,j as Ft,p as de,k as U,s as fe,l as me,n as J,o as v,q as pe,r as ge,t as ye,u as it,v as Nt,F as Wt,w,x as st,y as $t,z as Gt,A as zt,B as Ht,C as Xt,D as ve,E as nt,S as xe,G as Pe,H as z,I as V,J as O,K as F,L as ot,M as Te,N as De,O as Ee,P as B,Q as Se}from"./gestures-BHfQC-M8.js";import{bf as Re,bg as Yt,bh as N,bi as G,bj as qt,bk as Ae,bd as Le,bl as Ce,bm as je,bn as Ve,bo as H,bp as rt}from"./index-DiaaLdUu.js";import{r as Q,j as Be}from"./react-vendor-jWT2yUdV.js";function we(t){return t==="x"||t==="y"?L[t]?null:(L[t]=!0,()=>{L[t]=!1}):L.x||L.y?null:(L.x=L.y=!0,()=>{L.x=L.y=!1})}function _t(t){return Re(t)&&"ownerSVGElement"in t}function ke(t){return _t(t)&&t.tagName==="svg"}function M(t,e,s,n){return et(t,e,ce(s),n)}const Kt=1e-4,Me=1-Kt,be=1+Kt,Zt=.01,Ie=0-Zt,Ue=0+Zt;function D(t){return t.max-t.min}function Oe(t,e,s){return Math.abs(t-e)<=s}function at(t,e,s,n=.5){t.origin=n,t.originPoint=x(e.min,e.max,t.origin),t.scale=D(s)/D(e),t.translate=x(s.min,s.max,t.origin)-t.originPoint,(t.scale>=Me&&t.scale<=be||isNaN(t.scale))&&(t.scale=1),(t.translate>=Ie&&t.translate<=Ue||isNaN(t.translate))&&(t.translate=0)}function b(t,e,s,n){at(t.x,e.x,s.x,n?n.originX:void 0),at(t.y,e.y,s.y,n?n.originY:void 0)}function lt(t,e,s){t.min=s.min+e.min,t.max=t.min+D(e)}function Fe(t,e,s){lt(t.x,e.x,s.x),lt(t.y,e.y,s.y)}function ht(t,e,s){t.min=e.min-s.min,t.max=t.min+D(e)}function I(t,e,s){ht(t.x,e.x,s.x),ht(t.y,e.y,s.y)}function A(t){return[t("x"),t("y")]}const Jt=({current:t})=>t?t.ownerDocument.defaultView:null,ct=(t,e)=>Math.abs(t-e);function Ne(t,e){const s=ct(t.x,e.x),n=ct(t.y,e.y);return Math.sqrt(s**2+n**2)}class Qt{constructor(e,s,{transformPagePoint:n,contextWindow:a=window,dragSnapToOrigin:u=!1,distanceThreshold:i=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=Y(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,m=Ne(d.offset,{x:0,y:0})>=this.distanceThreshold;if(!f&&!m)return;const{point:p}=d,{timestamp:y}=E;this.history.push({...p,timestamp:y});const{onStart:g,onMove:P}=this.handlers;f||(g&&g(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),P&&P(this.lastMoveEvent,d)},this.handlePointerMove=(d,f)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=X(f,this.transformPagePoint),S.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 g=Y(d.type==="pointercancel"?this.lastMoveEventInfo:X(f,this.transformPagePoint),this.history);this.startEvent&&m&&m(d,g),p&&p(d,g)},!ue(e))return;this.dragSnapToOrigin=u,this.handlers=s,this.transformPagePoint=n,this.distanceThreshold=i,this.contextWindow=a||window;const o=Ft(e),r=X(o,this.transformPagePoint),{point:l}=r,{timestamp:h}=E;this.history=[{...l,timestamp:h}];const{onSessionStart:c}=s;c&&c(e,Y(r,this.history)),this.removeListeners=de(M(this.contextWindow,"pointermove",this.handlePointerMove),M(this.contextWindow,"pointerup",this.handlePointerUp),M(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),U(this.updatePoint)}}function X(t,e){return e?{point:e(t.point)}:t}function ut(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Y({point:t},e){return{point:t,delta:ut(t,te(e)),offset:ut(t,We(e)),velocity:$e(e,.1)}}function We(t){return t[0]}function te(t){return t[t.length-1]}function $e(t,e){if(t.length<2)return{x:0,y:0};let s=t.length-1,n=null;const a=te(t);for(;s>=0&&(n=t[s],!(a.timestamp-n.timestamp>fe(e)));)s--;if(!n)return{x:0,y:0};const u=me(a.timestamp-n.timestamp);if(u===0)return{x:0,y:0};const i={x:(a.x-n.x)/u,y:(a.y-n.y)/u};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function Ge(t,{min:e,max:s},n){return e!==void 0&&t<e?t=n?x(e,t,n.min):Math.max(t,e):s!==void 0&&t>s&&(t=n?x(s,t,n.max):Math.min(t,s)),t}function dt(t,e,s){return{min:e!==void 0?t.min+e:void 0,max:s!==void 0?t.max+s-(t.max-t.min):void 0}}function ze(t,{top:e,left:s,bottom:n,right:a}){return{x:dt(t.x,s,a),y:dt(t.y,e,n)}}function ft(t,e){let s=e.min-t.min,n=e.max-t.max;return e.max-e.min<t.max-t.min&&([s,n]=[n,s]),{min:s,max:n}}function He(t,e){return{x:ft(t.x,e.x),y:ft(t.y,e.y)}}function Xe(t,e){let s=.5;const n=D(t),a=D(e);return a>n?s=J(e.min,e.max-n,t.min):n>a&&(s=J(t.min,t.max-a,e.min)),Yt(0,1,s)}function Ye(t,e){const s={};return e.min!==void 0&&(s.min=e.min-t.min),e.max!==void 0&&(s.max=e.max-t.min),s}const tt=.35;function qe(t=tt){return t===!1?t=0:t===!0&&(t=tt),{x:mt(t,"left","right"),y:mt(t,"top","bottom")}}function mt(t,e,s){return{min:pt(t,e),max:pt(t,s)}}function pt(t,e){return typeof t=="number"?t:t[e]||0}const _e=new WeakMap;class Ke{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=v(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:s=!1,distanceThreshold:n}={}){const{presenceContext:a}=this.visualElement;if(a&&a.isPresent===!1)return;const u=c=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),s&&this.snapToCursor(Ft(c).point)},i=(c,d)=>{const{drag:f,dragPropagation:m,onDragStart:p}=this.getProps();if(f&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=we(f),!this.openDragLock))return;this.latestPointerEvent=c,this.latestPanInfo=d,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),A(g=>{let P=this.getAxisMotionValue(g).get()||0;if(G.test(P)){const{projection:T}=this.visualElement;if(T&&T.layout){const C=T.layout.layoutBox[g];C&&(P=D(C)*(parseFloat(P)/100))}}this.originPoint[g]=P}),p&&S.postRender(()=>p(c,d)),it(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},o=(c,d)=>{this.latestPointerEvent=c,this.latestPanInfo=d;const{dragPropagation:f,dragDirectionLock:m,onDirectionLock:p,onDrag:y}=this.getProps();if(!f&&!this.openDragLock)return;const{offset:g}=d;if(m&&this.currentDirection===null){this.currentDirection=Ze(g),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",d.point,g),this.updateAxis("y",d.point,g),this.visualElement.render(),y&&y(c,d)},r=(c,d)=>{this.latestPointerEvent=c,this.latestPanInfo=d,this.stop(c,d),this.latestPointerEvent=null,this.latestPanInfo=null},l=()=>A(c=>{var d;return this.getAnimationState(c)==="paused"&&((d=this.getAxisMotionValue(c).animation)==null?void 0:d.play())}),{dragSnapToOrigin:h}=this.getProps();this.panSession=new Qt(e,{onSessionStart:u,onStart:i,onMove:o,onSessionEnd:r,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:h,distanceThreshold:n,contextWindow:Jt(this.visualElement)})}stop(e,s){const n=e||this.latestPointerEvent,a=s||this.latestPanInfo,u=this.isDragging;if(this.cancel(),!u||!a||!n)return;const{velocity:i}=a;this.startAnimation(i);const{onDragEnd:o}=this.getProps();o&&S.postRender(()=>o(n,a))}cancel(){this.isDragging=!1;const{projection:e,animationState:s}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),s&&s.setActive("whileDrag",!1)}updateAxis(e,s,n){const{drag:a}=this.getProps();if(!n||!W(e,a,this.currentDirection))return;const u=this.getAxisMotionValue(e);let i=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(i=Ge(i,this.constraints[e],this.elastic[e])),u.set(i)}resolveConstraints(){var u;const{dragConstraints:e,dragElastic:s}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(u=this.visualElement.projection)==null?void 0:u.layout,a=this.constraints;e&&N(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&n?this.constraints=ze(n.layoutBox,e):this.constraints=!1,this.elastic=qe(s),a!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&A(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=Ye(n.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:s}=this.getProps();if(!e||!N(e))return!1;const n=e.current,{projection:a}=this.visualElement;if(!a||!a.layout)return!1;const u=pe(n,a.root,this.visualElement.getTransformPagePoint());let i=He(a.layout.layoutBox,u);if(s){const o=s(ge(i));this.hasMutatedConstraints=!!o,o&&(i=ye(o))}return i}startAnimation(e){const{drag:s,dragMomentum:n,dragElastic:a,dragTransition:u,dragSnapToOrigin:i,onDragTransitionEnd:o}=this.getProps(),r=this.constraints||{},l=A(h=>{if(!W(h,s,this.currentDirection))return;let c=r&&r[h]||{};i&&(c={min:0,max:0});const d=a?200:1e6,f=a?40:1e7,m={type:"inertia",velocity:n?e[h]:0,bounceStiffness:d,bounceDamping:f,timeConstant:750,restDelta:1,restSpeed:10,...u,...c};return this.startAxisValueAnimation(h,m)});return Promise.all(l).then(o)}startAxisValueAnimation(e,s){const n=this.getAxisMotionValue(e);return it(this.visualElement,e),n.start(Nt(e,n,0,s,this.visualElement,!1))}stopAnimation(){A(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){A(e=>{var s;return(s=this.getAxisMotionValue(e).animation)==null?void 0:s.pause()})}getAnimationState(e){var s;return(s=this.getAxisMotionValue(e).animation)==null?void 0:s.state}getAxisMotionValue(e){const s=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps(),a=n[s];return a||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){A(s=>{const{drag:n}=this.getProps();if(!W(s,n,this.currentDirection))return;const{projection:a}=this.visualElement,u=this.getAxisMotionValue(s);if(a&&a.layout){const{min:i,max:o}=a.layout.layoutBox[s];u.set(e[s]-x(i,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:s}=this.getProps(),{projection:n}=this.visualElement;if(!N(s)||!n||!this.constraints)return;this.stopAnimation();const a={x:0,y:0};A(i=>{const o=this.getAxisMotionValue(i);if(o&&this.constraints!==!1){const r=o.get();a[i]=Xe({min:r,max:r},this.constraints[i])}});const{transformTemplate:u}=this.visualElement.getProps();this.visualElement.current.style.transform=u?u({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),A(i=>{if(!W(i,e,null))return;const o=this.getAxisMotionValue(i),{min:r,max:l}=this.constraints[i];o.set(x(r,l,a[i]))})}addListeners(){if(!this.visualElement.current)return;_e.set(this.visualElement,this);const e=this.visualElement.current,s=M(e,"pointerdown",r=>{const{drag:l,dragListener:h=!0}=this.getProps();l&&h&&this.start(r)}),n=()=>{const{dragConstraints:r}=this.getProps();N(r)&&r.current&&(this.constraints=this.resolveRefConstraints())},{projection:a}=this.visualElement,u=a.addEventListener("measure",n);a&&!a.layout&&(a.root&&a.root.updateScroll(),a.updateLayout()),S.read(n);const i=et(window,"resize",()=>this.scalePositionWithinConstraints()),o=a.addEventListener("didUpdate",(({delta:r,hasLayoutChanged:l})=>{this.isDragging&&l&&(A(h=>{const c=this.getAxisMotionValue(h);c&&(this.originPoint[h]+=r[h].translate,c.set(c.get()+r[h].translate))}),this.visualElement.render())}));return()=>{i(),s(),u(),o&&o()}}getProps(){const e=this.visualElement.getProps(),{drag:s=!1,dragDirectionLock:n=!1,dragPropagation:a=!1,dragConstraints:u=!1,dragElastic:i=tt,dragMomentum:o=!0}=e;return{...e,drag:s,dragDirectionLock:n,dragPropagation:a,dragConstraints:u,dragElastic:i,dragMomentum:o}}}function W(t,e,s){return(e===!0||e===t)&&(s===null||s===t)}function Ze(t,e=10){let s=null;return Math.abs(t.y)>e?s="y":Math.abs(t.x)>e&&(s="x"),s}class Je extends Wt{constructor(e){super(e),this.removeGroupControls=w,this.removeListeners=w,this.controls=new Ke(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||w}unmount(){this.removeGroupControls(),this.removeListeners()}}const gt=t=>(e,s)=>{t&&S.postRender(()=>t(e,s))};class Qe extends Wt{constructor(){super(...arguments),this.removePointerDownListener=w}onPointerDown(e){this.session=new Qt(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Jt(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:s,onPan:n,onPanEnd:a}=this.node.getProps();return{onSessionStart:gt(e),onStart:gt(s),onMove:n,onEnd:(u,i)=>{delete this.session,a&&S.postRender(()=>a(u,i))}}}mount(){this.removePointerDownListener=M(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const $={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function yt(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const k={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(qt.test(t))t=parseFloat(t);else return t;const s=yt(t,e.target.x),n=yt(t,e.target.y);return`${s}% ${n}%`}},ti={correct:(t,{treeScale:e,projectionDelta:s})=>{const n=t,a=st.parse(t);if(a.length>5)return n;const u=st.createTransformer(t),i=typeof a[0]!="number"?1:0,o=s.x.scale*e.x,r=s.y.scale*e.y;a[0+i]/=o,a[1+i]/=r;const l=x(o,r,.5);return typeof a[2+i]=="number"&&(a[2+i]/=l),typeof a[3+i]=="number"&&(a[3+i]/=l),u(a)}};let q=!1;class ei extends Q.Component{componentDidMount(){const{visualElement:e,layoutGroup:s,switchLayoutGroup:n,layoutId:a}=this.props,{projection:u}=e;je(ii),u&&(s.group&&s.group.add(u),n&&n.register&&a&&n.register(u),q&&u.root.didUpdate(),u.addEventListener("animationComplete",()=>{this.safeToRemove()}),u.setOptions({...u.options,onExitComplete:()=>this.safeToRemove()})),$.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:s,visualElement:n,drag:a,isPresent:u}=this.props,{projection:i}=n;return i&&(i.isPresent=u,q=!0,a||e.layoutDependency!==s||s===void 0||e.isPresent!==u?i.willUpdate():this.safeToRemove(),e.isPresent!==u&&(u?i.promote():i.relegate()||S.postRender(()=>{const o=i.getStack();(!o||!o.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),$t.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:s,switchLayoutGroup:n}=this.props,{projection:a}=e;q=!0,a&&(a.scheduleCheckAfterUnmount(),s&&s.group&&s.group.remove(a),n&&n.deregister&&n.deregister(a))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function ee(t){const[e,s]=Ae(),n=Q.useContext(Le);return Be.jsx(ei,{...t,layoutGroup:n,switchLayoutGroup:Q.useContext(Ce),isPresent:e,safeToRemove:s})}const ii={borderRadius:{...k,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:k,borderTopRightRadius:k,borderBottomLeftRadius:k,borderBottomRightRadius:k,boxShadow:ti};function si(t,e,s){const n=Ve(t)?t:Gt(t);return n.start(Nt("",n,e,s)),n.animation}const ni=(t,e)=>t.depth-e.depth;class oi{constructor(){this.children=[],this.isDirty=!1}add(e){zt(this.children,e),this.isDirty=!0}remove(e){Ht(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(ni),this.isDirty=!1,this.children.forEach(e)}}function ri(t,e){const s=Xt.now(),n=({timestamp:a})=>{const u=a-s;u>=e&&(U(n),t(u-e))};return S.setup(n,!0),()=>U(n)}const ie=["TopLeft","TopRight","BottomLeft","BottomRight"],ai=ie.length,vt=t=>typeof t=="string"?parseFloat(t):t,xt=t=>typeof t=="number"||qt.test(t);function li(t,e,s,n,a,u){a?(t.opacity=x(0,s.opacity??1,hi(n)),t.opacityExit=x(e.opacity??1,0,ci(n))):u&&(t.opacity=x(e.opacity??1,s.opacity??1,n));for(let i=0;i<ai;i++){const o=`border${ie[i]}Radius`;let r=Pt(e,o),l=Pt(s,o);if(r===void 0&&l===void 0)continue;r||(r=0),l||(l=0),r===0||l===0||xt(r)===xt(l)?(t[o]=Math.max(x(vt(r),vt(l),n),0),(G.test(l)||G.test(r))&&(t[o]+="%")):t[o]=l}(e.rotate||s.rotate)&&(t.rotate=x(e.rotate||0,s.rotate||0,n))}function Pt(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const hi=se(0,.5,ve),ci=se(.5,.95,w);function se(t,e,s){return n=>n<t?0:n>e?1:s(J(t,e,n))}function Tt(t,e){t.min=e.min,t.max=e.max}function R(t,e){Tt(t.x,e.x),Tt(t.y,e.y)}function Dt(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function Et(t,e,s,n,a){return t-=e,t=nt(t,1/s,n),a!==void 0&&(t=nt(t,1/a,n)),t}function ui(t,e=0,s=1,n=.5,a,u=t,i=t){if(G.test(e)&&(e=parseFloat(e),e=x(i.min,i.max,e/100)-i.min),typeof e!="number")return;let o=x(u.min,u.max,n);t===u&&(o-=e),t.min=Et(t.min,e,s,o,a),t.max=Et(t.max,e,s,o,a)}function St(t,e,[s,n,a],u,i){ui(t,e[s],e[n],e[a],e.scale,u,i)}const di=["x","scaleX","originX"],fi=["y","scaleY","originY"];function Rt(t,e,s,n){St(t.x,e,di,s?s.x:void 0,n?n.x:void 0),St(t.y,e,fi,s?s.y:void 0,n?n.y:void 0)}function At(t){return t.translate===0&&t.scale===1}function ne(t){return At(t.x)&&At(t.y)}function Lt(t,e){return t.min===e.min&&t.max===e.max}function mi(t,e){return Lt(t.x,e.x)&&Lt(t.y,e.y)}function Ct(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function oe(t,e){return Ct(t.x,e.x)&&Ct(t.y,e.y)}function jt(t){return D(t.x)/D(t.y)}function Vt(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class pi{constructor(){this.members=[]}add(e){zt(this.members,e),e.scheduleRender()}remove(e){if(Ht(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const s=this.members[this.members.length-1];s&&this.promote(s)}}relegate(e){const s=this.members.findIndex(a=>e===a);if(s===0)return!1;let n;for(let a=s;a>=0;a--){const u=this.members[a];if(u.isPresent!==!1){n=u;break}}return n?(this.promote(n),!0):!1}promote(e,s){const n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.instance&&n.scheduleRender(),e.scheduleRender(),e.resumeFrom=n,s&&(e.resumeFrom.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:a}=e.options;a===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:s,resumingFrom:n}=e;s.onExitComplete&&s.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function gi(t,e,s){let n="";const a=t.x.translate/e.x,u=t.y.translate/e.y,i=(s==null?void 0:s.z)||0;if((a||u||i)&&(n=`translate3d(${a}px, ${u}px, ${i}px) `),(e.x!==1||e.y!==1)&&(n+=`scale(${1/e.x}, ${1/e.y}) `),s){const{transformPerspective:l,rotate:h,rotateX:c,rotateY:d,skewX:f,skewY:m}=s;l&&(n=`perspective(${l}px) ${n}`),h&&(n+=`rotate(${h}deg) `),c&&(n+=`rotateX(${c}deg) `),d&&(n+=`rotateY(${d}deg) `),f&&(n+=`skewX(${f}deg) `),m&&(n+=`skewY(${m}deg) `)}const o=t.x.scale*e.x,r=t.y.scale*e.y;return(o!==1||r!==1)&&(n+=`scale(${o}, ${r})`),n||"none"}const _=["","X","Y","Z"],yi=1e3;let vi=0;function K(t,e,s,n){const{latestValues:a}=e;a[t]&&(s[t]=a[t],e.setStaticValue(t,0),n&&(n[t]=0))}function re(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const s=Se(e);if(window.MotionHasOptimisedAnimation(s,"transform")){const{layout:a,layoutId:u}=t.options;window.MotionCancelOptimisedAnimation(s,"transform",S,!(a||u))}const{parent:n}=t;n&&!n.hasCheckedOptimisedAppear&&re(n)}function ae({attachResizeListener:t,defaultParent:e,measureScroll:s,checkIsScrollRoot:n,resetTransform:a}){return class{constructor(i={},o=e==null?void 0:e()){this.id=vi++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.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(Ti),this.nodes.forEach(Ri),this.nodes.forEach(Ai),this.nodes.forEach(Di)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=i,this.root=o?o.root||o:this,this.path=o?[...o.path,o]:[],this.parent=o,this.depth=o?o.depth+1:0;for(let r=0;r<this.path.length;r++)this.path[r].shouldResetTransform=!0;this.root===this&&(this.nodes=new oi)}addEventListener(i,o){return this.eventHandlers.has(i)||this.eventHandlers.set(i,new xe),this.eventHandlers.get(i).add(o)}notifyListeners(i,...o){const r=this.eventHandlers.get(i);r&&r.notify(...o)}hasListeners(i){return this.eventHandlers.has(i)}mount(i){if(this.instance)return;this.isSVG=_t(i)&&!ke(i),this.instance=i;const{layoutId:o,layout:r,visualElement:l}=this.options;if(l&&!l.current&&l.mount(i),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||o)&&(this.isLayoutDirty=!0),t){let h,c=0;const d=()=>this.root.updateBlockedByResize=!1;S.read(()=>{c=window.innerWidth}),t(i,()=>{const f=window.innerWidth;f!==c&&(c=f,this.root.updateBlockedByResize=!0,h&&h(),h=ri(d,250),$.hasAnimatedSinceResize&&($.hasAnimatedSinceResize=!1,this.nodes.forEach(kt)))})}o&&this.root.registerSharedNode(o,this),this.options.animate!==!1&&l&&(o||r)&&this.addEventListener("didUpdate",({delta:h,hasLayoutChanged:c,hasRelativeLayoutChanged:d,layout:f})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||l.getDefaultTransition()||Bi,{onLayoutAnimationStart:p,onLayoutAnimationComplete:y}=l.getProps(),g=!this.targetLayout||!oe(this.targetLayout,f),P=!c&&d;if(this.options.layoutRoot||this.resumeFrom||P||c&&(g||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const T={...Pe(m,"layout"),onPlay:p,onComplete:y};(l.shouldReduceMotion||this.options.layoutRoot)&&(T.delay=0,T.type=!1),this.startAnimation(T),this.setAnimationOrigin(h,P)}else c||kt(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=f})}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,this.eventHandlers.clear(),U(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(Li),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&&re(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let h=0;h<this.path.length;h++){const c=this.path[h];c.shouldResetTransform=!0,c.updateScroll("snapshot"),c.options.layoutRoot&&c.willUpdate(!1)}const{layoutId:o,layout:r}=this.options;if(o===void 0&&!r)return;const l=this.getTransformTemplate();this.prevTransformTemplateValue=l?l(this.latestValues,""):void 0,this.updateSnapshot(),i&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Bt);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(wt);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Si),this.nodes.forEach(xi),this.nodes.forEach(Pi)):this.nodes.forEach(wt),this.clearAllSnapshots();const o=Xt.now();E.delta=Yt(0,1e3/60,o-E.timestamp),E.timestamp=o,E.isProcessing=!0,z.update.process(E),z.preRender.process(E),z.render.process(E),E.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,$t.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Ei),this.sharedNodes.forEach(Ci)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,S.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){S.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!D(this.snapshot.measuredBox.x)&&!D(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 r=0;r<this.path.length;r++)this.path[r].updateScroll();const i=this.layout;this.layout=this.measure(!1),this.layoutCorrected=v(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:o}=this.options;o&&o.notify("LayoutMeasure",this.layout.layoutBox,i?i.layoutBox:void 0)}updateScroll(i="measure"){let o=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===i&&(o=!1),o&&this.instance){const r=n(this.instance);this.scroll={animationId:this.root.animationId,phase:i,isRoot:r,offset:s(this.instance),wasRoot:this.scroll?this.scroll.isRoot:r}}}resetTransform(){if(!a)return;const i=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,o=this.projectionDelta&&!ne(this.projectionDelta),r=this.getTransformTemplate(),l=r?r(this.latestValues,""):void 0,h=l!==this.prevTransformTemplateValue;i&&this.instance&&(o||V(this.latestValues)||h)&&(a(this.instance,l),this.shouldResetTransform=!1,this.scheduleRender())}measure(i=!0){const o=this.measurePageBox();let r=this.removeElementScroll(o);return i&&(r=this.removeTransform(r)),wi(r),{animationId:this.root.animationId,measuredBox:o,layoutBox:r,latestValues:{},source:this.id}}measurePageBox(){var l;const{visualElement:i}=this.options;if(!i)return v();const o=i.measureViewportBox();if(!(((l=this.scroll)==null?void 0:l.wasRoot)||this.path.some(ki))){const{scroll:h}=this.root;h&&(O(o.x,h.offset.x),O(o.y,h.offset.y))}return o}removeElementScroll(i){var r;const o=v();if(R(o,i),(r=this.scroll)!=null&&r.wasRoot)return o;for(let l=0;l<this.path.length;l++){const h=this.path[l],{scroll:c,options:d}=h;h!==this.root&&c&&d.layoutScroll&&(c.wasRoot&&R(o,i),O(o.x,c.offset.x),O(o.y,c.offset.y))}return o}applyTransform(i,o=!1){const r=v();R(r,i);for(let l=0;l<this.path.length;l++){const h=this.path[l];!o&&h.options.layoutScroll&&h.scroll&&h!==h.root&&F(r,{x:-h.scroll.offset.x,y:-h.scroll.offset.y}),V(h.latestValues)&&F(r,h.latestValues)}return V(this.latestValues)&&F(r,this.latestValues),r}removeTransform(i){const o=v();R(o,i);for(let r=0;r<this.path.length;r++){const l=this.path[r];if(!l.instance||!V(l.latestValues))continue;ot(l.latestValues)&&l.updateSnapshot();const h=v(),c=l.measurePageBox();R(h,c),Rt(o,l.latestValues,l.snapshot?l.snapshot.layoutBox:void 0,h)}return V(this.latestValues)&&Rt(o,this.latestValues),o}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!==E.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(i=!1){var d;const o=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=o.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=o.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=o.isSharedProjectionDirty);const r=!!this.resumingFrom||this!==o;if(!(i||r&&this.isSharedProjectionDirty||this.isProjectionDirty||(d=this.parent)!=null&&d.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:h,layoutId:c}=this.options;if(!(!this.layout||!(h||c))){if(this.resolvedRelativeTargetAt=E.timestamp,!this.targetDelta&&!this.relativeTarget){const f=this.getClosestProjectingParent();f&&f.layout&&this.animationProgress!==1?(this.relativeParent=f,this.forceRelativeParentToResolveTarget(),this.relativeTarget=v(),this.relativeTargetOrigin=v(),I(this.relativeTargetOrigin,this.layout.layoutBox,f.layout.layoutBox),R(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=v(),this.targetWithTransforms=v()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Fe(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):R(this.target,this.layout.layoutBox),Te(this.target,this.targetDelta)):R(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const f=this.getClosestProjectingParent();f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?(this.relativeParent=f,this.forceRelativeParentToResolveTarget(),this.relativeTarget=v(),this.relativeTargetOrigin=v(),I(this.relativeTargetOrigin,this.target,f.target),R(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||ot(this.parent.latestValues)||De(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 m;const i=this.getLead(),o=!!this.resumingFrom||this!==i;let r=!0;if((this.isProjectionDirty||(m=this.parent)!=null&&m.isProjectionDirty)&&(r=!1),o&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(r=!1),this.resolvedRelativeTargetAt===E.timestamp&&(r=!1),r)return;const{layout:l,layoutId:h}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(l||h))return;R(this.layoutCorrected,this.layout.layoutBox);const c=this.treeScale.x,d=this.treeScale.y;Ee(this.layoutCorrected,this.treeScale,this.path,o),i.layout&&!i.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(i.target=i.layout.layoutBox,i.targetWithTransforms=v());const{target:f}=i;if(!f){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Dt(this.prevProjectionDelta.x,this.projectionDelta.x),Dt(this.prevProjectionDelta.y,this.projectionDelta.y)),b(this.projectionDelta,this.layoutCorrected,f,this.latestValues),(this.treeScale.x!==c||this.treeScale.y!==d||!Vt(this.projectionDelta.x,this.prevProjectionDelta.x)||!Vt(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",f))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(i=!0){var o;if((o=this.options.visualElement)==null||o.scheduleRender(),i){const r=this.getStack();r&&r.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=B(),this.projectionDelta=B(),this.projectionDeltaWithTransform=B()}setAnimationOrigin(i,o=!1){const r=this.snapshot,l=r?r.latestValues:{},h={...this.latestValues},c=B();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!o;const d=v(),f=r?r.source:void 0,m=this.layout?this.layout.source:void 0,p=f!==m,y=this.getStack(),g=!y||y.members.length<=1,P=!!(p&&!g&&this.options.crossfade===!0&&!this.path.some(Vi));this.animationProgress=0;let T;this.mixTargetDelta=C=>{const j=C/1e3;Mt(c.x,i.x,j),Mt(c.y,i.y,j),this.setTargetDelta(c),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(I(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox),ji(this.relativeTarget,this.relativeTargetOrigin,d,j),T&&mi(this.relativeTarget,T)&&(this.isProjectionDirty=!1),T||(T=v()),R(T,this.relativeTarget)),p&&(this.animationValues=h,li(h,l,this.latestValues,j,P,g)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=j},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(i){var o,r,l;this.notifyListeners("animationStart"),(o=this.currentAnimation)==null||o.stop(),(l=(r=this.resumingFrom)==null?void 0:r.currentAnimation)==null||l.stop(),this.pendingAnimation&&(U(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=S.update(()=>{$.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Gt(0)),this.currentAnimation=si(this.motionValue,[0,1e3],{...i,velocity:0,isSync:!0,onUpdate:h=>{this.mixTargetDelta(h),i.onUpdate&&i.onUpdate(h)},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(yi),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const i=this.getLead();let{targetWithTransforms:o,target:r,layout:l,latestValues:h}=i;if(!(!o||!r||!l)){if(this!==i&&this.layout&&l&&le(this.options.animationType,this.layout.layoutBox,l.layoutBox)){r=this.target||v();const c=D(this.layout.layoutBox.x);r.x.min=i.target.x.min,r.x.max=r.x.min+c;const d=D(this.layout.layoutBox.y);r.y.min=i.target.y.min,r.y.max=r.y.min+d}R(o,r),F(o,h),b(this.projectionDeltaWithTransform,this.layoutCorrected,o,h)}}registerSharedNode(i,o){this.sharedNodes.has(i)||this.sharedNodes.set(i,new pi),this.sharedNodes.get(i).add(o);const l=o.options.initialPromotionConfig;o.promote({transition:l?l.transition:void 0,preserveFollowOpacity:l&&l.shouldPreserveFollowOpacity?l.shouldPreserveFollowOpacity(o):void 0})}isLead(){const i=this.getStack();return i?i.lead===this:!0}getLead(){var o;const{layoutId:i}=this.options;return i?((o=this.getStack())==null?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:i}=this.options;return i?(o=this.getStack())==null?void 0:o.prevLead:void 0}getStack(){const{layoutId:i}=this.options;if(i)return this.root.sharedNodes.get(i)}promote({needsReset:i,transition:o,preserveFollowOpacity:r}={}){const l=this.getStack();l&&l.promote(this,r),i&&(this.projectionDelta=void 0,this.needsReset=!0),o&&this.setOptions({transition:o})}relegate(){const i=this.getStack();return i?i.relegate(this):!1}resetSkewAndRotation(){const{visualElement:i}=this.options;if(!i)return;let o=!1;const{latestValues:r}=i;if((r.z||r.rotate||r.rotateX||r.rotateY||r.rotateZ||r.skewX||r.skewY)&&(o=!0),!o)return;const l={};r.z&&K("z",i,l,this.animationValues);for(let h=0;h<_.length;h++)K(`rotate${_[h]}`,i,l,this.animationValues),K(`skew${_[h]}`,i,l,this.animationValues);i.render();for(const h in l)i.setStaticValue(h,l[h]),this.animationValues&&(this.animationValues[h]=l[h]);i.scheduleRender()}applyProjectionStyles(i,o){if(!this.instance||this.isSVG)return;if(!this.isVisible){i.visibility="hidden";return}const r=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,i.visibility="",i.opacity="",i.pointerEvents=H(o==null?void 0:o.pointerEvents)||"",i.transform=r?r(this.latestValues,""):"none";return}const l=this.getLead();if(!this.projectionDelta||!this.layout||!l.target){this.options.layoutId&&(i.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,i.pointerEvents=H(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!V(this.latestValues)&&(i.transform=r?r({},""):"none",this.hasProjected=!1);return}i.visibility="";const h=l.animationValues||l.latestValues;this.applyTransformsToTarget();let c=gi(this.projectionDeltaWithTransform,this.treeScale,h);r&&(c=r(h,c)),i.transform=c;const{x:d,y:f}=this.projectionDelta;i.transformOrigin=`${d.origin*100}% ${f.origin*100}% 0`,l.animationValues?i.opacity=l===this?h.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:i.opacity=l===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const m in rt){if(h[m]===void 0)continue;const{correct:p,applyTo:y,isCSSVariable:g}=rt[m],P=c==="none"?h[m]:p(h[m],l);if(y){const T=y.length;for(let C=0;C<T;C++)i[y[C]]=P}else g?this.options.visualElement.renderState.vars[m]=P:i[m]=P}this.options.layoutId&&(i.pointerEvents=l===this?H(o==null?void 0:o.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(i=>{var o;return(o=i.currentAnimation)==null?void 0:o.stop()}),this.root.nodes.forEach(Bt),this.root.sharedNodes.clear()}}}function xi(t){t.updateLayout()}function Pi(t){var s;const e=((s=t.resumeFrom)==null?void 0:s.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:a}=t.layout,{animationType:u}=t.options,i=e.source!==t.layout.source;u==="size"?A(c=>{const d=i?e.measuredBox[c]:e.layoutBox[c],f=D(d);d.min=n[c].min,d.max=d.min+f}):le(u,e.layoutBox,n)&&A(c=>{const d=i?e.measuredBox[c]:e.layoutBox[c],f=D(n[c]);d.max=d.min+f,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[c].max=t.relativeTarget[c].min+f)});const o=B();b(o,n,e.layoutBox);const r=B();i?b(r,t.applyTransform(a,!0),e.measuredBox):b(r,n,e.layoutBox);const l=!ne(o);let h=!1;if(!t.resumeFrom){const c=t.getClosestProjectingParent();if(c&&!c.resumeFrom){const{snapshot:d,layout:f}=c;if(d&&f){const m=v();I(m,e.layoutBox,d.layoutBox);const p=v();I(p,n,f.layoutBox),oe(m,p)||(h=!0),c.options.layoutRoot&&(t.relativeTarget=p,t.relativeTargetOrigin=m,t.relativeParent=c)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:r,layoutDelta:o,hasLayoutChanged:l,hasRelativeLayoutChanged:h})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function Ti(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Di(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Ei(t){t.clearSnapshot()}function Bt(t){t.clearMeasurements()}function wt(t){t.isLayoutDirty=!1}function Si(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function kt(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Ri(t){t.resolveTargetDelta()}function Ai(t){t.calcProjection()}function Li(t){t.resetSkewAndRotation()}function Ci(t){t.removeLeadSnapshot()}function Mt(t,e,s){t.translate=x(e.translate,0,s),t.scale=x(e.scale,1,s),t.origin=e.origin,t.originPoint=e.originPoint}function bt(t,e,s,n){t.min=x(e.min,s.min,n),t.max=x(e.max,s.max,n)}function ji(t,e,s,n){bt(t.x,e.x,s.x,n),bt(t.y,e.y,s.y,n)}function Vi(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Bi={duration:.45,ease:[.4,0,.1,1]},It=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Ut=It("applewebkit/")&&!It("chrome/")?Math.round:w;function Ot(t){t.min=Ut(t.min),t.max=Ut(t.max)}function wi(t){Ot(t.x),Ot(t.y)}function le(t,e,s){return t==="position"||t==="preserve-aspect"&&!Oe(jt(e),jt(s),.2)}function ki(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const Mi=ae({attachResizeListener:(t,e)=>et(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Z={current:void 0},he=ae({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Z.current){const t=new Mi({});t.mount(window),t.setOptions({layoutScroll:!0}),Z.current=t}return Z.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Fi={pan:{Feature:Qe},drag:{Feature:Je,ProjectionNode:he,MeasureLayout:ee}},Ni={layout:{ProjectionNode:he,MeasureLayout:ee}};export{Fi as d,Ni as l};