UNPKG

wawa-vfx

Version:

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

1 lines 241 kB
(function(ye,pe){typeof exports=="object"&&typeof module<"u"?pe(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"],pe):(ye=typeof globalThis<"u"?globalThis:ye||self,pe(ye["Wawa-VFX"]={},ye["react/jsx-runtime"],ye.reactThreeFiber,ye.React,ye.THREE,ye.ReactDOM,ye.ReactDOMClient))})(this,function(ye,pe,Ln,l,le,Qt,rl){"use strict";function zn(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 we=zn(l),Zt=zn(le),ol=zn(Qt);var Nn=(e=>(e[e.Square=0]="Square",e[e.Circular=1]="Circular",e))(Nn||{}),Fn=(e=>(e.StretchBillboard="stretchBillboard",e.Billboard="billboard",e.Mesh="mesh",e))(Fn||{});const il=["easeLinear","easeInPower1","easeOutPower1","easeInOutPower1","easeInPower2","easeOutPower2","easeInOutPower2","easeInPower3","easeOutPower3","easeInOutPower3","easeInPower4","easeOutPower4","easeInOutPower4","easeInQuad","easeOutQuad","easeInOutQuad","easeInCubic","easeOutCubic","easeInOutCubic","easeInQuart","easeOutQuart","easeInOutQuart","easeInQuint","easeOutQuint","easeInOutQuint","easeInSine","easeOutSine","easeInOutSine","easeInExpo","easeOutExpo","easeInOutExpo","easeInCirc","easeOutCirc","easeInOutCirc","easeInElastic","easeOutElastic","easeInOutElastic","easeInBack","easeOutBack","easeInOutBack","easeInBounce","easeOutBounce","easeInOutBounce"];function Jt(e,t){return e+Math.floor(Math.random()*(t-e+1))}function Q(e,t){return e+Math.random()*(t-e)}function he(){return he=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},he.apply(null,arguments)}function sl(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function yo(...e){return t=>e.forEach(n=>sl(n,t))}function pt(...e){return l.useCallback(yo(...e),e)}const wo=l.forwardRef((e,t)=>{const{children:n,...r}=e,o=l.Children.toArray(n),i=o.find(al);if(i){const s=i.props.children,a=o.map(c=>c===i?l.Children.count(s)>1?l.Children.only(null):l.isValidElement(s)?s.props.children:null:c);return l.createElement(Bn,he({},r,{ref:t}),l.isValidElement(s)?l.cloneElement(s,void 0,a):null)}return l.createElement(Bn,he({},r,{ref:t}),n)});wo.displayName="Slot";const Bn=l.forwardRef((e,t)=>{const{children:n,...r}=e;return l.isValidElement(n)?l.cloneElement(n,{...ll(r,n.props),ref:yo(t,n.ref)}):l.Children.count(n)>1?l.Children.only(null):null});Bn.displayName="SlotClone";const Eo=({children:e})=>l.createElement(l.Fragment,null,e);function al(e){return l.isValidElement(e)&&e.type===Eo}function ll(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=l.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?wo:t;return l.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),l.createElement(a,he({},s,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function cl(e,t){e&&Qt.flushSync(()=>e.dispatchEvent(t))}const ul=l.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?Qt.createPortal(l.createElement(Ke.div,he({},o,{ref:t})),r):null});var $o=Object.prototype.hasOwnProperty;function _t(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--&&_t(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if($o.call(e,n)&&++r&&!$o.call(t,n)||!(n in t)||!_t(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}function en(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 tn=function(t,n,r,o){this.name=t,this.fn=n,this.args=r,this.modifiers=o};tn.prototype._test=function(t){var n=this.fn;try{ht(this.modifiers.slice(),n,this)(t)}catch{n=function(){return!1}}try{return ht(this.modifiers.slice(),n,this)(t)}catch{return!1}},tn.prototype._check=function(t){try{ht(this.modifiers.slice(),this.fn,this)(t)}catch{if(ht(this.modifiers.slice(),function(r){return r},this)(!1))return}if(!ht(this.modifiers.slice(),this.fn,this)(t))throw null},tn.prototype._testAsync=function(t){var n=this;return new Promise(function(r,o){So(n.modifiers.slice(),n.fn,n)(t).then(function(i){i?r(t):o(null)}).catch(function(i){return o(i)})})};function xo(e,t){return t===void 0&&(t="simple"),typeof e=="object"?e[t]:e}function ht(e,t,n){if(e.length){var r=e.shift(),o=ht(e,t,n);return r.perform(o,n)}else return xo(t)}function So(e,t,n){if(e.length){var r=e.shift(),o=So(e,t,n);return r.performAsync(o,n)}else return function(i){return Promise.resolve(xo(t,"async")(i))}}var fl=function(t,n,r){this.name=t,this.perform=n,this.performAsync=r},Wn=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 tn(n,t.apply(r,o),o,r.nextRuleModifiers)),r.nextRuleModifiers=[],r}},Me.prototype._applyModifier=function(t,n){return this.nextRuleModifiers.push(new fl(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 Wn(r,t,o))}}),n},Me.prototype.check=function(t){this.chain.forEach(function(n){try{n._check(t)}catch(r){throw new Wn(n,t,r)}})},Me.prototype.testAsync=function(t){var n=this;return new Promise(function(r,o){Oo(t,n.chain.slice(),r,o)})};function Oo(e,t,n,r){if(t.length){var o=t.shift();o._testAsync(e).then(function(){Oo(e,t,n,r)},function(i){r(new Wn(o,e,i))})}else n(e)}var Co=function(e,t){return t&&typeof e=="string"&&e.trim().length===0?!0:e==null};function dl(e,t){return t===void 0&&(t=!1),{simple:function(n){return Co(n,t)||e.check(n)===void 0},async:function(n){return Co(n,t)||e.testAsync(n)}}}function Se(){return typeof Proxy<"u"?Po(new Me):Un(new Me)}var Tt={};Se.extend=function(e){Object.assign(Tt,e)},Se.clearCustomRules=function(){Tt={}};function Po(e){return new Proxy(e,{get:function(n,r){if(r in n)return n[r];var o=Po(e._clone());if(r in nn)return o._applyModifier(nn[r],r);if(r in Tt)return o._applyRule(Tt[r],r);if(r in Vn)return o._applyRule(Vn[r],r)}})}function Un(e){var t=function(o,i){return Object.keys(o).forEach(function(s){i[s]=function(){for(var a=[],c=arguments.length;c--;)a[c]=arguments[c];var u=Un(i._clone()),f=u._applyRule(o[s],s).apply(void 0,a);return f}}),i},n=t(Vn,e),r=t(Tt,n);return Object.keys(nn).forEach(function(o){Object.defineProperty(r,o,{get:function(){var i=Un(r._clone());return i._applyModifier(nn[o],o)}})}),r}var nn={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 rn(t).some(function(n){try{return e(n)}catch{return!1}})}},async:function(e){return function(t){return Promise.all(rn(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&&rn(t).every(e)}},async:function(e){return function(t){return Promise.all(rn(t).map(e)).then(function(n){return n.every(Boolean)})}}},strict:{simple:function(e,t){return function(n){return _o(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 _o(t)&&n&&typeof n=="object"?Object.keys(t.args[0]).length===Object.keys(n).length&&r:r}).catch(function(){return!1})}}}};function _o(e){return e&&e.name==="schema"&&e.args.length>0&&typeof e.args[0]=="object"}function rn(e){return typeof e=="string"?e.split(""):e}var Vn={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||pl;return t(e)}},numeric:function(){return function(e){return!isNaN(parseFloat(e))&&isFinite(e)}},string:function(){return gt("string")},boolean:function(){return gt("boolean")},undefined:function(){return gt("undefined")},null:function(){return gt("null")},array:function(){return gt("array")},object:function(){return gt("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 hl(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:dl};function gt(e){return function(t){return Array.isArray(t)&&e==="array"||t===null&&e==="null"||typeof t===e}}function pl(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e}function hl(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 te="colors",Ee="sizes",D="space",gl={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:te,backgroundColor:te,backgroundImage:te,borderImage:te,border:te,borderBlock:te,borderBlockEnd:te,borderBlockStart:te,borderBottom:te,borderBottomColor:te,borderColor:te,borderInline:te,borderInlineEnd:te,borderInlineStart:te,borderLeft:te,borderLeftColor:te,borderRight:te,borderRightColor:te,borderTop:te,borderTopColor:te,caretColor:te,color:te,columnRuleColor:te,fill:te,outline:te,outlineColor:te,stroke:te,textDecorationColor:te,fontFamily:"fonts",fontWeight:"fontWeights",lineHeight:"lineHeights",letterSpacing:"letterSpacings",blockSize:Ee,minBlockSize:Ee,maxBlockSize:Ee,inlineSize:Ee,minInlineSize:Ee,maxInlineSize:Ee,width:Ee,minWidth:Ee,maxWidth:Ee,height:Ee,minHeight:Ee,maxHeight:Ee,flexBasis:Ee,gridTemplateColumns:Ee,gridTemplateRows:Ee,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"},ml=(e,t)=>typeof t=="function"?{"()":Function.prototype.toString.call(t)}:t,mt=()=>{const e=Object.create(null);return(t,n,...r)=>{const o=(i=>JSON.stringify(i,ml))(t);return o in e?e[o]:e[o]=n(t,...r)}},at=Symbol.for("sxs.internal"),Hn=(e,t)=>Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)),To=e=>{for(const t in e)return!0;return!1},{hasOwnProperty:vl}=Object.prototype,Rn=e=>e.includes("-")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase()),bl=/\s+(?![^()]*\))/,vt=e=>t=>e(...typeof t=="string"?String(t).split(bl):[t]),Io={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:vt((e,t)=>({marginBlockStart:e,marginBlockEnd:t||e})),marginInline:vt((e,t)=>({marginInlineStart:e,marginInlineEnd:t||e})),maxSize:vt((e,t)=>({maxBlockSize:e,maxInlineSize:t||e})),minSize:vt((e,t)=>({minBlockSize:e,minInlineSize:t||e})),paddingBlock:vt((e,t)=>({paddingBlockStart:e,paddingBlockEnd:t||e})),paddingInline:vt((e,t)=>({paddingInlineStart:e,paddingInlineEnd:t||e}))},Yn=/([\d.]+)([^]*)/,yl=(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,wl=(e,t)=>e in El&&typeof t=="string"?t.replace(/^((?:[^]*[^\w-])?)(fit-content|stretch)((?:[^\w-][^]*)?)$/,(n,r,o,i)=>r+(o==="stretch"?`-moz-available${i};${Rn(e)}:${r}-webkit-fill-available`:`-moz-fit-content${i};${Rn(e)}:${r}fit-content`)+i):String(t),El={blockSize:1,height:1,inlineSize:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,width:1},Ne=e=>e?e+"-":"",ko=(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==="$"?Ne(t)+(a.includes("$")?"":Ne(n))+a.replace(/\$/g,"-"):a)+")"+(o||s=="--"?"*"+(o||"")+(i||"1")+")":"")),$l=/\s*,\s*(?![^()]*\))/,xl=Object.prototype.toString,bt=(e,t,n,r,o)=>{let i,s,a;const c=(u,f,d)=>{let p,h;const m=g=>{for(p in g){const y=p.charCodeAt(0)===64,w=y&&Array.isArray(g[p])?g[p]:[g[p]];for(h of w){const $=/[A-Z]/.test(b=p)?b:b.replace(/-[^]/g,x=>x[1].toUpperCase()),E=typeof h=="object"&&h&&h.toString===xl&&(!r.utils[$]||!f.length);if($ in r.utils&&!E){const x=r.utils[$];if(x!==s){s=x,m(x(h)),s=null;continue}}else if($ in Io){const x=Io[$];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,O,P,B,T,_)=>{const k=Yn.test(O),M=.0625*(k?-1:1),[G,Y]=k?[B,O]:[O,B];return"("+(P[0]==="="?"":P[0]===">"===k?"max-":"min-")+G+":"+(P[0]!=="="&&P.length===1?Y.replace(Yn,(X,ee,oe)=>Number(ee)+M*(P===">"?1:-1)+oe):Y)+(T?") and ("+(T[0]===">"?"min-":"max-")+G+":"+(T.length===1?_.replace(Yn,(X,ee,oe)=>Number(ee)+M*(T===">"?-1:1)+oe):_):"")+")"})),E){const x=y?d.concat(p):[...d],O=y?[...f]:yl(f,p.split($l));i!==void 0&&o(Ao(...i)),i=void 0,c(h,O,x)}else i===void 0&&(i=[[],f,d]),p=y||p.charCodeAt(0)!==36?p:`--${Ne(r.prefix)}${p.slice(1).replace(/\$/g,"-")}`,h=E?h:typeof h=="number"?h&&$ in Sl?String(h)+"px":String(h):ko(wl($,h??""),r.prefix,r.themeMap[$]),i[0].push(`${y?`${p} `:`${Rn(p)}:`}${h}`)}}var v,b};m(u),i!==void 0&&o(Ao(...i)),i=void 0};c(e,t,n)},Ao=(e,t,n)=>`${n.map(r=>`${r}{`).join("")}${t.length?`${t.join(",")}{`:""}${e.join(";")}${t.length?"}":""}${Array(n.length?n.length+1:0).join("}")}`,Sl={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},Do=e=>String.fromCharCode(e+(e>25?39:97)),lt=e=>(t=>{let n,r="";for(n=Math.abs(t);n>52;n=n/52|0)r=Do(n%52)+r;return Do(n%52)+r})(((t,n)=>{let r=n.length;for(;r;)t=33*t^n.charCodeAt(--r);return t})(5381,JSON.stringify(e))>>>0),It=["themed","global","styled","onevar","resonevar","allvar","inline"],Ol=e=>{if(e.href&&!e.href.startsWith(location.origin))return!1;try{return!!e.cssRules}catch{return!1}},Cl=e=>{let t;const n=()=>{const{cssRules:o}=t.sheet;return[].map.call(o,(i,s)=>{const{cssText:a}=i;let c="";if(a.startsWith("--sxs"))return"";if(o[s-1]&&(c=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?`${c}${a}`:""}return a}).join("")},r=()=>{if(t){const{rules:a,sheet:c}=t;if(!c.deleteRule){for(;Object(Object(c.cssRules)[0]).type===3;)c.cssRules.splice(0,1);c.cssRules=[]}for(const u in a)delete a[u]}const o=Object(e).styleSheets||[];for(const a of o)if(Ol(a)){for(let c=0,u=a.cssRules;u[c];++c){const f=Object(u[c]);if(f.type!==1)continue;const d=Object(u[c+1]);if(d.type!==4)continue;++c;const{cssText:p}=f;if(!p.startsWith("--sxs"))continue;const h=p.slice(14,-3).trim().split(/\s+/),m=It[h[0]];m&&(t||(t={sheet:a,reset:r,rules:{},toString:n}),t.rules[m]={group:d,index:c,cache:new Set(h)})}if(t)break}if(!t){const a=(c,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 c==="@media{}"?`@media{${[].map.call(this.cssRules,f=>f.cssText).join("")}}`:c}});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=It.length-1;a>=0;--a){const c=It[a];if(!s[c]){const u=It[a+1],f=s[u]?s[u].index:i.cssRules.length;i.insertRule("@media{}",f),i.insertRule(`--sxs{--sxs:${a}}`,f),s[c]={group:i.cssRules[f+1],index:f,cache:new Set([a])}}Pl(s[c])}};return r(),t},Pl=e=>{const t=e.group;let n=t.cssRules.length;e.apply=r=>{try{t.insertRule(r,n),++n}catch{}}},kt=Symbol(),_l=mt(),Mo=(e,t)=>_l(e,()=>(...n)=>{let r={type:null,composers:new Set};for(const o of n)if(o!=null)if(o[at]){r.type==null&&(r.type=o[at].type);for(const i of o[at].composers)r.composers.add(i)}else o.constructor!==Object||o.$$typeof?r.type==null&&(r.type=o):r.composers.add(Tl(o,e));return r.type==null&&(r.type="span"),r.composers.size||r.composers.add(["PJLV",{},[],[],{},[]]),Il(e,r,t)}),Tl=({variants:e,compoundVariants:t,defaultVariants:n,...r},o)=>{const i=`${Ne(o.prefix)}c-${lt(r)}`,s=[],a=[],c=Object.create(null),u=[];for(const p in n)c[p]=String(n[p]);if(typeof e=="object"&&e)for(const p in e){f=c,d=p,vl.call(f,d)||(c[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,!To(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,!To(h)];a.push(g)}return[i,r,s,a,c,u]},Il=(e,t,n)=>{const[r,o,i,s]=kl(t.composers),a=typeof t.type=="function"||t.type.$$typeof?(d=>{function p(){for(let h=0;h<p[kt].length;h++){const[m,g]=p[kt][h];d.rules[m].apply(g)}return p[kt]=[],null}return p[kt]=[],p.rules={},It.forEach(h=>p.rules[h]={apply:m=>p[kt].push([h,m])}),p})(n):null,c=(a||n).rules,u=`.${r}${o.length>1?`:where(.${o.slice(1).join(".")})`:""}`,f=d=>{d=typeof d=="object"&&d||Al;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,w,$]of t.composers){n.rules.styled.cache.has(b)||(n.rules.styled.cache.add(b),bt(y,[`.${b}`],[],e,O=>{c.styled.apply(O)}));const E=jo(w,m,e.media),x=jo($,m,e.media,!0);for(const O of E)if(O!==void 0)for(const[P,B,T]of O){const _=`${b}-${lt(B)}-${P}`;g.add(_);const k=(T?n.rules.resonevar:n.rules.onevar).cache,M=T?c.resonevar:c.onevar;k.has(_)||(k.add(_),bt(B,[`.${_}`],[],e,G=>{M.apply(G)}))}for(const O of x)if(O!==void 0)for(const[P,B]of O){const T=`${b}-${lt(B)}-${P}`;g.add(T),n.rules.allvar.cache.has(T)||(n.rules.allvar.cache.add(T),bt(B,[`.${T}`],[],e,_=>{c.allvar.apply(_)}))}}if(typeof p=="object"&&p){const b=`${r}-i${lt(p)}-css`;g.add(b),n.rules.inline.cache.has(b)||(n.rules.inline.cache.add(b),bt(p,[`.${b}`],[],e,y=>{c.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 Hn(f,{className:r,selector:u,[at]:t,toString:()=>(n.rules.styled.cache.has(r)||f(),r)})},kl=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 c in s){const u=s[c];(r[c]===void 0||u!=="undefined"||a.includes(u))&&(r[c]=u)}}return[t,n,r,new Set(o)]},jo=(e,t,n,r)=>{const o=[];e:for(let[i,s,a]of e){if(a)continue;let c,u=0,f=!1;for(c in i){const d=i[c];let p=t[c];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":`${c}-${i[c]}`,s,f])}return o},Al={},Dl=mt(),Ml=(e,t)=>Dl(e,()=>(...n)=>{const r=()=>{for(let o of n){o=typeof o=="object"&&o||{};let i=lt(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"]}bt(o,[],[],e,s=>{t.rules.global.apply(s)})}}return""};return Hn(r,{toString:r})}),jl=mt(),Ll=(e,t)=>jl(e,()=>n=>{const r=`${Ne(e.prefix)}k-${lt(n)}`,o=()=>{if(!t.rules.global.cache.has(r)){t.rules.global.cache.add(r);const i=[];bt(n,[],[],e,a=>i.push(a));const s=`@keyframes ${r}{${i.join("")}}`;t.rules.global.apply(s)}return r};return Hn(o,{get name(){return o()},toString:o})}),zl=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"--"+Ne(this.prefix)+Ne(this.scale)+this.token}toString(){return this.computedValue}},Nl=mt(),Fl=(e,t)=>Nl(e,()=>(n,r)=>{r=typeof n=="object"&&n||Object(r);const o=`.${n=(n=typeof n=="string"?n:"")||`${Ne(e.prefix)}t-${lt(r)}`}`,i={},s=[];for(const c in r){i[c]={};for(const u in r[c]){const f=`--${Ne(e.prefix)}${c}-${u}`,d=ko(String(r[c][u]),e.prefix,c);i[c][u]=new zl(u,d,c,e.prefix),s.push(`${f}:${d}`)}}const a=()=>{if(s.length&&!t.rules.themed.cache.has(n)){t.rules.themed.cache.add(n);const c=`${r===e.theme?":root,":""}.${n}{${s.join(";")}}`;t.rules.themed.apply(c)}return n};return{...i,get className(){return a()},selector:o,toString:a}}),Bl=mt(),Wl=mt(),Ul=e=>{const t=(n=>{let r=!1;const o=Bl(n,i=>{r=!0;const s="prefix"in(i=typeof i=="object"&&i||{})?String(i.prefix):"",a=typeof i.media=="object"&&i.media||{},c=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||{...gl},utils:typeof i.utils=="object"&&i.utils||{}},d=Cl(c),p={css:Mo(f,d),globalCss:Ml(f,d),keyframes:Ll(f,d),createTheme:Fl(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})=>Wl(n,()=>{const o=Mo(n,r);return(...i)=>{const s=o(...i),a=s[at].type,c=l.forwardRef((u,f)=>{const d=u&&u.as||a,{props:p,deferredInjector:h}=s(u);return delete p.as,p.ref=f,h?l.createElement(l.Fragment,null,l.createElement(d,p),l.createElement(h,null)):l.createElement(d,p)});return c.className=s.className,c.displayName=`Styled.${a.displayName||a.name||a}`,c.selector=s.selector,c.toString=()=>s.selector,c[at]=s[at],c}}))(t),t};function Vl(e,t,n){return Math.max(t,Math.min(e,n))}const ve={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 Lo(e,t,n){return t===0||Math.abs(t)===1/0?Math.pow(e,n*5):e*t*n/(t+n*e)}function zo(e,t,n,r=.15){return r===0?Vl(e,t,n):e<t?-Lo(t-e,n-t,r)+t:e>n?+Lo(e-n,n-t,r)+n:e}function Hl(e,[t,n],[r,o]){const[[i,s],[a,c]]=e;return[zo(t,i,s,r),zo(n,a,c,o)]}function Rl(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 Yl(e){var t=Rl(e,"string");return typeof t=="symbol"?t:String(t)}function Oe(e,t,n){return t=Yl(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function No(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 ie(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?No(Object(n),!0).forEach(function(r){Oe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):No(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}const Fo={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 Bo(e){return e?e[0].toUpperCase()+e.slice(1):""}const ql=["enter","leave"];function Kl(e=!1,t){return e&&!ql.includes(t)}function Gl(e,t="",n=!1){const r=Fo[e],o=r&&r[t]||t;return"on"+Bo(e)+Bo(o)+(Kl(n,o)?"Capture":"")}const Xl=["gotpointercapture","lostpointercapture"];function Ql(e){let t=e.substring(2).toLowerCase();const n=!!~t.indexOf("passive");n&&(t=t.replace("passive",""));const r=Xl.includes(t)?"capturecapture":"capture",o=!!~t.indexOf(r);return o&&(t=t.replace("capture","")),{device:t,capture:o,passive:n}}function Zl(e,t=""){const n=Fo[e],r=n&&n[t]||t;return e+r}function on(e){return"touches"in e}function Wo(e){return on(e)?"touch":"pointerType"in e?e.pointerType:"mouse"}function Jl(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 ec(e){return e.type==="touchend"||e.type==="touchcancel"?e.changedTouches:e.targetTouches}function Uo(e){return on(e)?ec(e)[0]:e}function tc(e){return Jl(e).map(t=>t.identifier)}function qn(e){const t=Uo(e);return on(e)?t.identifier:t.pointerId}function Vo(e){const t=Uo(e);return[t.clientX,t.clientY]}function nc(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 sn(e,...t){return typeof e=="function"?e(...t):e}function rc(){}function oc(...e){return e.length===0?rc:e.length===1?e[0]:function(){let t;for(const n of e)t=n.apply(this,arguments)||t;return t}}function Ho(e,t){return Object.assign({},t,e||{})}const ic=32;class sc{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?sn(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,nc(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);ve.addTo(n._distance,x)}this.axisIntent&&this.axisIntent(t);const[s,a]=n._movement,[c,u]=r.threshold,{_step:f,values:d}=n;if(r.hasCustomTransform?(f[0]===!1&&(f[0]=Math.abs(s)>=c&&d[0]),f[1]===!1&&(f[1]=Math.abs(a)>=u&&d[1])):(f[0]===!1&&(f[0]=Math.abs(s)>=c&&Math.sign(s)*c),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,O]=d;p[0]=f[0]!==!1?x-f[0]:0,p[1]=f[1]!==!1?O-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=sn(r.bounds,n)),this.setup&&this.setup()),n.movement=p,this.computeOffset()));const[g,v]=n.offset,[[b,y],[w,$]]=n._bounds;n.overflow=[g<b?-1:g>y?1:0,v<w?-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 E=n._active?r.rubberband||[0,0]:[0,0];if(n.offset=Hl(n._bounds,n.offset,E),n.delta=ve.sub(n.offset,h),this.computeMovement(),m&&(!n.last||i>ic)){n.delta=ve.sub(n.offset,h);const x=n.delta.map(Math.abs);ve.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(ie(ie(ie({},n),t),{},{[this.aliasKey]:t.values}));o!==void 0&&(t.memo=o)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}function ac([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 lc extends sc{constructor(...t){super(...t),Oe(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=ve.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=ve.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[Wo(t)]:r.axisThreshold;n.axis=ac(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 Ro=e=>e,Yo=.15,Kn={enabled(e=!0){return e},eventOptions(e,t,n){return ie(ie({},n.shared.eventOptions),e)},preventDefault(e=!1){return e},triggerAllEvents(e=!1){return e},rubberband(e=0){switch(e){case!0:return[Yo,Yo];case!1:return[0,0];default:return ve.toVector(e)}},from(e){if(typeof e=="function")return e;if(e!=null)return ve.toVector(e)},transform(e,t,n){const r=e||n.shared.transform;if(this.hasCustomTransform=!!r,process.env.NODE_ENV==="development"){const o=r||Ro;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||Ro},threshold(e){return ve.toVector(e,0)}};process.env.NODE_ENV==="development"&&Object.assign(Kn,{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 cc=0,At=ie(ie({},Kn),{},{axis(e,t,{axis:n}){if(this.lockDirection=n==="lock",!this.lockDirection)return n},axisThreshold(e=cc){return e},bounds(e={}){if(typeof e=="function")return i=>At.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]]}}),qo={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 uc extends lc{constructor(...t){super(...t),Oe(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=At.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=qn(t),r._pointerActive=!0,this.computeValues(Vo(t)),this.computeInitial(),n.preventScrollAxis&&Wo(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=qn(t);if(n._pointerId!==void 0&&o!==n._pointerId)return;const i=Vo(t);if(document.pointerLockElement===t.target?n._delta=[t.movementX,t.movementY]:(n._delta=ve.sub(i,n._values),this.computeValues(i)),ve.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=qn(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,c]=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(c/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(c))}}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,fc(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=qo[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,ve.addTo(r._movement,r._delta),this.compute(t),this.emit()}}keyUp(t){t.key in qo&&(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 fc(e){"persist"in e&&typeof e.persist=="function"&&e.persist()}const Dt=typeof window<"u"&&window.document&&window.document.createElement;function Ko(){return Dt&&"ontouchstart"in window}function dc(){return Ko()||Dt&&window.navigator.maxTouchPoints>1}function pc(){return Dt&&"onpointerdown"in window}function hc(){return Dt&&"exitPointerLock"in window.document}function gc(){try{return"constructor"in GestureEvent}catch{return!1}}const Pe={isBrowser:Dt,gesture:gc(),touch:Ko(),touchscreen:dc(),pointer:pc(),pointerLock:hc()},mc=250,vc=180,bc=.5,yc=50,wc=250,Ec=10,Go={mouse:0,touch:0,pen:8},Xo=ie(ie({},At),{},{device(e,t,{pointer:{touch:n=!1,lock:r=!1,mouse:o=!1}={}}){return this.pointerLock=r&&Pe.pointerLock,Pe.touch&&n?"touch":this.pointerLock?"mouse":Pe.pointer&&!o?"pointer":Pe.touch?"touch":"mouse"},preventScrollAxis(e,t,{preventScroll:n}){if(this.preventScrollDelay=typeof n=="number"?n:n||n===void 0&&e?mc:void 0,!(!Pe.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=ve.toVector(e,n?r:o?1:0);return this.filterTaps=n,this.tapsThreshold=r,i},swipe({velocity:e=bc,distance:t=yc,duration:n=wc}={}){return{velocity:this.transform(ve.toVector(e)),distance:this.transform(ve.toVector(t)),duration:n}},delay(e=0){switch(e){case!0:return vc;case!1:return 0;default:return e}},axisThreshold(e){return e?ie(ie({},Go),e):Go},keyboardDisplacement(e=Ec){return e}});process.env.NODE_ENV==="development"&&Object.assign(Xo,{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}}),ie(ie({},Kn),{},{device(e,t,{shared:n,pointer:{touch:r=!1}={}}){if(n.target&&!Pe.touch&&Pe.gesture)return"gesture";if(Pe.touch&&r)return"touch";if(Pe.touchscreen){if(Pe.pointer)return"pointer";if(Pe.touch)return"touch"}},bounds(e,t,{scaleBounds:n={},angleBounds:r={}}){const o=s=>{const a=Ho(sn(n,s),{min:-1/0,max:1/0});return[a.min,a.max]},i=s=>{const a=Ho(sn(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",ve.toVector(e,this.lockDirection?[.1,3]:0)},modifierKey(e){return e===void 0?"ctrlKey":e},pinchOnWheel(e=!0){return e}}),ie(ie({},At),{},{mouseOnly:(e=!0)=>e}),ie(ie({},At),{},{mouseOnly:(e=!0)=>e});const Qo=new Map,Gn=new Map;function $c(e){Qo.set(e.key,e.engine),Gn.set(e.key,e.resolver)}const xc={key:"drag",engine:uc,resolver:Xo};function Sc(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 Oc(e,t){if(e==null)return{};var n=Sc(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 Cc={target(e){if(e)return()=>"current"in e?e.current:e},enabled(e=!0){return e},window(e=Pe.isBrowser?window:void 0){return e},eventOptions({passive:e=!0,capture:t=!1}={}){return{passive:e,capture:t}},transform(e){return e}},Pc=["target","eventOptions","window","enabled","transform"];function an(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]=an(e[r],o);break;case"boolean":o&&(n[r]=e[r]);break}return n}function _c(e,t,n={}){const r=e,{target:o,eventOptions:i,window:s,enabled:a,transform:c}=r,u=Oc(r,Pc);if(n.shared=an({target:o,eventOptions:i,window:s,enabled:a,transform:c},Cc),t){const f=Gn.get(t);n[t]=an(ie({shared:n.shared},u),f)}else for(const f in u){const d=Gn.get(f);if(d)n[f]=an(ie({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 Zo{constructor(t,n){Oe(this,"_listeners",new Set),this._ctrl=t,this._gestureKey=n}add(t,n,r,o,i){const s=this._listeners,a=Zl(n,r),c=this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{},u=ie(ie({},c),i);t.addEventLis