scrolltube 2.0.15 → 2.1.0

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.
@@ -11,4 +11,4 @@
11
11
  */
12
12
 
13
13
 
14
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ScrollTube=e():t.ScrollTube=e()}(this,()=>(()=>{"use strict";var t={d:(e,n)=>{for(var i in n)t.o(n,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:n[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};t.d(e,{default:()=>Zs});class n{constructor(t,e={}){if(this.targetMouse={x:0,y:0},this.currentMouse={x:0,y:0},this.animationFrameId=0,this.depthTilt=.04,this.animate=()=>{if(this.currentMouse.x+=.1*(this.targetMouse.x-this.currentMouse.x),this.currentMouse.y+=.1*(this.targetMouse.y-this.currentMouse.y),this.gl&&this.program){this.gl.useProgram(this.program);const t=this.gl.getUniformLocation(this.program,"u_mouse");this.gl.uniform2f(t,this.currentMouse.x,this.currentMouse.y);const e=this.gl.getUniformLocation(this.program,"u_depthTilt");this.gl.uniform1f(e,this.depthTilt),this.draw()}this.animationFrameId=requestAnimationFrame(this.animate)},this.depthTilt=void 0!==e.depthTilt?e.depthTilt:4,this.gl=t.getContext("webgl",{alpha:!1,antialias:!1}),!this.gl)throw new Error("WebGL not supported");this.program=this.createProgram("\n attribute vec2 a_position;\n varying vec2 v_texCoord;\n void main() {\n gl_Position = vec4(a_position, 0.0, 1.0);\n // Convert -1 -> 1 to 0 -> 1 for UVs\n v_texCoord = a_position * 0.5 + 0.5;\n v_texCoord.y = 1.0 - v_texCoord.y;\n }\n ","\n precision mediump float;\n uniform sampler2D u_image;\n uniform sampler2D u_depthMap;\n uniform vec2 u_resolution;\n uniform vec2 u_imageResolution;\n uniform vec2 u_mouse;\n uniform float u_depthTilt;\n uniform bool u_hasDepth;\n varying vec2 v_texCoord;\n\n void main() {\n // object-fit: cover math\n vec2 ratio = vec2(\n min((u_resolution.x / u_resolution.y) / (u_imageResolution.x / u_imageResolution.y), 1.0),\n min((u_resolution.y / u_resolution.x) / (u_imageResolution.y / u_imageResolution.x), 1.0)\n );\n vec2 uv = vec2(\n v_texCoord.x * ratio.x + (1.0 - ratio.x) * 0.5,\n v_texCoord.y * ratio.y + (1.0 - ratio.y) * 0.5\n );\n\n if (u_hasDepth) {\n float depth = texture2D(u_depthMap, uv).r;\n // White is close (1), Black is far (0).\n // By making the background move and the foreground stay still (using 1.0 - depth)\n // and subtracting the parallax, the background pulls the foreground over itself,\n // expanding the edges and creating proper occlusion, instead of collapsing/tearing.\n // depthTilt is scaled by 0.01 internally (so 100 = 1.0 peak displacement)\n vec2 parallax = u_mouse * (1.0 - depth) * (u_depthTilt * 0.01);\n uv -= parallax;\n }\n \n gl_FragColor = texture2D(u_image, uv);\n }\n "),this.gl.useProgram(this.program),this.positionBuffer=this.gl.createBuffer(),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.positionBuffer),this.gl.bufferData(this.gl.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),this.gl.STATIC_DRAW),this.texture=this.gl.createTexture(),this.depthTexture=this.gl.createTexture(),window.addEventListener("mousemove",t=>{this.targetMouse.x=t.clientX/window.innerWidth*2-1,this.targetMouse.y=t.clientY/window.innerHeight*2-1}),this.animate()}setDepthTilt(t){this.depthTilt=t}createProgram(t,e){const n=this.gl.createShader(this.gl.VERTEX_SHADER);this.gl.shaderSource(n,t),this.gl.compileShader(n);const i=this.gl.createShader(this.gl.FRAGMENT_SHADER);this.gl.shaderSource(i,e),this.gl.compileShader(i);const s=this.gl.createProgram();return this.gl.attachShader(s,n),this.gl.attachShader(s,i),this.gl.linkProgram(s),s}render(t,e,n,i){this.gl.useProgram(this.program),this.gl.activeTexture(this.gl.TEXTURE0),this.gl.bindTexture(this.gl.TEXTURE_2D,this.texture),this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,this.gl.RGBA,this.gl.UNSIGNED_BYTE,t),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.LINEAR),this.gl.activeTexture(this.gl.TEXTURE1),this.gl.bindTexture(this.gl.TEXTURE_2D,this.depthTexture),e&&(this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,this.gl.RGBA,this.gl.UNSIGNED_BYTE,e),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.LINEAR)),this.gl.uniform1i(this.gl.getUniformLocation(this.program,"u_image"),0),this.gl.uniform1i(this.gl.getUniformLocation(this.program,"u_depthMap"),1),this.gl.uniform1i(this.gl.getUniformLocation(this.program,"u_hasDepth"),e?1:0),this.gl.uniform2f(this.gl.getUniformLocation(this.program,"u_resolution"),n,i),this.gl.uniform2f(this.gl.getUniformLocation(this.program,"u_imageResolution"),t.naturalWidth,t.naturalHeight);const s=this.gl.getAttribLocation(this.program,"a_position");this.gl.enableVertexAttribArray(s),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.positionBuffer),this.gl.vertexAttribPointer(s,2,this.gl.FLOAT,!1,0,0),this.gl.viewport(0,0,n,i),this.draw()}draw(){this.gl.drawArrays(this.gl.TRIANGLES,0,6)}destroy(){cancelAnimationFrame(this.animationFrameId)}}var i=function(t,e,n,i){return new(n||(n=Promise))(function(s,r){function a(t){try{h(i.next(t))}catch(t){r(t)}}function o(t){try{h(i.throw(t))}catch(t){r(t)}}function h(t){var e;t.done?s(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(a,o)}h((i=i.apply(t,e||[])).next())})};class s{constructor(t,e={}){this.currentFrame=-1,this.activeVariant=null,this.canvas=null,this.ctx=null,this.renderer=null,this.basePath="",this.scrub=0,this.depthTilt=4,this.targetProgress=0,this.currentProgress=0,this.rafId=0,this.destroyed=!1,this.imageCache=new Map,this.depthCache=new Map,this.scrollTimeout=null,this.trackingDataCache=new Map,this.config=t,this.basePath=t.settings.basePath||"",this.scrub=void 0!==e.scrub?e.scrub:0,this.depthTilt=void 0!==e.depthTilt?e.depthTilt:4,this.detectBestVariant(),this.boundResize=()=>{this.detectBestVariant(),this.resizeCanvas(),this.render()},window.addEventListener("resize",this.boundResize),this.updateLoop=this.updateLoop.bind(this),this.rafId=requestAnimationFrame(this.updateLoop)}destroy(){this.destroyed=!0,this.rafId&&cancelAnimationFrame(this.rafId),window.removeEventListener("resize",this.boundResize),this.scrollTimeout&&clearTimeout(this.scrollTimeout),this.clearCache(),this.trackingDataCache.clear(),this.canvas=null,this.ctx=null,this.renderer=null,this.onFrameChange=void 0}static init(t,e){return i(this,void 0,void 0,function*(){const n=yield fetch(e);if(!n.ok)throw new Error(`Failed to load config: ${n.statusText}`);const i=yield n.json(),r=e.substring(0,e.lastIndexOf("/"));i.settings||(i.settings={baseResolution:{width:1920,height:1080},scrollMode:"vh"}),i.settings.basePath=i.settings.basePath||r;const a=new s(i,{scrub:"object"==typeof i.settings?i.settings.scrub:0});let o=t.querySelector("canvas");return o||(o=document.createElement("canvas"),o.style.width="100%",o.style.height="100%",o.style.display="block",o.style.objectFit="cover",t.appendChild(o)),a.attachCanvas(o),a})}attachCanvas(t){this.canvas=t;try{this.renderer=new n(t,{depthTilt:this.depthTilt})}catch(e){console.warn("WebGL failed, falling back to 2D",e),this.ctx=t.getContext("2d",{alpha:!1})}this.resizeCanvas(),this.render()}resizeCanvas(){if(!this.canvas)return;const t=this.canvas.getBoundingClientRect(),e=t.width,n=t.height,i=window.devicePixelRatio||1;this.canvas.width=e*i,this.canvas.height=n*i,this.ctx&&this.ctx.scale(i,i)}detectBestVariant(){var t;const e=this.config.assets[0];if(!e)return;const n=this.canvas?this.canvas.getBoundingClientRect():{width:window.innerWidth,height:window.innerHeight},i=n.height>n.width,s=n.width*(window.devicePixelRatio||1),r=e.variants.filter(t=>{const e="portrait"===t.orientation||parseInt(t.aspectRatio.split(":")[1])>parseInt(t.aspectRatio.split(":")[0]);return i===e});r.sort((t,e)=>t.frameCount-e.frameCount);const a=r.find(t=>t.width>=s)||r[r.length-1];a?(null===(t=this.activeVariant)||void 0===t?void 0:t.id)!==a.id&&(console.log(`🎯 Variant Switched: ${a.id} (${i?"Portrait":"Landscape"})`),this.activeVariant=a,this.clearCache(),this.preloadInitial()):console.warn("[CoreEngine] No suitable variant found")}clearCache(){this.imageCache.clear(),this.depthCache.clear()}preloadInitial(){for(let t=0;t<15;t++)this.getImage(t)}update(t){this.targetProgress=Math.max(0,Math.min(1,t))}setDepthTilt(t){this.depthTilt=t,this.renderer&&this.renderer.setDepthTilt(t)}updateLoop(){if(this.destroyed)return;this.rafId=requestAnimationFrame(this.updateLoop);const t=this.scrub;if(t>0){const e=Math.max(.01,1-t);this.currentProgress+=(this.targetProgress-this.currentProgress)*e}else this.currentProgress=this.targetProgress;Math.abs(this.targetProgress-this.currentProgress)<1e-4&&(this.currentProgress=this.targetProgress),this.onProgressUpdate&&this.onProgressUpdate(this.currentProgress),this.calculateFrame(this.currentProgress)}calculateFrame(t){const e=this.config.timeline.scenes[0];if(!e)return;const n=e.assetRange[1]-e.assetRange[0],i=Math.floor(e.assetRange[0]+t*n),s=Math.max(0,Math.min(i,e.assetRange[1]));s!==this.currentFrame&&(this.currentFrame=s,this.render(),this.getImage(this.currentFrame+5),this.getImage(this.currentFrame+10),this.scrollTimeout&&clearTimeout(this.scrollTimeout),this.scrollTimeout=setTimeout(()=>{this.loadDepthMap(this.currentFrame)},100),this.onFrameChange&&this.onFrameChange(this.currentFrame,t))}loadTrackingData(t){return i(this,void 0,void 0,function*(){var e;if(!this.activeVariant)return;if(!(null===(e=this.activeVariant.subjects)||void 0===e?void 0:e.includes(t)))return void console.warn(`[CoreEngine] Subject ${t} not found in active variant ${this.activeVariant.id}`);const n=`${this.activeVariant.id}_${t}`;if(!this.trackingDataCache.has(n))try{const e=`${this.basePath?`${this.basePath}/`:""}${this.activeVariant.path}/000_tracking-${t}.json`;console.log(`[CoreEngine] Fetching tracking data: ${e}`);const i=yield fetch(e);if(!i.ok)throw new Error(i.statusText);const s=yield i.json();this.trackingDataCache.set(n,s)}catch(e){console.error(`[CoreEngine] Failed to load tracking data for ${t}`,e)}})}getTrackedCoords(t,e){if(!this.activeVariant||!this.canvas)return{x:.5,y:.5};const n=`${this.activeVariant.id}_${t}`,i=this.trackingDataCache.get(n);if(!i)return{x:.5,y:.5};const s=i.find(t=>t.frame===e);if(!s)return{x:.5,y:.5};const r=this.canvas.clientWidth/this.canvas.clientHeight,a=this.activeVariant.width/this.activeVariant.height,o=Math.min(r/a,1),h=Math.min(1/r/(1/a),1);return{x:(s.x-.5)/o+.5,y:(s.y-.5)/h+.5,scale:s.scale}}render(){var t;if(!this.canvas||-1===this.currentFrame)return;const e=this.getImage(this.currentFrame);if(!e||!e.complete)return;const n=this.canvas.clientWidth,i=this.canvas.clientHeight;let s=null;if((null===(t=this.activeVariant)||void 0===t?void 0:t.hasDepthMap)&&(s=this.getDepthImage(this.currentFrame),s&&!s.complete&&(s=null)),this.renderer)this.renderer.render(e,s,n*(window.devicePixelRatio||1),i*(window.devicePixelRatio||1));else if(this.ctx){const t=e.naturalWidth/e.naturalHeight;let s,r,a,o;t>n/i?(r=i,s=i*t,a=(n-s)/2,o=0):(s=n,r=n/t,a=0,o=(i-r)/2),this.ctx.clearRect(0,0,n,i),this.ctx.drawImage(e,a,o,s,r)}}getImage(t){if(!this.activeVariant)return null;if(t<0||t>=this.activeVariant.frameCount)return null;const e=`${this.activeVariant.id}_${t}`;if(this.imageCache.has(e))return this.imageCache.get(e);const n=this.basePath?`${this.basePath}/`:"",i=new Image;return i.crossOrigin="anonymous",i.src=`${n}${this.activeVariant.path}/index_${t}.webp`,i.onload=()=>{this.currentFrame===t&&this.render()},this.imageCache.set(e,i),i}loadDepthMap(t){var e;if(!(null===(e=this.activeVariant)||void 0===e?void 0:e.hasDepthMap))return void console.log("[CoreEngine] activeVariant does not define hasDepthMap=true");console.log(`[CoreEngine] Lazy requesting depth map for frame: ${t}`);this.getDepthImage(t)}getDepthImage(t){var e;if(!(null===(e=this.activeVariant)||void 0===e?void 0:e.hasDepthMap))return null;if(t<0||t>=this.activeVariant.frameCount)return null;const n=`${this.activeVariant.id}_depth_${t}`;if(this.depthCache.has(n))return this.depthCache.get(n);const i=this.basePath?`${this.basePath}/`:"";console.log(`[CoreEngine] Downloading: ${i}${this.activeVariant.path}/index_${t}_depth.webp`);const s=new Image;return s.crossOrigin="anonymous",s.src=`${i}${this.activeVariant.path}/index_${t}_depth.webp`,s.onload=()=>{console.log(`[CoreEngine] Depth map loaded for frame: ${t}`),this.currentFrame===t&&this.render()},s.onerror=e=>{console.error(`[CoreEngine] Depth map failed to load for frame: ${t}`,e)},this.depthCache.set(n,s),s}}const r=t=>t,a={},o=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],h={value:null,addProjectionMetrics:null};function l(t,e){let n=!1,i=!0;const s={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,l=o.reduce((t,n)=>(t[n]=function(t,e){let n=new Set,i=new Set,s=!1,r=!1;const a=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1},l=0;function c(e){a.has(e)&&(u.schedule(e),t()),l++,e(o)}const u={schedule:(t,e=!1,r=!1)=>{const o=r&&s?n:i;return e&&a.add(t),o.add(t),t},cancel:t=>{i.delete(t),a.delete(t)},process:t=>{if(o=t,s)return void(r=!0);s=!0;const a=n;n=i,i=a,n.forEach(c),e&&h.value&&h.value.frameloop[e].push(l),l=0,n.clear(),s=!1,r&&(r=!1,u.process(t))}};return u}(r,e?n:void 0),t),{}),{setup:c,read:u,resolveKeyframes:d,preUpdate:p,update:f,preRender:m,render:g,postRender:y}=l,v=()=>{const r=a.useManualTiming,o=r?s.timestamp:performance.now();n=!1,r||(s.delta=i?1e3/60:Math.max(Math.min(o-s.timestamp,40),1)),s.timestamp=o,s.isProcessing=!0,c.process(s),u.process(s),d.process(s),p.process(s),f.process(s),m.process(s),g.process(s),y.process(s),s.isProcessing=!1,n&&e&&(i=!1,t(v))};return{schedule:o.reduce((e,r)=>{const a=l[r];return e[r]=(e,r=!1,o=!1)=>(n||(n=!0,i=!0,s.isProcessing||t(v)),a.schedule(e,r,o)),e},{}),cancel:t=>{for(let e=0;e<o.length;e++)l[o[e]].cancel(t)},state:s,steps:l}}const{schedule:c,cancel:u,state:d,steps:p}=l("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:r,!0);function f(t,e){let n;const i=()=>{const{currentTime:i}=e,s=(null===i?0:i.value)/100;n!==s&&t(s),n=s};return c.preUpdate(i,!0),()=>u(i)}function m(t){let e;return()=>(void 0===e&&(e=t()),e)}const g={};function y(t,e){const n=m(t);return()=>g[e]??n()}const v=y(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),b=y(()=>void 0!==window.ViewTimeline,"viewTimeline");function w(t){return"undefined"!=typeof window&&(t?b():v())}function T(t){return"object"==typeof t&&null!==t}function x(t){return T(t)&&"ownerSVGElement"in t}function M(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let i=document;e&&(i=e.current);const s=n?.[t]??i.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(t=>null!=t)}const A=new WeakMap;let S;const E=(t,e,n)=>(i,s)=>s&&s[0]?s[0][t+"Size"]:x(i)&&"getBBox"in i?i.getBBox()[e]:i[n],C=E("inline","width","offsetWidth"),V=E("block","height","offsetHeight");function k({target:t,borderBoxSize:e}){A.get(t)?.forEach(n=>{n(t,{get width(){return C(t,e)},get height(){return V(t,e)}})})}function P(t){t.forEach(k)}function R(t,e){S||"undefined"!=typeof ResizeObserver&&(S=new ResizeObserver(P));const n=M(t);return n.forEach(t=>{let n=A.get(t);n||(n=new Set,A.set(t,n)),n.add(e),S?.observe(t)}),()=>{n.forEach(t=>{const n=A.get(t);n?.delete(e),n?.size||S?.unobserve(t)})}}const F=new Set;let D;function _(t){return F.add(t),D||(D=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};F.forEach(e=>e(t))},window.addEventListener("resize",D)),()=>{F.delete(t),F.size||"function"!=typeof D||(window.removeEventListener("resize",D),D=void 0)}}const B=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i};function I(t,e){return e?t*(1e3/e):0}const O={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function L(t,e,n,i){const s=n[e],{length:r,position:a}=O[e],o=s.current,h=n.time;s.current=Math.abs(t[`scroll${a}`]),s.scrollLength=t[`scroll${r}`]-t[`client${r}`],s.offset.length=0,s.offset[0]=0,s.offset[1]=s.scrollLength,s.progress=B(0,s.scrollLength,s.current);const l=i-h;s.velocity=l>50?0:I(s.current-o,l)}const W=(t,e)=>n=>e(t(n)),$=(...t)=>t.reduce(W);const j=(t,e,n)=>n>e?e:n<t?t:n,N=t=>e=>"string"==typeof e&&e.startsWith(t),U=N("--"),X=N("var(--"),z=t=>!!X(t)&&K.test(t.split("/*")[0].trim()),K=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Y(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const H={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},q={...H,transform:t=>j(0,1,t)},G={...H,default:1},Z=t=>Math.round(1e5*t)/1e5,J=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const Q=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,tt=(t,e)=>n=>Boolean("string"==typeof n&&Q.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),et=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,r,a,o]=i.match(J);return{[t]:parseFloat(s),[e]:parseFloat(r),[n]:parseFloat(a),alpha:void 0!==o?parseFloat(o):1}},nt={...H,transform:t=>Math.round((t=>j(0,255,t))(t))},it={test:tt("rgb","red"),parse:et("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+nt.transform(t)+", "+nt.transform(e)+", "+nt.transform(n)+", "+Z(q.transform(i))+")"};const st={test:tt("#"),parse:function(t){let e="",n="",i="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}},transform:it.transform},rt=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),at=rt("deg"),ot=rt("%"),ht=rt("px"),lt=rt("vh"),ct=rt("vw"),ut=(()=>({...ot,parse:t=>ot.parse(t)/100,transform:t=>ot.transform(100*t)}))(),dt={test:tt("hsl","hue"),parse:et("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+ot.transform(Z(e))+", "+ot.transform(Z(n))+", "+Z(q.transform(i))+")"},pt={test:t=>it.test(t)||st.test(t)||dt.test(t),parse:t=>it.test(t)?it.parse(t):dt.test(t)?dt.parse(t):st.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?it.transform(t):dt.transform(t),getAnimatableNone:t=>{const e=pt.parse(t);return e.alpha=0,pt.transform(e)}},ft=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const mt="number",gt="color",yt=/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 vt(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let r=0;const a=e.replace(yt,t=>(pt.test(t)?(i.color.push(r),s.push(gt),n.push(pt.parse(t))):t.startsWith("var(")?(i.var.push(r),s.push("var"),n.push(t)):(i.number.push(r),s.push(mt),n.push(parseFloat(t))),++r,"${}")).split("${}");return{values:n,split:a,indexes:i,types:s}}function bt({split:t,types:e}){const n=t.length;return i=>{let s="";for(let r=0;r<n;r++)if(s+=t[r],void 0!==i[r]){const t=e[r];s+=t===mt?Z(i[r]):t===gt?pt.transform(i[r]):i[r]}return s}}const wt=(t,e)=>{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(n=t)?0:pt.test(n)?pt.getAnimatableNone(n):n;var n};const Tt={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(J)?.length||0)+(t.match(ft)?.length||0)>0},parse:function(t){return vt(t).values},createTransformer:function(t){return bt(vt(t))},getAnimatableNone:function(t){const e=vt(t);return bt(e)(e.values.map((t,n)=>wt(t,e.split[n])))}};function xt(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Mt(t,e){return n=>n>0?e:t}const At=(t,e,n)=>t+(e-t)*n,St=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},Et=[st,it,dt];function Ct(t){const e=(n=t,Et.find(t=>t.test(n)));var n;if(Boolean(e),!Boolean(e))return!1;let i=e.parse(t);return e===dt&&(i=function({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let s=0,r=0,a=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,o=2*n-i;s=xt(o,i,t+1/3),r=xt(o,i,t),a=xt(o,i,t-1/3)}else s=r=a=n;return{red:Math.round(255*s),green:Math.round(255*r),blue:Math.round(255*a),alpha:i}}(i)),i}const Vt=(t,e)=>{const n=Ct(t),i=Ct(e);if(!n||!i)return Mt(t,e);const s={...n};return t=>(s.red=St(n.red,i.red,t),s.green=St(n.green,i.green,t),s.blue=St(n.blue,i.blue,t),s.alpha=At(n.alpha,i.alpha,t),it.transform(s))},kt=new Set(["none","hidden"]);function Pt(t,e){return n=>At(t,e,n)}function Rt(t){return"number"==typeof t?Pt:"string"==typeof t?z(t)?Mt:pt.test(t)?Vt:_t:Array.isArray(t)?Ft:"object"==typeof t?pt.test(t)?Vt:Dt:Mt}function Ft(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>Rt(t)(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=s[e](t);return n}}function Dt(t,e){const n={...t,...e},i={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(i[s]=Rt(t[s])(t[s],e[s]));return t=>{for(const e in i)n[e]=i[e](t);return n}}const _t=(t,e)=>{const n=Tt.createTransformer(e),i=vt(t),s=vt(e);return i.indexes.var.length===s.indexes.var.length&&i.indexes.color.length===s.indexes.color.length&&i.indexes.number.length>=s.indexes.number.length?kt.has(t)&&!s.values.length||kt.has(e)&&!i.values.length?function(t,e){return kt.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):$(Ft(function(t,e){const n=[],i={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const r=e.types[s],a=t.indexes[r][i[r]],o=t.values[a]??0;n[s]=o,i[r]++}return n}(i,s),s.values),n):Mt(t,e)};function Bt(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return At(t,e,n);return Rt(t)(t,e)}function It(t,e,{clamp:n=!0,ease:i,mixer:s}={}){const o=t.length;if(e.length,1===o)return()=>e[0];if(2===o&&e[0]===e[1])return()=>e[1];const h=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const l=function(t,e,n){const i=[],s=n||a.mix||Bt,o=t.length-1;for(let n=0;n<o;n++){let a=s(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]||r:e;a=$(t,a)}i.push(a)}return i}(e,i,s),c=l.length,u=n=>{if(h&&n<t[0])return e[0];let i=0;if(c>1)for(;i<t.length-2&&!(n<t[i+1]);i++);const s=B(t[i],t[i+1],n);return l[i](s)};return n?e=>u(j(t[0],t[o-1],e)):u}function Ot(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=B(0,e,i);t.push(At(n,1,s))}}function Lt(t){const e=[0];return Ot(e,t.length-1),e}function Wt(t){return T(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const $t={start:0,center:.5,end:1};function jt(t,e,n=0){let i=0;if(t in $t&&(t=$t[t]),"string"==typeof t){const e=parseFloat(t);t.endsWith("px")?i=e:t.endsWith("%")?t=e/100:t.endsWith("vw")?i=e/100*document.documentElement.clientWidth:t.endsWith("vh")?i=e/100*document.documentElement.clientHeight:t=e}return"number"==typeof t&&(i=e*t),n+i}const Nt=[0,0];function Ut(t,e,n,i){let s=Array.isArray(t)?t:Nt,r=0,a=0;return"number"==typeof t?s=[t,t]:"string"==typeof t&&(s=(t=t.trim()).includes(" ")?t.split(" "):[t,$t[t]?t:"0"]),r=jt(s[0],n,i),a=jt(s[1],e),r-a}const Xt={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},zt={x:0,y:0};function Kt(t,e,n){const{offset:i=Xt.All}=n,{target:s=t,axis:r="y"}=n,a="y"===r?"height":"width",o=s!==t?function(t,e){const n={x:0,y:0};let i=t;for(;i&&i!==e;)if(Wt(i))n.x+=i.offsetLeft,n.y+=i.offsetTop,i=i.offsetParent;else if("svg"===i.tagName){const t=i.getBoundingClientRect();i=i.parentElement;const e=i.getBoundingClientRect();n.x+=t.left-e.left,n.y+=t.top-e.top}else{if(!(i instanceof SVGGraphicsElement))break;{const{x:t,y:e}=i.getBBox();n.x+=t,n.y+=e;let s=null,r=i.parentNode;for(;!s;)"svg"===r.tagName&&(s=r),r=i.parentNode;i=s}}return n}(s,t):zt,h=s===t?{width:t.scrollWidth,height:t.scrollHeight}:function(t){return"getBBox"in t&&"svg"!==t.tagName?t.getBBox():{width:t.clientWidth,height:t.clientHeight}}(s),l={width:t.clientWidth,height:t.clientHeight};e[r].offset.length=0;let c=!e[r].interpolate;const u=i.length;for(let t=0;t<u;t++){const n=Ut(i[t],l[a],h[a],o[r]);c||n===e[r].interpolatorOffsets[t]||(c=!0),e[r].offset[t]=n}c&&(e[r].interpolate=It(e[r].offset,Lt(i),{clamp:!1}),e[r].interpolatorOffsets=[...e[r].offset]),e[r].progress=j(0,1,e[r].interpolate(e[r].current))}function Yt(t,e,n,i={}){return{measure:e=>{!function(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let i=e;for(;i&&i!==t;)n.x.targetOffset+=i.offsetLeft,n.y.targetOffset+=i.offsetTop,i=i.offsetParent}n.x.targetLength=e===t?e.scrollWidth:e.clientWidth,n.y.targetLength=e===t?e.scrollHeight:e.clientHeight,n.x.containerLength=t.clientWidth,n.y.containerLength=t.clientHeight}(t,i.target,n),function(t,e,n){L(t,"x",e,n),L(t,"y",e,n),e.time=n}(t,n,e),(i.offset||i.target)&&Kt(t,n,i)},notify:()=>e(n)}}const Ht=new WeakMap,qt=new WeakMap,Gt=new WeakMap,Zt=new WeakMap,Jt=new WeakMap,Qt=t=>t===document.scrollingElement?window:t;function te(t,{container:e=document.scrollingElement,trackContentSize:n=!1,...i}={}){if(!e)return r;let s=Gt.get(e);s||(s=new Set,Gt.set(e,s));const a=Yt(e,t,{time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},i);if(s.add(a),!Ht.has(e)){const t=()=>{for(const t of s)t.measure(d.timestamp);c.preUpdate(n)},n=()=>{for(const t of s)t.notify()},i=()=>c.read(t);Ht.set(e,i);const r=Qt(e);window.addEventListener("resize",i),e!==document.documentElement&&qt.set(e,(h=i,"function"==typeof(o=e)?_(o):R(o,h))),r.addEventListener("scroll",i),i()}var o,h;if(n&&!Jt.has(e)){const t=Ht.get(e),n={width:e.scrollWidth,height:e.scrollHeight};Zt.set(e,n);const i=()=>{const i=e.scrollWidth,s=e.scrollHeight;n.width===i&&n.height===s||(t(),n.width=i,n.height=s)},s=c.read(i,!0);Jt.set(e,s)}const l=Ht.get(e);return c.read(l,!1,!0),()=>{u(l);const t=Gt.get(e);if(!t)return;if(t.delete(a),t.size)return;const n=Ht.get(e);Ht.delete(e),n&&(Qt(e).removeEventListener("scroll",n),qt.get(e)?.(),window.removeEventListener("resize",n));const i=Jt.get(e);i&&(u(i),Jt.delete(e)),Zt.delete(e)}}const ee=[[Xt.Enter,"entry"],[Xt.Exit,"exit"],[Xt.Any,"cover"],[Xt.All,"contain"]];function ne(t,e){if(2!==t.length)return!1;for(let n=0;n<2;n++){const i=t[n],s=e[n];if(!Array.isArray(i)||2!==i.length||i[0]!==s[0]||i[1]!==s[1])return!1}return!0}function ie(t){if(!t)return{rangeStart:"contain 0%",rangeEnd:"contain 100%"};for(const[e,n]of ee)if(ne(t,e))return{rangeStart:`${n} 0%`,rangeEnd:`${n} 100%`}}const se=new Map;function re(t){const e={value:0},n=te(n=>{e.value=100*n[t.axis].progress},t);return{currentTime:e,cancel:n}}function ae({source:t,container:e,...n}){const{axis:i}=n;t&&(e=t);let s=se.get(e);s||(s=new Map,se.set(e,s));const r=n.target??"self";let a=s.get(r);a||(a={},s.set(r,a));const o=i+(n.offset??[]).join(",");if(!a[o])if(n.target&&w(n.target)){const t=ie(n.offset);a[o]=t?new ViewTimeline({subject:n.target,axis:i}):re({container:e,...n})}else w()?a[o]=new ScrollTimeline({source:e,axis:i}):a[o]=re({container:e,...n});return a[o]}function oe(t,{axis:e="y",container:n=document.scrollingElement,...i}={}){if(!n)return r;const s={axis:e,container:n,...i};return"function"==typeof t?function(t,e){return function(t){return 2===t.length}(t)?te(n=>{t(n[e.axis].progress,n)},e):f(t,ae(e))}(t,s):function(t,e){const n=ae(e),i=e.target?ie(e.offset):void 0,s=e.target?w(e.target)&&!!i:w();return t.attachTimeline({timeline:s?n:void 0,...i&&s&&{rangeStart:i.rangeStart,rangeEnd:i.rangeEnd},observe:t=>(t.pause(),f(e=>{t.time=t.iterationDuration*e},n))})}(t,s)}class he{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;n<this.animations.length;n++)this.animations[n][t]=e}attachTimeline(t){const e=this.animations.map(e=>e.attachTimeline(t));return()=>{e.forEach((t,e)=>{t&&t(),this.animations[e].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 state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return le(this.animations,"duration")}get iterationDuration(){return le(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(e=>e[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function le(t,e){let n=0;for(let i=0;i<t.length;i++){const s=t[i][e];null!==s&&s>n&&(n=s)}return n}class ce extends he{then(t,e){return this.finished.finally(t).then(()=>{})}}function ue(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class de{constructor(){this.subscriptions=[]}add(t){var e,n;return e=this.subscriptions,n=t,-1===e.indexOf(n)&&e.push(n),()=>ue(this.subscriptions,t)}notify(t,e,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,n);else for(let s=0;s<i;s++){const i=this.subscriptions[s];i&&i(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}let pe;function fe(){pe=void 0}const me={now:()=>(void 0===pe&&me.set(d.isProcessing||a.useManualTiming?d.timestamp:performance.now()),pe),set:t=>{pe=t,queueMicrotask(fe)}},ge={current:void 0};class ye{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=me.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=me.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new de);const n=this.events[t].add(e);return"change"===t?()=>{n(),c.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return ge.current&&ge.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=me.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return I(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),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.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function ve(t,e){return new ye(t,e)}const be=t=>1e3*t,we=t=>t/1e3,Te=(t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let e=0;e<s;e++)i+=Math.round(1e4*t(e/(s-1)))/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},xe=2e4;function Me(t){let e=0;let n=t.next(e);for(;!n.done&&e<xe;)e+=50,n=t.next(e);return e>=xe?1/0:e}function Ae(t,e=100,n){const i=n({...t,keyframes:[0,e]}),s=Math.min(Me(i),xe);return{type:"keyframes",ease:t=>i.next(s*t).value/e,duration:we(s)}}const Se=100,Ee=10,Ce=1,Ve=0,ke=800,Pe=.3,Re=.3,Fe={granular:.01,default:2},De={granular:.005,default:.5},_e=.01,Be=10,Ie=.05,Oe=1;function Le(t,e){return t*Math.sqrt(1-e*e)}const We=.001;const $e=["duration","bounce"],je=["stiffness","damping","mass"];function Ne(t,e){return e.some(e=>void 0!==t[e])}function Ue(t){let e={velocity:Ve,stiffness:Se,damping:Ee,mass:Ce,isResolvedFromDuration:!1,...t};if(!Ne(t,je)&&Ne(t,$e))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(1.2*n),s=i*i,r=2*j(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:Ce,stiffness:s,damping:r}}else{const n=function({duration:t=ke,bounce:e=Pe,velocity:n=Ve,mass:i=Ce}){let s,r;be(Be);let a=1-e;a=j(Ie,Oe,a),t=j(_e,Be,we(t)),a<1?(s=e=>{const i=e*a,s=i*t,r=i-n,o=Le(e,a),h=Math.exp(-s);return We-r/o*h},r=e=>{const i=e*a*t,r=i*n+n,o=Math.pow(a,2)*Math.pow(e,2)*t,h=Math.exp(-i),l=Le(Math.pow(e,2),a);return(-s(e)+We>0?-1:1)*((r-o)*h)/l}):(s=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,r=e=>Math.exp(-e*t)*(t*t*(n-e)));const o=function(t,e,n){let i=n;for(let n=1;n<12;n++)i-=t(i)/e(i);return i}(s,r,5/t);if(t=be(t),isNaN(o))return{stiffness:Se,damping:Ee,duration:t};{const e=Math.pow(o,2)*i;return{stiffness:e,damping:2*a*Math.sqrt(i*e),duration:t}}}({...t,velocity:0});e={...e,...n,mass:Ce},e.isResolvedFromDuration=!0}return e}function Xe(t=Re,e=Pe){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:s}=n;const r=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],o={done:!1,value:r},{stiffness:h,damping:l,mass:c,duration:u,velocity:d,isResolvedFromDuration:p}=Ue({...n,velocity:-we(n.velocity||0)}),f=d||0,m=l/(2*Math.sqrt(h*c)),g=a-r,y=we(Math.sqrt(h/c)),v=Math.abs(g)<5;let b,w,T,x,M,A;if(i||(i=v?Fe.granular:Fe.default),s||(s=v?De.granular:De.default),m<1)T=Le(y,m),x=(f+m*y*g)/T,b=t=>{const e=Math.exp(-m*y*t);return a-e*(x*Math.sin(T*t)+g*Math.cos(T*t))},M=m*y*x+g*T,A=m*y*g-x*T,w=t=>Math.exp(-m*y*t)*(M*Math.sin(T*t)+A*Math.cos(T*t));else if(1===m){b=t=>a-Math.exp(-y*t)*(g+(f+y*g)*t);const t=f+y*g;w=e=>Math.exp(-y*e)*(y*t*e-f)}else{const t=y*Math.sqrt(m*m-1);b=e=>{const n=Math.exp(-m*y*e),i=Math.min(t*e,300);return a-n*((f+m*y*g)*Math.sinh(i)+t*g*Math.cosh(i))/t};const e=(f+m*y*g)/t,n=m*y*e-g*t,i=m*y*g-e*t;w=e=>{const s=Math.exp(-m*y*e),r=Math.min(t*e,300);return s*(n*Math.sinh(r)+i*Math.cosh(r))}}const S={calculatedDuration:p&&u||null,velocity:t=>be(w(t)),next:t=>{if(!p&&m<1){const e=Math.exp(-m*y*t),n=Math.sin(T*t),r=Math.cos(T*t),h=a-e*(x*n+g*r),l=be(e*(M*n+A*r));return o.done=Math.abs(l)<=i&&Math.abs(a-h)<=s,o.value=o.done?a:h,o}const e=b(t);if(p)o.done=t>=u;else{const n=be(w(t));o.done=Math.abs(n)<=i&&Math.abs(a-e)<=s}return o.value=o.done?a:e,o},toString:()=>{const t=Math.min(Me(S),xe),e=Te(e=>S.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return S}function ze(t){return"function"==typeof t&&"applyToOptions"in t}Xe.applyToOptions=t=>{const e=Ae(t,100,Xe);return t.ease=e.ease,t.duration=be(e.duration),t.type="keyframes",t};const Ke=t=>Boolean(t&&t.getVelocity),Ye=t=>Array.isArray(t)&&"number"!=typeof t[0];function He(t,e){return Ye(t)?t[((t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t})(0,t.length,e)]:t}function qe(t){return"object"==typeof t&&!Array.isArray(t)}function Ge(t,e,n,i){return null==t?[]:"string"==typeof t&&qe(e)?M(t,n,i):t instanceof NodeList?Array.from(t):Array.isArray(t)?t.filter(t=>null!=t):[t]}function Ze(t,e,n){return t*(e+1)}function Je(t,e,n,i){return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:e.startsWith("<")?Math.max(0,n+parseFloat(e.slice(1))):i.get(e)??t}function Qe(t,e,n,i,s,r){!function(t,e,n){for(let i=0;i<t.length;i++){const s=t[i];s.at>e&&s.at<n&&(ue(t,s),i--)}}(t,s,r);for(let a=0;a<e.length;a++)t.push({value:e[a],at:At(s,r,i[a]),easing:He(n,a)})}function tn(t,e){for(let n=0;n<t.length;n++)t[n]=t[n]/(e+1)}function en(t,e){return t.at===e.at?null===t.value?1:null===e.value?-1:0:t.at-e.at}function nn(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function sn(t,e){return e[t]||(e[t]=[]),e[t]}function rn(t){return Array.isArray(t)?t:[t]}function an(t,e){return t&&t[e]?{...t,...t[e]}:{...t}}const on=t=>"number"==typeof t,hn=t=>t.every(on),ln={layout:0,mainThread:0,waapi:0},cn=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>c.update(e,t),stop:()=>u(e),now:()=>d.isProcessing?d.timestamp:me.now()}};function un(t,e,n){const i=Math.max(e-5,0);return I(n-t(i),e-i)}function dn({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:r=500,modifyTarget:a,min:o,max:h,restDelta:l=.5,restSpeed:c}){const u=t[0],d={done:!1,value:u},p=t=>void 0===o?h:void 0===h||Math.abs(o-t)<Math.abs(h-t)?o:h;let f=n*e;const m=u+f,g=void 0===a?m:a(m);g!==m&&(f=g-u);const y=t=>-f*Math.exp(-t/i),v=t=>g+y(t),b=t=>{const e=y(t),n=v(t);d.done=Math.abs(e)<=l,d.value=d.done?g:n};let w,T;const x=t=>{var e;(e=d.value,void 0!==o&&e<o||void 0!==h&&e>h)&&(w=t,T=Xe({keyframes:[d.value,p(d.value)],velocity:un(v,t,d.value),damping:s,stiffness:r,restDelta:l,restSpeed:c}))};return x(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==w||(e=!0,b(t),x(t)),void 0!==w&&t>=w?T.next(t-w):(!e&&b(t),d)}}}const pn=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function fn(t,e,n,i){if(t===e&&n===i)return r;const s=e=>function(t,e,n,i,s){let r,a,o=0;do{a=e+(n-e)/2,r=pn(a,i,s)-t,r>0?n=a:e=a}while(Math.abs(r)>1e-7&&++o<12);return a}(e,0,1,t,n);return t=>0===t||1===t?t:pn(s(t),e,i)}const mn=fn(.42,0,1,1),gn=fn(0,0,.58,1),yn=fn(.42,0,.58,1),vn=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,bn=t=>e=>1-t(1-e),wn=fn(.33,1.53,.69,.99),Tn=bn(wn),xn=vn(Tn),Mn=t=>t>=1?1:(t*=2)<1?.5*Tn(t):.5*(2-Math.pow(2,-10*(t-1))),An=t=>1-Math.sin(Math.acos(t)),Sn=bn(An),En=vn(An),Cn=t=>Array.isArray(t)&&"number"==typeof t[0],Vn={linear:r,easeIn:mn,easeInOut:yn,easeOut:gn,circIn:An,circInOut:En,circOut:Sn,backIn:Tn,backInOut:xn,backOut:wn,anticipate:Mn},kn=t=>{if(Cn(t)){t.length;const[e,n,i,s]=t;return fn(e,n,i,s)}return"string"==typeof t?Vn[t]:t};function Pn({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const s=Ye(i)?i.map(kn):kn(i),r={done:!1,value:e[0]},a=function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:Lt(e),t),o=It(a,e,{ease:Array.isArray(s)?s:(h=e,l=s,h.map(()=>l||yn).splice(0,h.length-1))});var h,l;return{calculatedDuration:t,next:e=>(r.value=o(e),r.done=e>=t,r)}}const Rn=t=>null!==t;function Fn(t,{repeat:e,repeatType:n="loop"},i,s=1){const r=t.filter(Rn),a=s<0||e&&"loop"!==n&&e%2==1?0:r.length-1;return a&&void 0!==i?i:r[a]}const Dn={decay:dn,inertia:dn,tween:Pn,keyframes:Pn,spring:Xe};function _n(t){"string"==typeof t.type&&(t.type=Dn[t.type])}class Bn{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const In=t=>t/100;class On extends Bn{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==me.now()&&this.tick(me.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},ln.mainThread++,this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;_n(t);const{type:e=Pn,repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:r=0}=t;let{keyframes:a}=t;const o=e||Pn;o!==Pn&&"number"!=typeof a[0]&&(this.mixKeyframes=$(In,Bt(a[0],a[1])),a=[0,100]);const h=o({...t,keyframes:a});"mirror"===s&&(this.mirroredGenerator=o({...t,keyframes:[...a].reverse(),velocity:-r})),null===h.calculatedDuration&&(h.calculatedDuration=Me(h));const{calculatedDuration:l}=h;this.calculatedDuration=l,this.resolvedDuration=l+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=h}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:i,mixKeyframes:s,mirroredGenerator:r,resolvedDuration:a,calculatedDuration:o}=this;if(null===this.startTime)return n.next(0);const{delay:h=0,keyframes:l,repeat:c,repeatType:u,repeatDelay:d,type:p,onUpdate:f,finalKeyframe:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const g=this.currentTime-h*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?g<0:g>i;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);let v=this.currentTime,b=n;if(c){const t=Math.min(this.currentTime,i)/a;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,c+1);Boolean(e%2)&&("reverse"===u?(n=1-n,d&&(n-=d/a)):"mirror"===u&&(b=r)),v=j(0,1,n)*a}const w=y?{done:!1,value:l[0]}:b.next(v);s&&!y&&(w.value=s(w.value));let{done:T}=w;y||null===o||(T=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const x=null===this.holdTime&&("finished"===this.state||"running"===this.state&&T);return x&&p!==dn&&(w.value=Fn(l,this.options,m,this.speed)),f&&f(w.value),x&&this.finish(),w}then(t,e){return this.finished.then(t,e)}get duration(){return we(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+we(t)}get time(){return we(this.currentTime)}set time(t){t=be(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);return un(t=>this.generator.next(t).value,t,this.generator.next(t).value)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;e&&this.driver&&this.updateTime(me.now()),this.playbackSpeed=t,e&&this.driver&&(this.time=we(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=cn,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=e??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(me.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null,ln.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}const Ln=t=>180*t/Math.PI,Wn=t=>{const e=Ln(Math.atan2(t[1],t[0]));return jn(e)},$n={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Wn,rotateZ:Wn,skewX:t=>Ln(Math.atan(t[1])),skewY:t=>Ln(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},jn=t=>((t%=360)<0&&(t+=360),t),Nn=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Un=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Xn={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Nn,scaleY:Un,scale:t=>(Nn(t)+Un(t))/2,rotateX:t=>jn(Ln(Math.atan2(t[6],t[5]))),rotateY:t=>jn(Ln(Math.atan2(-t[2],t[0]))),rotateZ:Wn,rotate:Wn,skewX:t=>Ln(Math.atan(t[4])),skewY:t=>Ln(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function zn(t){return t.includes("scale")?1:0}function Kn(t,e){if(!t||"none"===t)return zn(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=Xn,s=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=$n,s=e}if(!s)return zn(e);const r=i[e],a=s[1].split(",").map(Yn);return"function"==typeof r?r(a):a[r]}function Yn(t){return parseFloat(t.trim())}const Hn=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],qn=(()=>new Set(Hn))(),Gn=t=>t===H||t===ht,Zn=new Set(["x","y","z"]),Jn=Hn.filter(t=>!Zn.has(t));const Qn={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:i})=>{const s=t.max-t.min;return"border-box"===i?s:s-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:i})=>{const s=t.max-t.min;return"border-box"===i?s:s-parseFloat(e)-parseFloat(n)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Kn(e,"x"),y:(t,{transform:e})=>Kn(e,"y")};Qn.translateX=Qn.x,Qn.translateY=Qn.y;const ti=new Set;let ei=!1,ni=!1,ii=!1;function si(){if(ni){const t=Array.from(ti).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),n=new Map;e.forEach(t=>{const e=function(t){const e=[];return Jn.forEach(n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}(t);e.length&&(n.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=n.get(t);e&&e.forEach(([e,n])=>{t.getValue(e)?.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}ni=!1,ei=!1,ti.forEach(t=>t.complete(ii)),ti.clear()}function ri(){ti.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(ni=!0)})}class ai{constructor(t,e,n,i,s,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=i,this.element=s,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?(ti.add(this),ei||(ei=!0,c.read(ri),c.resolveKeyframes(si))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;if(null===t[0]){const s=i?.get(),r=t[t.length-1];if(void 0!==s)t[0]=s;else if(n&&e){const i=n.readValue(e,r);null!=i&&(t[0]=i)}void 0===t[0]&&(t[0]=r),i&&void 0===s&&i.set(t[0])}!function(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),ti.delete(this)}cancel(){"scheduled"===this.state&&(ti.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}function oi(t,e,n){(t=>t.startsWith("--"))(e)?t.style.setProperty(e,n):t.style[e]=n}const hi=y(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),li=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,ci={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:li([0,.65,.55,1]),circOut:li([.55,0,1,.45]),backIn:li([.31,.01,.66,-.59]),backOut:li([.33,1.53,.69,.99])};function ui(t,e){return t?"function"==typeof t?hi()?Te(t,e):"ease-out":Cn(t)?li(t):Array.isArray(t)?t.map(t=>ui(t,e)||ci.easeOut):ci[t]:void 0}function di(t,e,n,{delay:i=0,duration:s=300,repeat:r=0,repeatType:a="loop",ease:o="easeOut",times:l}={},c=void 0){const u={[e]:n};l&&(u.offset=l);const d=ui(o,s);Array.isArray(d)&&(u.easing=d),h.value&&ln.waapi++;const p={delay:i,duration:s,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:r+1,direction:"reverse"===a?"alternate":"normal"};c&&(p.pseudoElement=c);const f=t.animate(u,p);return h.value&&f.finished.finally(()=>{ln.waapi--}),f}class pi extends Bn{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:n,keyframes:i,pseudoElement:s,allowFlatten:r=!1,finalKeyframe:a,onComplete:o}=t;this.isPseudoElement=Boolean(s),this.allowFlatten=r,this.options=t,t.type;const h=function({type:t,...e}){return ze(t)&&hi()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=di(e,n,i,h,s),!1===h.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const t=Fn(i,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(t),oi(e,n,t),this.animation.cancel()}o?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return we(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+we(t)}get time(){return we(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=be(t),e&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:e,rangeEnd:n,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&v()?(this.animation.timeline=t,e&&(this.animation.rangeStart=e),n&&(this.animation.rangeEnd=n),r):i(this)}}const fi={anticipate:Mn,backInOut:xn,circInOut:En};function mi(t){"string"==typeof t.ease&&t.ease in fi&&(t.ease=fi[t.ease])}class gi extends pi{constructor(t){mi(t),_n(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:i,element:s,...r}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const a=new On({...r,autoplay:!1}),o=Math.max(10,me.now()-this.startTime),h=j(0,10,o-10),l=a.sample(o).value,{name:c}=this.options;s&&c&&oi(s,c,l),e.setWithVelocity(a.sample(Math.max(0,o-h)).value,l,h),a.stop()}}const yi=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Tt.test(t)&&"0"!==t||t.startsWith("url(")));function vi(t){t.duration=0,t.type="keyframes"}const bi=new Set(["opacity","clipPath","filter","transform"]),wi=m(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class Ti extends Bn{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:r="loop",keyframes:a,name:o,motionValue:h,element:l,...c}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=me.now();const u={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:s,repeatType:r,name:o,motionValue:h,element:l,...c},d=l?.KeyframeResolver||ai;this.keyframeResolver=new d(a,(t,e,n)=>this.onKeyframesResolved(t,e,u,!n),o,h,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,e,n,i){this.keyframeResolver=void 0;const{name:s,type:o,velocity:h,delay:l,isHandoff:c,onUpdate:u}=n;this.resolvedAt=me.now();let d=!0;(function(t,e,n,i){const s=t[0];if(null===s)return!1;if("display"===e||"visibility"===e)return!0;const r=t[t.length-1],a=yi(s,e),o=yi(r,e);return!(!a||!o)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}(t)||("spring"===n||ze(n))&&i)})(t,s,o,h)||(d=!1,!a.instantAnimations&&l||u?.(Fn(t,n,e)),t[0]=t[t.length-1],vi(n),n.repeat=0);const p={startTime:i?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:e,...n,keyframes:t},f=d&&!c&&function(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:r,type:a}=t,o=e?.owner?.current;if(!(o instanceof HTMLElement))return!1;const{onUpdate:h,transformTemplate:l}=e.owner.getProps();return wi()&&n&&bi.has(n)&&("transform"!==n||!l)&&!h&&!i&&"mirror"!==s&&0!==r&&"inertia"!==a}(p),m=p.motionValue?.owner?.current,g=f?new gi({...p,element:m}):new On(p);g.finished.then(()=>{this.notifyFinished()}).catch(r),this.pendingTimeline&&(this.stopTimeline=g.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=g}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),ii=!0,ri(),si(),ii=!1),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function xi(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function Mi(t,e){const n=t?.[e]??t?.default??t;return n!==t?xi(n,t):n}const Ai={type:"spring",stiffness:500,damping:25,restSpeed:10},Si={type:"keyframes",duration:.8},Ei={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Ci=(t,{keyframes:e})=>e.length>2?Si:qn.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Ai:Ei,Vi=t=>null!==t;const ki=(t,e,n,i={},s,r)=>o=>{const h=Mi(i,t)||{},l=h.delay||i.delay||0;let{elapsed:u=0}=i;u-=be(l);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...h,delay:-u,onUpdate:t=>{e.set(t),h.onUpdate&&h.onUpdate(t)},onComplete:()=>{o(),h.onComplete&&h.onComplete()},name:t,motionValue:e,element:r?void 0:s};(function({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:s,repeat:r,repeatType:a,repeatDelay:o,from:h,elapsed:l,...c}){return!!Object.keys(c).length})(h)||Object.assign(d,Ci(t,d)),d.duration&&(d.duration=be(d.duration)),d.repeatDelay&&(d.repeatDelay=be(d.repeatDelay)),void 0!==d.from&&(d.keyframes[0]=d.from);let p=!1;if((!1===d.type||0===d.duration&&!d.repeatDelay)&&(vi(d),0===d.delay&&(p=!0)),(a.instantAnimations||a.skipAnimations||s?.shouldSkipAnimations)&&(p=!0,vi(d),d.delay=0),d.allowFlatten=!h.type&&!h.ease,p&&!r&&void 0!==e.get()){const t=function(t,{repeat:e,repeatType:n="loop"},i){const s=t.filter(Vi),r=e&&"loop"!==n&&e%2==1?0:s.length-1;return r&&void 0!==i?i:s[r]}(d.keyframes,h);if(void 0!==t)return void c.update(()=>{d.onUpdate(t),d.onComplete()})}return h.isSync?new On(d):new Ti(d)};const Pi=new WeakMap,Ri=new Set(["width","height","top","left","right","bottom",...Hn]);function Fi(t){const e=[{},{}];return t?.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function Di(t,e,n,i){if("function"==typeof e){const[s,r]=Fi(i);e=e(void 0!==n?n:t.custom,s,r)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[s,r]=Fi(i);e=e(void 0!==n?n:t.custom,s,r)}return e}function _i(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,ve(n))}function Bi(t){return(t=>Array.isArray(t))(t)?t[t.length-1]||0:t}function Ii(t,e){const n=function(t,e,n){const i=t.getProps();return Di(i,e,void 0!==n?n:i.custom,t)}(t,e);let{transitionEnd:i={},transition:s={},...r}=n||{};r={...r,...i};for(const e in r){_i(t,e,Bi(r[e]))}}function Oi(t,e){const n=t.getValue("willChange");if(i=n,Boolean(Ke(i)&&i.add))return n.add(e);if(!n&&a.WillChange){const n=new a.WillChange("auto");t.addValue("willChange",n),n.add(e)}var i}function Li(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const Wi="data-"+Li("framerAppearId");function $i(t){return t.props[Wi]}function ji({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function Ni(t,e,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:r,transitionEnd:a,...o}=e;const h=t.getDefaultTransition();r=r?xi(r,h):h;const l=r?.reduceMotion;i&&(r=i);const u=[],d=s&&t.animationState&&t.animationState.getState()[s];for(const e in o){const i=t.getValue(e,t.latestValues[e]??null),s=o[e];if(void 0===s||d&&ji(d,e))continue;const a={delay:n,...Mi(r||{},e)},h=i.get();if(void 0!==h&&!i.isAnimating&&!Array.isArray(s)&&s===h&&!a.velocity)continue;let p=!1;if(window.MotionHandoffAnimation){const n=$i(t);if(n){const t=window.MotionHandoffAnimation(n,e,c);null!==t&&(a.startTime=t,p=!0)}}Oi(t,e);const f=l??t.shouldReduceMotion;i.start(ki(e,i,s,f&&Ri.has(e)?{type:!1}:a,t,p));const m=i.animation;m&&u.push(m)}if(a){const e=()=>c.update(()=>{a&&Ii(t,a)});u.length?Promise.all(u).then(e):e()}return u}const Ui=new Set(["brightness","contrast","saturate","opacity"]);function Xi(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(J)||[];if(!i)return t;const s=n.replace(i,"");let r=Ui.has(e)?1:0;return i!==n&&(r*=100),e+"("+r+s+")"}const zi=/\b([a-z-]*)\(.*?\)/gu,Ki={...Tt,getAnimatableNone:t=>{const e=t.match(zi);return e?e.map(Xi).join(" "):t}},Yi={...Tt,getAnimatableNone:t=>{const e=Tt.parse(t);return Tt.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},Hi={...H,transform:Math.round},qi={borderWidth:ht,borderTopWidth:ht,borderRightWidth:ht,borderBottomWidth:ht,borderLeftWidth:ht,borderRadius:ht,borderTopLeftRadius:ht,borderTopRightRadius:ht,borderBottomRightRadius:ht,borderBottomLeftRadius:ht,width:ht,maxWidth:ht,height:ht,maxHeight:ht,top:ht,right:ht,bottom:ht,left:ht,inset:ht,insetBlock:ht,insetBlockStart:ht,insetBlockEnd:ht,insetInline:ht,insetInlineStart:ht,insetInlineEnd:ht,padding:ht,paddingTop:ht,paddingRight:ht,paddingBottom:ht,paddingLeft:ht,paddingBlock:ht,paddingBlockStart:ht,paddingBlockEnd:ht,paddingInline:ht,paddingInlineStart:ht,paddingInlineEnd:ht,margin:ht,marginTop:ht,marginRight:ht,marginBottom:ht,marginLeft:ht,marginBlock:ht,marginBlockStart:ht,marginBlockEnd:ht,marginInline:ht,marginInlineStart:ht,marginInlineEnd:ht,fontSize:ht,backgroundPositionX:ht,backgroundPositionY:ht,...{rotate:at,rotateX:at,rotateY:at,rotateZ:at,scale:G,scaleX:G,scaleY:G,scaleZ:G,skew:at,skewX:at,skewY:at,distance:ht,translateX:ht,translateY:ht,translateZ:ht,x:ht,y:ht,z:ht,perspective:ht,transformPerspective:ht,opacity:q,originX:ut,originY:ut,originZ:ht},zIndex:Hi,fillOpacity:q,strokeOpacity:q,numOctaves:Hi},Gi={...qi,color:pt,backgroundColor:pt,outlineColor:pt,fill:pt,stroke:pt,borderColor:pt,borderTopColor:pt,borderRightColor:pt,borderBottomColor:pt,borderLeftColor:pt,filter:Ki,WebkitFilter:Ki,mask:Yi,WebkitMask:Yi},Zi=t=>Gi[t],Ji=()=>({x:{min:0,max:0},y:{min:0,max:0}}),Qi=t=>e=>e.test(t),ts=[H,ht,ot,at,ct,lt,{test:t=>"auto"===t,parse:t=>t}],es=t=>ts.find(Qi(t)),ns=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),is=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ss(t,e,n=1){const[i,s]=function(t){const e=is.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}(t);if(!i)return;const r=window.getComputedStyle(e).getPropertyValue(i);if(r){const t=r.trim();return ns(t)?parseFloat(t):t}return z(s)?ss(s,e,n+1):s}const rs=t=>/^0[^.\s]+$/u.test(t);function as(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||rs(t))}const os=new Set([Ki,Yi]);function hs(t,e){let n=Zi(t);return os.has(n)||(n=Tt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const ls=new Set(["auto","none","0"]);class cs extends ai{constructor(t,e,n,i,s){super(t,e,n,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){let i=t[n];if("string"==typeof i&&(i=i.trim(),z(i))){const s=ss(i,e.current);void 0!==s&&(t[n]=s),n===t.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!Ri.has(n)||2!==t.length)return;const[i,s]=t,r=es(i),a=es(s);if(Y(i)!==Y(s)&&Qn[n])this.needsMeasurement=!0;else if(r!==a)if(Gn(r)&&Gn(a))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else Qn[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||as(t[e]))&&n.push(e);n.length&&function(t,e,n){let i,s=0;for(;s<t.length&&!i;){const e=t[s];"string"==typeof e&&!ls.has(e)&&vt(e).values.length&&(i=t[s]),s++}if(i&&n)for(const s of e)t[s]=hs(n,i)}(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Qn[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const i=e[e.length-1];void 0!==i&&t.getValue(n,i).jump(i,!1)}measureEndState(){const{element:t,name:e,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const i=t.getValue(e);i&&i.jump(this.measuredOrigin,!1);const s=n.length-1,r=n[s];n[s]=Qn[e](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==r&&void 0===this.finalKeyframe&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([e,n])=>{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const us=new Set(["opacity","clipPath","filter","transform"]),{schedule:ds,cancel:ps}=l(queueMicrotask,!1),fs=[...ts,pt,Tt];const ms=["initial","animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"];function gs(t){return null!==(e=t.animate)&&"object"==typeof e&&"function"==typeof e.start||ms.some(e=>function(t){return"string"==typeof t||Array.isArray(t)}(t[e]));var e}const ys={current:null},vs={current:!1},bs="undefined"!=typeof window;const ws=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Ts={};class xs{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:i,skipAnimations:s,blockInitialAnimation:r,visualState:a},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=ai,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,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 t=me.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,c.render(this.render,!1,!0))};const{latestValues:h,renderState:l}=a;this.latestValues=h,this.baseTarget={...h},this.initialValues=e.initial?{...h}:{},this.renderState=l,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=s,this.options=o,this.blockInitialAnimation=Boolean(r),this.isControllingVariants=gs(e),this.isVariantNode=function(t){return Boolean(gs(t)||t.variants)}(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:u,...d}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in d){const e=d[t];void 0!==h[t]&&Ke(e)&&e.set(h[t])}}mount(t){if(this.hasBeenMounted)for(const t in this.initialValues)this.values.get(t)?.jump(this.initialValues[t]),this.latestValues[t]=this.initialValues[t];this.current=t,Pi.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((t,e)=>this.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(vs.current||function(){if(vs.current=!0,bs)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>ys.current=t.matches;t.addEventListener("change",e),e()}else ys.current=!1}(),this.shouldReduceMotion=ys.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),u(this.notifyUpdate),u(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),e.accelerate&&us.has(t)&&this.current instanceof HTMLElement){const{factory:n,keyframes:i,times:s,ease:r,duration:a}=e.accelerate,o=new pi({element:this.current,name:t,keyframes:i,times:s,ease:r,duration:be(a)}),h=n(o);return void this.valueSubscriptions.set(t,()=>{h(),o.cancel()})}const n=qn.has(t);n&&this.onBindTransform&&this.onBindTransform();const i=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&c.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{i(),s&&s(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in Ts){const e=Ts[t];if(!e)continue;const{isEnabled:n,Feature:i}=e;if(!this.features[t]&&i&&n(this.props)&&(this.features[t]=new i(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<ws.length;e++){const n=ws[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const i=t["on"+n];i&&(this.propEventSubscriptions[n]=this.on(n,i))}this.prevMotionValues=function(t,e,n){for(const i in e){const s=e[i],r=n[i];if(Ke(s))t.addValue(i,s);else if(Ke(r))t.addValue(i,ve(s,{owner:t}));else if(r!==s)if(t.hasValue(i)){const e=t.getValue(i);!0===e.liveStyle?e.jump(s):e.hasAnimated||e.set(s)}else{const e=t.getStaticValue(i);t.addValue(i,ve(void 0!==e?e:s,{owner:t}))}}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}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 e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=ve(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){let n=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var i;return null!=n&&("string"==typeof n&&(ns(n)||rs(n))?n=parseFloat(n):(i=n,!fs.find(Qi(i))&&Tt.test(e)&&(n=hs(t,e))),this.setBaseTarget(t,Ke(n)?n.get():n)),Ke(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let n;if("string"==typeof e||"object"==typeof e){const i=Di(this.props,e,this.presenceContext?.custom);i&&(n=i[t])}if(e&&void 0!==n)return n;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||Ke(i)?void 0!==this.initialValues[t]&&void 0===n?void 0:this.baseTarget[t]:i}on(t,e){return this.events[t]||(this.events[t]=new de),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){ds.render(this.render)}}class Ms extends xs{constructor(){super(...arguments),this.KeyframeResolver=cs}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){const n=t.style;return n?n[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Ke(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}const As=(t,e)=>e&&"number"==typeof t?e.transform(t):t,Ss={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Es=Hn.length;function Cs(t,e,n){const{style:i,vars:s,transformOrigin:r}=t;let a=!1,o=!1;for(const t in e){const n=e[t];if(qn.has(t))a=!0;else if(U(t))s[t]=n;else{const e=As(n,qi[t]);t.startsWith("origin")?(o=!0,r[t]=e):i[t]=e}}if(e.transform||(a||n?i.transform=function(t,e,n){let i="",s=!0;for(let r=0;r<Es;r++){const a=Hn[r],o=t[a];if(void 0===o)continue;let h=!0;if("number"==typeof o)h=o===(a.startsWith("scale")?1:0);else{const t=parseFloat(o);h=a.startsWith("scale")?1===t:0===t}if(!h||n){const t=As(o,qi[a]);h||(s=!1,i+=`${Ss[a]||a}(${t}) `),n&&(e[a]=t)}}return i=i.trim(),n?i=n(e,s?"":i):s&&(i="none"),i}(e,t.transform,n):i.transform&&(i.transform="none")),o){const{originX:t="50%",originY:e="50%",originZ:n=0}=r;i.transformOrigin=`${t} ${e} ${n}`}}const Vs={offset:"stroke-dashoffset",array:"stroke-dasharray"},ks={offset:"strokeDashoffset",array:"strokeDasharray"};const Ps=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Rs(t,{attrX:e,attrY:n,attrScale:i,pathLength:s,pathSpacing:r=1,pathOffset:a=0,...o},h,l,c){if(Cs(t,o,l),h)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:u,style:d}=t;u.transform&&(d.transform=u.transform,delete u.transform),(d.transform||u.transformOrigin)&&(d.transformOrigin=u.transformOrigin??"50% 50%",delete u.transformOrigin),d.transform&&(d.transformBox=c?.transformBox??"fill-box",delete u.transformBox);for(const t of Ps)void 0!==u[t]&&(d[t]=u[t],delete u[t]);void 0!==e&&(u.x=e),void 0!==n&&(u.y=n),void 0!==i&&(u.scale=i),void 0!==s&&function(t,e,n=1,i=0,s=!0){t.pathLength=1;const r=s?Vs:ks;t[r.offset]=""+-i,t[r.array]=`${e} ${n}`}(u,s,r,a,!1)}const Fs=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 Ds(t,{style:e,vars:n},i,s){const r=t.style;let a;for(a in e)r[a]=e[a];for(a in s?.applyProjectionStyles(r,i),n)r.setProperty(a,n[a])}function _s(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Bs={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!ht.test(t))return t;t=parseFloat(t)}return`${_s(t,e.target.x)}% ${_s(t,e.target.y)}%`}},Is={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=Tt.parse(t);if(s.length>5)return i;const r=Tt.createTransformer(t),a="number"!=typeof s[0]?1:0,o=n.x.scale*e.x,h=n.y.scale*e.y;s[0+a]/=o,s[1+a]/=h;const l=At(o,h,.5);return"number"==typeof s[2+a]&&(s[2+a]/=l),"number"==typeof s[3+a]&&(s[3+a]/=l),r(s)}};const Os={borderRadius:{...Bs,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Bs,borderTopRightRadius:Bs,borderBottomLeftRadius:Bs,borderBottomRightRadius:Bs,boxShadow:Is};function Ls(t,{layout:e,layoutId:n}){return qn.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!Os[t]||"opacity"===t)}function Ws(t,e,n){const i=t.style,s=e?.style,r={};if(!i)return r;for(const e in i)(Ke(i[e])||s&&Ke(s[e])||Ls(e,t)||void 0!==n?.getValue(e)?.liveStyle)&&(r[e]=i[e]);return r}class $s extends Ms{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ji}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(qn.has(e)){const t=Zi(e);return t&&t.default||0}return e=Fs.has(e)?e:Li(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return function(t,e,n){const i=Ws(t,e,n);for(const n in t)(Ke(t[n])||Ke(e[n]))&&(i[-1!==Hn.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]);return i}(t,e,n)}build(t,e,n){Rs(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){!function(t,e,n,i){Ds(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(Fs.has(n)?n:Li(n),e.attrs[n])}(t,e,0,i)}mount(t){var e;this.isSVGTag="string"==typeof(e=t.tagName)&&"svg"===e.toLowerCase(),super.mount(t)}}function js(t,e){return function({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}(t.getBoundingClientRect(),e))}class Ns extends Ms{constructor(){super(...arguments),this.type="html",this.renderInstance=Ds}readValueFromInstance(t,e){if(qn.has(e))return this.projection?.isProjecting?zn(e):((t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Kn(n,e)})(t,e);{const i=(n=t,window.getComputedStyle(n)),s=(U(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return js(t,e)}build(t,e,n){Cs(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return Ws(t,e,n)}}class Us extends xs{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(function(t,e){return t in e}(e,t)){const n=t[e];if("string"==typeof n||"number"==typeof n)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(t,e){delete e.output[t]}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}build(t,e){Object.assign(t.output,e)}renderInstance(t,{output:e}){Object.assign(t,e)}sortInstanceNodePosition(){return 0}}function Xs(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=x(t)&&!function(t){return x(t)&&"svg"===t.tagName}(t)?new $s(e):new Ns(e);n.mount(t),Pi.set(t,n)}function zs(t){const e=new Us({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});e.mount(t),Pi.set(t,e)}function Ks(t,e,n,i){const s=[];if(function(t,e){return Ke(t)||"number"==typeof t||"string"==typeof t&&!qe(e)}(t,e))s.push(function(t,e,n){const i=Ke(t)?t:ve(t);return i.start(ki("",i,e,n)),i.animation}(t,qe(e)&&e.default||e,n&&n.default||n));else{if(null==t)return s;const r=Ge(t,e,i),a=r.length;Boolean(a);for(let t=0;t<a;t++){const i=r[t],o=i instanceof Element?Xs:zs;Pi.has(i)||o(i);const h=Pi.get(i),l={...n};"delay"in l&&"function"==typeof l.delay&&(l.delay=l.delay(t,a)),s.push(...Ni(h,{...e,transition:l},{}))}}return s}function Ys(t,e,n){const i=[],s=function(t,{defaultTransition:e={},...n}={},i,s){const r=e.duration||.3,a=new Map,o=new Map,h={},l=new Map;let c=0,u=0,d=0;for(let n=0;n<t.length;n++){const a=t[n];if("string"==typeof a){l.set(a,u);continue}if(!Array.isArray(a)){l.set(a.name,Je(u,a.at,c,l));continue}let[p,f,m={}]=a;void 0!==m.at&&(u=Je(u,m.at,c,l));let g=0;const y=(t,n,i,a=0,o=0)=>{const h=rn(t),{delay:l=0,times:c=Lt(h),type:p=e.type||"keyframes",repeat:f,repeatType:m,repeatDelay:y=0,...v}=n;let{ease:b=e.ease||"easeOut",duration:w}=n;const T="function"==typeof l?l(a,o):l,x=h.length,M=ze(p)?p:s?.[p||"keyframes"];if(x<=2&&M){let t=100;if(2===x&&hn(h)){const e=h[1]-h[0];t=Math.abs(e)}const n={...e,...v};void 0!==w&&(n.duration=be(w));const i=Ae(n,t,M);b=i.ease,w=i.duration}w??(w=r);const A=u+T;1===c.length&&0===c[0]&&(c[1]=1);const S=c.length-h.length;if(S>0&&Ot(c,S),1===h.length&&h.unshift(null),f){w=Ze(w,f);const t=[...h],e=[...c];b=Array.isArray(b)?[...b]:[b];const n=[...b];for(let i=0;i<f;i++){h.push(...t);for(let s=0;s<t.length;s++)c.push(e[s]+(i+1)),b.push(0===s?"linear":He(n,s-1))}tn(c,f)}const E=A+w;Qe(i,h,b,c,A,E),g=Math.max(T+w,g),d=Math.max(E,d)};if(Ke(p))y(f,m,sn("default",nn(p,o)));else{const t=Ge(p,f,i,h),e=t.length;for(let n=0;n<e;n++){const i=nn(t[n],o);for(const t in f)y(f[t],an(m,t),sn(t,i),n,e)}}c=u,u+=g}return o.forEach((t,i)=>{for(const s in t){const r=t[s];r.sort(en);const o=[],h=[],l=[];for(let t=0;t<r.length;t++){const{at:e,value:n,easing:i}=r[t];o.push(n),h.push(B(0,d,e)),l.push(i||"easeOut")}0!==h[0]&&(h.unshift(0),o.unshift(o[0]),l.unshift("easeInOut")),1!==h[h.length-1]&&(h.push(1),o.push(null)),a.has(i)||a.set(i,{keyframes:{},transition:{}});const c=a.get(i);c.keyframes[s]=o;const{type:u,...p}=e;c.transition[s]={...p,duration:d,ease:l,times:h,...n}}}),a}(t.map(t=>{if(Array.isArray(t)&&"function"==typeof t[0]){const e=t[0],n=ve(0);return n.on("change",e),1===t.length?[n,[0,1]]:2===t.length?[n,[0,1],t[1]]:[n,t[1],t[2]]}return t}),e,n,{spring:Xe});return s.forEach(({keyframes:t,transition:e},n)=>{i.push(...Ks(n,t,e))}),i}const Hs=function(t={}){const{scope:e,reduceMotion:n}=t;return function(t,i,s){let r,a=[];if(o=t,Array.isArray(o)&&o.some(Array.isArray)){const{onComplete:s,...o}=i||{};"function"==typeof s&&(r=s),a=Ys(t,void 0!==n?{reduceMotion:n,...o}:o,e)}else{const{onComplete:o,...h}=s||{};"function"==typeof o&&(r=o),a=Ks(t,i,void 0!==n?{reduceMotion:n,...h}:h,e)}var o;const h=new ce(a);return r&&h.finished.then(r),e&&(e.animations.push(h),h.finished.then(()=>{ue(e.animations,h)})),h}}();var qs=function(t,e,n,i){return new(n||(n=Promise))(function(s,r){function a(t){try{h(i.next(t))}catch(t){r(t)}}function o(t){try{h(i.throw(t))}catch(t){r(t)}}function h(t){var e;t.done?s(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(a,o)}h((i=i.apply(t,e||[])).next())})};class Gs{constructor(t,e={}){this.engine=null,this.syncedAnimations=[],this.destroyed=!1,this.container=t,this.options=Object.assign({scrub:0},e),this.injectStyles()}injectStyles(){if(Gs.stylesInjected)return;const t=document.createElement("style");t.id="stube-base-styles",t.innerHTML='\n .stube-layer {\n position: absolute;\n inset: 0;\n pointer-events: none;\n display: grid;\n grid-template-areas: "content";\n }\n .stube-layer > * {\n grid-area: content;\n pointer-events: auto;\n }\n /* Alignment Mappings */\n .stube-layer[data-stube-align^="top"] { align-items: start; }\n .stube-layer[data-stube-align^="center"] { align-items: center; }\n .stube-layer[data-stube-align^="bottom"] { align-items: end; }\n \n .stube-layer[data-stube-align$="left"] { justify-items: start; }\n .stube-layer[data-stube-align$="center"] { justify-items: center; }\n .stube-layer[data-stube-align$="right"] { justify-items: end; }\n ',document.head.appendChild(t),Gs.stylesInjected=!0}static initAll(){return qs(this,void 0,void 0,function*(){const t=document.querySelectorAll(".stube-container"),e=[];for(let n=0;n<t.length;n++){const i=t[n],s=new Gs(i,{scrub:.5});yield s.init(),e.push(s)}return e})}init(){return qs(this,void 0,void 0,function*(){if(this.destroyed)return;const t=this.container.querySelector(".stube-canvas");if(!t)return void console.warn("[CoreOrchestrator] No .stube-canvas found inside container.");const e=t.dataset.stubeCanvas||t.getAttribute("data-project");if(!e)return void console.warn('[CoreOrchestrator] No project URL found on .stube-canvas. Use data-stube-canvas="url"');const n=t.dataset.stubeDepthtilt||t.getAttribute("data-stube-depthtilt");null!=n&&(this.options.depthTilt=parseFloat(n)),this.engine=yield this.loadEngine(e,t),this.destroyed||(this.parseAnimatedElements(),this.setupScrollTracking(),this.engine.onFrameChange=(t,e)=>{this.syncTrackingLayers(t),this.onFrameChange&&this.onFrameChange(t,e)},this.engine.onProgressUpdate=t=>{this.syncAnimations(t)})})}loadEngine(t,e){return qs(this,void 0,void 0,function*(){let n;try{if(t.trim().startsWith("{"))n=JSON.parse(t);else{const e=yield fetch(t);if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);n=yield e.json()}}catch(t){throw console.error("[CoreOrchestrator] Failed to load configuration:",t),t}n.settings||(n.settings={baseResolution:{width:1920,height:1080},scrollMode:"vh"}),n.settings.basePath||t.trim().startsWith("{")||(n.settings.basePath=t.substring(0,t.lastIndexOf("/")));const i=new s(n,{scrub:this.options.scrub,depthTilt:this.options.depthTilt});let r=e.querySelector("canvas");return r||(r=document.createElement("canvas"),r.style.width="100%",r.style.height="100%",r.style.display="block",r.style.objectFit="cover",e.appendChild(r)),i.attachCanvas(r),i})}setupScrollTracking(){if(!this.engine)return;const t=this.container.dataset.stubeOffset;let e=["start end","end start"];try{t&&(e=JSON.parse(t))}catch(t){}this.motionScrollCancel=oe(t=>{this.engine&&this.engine.update(t)},{target:this.container,offset:e})}parseAnimatedElements(){this.container.querySelectorAll("[data-stube-animate]").forEach(t=>{try{const e=t.getAttribute("data-stube-animate");if(!e)return;const n=JSON.parse(e),i=Hs(t,n,{duration:1,ease:"linear"});i.pause(),i.time=0,this.syncedAnimations.push(i)}catch(e){console.warn("[CoreOrchestrator] Failed to parse data-stube-animate on element",t,e)}})}syncAnimations(t){for(const e of this.syncedAnimations)e.time=t}syncTrackingLayers(t){if(!this.engine)return;this.container.querySelectorAll("[data-stube-layer-tracking]").forEach(e=>qs(this,void 0,void 0,function*(){const n=e.dataset.stubeLayerTracking;if(!n)return;yield this.engine.loadTrackingData(n);const i=this.engine.getTrackedCoords(n,t);e.style.left=100*i.x+"%",e.style.top=100*i.y+"%"}))}getEngine(){return this.engine}destroy(){this.destroyed=!0,this.motionScrollCancel&&(this.motionScrollCancel(),this.motionScrollCancel=void 0);for(const t of this.syncedAnimations)t.stop();this.syncedAnimations=[],this.engine&&(this.engine.destroy(),this.engine=null),this.onFrameChange=void 0}}Gs.stylesInjected=!1;const Zs=Object.assign(s,{CoreOrchestrator:Gs});return e=e.default})());
14
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ScrollTube=e():t.ScrollTube=e()}(this,()=>(()=>{"use strict";var t={d:(e,n)=>{for(var i in n)t.o(n,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:n[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};t.d(e,{default:()=>er});class n{constructor(t,e={}){if(this.targetMouse={x:0,y:0},this.currentMouse={x:0,y:0},this.animationFrameId=0,this.depthTilt=.04,this.animate=()=>{if(this.currentMouse.x+=.1*(this.targetMouse.x-this.currentMouse.x),this.currentMouse.y+=.1*(this.targetMouse.y-this.currentMouse.y),this.gl&&this.program){this.gl.useProgram(this.program);const t=this.gl.getUniformLocation(this.program,"u_mouse");this.gl.uniform2f(t,this.currentMouse.x,this.currentMouse.y);const e=this.gl.getUniformLocation(this.program,"u_depthTilt");this.gl.uniform1f(e,this.depthTilt),this.draw()}this.animationFrameId=requestAnimationFrame(this.animate)},this.depthTilt=void 0!==e.depthTilt?e.depthTilt:4,this.gl=t.getContext("webgl",{alpha:!1,antialias:!1}),!this.gl)throw new Error("WebGL not supported");this.program=this.createProgram("\n attribute vec2 a_position;\n varying vec2 v_texCoord;\n void main() {\n gl_Position = vec4(a_position, 0.0, 1.0);\n // Convert -1 -> 1 to 0 -> 1 for UVs\n v_texCoord = a_position * 0.5 + 0.5;\n v_texCoord.y = 1.0 - v_texCoord.y;\n }\n ","\n precision mediump float;\n uniform sampler2D u_image;\n uniform sampler2D u_depthMap;\n uniform vec2 u_resolution;\n uniform vec2 u_imageResolution;\n uniform vec2 u_mouse;\n uniform float u_depthTilt;\n uniform bool u_hasDepth;\n varying vec2 v_texCoord;\n\n void main() {\n // object-fit: cover math\n vec2 ratio = vec2(\n min((u_resolution.x / u_resolution.y) / (u_imageResolution.x / u_imageResolution.y), 1.0),\n min((u_resolution.y / u_resolution.x) / (u_imageResolution.y / u_imageResolution.x), 1.0)\n );\n vec2 uv = vec2(\n v_texCoord.x * ratio.x + (1.0 - ratio.x) * 0.5,\n v_texCoord.y * ratio.y + (1.0 - ratio.y) * 0.5\n );\n\n if (u_hasDepth) {\n float depth = texture2D(u_depthMap, uv).r;\n // White is close (1), Black is far (0).\n // By making the background move and the foreground stay still (using 1.0 - depth)\n // and subtracting the parallax, the background pulls the foreground over itself,\n // expanding the edges and creating proper occlusion, instead of collapsing/tearing.\n // depthTilt is scaled by 0.01 internally (so 100 = 1.0 peak displacement)\n vec2 parallax = u_mouse * (1.0 - depth) * (u_depthTilt * 0.01);\n uv -= parallax;\n }\n \n gl_FragColor = texture2D(u_image, uv);\n }\n "),this.gl.useProgram(this.program),this.positionBuffer=this.gl.createBuffer(),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.positionBuffer),this.gl.bufferData(this.gl.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),this.gl.STATIC_DRAW),this.texture=this.gl.createTexture(),this.depthTexture=this.gl.createTexture(),window.addEventListener("mousemove",t=>{this.targetMouse.x=t.clientX/window.innerWidth*2-1,this.targetMouse.y=t.clientY/window.innerHeight*2-1}),this.animate()}setDepthTilt(t){this.depthTilt=t}createProgram(t,e){const n=this.gl.createShader(this.gl.VERTEX_SHADER);this.gl.shaderSource(n,t),this.gl.compileShader(n);const i=this.gl.createShader(this.gl.FRAGMENT_SHADER);this.gl.shaderSource(i,e),this.gl.compileShader(i);const s=this.gl.createProgram();return this.gl.attachShader(s,n),this.gl.attachShader(s,i),this.gl.linkProgram(s),s}render(t,e,n,i){this.gl.useProgram(this.program),this.gl.activeTexture(this.gl.TEXTURE0),this.gl.bindTexture(this.gl.TEXTURE_2D,this.texture),this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,this.gl.RGBA,this.gl.UNSIGNED_BYTE,t),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.LINEAR),this.gl.activeTexture(this.gl.TEXTURE1),this.gl.bindTexture(this.gl.TEXTURE_2D,this.depthTexture),e&&(this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,this.gl.RGBA,this.gl.UNSIGNED_BYTE,e),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.LINEAR)),this.gl.uniform1i(this.gl.getUniformLocation(this.program,"u_image"),0),this.gl.uniform1i(this.gl.getUniformLocation(this.program,"u_depthMap"),1),this.gl.uniform1i(this.gl.getUniformLocation(this.program,"u_hasDepth"),e?1:0),this.gl.uniform2f(this.gl.getUniformLocation(this.program,"u_resolution"),n,i),this.gl.uniform2f(this.gl.getUniformLocation(this.program,"u_imageResolution"),t.naturalWidth,t.naturalHeight);const s=this.gl.getAttribLocation(this.program,"a_position");this.gl.enableVertexAttribArray(s),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.positionBuffer),this.gl.vertexAttribPointer(s,2,this.gl.FLOAT,!1,0,0),this.gl.viewport(0,0,n,i),this.draw()}draw(){this.gl.drawArrays(this.gl.TRIANGLES,0,6)}destroy(){cancelAnimationFrame(this.animationFrameId)}}var i=function(t,e,n,i){return new(n||(n=Promise))(function(s,r){function a(t){try{l(i.next(t))}catch(t){r(t)}}function o(t){try{l(i.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?s(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(a,o)}l((i=i.apply(t,e||[])).next())})};console.log("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");class s{constructor(t,e={}){this.currentFrame=-1,this.activeVariant=null,this.canvas=null,this.ctx=null,this.renderer=null,this.basePath="",this.scrub=0,this.depthTilt=4,this.targetProgress=0,this.currentProgress=0,this.rafId=0,this.destroyed=!1,this.imageCache=new Map,this.depthCache=new Map,this.scrollTimeout=null,this.trackingDataCache=new Map,this.config=t,this.basePath=t.settings.basePath||"",this.scrub=void 0!==e.scrub?e.scrub:0,this.depthTilt=void 0!==e.depthTilt?e.depthTilt:4,this.detectBestVariant(),this.boundResize=()=>{this.detectBestVariant(),this.resizeCanvas(),this.render()},window.addEventListener("resize",this.boundResize),this.updateLoop=this.updateLoop.bind(this),this.rafId=requestAnimationFrame(this.updateLoop)}destroy(){this.destroyed=!0,this.rafId&&cancelAnimationFrame(this.rafId),window.removeEventListener("resize",this.boundResize),this.scrollTimeout&&clearTimeout(this.scrollTimeout),this.clearCache(),this.trackingDataCache.clear(),this.canvas=null,this.ctx=null,this.renderer=null,this.onFrameChange=void 0}static init(t,e){return i(this,void 0,void 0,function*(){const n=yield fetch(e);if(!n.ok)throw new Error(`Failed to load config: ${n.statusText}`);const i=yield n.json(),r=e.substring(0,e.lastIndexOf("/"));i.settings||(i.settings={baseResolution:{width:1920,height:1080},scrollMode:"vh"}),i.settings.basePath=i.settings.basePath||r;const a=new s(i,{scrub:"object"==typeof i.settings?i.settings.scrub:0});let o=t.querySelector("canvas");return o||(o=document.createElement("canvas"),o.style.width="100%",o.style.height="100%",o.style.display="block",o.style.objectFit="cover",t.appendChild(o)),a.attachCanvas(o),a})}attachCanvas(t){this.canvas=t;try{this.renderer=new n(t,{depthTilt:this.depthTilt})}catch(e){console.warn("WebGL failed, falling back to 2D",e),this.ctx=t.getContext("2d",{alpha:!1})}this.resizeCanvas(),this.render()}resizeCanvas(){if(!this.canvas)return;const t=this.canvas.getBoundingClientRect(),e=t.width,n=t.height,i=window.devicePixelRatio||1;this.canvas.width=e*i,this.canvas.height=n*i,this.ctx&&this.ctx.scale(i,i)}detectBestVariant(){var t;const e=this.config.assets[0];if(!e)return;const n=this.canvas?this.canvas.getBoundingClientRect():{width:window.innerWidth,height:window.innerHeight},i=n.height>n.width,s=n.width*(window.devicePixelRatio||1),r=e.variants.filter(t=>{const e="portrait"===t.orientation||parseInt(t.aspectRatio.split(":")[1])>parseInt(t.aspectRatio.split(":")[0]);return i===e});r.sort((t,e)=>t.frameCount-e.frameCount);const a=r.find(t=>t.width>=s)||r[r.length-1];a?(null===(t=this.activeVariant)||void 0===t?void 0:t.id)!==a.id&&(console.log(`🎯 Variant Switched: ${a.id} (${i?"Portrait":"Landscape"})`),this.activeVariant=a,this.clearCache(),this.preloadInitial()):console.warn("[CoreEngine] No suitable variant found")}clearCache(){this.imageCache.clear(),this.depthCache.clear()}preloadInitial(){for(let t=0;t<15;t++)this.getImage(t)}update(t){this.targetProgress=Math.max(0,Math.min(1,t))}setDepthTilt(t){this.depthTilt=t,this.renderer&&this.renderer.setDepthTilt(t)}updateLoop(){if(this.destroyed)return;this.rafId=requestAnimationFrame(this.updateLoop);const t=this.scrub;if(t>0){const e=Math.max(.01,1-t);this.currentProgress+=(this.targetProgress-this.currentProgress)*e}else this.currentProgress=this.targetProgress;Math.abs(this.targetProgress-this.currentProgress)<1e-4&&(this.currentProgress=this.targetProgress),this.onProgressUpdate&&this.onProgressUpdate(this.currentProgress),this.calculateFrame(this.currentProgress)}calculateFrame(t){const e=this.config.timeline.scenes[0];if(!e)return;const n=e.assetRange[1]-e.assetRange[0],i=Math.floor(e.assetRange[0]+t*n),s=Math.max(0,Math.min(i,e.assetRange[1]));s!==this.currentFrame&&(this.currentFrame=s,this.render(),this.getImage(this.currentFrame+5),this.getImage(this.currentFrame+10),this.scrollTimeout&&clearTimeout(this.scrollTimeout),this.scrollTimeout=setTimeout(()=>{this.loadDepthMap(this.currentFrame)},100),this.onFrameChange&&this.onFrameChange(this.currentFrame,t))}loadTrackingData(t){return i(this,void 0,void 0,function*(){var e;if(!this.activeVariant)return;if(!(null===(e=this.activeVariant.subjects)||void 0===e?void 0:e.includes(t)))return void console.warn(`[CoreEngine] Subject ${t} not found in active variant ${this.activeVariant.id}`);const n=`${this.activeVariant.id}_${t}`;if(!this.trackingDataCache.has(n))try{const e=`${this.basePath?`${this.basePath}/`:""}${this.activeVariant.path}/000_tracking-${t}.json`;console.log(`[CoreEngine] Fetching tracking data: ${e}`);const i=yield fetch(e);if(!i.ok)throw new Error(i.statusText);const s=yield i.json();this.trackingDataCache.set(n,s)}catch(e){console.error(`[CoreEngine] Failed to load tracking data for ${t}`,e)}})}getTrackedCoords(t,e){if(!this.activeVariant||!this.canvas)return{x:.5,y:.5};const n=`${this.activeVariant.id}_${t}`,i=this.trackingDataCache.get(n);if(!i)return{x:.5,y:.5};const s=i.find(t=>t.frame===e);if(!s)return{x:.5,y:.5};const r=this.canvas.clientWidth/this.canvas.clientHeight,a=this.activeVariant.width/this.activeVariant.height,o=Math.min(r/a,1),l=Math.min(1/r/(1/a),1);return{x:(s.x-.5)/o+.5,y:(s.y-.5)/l+.5,scale:s.scale}}render(){var t;if(!this.canvas||-1===this.currentFrame)return;const e=this.getImage(this.currentFrame);if(!e||!e.complete)return;const n=this.canvas.clientWidth,i=this.canvas.clientHeight;let s=null;if((null===(t=this.activeVariant)||void 0===t?void 0:t.hasDepthMap)&&(s=this.getDepthImage(this.currentFrame),s&&!s.complete&&(s=null)),this.renderer)this.renderer.render(e,s,n*(window.devicePixelRatio||1),i*(window.devicePixelRatio||1));else if(this.ctx){const t=e.naturalWidth/e.naturalHeight;let s,r,a,o;t>n/i?(r=i,s=i*t,a=(n-s)/2,o=0):(s=n,r=n/t,a=0,o=(i-r)/2),this.ctx.clearRect(0,0,n,i),this.ctx.drawImage(e,a,o,s,r)}}getImage(t){if(!this.activeVariant)return null;if(t<0||t>=this.activeVariant.frameCount)return null;const e=`${this.activeVariant.id}_${t}`;if(this.imageCache.has(e))return this.imageCache.get(e);const n=this.basePath?`${this.basePath}/`:"",i=new Image;return i.crossOrigin="anonymous",i.src=`${n}${this.activeVariant.path}/index_${t}.webp`,i.onload=()=>{this.currentFrame===t&&this.render()},this.imageCache.set(e,i),i}loadDepthMap(t){var e;if(!(null===(e=this.activeVariant)||void 0===e?void 0:e.hasDepthMap))return void console.log("[CoreEngine] activeVariant does not define hasDepthMap=true");console.log(`[CoreEngine] Lazy requesting depth map for frame: ${t}`);this.getDepthImage(t)}getDepthImage(t){var e;if(!(null===(e=this.activeVariant)||void 0===e?void 0:e.hasDepthMap))return null;if(t<0||t>=this.activeVariant.frameCount)return null;const n=`${this.activeVariant.id}_depth_${t}`;if(this.depthCache.has(n))return this.depthCache.get(n);const i=this.basePath?`${this.basePath}/`:"";console.log(`[CoreEngine] Downloading: ${i}${this.activeVariant.path}/index_${t}_depth.webp`);const s=new Image;return s.crossOrigin="anonymous",s.src=`${i}${this.activeVariant.path}/index_${t}_depth.webp`,s.onload=()=>{console.log(`[CoreEngine] Depth map loaded for frame: ${t}`),this.currentFrame===t&&this.render()},s.onerror=e=>{console.error(`[CoreEngine] Depth map failed to load for frame: ${t}`,e)},this.depthCache.set(n,s),s}}const r=t=>t,a={},o=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],l={value:null,addProjectionMetrics:null};function h(t,e){let n=!1,i=!0;const s={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,h=o.reduce((t,n)=>(t[n]=function(t,e){let n=new Set,i=new Set,s=!1,r=!1;const a=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1},h=0;function c(e){a.has(e)&&(u.schedule(e),t()),h++,e(o)}const u={schedule:(t,e=!1,r=!1)=>{const o=r&&s?n:i;return e&&a.add(t),o.add(t),t},cancel:t=>{i.delete(t),a.delete(t)},process:t=>{if(o=t,s)return void(r=!0);s=!0;const a=n;n=i,i=a,n.forEach(c),e&&l.value&&l.value.frameloop[e].push(h),h=0,n.clear(),s=!1,r&&(r=!1,u.process(t))}};return u}(r,e?n:void 0),t),{}),{setup:c,read:u,resolveKeyframes:d,preUpdate:p,update:f,preRender:m,render:g,postRender:y}=h,v=()=>{const r=a.useManualTiming,o=r?s.timestamp:performance.now();n=!1,r||(s.delta=i?1e3/60:Math.max(Math.min(o-s.timestamp,40),1)),s.timestamp=o,s.isProcessing=!0,c.process(s),u.process(s),d.process(s),p.process(s),f.process(s),m.process(s),g.process(s),y.process(s),s.isProcessing=!1,n&&e&&(i=!1,t(v))};return{schedule:o.reduce((e,r)=>{const a=h[r];return e[r]=(e,r=!1,o=!1)=>(n||(n=!0,i=!0,s.isProcessing||t(v)),a.schedule(e,r,o)),e},{}),cancel:t=>{for(let e=0;e<o.length;e++)h[o[e]].cancel(t)},state:s,steps:h}}const{schedule:c,cancel:u,state:d,steps:p}=h("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:r,!0);function f(t,e){let n;const i=()=>{const{currentTime:i}=e,s=(null===i?0:i.value)/100;n!==s&&t(s),n=s};return c.preUpdate(i,!0),()=>u(i)}function m(t){let e;return()=>(void 0===e&&(e=t()),e)}const g={};function y(t,e){const n=m(t);return()=>g[e]??n()}const v=y(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),b=y(()=>void 0!==window.ViewTimeline,"viewTimeline");function w(t){return"undefined"!=typeof window&&(t?b():v())}function T(t){return"object"==typeof t&&null!==t}function x(t){return T(t)&&"ownerSVGElement"in t}function M(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let i=document;e&&(i=e.current);const s=n?.[t]??i.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(t=>null!=t)}const A=new WeakMap;let S;const C=(t,e,n)=>(i,s)=>s&&s[0]?s[0][t+"Size"]:x(i)&&"getBBox"in i?i.getBBox()[e]:i[n],E=C("inline","width","offsetWidth"),k=C("block","height","offsetHeight");function V({target:t,borderBoxSize:e}){A.get(t)?.forEach(n=>{n(t,{get width(){return E(t,e)},get height(){return k(t,e)}})})}function R(t){t.forEach(V)}function P(t,e){S||"undefined"!=typeof ResizeObserver&&(S=new ResizeObserver(R));const n=M(t);return n.forEach(t=>{let n=A.get(t);n||(n=new Set,A.set(t,n)),n.add(e),S?.observe(t)}),()=>{n.forEach(t=>{const n=A.get(t);n?.delete(e),n?.size||S?.unobserve(t)})}}const F=new Set;let D;function _(t){return F.add(t),D||(D=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};F.forEach(e=>e(t))},window.addEventListener("resize",D)),()=>{F.delete(t),F.size||"function"!=typeof D||(window.removeEventListener("resize",D),D=void 0)}}const B=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i};function I(t,e){return e?t*(1e3/e):0}const O={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function L(t,e,n,i){const s=n[e],{length:r,position:a}=O[e],o=s.current,l=n.time;s.current=Math.abs(t[`scroll${a}`]),s.scrollLength=t[`scroll${r}`]-t[`client${r}`],s.offset.length=0,s.offset[0]=0,s.offset[1]=s.scrollLength,s.progress=B(0,s.scrollLength,s.current);const h=i-l;s.velocity=h>50?0:I(s.current-o,h)}const X=(t,e)=>n=>e(t(n)),W=(...t)=>t.reduce(X);const $=(t,e,n)=>n>e?e:n<t?t:n,j=t=>e=>"string"==typeof e&&e.startsWith(t),N=j("--"),U=j("var(--"),z=t=>!!U(t)&&K.test(t.split("/*")[0].trim()),K=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Y(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const H={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},q={...H,transform:t=>$(0,1,t)},G={...H,default:1},Z=t=>Math.round(1e5*t)/1e5,J=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const Q=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,tt=(t,e)=>n=>Boolean("string"==typeof n&&Q.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),et=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,r,a,o]=i.match(J);return{[t]:parseFloat(s),[e]:parseFloat(r),[n]:parseFloat(a),alpha:void 0!==o?parseFloat(o):1}},nt={...H,transform:t=>Math.round((t=>$(0,255,t))(t))},it={test:tt("rgb","red"),parse:et("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+nt.transform(t)+", "+nt.transform(e)+", "+nt.transform(n)+", "+Z(q.transform(i))+")"};const st={test:tt("#"),parse:function(t){let e="",n="",i="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}},transform:it.transform},rt=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),at=rt("deg"),ot=rt("%"),lt=rt("px"),ht=rt("vh"),ct=rt("vw"),ut=(()=>({...ot,parse:t=>ot.parse(t)/100,transform:t=>ot.transform(100*t)}))(),dt={test:tt("hsl","hue"),parse:et("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+ot.transform(Z(e))+", "+ot.transform(Z(n))+", "+Z(q.transform(i))+")"},pt={test:t=>it.test(t)||st.test(t)||dt.test(t),parse:t=>it.test(t)?it.parse(t):dt.test(t)?dt.parse(t):st.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?it.transform(t):dt.transform(t),getAnimatableNone:t=>{const e=pt.parse(t);return e.alpha=0,pt.transform(e)}},ft=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const mt="number",gt="color",yt=/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 vt(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let r=0;const a=e.replace(yt,t=>(pt.test(t)?(i.color.push(r),s.push(gt),n.push(pt.parse(t))):t.startsWith("var(")?(i.var.push(r),s.push("var"),n.push(t)):(i.number.push(r),s.push(mt),n.push(parseFloat(t))),++r,"${}")).split("${}");return{values:n,split:a,indexes:i,types:s}}function bt({split:t,types:e}){const n=t.length;return i=>{let s="";for(let r=0;r<n;r++)if(s+=t[r],void 0!==i[r]){const t=e[r];s+=t===mt?Z(i[r]):t===gt?pt.transform(i[r]):i[r]}return s}}const wt=(t,e)=>{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(n=t)?0:pt.test(n)?pt.getAnimatableNone(n):n;var n};const Tt={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(J)?.length||0)+(t.match(ft)?.length||0)>0},parse:function(t){return vt(t).values},createTransformer:function(t){return bt(vt(t))},getAnimatableNone:function(t){const e=vt(t);return bt(e)(e.values.map((t,n)=>wt(t,e.split[n])))}};function xt(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Mt(t,e){return n=>n>0?e:t}const At=(t,e,n)=>t+(e-t)*n,St=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},Ct=[st,it,dt];function Et(t){const e=(n=t,Ct.find(t=>t.test(n)));var n;if(Boolean(e),!Boolean(e))return!1;let i=e.parse(t);return e===dt&&(i=function({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let s=0,r=0,a=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,o=2*n-i;s=xt(o,i,t+1/3),r=xt(o,i,t),a=xt(o,i,t-1/3)}else s=r=a=n;return{red:Math.round(255*s),green:Math.round(255*r),blue:Math.round(255*a),alpha:i}}(i)),i}const kt=(t,e)=>{const n=Et(t),i=Et(e);if(!n||!i)return Mt(t,e);const s={...n};return t=>(s.red=St(n.red,i.red,t),s.green=St(n.green,i.green,t),s.blue=St(n.blue,i.blue,t),s.alpha=At(n.alpha,i.alpha,t),it.transform(s))},Vt=new Set(["none","hidden"]);function Rt(t,e){return n=>At(t,e,n)}function Pt(t){return"number"==typeof t?Rt:"string"==typeof t?z(t)?Mt:pt.test(t)?kt:_t:Array.isArray(t)?Ft:"object"==typeof t?pt.test(t)?kt:Dt:Mt}function Ft(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>Pt(t)(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=s[e](t);return n}}function Dt(t,e){const n={...t,...e},i={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(i[s]=Pt(t[s])(t[s],e[s]));return t=>{for(const e in i)n[e]=i[e](t);return n}}const _t=(t,e)=>{const n=Tt.createTransformer(e),i=vt(t),s=vt(e);return i.indexes.var.length===s.indexes.var.length&&i.indexes.color.length===s.indexes.color.length&&i.indexes.number.length>=s.indexes.number.length?Vt.has(t)&&!s.values.length||Vt.has(e)&&!i.values.length?function(t,e){return Vt.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):W(Ft(function(t,e){const n=[],i={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const r=e.types[s],a=t.indexes[r][i[r]],o=t.values[a]??0;n[s]=o,i[r]++}return n}(i,s),s.values),n):Mt(t,e)};function Bt(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return At(t,e,n);return Pt(t)(t,e)}function It(t,e,{clamp:n=!0,ease:i,mixer:s}={}){const o=t.length;if(e.length,1===o)return()=>e[0];if(2===o&&e[0]===e[1])return()=>e[1];const l=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const h=function(t,e,n){const i=[],s=n||a.mix||Bt,o=t.length-1;for(let n=0;n<o;n++){let a=s(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]||r:e;a=W(t,a)}i.push(a)}return i}(e,i,s),c=h.length,u=n=>{if(l&&n<t[0])return e[0];let i=0;if(c>1)for(;i<t.length-2&&!(n<t[i+1]);i++);const s=B(t[i],t[i+1],n);return h[i](s)};return n?e=>u($(t[0],t[o-1],e)):u}function Ot(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=B(0,e,i);t.push(At(n,1,s))}}function Lt(t){const e=[0];return Ot(e,t.length-1),e}function Xt(t){return T(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const Wt={start:0,center:.5,end:1};function $t(t,e,n=0){let i=0;if(t in Wt&&(t=Wt[t]),"string"==typeof t){const e=parseFloat(t);t.endsWith("px")?i=e:t.endsWith("%")?t=e/100:t.endsWith("vw")?i=e/100*document.documentElement.clientWidth:t.endsWith("vh")?i=e/100*document.documentElement.clientHeight:t=e}return"number"==typeof t&&(i=e*t),n+i}const jt=[0,0];function Nt(t,e,n,i){let s=Array.isArray(t)?t:jt,r=0,a=0;return"number"==typeof t?s=[t,t]:"string"==typeof t&&(s=(t=t.trim()).includes(" ")?t.split(" "):[t,Wt[t]?t:"0"]),r=$t(s[0],n,i),a=$t(s[1],e),r-a}const Ut={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},zt={x:0,y:0};function Kt(t,e,n){const{offset:i=Ut.All}=n,{target:s=t,axis:r="y"}=n,a="y"===r?"height":"width",o=s!==t?function(t,e){const n={x:0,y:0};let i=t;for(;i&&i!==e;)if(Xt(i))n.x+=i.offsetLeft,n.y+=i.offsetTop,i=i.offsetParent;else if("svg"===i.tagName){const t=i.getBoundingClientRect();i=i.parentElement;const e=i.getBoundingClientRect();n.x+=t.left-e.left,n.y+=t.top-e.top}else{if(!(i instanceof SVGGraphicsElement))break;{const{x:t,y:e}=i.getBBox();n.x+=t,n.y+=e;let s=null,r=i.parentNode;for(;!s;)"svg"===r.tagName&&(s=r),r=i.parentNode;i=s}}return n}(s,t):zt,l=s===t?{width:t.scrollWidth,height:t.scrollHeight}:function(t){return"getBBox"in t&&"svg"!==t.tagName?t.getBBox():{width:t.clientWidth,height:t.clientHeight}}(s),h={width:t.clientWidth,height:t.clientHeight};e[r].offset.length=0;let c=!e[r].interpolate;const u=i.length;for(let t=0;t<u;t++){const n=Nt(i[t],h[a],l[a],o[r]);c||n===e[r].interpolatorOffsets[t]||(c=!0),e[r].offset[t]=n}c&&(e[r].interpolate=It(e[r].offset,Lt(i),{clamp:!1}),e[r].interpolatorOffsets=[...e[r].offset]),e[r].progress=$(0,1,e[r].interpolate(e[r].current))}function Yt(t,e,n,i={}){return{measure:e=>{!function(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let i=e;for(;i&&i!==t;)n.x.targetOffset+=i.offsetLeft,n.y.targetOffset+=i.offsetTop,i=i.offsetParent}n.x.targetLength=e===t?e.scrollWidth:e.clientWidth,n.y.targetLength=e===t?e.scrollHeight:e.clientHeight,n.x.containerLength=t.clientWidth,n.y.containerLength=t.clientHeight}(t,i.target,n),function(t,e,n){L(t,"x",e,n),L(t,"y",e,n),e.time=n}(t,n,e),(i.offset||i.target)&&Kt(t,n,i)},notify:()=>e(n)}}const Ht=new WeakMap,qt=new WeakMap,Gt=new WeakMap,Zt=new WeakMap,Jt=new WeakMap,Qt=t=>t===document.scrollingElement?window:t;function te(t,{container:e=document.scrollingElement,trackContentSize:n=!1,...i}={}){if(!e)return r;let s=Gt.get(e);s||(s=new Set,Gt.set(e,s));const a=Yt(e,t,{time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},i);if(s.add(a),!Ht.has(e)){const t=()=>{for(const t of s)t.measure(d.timestamp);c.preUpdate(n)},n=()=>{for(const t of s)t.notify()},i=()=>c.read(t);Ht.set(e,i);const r=Qt(e);window.addEventListener("resize",i),e!==document.documentElement&&qt.set(e,(l=i,"function"==typeof(o=e)?_(o):P(o,l))),r.addEventListener("scroll",i),i()}var o,l;if(n&&!Jt.has(e)){const t=Ht.get(e),n={width:e.scrollWidth,height:e.scrollHeight};Zt.set(e,n);const i=()=>{const i=e.scrollWidth,s=e.scrollHeight;n.width===i&&n.height===s||(t(),n.width=i,n.height=s)},s=c.read(i,!0);Jt.set(e,s)}const h=Ht.get(e);return c.read(h,!1,!0),()=>{u(h);const t=Gt.get(e);if(!t)return;if(t.delete(a),t.size)return;const n=Ht.get(e);Ht.delete(e),n&&(Qt(e).removeEventListener("scroll",n),qt.get(e)?.(),window.removeEventListener("resize",n));const i=Jt.get(e);i&&(u(i),Jt.delete(e)),Zt.delete(e)}}const ee=[[Ut.Enter,"entry"],[Ut.Exit,"exit"],[Ut.Any,"cover"],[Ut.All,"contain"]],ne={start:0,end:1};function ie(t){const e=t.trim().split(/\s+/);if(2!==e.length)return;const n=ne[e[0]],i=ne[e[1]];return void 0!==n&&void 0!==i?[n,i]:void 0}function se(t,e){const n=function(t){if(2!==t.length)return;const e=[];for(const n of t)if(Array.isArray(n))e.push(n);else{if("string"!=typeof n)return;{const t=ie(n);if(!t)return;e.push(t)}}return e}(t);if(!n)return!1;for(let t=0;t<2;t++){const i=n[t],s=e[t];if(i[0]!==s[0]||i[1]!==s[1])return!1}return!0}function re(t){if(!t)return{rangeStart:"contain 0%",rangeEnd:"contain 100%"};for(const[e,n]of ee)if(se(t,e))return{rangeStart:`${n} 0%`,rangeEnd:`${n} 100%`}}const ae=new Map;function oe(t){const e={value:0},n=te(n=>{e.value=100*n[t.axis].progress},t);return{currentTime:e,cancel:n}}function le({source:t,container:e,...n}){const{axis:i}=n;t&&(e=t);let s=ae.get(e);s||(s=new Map,ae.set(e,s));const r=n.target??"self";let a=s.get(r);a||(a={},s.set(r,a));const o=i+(n.offset??[]).join(",");if(!a[o])if(n.target&&w(n.target)){const t=re(n.offset);a[o]=t?new ViewTimeline({subject:n.target,axis:i}):oe({container:e,...n})}else w()?a[o]=new ScrollTimeline({source:e,axis:i}):a[o]=oe({container:e,...n});return a[o]}function he(t,{axis:e="y",container:n=document.scrollingElement,...i}={}){if(!n)return r;const s={axis:e,container:n,...i};return"function"==typeof t?function(t,e){return function(t){return 2===t.length}(t)?te(n=>{t(n[e.axis].progress,n)},e):f(t,le(e))}(t,s):function(t,e){const n=le(e),i=e.target?re(e.offset):void 0,s=e.target?w(e.target)&&!!i:w();return t.attachTimeline({timeline:s?n:void 0,...i&&s&&{rangeStart:i.rangeStart,rangeEnd:i.rangeEnd},observe:t=>(t.pause(),f(e=>{t.time=t.iterationDuration*e},n))})}(t,s)}class ce{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;n<this.animations.length;n++)this.animations[n][t]=e}attachTimeline(t){const e=this.animations.map(e=>e.attachTimeline(t));return()=>{e.forEach((t,e)=>{t&&t(),this.animations[e].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 state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return ue(this.animations,"duration")}get iterationDuration(){return ue(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(e=>e[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function ue(t,e){let n=0;for(let i=0;i<t.length;i++){const s=t[i][e];null!==s&&s>n&&(n=s)}return n}class de extends ce{then(t,e){return this.finished.finally(t).then(()=>{})}}function pe(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class fe{constructor(){this.subscriptions=[]}add(t){var e,n;return e=this.subscriptions,n=t,-1===e.indexOf(n)&&e.push(n),()=>pe(this.subscriptions,t)}notify(t,e,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,n);else for(let s=0;s<i;s++){const i=this.subscriptions[s];i&&i(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}let me;function ge(){me=void 0}const ye={now:()=>(void 0===me&&ye.set(d.isProcessing||a.useManualTiming?d.timestamp:performance.now()),me),set:t=>{me=t,queueMicrotask(ge)}},ve={current:void 0};class be{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=ye.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=ye.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new fe);const n=this.events[t].add(e);return"change"===t?()=>{n(),c.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return ve.current&&ve.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=ye.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return I(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),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.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function we(t,e){return new be(t,e)}const Te=t=>1e3*t,xe=t=>t/1e3,Me=(t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let e=0;e<s;e++)i+=Math.round(1e4*t(e/(s-1)))/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},Ae=2e4;function Se(t){let e=0;let n=t.next(e);for(;!n.done&&e<Ae;)e+=50,n=t.next(e);return e>=Ae?1/0:e}function Ce(t,e=100,n){const i=n({...t,keyframes:[0,e]}),s=Math.min(Se(i),Ae);return{type:"keyframes",ease:t=>i.next(s*t).value/e,duration:xe(s)}}const Ee=100,ke=10,Ve=1,Re=0,Pe=800,Fe=.3,De=.3,_e={granular:.01,default:2},Be={granular:.005,default:.5},Ie=.01,Oe=10,Le=.05,Xe=1;function We(t,e){return t*Math.sqrt(1-e*e)}const $e=.001;const je=["duration","bounce"],Ne=["stiffness","damping","mass"];function Ue(t,e){return e.some(e=>void 0!==t[e])}function ze(t){let e={velocity:Re,stiffness:Ee,damping:ke,mass:Ve,isResolvedFromDuration:!1,...t};if(!Ue(t,Ne)&&Ue(t,je))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(1.2*n),s=i*i,r=2*$(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:Ve,stiffness:s,damping:r}}else{const n=function({duration:t=Pe,bounce:e=Fe,velocity:n=Re,mass:i=Ve}){let s,r;Te(Oe);let a=1-e;a=$(Le,Xe,a),t=$(Ie,Oe,xe(t)),a<1?(s=e=>{const i=e*a,s=i*t,r=i-n,o=We(e,a),l=Math.exp(-s);return $e-r/o*l},r=e=>{const i=e*a*t,r=i*n+n,o=Math.pow(a,2)*Math.pow(e,2)*t,l=Math.exp(-i),h=We(Math.pow(e,2),a);return(-s(e)+$e>0?-1:1)*((r-o)*l)/h}):(s=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,r=e=>Math.exp(-e*t)*(t*t*(n-e)));const o=function(t,e,n){let i=n;for(let n=1;n<12;n++)i-=t(i)/e(i);return i}(s,r,5/t);if(t=Te(t),isNaN(o))return{stiffness:Ee,damping:ke,duration:t};{const e=Math.pow(o,2)*i;return{stiffness:e,damping:2*a*Math.sqrt(i*e),duration:t}}}({...t,velocity:0});e={...e,...n,mass:Ve},e.isResolvedFromDuration=!0}return e}function Ke(t=De,e=Fe){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:s}=n;const r=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],o={done:!1,value:r},{stiffness:l,damping:h,mass:c,duration:u,velocity:d,isResolvedFromDuration:p}=ze({...n,velocity:-xe(n.velocity||0)}),f=d||0,m=h/(2*Math.sqrt(l*c)),g=a-r,y=xe(Math.sqrt(l/c)),v=Math.abs(g)<5;let b,w,T,x,M,A;if(i||(i=v?_e.granular:_e.default),s||(s=v?Be.granular:Be.default),m<1)T=We(y,m),x=(f+m*y*g)/T,b=t=>{const e=Math.exp(-m*y*t);return a-e*(x*Math.sin(T*t)+g*Math.cos(T*t))},M=m*y*x+g*T,A=m*y*g-x*T,w=t=>Math.exp(-m*y*t)*(M*Math.sin(T*t)+A*Math.cos(T*t));else if(1===m){b=t=>a-Math.exp(-y*t)*(g+(f+y*g)*t);const t=f+y*g;w=e=>Math.exp(-y*e)*(y*t*e-f)}else{const t=y*Math.sqrt(m*m-1);b=e=>{const n=Math.exp(-m*y*e),i=Math.min(t*e,300);return a-n*((f+m*y*g)*Math.sinh(i)+t*g*Math.cosh(i))/t};const e=(f+m*y*g)/t,n=m*y*e-g*t,i=m*y*g-e*t;w=e=>{const s=Math.exp(-m*y*e),r=Math.min(t*e,300);return s*(n*Math.sinh(r)+i*Math.cosh(r))}}const S={calculatedDuration:p&&u||null,velocity:t=>Te(w(t)),next:t=>{if(!p&&m<1){const e=Math.exp(-m*y*t),n=Math.sin(T*t),r=Math.cos(T*t),l=a-e*(x*n+g*r),h=Te(e*(M*n+A*r));return o.done=Math.abs(h)<=i&&Math.abs(a-l)<=s,o.value=o.done?a:l,o}const e=b(t);if(p)o.done=t>=u;else{const n=Te(w(t));o.done=Math.abs(n)<=i&&Math.abs(a-e)<=s}return o.value=o.done?a:e,o},toString:()=>{const t=Math.min(Se(S),Ae),e=Me(e=>S.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return S}function Ye(t){return"function"==typeof t&&"applyToOptions"in t}Ke.applyToOptions=t=>{const e=Ce(t,100,Ke);return t.ease=e.ease,t.duration=Te(e.duration),t.type="keyframes",t};const He=t=>Boolean(t&&t.getVelocity),qe=t=>Array.isArray(t)&&"number"!=typeof t[0];function Ge(t,e){return qe(t)?t[((t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t})(0,t.length,e)]:t}function Ze(t){return"object"==typeof t&&!Array.isArray(t)}function Je(t,e,n,i){return null==t?[]:"string"==typeof t&&Ze(e)?M(t,n,i):t instanceof NodeList?Array.from(t):Array.isArray(t)?t.filter(t=>null!=t):[t]}function Qe(t,e,n){return t*(e+1)}function tn(t,e,n,i){return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:e.startsWith("<")?Math.max(0,n+parseFloat(e.slice(1))):i.get(e)??t}function en(t,e,n,i,s,r){!function(t,e,n){for(let i=0;i<t.length;i++){const s=t[i];s.at>e&&s.at<n&&(pe(t,s),i--)}}(t,s,r);for(let a=0;a<e.length;a++)t.push({value:e[a],at:At(s,r,i[a]),easing:Ge(n,a)})}function nn(t,e){for(let n=0;n<t.length;n++)t[n]=t[n]/(e+1)}function sn(t,e){return t.at===e.at?null===t.value?1:null===e.value?-1:0:t.at-e.at}function rn(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function an(t,e){return e[t]||(e[t]=[]),e[t]}function on(t){return Array.isArray(t)?t:[t]}function ln(t,e){return t&&t[e]?{...t,...t[e]}:{...t}}const hn=t=>"number"==typeof t,cn=t=>t.every(hn),un={layout:0,mainThread:0,waapi:0},dn=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>c.update(e,t),stop:()=>u(e),now:()=>d.isProcessing?d.timestamp:ye.now()}};function pn(t,e,n){const i=Math.max(e-5,0);return I(n-t(i),e-i)}function fn({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:r=500,modifyTarget:a,min:o,max:l,restDelta:h=.5,restSpeed:c}){const u=t[0],d={done:!1,value:u},p=t=>void 0===o?l:void 0===l||Math.abs(o-t)<Math.abs(l-t)?o:l;let f=n*e;const m=u+f,g=void 0===a?m:a(m);g!==m&&(f=g-u);const y=t=>-f*Math.exp(-t/i),v=t=>g+y(t),b=t=>{const e=y(t),n=v(t);d.done=Math.abs(e)<=h,d.value=d.done?g:n};let w,T;const x=t=>{var e;(e=d.value,void 0!==o&&e<o||void 0!==l&&e>l)&&(w=t,T=Ke({keyframes:[d.value,p(d.value)],velocity:pn(v,t,d.value),damping:s,stiffness:r,restDelta:h,restSpeed:c}))};return x(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==w||(e=!0,b(t),x(t)),void 0!==w&&t>=w?T.next(t-w):(!e&&b(t),d)}}}const mn=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function gn(t,e,n,i){if(t===e&&n===i)return r;const s=e=>function(t,e,n,i,s){let r,a,o=0;do{a=e+(n-e)/2,r=mn(a,i,s)-t,r>0?n=a:e=a}while(Math.abs(r)>1e-7&&++o<12);return a}(e,0,1,t,n);return t=>0===t||1===t?t:mn(s(t),e,i)}const yn=gn(.42,0,1,1),vn=gn(0,0,.58,1),bn=gn(.42,0,.58,1),wn=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Tn=t=>e=>1-t(1-e),xn=gn(.33,1.53,.69,.99),Mn=Tn(xn),An=wn(Mn),Sn=t=>t>=1?1:(t*=2)<1?.5*Mn(t):.5*(2-Math.pow(2,-10*(t-1))),Cn=t=>1-Math.sin(Math.acos(t)),En=Tn(Cn),kn=wn(Cn),Vn=t=>Array.isArray(t)&&"number"==typeof t[0],Rn={linear:r,easeIn:yn,easeInOut:bn,easeOut:vn,circIn:Cn,circInOut:kn,circOut:En,backIn:Mn,backInOut:An,backOut:xn,anticipate:Sn},Pn=t=>{if(Vn(t)){t.length;const[e,n,i,s]=t;return gn(e,n,i,s)}return"string"==typeof t?Rn[t]:t};function Fn({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const s=qe(i)?i.map(Pn):Pn(i),r={done:!1,value:e[0]},a=function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:Lt(e),t),o=It(a,e,{ease:Array.isArray(s)?s:(l=e,h=s,l.map(()=>h||bn).splice(0,l.length-1))});var l,h;return{calculatedDuration:t,next:e=>(r.value=o(e),r.done=e>=t,r)}}const Dn=t=>null!==t;function _n(t,{repeat:e,repeatType:n="loop"},i,s=1){const r=t.filter(Dn),a=s<0||e&&"loop"!==n&&e%2==1?0:r.length-1;return a&&void 0!==i?i:r[a]}const Bn={decay:fn,inertia:fn,tween:Fn,keyframes:Fn,spring:Ke};function In(t){"string"==typeof t.type&&(t.type=Bn[t.type])}class On{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const Ln=t=>t/100;class Xn extends On{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==ye.now()&&this.tick(ye.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},un.mainThread++,this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;In(t);const{type:e=Fn,repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:r=0}=t;let{keyframes:a}=t;const o=e||Fn;o!==Fn&&"number"!=typeof a[0]&&(this.mixKeyframes=W(Ln,Bt(a[0],a[1])),a=[0,100]);const l=o({...t,keyframes:a});"mirror"===s&&(this.mirroredGenerator=o({...t,keyframes:[...a].reverse(),velocity:-r})),null===l.calculatedDuration&&(l.calculatedDuration=Se(l));const{calculatedDuration:h}=l;this.calculatedDuration=h,this.resolvedDuration=h+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=l}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:i,mixKeyframes:s,mirroredGenerator:r,resolvedDuration:a,calculatedDuration:o}=this;if(null===this.startTime)return n.next(0);const{delay:l=0,keyframes:h,repeat:c,repeatType:u,repeatDelay:d,type:p,onUpdate:f,finalKeyframe:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const g=this.currentTime-l*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?g<0:g>i;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);let v,b=this.currentTime,w=n;if(c){const t=Math.min(this.currentTime,i)/a;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,c+1);Boolean(e%2)&&("reverse"===u?(n=1-n,d&&(n-=d/a)):"mirror"===u&&(w=r)),b=$(0,1,n)*a}y?(this.delayState.value=h[0],v=this.delayState):v=w.next(b),s&&!y&&(v.value=s(v.value));let{done:T}=v;y||null===o||(T=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const x=null===this.holdTime&&("finished"===this.state||"running"===this.state&&T);return x&&p!==fn&&(v.value=_n(h,this.options,m,this.speed)),f&&f(v.value),x&&this.finish(),v}then(t,e){return this.finished.then(t,e)}get duration(){return xe(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+xe(t)}get time(){return xe(this.currentTime)}set time(t){t=Te(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);return pn(t=>this.generator.next(t).value,t,this.generator.next(t).value)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;e&&this.driver&&this.updateTime(ye.now()),this.playbackSpeed=t,e&&this.driver&&(this.time=xe(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=dn,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=e??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(ye.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null,un.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}const Wn=t=>180*t/Math.PI,$n=t=>{const e=Wn(Math.atan2(t[1],t[0]));return Nn(e)},jn={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:$n,rotateZ:$n,skewX:t=>Wn(Math.atan(t[1])),skewY:t=>Wn(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Nn=t=>((t%=360)<0&&(t+=360),t),Un=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),zn=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Kn={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Un,scaleY:zn,scale:t=>(Un(t)+zn(t))/2,rotateX:t=>Nn(Wn(Math.atan2(t[6],t[5]))),rotateY:t=>Nn(Wn(Math.atan2(-t[2],t[0]))),rotateZ:$n,rotate:$n,skewX:t=>Wn(Math.atan(t[4])),skewY:t=>Wn(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Yn(t){return t.includes("scale")?1:0}function Hn(t,e){if(!t||"none"===t)return Yn(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=Kn,s=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=jn,s=e}if(!s)return Yn(e);const r=i[e],a=s[1].split(",").map(qn);return"function"==typeof r?r(a):a[r]}function qn(t){return parseFloat(t.trim())}const Gn=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Zn=(()=>new Set(Gn))(),Jn=t=>t===H||t===lt,Qn=new Set(["x","y","z"]),ti=Gn.filter(t=>!Qn.has(t));const ei={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:i})=>{const s=t.max-t.min;return"border-box"===i?s:s-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:i})=>{const s=t.max-t.min;return"border-box"===i?s:s-parseFloat(e)-parseFloat(n)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Hn(e,"x"),y:(t,{transform:e})=>Hn(e,"y")};ei.translateX=ei.x,ei.translateY=ei.y;const ni=new Set;let ii=!1,si=!1,ri=!1;function ai(){if(si){const t=Array.from(ni).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),n=new Map;e.forEach(t=>{const e=function(t){const e=[];return ti.forEach(n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}(t);e.length&&(n.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=n.get(t);e&&e.forEach(([e,n])=>{t.getValue(e)?.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}si=!1,ii=!1,ni.forEach(t=>t.complete(ri)),ni.clear()}function oi(){ni.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(si=!0)})}class li{constructor(t,e,n,i,s,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=i,this.element=s,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?(ni.add(this),ii||(ii=!0,c.read(oi),c.resolveKeyframes(ai))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;if(null===t[0]){const s=i?.get(),r=t[t.length-1];if(void 0!==s)t[0]=s;else if(n&&e){const i=n.readValue(e,r);null!=i&&(t[0]=i)}void 0===t[0]&&(t[0]=r),i&&void 0===s&&i.set(t[0])}!function(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),ni.delete(this)}cancel(){"scheduled"===this.state&&(ni.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}function hi(t,e,n){(t=>t.startsWith("--"))(e)?t.style.setProperty(e,n):t.style[e]=n}const ci=y(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),ui=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,di={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ui([0,.65,.55,1]),circOut:ui([.55,0,1,.45]),backIn:ui([.31,.01,.66,-.59]),backOut:ui([.33,1.53,.69,.99])};function pi(t,e){return t?"function"==typeof t?ci()?Me(t,e):"ease-out":Vn(t)?ui(t):Array.isArray(t)?t.map(t=>pi(t,e)||di.easeOut):di[t]:void 0}function fi(t,e,n,{delay:i=0,duration:s=300,repeat:r=0,repeatType:a="loop",ease:o="easeOut",times:h}={},c=void 0){const u={[e]:n};h&&(u.offset=h);const d=pi(o,s);Array.isArray(d)&&(u.easing=d),l.value&&un.waapi++;const p={delay:i,duration:s,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:r+1,direction:"reverse"===a?"alternate":"normal"};c&&(p.pseudoElement=c);const f=t.animate(u,p);return l.value&&f.finished.finally(()=>{un.waapi--}),f}class mi extends On{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:n,keyframes:i,pseudoElement:s,allowFlatten:r=!1,finalKeyframe:a,onComplete:o}=t;this.isPseudoElement=Boolean(s),this.allowFlatten=r,this.options=t,t.type;const l=function({type:t,...e}){return Ye(t)&&ci()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=fi(e,n,i,l,s),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const t=_n(i,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(t),hi(e,n,t),this.animation.cancel()}o?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return xe(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+xe(t)}get time(){return xe(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Te(t),e&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:e,rangeEnd:n,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&v()?(this.animation.timeline=t,e&&(this.animation.rangeStart=e),n&&(this.animation.rangeEnd=n),r):i(this)}}const gi={anticipate:Sn,backInOut:An,circInOut:kn};function yi(t){"string"==typeof t.ease&&t.ease in gi&&(t.ease=gi[t.ease])}class vi extends mi{constructor(t){yi(t),In(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:i,element:s,...r}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const a=new Xn({...r,autoplay:!1}),o=Math.max(10,ye.now()-this.startTime),l=$(0,10,o-10),h=a.sample(o).value,{name:c}=this.options;s&&c&&hi(s,c,h),e.setWithVelocity(a.sample(Math.max(0,o-l)).value,h,l),a.stop()}}const bi=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Tt.test(t)&&"0"!==t||t.startsWith("url(")));function wi(t){t.duration=0,t.type="keyframes"}const Ti=new Set(["opacity","clipPath","filter","transform"]),xi=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;const Mi=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Ai=m(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Si(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:r,type:a,keyframes:o}=t,l=e?.owner?.current;if(!(l instanceof HTMLElement))return!1;const{onUpdate:h,transformTemplate:c}=e.owner.getProps();return Ai()&&n&&(Ti.has(n)||Mi.has(n)&&function(t){for(let e=0;e<t.length;e++)if("string"==typeof t[e]&&xi.test(t[e]))return!0;return!1}(o))&&("transform"!==n||!c)&&!h&&!i&&"mirror"!==s&&0!==r&&"inertia"!==a}class Ci extends On{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:r="loop",keyframes:a,name:o,motionValue:l,element:h,...c}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=ye.now();const u={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:s,repeatType:r,name:o,motionValue:l,element:h,...c},d=h?.KeyframeResolver||li;this.keyframeResolver=new d(a,(t,e,n)=>this.onKeyframesResolved(t,e,u,!n),o,l,h),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,e,n,i){this.keyframeResolver=void 0;const{name:s,type:o,velocity:l,delay:h,isHandoff:c,onUpdate:u}=n;this.resolvedAt=ye.now();let d=!0;(function(t,e,n,i){const s=t[0];if(null===s)return!1;if("display"===e||"visibility"===e)return!0;const r=t[t.length-1],a=bi(s,e),o=bi(r,e);return!(!a||!o)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}(t)||("spring"===n||Ye(n))&&i)})(t,s,o,l)||(d=!1,!a.instantAnimations&&h||u?.(_n(t,n,e)),t[0]=t[t.length-1],wi(n),n.repeat=0);const p={startTime:i?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:e,...n,keyframes:t},f=d&&!c&&Si(p),m=p.motionValue?.owner?.current;let g;if(f)try{g=new vi({...p,element:m})}catch{g=new Xn(p)}else g=new Xn(p);g.finished.then(()=>{this.notifyFinished()}).catch(r),this.pendingTimeline&&(this.stopTimeline=g.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=g}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),ri=!0,oi(),ai(),ri=!1),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function Ei(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function ki(t,e){const n=t?.[e]??t?.default??t;return n!==t?Ei(n,t):n}const Vi={type:"spring",stiffness:500,damping:25,restSpeed:10},Ri={type:"keyframes",duration:.8},Pi={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Fi=(t,{keyframes:e})=>e.length>2?Ri:Zn.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Vi:Pi,Di=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);const _i=(t,e,n,i={},s,r)=>o=>{const l=ki(i,t)||{},h=l.delay||i.delay||0;let{elapsed:u=0}=i;u-=Te(h);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-u,onUpdate:t=>{e.set(t),l.onUpdate&&l.onUpdate(t)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:t,motionValue:e,element:r?void 0:s};(function(t){for(const e in t)if(!Di.has(e))return!0;return!1})(l)||Object.assign(d,Fi(t,d)),d.duration&&(d.duration=Te(d.duration)),d.repeatDelay&&(d.repeatDelay=Te(d.repeatDelay)),void 0!==d.from&&(d.keyframes[0]=d.from);let p=!1;if((!1===d.type||0===d.duration&&!d.repeatDelay)&&(wi(d),0===d.delay&&(p=!0)),(a.instantAnimations||a.skipAnimations||s?.shouldSkipAnimations)&&(p=!0,wi(d),d.delay=0),d.allowFlatten=!l.type&&!l.ease,p&&!r&&void 0!==e.get()){const t=_n(d.keyframes,l);if(void 0!==t)return void c.update(()=>{d.onUpdate(t),d.onComplete()})}return l.isSync?new Xn(d):new Ci(d)};const Bi=new WeakMap,Ii=new Set(["width","height","top","left","right","bottom",...Gn]);function Oi(t){const e=[{},{}];return t?.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function Li(t,e,n,i){if("function"==typeof e){const[s,r]=Oi(i);e=e(void 0!==n?n:t.custom,s,r)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[s,r]=Oi(i);e=e(void 0!==n?n:t.custom,s,r)}return e}function Xi(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,we(n))}function Wi(t){return(t=>Array.isArray(t))(t)?t[t.length-1]||0:t}function $i(t,e){const n=function(t,e,n){const i=t.getProps();return Li(i,e,void 0!==n?n:i.custom,t)}(t,e);let{transitionEnd:i={},transition:s={},...r}=n||{};r={...r,...i};for(const e in r){Xi(t,e,Wi(r[e]))}}function ji(t,e){const n=t.getValue("willChange");if(i=n,Boolean(He(i)&&i.add))return n.add(e);if(!n&&a.WillChange){const n=new a.WillChange("auto");t.addValue("willChange",n),n.add(e)}var i}function Ni(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const Ui="data-"+Ni("framerAppearId");function zi(t){return t.props[Ui]}function Ki({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function Yi(t,e,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:r,transitionEnd:a,...o}=e;const l=t.getDefaultTransition();r=r?Ei(r,l):l;const h=r?.reduceMotion;i&&(r=i);const u=[],d=s&&t.animationState&&t.animationState.getState()[s];for(const e in o){const i=t.getValue(e,t.latestValues[e]??null),s=o[e];if(void 0===s||d&&Ki(d,e))continue;const a={delay:n,...ki(r||{},e)},l=i.get();if(void 0!==l&&!i.isAnimating()&&!Array.isArray(s)&&s===l&&!a.velocity){c.update(()=>i.set(s));continue}let p=!1;if(window.MotionHandoffAnimation){const n=zi(t);if(n){const t=window.MotionHandoffAnimation(n,e,c);null!==t&&(a.startTime=t,p=!0)}}ji(t,e);const f=h??t.shouldReduceMotion;i.start(_i(e,i,s,f&&Ii.has(e)?{type:!1}:a,t,p));const m=i.animation;m&&u.push(m)}if(a){const e=()=>c.update(()=>{a&&$i(t,a)});u.length?Promise.all(u).then(e):e()}return u}const Hi=new Set(["brightness","contrast","saturate","opacity"]);function qi(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(J)||[];if(!i)return t;const s=n.replace(i,"");let r=Hi.has(e)?1:0;return i!==n&&(r*=100),e+"("+r+s+")"}const Gi=/\b([a-z-]*)\(.*?\)/gu,Zi={...Tt,getAnimatableNone:t=>{const e=t.match(Gi);return e?e.map(qi).join(" "):t}},Ji={...Tt,getAnimatableNone:t=>{const e=Tt.parse(t);return Tt.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},Qi={...H,transform:Math.round},ts={borderWidth:lt,borderTopWidth:lt,borderRightWidth:lt,borderBottomWidth:lt,borderLeftWidth:lt,borderRadius:lt,borderTopLeftRadius:lt,borderTopRightRadius:lt,borderBottomRightRadius:lt,borderBottomLeftRadius:lt,width:lt,maxWidth:lt,height:lt,maxHeight:lt,top:lt,right:lt,bottom:lt,left:lt,inset:lt,insetBlock:lt,insetBlockStart:lt,insetBlockEnd:lt,insetInline:lt,insetInlineStart:lt,insetInlineEnd:lt,padding:lt,paddingTop:lt,paddingRight:lt,paddingBottom:lt,paddingLeft:lt,paddingBlock:lt,paddingBlockStart:lt,paddingBlockEnd:lt,paddingInline:lt,paddingInlineStart:lt,paddingInlineEnd:lt,margin:lt,marginTop:lt,marginRight:lt,marginBottom:lt,marginLeft:lt,marginBlock:lt,marginBlockStart:lt,marginBlockEnd:lt,marginInline:lt,marginInlineStart:lt,marginInlineEnd:lt,fontSize:lt,backgroundPositionX:lt,backgroundPositionY:lt,...{rotate:at,rotateX:at,rotateY:at,rotateZ:at,scale:G,scaleX:G,scaleY:G,scaleZ:G,skew:at,skewX:at,skewY:at,distance:lt,translateX:lt,translateY:lt,translateZ:lt,x:lt,y:lt,z:lt,perspective:lt,transformPerspective:lt,opacity:q,originX:ut,originY:ut,originZ:lt},zIndex:Qi,fillOpacity:q,strokeOpacity:q,numOctaves:Qi},es={...ts,color:pt,backgroundColor:pt,outlineColor:pt,fill:pt,stroke:pt,borderColor:pt,borderTopColor:pt,borderRightColor:pt,borderBottomColor:pt,borderLeftColor:pt,filter:Zi,WebkitFilter:Zi,mask:Ji,WebkitMask:Ji},ns=t=>es[t],is=()=>({x:{min:0,max:0},y:{min:0,max:0}}),ss=t=>e=>e.test(t),rs=[H,lt,ot,at,ct,ht,{test:t=>"auto"===t,parse:t=>t}],as=t=>rs.find(ss(t)),os=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),ls=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function hs(t,e,n=1){const[i,s]=function(t){const e=ls.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}(t);if(!i)return;const r=window.getComputedStyle(e).getPropertyValue(i);if(r){const t=r.trim();return os(t)?parseFloat(t):t}return z(s)?hs(s,e,n+1):s}const cs=t=>/^0[^.\s]+$/u.test(t);function us(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||cs(t))}const ds=new Set([Zi,Ji]);function ps(t,e){let n=ns(t);return ds.has(n)||(n=Tt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const fs=new Set(["auto","none","0"]);class ms extends li{constructor(t,e,n,i,s){super(t,e,n,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){let i=t[n];if("string"==typeof i&&(i=i.trim(),z(i))){const s=hs(i,e.current);void 0!==s&&(t[n]=s),n===t.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!Ii.has(n)||2!==t.length)return;const[i,s]=t,r=as(i),a=as(s);if(Y(i)!==Y(s)&&ei[n])this.needsMeasurement=!0;else if(r!==a)if(Jn(r)&&Jn(a))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else ei[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||us(t[e]))&&n.push(e);n.length&&function(t,e,n){let i,s=0;for(;s<t.length&&!i;){const e=t[s];"string"==typeof e&&!fs.has(e)&&vt(e).values.length&&(i=t[s]),s++}if(i&&n)for(const s of e)t[s]=ps(n,i)}(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=ei[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const i=e[e.length-1];void 0!==i&&t.getValue(n,i).jump(i,!1)}measureEndState(){const{element:t,name:e,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const i=t.getValue(e);i&&i.jump(this.measuredOrigin,!1);const s=n.length-1,r=n[s];n[s]=ei[e](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==r&&void 0===this.finalKeyframe&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([e,n])=>{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const{schedule:gs,cancel:ys}=h(queueMicrotask,!1),vs=[...rs,pt,Tt];const bs=["initial","animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"];function ws(t){return null!==(e=t.animate)&&"object"==typeof e&&"function"==typeof e.start||bs.some(e=>function(t){return"string"==typeof t||Array.isArray(t)}(t[e]));var e}const Ts={current:null},xs={current:!1},Ms="undefined"!=typeof window;const As=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Ss={};class Cs{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:i,skipAnimations:s,blockInitialAnimation:r,visualState:a},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=li,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,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 t=ye.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,c.render(this.render,!1,!0))};const{latestValues:l,renderState:h}=a;this.latestValues=l,this.baseTarget={...l},this.initialValues=e.initial?{...l}:{},this.renderState=h,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=s,this.options=o,this.blockInitialAnimation=Boolean(r),this.isControllingVariants=ws(e),this.isVariantNode=function(t){return Boolean(ws(t)||t.variants)}(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:u,...d}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in d){const e=d[t];void 0!==l[t]&&He(e)&&e.set(l[t])}}mount(t){if(this.hasBeenMounted)for(const t in this.initialValues)this.values.get(t)?.jump(this.initialValues[t]),this.latestValues[t]=this.initialValues[t];this.current=t,Bi.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((t,e)=>this.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(xs.current||function(){if(xs.current=!0,Ms)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Ts.current=t.matches;t.addEventListener("change",e),e()}else Ts.current=!1}(),this.shouldReduceMotion=Ts.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),u(this.notifyUpdate),u(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),e.accelerate&&Ti.has(t)&&this.current instanceof HTMLElement){const{factory:n,keyframes:i,times:s,ease:r,duration:a}=e.accelerate,o=new mi({element:this.current,name:t,keyframes:i,times:s,ease:r,duration:Te(a)}),l=n(o);return void this.valueSubscriptions.set(t,()=>{l(),o.cancel()})}const n=Zn.has(t);n&&this.onBindTransform&&this.onBindTransform();const i=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&c.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{i(),s&&s(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in Ss){const e=Ss[t];if(!e)continue;const{isEnabled:n,Feature:i}=e;if(!this.features[t]&&i&&n(this.props)&&(this.features[t]=new i(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<As.length;e++){const n=As[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const i=t["on"+n];i&&(this.propEventSubscriptions[n]=this.on(n,i))}this.prevMotionValues=function(t,e,n){for(const i in e){const s=e[i],r=n[i];if(He(s))t.addValue(i,s);else if(He(r))t.addValue(i,we(s,{owner:t}));else if(r!==s)if(t.hasValue(i)){const e=t.getValue(i);!0===e.liveStyle?e.jump(s):e.hasAnimated||e.set(s)}else{const e=t.getStaticValue(i);t.addValue(i,we(void 0!==e?e:s,{owner:t}))}}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}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 e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=we(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){let n=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var i;return null!=n&&("string"==typeof n&&(os(n)||cs(n))?n=parseFloat(n):(i=n,!vs.find(ss(i))&&Tt.test(e)&&(n=ps(t,e))),this.setBaseTarget(t,He(n)?n.get():n)),He(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let n;if("string"==typeof e||"object"==typeof e){const i=Li(this.props,e,this.presenceContext?.custom);i&&(n=i[t])}if(e&&void 0!==n)return n;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||He(i)?void 0!==this.initialValues[t]&&void 0===n?void 0:this.baseTarget[t]:i}on(t,e){return this.events[t]||(this.events[t]=new fe),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){gs.render(this.render)}}class Es extends Cs{constructor(){super(...arguments),this.KeyframeResolver=ms}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){const n=t.style;return n?n[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;He(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}const ks=(t,e)=>e&&"number"==typeof t?e.transform(t):t,Vs={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Rs=Gn.length;function Ps(t,e,n){const{style:i,vars:s,transformOrigin:r}=t;let a=!1,o=!1;for(const t in e){const n=e[t];if(Zn.has(t))a=!0;else if(N(t))s[t]=n;else{const e=ks(n,ts[t]);t.startsWith("origin")?(o=!0,r[t]=e):i[t]=e}}if(e.transform||(a||n?i.transform=function(t,e,n){let i="",s=!0;for(let r=0;r<Rs;r++){const a=Gn[r],o=t[a];if(void 0===o)continue;let l=!0;if("number"==typeof o)l=o===(a.startsWith("scale")?1:0);else{const t=parseFloat(o);l=a.startsWith("scale")?1===t:0===t}if(!l||n){const t=ks(o,ts[a]);l||(s=!1,i+=`${Vs[a]||a}(${t}) `),n&&(e[a]=t)}}return i=i.trim(),n?i=n(e,s?"":i):s&&(i="none"),i}(e,t.transform,n):i.transform&&(i.transform="none")),o){const{originX:t="50%",originY:e="50%",originZ:n=0}=r;i.transformOrigin=`${t} ${e} ${n}`}}const Fs={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ds={offset:"strokeDashoffset",array:"strokeDasharray"};const _s=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Bs(t,{attrX:e,attrY:n,attrScale:i,pathLength:s,pathSpacing:r=1,pathOffset:a=0,...o},l,h,c){if(Ps(t,o,h),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:u,style:d}=t;u.transform&&(d.transform=u.transform,delete u.transform),(d.transform||u.transformOrigin)&&(d.transformOrigin=u.transformOrigin??"50% 50%",delete u.transformOrigin),d.transform&&(d.transformBox=c?.transformBox??"fill-box",delete u.transformBox);for(const t of _s)void 0!==u[t]&&(d[t]=u[t],delete u[t]);void 0!==e&&(u.x=e),void 0!==n&&(u.y=n),void 0!==i&&(u.scale=i),void 0!==s&&function(t,e,n=1,i=0,s=!0){t.pathLength=1;const r=s?Fs:Ds;t[r.offset]=""+-i,t[r.array]=`${e} ${n}`}(u,s,r,a,!1)}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 Os(t,{style:e,vars:n},i,s){const r=t.style;let a;for(a in e)r[a]=e[a];for(a in s?.applyProjectionStyles(r,i),n)r.setProperty(a,n[a])}function Ls(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Xs={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!lt.test(t))return t;t=parseFloat(t)}return`${Ls(t,e.target.x)}% ${Ls(t,e.target.y)}%`}},Ws={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=Tt.parse(t);if(s.length>5)return i;const r=Tt.createTransformer(t),a="number"!=typeof s[0]?1:0,o=n.x.scale*e.x,l=n.y.scale*e.y;s[0+a]/=o,s[1+a]/=l;const h=At(o,l,.5);return"number"==typeof s[2+a]&&(s[2+a]/=h),"number"==typeof s[3+a]&&(s[3+a]/=h),r(s)}};const $s={borderRadius:{...Xs,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Xs,borderTopRightRadius:Xs,borderBottomLeftRadius:Xs,borderBottomRightRadius:Xs,boxShadow:Ws};function js(t,{layout:e,layoutId:n}){return Zn.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!$s[t]||"opacity"===t)}function Ns(t,e,n){const i=t.style,s=e?.style,r={};if(!i)return r;for(const e in i)(He(i[e])||s&&He(s[e])||js(e,t)||void 0!==n?.getValue(e)?.liveStyle)&&(r[e]=i[e]);return r}class Us extends Es{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=is}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(Zn.has(e)){const t=ns(e);return t&&t.default||0}return e=Is.has(e)?e:Ni(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return function(t,e,n){const i=Ns(t,e,n);for(const n in t)(He(t[n])||He(e[n]))&&(i[-1!==Gn.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]);return i}(t,e,n)}build(t,e,n){Bs(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){!function(t,e,n,i){Os(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(Is.has(n)?n:Ni(n),e.attrs[n])}(t,e,0,i)}mount(t){var e;this.isSVGTag="string"==typeof(e=t.tagName)&&"svg"===e.toLowerCase(),super.mount(t)}}function zs(t,e){return function({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}(t.getBoundingClientRect(),e))}class Ks extends Es{constructor(){super(...arguments),this.type="html",this.renderInstance=Os}readValueFromInstance(t,e){if(Zn.has(e))return this.projection?.isProjecting?Yn(e):((t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Hn(n,e)})(t,e);{const i=(n=t,window.getComputedStyle(n)),s=(N(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return zs(t,e)}build(t,e,n){Ps(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return Ns(t,e,n)}}class Ys extends Cs{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(function(t,e){return t in e}(e,t)){const n=t[e];if("string"==typeof n||"number"==typeof n)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(t,e){delete e.output[t]}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}build(t,e){Object.assign(t.output,e)}renderInstance(t,{output:e}){Object.assign(t,e)}sortInstanceNodePosition(){return 0}}function Hs(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=x(t)&&!function(t){return x(t)&&"svg"===t.tagName}(t)?new Us(e):new Ks(e);n.mount(t),Bi.set(t,n)}function qs(t){const e=new Ys({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});e.mount(t),Bi.set(t,e)}function Gs(t,e,n,i){const s=[];if(function(t,e){return He(t)||"number"==typeof t||"string"==typeof t&&!Ze(e)}(t,e))s.push(function(t,e,n){const i=He(t)?t:we(t);return i.start(_i("",i,e,n)),i.animation}(t,Ze(e)&&e.default||e,n&&n.default||n));else{if(null==t)return s;const r=Je(t,e,i),a=r.length;Boolean(a);for(let t=0;t<a;t++){const i=r[t],o=i instanceof Element?Hs:qs;Bi.has(i)||o(i);const l=Bi.get(i),h={...n};"delay"in h&&"function"==typeof h.delay&&(h.delay=h.delay(t,a)),s.push(...Yi(l,{...e,transition:h},{}))}}return s}function Zs(t,e,n){const i=[],s=function(t,{defaultTransition:e={},...n}={},i,s){const r=e.duration||.3,a=new Map,o=new Map,l={},h=new Map;let c=0,u=0,d=0;for(let n=0;n<t.length;n++){const a=t[n];if("string"==typeof a){h.set(a,u);continue}if(!Array.isArray(a)){h.set(a.name,tn(u,a.at,c,h));continue}let[p,f,m={}]=a;void 0!==m.at&&(u=tn(u,m.at,c,h));let g=0;const y=(t,n,i,a=0,o=0)=>{const l=on(t),{delay:h=0,times:c=Lt(l),type:p=e.type||"keyframes",repeat:f,repeatType:m,repeatDelay:y=0,...v}=n;let{ease:b=e.ease||"easeOut",duration:w}=n;const T="function"==typeof h?h(a,o):h,x=l.length,M=Ye(p)?p:s?.[p||"keyframes"];if(x<=2&&M){let t=100;if(2===x&&cn(l)){const e=l[1]-l[0];t=Math.abs(e)}const n={...e,...v};void 0!==w&&(n.duration=Te(w));const i=Ce(n,t,M);b=i.ease,w=i.duration}w??(w=r);const A=u+T;1===c.length&&0===c[0]&&(c[1]=1);const S=c.length-l.length;if(S>0&&Ot(c,S),1===l.length&&l.unshift(null),f){w=Qe(w,f);const t=[...l],e=[...c];b=Array.isArray(b)?[...b]:[b];const n=[...b];for(let i=0;i<f;i++){l.push(...t);for(let s=0;s<t.length;s++)c.push(e[s]+(i+1)),b.push(0===s?"linear":Ge(n,s-1))}nn(c,f)}const C=A+w;en(i,l,b,c,A,C),g=Math.max(T+w,g),d=Math.max(C,d)};if(He(p))y(f,m,an("default",rn(p,o)));else{const t=Je(p,f,i,l),e=t.length;for(let n=0;n<e;n++){const i=rn(t[n],o);for(const t in f)y(f[t],ln(m,t),an(t,i),n,e)}}c=u,u+=g}return o.forEach((t,i)=>{for(const s in t){const r=t[s];r.sort(sn);const o=[],l=[],h=[];for(let t=0;t<r.length;t++){const{at:e,value:n,easing:i}=r[t];o.push(n),l.push(B(0,d,e)),h.push(i||"easeOut")}0!==l[0]&&(l.unshift(0),o.unshift(o[0]),h.unshift("easeInOut")),1!==l[l.length-1]&&(l.push(1),o.push(null)),a.has(i)||a.set(i,{keyframes:{},transition:{}});const c=a.get(i);c.keyframes[s]=o;const{type:u,...p}=e;c.transition[s]={...p,duration:d,ease:h,times:l,...n}}}),a}(t.map(t=>{if(Array.isArray(t)&&"function"==typeof t[0]){const e=t[0],n=we(0);return n.on("change",e),1===t.length?[n,[0,1]]:2===t.length?[n,[0,1],t[1]]:[n,t[1],t[2]]}return t}),e,n,{spring:Ke});return s.forEach(({keyframes:t,transition:e},n)=>{i.push(...Gs(n,t,e))}),i}const Js=function(t={}){const{scope:e,reduceMotion:n}=t;return function(t,i,s){let r,a=[];if(o=t,Array.isArray(o)&&o.some(Array.isArray)){const{onComplete:s,...o}=i||{};"function"==typeof s&&(r=s),a=Zs(t,void 0!==n?{reduceMotion:n,...o}:o,e)}else{const{onComplete:o,...l}=s||{};"function"==typeof o&&(r=o),a=Gs(t,i,void 0!==n?{reduceMotion:n,...l}:l,e)}var o;const l=new de(a);return r&&l.finished.then(r),e&&(e.animations.push(l),l.finished.then(()=>{pe(e.animations,l)})),l}}();var Qs=function(t,e,n,i){return new(n||(n=Promise))(function(s,r){function a(t){try{l(i.next(t))}catch(t){r(t)}}function o(t){try{l(i.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?s(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(a,o)}l((i=i.apply(t,e||[])).next())})};class tr{constructor(t,e={}){this.engine=null,this.syncedAnimations=[],this.destroyed=!1,this.container=t,this.options=Object.assign({scrub:0},e),this.injectStyles()}injectStyles(){if(tr.stylesInjected)return;const t=document.createElement("style");t.id="stube-base-styles",t.innerHTML='\n .stube-layer {\n position: absolute;\n inset: 0;\n pointer-events: none;\n display: grid;\n grid-template-areas: "content";\n }\n .stube-layer > * {\n grid-area: content;\n pointer-events: auto;\n }\n /* Alignment Mappings */\n .stube-layer[data-stube-align^="top"] { align-items: start; }\n .stube-layer[data-stube-align^="center"] { align-items: center; }\n .stube-layer[data-stube-align^="bottom"] { align-items: end; }\n \n .stube-layer[data-stube-align$="left"] { justify-items: start; }\n .stube-layer[data-stube-align$="center"] { justify-items: center; }\n .stube-layer[data-stube-align$="right"] { justify-items: end; }\n ',document.head.appendChild(t),tr.stylesInjected=!0}static initAll(){return Qs(this,void 0,void 0,function*(){const t=document.querySelectorAll(".stube-container"),e=[];for(let n=0;n<t.length;n++){const i=t[n],s=new tr(i,{scrub:.5});yield s.init(),e.push(s)}return e})}init(){return Qs(this,void 0,void 0,function*(){if(this.destroyed)return;const t=this.container.querySelector(".stube-canvas");if(!t)return void console.warn("[CoreOrchestrator] No .stube-canvas found inside container.");const e=t.dataset.stubeCanvas||t.getAttribute("data-project");if(!e)return void console.warn('[CoreOrchestrator] No project URL found on .stube-canvas. Use data-stube-canvas="url"');const n=t.dataset.stubeDepthtilt||t.getAttribute("data-stube-depthtilt");null!=n&&(this.options.depthTilt=parseFloat(n)),this.engine=yield this.loadEngine(e,t),this.destroyed||(this.parseAnimatedElements(),this.setupScrollTracking(),this.engine.onFrameChange=(t,e)=>{this.syncTrackingLayers(t),this.onFrameChange&&this.onFrameChange(t,e)},this.engine.onProgressUpdate=t=>{this.syncAnimations(t)})})}loadEngine(t,e){return Qs(this,void 0,void 0,function*(){let n;try{if(t.trim().startsWith("{"))n=JSON.parse(t);else{const e=yield fetch(t);if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);n=yield e.json()}}catch(t){throw console.error("[CoreOrchestrator] Failed to load configuration:",t),t}n.settings||(n.settings={baseResolution:{width:1920,height:1080},scrollMode:"vh"}),n.settings.basePath||t.trim().startsWith("{")||(n.settings.basePath=t.substring(0,t.lastIndexOf("/")));const i=new s(n,{scrub:this.options.scrub,depthTilt:this.options.depthTilt});let r=e.querySelector("canvas");return r||(r=document.createElement("canvas"),r.style.width="100%",r.style.height="100%",r.style.display="block",r.style.objectFit="cover",e.appendChild(r)),i.attachCanvas(r),i})}setupScrollTracking(){if(!this.engine)return;const t=this.container.dataset.stubeOffset;let e=["start end","end start"];try{t&&(e=JSON.parse(t))}catch(t){}this.motionScrollCancel=he(t=>{this.engine&&this.engine.update(t)},{target:this.container,offset:e})}parseAnimatedElements(){this.container.querySelectorAll("[data-stube-animate]").forEach(t=>{try{const e=t.getAttribute("data-stube-animate");if(!e)return;const n=JSON.parse(e),i=Js(t,n,{duration:1,ease:"linear"});i.pause(),i.time=0,this.syncedAnimations.push(i)}catch(e){console.warn("[CoreOrchestrator] Failed to parse data-stube-animate on element",t,e)}})}syncAnimations(t){for(const e of this.syncedAnimations)e.time=t}syncTrackingLayers(t){if(!this.engine)return;this.container.querySelectorAll("[data-stube-layer-tracking]").forEach(e=>Qs(this,void 0,void 0,function*(){const n=e.dataset.stubeLayerTracking;if(!n)return;yield this.engine.loadTrackingData(n);const i=this.engine.getTrackedCoords(n,t);e.style.left=100*i.x+"%",e.style.top=100*i.y+"%"}))}getEngine(){return this.engine}destroy(){this.destroyed=!0,this.motionScrollCancel&&(this.motionScrollCancel(),this.motionScrollCancel=void 0);for(const t of this.syncedAnimations)t.stop();this.syncedAnimations=[],this.engine&&(this.engine.destroy(),this.engine=null),this.onFrameChange=void 0}}tr.stylesInjected=!1;const er=Object.assign(s,{CoreOrchestrator:tr});return e=e.default})());
@@ -11,4 +11,4 @@
11
11
  */
12
12
 
13
13
 
14
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports.ScrollTubeReact=e(require("react")):t.ScrollTubeReact=e(t.react)}(this,t=>(()=>{"use strict";var e={197(t,e){var n=Symbol.for("react.transitional.element");function i(t,e,i){var s=null;if(void 0!==i&&(s=""+i),void 0!==e.key&&(s=""+e.key),"key"in e)for(var r in i={},e)"key"!==r&&(i[r]=e[r]);else i=e;return e=i.ref,{$$typeof:n,type:t,key:s,ref:void 0!==e?e:null,props:i}}Symbol.for("react.fragment"),e.jsx=i},85(t,e,n){t.exports=n(197)},155(e){e.exports=t}},n={};function i(t){var s=n[t];if(void 0!==s)return s.exports;var r=n[t]={exports:{}};return e[t](r,r.exports,i),r.exports}i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var s={};i.r(s),i.d(s,{ScrollTubeCanvas:()=>rr,ScrollTubeLayer:()=>ar,ScrollTubeLayerTracking:()=>or,ScrollTubeProvider:()=>sr,SubjectLayer:()=>lr,useScrollTube:()=>hr});var r=i(85),a=i(155);class o{constructor(t,e={}){if(this.targetMouse={x:0,y:0},this.currentMouse={x:0,y:0},this.animationFrameId=0,this.depthTilt=.04,this.animate=()=>{if(this.currentMouse.x+=.1*(this.targetMouse.x-this.currentMouse.x),this.currentMouse.y+=.1*(this.targetMouse.y-this.currentMouse.y),this.gl&&this.program){this.gl.useProgram(this.program);const t=this.gl.getUniformLocation(this.program,"u_mouse");this.gl.uniform2f(t,this.currentMouse.x,this.currentMouse.y);const e=this.gl.getUniformLocation(this.program,"u_depthTilt");this.gl.uniform1f(e,this.depthTilt),this.draw()}this.animationFrameId=requestAnimationFrame(this.animate)},this.depthTilt=void 0!==e.depthTilt?e.depthTilt:4,this.gl=t.getContext("webgl",{alpha:!1,antialias:!1}),!this.gl)throw new Error("WebGL not supported");this.program=this.createProgram("\n attribute vec2 a_position;\n varying vec2 v_texCoord;\n void main() {\n gl_Position = vec4(a_position, 0.0, 1.0);\n // Convert -1 -> 1 to 0 -> 1 for UVs\n v_texCoord = a_position * 0.5 + 0.5;\n v_texCoord.y = 1.0 - v_texCoord.y;\n }\n ","\n precision mediump float;\n uniform sampler2D u_image;\n uniform sampler2D u_depthMap;\n uniform vec2 u_resolution;\n uniform vec2 u_imageResolution;\n uniform vec2 u_mouse;\n uniform float u_depthTilt;\n uniform bool u_hasDepth;\n varying vec2 v_texCoord;\n\n void main() {\n // object-fit: cover math\n vec2 ratio = vec2(\n min((u_resolution.x / u_resolution.y) / (u_imageResolution.x / u_imageResolution.y), 1.0),\n min((u_resolution.y / u_resolution.x) / (u_imageResolution.y / u_imageResolution.x), 1.0)\n );\n vec2 uv = vec2(\n v_texCoord.x * ratio.x + (1.0 - ratio.x) * 0.5,\n v_texCoord.y * ratio.y + (1.0 - ratio.y) * 0.5\n );\n\n if (u_hasDepth) {\n float depth = texture2D(u_depthMap, uv).r;\n // White is close (1), Black is far (0).\n // By making the background move and the foreground stay still (using 1.0 - depth)\n // and subtracting the parallax, the background pulls the foreground over itself,\n // expanding the edges and creating proper occlusion, instead of collapsing/tearing.\n // depthTilt is scaled by 0.01 internally (so 100 = 1.0 peak displacement)\n vec2 parallax = u_mouse * (1.0 - depth) * (u_depthTilt * 0.01);\n uv -= parallax;\n }\n \n gl_FragColor = texture2D(u_image, uv);\n }\n "),this.gl.useProgram(this.program),this.positionBuffer=this.gl.createBuffer(),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.positionBuffer),this.gl.bufferData(this.gl.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),this.gl.STATIC_DRAW),this.texture=this.gl.createTexture(),this.depthTexture=this.gl.createTexture(),window.addEventListener("mousemove",t=>{this.targetMouse.x=t.clientX/window.innerWidth*2-1,this.targetMouse.y=t.clientY/window.innerHeight*2-1}),this.animate()}setDepthTilt(t){this.depthTilt=t}createProgram(t,e){const n=this.gl.createShader(this.gl.VERTEX_SHADER);this.gl.shaderSource(n,t),this.gl.compileShader(n);const i=this.gl.createShader(this.gl.FRAGMENT_SHADER);this.gl.shaderSource(i,e),this.gl.compileShader(i);const s=this.gl.createProgram();return this.gl.attachShader(s,n),this.gl.attachShader(s,i),this.gl.linkProgram(s),s}render(t,e,n,i){this.gl.useProgram(this.program),this.gl.activeTexture(this.gl.TEXTURE0),this.gl.bindTexture(this.gl.TEXTURE_2D,this.texture),this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,this.gl.RGBA,this.gl.UNSIGNED_BYTE,t),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.LINEAR),this.gl.activeTexture(this.gl.TEXTURE1),this.gl.bindTexture(this.gl.TEXTURE_2D,this.depthTexture),e&&(this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,this.gl.RGBA,this.gl.UNSIGNED_BYTE,e),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.LINEAR)),this.gl.uniform1i(this.gl.getUniformLocation(this.program,"u_image"),0),this.gl.uniform1i(this.gl.getUniformLocation(this.program,"u_depthMap"),1),this.gl.uniform1i(this.gl.getUniformLocation(this.program,"u_hasDepth"),e?1:0),this.gl.uniform2f(this.gl.getUniformLocation(this.program,"u_resolution"),n,i),this.gl.uniform2f(this.gl.getUniformLocation(this.program,"u_imageResolution"),t.naturalWidth,t.naturalHeight);const s=this.gl.getAttribLocation(this.program,"a_position");this.gl.enableVertexAttribArray(s),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.positionBuffer),this.gl.vertexAttribPointer(s,2,this.gl.FLOAT,!1,0,0),this.gl.viewport(0,0,n,i),this.draw()}draw(){this.gl.drawArrays(this.gl.TRIANGLES,0,6)}destroy(){cancelAnimationFrame(this.animationFrameId)}}var l=function(t,e,n,i){return new(n||(n=Promise))(function(s,r){function a(t){try{l(i.next(t))}catch(t){r(t)}}function o(t){try{l(i.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?s(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(a,o)}l((i=i.apply(t,e||[])).next())})};class h{constructor(t,e={}){this.currentFrame=-1,this.activeVariant=null,this.canvas=null,this.ctx=null,this.renderer=null,this.basePath="",this.scrub=0,this.depthTilt=4,this.targetProgress=0,this.currentProgress=0,this.rafId=0,this.destroyed=!1,this.imageCache=new Map,this.depthCache=new Map,this.scrollTimeout=null,this.trackingDataCache=new Map,this.config=t,this.basePath=t.settings.basePath||"",this.scrub=void 0!==e.scrub?e.scrub:0,this.depthTilt=void 0!==e.depthTilt?e.depthTilt:4,this.detectBestVariant(),this.boundResize=()=>{this.detectBestVariant(),this.resizeCanvas(),this.render()},window.addEventListener("resize",this.boundResize),this.updateLoop=this.updateLoop.bind(this),this.rafId=requestAnimationFrame(this.updateLoop)}destroy(){this.destroyed=!0,this.rafId&&cancelAnimationFrame(this.rafId),window.removeEventListener("resize",this.boundResize),this.scrollTimeout&&clearTimeout(this.scrollTimeout),this.clearCache(),this.trackingDataCache.clear(),this.canvas=null,this.ctx=null,this.renderer=null,this.onFrameChange=void 0}static init(t,e){return l(this,void 0,void 0,function*(){const n=yield fetch(e);if(!n.ok)throw new Error(`Failed to load config: ${n.statusText}`);const i=yield n.json(),s=e.substring(0,e.lastIndexOf("/"));i.settings||(i.settings={baseResolution:{width:1920,height:1080},scrollMode:"vh"}),i.settings.basePath=i.settings.basePath||s;const r=new h(i,{scrub:"object"==typeof i.settings?i.settings.scrub:0});let a=t.querySelector("canvas");return a||(a=document.createElement("canvas"),a.style.width="100%",a.style.height="100%",a.style.display="block",a.style.objectFit="cover",t.appendChild(a)),r.attachCanvas(a),r})}attachCanvas(t){this.canvas=t;try{this.renderer=new o(t,{depthTilt:this.depthTilt})}catch(e){console.warn("WebGL failed, falling back to 2D",e),this.ctx=t.getContext("2d",{alpha:!1})}this.resizeCanvas(),this.render()}resizeCanvas(){if(!this.canvas)return;const t=this.canvas.getBoundingClientRect(),e=t.width,n=t.height,i=window.devicePixelRatio||1;this.canvas.width=e*i,this.canvas.height=n*i,this.ctx&&this.ctx.scale(i,i)}detectBestVariant(){var t;const e=this.config.assets[0];if(!e)return;const n=this.canvas?this.canvas.getBoundingClientRect():{width:window.innerWidth,height:window.innerHeight},i=n.height>n.width,s=n.width*(window.devicePixelRatio||1),r=e.variants.filter(t=>{const e="portrait"===t.orientation||parseInt(t.aspectRatio.split(":")[1])>parseInt(t.aspectRatio.split(":")[0]);return i===e});r.sort((t,e)=>t.frameCount-e.frameCount);const a=r.find(t=>t.width>=s)||r[r.length-1];a?(null===(t=this.activeVariant)||void 0===t?void 0:t.id)!==a.id&&(console.log(`🎯 Variant Switched: ${a.id} (${i?"Portrait":"Landscape"})`),this.activeVariant=a,this.clearCache(),this.preloadInitial()):console.warn("[CoreEngine] No suitable variant found")}clearCache(){this.imageCache.clear(),this.depthCache.clear()}preloadInitial(){for(let t=0;t<15;t++)this.getImage(t)}update(t){this.targetProgress=Math.max(0,Math.min(1,t))}setDepthTilt(t){this.depthTilt=t,this.renderer&&this.renderer.setDepthTilt(t)}updateLoop(){if(this.destroyed)return;this.rafId=requestAnimationFrame(this.updateLoop);const t=this.scrub;if(t>0){const e=Math.max(.01,1-t);this.currentProgress+=(this.targetProgress-this.currentProgress)*e}else this.currentProgress=this.targetProgress;Math.abs(this.targetProgress-this.currentProgress)<1e-4&&(this.currentProgress=this.targetProgress),this.onProgressUpdate&&this.onProgressUpdate(this.currentProgress),this.calculateFrame(this.currentProgress)}calculateFrame(t){const e=this.config.timeline.scenes[0];if(!e)return;const n=e.assetRange[1]-e.assetRange[0],i=Math.floor(e.assetRange[0]+t*n),s=Math.max(0,Math.min(i,e.assetRange[1]));s!==this.currentFrame&&(this.currentFrame=s,this.render(),this.getImage(this.currentFrame+5),this.getImage(this.currentFrame+10),this.scrollTimeout&&clearTimeout(this.scrollTimeout),this.scrollTimeout=setTimeout(()=>{this.loadDepthMap(this.currentFrame)},100),this.onFrameChange&&this.onFrameChange(this.currentFrame,t))}loadTrackingData(t){return l(this,void 0,void 0,function*(){var e;if(!this.activeVariant)return;if(!(null===(e=this.activeVariant.subjects)||void 0===e?void 0:e.includes(t)))return void console.warn(`[CoreEngine] Subject ${t} not found in active variant ${this.activeVariant.id}`);const n=`${this.activeVariant.id}_${t}`;if(!this.trackingDataCache.has(n))try{const e=`${this.basePath?`${this.basePath}/`:""}${this.activeVariant.path}/000_tracking-${t}.json`;console.log(`[CoreEngine] Fetching tracking data: ${e}`);const i=yield fetch(e);if(!i.ok)throw new Error(i.statusText);const s=yield i.json();this.trackingDataCache.set(n,s)}catch(e){console.error(`[CoreEngine] Failed to load tracking data for ${t}`,e)}})}getTrackedCoords(t,e){if(!this.activeVariant||!this.canvas)return{x:.5,y:.5};const n=`${this.activeVariant.id}_${t}`,i=this.trackingDataCache.get(n);if(!i)return{x:.5,y:.5};const s=i.find(t=>t.frame===e);if(!s)return{x:.5,y:.5};const r=this.canvas.clientWidth/this.canvas.clientHeight,a=this.activeVariant.width/this.activeVariant.height,o=Math.min(r/a,1),l=Math.min(1/r/(1/a),1);return{x:(s.x-.5)/o+.5,y:(s.y-.5)/l+.5,scale:s.scale}}render(){var t;if(!this.canvas||-1===this.currentFrame)return;const e=this.getImage(this.currentFrame);if(!e||!e.complete)return;const n=this.canvas.clientWidth,i=this.canvas.clientHeight;let s=null;if((null===(t=this.activeVariant)||void 0===t?void 0:t.hasDepthMap)&&(s=this.getDepthImage(this.currentFrame),s&&!s.complete&&(s=null)),this.renderer)this.renderer.render(e,s,n*(window.devicePixelRatio||1),i*(window.devicePixelRatio||1));else if(this.ctx){const t=e.naturalWidth/e.naturalHeight;let s,r,a,o;t>n/i?(r=i,s=i*t,a=(n-s)/2,o=0):(s=n,r=n/t,a=0,o=(i-r)/2),this.ctx.clearRect(0,0,n,i),this.ctx.drawImage(e,a,o,s,r)}}getImage(t){if(!this.activeVariant)return null;if(t<0||t>=this.activeVariant.frameCount)return null;const e=`${this.activeVariant.id}_${t}`;if(this.imageCache.has(e))return this.imageCache.get(e);const n=this.basePath?`${this.basePath}/`:"",i=new Image;return i.crossOrigin="anonymous",i.src=`${n}${this.activeVariant.path}/index_${t}.webp`,i.onload=()=>{this.currentFrame===t&&this.render()},this.imageCache.set(e,i),i}loadDepthMap(t){var e;if(!(null===(e=this.activeVariant)||void 0===e?void 0:e.hasDepthMap))return void console.log("[CoreEngine] activeVariant does not define hasDepthMap=true");console.log(`[CoreEngine] Lazy requesting depth map for frame: ${t}`);this.getDepthImage(t)}getDepthImage(t){var e;if(!(null===(e=this.activeVariant)||void 0===e?void 0:e.hasDepthMap))return null;if(t<0||t>=this.activeVariant.frameCount)return null;const n=`${this.activeVariant.id}_depth_${t}`;if(this.depthCache.has(n))return this.depthCache.get(n);const i=this.basePath?`${this.basePath}/`:"";console.log(`[CoreEngine] Downloading: ${i}${this.activeVariant.path}/index_${t}_depth.webp`);const s=new Image;return s.crossOrigin="anonymous",s.src=`${i}${this.activeVariant.path}/index_${t}_depth.webp`,s.onload=()=>{console.log(`[CoreEngine] Depth map loaded for frame: ${t}`),this.currentFrame===t&&this.render()},s.onerror=e=>{console.error(`[CoreEngine] Depth map failed to load for frame: ${t}`,e)},this.depthCache.set(n,s),s}}const c=t=>t,u={},d=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],p={value:null,addProjectionMetrics:null};function f(t,e){let n=!1,i=!0;const s={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,a=d.reduce((t,n)=>(t[n]=function(t,e){let n=new Set,i=new Set,s=!1,r=!1;const a=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1},l=0;function h(e){a.has(e)&&(c.schedule(e),t()),l++,e(o)}const c={schedule:(t,e=!1,r=!1)=>{const o=r&&s?n:i;return e&&a.add(t),o.add(t),t},cancel:t=>{i.delete(t),a.delete(t)},process:t=>{if(o=t,s)return void(r=!0);s=!0;const a=n;n=i,i=a,n.forEach(h),e&&p.value&&p.value.frameloop[e].push(l),l=0,n.clear(),s=!1,r&&(r=!1,c.process(t))}};return c}(r,e?n:void 0),t),{}),{setup:o,read:l,resolveKeyframes:h,preUpdate:c,update:f,preRender:m,render:g,postRender:y}=a,v=()=>{const r=u.useManualTiming,a=r?s.timestamp:performance.now();n=!1,r||(s.delta=i?1e3/60:Math.max(Math.min(a-s.timestamp,40),1)),s.timestamp=a,s.isProcessing=!0,o.process(s),l.process(s),h.process(s),c.process(s),f.process(s),m.process(s),g.process(s),y.process(s),s.isProcessing=!1,n&&e&&(i=!1,t(v))};return{schedule:d.reduce((e,r)=>{const o=a[r];return e[r]=(e,r=!1,a=!1)=>(n||(n=!0,i=!0,s.isProcessing||t(v)),o.schedule(e,r,a)),e},{}),cancel:t=>{for(let e=0;e<d.length;e++)a[d[e]].cancel(t)},state:s,steps:a}}const{schedule:m,cancel:g,state:y,steps:v}=f("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:c,!0);function b(t,e){let n;const i=()=>{const{currentTime:i}=e,s=(null===i?0:i.value)/100;n!==s&&t(s),n=s};return m.preUpdate(i,!0),()=>g(i)}function T(t){let e;return()=>(void 0===e&&(e=t()),e)}const w={};function x(t,e){const n=T(t);return()=>w[e]??n()}const M=x(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),S=x(()=>void 0!==window.ViewTimeline,"viewTimeline");function A(t){return"undefined"!=typeof window&&(t?S():M())}function E(t){return"object"==typeof t&&null!==t}function C(t){return E(t)&&"ownerSVGElement"in t}function k(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let i=document;e&&(i=e.current);const s=n?.[t]??i.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(t=>null!=t)}const V=new WeakMap;let P;const R=(t,e,n)=>(i,s)=>s&&s[0]?s[0][t+"Size"]:C(i)&&"getBBox"in i?i.getBBox()[e]:i[n],F=R("inline","width","offsetWidth"),D=R("block","height","offsetHeight");function _({target:t,borderBoxSize:e}){V.get(t)?.forEach(n=>{n(t,{get width(){return F(t,e)},get height(){return D(t,e)}})})}function B(t){t.forEach(_)}function O(t,e){P||"undefined"!=typeof ResizeObserver&&(P=new ResizeObserver(B));const n=k(t);return n.forEach(t=>{let n=V.get(t);n||(n=new Set,V.set(t,n)),n.add(e),P?.observe(t)}),()=>{n.forEach(t=>{const n=V.get(t);n?.delete(e),n?.size||P?.unobserve(t)})}}const I=new Set;let L;function j(t){return I.add(t),L||(L=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};I.forEach(e=>e(t))},window.addEventListener("resize",L)),()=>{I.delete(t),I.size||"function"!=typeof L||(window.removeEventListener("resize",L),L=void 0)}}const $=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i};function W(t,e){return e?t*(1e3/e):0}const N={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function U(t,e,n,i){const s=n[e],{length:r,position:a}=N[e],o=s.current,l=n.time;s.current=Math.abs(t[`scroll${a}`]),s.scrollLength=t[`scroll${r}`]-t[`client${r}`],s.offset.length=0,s.offset[0]=0,s.offset[1]=s.scrollLength,s.progress=$(0,s.scrollLength,s.current);const h=i-l;s.velocity=h>50?0:W(s.current-o,h)}const X=(t,e)=>n=>e(t(n)),z=(...t)=>t.reduce(X);const K=(t,e,n)=>n>e?e:n<t?t:n,H=t=>e=>"string"==typeof e&&e.startsWith(t),Y=H("--"),q=H("var(--"),G=t=>!!q(t)&&Z.test(t.split("/*")[0].trim()),Z=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function J(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const Q={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},tt={...Q,transform:t=>K(0,1,t)},et={...Q,default:1},nt=t=>Math.round(1e5*t)/1e5,it=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const st=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,rt=(t,e)=>n=>Boolean("string"==typeof n&&st.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),at=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,r,a,o]=i.match(it);return{[t]:parseFloat(s),[e]:parseFloat(r),[n]:parseFloat(a),alpha:void 0!==o?parseFloat(o):1}},ot={...Q,transform:t=>Math.round((t=>K(0,255,t))(t))},lt={test:rt("rgb","red"),parse:at("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+ot.transform(t)+", "+ot.transform(e)+", "+ot.transform(n)+", "+nt(tt.transform(i))+")"};const ht={test:rt("#"),parse:function(t){let e="",n="",i="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}},transform:lt.transform},ct=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),ut=ct("deg"),dt=ct("%"),pt=ct("px"),ft=ct("vh"),mt=ct("vw"),gt=(()=>({...dt,parse:t=>dt.parse(t)/100,transform:t=>dt.transform(100*t)}))(),yt={test:rt("hsl","hue"),parse:at("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+dt.transform(nt(e))+", "+dt.transform(nt(n))+", "+nt(tt.transform(i))+")"},vt={test:t=>lt.test(t)||ht.test(t)||yt.test(t),parse:t=>lt.test(t)?lt.parse(t):yt.test(t)?yt.parse(t):ht.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?lt.transform(t):yt.transform(t),getAnimatableNone:t=>{const e=vt.parse(t);return e.alpha=0,vt.transform(e)}},bt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const Tt="number",wt="color",xt=/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 Mt(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let r=0;const a=e.replace(xt,t=>(vt.test(t)?(i.color.push(r),s.push(wt),n.push(vt.parse(t))):t.startsWith("var(")?(i.var.push(r),s.push("var"),n.push(t)):(i.number.push(r),s.push(Tt),n.push(parseFloat(t))),++r,"${}")).split("${}");return{values:n,split:a,indexes:i,types:s}}function St({split:t,types:e}){const n=t.length;return i=>{let s="";for(let r=0;r<n;r++)if(s+=t[r],void 0!==i[r]){const t=e[r];s+=t===Tt?nt(i[r]):t===wt?vt.transform(i[r]):i[r]}return s}}const At=(t,e)=>{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(n=t)?0:vt.test(n)?vt.getAnimatableNone(n):n;var n};const Et={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(it)?.length||0)+(t.match(bt)?.length||0)>0},parse:function(t){return Mt(t).values},createTransformer:function(t){return St(Mt(t))},getAnimatableNone:function(t){const e=Mt(t);return St(e)(e.values.map((t,n)=>At(t,e.split[n])))}};function Ct(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function kt(t,e){return n=>n>0?e:t}const Vt=(t,e,n)=>t+(e-t)*n,Pt=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},Rt=[ht,lt,yt];function Ft(t){const e=(n=t,Rt.find(t=>t.test(n)));var n;if(Boolean(e),!Boolean(e))return!1;let i=e.parse(t);return e===yt&&(i=function({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let s=0,r=0,a=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,o=2*n-i;s=Ct(o,i,t+1/3),r=Ct(o,i,t),a=Ct(o,i,t-1/3)}else s=r=a=n;return{red:Math.round(255*s),green:Math.round(255*r),blue:Math.round(255*a),alpha:i}}(i)),i}const Dt=(t,e)=>{const n=Ft(t),i=Ft(e);if(!n||!i)return kt(t,e);const s={...n};return t=>(s.red=Pt(n.red,i.red,t),s.green=Pt(n.green,i.green,t),s.blue=Pt(n.blue,i.blue,t),s.alpha=Vt(n.alpha,i.alpha,t),lt.transform(s))},_t=new Set(["none","hidden"]);function Bt(t,e){return n=>Vt(t,e,n)}function Ot(t){return"number"==typeof t?Bt:"string"==typeof t?G(t)?kt:vt.test(t)?Dt:jt:Array.isArray(t)?It:"object"==typeof t?vt.test(t)?Dt:Lt:kt}function It(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>Ot(t)(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=s[e](t);return n}}function Lt(t,e){const n={...t,...e},i={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(i[s]=Ot(t[s])(t[s],e[s]));return t=>{for(const e in i)n[e]=i[e](t);return n}}const jt=(t,e)=>{const n=Et.createTransformer(e),i=Mt(t),s=Mt(e);return i.indexes.var.length===s.indexes.var.length&&i.indexes.color.length===s.indexes.color.length&&i.indexes.number.length>=s.indexes.number.length?_t.has(t)&&!s.values.length||_t.has(e)&&!i.values.length?function(t,e){return _t.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):z(It(function(t,e){const n=[],i={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const r=e.types[s],a=t.indexes[r][i[r]],o=t.values[a]??0;n[s]=o,i[r]++}return n}(i,s),s.values),n):kt(t,e)};function $t(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return Vt(t,e,n);return Ot(t)(t,e)}function Wt(t,e,{clamp:n=!0,ease:i,mixer:s}={}){const r=t.length;if(e.length,1===r)return()=>e[0];if(2===r&&e[0]===e[1])return()=>e[1];const a=t[0]===t[1];t[0]>t[r-1]&&(t=[...t].reverse(),e=[...e].reverse());const o=function(t,e,n){const i=[],s=n||u.mix||$t,r=t.length-1;for(let n=0;n<r;n++){let r=s(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]||c:e;r=z(t,r)}i.push(r)}return i}(e,i,s),l=o.length,h=n=>{if(a&&n<t[0])return e[0];let i=0;if(l>1)for(;i<t.length-2&&!(n<t[i+1]);i++);const s=$(t[i],t[i+1],n);return o[i](s)};return n?e=>h(K(t[0],t[r-1],e)):h}function Nt(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=$(0,e,i);t.push(Vt(n,1,s))}}function Ut(t){const e=[0];return Nt(e,t.length-1),e}function Xt(t){return E(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const zt={start:0,center:.5,end:1};function Kt(t,e,n=0){let i=0;if(t in zt&&(t=zt[t]),"string"==typeof t){const e=parseFloat(t);t.endsWith("px")?i=e:t.endsWith("%")?t=e/100:t.endsWith("vw")?i=e/100*document.documentElement.clientWidth:t.endsWith("vh")?i=e/100*document.documentElement.clientHeight:t=e}return"number"==typeof t&&(i=e*t),n+i}const Ht=[0,0];function Yt(t,e,n,i){let s=Array.isArray(t)?t:Ht,r=0,a=0;return"number"==typeof t?s=[t,t]:"string"==typeof t&&(s=(t=t.trim()).includes(" ")?t.split(" "):[t,zt[t]?t:"0"]),r=Kt(s[0],n,i),a=Kt(s[1],e),r-a}const qt={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},Gt={x:0,y:0};function Zt(t,e,n){const{offset:i=qt.All}=n,{target:s=t,axis:r="y"}=n,a="y"===r?"height":"width",o=s!==t?function(t,e){const n={x:0,y:0};let i=t;for(;i&&i!==e;)if(Xt(i))n.x+=i.offsetLeft,n.y+=i.offsetTop,i=i.offsetParent;else if("svg"===i.tagName){const t=i.getBoundingClientRect();i=i.parentElement;const e=i.getBoundingClientRect();n.x+=t.left-e.left,n.y+=t.top-e.top}else{if(!(i instanceof SVGGraphicsElement))break;{const{x:t,y:e}=i.getBBox();n.x+=t,n.y+=e;let s=null,r=i.parentNode;for(;!s;)"svg"===r.tagName&&(s=r),r=i.parentNode;i=s}}return n}(s,t):Gt,l=s===t?{width:t.scrollWidth,height:t.scrollHeight}:function(t){return"getBBox"in t&&"svg"!==t.tagName?t.getBBox():{width:t.clientWidth,height:t.clientHeight}}(s),h={width:t.clientWidth,height:t.clientHeight};e[r].offset.length=0;let c=!e[r].interpolate;const u=i.length;for(let t=0;t<u;t++){const n=Yt(i[t],h[a],l[a],o[r]);c||n===e[r].interpolatorOffsets[t]||(c=!0),e[r].offset[t]=n}c&&(e[r].interpolate=Wt(e[r].offset,Ut(i),{clamp:!1}),e[r].interpolatorOffsets=[...e[r].offset]),e[r].progress=K(0,1,e[r].interpolate(e[r].current))}function Jt(t,e,n,i={}){return{measure:e=>{!function(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let i=e;for(;i&&i!==t;)n.x.targetOffset+=i.offsetLeft,n.y.targetOffset+=i.offsetTop,i=i.offsetParent}n.x.targetLength=e===t?e.scrollWidth:e.clientWidth,n.y.targetLength=e===t?e.scrollHeight:e.clientHeight,n.x.containerLength=t.clientWidth,n.y.containerLength=t.clientHeight}(t,i.target,n),function(t,e,n){U(t,"x",e,n),U(t,"y",e,n),e.time=n}(t,n,e),(i.offset||i.target)&&Zt(t,n,i)},notify:()=>e(n)}}const Qt=new WeakMap,te=new WeakMap,ee=new WeakMap,ne=new WeakMap,ie=new WeakMap,se=t=>t===document.scrollingElement?window:t;function re(t,{container:e=document.scrollingElement,trackContentSize:n=!1,...i}={}){if(!e)return c;let s=ee.get(e);s||(s=new Set,ee.set(e,s));const r=Jt(e,t,{time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},i);if(s.add(r),!Qt.has(e)){const t=()=>{for(const t of s)t.measure(y.timestamp);m.preUpdate(n)},n=()=>{for(const t of s)t.notify()},i=()=>m.read(t);Qt.set(e,i);const r=se(e);window.addEventListener("resize",i),e!==document.documentElement&&te.set(e,(o=i,"function"==typeof(a=e)?j(a):O(a,o))),r.addEventListener("scroll",i),i()}var a,o;if(n&&!ie.has(e)){const t=Qt.get(e),n={width:e.scrollWidth,height:e.scrollHeight};ne.set(e,n);const i=()=>{const i=e.scrollWidth,s=e.scrollHeight;n.width===i&&n.height===s||(t(),n.width=i,n.height=s)},s=m.read(i,!0);ie.set(e,s)}const l=Qt.get(e);return m.read(l,!1,!0),()=>{g(l);const t=ee.get(e);if(!t)return;if(t.delete(r),t.size)return;const n=Qt.get(e);Qt.delete(e),n&&(se(e).removeEventListener("scroll",n),te.get(e)?.(),window.removeEventListener("resize",n));const i=ie.get(e);i&&(g(i),ie.delete(e)),ne.delete(e)}}const ae=[[qt.Enter,"entry"],[qt.Exit,"exit"],[qt.Any,"cover"],[qt.All,"contain"]];function oe(t,e){if(2!==t.length)return!1;for(let n=0;n<2;n++){const i=t[n],s=e[n];if(!Array.isArray(i)||2!==i.length||i[0]!==s[0]||i[1]!==s[1])return!1}return!0}function le(t){if(!t)return{rangeStart:"contain 0%",rangeEnd:"contain 100%"};for(const[e,n]of ae)if(oe(t,e))return{rangeStart:`${n} 0%`,rangeEnd:`${n} 100%`}}const he=new Map;function ce(t){const e={value:0},n=re(n=>{e.value=100*n[t.axis].progress},t);return{currentTime:e,cancel:n}}function ue({source:t,container:e,...n}){const{axis:i}=n;t&&(e=t);let s=he.get(e);s||(s=new Map,he.set(e,s));const r=n.target??"self";let a=s.get(r);a||(a={},s.set(r,a));const o=i+(n.offset??[]).join(",");if(!a[o])if(n.target&&A(n.target)){const t=le(n.offset);a[o]=t?new ViewTimeline({subject:n.target,axis:i}):ce({container:e,...n})}else A()?a[o]=new ScrollTimeline({source:e,axis:i}):a[o]=ce({container:e,...n});return a[o]}function de(t,{axis:e="y",container:n=document.scrollingElement,...i}={}){if(!n)return c;const s={axis:e,container:n,...i};return"function"==typeof t?function(t,e){return function(t){return 2===t.length}(t)?re(n=>{t(n[e.axis].progress,n)},e):b(t,ue(e))}(t,s):function(t,e){const n=ue(e),i=e.target?le(e.offset):void 0,s=e.target?A(e.target)&&!!i:A();return t.attachTimeline({timeline:s?n:void 0,...i&&s&&{rangeStart:i.rangeStart,rangeEnd:i.rangeEnd},observe:t=>(t.pause(),b(e=>{t.time=t.iterationDuration*e},n))})}(t,s)}class pe{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;n<this.animations.length;n++)this.animations[n][t]=e}attachTimeline(t){const e=this.animations.map(e=>e.attachTimeline(t));return()=>{e.forEach((t,e)=>{t&&t(),this.animations[e].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 state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return fe(this.animations,"duration")}get iterationDuration(){return fe(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(e=>e[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function fe(t,e){let n=0;for(let i=0;i<t.length;i++){const s=t[i][e];null!==s&&s>n&&(n=s)}return n}class me extends pe{then(t,e){return this.finished.finally(t).then(()=>{})}}function ge(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class ye{constructor(){this.subscriptions=[]}add(t){var e,n;return e=this.subscriptions,n=t,-1===e.indexOf(n)&&e.push(n),()=>ge(this.subscriptions,t)}notify(t,e,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,n);else for(let s=0;s<i;s++){const i=this.subscriptions[s];i&&i(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}let ve;function be(){ve=void 0}const Te={now:()=>(void 0===ve&&Te.set(y.isProcessing||u.useManualTiming?y.timestamp:performance.now()),ve),set:t=>{ve=t,queueMicrotask(be)}},we={current:void 0};class xe{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=Te.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=Te.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new ye);const n=this.events[t].add(e);return"change"===t?()=>{n(),m.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return we.current&&we.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=Te.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return W(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),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.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Me(t,e){return new xe(t,e)}const Se=t=>1e3*t,Ae=t=>t/1e3,Ee=(t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let e=0;e<s;e++)i+=Math.round(1e4*t(e/(s-1)))/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},Ce=2e4;function ke(t){let e=0;let n=t.next(e);for(;!n.done&&e<Ce;)e+=50,n=t.next(e);return e>=Ce?1/0:e}function Ve(t,e=100,n){const i=n({...t,keyframes:[0,e]}),s=Math.min(ke(i),Ce);return{type:"keyframes",ease:t=>i.next(s*t).value/e,duration:Ae(s)}}const Pe=100,Re=10,Fe=1,De=0,_e=800,Be=.3,Oe=.3,Ie={granular:.01,default:2},Le={granular:.005,default:.5},je=.01,$e=10,We=.05,Ne=1;function Ue(t,e){return t*Math.sqrt(1-e*e)}const Xe=.001;const ze=["duration","bounce"],Ke=["stiffness","damping","mass"];function He(t,e){return e.some(e=>void 0!==t[e])}function Ye(t){let e={velocity:De,stiffness:Pe,damping:Re,mass:Fe,isResolvedFromDuration:!1,...t};if(!He(t,Ke)&&He(t,ze))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(1.2*n),s=i*i,r=2*K(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:Fe,stiffness:s,damping:r}}else{const n=function({duration:t=_e,bounce:e=Be,velocity:n=De,mass:i=Fe}){let s,r;Se($e);let a=1-e;a=K(We,Ne,a),t=K(je,$e,Ae(t)),a<1?(s=e=>{const i=e*a,s=i*t,r=i-n,o=Ue(e,a),l=Math.exp(-s);return Xe-r/o*l},r=e=>{const i=e*a*t,r=i*n+n,o=Math.pow(a,2)*Math.pow(e,2)*t,l=Math.exp(-i),h=Ue(Math.pow(e,2),a);return(-s(e)+Xe>0?-1:1)*((r-o)*l)/h}):(s=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,r=e=>Math.exp(-e*t)*(t*t*(n-e)));const o=function(t,e,n){let i=n;for(let n=1;n<12;n++)i-=t(i)/e(i);return i}(s,r,5/t);if(t=Se(t),isNaN(o))return{stiffness:Pe,damping:Re,duration:t};{const e=Math.pow(o,2)*i;return{stiffness:e,damping:2*a*Math.sqrt(i*e),duration:t}}}({...t,velocity:0});e={...e,...n,mass:Fe},e.isResolvedFromDuration=!0}return e}function qe(t=Oe,e=Be){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:s}=n;const r=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],o={done:!1,value:r},{stiffness:l,damping:h,mass:c,duration:u,velocity:d,isResolvedFromDuration:p}=Ye({...n,velocity:-Ae(n.velocity||0)}),f=d||0,m=h/(2*Math.sqrt(l*c)),g=a-r,y=Ae(Math.sqrt(l/c)),v=Math.abs(g)<5;let b,T,w,x,M,S;if(i||(i=v?Ie.granular:Ie.default),s||(s=v?Le.granular:Le.default),m<1)w=Ue(y,m),x=(f+m*y*g)/w,b=t=>{const e=Math.exp(-m*y*t);return a-e*(x*Math.sin(w*t)+g*Math.cos(w*t))},M=m*y*x+g*w,S=m*y*g-x*w,T=t=>Math.exp(-m*y*t)*(M*Math.sin(w*t)+S*Math.cos(w*t));else if(1===m){b=t=>a-Math.exp(-y*t)*(g+(f+y*g)*t);const t=f+y*g;T=e=>Math.exp(-y*e)*(y*t*e-f)}else{const t=y*Math.sqrt(m*m-1);b=e=>{const n=Math.exp(-m*y*e),i=Math.min(t*e,300);return a-n*((f+m*y*g)*Math.sinh(i)+t*g*Math.cosh(i))/t};const e=(f+m*y*g)/t,n=m*y*e-g*t,i=m*y*g-e*t;T=e=>{const s=Math.exp(-m*y*e),r=Math.min(t*e,300);return s*(n*Math.sinh(r)+i*Math.cosh(r))}}const A={calculatedDuration:p&&u||null,velocity:t=>Se(T(t)),next:t=>{if(!p&&m<1){const e=Math.exp(-m*y*t),n=Math.sin(w*t),r=Math.cos(w*t),l=a-e*(x*n+g*r),h=Se(e*(M*n+S*r));return o.done=Math.abs(h)<=i&&Math.abs(a-l)<=s,o.value=o.done?a:l,o}const e=b(t);if(p)o.done=t>=u;else{const n=Se(T(t));o.done=Math.abs(n)<=i&&Math.abs(a-e)<=s}return o.value=o.done?a:e,o},toString:()=>{const t=Math.min(ke(A),Ce),e=Ee(e=>A.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return A}function Ge(t){return"function"==typeof t&&"applyToOptions"in t}qe.applyToOptions=t=>{const e=Ve(t,100,qe);return t.ease=e.ease,t.duration=Se(e.duration),t.type="keyframes",t};const Ze=t=>Boolean(t&&t.getVelocity),Je=t=>Array.isArray(t)&&"number"!=typeof t[0];function Qe(t,e){return Je(t)?t[((t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t})(0,t.length,e)]:t}function tn(t){return"object"==typeof t&&!Array.isArray(t)}function en(t,e,n,i){return null==t?[]:"string"==typeof t&&tn(e)?k(t,n,i):t instanceof NodeList?Array.from(t):Array.isArray(t)?t.filter(t=>null!=t):[t]}function nn(t,e,n){return t*(e+1)}function sn(t,e,n,i){return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:e.startsWith("<")?Math.max(0,n+parseFloat(e.slice(1))):i.get(e)??t}function rn(t,e,n,i,s,r){!function(t,e,n){for(let i=0;i<t.length;i++){const s=t[i];s.at>e&&s.at<n&&(ge(t,s),i--)}}(t,s,r);for(let a=0;a<e.length;a++)t.push({value:e[a],at:Vt(s,r,i[a]),easing:Qe(n,a)})}function an(t,e){for(let n=0;n<t.length;n++)t[n]=t[n]/(e+1)}function on(t,e){return t.at===e.at?null===t.value?1:null===e.value?-1:0:t.at-e.at}function ln(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function hn(t,e){return e[t]||(e[t]=[]),e[t]}function cn(t){return Array.isArray(t)?t:[t]}function un(t,e){return t&&t[e]?{...t,...t[e]}:{...t}}const dn=t=>"number"==typeof t,pn=t=>t.every(dn),fn={layout:0,mainThread:0,waapi:0},mn=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>m.update(e,t),stop:()=>g(e),now:()=>y.isProcessing?y.timestamp:Te.now()}};function gn(t,e,n){const i=Math.max(e-5,0);return W(n-t(i),e-i)}function yn({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:r=500,modifyTarget:a,min:o,max:l,restDelta:h=.5,restSpeed:c}){const u=t[0],d={done:!1,value:u},p=t=>void 0===o?l:void 0===l||Math.abs(o-t)<Math.abs(l-t)?o:l;let f=n*e;const m=u+f,g=void 0===a?m:a(m);g!==m&&(f=g-u);const y=t=>-f*Math.exp(-t/i),v=t=>g+y(t),b=t=>{const e=y(t),n=v(t);d.done=Math.abs(e)<=h,d.value=d.done?g:n};let T,w;const x=t=>{var e;(e=d.value,void 0!==o&&e<o||void 0!==l&&e>l)&&(T=t,w=qe({keyframes:[d.value,p(d.value)],velocity:gn(v,t,d.value),damping:s,stiffness:r,restDelta:h,restSpeed:c}))};return x(0),{calculatedDuration:null,next:t=>{let e=!1;return w||void 0!==T||(e=!0,b(t),x(t)),void 0!==T&&t>=T?w.next(t-T):(!e&&b(t),d)}}}const vn=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function bn(t,e,n,i){if(t===e&&n===i)return c;const s=e=>function(t,e,n,i,s){let r,a,o=0;do{a=e+(n-e)/2,r=vn(a,i,s)-t,r>0?n=a:e=a}while(Math.abs(r)>1e-7&&++o<12);return a}(e,0,1,t,n);return t=>0===t||1===t?t:vn(s(t),e,i)}const Tn=bn(.42,0,1,1),wn=bn(0,0,.58,1),xn=bn(.42,0,.58,1),Mn=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Sn=t=>e=>1-t(1-e),An=bn(.33,1.53,.69,.99),En=Sn(An),Cn=Mn(En),kn=t=>t>=1?1:(t*=2)<1?.5*En(t):.5*(2-Math.pow(2,-10*(t-1))),Vn=t=>1-Math.sin(Math.acos(t)),Pn=Sn(Vn),Rn=Mn(Vn),Fn=t=>Array.isArray(t)&&"number"==typeof t[0],Dn={linear:c,easeIn:Tn,easeInOut:xn,easeOut:wn,circIn:Vn,circInOut:Rn,circOut:Pn,backIn:En,backInOut:Cn,backOut:An,anticipate:kn},_n=t=>{if(Fn(t)){t.length;const[e,n,i,s]=t;return bn(e,n,i,s)}return"string"==typeof t?Dn[t]:t};function Bn({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const s=Je(i)?i.map(_n):_n(i),r={done:!1,value:e[0]},a=function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:Ut(e),t),o=Wt(a,e,{ease:Array.isArray(s)?s:(l=e,h=s,l.map(()=>h||xn).splice(0,l.length-1))});var l,h;return{calculatedDuration:t,next:e=>(r.value=o(e),r.done=e>=t,r)}}const On=t=>null!==t;function In(t,{repeat:e,repeatType:n="loop"},i,s=1){const r=t.filter(On),a=s<0||e&&"loop"!==n&&e%2==1?0:r.length-1;return a&&void 0!==i?i:r[a]}const Ln={decay:yn,inertia:yn,tween:Bn,keyframes:Bn,spring:qe};function jn(t){"string"==typeof t.type&&(t.type=Ln[t.type])}class $n{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const Wn=t=>t/100;class Nn extends $n{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==Te.now()&&this.tick(Te.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},fn.mainThread++,this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;jn(t);const{type:e=Bn,repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:r=0}=t;let{keyframes:a}=t;const o=e||Bn;o!==Bn&&"number"!=typeof a[0]&&(this.mixKeyframes=z(Wn,$t(a[0],a[1])),a=[0,100]);const l=o({...t,keyframes:a});"mirror"===s&&(this.mirroredGenerator=o({...t,keyframes:[...a].reverse(),velocity:-r})),null===l.calculatedDuration&&(l.calculatedDuration=ke(l));const{calculatedDuration:h}=l;this.calculatedDuration=h,this.resolvedDuration=h+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=l}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:i,mixKeyframes:s,mirroredGenerator:r,resolvedDuration:a,calculatedDuration:o}=this;if(null===this.startTime)return n.next(0);const{delay:l=0,keyframes:h,repeat:c,repeatType:u,repeatDelay:d,type:p,onUpdate:f,finalKeyframe:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const g=this.currentTime-l*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?g<0:g>i;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);let v=this.currentTime,b=n;if(c){const t=Math.min(this.currentTime,i)/a;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,c+1);Boolean(e%2)&&("reverse"===u?(n=1-n,d&&(n-=d/a)):"mirror"===u&&(b=r)),v=K(0,1,n)*a}const T=y?{done:!1,value:h[0]}:b.next(v);s&&!y&&(T.value=s(T.value));let{done:w}=T;y||null===o||(w=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const x=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return x&&p!==yn&&(T.value=In(h,this.options,m,this.speed)),f&&f(T.value),x&&this.finish(),T}then(t,e){return this.finished.then(t,e)}get duration(){return Ae(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Ae(t)}get time(){return Ae(this.currentTime)}set time(t){t=Se(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);return gn(t=>this.generator.next(t).value,t,this.generator.next(t).value)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;e&&this.driver&&this.updateTime(Te.now()),this.playbackSpeed=t,e&&this.driver&&(this.time=Ae(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=mn,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=e??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Te.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null,fn.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}const Un=t=>180*t/Math.PI,Xn=t=>{const e=Un(Math.atan2(t[1],t[0]));return Kn(e)},zn={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Xn,rotateZ:Xn,skewX:t=>Un(Math.atan(t[1])),skewY:t=>Un(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Kn=t=>((t%=360)<0&&(t+=360),t),Hn=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Yn=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),qn={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Hn,scaleY:Yn,scale:t=>(Hn(t)+Yn(t))/2,rotateX:t=>Kn(Un(Math.atan2(t[6],t[5]))),rotateY:t=>Kn(Un(Math.atan2(-t[2],t[0]))),rotateZ:Xn,rotate:Xn,skewX:t=>Un(Math.atan(t[4])),skewY:t=>Un(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Gn(t){return t.includes("scale")?1:0}function Zn(t,e){if(!t||"none"===t)return Gn(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=qn,s=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=zn,s=e}if(!s)return Gn(e);const r=i[e],a=s[1].split(",").map(Jn);return"function"==typeof r?r(a):a[r]}function Jn(t){return parseFloat(t.trim())}const Qn=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ti=(()=>new Set(Qn))(),ei=t=>t===Q||t===pt,ni=new Set(["x","y","z"]),ii=Qn.filter(t=>!ni.has(t));const si={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:i})=>{const s=t.max-t.min;return"border-box"===i?s:s-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:i})=>{const s=t.max-t.min;return"border-box"===i?s:s-parseFloat(e)-parseFloat(n)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Zn(e,"x"),y:(t,{transform:e})=>Zn(e,"y")};si.translateX=si.x,si.translateY=si.y;const ri=new Set;let ai=!1,oi=!1,li=!1;function hi(){if(oi){const t=Array.from(ri).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),n=new Map;e.forEach(t=>{const e=function(t){const e=[];return ii.forEach(n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}(t);e.length&&(n.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=n.get(t);e&&e.forEach(([e,n])=>{t.getValue(e)?.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}oi=!1,ai=!1,ri.forEach(t=>t.complete(li)),ri.clear()}function ci(){ri.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(oi=!0)})}class ui{constructor(t,e,n,i,s,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=i,this.element=s,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?(ri.add(this),ai||(ai=!0,m.read(ci),m.resolveKeyframes(hi))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;if(null===t[0]){const s=i?.get(),r=t[t.length-1];if(void 0!==s)t[0]=s;else if(n&&e){const i=n.readValue(e,r);null!=i&&(t[0]=i)}void 0===t[0]&&(t[0]=r),i&&void 0===s&&i.set(t[0])}!function(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),ri.delete(this)}cancel(){"scheduled"===this.state&&(ri.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}function di(t,e,n){(t=>t.startsWith("--"))(e)?t.style.setProperty(e,n):t.style[e]=n}const pi=x(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),fi=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,mi={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:fi([0,.65,.55,1]),circOut:fi([.55,0,1,.45]),backIn:fi([.31,.01,.66,-.59]),backOut:fi([.33,1.53,.69,.99])};function gi(t,e){return t?"function"==typeof t?pi()?Ee(t,e):"ease-out":Fn(t)?fi(t):Array.isArray(t)?t.map(t=>gi(t,e)||mi.easeOut):mi[t]:void 0}function yi(t,e,n,{delay:i=0,duration:s=300,repeat:r=0,repeatType:a="loop",ease:o="easeOut",times:l}={},h=void 0){const c={[e]:n};l&&(c.offset=l);const u=gi(o,s);Array.isArray(u)&&(c.easing=u),p.value&&fn.waapi++;const d={delay:i,duration:s,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:r+1,direction:"reverse"===a?"alternate":"normal"};h&&(d.pseudoElement=h);const f=t.animate(c,d);return p.value&&f.finished.finally(()=>{fn.waapi--}),f}class vi extends $n{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:n,keyframes:i,pseudoElement:s,allowFlatten:r=!1,finalKeyframe:a,onComplete:o}=t;this.isPseudoElement=Boolean(s),this.allowFlatten=r,this.options=t,t.type;const l=function({type:t,...e}){return Ge(t)&&pi()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=yi(e,n,i,l,s),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const t=In(i,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(t),di(e,n,t),this.animation.cancel()}o?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return Ae(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Ae(t)}get time(){return Ae(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Se(t),e&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:e,rangeEnd:n,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&M()?(this.animation.timeline=t,e&&(this.animation.rangeStart=e),n&&(this.animation.rangeEnd=n),c):i(this)}}const bi={anticipate:kn,backInOut:Cn,circInOut:Rn};function Ti(t){"string"==typeof t.ease&&t.ease in bi&&(t.ease=bi[t.ease])}class wi extends vi{constructor(t){Ti(t),jn(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:i,element:s,...r}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const a=new Nn({...r,autoplay:!1}),o=Math.max(10,Te.now()-this.startTime),l=K(0,10,o-10),h=a.sample(o).value,{name:c}=this.options;s&&c&&di(s,c,h),e.setWithVelocity(a.sample(Math.max(0,o-l)).value,h,l),a.stop()}}const xi=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Et.test(t)&&"0"!==t||t.startsWith("url(")));function Mi(t){t.duration=0,t.type="keyframes"}const Si=new Set(["opacity","clipPath","filter","transform"]),Ai=T(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class Ei extends $n{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:r="loop",keyframes:a,name:o,motionValue:l,element:h,...c}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Te.now();const u={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:s,repeatType:r,name:o,motionValue:l,element:h,...c},d=h?.KeyframeResolver||ui;this.keyframeResolver=new d(a,(t,e,n)=>this.onKeyframesResolved(t,e,u,!n),o,l,h),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,e,n,i){this.keyframeResolver=void 0;const{name:s,type:r,velocity:a,delay:o,isHandoff:l,onUpdate:h}=n;this.resolvedAt=Te.now();let d=!0;(function(t,e,n,i){const s=t[0];if(null===s)return!1;if("display"===e||"visibility"===e)return!0;const r=t[t.length-1],a=xi(s,e),o=xi(r,e);return!(!a||!o)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}(t)||("spring"===n||Ge(n))&&i)})(t,s,r,a)||(d=!1,!u.instantAnimations&&o||h?.(In(t,n,e)),t[0]=t[t.length-1],Mi(n),n.repeat=0);const p={startTime:i?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:e,...n,keyframes:t},f=d&&!l&&function(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:r,type:a}=t,o=e?.owner?.current;if(!(o instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:h}=e.owner.getProps();return Ai()&&n&&Si.has(n)&&("transform"!==n||!h)&&!l&&!i&&"mirror"!==s&&0!==r&&"inertia"!==a}(p),m=p.motionValue?.owner?.current,g=f?new wi({...p,element:m}):new Nn(p);g.finished.then(()=>{this.notifyFinished()}).catch(c),this.pendingTimeline&&(this.stopTimeline=g.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=g}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),li=!0,ci(),hi(),li=!1),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function Ci(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function ki(t,e){const n=t?.[e]??t?.default??t;return n!==t?Ci(n,t):n}const Vi={type:"spring",stiffness:500,damping:25,restSpeed:10},Pi={type:"keyframes",duration:.8},Ri={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Fi=(t,{keyframes:e})=>e.length>2?Pi:ti.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Vi:Ri,Di=t=>null!==t;const _i=(t,e,n,i={},s,r)=>a=>{const o=ki(i,t)||{},l=o.delay||i.delay||0;let{elapsed:h=0}=i;h-=Se(l);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...o,delay:-h,onUpdate:t=>{e.set(t),o.onUpdate&&o.onUpdate(t)},onComplete:()=>{a(),o.onComplete&&o.onComplete()},name:t,motionValue:e,element:r?void 0:s};(function({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:s,repeat:r,repeatType:a,repeatDelay:o,from:l,elapsed:h,...c}){return!!Object.keys(c).length})(o)||Object.assign(c,Fi(t,c)),c.duration&&(c.duration=Se(c.duration)),c.repeatDelay&&(c.repeatDelay=Se(c.repeatDelay)),void 0!==c.from&&(c.keyframes[0]=c.from);let d=!1;if((!1===c.type||0===c.duration&&!c.repeatDelay)&&(Mi(c),0===c.delay&&(d=!0)),(u.instantAnimations||u.skipAnimations||s?.shouldSkipAnimations)&&(d=!0,Mi(c),c.delay=0),c.allowFlatten=!o.type&&!o.ease,d&&!r&&void 0!==e.get()){const t=function(t,{repeat:e,repeatType:n="loop"},i){const s=t.filter(Di),r=e&&"loop"!==n&&e%2==1?0:s.length-1;return r&&void 0!==i?i:s[r]}(c.keyframes,o);if(void 0!==t)return void m.update(()=>{c.onUpdate(t),c.onComplete()})}return o.isSync?new Nn(c):new Ei(c)};const Bi=new WeakMap,Oi=new Set(["width","height","top","left","right","bottom",...Qn]);function Ii(t){const e=[{},{}];return t?.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function Li(t,e,n,i){if("function"==typeof e){const[s,r]=Ii(i);e=e(void 0!==n?n:t.custom,s,r)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[s,r]=Ii(i);e=e(void 0!==n?n:t.custom,s,r)}return e}function ji(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Me(n))}function $i(t){return(t=>Array.isArray(t))(t)?t[t.length-1]||0:t}function Wi(t,e){const n=function(t,e,n){const i=t.getProps();return Li(i,e,void 0!==n?n:i.custom,t)}(t,e);let{transitionEnd:i={},transition:s={},...r}=n||{};r={...r,...i};for(const e in r){ji(t,e,$i(r[e]))}}function Ni(t,e){const n=t.getValue("willChange");if(i=n,Boolean(Ze(i)&&i.add))return n.add(e);if(!n&&u.WillChange){const n=new u.WillChange("auto");t.addValue("willChange",n),n.add(e)}var i}function Ui(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const Xi="data-"+Ui("framerAppearId");function zi(t){return t.props[Xi]}function Ki({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function Hi(t,e,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:r,transitionEnd:a,...o}=e;const l=t.getDefaultTransition();r=r?Ci(r,l):l;const h=r?.reduceMotion;i&&(r=i);const c=[],u=s&&t.animationState&&t.animationState.getState()[s];for(const e in o){const i=t.getValue(e,t.latestValues[e]??null),s=o[e];if(void 0===s||u&&Ki(u,e))continue;const a={delay:n,...ki(r||{},e)},l=i.get();if(void 0!==l&&!i.isAnimating&&!Array.isArray(s)&&s===l&&!a.velocity)continue;let d=!1;if(window.MotionHandoffAnimation){const n=zi(t);if(n){const t=window.MotionHandoffAnimation(n,e,m);null!==t&&(a.startTime=t,d=!0)}}Ni(t,e);const p=h??t.shouldReduceMotion;i.start(_i(e,i,s,p&&Oi.has(e)?{type:!1}:a,t,d));const f=i.animation;f&&c.push(f)}if(a){const e=()=>m.update(()=>{a&&Wi(t,a)});c.length?Promise.all(c).then(e):e()}return c}const Yi=new Set(["brightness","contrast","saturate","opacity"]);function qi(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(it)||[];if(!i)return t;const s=n.replace(i,"");let r=Yi.has(e)?1:0;return i!==n&&(r*=100),e+"("+r+s+")"}const Gi=/\b([a-z-]*)\(.*?\)/gu,Zi={...Et,getAnimatableNone:t=>{const e=t.match(Gi);return e?e.map(qi).join(" "):t}},Ji={...Et,getAnimatableNone:t=>{const e=Et.parse(t);return Et.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},Qi={...Q,transform:Math.round},ts={borderWidth:pt,borderTopWidth:pt,borderRightWidth:pt,borderBottomWidth:pt,borderLeftWidth:pt,borderRadius:pt,borderTopLeftRadius:pt,borderTopRightRadius:pt,borderBottomRightRadius:pt,borderBottomLeftRadius:pt,width:pt,maxWidth:pt,height:pt,maxHeight:pt,top:pt,right:pt,bottom:pt,left:pt,inset:pt,insetBlock:pt,insetBlockStart:pt,insetBlockEnd:pt,insetInline:pt,insetInlineStart:pt,insetInlineEnd:pt,padding:pt,paddingTop:pt,paddingRight:pt,paddingBottom:pt,paddingLeft:pt,paddingBlock:pt,paddingBlockStart:pt,paddingBlockEnd:pt,paddingInline:pt,paddingInlineStart:pt,paddingInlineEnd:pt,margin:pt,marginTop:pt,marginRight:pt,marginBottom:pt,marginLeft:pt,marginBlock:pt,marginBlockStart:pt,marginBlockEnd:pt,marginInline:pt,marginInlineStart:pt,marginInlineEnd:pt,fontSize:pt,backgroundPositionX:pt,backgroundPositionY:pt,...{rotate:ut,rotateX:ut,rotateY:ut,rotateZ:ut,scale:et,scaleX:et,scaleY:et,scaleZ:et,skew:ut,skewX:ut,skewY:ut,distance:pt,translateX:pt,translateY:pt,translateZ:pt,x:pt,y:pt,z:pt,perspective:pt,transformPerspective:pt,opacity:tt,originX:gt,originY:gt,originZ:pt},zIndex:Qi,fillOpacity:tt,strokeOpacity:tt,numOctaves:Qi},es={...ts,color:vt,backgroundColor:vt,outlineColor:vt,fill:vt,stroke:vt,borderColor:vt,borderTopColor:vt,borderRightColor:vt,borderBottomColor:vt,borderLeftColor:vt,filter:Zi,WebkitFilter:Zi,mask:Ji,WebkitMask:Ji},ns=t=>es[t],is=()=>({x:{min:0,max:0},y:{min:0,max:0}}),ss=t=>e=>e.test(t),rs=[Q,pt,dt,ut,mt,ft,{test:t=>"auto"===t,parse:t=>t}],as=t=>rs.find(ss(t)),os=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),ls=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function hs(t,e,n=1){const[i,s]=function(t){const e=ls.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}(t);if(!i)return;const r=window.getComputedStyle(e).getPropertyValue(i);if(r){const t=r.trim();return os(t)?parseFloat(t):t}return G(s)?hs(s,e,n+1):s}const cs=t=>/^0[^.\s]+$/u.test(t);function us(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||cs(t))}const ds=new Set([Zi,Ji]);function ps(t,e){let n=ns(t);return ds.has(n)||(n=Et),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const fs=new Set(["auto","none","0"]);class ms extends ui{constructor(t,e,n,i,s){super(t,e,n,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){let i=t[n];if("string"==typeof i&&(i=i.trim(),G(i))){const s=hs(i,e.current);void 0!==s&&(t[n]=s),n===t.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!Oi.has(n)||2!==t.length)return;const[i,s]=t,r=as(i),a=as(s);if(J(i)!==J(s)&&si[n])this.needsMeasurement=!0;else if(r!==a)if(ei(r)&&ei(a))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else si[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||us(t[e]))&&n.push(e);n.length&&function(t,e,n){let i,s=0;for(;s<t.length&&!i;){const e=t[s];"string"==typeof e&&!fs.has(e)&&Mt(e).values.length&&(i=t[s]),s++}if(i&&n)for(const s of e)t[s]=ps(n,i)}(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=si[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const i=e[e.length-1];void 0!==i&&t.getValue(n,i).jump(i,!1)}measureEndState(){const{element:t,name:e,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const i=t.getValue(e);i&&i.jump(this.measuredOrigin,!1);const s=n.length-1,r=n[s];n[s]=si[e](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==r&&void 0===this.finalKeyframe&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([e,n])=>{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const gs=new Set(["opacity","clipPath","filter","transform"]),{schedule:ys,cancel:vs}=f(queueMicrotask,!1),bs=[...rs,vt,Et];const Ts=["initial","animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"];function ws(t){return null!==(e=t.animate)&&"object"==typeof e&&"function"==typeof e.start||Ts.some(e=>function(t){return"string"==typeof t||Array.isArray(t)}(t[e]));var e}const xs={current:null},Ms={current:!1},Ss="undefined"!=typeof window;const As=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Es={};class Cs{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:i,skipAnimations:s,blockInitialAnimation:r,visualState:a},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=ui,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,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 t=Te.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,m.render(this.render,!1,!0))};const{latestValues:l,renderState:h}=a;this.latestValues=l,this.baseTarget={...l},this.initialValues=e.initial?{...l}:{},this.renderState=h,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=s,this.options=o,this.blockInitialAnimation=Boolean(r),this.isControllingVariants=ws(e),this.isVariantNode=function(t){return Boolean(ws(t)||t.variants)}(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:c,...u}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in u){const e=u[t];void 0!==l[t]&&Ze(e)&&e.set(l[t])}}mount(t){if(this.hasBeenMounted)for(const t in this.initialValues)this.values.get(t)?.jump(this.initialValues[t]),this.latestValues[t]=this.initialValues[t];this.current=t,Bi.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((t,e)=>this.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(Ms.current||function(){if(Ms.current=!0,Ss)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>xs.current=t.matches;t.addEventListener("change",e),e()}else xs.current=!1}(),this.shouldReduceMotion=xs.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),g(this.notifyUpdate),g(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),e.accelerate&&gs.has(t)&&this.current instanceof HTMLElement){const{factory:n,keyframes:i,times:s,ease:r,duration:a}=e.accelerate,o=new vi({element:this.current,name:t,keyframes:i,times:s,ease:r,duration:Se(a)}),l=n(o);return void this.valueSubscriptions.set(t,()=>{l(),o.cancel()})}const n=ti.has(t);n&&this.onBindTransform&&this.onBindTransform();const i=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&m.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{i(),s&&s(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in Es){const e=Es[t];if(!e)continue;const{isEnabled:n,Feature:i}=e;if(!this.features[t]&&i&&n(this.props)&&(this.features[t]=new i(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<As.length;e++){const n=As[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const i=t["on"+n];i&&(this.propEventSubscriptions[n]=this.on(n,i))}this.prevMotionValues=function(t,e,n){for(const i in e){const s=e[i],r=n[i];if(Ze(s))t.addValue(i,s);else if(Ze(r))t.addValue(i,Me(s,{owner:t}));else if(r!==s)if(t.hasValue(i)){const e=t.getValue(i);!0===e.liveStyle?e.jump(s):e.hasAnimated||e.set(s)}else{const e=t.getStaticValue(i);t.addValue(i,Me(void 0!==e?e:s,{owner:t}))}}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}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 e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=Me(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){let n=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var i;return null!=n&&("string"==typeof n&&(os(n)||cs(n))?n=parseFloat(n):(i=n,!bs.find(ss(i))&&Et.test(e)&&(n=ps(t,e))),this.setBaseTarget(t,Ze(n)?n.get():n)),Ze(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let n;if("string"==typeof e||"object"==typeof e){const i=Li(this.props,e,this.presenceContext?.custom);i&&(n=i[t])}if(e&&void 0!==n)return n;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||Ze(i)?void 0!==this.initialValues[t]&&void 0===n?void 0:this.baseTarget[t]:i}on(t,e){return this.events[t]||(this.events[t]=new ye),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){ys.render(this.render)}}class ks extends Cs{constructor(){super(...arguments),this.KeyframeResolver=ms}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){const n=t.style;return n?n[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Ze(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}const Vs=(t,e)=>e&&"number"==typeof t?e.transform(t):t,Ps={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Rs=Qn.length;function Fs(t,e,n){const{style:i,vars:s,transformOrigin:r}=t;let a=!1,o=!1;for(const t in e){const n=e[t];if(ti.has(t))a=!0;else if(Y(t))s[t]=n;else{const e=Vs(n,ts[t]);t.startsWith("origin")?(o=!0,r[t]=e):i[t]=e}}if(e.transform||(a||n?i.transform=function(t,e,n){let i="",s=!0;for(let r=0;r<Rs;r++){const a=Qn[r],o=t[a];if(void 0===o)continue;let l=!0;if("number"==typeof o)l=o===(a.startsWith("scale")?1:0);else{const t=parseFloat(o);l=a.startsWith("scale")?1===t:0===t}if(!l||n){const t=Vs(o,ts[a]);l||(s=!1,i+=`${Ps[a]||a}(${t}) `),n&&(e[a]=t)}}return i=i.trim(),n?i=n(e,s?"":i):s&&(i="none"),i}(e,t.transform,n):i.transform&&(i.transform="none")),o){const{originX:t="50%",originY:e="50%",originZ:n=0}=r;i.transformOrigin=`${t} ${e} ${n}`}}const Ds={offset:"stroke-dashoffset",array:"stroke-dasharray"},_s={offset:"strokeDashoffset",array:"strokeDasharray"};const Bs=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Os(t,{attrX:e,attrY:n,attrScale:i,pathLength:s,pathSpacing:r=1,pathOffset:a=0,...o},l,h,c){if(Fs(t,o,h),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:u,style:d}=t;u.transform&&(d.transform=u.transform,delete u.transform),(d.transform||u.transformOrigin)&&(d.transformOrigin=u.transformOrigin??"50% 50%",delete u.transformOrigin),d.transform&&(d.transformBox=c?.transformBox??"fill-box",delete u.transformBox);for(const t of Bs)void 0!==u[t]&&(d[t]=u[t],delete u[t]);void 0!==e&&(u.x=e),void 0!==n&&(u.y=n),void 0!==i&&(u.scale=i),void 0!==s&&function(t,e,n=1,i=0,s=!0){t.pathLength=1;const r=s?Ds:_s;t[r.offset]=""+-i,t[r.array]=`${e} ${n}`}(u,s,r,a,!1)}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 Ls(t,{style:e,vars:n},i,s){const r=t.style;let a;for(a in e)r[a]=e[a];for(a in s?.applyProjectionStyles(r,i),n)r.setProperty(a,n[a])}function js(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const $s={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!pt.test(t))return t;t=parseFloat(t)}return`${js(t,e.target.x)}% ${js(t,e.target.y)}%`}},Ws={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=Et.parse(t);if(s.length>5)return i;const r=Et.createTransformer(t),a="number"!=typeof s[0]?1:0,o=n.x.scale*e.x,l=n.y.scale*e.y;s[0+a]/=o,s[1+a]/=l;const h=Vt(o,l,.5);return"number"==typeof s[2+a]&&(s[2+a]/=h),"number"==typeof s[3+a]&&(s[3+a]/=h),r(s)}};const Ns={borderRadius:{...$s,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:$s,borderTopRightRadius:$s,borderBottomLeftRadius:$s,borderBottomRightRadius:$s,boxShadow:Ws};function Us(t,{layout:e,layoutId:n}){return ti.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!Ns[t]||"opacity"===t)}function Xs(t,e,n){const i=t.style,s=e?.style,r={};if(!i)return r;for(const e in i)(Ze(i[e])||s&&Ze(s[e])||Us(e,t)||void 0!==n?.getValue(e)?.liveStyle)&&(r[e]=i[e]);return r}class zs extends ks{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=is}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(ti.has(e)){const t=ns(e);return t&&t.default||0}return e=Is.has(e)?e:Ui(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return function(t,e,n){const i=Xs(t,e,n);for(const n in t)(Ze(t[n])||Ze(e[n]))&&(i[-1!==Qn.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]);return i}(t,e,n)}build(t,e,n){Os(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){!function(t,e,n,i){Ls(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(Is.has(n)?n:Ui(n),e.attrs[n])}(t,e,0,i)}mount(t){var e;this.isSVGTag="string"==typeof(e=t.tagName)&&"svg"===e.toLowerCase(),super.mount(t)}}function Ks(t,e){return function({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}(t.getBoundingClientRect(),e))}class Hs extends ks{constructor(){super(...arguments),this.type="html",this.renderInstance=Ls}readValueFromInstance(t,e){if(ti.has(e))return this.projection?.isProjecting?Gn(e):((t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Zn(n,e)})(t,e);{const i=(n=t,window.getComputedStyle(n)),s=(Y(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return Ks(t,e)}build(t,e,n){Fs(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return Xs(t,e,n)}}class Ys extends Cs{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(function(t,e){return t in e}(e,t)){const n=t[e];if("string"==typeof n||"number"==typeof n)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(t,e){delete e.output[t]}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}build(t,e){Object.assign(t.output,e)}renderInstance(t,{output:e}){Object.assign(t,e)}sortInstanceNodePosition(){return 0}}function qs(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=C(t)&&!function(t){return C(t)&&"svg"===t.tagName}(t)?new zs(e):new Hs(e);n.mount(t),Bi.set(t,n)}function Gs(t){const e=new Ys({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});e.mount(t),Bi.set(t,e)}function Zs(t,e,n,i){const s=[];if(function(t,e){return Ze(t)||"number"==typeof t||"string"==typeof t&&!tn(e)}(t,e))s.push(function(t,e,n){const i=Ze(t)?t:Me(t);return i.start(_i("",i,e,n)),i.animation}(t,tn(e)&&e.default||e,n&&n.default||n));else{if(null==t)return s;const r=en(t,e,i),a=r.length;Boolean(a);for(let t=0;t<a;t++){const i=r[t],o=i instanceof Element?qs:Gs;Bi.has(i)||o(i);const l=Bi.get(i),h={...n};"delay"in h&&"function"==typeof h.delay&&(h.delay=h.delay(t,a)),s.push(...Hi(l,{...e,transition:h},{}))}}return s}function Js(t,e,n){const i=[],s=function(t,{defaultTransition:e={},...n}={},i,s){const r=e.duration||.3,a=new Map,o=new Map,l={},h=new Map;let c=0,u=0,d=0;for(let n=0;n<t.length;n++){const a=t[n];if("string"==typeof a){h.set(a,u);continue}if(!Array.isArray(a)){h.set(a.name,sn(u,a.at,c,h));continue}let[p,f,m={}]=a;void 0!==m.at&&(u=sn(u,m.at,c,h));let g=0;const y=(t,n,i,a=0,o=0)=>{const l=cn(t),{delay:h=0,times:c=Ut(l),type:p=e.type||"keyframes",repeat:f,repeatType:m,repeatDelay:y=0,...v}=n;let{ease:b=e.ease||"easeOut",duration:T}=n;const w="function"==typeof h?h(a,o):h,x=l.length,M=Ge(p)?p:s?.[p||"keyframes"];if(x<=2&&M){let t=100;if(2===x&&pn(l)){const e=l[1]-l[0];t=Math.abs(e)}const n={...e,...v};void 0!==T&&(n.duration=Se(T));const i=Ve(n,t,M);b=i.ease,T=i.duration}T??(T=r);const S=u+w;1===c.length&&0===c[0]&&(c[1]=1);const A=c.length-l.length;if(A>0&&Nt(c,A),1===l.length&&l.unshift(null),f){T=nn(T,f);const t=[...l],e=[...c];b=Array.isArray(b)?[...b]:[b];const n=[...b];for(let i=0;i<f;i++){l.push(...t);for(let s=0;s<t.length;s++)c.push(e[s]+(i+1)),b.push(0===s?"linear":Qe(n,s-1))}an(c,f)}const E=S+T;rn(i,l,b,c,S,E),g=Math.max(w+T,g),d=Math.max(E,d)};if(Ze(p))y(f,m,hn("default",ln(p,o)));else{const t=en(p,f,i,l),e=t.length;for(let n=0;n<e;n++){const i=ln(t[n],o);for(const t in f)y(f[t],un(m,t),hn(t,i),n,e)}}c=u,u+=g}return o.forEach((t,i)=>{for(const s in t){const r=t[s];r.sort(on);const o=[],l=[],h=[];for(let t=0;t<r.length;t++){const{at:e,value:n,easing:i}=r[t];o.push(n),l.push($(0,d,e)),h.push(i||"easeOut")}0!==l[0]&&(l.unshift(0),o.unshift(o[0]),h.unshift("easeInOut")),1!==l[l.length-1]&&(l.push(1),o.push(null)),a.has(i)||a.set(i,{keyframes:{},transition:{}});const c=a.get(i);c.keyframes[s]=o;const{type:u,...p}=e;c.transition[s]={...p,duration:d,ease:h,times:l,...n}}}),a}(t.map(t=>{if(Array.isArray(t)&&"function"==typeof t[0]){const e=t[0],n=Me(0);return n.on("change",e),1===t.length?[n,[0,1]]:2===t.length?[n,[0,1],t[1]]:[n,t[1],t[2]]}return t}),e,n,{spring:qe});return s.forEach(({keyframes:t,transition:e},n)=>{i.push(...Zs(n,t,e))}),i}const Qs=function(t={}){const{scope:e,reduceMotion:n}=t;return function(t,i,s){let r,a=[];if(o=t,Array.isArray(o)&&o.some(Array.isArray)){const{onComplete:s,...o}=i||{};"function"==typeof s&&(r=s),a=Js(t,void 0!==n?{reduceMotion:n,...o}:o,e)}else{const{onComplete:o,...l}=s||{};"function"==typeof o&&(r=o),a=Zs(t,i,void 0!==n?{reduceMotion:n,...l}:l,e)}var o;const l=new me(a);return r&&l.finished.then(r),e&&(e.animations.push(l),l.finished.then(()=>{ge(e.animations,l)})),l}}();var tr=function(t,e,n,i){return new(n||(n=Promise))(function(s,r){function a(t){try{l(i.next(t))}catch(t){r(t)}}function o(t){try{l(i.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?s(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(a,o)}l((i=i.apply(t,e||[])).next())})};class er{constructor(t,e={}){this.engine=null,this.syncedAnimations=[],this.destroyed=!1,this.container=t,this.options=Object.assign({scrub:0},e),this.injectStyles()}injectStyles(){if(er.stylesInjected)return;const t=document.createElement("style");t.id="stube-base-styles",t.innerHTML='\n .stube-layer {\n position: absolute;\n inset: 0;\n pointer-events: none;\n display: grid;\n grid-template-areas: "content";\n }\n .stube-layer > * {\n grid-area: content;\n pointer-events: auto;\n }\n /* Alignment Mappings */\n .stube-layer[data-stube-align^="top"] { align-items: start; }\n .stube-layer[data-stube-align^="center"] { align-items: center; }\n .stube-layer[data-stube-align^="bottom"] { align-items: end; }\n \n .stube-layer[data-stube-align$="left"] { justify-items: start; }\n .stube-layer[data-stube-align$="center"] { justify-items: center; }\n .stube-layer[data-stube-align$="right"] { justify-items: end; }\n ',document.head.appendChild(t),er.stylesInjected=!0}static initAll(){return tr(this,void 0,void 0,function*(){const t=document.querySelectorAll(".stube-container"),e=[];for(let n=0;n<t.length;n++){const i=t[n],s=new er(i,{scrub:.5});yield s.init(),e.push(s)}return e})}init(){return tr(this,void 0,void 0,function*(){if(this.destroyed)return;const t=this.container.querySelector(".stube-canvas");if(!t)return void console.warn("[CoreOrchestrator] No .stube-canvas found inside container.");const e=t.dataset.stubeCanvas||t.getAttribute("data-project");if(!e)return void console.warn('[CoreOrchestrator] No project URL found on .stube-canvas. Use data-stube-canvas="url"');const n=t.dataset.stubeDepthtilt||t.getAttribute("data-stube-depthtilt");null!=n&&(this.options.depthTilt=parseFloat(n)),this.engine=yield this.loadEngine(e,t),this.destroyed||(this.parseAnimatedElements(),this.setupScrollTracking(),this.engine.onFrameChange=(t,e)=>{this.syncTrackingLayers(t),this.onFrameChange&&this.onFrameChange(t,e)},this.engine.onProgressUpdate=t=>{this.syncAnimations(t)})})}loadEngine(t,e){return tr(this,void 0,void 0,function*(){let n;try{if(t.trim().startsWith("{"))n=JSON.parse(t);else{const e=yield fetch(t);if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);n=yield e.json()}}catch(t){throw console.error("[CoreOrchestrator] Failed to load configuration:",t),t}n.settings||(n.settings={baseResolution:{width:1920,height:1080},scrollMode:"vh"}),n.settings.basePath||t.trim().startsWith("{")||(n.settings.basePath=t.substring(0,t.lastIndexOf("/")));const i=new h(n,{scrub:this.options.scrub,depthTilt:this.options.depthTilt});let s=e.querySelector("canvas");return s||(s=document.createElement("canvas"),s.style.width="100%",s.style.height="100%",s.style.display="block",s.style.objectFit="cover",e.appendChild(s)),i.attachCanvas(s),i})}setupScrollTracking(){if(!this.engine)return;const t=this.container.dataset.stubeOffset;let e=["start end","end start"];try{t&&(e=JSON.parse(t))}catch(t){}this.motionScrollCancel=de(t=>{this.engine&&this.engine.update(t)},{target:this.container,offset:e})}parseAnimatedElements(){this.container.querySelectorAll("[data-stube-animate]").forEach(t=>{try{const e=t.getAttribute("data-stube-animate");if(!e)return;const n=JSON.parse(e),i=Qs(t,n,{duration:1,ease:"linear"});i.pause(),i.time=0,this.syncedAnimations.push(i)}catch(e){console.warn("[CoreOrchestrator] Failed to parse data-stube-animate on element",t,e)}})}syncAnimations(t){for(const e of this.syncedAnimations)e.time=t}syncTrackingLayers(t){if(!this.engine)return;this.container.querySelectorAll("[data-stube-layer-tracking]").forEach(e=>tr(this,void 0,void 0,function*(){const n=e.dataset.stubeLayerTracking;if(!n)return;yield this.engine.loadTrackingData(n);const i=this.engine.getTrackedCoords(n,t);e.style.left=100*i.x+"%",e.style.top=100*i.y+"%"}))}getEngine(){return this.engine}destroy(){this.destroyed=!0,this.motionScrollCancel&&(this.motionScrollCancel(),this.motionScrollCancel=void 0);for(const t of this.syncedAnimations)t.stop();this.syncedAnimations=[],this.engine&&(this.engine.destroy(),this.engine=null),this.onFrameChange=void 0}}er.stylesInjected=!1;Object.assign(h,{CoreOrchestrator:er});var nr=function(t,e,n,i){return new(n||(n=Promise))(function(s,r){function a(t){try{l(i.next(t))}catch(t){r(t)}}function o(t){try{l(i.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?s(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(a,o)}l((i=i.apply(t,e||[])).next())})};const ir=(0,a.createContext)(null),sr=({type:t="sticky",containerHeight:e="400vh",sceneHeight:n="100vh",sceneTop:i=0,offset:s=["start end","end start"],scrub:o=0,children:l})=>{var h;const[c,u]=(0,a.useState)({progress:0,frame:-1}),[d,p]=(0,a.useState)(!1),f=(0,a.useRef)(null),m=(0,a.useRef)(null),g=JSON.stringify(s);(0,a.useEffect)(()=>{let t=!0;if(!f.current)return;const e=setTimeout(()=>{nr(void 0,void 0,void 0,function*(){const e=new er(f.current,{scrub:o});m.current=e,e.onFrameChange=(e,n)=>{t&&u({frame:e,progress:n})},yield e.init(),t&&p(!0)})},0);return()=>{t=!1,clearTimeout(e),m.current&&(m.current.destroy(),m.current=null)}},[o,g]);const y=(null===(h=m.current)||void 0===h?void 0:h.getEngine())||null;return(0,r.jsx)(ir.Provider,{value:Object.assign(Object.assign({},c),{engine:y}),children:(0,r.jsx)("div",{ref:f,className:"stube-container",style:{position:"relative",height:e},"data-stube-offset":g,children:(0,r.jsx)("div",{className:"stube-container_inner_sticky",style:{position:"sticky",top:i,height:n,overflow:"hidden"},children:l})})})},rr=({project:t,depthtilt:e,width:n="100%",height:i="100%",style:s})=>{const{engine:o}=hr(),l=void 0!==e?Number(e):4;return(0,a.useEffect)(()=>{o&&o.setDepthTilt(l)},[o,l]),(0,r.jsx)("div",{className:"stube-canvas","data-stube-canvas":t,"data-stube-depthtilt":l,style:Object.assign({width:n,height:i,pointerEvents:"auto"},s)})},ar=({align:t,style:e,children:n})=>(0,r.jsx)("div",{className:"stube-layer","data-stube-align":t,style:e,children:n}),or=({id:t="main",offset:e={x:0,y:0},style:n,children:i})=>{const s=(0,a.useContext)(ir);if((0,a.useEffect)(()=>{(null==s?void 0:s.engine)&&s.engine.loadTrackingData(t)},[null==s?void 0:s.engine,t]),!s)return null;const o=Object.assign(Object.assign(Object.assign({position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",pointerEvents:"auto",zIndex:10},n),0!==e.x?{marginLeft:`${e.x}px`}:{}),0!==e.y?{marginTop:`${e.y}px`}:{});return(0,r.jsx)("div",{className:"stube-layer-tracking","data-stube-layer-tracking":t,style:o,children:i})},lr=or,hr=()=>{const t=(0,a.useContext)(ir);if(!t)throw new Error("useScrollTube must be used within a ScrollTubeProvider");return t};return s})());
14
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports.ScrollTubeReact=e(require("react")):t.ScrollTubeReact=e(t.react)}(this,t=>(()=>{"use strict";var e={698(t,e){var n=Symbol.for("react.transitional.element");function i(t,e,i){var s=null;if(void 0!==i&&(s=""+i),void 0!==e.key&&(s=""+e.key),"key"in e)for(var r in i={},e)"key"!==r&&(i[r]=e[r]);else i=e;return e=i.ref,{$$typeof:n,type:t,key:s,ref:void 0!==e?e:null,props:i}}Symbol.for("react.fragment"),e.jsx=i},848(t,e,n){t.exports=n(698)},155(e){e.exports=t}},n={};function i(t){var s=n[t];if(void 0!==s)return s.exports;var r=n[t]={exports:{}};return e[t](r,r.exports,i),r.exports}i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var s={};i.r(s),i.d(s,{ScrollTubeCanvas:()=>hr,ScrollTubeLayer:()=>cr,ScrollTubeLayerTracking:()=>ur,ScrollTubeProvider:()=>lr,SubjectLayer:()=>dr,useScrollTube:()=>pr});var r=i(848),a=i(155);class o{constructor(t,e={}){if(this.targetMouse={x:0,y:0},this.currentMouse={x:0,y:0},this.animationFrameId=0,this.depthTilt=.04,this.animate=()=>{if(this.currentMouse.x+=.1*(this.targetMouse.x-this.currentMouse.x),this.currentMouse.y+=.1*(this.targetMouse.y-this.currentMouse.y),this.gl&&this.program){this.gl.useProgram(this.program);const t=this.gl.getUniformLocation(this.program,"u_mouse");this.gl.uniform2f(t,this.currentMouse.x,this.currentMouse.y);const e=this.gl.getUniformLocation(this.program,"u_depthTilt");this.gl.uniform1f(e,this.depthTilt),this.draw()}this.animationFrameId=requestAnimationFrame(this.animate)},this.depthTilt=void 0!==e.depthTilt?e.depthTilt:4,this.gl=t.getContext("webgl",{alpha:!1,antialias:!1}),!this.gl)throw new Error("WebGL not supported");this.program=this.createProgram("\n attribute vec2 a_position;\n varying vec2 v_texCoord;\n void main() {\n gl_Position = vec4(a_position, 0.0, 1.0);\n // Convert -1 -> 1 to 0 -> 1 for UVs\n v_texCoord = a_position * 0.5 + 0.5;\n v_texCoord.y = 1.0 - v_texCoord.y;\n }\n ","\n precision mediump float;\n uniform sampler2D u_image;\n uniform sampler2D u_depthMap;\n uniform vec2 u_resolution;\n uniform vec2 u_imageResolution;\n uniform vec2 u_mouse;\n uniform float u_depthTilt;\n uniform bool u_hasDepth;\n varying vec2 v_texCoord;\n\n void main() {\n // object-fit: cover math\n vec2 ratio = vec2(\n min((u_resolution.x / u_resolution.y) / (u_imageResolution.x / u_imageResolution.y), 1.0),\n min((u_resolution.y / u_resolution.x) / (u_imageResolution.y / u_imageResolution.x), 1.0)\n );\n vec2 uv = vec2(\n v_texCoord.x * ratio.x + (1.0 - ratio.x) * 0.5,\n v_texCoord.y * ratio.y + (1.0 - ratio.y) * 0.5\n );\n\n if (u_hasDepth) {\n float depth = texture2D(u_depthMap, uv).r;\n // White is close (1), Black is far (0).\n // By making the background move and the foreground stay still (using 1.0 - depth)\n // and subtracting the parallax, the background pulls the foreground over itself,\n // expanding the edges and creating proper occlusion, instead of collapsing/tearing.\n // depthTilt is scaled by 0.01 internally (so 100 = 1.0 peak displacement)\n vec2 parallax = u_mouse * (1.0 - depth) * (u_depthTilt * 0.01);\n uv -= parallax;\n }\n \n gl_FragColor = texture2D(u_image, uv);\n }\n "),this.gl.useProgram(this.program),this.positionBuffer=this.gl.createBuffer(),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.positionBuffer),this.gl.bufferData(this.gl.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),this.gl.STATIC_DRAW),this.texture=this.gl.createTexture(),this.depthTexture=this.gl.createTexture(),window.addEventListener("mousemove",t=>{this.targetMouse.x=t.clientX/window.innerWidth*2-1,this.targetMouse.y=t.clientY/window.innerHeight*2-1}),this.animate()}setDepthTilt(t){this.depthTilt=t}createProgram(t,e){const n=this.gl.createShader(this.gl.VERTEX_SHADER);this.gl.shaderSource(n,t),this.gl.compileShader(n);const i=this.gl.createShader(this.gl.FRAGMENT_SHADER);this.gl.shaderSource(i,e),this.gl.compileShader(i);const s=this.gl.createProgram();return this.gl.attachShader(s,n),this.gl.attachShader(s,i),this.gl.linkProgram(s),s}render(t,e,n,i){this.gl.useProgram(this.program),this.gl.activeTexture(this.gl.TEXTURE0),this.gl.bindTexture(this.gl.TEXTURE_2D,this.texture),this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,this.gl.RGBA,this.gl.UNSIGNED_BYTE,t),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.LINEAR),this.gl.activeTexture(this.gl.TEXTURE1),this.gl.bindTexture(this.gl.TEXTURE_2D,this.depthTexture),e&&(this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,this.gl.RGBA,this.gl.UNSIGNED_BYTE,e),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.LINEAR)),this.gl.uniform1i(this.gl.getUniformLocation(this.program,"u_image"),0),this.gl.uniform1i(this.gl.getUniformLocation(this.program,"u_depthMap"),1),this.gl.uniform1i(this.gl.getUniformLocation(this.program,"u_hasDepth"),e?1:0),this.gl.uniform2f(this.gl.getUniformLocation(this.program,"u_resolution"),n,i),this.gl.uniform2f(this.gl.getUniformLocation(this.program,"u_imageResolution"),t.naturalWidth,t.naturalHeight);const s=this.gl.getAttribLocation(this.program,"a_position");this.gl.enableVertexAttribArray(s),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.positionBuffer),this.gl.vertexAttribPointer(s,2,this.gl.FLOAT,!1,0,0),this.gl.viewport(0,0,n,i),this.draw()}draw(){this.gl.drawArrays(this.gl.TRIANGLES,0,6)}destroy(){cancelAnimationFrame(this.animationFrameId)}}var l=function(t,e,n,i){return new(n||(n=Promise))(function(s,r){function a(t){try{l(i.next(t))}catch(t){r(t)}}function o(t){try{l(i.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?s(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(a,o)}l((i=i.apply(t,e||[])).next())})};console.log("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");class h{constructor(t,e={}){this.currentFrame=-1,this.activeVariant=null,this.canvas=null,this.ctx=null,this.renderer=null,this.basePath="",this.scrub=0,this.depthTilt=4,this.targetProgress=0,this.currentProgress=0,this.rafId=0,this.destroyed=!1,this.imageCache=new Map,this.depthCache=new Map,this.scrollTimeout=null,this.trackingDataCache=new Map,this.config=t,this.basePath=t.settings.basePath||"",this.scrub=void 0!==e.scrub?e.scrub:0,this.depthTilt=void 0!==e.depthTilt?e.depthTilt:4,this.detectBestVariant(),this.boundResize=()=>{this.detectBestVariant(),this.resizeCanvas(),this.render()},window.addEventListener("resize",this.boundResize),this.updateLoop=this.updateLoop.bind(this),this.rafId=requestAnimationFrame(this.updateLoop)}destroy(){this.destroyed=!0,this.rafId&&cancelAnimationFrame(this.rafId),window.removeEventListener("resize",this.boundResize),this.scrollTimeout&&clearTimeout(this.scrollTimeout),this.clearCache(),this.trackingDataCache.clear(),this.canvas=null,this.ctx=null,this.renderer=null,this.onFrameChange=void 0}static init(t,e){return l(this,void 0,void 0,function*(){const n=yield fetch(e);if(!n.ok)throw new Error(`Failed to load config: ${n.statusText}`);const i=yield n.json(),s=e.substring(0,e.lastIndexOf("/"));i.settings||(i.settings={baseResolution:{width:1920,height:1080},scrollMode:"vh"}),i.settings.basePath=i.settings.basePath||s;const r=new h(i,{scrub:"object"==typeof i.settings?i.settings.scrub:0});let a=t.querySelector("canvas");return a||(a=document.createElement("canvas"),a.style.width="100%",a.style.height="100%",a.style.display="block",a.style.objectFit="cover",t.appendChild(a)),r.attachCanvas(a),r})}attachCanvas(t){this.canvas=t;try{this.renderer=new o(t,{depthTilt:this.depthTilt})}catch(e){console.warn("WebGL failed, falling back to 2D",e),this.ctx=t.getContext("2d",{alpha:!1})}this.resizeCanvas(),this.render()}resizeCanvas(){if(!this.canvas)return;const t=this.canvas.getBoundingClientRect(),e=t.width,n=t.height,i=window.devicePixelRatio||1;this.canvas.width=e*i,this.canvas.height=n*i,this.ctx&&this.ctx.scale(i,i)}detectBestVariant(){var t;const e=this.config.assets[0];if(!e)return;const n=this.canvas?this.canvas.getBoundingClientRect():{width:window.innerWidth,height:window.innerHeight},i=n.height>n.width,s=n.width*(window.devicePixelRatio||1),r=e.variants.filter(t=>{const e="portrait"===t.orientation||parseInt(t.aspectRatio.split(":")[1])>parseInt(t.aspectRatio.split(":")[0]);return i===e});r.sort((t,e)=>t.frameCount-e.frameCount);const a=r.find(t=>t.width>=s)||r[r.length-1];a?(null===(t=this.activeVariant)||void 0===t?void 0:t.id)!==a.id&&(console.log(`🎯 Variant Switched: ${a.id} (${i?"Portrait":"Landscape"})`),this.activeVariant=a,this.clearCache(),this.preloadInitial()):console.warn("[CoreEngine] No suitable variant found")}clearCache(){this.imageCache.clear(),this.depthCache.clear()}preloadInitial(){for(let t=0;t<15;t++)this.getImage(t)}update(t){this.targetProgress=Math.max(0,Math.min(1,t))}setDepthTilt(t){this.depthTilt=t,this.renderer&&this.renderer.setDepthTilt(t)}updateLoop(){if(this.destroyed)return;this.rafId=requestAnimationFrame(this.updateLoop);const t=this.scrub;if(t>0){const e=Math.max(.01,1-t);this.currentProgress+=(this.targetProgress-this.currentProgress)*e}else this.currentProgress=this.targetProgress;Math.abs(this.targetProgress-this.currentProgress)<1e-4&&(this.currentProgress=this.targetProgress),this.onProgressUpdate&&this.onProgressUpdate(this.currentProgress),this.calculateFrame(this.currentProgress)}calculateFrame(t){const e=this.config.timeline.scenes[0];if(!e)return;const n=e.assetRange[1]-e.assetRange[0],i=Math.floor(e.assetRange[0]+t*n),s=Math.max(0,Math.min(i,e.assetRange[1]));s!==this.currentFrame&&(this.currentFrame=s,this.render(),this.getImage(this.currentFrame+5),this.getImage(this.currentFrame+10),this.scrollTimeout&&clearTimeout(this.scrollTimeout),this.scrollTimeout=setTimeout(()=>{this.loadDepthMap(this.currentFrame)},100),this.onFrameChange&&this.onFrameChange(this.currentFrame,t))}loadTrackingData(t){return l(this,void 0,void 0,function*(){var e;if(!this.activeVariant)return;if(!(null===(e=this.activeVariant.subjects)||void 0===e?void 0:e.includes(t)))return void console.warn(`[CoreEngine] Subject ${t} not found in active variant ${this.activeVariant.id}`);const n=`${this.activeVariant.id}_${t}`;if(!this.trackingDataCache.has(n))try{const e=`${this.basePath?`${this.basePath}/`:""}${this.activeVariant.path}/000_tracking-${t}.json`;console.log(`[CoreEngine] Fetching tracking data: ${e}`);const i=yield fetch(e);if(!i.ok)throw new Error(i.statusText);const s=yield i.json();this.trackingDataCache.set(n,s)}catch(e){console.error(`[CoreEngine] Failed to load tracking data for ${t}`,e)}})}getTrackedCoords(t,e){if(!this.activeVariant||!this.canvas)return{x:.5,y:.5};const n=`${this.activeVariant.id}_${t}`,i=this.trackingDataCache.get(n);if(!i)return{x:.5,y:.5};const s=i.find(t=>t.frame===e);if(!s)return{x:.5,y:.5};const r=this.canvas.clientWidth/this.canvas.clientHeight,a=this.activeVariant.width/this.activeVariant.height,o=Math.min(r/a,1),l=Math.min(1/r/(1/a),1);return{x:(s.x-.5)/o+.5,y:(s.y-.5)/l+.5,scale:s.scale}}render(){var t;if(!this.canvas||-1===this.currentFrame)return;const e=this.getImage(this.currentFrame);if(!e||!e.complete)return;const n=this.canvas.clientWidth,i=this.canvas.clientHeight;let s=null;if((null===(t=this.activeVariant)||void 0===t?void 0:t.hasDepthMap)&&(s=this.getDepthImage(this.currentFrame),s&&!s.complete&&(s=null)),this.renderer)this.renderer.render(e,s,n*(window.devicePixelRatio||1),i*(window.devicePixelRatio||1));else if(this.ctx){const t=e.naturalWidth/e.naturalHeight;let s,r,a,o;t>n/i?(r=i,s=i*t,a=(n-s)/2,o=0):(s=n,r=n/t,a=0,o=(i-r)/2),this.ctx.clearRect(0,0,n,i),this.ctx.drawImage(e,a,o,s,r)}}getImage(t){if(!this.activeVariant)return null;if(t<0||t>=this.activeVariant.frameCount)return null;const e=`${this.activeVariant.id}_${t}`;if(this.imageCache.has(e))return this.imageCache.get(e);const n=this.basePath?`${this.basePath}/`:"",i=new Image;return i.crossOrigin="anonymous",i.src=`${n}${this.activeVariant.path}/index_${t}.webp`,i.onload=()=>{this.currentFrame===t&&this.render()},this.imageCache.set(e,i),i}loadDepthMap(t){var e;if(!(null===(e=this.activeVariant)||void 0===e?void 0:e.hasDepthMap))return void console.log("[CoreEngine] activeVariant does not define hasDepthMap=true");console.log(`[CoreEngine] Lazy requesting depth map for frame: ${t}`);this.getDepthImage(t)}getDepthImage(t){var e;if(!(null===(e=this.activeVariant)||void 0===e?void 0:e.hasDepthMap))return null;if(t<0||t>=this.activeVariant.frameCount)return null;const n=`${this.activeVariant.id}_depth_${t}`;if(this.depthCache.has(n))return this.depthCache.get(n);const i=this.basePath?`${this.basePath}/`:"";console.log(`[CoreEngine] Downloading: ${i}${this.activeVariant.path}/index_${t}_depth.webp`);const s=new Image;return s.crossOrigin="anonymous",s.src=`${i}${this.activeVariant.path}/index_${t}_depth.webp`,s.onload=()=>{console.log(`[CoreEngine] Depth map loaded for frame: ${t}`),this.currentFrame===t&&this.render()},s.onerror=e=>{console.error(`[CoreEngine] Depth map failed to load for frame: ${t}`,e)},this.depthCache.set(n,s),s}}const c=t=>t,u={},d=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],p={value:null,addProjectionMetrics:null};function f(t,e){let n=!1,i=!0;const s={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,a=d.reduce((t,n)=>(t[n]=function(t,e){let n=new Set,i=new Set,s=!1,r=!1;const a=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1},l=0;function h(e){a.has(e)&&(c.schedule(e),t()),l++,e(o)}const c={schedule:(t,e=!1,r=!1)=>{const o=r&&s?n:i;return e&&a.add(t),o.add(t),t},cancel:t=>{i.delete(t),a.delete(t)},process:t=>{if(o=t,s)return void(r=!0);s=!0;const a=n;n=i,i=a,n.forEach(h),e&&p.value&&p.value.frameloop[e].push(l),l=0,n.clear(),s=!1,r&&(r=!1,c.process(t))}};return c}(r,e?n:void 0),t),{}),{setup:o,read:l,resolveKeyframes:h,preUpdate:c,update:f,preRender:m,render:g,postRender:y}=a,v=()=>{const r=u.useManualTiming,a=r?s.timestamp:performance.now();n=!1,r||(s.delta=i?1e3/60:Math.max(Math.min(a-s.timestamp,40),1)),s.timestamp=a,s.isProcessing=!0,o.process(s),l.process(s),h.process(s),c.process(s),f.process(s),m.process(s),g.process(s),y.process(s),s.isProcessing=!1,n&&e&&(i=!1,t(v))};return{schedule:d.reduce((e,r)=>{const o=a[r];return e[r]=(e,r=!1,a=!1)=>(n||(n=!0,i=!0,s.isProcessing||t(v)),o.schedule(e,r,a)),e},{}),cancel:t=>{for(let e=0;e<d.length;e++)a[d[e]].cancel(t)},state:s,steps:a}}const{schedule:m,cancel:g,state:y,steps:v}=f("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:c,!0);function b(t,e){let n;const i=()=>{const{currentTime:i}=e,s=(null===i?0:i.value)/100;n!==s&&t(s),n=s};return m.preUpdate(i,!0),()=>g(i)}function T(t){let e;return()=>(void 0===e&&(e=t()),e)}const w={};function x(t,e){const n=T(t);return()=>w[e]??n()}const M=x(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),S=x(()=>void 0!==window.ViewTimeline,"viewTimeline");function A(t){return"undefined"!=typeof window&&(t?S():M())}function C(t){return"object"==typeof t&&null!==t}function E(t){return C(t)&&"ownerSVGElement"in t}function k(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let i=document;e&&(i=e.current);const s=n?.[t]??i.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(t=>null!=t)}const V=new WeakMap;let P;const R=(t,e,n)=>(i,s)=>s&&s[0]?s[0][t+"Size"]:E(i)&&"getBBox"in i?i.getBBox()[e]:i[n],F=R("inline","width","offsetWidth"),D=R("block","height","offsetHeight");function _({target:t,borderBoxSize:e}){V.get(t)?.forEach(n=>{n(t,{get width(){return F(t,e)},get height(){return D(t,e)}})})}function B(t){t.forEach(_)}function I(t,e){P||"undefined"!=typeof ResizeObserver&&(P=new ResizeObserver(B));const n=k(t);return n.forEach(t=>{let n=V.get(t);n||(n=new Set,V.set(t,n)),n.add(e),P?.observe(t)}),()=>{n.forEach(t=>{const n=V.get(t);n?.delete(e),n?.size||P?.unobserve(t)})}}const O=new Set;let L;function j(t){return O.add(t),L||(L=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};O.forEach(e=>e(t))},window.addEventListener("resize",L)),()=>{O.delete(t),O.size||"function"!=typeof L||(window.removeEventListener("resize",L),L=void 0)}}const X=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i};function $(t,e){return e?t*(1e3/e):0}const W={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function N(t,e,n,i){const s=n[e],{length:r,position:a}=W[e],o=s.current,l=n.time;s.current=Math.abs(t[`scroll${a}`]),s.scrollLength=t[`scroll${r}`]-t[`client${r}`],s.offset.length=0,s.offset[0]=0,s.offset[1]=s.scrollLength,s.progress=X(0,s.scrollLength,s.current);const h=i-l;s.velocity=h>50?0:$(s.current-o,h)}const U=(t,e)=>n=>e(t(n)),z=(...t)=>t.reduce(U);const K=(t,e,n)=>n>e?e:n<t?t:n,H=t=>e=>"string"==typeof e&&e.startsWith(t),Y=H("--"),q=H("var(--"),G=t=>!!q(t)&&Z.test(t.split("/*")[0].trim()),Z=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function J(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const Q={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},tt={...Q,transform:t=>K(0,1,t)},et={...Q,default:1},nt=t=>Math.round(1e5*t)/1e5,it=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const st=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,rt=(t,e)=>n=>Boolean("string"==typeof n&&st.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),at=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,r,a,o]=i.match(it);return{[t]:parseFloat(s),[e]:parseFloat(r),[n]:parseFloat(a),alpha:void 0!==o?parseFloat(o):1}},ot={...Q,transform:t=>Math.round((t=>K(0,255,t))(t))},lt={test:rt("rgb","red"),parse:at("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+ot.transform(t)+", "+ot.transform(e)+", "+ot.transform(n)+", "+nt(tt.transform(i))+")"};const ht={test:rt("#"),parse:function(t){let e="",n="",i="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}},transform:lt.transform},ct=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),ut=ct("deg"),dt=ct("%"),pt=ct("px"),ft=ct("vh"),mt=ct("vw"),gt=(()=>({...dt,parse:t=>dt.parse(t)/100,transform:t=>dt.transform(100*t)}))(),yt={test:rt("hsl","hue"),parse:at("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+dt.transform(nt(e))+", "+dt.transform(nt(n))+", "+nt(tt.transform(i))+")"},vt={test:t=>lt.test(t)||ht.test(t)||yt.test(t),parse:t=>lt.test(t)?lt.parse(t):yt.test(t)?yt.parse(t):ht.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?lt.transform(t):yt.transform(t),getAnimatableNone:t=>{const e=vt.parse(t);return e.alpha=0,vt.transform(e)}},bt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const Tt="number",wt="color",xt=/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 Mt(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let r=0;const a=e.replace(xt,t=>(vt.test(t)?(i.color.push(r),s.push(wt),n.push(vt.parse(t))):t.startsWith("var(")?(i.var.push(r),s.push("var"),n.push(t)):(i.number.push(r),s.push(Tt),n.push(parseFloat(t))),++r,"${}")).split("${}");return{values:n,split:a,indexes:i,types:s}}function St({split:t,types:e}){const n=t.length;return i=>{let s="";for(let r=0;r<n;r++)if(s+=t[r],void 0!==i[r]){const t=e[r];s+=t===Tt?nt(i[r]):t===wt?vt.transform(i[r]):i[r]}return s}}const At=(t,e)=>{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(n=t)?0:vt.test(n)?vt.getAnimatableNone(n):n;var n};const Ct={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(it)?.length||0)+(t.match(bt)?.length||0)>0},parse:function(t){return Mt(t).values},createTransformer:function(t){return St(Mt(t))},getAnimatableNone:function(t){const e=Mt(t);return St(e)(e.values.map((t,n)=>At(t,e.split[n])))}};function Et(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function kt(t,e){return n=>n>0?e:t}const Vt=(t,e,n)=>t+(e-t)*n,Pt=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},Rt=[ht,lt,yt];function Ft(t){const e=(n=t,Rt.find(t=>t.test(n)));var n;if(Boolean(e),!Boolean(e))return!1;let i=e.parse(t);return e===yt&&(i=function({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let s=0,r=0,a=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,o=2*n-i;s=Et(o,i,t+1/3),r=Et(o,i,t),a=Et(o,i,t-1/3)}else s=r=a=n;return{red:Math.round(255*s),green:Math.round(255*r),blue:Math.round(255*a),alpha:i}}(i)),i}const Dt=(t,e)=>{const n=Ft(t),i=Ft(e);if(!n||!i)return kt(t,e);const s={...n};return t=>(s.red=Pt(n.red,i.red,t),s.green=Pt(n.green,i.green,t),s.blue=Pt(n.blue,i.blue,t),s.alpha=Vt(n.alpha,i.alpha,t),lt.transform(s))},_t=new Set(["none","hidden"]);function Bt(t,e){return n=>Vt(t,e,n)}function It(t){return"number"==typeof t?Bt:"string"==typeof t?G(t)?kt:vt.test(t)?Dt:jt:Array.isArray(t)?Ot:"object"==typeof t?vt.test(t)?Dt:Lt:kt}function Ot(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>It(t)(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=s[e](t);return n}}function Lt(t,e){const n={...t,...e},i={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(i[s]=It(t[s])(t[s],e[s]));return t=>{for(const e in i)n[e]=i[e](t);return n}}const jt=(t,e)=>{const n=Ct.createTransformer(e),i=Mt(t),s=Mt(e);return i.indexes.var.length===s.indexes.var.length&&i.indexes.color.length===s.indexes.color.length&&i.indexes.number.length>=s.indexes.number.length?_t.has(t)&&!s.values.length||_t.has(e)&&!i.values.length?function(t,e){return _t.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):z(Ot(function(t,e){const n=[],i={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const r=e.types[s],a=t.indexes[r][i[r]],o=t.values[a]??0;n[s]=o,i[r]++}return n}(i,s),s.values),n):kt(t,e)};function Xt(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return Vt(t,e,n);return It(t)(t,e)}function $t(t,e,{clamp:n=!0,ease:i,mixer:s}={}){const r=t.length;if(e.length,1===r)return()=>e[0];if(2===r&&e[0]===e[1])return()=>e[1];const a=t[0]===t[1];t[0]>t[r-1]&&(t=[...t].reverse(),e=[...e].reverse());const o=function(t,e,n){const i=[],s=n||u.mix||Xt,r=t.length-1;for(let n=0;n<r;n++){let r=s(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]||c:e;r=z(t,r)}i.push(r)}return i}(e,i,s),l=o.length,h=n=>{if(a&&n<t[0])return e[0];let i=0;if(l>1)for(;i<t.length-2&&!(n<t[i+1]);i++);const s=X(t[i],t[i+1],n);return o[i](s)};return n?e=>h(K(t[0],t[r-1],e)):h}function Wt(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=X(0,e,i);t.push(Vt(n,1,s))}}function Nt(t){const e=[0];return Wt(e,t.length-1),e}function Ut(t){return C(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const zt={start:0,center:.5,end:1};function Kt(t,e,n=0){let i=0;if(t in zt&&(t=zt[t]),"string"==typeof t){const e=parseFloat(t);t.endsWith("px")?i=e:t.endsWith("%")?t=e/100:t.endsWith("vw")?i=e/100*document.documentElement.clientWidth:t.endsWith("vh")?i=e/100*document.documentElement.clientHeight:t=e}return"number"==typeof t&&(i=e*t),n+i}const Ht=[0,0];function Yt(t,e,n,i){let s=Array.isArray(t)?t:Ht,r=0,a=0;return"number"==typeof t?s=[t,t]:"string"==typeof t&&(s=(t=t.trim()).includes(" ")?t.split(" "):[t,zt[t]?t:"0"]),r=Kt(s[0],n,i),a=Kt(s[1],e),r-a}const qt={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},Gt={x:0,y:0};function Zt(t,e,n){const{offset:i=qt.All}=n,{target:s=t,axis:r="y"}=n,a="y"===r?"height":"width",o=s!==t?function(t,e){const n={x:0,y:0};let i=t;for(;i&&i!==e;)if(Ut(i))n.x+=i.offsetLeft,n.y+=i.offsetTop,i=i.offsetParent;else if("svg"===i.tagName){const t=i.getBoundingClientRect();i=i.parentElement;const e=i.getBoundingClientRect();n.x+=t.left-e.left,n.y+=t.top-e.top}else{if(!(i instanceof SVGGraphicsElement))break;{const{x:t,y:e}=i.getBBox();n.x+=t,n.y+=e;let s=null,r=i.parentNode;for(;!s;)"svg"===r.tagName&&(s=r),r=i.parentNode;i=s}}return n}(s,t):Gt,l=s===t?{width:t.scrollWidth,height:t.scrollHeight}:function(t){return"getBBox"in t&&"svg"!==t.tagName?t.getBBox():{width:t.clientWidth,height:t.clientHeight}}(s),h={width:t.clientWidth,height:t.clientHeight};e[r].offset.length=0;let c=!e[r].interpolate;const u=i.length;for(let t=0;t<u;t++){const n=Yt(i[t],h[a],l[a],o[r]);c||n===e[r].interpolatorOffsets[t]||(c=!0),e[r].offset[t]=n}c&&(e[r].interpolate=$t(e[r].offset,Nt(i),{clamp:!1}),e[r].interpolatorOffsets=[...e[r].offset]),e[r].progress=K(0,1,e[r].interpolate(e[r].current))}function Jt(t,e,n,i={}){return{measure:e=>{!function(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let i=e;for(;i&&i!==t;)n.x.targetOffset+=i.offsetLeft,n.y.targetOffset+=i.offsetTop,i=i.offsetParent}n.x.targetLength=e===t?e.scrollWidth:e.clientWidth,n.y.targetLength=e===t?e.scrollHeight:e.clientHeight,n.x.containerLength=t.clientWidth,n.y.containerLength=t.clientHeight}(t,i.target,n),function(t,e,n){N(t,"x",e,n),N(t,"y",e,n),e.time=n}(t,n,e),(i.offset||i.target)&&Zt(t,n,i)},notify:()=>e(n)}}const Qt=new WeakMap,te=new WeakMap,ee=new WeakMap,ne=new WeakMap,ie=new WeakMap,se=t=>t===document.scrollingElement?window:t;function re(t,{container:e=document.scrollingElement,trackContentSize:n=!1,...i}={}){if(!e)return c;let s=ee.get(e);s||(s=new Set,ee.set(e,s));const r=Jt(e,t,{time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},i);if(s.add(r),!Qt.has(e)){const t=()=>{for(const t of s)t.measure(y.timestamp);m.preUpdate(n)},n=()=>{for(const t of s)t.notify()},i=()=>m.read(t);Qt.set(e,i);const r=se(e);window.addEventListener("resize",i),e!==document.documentElement&&te.set(e,(o=i,"function"==typeof(a=e)?j(a):I(a,o))),r.addEventListener("scroll",i),i()}var a,o;if(n&&!ie.has(e)){const t=Qt.get(e),n={width:e.scrollWidth,height:e.scrollHeight};ne.set(e,n);const i=()=>{const i=e.scrollWidth,s=e.scrollHeight;n.width===i&&n.height===s||(t(),n.width=i,n.height=s)},s=m.read(i,!0);ie.set(e,s)}const l=Qt.get(e);return m.read(l,!1,!0),()=>{g(l);const t=ee.get(e);if(!t)return;if(t.delete(r),t.size)return;const n=Qt.get(e);Qt.delete(e),n&&(se(e).removeEventListener("scroll",n),te.get(e)?.(),window.removeEventListener("resize",n));const i=ie.get(e);i&&(g(i),ie.delete(e)),ne.delete(e)}}const ae=[[qt.Enter,"entry"],[qt.Exit,"exit"],[qt.Any,"cover"],[qt.All,"contain"]],oe={start:0,end:1};function le(t){const e=t.trim().split(/\s+/);if(2!==e.length)return;const n=oe[e[0]],i=oe[e[1]];return void 0!==n&&void 0!==i?[n,i]:void 0}function he(t,e){const n=function(t){if(2!==t.length)return;const e=[];for(const n of t)if(Array.isArray(n))e.push(n);else{if("string"!=typeof n)return;{const t=le(n);if(!t)return;e.push(t)}}return e}(t);if(!n)return!1;for(let t=0;t<2;t++){const i=n[t],s=e[t];if(i[0]!==s[0]||i[1]!==s[1])return!1}return!0}function ce(t){if(!t)return{rangeStart:"contain 0%",rangeEnd:"contain 100%"};for(const[e,n]of ae)if(he(t,e))return{rangeStart:`${n} 0%`,rangeEnd:`${n} 100%`}}const ue=new Map;function de(t){const e={value:0},n=re(n=>{e.value=100*n[t.axis].progress},t);return{currentTime:e,cancel:n}}function pe({source:t,container:e,...n}){const{axis:i}=n;t&&(e=t);let s=ue.get(e);s||(s=new Map,ue.set(e,s));const r=n.target??"self";let a=s.get(r);a||(a={},s.set(r,a));const o=i+(n.offset??[]).join(",");if(!a[o])if(n.target&&A(n.target)){const t=ce(n.offset);a[o]=t?new ViewTimeline({subject:n.target,axis:i}):de({container:e,...n})}else A()?a[o]=new ScrollTimeline({source:e,axis:i}):a[o]=de({container:e,...n});return a[o]}function fe(t,{axis:e="y",container:n=document.scrollingElement,...i}={}){if(!n)return c;const s={axis:e,container:n,...i};return"function"==typeof t?function(t,e){return function(t){return 2===t.length}(t)?re(n=>{t(n[e.axis].progress,n)},e):b(t,pe(e))}(t,s):function(t,e){const n=pe(e),i=e.target?ce(e.offset):void 0,s=e.target?A(e.target)&&!!i:A();return t.attachTimeline({timeline:s?n:void 0,...i&&s&&{rangeStart:i.rangeStart,rangeEnd:i.rangeEnd},observe:t=>(t.pause(),b(e=>{t.time=t.iterationDuration*e},n))})}(t,s)}class me{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;n<this.animations.length;n++)this.animations[n][t]=e}attachTimeline(t){const e=this.animations.map(e=>e.attachTimeline(t));return()=>{e.forEach((t,e)=>{t&&t(),this.animations[e].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 state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return ge(this.animations,"duration")}get iterationDuration(){return ge(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(e=>e[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function ge(t,e){let n=0;for(let i=0;i<t.length;i++){const s=t[i][e];null!==s&&s>n&&(n=s)}return n}class ye extends me{then(t,e){return this.finished.finally(t).then(()=>{})}}function ve(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class be{constructor(){this.subscriptions=[]}add(t){var e,n;return e=this.subscriptions,n=t,-1===e.indexOf(n)&&e.push(n),()=>ve(this.subscriptions,t)}notify(t,e,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,n);else for(let s=0;s<i;s++){const i=this.subscriptions[s];i&&i(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}let Te;function we(){Te=void 0}const xe={now:()=>(void 0===Te&&xe.set(y.isProcessing||u.useManualTiming?y.timestamp:performance.now()),Te),set:t=>{Te=t,queueMicrotask(we)}},Me={current:void 0};class Se{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=xe.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=xe.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new be);const n=this.events[t].add(e);return"change"===t?()=>{n(),m.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return Me.current&&Me.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=xe.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return $(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),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.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ae(t,e){return new Se(t,e)}const Ce=t=>1e3*t,Ee=t=>t/1e3,ke=(t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let e=0;e<s;e++)i+=Math.round(1e4*t(e/(s-1)))/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},Ve=2e4;function Pe(t){let e=0;let n=t.next(e);for(;!n.done&&e<Ve;)e+=50,n=t.next(e);return e>=Ve?1/0:e}function Re(t,e=100,n){const i=n({...t,keyframes:[0,e]}),s=Math.min(Pe(i),Ve);return{type:"keyframes",ease:t=>i.next(s*t).value/e,duration:Ee(s)}}const Fe=100,De=10,_e=1,Be=0,Ie=800,Oe=.3,Le=.3,je={granular:.01,default:2},Xe={granular:.005,default:.5},$e=.01,We=10,Ne=.05,Ue=1;function ze(t,e){return t*Math.sqrt(1-e*e)}const Ke=.001;const He=["duration","bounce"],Ye=["stiffness","damping","mass"];function qe(t,e){return e.some(e=>void 0!==t[e])}function Ge(t){let e={velocity:Be,stiffness:Fe,damping:De,mass:_e,isResolvedFromDuration:!1,...t};if(!qe(t,Ye)&&qe(t,He))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(1.2*n),s=i*i,r=2*K(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:_e,stiffness:s,damping:r}}else{const n=function({duration:t=Ie,bounce:e=Oe,velocity:n=Be,mass:i=_e}){let s,r;Ce(We);let a=1-e;a=K(Ne,Ue,a),t=K($e,We,Ee(t)),a<1?(s=e=>{const i=e*a,s=i*t,r=i-n,o=ze(e,a),l=Math.exp(-s);return Ke-r/o*l},r=e=>{const i=e*a*t,r=i*n+n,o=Math.pow(a,2)*Math.pow(e,2)*t,l=Math.exp(-i),h=ze(Math.pow(e,2),a);return(-s(e)+Ke>0?-1:1)*((r-o)*l)/h}):(s=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,r=e=>Math.exp(-e*t)*(t*t*(n-e)));const o=function(t,e,n){let i=n;for(let n=1;n<12;n++)i-=t(i)/e(i);return i}(s,r,5/t);if(t=Ce(t),isNaN(o))return{stiffness:Fe,damping:De,duration:t};{const e=Math.pow(o,2)*i;return{stiffness:e,damping:2*a*Math.sqrt(i*e),duration:t}}}({...t,velocity:0});e={...e,...n,mass:_e},e.isResolvedFromDuration=!0}return e}function Ze(t=Le,e=Oe){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:s}=n;const r=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],o={done:!1,value:r},{stiffness:l,damping:h,mass:c,duration:u,velocity:d,isResolvedFromDuration:p}=Ge({...n,velocity:-Ee(n.velocity||0)}),f=d||0,m=h/(2*Math.sqrt(l*c)),g=a-r,y=Ee(Math.sqrt(l/c)),v=Math.abs(g)<5;let b,T,w,x,M,S;if(i||(i=v?je.granular:je.default),s||(s=v?Xe.granular:Xe.default),m<1)w=ze(y,m),x=(f+m*y*g)/w,b=t=>{const e=Math.exp(-m*y*t);return a-e*(x*Math.sin(w*t)+g*Math.cos(w*t))},M=m*y*x+g*w,S=m*y*g-x*w,T=t=>Math.exp(-m*y*t)*(M*Math.sin(w*t)+S*Math.cos(w*t));else if(1===m){b=t=>a-Math.exp(-y*t)*(g+(f+y*g)*t);const t=f+y*g;T=e=>Math.exp(-y*e)*(y*t*e-f)}else{const t=y*Math.sqrt(m*m-1);b=e=>{const n=Math.exp(-m*y*e),i=Math.min(t*e,300);return a-n*((f+m*y*g)*Math.sinh(i)+t*g*Math.cosh(i))/t};const e=(f+m*y*g)/t,n=m*y*e-g*t,i=m*y*g-e*t;T=e=>{const s=Math.exp(-m*y*e),r=Math.min(t*e,300);return s*(n*Math.sinh(r)+i*Math.cosh(r))}}const A={calculatedDuration:p&&u||null,velocity:t=>Ce(T(t)),next:t=>{if(!p&&m<1){const e=Math.exp(-m*y*t),n=Math.sin(w*t),r=Math.cos(w*t),l=a-e*(x*n+g*r),h=Ce(e*(M*n+S*r));return o.done=Math.abs(h)<=i&&Math.abs(a-l)<=s,o.value=o.done?a:l,o}const e=b(t);if(p)o.done=t>=u;else{const n=Ce(T(t));o.done=Math.abs(n)<=i&&Math.abs(a-e)<=s}return o.value=o.done?a:e,o},toString:()=>{const t=Math.min(Pe(A),Ve),e=ke(e=>A.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return A}function Je(t){return"function"==typeof t&&"applyToOptions"in t}Ze.applyToOptions=t=>{const e=Re(t,100,Ze);return t.ease=e.ease,t.duration=Ce(e.duration),t.type="keyframes",t};const Qe=t=>Boolean(t&&t.getVelocity),tn=t=>Array.isArray(t)&&"number"!=typeof t[0];function en(t,e){return tn(t)?t[((t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t})(0,t.length,e)]:t}function nn(t){return"object"==typeof t&&!Array.isArray(t)}function sn(t,e,n,i){return null==t?[]:"string"==typeof t&&nn(e)?k(t,n,i):t instanceof NodeList?Array.from(t):Array.isArray(t)?t.filter(t=>null!=t):[t]}function rn(t,e,n){return t*(e+1)}function an(t,e,n,i){return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:e.startsWith("<")?Math.max(0,n+parseFloat(e.slice(1))):i.get(e)??t}function on(t,e,n,i,s,r){!function(t,e,n){for(let i=0;i<t.length;i++){const s=t[i];s.at>e&&s.at<n&&(ve(t,s),i--)}}(t,s,r);for(let a=0;a<e.length;a++)t.push({value:e[a],at:Vt(s,r,i[a]),easing:en(n,a)})}function ln(t,e){for(let n=0;n<t.length;n++)t[n]=t[n]/(e+1)}function hn(t,e){return t.at===e.at?null===t.value?1:null===e.value?-1:0:t.at-e.at}function cn(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function un(t,e){return e[t]||(e[t]=[]),e[t]}function dn(t){return Array.isArray(t)?t:[t]}function pn(t,e){return t&&t[e]?{...t,...t[e]}:{...t}}const fn=t=>"number"==typeof t,mn=t=>t.every(fn),gn={layout:0,mainThread:0,waapi:0},yn=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>m.update(e,t),stop:()=>g(e),now:()=>y.isProcessing?y.timestamp:xe.now()}};function vn(t,e,n){const i=Math.max(e-5,0);return $(n-t(i),e-i)}function bn({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:r=500,modifyTarget:a,min:o,max:l,restDelta:h=.5,restSpeed:c}){const u=t[0],d={done:!1,value:u},p=t=>void 0===o?l:void 0===l||Math.abs(o-t)<Math.abs(l-t)?o:l;let f=n*e;const m=u+f,g=void 0===a?m:a(m);g!==m&&(f=g-u);const y=t=>-f*Math.exp(-t/i),v=t=>g+y(t),b=t=>{const e=y(t),n=v(t);d.done=Math.abs(e)<=h,d.value=d.done?g:n};let T,w;const x=t=>{var e;(e=d.value,void 0!==o&&e<o||void 0!==l&&e>l)&&(T=t,w=Ze({keyframes:[d.value,p(d.value)],velocity:vn(v,t,d.value),damping:s,stiffness:r,restDelta:h,restSpeed:c}))};return x(0),{calculatedDuration:null,next:t=>{let e=!1;return w||void 0!==T||(e=!0,b(t),x(t)),void 0!==T&&t>=T?w.next(t-T):(!e&&b(t),d)}}}const Tn=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function wn(t,e,n,i){if(t===e&&n===i)return c;const s=e=>function(t,e,n,i,s){let r,a,o=0;do{a=e+(n-e)/2,r=Tn(a,i,s)-t,r>0?n=a:e=a}while(Math.abs(r)>1e-7&&++o<12);return a}(e,0,1,t,n);return t=>0===t||1===t?t:Tn(s(t),e,i)}const xn=wn(.42,0,1,1),Mn=wn(0,0,.58,1),Sn=wn(.42,0,.58,1),An=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Cn=t=>e=>1-t(1-e),En=wn(.33,1.53,.69,.99),kn=Cn(En),Vn=An(kn),Pn=t=>t>=1?1:(t*=2)<1?.5*kn(t):.5*(2-Math.pow(2,-10*(t-1))),Rn=t=>1-Math.sin(Math.acos(t)),Fn=Cn(Rn),Dn=An(Rn),_n=t=>Array.isArray(t)&&"number"==typeof t[0],Bn={linear:c,easeIn:xn,easeInOut:Sn,easeOut:Mn,circIn:Rn,circInOut:Dn,circOut:Fn,backIn:kn,backInOut:Vn,backOut:En,anticipate:Pn},In=t=>{if(_n(t)){t.length;const[e,n,i,s]=t;return wn(e,n,i,s)}return"string"==typeof t?Bn[t]:t};function On({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const s=tn(i)?i.map(In):In(i),r={done:!1,value:e[0]},a=function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:Nt(e),t),o=$t(a,e,{ease:Array.isArray(s)?s:(l=e,h=s,l.map(()=>h||Sn).splice(0,l.length-1))});var l,h;return{calculatedDuration:t,next:e=>(r.value=o(e),r.done=e>=t,r)}}const Ln=t=>null!==t;function jn(t,{repeat:e,repeatType:n="loop"},i,s=1){const r=t.filter(Ln),a=s<0||e&&"loop"!==n&&e%2==1?0:r.length-1;return a&&void 0!==i?i:r[a]}const Xn={decay:bn,inertia:bn,tween:On,keyframes:On,spring:Ze};function $n(t){"string"==typeof t.type&&(t.type=Xn[t.type])}class Wn{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const Nn=t=>t/100;class Un extends Wn{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==xe.now()&&this.tick(xe.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},gn.mainThread++,this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;$n(t);const{type:e=On,repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:r=0}=t;let{keyframes:a}=t;const o=e||On;o!==On&&"number"!=typeof a[0]&&(this.mixKeyframes=z(Nn,Xt(a[0],a[1])),a=[0,100]);const l=o({...t,keyframes:a});"mirror"===s&&(this.mirroredGenerator=o({...t,keyframes:[...a].reverse(),velocity:-r})),null===l.calculatedDuration&&(l.calculatedDuration=Pe(l));const{calculatedDuration:h}=l;this.calculatedDuration=h,this.resolvedDuration=h+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=l}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:i,mixKeyframes:s,mirroredGenerator:r,resolvedDuration:a,calculatedDuration:o}=this;if(null===this.startTime)return n.next(0);const{delay:l=0,keyframes:h,repeat:c,repeatType:u,repeatDelay:d,type:p,onUpdate:f,finalKeyframe:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const g=this.currentTime-l*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?g<0:g>i;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);let v,b=this.currentTime,T=n;if(c){const t=Math.min(this.currentTime,i)/a;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,c+1);Boolean(e%2)&&("reverse"===u?(n=1-n,d&&(n-=d/a)):"mirror"===u&&(T=r)),b=K(0,1,n)*a}y?(this.delayState.value=h[0],v=this.delayState):v=T.next(b),s&&!y&&(v.value=s(v.value));let{done:w}=v;y||null===o||(w=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const x=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return x&&p!==bn&&(v.value=jn(h,this.options,m,this.speed)),f&&f(v.value),x&&this.finish(),v}then(t,e){return this.finished.then(t,e)}get duration(){return Ee(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Ee(t)}get time(){return Ee(this.currentTime)}set time(t){t=Ce(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);return vn(t=>this.generator.next(t).value,t,this.generator.next(t).value)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;e&&this.driver&&this.updateTime(xe.now()),this.playbackSpeed=t,e&&this.driver&&(this.time=Ee(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=yn,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=e??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(xe.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null,gn.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}const zn=t=>180*t/Math.PI,Kn=t=>{const e=zn(Math.atan2(t[1],t[0]));return Yn(e)},Hn={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Kn,rotateZ:Kn,skewX:t=>zn(Math.atan(t[1])),skewY:t=>zn(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Yn=t=>((t%=360)<0&&(t+=360),t),qn=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Gn=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Zn={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:qn,scaleY:Gn,scale:t=>(qn(t)+Gn(t))/2,rotateX:t=>Yn(zn(Math.atan2(t[6],t[5]))),rotateY:t=>Yn(zn(Math.atan2(-t[2],t[0]))),rotateZ:Kn,rotate:Kn,skewX:t=>zn(Math.atan(t[4])),skewY:t=>zn(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Jn(t){return t.includes("scale")?1:0}function Qn(t,e){if(!t||"none"===t)return Jn(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=Zn,s=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=Hn,s=e}if(!s)return Jn(e);const r=i[e],a=s[1].split(",").map(ti);return"function"==typeof r?r(a):a[r]}function ti(t){return parseFloat(t.trim())}const ei=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ni=(()=>new Set(ei))(),ii=t=>t===Q||t===pt,si=new Set(["x","y","z"]),ri=ei.filter(t=>!si.has(t));const ai={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:i})=>{const s=t.max-t.min;return"border-box"===i?s:s-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:i})=>{const s=t.max-t.min;return"border-box"===i?s:s-parseFloat(e)-parseFloat(n)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Qn(e,"x"),y:(t,{transform:e})=>Qn(e,"y")};ai.translateX=ai.x,ai.translateY=ai.y;const oi=new Set;let li=!1,hi=!1,ci=!1;function ui(){if(hi){const t=Array.from(oi).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),n=new Map;e.forEach(t=>{const e=function(t){const e=[];return ri.forEach(n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}(t);e.length&&(n.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=n.get(t);e&&e.forEach(([e,n])=>{t.getValue(e)?.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}hi=!1,li=!1,oi.forEach(t=>t.complete(ci)),oi.clear()}function di(){oi.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(hi=!0)})}class pi{constructor(t,e,n,i,s,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=i,this.element=s,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?(oi.add(this),li||(li=!0,m.read(di),m.resolveKeyframes(ui))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;if(null===t[0]){const s=i?.get(),r=t[t.length-1];if(void 0!==s)t[0]=s;else if(n&&e){const i=n.readValue(e,r);null!=i&&(t[0]=i)}void 0===t[0]&&(t[0]=r),i&&void 0===s&&i.set(t[0])}!function(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),oi.delete(this)}cancel(){"scheduled"===this.state&&(oi.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}function fi(t,e,n){(t=>t.startsWith("--"))(e)?t.style.setProperty(e,n):t.style[e]=n}const mi=x(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),gi=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,yi={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:gi([0,.65,.55,1]),circOut:gi([.55,0,1,.45]),backIn:gi([.31,.01,.66,-.59]),backOut:gi([.33,1.53,.69,.99])};function vi(t,e){return t?"function"==typeof t?mi()?ke(t,e):"ease-out":_n(t)?gi(t):Array.isArray(t)?t.map(t=>vi(t,e)||yi.easeOut):yi[t]:void 0}function bi(t,e,n,{delay:i=0,duration:s=300,repeat:r=0,repeatType:a="loop",ease:o="easeOut",times:l}={},h=void 0){const c={[e]:n};l&&(c.offset=l);const u=vi(o,s);Array.isArray(u)&&(c.easing=u),p.value&&gn.waapi++;const d={delay:i,duration:s,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:r+1,direction:"reverse"===a?"alternate":"normal"};h&&(d.pseudoElement=h);const f=t.animate(c,d);return p.value&&f.finished.finally(()=>{gn.waapi--}),f}class Ti extends Wn{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:n,keyframes:i,pseudoElement:s,allowFlatten:r=!1,finalKeyframe:a,onComplete:o}=t;this.isPseudoElement=Boolean(s),this.allowFlatten=r,this.options=t,t.type;const l=function({type:t,...e}){return Je(t)&&mi()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=bi(e,n,i,l,s),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const t=jn(i,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(t),fi(e,n,t),this.animation.cancel()}o?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return Ee(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Ee(t)}get time(){return Ee(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Ce(t),e&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:e,rangeEnd:n,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&M()?(this.animation.timeline=t,e&&(this.animation.rangeStart=e),n&&(this.animation.rangeEnd=n),c):i(this)}}const wi={anticipate:Pn,backInOut:Vn,circInOut:Dn};function xi(t){"string"==typeof t.ease&&t.ease in wi&&(t.ease=wi[t.ease])}class Mi extends Ti{constructor(t){xi(t),$n(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:i,element:s,...r}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const a=new Un({...r,autoplay:!1}),o=Math.max(10,xe.now()-this.startTime),l=K(0,10,o-10),h=a.sample(o).value,{name:c}=this.options;s&&c&&fi(s,c,h),e.setWithVelocity(a.sample(Math.max(0,o-l)).value,h,l),a.stop()}}const Si=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Ct.test(t)&&"0"!==t||t.startsWith("url(")));function Ai(t){t.duration=0,t.type="keyframes"}const Ci=new Set(["opacity","clipPath","filter","transform"]),Ei=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;const ki=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Vi=T(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Pi(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:r,type:a,keyframes:o}=t,l=e?.owner?.current;if(!(l instanceof HTMLElement))return!1;const{onUpdate:h,transformTemplate:c}=e.owner.getProps();return Vi()&&n&&(Ci.has(n)||ki.has(n)&&function(t){for(let e=0;e<t.length;e++)if("string"==typeof t[e]&&Ei.test(t[e]))return!0;return!1}(o))&&("transform"!==n||!c)&&!h&&!i&&"mirror"!==s&&0!==r&&"inertia"!==a}class Ri extends Wn{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:r="loop",keyframes:a,name:o,motionValue:l,element:h,...c}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=xe.now();const u={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:s,repeatType:r,name:o,motionValue:l,element:h,...c},d=h?.KeyframeResolver||pi;this.keyframeResolver=new d(a,(t,e,n)=>this.onKeyframesResolved(t,e,u,!n),o,l,h),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,e,n,i){this.keyframeResolver=void 0;const{name:s,type:r,velocity:a,delay:o,isHandoff:l,onUpdate:h}=n;this.resolvedAt=xe.now();let d=!0;(function(t,e,n,i){const s=t[0];if(null===s)return!1;if("display"===e||"visibility"===e)return!0;const r=t[t.length-1],a=Si(s,e),o=Si(r,e);return!(!a||!o)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}(t)||("spring"===n||Je(n))&&i)})(t,s,r,a)||(d=!1,!u.instantAnimations&&o||h?.(jn(t,n,e)),t[0]=t[t.length-1],Ai(n),n.repeat=0);const p={startTime:i?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:e,...n,keyframes:t},f=d&&!l&&Pi(p),m=p.motionValue?.owner?.current;let g;if(f)try{g=new Mi({...p,element:m})}catch{g=new Un(p)}else g=new Un(p);g.finished.then(()=>{this.notifyFinished()}).catch(c),this.pendingTimeline&&(this.stopTimeline=g.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=g}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),ci=!0,di(),ui(),ci=!1),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function Fi(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function Di(t,e){const n=t?.[e]??t?.default??t;return n!==t?Fi(n,t):n}const _i={type:"spring",stiffness:500,damping:25,restSpeed:10},Bi={type:"keyframes",duration:.8},Ii={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Oi=(t,{keyframes:e})=>e.length>2?Bi:ni.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:_i:Ii,Li=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);const ji=(t,e,n,i={},s,r)=>a=>{const o=Di(i,t)||{},l=o.delay||i.delay||0;let{elapsed:h=0}=i;h-=Ce(l);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...o,delay:-h,onUpdate:t=>{e.set(t),o.onUpdate&&o.onUpdate(t)},onComplete:()=>{a(),o.onComplete&&o.onComplete()},name:t,motionValue:e,element:r?void 0:s};(function(t){for(const e in t)if(!Li.has(e))return!0;return!1})(o)||Object.assign(c,Oi(t,c)),c.duration&&(c.duration=Ce(c.duration)),c.repeatDelay&&(c.repeatDelay=Ce(c.repeatDelay)),void 0!==c.from&&(c.keyframes[0]=c.from);let d=!1;if((!1===c.type||0===c.duration&&!c.repeatDelay)&&(Ai(c),0===c.delay&&(d=!0)),(u.instantAnimations||u.skipAnimations||s?.shouldSkipAnimations)&&(d=!0,Ai(c),c.delay=0),c.allowFlatten=!o.type&&!o.ease,d&&!r&&void 0!==e.get()){const t=jn(c.keyframes,o);if(void 0!==t)return void m.update(()=>{c.onUpdate(t),c.onComplete()})}return o.isSync?new Un(c):new Ri(c)};const Xi=new WeakMap,$i=new Set(["width","height","top","left","right","bottom",...ei]);function Wi(t){const e=[{},{}];return t?.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function Ni(t,e,n,i){if("function"==typeof e){const[s,r]=Wi(i);e=e(void 0!==n?n:t.custom,s,r)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[s,r]=Wi(i);e=e(void 0!==n?n:t.custom,s,r)}return e}function Ui(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Ae(n))}function zi(t){return(t=>Array.isArray(t))(t)?t[t.length-1]||0:t}function Ki(t,e){const n=function(t,e,n){const i=t.getProps();return Ni(i,e,void 0!==n?n:i.custom,t)}(t,e);let{transitionEnd:i={},transition:s={},...r}=n||{};r={...r,...i};for(const e in r){Ui(t,e,zi(r[e]))}}function Hi(t,e){const n=t.getValue("willChange");if(i=n,Boolean(Qe(i)&&i.add))return n.add(e);if(!n&&u.WillChange){const n=new u.WillChange("auto");t.addValue("willChange",n),n.add(e)}var i}function Yi(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const qi="data-"+Yi("framerAppearId");function Gi(t){return t.props[qi]}function Zi({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function Ji(t,e,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:r,transitionEnd:a,...o}=e;const l=t.getDefaultTransition();r=r?Fi(r,l):l;const h=r?.reduceMotion;i&&(r=i);const c=[],u=s&&t.animationState&&t.animationState.getState()[s];for(const e in o){const i=t.getValue(e,t.latestValues[e]??null),s=o[e];if(void 0===s||u&&Zi(u,e))continue;const a={delay:n,...Di(r||{},e)},l=i.get();if(void 0!==l&&!i.isAnimating()&&!Array.isArray(s)&&s===l&&!a.velocity){m.update(()=>i.set(s));continue}let d=!1;if(window.MotionHandoffAnimation){const n=Gi(t);if(n){const t=window.MotionHandoffAnimation(n,e,m);null!==t&&(a.startTime=t,d=!0)}}Hi(t,e);const p=h??t.shouldReduceMotion;i.start(ji(e,i,s,p&&$i.has(e)?{type:!1}:a,t,d));const f=i.animation;f&&c.push(f)}if(a){const e=()=>m.update(()=>{a&&Ki(t,a)});c.length?Promise.all(c).then(e):e()}return c}const Qi=new Set(["brightness","contrast","saturate","opacity"]);function ts(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(it)||[];if(!i)return t;const s=n.replace(i,"");let r=Qi.has(e)?1:0;return i!==n&&(r*=100),e+"("+r+s+")"}const es=/\b([a-z-]*)\(.*?\)/gu,ns={...Ct,getAnimatableNone:t=>{const e=t.match(es);return e?e.map(ts).join(" "):t}},is={...Ct,getAnimatableNone:t=>{const e=Ct.parse(t);return Ct.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},ss={...Q,transform:Math.round},rs={borderWidth:pt,borderTopWidth:pt,borderRightWidth:pt,borderBottomWidth:pt,borderLeftWidth:pt,borderRadius:pt,borderTopLeftRadius:pt,borderTopRightRadius:pt,borderBottomRightRadius:pt,borderBottomLeftRadius:pt,width:pt,maxWidth:pt,height:pt,maxHeight:pt,top:pt,right:pt,bottom:pt,left:pt,inset:pt,insetBlock:pt,insetBlockStart:pt,insetBlockEnd:pt,insetInline:pt,insetInlineStart:pt,insetInlineEnd:pt,padding:pt,paddingTop:pt,paddingRight:pt,paddingBottom:pt,paddingLeft:pt,paddingBlock:pt,paddingBlockStart:pt,paddingBlockEnd:pt,paddingInline:pt,paddingInlineStart:pt,paddingInlineEnd:pt,margin:pt,marginTop:pt,marginRight:pt,marginBottom:pt,marginLeft:pt,marginBlock:pt,marginBlockStart:pt,marginBlockEnd:pt,marginInline:pt,marginInlineStart:pt,marginInlineEnd:pt,fontSize:pt,backgroundPositionX:pt,backgroundPositionY:pt,...{rotate:ut,rotateX:ut,rotateY:ut,rotateZ:ut,scale:et,scaleX:et,scaleY:et,scaleZ:et,skew:ut,skewX:ut,skewY:ut,distance:pt,translateX:pt,translateY:pt,translateZ:pt,x:pt,y:pt,z:pt,perspective:pt,transformPerspective:pt,opacity:tt,originX:gt,originY:gt,originZ:pt},zIndex:ss,fillOpacity:tt,strokeOpacity:tt,numOctaves:ss},as={...rs,color:vt,backgroundColor:vt,outlineColor:vt,fill:vt,stroke:vt,borderColor:vt,borderTopColor:vt,borderRightColor:vt,borderBottomColor:vt,borderLeftColor:vt,filter:ns,WebkitFilter:ns,mask:is,WebkitMask:is},os=t=>as[t],ls=()=>({x:{min:0,max:0},y:{min:0,max:0}}),hs=t=>e=>e.test(t),cs=[Q,pt,dt,ut,mt,ft,{test:t=>"auto"===t,parse:t=>t}],us=t=>cs.find(hs(t)),ds=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),ps=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function fs(t,e,n=1){const[i,s]=function(t){const e=ps.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}(t);if(!i)return;const r=window.getComputedStyle(e).getPropertyValue(i);if(r){const t=r.trim();return ds(t)?parseFloat(t):t}return G(s)?fs(s,e,n+1):s}const ms=t=>/^0[^.\s]+$/u.test(t);function gs(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||ms(t))}const ys=new Set([ns,is]);function vs(t,e){let n=os(t);return ys.has(n)||(n=Ct),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const bs=new Set(["auto","none","0"]);class Ts extends pi{constructor(t,e,n,i,s){super(t,e,n,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){let i=t[n];if("string"==typeof i&&(i=i.trim(),G(i))){const s=fs(i,e.current);void 0!==s&&(t[n]=s),n===t.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!$i.has(n)||2!==t.length)return;const[i,s]=t,r=us(i),a=us(s);if(J(i)!==J(s)&&ai[n])this.needsMeasurement=!0;else if(r!==a)if(ii(r)&&ii(a))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else ai[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||gs(t[e]))&&n.push(e);n.length&&function(t,e,n){let i,s=0;for(;s<t.length&&!i;){const e=t[s];"string"==typeof e&&!bs.has(e)&&Mt(e).values.length&&(i=t[s]),s++}if(i&&n)for(const s of e)t[s]=vs(n,i)}(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=ai[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const i=e[e.length-1];void 0!==i&&t.getValue(n,i).jump(i,!1)}measureEndState(){const{element:t,name:e,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const i=t.getValue(e);i&&i.jump(this.measuredOrigin,!1);const s=n.length-1,r=n[s];n[s]=ai[e](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==r&&void 0===this.finalKeyframe&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([e,n])=>{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const{schedule:ws,cancel:xs}=f(queueMicrotask,!1),Ms=[...cs,vt,Ct];const Ss=["initial","animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"];function As(t){return null!==(e=t.animate)&&"object"==typeof e&&"function"==typeof e.start||Ss.some(e=>function(t){return"string"==typeof t||Array.isArray(t)}(t[e]));var e}const Cs={current:null},Es={current:!1},ks="undefined"!=typeof window;const Vs=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Ps={};class Rs{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:i,skipAnimations:s,blockInitialAnimation:r,visualState:a},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=pi,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,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 t=xe.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,m.render(this.render,!1,!0))};const{latestValues:l,renderState:h}=a;this.latestValues=l,this.baseTarget={...l},this.initialValues=e.initial?{...l}:{},this.renderState=h,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=s,this.options=o,this.blockInitialAnimation=Boolean(r),this.isControllingVariants=As(e),this.isVariantNode=function(t){return Boolean(As(t)||t.variants)}(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:c,...u}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in u){const e=u[t];void 0!==l[t]&&Qe(e)&&e.set(l[t])}}mount(t){if(this.hasBeenMounted)for(const t in this.initialValues)this.values.get(t)?.jump(this.initialValues[t]),this.latestValues[t]=this.initialValues[t];this.current=t,Xi.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((t,e)=>this.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(Es.current||function(){if(Es.current=!0,ks)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Cs.current=t.matches;t.addEventListener("change",e),e()}else Cs.current=!1}(),this.shouldReduceMotion=Cs.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),g(this.notifyUpdate),g(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),e.accelerate&&Ci.has(t)&&this.current instanceof HTMLElement){const{factory:n,keyframes:i,times:s,ease:r,duration:a}=e.accelerate,o=new Ti({element:this.current,name:t,keyframes:i,times:s,ease:r,duration:Ce(a)}),l=n(o);return void this.valueSubscriptions.set(t,()=>{l(),o.cancel()})}const n=ni.has(t);n&&this.onBindTransform&&this.onBindTransform();const i=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&m.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{i(),s&&s(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in Ps){const e=Ps[t];if(!e)continue;const{isEnabled:n,Feature:i}=e;if(!this.features[t]&&i&&n(this.props)&&(this.features[t]=new i(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<Vs.length;e++){const n=Vs[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const i=t["on"+n];i&&(this.propEventSubscriptions[n]=this.on(n,i))}this.prevMotionValues=function(t,e,n){for(const i in e){const s=e[i],r=n[i];if(Qe(s))t.addValue(i,s);else if(Qe(r))t.addValue(i,Ae(s,{owner:t}));else if(r!==s)if(t.hasValue(i)){const e=t.getValue(i);!0===e.liveStyle?e.jump(s):e.hasAnimated||e.set(s)}else{const e=t.getStaticValue(i);t.addValue(i,Ae(void 0!==e?e:s,{owner:t}))}}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}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 e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=Ae(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){let n=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var i;return null!=n&&("string"==typeof n&&(ds(n)||ms(n))?n=parseFloat(n):(i=n,!Ms.find(hs(i))&&Ct.test(e)&&(n=vs(t,e))),this.setBaseTarget(t,Qe(n)?n.get():n)),Qe(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let n;if("string"==typeof e||"object"==typeof e){const i=Ni(this.props,e,this.presenceContext?.custom);i&&(n=i[t])}if(e&&void 0!==n)return n;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||Qe(i)?void 0!==this.initialValues[t]&&void 0===n?void 0:this.baseTarget[t]:i}on(t,e){return this.events[t]||(this.events[t]=new be),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){ws.render(this.render)}}class Fs extends Rs{constructor(){super(...arguments),this.KeyframeResolver=Ts}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){const n=t.style;return n?n[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Qe(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}const Ds=(t,e)=>e&&"number"==typeof t?e.transform(t):t,_s={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Bs=ei.length;function Is(t,e,n){const{style:i,vars:s,transformOrigin:r}=t;let a=!1,o=!1;for(const t in e){const n=e[t];if(ni.has(t))a=!0;else if(Y(t))s[t]=n;else{const e=Ds(n,rs[t]);t.startsWith("origin")?(o=!0,r[t]=e):i[t]=e}}if(e.transform||(a||n?i.transform=function(t,e,n){let i="",s=!0;for(let r=0;r<Bs;r++){const a=ei[r],o=t[a];if(void 0===o)continue;let l=!0;if("number"==typeof o)l=o===(a.startsWith("scale")?1:0);else{const t=parseFloat(o);l=a.startsWith("scale")?1===t:0===t}if(!l||n){const t=Ds(o,rs[a]);l||(s=!1,i+=`${_s[a]||a}(${t}) `),n&&(e[a]=t)}}return i=i.trim(),n?i=n(e,s?"":i):s&&(i="none"),i}(e,t.transform,n):i.transform&&(i.transform="none")),o){const{originX:t="50%",originY:e="50%",originZ:n=0}=r;i.transformOrigin=`${t} ${e} ${n}`}}const Os={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ls={offset:"strokeDashoffset",array:"strokeDasharray"};const js=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Xs(t,{attrX:e,attrY:n,attrScale:i,pathLength:s,pathSpacing:r=1,pathOffset:a=0,...o},l,h,c){if(Is(t,o,h),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:u,style:d}=t;u.transform&&(d.transform=u.transform,delete u.transform),(d.transform||u.transformOrigin)&&(d.transformOrigin=u.transformOrigin??"50% 50%",delete u.transformOrigin),d.transform&&(d.transformBox=c?.transformBox??"fill-box",delete u.transformBox);for(const t of js)void 0!==u[t]&&(d[t]=u[t],delete u[t]);void 0!==e&&(u.x=e),void 0!==n&&(u.y=n),void 0!==i&&(u.scale=i),void 0!==s&&function(t,e,n=1,i=0,s=!0){t.pathLength=1;const r=s?Os:Ls;t[r.offset]=""+-i,t[r.array]=`${e} ${n}`}(u,s,r,a,!1)}const $s=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 Ws(t,{style:e,vars:n},i,s){const r=t.style;let a;for(a in e)r[a]=e[a];for(a in s?.applyProjectionStyles(r,i),n)r.setProperty(a,n[a])}function Ns(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Us={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!pt.test(t))return t;t=parseFloat(t)}return`${Ns(t,e.target.x)}% ${Ns(t,e.target.y)}%`}},zs={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=Ct.parse(t);if(s.length>5)return i;const r=Ct.createTransformer(t),a="number"!=typeof s[0]?1:0,o=n.x.scale*e.x,l=n.y.scale*e.y;s[0+a]/=o,s[1+a]/=l;const h=Vt(o,l,.5);return"number"==typeof s[2+a]&&(s[2+a]/=h),"number"==typeof s[3+a]&&(s[3+a]/=h),r(s)}};const Ks={borderRadius:{...Us,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Us,borderTopRightRadius:Us,borderBottomLeftRadius:Us,borderBottomRightRadius:Us,boxShadow:zs};function Hs(t,{layout:e,layoutId:n}){return ni.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!Ks[t]||"opacity"===t)}function Ys(t,e,n){const i=t.style,s=e?.style,r={};if(!i)return r;for(const e in i)(Qe(i[e])||s&&Qe(s[e])||Hs(e,t)||void 0!==n?.getValue(e)?.liveStyle)&&(r[e]=i[e]);return r}class qs extends Fs{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ls}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(ni.has(e)){const t=os(e);return t&&t.default||0}return e=$s.has(e)?e:Yi(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return function(t,e,n){const i=Ys(t,e,n);for(const n in t)(Qe(t[n])||Qe(e[n]))&&(i[-1!==ei.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]);return i}(t,e,n)}build(t,e,n){Xs(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){!function(t,e,n,i){Ws(t,e,void 0,i);for(const n in e.attrs)t.setAttribute($s.has(n)?n:Yi(n),e.attrs[n])}(t,e,0,i)}mount(t){var e;this.isSVGTag="string"==typeof(e=t.tagName)&&"svg"===e.toLowerCase(),super.mount(t)}}function Gs(t,e){return function({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}(t.getBoundingClientRect(),e))}class Zs extends Fs{constructor(){super(...arguments),this.type="html",this.renderInstance=Ws}readValueFromInstance(t,e){if(ni.has(e))return this.projection?.isProjecting?Jn(e):((t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Qn(n,e)})(t,e);{const i=(n=t,window.getComputedStyle(n)),s=(Y(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return Gs(t,e)}build(t,e,n){Is(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return Ys(t,e,n)}}class Js extends Rs{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(function(t,e){return t in e}(e,t)){const n=t[e];if("string"==typeof n||"number"==typeof n)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(t,e){delete e.output[t]}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}build(t,e){Object.assign(t.output,e)}renderInstance(t,{output:e}){Object.assign(t,e)}sortInstanceNodePosition(){return 0}}function Qs(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=E(t)&&!function(t){return E(t)&&"svg"===t.tagName}(t)?new qs(e):new Zs(e);n.mount(t),Xi.set(t,n)}function tr(t){const e=new Js({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});e.mount(t),Xi.set(t,e)}function er(t,e,n,i){const s=[];if(function(t,e){return Qe(t)||"number"==typeof t||"string"==typeof t&&!nn(e)}(t,e))s.push(function(t,e,n){const i=Qe(t)?t:Ae(t);return i.start(ji("",i,e,n)),i.animation}(t,nn(e)&&e.default||e,n&&n.default||n));else{if(null==t)return s;const r=sn(t,e,i),a=r.length;Boolean(a);for(let t=0;t<a;t++){const i=r[t],o=i instanceof Element?Qs:tr;Xi.has(i)||o(i);const l=Xi.get(i),h={...n};"delay"in h&&"function"==typeof h.delay&&(h.delay=h.delay(t,a)),s.push(...Ji(l,{...e,transition:h},{}))}}return s}function nr(t,e,n){const i=[],s=function(t,{defaultTransition:e={},...n}={},i,s){const r=e.duration||.3,a=new Map,o=new Map,l={},h=new Map;let c=0,u=0,d=0;for(let n=0;n<t.length;n++){const a=t[n];if("string"==typeof a){h.set(a,u);continue}if(!Array.isArray(a)){h.set(a.name,an(u,a.at,c,h));continue}let[p,f,m={}]=a;void 0!==m.at&&(u=an(u,m.at,c,h));let g=0;const y=(t,n,i,a=0,o=0)=>{const l=dn(t),{delay:h=0,times:c=Nt(l),type:p=e.type||"keyframes",repeat:f,repeatType:m,repeatDelay:y=0,...v}=n;let{ease:b=e.ease||"easeOut",duration:T}=n;const w="function"==typeof h?h(a,o):h,x=l.length,M=Je(p)?p:s?.[p||"keyframes"];if(x<=2&&M){let t=100;if(2===x&&mn(l)){const e=l[1]-l[0];t=Math.abs(e)}const n={...e,...v};void 0!==T&&(n.duration=Ce(T));const i=Re(n,t,M);b=i.ease,T=i.duration}T??(T=r);const S=u+w;1===c.length&&0===c[0]&&(c[1]=1);const A=c.length-l.length;if(A>0&&Wt(c,A),1===l.length&&l.unshift(null),f){T=rn(T,f);const t=[...l],e=[...c];b=Array.isArray(b)?[...b]:[b];const n=[...b];for(let i=0;i<f;i++){l.push(...t);for(let s=0;s<t.length;s++)c.push(e[s]+(i+1)),b.push(0===s?"linear":en(n,s-1))}ln(c,f)}const C=S+T;on(i,l,b,c,S,C),g=Math.max(w+T,g),d=Math.max(C,d)};if(Qe(p))y(f,m,un("default",cn(p,o)));else{const t=sn(p,f,i,l),e=t.length;for(let n=0;n<e;n++){const i=cn(t[n],o);for(const t in f)y(f[t],pn(m,t),un(t,i),n,e)}}c=u,u+=g}return o.forEach((t,i)=>{for(const s in t){const r=t[s];r.sort(hn);const o=[],l=[],h=[];for(let t=0;t<r.length;t++){const{at:e,value:n,easing:i}=r[t];o.push(n),l.push(X(0,d,e)),h.push(i||"easeOut")}0!==l[0]&&(l.unshift(0),o.unshift(o[0]),h.unshift("easeInOut")),1!==l[l.length-1]&&(l.push(1),o.push(null)),a.has(i)||a.set(i,{keyframes:{},transition:{}});const c=a.get(i);c.keyframes[s]=o;const{type:u,...p}=e;c.transition[s]={...p,duration:d,ease:h,times:l,...n}}}),a}(t.map(t=>{if(Array.isArray(t)&&"function"==typeof t[0]){const e=t[0],n=Ae(0);return n.on("change",e),1===t.length?[n,[0,1]]:2===t.length?[n,[0,1],t[1]]:[n,t[1],t[2]]}return t}),e,n,{spring:Ze});return s.forEach(({keyframes:t,transition:e},n)=>{i.push(...er(n,t,e))}),i}const ir=function(t={}){const{scope:e,reduceMotion:n}=t;return function(t,i,s){let r,a=[];if(o=t,Array.isArray(o)&&o.some(Array.isArray)){const{onComplete:s,...o}=i||{};"function"==typeof s&&(r=s),a=nr(t,void 0!==n?{reduceMotion:n,...o}:o,e)}else{const{onComplete:o,...l}=s||{};"function"==typeof o&&(r=o),a=er(t,i,void 0!==n?{reduceMotion:n,...l}:l,e)}var o;const l=new ye(a);return r&&l.finished.then(r),e&&(e.animations.push(l),l.finished.then(()=>{ve(e.animations,l)})),l}}();var sr=function(t,e,n,i){return new(n||(n=Promise))(function(s,r){function a(t){try{l(i.next(t))}catch(t){r(t)}}function o(t){try{l(i.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?s(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(a,o)}l((i=i.apply(t,e||[])).next())})};class rr{constructor(t,e={}){this.engine=null,this.syncedAnimations=[],this.destroyed=!1,this.container=t,this.options=Object.assign({scrub:0},e),this.injectStyles()}injectStyles(){if(rr.stylesInjected)return;const t=document.createElement("style");t.id="stube-base-styles",t.innerHTML='\n .stube-layer {\n position: absolute;\n inset: 0;\n pointer-events: none;\n display: grid;\n grid-template-areas: "content";\n }\n .stube-layer > * {\n grid-area: content;\n pointer-events: auto;\n }\n /* Alignment Mappings */\n .stube-layer[data-stube-align^="top"] { align-items: start; }\n .stube-layer[data-stube-align^="center"] { align-items: center; }\n .stube-layer[data-stube-align^="bottom"] { align-items: end; }\n \n .stube-layer[data-stube-align$="left"] { justify-items: start; }\n .stube-layer[data-stube-align$="center"] { justify-items: center; }\n .stube-layer[data-stube-align$="right"] { justify-items: end; }\n ',document.head.appendChild(t),rr.stylesInjected=!0}static initAll(){return sr(this,void 0,void 0,function*(){const t=document.querySelectorAll(".stube-container"),e=[];for(let n=0;n<t.length;n++){const i=t[n],s=new rr(i,{scrub:.5});yield s.init(),e.push(s)}return e})}init(){return sr(this,void 0,void 0,function*(){if(this.destroyed)return;const t=this.container.querySelector(".stube-canvas");if(!t)return void console.warn("[CoreOrchestrator] No .stube-canvas found inside container.");const e=t.dataset.stubeCanvas||t.getAttribute("data-project");if(!e)return void console.warn('[CoreOrchestrator] No project URL found on .stube-canvas. Use data-stube-canvas="url"');const n=t.dataset.stubeDepthtilt||t.getAttribute("data-stube-depthtilt");null!=n&&(this.options.depthTilt=parseFloat(n)),this.engine=yield this.loadEngine(e,t),this.destroyed||(this.parseAnimatedElements(),this.setupScrollTracking(),this.engine.onFrameChange=(t,e)=>{this.syncTrackingLayers(t),this.onFrameChange&&this.onFrameChange(t,e)},this.engine.onProgressUpdate=t=>{this.syncAnimations(t)})})}loadEngine(t,e){return sr(this,void 0,void 0,function*(){let n;try{if(t.trim().startsWith("{"))n=JSON.parse(t);else{const e=yield fetch(t);if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);n=yield e.json()}}catch(t){throw console.error("[CoreOrchestrator] Failed to load configuration:",t),t}n.settings||(n.settings={baseResolution:{width:1920,height:1080},scrollMode:"vh"}),n.settings.basePath||t.trim().startsWith("{")||(n.settings.basePath=t.substring(0,t.lastIndexOf("/")));const i=new h(n,{scrub:this.options.scrub,depthTilt:this.options.depthTilt});let s=e.querySelector("canvas");return s||(s=document.createElement("canvas"),s.style.width="100%",s.style.height="100%",s.style.display="block",s.style.objectFit="cover",e.appendChild(s)),i.attachCanvas(s),i})}setupScrollTracking(){if(!this.engine)return;const t=this.container.dataset.stubeOffset;let e=["start end","end start"];try{t&&(e=JSON.parse(t))}catch(t){}this.motionScrollCancel=fe(t=>{this.engine&&this.engine.update(t)},{target:this.container,offset:e})}parseAnimatedElements(){this.container.querySelectorAll("[data-stube-animate]").forEach(t=>{try{const e=t.getAttribute("data-stube-animate");if(!e)return;const n=JSON.parse(e),i=ir(t,n,{duration:1,ease:"linear"});i.pause(),i.time=0,this.syncedAnimations.push(i)}catch(e){console.warn("[CoreOrchestrator] Failed to parse data-stube-animate on element",t,e)}})}syncAnimations(t){for(const e of this.syncedAnimations)e.time=t}syncTrackingLayers(t){if(!this.engine)return;this.container.querySelectorAll("[data-stube-layer-tracking]").forEach(e=>sr(this,void 0,void 0,function*(){const n=e.dataset.stubeLayerTracking;if(!n)return;yield this.engine.loadTrackingData(n);const i=this.engine.getTrackedCoords(n,t);e.style.left=100*i.x+"%",e.style.top=100*i.y+"%"}))}getEngine(){return this.engine}destroy(){this.destroyed=!0,this.motionScrollCancel&&(this.motionScrollCancel(),this.motionScrollCancel=void 0);for(const t of this.syncedAnimations)t.stop();this.syncedAnimations=[],this.engine&&(this.engine.destroy(),this.engine=null),this.onFrameChange=void 0}}rr.stylesInjected=!1;Object.assign(h,{CoreOrchestrator:rr});var ar=function(t,e,n,i){return new(n||(n=Promise))(function(s,r){function a(t){try{l(i.next(t))}catch(t){r(t)}}function o(t){try{l(i.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?s(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(a,o)}l((i=i.apply(t,e||[])).next())})};const or=(0,a.createContext)(null),lr=({type:t="sticky",containerHeight:e="400vh",sceneHeight:n="100vh",sceneTop:i=0,offset:s=["start end","end start"],scrub:o=0,children:l})=>{var h;const[c,u]=(0,a.useState)({progress:0,frame:-1}),[d,p]=(0,a.useState)(!1),f=(0,a.useRef)(null),m=(0,a.useRef)(null),g=JSON.stringify(s);(0,a.useEffect)(()=>{let t=!0;if(!f.current)return;const e=setTimeout(()=>{ar(void 0,void 0,void 0,function*(){const e=new rr(f.current,{scrub:o});m.current=e,e.onFrameChange=(e,n)=>{t&&u({frame:e,progress:n})},yield e.init(),t&&p(!0)})},0);return()=>{t=!1,clearTimeout(e),m.current&&(m.current.destroy(),m.current=null)}},[o,g]);const y=(null===(h=m.current)||void 0===h?void 0:h.getEngine())||null;return(0,r.jsx)(or.Provider,{value:Object.assign(Object.assign({},c),{engine:y}),children:(0,r.jsx)("div",{ref:f,className:"stube-container",style:{position:"relative",height:e},"data-stube-offset":g,children:(0,r.jsx)("div",{className:"stube-container_inner_sticky",style:{position:"sticky",top:i,height:n,overflow:"hidden"},children:l})})})},hr=({project:t,depthtilt:e,width:n="100%",height:i="100%",style:s})=>{const{engine:o}=pr(),l=void 0!==e?Number(e):4;return(0,a.useEffect)(()=>{o&&o.setDepthTilt(l)},[o,l]),(0,r.jsx)("div",{className:"stube-canvas","data-stube-canvas":t,"data-stube-depthtilt":l,style:Object.assign({width:n,height:i,pointerEvents:"auto"},s)})},cr=({align:t,style:e,children:n})=>(0,r.jsx)("div",{className:"stube-layer","data-stube-align":t,style:e,children:n}),ur=({id:t="main",offset:e={x:0,y:0},style:n,children:i})=>{const s=(0,a.useContext)(or);if((0,a.useEffect)(()=>{(null==s?void 0:s.engine)&&s.engine.loadTrackingData(t)},[null==s?void 0:s.engine,t]),!s)return null;const o=Object.assign(Object.assign(Object.assign({position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",pointerEvents:"auto",zIndex:10},n),0!==e.x?{marginLeft:`${e.x}px`}:{}),0!==e.y?{marginTop:`${e.y}px`}:{});return(0,r.jsx)("div",{className:"stube-layer-tracking","data-stube-layer-tracking":t,style:o,children:i})},dr=ur,pr=()=>{const t=(0,a.useContext)(or);if(!t)throw new Error("useScrollTube must be used within a ScrollTubeProvider");return t};return s})());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scrolltube",
3
- "version": "2.0.15",
3
+ "version": "2.1.0",
4
4
  "description": "ScrollTube is a web-based tool for scroll-triggered animations.",
5
5
  "main": "dist/core/scrolltube.umd.min.js",
6
6
  "module": "dist/core/scrolltube.umd.min.js",
@@ -33,8 +33,7 @@
33
33
  "docs"
34
34
  ],
35
35
  "scripts": {
36
- "build": "npm run sync-readme && npm run build:web && npm run build:pipeline",
37
- "sync-readme": "node -e \"fs.copyFileSync('../../README.md', './README.md')\"",
36
+ "build": "npm run build:web && npm run build:pipeline",
38
37
  "build:web": "webpack --config webpack.config.js --mode production && npm run build:types:web",
39
38
  "build:types:web": "tsc --project tsconfig.json --emitDeclarationOnly",
40
39
  "build:pipeline": "tsc --project tsconfig.node.json && node scripts/make-executable.cjs",
@@ -95,5 +94,9 @@
95
94
  "webpack-cli": "^5.1.0",
96
95
  "@types/fs-extra": "^11.0.4",
97
96
  "@types/sharp": "^0.31.1"
98
- }
97
+ },
98
+ "workspaces": [
99
+ "apps/nextjs-docs",
100
+ "demos/*"
101
+ ]
99
102
  }