UNPKG

wawa-vfx

Version:

A simple and easy-to-use library for creating visual effects in React Three Fiber.

1 lines 226 kB
(function(_e,de){typeof exports=="object"&&typeof module<"u"?de(exports,require("react/jsx-runtime"),require("@react-three/fiber"),require("react"),require("three"),require("react-dom"),require("react-dom/client")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@react-three/fiber","react","three","react-dom","react-dom/client"],de):(_e=typeof globalThis<"u"?globalThis:_e||self,de(_e["Wawa-VFX"]={},_e["react/jsx-runtime"],_e.reactThreeFiber,_e.React,_e.THREE,_e.ReactDOM,_e.ReactDOMClient))})(this,function(_e,de,In,c,ce,Kt,Qa){"use strict";function Mn(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const be=Mn(c),Gt=Mn(ce),ec=Mn(Kt);function go(e,t){return e+Math.floor(Math.random()*(t-e+1))}function ye(e,t){return e+Math.random()*(t-e)}function pe(){return pe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pe.apply(null,arguments)}function tc(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function mo(...e){return t=>e.forEach(n=>tc(n,t))}function ut(...e){return c.useCallback(mo(...e),e)}const vo=c.forwardRef((e,t)=>{const{children:n,...r}=e,o=c.Children.toArray(n),i=o.find(nc);if(i){const s=i.props.children,a=o.map(l=>l===i?c.Children.count(s)>1?c.Children.only(null):c.isValidElement(s)?s.props.children:null:l);return c.createElement(jn,pe({},r,{ref:t}),c.isValidElement(s)?c.cloneElement(s,void 0,a):null)}return c.createElement(jn,pe({},r,{ref:t}),n)});vo.displayName="Slot";const jn=c.forwardRef((e,t)=>{const{children:n,...r}=e;return c.isValidElement(n)?c.cloneElement(n,{...rc(r,n.props),ref:mo(t,n.ref)}):c.Children.count(n)>1?c.Children.only(null):null});jn.displayName="SlotClone";const bo=({children:e})=>c.createElement(c.Fragment,null,e);function nc(e){return c.isValidElement(e)&&e.type===bo}function rc(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const Ke=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((e,t)=>{const n=c.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?vo:t;return c.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),c.createElement(a,pe({},s,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function oc(e,t){e&&Kt.flushSync(()=>e.dispatchEvent(t))}const ic=c.forwardRef((e,t)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...o}=e;return r?Kt.createPortal(c.createElement(Ke.div,pe({},o,{ref:t})),r):null});var yo=Object.prototype.hasOwnProperty;function Ct(e,t){var n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&Ct(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(yo.call(e,n)&&++r&&!yo.call(t,n)||!(n in t)||!Ct(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}function Xt(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}var Jt=function(t,n,r,o){this.name=t,this.fn=n,this.args=r,this.modifiers=o};Jt.prototype._test=function(t){var n=this.fn;try{ft(this.modifiers.slice(),n,this)(t)}catch{n=function(){return!1}}try{return ft(this.modifiers.slice(),n,this)(t)}catch{return!1}},Jt.prototype._check=function(t){try{ft(this.modifiers.slice(),this.fn,this)(t)}catch{if(ft(this.modifiers.slice(),function(r){return r},this)(!1))return}if(!ft(this.modifiers.slice(),this.fn,this)(t))throw null},Jt.prototype._testAsync=function(t){var n=this;return new Promise(function(r,o){$o(n.modifiers.slice(),n.fn,n)(t).then(function(i){i?r(t):o(null)}).catch(function(i){return o(i)})})};function wo(e,t){return t===void 0&&(t="simple"),typeof e=="object"?e[t]:e}function ft(e,t,n){if(e.length){var r=e.shift(),o=ft(e,t,n);return r.perform(o,n)}else return wo(t)}function $o(e,t,n){if(e.length){var r=e.shift(),o=$o(e,t,n);return r.performAsync(o,n)}else return function(i){return Promise.resolve(wo(t,"async")(i))}}var sc=function(t,n,r){this.name=t,this.perform=n,this.performAsync=r},Ln=function(e){function t(n,r,o,i){for(var s=[],a=arguments.length-4;a-- >0;)s[a]=arguments[a+4];e.call(this,s),e.captureStackTrace&&e.captureStackTrace(this,t),this.rule=n,this.value=r,this.cause=o,this.target=i}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Error),Me=function(t,n){t===void 0&&(t=[]),n===void 0&&(n=[]),this.chain=t,this.nextRuleModifiers=n};Me.prototype._applyRule=function(t,n){var r=this;return function(){for(var o=[],i=arguments.length;i--;)o[i]=arguments[i];return r.chain.push(new Jt(n,t.apply(r,o),o,r.nextRuleModifiers)),r.nextRuleModifiers=[],r}},Me.prototype._applyModifier=function(t,n){return this.nextRuleModifiers.push(new sc(n,t.simple,t.async)),this},Me.prototype._clone=function(){return new Me(this.chain.slice(),this.nextRuleModifiers.slice())},Me.prototype.test=function(t){return this.chain.every(function(n){return n._test(t)})},Me.prototype.testAll=function(t){var n=[];return this.chain.forEach(function(r){try{r._check(t)}catch(o){n.push(new Ln(r,t,o))}}),n},Me.prototype.check=function(t){this.chain.forEach(function(n){try{n._check(t)}catch(r){throw new Ln(n,t,r)}})},Me.prototype.testAsync=function(t){var n=this;return new Promise(function(r,o){Eo(t,n.chain.slice(),r,o)})};function Eo(e,t,n,r){if(t.length){var o=t.shift();o._testAsync(e).then(function(){Eo(e,t,n,r)},function(i){r(new Ln(o,e,i))})}else n(e)}var xo=function(e,t){return t&&typeof e=="string"&&e.trim().length===0?!0:e==null};function ac(e,t){return t===void 0&&(t=!1),{simple:function(n){return xo(n,t)||e.check(n)===void 0},async:function(n){return xo(n,t)||e.testAsync(n)}}}function xe(){return typeof Proxy<"u"?So(new Me):Nn(new Me)}var _t={};xe.extend=function(e){Object.assign(_t,e)},xe.clearCustomRules=function(){_t={}};function So(e){return new Proxy(e,{get:function(n,r){if(r in n)return n[r];var o=So(e._clone());if(r in Zt)return o._applyModifier(Zt[r],r);if(r in _t)return o._applyRule(_t[r],r);if(r in zn)return o._applyRule(zn[r],r)}})}function Nn(e){var t=function(o,i){return Object.keys(o).forEach(function(s){i[s]=function(){for(var a=[],l=arguments.length;l--;)a[l]=arguments[l];var u=Nn(i._clone()),f=u._applyRule(o[s],s).apply(void 0,a);return f}}),i},n=t(zn,e),r=t(_t,n);return Object.keys(Zt).forEach(function(o){Object.defineProperty(r,o,{get:function(){var i=Nn(r._clone());return i._applyModifier(Zt[o],o)}})}),r}var Zt={not:{simple:function(e){return function(t){return!e(t)}},async:function(e){return function(t){return Promise.resolve(e(t)).then(function(n){return!n}).catch(function(){return!0})}}},some:{simple:function(e){return function(t){return Qt(t).some(function(n){try{return e(n)}catch{return!1}})}},async:function(e){return function(t){return Promise.all(Qt(t).map(function(n){try{return e(n).catch(function(){return!1})}catch{return!1}})).then(function(n){return n.some(Boolean)})}}},every:{simple:function(e){return function(t){return t!==!1&&Qt(t).every(e)}},async:function(e){return function(t){return Promise.all(Qt(t).map(e)).then(function(n){return n.every(Boolean)})}}},strict:{simple:function(e,t){return function(n){return Co(t)&&n&&typeof n=="object"?Object.keys(t.args[0]).length===Object.keys(n).length&&e(n):e(n)}},async:function(e,t){return function(n){return Promise.resolve(e(n)).then(function(r){return Co(t)&&n&&typeof n=="object"?Object.keys(t.args[0]).length===Object.keys(n).length&&r:r}).catch(function(){return!1})}}}};function Co(e){return e&&e.name==="schema"&&e.args.length>0&&typeof e.args[0]=="object"}function Qt(e){return typeof e=="string"?e.split(""):e}var zn={equal:function(e){return function(t){return t==e}},exact:function(e){return function(t){return t===e}},number:function(e){return e===void 0&&(e=!0),function(t){return typeof t=="number"&&(e||isFinite(t))}},integer:function(){return function(e){var t=Number.isInteger||cc;return t(e)}},numeric:function(){return function(e){return!isNaN(parseFloat(e))&&isFinite(e)}},string:function(){return dt("string")},boolean:function(){return dt("boolean")},undefined:function(){return dt("undefined")},null:function(){return dt("null")},array:function(){return dt("array")},object:function(){return dt("object")},instanceOf:function(e){return function(t){return t instanceof e}},pattern:function(e){return function(t){return e.test(t)}},lowercase:function(){return function(e){return typeof e=="boolean"||e===e.toLowerCase()&&e.trim()!==""}},uppercase:function(){return function(e){return e===e.toUpperCase()&&e.trim()!==""}},vowel:function(){return function(e){return/^[aeiou]+$/i.test(e)}},consonant:function(){return function(e){return/^(?=[^aeiou])([a-z]+)$/i.test(e)}},first:function(e){return function(t){return t[0]==e}},last:function(e){return function(t){return t[t.length-1]==e}},empty:function(){return function(e){return e.length===0}},length:function(e,t){return function(n){return n.length>=e&&n.length<=(t||e)}},minLength:function(e){return function(t){return t.length>=e}},maxLength:function(e){return function(t){return t.length<=e}},negative:function(){return function(e){return e<0}},positive:function(){return function(e){return e>=0}},between:function(e,t){return function(n){return n>=e&&n<=t}},range:function(e,t){return function(n){return n>=e&&n<=t}},lessThan:function(e){return function(t){return t<e}},lessThanOrEqual:function(e){return function(t){return t<=e}},greaterThan:function(e){return function(t){return t>e}},greaterThanOrEqual:function(e){return function(t){return t>=e}},even:function(){return function(e){return e%2===0}},odd:function(){return function(e){return e%2!==0}},includes:function(e){return function(t){return~t.indexOf(e)}},schema:function(e){return lc(e)},passesAnyOf:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return function(n){return e.some(function(r){return r.test(n)})}},optional:ac};function dt(e){return function(t){return Array.isArray(t)&&e==="array"||t===null&&e==="null"||typeof t===e}}function cc(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e}function lc(e){return{simple:function(t){var n=[];if(Object.keys(e).forEach(function(r){var o=e[r];try{o.check((t||{})[r])}catch(i){i.target=r,n.push(i)}}),n.length>0)throw n;return!0},async:function(t){var n=[],r=Object.keys(e).map(function(o){var i=e[o];return i.testAsync((t||{})[o]).catch(function(s){s.target=o,n.push(s)})});return Promise.all(r).then(function(){if(n.length>0)throw n;return!0})}}}var Q="colors",we="sizes",D="space",uc={gap:D,gridGap:D,columnGap:D,gridColumnGap:D,rowGap:D,gridRowGap:D,inset:D,insetBlock:D,insetBlockEnd:D,insetBlockStart:D,insetInline:D,insetInlineEnd:D,insetInlineStart:D,margin:D,marginTop:D,marginRight:D,marginBottom:D,marginLeft:D,marginBlock:D,marginBlockEnd:D,marginBlockStart:D,marginInline:D,marginInlineEnd:D,marginInlineStart:D,padding:D,paddingTop:D,paddingRight:D,paddingBottom:D,paddingLeft:D,paddingBlock:D,paddingBlockEnd:D,paddingBlockStart:D,paddingInline:D,paddingInlineEnd:D,paddingInlineStart:D,top:D,right:D,bottom:D,left:D,scrollMargin:D,scrollMarginTop:D,scrollMarginRight:D,scrollMarginBottom:D,scrollMarginLeft:D,scrollMarginX:D,scrollMarginY:D,scrollMarginBlock:D,scrollMarginBlockEnd:D,scrollMarginBlockStart:D,scrollMarginInline:D,scrollMarginInlineEnd:D,scrollMarginInlineStart:D,scrollPadding:D,scrollPaddingTop:D,scrollPaddingRight:D,scrollPaddingBottom:D,scrollPaddingLeft:D,scrollPaddingX:D,scrollPaddingY:D,scrollPaddingBlock:D,scrollPaddingBlockEnd:D,scrollPaddingBlockStart:D,scrollPaddingInline:D,scrollPaddingInlineEnd:D,scrollPaddingInlineStart:D,fontSize:"fontSizes",background:Q,backgroundColor:Q,backgroundImage:Q,borderImage:Q,border:Q,borderBlock:Q,borderBlockEnd:Q,borderBlockStart:Q,borderBottom:Q,borderBottomColor:Q,borderColor:Q,borderInline:Q,borderInlineEnd:Q,borderInlineStart:Q,borderLeft:Q,borderLeftColor:Q,borderRight:Q,borderRightColor:Q,borderTop:Q,borderTopColor:Q,caretColor:Q,color:Q,columnRuleColor:Q,fill:Q,outline:Q,outlineColor:Q,stroke:Q,textDecorationColor:Q,fontFamily:"fonts",fontWeight:"fontWeights",lineHeight:"lineHeights",letterSpacing:"letterSpacings",blockSize:we,minBlockSize:we,maxBlockSize:we,inlineSize:we,minInlineSize:we,maxInlineSize:we,width:we,minWidth:we,maxWidth:we,height:we,minHeight:we,maxHeight:we,flexBasis:we,gridTemplateColumns:we,gridTemplateRows:we,borderWidth:"borderWidths",borderTopWidth:"borderWidths",borderRightWidth:"borderWidths",borderBottomWidth:"borderWidths",borderLeftWidth:"borderWidths",borderStyle:"borderStyles",borderTopStyle:"borderStyles",borderRightStyle:"borderStyles",borderBottomStyle:"borderStyles",borderLeftStyle:"borderStyles",borderRadius:"radii",borderTopLeftRadius:"radii",borderTopRightRadius:"radii",borderBottomRightRadius:"radii",borderBottomLeftRadius:"radii",boxShadow:"shadows",textShadow:"shadows",transition:"transitions",zIndex:"zIndices"},fc=(e,t)=>typeof t=="function"?{"()":Function.prototype.toString.call(t)}:t,pt=()=>{const e=Object.create(null);return(t,n,...r)=>{const o=(i=>JSON.stringify(i,fc))(t);return o in e?e[o]:e[o]=n(t,...r)}},ot=Symbol.for("sxs.internal"),Fn=(e,t)=>Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)),_o=e=>{for(const t in e)return!0;return!1},{hasOwnProperty:dc}=Object.prototype,Bn=e=>e.includes("-")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase()),pc=/\s+(?![^()]*\))/,ht=e=>t=>e(...typeof t=="string"?String(t).split(pc):[t]),Oo={appearance:e=>({WebkitAppearance:e,appearance:e}),backfaceVisibility:e=>({WebkitBackfaceVisibility:e,backfaceVisibility:e}),backdropFilter:e=>({WebkitBackdropFilter:e,backdropFilter:e}),backgroundClip:e=>({WebkitBackgroundClip:e,backgroundClip:e}),boxDecorationBreak:e=>({WebkitBoxDecorationBreak:e,boxDecorationBreak:e}),clipPath:e=>({WebkitClipPath:e,clipPath:e}),content:e=>({content:e.includes('"')||e.includes("'")||/^([A-Za-z]+\([^]*|[^]*-quote|inherit|initial|none|normal|revert|unset)$/.test(e)?e:`"${e}"`}),hyphens:e=>({WebkitHyphens:e,hyphens:e}),maskImage:e=>({WebkitMaskImage:e,maskImage:e}),maskSize:e=>({WebkitMaskSize:e,maskSize:e}),tabSize:e=>({MozTabSize:e,tabSize:e}),textSizeAdjust:e=>({WebkitTextSizeAdjust:e,textSizeAdjust:e}),userSelect:e=>({WebkitUserSelect:e,userSelect:e}),marginBlock:ht((e,t)=>({marginBlockStart:e,marginBlockEnd:t||e})),marginInline:ht((e,t)=>({marginInlineStart:e,marginInlineEnd:t||e})),maxSize:ht((e,t)=>({maxBlockSize:e,maxInlineSize:t||e})),minSize:ht((e,t)=>({minBlockSize:e,minInlineSize:t||e})),paddingBlock:ht((e,t)=>({paddingBlockStart:e,paddingBlockEnd:t||e})),paddingInline:ht((e,t)=>({paddingInlineStart:e,paddingInlineEnd:t||e}))},Wn=/([\d.]+)([^]*)/,hc=(e,t)=>e.length?e.reduce((n,r)=>(n.push(...t.map(o=>o.includes("&")?o.replace(/&/g,/[ +>|~]/.test(r)&&/&.*&/.test(o)?`:is(${r})`:r):r+" "+o)),n),[]):t,gc=(e,t)=>e in mc&&typeof t=="string"?t.replace(/^((?:[^]*[^\w-])?)(fit-content|stretch)((?:[^\w-][^]*)?)$/,(n,r,o,i)=>r+(o==="stretch"?`-moz-available${i};${Bn(e)}:${r}-webkit-fill-available`:`-moz-fit-content${i};${Bn(e)}:${r}fit-content`)+i):String(t),mc={blockSize:1,height:1,inlineSize:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,width:1},ze=e=>e?e+"-":"",Po=(e,t,n)=>e.replace(/([+-])?((?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?)?(\$|--)([$\w-]+)/g,(r,o,i,s,a)=>s=="$"==!!i?r:(o||s=="--"?"calc(":"")+"var(--"+(s==="$"?ze(t)+(a.includes("$")?"":ze(n))+a.replace(/\$/g,"-"):a)+")"+(o||s=="--"?"*"+(o||"")+(i||"1")+")":"")),vc=/\s*,\s*(?![^()]*\))/,bc=Object.prototype.toString,gt=(e,t,n,r,o)=>{let i,s,a;const l=(u,f,d)=>{let p,h;const m=g=>{for(p in g){const y=p.charCodeAt(0)===64,E=y&&Array.isArray(g[p])?g[p]:[g[p]];for(h of E){const $=/[A-Z]/.test(b=p)?b:b.replace(/-[^]/g,x=>x[1].toUpperCase()),w=typeof h=="object"&&h&&h.toString===bc&&(!r.utils[$]||!f.length);if($ in r.utils&&!w){const x=r.utils[$];if(x!==s){s=x,m(x(h)),s=null;continue}}else if($ in Oo){const x=Oo[$];if(x!==a){a=x,m(x(h)),a=null;continue}}if(y&&(v=p.slice(1)in r.media?"@media "+r.media[p.slice(1)]:p,p=v.replace(/\(\s*([\w-]+)\s*(=|<|<=|>|>=)\s*([\w-]+)\s*(?:(<|<=|>|>=)\s*([\w-]+)\s*)?\)/g,(x,C,_,M,A,T)=>{const I=Wn.test(C),N=.0625*(I?-1:1),[H,R]=I?[M,C]:[C,M];return"("+(_[0]==="="?"":_[0]===">"===I?"max-":"min-")+H+":"+(_[0]!=="="&&_.length===1?R.replace(Wn,(X,te,ne)=>Number(te)+N*(_===">"?1:-1)+ne):R)+(A?") and ("+(A[0]===">"?"min-":"max-")+H+":"+(A.length===1?T.replace(Wn,(X,te,ne)=>Number(te)+N*(A===">"?-1:1)+ne):T):"")+")"})),w){const x=y?d.concat(p):[...d],C=y?[...f]:hc(f,p.split(vc));i!==void 0&&o(To(...i)),i=void 0,l(h,C,x)}else i===void 0&&(i=[[],f,d]),p=y||p.charCodeAt(0)!==36?p:`--${ze(r.prefix)}${p.slice(1).replace(/\$/g,"-")}`,h=w?h:typeof h=="number"?h&&$ in yc?String(h)+"px":String(h):Po(gc($,h??""),r.prefix,r.themeMap[$]),i[0].push(`${y?`${p} `:`${Bn(p)}:`}${h}`)}}var v,b};m(u),i!==void 0&&o(To(...i)),i=void 0};l(e,t,n)},To=(e,t,n)=>`${n.map(r=>`${r}{`).join("")}${t.length?`${t.join(",")}{`:""}${e.join(";")}${t.length?"}":""}${Array(n.length?n.length+1:0).join("}")}`,yc={animationDelay:1,animationDuration:1,backgroundSize:1,blockSize:1,border:1,borderBlock:1,borderBlockEnd:1,borderBlockEndWidth:1,borderBlockStart:1,borderBlockStartWidth:1,borderBlockWidth:1,borderBottom:1,borderBottomLeftRadius:1,borderBottomRightRadius:1,borderBottomWidth:1,borderEndEndRadius:1,borderEndStartRadius:1,borderInlineEnd:1,borderInlineEndWidth:1,borderInlineStart:1,borderInlineStartWidth:1,borderInlineWidth:1,borderLeft:1,borderLeftWidth:1,borderRadius:1,borderRight:1,borderRightWidth:1,borderSpacing:1,borderStartEndRadius:1,borderStartStartRadius:1,borderTop:1,borderTopLeftRadius:1,borderTopRightRadius:1,borderTopWidth:1,borderWidth:1,bottom:1,columnGap:1,columnRule:1,columnRuleWidth:1,columnWidth:1,containIntrinsicSize:1,flexBasis:1,fontSize:1,gap:1,gridAutoColumns:1,gridAutoRows:1,gridTemplateColumns:1,gridTemplateRows:1,height:1,inlineSize:1,inset:1,insetBlock:1,insetBlockEnd:1,insetBlockStart:1,insetInline:1,insetInlineEnd:1,insetInlineStart:1,left:1,letterSpacing:1,margin:1,marginBlock:1,marginBlockEnd:1,marginBlockStart:1,marginBottom:1,marginInline:1,marginInlineEnd:1,marginInlineStart:1,marginLeft:1,marginRight:1,marginTop:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,offsetDistance:1,offsetRotate:1,outline:1,outlineOffset:1,outlineWidth:1,overflowClipMargin:1,padding:1,paddingBlock:1,paddingBlockEnd:1,paddingBlockStart:1,paddingBottom:1,paddingInline:1,paddingInlineEnd:1,paddingInlineStart:1,paddingLeft:1,paddingRight:1,paddingTop:1,perspective:1,right:1,rowGap:1,scrollMargin:1,scrollMarginBlock:1,scrollMarginBlockEnd:1,scrollMarginBlockStart:1,scrollMarginBottom:1,scrollMarginInline:1,scrollMarginInlineEnd:1,scrollMarginInlineStart:1,scrollMarginLeft:1,scrollMarginRight:1,scrollMarginTop:1,scrollPadding:1,scrollPaddingBlock:1,scrollPaddingBlockEnd:1,scrollPaddingBlockStart:1,scrollPaddingBottom:1,scrollPaddingInline:1,scrollPaddingInlineEnd:1,scrollPaddingInlineStart:1,scrollPaddingLeft:1,scrollPaddingRight:1,scrollPaddingTop:1,shapeMargin:1,textDecoration:1,textDecorationThickness:1,textIndent:1,textUnderlineOffset:1,top:1,transitionDelay:1,transitionDuration:1,verticalAlign:1,width:1,wordSpacing:1},ko=e=>String.fromCharCode(e+(e>25?39:97)),it=e=>(t=>{let n,r="";for(n=Math.abs(t);n>52;n=n/52|0)r=ko(n%52)+r;return ko(n%52)+r})(((t,n)=>{let r=n.length;for(;r;)t=33*t^n.charCodeAt(--r);return t})(5381,JSON.stringify(e))>>>0),Ot=["themed","global","styled","onevar","resonevar","allvar","inline"],wc=e=>{if(e.href&&!e.href.startsWith(location.origin))return!1;try{return!!e.cssRules}catch{return!1}},$c=e=>{let t;const n=()=>{const{cssRules:o}=t.sheet;return[].map.call(o,(i,s)=>{const{cssText:a}=i;let l="";if(a.startsWith("--sxs"))return"";if(o[s-1]&&(l=o[s-1].cssText).startsWith("--sxs")){if(!i.cssRules.length)return"";for(const u in t.rules)if(t.rules[u].group===i)return`--sxs{--sxs:${[...t.rules[u].cache].join(" ")}}${a}`;return i.cssRules.length?`${l}${a}`:""}return a}).join("")},r=()=>{if(t){const{rules:a,sheet:l}=t;if(!l.deleteRule){for(;Object(Object(l.cssRules)[0]).type===3;)l.cssRules.splice(0,1);l.cssRules=[]}for(const u in a)delete a[u]}const o=Object(e).styleSheets||[];for(const a of o)if(wc(a)){for(let l=0,u=a.cssRules;u[l];++l){const f=Object(u[l]);if(f.type!==1)continue;const d=Object(u[l+1]);if(d.type!==4)continue;++l;const{cssText:p}=f;if(!p.startsWith("--sxs"))continue;const h=p.slice(14,-3).trim().split(/\s+/),m=Ot[h[0]];m&&(t||(t={sheet:a,reset:r,rules:{},toString:n}),t.rules[m]={group:d,index:l,cache:new Set(h)})}if(t)break}if(!t){const a=(l,u)=>({type:u,cssRules:[],insertRule(f,d){this.cssRules.splice(d,0,a(f,{import:3,undefined:1}[(f.toLowerCase().match(/^@([a-z]+)/)||[])[1]]||4))},get cssText(){return l==="@media{}"?`@media{${[].map.call(this.cssRules,f=>f.cssText).join("")}}`:l}});t={sheet:e?(e.head||e).appendChild(document.createElement("style")).sheet:a("","text/css"),rules:{},reset:r,toString:n}}const{sheet:i,rules:s}=t;for(let a=Ot.length-1;a>=0;--a){const l=Ot[a];if(!s[l]){const u=Ot[a+1],f=s[u]?s[u].index:i.cssRules.length;i.insertRule("@media{}",f),i.insertRule(`--sxs{--sxs:${a}}`,f),s[l]={group:i.cssRules[f+1],index:f,cache:new Set([a])}}Ec(s[l])}};return r(),t},Ec=e=>{const t=e.group;let n=t.cssRules.length;e.apply=r=>{try{t.insertRule(r,n),++n}catch{}}},Pt=Symbol(),xc=pt(),Ao=(e,t)=>xc(e,()=>(...n)=>{let r={type:null,composers:new Set};for(const o of n)if(o!=null)if(o[ot]){r.type==null&&(r.type=o[ot].type);for(const i of o[ot].composers)r.composers.add(i)}else o.constructor!==Object||o.$$typeof?r.type==null&&(r.type=o):r.composers.add(Sc(o,e));return r.type==null&&(r.type="span"),r.composers.size||r.composers.add(["PJLV",{},[],[],{},[]]),Cc(e,r,t)}),Sc=({variants:e,compoundVariants:t,defaultVariants:n,...r},o)=>{const i=`${ze(o.prefix)}c-${it(r)}`,s=[],a=[],l=Object.create(null),u=[];for(const p in n)l[p]=String(n[p]);if(typeof e=="object"&&e)for(const p in e){f=l,d=p,dc.call(f,d)||(l[p]="undefined");const h=e[p];for(const m in h){const g={[p]:String(m)};String(m)==="undefined"&&u.push(p);const v=h[m],b=[g,v,!_o(v)];s.push(b)}}var f,d;if(typeof t=="object"&&t)for(const p of t){let{css:h,...m}=p;h=typeof h=="object"&&h||{};for(const v in m)m[v]=String(m[v]);const g=[m,h,!_o(h)];a.push(g)}return[i,r,s,a,l,u]},Cc=(e,t,n)=>{const[r,o,i,s]=_c(t.composers),a=typeof t.type=="function"||t.type.$$typeof?(d=>{function p(){for(let h=0;h<p[Pt].length;h++){const[m,g]=p[Pt][h];d.rules[m].apply(g)}return p[Pt]=[],null}return p[Pt]=[],p.rules={},Ot.forEach(h=>p.rules[h]={apply:m=>p[Pt].push([h,m])}),p})(n):null,l=(a||n).rules,u=`.${r}${o.length>1?`:where(.${o.slice(1).join(".")})`:""}`,f=d=>{d=typeof d=="object"&&d||Oc;const{css:p,...h}=d,m={};for(const b in i)if(delete h[b],b in d){let y=d[b];typeof y=="object"&&y?m[b]={"@initial":i[b],...y}:(y=String(y),m[b]=y!=="undefined"||s.has(b)?y:i[b])}else m[b]=i[b];const g=new Set([...o]);for(const[b,y,E,$]of t.composers){n.rules.styled.cache.has(b)||(n.rules.styled.cache.add(b),gt(y,[`.${b}`],[],e,C=>{l.styled.apply(C)}));const w=Do(E,m,e.media),x=Do($,m,e.media,!0);for(const C of w)if(C!==void 0)for(const[_,M,A]of C){const T=`${b}-${it(M)}-${_}`;g.add(T);const I=(A?n.rules.resonevar:n.rules.onevar).cache,N=A?l.resonevar:l.onevar;I.has(T)||(I.add(T),gt(M,[`.${T}`],[],e,H=>{N.apply(H)}))}for(const C of x)if(C!==void 0)for(const[_,M]of C){const A=`${b}-${it(M)}-${_}`;g.add(A),n.rules.allvar.cache.has(A)||(n.rules.allvar.cache.add(A),gt(M,[`.${A}`],[],e,T=>{l.allvar.apply(T)}))}}if(typeof p=="object"&&p){const b=`${r}-i${it(p)}-css`;g.add(b),n.rules.inline.cache.has(b)||(n.rules.inline.cache.add(b),gt(p,[`.${b}`],[],e,y=>{l.inline.apply(y)}))}for(const b of String(d.className||"").trim().split(/\s+/))b&&g.add(b);const v=h.className=[...g].join(" ");return{type:t.type,className:v,selector:u,props:h,toString:()=>v,deferredInjector:a}};return Fn(f,{className:r,selector:u,[ot]:t,toString:()=>(n.rules.styled.cache.has(r)||f(),r)})},_c=e=>{let t="";const n=[],r={},o=[];for(const[i,,,,s,a]of e){t===""&&(t=i),n.push(i),o.push(...a);for(const l in s){const u=s[l];(r[l]===void 0||u!=="undefined"||a.includes(u))&&(r[l]=u)}}return[t,n,r,new Set(o)]},Do=(e,t,n,r)=>{const o=[];e:for(let[i,s,a]of e){if(a)continue;let l,u=0,f=!1;for(l in i){const d=i[l];let p=t[l];if(p!==d){if(typeof p!="object"||!p)continue e;{let h,m,g=0;for(const v in p){if(d===String(p[v])){if(v!=="@initial"){const b=v.slice(1);(m=m||[]).push(b in n?n[b]:v.replace(/^@media ?/,"")),f=!0}u+=g,h=!0}++g}if(m&&m.length&&(s={["@media "+m.join(", ")]:s}),!h)continue e}}}(o[u]=o[u]||[]).push([r?"cv":`${l}-${i[l]}`,s,f])}return o},Oc={},Pc=pt(),Tc=(e,t)=>Pc(e,()=>(...n)=>{const r=()=>{for(let o of n){o=typeof o=="object"&&o||{};let i=it(o);if(!t.rules.global.cache.has(i)){if(t.rules.global.cache.add(i),"@import"in o){let s=[].indexOf.call(t.sheet.cssRules,t.rules.themed.group)-1;for(let a of[].concat(o["@import"]))a=a.includes('"')||a.includes("'")?a:`"${a}"`,t.sheet.insertRule(`@import ${a};`,s++);delete o["@import"]}gt(o,[],[],e,s=>{t.rules.global.apply(s)})}}return""};return Fn(r,{toString:r})}),kc=pt(),Ac=(e,t)=>kc(e,()=>n=>{const r=`${ze(e.prefix)}k-${it(n)}`,o=()=>{if(!t.rules.global.cache.has(r)){t.rules.global.cache.add(r);const i=[];gt(n,[],[],e,a=>i.push(a));const s=`@keyframes ${r}{${i.join("")}}`;t.rules.global.apply(s)}return r};return Fn(o,{get name(){return o()},toString:o})}),Dc=class{constructor(e,t,n,r){this.token=e==null?"":String(e),this.value=t==null?"":String(t),this.scale=n==null?"":String(n),this.prefix=r==null?"":String(r)}get computedValue(){return"var("+this.variable+")"}get variable(){return"--"+ze(this.prefix)+ze(this.scale)+this.token}toString(){return this.computedValue}},Ic=pt(),Mc=(e,t)=>Ic(e,()=>(n,r)=>{r=typeof n=="object"&&n||Object(r);const o=`.${n=(n=typeof n=="string"?n:"")||`${ze(e.prefix)}t-${it(r)}`}`,i={},s=[];for(const l in r){i[l]={};for(const u in r[l]){const f=`--${ze(e.prefix)}${l}-${u}`,d=Po(String(r[l][u]),e.prefix,l);i[l][u]=new Dc(u,d,l,e.prefix),s.push(`${f}:${d}`)}}const a=()=>{if(s.length&&!t.rules.themed.cache.has(n)){t.rules.themed.cache.add(n);const l=`${r===e.theme?":root,":""}.${n}{${s.join(";")}}`;t.rules.themed.apply(l)}return n};return{...i,get className(){return a()},selector:o,toString:a}}),jc=pt(),Lc=pt(),Nc=e=>{const t=(n=>{let r=!1;const o=jc(n,i=>{r=!0;const s="prefix"in(i=typeof i=="object"&&i||{})?String(i.prefix):"",a=typeof i.media=="object"&&i.media||{},l=typeof i.root=="object"?i.root||null:globalThis.document||null,u=typeof i.theme=="object"&&i.theme||{},f={prefix:s,media:a,theme:u,themeMap:typeof i.themeMap=="object"&&i.themeMap||{...uc},utils:typeof i.utils=="object"&&i.utils||{}},d=$c(l),p={css:Ao(f,d),globalCss:Tc(f,d),keyframes:Ac(f,d),createTheme:Mc(f,d),reset(){d.reset(),p.theme.toString()},theme:{},sheet:d,config:f,prefix:s,getCssText:d.toString,toString:d.toString};return String(p.theme=p.createTheme(u)),p});return r||o.reset(),o})(e);return t.styled=(({config:n,sheet:r})=>Lc(n,()=>{const o=Ao(n,r);return(...i)=>{const s=o(...i),a=s[ot].type,l=c.forwardRef((u,f)=>{const d=u&&u.as||a,{props:p,deferredInjector:h}=s(u);return delete p.as,p.ref=f,h?c.createElement(c.Fragment,null,c.createElement(d,p),c.createElement(h,null)):c.createElement(d,p)});return l.className=s.className,l.displayName=`Styled.${a.displayName||a.name||a}`,l.selector=s.selector,l.toString=()=>s.selector,l[ot]=s[ot],l}}))(t),t};function zc(e,t,n){return Math.max(t,Math.min(e,n))}const me={toVector(e,t){return e===void 0&&(e=t),Array.isArray(e)?e:[e,e]},add(e,t){return[e[0]+t[0],e[1]+t[1]]},sub(e,t){return[e[0]-t[0],e[1]-t[1]]},addTo(e,t){e[0]+=t[0],e[1]+=t[1]},subTo(e,t){e[0]-=t[0],e[1]-=t[1]}};function Io(e,t,n){return t===0||Math.abs(t)===1/0?Math.pow(e,n*5):e*t*n/(t+n*e)}function Mo(e,t,n,r=.15){return r===0?zc(e,t,n):e<t?-Io(t-e,n-t,r)+t:e>n?+Io(e-n,n-t,r)+n:e}function Fc(e,[t,n],[r,o]){const[[i,s],[a,l]]=e;return[Mo(t,i,s,r),Mo(n,a,l,o)]}function Bc(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Wc(e){var t=Bc(e,"string");return typeof t=="symbol"?t:String(t)}function Se(e,t,n){return t=Wc(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function oe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jo(Object(n),!0).forEach(function(r){Se(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jo(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}const Lo={pointer:{start:"down",change:"move",end:"up"},mouse:{start:"down",change:"move",end:"up"},touch:{start:"start",change:"move",end:"end"},gesture:{start:"start",change:"change",end:"end"}};function No(e){return e?e[0].toUpperCase()+e.slice(1):""}const Uc=["enter","leave"];function Vc(e=!1,t){return e&&!Uc.includes(t)}function Hc(e,t="",n=!1){const r=Lo[e],o=r&&r[t]||t;return"on"+No(e)+No(o)+(Vc(n,o)?"Capture":"")}const Rc=["gotpointercapture","lostpointercapture"];function Yc(e){let t=e.substring(2).toLowerCase();const n=!!~t.indexOf("passive");n&&(t=t.replace("passive",""));const r=Rc.includes(t)?"capturecapture":"capture",o=!!~t.indexOf(r);return o&&(t=t.replace("capture","")),{device:t,capture:o,passive:n}}function qc(e,t=""){const n=Lo[e],r=n&&n[t]||t;return e+r}function en(e){return"touches"in e}function zo(e){return en(e)?"touch":"pointerType"in e?e.pointerType:"mouse"}function Kc(e){return Array.from(e.touches).filter(t=>{var n,r;return t.target===e.currentTarget||((n=e.currentTarget)===null||n===void 0||(r=n.contains)===null||r===void 0?void 0:r.call(n,t.target))})}function Gc(e){return e.type==="touchend"||e.type==="touchcancel"?e.changedTouches:e.targetTouches}function Fo(e){return en(e)?Gc(e)[0]:e}function Xc(e){return Kc(e).map(t=>t.identifier)}function Un(e){const t=Fo(e);return en(e)?t.identifier:t.pointerId}function Bo(e){const t=Fo(e);return[t.clientX,t.clientY]}function Jc(e){const t={};if("buttons"in e&&(t.buttons=e.buttons),"shiftKey"in e){const{shiftKey:n,altKey:r,metaKey:o,ctrlKey:i}=e;Object.assign(t,{shiftKey:n,altKey:r,metaKey:o,ctrlKey:i})}return t}function tn(e,...t){return typeof e=="function"?e(...t):e}function Zc(){}function Qc(...e){return e.length===0?Zc:e.length===1?e[0]:function(){let t;for(const n of e)t=n.apply(this,arguments)||t;return t}}function Wo(e,t){return Object.assign({},t,e||{})}const el=32;class tl{constructor(t,n,r){this.ctrl=t,this.args=n,this.key=r,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(t){this.ctrl.state[this.key]=t}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:t,shared:n,ingKey:r,args:o}=this;n[r]=t._active=t.active=t._blocked=t._force=!1,t._step=[!1,!1],t.intentional=!1,t._movement=[0,0],t._distance=[0,0],t._direction=[0,0],t._delta=[0,0],t._bounds=[[-1/0,1/0],[-1/0,1/0]],t.args=o,t.axis=void 0,t.memo=void 0,t.elapsedTime=t.timeDelta=0,t.direction=[0,0],t.distance=[0,0],t.overflow=[0,0],t._movementBound=[!1,!1],t.velocity=[0,0],t.movement=[0,0],t.delta=[0,0],t.timeStamp=0}start(t){const n=this.state,r=this.config;n._active||(this.reset(),this.computeInitial(),n._active=!0,n.target=t.target,n.currentTarget=t.currentTarget,n.lastOffset=r.from?tn(r.from,n):n.offset,n.offset=n.lastOffset,n.startTime=n.timeStamp=t.timeStamp)}computeValues(t){const n=this.state;n._values=t,n.values=this.config.transform(t)}computeInitial(){const t=this.state;t._initial=t._values,t.initial=t.values}compute(t){const{state:n,config:r,shared:o}=this;n.args=this.args;let i=0;if(t&&(n.event=t,r.preventDefault&&t.cancelable&&n.event.preventDefault(),n.type=t.type,o.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,o.locked=!!document.pointerLockElement,Object.assign(o,Jc(t)),o.down=o.pressed=o.buttons%2===1||o.touches>0,i=t.timeStamp-n.timeStamp,n.timeStamp=t.timeStamp,n.elapsedTime=n.timeStamp-n.startTime),n._active){const x=n._delta.map(Math.abs);me.addTo(n._distance,x)}this.axisIntent&&this.axisIntent(t);const[s,a]=n._movement,[l,u]=r.threshold,{_step:f,values:d}=n;if(r.hasCustomTransform?(f[0]===!1&&(f[0]=Math.abs(s)>=l&&d[0]),f[1]===!1&&(f[1]=Math.abs(a)>=u&&d[1])):(f[0]===!1&&(f[0]=Math.abs(s)>=l&&Math.sign(s)*l),f[1]===!1&&(f[1]=Math.abs(a)>=u&&Math.sign(a)*u)),n.intentional=f[0]!==!1||f[1]!==!1,!n.intentional)return;const p=[0,0];if(r.hasCustomTransform){const[x,C]=d;p[0]=f[0]!==!1?x-f[0]:0,p[1]=f[1]!==!1?C-f[1]:0}else p[0]=f[0]!==!1?s-f[0]:0,p[1]=f[1]!==!1?a-f[1]:0;this.restrictToAxis&&!n._blocked&&this.restrictToAxis(p);const h=n.offset,m=n._active&&!n._blocked||n.active;m&&(n.first=n._active&&!n.active,n.last=!n._active&&n.active,n.active=o[this.ingKey]=n._active,t&&(n.first&&("bounds"in r&&(n._bounds=tn(r.bounds,n)),this.setup&&this.setup()),n.movement=p,this.computeOffset()));const[g,v]=n.offset,[[b,y],[E,$]]=n._bounds;n.overflow=[g<b?-1:g>y?1:0,v<E?-1:v>$?1:0],n._movementBound[0]=n.overflow[0]?n._movementBound[0]===!1?n._movement[0]:n._movementBound[0]:!1,n._movementBound[1]=n.overflow[1]?n._movementBound[1]===!1?n._movement[1]:n._movementBound[1]:!1;const w=n._active?r.rubberband||[0,0]:[0,0];if(n.offset=Fc(n._bounds,n.offset,w),n.delta=me.sub(n.offset,h),this.computeMovement(),m&&(!n.last||i>el)){n.delta=me.sub(n.offset,h);const x=n.delta.map(Math.abs);me.addTo(n.distance,x),n.direction=n.delta.map(Math.sign),n._direction=n._delta.map(Math.sign),!n.first&&i>0&&(n.velocity=[x[0]/i,x[1]/i],n.timeDelta=i)}}emit(){const t=this.state,n=this.shared,r=this.config;if(t._active||this.clean(),(t._blocked||!t.intentional)&&!t._force&&!r.triggerAllEvents)return;const o=this.handler(oe(oe(oe({},n),t),{},{[this.aliasKey]:t.values}));o!==void 0&&(t.memo=o)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}function nl([e,t],n){const r=Math.abs(e),o=Math.abs(t);if(r>o&&r>n)return"x";if(o>r&&o>n)return"y"}class rl extends tl{constructor(...t){super(...t),Se(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=me.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=me.sub(this.state.offset,this.state.lastOffset)}axisIntent(t){const n=this.state,r=this.config;if(!n.axis&&t){const o=typeof r.axisThreshold=="object"?r.axisThreshold[zo(t)]:r.axisThreshold;n.axis=nl(n._movement,o)}n._blocked=(r.lockDirection||!!r.axis)&&!n.axis||!!r.axis&&r.axis!==n.axis}restrictToAxis(t){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":t[1]=0;break;case"y":t[0]=0;break}}}const Uo=e=>e,Vo=.15,Vn={enabled(e=!0){return e},eventOptions(e,t,n){return oe(oe({},n.shared.eventOptions),e)},preventDefault(e=!1){return e},triggerAllEvents(e=!1){return e},rubberband(e=0){switch(e){case!0:return[Vo,Vo];case!1:return[0,0];default:return me.toVector(e)}},from(e){if(typeof e=="function")return e;if(e!=null)return me.toVector(e)},transform(e,t,n){const r=e||n.shared.transform;if(this.hasCustomTransform=!!r,process.env.NODE_ENV==="development"){const o=r||Uo;return i=>{const s=o(i);return(!isFinite(s[0])||!isFinite(s[1]))&&console.warn(`[@use-gesture]: config.transform() must produce a valid result, but it was: [${s[0]},${[1]}]`),s}}return r||Uo},threshold(e){return me.toVector(e,0)}};process.env.NODE_ENV==="development"&&Object.assign(Vn,{domTarget(e){if(e!==void 0)throw Error("[@use-gesture]: `domTarget` option has been renamed to `target`.");return NaN},lockDirection(e){if(e!==void 0)throw Error("[@use-gesture]: `lockDirection` option has been merged with `axis`. Use it as in `{ axis: 'lock' }`");return NaN},initial(e){if(e!==void 0)throw Error("[@use-gesture]: `initial` option has been renamed to `from`.");return NaN}});const ol=0,Tt=oe(oe({},Vn),{},{axis(e,t,{axis:n}){if(this.lockDirection=n==="lock",!this.lockDirection)return n},axisThreshold(e=ol){return e},bounds(e={}){if(typeof e=="function")return i=>Tt.bounds(e(i));if("current"in e)return()=>e.current;if(typeof HTMLElement=="function"&&e instanceof HTMLElement)return e;const{left:t=-1/0,right:n=1/0,top:r=-1/0,bottom:o=1/0}=e;return[[t,n],[r,o]]}}),Ho={ArrowRight:(e,t=1)=>[e*t,0],ArrowLeft:(e,t=1)=>[-1*e*t,0],ArrowUp:(e,t=1)=>[0,-1*e*t],ArrowDown:(e,t=1)=>[0,e*t]};class il extends rl{constructor(...t){super(...t),Se(this,"ingKey","dragging")}reset(){super.reset();const t=this.state;t._pointerId=void 0,t._pointerActive=!1,t._keyboardActive=!1,t._preventScroll=!1,t._delayed=!1,t.swipe=[0,0],t.tap=!1,t.canceled=!1,t.cancel=this.cancel.bind(this)}setup(){const t=this.state;if(t._bounds instanceof HTMLElement){const n=t._bounds.getBoundingClientRect(),r=t.currentTarget.getBoundingClientRect(),o={left:n.left-r.left+t.offset[0],right:n.right-r.right+t.offset[0],top:n.top-r.top+t.offset[1],bottom:n.bottom-r.bottom+t.offset[1]};t._bounds=Tt.bounds(o)}}cancel(){const t=this.state;t.canceled||(t.canceled=!0,t._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(t){const n=this.config,r=this.state;if(t.buttons!=null&&(Array.isArray(n.pointerButtons)?!n.pointerButtons.includes(t.buttons):n.pointerButtons!==-1&&n.pointerButtons!==t.buttons))return;const o=this.ctrl.setEventIds(t);n.pointerCapture&&t.target.setPointerCapture(t.pointerId),!(o&&o.size>1&&r._pointerActive)&&(this.start(t),this.setupPointer(t),r._pointerId=Un(t),r._pointerActive=!0,this.computeValues(Bo(t)),this.computeInitial(),n.preventScrollAxis&&zo(t)!=="mouse"?(r._active=!1,this.setupScrollPrevention(t)):n.delay>0?(this.setupDelayTrigger(t),n.triggerAllEvents&&(this.compute(t),this.emit())):this.startPointerDrag(t))}startPointerDrag(t){const n=this.state;n._active=!0,n._preventScroll=!0,n._delayed=!1,this.compute(t),this.emit()}pointerMove(t){const n=this.state,r=this.config;if(!n._pointerActive)return;const o=Un(t);if(n._pointerId!==void 0&&o!==n._pointerId)return;const i=Bo(t);if(document.pointerLockElement===t.target?n._delta=[t.movementX,t.movementY]:(n._delta=me.sub(i,n._values),this.computeValues(i)),me.addTo(n._movement,n._delta),this.compute(t),n._delayed&&n.intentional){this.timeoutStore.remove("dragDelay"),n.active=!1,this.startPointerDrag(t);return}if(r.preventScrollAxis&&!n._preventScroll)if(n.axis)if(n.axis===r.preventScrollAxis||r.preventScrollAxis==="xy"){n._active=!1,this.clean();return}else{this.timeoutStore.remove("startPointerDrag"),this.startPointerDrag(t);return}else return;this.emit()}pointerUp(t){this.ctrl.setEventIds(t);try{this.config.pointerCapture&&t.target.hasPointerCapture(t.pointerId)&&t.target.releasePointerCapture(t.pointerId)}catch{process.env.NODE_ENV==="development"&&console.warn("[@use-gesture]: If you see this message, it's likely that you're using an outdated version of `@react-three/fiber`. \n\nPlease upgrade to the latest version.")}const n=this.state,r=this.config;if(!n._active||!n._pointerActive)return;const o=Un(t);if(n._pointerId!==void 0&&o!==n._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(t);const[i,s]=n._distance;if(n.tap=i<=r.tapsThreshold&&s<=r.tapsThreshold,n.tap&&r.filterTaps)n._force=!0;else{const[a,l]=n._delta,[u,f]=n._movement,[d,p]=r.swipe.velocity,[h,m]=r.swipe.distance,g=r.swipe.duration;if(n.elapsedTime<g){const v=Math.abs(a/n.timeDelta),b=Math.abs(l/n.timeDelta);v>d&&Math.abs(u)>h&&(n.swipe[0]=Math.sign(a)),b>p&&Math.abs(f)>m&&(n.swipe[1]=Math.sign(l))}}this.emit()}pointerClick(t){!this.state.tap&&t.detail>0&&(t.preventDefault(),t.stopPropagation())}setupPointer(t){const n=this.config,r=n.device;if(process.env.NODE_ENV==="development")try{if(r==="pointer"&&n.preventScrollDelay===void 0){const o="uv"in t?t.sourceEvent.currentTarget:t.currentTarget;window.getComputedStyle(o).touchAction==="auto"&&console.warn("[@use-gesture]: The drag target has its `touch-action` style property set to `auto`. It is recommended to add `touch-action: 'none'` so that the drag gesture behaves correctly on touch-enabled devices. For more information read this: https://use-gesture.netlify.app/docs/extras/#touch-action.\n\nThis message will only show in development mode. It won't appear in production. If this is intended, you can ignore it.",o)}}catch{}n.pointerLock&&t.currentTarget.requestPointerLock(),n.pointerCapture||(this.eventStore.add(this.sharedConfig.window,r,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(t){this.state._preventScroll&&t.cancelable&&t.preventDefault()}setupScrollPrevention(t){this.state._preventScroll=!1,sl(t);const n=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",n),this.eventStore.add(this.sharedConfig.window,"touch","cancel",n),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,t)}setupDelayTrigger(t){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(t)},this.config.delay)}keyDown(t){const n=Ho[t.key];if(n){const r=this.state,o=t.shiftKey?10:t.altKey?.1:1;this.start(t),r._delta=n(this.config.keyboardDisplacement,o),r._keyboardActive=!0,me.addTo(r._movement,r._delta),this.compute(t),this.emit()}}keyUp(t){t.key in Ho&&(this.state._keyboardActive=!1,this.setActive(),this.compute(t),this.emit())}bind(t){const n=this.config.device;t(n,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(t(n,"change",this.pointerMove.bind(this)),t(n,"end",this.pointerUp.bind(this)),t(n,"cancel",this.pointerUp.bind(this)),t("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(t("key","down",this.keyDown.bind(this)),t("key","up",this.keyUp.bind(this))),this.config.filterTaps&&t("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}}function sl(e){"persist"in e&&typeof e.persist=="function"&&e.persist()}const kt=typeof window<"u"&&window.document&&window.document.createElement;function Ro(){return kt&&"ontouchstart"in window}function al(){return Ro()||kt&&window.navigator.maxTouchPoints>1}function cl(){return kt&&"onpointerdown"in window}function ll(){return kt&&"exitPointerLock"in window.document}function ul(){try{return"constructor"in GestureEvent}catch{return!1}}const Oe={isBrowser:kt,gesture:ul(),touch:Ro(),touchscreen:al(),pointer:cl(),pointerLock:ll()},fl=250,dl=180,pl=.5,hl=50,gl=250,ml=10,Yo={mouse:0,touch:0,pen:8},qo=oe(oe({},Tt),{},{device(e,t,{pointer:{touch:n=!1,lock:r=!1,mouse:o=!1}={}}){return this.pointerLock=r&&Oe.pointerLock,Oe.touch&&n?"touch":this.pointerLock?"mouse":Oe.pointer&&!o?"pointer":Oe.touch?"touch":"mouse"},preventScrollAxis(e,t,{preventScroll:n}){if(this.preventScrollDelay=typeof n=="number"?n:n||n===void 0&&e?fl:void 0,!(!Oe.touchscreen||n===!1))return e||(n!==void 0?"y":void 0)},pointerCapture(e,t,{pointer:{capture:n=!0,buttons:r=1,keys:o=!0}={}}){return this.pointerButtons=r,this.keys=o,!this.pointerLock&&this.device==="pointer"&&n},threshold(e,t,{filterTaps:n=!1,tapsThreshold:r=3,axis:o=void 0}){const i=me.toVector(e,n?r:o?1:0);return this.filterTaps=n,this.tapsThreshold=r,i},swipe({velocity:e=pl,distance:t=hl,duration:n=gl}={}){return{velocity:this.transform(me.toVector(e)),distance:this.transform(me.toVector(t)),duration:n}},delay(e=0){switch(e){case!0:return dl;case!1:return 0;default:return e}},axisThreshold(e){return e?oe(oe({},Yo),e):Yo},keyboardDisplacement(e=ml){return e}});process.env.NODE_ENV==="development"&&Object.assign(qo,{useTouch(e){if(e!==void 0)throw Error("[@use-gesture]: `useTouch` option has been renamed to `pointer.touch`. Use it as in `{ pointer: { touch: true } }`.");return NaN},experimental_preventWindowScrollY(e){if(e!==void 0)throw Error("[@use-gesture]: `experimental_preventWindowScrollY` option has been renamed to `preventScroll`.");return NaN},swipeVelocity(e){if(e!==void 0)throw Error("[@use-gesture]: `swipeVelocity` option has been renamed to `swipe.velocity`. Use it as in `{ swipe: { velocity: 0.5 } }`.");return NaN},swipeDistance(e){if(e!==void 0)throw Error("[@use-gesture]: `swipeDistance` option has been renamed to `swipe.distance`. Use it as in `{ swipe: { distance: 50 } }`.");return NaN},swipeDuration(e){if(e!==void 0)throw Error("[@use-gesture]: `swipeDuration` option has been renamed to `swipe.duration`. Use it as in `{ swipe: { duration: 250 } }`.");return NaN}}),oe(oe({},Vn),{},{device(e,t,{shared:n,pointer:{touch:r=!1}={}}){if(n.target&&!Oe.touch&&Oe.gesture)return"gesture";if(Oe.touch&&r)return"touch";if(Oe.touchscreen){if(Oe.pointer)return"pointer";if(Oe.touch)return"touch"}},bounds(e,t,{scaleBounds:n={},angleBounds:r={}}){const o=s=>{const a=Wo(tn(n,s),{min:-1/0,max:1/0});return[a.min,a.max]},i=s=>{const a=Wo(tn(r,s),{min:-1/0,max:1/0});return[a.min,a.max]};return typeof n!="function"&&typeof r!="function"?[o(),i()]:s=>[o(s),i(s)]},threshold(e,t,n){return this.lockDirection=n.axis==="lock",me.toVector(e,this.lockDirection?[.1,3]:0)},modifierKey(e){return e===void 0?"ctrlKey":e},pinchOnWheel(e=!0){return e}}),oe(oe({},Tt),{},{mouseOnly:(e=!0)=>e}),oe(oe({},Tt),{},{mouseOnly:(e=!0)=>e});const Ko=new Map,Hn=new Map;function vl(e){Ko.set(e.key,e.engine),Hn.set(e.key,e.resolver)}const bl={key:"drag",engine:il,resolver:qo};function yl(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function wl(e,t){if(e==null)return{};var n=yl(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}const $l={target(e){if(e)return()=>"current"in e?e.current:e},enabled(e=!0){return e},window(e=Oe.isBrowser?window:void 0){return e},eventOptions({passive:e=!0,capture:t=!1}={}){return{passive:e,capture:t}},transform(e){return e}},El=["target","eventOptions","window","enabled","transform"];function nn(e={},t){const n={};for(const[r,o]of Object.entries(t))switch(typeof o){case"function":if(process.env.NODE_ENV==="development"){const i=o.call(n,e[r],r,e);Number.isNaN(i)||(n[r]=i)}else n[r]=o.call(n,e[r],r,e);break;case"object":n[r]=nn(e[r],o);break;case"boolean":o&&(n[r]=e[r]);break}return n}function xl(e,t,n={}){const r=e,{target:o,eventOptions:i,window:s,enabled:a,transform:l}=r,u=wl(r,El);if(n.shared=nn({target:o,eventOptions:i,window:s,enabled:a,transform:l},$l),t){const f=Hn.get(t);n[t]=nn(oe({shared:n.shared},u),f)}else for(const f in u){const d=Hn.get(f);if(d)n[f]=nn(oe({shared:n.shared},u[f]),d);else if(process.env.NODE_ENV==="development"&&!["drag","pinch","scroll","wheel","move","hover"].includes(f)){if(f==="domTarget")throw Error("[@use-gesture]: `domTarget` option has been renamed to `target`.");console.warn(`[@use-gesture]: Unknown config key \`${f}\` was used. Please read the documentation for further information.`)}}return n}class Go{constructor(t,n){Se(this,"_listeners",new Set),this._ctrl=t,this._gestureKey=n}add(t,n,r,o,i){const s=this._listeners,a=qc(n,r),l=this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{},u=oe(oe({},l),i);t.addEventListener(a,o,u);const f=()=>{t.removeEventListener(a,o,u),s.delete(f)};return s.add(f),f}clean(){this._listeners.forEach(t=>t()),this._listeners.clear()}}class Sl{constructor(){Se(this,"_timeouts",new Map)}add(t,n,r=140,...o){this.remove(t),this._timeouts.set(t,window.setTimeout(n,r,...o))}remove(t){const n=this._timeouts.get(t);n&&window.clearTimeout(n)}clean(){this._timeouts.forEach(t=>void window.clearTimeout(t)),this._timeouts.clear()}}class Cl{constructor(t){Se(this,"gestures",new Set),Se(this,"_targetEventStore",new Go(this)),Se(this,"gestureEventStores",{}),Se(this,"gestureTimeoutStores",{}),Se(this,"handlers",{}),Se(this,"config",{}),Se(this,"pointerIds",new Set),Se(this,"touchIds",new Set),Se(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),_l(this,t)}setEventIds(t){if(en(t))return this.touchIds=new Set(Xc(t)),this.touchIds;if("pointe