ymy-components 0.0.65 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +91 -91
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1840 -1571
- package/dist/theme/index.d.ts +4 -0
- package/dist/theme/palettes/default.palette.d.ts +2 -0
- package/dist/theme/palettes/index.d.ts +2 -0
- package/dist/theme/palettes/types.d.ts +49 -0
- package/dist/theme/theme.builder.d.ts +188 -0
- package/dist/theme/theme.types.d.ts +5 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("react/jsx-runtime"),w=require("react"),Or=require("react-dom"),N=require("styled-components"),At=require("@reduxjs/toolkit"),jr=e=>e&&e.__esModule?e:{default:e};function $r(e){if(e&&e.__esModule)return 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 V=$r(w),_=jr(N);var Rt=De(),P=e=>Ce(e,Rt),Ot=De();P.write=e=>Ce(e,Ot);var et=De();P.onStart=e=>Ce(e,et);var jt=De();P.onFrame=e=>Ce(e,jt);var $t=De();P.onFinish=e=>Ce(e,$t);var ae=[];P.setTimeout=(e,t)=>{const n=P.now()+t,r=()=>{const s=ae.findIndex(o=>o.cancel==r);~s&&ae.splice(s,1),Z-=~s?1:0},i={time:n,handler:e,cancel:r};return ae.splice(On(n),0,i),Z+=1,jn(),i};var On=e=>~(~ae.findIndex(t=>t.time>e)||~ae.length);P.cancel=e=>{et.delete(e),jt.delete(e),$t.delete(e),Rt.delete(e),Ot.delete(e)};P.sync=e=>{bt=!0,P.batchedUpdates(e),bt=!1};P.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function r(...i){t=i,P.onStart(n)}return r.handler=e,r.cancel=()=>{et.delete(n),t=null},r};var Ct=typeof window<"u"?window.requestAnimationFrame:()=>{};P.use=e=>Ct=e;P.now=typeof performance<"u"?()=>performance.now():Date.now;P.batchedUpdates=e=>e();P.catch=console.error;P.frameLoop="always";P.advance=()=>{P.frameLoop!=="demand"?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):Cn()};var X=-1,Z=0,bt=!1;function Ce(e,t){bt?(t.delete(e),e(0)):(t.add(e),jn())}function jn(){X<0&&(X=0,P.frameLoop!=="demand"&&Ct($n))}function Cr(){X=-1}function $n(){~X&&(Ct($n),P.batchedUpdates(Cn))}function Cn(){const e=X;X=P.now();const t=On(X);if(t&&(Dn(ae.splice(0,t),n=>n.handler()),Z-=t),!Z){Cr();return}et.flush(),Rt.flush(e?Math.min(64,X-e):16.667),jt.flush(),Ot.flush(),$t.flush()}function De(){let e=new Set,t=e;return{add(n){Z+=t==e&&!e.has(n)?1:0,e.add(n)},delete(n){return Z-=t==e&&e.has(n)?1:0,e.delete(n)},flush(n){t.size&&(e=new Set,Z-=t.size,Dn(t,r=>r(n)&&e.add(r)),Z+=e.size,t=e)}}}function Dn(e,t){e.forEach(n=>{try{t(n)}catch(r){P.catch(r)}})}var Dr=Object.defineProperty,Lr=(e,t)=>{for(var n in t)Dr(e,n,{get:t[n],enumerable:!0})},G={};Lr(G,{assign:()=>Vr,colors:()=>J,createStringInterpolator:()=>Lt,skipAnimation:()=>Nn,to:()=>Ln,willAdvance:()=>Nt});function wt(){}var Nr=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),p={arr:Array.isArray,obj:e=>!!e&&e.constructor.name==="Object",fun:e=>typeof e=="function",str:e=>typeof e=="string",num:e=>typeof e=="number",und:e=>e===void 0};function W(e,t){if(p.arr(e)){if(!p.arr(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return e===t}var E=(e,t)=>e.forEach(t);function q(e,t,n){if(p.arr(e)){for(let r=0;r<e.length;r++)t.call(n,e[r],`${r}`);return}for(const r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r)}var L=e=>p.und(e)?[]:p.arr(e)?e:[e];function be(e,t){if(e.size){const n=Array.from(e);e.clear(),E(n,t)}}var ve=(e,...t)=>be(e,n=>n(...t)),Dt=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),Lt,Ln,J=null,Nn=!1,Nt=wt,Vr=e=>{e.to&&(Ln=e.to),e.now&&(P.now=e.now),e.colors!==void 0&&(J=e.colors),e.skipAnimation!=null&&(Nn=e.skipAnimation),e.createStringInterpolator&&(Lt=e.createStringInterpolator),e.requestAnimationFrame&&P.use(e.requestAnimationFrame),e.batchedUpdates&&(P.batchedUpdates=e.batchedUpdates),e.willAdvance&&(Nt=e.willAdvance),e.frameLoop&&(P.frameLoop=e.frameLoop)},we=new Set,F=[],dt=[],qe=0,tt={get idle(){return!we.size&&!F.length},start(e){qe>e.priority?(we.add(e),P.onStart(zr)):(Vn(e),P(xt))},advance:xt,sort(e){if(qe)P.onFrame(()=>tt.sort(e));else{const t=F.indexOf(e);~t&&(F.splice(t,1),zn(e))}},clear(){F=[],we.clear()}};function zr(){we.forEach(Vn),we.clear(),P(xt)}function Vn(e){F.includes(e)||zn(e)}function zn(e){F.splice(Mr(F,t=>t.priority>e.priority),0,e)}function xt(e){const t=dt;for(let n=0;n<F.length;n++){const r=F[n];qe=r.priority,r.idle||(Nt(r),r.advance(e),r.idle||t.push(r))}return qe=0,dt=F,dt.length=0,F=t,F.length>0}function Mr(e,t){const n=e.findIndex(t);return n<0?e.length:n}var Fr={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},U="[-+]?\\d*\\.?\\d+",Qe=U+"%";function nt(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var Br=new RegExp("rgb"+nt(U,U,U)),Ur=new RegExp("rgba"+nt(U,U,U,U)),Gr=new RegExp("hsl"+nt(U,Qe,Qe)),Hr=new RegExp("hsla"+nt(U,Qe,Qe,U)),qr=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Qr=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Wr=/^#([0-9a-fA-F]{6})$/,Yr=/^#([0-9a-fA-F]{8})$/;function Kr(e){let t;return typeof e=="number"?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=Wr.exec(e))?parseInt(t[1]+"ff",16)>>>0:J&&J[e]!==void 0?J[e]:(t=Br.exec(e))?(se(t[1])<<24|se(t[2])<<16|se(t[3])<<8|255)>>>0:(t=Ur.exec(e))?(se(t[1])<<24|se(t[2])<<16|se(t[3])<<8|Yt(t[4]))>>>0:(t=qr.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=Yr.exec(e))?parseInt(t[1],16)>>>0:(t=Qr.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=Gr.exec(e))?(Qt(Wt(t[1]),Fe(t[2]),Fe(t[3]))|255)>>>0:(t=Hr.exec(e))?(Qt(Wt(t[1]),Fe(t[2]),Fe(t[3]))|Yt(t[4]))>>>0:null}function ft(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Qt(e,t,n){const r=n<.5?n*(1+t):n+t-n*t,i=2*n-r,s=ft(i,r,e+1/3),o=ft(i,r,e),a=ft(i,r,e-1/3);return Math.round(s*255)<<24|Math.round(o*255)<<16|Math.round(a*255)<<8}function se(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function Wt(e){return(parseFloat(e)%360+360)%360/360}function Yt(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(t*255)}function Fe(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function Kt(e){let t=Kr(e);if(t===null)return e;t=t||0;const n=(t&4278190080)>>>24,r=(t&16711680)>>>16,i=(t&65280)>>>8,s=(t&255)/255;return`rgba(${n}, ${r}, ${i}, ${s})`}var Se=(e,t,n)=>{if(p.fun(e))return e;if(p.arr(e))return Se({range:e,output:t,extrapolate:n});if(p.str(e.output[0]))return Lt(e);const r=e,i=r.output,s=r.range||[0,1],o=r.extrapolateLeft||r.extrapolate||"extend",a=r.extrapolateRight||r.extrapolate||"extend",l=r.easing||(c=>c);return c=>{const u=Zr(c,s);return Xr(c,s[u],s[u+1],i[u],i[u+1],l,o,a,r.map)}};function Xr(e,t,n,r,i,s,o,a,l){let c=l?l(e):e;if(c<t){if(o==="identity")return c;o==="clamp"&&(c=t)}if(c>n){if(a==="identity")return c;a==="clamp"&&(c=n)}return r===i?r:t===n?e<=t?r:i:(t===-1/0?c=-c:n===1/0?c=c-t:c=(c-t)/(n-t),c=s(c),r===-1/0?c=-c:i===1/0?c=c+r:c=c*(i-r)+r,c)}function Zr(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}var Jr={linear:e=>e},ke=Symbol.for("FluidValue.get"),ue=Symbol.for("FluidValue.observers"),z=e=>!!(e&&e[ke]),C=e=>e&&e[ke]?e[ke]():e,Xt=e=>e[ue]||null;function ei(e,t){e.eventObserved?e.eventObserved(t):e(t)}function Pe(e,t){const n=e[ue];n&&n.forEach(r=>{ei(r,t)})}var Mn=class{constructor(e){if(!e&&!(e=this.get))throw Error("Unknown getter");ti(this,e)}},ti=(e,t)=>Fn(e,ke,t);function de(e,t){if(e[ke]){let n=e[ue];n||Fn(e,ue,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function Te(e,t){const n=e[ue];if(n&&n.has(t)){const r=n.size-1;r?n.delete(t):e[ue]=null,e.observerRemoved&&e.observerRemoved(r,t)}}var Fn=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),Ue=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,ni=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,Zt=new RegExp(`(${Ue.source})(%|[a-z]+)`,"i"),ri=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,rt=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,Bn=e=>{const[t,n]=ii(e);if(!t||Dt())return e;const r=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(r)return r.trim();if(n&&n.startsWith("--")){const i=window.getComputedStyle(document.documentElement).getPropertyValue(n);return i||e}else{if(n&&rt.test(n))return Bn(n);if(n)return n}return e},ii=e=>{const t=rt.exec(e);if(!t)return[,];const[,n,r]=t;return[n,r]},ht,si=(e,t,n,r,i)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(r)}, ${i})`,Un=e=>{ht||(ht=J?new RegExp(`(${Object.keys(J).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map(s=>C(s).replace(rt,Bn).replace(ni,Kt).replace(ht,Kt)),n=t.map(s=>s.match(Ue).map(Number)),i=n[0].map((s,o)=>n.map(a=>{if(!(o in a))throw Error('The arity of each "output" value must be equal');return a[o]})).map(s=>Se({...e,output:s}));return s=>{var l;const o=!Zt.test(t[0])&&((l=t.find(c=>Zt.test(c)))==null?void 0:l.replace(Ue,""));let a=0;return t[0].replace(Ue,()=>`${i[a++](s)}${o||""}`).replace(ri,si)}},Vt="react-spring: ",Gn=e=>{const t=e;let n=!1;if(typeof t!="function")throw new TypeError(`${Vt}once requires a function parameter`);return(...r)=>{n||(t(...r),n=!0)}},oi=Gn(console.warn);function ai(){oi(`${Vt}The "interpolate" function is deprecated in v9 (use "to" instead)`)}var ci=Gn(console.warn);function ui(){ci(`${Vt}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`)}function it(e){return p.str(e)&&(e[0]=="#"||/\d/.test(e)||!Dt()&&rt.test(e)||e in(J||{}))}var zt=Dt()?w.useEffect:w.useLayoutEffect,li=()=>{const e=w.useRef(!1);return zt(()=>(e.current=!0,()=>{e.current=!1}),[]),e};function Hn(){const e=w.useState()[1],t=li();return()=>{t.current&&e(Math.random())}}function di(e,t){const[n]=w.useState(()=>({inputs:t,result:e()})),r=w.useRef(),i=r.current;let s=i;return s?t&&s.inputs&&fi(t,s.inputs)||(s={inputs:t,result:e()}):s=n,w.useEffect(()=>{r.current=s,i==n&&(n.inputs=n.result=void 0)},[s]),s.result}function fi(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}var qn=e=>w.useEffect(e,hi),hi=[];function Jt(e){const t=w.useRef();return w.useEffect(()=>{t.current=e}),t.current}var Ee=Symbol.for("Animated:node"),pi=e=>!!e&&e[Ee]===e,H=e=>e&&e[Ee],Mt=(e,t)=>Nr(e,Ee,t),st=e=>e&&e[Ee]&&e[Ee].getPayload(),Qn=class{constructor(){Mt(this,this)}getPayload(){return this.payload||[]}},Le=class extends Qn{constructor(e){super(),this._value=e,this.done=!0,this.durationProgress=0,p.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new Le(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return p.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value===e?!1:(this._value=e,!0)}reset(){const{done:e}=this;this.done=!1,p.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},Ie=class extends Le{constructor(e){super(0),this._string=null,this._toString=Se({output:[e,e]})}static create(e){return new Ie(e)}getValue(){const e=this._string;return e??(this._string=this._toString(this._value))}setValue(e){if(p.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else if(super.setValue(e))this._string=null;else return!1;return!0}reset(e){e&&(this._toString=Se({output:[this.getValue(),e]})),this._value=0,super.reset()}},We={dependencies:null},ot=class extends Qn{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return q(this.source,(n,r)=>{pi(n)?t[r]=n.getValue(e):z(n)?t[r]=C(n):e||(t[r]=n)}),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&E(this.payload,e=>e.reset())}_makePayload(e){if(e){const t=new Set;return q(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){We.dependencies&&z(e)&&We.dependencies.add(e);const t=st(e);t&&E(t,n=>this.add(n))}},Wn=class extends ot{constructor(e){super(e)}static create(e){return new Wn(e)}getValue(){return this.source.map(e=>e.getValue())}setValue(e){const t=this.getPayload();return e.length==t.length?t.map((n,r)=>n.setValue(e[r])).some(Boolean):(super.setValue(e.map(mi)),!0)}};function mi(e){return(it(e)?Ie:Le).create(e)}function _t(e){const t=H(e);return t?t.constructor:p.arr(e)?Wn:it(e)?Ie:Le}var en=(e,t)=>{const n=!p.fun(e)||e.prototype&&e.prototype.isReactComponent;return w.forwardRef((r,i)=>{const s=w.useRef(null),o=n&&w.useCallback(v=>{s.current=vi(i,v)},[i]),[a,l]=yi(r,t),c=Hn(),u=()=>{const v=s.current;if(n&&!v)return;(v?t.applyAnimatedValues(v,a.getValue(!0)):!1)===!1&&c()},d=new gi(u,l),f=w.useRef();zt(()=>(f.current=d,E(l,v=>de(v,d)),()=>{f.current&&(E(f.current.deps,v=>Te(v,f.current)),P.cancel(f.current.update))})),w.useEffect(u,[]),qn(()=>()=>{const v=f.current;E(v.deps,g=>Te(g,v))});const m=t.getComponentProps(a.getValue());return V.createElement(e,{...m,ref:o})})},gi=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){e.type=="change"&&P.write(this.update)}};function yi(e,t){const n=new Set;return We.dependencies=n,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new ot(e),We.dependencies=null,[e,n]}function vi(e,t){return e&&(p.fun(e)?e(t):e.current=t),t}var tn=Symbol.for("AnimatedComponent"),bi=(e,{applyAnimatedValues:t=()=>!1,createAnimatedStyle:n=i=>new ot(i),getComponentProps:r=i=>i}={})=>{const i={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:r},s=o=>{const a=nn(o)||"Anonymous";return p.str(o)?o=s[o]||(s[o]=en(o,i)):o=o[tn]||(o[tn]=en(o,i)),o.displayName=`Animated(${a})`,o};return q(e,(o,a)=>{p.arr(e)&&(a=nn(o)),s[a]=s(o)}),{animated:s}},nn=e=>p.str(e)?e:e&&p.str(e.displayName)?e.displayName:p.fun(e)&&e.name||null;function ne(e,...t){return p.fun(e)?e(...t):e}var xe=(e,t)=>e===!0||!!(t&&e&&(p.fun(e)?e(t):L(e).includes(t))),Yn=(e,t)=>p.obj(e)?t&&e[t]:e,Kn=(e,t)=>e.default===!0?e[t]:e.default?e.default[t]:void 0,wi=e=>e,Ft=(e,t=wi)=>{let n=xi;e.default&&e.default!==!0&&(e=e.default,n=Object.keys(e));const r={};for(const i of n){const s=t(e[i],i);p.und(s)||(r[i]=s)}return r},xi=["config","onProps","onStart","onChange","onPause","onResume","onRest"],_i={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function Si(e){const t={};let n=0;if(q(e,(r,i)=>{_i[i]||(t[i]=r,n++)}),n)return t}function Xn(e){const t=Si(e);if(t){const n={to:t};return q(e,(r,i)=>i in t||(n[i]=r)),n}return{...e}}function Ae(e){return e=C(e),p.arr(e)?e.map(Ae):it(e)?G.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function ki(e){for(const t in e)return!0;return!1}function St(e){return p.fun(e)||p.arr(e)&&p.obj(e[0])}function Pi(e,t){var n;(n=e.ref)==null||n.delete(e),t==null||t.delete(e)}function Ti(e,t){var n;t&&e.ref!==t&&((n=e.ref)==null||n.delete(e),t.add(e),e.ref=t)}var Ei={default:{tension:170,friction:26}},kt={...Ei.default,mass:1,damping:1,easing:Jr.linear,clamp:!1},Ii=class{constructor(){this.velocity=0,Object.assign(this,kt)}};function Ai(e,t,n){n&&(n={...n},rn(n,t),t={...n,...t}),rn(e,t),Object.assign(e,t);for(const o in kt)e[o]==null&&(e[o]=kt[o]);let{frequency:r,damping:i}=e;const{mass:s}=e;return p.und(r)||(r<.01&&(r=.01),i<0&&(i=0),e.tension=Math.pow(2*Math.PI/r,2)*s,e.friction=4*Math.PI*i*s/r),e}function rn(e,t){if(!p.und(t.decay))e.duration=void 0;else{const n=!p.und(t.tension)||!p.und(t.friction);(n||!p.und(t.frequency)||!p.und(t.damping)||!p.und(t.mass))&&(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}}var sn=[],Ri=class{constructor(){this.changed=!1,this.values=sn,this.toValues=null,this.fromValues=sn,this.config=new Ii,this.immediate=!1}};function Zn(e,{key:t,props:n,defaultProps:r,state:i,actions:s}){return new Promise((o,a)=>{let l,c,u=xe(n.cancel??(r==null?void 0:r.cancel),t);if(u)m();else{p.und(n.pause)||(i.paused=xe(n.pause,t));let v=r==null?void 0:r.pause;v!==!0&&(v=i.paused||xe(v,t)),l=ne(n.delay||0,t),v?(i.resumeQueue.add(f),s.pause()):(s.resume(),f())}function d(){i.resumeQueue.add(f),i.timeouts.delete(c),c.cancel(),l=c.time-P.now()}function f(){l>0&&!G.skipAnimation?(i.delayed=!0,c=P.setTimeout(m,l),i.pauseQueue.add(d),i.timeouts.add(c)):m()}function m(){i.delayed&&(i.delayed=!1),i.pauseQueue.delete(d),i.timeouts.delete(c),e<=(i.cancelId||0)&&(u=!0);try{s.start({...n,callId:e,cancel:u},o)}catch(v){a(v)}}})}var Bt=(e,t)=>t.length==1?t[0]:t.some(n=>n.cancelled)?ce(e.get()):t.every(n=>n.noop)?Jn(e.get()):B(e.get(),t.every(n=>n.finished)),Jn=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),B=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),ce=e=>({value:e,cancelled:!0,finished:!1});function er(e,t,n,r){const{callId:i,parentId:s,onRest:o}=t,{asyncTo:a,promise:l}=n;return!s&&e===a&&!t.reset?l:n.promise=(async()=>{n.asyncId=i,n.asyncTo=e;const c=Ft(t,(b,y)=>y==="onRest"?void 0:b);let u,d;const f=new Promise((b,y)=>(u=b,d=y)),m=b=>{const y=i<=(n.cancelId||0)&&ce(r)||i!==n.asyncId&&B(r,!1);if(y)throw b.result=y,d(b),b},v=(b,y)=>{const S=new on,x=new an;return(async()=>{if(G.skipAnimation)throw Re(n),x.result=B(r,!1),d(x),x;m(S);const T=p.obj(b)?{...b}:{...y,to:b};T.parentId=i,q(c,(A,R)=>{p.und(T[R])&&(T[R]=A)});const k=await r.start(T);return m(S),n.paused&&await new Promise(A=>{n.resumeQueue.add(A)}),k})()};let g;if(G.skipAnimation)return Re(n),B(r,!1);try{let b;p.arr(e)?b=(async y=>{for(const S of y)await v(S)})(e):b=Promise.resolve(e(v,r.stop.bind(r))),await Promise.all([b.then(u),f]),g=B(r.get(),!0,!1)}catch(b){if(b instanceof on)g=b.result;else if(b instanceof an)g=b.result;else throw b}finally{i==n.asyncId&&(n.asyncId=s,n.asyncTo=s?a:void 0,n.promise=s?l:void 0)}return p.fun(o)&&P.batchedUpdates(()=>{o(g,r,r.item)}),g})()}function Re(e,t){be(e.timeouts,n=>n.cancel()),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}var on=class extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},an=class extends Error{constructor(){super("SkipAnimationSignal")}},Pt=e=>e instanceof Ut,Oi=1,Ut=class extends Mn{constructor(){super(...arguments),this.id=Oi++,this._priority=0}get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){const e=H(this);return e&&e.getValue()}to(...e){return G.to(this,e)}interpolate(...e){return ai(),G.to(this,e)}toJSON(){return this.get()}observerAdded(e){e==1&&this._attach()}observerRemoved(e){e==0&&this._detach()}_attach(){}_detach(){}_onChange(e,t=!1){Pe(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||tt.sort(this),Pe(this,{type:"priority",parent:this,priority:e})}},re=Symbol.for("SpringPhase"),tr=1,nr=2,rr=4,pt=e=>(e[re]&tr)>0,K=e=>(e[re]&nr)>0,fe=e=>(e[re]&rr)>0,cn=(e,t)=>t?e[re]|=nr|tr:e[re]&=-3,un=(e,t)=>t?e[re]|=rr:e[re]&=-5,ji=class extends Ut{constructor(e,t){if(super(),this.animation=new Ri,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!p.und(e)||!p.und(t)){const n=p.obj(e)?{...e}:{...t,from:e};p.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(K(this)||this._state.asyncTo)||fe(this)}get goal(){return C(this.animation.to)}get velocity(){const e=H(this);return e instanceof Le?e.lastVelocity||0:e.getPayload().map(t=>t.lastVelocity||0)}get hasAnimated(){return pt(this)}get isAnimating(){return K(this)}get isPaused(){return fe(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1;const r=this.animation;let{toValues:i}=r;const{config:s}=r,o=st(r.to);!o&&z(r.to)&&(i=L(C(r.to))),r.values.forEach((c,u)=>{if(c.done)return;const d=c.constructor==Ie?1:o?o[u].lastPosition:i[u];let f=r.immediate,m=d;if(!f){if(m=c.lastPosition,s.tension<=0){c.done=!0;return}let v=c.elapsedTime+=e;const g=r.fromValues[u],b=c.v0!=null?c.v0:c.v0=p.arr(s.velocity)?s.velocity[u]:s.velocity;let y;const S=s.precision||(g==d?.005:Math.min(1,Math.abs(d-g)*.001));if(p.und(s.duration))if(s.decay){const x=s.decay===!0?.998:s.decay,T=Math.exp(-(1-x)*v);m=g+b/(1-x)*(1-T),f=Math.abs(c.lastPosition-m)<=S,y=b*T}else{y=c.lastVelocity==null?b:c.lastVelocity;const x=s.restVelocity||S/10,T=s.clamp?0:s.bounce,k=!p.und(T),A=g==d?c.v0>0:g<d;let R,ie=!1;const j=1,te=Math.ceil(e/j);for(let D=0;D<te&&(R=Math.abs(y)>x,!(!R&&(f=Math.abs(d-m)<=S,f)));++D){k&&(ie=m==d||m>d==A,ie&&(y=-y*T,m=d));const Q=-s.tension*1e-6*(m-d),Y=-s.friction*.001*y,ut=(Q+Y)/s.mass;y=y+ut*j,m=m+y*j}}else{let x=1;s.duration>0&&(this._memoizedDuration!==s.duration&&(this._memoizedDuration=s.duration,c.durationProgress>0&&(c.elapsedTime=s.duration*c.durationProgress,v=c.elapsedTime+=e)),x=(s.progress||0)+v/this._memoizedDuration,x=x>1?1:x<0?0:x,c.durationProgress=x),m=g+s.easing(x)*(d-g),y=(m-c.lastPosition)/e,f=x==1}c.lastVelocity=y,Number.isNaN(m)&&(console.warn("Got NaN while animating:",this),f=!0)}o&&!o[u].done&&(f=!1),f?c.done=!0:t=!1,c.setValue(m,s.round)&&(n=!0)});const a=H(this),l=a.getValue();if(t){const c=C(r.to);(l!==c||n)&&!s.decay?(a.setValue(c),this._onChange(c)):n&&s.decay&&this._onChange(l),this._stop()}else n&&this._onChange(l)}set(e){return P.batchedUpdates(()=>{this._stop(),this._focus(e),this._set(e)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(K(this)){const{to:e,config:t}=this.animation;P.batchedUpdates(()=>{this._onStart(),t.decay||this._set(e,!1),this._stop()})}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,t){let n;return p.und(e)?(n=this.queue||[],this.queue=[]):n=[p.obj(e)?e:{...t,to:e}],Promise.all(n.map(r=>this._update(r))).then(r=>Bt(this,r))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),Re(this._state,e&&this._lastCallId),P.batchedUpdates(()=>this._stop(t,e)),this}reset(){this._update({reset:!0})}eventObserved(e){e.type=="change"?this._start():e.type=="priority"&&(this.priority=e.priority+1)}_prepareNode(e){const t=this.key||"";let{to:n,from:r}=e;n=p.obj(n)?n[t]:n,(n==null||St(n))&&(n=void 0),r=p.obj(r)?r[t]:r,r==null&&(r=void 0);const i={to:n,from:r};return pt(this)||(e.reverse&&([n,r]=[r,n]),r=C(r),p.und(r)?H(this)||this._set(n):this._set(r)),i}_update({...e},t){const{key:n,defaultProps:r}=this;e.default&&Object.assign(r,Ft(e,(o,a)=>/^on/.test(a)?Yn(o,n):o)),dn(this,e,"onProps"),pe(this,"onProps",e,this);const i=this._prepareNode(e);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const s=this._state;return Zn(++this._lastCallId,{key:n,props:e,defaultProps:r,state:s,actions:{pause:()=>{fe(this)||(un(this,!0),ve(s.pauseQueue),pe(this,"onPause",B(this,he(this,this.animation.to)),this))},resume:()=>{fe(this)&&(un(this,!1),K(this)&&this._resume(),ve(s.resumeQueue),pe(this,"onResume",B(this,he(this,this.animation.to)),this))},start:this._merge.bind(this,i)}}).then(o=>{if(e.loop&&o.finished&&!(t&&o.noop)){const a=ir(e);if(a)return this._update(a,!0)}return o})}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(ce(this));const r=!p.und(e.to),i=!p.und(e.from);if(r||i)if(t.callId>this._lastToId)this._lastToId=t.callId;else return n(ce(this));const{key:s,defaultProps:o,animation:a}=this,{to:l,from:c}=a;let{to:u=l,from:d=c}=e;i&&!r&&(!t.default||p.und(u))&&(u=d),t.reverse&&([u,d]=[d,u]);const f=!W(d,c);f&&(a.from=d),d=C(d);const m=!W(u,l);m&&this._focus(u);const v=St(t.to),{config:g}=a,{decay:b,velocity:y}=g;(r||i)&&(g.velocity=0),t.config&&!v&&Ai(g,ne(t.config,s),t.config!==o.config?ne(o.config,s):void 0);let S=H(this);if(!S||p.und(u))return n(B(this,!0));const x=p.und(t.reset)?i&&!t.default:!p.und(d)&&xe(t.reset,s),T=x?d:this.get(),k=Ae(u),A=p.num(k)||p.arr(k)||it(k),R=!v&&(!A||xe(o.immediate||t.immediate,s));if(m){const D=_t(u);if(D!==S.constructor)if(R)S=this._set(k);else throw Error(`Cannot animate between ${S.constructor.name} and ${D.name}, as the "to" prop suggests`)}const ie=S.constructor;let j=z(u),te=!1;if(!j){const D=x||!pt(this)&&f;(m||D)&&(te=W(Ae(T),k),j=!te),(!W(a.immediate,R)&&!R||!W(g.decay,b)||!W(g.velocity,y))&&(j=!0)}if(te&&K(this)&&(a.changed&&!x?j=!0:j||this._stop(l)),!v&&((j||z(l))&&(a.values=S.getPayload(),a.toValues=z(u)?null:ie==Ie?[1]:L(k)),a.immediate!=R&&(a.immediate=R,!R&&!x&&this._set(l)),j)){const{onRest:D}=a;E(Ci,Y=>dn(this,t,Y));const Q=B(this,he(this,l));ve(this._pendingCalls,Q),this._pendingCalls.add(n),a.changed&&P.batchedUpdates(()=>{var Y;a.changed=!x,D==null||D(Q,this),x?ne(o.onRest,Q):(Y=a.onStart)==null||Y.call(a,Q,this)})}x&&this._set(T),v?n(er(t.to,t,this._state,this)):j?this._start():K(this)&&!m?this._pendingCalls.add(n):n(Jn(T))}_focus(e){const t=this.animation;e!==t.to&&(Xt(this)&&this._detach(),t.to=e,Xt(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;z(t)&&(de(t,this),Pt(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;z(e)&&Te(e,this)}_set(e,t=!0){const n=C(e);if(!p.und(n)){const r=H(this);if(!r||!W(n,r.getValue())){const i=_t(n);!r||r.constructor!=i?Mt(this,i.create(n)):r.setValue(n),r&&P.batchedUpdates(()=>{this._onChange(n,t)})}}return H(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,pe(this,"onStart",B(this,he(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),ne(this.animation.onChange,e,this)),ne(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;H(this).reset(C(e.to)),e.immediate||(e.fromValues=e.values.map(t=>t.lastPosition)),K(this)||(cn(this,!0),fe(this)||this._resume())}_resume(){G.skipAnimation?this.finish():tt.start(this)}_stop(e,t){if(K(this)){cn(this,!1);const n=this.animation;E(n.values,i=>{i.done=!0}),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Pe(this,{type:"idle",parent:this});const r=t?ce(this.get()):B(this.get(),he(this,e??n.to));ve(this._pendingCalls,r),n.changed&&(n.changed=!1,pe(this,"onRest",r,this))}}};function he(e,t){const n=Ae(t),r=Ae(e.get());return W(r,n)}function ir(e,t=e.loop,n=e.to){const r=ne(t);if(r){const i=r!==!0&&Xn(r),s=(i||e).reverse,o=!i||i.reset;return Oe({...e,loop:t,default:!1,pause:void 0,to:!s||St(n)?n:void 0,from:o?e.from:void 0,reset:o,...i})}}function Oe(e){const{to:t,from:n}=e=Xn(e),r=new Set;return p.obj(t)&&ln(t,r),p.obj(n)&&ln(n,r),e.keys=r.size?Array.from(r):null,e}function $i(e){const t=Oe(e);return p.und(t.default)&&(t.default=Ft(t)),t}function ln(e,t){q(e,(n,r)=>n!=null&&t.add(r))}var Ci=["onStart","onRest","onChange","onPause","onResume"];function dn(e,t,n){e.animation[n]=t[n]!==Kn(t,n)?Yn(t[n],e.key):void 0}function pe(e,t,...n){var r,i,s,o;(i=(r=e.animation)[t])==null||i.call(r,...n),(o=(s=e.defaultProps)[t])==null||o.call(s,...n)}var Di=["onStart","onChange","onRest"],Li=1,Ni=class{constructor(t,n){this.id=Li++,this.springs={},this.queue=[],this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),n&&(this._flush=n),t&&this.start({default:!0,...t})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(t=>t.idle&&!t.isDelayed&&!t.isPaused)}get item(){return this._item}set item(t){this._item=t}get(){const t={};return this.each((n,r)=>t[r]=n.get()),t}set(t){for(const n in t){const r=t[n];p.und(r)||this.springs[n].set(r)}}update(t){return t&&this.queue.push(Oe(t)),this}start(t){let{queue:n}=this;return t?n=L(t).map(Oe):this.queue=[],this._flush?this._flush(this,n):(ur(this,n),Tt(this,n))}stop(t,n){if(t!==!!t&&(n=t),n){const r=this.springs;E(L(n),i=>r[i].stop(!!t))}else Re(this._state,this._lastAsyncId),this.each(r=>r.stop(!!t));return this}pause(t){if(p.und(t))this.start({pause:!0});else{const n=this.springs;E(L(t),r=>n[r].pause())}return this}resume(t){if(p.und(t))this.start({pause:!1});else{const n=this.springs;E(L(t),r=>n[r].resume())}return this}each(t){q(this.springs,t)}_onFrame(){const{onStart:t,onChange:n,onRest:r}=this._events,i=this._active.size>0,s=this._changed.size>0;(i&&!this._started||s&&!this._started)&&(this._started=!0,be(t,([l,c])=>{c.value=this.get(),l(c,this,this._item)}));const o=!i&&this._started,a=s||o&&r.size?this.get():null;s&&n.size&&be(n,([l,c])=>{c.value=a,l(c,this,this._item)}),o&&(this._started=!1,be(r,([l,c])=>{c.value=a,l(c,this,this._item)}))}eventObserved(t){if(t.type=="change")this._changed.add(t.parent),t.idle||this._active.add(t.parent);else if(t.type=="idle")this._active.delete(t.parent);else return;P.onFrame(this._onFrame)}};function Tt(e,t){return Promise.all(t.map(n=>sr(e,n))).then(n=>Bt(e,n))}async function sr(e,t,n){const{keys:r,to:i,from:s,loop:o,onRest:a,onResolve:l}=t,c=p.obj(t.default)&&t.default;o&&(t.loop=!1),i===!1&&(t.to=null),s===!1&&(t.from=null);const u=p.arr(i)||p.fun(i)?i:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):E(Di,g=>{const b=t[g];if(p.fun(b)){const y=e._events[g];t[g]=({finished:S,cancelled:x})=>{const T=y.get(b);T?(S||(T.finished=!1),x&&(T.cancelled=!0)):y.set(b,{value:null,finished:S||!1,cancelled:x||!1})},c&&(c[g]=t[g])}});const d=e._state;t.pause===!d.paused?(d.paused=t.pause,ve(t.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(t.pause=!0);const f=(r||Object.keys(e.springs)).map(g=>e.springs[g].start(t)),m=t.cancel===!0||Kn(t,"cancel")===!0;(u||m&&d.asyncId)&&f.push(Zn(++e._lastAsyncId,{props:t,state:d,actions:{pause:wt,resume:wt,start(g,b){m?(Re(d,e._lastAsyncId),b(ce(e))):(g.onRest=a,b(er(u,g,d,e)))}}})),d.paused&&await new Promise(g=>{d.resumeQueue.add(g)});const v=Bt(e,await Promise.all(f));if(o&&v.finished&&!(n&&v.noop)){const g=ir(t,o,i);if(g)return ur(e,[g]),sr(e,g,!0)}return l&&P.batchedUpdates(()=>l(v,e,e.item)),v}function fn(e,t){const n={...e.springs};return t&&E(L(t),r=>{p.und(r.keys)&&(r=Oe(r)),p.obj(r.to)||(r={...r,to:void 0}),cr(n,r,i=>ar(i))}),or(e,n),n}function or(e,t){q(t,(n,r)=>{e.springs[r]||(e.springs[r]=n,de(n,e))})}function ar(e,t){const n=new ji;return n.key=e,t&&de(n,t),n}function cr(e,t,n){t.keys&&E(t.keys,r=>{(e[r]||(e[r]=n(r)))._prepareNode(t)})}function ur(e,t){E(t,n=>{cr(e.springs,n,r=>ar(r,e))})}var at=({children:e,...t})=>{const n=w.useContext(Ye),r=t.pause||!!n.pause,i=t.immediate||!!n.immediate;t=di(()=>({pause:r,immediate:i}),[r,i]);const{Provider:s}=Ye;return V.createElement(s,{value:t},e)},Ye=Vi(at,{});at.Provider=Ye.Provider;at.Consumer=Ye.Consumer;function Vi(e,t){return Object.assign(e,V.createContext(t)),e.Provider._context=e,e.Consumer._context=e,e}var zi=()=>{const e=[],t=function(r){ui();const i=[];return E(e,(s,o)=>{if(p.und(r))i.push(s.start());else{const a=n(r,s,o);a&&i.push(s.start(a))}}),i};t.current=e,t.add=function(r){e.includes(r)||e.push(r)},t.delete=function(r){const i=e.indexOf(r);~i&&e.splice(i,1)},t.pause=function(){return E(e,r=>r.pause(...arguments)),this},t.resume=function(){return E(e,r=>r.resume(...arguments)),this},t.set=function(r){E(e,(i,s)=>{const o=p.fun(r)?r(s,i):r;o&&i.set(o)})},t.start=function(r){const i=[];return E(e,(s,o)=>{if(p.und(r))i.push(s.start());else{const a=this._getProps(r,s,o);a&&i.push(s.start(a))}}),i},t.stop=function(){return E(e,r=>r.stop(...arguments)),this},t.update=function(r){return E(e,(i,s)=>i.update(this._getProps(r,i,s))),this};const n=function(r,i,s){return p.fun(r)?r(s,i):r};return t._getProps=n,t};function Mi(e,t,n){const r=p.fun(t)&&t;r&&!n&&(n=[]);const i=w.useMemo(()=>r||arguments.length==3?zi():void 0,[]),s=w.useRef(0),o=Hn(),a=w.useMemo(()=>({ctrls:[],queue:[],flush(y,S){const x=fn(y,S);return s.current>0&&!a.queue.length&&!Object.keys(x).some(k=>!y.springs[k])?Tt(y,S):new Promise(k=>{or(y,x),a.queue.push(()=>{k(Tt(y,S))}),o()})}}),[]),l=w.useRef([...a.ctrls]),c=[],u=Jt(e)||0;w.useMemo(()=>{E(l.current.slice(e,u),y=>{Pi(y,i),y.stop(!0)}),l.current.length=e,d(u,e)},[e]),w.useMemo(()=>{d(0,Math.min(u,e))},n);function d(y,S){for(let x=y;x<S;x++){const T=l.current[x]||(l.current[x]=new Ni(null,a.flush)),k=r?r(x,T):t[x];k&&(c[x]=$i(k))}}const f=l.current.map((y,S)=>fn(y,c[S])),m=w.useContext(at),v=Jt(m),g=m!==v&&ki(m);zt(()=>{s.current++,a.ctrls=l.current;const{queue:y}=a;y.length&&(a.queue=[],E(y,S=>S())),E(l.current,(S,x)=>{i==null||i.add(S),g&&S.start({default:m});const T=c[x];T&&(Ti(S,T.ref),S.ref?S.queue.push(T):S.start(T))})}),qn(()=>()=>{E(a.ctrls,y=>y.stop(!0))});const b=f.map(y=>({...y}));return i?[b,i]:b}function Ne(e,t){const n=p.fun(e),[[r],i]=Mi(1,n?e:[e],n?[]:t);return n||arguments.length==2?[r,i]:r}var Fi=class extends Ut{constructor(e,t){super(),this.source=e,this.idle=!0,this._active=new Set,this.calc=Se(...t);const n=this._get(),r=_t(n);Mt(this,r.create(n))}advance(e){const t=this._get(),n=this.get();W(t,n)||(H(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&hn(this._active)&&mt(this)}_get(){const e=p.arr(this.source)?this.source.map(C):L(C(this.source));return this.calc(...e)}_start(){this.idle&&!hn(this._active)&&(this.idle=!1,E(st(this),e=>{e.done=!1}),G.skipAnimation?(P.batchedUpdates(()=>this.advance()),mt(this)):tt.start(this))}_attach(){let e=1;E(L(this.source),t=>{z(t)&&de(t,this),Pt(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))}),this.priority=e,this._start()}_detach(){E(L(this.source),e=>{z(e)&&Te(e,this)}),this._active.clear(),mt(this)}eventObserved(e){e.type=="change"?e.idle?this.advance():(this._active.add(e.parent),this._start()):e.type=="idle"?this._active.delete(e.parent):e.type=="priority"&&(this.priority=L(this.source).reduce((t,n)=>Math.max(t,(Pt(n)?n.priority:0)+1),0))}};function Bi(e){return e.idle!==!1}function hn(e){return!e.size||Array.from(e).every(Bi)}function mt(e){e.idle||(e.idle=!0,E(st(e),t=>{t.done=!0}),Pe(e,{type:"idle",parent:e}))}G.assign({createStringInterpolator:Un,to:(e,t)=>new Fi(e,t)});var lr=/^--/;function Ui(e,t){return t==null||typeof t=="boolean"||t===""?"":typeof t=="number"&&t!==0&&!lr.test(e)&&!(_e.hasOwnProperty(e)&&_e[e])?t+"px":(""+t).trim()}var pn={};function Gi(e,t){if(!e.nodeType||!e.setAttribute)return!1;const n=e.nodeName==="filter"||e.parentNode&&e.parentNode.nodeName==="filter",{className:r,style:i,children:s,scrollTop:o,scrollLeft:a,viewBox:l,...c}=t,u=Object.values(c),d=Object.keys(c).map(f=>n||e.hasAttribute(f)?f:pn[f]||(pn[f]=f.replace(/([A-Z])/g,m=>"-"+m.toLowerCase())));s!==void 0&&(e.textContent=s);for(const f in i)if(i.hasOwnProperty(f)){const m=Ui(f,i[f]);lr.test(f)?e.style.setProperty(f,m):e.style[f]=m}d.forEach((f,m)=>{e.setAttribute(f,u[m])}),r!==void 0&&(e.className=r),o!==void 0&&(e.scrollTop=o),a!==void 0&&(e.scrollLeft=a),l!==void 0&&e.setAttribute("viewBox",l)}var _e={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Hi=(e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1),qi=["Webkit","Ms","Moz","O"];_e=Object.keys(_e).reduce((e,t)=>(qi.forEach(n=>e[Hi(n,t)]=e[t]),e),_e);var Qi=/^(matrix|translate|scale|rotate|skew)/,Wi=/^(translate)/,Yi=/^(rotate|skew)/,gt=(e,t)=>p.num(e)&&e!==0?e+t:e,Ge=(e,t)=>p.arr(e)?e.every(n=>Ge(n,t)):p.num(e)?e===t:parseFloat(e)===t,Ki=class extends ot{constructor({x:e,y:t,z:n,...r}){const i=[],s=[];(e||t||n)&&(i.push([e||0,t||0,n||0]),s.push(o=>[`translate3d(${o.map(a=>gt(a,"px")).join(",")})`,Ge(o,0)])),q(r,(o,a)=>{if(a==="transform")i.push([o||""]),s.push(l=>[l,l===""]);else if(Qi.test(a)){if(delete r[a],p.und(o))return;const l=Wi.test(a)?"px":Yi.test(a)?"deg":"";i.push(L(o)),s.push(a==="rotate3d"?([c,u,d,f])=>[`rotate3d(${c},${u},${d},${gt(f,l)})`,Ge(f,0)]:c=>[`${a}(${c.map(u=>gt(u,l)).join(",")})`,Ge(c,a.startsWith("scale")?1:0)])}}),i.length&&(r.transform=new Xi(i,s)),super(r)}},Xi=class extends Mn{constructor(e,t){super(),this.inputs=e,this.transforms=t,this._value=null}get(){return this._value||(this._value=this._get())}_get(){let e="",t=!0;return E(this.inputs,(n,r)=>{const i=C(n[0]),[s,o]=this.transforms[r](p.arr(i)?i:n.map(C));e+=" "+s,t=t&&o}),t?"none":e}observerAdded(e){e==1&&E(this.inputs,t=>E(t,n=>z(n)&&de(n,this)))}observerRemoved(e){e==0&&E(this.inputs,t=>E(t,n=>z(n)&&Te(n,this)))}eventObserved(e){e.type=="change"&&(this._value=null),Pe(this,e)}},Zi=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"];G.assign({batchedUpdates:Or.unstable_batchedUpdates,createStringInterpolator:Un,colors:Fr});var Ji=bi(Zi,{applyAnimatedValues:Gi,createAnimatedStyle:e=>new Ki(e),getComponentProps:({scrollTop:e,scrollLeft:t,...n})=>n}),le=Ji.animated;const dr=w.createContext({});function es({children:e,...t}){return h.jsx(dr.Provider,{value:t,children:e})}function ts(){return w.useContext(dr)}function Gt({animate:e,content:t,textStyles:n,htmlElement:r,fadeIn:i,characterPreference:s,maxDelay:o=15e3,staticLanguage:a}){const l=ts(),c=e??l.animate??!0,u=s??l.characterPreference??"simplified",d=a??l.staticLanguage??"english",f=r??"div",[m,v]=w.useState(!1),[g,b]=Ne(()=>({opacity:i?0:1,config:{duration:600}})),y=w.useRef(c);w.useEffect(()=>{if(!c){y.current=c;return}const Er=!y.current&&c;y.current=c;const Ir=Er?500:Math.floor(Math.random()*(o-3500+1))+3500,Ar=setTimeout(()=>{b.start({opacity:0,onRest:()=>{v(Rr=>!Rr),b.start({opacity:1})}})},Ir);return()=>clearTimeout(Ar)},[m,c,b,o]);const S=u==="traditional"?t.traditional:t.simplified,x=d==="chinese"?S:t.english,T=c?m?S:t.english:x,{fontSize:k,fontFamily:A,fontWeight:R,fontStyle:ie,letterSpacing:j,lineHeight:te,...D}=n||{},Q={fontSize:k,fontFamily:A,fontWeight:R,fontStyle:ie,letterSpacing:j,lineHeight:te},Y={...D,display:"inline-grid",alignContent:"center"},ut={...Q,gridArea:"1 / 1"},lt={...Q,gridArea:"1 / 1",visibility:"hidden"};return h.jsx(le.div,{style:{...g,display:"inline-block"},children:h.jsxs(f,{style:Y,children:[h.jsx("span",{style:ut,children:T}),h.jsx("span",{style:lt,children:t.english}),h.jsx("span",{style:lt,children:t.simplified}),h.jsx("span",{style:lt,children:t.traditional})]})})}const ns=N.keyframes`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("react/jsx-runtime"),w=require("react"),jn=require("react-dom"),N=require("styled-components"),It=require("@reduxjs/toolkit"),Ln=e=>e&&e.__esModule?e:{default:e};function Fn(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const V=Fn(w),_=Ln(N);var Rt=Fe(),A=e=>Le(e,Rt),Dt=Fe();A.write=e=>Le(e,Dt);var rt=Fe();A.onStart=e=>Le(e,rt);var $t=Fe();A.onFrame=e=>Le(e,$t);var jt=Fe();A.onFinish=e=>Le(e,jt);var ue=[];A.setTimeout=(e,t)=>{const r=A.now()+t,n=()=>{const s=ue.findIndex(o=>o.cancel==n);~s&&ue.splice(s,1),J-=~s?1:0},i={time:r,handler:e,cancel:n};return ue.splice(Dr(r),0,i),J+=1,$r(),i};var Dr=e=>~(~ue.findIndex(t=>t.time>e)||~ue.length);A.cancel=e=>{rt.delete(e),$t.delete(e),jt.delete(e),Rt.delete(e),Dt.delete(e)};A.sync=e=>{xt=!0,A.batchedUpdates(e),xt=!1};A.throttle=e=>{let t;function r(){try{e(...t)}finally{t=null}}function n(...i){t=i,A.onStart(r)}return n.handler=e,n.cancel=()=>{rt.delete(r),t=null},n};var Lt=typeof window<"u"?window.requestAnimationFrame:()=>{};A.use=e=>Lt=e;A.now=typeof performance<"u"?()=>performance.now():Date.now;A.batchedUpdates=e=>e();A.catch=console.error;A.frameLoop="always";A.advance=()=>{A.frameLoop!=="demand"?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):Lr()};var Z=-1,J=0,xt=!1;function Le(e,t){xt?(t.delete(e),e(0)):(t.add(e),$r())}function $r(){Z<0&&(Z=0,A.frameLoop!=="demand"&&Lt(jr))}function Nn(){Z=-1}function jr(){~Z&&(Lt(jr),A.batchedUpdates(Lr))}function Lr(){const e=Z;Z=A.now();const t=Dr(Z);if(t&&(Fr(ue.splice(0,t),r=>r.handler()),J-=t),!J){Nn();return}rt.flush(),Rt.flush(e?Math.min(64,Z-e):16.667),$t.flush(),Dt.flush(),jt.flush()}function Fe(){let e=new Set,t=e;return{add(r){J+=t==e&&!e.has(r)?1:0,e.add(r)},delete(r){return J-=t==e&&e.has(r)?1:0,e.delete(r)},flush(r){t.size&&(e=new Set,J-=t.size,Fr(t,n=>n(r)&&e.add(n)),J+=e.size,t=e)}}}function Fr(e,t){e.forEach(r=>{try{t(r)}catch(n){A.catch(n)}})}var Vn=Object.defineProperty,Mn=(e,t)=>{for(var r in t)Vn(e,r,{get:t[r],enumerable:!0})},G={};Mn(G,{assign:()=>Bn,colors:()=>ee,createStringInterpolator:()=>Nt,skipAnimation:()=>Vr,to:()=>Nr,willAdvance:()=>Vt});function _t(){}var zn=(e,t,r)=>Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0}),p={arr:Array.isArray,obj:e=>!!e&&e.constructor.name==="Object",fun:e=>typeof e=="function",str:e=>typeof e=="string",num:e=>typeof e=="number",und:e=>e===void 0};function Y(e,t){if(p.arr(e)){if(!p.arr(t)||e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}return e===t}var E=(e,t)=>e.forEach(t);function W(e,t,r){if(p.arr(e)){for(let n=0;n<e.length;n++)t.call(r,e[n],`${n}`);return}for(const n in e)e.hasOwnProperty(n)&&t.call(r,e[n],n)}var F=e=>p.und(e)?[]:p.arr(e)?e:[e];function xe(e,t){if(e.size){const r=Array.from(e);e.clear(),E(r,t)}}var we=(e,...t)=>xe(e,r=>r(...t)),Ft=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),Nt,Nr,ee=null,Vr=!1,Vt=_t,Bn=e=>{e.to&&(Nr=e.to),e.now&&(A.now=e.now),e.colors!==void 0&&(ee=e.colors),e.skipAnimation!=null&&(Vr=e.skipAnimation),e.createStringInterpolator&&(Nt=e.createStringInterpolator),e.requestAnimationFrame&&A.use(e.requestAnimationFrame),e.batchedUpdates&&(A.batchedUpdates=e.batchedUpdates),e.willAdvance&&(Vt=e.willAdvance),e.frameLoop&&(A.frameLoop=e.frameLoop)},_e=new Set,B=[],ht=[],Qe=0,nt={get idle(){return!_e.size&&!B.length},start(e){Qe>e.priority?(_e.add(e),A.onStart(Un)):(Mr(e),A(kt))},advance:kt,sort(e){if(Qe)A.onFrame(()=>nt.sort(e));else{const t=B.indexOf(e);~t&&(B.splice(t,1),zr(e))}},clear(){B=[],_e.clear()}};function Un(){_e.forEach(Mr),_e.clear(),A(kt)}function Mr(e){B.includes(e)||zr(e)}function zr(e){B.splice(Hn(B,t=>t.priority>e.priority),0,e)}function kt(e){const t=ht;for(let r=0;r<B.length;r++){const n=B[r];Qe=n.priority,n.idle||(Vt(n),n.advance(e),n.idle||t.push(n))}return Qe=0,ht=B,ht.length=0,B=t,B.length>0}function Hn(e,t){const r=e.findIndex(t);return r<0?e.length:r}var Gn={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},H="[-+]?\\d*\\.?\\d+",Ye=H+"%";function it(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var qn=new RegExp("rgb"+it(H,H,H)),Wn=new RegExp("rgba"+it(H,H,H,H)),Qn=new RegExp("hsl"+it(H,Ye,Ye)),Yn=new RegExp("hsla"+it(H,Ye,Ye,H)),Kn=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Xn=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Zn=/^#([0-9a-fA-F]{6})$/,Jn=/^#([0-9a-fA-F]{8})$/;function ei(e){let t;return typeof e=="number"?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=Zn.exec(e))?parseInt(t[1]+"ff",16)>>>0:ee&&ee[e]!==void 0?ee[e]:(t=qn.exec(e))?(oe(t[1])<<24|oe(t[2])<<16|oe(t[3])<<8|255)>>>0:(t=Wn.exec(e))?(oe(t[1])<<24|oe(t[2])<<16|oe(t[3])<<8|Xt(t[4]))>>>0:(t=Kn.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=Jn.exec(e))?parseInt(t[1],16)>>>0:(t=Xn.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=Qn.exec(e))?(Yt(Kt(t[1]),Ue(t[2]),Ue(t[3]))|255)>>>0:(t=Yn.exec(e))?(Yt(Kt(t[1]),Ue(t[2]),Ue(t[3]))|Xt(t[4]))>>>0:null}function pt(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function Yt(e,t,r){const n=r<.5?r*(1+t):r+t-r*t,i=2*r-n,s=pt(i,n,e+1/3),o=pt(i,n,e),a=pt(i,n,e-1/3);return Math.round(s*255)<<24|Math.round(o*255)<<16|Math.round(a*255)<<8}function oe(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function Kt(e){return(parseFloat(e)%360+360)%360/360}function Xt(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(t*255)}function Ue(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function Zt(e){let t=ei(e);if(t===null)return e;t=t||0;const r=(t&4278190080)>>>24,n=(t&16711680)>>>16,i=(t&65280)>>>8,s=(t&255)/255;return`rgba(${r}, ${n}, ${i}, ${s})`}var Ae=(e,t,r)=>{if(p.fun(e))return e;if(p.arr(e))return Ae({range:e,output:t,extrapolate:r});if(p.str(e.output[0]))return Nt(e);const n=e,i=n.output,s=n.range||[0,1],o=n.extrapolateLeft||n.extrapolate||"extend",a=n.extrapolateRight||n.extrapolate||"extend",l=n.easing||(c=>c);return c=>{const u=ri(c,s);return ti(c,s[u],s[u+1],i[u],i[u+1],l,o,a,n.map)}};function ti(e,t,r,n,i,s,o,a,l){let c=l?l(e):e;if(c<t){if(o==="identity")return c;o==="clamp"&&(c=t)}if(c>r){if(a==="identity")return c;a==="clamp"&&(c=r)}return n===i?n:t===r?e<=t?n:i:(t===-1/0?c=-c:r===1/0?c=c-t:c=(c-t)/(r-t),c=s(c),n===-1/0?c=-c:i===1/0?c=c+n:c=c*(i-n)+n,c)}function ri(e,t){for(var r=1;r<t.length-1&&!(t[r]>=e);++r);return r-1}var ni={linear:e=>e},Pe=Symbol.for("FluidValue.get"),de=Symbol.for("FluidValue.observers"),M=e=>!!(e&&e[Pe]),j=e=>e&&e[Pe]?e[Pe]():e,Jt=e=>e[de]||null;function ii(e,t){e.eventObserved?e.eventObserved(t):e(t)}function Ee(e,t){const r=e[de];r&&r.forEach(n=>{ii(n,t)})}var Br=class{constructor(e){if(!e&&!(e=this.get))throw Error("Unknown getter");si(this,e)}},si=(e,t)=>Ur(e,Pe,t);function he(e,t){if(e[Pe]){let r=e[de];r||Ur(e,de,r=new Set),r.has(t)||(r.add(t),e.observerAdded&&e.observerAdded(r.size,t))}return t}function Te(e,t){const r=e[de];if(r&&r.has(t)){const n=r.size-1;n?r.delete(t):e[de]=null,e.observerRemoved&&e.observerRemoved(n,t)}}var Ur=(e,t,r)=>Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0}),Ge=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,oi=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,er=new RegExp(`(${Ge.source})(%|[a-z]+)`,"i"),ai=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,st=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,Hr=e=>{const[t,r]=ci(e);if(!t||Ft())return e;const n=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(n)return n.trim();if(r&&r.startsWith("--")){const i=window.getComputedStyle(document.documentElement).getPropertyValue(r);return i||e}else{if(r&&st.test(r))return Hr(r);if(r)return r}return e},ci=e=>{const t=st.exec(e);if(!t)return[,];const[,r,n]=t;return[r,n]},gt,ui=(e,t,r,n,i)=>`rgba(${Math.round(t)}, ${Math.round(r)}, ${Math.round(n)}, ${i})`,Gr=e=>{gt||(gt=ee?new RegExp(`(${Object.keys(ee).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map(s=>j(s).replace(st,Hr).replace(oi,Zt).replace(gt,Zt)),r=t.map(s=>s.match(Ge).map(Number)),i=r[0].map((s,o)=>r.map(a=>{if(!(o in a))throw Error('The arity of each "output" value must be equal');return a[o]})).map(s=>Ae({...e,output:s}));return s=>{var l;const o=!er.test(t[0])&&((l=t.find(c=>er.test(c)))==null?void 0:l.replace(Ge,""));let a=0;return t[0].replace(Ge,()=>`${i[a++](s)}${o||""}`).replace(ai,ui)}},Mt="react-spring: ",qr=e=>{const t=e;let r=!1;if(typeof t!="function")throw new TypeError(`${Mt}once requires a function parameter`);return(...n)=>{r||(t(...n),r=!0)}},li=qr(console.warn);function di(){li(`${Mt}The "interpolate" function is deprecated in v9 (use "to" instead)`)}var fi=qr(console.warn);function hi(){fi(`${Mt}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`)}function ot(e){return p.str(e)&&(e[0]=="#"||/\d/.test(e)||!Ft()&&st.test(e)||e in(ee||{}))}var zt=Ft()?w.useEffect:w.useLayoutEffect,pi=()=>{const e=w.useRef(!1);return zt(()=>(e.current=!0,()=>{e.current=!1}),[]),e};function Wr(){const e=w.useState()[1],t=pi();return()=>{t.current&&e(Math.random())}}function gi(e,t){const[r]=w.useState(()=>({inputs:t,result:e()})),n=w.useRef(),i=n.current;let s=i;return s?t&&s.inputs&&mi(t,s.inputs)||(s={inputs:t,result:e()}):s=r,w.useEffect(()=>{n.current=s,i==r&&(r.inputs=r.result=void 0)},[s]),s.result}function mi(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}var Qr=e=>w.useEffect(e,yi),yi=[];function tr(e){const t=w.useRef();return w.useEffect(()=>{t.current=e}),t.current}var Ce=Symbol.for("Animated:node"),vi=e=>!!e&&e[Ce]===e,q=e=>e&&e[Ce],Bt=(e,t)=>zn(e,Ce,t),at=e=>e&&e[Ce]&&e[Ce].getPayload(),Yr=class{constructor(){Bt(this,this)}getPayload(){return this.payload||[]}},Ne=class extends Yr{constructor(e){super(),this._value=e,this.done=!0,this.durationProgress=0,p.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new Ne(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return p.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value===e?!1:(this._value=e,!0)}reset(){const{done:e}=this;this.done=!1,p.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},Oe=class extends Ne{constructor(e){super(0),this._string=null,this._toString=Ae({output:[e,e]})}static create(e){return new Oe(e)}getValue(){const e=this._string;return e??(this._string=this._toString(this._value))}setValue(e){if(p.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else if(super.setValue(e))this._string=null;else return!1;return!0}reset(e){e&&(this._toString=Ae({output:[this.getValue(),e]})),this._value=0,super.reset()}},Ke={dependencies:null},ct=class extends Yr{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return W(this.source,(r,n)=>{vi(r)?t[n]=r.getValue(e):M(r)?t[n]=j(r):e||(t[n]=r)}),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&E(this.payload,e=>e.reset())}_makePayload(e){if(e){const t=new Set;return W(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){Ke.dependencies&&M(e)&&Ke.dependencies.add(e);const t=at(e);t&&E(t,r=>this.add(r))}},Kr=class extends ct{constructor(e){super(e)}static create(e){return new Kr(e)}getValue(){return this.source.map(e=>e.getValue())}setValue(e){const t=this.getPayload();return e.length==t.length?t.map((r,n)=>r.setValue(e[n])).some(Boolean):(super.setValue(e.map(bi)),!0)}};function bi(e){return(ot(e)?Oe:Ne).create(e)}function St(e){const t=q(e);return t?t.constructor:p.arr(e)?Kr:ot(e)?Oe:Ne}var rr=(e,t)=>{const r=!p.fun(e)||e.prototype&&e.prototype.isReactComponent;return w.forwardRef((n,i)=>{const s=w.useRef(null),o=r&&w.useCallback(v=>{s.current=_i(i,v)},[i]),[a,l]=xi(n,t),c=Wr(),u=()=>{const v=s.current;if(r&&!v)return;(v?t.applyAnimatedValues(v,a.getValue(!0)):!1)===!1&&c()},d=new wi(u,l),f=w.useRef();zt(()=>(f.current=d,E(l,v=>he(v,d)),()=>{f.current&&(E(f.current.deps,v=>Te(v,f.current)),A.cancel(f.current.update))})),w.useEffect(u,[]),Qr(()=>()=>{const v=f.current;E(v.deps,m=>Te(m,v))});const g=t.getComponentProps(a.getValue());return V.createElement(e,{...g,ref:o})})},wi=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){e.type=="change"&&A.write(this.update)}};function xi(e,t){const r=new Set;return Ke.dependencies=r,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new ct(e),Ke.dependencies=null,[e,r]}function _i(e,t){return e&&(p.fun(e)?e(t):e.current=t),t}var nr=Symbol.for("AnimatedComponent"),ki=(e,{applyAnimatedValues:t=()=>!1,createAnimatedStyle:r=i=>new ct(i),getComponentProps:n=i=>i}={})=>{const i={applyAnimatedValues:t,createAnimatedStyle:r,getComponentProps:n},s=o=>{const a=ir(o)||"Anonymous";return p.str(o)?o=s[o]||(s[o]=rr(o,i)):o=o[nr]||(o[nr]=rr(o,i)),o.displayName=`Animated(${a})`,o};return W(e,(o,a)=>{p.arr(e)&&(a=ir(o)),s[a]=s(o)}),{animated:s}},ir=e=>p.str(e)?e:e&&p.str(e.displayName)?e.displayName:p.fun(e)&&e.name||null;function ne(e,...t){return p.fun(e)?e(...t):e}var ke=(e,t)=>e===!0||!!(t&&e&&(p.fun(e)?e(t):F(e).includes(t))),Xr=(e,t)=>p.obj(e)?t&&e[t]:e,Zr=(e,t)=>e.default===!0?e[t]:e.default?e.default[t]:void 0,Si=e=>e,Ut=(e,t=Si)=>{let r=Ai;e.default&&e.default!==!0&&(e=e.default,r=Object.keys(e));const n={};for(const i of r){const s=t(e[i],i);p.und(s)||(n[i]=s)}return n},Ai=["config","onProps","onStart","onChange","onPause","onResume","onRest"],Pi={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function Ei(e){const t={};let r=0;if(W(e,(n,i)=>{Pi[i]||(t[i]=n,r++)}),r)return t}function Jr(e){const t=Ei(e);if(t){const r={to:t};return W(e,(n,i)=>i in t||(r[i]=n)),r}return{...e}}function Ie(e){return e=j(e),p.arr(e)?e.map(Ie):ot(e)?G.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function Ti(e){for(const t in e)return!0;return!1}function At(e){return p.fun(e)||p.arr(e)&&p.obj(e[0])}function Ci(e,t){var r;(r=e.ref)==null||r.delete(e),t==null||t.delete(e)}function Oi(e,t){var r;t&&e.ref!==t&&((r=e.ref)==null||r.delete(e),t.add(e),e.ref=t)}var Ii={default:{tension:170,friction:26}},Pt={...Ii.default,mass:1,damping:1,easing:ni.linear,clamp:!1},Ri=class{constructor(){this.velocity=0,Object.assign(this,Pt)}};function Di(e,t,r){r&&(r={...r},sr(r,t),t={...r,...t}),sr(e,t),Object.assign(e,t);for(const o in Pt)e[o]==null&&(e[o]=Pt[o]);let{frequency:n,damping:i}=e;const{mass:s}=e;return p.und(n)||(n<.01&&(n=.01),i<0&&(i=0),e.tension=Math.pow(2*Math.PI/n,2)*s,e.friction=4*Math.PI*i*s/n),e}function sr(e,t){if(!p.und(t.decay))e.duration=void 0;else{const r=!p.und(t.tension)||!p.und(t.friction);(r||!p.und(t.frequency)||!p.und(t.damping)||!p.und(t.mass))&&(e.duration=void 0,e.decay=void 0),r&&(e.frequency=void 0)}}var or=[],$i=class{constructor(){this.changed=!1,this.values=or,this.toValues=null,this.fromValues=or,this.config=new Ri,this.immediate=!1}};function en(e,{key:t,props:r,defaultProps:n,state:i,actions:s}){return new Promise((o,a)=>{let l,c,u=ke(r.cancel??(n==null?void 0:n.cancel),t);if(u)g();else{p.und(r.pause)||(i.paused=ke(r.pause,t));let v=n==null?void 0:n.pause;v!==!0&&(v=i.paused||ke(v,t)),l=ne(r.delay||0,t),v?(i.resumeQueue.add(f),s.pause()):(s.resume(),f())}function d(){i.resumeQueue.add(f),i.timeouts.delete(c),c.cancel(),l=c.time-A.now()}function f(){l>0&&!G.skipAnimation?(i.delayed=!0,c=A.setTimeout(g,l),i.pauseQueue.add(d),i.timeouts.add(c)):g()}function g(){i.delayed&&(i.delayed=!1),i.pauseQueue.delete(d),i.timeouts.delete(c),e<=(i.cancelId||0)&&(u=!0);try{s.start({...r,callId:e,cancel:u},o)}catch(v){a(v)}}})}var Ht=(e,t)=>t.length==1?t[0]:t.some(r=>r.cancelled)?le(e.get()):t.every(r=>r.noop)?tn(e.get()):U(e.get(),t.every(r=>r.finished)),tn=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),U=(e,t,r=!1)=>({value:e,finished:t,cancelled:r}),le=e=>({value:e,cancelled:!0,finished:!1});function rn(e,t,r,n){const{callId:i,parentId:s,onRest:o}=t,{asyncTo:a,promise:l}=r;return!s&&e===a&&!t.reset?l:r.promise=(async()=>{r.asyncId=i,r.asyncTo=e;const c=Ut(t,(b,y)=>y==="onRest"?void 0:b);let u,d;const f=new Promise((b,y)=>(u=b,d=y)),g=b=>{const y=i<=(r.cancelId||0)&&le(n)||i!==r.asyncId&&U(n,!1);if(y)throw b.result=y,d(b),b},v=(b,y)=>{const k=new ar,x=new cr;return(async()=>{if(G.skipAnimation)throw Re(r),x.result=U(n,!1),d(x),x;g(k);const P=p.obj(b)?{...b}:{...y,to:b};P.parentId=i,W(c,(C,O)=>{p.und(P[O])&&(P[O]=C)});const S=await n.start(P);return g(k),r.paused&&await new Promise(C=>{r.resumeQueue.add(C)}),S})()};let m;if(G.skipAnimation)return Re(r),U(n,!1);try{let b;p.arr(e)?b=(async y=>{for(const k of y)await v(k)})(e):b=Promise.resolve(e(v,n.stop.bind(n))),await Promise.all([b.then(u),f]),m=U(n.get(),!0,!1)}catch(b){if(b instanceof ar)m=b.result;else if(b instanceof cr)m=b.result;else throw b}finally{i==r.asyncId&&(r.asyncId=s,r.asyncTo=s?a:void 0,r.promise=s?l:void 0)}return p.fun(o)&&A.batchedUpdates(()=>{o(m,n,n.item)}),m})()}function Re(e,t){xe(e.timeouts,r=>r.cancel()),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}var ar=class extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},cr=class extends Error{constructor(){super("SkipAnimationSignal")}},Et=e=>e instanceof Gt,ji=1,Gt=class extends Br{constructor(){super(...arguments),this.id=ji++,this._priority=0}get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){const e=q(this);return e&&e.getValue()}to(...e){return G.to(this,e)}interpolate(...e){return di(),G.to(this,e)}toJSON(){return this.get()}observerAdded(e){e==1&&this._attach()}observerRemoved(e){e==0&&this._detach()}_attach(){}_detach(){}_onChange(e,t=!1){Ee(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||nt.sort(this),Ee(this,{type:"priority",parent:this,priority:e})}},ie=Symbol.for("SpringPhase"),nn=1,sn=2,on=4,mt=e=>(e[ie]&nn)>0,X=e=>(e[ie]&sn)>0,pe=e=>(e[ie]&on)>0,ur=(e,t)=>t?e[ie]|=sn|nn:e[ie]&=-3,lr=(e,t)=>t?e[ie]|=on:e[ie]&=-5,Li=class extends Gt{constructor(e,t){if(super(),this.animation=new $i,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!p.und(e)||!p.und(t)){const r=p.obj(e)?{...e}:{...t,from:e};p.und(r.default)&&(r.default=!0),this.start(r)}}get idle(){return!(X(this)||this._state.asyncTo)||pe(this)}get goal(){return j(this.animation.to)}get velocity(){const e=q(this);return e instanceof Ne?e.lastVelocity||0:e.getPayload().map(t=>t.lastVelocity||0)}get hasAnimated(){return mt(this)}get isAnimating(){return X(this)}get isPaused(){return pe(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,r=!1;const n=this.animation;let{toValues:i}=n;const{config:s}=n,o=at(n.to);!o&&M(n.to)&&(i=F(j(n.to))),n.values.forEach((c,u)=>{if(c.done)return;const d=c.constructor==Oe?1:o?o[u].lastPosition:i[u];let f=n.immediate,g=d;if(!f){if(g=c.lastPosition,s.tension<=0){c.done=!0;return}let v=c.elapsedTime+=e;const m=n.fromValues[u],b=c.v0!=null?c.v0:c.v0=p.arr(s.velocity)?s.velocity[u]:s.velocity;let y;const k=s.precision||(m==d?.005:Math.min(1,Math.abs(d-m)*.001));if(p.und(s.duration))if(s.decay){const x=s.decay===!0?.998:s.decay,P=Math.exp(-(1-x)*v);g=m+b/(1-x)*(1-P),f=Math.abs(c.lastPosition-g)<=k,y=b*P}else{y=c.lastVelocity==null?b:c.lastVelocity;const x=s.restVelocity||k/10,P=s.clamp?0:s.bounce,S=!p.und(P),C=m==d?c.v0>0:m<d;let O,se=!1;const D=1,re=Math.ceil(e/D);for(let L=0;L<re&&(O=Math.abs(y)>x,!(!O&&(f=Math.abs(d-g)<=k,f)));++L){S&&(se=g==d||g>d==C,se&&(y=-y*P,g=d));const Q=-s.tension*1e-6*(g-d),K=-s.friction*.001*y,dt=(Q+K)/s.mass;y=y+dt*D,g=g+y*D}}else{let x=1;s.duration>0&&(this._memoizedDuration!==s.duration&&(this._memoizedDuration=s.duration,c.durationProgress>0&&(c.elapsedTime=s.duration*c.durationProgress,v=c.elapsedTime+=e)),x=(s.progress||0)+v/this._memoizedDuration,x=x>1?1:x<0?0:x,c.durationProgress=x),g=m+s.easing(x)*(d-m),y=(g-c.lastPosition)/e,f=x==1}c.lastVelocity=y,Number.isNaN(g)&&(console.warn("Got NaN while animating:",this),f=!0)}o&&!o[u].done&&(f=!1),f?c.done=!0:t=!1,c.setValue(g,s.round)&&(r=!0)});const a=q(this),l=a.getValue();if(t){const c=j(n.to);(l!==c||r)&&!s.decay?(a.setValue(c),this._onChange(c)):r&&s.decay&&this._onChange(l),this._stop()}else r&&this._onChange(l)}set(e){return A.batchedUpdates(()=>{this._stop(),this._focus(e),this._set(e)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(X(this)){const{to:e,config:t}=this.animation;A.batchedUpdates(()=>{this._onStart(),t.decay||this._set(e,!1),this._stop()})}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,t){let r;return p.und(e)?(r=this.queue||[],this.queue=[]):r=[p.obj(e)?e:{...t,to:e}],Promise.all(r.map(n=>this._update(n))).then(n=>Ht(this,n))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),Re(this._state,e&&this._lastCallId),A.batchedUpdates(()=>this._stop(t,e)),this}reset(){this._update({reset:!0})}eventObserved(e){e.type=="change"?this._start():e.type=="priority"&&(this.priority=e.priority+1)}_prepareNode(e){const t=this.key||"";let{to:r,from:n}=e;r=p.obj(r)?r[t]:r,(r==null||At(r))&&(r=void 0),n=p.obj(n)?n[t]:n,n==null&&(n=void 0);const i={to:r,from:n};return mt(this)||(e.reverse&&([r,n]=[n,r]),n=j(n),p.und(n)?q(this)||this._set(r):this._set(n)),i}_update({...e},t){const{key:r,defaultProps:n}=this;e.default&&Object.assign(n,Ut(e,(o,a)=>/^on/.test(a)?Xr(o,r):o)),fr(this,e,"onProps"),me(this,"onProps",e,this);const i=this._prepareNode(e);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const s=this._state;return en(++this._lastCallId,{key:r,props:e,defaultProps:n,state:s,actions:{pause:()=>{pe(this)||(lr(this,!0),we(s.pauseQueue),me(this,"onPause",U(this,ge(this,this.animation.to)),this))},resume:()=>{pe(this)&&(lr(this,!1),X(this)&&this._resume(),we(s.resumeQueue),me(this,"onResume",U(this,ge(this,this.animation.to)),this))},start:this._merge.bind(this,i)}}).then(o=>{if(e.loop&&o.finished&&!(t&&o.noop)){const a=an(e);if(a)return this._update(a,!0)}return o})}_merge(e,t,r){if(t.cancel)return this.stop(!0),r(le(this));const n=!p.und(e.to),i=!p.und(e.from);if(n||i)if(t.callId>this._lastToId)this._lastToId=t.callId;else return r(le(this));const{key:s,defaultProps:o,animation:a}=this,{to:l,from:c}=a;let{to:u=l,from:d=c}=e;i&&!n&&(!t.default||p.und(u))&&(u=d),t.reverse&&([u,d]=[d,u]);const f=!Y(d,c);f&&(a.from=d),d=j(d);const g=!Y(u,l);g&&this._focus(u);const v=At(t.to),{config:m}=a,{decay:b,velocity:y}=m;(n||i)&&(m.velocity=0),t.config&&!v&&Di(m,ne(t.config,s),t.config!==o.config?ne(o.config,s):void 0);let k=q(this);if(!k||p.und(u))return r(U(this,!0));const x=p.und(t.reset)?i&&!t.default:!p.und(d)&&ke(t.reset,s),P=x?d:this.get(),S=Ie(u),C=p.num(S)||p.arr(S)||ot(S),O=!v&&(!C||ke(o.immediate||t.immediate,s));if(g){const L=St(u);if(L!==k.constructor)if(O)k=this._set(S);else throw Error(`Cannot animate between ${k.constructor.name} and ${L.name}, as the "to" prop suggests`)}const se=k.constructor;let D=M(u),re=!1;if(!D){const L=x||!mt(this)&&f;(g||L)&&(re=Y(Ie(P),S),D=!re),(!Y(a.immediate,O)&&!O||!Y(m.decay,b)||!Y(m.velocity,y))&&(D=!0)}if(re&&X(this)&&(a.changed&&!x?D=!0:D||this._stop(l)),!v&&((D||M(l))&&(a.values=k.getPayload(),a.toValues=M(u)?null:se==Oe?[1]:F(S)),a.immediate!=O&&(a.immediate=O,!O&&!x&&this._set(l)),D)){const{onRest:L}=a;E(Ni,K=>fr(this,t,K));const Q=U(this,ge(this,l));we(this._pendingCalls,Q),this._pendingCalls.add(r),a.changed&&A.batchedUpdates(()=>{var K;a.changed=!x,L==null||L(Q,this),x?ne(o.onRest,Q):(K=a.onStart)==null||K.call(a,Q,this)})}x&&this._set(P),v?r(rn(t.to,t,this._state,this)):D?this._start():X(this)&&!g?this._pendingCalls.add(r):r(tn(P))}_focus(e){const t=this.animation;e!==t.to&&(Jt(this)&&this._detach(),t.to=e,Jt(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;M(t)&&(he(t,this),Et(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;M(e)&&Te(e,this)}_set(e,t=!0){const r=j(e);if(!p.und(r)){const n=q(this);if(!n||!Y(r,n.getValue())){const i=St(r);!n||n.constructor!=i?Bt(this,i.create(r)):n.setValue(r),n&&A.batchedUpdates(()=>{this._onChange(r,t)})}}return q(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,me(this,"onStart",U(this,ge(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),ne(this.animation.onChange,e,this)),ne(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;q(this).reset(j(e.to)),e.immediate||(e.fromValues=e.values.map(t=>t.lastPosition)),X(this)||(ur(this,!0),pe(this)||this._resume())}_resume(){G.skipAnimation?this.finish():nt.start(this)}_stop(e,t){if(X(this)){ur(this,!1);const r=this.animation;E(r.values,i=>{i.done=!0}),r.toValues&&(r.onChange=r.onPause=r.onResume=void 0),Ee(this,{type:"idle",parent:this});const n=t?le(this.get()):U(this.get(),ge(this,e??r.to));we(this._pendingCalls,n),r.changed&&(r.changed=!1,me(this,"onRest",n,this))}}};function ge(e,t){const r=Ie(t),n=Ie(e.get());return Y(n,r)}function an(e,t=e.loop,r=e.to){const n=ne(t);if(n){const i=n!==!0&&Jr(n),s=(i||e).reverse,o=!i||i.reset;return De({...e,loop:t,default:!1,pause:void 0,to:!s||At(r)?r:void 0,from:o?e.from:void 0,reset:o,...i})}}function De(e){const{to:t,from:r}=e=Jr(e),n=new Set;return p.obj(t)&&dr(t,n),p.obj(r)&&dr(r,n),e.keys=n.size?Array.from(n):null,e}function Fi(e){const t=De(e);return p.und(t.default)&&(t.default=Ut(t)),t}function dr(e,t){W(e,(r,n)=>r!=null&&t.add(n))}var Ni=["onStart","onRest","onChange","onPause","onResume"];function fr(e,t,r){e.animation[r]=t[r]!==Zr(t,r)?Xr(t[r],e.key):void 0}function me(e,t,...r){var n,i,s,o;(i=(n=e.animation)[t])==null||i.call(n,...r),(o=(s=e.defaultProps)[t])==null||o.call(s,...r)}var Vi=["onStart","onChange","onRest"],Mi=1,zi=class{constructor(t,r){this.id=Mi++,this.springs={},this.queue=[],this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),r&&(this._flush=r),t&&this.start({default:!0,...t})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(t=>t.idle&&!t.isDelayed&&!t.isPaused)}get item(){return this._item}set item(t){this._item=t}get(){const t={};return this.each((r,n)=>t[n]=r.get()),t}set(t){for(const r in t){const n=t[r];p.und(n)||this.springs[r].set(n)}}update(t){return t&&this.queue.push(De(t)),this}start(t){let{queue:r}=this;return t?r=F(t).map(De):this.queue=[],this._flush?this._flush(this,r):(fn(this,r),Tt(this,r))}stop(t,r){if(t!==!!t&&(r=t),r){const n=this.springs;E(F(r),i=>n[i].stop(!!t))}else Re(this._state,this._lastAsyncId),this.each(n=>n.stop(!!t));return this}pause(t){if(p.und(t))this.start({pause:!0});else{const r=this.springs;E(F(t),n=>r[n].pause())}return this}resume(t){if(p.und(t))this.start({pause:!1});else{const r=this.springs;E(F(t),n=>r[n].resume())}return this}each(t){W(this.springs,t)}_onFrame(){const{onStart:t,onChange:r,onRest:n}=this._events,i=this._active.size>0,s=this._changed.size>0;(i&&!this._started||s&&!this._started)&&(this._started=!0,xe(t,([l,c])=>{c.value=this.get(),l(c,this,this._item)}));const o=!i&&this._started,a=s||o&&n.size?this.get():null;s&&r.size&&xe(r,([l,c])=>{c.value=a,l(c,this,this._item)}),o&&(this._started=!1,xe(n,([l,c])=>{c.value=a,l(c,this,this._item)}))}eventObserved(t){if(t.type=="change")this._changed.add(t.parent),t.idle||this._active.add(t.parent);else if(t.type=="idle")this._active.delete(t.parent);else return;A.onFrame(this._onFrame)}};function Tt(e,t){return Promise.all(t.map(r=>cn(e,r))).then(r=>Ht(e,r))}async function cn(e,t,r){const{keys:n,to:i,from:s,loop:o,onRest:a,onResolve:l}=t,c=p.obj(t.default)&&t.default;o&&(t.loop=!1),i===!1&&(t.to=null),s===!1&&(t.from=null);const u=p.arr(i)||p.fun(i)?i:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):E(Vi,m=>{const b=t[m];if(p.fun(b)){const y=e._events[m];t[m]=({finished:k,cancelled:x})=>{const P=y.get(b);P?(k||(P.finished=!1),x&&(P.cancelled=!0)):y.set(b,{value:null,finished:k||!1,cancelled:x||!1})},c&&(c[m]=t[m])}});const d=e._state;t.pause===!d.paused?(d.paused=t.pause,we(t.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(t.pause=!0);const f=(n||Object.keys(e.springs)).map(m=>e.springs[m].start(t)),g=t.cancel===!0||Zr(t,"cancel")===!0;(u||g&&d.asyncId)&&f.push(en(++e._lastAsyncId,{props:t,state:d,actions:{pause:_t,resume:_t,start(m,b){g?(Re(d,e._lastAsyncId),b(le(e))):(m.onRest=a,b(rn(u,m,d,e)))}}})),d.paused&&await new Promise(m=>{d.resumeQueue.add(m)});const v=Ht(e,await Promise.all(f));if(o&&v.finished&&!(r&&v.noop)){const m=an(t,o,i);if(m)return fn(e,[m]),cn(e,m,!0)}return l&&A.batchedUpdates(()=>l(v,e,e.item)),v}function hr(e,t){const r={...e.springs};return t&&E(F(t),n=>{p.und(n.keys)&&(n=De(n)),p.obj(n.to)||(n={...n,to:void 0}),dn(r,n,i=>ln(i))}),un(e,r),r}function un(e,t){W(t,(r,n)=>{e.springs[n]||(e.springs[n]=r,he(r,e))})}function ln(e,t){const r=new Li;return r.key=e,t&&he(r,t),r}function dn(e,t,r){t.keys&&E(t.keys,n=>{(e[n]||(e[n]=r(n)))._prepareNode(t)})}function fn(e,t){E(t,r=>{dn(e.springs,r,n=>ln(n,e))})}var ut=({children:e,...t})=>{const r=w.useContext(Xe),n=t.pause||!!r.pause,i=t.immediate||!!r.immediate;t=gi(()=>({pause:n,immediate:i}),[n,i]);const{Provider:s}=Xe;return V.createElement(s,{value:t},e)},Xe=Bi(ut,{});ut.Provider=Xe.Provider;ut.Consumer=Xe.Consumer;function Bi(e,t){return Object.assign(e,V.createContext(t)),e.Provider._context=e,e.Consumer._context=e,e}var Ui=()=>{const e=[],t=function(n){hi();const i=[];return E(e,(s,o)=>{if(p.und(n))i.push(s.start());else{const a=r(n,s,o);a&&i.push(s.start(a))}}),i};t.current=e,t.add=function(n){e.includes(n)||e.push(n)},t.delete=function(n){const i=e.indexOf(n);~i&&e.splice(i,1)},t.pause=function(){return E(e,n=>n.pause(...arguments)),this},t.resume=function(){return E(e,n=>n.resume(...arguments)),this},t.set=function(n){E(e,(i,s)=>{const o=p.fun(n)?n(s,i):n;o&&i.set(o)})},t.start=function(n){const i=[];return E(e,(s,o)=>{if(p.und(n))i.push(s.start());else{const a=this._getProps(n,s,o);a&&i.push(s.start(a))}}),i},t.stop=function(){return E(e,n=>n.stop(...arguments)),this},t.update=function(n){return E(e,(i,s)=>i.update(this._getProps(n,i,s))),this};const r=function(n,i,s){return p.fun(n)?n(s,i):n};return t._getProps=r,t};function Hi(e,t,r){const n=p.fun(t)&&t;n&&!r&&(r=[]);const i=w.useMemo(()=>n||arguments.length==3?Ui():void 0,[]),s=w.useRef(0),o=Wr(),a=w.useMemo(()=>({ctrls:[],queue:[],flush(y,k){const x=hr(y,k);return s.current>0&&!a.queue.length&&!Object.keys(x).some(S=>!y.springs[S])?Tt(y,k):new Promise(S=>{un(y,x),a.queue.push(()=>{S(Tt(y,k))}),o()})}}),[]),l=w.useRef([...a.ctrls]),c=[],u=tr(e)||0;w.useMemo(()=>{E(l.current.slice(e,u),y=>{Ci(y,i),y.stop(!0)}),l.current.length=e,d(u,e)},[e]),w.useMemo(()=>{d(0,Math.min(u,e))},r);function d(y,k){for(let x=y;x<k;x++){const P=l.current[x]||(l.current[x]=new zi(null,a.flush)),S=n?n(x,P):t[x];S&&(c[x]=Fi(S))}}const f=l.current.map((y,k)=>hr(y,c[k])),g=w.useContext(ut),v=tr(g),m=g!==v&&Ti(g);zt(()=>{s.current++,a.ctrls=l.current;const{queue:y}=a;y.length&&(a.queue=[],E(y,k=>k())),E(l.current,(k,x)=>{i==null||i.add(k),m&&k.start({default:g});const P=c[x];P&&(Oi(k,P.ref),k.ref?k.queue.push(P):k.start(P))})}),Qr(()=>()=>{E(a.ctrls,y=>y.stop(!0))});const b=f.map(y=>({...y}));return i?[b,i]:b}function Ve(e,t){const r=p.fun(e),[[n],i]=Hi(1,r?e:[e],r?[]:t);return r||arguments.length==2?[n,i]:n}var Gi=class extends Gt{constructor(e,t){super(),this.source=e,this.idle=!0,this._active=new Set,this.calc=Ae(...t);const r=this._get(),n=St(r);Bt(this,n.create(r))}advance(e){const t=this._get(),r=this.get();Y(t,r)||(q(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&pr(this._active)&&yt(this)}_get(){const e=p.arr(this.source)?this.source.map(j):F(j(this.source));return this.calc(...e)}_start(){this.idle&&!pr(this._active)&&(this.idle=!1,E(at(this),e=>{e.done=!1}),G.skipAnimation?(A.batchedUpdates(()=>this.advance()),yt(this)):nt.start(this))}_attach(){let e=1;E(F(this.source),t=>{M(t)&&he(t,this),Et(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))}),this.priority=e,this._start()}_detach(){E(F(this.source),e=>{M(e)&&Te(e,this)}),this._active.clear(),yt(this)}eventObserved(e){e.type=="change"?e.idle?this.advance():(this._active.add(e.parent),this._start()):e.type=="idle"?this._active.delete(e.parent):e.type=="priority"&&(this.priority=F(this.source).reduce((t,r)=>Math.max(t,(Et(r)?r.priority:0)+1),0))}};function qi(e){return e.idle!==!1}function pr(e){return!e.size||Array.from(e).every(qi)}function yt(e){e.idle||(e.idle=!0,E(at(e),t=>{t.done=!0}),Ee(e,{type:"idle",parent:e}))}G.assign({createStringInterpolator:Gr,to:(e,t)=>new Gi(e,t)});var hn=/^--/;function Wi(e,t){return t==null||typeof t=="boolean"||t===""?"":typeof t=="number"&&t!==0&&!hn.test(e)&&!(Se.hasOwnProperty(e)&&Se[e])?t+"px":(""+t).trim()}var gr={};function Qi(e,t){if(!e.nodeType||!e.setAttribute)return!1;const r=e.nodeName==="filter"||e.parentNode&&e.parentNode.nodeName==="filter",{className:n,style:i,children:s,scrollTop:o,scrollLeft:a,viewBox:l,...c}=t,u=Object.values(c),d=Object.keys(c).map(f=>r||e.hasAttribute(f)?f:gr[f]||(gr[f]=f.replace(/([A-Z])/g,g=>"-"+g.toLowerCase())));s!==void 0&&(e.textContent=s);for(const f in i)if(i.hasOwnProperty(f)){const g=Wi(f,i[f]);hn.test(f)?e.style.setProperty(f,g):e.style[f]=g}d.forEach((f,g)=>{e.setAttribute(f,u[g])}),n!==void 0&&(e.className=n),o!==void 0&&(e.scrollTop=o),a!==void 0&&(e.scrollLeft=a),l!==void 0&&e.setAttribute("viewBox",l)}var Se={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Yi=(e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1),Ki=["Webkit","Ms","Moz","O"];Se=Object.keys(Se).reduce((e,t)=>(Ki.forEach(r=>e[Yi(r,t)]=e[t]),e),Se);var Xi=/^(matrix|translate|scale|rotate|skew)/,Zi=/^(translate)/,Ji=/^(rotate|skew)/,vt=(e,t)=>p.num(e)&&e!==0?e+t:e,qe=(e,t)=>p.arr(e)?e.every(r=>qe(r,t)):p.num(e)?e===t:parseFloat(e)===t,es=class extends ct{constructor({x:e,y:t,z:r,...n}){const i=[],s=[];(e||t||r)&&(i.push([e||0,t||0,r||0]),s.push(o=>[`translate3d(${o.map(a=>vt(a,"px")).join(",")})`,qe(o,0)])),W(n,(o,a)=>{if(a==="transform")i.push([o||""]),s.push(l=>[l,l===""]);else if(Xi.test(a)){if(delete n[a],p.und(o))return;const l=Zi.test(a)?"px":Ji.test(a)?"deg":"";i.push(F(o)),s.push(a==="rotate3d"?([c,u,d,f])=>[`rotate3d(${c},${u},${d},${vt(f,l)})`,qe(f,0)]:c=>[`${a}(${c.map(u=>vt(u,l)).join(",")})`,qe(c,a.startsWith("scale")?1:0)])}}),i.length&&(n.transform=new ts(i,s)),super(n)}},ts=class extends Br{constructor(e,t){super(),this.inputs=e,this.transforms=t,this._value=null}get(){return this._value||(this._value=this._get())}_get(){let e="",t=!0;return E(this.inputs,(r,n)=>{const i=j(r[0]),[s,o]=this.transforms[n](p.arr(i)?i:r.map(j));e+=" "+s,t=t&&o}),t?"none":e}observerAdded(e){e==1&&E(this.inputs,t=>E(t,r=>M(r)&&he(r,this)))}observerRemoved(e){e==0&&E(this.inputs,t=>E(t,r=>M(r)&&Te(r,this)))}eventObserved(e){e.type=="change"&&(this._value=null),Ee(this,e)}},rs=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"];G.assign({batchedUpdates:jn.unstable_batchedUpdates,createStringInterpolator:Gr,colors:Gn});var ns=ki(rs,{applyAnimatedValues:Qi,createAnimatedStyle:e=>new es(e),getComponentProps:({scrollTop:e,scrollLeft:t,...r})=>r}),fe=ns.animated;const pn=w.createContext({});function is({children:e,...t}){return h.jsx(pn.Provider,{value:t,children:e})}function ss(){return w.useContext(pn)}function qt({animate:e,content:t,textStyles:r,htmlElement:n,fadeIn:i,characterPreference:s,maxDelay:o=15e3,staticLanguage:a}){const l=ss(),c=e??l.animate??!0,u=s??l.characterPreference??"simplified",d=a??l.staticLanguage??"english",f=n??"div",[g,v]=w.useState(!1),[m,b]=Ve(()=>({opacity:i?0:1,config:{duration:600}})),y=w.useRef(c);w.useEffect(()=>{if(!c){y.current=c;return}const In=!y.current&&c;y.current=c;const Rn=In?500:Math.floor(Math.random()*(o-3500+1))+3500,Dn=setTimeout(()=>{b.start({opacity:0,onRest:()=>{v($n=>!$n),b.start({opacity:1})}})},Rn);return()=>clearTimeout(Dn)},[g,c,b,o]);const k=u==="traditional"?t.traditional:t.simplified,x=d==="chinese"?k:t.english,P=c?g?k:t.english:x,{fontSize:S,fontFamily:C,fontWeight:O,fontStyle:se,letterSpacing:D,lineHeight:re,...L}=r||{},Q={fontSize:S,fontFamily:C,fontWeight:O,fontStyle:se,letterSpacing:D,lineHeight:re},K={...L,display:"inline-grid",alignContent:"center"},dt={...Q,gridArea:"1 / 1"},ft={...Q,gridArea:"1 / 1",visibility:"hidden"};return h.jsx(fe.div,{style:{...m,display:"inline-block"},children:h.jsxs(f,{style:K,children:[h.jsx("span",{style:dt,children:P}),h.jsx("span",{style:ft,children:t.english}),h.jsx("span",{style:ft,children:t.simplified}),h.jsx("span",{style:ft,children:t.traditional})]})})}const os=N.keyframes`
|
|
2
2
|
0% {
|
|
3
3
|
transform: scale(1);
|
|
4
4
|
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
100% {
|
|
9
9
|
transform: scale(1);
|
|
10
10
|
}
|
|
11
|
-
`,
|
|
11
|
+
`,as=_.default.div`
|
|
12
12
|
display: inline-block;
|
|
13
13
|
position: relative;
|
|
14
14
|
overflow: hidden;
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
box-shadow: 0px 4px 4px 0px ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.shadow)||"rgba(0, 0, 0, 0.25)"}};
|
|
18
18
|
|
|
19
19
|
&:active {
|
|
20
|
-
animation: ${
|
|
20
|
+
animation: ${os} 0.2s;
|
|
21
21
|
}
|
|
22
|
-
`,
|
|
22
|
+
`,cs=_.default.button`
|
|
23
23
|
display: flex;
|
|
24
24
|
align-items: center;
|
|
25
25
|
position: relative;
|
|
@@ -38,14 +38,14 @@
|
|
|
38
38
|
background-color: ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.secondaryLight)||"#ffb652"}};
|
|
39
39
|
color: ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.onSecondary)||"black"}};
|
|
40
40
|
}
|
|
41
|
-
`,
|
|
41
|
+
`,us=_.default.div`
|
|
42
42
|
display: flex;
|
|
43
43
|
margin-right: 1.25rem;
|
|
44
44
|
|
|
45
45
|
@media (min-width: 640px) {
|
|
46
46
|
margin-right: 0.25rem;
|
|
47
47
|
}
|
|
48
|
-
`;var
|
|
48
|
+
`;var gn={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},mr=V.default.createContext&&V.default.createContext(gn),ls=["attr","size","title"];function ds(e,t){if(e==null)return{};var r=fs(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function fs(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Ze(){return Ze=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ze.apply(this,arguments)}function yr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Je(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?yr(Object(r),!0).forEach(function(n){hs(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yr(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function hs(e,t,r){return t=ps(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ps(e){var t=gs(e,"string");return typeof t=="symbol"?t:t+""}function gs(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function mn(e){return e&&e.map((t,r)=>V.default.createElement(t.tag,Je({key:r},t.attr),mn(t.child)))}function te(e){return t=>V.default.createElement(ms,Ze({attr:Je({},e.attr)},t),mn(e.child))}function ms(e){var t=r=>{var{attr:n,size:i,title:s}=e,o=ds(e,ls),a=i||r.size||"1em",l;return r.className&&(l=r.className),e.className&&(l=(l?l+" ":"")+e.className),V.default.createElement("svg",Ze({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,o,{className:l,style:Je(Je({color:e.color||r.color},r.style),e.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),s&&V.default.createElement("title",null,s),e.children)};return mr!==void 0?V.default.createElement(mr.Consumer,null,r=>t(r)):t(gn)}function ys(e){return te({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"},child:[]}]})(e)}function vs(e){return te({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"22",y1:"2",x2:"11",y2:"13"},child:[]},{tag:"polygon",attr:{points:"22 2 15 22 11 13 2 9 22 2"},child:[]}]})(e)}const bs=({iconComponent:e,buttonText:t,buttonType:r="primary",onClick:n,characterPreference:i,animate:s=!0})=>{let o;e==="plus"?o=h.jsx(ys,{}):e==="send"&&(o=h.jsx(vs,{}));const a=()=>{n&&n()};return h.jsx(as,{onClick:a,children:h.jsxs(cs,{className:r,children:[h.jsx(us,{children:o}),h.jsx(qt,{textStyles:{lineHeight:"0.8rem",minWidth:"3rem"},content:t,animate:s,characterPreference:i})]})})},ws=_.default(fe.div)`
|
|
49
49
|
width: 2.5rem;
|
|
50
50
|
height: 2.5rem;
|
|
51
51
|
border-radius: 50%;
|
|
@@ -54,11 +54,11 @@
|
|
|
54
54
|
align-items: center;
|
|
55
55
|
justify-content: center;
|
|
56
56
|
cursor: pointer;
|
|
57
|
-
`,
|
|
57
|
+
`,xs=_.default.span`
|
|
58
58
|
display: flex;
|
|
59
59
|
color: ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.onSurface)||"black"}};
|
|
60
60
|
font-size: 1.125rem;
|
|
61
|
-
`;function
|
|
61
|
+
`;function _s(e){return te({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6m2-3a2 2 0 1 1-4 0 2 2 0 0 1 4 0m4 8c0 1-1 1-1 1H3s-1 0-1-1 1-4 6-4 6 3 6 4m-1-.004c-.001-.246-.154-.986-.832-1.664C11.516 10.68 10.289 10 8 10s-3.516.68-4.168 1.332c-.678.678-.83 1.418-.832 1.664z"},child:[]}]})(e)}function ks(e){return te({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M0 .5A.5.5 0 0 1 .5 0h3a.5.5 0 0 1 0 1H1v2.5a.5.5 0 0 1-1 0zm12 0a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v3a.5.5 0 0 1-1 0V1h-2.5a.5.5 0 0 1-.5-.5M.5 12a.5.5 0 0 1 .5.5V15h2.5a.5.5 0 0 1 0 1h-3a.5.5 0 0 1-.5-.5v-3a.5.5 0 0 1 .5-.5m15 0a.5.5 0 0 1 .5.5v3a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1 0-1H15v-2.5a.5.5 0 0 1 .5-.5M4 4h1v1H4z"},child:[]},{tag:"path",attr:{d:"M7 2H2v5h5zM3 3h3v3H3zm2 8H4v1h1z"},child:[]},{tag:"path",attr:{d:"M7 9H2v5h5zm-4 1h3v3H3zm8-6h1v1h-1z"},child:[]},{tag:"path",attr:{d:"M9 2h5v5H9zm1 1v3h3V3zM8 8v2h1v1H8v1h2v-2h1v2h1v-1h2v-1h-3V8zm2 2H9V9h1zm4 2h-1v1h-2v1h3zm-4 2v-1H8v1z"},child:[]},{tag:"path",attr:{d:"M12 9h2V8h-2z"},child:[]}]})(e)}const Ss=({iconComponent:e,onClick:t})=>{const r=Ve({from:{opacity:0,transform:"scale(0.5)"},to:{opacity:1,transform:"scale(1)"}}),n=()=>{t&&t()};let i;return e==="person"?i=h.jsx(_s,{}):e==="qr"&&(i=h.jsx(ks,{})),h.jsx(ws,{style:r,onClick:n,children:h.jsx(xs,{children:i})})};function As(e){return te({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M328 112 184 256l144 144"},child:[]}]})(e)}const Ps=({size:e,onClick:t})=>{const r=()=>{t&&t()};return h.jsx(As,{size:e??"1.5rem",onClick:r})},yn=N.keyframes`
|
|
62
62
|
0% {
|
|
63
63
|
transform: scale(0);
|
|
64
64
|
opacity: 0.6;
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
transform: scale(10);
|
|
68
68
|
opacity: 0;
|
|
69
69
|
}
|
|
70
|
-
|
|
70
|
+
`,$e=_.default.span`
|
|
71
71
|
position: absolute;
|
|
72
72
|
left: ${({$x:e})=>e}px;
|
|
73
73
|
top: ${({$y:e})=>e}px;
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
border-radius: 50%;
|
|
79
79
|
background-color: ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.ripple)||"rgba(0, 0, 0, 0.1)"}};
|
|
80
80
|
pointer-events: none;
|
|
81
|
-
animation: ${
|
|
81
|
+
animation: ${yn} 0.4s ease-out forwards;
|
|
82
82
|
`;_.default.div`
|
|
83
83
|
position: absolute;
|
|
84
84
|
left: 0;
|
|
@@ -97,41 +97,41 @@
|
|
|
97
97
|
display: flex;
|
|
98
98
|
flex-direction: column;
|
|
99
99
|
gap: 1.5rem;
|
|
100
|
-
`;const
|
|
100
|
+
`;const Es=_.default.ul`
|
|
101
101
|
display: flex;
|
|
102
102
|
flex-direction: column;
|
|
103
103
|
justify-content: center;
|
|
104
104
|
padding-inline-start: unset;
|
|
105
|
-
`,
|
|
105
|
+
`,Ts=_.default.li`
|
|
106
106
|
position: relative;
|
|
107
107
|
list-style: none;
|
|
108
108
|
cursor: pointer;
|
|
109
109
|
overflow: hidden;
|
|
110
110
|
-webkit-tap-highlight-color: transparent;
|
|
111
111
|
border-bottom: 1px solid ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.scrimLight)||"rgba(0, 0, 0, 0.3)"}};
|
|
112
|
-
`,
|
|
112
|
+
`,Cs=_.default.div`
|
|
113
113
|
display: flex;
|
|
114
114
|
flex-direction: row;
|
|
115
115
|
justify-content: space-between;
|
|
116
116
|
align-items: center;
|
|
117
117
|
padding: 0.5rem 0.75rem;
|
|
118
|
-
`,
|
|
118
|
+
`,Os=_.default.div`
|
|
119
119
|
display: flex;
|
|
120
120
|
flex-direction: row;
|
|
121
121
|
gap: 2rem;
|
|
122
122
|
align-items: center;
|
|
123
|
-
`,
|
|
123
|
+
`,vr=_.default.div`
|
|
124
124
|
display: flex;
|
|
125
125
|
flex-direction: column;
|
|
126
126
|
justify-content: center;
|
|
127
|
-
`,
|
|
127
|
+
`,Is=_.default.span`
|
|
128
128
|
font-size: 1rem;
|
|
129
|
-
`;function
|
|
129
|
+
`;function Rs(e){return te({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"m12.87 15.07-2.54-2.51.03-.03A17.52 17.52 0 0 0 14.07 6H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7 1.62-4.33L19.12 17h-3.24z"},child:[]}]})(e)}function Ds(e){return te({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"},child:[]}]})(e)}function $s(e){return te({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"m6.76 4.84-1.8-1.79-1.41 1.41 1.79 1.79zM1 10.5h3v2H1zM11 .55h2V3.5h-2zm8.04 2.495 1.408 1.407-1.79 1.79-1.407-1.408zm-1.8 15.115 1.79 1.8 1.41-1.41-1.8-1.79zM20 10.5h3v2h-3zm-8-5c-3.31 0-6 2.69-6 6s2.69 6 6 6 6-2.69 6-6-2.69-6-6-6zm0 10c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4zm-1 4h2v2.95h-2zm-7.45-.96 1.41 1.41 1.79-1.8-1.41-1.41z"},child:[]}]})(e)}const js=_.default.input`
|
|
130
130
|
opacity: 0;
|
|
131
131
|
width: 0;
|
|
132
132
|
height: 0;
|
|
133
133
|
position: absolute;
|
|
134
|
-
`,
|
|
134
|
+
`,Ct=_.default.span`
|
|
135
135
|
position: absolute;
|
|
136
136
|
top: 50%;
|
|
137
137
|
left: ${({$checked:e})=>e?"14px":"0px"};
|
|
@@ -143,7 +143,7 @@
|
|
|
143
143
|
transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
|
|
144
144
|
left 150ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
145
145
|
pointer-events: none;
|
|
146
|
-
`,
|
|
146
|
+
`,Ls=_.default.label`
|
|
147
147
|
position: relative;
|
|
148
148
|
display: inline-flex;
|
|
149
149
|
align-items: center;
|
|
@@ -151,28 +151,28 @@
|
|
|
151
151
|
-webkit-tap-highlight-color: transparent;
|
|
152
152
|
|
|
153
153
|
@media (hover: hover) {
|
|
154
|
-
&:hover ${
|
|
155
|
-
background-color: ${({$checked:e,theme:t})=>{var n
|
|
154
|
+
&:hover ${Ct} {
|
|
155
|
+
background-color: ${({$checked:e,theme:t})=>{var r,n;return e?((r=t.colors)==null?void 0:r.toggleHoverOn)||"rgba(72, 159, 181, 0.08)":((n=t.colors)==null?void 0:n.toggleHoverOff)||"rgba(0, 0, 0, 0.04)"}};
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
158
|
|
|
159
|
-
&:focus-within ${
|
|
160
|
-
background-color: ${({$checked:e,theme:t})=>{var n
|
|
159
|
+
&:focus-within ${Ct} {
|
|
160
|
+
background-color: ${({$checked:e,theme:t})=>{var r,n;return e?((r=t.colors)==null?void 0:r.toggleFocusOn)||"rgba(72, 159, 181, 0.12)":((n=t.colors)==null?void 0:n.toggleFocusOff)||"rgba(0, 0, 0, 0.06)"}};
|
|
161
161
|
}
|
|
162
|
-
|
|
162
|
+
`,Fs=_.default.span`
|
|
163
163
|
width: 34px;
|
|
164
164
|
height: 14px;
|
|
165
|
-
background-color: ${({$checked:e,theme:t})=>{var n
|
|
165
|
+
background-color: ${({$checked:e,theme:t})=>{var r,n;return e?((r=t.colors)==null?void 0:r.toggleTrackOn)||"rgba(72, 159, 181, 0.5)":((n=t.colors)==null?void 0:n.toggleTrackOff)||"rgba(0, 0, 0, 0.38)"}};
|
|
166
166
|
border-radius: 7px;
|
|
167
167
|
transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
168
|
-
`,
|
|
168
|
+
`,Ns=_.default.span`
|
|
169
169
|
position: absolute;
|
|
170
170
|
top: 50%;
|
|
171
171
|
left: ${({$checked:e})=>e?"14px":"0px"};
|
|
172
172
|
transform: translateY(-50%);
|
|
173
173
|
width: 20px;
|
|
174
174
|
height: 20px;
|
|
175
|
-
background-color: ${({$checked:e,theme:t})=>{var n
|
|
175
|
+
background-color: ${({$checked:e,theme:t})=>{var r,n;return e?((r=t.colors)==null?void 0:r.toggleThumbOn)||"#489fb5":((n=t.colors)==null?void 0:n.toggleThumbOff)||"#fafafa"}};
|
|
176
176
|
border-radius: 50%;
|
|
177
177
|
box-shadow: 0px 2px 1px -1px ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.shadowLight)||"rgba(0, 0, 0, 0.2)"}},
|
|
178
178
|
0px 1px 1px 0px ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.shadowLighter)||"rgba(0, 0, 0, 0.14)"}},
|
|
@@ -180,49 +180,49 @@
|
|
|
180
180
|
transition: left 150ms cubic-bezier(0.4, 0, 0.2, 1),
|
|
181
181
|
background-color 150ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
182
182
|
pointer-events: none;
|
|
183
|
-
`,
|
|
183
|
+
`,vn=({checked:e,defaultChecked:t=!1,onChange:r,disabled:n=!1})=>{const[i,s]=w.useState(t),o=e!==void 0,a=o?e:i,l=c=>{if(n)return;c.target.blur();const u=!a;o||s(u),r==null||r(u)};return h.jsxs(Ls,{$checked:a,onClick:c=>c.stopPropagation(),children:[h.jsx(js,{type:"checkbox",checked:a,onChange:l,disabled:n}),h.jsx(Fs,{$checked:a}),h.jsx(Ct,{$checked:a}),h.jsx(Ns,{$checked:a})]})},Vs={translate:Rs,sunny:$s,character:({size:e})=>h.jsx("span",{style:{fontSize:e||"1rem",height:e||"1rem",lineHeight:e||"1rem",display:"inline-flex",alignItems:"center"},children:"字"})},Ms=({icon:e,text:t,textContent:r,characterPreference:n,animate:i=!0,maxDelay:s,actionIcon:o="chevron",onClick:a,styles:l,switchChecked:c,onSwitchChange:u,staticLanguage:d})=>{const f=Vs[e],[g,v]=w.useState(null),m=y=>{const k=y.currentTarget.getBoundingClientRect(),x=y.clientX-k.left,P=y.clientY-k.top;v({x,y:P,key:Date.now()}),o==="switch"&&u?u(!c):a&&a()},b=()=>o==="switch"?h.jsx(vn,{checked:c,onChange:u}):h.jsx(Ds,{});return h.jsxs(Ts,{onClick:m,style:l,children:[g&&h.jsx($e,{$x:g.x,$y:g.y},g.key),h.jsxs(Cs,{children:[h.jsxs(Os,{children:[h.jsx(vr,{children:h.jsx(f,{size:"1rem"})}),h.jsx(Is,{children:r?h.jsx(qt,{content:r,characterPreference:n,animate:i,maxDelay:s,staticLanguage:d}):t})]}),h.jsx(vr,{children:b()})]})]})},et={tension:200,friction:25},zs={tension:150,friction:25},Bs={tension:et.tension+125,friction:et.friction+5},je={tension:300,friction:30},Us={tension:je.tension*2.5,friction:je.friction},Hs={tension:je.tension*3,friction:je.friction},Gs={tension:185,friction:25},qs={tension:50,friction:20},Ws={tension:280,friction:22,mass:1},Qs={tension:220,friction:26,mass:1},Me="cubic-bezier(0.4, 0.0, 0.2, 1)",Ys=N.keyframes`
|
|
184
184
|
0% {
|
|
185
185
|
transform: translate(-50%, -50%) rotate(0deg);
|
|
186
186
|
}
|
|
187
187
|
100% {
|
|
188
188
|
transform: translate(-50%, -50%) rotate(-360deg);
|
|
189
189
|
}
|
|
190
|
-
`,
|
|
190
|
+
`,Ks=N.keyframes`
|
|
191
191
|
0%, 100% {
|
|
192
192
|
transform: scale(1);
|
|
193
193
|
}
|
|
194
194
|
40% {
|
|
195
195
|
transform: scale(0.5);
|
|
196
196
|
}
|
|
197
|
-
`,
|
|
197
|
+
`,Xs=N.keyframes`
|
|
198
198
|
0% {
|
|
199
199
|
transform: rotate(0deg);
|
|
200
200
|
}
|
|
201
201
|
100% {
|
|
202
202
|
transform: rotate(540deg);
|
|
203
203
|
}
|
|
204
|
-
`,
|
|
204
|
+
`,Zs=N.keyframes`
|
|
205
205
|
0% {
|
|
206
206
|
transform: translateX(-50%) rotate(0deg);
|
|
207
207
|
}
|
|
208
208
|
100% {
|
|
209
209
|
transform: translateX(-50%) rotate(-900deg);
|
|
210
210
|
}
|
|
211
|
-
`,
|
|
211
|
+
`,Js=N.keyframes`
|
|
212
212
|
0% {
|
|
213
213
|
transform: translate(-50%, -50%) rotate(0deg);
|
|
214
214
|
}
|
|
215
215
|
100% {
|
|
216
216
|
transform: translate(-50%, -50%) rotate(-1620deg);
|
|
217
217
|
}
|
|
218
|
-
`,
|
|
218
|
+
`,bn=N.keyframes`
|
|
219
219
|
0% {
|
|
220
220
|
opacity: 0;
|
|
221
221
|
}
|
|
222
222
|
100% {
|
|
223
223
|
opacity: 1;
|
|
224
224
|
}
|
|
225
|
-
`,
|
|
225
|
+
`,eo=_.default(fe.div)`
|
|
226
226
|
position: fixed;
|
|
227
227
|
inset: 0;
|
|
228
228
|
z-index: 9999;
|
|
@@ -231,22 +231,22 @@
|
|
|
231
231
|
justify-content: center;
|
|
232
232
|
background: rgb(${({theme:e})=>e.colors.backgroundRgb});
|
|
233
233
|
will-change: opacity, transform;
|
|
234
|
-
`,
|
|
234
|
+
`,to=_.default.div`
|
|
235
235
|
position: relative;
|
|
236
236
|
width: 200px;
|
|
237
237
|
height: 200px;
|
|
238
238
|
opacity: 0;
|
|
239
|
-
animation: ${
|
|
239
|
+
animation: ${bn} 0.25s ease-out forwards, ${Xs} 1.75s ${Me} 0.25s infinite;
|
|
240
240
|
will-change: transform, opacity;
|
|
241
|
-
`,
|
|
241
|
+
`,br=_.default.span`
|
|
242
242
|
position: absolute;
|
|
243
243
|
left: 50%;
|
|
244
244
|
font-size: 3rem;
|
|
245
245
|
font-weight: 700;
|
|
246
|
-
color: ${({$color:e,theme:t})=>{var
|
|
246
|
+
color: ${({$color:e,theme:t})=>{var r;return e||((r=t.colors)==null?void 0:r.secondaryLight)||"#ffb652"}};
|
|
247
247
|
${({$position:e})=>e==="top"?"top: 0;":"bottom: 0;"}
|
|
248
248
|
transform: translateX(-50%);
|
|
249
|
-
animation: ${
|
|
249
|
+
animation: ${Zs} 1.75s ${Me} 0.25s infinite;
|
|
250
250
|
will-change: transform;
|
|
251
251
|
text-shadow: 1px 1px 0 ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.textShadowDark)||"#555"}},
|
|
252
252
|
2px 2px 0 ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.textShadowDark)||"#555"}},
|
|
@@ -254,15 +254,15 @@
|
|
|
254
254
|
4px 4px 0 ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.textShadowDark)||"#555"}},
|
|
255
255
|
5px 5px 0 ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.textShadowDark)||"#555"}},
|
|
256
256
|
6px 6px 4px ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.shadow)||"rgba(0, 0, 0, 0.75)"}};
|
|
257
|
-
`,
|
|
257
|
+
`,ro=_.default.span`
|
|
258
258
|
position: absolute;
|
|
259
259
|
top: 50%;
|
|
260
260
|
left: 50%;
|
|
261
261
|
font-size: 3.5rem;
|
|
262
262
|
font-weight: 700;
|
|
263
|
-
color: ${({$color:e,theme:t})=>{var
|
|
263
|
+
color: ${({$color:e,theme:t})=>{var r;return e||((r=t.colors)==null?void 0:r.onBackground)||"white"}};
|
|
264
264
|
transform: translate(-50%, -50%);
|
|
265
|
-
animation: ${
|
|
265
|
+
animation: ${Js} 1.75s ${Me} 0.25s infinite;
|
|
266
266
|
will-change: transform;
|
|
267
267
|
text-shadow: 1px 1px 0 ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.textShadowDark)||"#555"}},
|
|
268
268
|
2px 2px 0 ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.textShadowDark)||"#555"}},
|
|
@@ -270,7 +270,7 @@
|
|
|
270
270
|
4px 4px 0 ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.textShadowDark)||"#555"}},
|
|
271
271
|
5px 5px 0 ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.textShadowDark)||"#555"}},
|
|
272
272
|
6px 6px 4px ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.shadow)||"rgba(0, 0, 0, 0.75)"}};
|
|
273
|
-
`,
|
|
273
|
+
`,no=_.default.div`
|
|
274
274
|
position: absolute;
|
|
275
275
|
top: 50%;
|
|
276
276
|
left: 50%;
|
|
@@ -279,27 +279,27 @@
|
|
|
279
279
|
filter: drop-shadow(0 0 30px ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.shadow)||"rgba(0, 0, 0, 0.26)"}});
|
|
280
280
|
transform-origin: center;
|
|
281
281
|
opacity: 0;
|
|
282
|
-
animation: ${
|
|
282
|
+
animation: ${bn} 0.15s ease-out forwards, ${Ys} 2s ${Me} infinite forwards;
|
|
283
283
|
will-change: transform, opacity;
|
|
284
284
|
pointer-events: none;
|
|
285
285
|
z-index: -1;
|
|
286
|
-
`,
|
|
286
|
+
`,io=_.default.div`
|
|
287
287
|
position: absolute;
|
|
288
288
|
inset: 0;
|
|
289
289
|
background-color: ${({theme:e})=>e.colors.primary};
|
|
290
290
|
background-blend-mode: screen;
|
|
291
291
|
transform-origin: center;
|
|
292
|
-
animation: ${
|
|
292
|
+
animation: ${Ks} 1.75s ${Me} 0.25s infinite forwards;
|
|
293
293
|
clip-path: url(#rounded-pentagon);
|
|
294
|
-
`,
|
|
294
|
+
`,so=_.default.svg`
|
|
295
295
|
position: absolute;
|
|
296
296
|
width: 0;
|
|
297
297
|
height: 0;
|
|
298
|
-
`,
|
|
298
|
+
`,oo=({isLoading:e,onExitComplete:t,orbitingContent:r="有",centerContent:n="没",orbitingColor:i,centerColor:s})=>{const[o,a]=w.useState(!0),[l,c]=Ve(()=>({opacity:1,scale:1}));return w.useEffect(()=>{e||c.start({opacity:0,scale:1.1,config:et,onRest:()=>{a(!1),t==null||t()}})},[e,c,t]),o?h.jsxs(eo,{style:{opacity:l.opacity,transform:l.scale.to(u=>`scale(${u})`)},children:[h.jsx(so,{children:h.jsx("defs",{children:h.jsx("clipPath",{id:"rounded-pentagon",clipPathUnits:"objectBoundingBox",children:h.jsx("path",{d:"M 0.5 0.05 Q 0.52 0.05, 0.54 0.07 L 0.93 0.34 Q 0.97 0.37, 0.96 0.41 L 0.81 0.92 Q 0.80 0.97, 0.75 0.97 L 0.25 0.97 Q 0.20 0.97, 0.19 0.92 L 0.04 0.41 Q 0.03 0.37, 0.07 0.34 L 0.46 0.07 Q 0.48 0.05, 0.5 0.05 Z"})})})}),h.jsx(no,{children:h.jsx(io,{})}),h.jsxs(to,{children:[h.jsx(br,{$position:"top",$color:i,children:r}),h.jsx(ro,{$color:s,children:n}),h.jsx(br,{$position:"bottom",$color:i,children:r})]})]}):null},ao=N.keyframes`
|
|
299
299
|
0%, 100% { transform: translateX(0); }
|
|
300
300
|
20%, 60% { transform: translateX(-4px); }
|
|
301
301
|
40%, 80% { transform: translateX(4px); }
|
|
302
|
-
`,
|
|
302
|
+
`,co=_.default.div`
|
|
303
303
|
display: flex;
|
|
304
304
|
flex-direction: column;
|
|
305
305
|
gap: 0.5rem;
|
|
@@ -307,12 +307,12 @@
|
|
|
307
307
|
width: 100%;
|
|
308
308
|
max-width: 100%;
|
|
309
309
|
box-sizing: border-box;
|
|
310
|
-
animation: ${({$shaking:e})=>e?
|
|
311
|
-
`,
|
|
310
|
+
animation: ${({$shaking:e})=>e?ao:"none"} 0.2s ease-in-out;
|
|
311
|
+
`,ye=_.default.div`
|
|
312
312
|
display: flex;
|
|
313
313
|
justify-content: ${({$justify:e})=>e||"center"};
|
|
314
314
|
gap: 0.25rem;
|
|
315
|
-
`,
|
|
315
|
+
`,ve=_.default.button`
|
|
316
316
|
display: flex;
|
|
317
317
|
align-items: center;
|
|
318
318
|
justify-content: center;
|
|
@@ -330,27 +330,27 @@
|
|
|
330
330
|
-webkit-tap-highlight-color: transparent;
|
|
331
331
|
|
|
332
332
|
/* Variant styles - dark blue keyboard theme */
|
|
333
|
-
${({$variant:e,$muted:t,theme:
|
|
334
|
-
background: ${((r
|
|
335
|
-
color: ${((i=
|
|
333
|
+
${({$variant:e,$muted:t,theme:r})=>{var n,i,s,o,a,l,c,u,d,f,g,v;switch(e){case"tone":return`
|
|
334
|
+
background: ${((n=r.colors)==null?void 0:n.keyDefault)||"#2d6a8a"};
|
|
335
|
+
color: ${((i=r.colors)==null?void 0:i.keyDefaultText)||"#ffa62b"};
|
|
336
336
|
font-weight: 500;
|
|
337
337
|
`;case"backspace":return t?`
|
|
338
|
-
background: ${((s=
|
|
339
|
-
color: ${((o=
|
|
338
|
+
background: ${((s=r.colors)==null?void 0:s.keyWrongMuted)||"#6b4a46"};
|
|
339
|
+
color: ${((o=r.colors)==null?void 0:o.keyDisabledText)||"#9ca3af"};
|
|
340
340
|
`:`
|
|
341
|
-
background: ${((a=
|
|
342
|
-
color: ${((l=
|
|
341
|
+
background: ${((a=r.colors)==null?void 0:a.keyWrong)||"#c75146"};
|
|
342
|
+
color: ${((l=r.colors)==null?void 0:l.onError)||"#fff"};
|
|
343
343
|
`;case"enter":return t?`
|
|
344
|
-
background: ${((c=
|
|
345
|
-
color: ${((u=
|
|
344
|
+
background: ${((c=r.colors)==null?void 0:c.keyCorrectMuted)||"#3d6b56"};
|
|
345
|
+
color: ${((u=r.colors)==null?void 0:u.keyDisabledText)||"#9ca3af"};
|
|
346
346
|
font-weight: 600;
|
|
347
347
|
`:`
|
|
348
|
-
background: ${((d=
|
|
349
|
-
color: ${((f=
|
|
348
|
+
background: ${((d=r.colors)==null?void 0:d.keyCorrect)||"#4ade80"};
|
|
349
|
+
color: ${((f=r.colors)==null?void 0:f.onSuccess)||"#1b4965"};
|
|
350
350
|
font-weight: 600;
|
|
351
351
|
`;default:return`
|
|
352
|
-
background: ${((
|
|
353
|
-
color: ${((v=
|
|
352
|
+
background: ${((g=r.colors)==null?void 0:g.primary)||"#489fb5"};
|
|
353
|
+
color: ${((v=r.colors)==null?void 0:v.onPrimary)||"#fff"};
|
|
354
354
|
`}}}
|
|
355
355
|
|
|
356
356
|
&:active {
|
|
@@ -361,9 +361,9 @@
|
|
|
361
361
|
cursor: not-allowed;
|
|
362
362
|
|
|
363
363
|
/* Status-based disabled styles */
|
|
364
|
-
${({$status:e,theme:t})=>{var n,
|
|
365
|
-
background: ${((
|
|
366
|
-
color: ${((
|
|
364
|
+
${({$status:e,theme:t})=>{var r,n,i,s;switch(e){case"correct":return`
|
|
365
|
+
background: ${((r=t.colors)==null?void 0:r.successDark)||"#22c55e"};
|
|
366
|
+
color: ${((n=t.colors)==null?void 0:n.onPrimary)||"#fff"};
|
|
367
367
|
opacity: 0.85;
|
|
368
368
|
`;case"incorrect":return`
|
|
369
369
|
background: ${((i=t.colors)==null?void 0:i.keyDisabled)||"#6b7280"};
|
|
@@ -373,7 +373,7 @@
|
|
|
373
373
|
opacity: 0.4;
|
|
374
374
|
`}}}
|
|
375
375
|
}
|
|
376
|
-
`,
|
|
376
|
+
`,be=_.default.span`
|
|
377
377
|
line-height: 1;
|
|
378
378
|
`;_.default.span`
|
|
379
379
|
font-size: 0.625rem;
|
|
@@ -383,24 +383,24 @@
|
|
|
383
383
|
display: flex;
|
|
384
384
|
flex-direction: column;
|
|
385
385
|
align-items: center;
|
|
386
|
-
`;const
|
|
386
|
+
`;const uo=_.default.div`
|
|
387
387
|
display: flex;
|
|
388
388
|
justify-content: center;
|
|
389
389
|
align-items: center;
|
|
390
390
|
overflow: hidden;
|
|
391
|
-
`,
|
|
391
|
+
`,lo=_.default.span`
|
|
392
392
|
font-size: 2rem;
|
|
393
393
|
font-family: 'Noto Sans TC', sans-serif;
|
|
394
394
|
color: ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.onPrimary)||"#fff"}};
|
|
395
395
|
letter-spacing: 0.1em;
|
|
396
396
|
opacity: ${({$visible:e})=>e?1:0};
|
|
397
397
|
transition: opacity 0.1s ease;
|
|
398
|
-
`,
|
|
398
|
+
`,fo=new Set(["ˇ","ˋ","ˊ","˙","ˉ"," "]),bt=0,ho=2.5,po=3.5,go=fe(uo),He={row1:["ㄅ","ㄉ","ˇ","ˋ","ㄓ","ˊ","˙","ㄚ","ㄞ","ㄢ"],row2:["ㄆ","ㄊ","ㄍ","ㄐ","ㄔ","ㄗ","ㄧ","ㄛ","ㄟ","ㄣ"],row3:["ㄇ","ㄋ","ㄎ","ㄑ","ㄕ","ㄘ","ㄨ","ㄜ","ㄠ","ㄤ"],row4:["ㄈ","ㄌ","ㄏ","ㄒ","ㄖ","ㄙ","ㄩ","ㄝ","ㄡ","ㄥ"]},mo=400,wn=w.memo(({onKeyPress:e,onBackspace:t,onSubmit:r,disabled:n=!1,currentInput:i="",disabledKeys:s,correctKeys:o,incorrectKeys:a,shaking:l=!1})=>{const[c,u]=w.useState(""),d=w.useRef(null),f=S=>S?fo.has(S)?ho:po:bt,[g,v]=Ve(()=>({height:bt,config:{tension:300,friction:26}}));w.useEffect(()=>(i?(d.current&&(clearTimeout(d.current),d.current=null),u(i),v.start({height:f(i)})):c&&(d.current=setTimeout(()=>{v.start({height:bt}),setTimeout(()=>u(""),250)},mo)),()=>{d.current&&clearTimeout(d.current)}),[i,c,v]);const m=w.useCallback(S=>{!n&&!(s!=null&&s.has(S))&&e(S)},[e,n,s]),b=w.useCallback(()=>{!n&&t&&t()},[t,n]),y=w.useCallback(()=>{!n&&r&&r()},[r,n]),k=w.useCallback(S=>n?!0:(s==null?void 0:s.has(S))??!1,[n,s]),x=w.useCallback(S=>o!=null&&o.has(S)?"correct":a!=null&&a.has(S)?"incorrect":null,[o,a]),P=(S,C)=>h.jsx(ve,{onClick:()=>m(S),disabled:k(S),$status:x(S),children:h.jsx(be,{children:S})},`${S}-${C}`);return h.jsxs(co,{$shaking:l,children:[h.jsx(go,{style:{height:g.height.to(S=>`${S}rem`)},children:h.jsx(lo,{$visible:!!i,children:c})}),h.jsx(ye,{children:He.row1.map(P)}),h.jsx(ye,{children:He.row2.map(P)}),h.jsx(ye,{children:He.row3.map(P)}),h.jsx(ye,{children:He.row4.map(P)}),h.jsxs(ye,{$justify:"flex-start",children:[h.jsx(ve,{$variant:"backspace",$width:"wide",$muted:!i,onClick:b,disabled:n,children:h.jsx(be,{children:"⌫"})}),h.jsx(ve,{$variant:"tone",$width:"space",onClick:()=>m("ˉ"),disabled:k("ˉ"),$status:x("ˉ"),children:h.jsx(be,{children:"ˉ"})}),h.jsx(ve,{onClick:()=>m("ㄦ"),disabled:k("ㄦ"),$status:x("ㄦ"),children:h.jsx(be,{children:"ㄦ"})}),r&&h.jsx(ve,{$variant:"enter",$width:"extra-wide",$muted:!i,onClick:y,disabled:n,children:h.jsx(be,{children:"⏎"})})]})]})});wn.displayName="ZhuyinKeyboard";const yo=_.default.div`
|
|
399
399
|
position: relative;
|
|
400
400
|
display: flex;
|
|
401
401
|
flex-direction: column;
|
|
402
402
|
gap: 0.5rem;
|
|
403
|
-
`,
|
|
403
|
+
`,vo=_.default.div`
|
|
404
404
|
position: absolute;
|
|
405
405
|
top: ${({$index:e})=>`calc(${e} * (1rem * 2 + 1.125rem * 1.5 + 0.5rem))`};
|
|
406
406
|
left: 0;
|
|
@@ -410,7 +410,7 @@
|
|
|
410
410
|
border-radius: 12px;
|
|
411
411
|
transition: top 0.25s cubic-bezier(0.4, 0, 0.2, 1);
|
|
412
412
|
pointer-events: none;
|
|
413
|
-
`,
|
|
413
|
+
`,bo=_.default.button`
|
|
414
414
|
position: relative;
|
|
415
415
|
z-index: 1;
|
|
416
416
|
display: flex;
|
|
@@ -423,7 +423,7 @@
|
|
|
423
423
|
border: none;
|
|
424
424
|
border-radius: 12px;
|
|
425
425
|
background-color: transparent;
|
|
426
|
-
color: ${({$isSelected:e,theme:t})=>{var
|
|
426
|
+
color: ${({$isSelected:e,theme:t})=>{var r;return e?((r=t.colors)==null?void 0:r.onPrimary)||"#fff":"inherit"}};
|
|
427
427
|
cursor: pointer;
|
|
428
428
|
outline: none;
|
|
429
429
|
overflow: hidden;
|
|
@@ -431,25 +431,25 @@
|
|
|
431
431
|
transition:
|
|
432
432
|
color 0.2s ease,
|
|
433
433
|
font-weight 0.2s ease;
|
|
434
|
-
`,go=_.default.span``;function yo({options:e,value:t,onChange:n,onClose:r,closeOnSameValue:i=!0}){const s=w.useRef(null),[o,a]=w.useState(null),l=e.findIndex(u=>u.value===t),c=(u,d)=>{const f=u.currentTarget.getBoundingClientRect(),m=u.clientX-f.left,v=u.clientY-f.top;if(a({x:m,y:v,key:Date.now(),target:d.value}),d.value===t){i&&r&&r();return}if(n(d.value),r){const g=s.current;if(g){const b=()=>{g.removeEventListener("transitionend",b),r()};g.addEventListener("transitionend",b)}else r()}};return h.jsxs(ho,{children:[h.jsx(po,{ref:s,$index:l}),e.map(u=>h.jsxs(mo,{$isSelected:t===u.value,onClick:d=>c(d,u),children:[o&&o.target===u.value&&h.jsx(je,{$x:o.x,$y:o.y},o.key),h.jsx(go,{children:u.label})]},u.value))]})}function vo(e,t,n){return Math.max(t,Math.min(e,n))}const O={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 bn(e,t,n){return t===0||Math.abs(t)===1/0?Math.pow(e,n*5):e*t*n/(t+n*e)}function wn(e,t,n,r=.15){return r===0?vo(e,t,n):e<t?-bn(t-e,n-t,r)+t:e>n?+bn(e-n,n-t,r)+n:e}function bo(e,[t,n],[r,i]){const[[s,o],[a,l]]=e;return[wn(t,s,o,r),wn(n,a,l,i)]}function wo(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 xo(e){var t=wo(e,"string");return typeof t=="symbol"?t:String(t)}function $(e,t,n){return t=xo(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function I(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xn(Object(n),!0).forEach(function(r){$(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xn(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}const vr={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 _n(e){return e?e[0].toUpperCase()+e.slice(1):""}const _o=["enter","leave"];function So(e=!1,t){return e&&!_o.includes(t)}function ko(e,t="",n=!1){const r=vr[e],i=r&&r[t]||t;return"on"+_n(e)+_n(i)+(So(n,i)?"Capture":"")}const Po=["gotpointercapture","lostpointercapture"];function To(e){let t=e.substring(2).toLowerCase();const n=!!~t.indexOf("passive");n&&(t=t.replace("passive",""));const r=Po.includes(t)?"capturecapture":"capture",i=!!~t.indexOf(r);return i&&(t=t.replace("capture","")),{device:t,capture:i,passive:n}}function Eo(e,t=""){const n=vr[e],r=n&&n[t]||t;return e+r}function ct(e){return"touches"in e}function br(e){return ct(e)?"touch":"pointerType"in e?e.pointerType:"mouse"}function Io(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 Ao(e){return e.type==="touchend"||e.type==="touchcancel"?e.changedTouches:e.targetTouches}function wr(e){return ct(e)?Ao(e)[0]:e}function Ro(e){return Io(e).map(t=>t.identifier)}function vt(e){const t=wr(e);return ct(e)?t.identifier:t.pointerId}function Sn(e){const t=wr(e);return[t.clientX,t.clientY]}function Oo(e){const t={};if("buttons"in e&&(t.buttons=e.buttons),"shiftKey"in e){const{shiftKey:n,altKey:r,metaKey:i,ctrlKey:s}=e;Object.assign(t,{shiftKey:n,altKey:r,metaKey:i,ctrlKey:s})}return t}function Je(e,...t){return typeof e=="function"?e(...t):e}function jo(){}function $o(...e){return e.length===0?jo:e.length===1?e[0]:function(){let t;for(const n of e)t=n.apply(this,arguments)||t;return t}}function kn(e,t){return Object.assign({},t,e||{})}const Co=32;class Do{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:i}=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=i,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?Je(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:i}=this;n.args=this.args;let s=0;if(t&&(n.event=t,r.preventDefault&&t.cancelable&&n.event.preventDefault(),n.type=t.type,i.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,i.locked=!!document.pointerLockElement,Object.assign(i,Oo(t)),i.down=i.pressed=i.buttons%2===1||i.touches>0,s=t.timeStamp-n.timeStamp,n.timeStamp=t.timeStamp,n.elapsedTime=n.timeStamp-n.startTime),n._active){const A=n._delta.map(Math.abs);O.addTo(n._distance,A)}this.axisIntent&&this.axisIntent(t);const[o,a]=n._movement,[l,c]=r.threshold,{_step:u,values:d}=n;if(r.hasCustomTransform?(u[0]===!1&&(u[0]=Math.abs(o)>=l&&d[0]),u[1]===!1&&(u[1]=Math.abs(a)>=c&&d[1])):(u[0]===!1&&(u[0]=Math.abs(o)>=l&&Math.sign(o)*l),u[1]===!1&&(u[1]=Math.abs(a)>=c&&Math.sign(a)*c)),n.intentional=u[0]!==!1||u[1]!==!1,!n.intentional)return;const f=[0,0];if(r.hasCustomTransform){const[A,R]=d;f[0]=u[0]!==!1?A-u[0]:0,f[1]=u[1]!==!1?R-u[1]:0}else f[0]=u[0]!==!1?o-u[0]:0,f[1]=u[1]!==!1?a-u[1]:0;this.restrictToAxis&&!n._blocked&&this.restrictToAxis(f);const m=n.offset,v=n._active&&!n._blocked||n.active;v&&(n.first=n._active&&!n.active,n.last=!n._active&&n.active,n.active=i[this.ingKey]=n._active,t&&(n.first&&("bounds"in r&&(n._bounds=Je(r.bounds,n)),this.setup&&this.setup()),n.movement=f,this.computeOffset()));const[g,b]=n.offset,[[y,S],[x,T]]=n._bounds;n.overflow=[g<y?-1:g>S?1:0,b<x?-1:b>T?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 k=n._active?r.rubberband||[0,0]:[0,0];if(n.offset=bo(n._bounds,n.offset,k),n.delta=O.sub(n.offset,m),this.computeMovement(),v&&(!n.last||s>Co)){n.delta=O.sub(n.offset,m);const A=n.delta.map(Math.abs);O.addTo(n.distance,A),n.direction=n.delta.map(Math.sign),n._direction=n._delta.map(Math.sign),!n.first&&s>0&&(n.velocity=[A[0]/s,A[1]/s],n.timeDelta=s)}}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 i=this.handler(I(I(I({},n),t),{},{[this.aliasKey]:t.values}));i!==void 0&&(t.memo=i)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}function Lo([e,t],n){const r=Math.abs(e),i=Math.abs(t);if(r>i&&r>n)return"x";if(i>r&&i>n)return"y"}class No extends Do{constructor(...t){super(...t),$(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=O.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=O.sub(this.state.offset,this.state.lastOffset)}axisIntent(t){const n=this.state,r=this.config;if(!n.axis&&t){const i=typeof r.axisThreshold=="object"?r.axisThreshold[br(t)]:r.axisThreshold;n.axis=Lo(n._movement,i)}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 Pn=e=>e,Tn=.15,Ht={enabled(e=!0){return e},eventOptions(e,t,n){return I(I({},n.shared.eventOptions),e)},preventDefault(e=!1){return e},triggerAllEvents(e=!1){return e},rubberband(e=0){switch(e){case!0:return[Tn,Tn];case!1:return[0,0];default:return O.toVector(e)}},from(e){if(typeof e=="function")return e;if(e!=null)return O.toVector(e)},transform(e,t,n){const r=e||n.shared.transform;if(this.hasCustomTransform=!!r,process.env.NODE_ENV==="development"){const i=r||Pn;return s=>{const o=i(s);return(!isFinite(o[0])||!isFinite(o[1]))&&console.warn(`[@use-gesture]: config.transform() must produce a valid result, but it was: [${o[0]},${[1]}]`),o}}return r||Pn},threshold(e){return O.toVector(e,0)}};process.env.NODE_ENV==="development"&&Object.assign(Ht,{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 Vo=0,ze=I(I({},Ht),{},{axis(e,t,{axis:n}){if(this.lockDirection=n==="lock",!this.lockDirection)return n},axisThreshold(e=Vo){return e},bounds(e={}){if(typeof e=="function")return s=>ze.bounds(e(s));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:i=1/0}=e;return[[t,n],[r,i]]}}),En={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 zo extends No{constructor(...t){super(...t),$(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(),i={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=ze.bounds(i)}}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 i=this.ctrl.setEventIds(t);n.pointerCapture&&t.target.setPointerCapture(t.pointerId),!(i&&i.size>1&&r._pointerActive)&&(this.start(t),this.setupPointer(t),r._pointerId=vt(t),r._pointerActive=!0,this.computeValues(Sn(t)),this.computeInitial(),n.preventScrollAxis&&br(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 i=vt(t);if(n._pointerId!==void 0&&i!==n._pointerId)return;const s=Sn(t);if(document.pointerLockElement===t.target?n._delta=[t.movementX,t.movementY]:(n._delta=O.sub(s,n._values),this.computeValues(s)),O.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 i=vt(t);if(n._pointerId!==void 0&&i!==n._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(t);const[s,o]=n._distance;if(n.tap=s<=r.tapsThreshold&&o<=r.tapsThreshold,n.tap&&r.filterTaps)n._force=!0;else{const[a,l]=n._delta,[c,u]=n._movement,[d,f]=r.swipe.velocity,[m,v]=r.swipe.distance,g=r.swipe.duration;if(n.elapsedTime<g){const b=Math.abs(a/n.timeDelta),y=Math.abs(l/n.timeDelta);b>d&&Math.abs(c)>m&&(n.swipe[0]=Math.sign(a)),y>f&&Math.abs(u)>v&&(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 i="uv"in t?t.sourceEvent.currentTarget:t.currentTarget;window.getComputedStyle(i).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.",i)}}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,Mo(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=En[t.key];if(n){const r=this.state,i=t.shiftKey?10:t.altKey?.1:1;this.start(t),r._delta=n(this.config.keyboardDisplacement,i),r._keyboardActive=!0,O.addTo(r._movement,r._delta),this.compute(t),this.emit()}}keyUp(t){t.key in En&&(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 Mo(e){"persist"in e&&typeof e.persist=="function"&&e.persist()}const Me=typeof window<"u"&&window.document&&window.document.createElement;function xr(){return Me&&"ontouchstart"in window}function Fo(){return xr()||Me&&window.navigator.maxTouchPoints>1}function Bo(){return Me&&"onpointerdown"in window}function Uo(){return Me&&"exitPointerLock"in window.document}function Go(){try{return"constructor"in GestureEvent}catch{return!1}}const M={isBrowser:Me,gesture:Go(),touch:xr(),touchscreen:Fo(),pointer:Bo(),pointerLock:Uo()},Ho=250,qo=180,Qo=.5,Wo=50,Yo=250,Ko=10,In={mouse:0,touch:0,pen:8},_r=I(I({},ze),{},{device(e,t,{pointer:{touch:n=!1,lock:r=!1,mouse:i=!1}={}}){return this.pointerLock=r&&M.pointerLock,M.touch&&n?"touch":this.pointerLock?"mouse":M.pointer&&!i?"pointer":M.touch?"touch":"mouse"},preventScrollAxis(e,t,{preventScroll:n}){if(this.preventScrollDelay=typeof n=="number"?n:n||n===void 0&&e?Ho:void 0,!(!M.touchscreen||n===!1))return e||(n!==void 0?"y":void 0)},pointerCapture(e,t,{pointer:{capture:n=!0,buttons:r=1,keys:i=!0}={}}){return this.pointerButtons=r,this.keys=i,!this.pointerLock&&this.device==="pointer"&&n},threshold(e,t,{filterTaps:n=!1,tapsThreshold:r=3,axis:i=void 0}){const s=O.toVector(e,n?r:i?1:0);return this.filterTaps=n,this.tapsThreshold=r,s},swipe({velocity:e=Qo,distance:t=Wo,duration:n=Yo}={}){return{velocity:this.transform(O.toVector(e)),distance:this.transform(O.toVector(t)),duration:n}},delay(e=0){switch(e){case!0:return qo;case!1:return 0;default:return e}},axisThreshold(e){return e?I(I({},In),e):In},keyboardDisplacement(e=Ko){return e}});process.env.NODE_ENV==="development"&&Object.assign(_r,{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}});I(I({},Ht),{},{device(e,t,{shared:n,pointer:{touch:r=!1}={}}){if(n.target&&!M.touch&&M.gesture)return"gesture";if(M.touch&&r)return"touch";if(M.touchscreen){if(M.pointer)return"pointer";if(M.touch)return"touch"}},bounds(e,t,{scaleBounds:n={},angleBounds:r={}}){const i=o=>{const a=kn(Je(n,o),{min:-1/0,max:1/0});return[a.min,a.max]},s=o=>{const a=kn(Je(r,o),{min:-1/0,max:1/0});return[a.min,a.max]};return typeof n!="function"&&typeof r!="function"?[i(),s()]:o=>[i(o),s(o)]},threshold(e,t,n){return this.lockDirection=n.axis==="lock",O.toVector(e,this.lockDirection?[.1,3]:0)},modifierKey(e){return e===void 0?"ctrlKey":e},pinchOnWheel(e=!0){return e}});I(I({},ze),{},{mouseOnly:(e=!0)=>e});I(I({},ze),{},{mouseOnly:(e=!0)=>e});const Sr=new Map,It=new Map;function Xo(e){Sr.set(e.key,e.engine),It.set(e.key,e.resolver)}const Zo={key:"drag",engine:zo,resolver:_r};function Jo(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s<r.length;s++)i=r[s],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function ea(e,t){if(e==null)return{};var n=Jo(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}const ta={target(e){if(e)return()=>"current"in e?e.current:e},enabled(e=!0){return e},window(e=M.isBrowser?window:void 0){return e},eventOptions({passive:e=!0,capture:t=!1}={}){return{passive:e,capture:t}},transform(e){return e}},na=["target","eventOptions","window","enabled","transform"];function He(e={},t){const n={};for(const[r,i]of Object.entries(t))switch(typeof i){case"function":if(process.env.NODE_ENV==="development"){const s=i.call(n,e[r],r,e);Number.isNaN(s)||(n[r]=s)}else n[r]=i.call(n,e[r],r,e);break;case"object":n[r]=He(e[r],i);break;case"boolean":i&&(n[r]=e[r]);break}return n}function ra(e,t,n={}){const r=e,{target:i,eventOptions:s,window:o,enabled:a,transform:l}=r,c=ea(r,na);if(n.shared=He({target:i,eventOptions:s,window:o,enabled:a,transform:l},ta),t){const u=It.get(t);n[t]=He(I({shared:n.shared},c),u)}else for(const u in c){const d=It.get(u);if(d)n[u]=He(I({shared:n.shared},c[u]),d);else if(process.env.NODE_ENV==="development"&&!["drag","pinch","scroll","wheel","move","hover"].includes(u)){if(u==="domTarget")throw Error("[@use-gesture]: `domTarget` option has been renamed to `target`.");console.warn(`[@use-gesture]: Unknown config key \`${u}\` was used. Please read the documentation for further information.`)}}return n}class kr{constructor(t,n){$(this,"_listeners",new Set),this._ctrl=t,this._gestureKey=n}add(t,n,r,i,s){const o=this._listeners,a=Eo(n,r),l=this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{},c=I(I({},l),s);t.addEventListener(a,i,c);const u=()=>{t.removeEventListener(a,i,c),o.delete(u)};return o.add(u),u}clean(){this._listeners.forEach(t=>t()),this._listeners.clear()}}class ia{constructor(){$(this,"_timeouts",new Map)}add(t,n,r=140,...i){this.remove(t),this._timeouts.set(t,window.setTimeout(n,r,...i))}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 sa{constructor(t){$(this,"gestures",new Set),$(this,"_targetEventStore",new kr(this)),$(this,"gestureEventStores",{}),$(this,"gestureTimeoutStores",{}),$(this,"handlers",{}),$(this,"config",{}),$(this,"pointerIds",new Set),$(this,"touchIds",new Set),$(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),oa(this,t)}setEventIds(t){if(ct(t))return this.touchIds=new Set(Ro(t)),this.touchIds;if("pointerId"in t)return t.type==="pointerup"||t.type==="pointercancel"?this.pointerIds.delete(t.pointerId):t.type==="pointerdown"&&this.pointerIds.add(t.pointerId),this.pointerIds}applyHandlers(t,n){this.handlers=t,this.nativeHandlers=n}applyConfig(t,n){this.config=ra(t,n,this.config)}clean(){this._targetEventStore.clean();for(const t of this.gestures)this.gestureEventStores[t].clean(),this.gestureTimeoutStores[t].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...t){const n=this.config.shared,r={};let i;if(!(n.target&&(i=n.target(),!i))){if(n.enabled){for(const o of this.gestures){const a=this.config[o],l=An(r,a.eventOptions,!!i);if(a.enabled){const c=Sr.get(o);new c(this,t,o).bind(l)}}const s=An(r,n.eventOptions,!!i);for(const o in this.nativeHandlers)s(o,"",a=>this.nativeHandlers[o](I(I({},this.state.shared),{},{event:a,args:t})),void 0,!0)}for(const s in r)r[s]=$o(...r[s]);if(!i)return r;for(const s in r){const{device:o,capture:a,passive:l}=To(s);this._targetEventStore.add(i,o,"",r[s],{capture:a,passive:l})}}}}function oe(e,t){e.gestures.add(t),e.gestureEventStores[t]=new kr(e,t),e.gestureTimeoutStores[t]=new ia}function oa(e,t){t.drag&&oe(e,"drag"),t.wheel&&oe(e,"wheel"),t.scroll&&oe(e,"scroll"),t.move&&oe(e,"move"),t.pinch&&oe(e,"pinch"),t.hover&&oe(e,"hover")}const An=(e,t,n)=>(r,i,s,o={},a=!1)=>{var l,c;const u=(l=o.capture)!==null&&l!==void 0?l:t.capture,d=(c=o.passive)!==null&&c!==void 0?c:t.passive;let f=a?r:ko(r,i,u);n&&d&&(f+="Passive"),e[f]=e[f]||[],e[f].push(s)};function aa(e,t={},n,r){const i=V.default.useMemo(()=>new sa(e),[]);if(i.applyHandlers(e,r),i.applyConfig(t,n),V.default.useEffect(i.effect.bind(i)),V.default.useEffect(()=>i.clean.bind(i),[]),t.target===void 0)return i.bind.bind(i)}function ca(e,t){return Xo(Zo),aa({drag:e},t||{},"drag")}const ua=_.default.div`
|
|
434
|
+
`,wo=_.default.span``;function xo({options:e,value:t,onChange:r,onClose:n,closeOnSameValue:i=!0}){const s=w.useRef(null),[o,a]=w.useState(null),l=e.findIndex(u=>u.value===t),c=(u,d)=>{const f=u.currentTarget.getBoundingClientRect(),g=u.clientX-f.left,v=u.clientY-f.top;if(a({x:g,y:v,key:Date.now(),target:d.value}),d.value===t){i&&n&&n();return}if(r(d.value),n){const m=s.current;if(m){const b=()=>{m.removeEventListener("transitionend",b),n()};m.addEventListener("transitionend",b)}else n()}};return h.jsxs(yo,{children:[h.jsx(vo,{ref:s,$index:l}),e.map(u=>h.jsxs(bo,{$isSelected:t===u.value,onClick:d=>c(d,u),children:[o&&o.target===u.value&&h.jsx($e,{$x:o.x,$y:o.y},o.key),h.jsx(wo,{children:u.label})]},u.value))]})}function _o(e,t,r){return Math.max(t,Math.min(e,r))}const I={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 wr(e,t,r){return t===0||Math.abs(t)===1/0?Math.pow(e,r*5):e*t*r/(t+r*e)}function xr(e,t,r,n=.15){return n===0?_o(e,t,r):e<t?-wr(t-e,r-t,n)+t:e>r?+wr(e-r,r-t,n)+r:e}function ko(e,[t,r],[n,i]){const[[s,o],[a,l]]=e;return[xr(t,s,o,n),xr(r,a,l,i)]}function So(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ao(e){var t=So(e,"string");return typeof t=="symbol"?t:String(t)}function $(e,t,r){return t=Ao(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _r(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function T(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_r(Object(r),!0).forEach(function(n){$(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_r(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}const xn={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 kr(e){return e?e[0].toUpperCase()+e.slice(1):""}const Po=["enter","leave"];function Eo(e=!1,t){return e&&!Po.includes(t)}function To(e,t="",r=!1){const n=xn[e],i=n&&n[t]||t;return"on"+kr(e)+kr(i)+(Eo(r,i)?"Capture":"")}const Co=["gotpointercapture","lostpointercapture"];function Oo(e){let t=e.substring(2).toLowerCase();const r=!!~t.indexOf("passive");r&&(t=t.replace("passive",""));const n=Co.includes(t)?"capturecapture":"capture",i=!!~t.indexOf(n);return i&&(t=t.replace("capture","")),{device:t,capture:i,passive:r}}function Io(e,t=""){const r=xn[e],n=r&&r[t]||t;return e+n}function lt(e){return"touches"in e}function _n(e){return lt(e)?"touch":"pointerType"in e?e.pointerType:"mouse"}function Ro(e){return Array.from(e.touches).filter(t=>{var r,n;return t.target===e.currentTarget||((r=e.currentTarget)===null||r===void 0||(n=r.contains)===null||n===void 0?void 0:n.call(r,t.target))})}function Do(e){return e.type==="touchend"||e.type==="touchcancel"?e.changedTouches:e.targetTouches}function kn(e){return lt(e)?Do(e)[0]:e}function $o(e){return Ro(e).map(t=>t.identifier)}function wt(e){const t=kn(e);return lt(e)?t.identifier:t.pointerId}function Sr(e){const t=kn(e);return[t.clientX,t.clientY]}function jo(e){const t={};if("buttons"in e&&(t.buttons=e.buttons),"shiftKey"in e){const{shiftKey:r,altKey:n,metaKey:i,ctrlKey:s}=e;Object.assign(t,{shiftKey:r,altKey:n,metaKey:i,ctrlKey:s})}return t}function tt(e,...t){return typeof e=="function"?e(...t):e}function Lo(){}function Fo(...e){return e.length===0?Lo:e.length===1?e[0]:function(){let t;for(const r of e)t=r.apply(this,arguments)||t;return t}}function Ar(e,t){return Object.assign({},t,e||{})}const No=32;class Vo{constructor(t,r,n){this.ctrl=t,this.args=r,this.key=n,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:r,ingKey:n,args:i}=this;r[n]=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=i,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 r=this.state,n=this.config;r._active||(this.reset(),this.computeInitial(),r._active=!0,r.target=t.target,r.currentTarget=t.currentTarget,r.lastOffset=n.from?tt(n.from,r):r.offset,r.offset=r.lastOffset,r.startTime=r.timeStamp=t.timeStamp)}computeValues(t){const r=this.state;r._values=t,r.values=this.config.transform(t)}computeInitial(){const t=this.state;t._initial=t._values,t.initial=t.values}compute(t){const{state:r,config:n,shared:i}=this;r.args=this.args;let s=0;if(t&&(r.event=t,n.preventDefault&&t.cancelable&&r.event.preventDefault(),r.type=t.type,i.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,i.locked=!!document.pointerLockElement,Object.assign(i,jo(t)),i.down=i.pressed=i.buttons%2===1||i.touches>0,s=t.timeStamp-r.timeStamp,r.timeStamp=t.timeStamp,r.elapsedTime=r.timeStamp-r.startTime),r._active){const C=r._delta.map(Math.abs);I.addTo(r._distance,C)}this.axisIntent&&this.axisIntent(t);const[o,a]=r._movement,[l,c]=n.threshold,{_step:u,values:d}=r;if(n.hasCustomTransform?(u[0]===!1&&(u[0]=Math.abs(o)>=l&&d[0]),u[1]===!1&&(u[1]=Math.abs(a)>=c&&d[1])):(u[0]===!1&&(u[0]=Math.abs(o)>=l&&Math.sign(o)*l),u[1]===!1&&(u[1]=Math.abs(a)>=c&&Math.sign(a)*c)),r.intentional=u[0]!==!1||u[1]!==!1,!r.intentional)return;const f=[0,0];if(n.hasCustomTransform){const[C,O]=d;f[0]=u[0]!==!1?C-u[0]:0,f[1]=u[1]!==!1?O-u[1]:0}else f[0]=u[0]!==!1?o-u[0]:0,f[1]=u[1]!==!1?a-u[1]:0;this.restrictToAxis&&!r._blocked&&this.restrictToAxis(f);const g=r.offset,v=r._active&&!r._blocked||r.active;v&&(r.first=r._active&&!r.active,r.last=!r._active&&r.active,r.active=i[this.ingKey]=r._active,t&&(r.first&&("bounds"in n&&(r._bounds=tt(n.bounds,r)),this.setup&&this.setup()),r.movement=f,this.computeOffset()));const[m,b]=r.offset,[[y,k],[x,P]]=r._bounds;r.overflow=[m<y?-1:m>k?1:0,b<x?-1:b>P?1:0],r._movementBound[0]=r.overflow[0]?r._movementBound[0]===!1?r._movement[0]:r._movementBound[0]:!1,r._movementBound[1]=r.overflow[1]?r._movementBound[1]===!1?r._movement[1]:r._movementBound[1]:!1;const S=r._active?n.rubberband||[0,0]:[0,0];if(r.offset=ko(r._bounds,r.offset,S),r.delta=I.sub(r.offset,g),this.computeMovement(),v&&(!r.last||s>No)){r.delta=I.sub(r.offset,g);const C=r.delta.map(Math.abs);I.addTo(r.distance,C),r.direction=r.delta.map(Math.sign),r._direction=r._delta.map(Math.sign),!r.first&&s>0&&(r.velocity=[C[0]/s,C[1]/s],r.timeDelta=s)}}emit(){const t=this.state,r=this.shared,n=this.config;if(t._active||this.clean(),(t._blocked||!t.intentional)&&!t._force&&!n.triggerAllEvents)return;const i=this.handler(T(T(T({},r),t),{},{[this.aliasKey]:t.values}));i!==void 0&&(t.memo=i)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}function Mo([e,t],r){const n=Math.abs(e),i=Math.abs(t);if(n>i&&n>r)return"x";if(i>n&&i>r)return"y"}class zo extends Vo{constructor(...t){super(...t),$(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=I.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=I.sub(this.state.offset,this.state.lastOffset)}axisIntent(t){const r=this.state,n=this.config;if(!r.axis&&t){const i=typeof n.axisThreshold=="object"?n.axisThreshold[_n(t)]:n.axisThreshold;r.axis=Mo(r._movement,i)}r._blocked=(n.lockDirection||!!n.axis)&&!r.axis||!!n.axis&&n.axis!==r.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 Pr=e=>e,Er=.15,Wt={enabled(e=!0){return e},eventOptions(e,t,r){return T(T({},r.shared.eventOptions),e)},preventDefault(e=!1){return e},triggerAllEvents(e=!1){return e},rubberband(e=0){switch(e){case!0:return[Er,Er];case!1:return[0,0];default:return I.toVector(e)}},from(e){if(typeof e=="function")return e;if(e!=null)return I.toVector(e)},transform(e,t,r){const n=e||r.shared.transform;if(this.hasCustomTransform=!!n,process.env.NODE_ENV==="development"){const i=n||Pr;return s=>{const o=i(s);return(!isFinite(o[0])||!isFinite(o[1]))&&console.warn(`[@use-gesture]: config.transform() must produce a valid result, but it was: [${o[0]},${[1]}]`),o}}return n||Pr},threshold(e){return I.toVector(e,0)}};process.env.NODE_ENV==="development"&&Object.assign(Wt,{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 Bo=0,ze=T(T({},Wt),{},{axis(e,t,{axis:r}){if(this.lockDirection=r==="lock",!this.lockDirection)return r},axisThreshold(e=Bo){return e},bounds(e={}){if(typeof e=="function")return s=>ze.bounds(e(s));if("current"in e)return()=>e.current;if(typeof HTMLElement=="function"&&e instanceof HTMLElement)return e;const{left:t=-1/0,right:r=1/0,top:n=-1/0,bottom:i=1/0}=e;return[[t,r],[n,i]]}}),Tr={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 Uo extends zo{constructor(...t){super(...t),$(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 r=t._bounds.getBoundingClientRect(),n=t.currentTarget.getBoundingClientRect(),i={left:r.left-n.left+t.offset[0],right:r.right-n.right+t.offset[0],top:r.top-n.top+t.offset[1],bottom:r.bottom-n.bottom+t.offset[1]};t._bounds=ze.bounds(i)}}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 r=this.config,n=this.state;if(t.buttons!=null&&(Array.isArray(r.pointerButtons)?!r.pointerButtons.includes(t.buttons):r.pointerButtons!==-1&&r.pointerButtons!==t.buttons))return;const i=this.ctrl.setEventIds(t);r.pointerCapture&&t.target.setPointerCapture(t.pointerId),!(i&&i.size>1&&n._pointerActive)&&(this.start(t),this.setupPointer(t),n._pointerId=wt(t),n._pointerActive=!0,this.computeValues(Sr(t)),this.computeInitial(),r.preventScrollAxis&&_n(t)!=="mouse"?(n._active=!1,this.setupScrollPrevention(t)):r.delay>0?(this.setupDelayTrigger(t),r.triggerAllEvents&&(this.compute(t),this.emit())):this.startPointerDrag(t))}startPointerDrag(t){const r=this.state;r._active=!0,r._preventScroll=!0,r._delayed=!1,this.compute(t),this.emit()}pointerMove(t){const r=this.state,n=this.config;if(!r._pointerActive)return;const i=wt(t);if(r._pointerId!==void 0&&i!==r._pointerId)return;const s=Sr(t);if(document.pointerLockElement===t.target?r._delta=[t.movementX,t.movementY]:(r._delta=I.sub(s,r._values),this.computeValues(s)),I.addTo(r._movement,r._delta),this.compute(t),r._delayed&&r.intentional){this.timeoutStore.remove("dragDelay"),r.active=!1,this.startPointerDrag(t);return}if(n.preventScrollAxis&&!r._preventScroll)if(r.axis)if(r.axis===n.preventScrollAxis||n.preventScrollAxis==="xy"){r._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 r=this.state,n=this.config;if(!r._active||!r._pointerActive)return;const i=wt(t);if(r._pointerId!==void 0&&i!==r._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(t);const[s,o]=r._distance;if(r.tap=s<=n.tapsThreshold&&o<=n.tapsThreshold,r.tap&&n.filterTaps)r._force=!0;else{const[a,l]=r._delta,[c,u]=r._movement,[d,f]=n.swipe.velocity,[g,v]=n.swipe.distance,m=n.swipe.duration;if(r.elapsedTime<m){const b=Math.abs(a/r.timeDelta),y=Math.abs(l/r.timeDelta);b>d&&Math.abs(c)>g&&(r.swipe[0]=Math.sign(a)),y>f&&Math.abs(u)>v&&(r.swipe[1]=Math.sign(l))}}this.emit()}pointerClick(t){!this.state.tap&&t.detail>0&&(t.preventDefault(),t.stopPropagation())}setupPointer(t){const r=this.config,n=r.device;if(process.env.NODE_ENV==="development")try{if(n==="pointer"&&r.preventScrollDelay===void 0){const i="uv"in t?t.sourceEvent.currentTarget:t.currentTarget;window.getComputedStyle(i).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.",i)}}catch{}r.pointerLock&&t.currentTarget.requestPointerLock(),r.pointerCapture||(this.eventStore.add(this.sharedConfig.window,n,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,n,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,n,"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,Ho(t);const r=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",r),this.eventStore.add(this.sharedConfig.window,"touch","cancel",r),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 r=Tr[t.key];if(r){const n=this.state,i=t.shiftKey?10:t.altKey?.1:1;this.start(t),n._delta=r(this.config.keyboardDisplacement,i),n._keyboardActive=!0,I.addTo(n._movement,n._delta),this.compute(t),this.emit()}}keyUp(t){t.key in Tr&&(this.state._keyboardActive=!1,this.setActive(),this.compute(t),this.emit())}bind(t){const r=this.config.device;t(r,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(t(r,"change",this.pointerMove.bind(this)),t(r,"end",this.pointerUp.bind(this)),t(r,"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 Ho(e){"persist"in e&&typeof e.persist=="function"&&e.persist()}const Be=typeof window<"u"&&window.document&&window.document.createElement;function Sn(){return Be&&"ontouchstart"in window}function Go(){return Sn()||Be&&window.navigator.maxTouchPoints>1}function qo(){return Be&&"onpointerdown"in window}function Wo(){return Be&&"exitPointerLock"in window.document}function Qo(){try{return"constructor"in GestureEvent}catch{return!1}}const z={isBrowser:Be,gesture:Qo(),touch:Sn(),touchscreen:Go(),pointer:qo(),pointerLock:Wo()},Yo=250,Ko=180,Xo=.5,Zo=50,Jo=250,ea=10,Cr={mouse:0,touch:0,pen:8},An=T(T({},ze),{},{device(e,t,{pointer:{touch:r=!1,lock:n=!1,mouse:i=!1}={}}){return this.pointerLock=n&&z.pointerLock,z.touch&&r?"touch":this.pointerLock?"mouse":z.pointer&&!i?"pointer":z.touch?"touch":"mouse"},preventScrollAxis(e,t,{preventScroll:r}){if(this.preventScrollDelay=typeof r=="number"?r:r||r===void 0&&e?Yo:void 0,!(!z.touchscreen||r===!1))return e||(r!==void 0?"y":void 0)},pointerCapture(e,t,{pointer:{capture:r=!0,buttons:n=1,keys:i=!0}={}}){return this.pointerButtons=n,this.keys=i,!this.pointerLock&&this.device==="pointer"&&r},threshold(e,t,{filterTaps:r=!1,tapsThreshold:n=3,axis:i=void 0}){const s=I.toVector(e,r?n:i?1:0);return this.filterTaps=r,this.tapsThreshold=n,s},swipe({velocity:e=Xo,distance:t=Zo,duration:r=Jo}={}){return{velocity:this.transform(I.toVector(e)),distance:this.transform(I.toVector(t)),duration:r}},delay(e=0){switch(e){case!0:return Ko;case!1:return 0;default:return e}},axisThreshold(e){return e?T(T({},Cr),e):Cr},keyboardDisplacement(e=ea){return e}});process.env.NODE_ENV==="development"&&Object.assign(An,{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}});T(T({},Wt),{},{device(e,t,{shared:r,pointer:{touch:n=!1}={}}){if(r.target&&!z.touch&&z.gesture)return"gesture";if(z.touch&&n)return"touch";if(z.touchscreen){if(z.pointer)return"pointer";if(z.touch)return"touch"}},bounds(e,t,{scaleBounds:r={},angleBounds:n={}}){const i=o=>{const a=Ar(tt(r,o),{min:-1/0,max:1/0});return[a.min,a.max]},s=o=>{const a=Ar(tt(n,o),{min:-1/0,max:1/0});return[a.min,a.max]};return typeof r!="function"&&typeof n!="function"?[i(),s()]:o=>[i(o),s(o)]},threshold(e,t,r){return this.lockDirection=r.axis==="lock",I.toVector(e,this.lockDirection?[.1,3]:0)},modifierKey(e){return e===void 0?"ctrlKey":e},pinchOnWheel(e=!0){return e}});T(T({},ze),{},{mouseOnly:(e=!0)=>e});T(T({},ze),{},{mouseOnly:(e=!0)=>e});const Pn=new Map,Ot=new Map;function ta(e){Pn.set(e.key,e.engine),Ot.set(e.key,e.resolver)}const ra={key:"drag",engine:Uo,resolver:An};function na(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,s;for(s=0;s<n.length;s++)i=n[s],!(t.indexOf(i)>=0)&&(r[i]=e[i]);return r}function ia(e,t){if(e==null)return{};var r=na(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}const sa={target(e){if(e)return()=>"current"in e?e.current:e},enabled(e=!0){return e},window(e=z.isBrowser?window:void 0){return e},eventOptions({passive:e=!0,capture:t=!1}={}){return{passive:e,capture:t}},transform(e){return e}},oa=["target","eventOptions","window","enabled","transform"];function We(e={},t){const r={};for(const[n,i]of Object.entries(t))switch(typeof i){case"function":if(process.env.NODE_ENV==="development"){const s=i.call(r,e[n],n,e);Number.isNaN(s)||(r[n]=s)}else r[n]=i.call(r,e[n],n,e);break;case"object":r[n]=We(e[n],i);break;case"boolean":i&&(r[n]=e[n]);break}return r}function aa(e,t,r={}){const n=e,{target:i,eventOptions:s,window:o,enabled:a,transform:l}=n,c=ia(n,oa);if(r.shared=We({target:i,eventOptions:s,window:o,enabled:a,transform:l},sa),t){const u=Ot.get(t);r[t]=We(T({shared:r.shared},c),u)}else for(const u in c){const d=Ot.get(u);if(d)r[u]=We(T({shared:r.shared},c[u]),d);else if(process.env.NODE_ENV==="development"&&!["drag","pinch","scroll","wheel","move","hover"].includes(u)){if(u==="domTarget")throw Error("[@use-gesture]: `domTarget` option has been renamed to `target`.");console.warn(`[@use-gesture]: Unknown config key \`${u}\` was used. Please read the documentation for further information.`)}}return r}class En{constructor(t,r){$(this,"_listeners",new Set),this._ctrl=t,this._gestureKey=r}add(t,r,n,i,s){const o=this._listeners,a=Io(r,n),l=this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{},c=T(T({},l),s);t.addEventListener(a,i,c);const u=()=>{t.removeEventListener(a,i,c),o.delete(u)};return o.add(u),u}clean(){this._listeners.forEach(t=>t()),this._listeners.clear()}}class ca{constructor(){$(this,"_timeouts",new Map)}add(t,r,n=140,...i){this.remove(t),this._timeouts.set(t,window.setTimeout(r,n,...i))}remove(t){const r=this._timeouts.get(t);r&&window.clearTimeout(r)}clean(){this._timeouts.forEach(t=>void window.clearTimeout(t)),this._timeouts.clear()}}class ua{constructor(t){$(this,"gestures",new Set),$(this,"_targetEventStore",new En(this)),$(this,"gestureEventStores",{}),$(this,"gestureTimeoutStores",{}),$(this,"handlers",{}),$(this,"config",{}),$(this,"pointerIds",new Set),$(this,"touchIds",new Set),$(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),la(this,t)}setEventIds(t){if(lt(t))return this.touchIds=new Set($o(t)),this.touchIds;if("pointerId"in t)return t.type==="pointerup"||t.type==="pointercancel"?this.pointerIds.delete(t.pointerId):t.type==="pointerdown"&&this.pointerIds.add(t.pointerId),this.pointerIds}applyHandlers(t,r){this.handlers=t,this.nativeHandlers=r}applyConfig(t,r){this.config=aa(t,r,this.config)}clean(){this._targetEventStore.clean();for(const t of this.gestures)this.gestureEventStores[t].clean(),this.gestureTimeoutStores[t].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...t){const r=this.config.shared,n={};let i;if(!(r.target&&(i=r.target(),!i))){if(r.enabled){for(const o of this.gestures){const a=this.config[o],l=Or(n,a.eventOptions,!!i);if(a.enabled){const c=Pn.get(o);new c(this,t,o).bind(l)}}const s=Or(n,r.eventOptions,!!i);for(const o in this.nativeHandlers)s(o,"",a=>this.nativeHandlers[o](T(T({},this.state.shared),{},{event:a,args:t})),void 0,!0)}for(const s in n)n[s]=Fo(...n[s]);if(!i)return n;for(const s in n){const{device:o,capture:a,passive:l}=Oo(s);this._targetEventStore.add(i,o,"",n[s],{capture:a,passive:l})}}}}function ae(e,t){e.gestures.add(t),e.gestureEventStores[t]=new En(e,t),e.gestureTimeoutStores[t]=new ca}function la(e,t){t.drag&&ae(e,"drag"),t.wheel&&ae(e,"wheel"),t.scroll&&ae(e,"scroll"),t.move&&ae(e,"move"),t.pinch&&ae(e,"pinch"),t.hover&&ae(e,"hover")}const Or=(e,t,r)=>(n,i,s,o={},a=!1)=>{var l,c;const u=(l=o.capture)!==null&&l!==void 0?l:t.capture,d=(c=o.passive)!==null&&c!==void 0?c:t.passive;let f=a?n:To(n,i,u);r&&d&&(f+="Passive"),e[f]=e[f]||[],e[f].push(s)};function da(e,t={},r,n){const i=V.default.useMemo(()=>new ua(e),[]);if(i.applyHandlers(e,n),i.applyConfig(t,r),V.default.useEffect(i.effect.bind(i)),V.default.useEffect(()=>i.clean.bind(i),[]),t.target===void 0)return i.bind.bind(i)}function fa(e,t){return ta(ra),da({drag:e},t||{},"drag")}const ha=_.default.div`
|
|
435
435
|
position: absolute;
|
|
436
436
|
inset: 0;
|
|
437
437
|
background-color: ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.scrim)||"rgba(0, 0, 0, 0.4)"}};
|
|
438
|
-
`,
|
|
438
|
+
`,pa=_.default.div`
|
|
439
439
|
background-color: rgb(${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.surfaceRgb)||"255, 255, 255"}});
|
|
440
440
|
border-top-left-radius: ${({theme:e})=>{var t;return((t=e.styling)==null?void 0:t.borderRadiusPixel)||24}}px;
|
|
441
441
|
border-top-right-radius: ${({theme:e})=>{var t;return((t=e.styling)==null?void 0:t.borderRadiusPixel)||24}}px;
|
|
442
442
|
max-height: 85dvh;
|
|
443
443
|
padding-bottom: max(env(safe-area-inset-bottom), 16px);
|
|
444
|
-
`,
|
|
444
|
+
`,ga=_.default.div`
|
|
445
445
|
width: 40px;
|
|
446
446
|
height: 5px;
|
|
447
447
|
background-color: ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.outline)||"rgba(0, 0, 0, 0.3)"}};
|
|
448
448
|
border-radius: 3px;
|
|
449
449
|
margin: 12px auto 8px;
|
|
450
|
-
`,
|
|
450
|
+
`,ma=_.default.div`
|
|
451
451
|
padding: 0 ${({theme:e})=>{var t;return((t=e.spacing)==null?void 0:t.appStandardPadding)||"16px"}};
|
|
452
|
-
`,
|
|
452
|
+
`,ya=_.default.span`
|
|
453
453
|
position: absolute;
|
|
454
454
|
width: 1px;
|
|
455
455
|
height: 1px;
|
|
@@ -459,20 +459,20 @@
|
|
|
459
459
|
clip: rect(0, 0, 0, 0);
|
|
460
460
|
white-space: nowrap;
|
|
461
461
|
border: 0;
|
|
462
|
-
`;function
|
|
462
|
+
`;function va(e){return 8*(Math.log(e+1)-2)}function ba({isOpen:e,onClose:t,children:r,title:n="Bottom Sheet",maxHeight:i=300,velocityThreshold:s=.4,closeThreshold:o=.25,onExitComplete:a}){const l=w.useRef(null),[c,u]=w.useState(e),[d,f]=Ve(()=>({y:i,opacity:0,config:{tension:300,friction:30}}));w.useEffect(()=>{var m,b;if(e){u(!0);const y=((m=l.current)==null?void 0:m.offsetHeight)||i;f.set({y,opacity:0}),f.start({y:0,opacity:1})}else{const y=((b=l.current)==null?void 0:b.offsetHeight)||i;f.start({y,opacity:0,onRest:()=>{u(!1),a==null||a()}})}},[e,f,i,a]);const g=w.useCallback(()=>{t()},[t]),v=fa(({active:m,movement:[,b],velocity:[,y],direction:[,k],cancel:x})=>{if(b<-10){x();return}const P=Math.max(0,b);if(m){const S=b<0?va(-b)*-.5:P;f.start({y:S,immediate:!0});const C=Math.min(P/i,1);f.start({opacity:1-C*.5,immediate:!0})}else y>s&&k>0||P>i*o?g():f.start({y:0,opacity:1})},{from:()=>[0,d.y.get()],filterTaps:!0,axis:"y",pointer:{touch:!0},preventDefault:!0,eventOptions:{passive:!1}});return c?h.jsxs(h.Fragment,{children:[h.jsx(fe.div,{style:{position:"fixed",inset:0,zIndex:49,opacity:d.opacity,pointerEvents:e?"auto":"none"},onClick:g,children:h.jsx(ha,{})}),h.jsx(fe.div,{style:{position:"fixed",bottom:0,left:0,right:0,zIndex:50,transform:d.y.to(m=>`translateY(${m}px)`)},children:h.jsxs(pa,{ref:l,children:[h.jsx(ya,{children:n}),h.jsx("div",{...v(),style:{touchAction:"none",cursor:"grab",padding:"8px 0"},children:h.jsx(ga,{})}),h.jsx(ma,{children:r})]})})]}):h.jsx(h.Fragment,{})}function Tn(){const[e,t]=w.useState(null),r=w.useCallback((i,s)=>{const o=i.currentTarget.getBoundingClientRect();t({x:i.clientX-o.left,y:i.clientY-o.top,key:Date.now(),target:s})},[]),n=w.useCallback(i=>e!==null&&e.target===i,[e]);return{ripple:e,trigger:r,isTarget:n}}const wa=_.default.div`
|
|
463
463
|
display: flex;
|
|
464
464
|
flex-direction: column;
|
|
465
465
|
gap: 0.5rem;
|
|
466
|
-
`,
|
|
466
|
+
`,xa=_.default.div`
|
|
467
467
|
text-align: center;
|
|
468
468
|
padding: 0.5rem 1rem;
|
|
469
469
|
font-weight: 300;
|
|
470
|
-
`,
|
|
470
|
+
`,_a=_.default.div`
|
|
471
471
|
text-align: center;
|
|
472
472
|
padding: 0 1rem 1rem;
|
|
473
473
|
font-size: 0.875rem;
|
|
474
474
|
opacity: 0.7;
|
|
475
|
-
`,
|
|
475
|
+
`,Ir=_.default.button`
|
|
476
476
|
position: relative;
|
|
477
477
|
z-index: 1;
|
|
478
478
|
display: flex;
|
|
@@ -490,13 +490,13 @@
|
|
|
490
490
|
outline: none;
|
|
491
491
|
overflow: hidden;
|
|
492
492
|
-webkit-tap-highlight-color: transparent;
|
|
493
|
-
`;function
|
|
493
|
+
`;function ka({message:e,description:t,confirmLabel:r,cancelLabel:n,destructive:i=!1,onConfirm:s,onCancel:o}){const{ripple:a,trigger:l,isTarget:c}=Tn(),u=f=>{l(f,"confirm"),s()},d=f=>{l(f,"cancel"),o()};return h.jsxs(wa,{children:[h.jsx(xa,{children:e}),t&&h.jsx(_a,{children:t}),h.jsxs(Ir,{$destructive:i,onClick:u,children:[c("confirm")&&a&&h.jsx($e,{$x:a.x,$y:a.y},a.key),r]}),h.jsxs(Ir,{onClick:d,children:[c("cancel")&&a&&h.jsx($e,{$x:a.x,$y:a.y},a.key),n]})]})}const Sa={primary:N.css`
|
|
494
494
|
background: ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.whiteLow)||"rgba(255, 255, 255, 0.2)"}};
|
|
495
495
|
`,muted:N.css`
|
|
496
496
|
background: ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.surfaceVariant)||"rgba(0, 0, 0, 0.06)"}};
|
|
497
497
|
`,success:N.css`
|
|
498
498
|
background: rgba(34, 197, 94, 0.15);
|
|
499
|
-
`},
|
|
499
|
+
`},Aa=_.default.div`
|
|
500
500
|
display: flex;
|
|
501
501
|
align-items: center;
|
|
502
502
|
justify-content: center;
|
|
@@ -504,16 +504,16 @@
|
|
|
504
504
|
padding: 0.75rem 1rem;
|
|
505
505
|
border-radius: 1rem;
|
|
506
506
|
min-width: 4rem;
|
|
507
|
-
${({$variant:e})=>
|
|
508
|
-
`,
|
|
507
|
+
${({$variant:e})=>Sa[e]}
|
|
508
|
+
`,Pa=_.default.span`
|
|
509
509
|
font-size: 1.25rem;
|
|
510
510
|
font-weight: 600;
|
|
511
511
|
line-height: 1;
|
|
512
|
-
color: ${({$variant:e,theme:t})=>{var n
|
|
513
|
-
`,
|
|
512
|
+
color: ${({$variant:e,theme:t})=>{var r,n;return e==="success"?"#16a34a":((r=t.colors)==null?void 0:r.primaryDarker)||((n=t.colors)==null?void 0:n.primary)||"#333"}};
|
|
513
|
+
`,Ea=_.default.span`
|
|
514
514
|
font-size: 0.625rem;
|
|
515
515
|
font-weight: 500;
|
|
516
516
|
color: ${({theme:e})=>{var t;return((t=e.colors)==null?void 0:t.onSurface)||"#333"}};
|
|
517
517
|
text-transform: uppercase;
|
|
518
518
|
letter-spacing: 0.05em;
|
|
519
|
-
`;function
|
|
519
|
+
`;function Ta({value:e,label:t,variant:r="primary"}){return h.jsxs(Aa,{$variant:r,children:[h.jsx(Pa,{$variant:r,children:e}),t&&h.jsx(Ea,{children:t})]})}const Ca={cardPosition:"transit-to-home"},Qt=It.createSlice({name:"navigation",initialState:Ca,reducers:{setCardState:(e,t)=>(e.cardPosition=t.payload.state,e)}}),{setCardState:za}=Qt.actions;Qt.reducer;const Oa=It.combineReducers({navigation:Qt.reducer}),Ia=It.configureStore({reducer:Oa});function Ra(){const[e,t]=w.useState(()=>typeof window>"u"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches);return w.useEffect(()=>{const r=window.matchMedia("(prefers-reduced-motion: reduce)"),n=i=>t(i.matches);return r.addEventListener("change",n),()=>r.removeEventListener("change",n)},[]),e}function Da(e=100){const[t,r]=w.useState({width:typeof window<"u"?window.innerWidth:0,height:typeof window<"u"?window.innerHeight:0});return w.useEffect(()=>{let n;const i=()=>{clearTimeout(n),n=setTimeout(()=>{r({width:window.innerWidth,height:window.innerHeight})},e)};return window.addEventListener("resize",i),window.addEventListener("orientationchange",i),()=>{clearTimeout(n),window.removeEventListener("resize",i),window.removeEventListener("orientationchange",i)}},[e]),t}function Cn(e,t){let r=0,n=null;const i=(...s)=>{const o=Date.now(),a=o-r;a>=t?(r=o,e(...s)):n||(n=setTimeout(()=>{r=Date.now(),n=null,e(...s)},t-a))};return i.cancel=()=>{n&&(clearTimeout(n),n=null)},i}function $a(e,t={}){const{enabled:r=!0,includeMargins:n=!0,throttleMs:i=16}=t,s=w.useRef(null),o=w.useRef(null),a=w.useRef(null),l=w.useRef(e);w.useEffect(()=>{l.current=e},[e]);const c=w.useCallback(()=>{if(!s.current||!r)return;const d=s.current.getBoundingClientRect();let f=0,g=0;if(n){const m=getComputedStyle(s.current);f=parseFloat(m.marginTop)||0,g=parseFloat(m.marginBottom)||0}const v={top:d.top-f,left:d.left,width:d.width,height:d.height+f+g,right:d.right,bottom:d.bottom+g,x:d.x,y:d.y-f};if(a.current){const m=Math.abs(v.top-a.current.top),b=Math.abs(v.height-a.current.height),y=Math.abs(v.width-a.current.width);if(m<.5&&b<.5&&y<.5)return}a.current=v,l.current(v)},[r,n]);return w.useEffect(()=>{if(!s.current||!r)return;const d=Cn(c,i),f=requestAnimationFrame(c),g=new ResizeObserver(d);g.observe(s.current),o.current=g;const v=m=>{const b=m.target;b!==document&&b!==document.documentElement||d()};return window.addEventListener("scroll",v,{passive:!0,capture:!0}),window.addEventListener("resize",d),()=>{cancelAnimationFrame(f),g.disconnect(),d.cancel(),window.removeEventListener("scroll",v,{capture:!0}),window.removeEventListener("resize",d)}},[c,r,i]),d=>{s.current=d}}const ce={palette:{teal50:"#FAF7F0",teal100:"#c8e6c9",teal200:"#81c784",teal400:"#4caf50",teal600:"#2e7d32",teal800:"#1b5e20",teal900:"#1a4f2e",orange50:"#FFFCF5",orange100:"#FFF5E0",orange300:"#E8C840",orange400:"#D4A520",orange500:"#B8860B",green50:"#f0fdf4",green100:"#dcfce7",green200:"#bbf7d0",green400:"#4ade80",green500:"#22c55e",green600:"#3d6b56",green800:"#166534",red400:"#BF4B3E",red600:"#6b4a46",white:"#ffffff",gray50:"#FAFAFA",gray100:"#F5F5F5",gray200:"#E0E0E0",gray300:"#D0D0D0",gray400:"#B8B8B8",gray500:"#9E9E9E",gray600:"#6E6E6E",gray700:"#505050",gray800:"#2A2A2A",gray900:"#161616",black:"#000000"},darkOverrides:{secondaryContainer:"#2A3A2A",surface:"#282C28",surfaceVariant:"#1C201C",surfaceContainer:"#323632",surfaceContainerHigh:"#3C403C",background:"#0E110E"}};function R(e){const t=e.replace("#",""),r=parseInt(t.substring(0,2),16),n=parseInt(t.substring(2,4),16),i=parseInt(t.substring(4,6),16);return`${r}, ${n}, ${i}`}function ja(e){const t=e.palette;return{primary:"#0D47A1",onPrimary:t.white,primaryContainer:"#BBDEFB",onPrimaryContainer:"#0D3B70",primaryDark:"#0A3A86",primaryDarker:"#08306B",secondary:"#E8C840",onSecondary:"#1A1A1A",secondaryContainer:"#FFF8E0",onSecondaryContainer:"#1A1A1A",secondaryLight:"#E8C840",success:t.green400,onSuccess:"#0D3B70",successContainer:t.green200,onSuccessContainer:t.green800,successSurface:t.green50,successDark:t.green500,successMuted:t.green600,error:t.red400,onError:t.white,errorMuted:t.red600,surface:t.white,onSurface:"#1A1A1A",surfaceVariant:"#FFF9F2",onSurfaceVariant:"#5A5550",surfaceContainer:"#F8F6F4",surfaceContainerHigh:"#F0EEEC",background:"#64B5F6",onBackground:"#0A0A0A",outline:"#9E9E9E",outlineVariant:"#D0D0D0",shadow:"rgba(0, 0, 0, 0.28)",shadowLight:"rgba(0, 0, 0, 0.15)",shadowLighter:"rgba(0, 0, 0, 0.10)",shadowSubtle:"rgba(0, 0, 0, 0.08)",shadowFaint:"rgba(0, 0, 0, 0.05)",scrim:"rgba(0, 0, 0, 0.4)",scrimLight:"rgba(0, 0, 0, 0.3)",ripple:"rgba(0, 0, 0, 0.1)",whiteHigh:"rgba(255, 255, 255, 0.9)",whiteMedium:"rgba(255, 255, 255, 0.5)",whiteLow:"rgba(255, 255, 255, 0.4)",whiteHover:"rgba(255, 255, 255, 0.08)",keyboardSurface:"#D5D3D0",keyCharacter:t.white,keyCharacterText:"#1A1A1A",keyDefault:"#B5B2AE",keyDefaultText:"#1A1A1A",keyWrong:"#B5B2AE",keyWrongMuted:"#B5B2AE",keyCorrect:"#0D47A1",keyCorrectMuted:"#0A3A86",keyAccentText:t.white,keyDisabled:"#6E6E6E",keyDisabledText:"#9E9E9E",toggleTrackOn:`rgba(${R("#0D47A1")}, 0.5)`,toggleTrackOff:"rgba(0, 0, 0, 0.38)",toggleThumbOn:"#0D47A1",toggleThumbOff:"#FAFAFA",toggleHoverOn:`rgba(${R("#0D47A1")}, 0.08)`,toggleHoverOff:"rgba(0, 0, 0, 0.04)",toggleFocusOn:`rgba(${R("#0D47A1")}, 0.12)`,toggleFocusOff:"rgba(0, 0, 0, 0.06)",textShadowDark:"#505050"}}function La(e){return{primary:R("#0D47A1"),background:R("#64B5F6"),surface:R("#ffffff"),primaryDarker:R("#08306B")}}function Fa(e){const t=e.palette,r=e.darkOverrides;return{primary:t.teal200,onPrimary:t.teal900,primaryContainer:t.teal800,onPrimaryContainer:t.teal100,primaryDark:t.teal400,primaryDarker:t.teal600,secondary:t.orange300,onSecondary:t.gray900,secondaryContainer:r.secondaryContainer,onSecondaryContainer:t.orange100,secondaryLight:t.orange400,success:t.green400,onSuccess:t.green800,successContainer:"#243d2f",onSuccessContainer:t.green200,successSurface:"#1a3022",successDark:t.green400,successMuted:t.green500,error:"#f28078",onError:t.gray900,errorMuted:"#8b5a55",surface:r.surface,onSurface:"#eeeeee",surfaceVariant:r.surfaceVariant,onSurfaceVariant:"#d0d0d0",surfaceContainer:r.surfaceContainer,surfaceContainerHigh:r.surfaceContainerHigh,background:r.background,onBackground:"#eeeeee",outline:"#858885",outlineVariant:"#656865",shadow:"rgba(0, 0, 0, 0.4)",shadowLight:"rgba(0, 0, 0, 0.25)",shadowLighter:"rgba(0, 0, 0, 0.15)",shadowSubtle:"rgba(0, 0, 0, 0.1)",shadowFaint:"rgba(0, 0, 0, 0.06)",scrim:"rgba(0, 0, 0, 0.6)",scrimLight:"rgba(0, 0, 0, 0.45)",ripple:"rgba(255, 255, 255, 0.1)",whiteHigh:"rgba(255, 255, 255, 0.87)",whiteMedium:"rgba(255, 255, 255, 0.5)",whiteLow:"rgba(255, 255, 255, 0.2)",whiteHover:"rgba(255, 255, 255, 0.08)",keyboardSurface:"#1e241e",keyCharacter:"#383e38",keyCharacterText:"#eeeeee",keyDefault:"#2a302a",keyDefaultText:"#d0d0d0",keyWrong:"#2a302a",keyWrongMuted:"#2a302a",keyCorrect:t.teal400,keyCorrectMuted:t.teal600,keyAccentText:"#eeeeee",keyDisabled:t.gray700,keyDisabledText:t.gray600,toggleTrackOn:`rgba(${R(t.teal200)}, 0.5)`,toggleTrackOff:"rgba(255, 255, 255, 0.3)",toggleThumbOn:t.teal200,toggleThumbOff:t.gray600,toggleHoverOn:`rgba(${R(t.teal200)}, 0.08)`,toggleHoverOff:"rgba(255, 255, 255, 0.04)",toggleFocusOn:`rgba(${R(t.teal200)}, 0.12)`,toggleFocusOff:"rgba(255, 255, 255, 0.06)",textShadowDark:t.black}}function Na(e){const t=e.palette,r=e.darkOverrides;return{primary:R(t.teal200),background:R(r.background),surface:R(r.surface),primaryDarker:R(t.teal600)}}function Rr(e,t,r){return{spacing:{appStandardPadding:"1rem"},colors:{...e,primaryRgb:t.primary,backgroundRgb:t.background,surfaceRgb:t.surface,primaryDarkerRgb:t.primaryDarker,primaryLight:e.primaryContainer,backgroundHex:e.background,bottomNavBarBackgroundRgb:t.primary,settingsBackgroundRgb:t.surface,text:e.onSurface},styling:{borderRadiusPixel:32},palette:r.palette}}function On(e){return e==="dark"?Rr(Fa(ce),Na(ce),ce):Rr(ja(ce),La(),ce)}const Va=On("light");exports.AnimatedText=qt;exports.AnimatedTextProvider=is;exports.BackButton=Ps;exports.Badge=Ta;exports.BannerButton=bs;exports.BottomSheet=ba;exports.CircleIconButton=Ss;exports.ConfirmDialog=ka;exports.ListItem=Ms;exports.LoadingScreen=oo;exports.OptionPicker=xo;exports.Ripple=$e;exports.SPRING_COMFORTABLE=et;exports.SPRING_COMFORTABLE_SLOW=zs;exports.SPRING_GENTLE=Gs;exports.SPRING_INSTANT=Hs;exports.SPRING_LANDING=Ws;exports.SPRING_RESPONSIVE=je;exports.SPRING_RISING=Qs;exports.SPRING_SNAPPY=Bs;exports.SPRING_STAGGERED=Us;exports.SPRING_VERY_SLOW=qs;exports.ToggleSwitch=vn;exports.UnorderedListItemContainer=Es;exports.ZhuyinKeyboard=wn;exports.buildTheme=On;exports.defaultTheme=ce;exports.hexToRgb=R;exports.rippleAnimation=yn;exports.theme=Va;exports.throttle=Cn;exports.useReducedMotion=Ra;exports.useReportPosition=$a;exports.useRipple=Tn;exports.useViewportSize=Da;exports.ymyStore=Ia;
|