@vezham/react 0.1.6 → 0.2.0-beta-v0xcli
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -18
- package/heroui.d.ts +1 -0
- package/index-BboEK-eG.js +1 -0
- package/index-Clg0GdGy.js +1 -0
- package/index-D1NSj03G.mjs +1382 -0
- package/index-DMLUAfMZ.mjs +61522 -0
- package/index-DrfIpzdt.mjs +5 -0
- package/index-Dtr5Cv2D.js +53 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/index.mjs +291 -0
- package/package.json +11 -99
- package/src-UW24ZMRV-BboEK-eG.js +1 -0
- package/src-UW24ZMRV-mfHlK29w.mjs +5 -0
- package/LICENSE +0 -21
- package/dist/components.json +0 -749
- package/dist/index.d.mts +0 -50
- package/dist/index.d.ts +0 -50
- package/dist/index.js +0 -130
- package/dist/index.mjs +0 -55
package/README.md
CHANGED
|
@@ -1,18 +1 @@
|
|
|
1
|
-
|
|
2
|
-
<a href="https://vezham.com" target="_blank" rel="noreferrer">
|
|
3
|
-
<picture>
|
|
4
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://static.cdn.vezham.com/images/logo-white.png">
|
|
5
|
-
<img src="https://static.cdn.vezham.com/images/logo-black.png" width="20%" alt="vezham">
|
|
6
|
-
</picture>
|
|
7
|
-
<h3 align="center">Vezham</h3>
|
|
8
|
-
</a>
|
|
9
|
-
</p>
|
|
10
|
-
<hr>
|
|
11
|
-
|
|
12
|
-
# heroui
|
|
13
|
-
|
|
14
|
-
### Getting Started
|
|
15
|
-
|
|
16
|
-
This repository mirrors the [heroui](https://github.com/vezham/heroui) repo to suit our needs.
|
|
17
|
-
|
|
18
|
-
Please report all issues and make contributions to the upstream repo.
|
|
1
|
+
# @vezham/react
|
package/heroui.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@v0xoss/react';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-Dtr5Cv2D.js");var t=e.domAnimation;exports.default=t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-Dtr5Cv2D.js"),p=require("react"),K=require("react/jsx-runtime");function it(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const i=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,i.get?i:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const rt=it(p);function We(e,t=100,o){const i=o({...e,keyframes:[0,t]}),r=Math.min(n.calcGeneratorDuration(i),n.maxGeneratorDuration);return{type:"keyframes",ease:s=>i.next(r*s).value/t,duration:n.millisecondsToSeconds(r)}}class st{constructor(t){this.animation=t}get duration(){var t,o,i;const r=((o=(t=this.animation)===null||t===void 0?void 0:t.effect)===null||o===void 0?void 0:o.getComputedTiming().duration)||((i=this.options)===null||i===void 0?void 0:i.duration)||300;return n.millisecondsToSeconds(Number(r))}get time(){var t;return this.animation?n.millisecondsToSeconds(((t=this.animation)===null||t===void 0?void 0:t.currentTime)||0):0}set time(t){this.animation&&(this.animation.currentTime=n.secondsToMilliseconds(t))}get speed(){return this.animation?this.animation.playbackRate:1}set speed(t){this.animation&&(this.animation.playbackRate=t)}get state(){return this.animation?this.animation.playState:"finished"}get startTime(){return this.animation?this.animation.startTime:null}get finished(){return this.animation?this.animation.finished:Promise.resolve()}play(){this.animation&&this.animation.play()}pause(){this.animation&&this.animation.pause()}stop(){!this.animation||this.state==="idle"||this.state==="finished"||(this.animation.commitStyles&&this.animation.commitStyles(),this.cancel())}flatten(){var t;this.animation&&((t=this.animation.effect)===null||t===void 0||t.updateTiming({easing:"linear"}))}attachTimeline(t){return this.animation&&n.attachTimeline(this.animation,t),n.noop}complete(){this.animation&&this.animation.finish()}cancel(){try{this.animation&&this.animation.cancel()}catch{}}}const at=n.createMotionComponentFactory({...n.animations,...n.gestureAnimations,...n.drag,...n.layout},n.createDomVisualElement),se=n.createDOMMotionComponentProxy(at),ut={renderer:n.createDomVisualElement,...n.animations};function Be(e,t,o){p.useInsertionEffect(()=>e.on(t,o),[e,t,o])}function Ge(e,t){let o;const i=()=>{const{currentTime:r}=t,a=(r===null?0:r.value)/100;o!==a&&e(a),o=a};return n.frame.update(i,!0),()=>n.cancelFrame(i)}const U=new WeakMap;let I;function ct(e,t){if(t){const{inlineSize:o,blockSize:i}=t[0];return{width:o,height:i}}else return e instanceof SVGElement&&"getBBox"in e?e.getBBox():{width:e.offsetWidth,height:e.offsetHeight}}function lt({target:e,contentRect:t,borderBoxSize:o}){var i;(i=U.get(e))===null||i===void 0||i.forEach(r=>{r({target:e,contentSize:t,get size(){return ct(e,o)}})})}function ft(e){e.forEach(lt)}function dt(){typeof ResizeObserver>"u"||(I=new ResizeObserver(ft))}function mt(e,t){I||dt();const o=n.resolveElements(e);return o.forEach(i=>{let r=U.get(i);r||(r=new Set,U.set(i,r)),r.add(t),I==null||I.observe(i)}),()=>{o.forEach(i=>{const r=U.get(i);r==null||r.delete(t),r!=null&&r.size||I==null||I.unobserve(i)})}}const Y=new Set;let _;function pt(){_=()=>{const e={width:window.innerWidth,height:window.innerHeight},t={target:window,size:e,contentSize:e};Y.forEach(o=>o(t))},window.addEventListener("resize",_)}function ht(e){return Y.add(e),_||pt(),()=>{Y.delete(e),!Y.size&&_&&(_=void 0)}}function gt(e,t){return typeof e=="function"?ht(e):mt(e,t)}const yt=50,Se=()=>({current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}),vt=()=>({time:0,x:Se(),y:Se()}),St={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function we(e,t,o,i){const r=o[t],{length:s,position:a}=St[t],c=r.current,u=o.time;r.current=e[`scroll${a}`],r.scrollLength=e[`scroll${s}`]-e[`client${s}`],r.offset.length=0,r.offset[0]=0,r.offset[1]=r.scrollLength,r.progress=n.progress(0,r.scrollLength,r.current);const l=i-u;r.velocity=l>yt?0:n.velocityPerSecond(r.current-c,l)}function wt(e,t,o){we(e,"x",t,o),we(e,"y",t,o),t.time=o}function Ct(e,t){const o={x:0,y:0};let i=e;for(;i&&i!==t;)if(i instanceof HTMLElement)o.x+=i.offsetLeft,o.y+=i.offsetTop,i=i.offsetParent;else if(i.tagName==="svg"){const r=i.getBoundingClientRect();i=i.parentElement;const s=i.getBoundingClientRect();o.x+=r.left-s.left,o.y+=r.top-s.top}else if(i instanceof SVGGraphicsElement){const{x:r,y:s}=i.getBBox();o.x+=r,o.y+=s;let a=null,c=i.parentNode;for(;!a;)c.tagName==="svg"&&(a=c),c=i.parentNode;i=a}else break;return o}const ne={start:0,center:.5,end:1};function Ce(e,t,o=0){let i=0;if(e in ne&&(e=ne[e]),typeof e=="string"){const r=parseFloat(e);e.endsWith("px")?i=r:e.endsWith("%")?e=r/100:e.endsWith("vw")?i=r/100*document.documentElement.clientWidth:e.endsWith("vh")?i=r/100*document.documentElement.clientHeight:e=r}return typeof e=="number"&&(i=t*e),o+i}const Et=[0,0];function Mt(e,t,o,i){let r=Array.isArray(e)?e:Et,s=0,a=0;return typeof e=="number"?r=[e,e]:typeof e=="string"&&(e=e.trim(),e.includes(" ")?r=e.split(" "):r=[e,ne[e]?e:"0"]),s=Ce(r[0],o,i),a=Ce(r[1],t),s-a}const At={All:[[0,0],[1,1]]},Vt={x:0,y:0};function xt(e){return"getBBox"in e&&e.tagName!=="svg"?e.getBBox():{width:e.clientWidth,height:e.clientHeight}}function bt(e,t,o){const{offset:i=At.All}=o,{target:r=e,axis:s="y"}=o,a=s==="y"?"height":"width",c=r!==e?Ct(r,e):Vt,u=r===e?{width:e.scrollWidth,height:e.scrollHeight}:xt(r),l={width:e.clientWidth,height:e.clientHeight};t[s].offset.length=0;let f=!t[s].interpolate;const m=i.length;for(let d=0;d<m;d++){const h=Mt(i[d],l[a],u[a],c[s]);!f&&h!==t[s].interpolatorOffsets[d]&&(f=!0),t[s].offset[d]=h}f&&(t[s].interpolate=n.interpolate(t[s].offset,n.defaultOffset(i),{clamp:!1}),t[s].interpolatorOffsets=[...t[s].offset]),t[s].progress=n.clamp(0,1,t[s].interpolate(t[s].current))}function It(e,t=e,o){if(o.x.targetOffset=0,o.y.targetOffset=0,t!==e){let i=t;for(;i&&i!==e;)o.x.targetOffset+=i.offsetLeft,o.y.targetOffset+=i.offsetTop,i=i.offsetParent}o.x.targetLength=t===e?t.scrollWidth:t.clientWidth,o.y.targetLength=t===e?t.scrollHeight:t.clientHeight,o.x.containerLength=e.clientWidth,o.y.containerLength=e.clientHeight,process.env.NODE_ENV!=="production"&&e&&t&&t!==e&&n.warnOnce(getComputedStyle(e).position!=="static","Please ensure that the container has a non-static position, like 'relative', 'fixed', or 'absolute' to ensure scroll offset is calculated correctly.")}function Tt(e,t,o,i={}){return{measure:()=>It(e,i.target,o),update:r=>{wt(e,o,r),(i.offset||i.target)&&bt(e,o,i)},notify:()=>t(o)}}const G=new WeakMap,Ee=new WeakMap,ee=new WeakMap,Me=e=>e===document.documentElement?window:e;function J(e,{container:t=document.documentElement,...o}={}){let i=ee.get(t);i||(i=new Set,ee.set(t,i));const r=vt(),s=Tt(t,e,r,o);if(i.add(s),!G.has(t)){const c=()=>{for(const d of i)d.measure()},u=()=>{for(const d of i)d.update(n.frameData.timestamp)},l=()=>{for(const d of i)d.notify()},f=()=>{n.frame.read(c,!1,!0),n.frame.read(u,!1,!0),n.frame.update(l,!1,!0)};G.set(t,f);const m=Me(t);window.addEventListener("resize",f,{passive:!0}),t!==document.documentElement&&Ee.set(t,gt(t,f)),m.addEventListener("scroll",f,{passive:!0})}const a=G.get(t);return n.frame.read(a,!1,!0),()=>{var c;n.cancelFrame(a);const u=ee.get(t);if(!u||(u.delete(s),u.size))return;const l=G.get(t);G.delete(t),l&&(Me(t).removeEventListener("scroll",l),(c=Ee.get(t))===null||c===void 0||c(),window.removeEventListener("resize",l))}}function Ot({source:e,container:t,axis:o="y"}){e&&(t=e);const i={value:0},r=J(s=>{i.value=s[o].progress*100},{container:t,axis:o});return{currentTime:i,cancel:r}}const te=new Map;function He({source:e,container:t=document.documentElement,axis:o="y"}={}){e&&(t=e),te.has(t)||te.set(t,{});const i=te.get(t);return i[o]||(i[o]=n.supportsScrollTimeline()?new ScrollTimeline({source:t,axis:o}):Ot({source:t,axis:o})),i[o]}function Pt(e){return e.length===2}function _e(e){return e&&(e.target||e.offset)}function Lt(e,t){return Pt(e)||_e(t)?J(o=>{e(o[t.axis].progress,o)},t):Ge(e,He(t))}function Dt(e,t){if(e.flatten(),_e(t))return e.pause(),J(o=>{e.time=e.duration*o[t.axis].progress},t);{const o=He(t);return e.attachTimeline?e.attachTimeline(o,i=>(i.pause(),Ge(r=>{i.time=i.duration*r},o))):n.noop}}function je(e,{axis:t="y",...o}={}){const i={axis:t,...o};return typeof e=="function"?Lt(e,i):Dt(e,i)}function Ae(e,t){n.warning(!!(!t||t.current),`You have defined a ${e} options but the provided ref is not yet hydrated, probably because it's defined higher up the tree. Try calling useScroll() in the same component as the ref, or setting its \`layoutEffect: false\` option.`)}const Rt=()=>({scrollX:n.motionValue(0),scrollY:n.motionValue(0),scrollXProgress:n.motionValue(0),scrollYProgress:n.motionValue(0)});function ae({container:e,target:t,layoutEffect:o=!0,...i}={}){const r=n.useConstant(Rt);return(o?n.useIsomorphicLayoutEffect:p.useEffect)(()=>(Ae("target",t),Ae("container",e),je((a,{x:c,y:u})=>{r.scrollX.set(c.current),r.scrollXProgress.set(c.progress),r.scrollY.set(u.current),r.scrollYProgress.set(u.progress)},{...i,container:(e==null?void 0:e.current)||void 0,target:(t==null?void 0:t.current)||void 0})),[e,t,JSON.stringify(i.offset)]),r}function Ft(e){return process.env.NODE_ENV==="development"&&n.warnOnce(!1,"useElementScroll is deprecated. Convert to useScroll({ container: ref })."),ae({container:e})}function zt(){return process.env.NODE_ENV!=="production"&&n.warnOnce(!1,"useViewportScroll is deprecated. Convert to useScroll()."),ae()}function T(e){const t=n.useConstant(()=>n.motionValue(e)),{isStatic:o}=p.useContext(n.MotionConfigContext);if(o){const[,i]=p.useState(e);p.useEffect(()=>t.on("change",i),[])}return t}function ue(e,t){const o=T(t()),i=()=>o.set(t());return i(),n.useIsomorphicLayoutEffect(()=>{const r=()=>n.frame.preRender(i,!1,!0),s=e.map(a=>a.on("change",r));return()=>{s.forEach(a=>a()),n.cancelFrame(i)}}),o}function Wt(e,...t){const o=e.length;function i(){let r="";for(let s=0;s<o;s++){r+=e[s];const a=t[s];a&&(r+=n.isMotionValue(a)?a.get():a)}return r}return ue(t.filter(n.isMotionValue),i)}function Bt(e,t={}){const{isStatic:o}=p.useContext(n.MotionConfigContext),i=p.useRef(null),r=n.useConstant(()=>n.isMotionValue(e)?e.get():e),s=n.useConstant(()=>typeof r=="string"?r.replace(/[\d.-]/g,""):void 0),a=T(r),c=p.useRef(r),u=p.useRef(n.noop),l=()=>{f(),i.current=n.animateValue({keyframes:[xe(a.get()),xe(c.current)],velocity:a.getVelocity(),type:"spring",restDelta:.001,restSpeed:.01,...t,onUpdate:u.current})},f=()=>{i.current&&i.current.stop()};return p.useInsertionEffect(()=>a.attach((m,d)=>o?d(m):(c.current=m,u.current=h=>d(Ve(h,s)),n.frame.postRender(l),a.get()),f),[JSON.stringify(t)]),n.useIsomorphicLayoutEffect(()=>{if(n.isMotionValue(e))return e.on("change",m=>a.set(Ve(m,s)))},[a,s]),a}function Ve(e,t){return t?e+t:e}function xe(e){return typeof e=="number"?e:parseFloat(e)}function ke(e){const t=p.useRef(0),{isStatic:o}=p.useContext(n.MotionConfigContext);p.useEffect(()=>{if(o)return;const i=({timestamp:r,delta:s})=>{t.current||(t.current=r),e(r-t.current,s)};return n.frame.update(i,!0),()=>n.cancelFrame(i)},[e])}function Gt(){const e=T(0);return ke(t=>e.set(t)),e}const Ht=e=>e&&typeof e=="object"&&e.mix,_t=e=>Ht(e)?e.mix:void 0;function Ne(...e){const t=!Array.isArray(e[0]),o=t?0:-1,i=e[0+o],r=e[1+o],s=e[2+o],a=e[3+o],c=n.interpolate(r,s,{mixer:_t(s[0]),...a});return t?c(i):c}function jt(e){n.collectMotionValues.current=[],e();const t=ue(n.collectMotionValues.current,e);return n.collectMotionValues.current=void 0,t}function q(e,t,o,i){if(typeof e=="function")return jt(e);const r=typeof t=="function"?t:Ne(t,o,i);return Array.isArray(e)?be(e,r):be([e],([s])=>r(s))}function be(e,t){const o=n.useConstant(()=>[]);return ue(e,()=>{o.length=0;const i=e.length;for(let r=0;r<i;r++)o[r]=e[r].get();return t(o)})}function kt(e){const t=T(e.getVelocity()),o=()=>{const i=e.getVelocity();t.set(i),i&&n.frame.update(o)};return Be(e,"change",()=>{n.frame.update(o,!1,!0)}),t}function Ue(){!n.hasReducedMotionListener.current&&n.initPrefersReducedMotion();const[e]=p.useState(n.prefersReducedMotion.current);return process.env.NODE_ENV!=="production"&&n.warnOnce(e!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),e}function Nt(){const e=Ue(),{reducedMotion:t}=p.useContext(n.MotionConfigContext);return t==="never"?!1:t==="always"?!0:e}function Ut(e){e.values.forEach(t=>t.stop())}function oe(e,t){[...t].reverse().forEach(i=>{const r=e.getVariant(i);r&&n.setTarget(e,r),e.variantChildren&&e.variantChildren.forEach(s=>{oe(s,t)})})}function Yt(e,t){if(Array.isArray(t))return oe(e,t);if(typeof t=="string")return oe(e,[t]);n.setTarget(e,t)}function Ye(){let e=!1;const t=new Set,o={subscribe(i){return t.add(i),()=>void t.delete(i)},start(i,r){n.invariant(e,"controls.start() should only be called after a component has mounted. Consider calling within a useEffect hook.");const s=[];return t.forEach(a=>{s.push(n.animateVisualElement(a,i,{transitionOverride:r}))}),Promise.all(s)},set(i){return n.invariant(e,"controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook."),t.forEach(r=>{Yt(r,i)})},stop(){t.forEach(i=>{Ut(i)})},mount(){return e=!0,()=>{e=!1,o.stop()}}};return o}function ce(e){return p.useEffect(()=>()=>e(),[])}const le=(e,t,o)=>{const i=t-e;return((o-e)%i+i)%i+e};function Xe(e,t){return n.isEasingArray(e)?e[le(0,e.length,t)]:e}function fe(e){return typeof e=="object"&&!Array.isArray(e)}function $e(e,t,o,i){return typeof e=="string"&&fe(t)?n.resolveElements(e,o,i):e instanceof NodeList?Array.from(e):Array.isArray(e)?e:[e]}function Xt(e,t,o){return e*(t+1)}function Ie(e,t,o,i){var r;return typeof t=="number"?t:t.startsWith("-")||t.startsWith("+")?Math.max(0,e+parseFloat(t)):t==="<"?o:(r=i.get(t))!==null&&r!==void 0?r:e}function $t(e,t,o){for(let i=0;i<e.length;i++){const r=e[i];r.at>t&&r.at<o&&(n.removeItem(e,r),i--)}}function Kt(e,t,o,i,r,s){$t(e,r,s);for(let a=0;a<t.length;a++)e.push({value:t[a],at:n.mixNumber(r,s,i[a]),easing:Xe(o,a)})}function qt(e,t){for(let o=0;o<e.length;o++)e[o]=e[o]/(t+1)}function Jt(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}const Qt="easeInOut",Zt=20;function en(e,{defaultTransition:t={},...o}={},i,r){const s=t.duration||.3,a=new Map,c=new Map,u={},l=new Map;let f=0,m=0,d=0;for(let h=0;h<e.length;h++){const g=e[h];if(typeof g=="string"){l.set(g,m);continue}else if(!Array.isArray(g)){l.set(g.name,Ie(m,g.at,f,l));continue}let[y,v,S={}]=g;S.at!==void 0&&(m=Ie(m,S.at,f,l));let w=0;const P=(M,A,x,D=0,R=0)=>{const C=tn(M),{delay:Q=0,times:V=n.defaultOffset(C),type:Z="keyframes",repeat:F,repeatType:io,repeatDelay:ro=0,...ot}=A;let{ease:b=t.ease||"easeOut",duration:E}=A;const me=typeof Q=="function"?Q(D,R):Q,pe=C.length,he=n.isGenerator(Z)?Z:r==null?void 0:r[Z];if(pe<=2&&he){let z=100;if(pe===2&&rn(C)){const W=C[1]-C[0];z=Math.abs(W)}const j={...ot};E!==void 0&&(j.duration=n.secondsToMilliseconds(E));const k=We(j,z,he);b=k.ease,E=k.duration}E??(E=s);const ge=m+me;V.length===1&&V[0]===0&&(V[1]=1);const ye=V.length-C.length;if(ye>0&&n.fillOffset(V,ye),C.length===1&&C.unshift(null),F){n.invariant(F<Zt,"Repeat count too high, must be less than 20"),E=Xt(E,F);const z=[...C],j=[...V];b=Array.isArray(b)?[...b]:[b];const k=[...b];for(let W=0;W<F;W++){C.push(...z);for(let B=0;B<z.length;B++)V.push(j[B]+(W+1)),b.push(B===0?"linear":Xe(k,B-1))}qt(V,F)}const ve=ge+E;Kt(x,C,b,V,ge,ve),w=Math.max(me+E,w),d=Math.max(ve,d)};if(n.isMotionValue(y)){const M=Te(y,c);P(v,S,Oe("default",M))}else{const M=$e(y,v,i,u),A=M.length;for(let x=0;x<A;x++){v=v,S=S;const D=M[x],R=Te(D,c);for(const C in v)P(v[C],nn(S,C),Oe(C,R),x,A)}}f=m,m+=w}return c.forEach((h,g)=>{for(const y in h){const v=h[y];v.sort(Jt);const S=[],w=[],P=[];for(let A=0;A<v.length;A++){const{at:x,value:D,easing:R}=v[A];S.push(D),w.push(n.progress(0,d,x)),P.push(R||"easeOut")}w[0]!==0&&(w.unshift(0),S.unshift(S[0]),P.unshift(Qt)),w[w.length-1]!==1&&(w.push(1),S.push(null)),a.has(g)||a.set(g,{keyframes:{},transition:{}});const M=a.get(g);M.keyframes[y]=S,M.transition[y]={...t,duration:d,ease:P,times:w,...o}}}),a}function Te(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function Oe(e,t){return t[e]||(t[e]=[]),t[e]}function tn(e){return Array.isArray(e)?e:[e]}function nn(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}const on=e=>typeof e=="number",rn=e=>e.every(on);function sn(e,t){return e in t}class an extends n.VisualElement{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,o){if(sn(o,t)){const i=t[o];if(typeof i=="string"||typeof i=="number")return i}}getBaseTargetFromProps(){}removeValueFromRenderState(t,o){delete o.output[t]}measureInstanceViewportBox(){return n.createBox()}build(t,o){Object.assign(t.output,o)}renderInstance(t,{output:o}){Object.assign(t,o)}sortInstanceNodePosition(){return 0}}function un(e){const t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},o=n.isSVGElement(e)?new n.SVGVisualElement(t):new n.HTMLVisualElement(t);o.mount(e),n.visualElementStore.set(e,o)}function cn(e){const t={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},o=new an(t);o.mount(e),n.visualElementStore.set(e,o)}function ln(e,t){return n.isMotionValue(e)||typeof e=="number"||typeof e=="string"&&!fe(t)}function Ke(e,t,o,i){const r=[];if(ln(e,t))r.push(n.animateSingleValue(e,fe(t)&&t.default||t,o&&(o.default||o)));else{const s=$e(e,t,i),a=s.length;n.invariant(!!a,"No valid elements provided.");for(let c=0;c<a;c++){const u=s[c],l=u instanceof Element?un:cn;n.visualElementStore.has(u)||l(u);const f=n.visualElementStore.get(u),m={...o};"delay"in m&&typeof m.delay=="function"&&(m.delay=m.delay(c,a)),r.push(...n.animateTarget(f,{...t,transition:m},{}))}}return r}function fn(e,t,o){const i=[];return en(e,t,o,{spring:n.spring}).forEach(({keyframes:s,transition:a},c)=>{i.push(...Ke(c,s,a))}),i}function dn(e){return Array.isArray(e)&&e.some(Array.isArray)}function de(e){function t(o,i,r){let s=[];dn(o)?s=fn(o,i,e):s=Ke(o,i,r,e);const a=new n.GroupPlaybackControls(s);return e&&e.animations.push(a),a}return t}const mn=de();function pn(){const e=n.useConstant(()=>({current:null,animations:[]})),t=n.useConstant(()=>de(e));return ce(()=>{e.animations.forEach(o=>o.stop())}),[e,t]}function hn(e,t,o){e.style.setProperty(t,o)}function gn(e,t,o){e.style[t]=o}const yn=n.memo(()=>{try{document.createElement("div").animate({opacity:[1]})}catch{return!1}return!0}),X=new WeakMap;function vn(e,t,o){for(let i=0;i<t.length;i++)t[i]===null&&(t[i]=i===0?o():t[i-1]),typeof t[i]=="number"&&n.browserNumberValueTypes[e]&&(t[i]=n.browserNumberValueTypes[e].transform(t[i]));!yn()&&t.length<2&&t.unshift(o())}const Pe="easeOut";function Le(e){const t=X.get(e)||new Map;return X.set(e,t),X.get(e)}class Sn extends st{constructor(t,o,i,r){const s=o.startsWith("--");n.invariant(typeof r.type!="string",`animateMini doesn't support "type" as a string. Did you mean to import { spring } from "framer-motion"?`);const a=Le(t).get(o);a&&a.stop();const c=()=>o.startsWith("--")?t.style.getPropertyValue(o):window.getComputedStyle(t)[o];if(Array.isArray(i)||(i=[i]),vn(o,i,c),n.isGenerator(r.type)){const f=We(r,100,r.type);r.ease=n.supportsLinearEasing()?f.ease:Pe,r.duration=n.secondsToMilliseconds(f.duration),r.type="keyframes"}else r.ease=r.ease||Pe;const u=()=>{this.setValue(t,o,n.getFinalKeyframe(i,r)),this.cancel(),this.resolveFinishedPromise()},l=()=>{this.setValue=s?hn:gn,this.options=r,this.updateFinishedPromise(),this.removeAnimation=()=>{const f=X.get(t);f&&f.delete(o)}};n.supportsWaapi()?(super(n.startWaapiAnimation(t,o,i,r)),l(),r.autoplay===!1&&this.animation.pause(),this.animation.onfinish=u,Le(t).set(o,this)):(super(),l(),u())}then(t,o){return this.currentFinishedPromise.then(t,o)}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}play(){this.state==="finished"&&this.updateFinishedPromise(),super.play()}cancel(){this.removeAnimation(),super.cancel()}}function wn(e,t,o,i){const r=n.resolveElements(e,i),s=r.length;n.invariant(!!s,"No valid element provided.");const a=[];for(let c=0;c<s;c++){const u=r[c],l={...o};typeof l.delay=="function"&&(l.delay=l.delay(c,s));for(const f in t){const m=t[f],d={...n.getValueTransition(l,f)};d.duration=d.duration?n.secondsToMilliseconds(d.duration):d.duration,d.delay=n.secondsToMilliseconds(d.delay||0),a.push(new Sn(u,f,m,d))}}return a}const qe=e=>{function t(o,i,r){return new n.GroupPlaybackControls(wn(o,i,r,e))}return t},Cn=qe();function En(){const e=n.useConstant(()=>({current:null,animations:[]})),t=n.useConstant(()=>qe(e));return ce(()=>{e.animations.forEach(o=>o.stop())}),[e,t]}function Je(){const e=n.useConstant(Ye);return n.useIsomorphicLayoutEffect(e.mount,[]),e}const Mn=Je;function An(){const e=p.useContext(n.PresenceContext);return e?e.custom:void 0}function Vn(e,t,o,i){p.useEffect(()=>{const r=e.current;if(o&&r)return n.addDomEvent(r,t,o,i)},[e,t,o,i])}class Qe{constructor(){this.componentControls=new Set}subscribe(t){return this.componentControls.add(t),()=>this.componentControls.delete(t)}start(t,o){this.componentControls.forEach(i=>{i.start(t.nativeEvent||t,o)})}}const xn=()=>new Qe;function bn(){return n.useConstant(xn)}function Ze(e){return e!==null&&typeof e=="object"&&n.motionComponentSymbol in e}function In(e){if(Ze(e))return e[n.motionComponentSymbol]}function et(){return Tn}function Tn(e){n.rootProjectionNode.current&&(n.rootProjectionNode.current.isUpdating=!1,n.rootProjectionNode.current.blockUpdate(),e&&e())}function On(){return p.useCallback(()=>{const t=n.rootProjectionNode.current;t&&t.resetTree()},[])}function Pn(...e){const t=p.useRef(0),[o,i]=p.useState(e[t.current]),r=p.useCallback(s=>{t.current=typeof s!="number"?le(0,e.length,t.current+1):s,i(e[t.current])},[e.length,...e]);return[o,r]}const Ln={some:0,all:1};function tt(e,t,{root:o,margin:i,amount:r="some"}={}){const s=n.resolveElements(e),a=new WeakMap,c=l=>{l.forEach(f=>{const m=a.get(f.target);if(f.isIntersecting!==!!m)if(f.isIntersecting){const d=t(f.target,f);typeof d=="function"?a.set(f.target,d):u.unobserve(f.target)}else typeof m=="function"&&(m(f),a.delete(f.target))})},u=new IntersectionObserver(c,{root:o,rootMargin:i,threshold:typeof r=="number"?r:Ln[r]});return s.forEach(l=>u.observe(l)),()=>u.disconnect()}function Dn(e,{root:t,margin:o,amount:i,once:r=!1,initial:s=!1}={}){const[a,c]=p.useState(s);return p.useEffect(()=>{if(!e.current||r&&a)return;const u=()=>(c(!0),r?void 0:()=>c(!1)),l={root:t&&t.current||void 0,margin:o,amount:i};return tt(e.current,u,l)},[t,e,o,r,i]),a}function Rn(){const[e,t]=n.useForceUpdate(),o=et(),i=p.useRef(-1);return p.useEffect(()=>{n.frame.postRender(()=>n.frame.postRender(()=>{t===i.current&&(n.instantAnimationState.current=!1)}))},[t]),r=>{o(()=>{n.instantAnimationState.current=!0,e(),r(),i.current=t+1})}}function Fn(){n.instantAnimationState.current=!1}const $=(e,t)=>{const o=n.transformProps.has(t)?"transform":t;return`${e}: ${o}`},O=new Map,H=new Map;function De(e,t,o){var i;const r=$(e,t),s=O.get(r);if(!s)return null;const{animation:a,startTime:c}=s;function u(){var l;(l=window.MotionCancelOptimisedAnimation)===null||l===void 0||l.call(window,e,t,o)}return a.onfinish=u,c===null||!((i=window.MotionHandoffIsComplete)===null||i===void 0)&&i.call(window,e)?(u(),null):c}let N,L;const ie=new Set;function zn(){ie.forEach(e=>{e.animation.play(),e.animation.startTime=e.startTime}),ie.clear()}function Wn(e,t,o,i,r){if(window.MotionIsMounted)return;const s=e.dataset[n.optimizedAppearDataId];if(!s)return;window.MotionHandoffAnimation=De;const a=$(s,t);L||(L=n.startWaapiAnimation(e,t,[o[0],o[0]],{duration:1e4,ease:"linear"}),O.set(a,{animation:L,startTime:null}),window.MotionHandoffAnimation=De,window.MotionHasOptimisedAnimation=(u,l)=>{if(!u)return!1;if(!l)return H.has(u);const f=$(u,l);return!!O.get(f)},window.MotionHandoffMarkAsComplete=u=>{H.has(u)&&H.set(u,!0)},window.MotionHandoffIsComplete=u=>H.get(u)===!0,window.MotionCancelOptimisedAnimation=(u,l,f,m)=>{const d=$(u,l),h=O.get(d);h&&(f&&m===void 0?f.postRender(()=>{f.postRender(()=>{h.animation.cancel()})}):h.animation.cancel(),f&&m?(ie.add(h),f.render(zn)):(O.delete(d),O.size||(window.MotionCancelOptimisedAnimation=void 0)))},window.MotionCheckAppearSync=(u,l,f)=>{var m,d;const h=n.getOptimisedAppearId(u);if(!h)return;const g=(m=window.MotionHasOptimisedAnimation)===null||m===void 0?void 0:m.call(window,h,l),y=(d=u.props.values)===null||d===void 0?void 0:d[l];if(!g||!y)return;const v=f.on("change",S=>{var w;y.get()!==S&&((w=window.MotionCancelOptimisedAnimation)===null||w===void 0||w.call(window,h,l),v())});return v});const c=()=>{L.cancel();const u=n.startWaapiAnimation(e,t,o,i);N===void 0&&(N=performance.now()),u.startTime=N,O.set(a,{animation:u,startTime:N}),r&&r(u)};H.set(s,!1),L.ready?L.ready.then(c).catch(n.noop):c()}const re=()=>({});class Bn extends n.VisualElement{constructor(){super(...arguments),this.measureInstanceViewportBox=n.createBox}build(){}resetTransform(){}restoreTransform(){}removeValueFromRenderState(){}renderInstance(){}scrapeMotionValuesFromProps(){return re()}getBaseTargetFromProps(){}readValueFromInstance(t,o,i){return i.initialState[o]||0}sortInstanceNodePosition(){return 0}}const Gn=n.makeUseVisualState({scrapeMotionValuesFromProps:re,createRenderState:re});function Hn(e){const[t,o]=p.useState(e),i=Gn({},!1),r=n.useConstant(()=>new Bn({props:{onUpdate:a=>{o({...a})}},visualState:i,presenceContext:null},{initialState:e}));p.useLayoutEffect(()=>(r.mount({}),()=>r.unmount()),[r]);const s=n.useConstant(()=>a=>n.animateVisualElement(r,a));return[t,s]}let _n=0;const jn=({children:e})=>(rt.useEffect(()=>{n.invariant(!1,"AnimateSharedLayout is deprecated: https://www.framer.com/docs/guide-upgrade/##shared-layout-animations")},[]),K.jsx(n.LayoutGroup,{id:n.useConstant(()=>`asl-${_n++}`),children:e})),kn=1e5,Re=e=>e>.001?1/e:kn;let Fe=!1;function Nn(e){let t=T(1),o=T(1);const{visualElement:i}=p.useContext(n.MotionContext);n.invariant(!!(e||i),"If no scale values are provided, useInvertedScale must be used within a child of another motion component."),n.warning(Fe,"useInvertedScale is deprecated and will be removed in 3.0. Use the layout prop instead."),Fe=!0,e?(t=e.scaleX||t,o=e.scaleY||o):i&&(t=i.getValue("scaleX",1),o=i.getValue("scaleY",1));const r=q(t,Re),s=q(o,Re);return{scaleX:r,scaleY:s}}const nt=p.createContext(null);function Un(e,t,o,i){if(!i)return e;const r=e.findIndex(f=>f.value===t);if(r===-1)return e;const s=i>0?1:-1,a=e[r+s];if(!a)return e;const c=e[r],u=a.layout,l=n.mixNumber(u.min,u.max,.5);return s===1&&c.layout.max+o>l||s===-1&&c.layout.min+o<l?n.moveItem(e,r,r+s):e}function Yn({children:e,as:t="ul",axis:o="y",onReorder:i,values:r,...s},a){const c=n.useConstant(()=>se[t]),u=[],l=p.useRef(!1);n.invariant(!!r,"Reorder.Group must be provided a values prop");const f={axis:o,registerItem:(m,d)=>{const h=u.findIndex(g=>m===g.value);h!==-1?u[h].layout=d[o]:u.push({value:m,layout:d[o]}),u.sort(Kn)},updateOrder:(m,d,h)=>{if(l.current)return;const g=Un(u,m,d,h);u!==g&&(l.current=!0,i(g.map($n).filter(y=>r.indexOf(y)!==-1)))}};return p.useEffect(()=>{l.current=!1}),K.jsx(c,{...s,ref:a,ignoreStrict:!0,children:K.jsx(nt.Provider,{value:f,children:e})})}const Xn=p.forwardRef(Yn);function $n(e){return e.value}function Kn(e,t){return e.layout.min-t.layout.min}function ze(e,t=0){return n.isMotionValue(e)?e:T(t)}function qn({children:e,style:t={},value:o,as:i="li",onDrag:r,layout:s=!0,...a},c){const u=n.useConstant(()=>se[i]),l=p.useContext(nt),f={x:ze(t.x),y:ze(t.y)},m=q([f.x,f.y],([y,v])=>y||v?1:"unset");n.invariant(!!l,"Reorder.Item must be a child of Reorder.Group");const{axis:d,registerItem:h,updateOrder:g}=l;return K.jsx(u,{drag:d,...a,dragSnapToOrigin:!0,style:{...t,x:f.x,y:f.y,zIndex:m},layout:s,onDrag:(y,v)=>{const{velocity:S}=v;S[d]&&g(o,f[d].get(),S[d]),r&&r(y,v)},onLayoutMeasure:y=>h(o,y),ref:c,ignoreStrict:!0,children:e})}const Jn=p.forwardRef(qn),Qn=Object.freeze(Object.defineProperty({__proto__:null,Group:Xn,Item:Jn},Symbol.toStringTag,{value:"Module"}));function Zn(e,t){if(e==="first")return 0;{const o=t-1;return e==="last"?o:o/2}}function eo(e=.1,{startDelay:t=0,from:o=0,ease:i}={}){return(r,s)=>{const a=typeof o=="number"?o:Zn(o,s),c=Math.abs(a-r);let u=e*c;if(i){const l=s*e;u=n.easingDefinitionToFunction(i)(u/l)*l}return t+u}}const to=n.frame,no=n.stepsOrder.reduce((e,t)=>(e[t]=o=>n.cancelFrame(o),e),{});function oo(e,t="end"){return o=>{o=t==="end"?Math.min(o,.999):Math.max(o,.001);const i=o*e,r=t==="end"?Math.floor(i):Math.ceil(i);return n.clamp(0,1,r/e)}}exports.AcceleratedAnimation=n.AcceleratedAnimation;exports.AnimatePresence=n.AnimatePresence;exports.DeprecatedLayoutGroupContext=n.DeprecatedLayoutGroupContext;exports.FlatTree=n.FlatTree;exports.LayoutGroup=n.LayoutGroup;exports.LayoutGroupContext=n.LayoutGroupContext;exports.LazyMotion=n.LazyMotion;exports.MotionConfig=n.MotionConfig;exports.MotionConfigContext=n.MotionConfigContext;exports.MotionContext=n.MotionContext;exports.MotionGlobalConfig=n.MotionGlobalConfig;exports.MotionValue=n.MotionValue;exports.PresenceContext=n.PresenceContext;exports.SwitchLayoutGroupContext=n.SwitchLayoutGroupContext;exports.VisualElement=n.VisualElement;exports.addPointerEvent=n.addPointerEvent;exports.addPointerInfo=n.addPointerInfo;exports.addScaleCorrector=n.addScaleCorrector;exports.animateValue=n.animateValue;exports.animateVisualElement=n.animateVisualElement;exports.animations=n.animations;exports.anticipate=n.anticipate;exports.backIn=n.backIn;exports.backInOut=n.backInOut;exports.backOut=n.backOut;exports.buildTransform=n.buildTransform;exports.calcLength=n.calcLength;exports.cancelFrame=n.cancelFrame;exports.circIn=n.circIn;exports.circInOut=n.circInOut;exports.circOut=n.circOut;exports.clamp=n.clamp;exports.color=n.color;exports.complex=n.complex;exports.createBox=n.createBox;exports.createRendererMotionComponent=n.createRendererMotionComponent;exports.cubicBezier=n.cubicBezier;exports.delay=n.delay;exports.distance=n.distance;exports.distance2D=n.distance2D;exports.domAnimation=n.domAnimation;exports.domMax=n.domMax;exports.easeIn=n.easeIn;exports.easeInOut=n.easeInOut;exports.easeOut=n.easeOut;exports.filterProps=n.filterProps;exports.findSpring=n.findSpring;exports.frame=n.frame;exports.frameData=n.frameData;exports.frameSteps=n.frameSteps;exports.hover=n.hover;exports.inertia=n.inertia;exports.interpolate=n.interpolate;Object.defineProperty(exports,"invariant",{enumerable:!0,get:()=>n.invariant});exports.isBrowser=n.isBrowser;exports.isDragActive=n.isDragActive;exports.isMotionValue=n.isMotionValue;exports.isValidMotionProp=n.isValidMotionProp;exports.keyframes=n.keyframes;exports.m=n.m;exports.makeUseVisualState=n.makeUseVisualState;exports.mirrorEasing=n.mirrorEasing;exports.mix=n.mix;exports.motionValue=n.motionValue;exports.noop=n.noop;exports.optimizedAppearDataAttribute=n.optimizedAppearDataAttribute;exports.pipe=n.pipe;exports.press=n.press;exports.progress=n.progress;exports.px=n.px;exports.resolveMotionValue=n.resolveMotionValue;exports.reverseEasing=n.reverseEasing;exports.spring=n.spring;exports.time=n.time;exports.useForceUpdate=n.useForceUpdate;exports.useIsPresent=n.useIsPresent;exports.useIsomorphicLayoutEffect=n.useIsomorphicLayoutEffect;exports.usePresence=n.usePresence;exports.useWillChange=n.useWillChange;exports.visualElementStore=n.visualElementStore;exports.AnimateSharedLayout=jn;exports.DragControls=Qe;exports.Reorder=Qn;exports.animate=mn;exports.animateMini=Cn;exports.animationControls=Ye;exports.cancelSync=no;exports.createScopedAnimate=de;exports.disableInstantTransitions=Fn;exports.domMin=ut;exports.inView=tt;exports.isMotionComponent=Ze;exports.motion=se;exports.scroll=je;exports.scrollInfo=J;exports.stagger=eo;exports.startOptimizedAppearAnimation=Wn;exports.steps=oo;exports.sync=to;exports.transform=Ne;exports.unwrapMotionComponent=In;exports.useAnimate=pn;exports.useAnimateMini=En;exports.useAnimation=Mn;exports.useAnimationControls=Je;exports.useAnimationFrame=ke;exports.useCycle=Pn;exports.useDeprecatedAnimatedState=Hn;exports.useDeprecatedInvertedScale=Nn;exports.useDomEvent=Vn;exports.useDragControls=bn;exports.useElementScroll=Ft;exports.useInView=Dn;exports.useInstantLayoutTransition=et;exports.useInstantTransition=Rn;exports.useMotionTemplate=Wt;exports.useMotionValue=T;exports.useMotionValueEvent=Be;exports.usePresenceData=An;exports.useReducedMotion=Ue;exports.useReducedMotionConfig=Nt;exports.useResetProjection=On;exports.useScroll=ae;exports.useSpring=Bt;exports.useTime=Gt;exports.useTransform=q;exports.useUnmountEffect=ce;exports.useVelocity=kt;exports.useViewportScroll=zt;exports.wrap=le;
|