@joy-ride/game 0.0.0-stage → 0.25.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/LICENSE.md +21 -0
- package/README.md +164 -2
- package/THIRD_PARTY_NOTICES.md +136 -0
- package/bookmarklet.d.ts +11 -0
- package/bookmarklet.js +25 -0
- package/embed-assets/attractor-B0xCt_Fj.mp3 +0 -0
- package/embed-assets/audi-rs3-top-Zwm7ZQ20.webp +0 -0
- package/embed-assets/bmw-m4-top-GKSf0h28.webp +0 -0
- package/embed-assets/boost-BLJDRtPH.mp3 +0 -0
- package/embed-assets/bullet-ricochet-1-BKWD_WRI.mp3 +0 -0
- package/embed-assets/bullet-ricochet-2-CmbSTqg5.mp3 +0 -0
- package/embed-assets/bullet-ricochet-3-DV3Th6nn.mp3 +0 -0
- package/embed-assets/burning-fire--0zItqR0.mp3 +0 -0
- package/embed-assets/collision-hard-b_eauD-v.mp3 +0 -0
- package/embed-assets/collision-medium-Bhw86k_p.mp3 +0 -0
- package/embed-assets/collision-soft-DIwEkPCV.mp3 +0 -0
- package/embed-assets/collision-soft-fVT-mQmJ.mp3 +0 -0
- package/embed-assets/combustible-explosion-XvpDzpm9.mp3 +0 -0
- package/embed-assets/crush-BZKARh2Y.mp3 +0 -0
- package/embed-assets/electric-bolt-Cg9Fmi6S.mp3 +0 -0
- package/embed-assets/electric-charge-zw1IjLo4.mp3 +0 -0
- package/embed-assets/electric-gt-top-DTcvEjMR.webp +0 -0
- package/embed-assets/flamethrower-B5pUrS5p.mp3 +0 -0
- package/embed-assets/ford-mustang-gt-top-DVzZTm7G.webp +0 -0
- package/embed-assets/ghost-mode-B33_bxYX.mp3 +0 -0
- package/embed-assets/inter-latin-variable-Dx4kXJAl.woff2 +0 -0
- package/embed-assets/jeep-wrangler-top-Dr43LU9c.webp +0 -0
- package/embed-assets/lamborghini-huracan-evo-top-BCJJwrTj.webp +0 -0
- package/embed-assets/logo-backing-DQNUb3C2.svg +1 -0
- package/embed-assets/machine-gun-C4ag4X6T.mp3 +0 -0
- package/embed-assets/porsche-911-997-top-BE6uRNL4.webp +0 -0
- package/embed-assets/rocket-explosion-DKnN7_wY.mp3 +0 -0
- package/embed-assets/rocket-launch-C-Yvbb7P.mp3 +0 -0
- package/embed-assets/roof-rocket-v1-Bs4IEw-s.webp +0 -0
- package/embed-assets/side-gun-v1-BnpvZN1b.webp +0 -0
- package/embed-assets/subaru-wrx-top-dLvMFYDs.webp +0 -0
- package/embed-assets/tire-screech-DEsAg1CH.mp3 +0 -0
- package/embed-chunks/CodeBlock-SbsdRltK.js +22 -0
- package/embed-chunks/Documentation-it27YLKx.js +33 -0
- package/embed-chunks/EmbedPanel-yRsx9glF.js +1 -0
- package/embed-chunks/JoyRideView-o-2qdJkr.js +1 -0
- package/embed-chunks/X.es-d7B7rOGv.js +1 -0
- package/embed-chunks/configuration~index~embed-CG9auZKS.js +1 -0
- package/embed-chunks/configuration~index~embed~bookmarklet-C8RUCiUX.js +1 -0
- package/embed-chunks/configuration~index~embed~bookmarklet~vehicle-popover~EmbedPanel~Documentation~JoyRideView~~n76yhyet-zf1LIsS8.js +1 -0
- package/embed-chunks/configuration~index~embed~bookmarklet~vehicle-popover~EmbedPanel~JoyRideView~browser-sessio~iaaa3ndj-BBrKrH7m.js +1 -0
- package/embed-chunks/controls~index~embed-B_C92tUz.js +1 -0
- package/embed-chunks/definitions~index~embed-CDMM_m1T.js +1 -0
- package/embed-chunks/definitions~index~embed~bookmarklet-BfjknPZN.js +1 -0
- package/embed-chunks/definitions~index~embed~bookmarklet~vehicle-popover~Documentation~JoyRideView~browser-sessi~fklztn3g-Dt96jol6.js +1 -0
- package/embed-chunks/definitions~index~embed~vehicle-popover~browser-session-core~renderer-RDNEXk_b.js +1 -0
- package/embed-chunks/react-vendor~index~embed-BNCMh3YF.js +9 -0
- package/embed-chunks/rolldown-runtime-XKyaHtl9.js +1 -0
- package/embed-chunks/runtime~JoyRideView~browser-session-core-Ya-yv4PC.js +1 -0
- package/embed-chunks/runtime~browser-session-core-DUfZaJcj.js +1 -0
- package/embed-chunks/runtime~index~embed-B2Zpd22X.js +210 -0
- package/embed-chunks/runtime~index~embed~vehicle-popover~browser-session-core~renderer-OqE9OpvH.js +1 -0
- package/embed-chunks/runtime~vehicle-popover-DI44kx2W.js +1 -0
- package/embed-chunks/runtime~vehicle-popover~browser-session-core-BC-HGK32.js +1 -0
- package/embed-chunks/runtime~vehicle-popover~browser-session-core~renderer-CHG4ymHM.js +4 -0
- package/embed-chunks/runtime~vehicle-popover~renderer-DwVymD49.js +1077 -0
- package/embed-chunks/src-BJXg-amK.js +2 -0
- package/embed-chunks/vehicle-catalog~index~embed-DcyLaPhV.js +1 -0
- package/embed-chunks/vehicle-popover-CtdtJ1cl.js +1 -0
- package/embed.js +1 -0
- package/index-sebzwsKw.d.ts +2492 -0
- package/index.d.ts +3 -0
- package/index.js +1 -0
- package/npm-chunks/CodeBlock-35k1cnjA.js +22 -0
- package/npm-chunks/Documentation-B6U46upd.js +33 -0
- package/npm-chunks/EmbedPanel-dnDwQhT5.js +1 -0
- package/npm-chunks/JoyRideView-C2nOVKZu.js +1 -0
- package/npm-chunks/X.es-VqSWeM6N.js +1 -0
- package/npm-chunks/configuration~react-CKBQFWEF.js +1 -0
- package/npm-chunks/configuration~react~browser-session-core-CyXr42pk.js +1 -0
- package/npm-chunks/configuration~react~vehicle-popover~EmbedPanel~Documentation~JoyRideView~browser-session-co~fvauaeow-zf1LIsS8.js +1 -0
- package/npm-chunks/configuration~react~vehicle-popover~EmbedPanel~JoyRideView~browser-session-core-BQ8wO_VE.js +1 -0
- package/npm-chunks/configuration~react~vehicle-popover~EmbedPanel~JoyRideView~browser-session-core~renderer-DJhBwBho.js +1 -0
- package/npm-chunks/configuration~react~vehicle-popover~JoyRideView~browser-session-core~renderer-B70Mpi9X.js +1 -0
- package/npm-chunks/controls~react~vehicle-popover~Documentation~JoyRideView~browser-session-core-CLDwfJ48.js +1 -0
- package/npm-chunks/controls~react~vehicle-popover~JoyRideView~browser-session-core~renderer-Cnf30Q_A.js +1 -0
- package/npm-chunks/definitions~react~browser-session-core-acRq5AYt.js +1 -0
- package/npm-chunks/definitions~react~vehicle-popover~Documentation~JoyRideView~browser-session-core-BZJqthWX.js +1 -0
- package/npm-chunks/definitions~react~vehicle-popover~Documentation~JoyRideView~browser-session-core~renderer-Dt96jol6.js +1 -0
- package/npm-chunks/definitions~react~vehicle-popover~browser-session-core~renderer-RDNEXk_b.js +1 -0
- package/npm-chunks/input-DHpsGB-l.js +1 -0
- package/npm-chunks/rolldown-runtime-XKyaHtl9.js +1 -0
- package/npm-chunks/runtime~JoyRideView~browser-session-core-CuSPCh9O.js +1 -0
- package/npm-chunks/runtime~browser-session-core-BenGnDZN.js +1 -0
- package/npm-chunks/runtime~react-BKEnJfDK.js +1 -0
- package/npm-chunks/runtime~react~JoyRideView~browser-session-core-BRSYGakW.js +1 -0
- package/npm-chunks/runtime~react~browser-session-core-Cr50FE3R.js +1 -0
- package/npm-chunks/runtime~react~vehicle-popover-khBccGFq.js +1 -0
- package/npm-chunks/runtime~react~vehicle-popover~browser-session-core-BzXBN4rK.js +210 -0
- package/npm-chunks/runtime~react~vehicle-popover~browser-session-core~renderer-Be8cIaU4.js +1 -0
- package/npm-chunks/runtime~vehicle-popover-PLJOXbUU.js +1 -0
- package/npm-chunks/runtime~vehicle-popover~browser-session-core-Ddxp7Nuh.js +1 -0
- package/npm-chunks/runtime~vehicle-popover~browser-session-core~renderer-jVG7K050.js +4 -0
- package/npm-chunks/runtime~vehicle-popover~renderer-CYXkRwO4.js +1077 -0
- package/npm-chunks/sync-shadow-theme-Bqi_M9ro.js +1 -0
- package/npm-chunks/theme-C4ZE2-nQ.js +2 -0
- package/npm-chunks/vehicle-catalog~react~browser-session-core-BzB5J-Lm.js +1 -0
- package/npm-chunks/vehicle-catalog~react~vehicle-popover~browser-session-core-B1wVsjdQ.js +1 -0
- package/npm-chunks/vehicle-popover-D0e1ZKfF.js +1 -0
- package/package.json +65 -4
- package/playground-DrT_x51v.d.ts +1255 -0
- package/react.d.ts +15 -0
- package/react.js +25 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{t}from"./configuration~index~embed~bookmarklet~vehicle-popover~EmbedPanel~Documentation~JoyRideView~~n76yhyet-zf1LIsS8.js";import{f as n,m as r,p as i,u as a}from"./configuration~index~embed~bookmarklet-C8RUCiUX.js";import{i as o,t as s}from"./react-vendor~index~embed-BNCMh3YF.js";import{N as c,S as l,a as u,c as d,h as f,l as p,m,o as h,u as g,x as _,y as v}from"./X.es-d7B7rOGv.js";import{t as y}from"./CodeBlock-SbsdRltK.js";import{C as b,D as x,E as S,_ as C,a as w,b as T,c as E,g as D,h as O,i as k,l as A,m as j,n as M,o as ee,p as N,r as P,s as F,t as I,v as te,w as L,x as R,y as z}from"./vehicle-popover-CtdtJ1cl.js";var B=e(o(),1),V=B.createContext(void 0);function H(){let e=B.useContext(V);if(e===void 0)throw Error(v(10));return e}var U=s(),W={value:()=>null},ne=B.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,hiddenUntilFound:a,keepMounted:o,loopFocus:s,onValueChange:c,multiple:u=!1,orientation:f=`vertical`,value:p,defaultValue:m,style:h,..._}=e,v=m??g,y=B.useRef([]),[b,x]=A({controlled:p,default:v,name:`Accordion`,state:`value`}),S=l((e,t,n)=>{let r;r=u?t?[...b,e]:b.filter(t=>t!==e):b[0]===e?[]:[e],c?.(r,n),!n.isCanceled&&x(r)}),C=B.useMemo(()=>({value:b,disabled:i,orientation:f}),[b,i,f]),w=B.useMemo(()=>({disabled:i,handleValueChange:S,hiddenUntilFound:a??!1,keepMounted:o??!1,state:C,value:b}),[i,S,a,o,C,b]),T=d(`div`,e,{state:C,ref:t,props:_,stateAttributesMapping:W});return(0,U.jsx)(V.Provider,{value:w,children:(0,U.jsx)(E,{elementsRef:y,children:T})})});function re(e){let{open:t,defaultOpen:n=!1,onOpenChange:r,disabled:i}=e,[a,o]=A({controlled:t,default:n,name:`Collapsible`,state:`open`}),{mounted:s,setMounted:c,transitionStatus:u}=D(a,!0,!0),d=L(),[f,p]=B.useState(),m=f===null?void 0:f??d,h=l(e=>{let t=!a,n=O(j,e.nativeEvent);r(t,n),!n.isCanceled&&o(t)});return B.useMemo(()=>({defaultPanelId:d,disabled:i,handleTrigger:h,mounted:s,open:a,panelId:m,setMounted:c,setOpen:o,setPanelIdState:p,transitionStatus:u}),[d,i,h,s,a,m,c,o,p,u])}var ie=B.createContext(void 0);function G(){let e=B.useContext(ie);if(e===void 0)throw Error(v(15));return e}var K=B.createContext(void 0);function q(){let e=B.useContext(K);if(e===void 0)throw Error(v(9));return e}var ae=`data-open`,oe=`data-closed`,J=b,se=`data-panel-open`,ce={[ae]:``},le={[oe]:``},ue={open(e){return e?{[se]:``}:null}},de={open(e){return e?ce:le}},fe=`data-index`,Y={...de,index:e=>({[fe]:String(e)}),...R,value:()=>null},pe=B.forwardRef(function(e,t){let{className:n,disabled:r=!1,onOpenChange:i,render:a,value:o,style:s,...c}=e,{ref:u,index:f}=F(),{disabled:p,handleValueChange:m,state:h,value:g}=H(),_=L(),v=o??_,y=r||p,b=g.includes(v),x=l((e,t)=>{i?.(e,t),!t.isCanceled&&m(v,e,t)}),S=re({open:b,onOpenChange:x,disabled:y}),C=B.useMemo(()=>({...S,onOpenChange:x,state:{open:S.open,disabled:S.disabled,transitionStatus:S.transitionStatus}}),[S,x]),w=B.useMemo(()=>({...h,hidden:!b&&!S.mounted,index:f,disabled:y,open:b}),[S.mounted,y,f,b,h]),T=L(),[E,D]=B.useState(),O=E===null?void 0:E??T,k=B.useMemo(()=>({defaultTriggerId:T,open:b,state:w,setTriggerId:D,triggerId:O}),[T,b,w,D,O]),A=d(`div`,e,{state:w,ref:[t,u],props:c,stateAttributesMapping:Y});return(0,U.jsx)(ie.Provider,{value:C,children:(0,U.jsx)(K.Provider,{value:k,children:A})})}),me=B.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{state:o}=q();return d(`h3`,e,{state:o,ref:t,props:a,stateAttributesMapping:Y})}),he={...Y,...ue},ge=B.forwardRef(function(e,t){let{disabled:n,className:r,id:i,render:a,nativeButton:o=!0,style:s,...c}=e,{panelId:l,open:u,handleTrigger:p,disabled:m}=G(),{getButtonProps:h,buttonRef:g}=f({disabled:n||m,native:o}),{defaultTriggerId:v,state:y,setTriggerId:b}=q(),x=i||void 0,S=x??v;return _(()=>(b(e=>x??(e===null?void 0:e)),()=>{b(e=>e===x?null:e)}),[x,b]),d(`button`,e,{state:y,ref:[t,g],props:[{"aria-controls":u?l:void 0,"aria-expanded":u,id:S,onClick:p},c,h],stateAttributesMapping:he})}),X={height:void 0,width:void 0};function _e(e){let{externalRef:t,hiddenUntilFound:n,id:r,keepMounted:i,mounted:a,onOpenChange:o,open:s,setMounted:c,setOpen:u,transitionStatus:d}=e,f=B.useRef(null),p=B.useRef(null),[h,g]=B.useState(X),v=B.useRef(X),y=B.useRef(!1),b=B.useRef(s),x=B.useRef(!1),[S,E]=B.useState(!1),D=B.useRef(null),k=m(t,f),A=w(s),j=te(f),M=!s&&!a,P=S?`idle`:d,F=s&&(b.current||x.current),I=!s&&a&&p.current===`css-animation`&&h.height===void 0&&h.width===void 0?v.current:h,L=n&&M&&p.current!==`css-animation`,R=l((e,t=!0)=>{t&&(v.current=e),g(e)}),V=l(()=>{D.current?.(),D.current=null}),H=l(e=>{V(),D.current=()=>{D.current=null,e()}}),U=l(()=>{s&&a&&p.current===`css-animation`&&(x.current=!0)});_(()=>{S&&d!==`starting`&&E(!1)},[S,d]),B.useEffect(()=>()=>{U(),V()},[U,V]),_(()=>{s||(b.current=!1,x.current=!1);let e=f.current;if(!e)return;!s&&D.current&&V();let t=ve(e,F);if(p.current=t,s&&d===`idle`&&b.current&&t===`css-animation`){v.current=Z(e);return}if(s&&d===`starting`){let n=y.current;if(y.current=!1,t===`none`){R(Z(e)),E(!0);return}if(t===`css-transition`){let t=be(e);if(R(Z(e)),!n)return t;let r=Q(e,`transition-duration`,`0s`);return H(r),E(!0),t}R(Z(e));let r=Q(e,`animation-name`,`none`);if(!n){r();return}let i=Q(e,`animation-duration`,`0s`);r(),H(i),E(!0);return}if(!s&&a&&(d===`idle`||d===`starting`)){if(t===`none`){R(X,!1),c(!1);return}R(Z(e));return}if(d!==`ending`)return;if(t===`none`){c(!1);return}let n=Z(e);n.height>0||n.width>0?(R(n),t===`css-animation`&&Q(e,`animation-name`,`none`)()):c(!1)},[a,s,V,R,c,H,F,d]),C({enabled:s&&a&&P===`idle`,open:!0,ref:f,onComplete(){s&&R(X,!1)}}),B.useEffect(()=>{if(s||!a||P!==`ending`)return;if(!f.current){c(!1),R(X,!1);return}let e=new AbortController,t=-1;function n(){A.current||(c(!1),R(X,!1))}return t=z.request(()=>{j(n,e.signal)}),()=>{z.cancel(t),e.abort()}},[A,a,s,P,j,R,c]),_(()=>{let e=f.current;e&&n&&M&&e.setAttribute(`hidden`,`until-found`)},[M,n]),B.useEffect(function(){let e=f.current;if(!e)return;let t=T.create(),n=-1,r=(r,i)=>{t.start(0,()=>{A.current||(n=z.request(()=>{A.current||(r&&(y.current=!1),i&&e.setAttribute(J,``),e.setAttribute(`hidden`,`until-found`))}))})},i=ee(e,`beforematch`,t=>{let n=O(N,t);if(o(!0,n),n.isCanceled){r(!1,!1);return}y.current=!0;let i=e.hasAttribute(J);e.removeAttribute(J),u(!0),r(!0,i)});return()=>{t.clear(),z.cancel(n),i()}},[A,o,u]);let W=i||n||a||s;return{height:I.height,props:{...L?{[J]:``}:void 0,hidden:M,id:r},ref:k,shouldPreventOpenAnimation:F,shouldRender:W,transitionStatus:P,width:I.width}}function Z(e){return{height:e.scrollHeight,width:e.scrollWidth}}function ve(e,t){let n=c(e).getComputedStyle(e),r=(n.animationName.split(`,`).map(e=>e.trim()).some(e=>e!==``&&e!==`none`)||t)&&ye(n.animationDuration),i=ye(n.transitionDuration);return r&&i||i?`css-transition`:r?`css-animation`:`none`}function ye(e){return e.split(`,`).map(e=>e.trim()).some(e=>e!==``&&Number.parseFloat(e)>0)}function Q(e,t,n){let r=e.style.getPropertyValue(t),i=e.style.getPropertyPriority(t);return e.style.setProperty(t,n),()=>{r===``?e.style.removeProperty(t):e.style.setProperty(t,r,i)}}function be(e){let t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(t=>{e.style.setProperty(t,`initial`,`important`)});function n(){Object.entries(t).forEach(([t,n])=>{n===``?e.style.removeProperty(t):e.style.setProperty(t,n)})}let r=z.request(n);return()=>{z.cancel(r),n()}}var xe=`--accordion-panel-height`,Se=`--accordion-panel-width`,Ce=B.forwardRef(function(e,t){let{className:n,hiddenUntilFound:r,keepMounted:i,id:a,render:o,style:s,...c}=e,{hiddenUntilFound:l,keepMounted:u}=H(),{defaultPanelId:f,mounted:m,onOpenChange:h,open:g,setMounted:v,setOpen:y,setPanelIdState:b,transitionStatus:x}=G(),S=r??l,C=i??u,w=a||void 0,T=a??f;_(()=>(b(e=>w??(e===null?void 0:e)),()=>{b(e=>e===w?null:e)}),[w,b]);let{height:E,props:D,ref:O,shouldPreventOpenAnimation:k,shouldRender:A,transitionStatus:j,width:M}=_e({externalRef:t,hiddenUntilFound:S,id:T,keepMounted:C,mounted:m,onOpenChange:h,open:g,setMounted:v,setOpen:y,transitionStatus:x}),{state:ee,triggerId:N}=q(),P={...ee,transitionStatus:j},F=p(s,P),I=d(`div`,{...e,style:void 0},{state:P,ref:O,props:[D,{"aria-labelledby":N,role:`region`,style:{[xe]:E===void 0?`auto`:`${E}px`,[Se]:M===void 0?`auto`:`${M}px`}},c,F?{style:F}:void 0,k?{style:{animationName:`none`}}:void 0],stateAttributesMapping:Y});return A?I:null});function we({className:e,...t}){return(0,U.jsx)(ne,{"data-slot":`accordion`,className:h(`flex w-full flex-col`,e),...t})}function Te({className:e,...t}){return(0,U.jsx)(pe,{"data-slot":`accordion-item`,className:h(`not-last:border-b`,e),...t})}function Ee({className:e,children:t,...n}){return(0,U.jsx)(me,{className:`flex`,children:(0,U.jsxs)(ge,{"data-slot":`accordion-trigger`,className:h(`group/accordion-trigger relative flex flex-1 items-start justify-between rounded-lg border border-transparent py-2.5 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:after:border-ring aria-disabled:pointer-events-none aria-disabled:opacity-50 **:data-[slot=accordion-trigger-icon]:ml-auto **:data-[slot=accordion-trigger-icon]:size-4 **:data-[slot=accordion-trigger-icon]:text-muted-foreground`,e),...n,children:[t,(0,U.jsx)(x,{"aria-hidden":`true`,"data-slot":`accordion-trigger-icon`,className:`pointer-events-none shrink-0 group-aria-expanded/accordion-trigger:hidden`}),(0,U.jsx)(S,{"aria-hidden":`true`,"data-slot":`accordion-trigger-icon`,className:`pointer-events-none hidden shrink-0 group-aria-expanded/accordion-trigger:inline`})]})})}function De({className:e,children:t,...n}){return(0,U.jsx)(Ce,{"data-slot":`accordion-content`,className:`overflow-hidden text-sm data-open:animate-accordion-down data-closed:animate-accordion-up`,...n,children:(0,U.jsx)(`div`,{className:h(`h-(--accordion-panel-height) pt-0 pb-2.5 data-ending-style:h-0 data-starting-style:h-0 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4`,e),children:t})})}function Oe({className:e,size:t=`default`,...n}){return(0,U.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:h(`group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl`,e),...n})}function ke({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`card-header`,className:h(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)`,e),...t})}function Ae({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`card-title`,className:h(`font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm`,e),...t})}function je({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`card-description`,className:h(`text-sm text-muted-foreground`,e),...t})}function Me({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`card-action`,className:h(`col-start-2 row-span-2 row-start-1 self-start justify-self-end`,e),...t})}var $={game:{title:`Game`,description:`Visuals, sound, performance, tools, and rules`},dialog:{title:`Dialog`,description:`Appearance, visible tabs, and visitor settings access`}};function Ne({value:e,onChange:o}){let[s,c]=(0,B.useState)(),l=n(r(a,e)),d=(t,n,r)=>o({...e,[t]:{...e[t],[n]:r}});return(0,U.jsxs)(`section`,{"aria-label":`Embed options`,className:`space-y-3 py-2 text-xs`,ref:e=>{let t=e?.getRootNode();t instanceof ShadowRoot&&t!==s&&c(t)},children:[(0,U.jsx)(Oe,{size:`sm`,className:`gap-0 bg-muted/30`,children:(0,U.jsxs)(ke,{className:`grid-cols-[minmax(0,1fr)_auto] items-center gap-x-3`,children:[(0,U.jsx)(Ae,{children:`Configure your embed`}),(0,U.jsx)(je,{children:`Choose the experience and what visitors can change.`}),(0,U.jsx)(Me,{children:(0,U.jsx)(u,{variant:`outline`,size:`sm`,onClick:()=>{let t={...e};for(let e of Object.keys(i))Object.assign(t,{[e]:{...t[e],...i[e]}});o(t)},children:`Use SFW defaults`})})]})}),(0,U.jsx)(we,{defaultValue:[],className:`gap-2`,children:Object.keys($).map(e=>(0,U.jsxs)(Te,{value:e,className:`rounded-lg border bg-card/40 px-3`,children:[(0,U.jsx)(Ee,{className:`py-3 hover:no-underline`,children:(0,U.jsxs)(`span`,{className:`grid gap-1`,children:[(0,U.jsx)(`span`,{children:$[e].title}),(0,U.jsx)(`span`,{className:`text-[11px] font-normal text-muted-foreground`,children:$[e].description})]})}),(0,U.jsx)(De,{children:(0,U.jsx)(`div`,{className:`divide-y border-t`,children:t.filter(t=>t.category===e).map(e=>{let t=`embed-${e.category}-${e.key}`,n=l[e.category][e.key],r=[`hint`,`tabs`].includes(e.control);return(0,U.jsxs)(`div`,{className:r?`grid gap-3 py-3`:`flex items-center justify-between gap-4 py-3`,children:[(0,U.jsxs)(`label`,{htmlFor:t,className:`grid min-w-0 gap-1 font-medium`,children:[(0,U.jsx)(`span`,{children:e.label}),e.help&&(0,U.jsx)(`span`,{className:`max-w-72 font-normal text-muted-foreground`,children:e.help})]}),(0,U.jsx)(k,{id:t,entry:e,value:n,container:s,onChange:t=>d(e.category,e.key,t)})]},e.key)})})})]},e))})]})}function Pe({embed:e}){let[t,n]=(0,B.useState)(`html`),r={html:{code:e.html,language:`html`,title:`HTML embed`},async:{code:e.async,language:`javascript`,title:`CDN`},npm:{code:e.npm,language:`javascript`,title:`JavaScript`},react:{code:e.react??``,language:`tsx`,title:`React`},bookmarklet:{code:e.bookmarklet,language:`javascript`,title:`Bookmarklet URL`}}[t];return(0,U.jsxs)(`section`,{className:`min-h-full px-3 py-2.5 text-sm`,children:[e.error?(0,U.jsx)(`p`,{role:`alert`,children:e.error}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(I,{value:t,onValueChange:e=>n(e),className:`my-2.5 gap-0`,children:(0,U.jsxs)(M,{className:`w-full`,"aria-label":`Embed format`,children:[(0,U.jsx)(P,{value:`html`,className:`text-sm`,children:`HTML`}),(0,U.jsx)(P,{value:`async`,className:`text-sm`,children:`CDN`}),(0,U.jsx)(P,{value:`npm`,className:`text-sm`,children:`JavaScript`}),(0,U.jsx)(P,{value:`react`,className:`text-sm`,disabled:!e.react,children:`React`}),(0,U.jsx)(P,{value:`bookmarklet`,className:`text-sm`,children:`Bookmarklet`})]})}),(t===`npm`||t===`react`)&&(0,U.jsx)(`div`,{className:`mb-3`,children:(0,U.jsx)(y,{code:`npm install @joy-ride/game`,language:`shell`,title:`Install the package`,compact:!0})}),(0,U.jsx)(y,{code:r.code,language:r.language,title:r.title,compact:!0,maxHeight:210,wrap:t===`html`||t===`bookmarklet`})]}),e.configuration&&e.onConfigure&&(0,U.jsx)(Ne,{value:e.configuration,onChange:e.onConfigure})]})}export{Pe as EmbedPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,r as n}from"./controls~index~embed-B_C92tUz.js";import{d as r}from"./runtime~index~embed-B2Zpd22X.js";import{i,r as a,t as o}from"./react-vendor~index~embed-BNCMh3YF.js";import{n as s}from"./runtime~JoyRideView~browser-session-core-Ya-yv4PC.js";import{i as c,o as l}from"./src-BJXg-amK.js";import{a as u,i as d,n as f,r as p,t as m}from"./X.es-d7B7rOGv.js";var h=e(a(),1),g=e(i(),1),_=o(),v={steer:0,gas:!1,brake:!1,boost:!1,handbrake:!1,attractor:!1},y={position:`fixed`,bottom:`calc(var(--joy-ride-controls-bottom, 0px) + max(18px, env(safe-area-inset-bottom)))`,zIndex:n(`controls`),touchAction:`none`,userSelect:`none`,WebkitUserSelect:`none`,color:`#f4f4f0`,fontFamily:`Arial, sans-serif`},b={border:`1px solid rgba(255,255,255,.38)`,background:`rgba(24,26,29,.84)`,color:`inherit`,boxShadow:`0 4px 16px #0005`,touchAction:`none`,cursor:`pointer`};function x({onChange:e}){let[n,r]=(0,g.useState)(!1),[i,a]=(0,g.useState)(v),o=(0,g.useRef)(v),s=(0,g.useRef)(null),c=(0,g.useRef)(e);c.current=e,(0,g.useEffect)(()=>{let e=window.matchMedia(`(pointer: coarse) and (max-width: 850px)`),t=()=>r(e.matches);return t(),e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]);let l=e=>{let n={...o.current,...e};o.current=n,a(n),c.current({...t(n.gas,n.brake),steer:n.steer,action:n.handbrake,boost:n.boost,attractor:n.attractor})};if((0,g.useEffect)(()=>{let e=()=>{s.current=null,o.current=v,a(v),c.current({throttle:0,steer:0,action:!1,boost:!1})};return window.addEventListener(`blur`,e),()=>{window.removeEventListener(`blur`,e),e()}},[]),!n)return null;let d=e=>{let t=e.currentTarget.getBoundingClientRect(),n=t.width/2;l({steer:Math.max(-1,Math.min(1,(n-(e.clientX-t.left))/(n*.72)))})},f=(e,t,n,r)=>(0,_.jsx)(u,{type:`button`,"aria-label":t,"aria-pressed":i[e],onPointerDown:t=>{t.preventDefault(),t.currentTarget.setPointerCapture(t.pointerId),l({[e]:!0})},onPointerUp:t=>{t.preventDefault(),l({[e]:!1})},onPointerCancel:()=>l({[e]:!1}),onLostPointerCapture:()=>l({[e]:!1}),style:{...b,gridArea:r,width:e===`attractor`?`100%`:62,height:e===`attractor`?44:62,borderRadius:16,background:i[e]?`rgba(90,94,98,.96)`:b.background,display:`grid`,placeItems:`center`,lineHeight:1,fontSize:10,fontWeight:700,letterSpacing:`.08em`,textTransform:`uppercase`},children:(0,_.jsxs)(`span`,{style:{display:`grid`,gap:3,justifyItems:`center`},children:[(0,_.jsx)(`span`,{"aria-hidden":`true`,style:{fontSize:20,lineHeight:1},children:n}),t]})});return(0,_.jsxs)(`div`,{"data-jr-touch-controls":``,"aria-label":`Touch driving controls`,children:[(0,_.jsx)(`div`,{style:{...y,left:`max(16px, env(safe-area-inset-left))`},children:(0,_.jsxs)(`div`,{role:`slider`,"aria-label":`Steering`,"aria-valuemin":-100,"aria-valuemax":100,"aria-valuenow":Math.round(-i.steer*100),tabIndex:0,onKeyDown:e=>{e.key===`ArrowLeft`&&(e.preventDefault(),l({steer:1})),e.key===`ArrowRight`&&(e.preventDefault(),l({steer:-1}))},onKeyUp:e=>{(e.key===`ArrowLeft`||e.key===`ArrowRight`)&&l({steer:0})},onPointerDown:e=>{e.preventDefault(),s.current=e.pointerId,e.currentTarget.setPointerCapture(e.pointerId),d(e)},onPointerMove:e=>{s.current===e.pointerId&&d(e)},onPointerUp:e=>{s.current===e.pointerId&&(s.current=null,l({steer:0}))},onPointerCancel:()=>{s.current=null,l({steer:0})},style:{...b,width:116,height:116,borderRadius:`50%`,position:`relative`,display:`grid`,placeItems:`center`},children:[(0,_.jsx)(`span`,{"aria-hidden":`true`,style:{position:`absolute`,top:14,fontSize:10,fontWeight:700,letterSpacing:`.1em`,opacity:.8},children:`STEER`}),(0,_.jsx)(`span`,{"aria-hidden":`true`,style:{width:48,height:48,borderRadius:`50%`,background:`#d1d3d2`,boxShadow:`0 2px 8px #0008`,transform:`translateX(${-i.steer*27}px)`,pointerEvents:`none`}})]})}),(0,_.jsxs)(`div`,{style:{...y,right:`max(16px, env(safe-area-inset-right))`,display:`grid`,gridTemplateAreas:`"attractor attractor" "boost gas" "handbrake brake"`,gap:8},children:[f(`attractor`,`Attract`,`◎`,`attractor`),f(`boost`,`Boost`,(0,_.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,children:(0,_.jsx)(`path`,{d:`M13.7 2 5 13h6l-.7 9L19 10h-6l.7-8Z`})}),`boost`),f(`gas`,`Gas`,`↑`,`gas`),f(`handbrake`,`Drift`,`↺`,`handbrake`),f(`brake`,`Brake`,`↓`,`brake`)]})]})}var S=new Map([[`bold`,g.createElement(g.Fragment,null,g.createElement(`path`,{d:`M108,84a16,16,0,1,1,16,16A16,16,0,0,1,108,84Zm128,44A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Zm-72,36.68V132a20,20,0,0,0-20-20,12,12,0,0,0-4,23.32V168a20,20,0,0,0,20,20,12,12,0,0,0,4-23.32Z`}))],[`duotone`,g.createElement(g.Fragment,null,g.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),g.createElement(`path`,{d:`M144,176a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176Zm88-48A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128ZM124,96a12,12,0,1,0-12-12A12,12,0,0,0,124,96Z`}))],[`fill`,g.createElement(g.Fragment,null,g.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-4,48a12,12,0,1,1-12,12A12,12,0,0,1,124,72Zm12,112a16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40a8,8,0,0,1,0,16Z`}))],[`light`,g.createElement(g.Fragment,null,g.createElement(`path`,{d:`M142,176a6,6,0,0,1-6,6,14,14,0,0,1-14-14V128a2,2,0,0,0-2-2,6,6,0,0,1,0-12,14,14,0,0,1,14,14v40a2,2,0,0,0,2,2A6,6,0,0,1,142,176ZM124,94a10,10,0,1,0-10-10A10,10,0,0,0,124,94Zm106,34A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z`}))],[`regular`,g.createElement(g.Fragment,null,g.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z`}))],[`thin`,g.createElement(g.Fragment,null,g.createElement(`path`,{d:`M140,176a4,4,0,0,1-4,4,12,12,0,0,1-12-12V128a4,4,0,0,0-4-4,4,4,0,0,1,0-8,12,12,0,0,1,12,12v40a4,4,0,0,0,4,4A4,4,0,0,1,140,176ZM124,92a8,8,0,1,0-8-8A8,8,0,0,0,124,92Zm104,36A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z`}))]]),C=g.forwardRef((e,t)=>g.createElement(d,{ref:t,...e,weights:S}));C.displayName=`InfoIcon`;var w=(0,g.forwardRef)(function({visible:e=!0,className:t=``,children:n,...r},i){return(0,_.jsx)(`div`,{ref:i,role:`toolbar`,"data-jr-toolbar":``,"data-visible":e,className:`inline-flex items-center gap-0.5 transition-opacity duration-150 ease-out data-[visible=false]:pointer-events-none data-[visible=false]:opacity-0 ${t}`,...r,children:n})});function T({iconOnly:e=!1,className:t=``,children:n,...r}){return(0,_.jsx)(u,{type:`button`,variant:`ghost`,size:e?`icon-xs`:`xs`,className:`h-[25px] min-h-[25px] rounded-sm border-0 bg-[#202326] px-2 text-[10px] font-semibold text-white shadow-[0_3px_10px_#0004] hover:bg-[#34383b] hover:text-white focus-visible:ring-white/40 [&_svg]:size-[13px] ${e?`w-[25px] p-0`:``} ${t}`,...r,children:n})}var E=l(c);function D(e,t){let i=(0,g.useRef)(e);i.current=e;let a=(0,g.useRef)(null),[o,s]=(0,g.useState)(null),c=!!e.onExit,l=!!e.overlay&&(c||!!e.onToggleMute||!!e.onControlsHelp);(0,g.useEffect)(()=>{if(!l)return;let e=document.createElement(`joy-ride-vehicle-toolbar`);e.dataset.jrUi=``,e.style.cssText=`position:fixed;left:0;top:0;z-index:${n(`controls`)};pointer-events:none`;let t=e.attachShadow({mode:`open`}),r=document.createElement(`style`);return r.textContent=E,t.append(r),document.body.append(e),s(t),()=>{e.remove(),s(null)}},[l]);let u=e=>r(e=>{let n=t.current?.handle.getPlayground()?.registry;n?n.report(e):console.error(`JoyRide host callback failed`,e)},e);return{adapter:(0,g.useMemo)(()=>({toolbar:()=>a.current,cameraFrame(){let e=Array.from(document.querySelectorAll(`[data-jr-touch-controls] > div`)),t=e.length?Math.min(...e.map(e=>e.getBoundingClientRect().top))-16:window.innerHeight;return e.length?{x:0,y:0,width:window.innerWidth,height:Math.max(160,t)}:null}}),[]),toolbar:e.overlay&&o&&(c||e.onToggleMute||e.onControlsHelp)?(0,h.createPortal)((0,_.jsxs)(w,{ref:a,"data-jr-ui":``,"aria-label":`Vehicle controls`,visible:!1,inert:!0,className:`fixed pointer-events-auto`,style:{zIndex:n(`controls`)},children:[e.onToggleMute&&(0,_.jsx)(T,{iconOnly:!0,"aria-label":(e.masterVolume??1)>0?`Mute audio`:`Unmute audio`,onClick:()=>u(i.current.onToggleMute),children:(e.masterVolume??1)>0?(0,_.jsx)(p,{size:14}):(0,_.jsx)(f,{size:14})}),e.onControlsHelp&&(0,_.jsx)(T,{iconOnly:!0,"aria-label":`Open controls help`,title:`Controls help`,onClick:()=>u(i.current.onControlsHelp),children:(0,_.jsx)(C,{size:14})}),c&&(0,_.jsx)(T,{iconOnly:!0,"aria-label":`Quit simulation`,onClick:()=>u(i.current.onExit),children:(0,_.jsx)(m,{size:14})})]}),o):null}}function O({ref:e,overlayRoot:t,className:n,style:r,onControlsHelp:i,...a}){return a}var k=e=>t=>{let r=t,i=O(t),{ref:a,overlay:o=s.overlay,overlayRoot:c,className:l,style:u,mode:d,initialMode:f=s.initialMode,paused:p=s.paused,showTouchControls:m=s.showTouchControls}=r,v=(0,g.useRef)(null),y=(0,g.useRef)(null),b=(0,g.useRef)(i);b.current=i;let S=D(r,y);(0,g.useLayoutEffect)(()=>{if(!v.current)return;let t=e(v.current,b.current,S.adapter);return y.current=t,()=>{t.dispose(),y.current=null}},[S.adapter]),(0,g.useImperativeHandle)(a,()=>y.current.handle,[]),(0,g.useLayoutEffect)(()=>{y.current?.update(i)});let C=(0,_.jsx)(`canvas`,{ref:v,className:l,style:{display:`block`,width:o?void 0:`100%`,height:o?void 0:`100%`,outline:`none`,touchAction:`none`,...u,...o?{position:`absolute`,zIndex:n(`world`),pointerEvents:`none`}:{}},"data-jr-overlay":o?``:void 0,tabIndex:o?-1:0,"aria-label":`Joy Ride vehicle simulation`});return o&&typeof document<`u`?(0,_.jsxs)(_.Fragment,{children:[(0,h.createPortal)((0,_.jsxs)(_.Fragment,{children:[C,m&&!p&&(d??f)===`car`&&(0,_.jsx)(x,{onChange:e=>y.current?.touchChange(e)})]}),c??document.body),S.toolbar]}):C};export{k as createJoyRide};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-vendor~index~embed-BNCMh3YF.js";var r=e(t(),1);function i(){return typeof window<`u`}function a(e){return c(e)?(e.nodeName||``).toLowerCase():`#document`}function o(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function s(e){return((c(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function c(e){return i()?e instanceof Node||e instanceof o(e).Node:!1}function l(e){return i()?e instanceof Element||e instanceof o(e).Element:!1}function u(e){return i()?e instanceof HTMLElement||e instanceof o(e).HTMLElement:!1}function d(e){return!i()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof o(e).ShadowRoot}function f(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=S(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function p(e){return/^(table|td|th)$/.test(a(e))}function m(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var h=/transform|translate|scale|rotate|perspective|filter/,g=/paint|layout|strict|content/,_=e=>!!e&&e!==`none`,v;function y(e){let t=l(e)?S(e):e;return _(t.transform)||_(t.translate)||_(t.scale)||_(t.rotate)||_(t.perspective)||!ee()&&(_(t.backdropFilter)||_(t.filter))||h.test(t.willChange||``)||g.test(t.contain||``)}function b(e){let t=ne(e);for(;u(t)&&!x(t);){if(y(t))return t;if(m(t))return null;t=ne(t)}return null}function ee(){return v??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),v}function x(e){return/^(html|body|#document)$/.test(a(e))}function S(e){return o(e).getComputedStyle(e)}function te(e){return l(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ne(e){if(a(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||d(e)&&e.host||s(e);return d(t)?t.host:t}function C(e){let t=ne(e);return x(t)?(e.ownerDocument||e).body:u(t)&&f(t)?t:C(t)}function w(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=C(e),i=r===e.ownerDocument?.body,a=o(r);if(i){let e=T(a);return t.concat(a,a.visualViewport||[],f(r)?r:[],e&&n?w(e):[])}return t.concat(r,w(r,[],n))}function T(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var E={...r},D={};function re(e,t){let n=r.useRef(D);return n.current===D&&(n.current=e(t)),n}var ie=E.useInsertionEffect,ae=ie&&ie!==E.useLayoutEffect?ie:e=>e();function O(e){let t=re(k).current;return t.next=e,ae(t.effect),t.trampoline}function k(){let e={next:void 0,callback:A,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function A(){}var oe=typeof document<`u`?r.useLayoutEffect:()=>{};function j(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}var M={};function N(e,t,n,r,i){if(!n&&!r&&!i&&!e)return ce(t);let a=ce(e);return t&&(a=P(a,t)),n&&(a=P(a,n)),r&&(a=P(a,r)),i&&(a=P(a,i)),a}function se(e){if(e.length===0)return M;if(e.length===1)return ce(e[0]);let t=ce(e[0]);for(let n=1;n<e.length;n+=1)t=P(t,e[n]);return t}function ce(e){return de(e)?{...e(M)}:F(e)}function P(e,t){return de(t)?t(e):le(e,t)}function F(e){let t={...e};for(let e in t){let n=t[e];ue(e,n)&&(t[e]=fe(n))}return t}function le(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=j(e.style,r);break;case`className`:e[n]=L(e.className,r);break;default:e[n]=ue(n,r)?I(e[n],r):r}}return e}function ue(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function de(e){return typeof e==`function`}function I(e,t){return t?e?(...n)=>{let r=n[0];if(me(r)){let i=r;pe(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:fe(t):e}function fe(e){return e&&((...t)=>{let n=t[0];return me(n)&&pe(n),e(...t)})}function pe(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function L(e,t){return t?e?t+` `+e:t:e}function me(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function he(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var ge=he(`https://base-ui.com/production-error`,`Base UI`),_e=r.createContext(void 0);function ve(e=!1){let t=r.useContext(_e);if(t===void 0&&!e)throw Error(ge(16));return t}function ye(e){let{focusableWhenDisabled:t,disabled:n,composite:i=!1,tabIndex:a=0,isNativeButton:o}=e,s=i&&t!==!1,c=i&&t===!1;return{props:r.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return i||(e.tabIndex=a,!o&&n&&(e.tabIndex=t?a:-1)),(o&&(t||s)||!o&&n)&&(e[`aria-disabled`]=n),o&&(!t||c)&&(e.disabled=n),e},[i,n,t,s,c,o,a])}}function be(e,t,{detail:n=0,pointerType:r=``}={}){e.dispatchEvent(new(o(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,pointerType:r,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function xe(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:i=0,native:a=!0,composite:o}=e,s=r.useRef(null),c=ve(!0),l=o??c!==void 0,{props:u}=ye({focusableWhenDisabled:n,disabled:t,composite:l,tabIndex:i,isNativeButton:a}),d=r.useCallback(()=>{let e=s.current;Se(e)&&l&&t&&u.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,u.disabled,l]);return oe(d,[d]),{getButtonProps:r.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:i,onKeyDown:o,onPointerDown:s,...c}=e;return N({onClick(e){t?e.preventDefault():n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(pe(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,i=Se(r),s=!a&&Ce(r),c=n&&(a?i:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&l&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!a||i)&&(e.preventBaseUIHandler(),be(r,e))}else!c||a||!d&&!u?n&&s&&d&&e.preventDefault():e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),be(r,e)))},onKeyUp(e){t||(pe(e),i?.(e),e.target===e.currentTarget&&a&&l&&Se(e.currentTarget)&&e.key===` `?e.preventDefault():e.baseUIHandlerPrevented||e.target!==e.currentTarget||a||l||e.defaultPrevented||e.key!==` `||(e.preventBaseUIHandler(),be(e.currentTarget,e)))},onPointerDown(e){t?e.preventDefault():s?.(e)}},a?{type:`button`}:{role:`button`},u,c)},[t,u,l,a]),buttonRef:O(e=>{s.current=e,d()})}}function Se(e){return u(e)&&e.tagName===`BUTTON`}function Ce(e){return u(e)&&e.tagName===`A`&&!!e.href}function we(e,t,n,r){let i=re(Ee).current;return De(i,e,t,n,r)&&ke(i,[e,t,n,r]),i.callback}function Te(e){let t=re(Ee).current;return Oe(t,e)&&ke(t,e),t.callback}function Ee(){return{callback:null,cleanup:null,refs:[]}}function De(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function Oe(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function ke(e,t){e.refs=t,e.callback=t.every(e=>e==null)?null:n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}var Ae=19;function je(e){return Ae>=e}function Me(e){if(!r.isValidElement(e))return null;let t=e,n=t.props;return(je(19)?n?.ref:t.ref)??null}function Ne(){}var Pe=Object.freeze([]),R=Object.freeze({});function Fe(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e)}else i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function Ie(e,t){return typeof e==`function`?e(t):e}function Le(e,t){return typeof e==`function`?e(t):e}function Re(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=Ve(r));let i=ze(t,n,r);if(n.enabled===!1)return null;let a=n.state??R;return He(e,r,i,a)}function ze(e,t,n){let{className:r,style:i}=e,{state:a=R,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?Ie(r,a):void 0,d=l?Le(i,a):void 0,f=l?Fe(a,c):R,p=l&&s?z(s):void 0,m=l?j(f,p)??{}:R;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?Te([m.ref,Me(n),...o]):we(m.ref,Me(n),o):we(null,null)),l?(u!==void 0&&(m.className=L(m.className,u)),d!==void 0&&(m.style=j(m.style,d)),m):R}function z(e){return Array.isArray(e)?se(e):N(void 0,e)}var Be=Symbol.for(`react.lazy`);function Ve(e){if(e?.$$typeof!==Be)return e;let t=r.Children.toArray(e)[0];return r.isValidElement(t)?t:e}function He(e,t,n,i){if(t){if(typeof t==`function`)return t(n,i);let e=N(n,t.props);return e.ref=n.ref,r.cloneElement(t,e)}return Ue(e,n)}function Ue(e,t){return e===`button`?(0,r.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,r.createElement)(`img`,{alt:``,...t,key:t.key}):r.createElement(e,t)}var We=r.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{getButtonProps:l,buttonRef:u}=xe({disabled:i,focusableWhenDisabled:a,native:o});return Re(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})});function Ge(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Ge(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function B(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Ge(e))&&(r&&(r+=` `),r+=t);return r}var Ke=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,V=B,H=(e,t)=>n=>{if(t?.variants==null)return V(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Ke(t)||Ke(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return V(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},qe=48,U=(e,t=0)=>{let n=new Int32Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r)-qe-t;return n},W=e=>{let t=new Int32Array(e.length+1);for(let n=0;n<e.length;n++)t[n+1]=t[n]+e[n];return t},G=e=>{let t=new Int32Array(e.length),n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r)-qe;n+=i>>>1^-(i&1),t[r]=n}return t},Je=384,Ye=[],K=W(U(`E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010`)),Xe=W(U(`:11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3`)),Ze=`@containerabcdefghinlmoprstunderlineviawzccentlignnimatespectuto-colsrowsaglorightnessckdrop-sisbcontrastfiltergrayscalehue-rotateinvertopacityslurrightnessaturateepia-coniclinearpositionradialsizeockurrderttom-belrstxyespacing-xyaretoursorlnt-umnsendspantartainentrasteividerop-shadowurationcorationlay-xyasendillexontromlter-featuresstretchapr-xyayscaleidow-colsrowsue-rotatedentlinesetvert-beringsxyeshadoweiadingftnest-clamp-imageabein-lrstxyskx--b-coniclpositionrsizet-x-y-fromto-fromto-inearfromto-fromto-adialfromto-fromtofromtofromtofromtoblockhinlinew-screenesblockhinlinewbjectpacityrutlinederigin-offsetbelrstxyesrspective-originaceholderioghtng-offsettateundedw-xyz-belrstlreseslr-endspantartaturatecepiahizekewpace-taleroll-xyz-barmpbelrstxyesbelrstxyes-thumbrackadowrink-xyxyartrokeabextora-shadowpckingnsformitionlate-xyz-offsetill-changeoom`,q=(()=>{let e=K.length-1,t=new Int32Array(e);for(let n=e-1;n>=0;n--){let e=1,r=n+1;for(let i=K[n];i<K[n+1];i++)e+=t[r],r+=t[r];t[n]=e}let n=new Int32Array(K[e]),r=0;for(let i=0;i<e;i++){let e=i+1;for(let a=K[i];a<K[i+1];a++)n[r++]=e,e+=t[e]}return n})(),Qe=U(`02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000
ŏ0000000ŏ00000000000000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000`,1),$e=W(U(`123333359346463635126536711576`)),et=U(`93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032`),J=U(`012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199`),tt=G(`020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200`),nt=(()=>{let e=new Int32Array(319).fill(-1),t=G(`02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222`),n=G(`02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222`);for(let r=0;r<t.length;r++)e[t[r]]=n[r];return e})(),rt=`container |break-after- all auto avoid avoid-page column left page right|break-before- all auto avoid avoid-page column left page right|break-inside-a uto void void-column void-page|box-decoration- clone slice|box- border content| contents flow-root hidden table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group| not-sr-only sr-only|float- end left none right start|clear- both end left none right start|isolat e ion-auto|overflow- auto clip hidden scroll visible|overflow-x- auto clip hidden scroll visible|overflow-y- auto clip hidden scroll visible|overscroll- auto contain none|overscroll-x- auto contain none|overscroll-y- auto contain none| absolute fixed relative static sticky| collapse invisible visible|justify- around baseline between center center-safe end end-safe evenly normal start stretch|justify-items- center center-safe end end-safe normal start stretch|justify-self- auto center center-safe end end-safe start stretch|items- baseline baseline-last center center-safe end end-safe start stretch|self- auto baseline baseline-last center center-safe end end-safe start stretch|place-content- around baseline between center center-safe end end-safe evenly start stretch|place-items- baseline center center-safe end end-safe start stretch|place-self- auto center center-safe end end-safe start stretch| antialiased subpixel-antialiased| italic not-italic|normal-nums |ordinal |slashed-zero | lining-nums oldstyle-nums| proportional-nums tabular-nums| diagonal-fractions stacked-fractions| no-underline overline| capitalize lowercase normal-case uppercase|truncate |whitespace- break-spaces normal nowrap pre pre-line pre-wrap|break- all keep normal words|wrap- anywhere break-word normal|hyphens- auto manual none|mix-blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay plus-darker plus-lighter saturation screen soft-light|table- auto fixed|caption- bottom top|backface- hidden visible|appearance- auto none|scheme- dark light light-dark normal only-dark only-light|field-sizing- content fixed|pointer-events- auto none|resize -none -x -y|snap- align-none center end start|snap- always normal|snap- both none x y|snap- mandatory proximity|touch- auto manipulation none|touch-pan- left right x|touch-pan- down up y|touch-pinch-zoom |select- all auto none text|forced-color-adjust- auto none| normal size| baseline bottom middle sub super text-bottom text-top top| bounce none ping pulse spin| auto square video| auto fr max min px|none | auto full px| fixed local scroll|clip- border content padding text|origin- border content padding| bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| no-repeat repeat repeat-round repeat-space repeat-x repeat-y| auto contain cover| gradient-to-b gradient-to-bl gradient-to-br gradient-to-l gradient-to-r gradient-to-t gradient-to-tl gradient-to-tr none|blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay saturation screen soft-light|to- b bl br l r t tl tr| auto dvh fit full lh lvh max min px screen svh| dashed dotted double hidden none solid| collapse separate|px |auto |full | content none strict| inline-size size|layout |paint |style | around baseline between center center-safe end end-safe evenly normal start stretch| alias all-scroll auto cell col-resize context-menu copy crosshair default e-resize ew-resize grab grabbing help move n-resize ne-resize nesw-resize no-drop none not-allowed ns-resize nw-resize nwse-resize pointer progress row-resize s-resize se-resize sw-resize text vertical-text w-resize wait zoom-in zoom-out| dashed dotted double solid wavy| auto from-font|reverse |initial | in in-out initial linear out| col col-reverse row row-reverse| nowrap wrap wrap-reverse| auto initial none| black bold extrabold extralight light medium normal semibold thin| condensed expanded extra-condensed extra-expanded normal semi-condensed semi-expanded ultra-condensed ultra-expanded|flow- col col-dense dense row row-dense| none subgrid| auto dvh dvw fit full lh lvh lvw max min px screen svh svw| block flex grid table| auto dvw fit full lvw max min px screen svw| loose none normal px relaxed snug tight|through |item | inside outside| decimal disc none| auto px| clip-border clip-content clip-fill clip-padding clip-stroke clip-view no-clip| add exclude intersect subtract| alpha luminance match|origin- border content fill padding stroke view|type- alpha luminance| circle ellipse| closest-corner closest-side farthest-corner farthest-side|at- bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| dvh fit full lh lvh max min none px screen svh| auto dvh dvw fit full lh lvh lvw max min none px screen svh svw| dvw fit full lvw max min none px screen svw| auto dvh dvw fit full lvh lvw max min none prose px svh svw| auto dvh dvw fit full lvh lvw max min none px screen svh svw| contain cover fill none scale-down| first last none| distant dramatic midrange near none normal|inset | full none|3d | auto smooth|gutter- auto both stable| auto none thin| inner none| auto dvh dvw fit full lvh lvw max min px svh svw|base | center end justify left right start| clip ellipsis| balance nowrap pretty wrap| normal tight tighter wide wider widest| cpu gpu none| 3d flat| all colors none opacity shadow transform| discrete normal| full px| auto dvh dvw fit full lvh lvw max min px screen svh svw| auto contents scroll transform`.split(`|`).map(e=>{let t=e.split(` `),n=t.shift();for(let e=0;e<t.length;e++)t[e]=n+t[e];return t}),Y=G(`0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422`),X=G(`ɠ222222222222222222222222222222222222222222222222222222222222˕4222226>ʶ22ʷʺʷ2ʸʷ42ʴ2ʓ22>621422ɶ222ɹɼɷɺɷɺ22ɱ42222ɨ2ɧ26622ɘɓ244ƸƵ222]d24242ǖǓƚÄȫ2263ȨȥȨ2222222ǣ222222222222222222ǂƽ2ƾƵ2222222422222ƜƑ22222222222222222222144Ŧţ22Ţş222222222222222222222ĸ2ı68ĦģĦɡŰ4Ġ«®ĝ822ĔđĔ2ē2222622`),it=G(`02222222222222222222222222222222222222222222222222222222222222222202022222222222EH2200IL021042222Y\\222IL0cf2e10j2222U00X202[^2y0000120|{~22
:22|22222222222G000qOVI00000}2>40000B00000I¨©000¬00000000000000021M®00°000000000000000000000222HGHa1º222¿2À2222ÉÌ000°2±`),Z=new Int32Array(995),at=new Int32Array(995),ot=new Int32Array(995),Q=``,st=new Int32Array(1038);{let e=new Map,t=0,n=0;for(let r=0;r<Y.length;r++)for(let i of rt[it[r]]){let a=e.get(i);a===void 0&&(a=t++,e.set(i,a),st[a*2]=Q.length,st[a*2+1]=i.length,Q+=i),Z[n]=Y[r],at[n]=X[r],ot[n]=a,n++}}var ct=G(`0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p`),lt=W(U(`1::24444432:442:44:44>222222:44:4421322511111311111114`)),ut=G(`24A;33N=C@H4A;33N=C@<27;83:;8393NQ:3NQʰ222ˉºŴŽ2R2=18cƴÅŇ=cĞÛC1ƈǝȈ:ħ25=11D3A@4=<1;1DEr25;11B3?<6;:371BCn9@7=<8192>2E121@9@EHE@9>2T25511<398454131<=V25511<398454131<=ƧNž2Đå242L222290000f22500ɛ000ǘ222`),dt=U(`ij`),ft=U(``),pt=U(`1`),mt={GROUP_COUNT:Je,customValidatorNames:Ye,edgeStart:K,labelStart:Xe,labelText:Ze,edgeTarget:q,nodeGroup:Qe,nodeVlist:nt,vlistPat:$e,vlistOps:et,vlistRef:J,vlistGroup:tt,litAnchor:Z,litGroup:at,litPool:ot,poolOffsets:st,poolText:Q,adjGid:ct,adjStart:lt,adjTgt:ut,patGid:dt,patTgt:ft,postfixLookupGroups:pt,orderSensitiveModifiers:`* ** after backdrop before details-content file first-letter first-line marker placeholder selection`},ht=`line`in Error(),$=-1,gt=-1,_t=(e,t,n)=>{let r=2166136261;for(let i=t;i<n;i++)r=Math.imul(r^e.charCodeAt(i),16777619);return r},vt=(e,t,n)=>{let r=n-t,i=Math.imul(r,2654435761)^e.charCodeAt(t);if(r>3){let a=r>>2,o=r>>1;i=Math.imul(i^e.charCodeAt(t+1)<<8^e.charCodeAt(t+2)<<16^e.charCodeAt(t+a),2246822507),i=Math.imul(i^e.charCodeAt(t+o)<<8^e.charCodeAt(t+o+a)<<16^e.charCodeAt(n-3),3266489909),i^=e.charCodeAt(n-2)<<8^e.charCodeAt(n-1)<<16;for(let r=t+3,a=n-4;r<t+8&&r<a;r++,a--)i=Math.imul(i^e.charCodeAt(r)^e.charCodeAt(a)<<8,16777619)}return i^i>>>15},yt=(e,t,n={})=>{let{GROUP_COUNT:r,edgeStart:i,labelStart:a,labelText:o,edgeTarget:s,nodeGroup:c,nodeVlist:l,vlistPat:u,vlistOps:d,vlistRef:f,vlistGroup:p,litAnchor:m,litGroup:h,litPool:g,poolOffsets:_,poolText:v,adjGid:y,adjStart:b,adjTgt:ee,patGid:x,patTgt:S,postfixLookupGroups:te,customValidatorNames:ne,orderSensitiveModifiers:C}=e,w=new Int32Array(r).fill(-1);for(let e=0;e<y.length;e++)w[y[e]]=e;let T=0;for(let e=0;e+1<b.length;e++){let t=b[e+1]-b[e];t>T&&(T=t)}let E=32;for(;E<2*(1+T+x.length);)E<<=1;let D=new Int32Array(f.length+1);for(let e=0;e<f.length;e++)D[e+1]=D[e]+u[f[e]+1]-u[f[e]];let re=new Uint8Array(r);for(let e=0;e<te.length;e++)re[te[e]]=1;let ie=i.length-1,ae=new Uint8Array(ie),O=0,k=!0;for(let e=0;e<m.length;e++){ae[m[e]]=1;let t=_[g[e]*2+1];t>O&&(O=t);let n=v.charCodeAt(_[g[e]*2]);(n===91||n===40)&&(k=!1)}let A=1;for(;A<m.length*2;)A<<=1;let oe=new Int32Array(A).fill(-1);for(let e=0;e<m.length;e++){let t=_[g[e]*2],n=(_t(v,t,t+_[g[e]*2+1])^Math.imul(m[e],2654435761)|0)&A-1;for(;oe[n]!==-1;)n=n+1&A-1;oe[n]=e}let j=(e,t,n,r)=>{let i=(_t(t,n,r)^Math.imul(e,2654435761)|0)&A-1,a=r-n;for(;;){let r=oe[i];if(r===-1)return-1;if(m[r]===e&&_[g[r]*2+1]===a){let e=_[g[r]*2],i=!0;for(let r=0;r<a;r++)if(v.charCodeAt(e+r)!==t.charCodeAt(n+r)){i=!1;break}if(i)return h[r]}i=i+1&A-1}},M=n.cacheSize??8192,N=n.prefix??e.prefix??``,se=N===``?``:N+`:`,ce=se.length,P=(ne??[]).map(e=>{let n=t&&t[e];if(!n)throw Error(`cn: missing validator `+e);return n}),F=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,le=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ue=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,de=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,I=0,fe=-1,pe=-1,L=-1,me=-1,he=e=>e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95,ge=e=>/\s/.test(String.fromCharCode(e)),_e=(e,t,n)=>{if(I=0,fe=-1,n-t<3)return;let r=e.charCodeAt(t),i=e.charCodeAt(n-1);if(r===91&&i===93)I=1;else if(r===40&&i===41)I=2;else return;L=t+1,me=n-1;let a=t+1;if(he(e.charCodeAt(a))){for(a++;a<n-1;){let t=e.charCodeAt(a);if(!he(t)&&t!==45)break;a++}a<n-2&&e.charCodeAt(a)===58&&(fe=t+1,pe=a,L=a+1)}},ve=(e,t,n,r)=>{if(n-t!==r.length)return!1;for(let n=0;n<r.length;n++)if(e.charCodeAt(t+n)!==r.charCodeAt(n))return!1;return!0},ye=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,be=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,xe=e=>!!e&&!Number.isNaN(Number(e)),Se=(e,t,n)=>{if(n-t<11||!ve(e,t,t+10,`@container`))return!1;if(e.charCodeAt(t+10)===47)return n-t>=12;let r=e.charCodeAt(t+11);return r===115&&n-t>=17&&ve(e,t+10,t+16,`-size/`)||r===110&&n-t>=19&&ve(e,t+10,t+18,`-normal/`)},Ce=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],we=`length|number|number weight|family-name|position percentage|length size bg-size|image url|shadow|length|family-name|position percentage|length size bg-size|image url|shadow|number weight`.split(`|`).map(e=>e.split(` `)),Te=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],Ee=(e,t,n,r)=>{if(e>=10){if(e>=25)return P[e-25](t.slice(n,r));let i=e-10;if(I!==Ce[i])return!1;if(fe>=0){for(let e of we[i])if(ve(t,fe,pe,e))return!0;return!1}switch(Te[i]){case 0:return!1;case 1:return!0;case 2:{let e=t.slice(L,me);return F.test(e)&&!le.test(e)}case 3:return xe(t.slice(L,me));case 4:return de.test(t.slice(L,me));default:return ue.test(t.slice(L,me))}}switch(e){case 0:return!0;case 1:return I===0;case 2:return I===1;case 3:return I===2;case 4:return ye.test(t.slice(n,r));case 5:return xe(t.slice(n,r));case 6:{let e=t.slice(n,r);return!!e&&Number.isInteger(Number(e))}case 7:return r>n&&t.charCodeAt(r-1)===37&&xe(t.slice(n,r-1));case 8:return be.test(t.slice(n,r));default:return Se(t,n,r)}},De=new Set(typeof C==`string`?C.split(` `):C),Oe=(e,t,n,r,i,a)=>{let o=_t(t,n,r)^(i?2654435769:0),s=e.get(o);if(s!==void 0)outer:for(let e=0;e<s.length;e++){let a=s[e];if(a.imp===i&&a.k.length===r-n){for(let e=0;e<a.k.length;e++)if(a.k.charCodeAt(e)!==t.charCodeAt(n+e))continue outer;return a.id}}else e.set(o,s=[]);let c=t.slice(n,r),l=a(c);return s.push({k:c,imp:i,id:l}),l},ke=new Map,Ae=new Map,je=2,Me=4096,Ne=(e,t)=>{let n=[],r=0,i=0,a=0;for(let t=0;t<e.length;t++){let o=e.charCodeAt(t);r===0&&i===0&&o===58?(n.push(e.slice(a,t)),a=t+1):o===91?r++:o===93?r--:o===40?i++:o===41&&i--}n.push(e.slice(a));let o=n[0];if(n.length>1){let e=[],t=[];for(let r of n)r.charCodeAt(0)===91||De.has(r)?(t.length&&(e.push(...t.sort()),t=[]),e.push(r)):t.push(r);t.length&&e.push(...t.sort()),o=e.join(`:`)}let s=t?o+` !`:o,c=Ae.get(s);return c===void 0&&Ae.set(s,c=je++),c},Pe=new Map,R=r,Fe=r+4096,Ie=()=>R++,Le=2097152,Re=8192,ze=new Int32Array(Re),z=Array(Re).fill(null),Be=new Int32Array(Re),Ve=new Int32Array(Re),He=new Uint8Array(Re),Ue=0,We=(e,t,n,r,i,a,o,s)=>{let c=e;if(z[e]!==null){if(z[e|1]===null)c=e|1;else if(!(Ue++&3))c=e|Ue>>2&1;else return}z[c]=t.slice(n,r),ze[c]=i,Be[c]=a,Ve[c]=o,He[c]=s},Ge=()=>z.fill(null),B=256,Ke=[new Int32Array(B),new Int32Array(B),new Int32Array(B),new Int32Array(B)],[V,H,qe,U]=Ke,W=new Uint8Array(B),G=new Uint8Array(B),Je=()=>{B*=2,Ke=Ke.map(e=>{let t=new Int32Array(B);return t.set(e),t}),[V,H,qe,U]=Ke;let e=new Uint8Array(B);e.set(W),W=e,G=new Uint8Array(B)},Ye=64,K=new Int32Array(Ye),Xe=new Int32Array(Ye),Ze=new Int32Array(r),q=2048,Qe=21,$e=new Float64Array(q),et=new Int32Array(q),J=0,tt=(e,t)=>{if(e===0&&t<r)return Ze[t]===J?1:(Ze[t]=J,0);let n=e*2097152+t+1,i=Math.imul(n,2654435761)>>>Qe;for(;et[i]===J;){if($e[i]===n)return 1;i=i+1&q-1}return $e[i]=n,et[i]=J,0},nt=(e,t,n,r,i)=>{if(n-t>=2&&e.charCodeAt(t)===91&&e.charCodeAt(n-1)===93){let r=-1;for(let i=t+1;i<n-1;i++)if(e.charCodeAt(i)===58){r=i;break}return r===-1||r===t+1?$:Oe(Pe,e,t+1,r,0,Ie)}if(r>=0&&c[r]>=0)return c[r];for(let t=i-1;t>=0;t--){let r=Xe[t];if(r>n)continue;let i=K[t],a=n-r;if(ae[i]===1&&a>0&&a<=O){let t=e.charCodeAt(r);if(k===!1||t!==91&&t!==40){let t=j(i,e,r,n);if(t>=0)return t}}let o=l[i];if(o<0)continue;let s=f[o],c=u[s],m=u[s+1];if(c===m)continue;_e(e,r,n);let h=D[o]-c;for(let t=c;t<m;t++)if(Ee(d[t],e,r,n))return p[h+t]}return $},rt=e=>{let t=e.length,n=0,c=0,u=!1;(je>Me||ke.size>Me)&&(ke=new Map,Ae=new Map,je=2,Ge()),R>Fe&&(Pe=new Map,R=r,Ge());let d=0;for(;d<t;){let f=e.charCodeAt(d);if(f===32||f>=9&&f<=13||f>=160&&ge(f)){f!==32&&(u=!0),d++;continue}let p=d,m=0;for(;d<t;){if(f=e.charCodeAt(d),f<=32){if(f===32)break;if(f>=9&&f<=13){u=!0;break}}else if(f>=160&&ge(f)){u=!0;break}m=Math.imul(m^f,16777619),d++}let h=d,g=h-p;n===B&&Je();let _=n++;V[_]=p,H[_]=h,c+=g,m^=Math.imul(g,2654435761);let v=m^m>>>15,y=v&8190;{let t=-1;if(ze[y]===v&&z[y]!==null&&z[y].length===g?t=y:ze[y|1]===v&&z[y|1]!==null&&z[y|1].length===g&&(t=y|1),t>=0){let n=z[t],r=!0;for(let t=0;t<g;t++)if(n.charCodeAt(t)!==e.charCodeAt(p+t)){r=!1;break}if(r){qe[_]=Be[t],U[_]=Ve[t],W[_]=He[t];continue}}}let b=p;if(ce!==0){if(h-p<=ce||!e.startsWith(se,p)){qe[_]=$,We(y,e,p,h,v,$,0,0);continue}b=p+ce}let ee=0,x=0,S=-1,te=-1;for(let t=b;t<h;t++){let n=e.charCodeAt(t);if(ee===0&&x===0){if(n===58){S=t;continue}if(n===47){te=t;continue}}n===91?ee++:n===93?ee--:n===40?x++:n===41&&x--}let ne=S>=b?S+1:b,C=ne,w=h,T=!1,E=0;w>C&&e.charCodeAt(w-1)===33?(T=!0,w--):w>C&&e.charCodeAt(C)===33&&(T=!0,C++,E=1);let D=-1;te>ne&&(D=te+E,D>=w&&(D=-1));let ie=C;w-C>1&&e.charCodeAt(C)===45&&(ie=C+1);let O=0,k=0,A=0,oe=-1,j=0;(l[0]>=0||ae[0]===1)&&(K[0]=0,Xe[0]=ie,j=1);let M=gt,N=0;for(let t=ie;t<w;t++)if(t===D&&(M=k<A?gt:O,N=j),O!==gt){let n=e.charCodeAt(t),r=-1;if(k<A)o.charCodeAt(k)===n?(k++,k===A&&(r=O=oe)):O=gt;else{let e=i[O],t=i[O+1],c=gt;for(let i=e;i<t;i++){let e=a[i];if(o.charCodeAt(e)===n){a[i+1]-e===1?r=c=s[i]:(k=e+1,A=a[i+1],oe=s[i],c=O);break}}O=c}if(r>=0&&(l[r]>=0||ae[r]===1)&&t+1<w&&e.charCodeAt(t+1)===45){if(j===Ye){Ye*=2;let e=new Int32Array(Ye);e.set(K),K=e;let t=new Int32Array(Ye);t.set(Xe),Xe=t}K[j]=r,Xe[j]=t+2,j++}}D===w&&(M=k<A?gt:O,N=j);let P=k<A?gt:O,F,le=!1;if(D>=0){if(le=!0,F=nt(e,C,D,M,N),F!==$&&F<r&&re[F]){let t=nt(e,C,w,P,j);t!==$&&t!==F&&(F=t,le=!1)}else F===$&&(F=nt(e,C,w,P,j),le=!1)}else F=nt(e,C,w,P,j);let ue=0,de=0;F===$?qe[_]=$:(de=+!!le,ue=b>=S?+!!T:Oe(ke,e,b,S,+!!T,e=>Ne(e,T)),qe[_]=F,W[_]=de,U[_]=ue),We(y,e,p,h,v,F,ue,de)}if(n===0)return``;if(n===1)return V[0]===0&&H[0]===t?e:e.slice(V[0],H[0]);if(n*E>q){for(;n*E>q;)q<<=1,Qe--;$e=new Float64Array(q),et=new Int32Array(q)}if(je>=Le||R>=Le)throw Error(`cn: too many distinct classes in one merge`);J=J+1|0,J===0&&(Ze.fill(0),et.fill(0),J=1);let f=!1;for(let e=n-1;e>=0;e--){let t=qe[e];if(t===$){G[e]=1;continue}let n=U[e];if(tt(n,t)===1)G[e]=0,f=!0;else if(G[e]=1,t<r){let r=w[t];if(r>=0)for(let e=b[r];e<b[r+1];e++)tt(n,ee[e]);if(W[e]&1)for(let e=0;e<x.length;e++)x[e]===t&&tt(n,S[e])}}if(!f&&!u&&t===c+n-1)return e;let p=``,m=0;for(;m<n;){if(!G[m]){m++;continue}let t=V[m],r=H[m],i=m+1;for(;i<n&&G[i]&&V[i]===r+1&&e.charCodeAt(r)===32;)r=H[i],i++;p.length>0&&(p+=` `),p+=e.slice(t,r),m=i}return p},Y=16384,X=new Int32Array(Y*2),it=0,Z=1,at=Object.create(null),ot=Object.create(null),Q=new Map,st=new Map,ct=0,lt=0,ut=()=>{it^=Y,Z=Z+1|0,lt=0},dt=e=>{let t=at[e];if(t!==void 0)return t;let n=vt(e,0,e.length),r=(n&16383)+it,i=X[r]===(n^Z)||X[r^Y]===(n^Z-1);return i&&(t=ot[e],t!==void 0)?(at[e]=t,t):(t=rt(e),i?(at[e]=t,++ct>M&&(ct=0,ot=at,at=Object.create(null),ut())):(X[r]=n^Z,++lt>Y&&ut()),t)},ft=e=>{let t=Q.get(e);if(t!==void 0)return t;let n=vt(e,0,e.length),r=(n&16383)+it,i=X[r]===(n^Z)||X[r^Y]===(n^Z-1);return i&&(t=st.get(e),t!==void 0)?(Q.set(e,t),t):(t=rt(e),i?(Q.set(e,t),++ct>M&&(ct=0,st=Q,Q=new Map,ut())):(X[r]=n^Z,++lt>Y&&ut()),t)},pt=e=>{let t=vt(e,0,e.length),n=(t&16383)+it;return X[n]===(t^Z)||X[n^Y]===(t^Z-1)||(X[n]=t^Z,++lt>Y&&ut(),!1)},mt=M===0?rt:ht?e=>{let t=Q.get(e);return t===void 0?ft(e):t}:dt;return{merge:function(){return arguments.length===1&&typeof arguments[0]==`string`?mt(arguments[0]):mt(St.apply(null,arguments))},mergeString:mt,seenBefore:M===0?()=>!1:pt,mergeUncached:rt}},bt=(e,t)=>{if(!e)return``;if(typeof e==`string`)return e;let n=``;if(typeof e.length==`number`&&(!t||Array.isArray(e))){let r=e;for(let e=0;e<r.length;e++){let i=r[e];if(!i)continue;let a=typeof i==`string`?i:bt(i,t);a&&(n&&(n+=` `),n+=a)}return n}if(t){if(typeof e==`number`)return``+e;if(typeof e==`object`)for(let t in e)e[t]&&(n&&(n+=` `),n+=t)}return n},xt=(e,t)=>{let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(!i)continue;let a=typeof i==`string`?i:bt(i,t);a&&(n&&(n+=` `),n+=a)}return n},St=function(){return xt(arguments,!1)},Ct=256,wt=16,Tt=1024,Et=4096,Dt=(e,t)=>{let n=t===void 0?()=>!0:t.seenBefore,r=t===void 0?e:t.mergeUncached,i=new Map,a=new Map,o=0,s=null,c=null,l=[],u=[],d=0,f=(t,n,r)=>{c===null&&(c=Array(Et).fill(``),l=Array(Et).fill(``),u=Array(Et).fill(``));let i=vt(t,0,t.length)&4094;if(c[i]===t&&l[i]===n)return u[i];if(c[i|1]===t&&l[i|1]===n)return u[i|1];let a=e(r?n+` `+t:t),o=c[i]===``?i:i|(c[i|1]===``?1:d++&1);return c[o]=t,l[o]=n,u[o]=a,a},p=(e,t,n,r)=>{let i=0;if(t){if(t!==e.a0)return!1;i=1}if(n){if(n!==(i===0?e.a0:e.a1))return!1;i++}if(r){if(r!==(i===0?e.a0:i===1?e.a1:e.a2))return!1;i++}return i===e.t},m=(e,t)=>{let n=e.a,r=0;for(let e=0;e<t.length;e++){let i=t[e];if(i){if(i!==n[r])return!1;r++}}return r===e.t},h=(t,c)=>{let l=t.length,u=s===null?null:s.n;if(!c){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let d=``,p=-1,h=0,g=!1;for(let e=0;e<l;e++){let n=t[e];if(n){if(typeof n!=`string`){if(n=t[e]=bt(n,!0),!n)continue;g=!0}p<0&&(d=n,p=e),h++}}if(h===0)return``;if(h===1)return e(d);if(g){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let _=i.get(d);_===void 0&&(_=a.get(d),_!==void 0&&i.set(d,_));let v=null;if(_!==void 0){if(_.skip>0){_.skip--,s=null;let e=d;for(let n=p+1;n<l;n++){let r=t[n];r&&(e+=` `+r)}return f(e,``,!1)}let e=_.e;outer:for(let n=0;n<e.length;n++){let r=e[n];if(r.t!==h)continue;let i=r.a,a=1;for(let e=p+1;e<l;e++){let n=t[e];if(n&&n!==i[a++])continue outer}v=r;break}v!==null&&(_.miss=0)}if(v===null){let s=d,c=[d];for(let e=p+1;e<l;e++){let n=t[e];n&&(s+=` `+n,c.push(n))}if(!n(s))return r(s);v={r:e(s),t:c.length,a0:c[0],a1:c[1],a2:c[2]??``,a:c,n:null},_===void 0?i.set(d,_={e:[],miss:0,skip:0,at:0}):++_.miss>wt&&(_.miss=wt,_.skip=Tt,_.e.length=0,_.at=0);let u=_.e;u.length<Ct?u.push(v):(u[_.at]=v,_.at=_.at+1&255),++o>1e3&&(o=0,a=i,i=new Map)}return s!==null&&s!==v&&(s.n=v),s=v,v.r},g=t=>Array.isArray(t)?h(t.slice(),!1):e(bt(t,!0));return function(t,n,r){let a=arguments.length;if((a|1)==3){let e=s;if(e!==null){let i=e.n;if(i!==null&&p(i,t,n,r))return s=i,i.r;if(e!==i&&p(e,t,n,r))return e.r}if(a===2&&typeof n==`string`&&n!==``){let e=i.get(t);if(e!==void 0&&e.skip>0)return e.skip--,s=null,f(n,t,!0)}return h([t,n,r],!0)}if(a===1)return typeof t==`string`?e(t):g(t);let o=s;if(o!==null){let e=o.n;if(e!==null){let t=e.a,n=0,r=!0;for(let e=0;e<a;e++){let i=arguments[e];if(i){if(i!==t[n]){r=!1;break}n++}}if(r&&n===e.t)return s=e,e.r}if(o!==e){let e=o.a,t=0,n=!0;for(let r=0;r<a;r++){let i=arguments[r];if(i){if(i!==e[t]){n=!1;break}t++}}if(n&&t===o.t)return o.r}}let c=[];for(let e=0;e<a;e++)c.push(arguments[e]);return h(c,!0)}},Ot=yt(mt),kt=Dt(Ot.mergeString,Ot);Ot.merge;var At=n(),jt=H(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function Mt({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,At.jsx)(We,{"data-slot":`button`,className:kt(jt({variant:t,size:n,className:e})),...r})}var Nt=new Map([[`bold`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M157.27,21.22a12,12,0,0,0-12.64,1.31L75.88,76H32A20,20,0,0,0,12,96v64a20,20,0,0,0,20,20H75.88l68.75,53.47A12,12,0,0,0,164,224V32A12,12,0,0,0,157.27,21.22ZM36,100H68v56H36Zm104,99.46L92,162.13V93.87l48-37.33ZM212,128a44,44,0,0,1-11,29.11,12,12,0,1,1-18-15.88,20,20,0,0,0,0-26.43,12,12,0,0,1,18-15.86A43.94,43.94,0,0,1,212,128Zm40,0a83.87,83.87,0,0,1-21.39,56,12,12,0,0,1-17.89-16,60,60,0,0,0,0-80,12,12,0,1,1,17.88-16A83.87,83.87,0,0,1,252,128Z`}))],[`duotone`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M80,88v80H32a8,8,0,0,1-8-8V96a8,8,0,0,1,8-8Z`,opacity:`0.2`}),r.createElement(`path`,{d:`M155.51,24.81a8,8,0,0,0-8.42.88L77.25,80H32A16,16,0,0,0,16,96v64a16,16,0,0,0,16,16H77.25l69.84,54.31A8,8,0,0,0,160,224V32A8,8,0,0,0,155.51,24.81ZM32,96H72v64H32ZM144,207.64,88,164.09V91.91l56-43.55Zm54-106.08a40,40,0,0,1,0,52.88,8,8,0,0,1-12-10.58,24,24,0,0,0,0-31.72,8,8,0,0,1,12-10.58ZM248,128a79.9,79.9,0,0,1-20.37,53.34,8,8,0,0,1-11.92-10.67,64,64,0,0,0,0-85.33,8,8,0,1,1,11.92-10.67A79.83,79.83,0,0,1,248,128Z`}))],[`fill`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M160,32.25V223.69a8.29,8.29,0,0,1-3.91,7.18,8,8,0,0,1-9-.56l-65.57-51A4,4,0,0,1,80,176.16V79.84a4,4,0,0,1,1.55-3.15l65.57-51a8,8,0,0,1,10,.16A8.27,8.27,0,0,1,160,32.25ZM60,80H32A16,16,0,0,0,16,96v64a16,16,0,0,0,16,16H60a4,4,0,0,0,4-4V84A4,4,0,0,0,60,80Zm126.77,20.84a8,8,0,0,0-.72,11.3,24,24,0,0,1,0,31.72,8,8,0,1,0,12,10.58,40,40,0,0,0,0-52.88A8,8,0,0,0,186.74,100.84Zm40.89-26.17a8,8,0,1,0-11.92,10.66,64,64,0,0,1,0,85.34,8,8,0,1,0,11.92,10.66,80,80,0,0,0,0-106.66Z`}))],[`light`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M154.64,26.61a6,6,0,0,0-6.32.65L77.94,82H32A14,14,0,0,0,18,96v64a14,14,0,0,0,14,14H77.94l70.38,54.74A6,6,0,0,0,158,224V32A6,6,0,0,0,154.64,26.61ZM30,160V96a2,2,0,0,1,2-2H74v68H32A2,2,0,0,1,30,160Zm116,51.73L86,165.07V90.93l60-46.66Zm50.53-108.85a38,38,0,0,1,0,50.24,6,6,0,1,1-9-7.94,26,26,0,0,0,0-34.37,6,6,0,0,1,9-7.93ZM246,128a77.86,77.86,0,0,1-19.86,52,6,6,0,1,1-8.94-8,66,66,0,0,0,0-88,6,6,0,1,1,8.94-8A77.86,77.86,0,0,1,246,128Z`}))],[`regular`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M155.51,24.81a8,8,0,0,0-8.42.88L77.25,80H32A16,16,0,0,0,16,96v64a16,16,0,0,0,16,16H77.25l69.84,54.31A8,8,0,0,0,160,224V32A8,8,0,0,0,155.51,24.81ZM32,96H72v64H32ZM144,207.64,88,164.09V91.91l56-43.55Zm54-106.08a40,40,0,0,1,0,52.88,8,8,0,0,1-12-10.58,24,24,0,0,0,0-31.72,8,8,0,0,1,12-10.58ZM248,128a79.9,79.9,0,0,1-20.37,53.34,8,8,0,0,1-11.92-10.67,64,64,0,0,0,0-85.33,8,8,0,1,1,11.92-10.67A79.83,79.83,0,0,1,248,128Z`}))],[`thin`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M153.76,28.41a4,4,0,0,0-4.22.43L78.63,84H32A12,12,0,0,0,20,96v64a12,12,0,0,0,12,12H78.63l70.91,55.16A4.07,4.07,0,0,0,152,228a3.92,3.92,0,0,0,1.76-.41A4,4,0,0,0,156,224V32A4,4,0,0,0,153.76,28.41ZM28,160V96a4,4,0,0,1,4-4H76v72H32A4,4,0,0,1,28,160Zm120,55.82L84,166V90l64-49.78Zm47-111.61a36,36,0,0,1,0,47.59,4,4,0,1,1-6-5.3,28,28,0,0,0,0-37,4,4,0,0,1,6-5.28ZM244,128a75.88,75.88,0,0,1-19.35,50.67,4,4,0,0,1-6-5.34,68,68,0,0,0,0-90.66,4,4,0,0,1,6-5.34A75.88,75.88,0,0,1,244,128Z`}))]]),Pt=new Map([[`bold`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M56.88,31.93A12,12,0,1,0,39.12,48.07L64.51,76H32A20,20,0,0,0,12,96v64a20,20,0,0,0,20,20H75.88l68.75,53.47A12,12,0,0,0,164,224V185.44l35.12,38.63a12,12,0,0,0,17.76-16.14ZM36,100H68v56H36Zm104,99.46L92,162.13V106.24L140,159Zm-31-134a12,12,0,0,1,2.11-16.84l33.51-26.07A12,12,0,0,1,164,32V94.94a12,12,0,0,1-24,0V56.54l-14.15,11A12,12,0,0,1,109,65.44Zm74,49.35a12,12,0,0,1,18-15.85,44,44,0,0,1,5.55,50.21,12,12,0,0,1-21-11.55A19.67,19.67,0,0,0,188,128,20,20,0,0,0,183,114.79ZM252,128a84.18,84.18,0,0,1-19.11,53.35,12,12,0,1,1-18.53-15.25A60,60,0,0,0,212.73,88a12,12,0,1,1,17.88-16A83.87,83.87,0,0,1,252,128Z`}))],[`duotone`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M80,88v80H32a8,8,0,0,1-8-8V96a8,8,0,0,1,8-8Z`,opacity:`0.2`}),r.createElement(`path`,{d:`M53.92,34.62A8,8,0,1,0,42.08,45.38L73.55,80H32A16,16,0,0,0,16,96v64a16,16,0,0,0,16,16H77.25l69.84,54.31A8,8,0,0,0,160,224V175.09l42.08,46.29a8,8,0,1,0,11.84-10.76ZM32,96H72v64H32ZM144,207.64,88,164.09V95.89l56,61.6Zm42-63.77a24,24,0,0,0,0-31.72,8,8,0,1,1,12-10.57,40,40,0,0,1,0,52.88,8,8,0,0,1-12-10.59Zm-80.16-76a8,8,0,0,1,1.4-11.23l39.85-31A8,8,0,0,1,160,32v74.83a8,8,0,0,1-16,0V48.36l-26.94,21A8,8,0,0,1,105.84,67.91ZM248,128a79.9,79.9,0,0,1-20.37,53.34,8,8,0,0,1-11.92-10.67,64,64,0,0,0,0-85.33,8,8,0,1,1,11.92-10.67A79.83,79.83,0,0,1,248,128Z`}))],[`fill`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M213.92,210.62a8,8,0,1,1-11.84,10.76L160,175.09v48.6a8.29,8.29,0,0,1-3.91,7.18,8,8,0,0,1-9-.56l-65.55-51A4,4,0,0,1,80,176.18V87.09L42.08,45.38A8,8,0,1,1,53.92,34.62Zm-27.21-55.46a8,8,0,0,0,11.29-.7,40,40,0,0,0,0-52.88,8,8,0,1,0-12,10.57,24,24,0,0,1,0,31.72A8,8,0,0,0,186.71,155.16Zm40.92-80.49a8,8,0,1,0-11.92,10.66,64,64,0,0,1,0,85.34,8,8,0,1,0,11.92,10.66,80,80,0,0,0,0-106.66ZM153,119.87a4,4,0,0,0,7-2.7V32.25a8.27,8.27,0,0,0-2.88-6.4,8,8,0,0,0-10-.16L103.83,59.33a4,4,0,0,0-.5,5.85ZM60,80H32A16,16,0,0,0,16,96v64a16,16,0,0,0,16,16H60a4,4,0,0,0,4-4V84A4,4,0,0,0,60,80Z`}))],[`light`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M52.44,36A6,6,0,0,0,43.56,44L78,81.94l-.08.06H32A14,14,0,0,0,18,96v64a14,14,0,0,0,14,14H77.94l70.38,54.74A6,6,0,0,0,158,224V169.92L203.56,220a6,6,0,0,0,8.88-8.08ZM30,160V96a2,2,0,0,1,2-2H74v68H32A2,2,0,0,1,30,160Zm116,51.73L86,165.07V90.93l.11-.08L146,156.72Zm41.5-66.53a26,26,0,0,0,0-34.37,6,6,0,1,1,9-7.93,38,38,0,0,1,0,50.24,6,6,0,0,1-9-7.94ZM107.41,66.68a6,6,0,0,1,1.06-8.42l39.85-31A6,6,0,0,1,158,32v74.83a6,6,0,0,1-12,0V44.27L115.83,67.73A6,6,0,0,1,107.41,66.68ZM246,128a77.86,77.86,0,0,1-19.86,52,6,6,0,1,1-8.94-8,66,66,0,0,0,0-88,6,6,0,1,1,8.94-8A77.86,77.86,0,0,1,246,128Z`}))],[`regular`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M53.92,34.62A8,8,0,1,0,42.08,45.38L73.55,80H32A16,16,0,0,0,16,96v64a16,16,0,0,0,16,16H77.25l69.84,54.31A8,8,0,0,0,160,224V175.09l42.08,46.29a8,8,0,1,0,11.84-10.76ZM32,96H72v64H32ZM144,207.64,88,164.09V95.89l56,61.6Zm42-63.77a24,24,0,0,0,0-31.72,8,8,0,1,1,12-10.57,40,40,0,0,1,0,52.88,8,8,0,0,1-12-10.59Zm-80.16-76a8,8,0,0,1,1.4-11.23l39.85-31A8,8,0,0,1,160,32v74.83a8,8,0,0,1-16,0V48.36l-26.94,21A8,8,0,0,1,105.84,67.91ZM248,128a79.9,79.9,0,0,1-20.37,53.34,8,8,0,0,1-11.92-10.67,64,64,0,0,0,0-85.33,8,8,0,1,1,11.92-10.67A79.83,79.83,0,0,1,248,128Z`}))],[`thin`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M51,37.31A4,4,0,0,0,45,42.69L81,82.19,78.63,84H32A12,12,0,0,0,20,96v64a12,12,0,0,0,12,12H78.63l70.91,55.16A4.07,4.07,0,0,0,152,228a3.92,3.92,0,0,0,1.76-.41A4,4,0,0,0,156,224V164.75l49,53.94a4,4,0,1,0,5.92-5.38ZM28,160V96a4,4,0,0,1,4-4H76v72H32A4,4,0,0,1,28,160Zm120,55.82L84,166V90l2.35-1.83L148,156Zm41-69.3a28,28,0,0,0,0-37,4,4,0,1,1,6-5.29,36,36,0,0,1,0,47.59,4,4,0,1,1-6-5.29ZM109,65.45a4,4,0,0,1,.7-5.61l39.85-31A4,4,0,0,1,156,32v74.83a4,4,0,0,1-8,0V40.18l-33.39,26A4,4,0,0,1,109,65.45ZM244,128a75.88,75.88,0,0,1-19.35,50.67,4,4,0,0,1-6-5.34,68,68,0,0,0,0-90.66,4,4,0,0,1,6-5.34A75.88,75.88,0,0,1,244,128Z`}))]]),Ft=new Map([[`bold`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z`}))],[`duotone`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`,opacity:`0.2`}),r.createElement(`path`,{d:`M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`fill`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`light`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z`}))],[`regular`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`thin`,r.createElement(r.Fragment,null,r.createElement(`path`,{d:`M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z`}))]]),It=(0,r.createContext)({color:`currentColor`,size:`1em`,weight:`regular`,mirrored:!1}),Lt=r.forwardRef((e,t)=>{let{alt:n,color:i,size:a,weight:o,mirrored:s,children:c,weights:l,...u}=e,{color:d=`currentColor`,size:f,weight:p=`regular`,mirrored:m=!1,...h}=r.useContext(It);return r.createElement(`svg`,{ref:t,xmlns:`http://www.w3.org/2000/svg`,width:a??f,height:a??f,fill:i??d,viewBox:`0 0 256 256`,transform:s||m?`scale(-1, 1)`:void 0,...h,...u},!!n&&r.createElement(`title`,null,n),c,l.get(o??p))});Lt.displayName=`IconBase`;var Rt=r.forwardRef((e,t)=>r.createElement(Lt,{ref:t,...e,weights:Nt}));Rt.displayName=`SpeakerHighIcon`;var zt=r.forwardRef((e,t)=>r.createElement(Lt,{ref:t,...e,weights:Pt}));zt.displayName=`SpeakerSlashIcon`;var Bt=r.forwardRef((e,t)=>r.createElement(Lt,{ref:t,...e,weights:Ft}));Bt.displayName=`XIcon`;export{te as A,d as B,re as C,s as D,b as E,l as F,m as H,u as I,x as L,ne as M,o as N,T as O,y as P,c as R,O as S,S as T,ee as U,p as V,_e as _,Mt as a,N as b,Re as c,R as d,Ne as f,be as g,xe as h,Lt as i,w as j,a as k,Le as l,we as m,zt as n,kt as o,je as p,Rt as r,H as s,Bt as t,Pe as u,ve as v,E as w,oe as x,ge as y,f as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,g as t,l as n,p as r,y as i}from"./definitions~index~embed~bookmarklet-BfjknPZN.js";import{d as a,f as o,l as s,m as c,p as l,u}from"./definitions~index~embed-CDMM_m1T.js";import{a as d}from"./configuration~index~embed~bookmarklet~vehicle-popover~EmbedPanel~Documentation~JoyRideView~~n76yhyet-zf1LIsS8.js";import{p as f}from"./configuration~index~embed~bookmarklet-C8RUCiUX.js";var p=e=>e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase()),m=e=>e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`),h=new Map,g=(e,t,n)=>h.set(`data-jr-${e}`,{path:t,kind:n});for(let e of[`solid`,`pushable`,`enabled`])g(e,[e],`boolean`);for(let e of[`id`,`object`])g(e,[e],`string`);g(`pickup-effect-color`,[`pickupEffectColor`],`string`);for(let e of[`points`])g(e,[e],`number`);var _=new Set([t,r,i,l.deformation]);function v(t,n,r){for(let[i,a]of Object.entries(r))g(`${t}-${m(i)}`,[...n,i],a===e?`boolean`:_.has(a)?`number`:`string`)}for(let[e,t]of Object.entries({breakable:s,burnable:u,combustible:a,crushable:o}))g(e,[e],`root`),v(e,[e],t);g(`liquid`,[`liquid`,`kind`],`string`);var{kind:y,...b}=l;v(`liquid`,[`liquid`],b),g(`debris`,[`debris`],`root`);for(let e of[`anchor`,`color`])g(`debris-${e}`,[`debris`,e],`string`);for(let e of[`amount`,`spread`,`seed`])g(`debris-${e}`,[`debris`,e],`number`);g(`debris-kinds`,[`debris`,`kinds`],`list`),g(`debris-wind-x`,[`debris`,`wind`,`x`],`number`),g(`debris-wind-y`,[`debris`,`wind`,`y`],`number`),g(`trigger`,[`trigger`],`root`),v(`trigger`,[`trigger`],c);var x=[`fps`,`speed`,`rpm`,`gear`,`health`,`points`],S=[`data-jr-hud`,`data-jr-hud-unit`,`data-jr-hud-precision`],C=Object.freeze([...h.keys(),...S]),w=C.map(e=>`[${e}]`).join(`,`);function T(e,t){return e===``||e===`true`||e!==`false`&&n(t,`use an empty marker, true, or false`)}function E(e,t,r,i){let a=e;for(let e=0;e<t.length-1;e++){let r=t[e],o=a[r];o===!1&&n(i,`options require an enabled capability`),o&&typeof o==`object`||(a[r]=typeof o==`string`?{preset:o}:{}),a=a[r]}a[t[t.length-1]]=r}function D(e){let t={},r=!1,i={},a=!1,o=Array.from(e.attributes).sort((e,t)=>e.name.split(`-`).length-t.name.split(`-`).length);for(let{name:e,value:s}of o){if(S.includes(e)){r=!0,e===`data-jr-hud-unit`?i.unit=s:e===`data-jr-hud-precision`?(s.trim()&&Number.isFinite(Number(s))||n(e,`expected a finite number`),i.precision=Number(s)):s===`false`?a=!0:x.includes(s)?i.field=s:n(e,`expected ${x.join(`, `)}, or false`);continue}if(e.startsWith(`data-jr-meta-`)){let i=p(e.slice(13));(!i||[`__proto__`,`prototype`,`constructor`].includes(i))&&n(e,`invalid metadata key`),t.meta??={},t.meta[i]=s,r=!0;continue}let o=h.get(e);if(!o)continue;r=!0;let c=s;o.kind===`list`?c=s.split(/[\s,]+/).filter(Boolean):o.kind===`boolean`?c=T(s,e):o.kind===`number`?(s.trim()||n(e,`expected a number`),c=Number(s),Number.isFinite(c)||n(e,`expected a finite number`)):o.kind===`root`&&(c=s===``||s===`true`||s===`false`?T(s,e):e===`data-jr-debris`?{kinds:s.split(/[\s,]+/).filter(Boolean)}:s),E(t,o.path,c,e)}return a&&Object.keys(i).length&&n(`data-jr-hud`,`false cannot be combined with HUD options`),Object.keys(i).length?t.hud=i:a&&(t.hud=!1),r?t:null}var O={sfw:f};function k(e,t={}){let n=O[e];if(!n)throw RangeError(`Unknown Joy Ride preset: ${e}`);let r={...n,...t};for(let e of d)(n[e]||t[e])&&Object.assign(r,{[e]:{...n[e],...t[e]}});return r}var A=Object.freeze({object:Object.freeze([...C]),entry:Object.freeze([`data-jr-entry`,`data-jr-entry-angle-rad`,`data-jr-entry-distance-px`,`data-jr-entry-fade-fraction`,`data-jr-entry-steer`,`data-jr-entry-delay-ms`,`data-jr-entry-speed-mps`]),script:Object.freeze([`data-jr-mount`,`data-jr-mount-preset`,`data-jr-dialog-theme`,`data-jr-accent-color`,`data-jr-dialog-font-family`,`data-jr-persist-vehicle`,`data-jr-persist-audio`,`data-jr-unmount`]),objective:Object.freeze([`data-jr-objective`,`data-jr-objective-type`,`data-jr-objective-count`,`data-jr-objective-points`,`data-jr-objective-targets`,`data-jr-objective-order`,`data-jr-objective-progress`,`data-jr-objective-event`]),route:Object.freeze([`data-jr-route`,`data-jr-route-order`,`data-jr-route-progress`,`data-jr-route-event`]),presentation:Object.freeze([`data-jr-ui`,`data-jr-foreground`,`data-jr-camera`,`data-jr-camera-zoom`,`data-jr-auto-paint`])}),j=Object.freeze(Object.values(A).flat()),M=Object.freeze([`data-jr-meta-`]);export{D as a,k as i,M as n,w as o,A as r,j as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as e,t}from"./definitions~index~embed~bookmarklet-BfjknPZN.js";import{a as n,c as r,t as i}from"./configuration~index~embed~bookmarklet~vehicle-popover~EmbedPanel~Documentation~JoyRideView~~n76yhyet-zf1LIsS8.js";import{n as a}from"./configuration~index~embed~bookmarklet~vehicle-popover~EmbedPanel~JoyRideView~browser-sessio~iaaa3ndj-BBrKrH7m.js";var o={lighting:{}};for(let e of i){let t=e.storage===`lighting`?o.lighting:o;t[e.key]=structuredClone(e.default)}var s=r(o),c={game:{vehicleDestructible:!1,toolsEnabled:!1,showHealthBars:!1,deform:!1,sparks:!1},dialog:{showVehicleNames:!1,showLogo:!1,showGithub:!1,showGameSettings:!1,vehicleTabs:[`vehicle`,`controls`],accentColor:`#000000`}};function l(e){let t=Object.fromEntries(n.map(e=>[e,{}])),o=a(e.lighting);for(let n of i)t[n.category][n.key]=n.storage===`lighting`?o[n.key]:e[n.key];return r(structuredClone(t))}function u(e,t){if(!t||typeof t!=`object`||Array.isArray(t))throw TypeError(`Runtime options must be an object`);let r={...structuredClone(e),lighting:a(e.lighting)};for(let[e,a]of Object.entries(t)){if(!n.includes(e))throw TypeError(`Unknown runtime option: ${e}`);if(a!==void 0){if(!a||typeof a!=`object`||Array.isArray(a))throw TypeError(`options.${e} must be an object`);for(let[t,n]of Object.entries(a)){let a=i.find(n=>n.category===e&&n.key===t);if(!a)throw TypeError(`Unknown option: ${e}.${t}`);if(n!==void 0||a.default===void 0){if(!a.valid(n))throw TypeError(`Invalid ${t===`dialogTheme`?`dialog theme`:a.label}: ${e}.${t}`);a.storage===`lighting`?r.lighting[t]=n:r[t]=structuredClone(n)}}}}return r}function d(e={}){let t={};for(let n of i){if(n.storage===`lighting`)continue;let r=e[n.key];r!==void 0&&((t[n.category]??={})[n.key]=r)}if(e.lighting!==void 0){if(!e.lighting||typeof e.lighting!=`object`||Array.isArray(e.lighting))throw TypeError(`lighting must be an object`);for(let[n,r]of Object.entries(e.lighting)){let e=i.find(e=>e.storage===`lighting`&&e.key===n);if(!e)throw TypeError(`Unknown lighting option: ${n}`);(t[e.category]??={})[n]=r}}let n=u(s,t);return{...n,lighting:a(n.lighting)}}function f(e,t){let n={};for(let r of i)if(!(r.visitor===!1||r.category===`game`&&!e.showGameSettings)){if(r.storage===`lighting`){let i=t.lighting?.[r.key];Object.hasOwn(t.lighting??{},r.key)&&r.valid(i)&&(n.lighting??=a(e.lighting),n.lighting[r.key]=i)}else{let e=t[r.key];e!==void 0&&r.valid(e)&&(n[r.key]=structuredClone(e))}}return n}var p=new URL(`../embed-assets/porsche-911-997-top-BE6uRNL4.webp`,import.meta.url).href,m=new URL(`../embed-assets/ford-mustang-gt-top-DVzZTm7G.webp`,import.meta.url).href,h=new URL(`../embed-assets/bmw-m4-top-GKSf0h28.webp`,import.meta.url).href,g=new URL(`../embed-assets/jeep-wrangler-top-Dr43LU9c.webp`,import.meta.url).href,_=new URL(`../embed-assets/subaru-wrx-top-dLvMFYDs.webp`,import.meta.url).href,v=new URL(`../embed-assets/audi-rs3-top-Zwm7ZQ20.webp`,import.meta.url).href,y=new URL(`../embed-assets/lamborghini-huracan-evo-top-BCJJwrTj.webp`,import.meta.url).href,b=new URL(`../embed-assets/electric-gt-top-DTcvEjMR.webp`,import.meta.url).href,x={xM:-.22,revealM:.36,roundsPerSecond:11,bulletSpeedMps:72,bulletLifetimeSeconds:1.35};function S(e){let t={...x,...e.machineGuns},n=(e,t,n,r)=>Number.isFinite(e)?Math.max(n,Math.min(r,e)):t;return{xM:n(t.xM,x.xM,-e.geometry.lengthM/2+.5,e.geometry.lengthM/2-.5),revealM:n(t.revealM,x.revealM,.12,.5),roundsPerSecond:n(t.roundsPerSecond,x.roundsPerSecond,2,20),bulletSpeedMps:n(t.bulletSpeedMps,x.bulletSpeedMps,20,150),bulletLifetimeSeconds:n(t.bulletLifetimeSeconds,x.bulletLifetimeSeconds,.25,3)}}var C={rangeM:6.5,ignitionSeconds:.45,spreadSeconds:2.2,spreadRadiusPx:24,burnSeconds:4,smokePerSecond:13,jetWidthM:.5,flowRate:1};function w(e){let t={...C,...e.flamethrower},n=(e,t,n,r)=>Number.isFinite(e)?Math.max(n,Math.min(r,e)):t;return{rangeM:n(t.rangeM,C.rangeM,1,12),ignitionSeconds:n(t.ignitionSeconds,C.ignitionSeconds,.1,10),spreadSeconds:n(t.spreadSeconds,C.spreadSeconds,.5,30),spreadRadiusPx:n(t.spreadRadiusPx,C.spreadRadiusPx,0,96),burnSeconds:n(t.burnSeconds,C.burnSeconds,.5,30),smokePerSecond:n(t.smokePerSecond,C.smokePerSecond,0,50),jetWidthM:n(t.jetWidthM,C.jetWidthM,.2,.9),flowRate:n(t.flowRate,C.flowRate,.2,2)}}var T={roundsPerSecond:1.25,launchSpeedMps:18,accelerationMps2:24,maxSpeedMps:44,lifetimeSeconds:3.1,smokePerSecond:22};function E(e){let t={...T,...e.rockets},n=(e,t,n,r)=>Number.isFinite(e)?Math.max(n,Math.min(r,e)):t;return{roundsPerSecond:n(t.roundsPerSecond,T.roundsPerSecond,.25,5),launchSpeedMps:n(t.launchSpeedMps,T.launchSpeedMps,5,60),accelerationMps2:n(t.accelerationMps2,T.accelerationMps2,0,100),maxSpeedMps:n(t.maxSpeedMps,T.maxSpeedMps,10,100),lifetimeSeconds:n(t.lifetimeSeconds,T.lifetimeSeconds,.5,8),smokePerSecond:n(t.smokePerSecond,T.smokePerSecond,0,60)}}function D(e){return{headlights:{xM:e.geometry.lengthM*.4,yM:e.geometry.widthM*.3,...e.lights?.headlights},taillights:{xM:-e.geometry.lengthM*.43,yM:e.geometry.widthM*.3,...e.lights?.taillights}}}var O=12;function k(e){return e.serviceBrakeDecelerationMps2??O}var A={porsche911997:{id:`porsche-911-997`,name:`Porsche 911 (997)`,description:`A quick, responsive rear-engine 911 with a naturally aspirated flat-six sound profile.`,make:`Porsche`,model:`911 (997)`,year:`2004–2012`,massKg:1380,frontWeightFraction:.4,sound:{engineId:`flat6`,vehicleId:`sports`,engineLabel:`Simulated flat-six · 3.8 L`,horn:{lowHz:335,highHz:400,tone:`disc`,level:.88}},geometry:{lengthM:4.43,widthM:2.03,wheelbaseM:2.35,trackWidthM:1.68,frontTrackWidthM:1.62,rearTrackWidthM:1.74,tireLengthM:.67,tireWidthM:.29},exhaust:{layout:`left-right`},lights:{headlights:{xM:1.728,yM:.608},taillights:{xM:-1.927,yM:.649}},roofRocket:{xM:-.16,yM:0,sizeM:.76,panelColor:`#a8b0b3`},machineGuns:{xM:-.14},engineForceN:18500,reversePowerRatio:.72,rollingResistance:39,coastDecelerationMps2:4,handbrakeDecelerationMps2:10.5,lateralResistance:1750,corneringAccelerationMps2:40,maxSteerAngleRad:.67,handbrakeStrength:.68,drift:{entrySpeedMps:4.5,slipAngleRad:.3},launch:{minRpm:2200,boostMps:.6,boostedBoostMps:1.8,assistDurationSeconds:.7,burnoutRampSeconds:1.05,chargedSpinSeconds:1.35,fireLifetimeSeconds:5.3},driveBoost:{gainMps:5.2,durationSeconds:2.6},image:{src:p,crop:{x:90/1774,y:74/887,width:1602/1774,height:733/887},wheelEdgeHalfWidthM:{front:.885,rear:.944}}},fordMustangGt:{id:`ford-mustang-gt-2024`,name:`Ford Mustang GT`,description:`A burbling V8 muscle car with strong acceleration and a willing rear axle.`,make:`Ford`,model:`Mustang GT`,year:`2024`,massKg:1730,frontWeightFraction:.54,sound:{engineId:`v8cross`,vehicleId:`muscle`,engineLabel:`Simulated cross-plane V8 · 5.0 L`,horn:{lowHz:330,highHz:430,tone:`trumpet`,level:1}},visual:{color:`#cc6249`,shape:`coupe`},geometry:{lengthM:4.81,widthM:1.92,wheelbaseM:2.72,trackWidthM:1.59,tireLengthM:.72,tireWidthM:.3},exhaust:{layout:`left-right`},lights:{headlights:{xM:1.826,yM:.576},taillights:{xM:-1.998,yM:.538}},roofRocket:{xM:-.1,yM:0,sizeM:.82,panelColor:`#777d80`},engineForceN:19500,reversePowerRatio:.7,rollingResistance:42,coastDecelerationMps2:3.7,handbrakeDecelerationMps2:9.2,lateralResistance:1580,corneringAccelerationMps2:35,maxSteerAngleRad:.6,handbrakeStrength:.72,drift:{entrySpeedMps:4,slipAngleRad:.3},launch:{minRpm:2600,boostMps:.5,boostedBoostMps:1.6,assistDurationSeconds:.75,burnoutRampSeconds:1.2,chargedSpinSeconds:1.5,fireLifetimeSeconds:5.6},driveBoost:{gainMps:4.3,durationSeconds:2.8},image:{src:m,crop:{x:41/1774,y:64/887,width:1687/1774,height:754/887},wheelEdgeHalfWidthM:{front:.868,rear:.87}}},bmwM4:{id:`bmw-m4-2024`,name:`BMW M4`,description:`A quick turbo straight-six coupe that rotates cleanly and rewards precise countersteer.`,make:`BMW`,model:`M4`,year:`2024`,massKg:1750,frontWeightFraction:.52,sound:{engineId:`i6`,vehicleId:`sports`,engineLabel:`Simulated turbo inline-six · 3.0 L`,turbo:!0,horn:{lowHz:345,highHz:415,tone:`disc`,level:.86}},visual:{color:`#587d9a`,shape:`coupe`},geometry:{lengthM:4.79,widthM:1.89,wheelbaseM:2.86,trackWidthM:1.54,tireLengthM:.71,tireWidthM:.29},exhaust:{layout:`left-right`},lights:{headlights:{xM:1.876,yM:.661},taillights:{xM:-1.941,yM:.661}},roofRocket:{xM:-.12,yM:0,sizeM:.8,panelColor:`#6c7d88`},engineForceN:22500,reversePowerRatio:.72,rollingResistance:42,coastDecelerationMps2:4.2,handbrakeDecelerationMps2:10,lateralResistance:1900,corneringAccelerationMps2:39,maxSteerAngleRad:.64,handbrakeStrength:.65,drift:{entrySpeedMps:4.5,slipAngleRad:.3},launch:{minRpm:2300,boostMps:.7,boostedBoostMps:1.8,assistDurationSeconds:.7,burnoutRampSeconds:1.1,chargedSpinSeconds:1.35,fireLifetimeSeconds:5.1},driveBoost:{gainMps:4.8,durationSeconds:2.6},image:{src:h,crop:{x:22/1774,y:47/887,width:1731/1774,height:795/887},scale:1.06,wheelEdgeHalfWidthM:{front:.842,rear:.851}}},jeepWrangler:{id:`jeep-wrangler-2026`,name:`Jeep Wrangler`,description:`A tall, heavy four-door SUV with deliberate steering and a wide, steady slide.`,make:`Jeep`,model:`Wrangler`,year:`2026`,massKg:2050,frontWeightFraction:.53,sound:{engineId:`v6`,vehicleId:`truck`,engineLabel:`Simulated V6 · 3.6 L`,horn:{lowHz:300,highHz:400,tone:`trumpet`,level:1}},visual:{color:`#7d8060`,shape:`suv`},geometry:{lengthM:4.78,widthM:1.88,wheelbaseM:3.01,trackWidthM:1.58,tireLengthM:.76,tireWidthM:.32},exhaust:{layout:`right`},lights:{headlights:{xM:1.818,yM:.645},taillights:{xM:-1.947,yM:.645}},roofRocket:{xM:0,yM:0,sizeM:.9,panelColor:`#777a65`},engineForceN:12500,reversePowerRatio:.73,rollingResistance:58,coastDecelerationMps2:4.8,handbrakeDecelerationMps2:11.5,lateralResistance:1850,corneringAccelerationMps2:28,maxSteerAngleRad:.53,handbrakeStrength:.64,drift:{entrySpeedMps:4.2,slipAngleRad:.3},launch:{minRpm:2200,boostMps:0,boostedBoostMps:.8,assistDurationSeconds:.8,burnoutRampSeconds:1.35,chargedSpinSeconds:1.65,fireLifetimeSeconds:5.8},driveBoost:{gainMps:2.8,durationSeconds:3},image:{src:g,crop:{x:52/1774,y:47/887,width:1720/1774,height:786/887},scale:1.04,wheelEdgeHalfWidthM:{front:.869,rear:.874}}},subaruWrx:{id:`subaru-wrx-2024`,name:`Subaru WRX`,description:`A compact turbo boxer sedan with brisk turn-in and a playful handbrake slide.`,make:`Subaru`,model:`WRX`,year:`2024`,massKg:1550,frontWeightFraction:.54,sound:{engineId:`boxer4`,vehicleId:`sports`,engineLabel:`Simulated turbo flat-four · 2.4 L`,turbo:!0,horn:{lowHz:370,highHz:450,tone:`disc`,level:.88}},visual:{color:`#547aaf`,shape:`sedan`},geometry:{lengthM:4.67,widthM:1.83,wheelbaseM:2.67,trackWidthM:1.48,tireLengthM:.69,tireWidthM:.27},exhaust:{layout:`left-right`},lights:{headlights:{xM:1.665,yM:.635},taillights:{xM:-1.784,yM:.616}},roofRocket:{xM:-.1,yM:0,sizeM:.78,panelColor:`#60758d`},engineForceN:16600,reversePowerRatio:.73,rollingResistance:39,coastDecelerationMps2:4,handbrakeDecelerationMps2:10,lateralResistance:1740,corneringAccelerationMps2:38,maxSteerAngleRad:.65,handbrakeStrength:.69,drift:{entrySpeedMps:4,slipAngleRad:.3},launch:{minRpm:2400,boostMps:.4,boostedBoostMps:1.3,assistDurationSeconds:.7,burnoutRampSeconds:1.1,chargedSpinSeconds:1.25,fireLifetimeSeconds:4.8},driveBoost:{gainMps:3.8,durationSeconds:2.8},image:{src:_,crop:{x:45/1774,y:48/887,width:1684/1774,height:793/887},scale:1.02,wheelEdgeHalfWidthM:{front:.801,rear:.811}}},audiRs3:{id:`audi-rs3-2024`,name:`Audi RS 3`,description:`A sharp five-cylinder sport sedan with punchy acceleration and fast grip recovery.`,make:`Audi`,model:`RS 3`,year:`2024`,massKg:1580,frontWeightFraction:.57,sound:{engineId:`i5`,vehicleId:`sports`,engineLabel:`Simulated turbo inline-five · 2.5 L`,turbo:!0,horn:{lowHz:400,highHz:500,tone:`disc`,level:.91}},visual:{color:`#5e7275`,shape:`sedan`},geometry:{lengthM:4.54,widthM:1.85,wheelbaseM:2.63,trackWidthM:1.52,tireLengthM:.7,tireWidthM:.28},exhaust:{layout:`left-right`},lights:{headlights:{xM:1.64,yM:.61},taillights:{xM:-1.738,yM:.61}},roofRocket:{xM:-.12,yM:0,sizeM:.76,panelColor:`#667377`},engineForceN:21e3,reversePowerRatio:.72,rollingResistance:40,coastDecelerationMps2:4.4,handbrakeDecelerationMps2:10.4,lateralResistance:1950,corneringAccelerationMps2:40,maxSteerAngleRad:.63,handbrakeStrength:.66,drift:{entrySpeedMps:4.5,slipAngleRad:.3},launch:{minRpm:2200,boostMps:.6,boostedBoostMps:1.7,assistDurationSeconds:.7,burnoutRampSeconds:1.05,chargedSpinSeconds:1.35,fireLifetimeSeconds:5.1},driveBoost:{gainMps:4.3,durationSeconds:2.7},image:{src:v,crop:{x:38/1774,y:34/887,width:1699/1774,height:805/887},wheelEdgeHalfWidthM:{front:.826,rear:.83}}},lamborghiniHuracanEvo:{id:`lamborghini-huracan-evo-2023`,name:`Lamborghini Huracán EVO`,description:`A low V10 supercar with fierce acceleration, quick response, and a high-revving voice.`,make:`Lamborghini`,model:`Huracán EVO`,year:`2023`,massKg:1450,frontWeightFraction:.43,sound:{engineId:`v10`,vehicleId:`supercar`,engineLabel:`Simulated V10 · 5.2 L`,horn:{lowHz:405,highHz:515,tone:`trumpet`,level:.92}},visual:{color:`#e0a84b`,shape:`supercar`},geometry:{lengthM:4.52,widthM:1.93,wheelbaseM:2.62,trackWidthM:1.49,frontTrackWidthM:1.43,rearTrackWidthM:1.54,tireLengthM:.69,tireWidthM:.3},exhaust:{layout:`center`},lights:{headlights:{xM:1.567,yM:.675},taillights:{xM:-1.72,yM:.695}},roofRocket:{xM:-.16,yM:0,sizeM:.7,panelColor:`#b79c57`},engineForceN:26500,reversePowerRatio:.68,rollingResistance:43,coastDecelerationMps2:4.7,handbrakeDecelerationMps2:11,lateralResistance:2250,corneringAccelerationMps2:44,maxSteerAngleRad:.63,handbrakeStrength:.7,drift:{entrySpeedMps:5,slipAngleRad:.3},launch:{minRpm:2800,boostMps:.9,boostedBoostMps:2.1,assistDurationSeconds:.65,burnoutRampSeconds:.95,chargedSpinSeconds:1.5,fireLifetimeSeconds:5.6},driveBoost:{gainMps:5.7,durationSeconds:2.5},image:{src:y,crop:{x:46/1774,y:13/887,width:1687/1774,height:852/887},wheelEdgeHalfWidthM:{front:.792,rear:.847}}},electricGt:{id:`electric-gt`,name:`Joy Ride Electric GT`,description:`An original electric fastback with instant response and a soft, choir-like low-speed warning tone.`,make:`Joy Ride`,model:`Electric GT`,year:`2026`,massKg:1850,frontWeightFraction:.5,sound:{engineId:`i4`,vehicleId:`sports`,engineLabel:`Procedural electric motor + choir-like warning tone`,electric:{fadeStartMps:20/3.6,fadeEndMps:30/3.6,motorFadeStartMps:120/3.6,motorFadeEndMps:50},horn:{lowHz:420,highHz:500,tone:`electronic`,level:.8}},visual:{color:`#dce9ed`,shape:`sedan`},geometry:{lengthM:4.75,widthM:1.9,wheelbaseM:2.88,trackWidthM:1.59,tireLengthM:.7,tireWidthM:.29},exhaust:{layout:`center`},lights:{headlights:{xM:1.964,yM:.665},taillights:{xM:-2.008,yM:.705}},roofRocket:{xM:-.12,yM:0,sizeM:.8,panelColor:`#b9cbd1`},engineForceN:23e3,reversePowerRatio:.68,rollingResistance:42,coastDecelerationMps2:4.8,handbrakeDecelerationMps2:10.5,lateralResistance:1940,corneringAccelerationMps2:37,maxSteerAngleRad:.63,handbrakeStrength:.69,drift:{entrySpeedMps:4.4,slipAngleRad:.3},launch:{minRpm:0,boostMps:0,boostedBoostMps:1.4,assistDurationSeconds:.65,burnoutRampSeconds:.95,chargedSpinSeconds:1.3,fireLifetimeSeconds:4.6},driveBoost:{gainMps:4.5,durationSeconds:2.6},image:{src:b,crop:{x:31/1774,y:50/887,width:1713/1774,height:773/887},scale:1.06,wheelEdgeHalfWidthM:{front:.86,rear:.858}}}};function j(e){return e.geometry.wheelbaseM/Math.tan(e.maxSteerAngleRad)}var M=e=>!!e&&typeof e==`object`&&!Array.isArray(e);function N(e,t){if(Object.is(e,t))return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((e,n)=>N(e,t[n]));if(!M(e)||!M(t))return!1;let n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(n=>N(e[n],t[n]))}var P=e=>Object.fromEntries(Object.entries(e).filter(([e])=>e!==`id`&&e!==`base`));function F(e,t){if(N(e,t))return;if(!M(e)||!M(t))return e;let n=Object.fromEntries(Object.entries(e).map(([e,n])=>[e,F(n,t[e])]).filter(([,e])=>e!==void 0));return Object.keys(n).length?n:void 0}function I(e){let n=Object.values(A),r=n.find(t=>t.id===e.base);if(!r)return e;let i=t(r,e),a=e;for(let e of n){let n=Object.fromEntries(Object.entries(i).filter(([t,n])=>t!==`id`&&t!==`base`&&!N(n,e[t]))),r={base:e.id,...n};N(P(t(e,r)),P(i))&&JSON.stringify(r).length<JSON.stringify(a).length&&(a=r)}return a}function L(n,r){let i=[],a=new Set,o=n;for(;r?.vehicles?.[o]&&!a.has(o);){a.add(o);let e=r.vehicles[o];i.unshift(e),o=e.base}return t({slots:e},...i.map(e=>({slots:e.slots}))).slots}function R(e){let t=l(s),n=F({game:e.game,dialog:e.dialog},t),r=e.definitions?{...Object.fromEntries(Object.entries(e.definitions).filter(([,e])=>Object.keys(e??{}).length)),...e.definitions.vehicles?{vehicles:Object.fromEntries(Object.entries(e.definitions.vehicles).map(([e,t])=>[e,I(t)]))}:{}}:void 0,i=e.player?L(e.player.vehicle,r):void 0,a=e.player?{vehicle:e.player.vehicle,...e.player.appearance&&e.player.appearance!==`auto`?{appearance:e.player.appearance}:{},...e.player.slots?{slots:Object.fromEntries(Object.entries(e.player.slots).filter(([e,t])=>!N(t,i?.[e])))}:{}}:void 0;return a?.slots&&!Object.keys(a.slots).length&&delete a.slots,{...e.audioSet&&e.audioSet!=="default"?{audioSet:e.audioSet}:{},...e.persist&&(e.persist.vehicle===!1||e.persist.audio===!1)?{persist:e.persist}:{},...r&&Object.values(r).some(e=>Object.keys(e??{}).length)?{definitions:r}:{},...a?{player:a}:{},...e.bindings?.length?{bindings:e.bindings}:{},...e.objectives&&Object.keys(e.objectives).length?{objectives:e.objectives}:{},...e.routes&&Object.keys(e.routes).length?{routes:e.routes}:{},...e.entry?{entry:e.entry}:{},...n}}export{j as a,D as c,d,l as f,f as h,S as i,A as l,u as m,C as n,E as o,c as p,w as r,k as s,R as t,s as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(t){if(t&&typeof t==`object`&&!(typeof Node<`u`&&t instanceof Node)){for(let n of Object.values(t))e(n);Object.freeze(t)}return t}var t=[`vehicle`,`objects`,`weapons`,`controls`,`settings`,`embed`,`documentation`],n=[`bottom`,`top`,`left`,`right`],r=[`move`,`click`],i=Object.freeze({showAfter:1e3,placement:`bottom`,text:`↑ ← ↓ →`,dismiss:`move`}),a=[`game`,`dialog`];function o(e,t,n){return{storage:e,default:t,control:`toggle`,valid:e=>typeof e==`boolean`,...n}}function s(e,t,n,r){return{storage:e,default:t,choices:n,control:`select`,valid:e=>typeof e==`string`&&n.includes(e),...r}}function c(e,t,n,r,i,a){return{storage:e,default:t,min:n,max:r,step:i,control:`number`,valid:e=>typeof e==`number`&&Number.isFinite(e)&&e>=n&&e<=r,...a}}function l(e,t,n,r=!1){return{storage:e,default:t,control:r?`color`:`text`,valid:e=>typeof e==`string`&&(r?/^#[\da-f]{6}$/i.test(e):!!e.trim()),...n}}function u(e,t,n=!1){return{...l(e,``,t,n),default:void 0,valid:e=>e===void 0||typeof e==`string`&&(n?/^#[\da-f]{6}$/i.test(e):!!e.trim())}}function d(e,t,n,r){return{storage:e,default:t,choices:t,control:n,valid:e=>Array.isArray(e)&&e.every(e=>typeof e==`string`&&t.includes(e)),...r}}function f(e){if(e===!1)return!0;if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return Object.keys(t).every(e=>[`showAfter`,`placement`,`text`,`dismiss`].includes(e))&&(t.showAfter===void 0||typeof t.showAfter==`number`&&Number.isFinite(t.showAfter)&&t.showAfter>=0)&&(t.placement===void 0||n.includes(t.placement))&&(t.text===void 0||typeof t.text==`string`)&&(t.dismiss===void 0||r.includes(t.dismiss))}var p={game:{masterVolume:c(`field`,1,0,1,.05,{label:`Volume`,description:`Set the master audio volume.`}),idleSound:o(`field`,!0,{label:`Idle sound`,description:`Play engine audio while the vehicle is idle.`}),quality:s(`field`,`high`,[`high`,`medium`,`low`],{label:`Quality`,description:`Choose the rendering quality for smoke, fire, and liquids.`}),tireSmoke:o(`field`,!0,{label:`Tire smoke`,description:`Show smoke from the tires.`}),vehicleShadows:o(`field`,!0,{label:`Vehicle shadows`,description:`Draw shadows beneath vehicles.`}),sparks:o(`field`,!0,{label:`Collision sparks`,description:`Show sparks when vehicles collide.`}),deform:o(`field`,!0,{label:`Vehicle deformation`,help:`Visual body deformation from collisions.`}),screenShake:o(`field`,!0,{label:`Screen shake`,description:`Shake the view during impacts and tool effects.`}),surfaceTone:s(`field`,`auto`,[`auto`,`light`,`dark`],{label:`Surface contrast`,description:`Adapt tire marks to light or dark page backgrounds.`}),debug:o(`field`,!1,{label:`Diagnostics`,description:`Show renderer diagnostics.`}),showHealthBars:o(`field`,!0,{label:`Health bars`,description:`Show vehicle health bars.`}),showVehicleMarkers:o(`field`,!0,{label:`Offscreen vehicle pointers`,description:`Point toward vehicles outside the view.`}),underglow:u(`lighting`,{label:`Underglow`,description:`Set a six-digit hex glow color, or leave unset to disable it.`},!0),underglowOpacity:c(`lighting`,.6,0,1,.05,{label:`Glow opacity`,description:`Set the strength of the underglow.`}),headlights:o(`lighting`,!0,{label:`Headlights`,description:`Enable the front lights.`}),taillights:o(`lighting`,!0,{label:`Taillights`,description:`Enable the rear lights.`}),brakeLights:o(`lighting`,!0,{label:`Brake lights`,description:`Brighten the rear lights while braking.`}),vehicleDestructible:o(`field`,!0,{label:`Vehicle damage`,description:`Allow vehicles to take damage.`}),toolsEnabled:o(`field`,!0,{label:`Tools`,description:`Enable or disable all vehicle tools, including boost.`}),viewportWalls:o(`field`,!0,{label:`Viewport walls`,help:`Keep vehicles inside the visible screen.`}),autoPaint:o(`field`,!1,{label:`Automatic paint`,help:`Turn small colored page elements into paint.`}),showToolbar:o(`field`,!0,{label:`Vehicle hover toolbar`,description:`Show quick controls when hovering over the vehicle.`,visitor:!1}),hint:{storage:`field`,default:!1,control:`hint`,label:`Vehicle hint`,description:`Show a hint after arrival, or false to keep it hidden.`,visitor:!1,valid:f}},dialog:{showTouchControls:o(`field`,!0,{label:`Touch controls`,description:`Show the driving controls on touch devices.`,visitor:!1}),dialogTheme:s(`field`,`auto`,[`auto`,`light`,`dark`],{label:`Theme`,description:`Match the page theme or choose light or dark.`,visitor:!1}),showGameSettings:o(`field`,!0,{label:`Show game settings`,help:`Show the settings tab. Vehicle switching, driving, and reset stay available when off.`,visitor:!1}),vehicleTabs:d(`field`,t,`tabs`,{label:`Visible tabs`,description:`Choose which tabs appear in the vehicle dialog.`,visitor:!1}),showLogo:o(`field`,!0,{label:`Joy Ride logo`,description:`Show the Joy Ride logo in the dialog.`,visitor:!1}),showGithub:o(`field`,!0,{label:`GitHub link`,description:`Show the GitHub link in the dialog.`,visitor:!1}),accentColor:u(`field`,{label:`Accent color`,description:`Set the dialog accent using six-digit hex.`,visitor:!1},!0),dialogFontFamily:u(`field`,{label:`Dialog font`,description:`Set a CSS font family; inherit uses the page font.`,visitor:!1}),showVehicleNames:o(`field`,!0,{label:`Vehicle names`,description:`Show vehicle names in the dialog.`,visitor:!1})}},m=Object.entries(p).flatMap(([e,t])=>Object.entries(t).map(([t,n])=>({...n,key:t,category:e}))),h=e(Object.fromEntries(a.map(e=>[e,Object.fromEntries(m.filter(t=>t.category===e).map(e=>[e.key,structuredClone(e.default)]))])));e(p),e(m);export{a,e as c,h as i,i as n,r as o,t as r,n as s,m as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./configuration~index~embed~bookmarklet~vehicle-popover~EmbedPanel~Documentation~JoyRideView~~n76yhyet-zf1LIsS8.js";var t=e.filter(e=>e.storage===`lighting`),n=Object.freeze(Object.fromEntries(t.map(e=>[e.key,e.default])));function r(e={}){let n={};for(let r of t){let t=e[r.key];n[r.key]=r.control===`number`&&typeof t==`number`&&Number.isFinite(t)?Math.max(r.min,Math.min(r.max,t)):r.valid(t)?t:r.default}return n}export{r as n,n as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as e}from"./definitions~index~embed~bookmarklet-BfjknPZN.js";var t=e.map(e=>`Digit${e}`),n=[{id:`accelerate`,label:`Accelerate`,keys:[`W`,`↑`],codes:[`KeyW`,`ArrowUp`]},{id:`reverse`,label:`Reverse / brake with gas`,keys:[`S`,`↓`],codes:[`KeyS`,`ArrowDown`]},{id:`left`,label:`Steer left`,keys:[`A`,`←`],codes:[`KeyA`,`ArrowLeft`]},{id:`right`,label:`Steer right`,keys:[`D`,`→`],codes:[`KeyD`,`ArrowRight`]},{id:`handbrake`,label:`Handbrake`,keys:[`Space`],codes:[`Space`]},{id:`boost`,label:`Hold boost / charge burnout launch`,keys:[`Shift`],codes:[`ShiftLeft`,`ShiftRight`]},...e.map(e=>({id:`slot${e}`,label:`Activate slot ${e}`,keys:[String(e)],codes:[`Digit${e}`]})),{id:`slowMo`,label:`Hold slow-mo`,keys:[`V`],codes:[`KeyV`]},{id:`underglow`,label:`Toggle underglow`,keys:[`U`],codes:[`KeyU`]},{id:`horn`,label:`Horn`,keys:[`H`],codes:[`KeyH`]},{id:`clean`,label:`Reset screen`,keys:[`C`],codes:[`KeyC`]},{id:`targets`,label:`Flash destroyable objects`,keys:[`F`],codes:[`KeyF`]},{id:`pause`,label:`Pause`,keys:[`P`],codes:[`KeyP`]},{id:`exit`,label:`Exit`,keys:[`Esc`],codes:[`Escape`]}],r=new Set([`KeyW`,`KeyA`,`KeyS`,`KeyD`,`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Space`,`ShiftLeft`,`ShiftRight`,...t]),i=new Set([`KeyU`,`KeyC`,`KeyF`,`KeyV`,`KeyP`,`KeyB`,`KeyG`,`KeyZ`,`KeyX`,`Escape`]);function a(e){return(e instanceof Event?e.composedPath():[e]).some(e=>e instanceof Element&&!!e.closest(`input, textarea, select, [contenteditable="true"]`))}function o(e,t){return{throttle:e?1:-Number(t),brake:Number(e&&t)}}function s(t){return{...o(t.has(`KeyW`)||t.has(`ArrowUp`),t.has(`KeyS`)||t.has(`ArrowDown`)),steer:Number(t.has(`KeyA`)||t.has(`ArrowLeft`))-Number(t.has(`KeyD`)||t.has(`ArrowRight`)),action:t.has(`Space`),boost:t.has(`ShiftLeft`)||t.has(`ShiftRight`),slots:e.filter(e=>t.has(`Digit${e}`))}}var c={world:1,foreground:2,backdrop:3,controls:4,dialogBackdrop:20,dialog:21};function l(e){return`calc(var(--joy-ride-z-index, ${c.world}) + ${c[e]-c.world})`}var u=`[data-jr-foreground]`,d=new WeakMap;function f(e=u){let t=new Map,n=!1,r=!1,i=(e,t)=>{if(--t.users>0)return;d.delete(e);let n=e.style;n.zIndex===l(`foreground`)&&(t.zIndex?n.setProperty(`z-index`,t.zIndex,t.zIndexPriority):n.removeProperty(`z-index`)),t.positioned&&n.position===`relative`&&!t.position?n.removeProperty(`position`):t.positioned&&n.position===`relative`&&t.position===`static`&&n.setProperty(`position`,t.position,t.positionPriority),e.getAttribute(`data-jr-ui`)===``&&(t.ui===null?e.removeAttribute(`data-jr-ui`):e.setAttribute(`data-jr-ui`,t.ui))},a=new MutationObserver(()=>{r||(r=!0,queueMicrotask(()=>{r=!1,n||o()}))}),o=()=>{if(n)return;let r=new Set(e?[...document.querySelectorAll(e)].filter(e=>e instanceof HTMLElement&&e!==document.body&&e!==document.documentElement):[]);a.disconnect();for(let[e,n]of t)r.has(e)||(i(e,n),t.delete(e));for(let e of r){let n=e.style;if(!t.has(e)){let r=d.get(e);r?r.users++:(r={position:n.position,positionPriority:n.getPropertyPriority(`position`),zIndex:n.zIndex,zIndexPriority:n.getPropertyPriority(`z-index`),ui:e.getAttribute(`data-jr-ui`),positioned:!1,users:1},d.set(e,r)),t.set(e,r)}let r=getComputedStyle(e);r.position===`static`&&(n.setProperty(`position`,`relative`,`important`),t.get(e).positioned=!0),r.zIndex&&r.zIndex!==`auto`||n.setProperty(`z-index`,l(`foreground`),`important`),e.setAttribute(`data-jr-ui`,``)}a.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`class`,`id`,`data-jr-foreground`,...[...e.matchAll(/\[([\w-]+)/g)].map(e=>e[1])]})};return o(),{refresh:o,dispose(){n=!0,a.disconnect();for(let[e,n]of t)i(e,n);t.clear()}}}export{a,s as c,o as i,i as l,c as n,n as o,l as r,r as s,f as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e,a as t,c as n,d as r,f as i,g as a,h as o,i as s,l as c,m as l,n as u,o as d,p as f,s as p,u as m,v as h,w as g,y as _}from"./definitions~index~embed~bookmarklet-BfjknPZN.js";import{n as v}from"./definitions~index~embed~vehicle-popover~browser-session-core~renderer-RDNEXk_b.js";var y={health:a},b={burnSeconds:a,ignitionSeconds:f,spreadSeconds:f},x={health:a,burnSeconds:a,blastRadiusPx:a},S={scale:_,opacity:_,crushedClass:h,crushedPaintColor:(e,t)=>p(e,t)},C={kind:h,color:(e,t)=>p(e,t,!0),distanceM:f,opacity:_,deformation:(e,t)=>l(e,t,0,4)},w=[`click`,`check`,`toggle`,`pickup`,`parking`],T=(e,t)=>{typeof e!=`string`&&c(t,`expected a space-separated class string`)},E={preset:(e,t)=>o(e,w,t),when:(e,t)=>o(e,[`enter`,`stop`],t),dwellSeconds:f,maxSpeedMps:f,action:(e,t)=>o(e,[`event`,`click`,`check`,`uncheck`,`toggle`],t),event:h,repeat:(e,t)=>o(e,[`visit`,`vehicle`,`scene`],t),vehicles:(e,t)=>o(e,[`player`,`all`],t),target:h,consume:t,exitMarginPx:f,containment:(e,t)=>o(e,[`overlap`,`center`,`full`],t),requireExit:t,suspended:t,reveal:(e,t)=>o(e,[`departed`],t),enteredClass:T,dwellingClass:T,successClass:T};function D(t,n){typeof t!=`boolean`&&(typeof t==`string`?o(t,w,n):m(e(t,n),E,n))}function O(e,t,n=!0){g(e,t,n,c)}function k(t,n,r=new Set){if(t!==null&&typeof t!=`string`&&typeof t!=`boolean`){if(typeof t==`number`)l(t,n,-1/0);else{if(typeof t!=`object`)return c(n,`metadata must be JSON-compatible`);if(r.has(t)&&c(n,`metadata cannot contain cycles`),r.add(t),Array.isArray(t))t.forEach((e,t)=>k(e,`${n}.${t}`,r));else for(let[i,a]of Object.entries(e(t,n)))k(a,`${n}.${i}`,r);r.delete(t)}}}function A(t,n,i=!0){if(t===!1)return;let a=e(t,n);m(a,{field:(e,t)=>o(e,[`fps`,`speed`,`rpm`,`gear`,`health`,`points`],t),unit:(e,t)=>o(e,[`mph`,`kmh`,`mps`],t),precision:(e,t)=>{l(e,t,0,4),Number.isInteger(e)||c(t,`precision must be an integer`)}},n),i&&!r(a,`field`)&&c(`${n}.field`,`choose one HUD metric`),r(a,`unit`)&&r(a,`field`)&&a.field!==`speed`&&c(`${n}.unit`,`only speed has a unit`)}var j={id:h,enabled:t,debris:e=>{typeof e!=`boolean`&&v(e)},trigger:D,hud:A,meta:(t,n)=>{e(t,n),k(t,n)},object:h,solid:t,pushable:t,points:f,pickupEffectColor:(e,t)=>p(e,t),liquid:(t,n)=>{if(t===!1)return;let i=e(t,n);m(i,C,n),r(i,`kind`)||c(`${n}.kind`,`choose a liquid`)},breakable:(e,t)=>d(e,t,y),burnable:(e,t)=>d(e,t,b),combustible:(e,t)=>d(e,t,x),crushable:(e,t)=>d(e,t,S)},M={id:h,vehicle:h,appearance:s,slots:O};function N(t){let n=e(t,`object`);return m(n,{...j,hud:(e,t)=>A(e,t,!1)},`object`),structuredClone(n)}function P(t){let r=e(t,`object`);return m(r,j,`object`),n(r.combustible)&&n(r.breakable)&&c(`object.combustible`,`combustible excludes breakable`),n(r.crushable)&&n(r.breakable)&&c(`object.crushable`,`crushable excludes breakable`),n(r.crushable)&&r.solid===!0&&c(`object.solid`,`crushable objects cannot be solid`),n(r.hud)&&(n(r.breakable)||n(r.burnable)||r.pushable===!0||n(r.liquid))&&c(`object.hud`,`HUD output cannot also own artwork or a liquid field`),structuredClone(r)}function F(t){let n=e(t,`vehicle`);m(n,{...M,slots:(e,t)=>O(e,t,!1)},`vehicle`);let r=n.slots;if(r)for(let[e,t]of Object.entries(r))t&&t.action!==void 0&&O({[e]:t},`vehicle.slots`);return structuredClone(n)}function I(t){let n=e(t,`vehicle`);return m(n,M,`vehicle`),h(n.vehicle,`vehicle.vehicle`),structuredClone(n)}function L(t){let n=e(t,`player`);return i(n,[`vehicle`,`appearance`,`slots`],`player`),I(n)}function R(t,n){let i=e(t,n);m(i,{order:(e,t)=>o(e,[`ordered`,`any`],t),progress:(e,t)=>o(e,[`vehicle`,`scene`],t),event:h,stops:(t,n)=>{Array.isArray(t)&&t.length||c(n,`expected at least one stop`);let r=new Set;for(let[i,a]of t.entries()){let t;if(typeof a==`string`)t=h(a,`${n}.${i}`);else{let r=e(a,`${n}.${i}`);m(r,{target:h,when:E.when,dwellSeconds:f,maxSpeedMps:f},`${n}.${i}`),t=h(r.target,`${n}.${i}.target`)}r.has(t)&&c(n,`duplicate stop ${t}`),r.add(t)}}},n),r(i,`stops`)||c(`${n}.stops`,`expected at least one stop`)}function z(e){return R(e,`route`),structuredClone(e)}function B(t,n){let r=e(t,n);if(Object.hasOwn(r,`steps`)){i(r,[`steps`,`order`,`progress`,`event`],n);let{steps:e,...t}=r;R({...t,stops:e},n);return}let s={event:h,progress:(e,t)=>o(e,[`vehicle`,`scene`],t)};r.type===`score`?(m(r,{...s,type:(e,t)=>o(e,[`score`],t),points:a},n),a(r.points,`${n}.points`),r.progress===`vehicle`&&c(`${n}.progress`,`score objectives use the shared scene score`)):(m(r,{...s,type:(e,t)=>o(e,[`collect`,`crush`,`break`,`ignite`],t),count:(e,t)=>{a(e,t),Number.isInteger(e)||c(t,`expected a positive whole number`)},targets:(e,t)=>{Array.isArray(e)&&e.length||c(t,`expected at least one object ID`);let n=new Set;for(let[r,i]of e.entries()){let e=h(i,`${t}.${r}`);n.has(e)&&c(t,`duplicate target ${e}`),n.add(e)}typeof r.count==`number`&&r.count>n.size&&c(t,`count exceeds the number of distinct targets`)}},n),o(r.type,[`collect`,`crush`,`break`,`ignite`],`${n}.type`),a(r.count,`${n}.count`),Number.isInteger(r.count)||c(`${n}.count`,`expected a positive whole number`))}function V(e){return B(e,`objective`),structuredClone(e)}function H(e){return e&&typeof e==`object`&&(Object.values(e).forEach(H),Object.freeze(e)),e}function U(n){let d=e(n,`definitions`);i(d,[`liquids`,`vehicles`,`objects`,`routes`,`objectives`],`definitions`);for(let[n,g]of Object.entries(d)){if(g===void 0)continue;let d=e(g,`definitions.${n}`);for(let[g,v]of Object.entries(d)){let d=`definitions.${n}.${g}`;(!/^[a-z][a-z0-9-]{0,63}$/.test(g)||[`constructor`,`prototype`,`__proto__`].includes(g))&&c(d,`use a lowercase recipe name`);let y=e(v,d);if(n===`objects`)P(y);else if(n===`routes`)R(y,d);else if(n===`objectives`)B(y,d);else if(n===`liquids`)m(y,{base:h,color:p,thickness:_,opacity:_,deformation:(e,t)=>l(e,t,0,4),conductive:t,burnable:t,burnLifetime:a,fireSpreadMps:a,effect:(t,n)=>{let i=e(t,n);m(i,{lifetime:(t,n)=>{let i=e(t,n);m(i,{unit:(e,t)=>o(e,[`seconds`,`distanceM`],t),amount:a},n),r(i,`unit`)&&r(i,`amount`)||c(n,`unit and amount are required`)},modifiers:(t,n)=>{for(let[r,i]of Object.entries(e(t,n)))f(i,`${n}.${r}`)},additiveModifiers:(t,n)=>{for(let[r,i]of Object.entries(e(t,n)))l(i,`${n}.${r}`,-1/0)},intensity:(e,t)=>o(e,[`linear`,`pulse`,`constant`],t)},n),r(i,`lifetime`)&&r(i,`modifiers`)||c(n,`lifetime and modifiers are required`)}},d),h(y.base,`${d}.base`);else{i(y,`base.name.description.make.model.year.massKg.health.frontWeightFraction.geometry.exhaust.lights.roofRocket.machineGuns.flamethrower.rockets.lightning.sound.visual.engineForceN.reversePowerRatio.maxReverseSpeedMps.rollingResistance.coastDecelerationMps2.handbrakeDecelerationMps2.serviceBrakeDecelerationMps2.lateralResistance.corneringAccelerationMps2.maxSteerAngleRad.handbrakeStrength.drift.launch.driveBoost.image.appearance.slots`.split(`.`),d),h(y.base,`${d}.base`),r(y,`appearance`)&&s(y.appearance,`${d}.appearance`),r(y,`slots`)&&O(y.slots,`${d}.slots`);for(let[e,t]of Object.entries(y))typeof t==`number`&&l(t,`${d}.${e}`,-1/0);k(u({},y),d)}}for(let e of Object.keys(d)){let t=new Set,r=e;for(;r&&Object.hasOwn(d,r);)t.has(r)&&c(`definitions.${n}.${e}.base`,`recipe inheritance contains a cycle`),t.add(r),r=d[r].base}}return H(structuredClone(n))}export{L as a,F as c,x as d,S as f,P as i,y as l,E as m,V as n,z as o,C as p,N as r,I as s,U as t,b as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as e}from"./definitions~index~embed~bookmarklet~vehicle-popover~Documentation~JoyRideView~browser-sessi~fklztn3g-Dt96jol6.js";var t=[1,2,3,4,5,6,7,8,9],n=[`eject`,`machineGun`,`flamethrower`,`rocket`,`ghost`,`attractor`,`lightning`,`boost`],r=Symbol(`prepared vehicle slots`),i=Object.freeze({1:Object.freeze({action:`eject`,liquid:`oil`,activation:`hold`,rate:6,amount:.65}),2:Object.freeze({action:`machineGun`,activation:`hold`}),3:Object.freeze({action:`flamethrower`,activation:`hold`}),4:Object.freeze({action:`rocket`,activation:`hold`}),5:Object.freeze({action:`ghost`,activation:`hold`}),6:Object.freeze({action:`attractor`,activation:`hold`}),7:Object.freeze({action:`lightning`,activation:`hold`})});function a(e){if(!Number.isInteger(e)||e<1||e>9)throw RangeError(`Vehicle slots use whole numbers from 1 to 9.`);return e}var o=new Set(n),s=new Set([`action`,`activation`]),c=new Set([...s,`liquid`,`rate`,`amount`]);function l(e,t=`slots`,n=!0,r=(e,t)=>{throw TypeError(`${e}: ${t}`)}){(!e||typeof e!=`object`||Array.isArray(e))&&r(t,`expected a slot configuration object.`);for(let[i,a]of Object.entries(e)){if(/^[1-9]$/.test(i)||r(`${t}.${i}`,`slot must be from 1 to 9.`),a===!1)continue;(!a||typeof a!=`object`||Array.isArray(a))&&r(`${t}.${i}`,`expected an action or false.`);let e=a;!n&&e.action===void 0||typeof e.action==`string`&&o.has(e.action)||r(`${t}.${i}.action`,`choose a supported vehicle action.`),e.activation!==void 0&&e.activation!==`tap`&&e.activation!==`hold`&&r(`${t}.${i}.activation`,`choose tap or hold.`);let l=e.action===`eject`||!n&&e.action===void 0?c:s;for(let n of Object.keys(e))l.has(n)||r(`${t}.${i}.${n}`,`unsupported option for this action.`);e.action===`eject`&&n&&(typeof e.liquid!=`string`||!e.liquid.trim())&&r(`${t}.${i}.liquid`,`choose a liquid definition.`),e.liquid===void 0||typeof e.liquid==`string`&&e.liquid.trim()||r(`${t}.${i}.liquid`,`choose a liquid definition.`);for(let n of[`rate`,`amount`])e[n]!==void 0&&(typeof e[n]!=`number`||!Number.isFinite(e[n])||e[n]<=0)&&r(`${t}.${i}.${n}`,`expected a positive finite amount.`)}}function u(n){if(n&&typeof n==`object`&&n[r])return n;l(n);let a={...i};for(let e of t){let t=n[e];t!==void 0&&(a[e]=t===!1?!1:t.action===`eject`?Object.freeze({activation:`hold`,rate:6,amount:.65,...t}):Object.freeze({activation:`hold`,...t}))}for(let t of Object.values(a))t&&t.action===`eject`&&e(t.liquid);return Object.defineProperty(a,r,{value:!0}),Object.freeze(a)}var d=class extends Error{path;code=`JR_INVALID_CONFIGURATION`;constructor(e,t){super(`${e}: ${t}`),this.path=e,this.name=`PlaygroundConfigurationError`}},f=(e,t)=>{throw new d(e,t)},p=(e,t)=>{if(!e||typeof e!=`object`||Array.isArray(e))return f(t,`expected an option object`);let n=Object.getPrototypeOf(e),r=n&&Object.getOwnPropertyDescriptor(n,`constructor`)?.value;return n!==null&&(Object.getPrototypeOf(n)!==null||typeof r!=`function`||Function.prototype.toString.call(r)!==Function.prototype.toString.call(Object))?f(t,`expected an option object`):e},m=(e,t)=>Object.hasOwn(e,t)&&e[t]!==void 0,h=e=>e!==void 0&&e!==!1,g=(e,t,n)=>{for(let r of Object.keys(e))t.includes(r)||f(`${n}.${r}`,`unknown option`)},_=(e,t)=>(typeof e==`string`&&e.trim()||f(t,`expected a non-empty string`),e),v=(e,t)=>{typeof e!=`boolean`&&f(t,`expected true or false`)},y=(e,t,n=0,r=1/0,i=!1)=>{(typeof e!=`number`||!Number.isFinite(e)||(i?e<=n:e<n)||e>r)&&f(t,`expected a finite number ${i?`greater than`:`at least`} ${n}${r<1/0?` and at most ${r}`:``}`)},b=(e,t,n)=>{typeof e==`string`&&t.includes(e)||f(n,`expected ${t.join(`, `)}`)},x=(e,t,n=!1)=>{n&&e===`auto`||typeof e==`string`&&/^#[\da-f]{6}$/i.test(e)||Array.isArray(e)&&e.length===3&&e.every(e=>typeof e==`number`&&Number.isFinite(e)&&e>=0&&e<=255)||f(t,`expected a six-digit hex color or RGB tuple`)},S=(e,t,n)=>{g(e,Object.keys(t),n);for(let[r,i]of Object.entries(t))m(e,r)&&i(e[r],`${n}.${r}`)},C=(e,t)=>y(e,t,0,1/0,!0),w=(e,t)=>y(e,t,0,1),T=(e,t)=>y(e,t),E=(e,t)=>b(e,[`auto`,`light`,`dark`],t),D=(e,t,n)=>{typeof e!=`boolean`&&S(p(e,t),n,t)};function O(e,t,n=[]){if(t===void 0||t===!0&&e&&typeof e==`object`&&!Array.isArray(e))return e;if(t&&typeof t==`object`&&!Array.isArray(t)){let r=p(t,`object`);n.length===2&&n[0]===`slots`&&r.action!==void 0&&e&&typeof e==`object`&&e.action!==r.action&&(e=void 0);let i={...e&&typeof e==`object`&&!Array.isArray(e)?e:{}};for(let[e,r]of Object.entries(t))[`__proto__`,`prototype`,`constructor`].includes(e)&&f(e,`reserved option name`),r!==void 0&&(i[e]=O(i[e],r,[...n,e]));return i}return t}function k(...e){let t={};for(let n of e){if(n==null)continue;let e={...p(n,`object`)};for(let t of[`trigger`])typeof e[t]==`string`&&(e[t]={preset:e[t]});t=O(t,e)}return structuredClone(t)}export{t as C,a as S,p as _,v as a,i as b,h as c,m as d,g as f,C as g,b as h,E as i,f as l,y as m,O as n,D as o,T as p,d as r,x as s,k as t,S as u,_ as v,l as w,u as x,w as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){if(typeof e==`string`){if(!/^#[\da-f]{6}$/i.test(e))throw RangeError(`Use a six-digit hex color or an RGB tuple.`);return[1,3,5].map(t=>parseInt(e.slice(t,t+2),16))}if(!Array.isArray(e)||e.length!==3||e.some(e=>!Number.isFinite(e)||e<0||e>255))throw RangeError(`RGB channels must be finite numbers from 0 to 255.`);return[...e]}function t(e){let t=typeof e==`string`?e:e.kind;if(!Object.hasOwn(i,t))throw Error(`Unknown liquid: ${t}`);return t}var n={oil:{family:`oil`,conductive:!1,burnable:!0,deformation:1,thickness:.86,alpha:1,color:[5,8,9],effectDistanceM:30,treadDistanceM:30,minimumGrip:.28,burnSeconds:12,burnLifetime:12,fireSpreadMps:3.2},water:{family:`water`,conductive:!0,burnable:!1,deformation:1,thickness:.14,alpha:.52,color:[116,172,196],effectDistanceM:0,treadDistanceM:15,minimumGrip:1},paint:{family:`paint`,conductive:!1,burnable:!1,deformation:1,thickness:.78,alpha:1,color:[205,49,57],effectDistanceM:0,treadDistanceM:30,minimumGrip:1},mud:{family:`mud`,conductive:!1,burnable:!1,deformation:1,thickness:.98,alpha:1,color:[104,72,45],effectDistanceM:18,treadDistanceM:34,minimumGrip:.45,speedFactor:.78,driveForceFactor:.82,contactGrip:.52,contactSpeedFactor:.72,contactDriveForceFactor:.8}},r={gloss:0,relief:0,film:0,grain:0,fineSpray:1},i={...n,"iridescent-oil":{...n.oil,color:[22,29,31]},"clear-water":{...n.water,color:[115,173,187]},"wet-clay":{...n.mud,color:[133,91,59]},"concept-water":{...n.water,color:[104,151,159]},"concept-oil":{...n.oil,color:[17,22,24]},"concept-syrup":{...n.paint,color:[159,75,14]},"concept-clay":{...n.mud,color:[114,82,61]},"concept-lava":{...n.mud,color:[62,30,22]},"concept-acid":{...n.water,alpha:.82,color:[137,182,31]},"concept-paint":{...n.paint}},a={oil:r,water:r,paint:r,mud:r,"iridescent-oil":{gloss:.72,relief:.7,film:.65,grain:0,fineSpray:1},"clear-water":{gloss:.85,relief:.85,film:0,grain:0,fineSpray:1},"wet-clay":{gloss:.28,relief:.55,film:0,grain:.7,fineSpray:1},"concept-water":{...r,fineSpray:1},"concept-oil":{...r,fineSpray:1},"concept-syrup":{...r,fineSpray:1},"concept-clay":{...r,fineSpray:1},"concept-lava":{...r,fineSpray:1},"concept-acid":{...r,fineSpray:1},"concept-paint":{...r,fineSpray:1}};function o(e){return i[e].family}var s={"concept-water":{name:`Water`,description:`Fast spreading · low viscosity · clear wakes`,gravity:1800,viscosity:2.5,cohesion:20,yieldStress:0,contactDepth:.06,wetting:.3,roughness:.07,absorption:.22,iridescence:0,sediment:0,settleSeconds:12},"concept-oil":{name:`Motor oil`,description:`Slow sheets · high viscosity · persistent tire coating`,gravity:650,viscosity:12,cohesion:16,yieldStress:0,contactDepth:.16,wetting:4,roughness:.12,absorption:20,iridescence:.45,sediment:0,settleSeconds:10},"concept-syrup":{name:`Amber syrup`,description:`Slow leveling · cohesive flow · persistent coating`,gravity:220,viscosity:30,cohesion:25,yieldStress:.05,contactDepth:.32,wetting:34,roughness:.09,absorption:1.7,iridescence:0,sediment:0,settleSeconds:10},"concept-clay":{name:`Clay slurry`,description:`Yield resistance · persistent furrows · suspended sediment`,gravity:120,viscosity:22,cohesion:12,yieldStress:.8,contactDepth:.22,wetting:18,roughness:.58,absorption:5,iridescence:0,sediment:.6,settleSeconds:8},"concept-lava":{name:`Basalt lava`,description:`High yield resistance · slow transport · heavy spray`,gravity:100,viscosity:38,cohesion:30,yieldStress:1.2,contactDepth:.35,wetting:35,roughness:.65,absorption:16,iridescence:0,sediment:.85,settleSeconds:14,thermal:[1,.9,.05,0],atmosphere:{emission:.65,emissionColor:[255,112,18],pulseSeconds:7.5,vaporOpacity:.56,vaporRise:22,vaporColor:[207,104,40],embers:{density:.45,color:[255,143,35],rise:20,size:.7,brightness:.85}}},"concept-acid":{name:`Acid`,description:`Fast wetting · low viscosity · fine spray`,gravity:2100,viscosity:1.2,cohesion:14,yieldStress:0,contactDepth:.045,wetting:.1,roughness:.045,absorption:.65,iridescence:.08,sediment:0,settleSeconds:12,thermal:[.08,0,.45,.8],atmosphere:{emission:.75,emissionColor:[168,255,38],pulseSeconds:6.5,vaporOpacity:.58,vaporRise:18,vaporColor:[119,181,34]}},"concept-paint":{name:`Paint`,description:`Opaque pigment · local color mixing · marbled tire pickup`,gravity:420,viscosity:18,cohesion:18,yieldStress:.1,contactDepth:.2,wetting:9,roughness:.18,absorption:24,iridescence:0,sediment:0,settleSeconds:12,mixing:!0,surface:{microRelief:0,heightNormalScale:2.4,clearcoat:1}}};function c(e){if(e.startsWith(`custom:`))return d.get(e)??null;let t=e===`paint`?`concept-paint`:e===`iridescent-oil`?`concept-oil`:e===`clear-water`?`concept-water`:e===`wet-clay`?`concept-clay`:e;return t in s?s[t]:null}var l={water:{coverage:.5,breakup:.32,film:.08,gloss:.9,iridescence:0,grain:0,drain:2.3,pitchM:.12,spray:1.1,impact:.3,carryM:5,emission:0},oil:{coverage:.82,breakup:.18,film:.78,gloss:.85,iridescence:.55,grain:0,drain:1.5,pitchM:.12,spray:.8,impact:.6,carryM:23,emission:0},paint:{coverage:.96,breakup:.08,film:.94,gloss:.38,iridescence:0,grain:0,drain:1.15,pitchM:.12,spray:.5,impact:.8,carryM:26,emission:0},mud:{coverage:.92,breakup:.36,film:.66,gloss:.3,iridescence:0,grain:.9,drain:1.3,pitchM:.12,spray:.45,impact:1,carryM:20,emission:0}};function u(e){let t=l[o(e)],n=c(e);return n?{...t,gloss:0,iridescence:0,grain:n.sediment,spray:1/(1+n.viscosity*.06),impact:Math.min(1,n.cohesion/30),emission:0,carryM:Math.min(28,4+n.viscosity*.7),breakup:Math.min(.65,.16+n.yieldStress*.3),drain:1.2+2/(1+n.viscosity)}:{...t,gloss:0,iridescence:0,emission:0}}var d=new Map,f=new Map;function p(e){return f.get(e)}function m(t,r){if(!/^[a-z][a-z0-9-]{0,63}$/.test(t))throw Error(`Liquid names use lowercase letters, digits and hyphens.`);let o=`custom:${t}`;for(let e of[`conductive`,`burnable`])if(r[e]!==void 0&&typeof r[e]!=`boolean`)throw TypeError(`Liquid ${e} must be a boolean.`);if(Object.hasOwn(i,o))throw Error(`Liquid already defined: ${t}`);if(!Object.hasOwn(i,r.base))throw Error(`Choose a defined base liquid.`);for(let e of[r.thickness,r.opacity])if(e!==void 0&&(!Number.isFinite(e)||e<0||e>1))throw RangeError(`Thickness and opacity must be between 0 and 1.`);if(r.deformation!==void 0&&(!Number.isFinite(r.deformation)||r.deformation<0||r.deformation>4))throw RangeError(`Deformation must be between 0 and 4.`);let s=r.effect;for(let e of[r.burnLifetime,r.fireSpreadMps])if(e!==void 0&&(!Number.isFinite(e)||e<=0))throw RangeError(`Liquid burn lifetime and fire spread speed must be positive finite numbers.`);if(s&&(![`seconds`,`distanceM`].includes(s.lifetime.unit)||!Number.isFinite(s.lifetime.amount)||s.lifetime.amount<=0||Object.values(s.modifiers).some(e=>e!==void 0&&(!Number.isFinite(e)||e<0))||Object.values(s.additiveModifiers??{}).some(e=>e!==void 0&&!Number.isFinite(e))))throw RangeError(`Invalid liquid status effect.`);let l=i[r.base],u=r.burnable??l.burnable,p={...l,conductive:r.conductive??l.conductive,burnable:u,color:e(r.color??l.color),thickness:r.thickness??l.thickness,deformation:r.deformation??l.deformation,alpha:r.opacity??l.alpha,burnLifetime:r.burnLifetime??l.burnLifetime??l.burnSeconds??(u?n.oil.burnLifetime:void 0),fireSpreadMps:r.fireSpreadMps??l.fireSpreadMps??(u?n.oil.fireSpreadMps:void 0)};i[o]=Object.freeze(p),a[o]={...a[r.base]};let m=c(r.base),h=p.thickness/Math.max(.05,l.thickness);return d.set(o,m?{...m,viscosity:m.viscosity*Math.max(.05,h),yieldStress:m.yieldStress*h}:null),s&&f.set(o,{...s,lifetime:{...s.lifetime},modifiers:{...s.modifiers},additiveModifiers:s.additiveModifiers?{...s.additiveModifiers}:void 0}),Object.freeze({kind:o})}function h(e){e.startsWith(`custom:`)&&(delete i[e],delete a[e],d.delete(e),f.delete(e))}export{i as a,t as c,c as i,u as l,h as n,o,e as r,a as s,m as t,p as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(t,n=new WeakMap){if(typeof t==`function`)throw Error(`Functions are not checkpoint state`);if(typeof t!=`object`||!t)return t;if(n.has(t))return n.get(t);if(typeof HTMLCanvasElement<`u`&&t instanceof HTMLCanvasElement){let e=document.createElement(`canvas`);return e.width=t.width,e.height=t.height,e.getContext(`2d`)?.drawImage(t,0,0),n.set(t,e),e}if(typeof Node<`u`&&t instanceof Node||typeof Range<`u`&&t instanceof Range)return t;if(typeof ImageData<`u`&&t instanceof ImageData)return new ImageData(new Uint8ClampedArray(t.data),t.width,t.height);if(t instanceof Date)return new Date(t.getTime());if(Array.isArray(t)){let r=[];n.set(t,r);for(let i of t)r.push(e(i,n));return r}if(ArrayBuffer.isView(t))return t instanceof DataView?new DataView(t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)):new t.constructor(t);if(t instanceof Map){let r=new Map;n.set(t,r);for(let[i,a]of t)r.set(e(i,n),e(a,n));return r}if(t instanceof Set){let r=new Set;n.set(t,r);for(let i of t)r.add(e(i,n));return r}let r=Object.getPrototypeOf(t);if(r!==Object.prototype&&!Object.keys(t).length)throw Error(`Cannot checkpoint ${t.constructor?.name??`unknown engine resource`}`);let i=Object.create(r);n.set(t,i);for(let[r,a]of Object.entries(t))i[r]=e(a,n);return i}var t=Object.freeze([`paper`,`leaf`]),n=Object.freeze([`center`,`top`,`top-right`,`right`,`bottom-right`,`bottom`,`bottom-left`,`left`,`top-left`,`fill`]),r=(e,t)=>{let n=Math.imul(e+31,374761393)^Math.imul(t+17,668265263);return n=Math.imul(n^n>>>13,1274126177),((n^n>>>16)>>>0)/4294967296},i=(e,t,n)=>e+(t-e)*n;function a(e,t){let n=Math.floor(e),a=e-n;return i(r(n,t),r(n+1,t),a*a*(3-2*a))*2-1}var o={paper:{size:[15,24],response:3.8,threshold:28,lift:1.6,gravity:52,friction:4,colors:[`#f2efe4`,`#e4e5dc`,`#e8dfc8`,`#d8e2e2`]},leaf:{size:[12,21],response:3.4,threshold:32,lift:1.4,gravity:65,friction:4.5,colors:[`#91824e`,`#927146`,`#707c4e`,`#9c7552`]}};function s(e={}){if(!e||typeof e!=`object`||Array.isArray(e))throw TypeError(`Debris options must be an object`);for(let t of Object.keys(e))if(![`amount`,`kinds`,`anchor`,`spread`,`seed`,`wind`,`color`].includes(t))throw RangeError(`Unknown debris option: ${t}`);let r=(t,n,r,i=!1)=>{let a=e[t];if(a!==void 0&&(!Number.isFinite(a)||a<n||a>r||i&&!Number.isInteger(a)))throw RangeError(`debris.${t} must be ${i?`an integer`:`a number`} between ${n} and ${r}`)};if(r(`amount`,0,600,!0),r(`spread`,0,2e3),r(`seed`,-2147483648,2147483647,!0),e.anchor!==void 0&&!n.includes(e.anchor))throw RangeError(`Unknown debris anchor`);if(e.kinds!==void 0&&(!Array.isArray(e.kinds)||!e.kinds.length||e.kinds.some(e=>!t.includes(e))))throw RangeError(`Choose at least one supported debris kind`);if(e.wind!==void 0&&(!e.wind||typeof e.wind!=`object`||!Number.isFinite(e.wind.x)||!Number.isFinite(e.wind.y)||Math.hypot(e.wind.x,e.wind.y)>500))throw RangeError(`Debris wind must be a finite vector up to 500 pixels/second`);if(e.color!==void 0&&!/^#[\da-f]{3}(?:[\da-f]{3})?$/i.test(e.color))throw RangeError(`Debris color must be a 3 or 6 digit hex color`)}function c(e,t){let n=t.anchor,a=n.includes(`left`)||n===`left`?0:n.includes(`right`)||n===`right`?1:.5,s=n.includes(`top`)||n===`top`?0:n.includes(`bottom`)||n===`bottom`?1:.5;return Array.from({length:t.amount},(c,l)=>{let u=Math.imul(t.seed,31)+l*977|0,d=t.kinds[l%t.kinds.length],f=o[d],p=r(u,7)*Math.PI*2,m=Math.sqrt(r(u,11))*t.spread;return{kind:d,x:e.x+(n===`fill`?r(u,13)*e.width:e.width*a+Math.cos(p)*m),y:e.y+(n===`fill`?r(u,17)*e.height:e.height*s+Math.sin(p)*m),z:0,vx:0,vy:0,vz:0,angle:r(u,19)*Math.PI*2,spin:0,tilt:0,fold:.05+r(u,23)*.18,curlX:.35+r(u,41)*.4,curlY:.1+r(u,43)*.35,twist:(r(u,47)-.5)*.4,curlVelocityX:0,curlVelocityY:0,twistVelocity:0,size:i(f.size[0],f.size[1],r(u,29)),seed:u,color:t.color||f.colors[Math.floor(r(u,31)*f.colors.length)],age:0,opacity:1}})}var l=class{groups=new Map;vortices=[];serial=0;time=0;wakeClock=0;collection=[];get particles(){return this.collection}get count(){return this.collection.length}get managedBytes(){return this.count*216+this.vortices.length*64}collect(){this.collection=[...this.groups.values()].flatMap(e=>e.particles)}scatter(e,n={}){if(s(n),[e.x,e.y,e.width,e.height].some(e=>!Number.isFinite(e))||e.width<0||e.height<0)throw RangeError(`Debris bounds must be finite and non-negative`);let r={amount:n.amount??30,anchor:n.anchor??`center`,kinds:[...new Set(n.kinds??t)],seed:n.seed??31,spread:n.spread??Math.max(60,Math.min(200,Math.sqrt(e.width*e.height)*.4)),wind:{...n.wind??{x:7,y:-2}},color:n.color??``};if(this.count+r.amount>3e3)throw RangeError(`Scene debris budget is 3000 particles`);let i=`debris-${++this.serial}`;return this.groups.set(i,{bounds:{...e},options:r,particles:c(e,r),gust:{x:0,y:0},gustAge:0}),this.collect(),this.handle(i)}get(e){return this.groups.has(e)?this.handle(e):null}handle(e){return{id:e,reset:()=>{let t=this.groups.get(e);t&&(t.particles=c(t.bounds,t.options),t.gust={x:0,y:0},this.collect())},gust:t=>{if(!Number.isFinite(t.x)||!Number.isFinite(t.y)||Math.hypot(t.x,t.y)>500)throw RangeError(`Gust velocity must be finite and at most 500 pixels/second`);let n=this.groups.get(e);n&&(n.gust={...t},n.gustAge=0)},dispose:()=>{this.groups.delete(e),this.collect()}}}reset(){this.vortices=[],this.time=0,this.wakeClock=0;for(let e of this.groups.values())e.particles=c(e.bounds,e.options),e.gust={x:0,y:0},e.gustAge=0;this.collect()}clear(){this.groups.clear(),this.vortices=[],this.collection=[]}captureState(){return e({groups:this.groups,vortices:this.vortices,serial:this.serial,time:this.time,wakeClock:this.wakeClock})}restoreState(t){let n=e(t);this.groups=n.groups,this.vortices=n.vortices,this.serial=Math.max(this.serial,n.serial),this.time=n.time,this.wakeClock=n.wakeClock,this.collect()}step(e,t=[],n,r=[]){if(!this.count||e<=0)return;let i=Math.max(1,Math.ceil(Math.min(.1,e)*120));for(let a=0;a<i;a++)this.integrate(Math.min(.1,e)/i,t,n,r)}airAt(e,t,n,r,i){let o=1+a(this.time*.27+e*7e-4,n.options.seed)*.55,s=n.options.wind.x*o+n.gust.x*r,c=n.options.wind.y*o+n.gust.y*r;s+=a(this.time*.5+t*.002,n.options.seed+19)*5,c+=a(this.time*.4+e*.002,n.options.seed+31)*5;for(let n of i){let r=e-n.x,i=t-n.y,a=Math.hypot(n.vx,n.vy);if(a<3||Math.abs(r)>n.length+100||Math.abs(i)>n.length+100)continue;let o=n.angle,l=Math.cos(o),u=Math.sin(o),d=r*l+i*u,f=-r*u+i*l,p=Math.max(0,1-Math.abs(d)/(n.length*.75+40))*Math.max(0,1-Math.abs(f)/(n.width*.7+55)),m=f>=0?1:-1;s+=(n.vx*.22-u*a*.36*m)*p,c+=(n.vy*.22+l*a*.36*m)*p}for(let n of this.vortices){let r=e-n.x,i=t-n.y,a=r*r+i*i;if(a>n.radius*n.radius)continue;let o=(1-a/(n.radius*n.radius))**2*Math.exp(-n.age*2),l=n.strength*o/Math.max(12,Math.sqrt(a));s+=-i*l+n.vx*o,c+=r*l+n.vy*o}return{x:s,y:c}}integrate(e,t,n,i=[]){this.time+=e,this.wakeClock+=e,this.vortices=this.vortices.filter(e=>e.age<1.6);for(let t of this.vortices)t.age+=e,t.x+=t.vx*e,t.y+=t.vy*e;if(this.wakeClock>=.1){this.wakeClock%=.1;for(let e of t){let t=Math.hypot(e.vx,e.vy);if(t<35)continue;let n=e.vx/t,r=e.vy/t;for(let i of[-1,1])this.vortices.push({x:e.x-n*e.length*.45-r*e.width*.6*i,y:e.y-r*e.length*.45+n*e.width*.6*i,vx:e.vx*.12,vy:e.vy*.12,strength:Math.min(200,t*.3)*i,radius:Math.min(130,e.width*1.6+t*.1),age:0})}this.vortices.length>32&&this.vortices.splice(0,this.vortices.length-32)}for(let s of this.groups.values()){s.gustAge+=e;let c=Math.exp(-s.gustAge*1.5);for(let l of s.particles){if(l.age+=e,n&&l.z<.05&&Math.hypot(l.vx,l.vy)<2&&l.vz<=0&&(l.x<n.x-300||l.x>n.x+n.width+300||l.y<n.y-300||l.y>n.y+n.height+300))continue;let u=o[l.kind],{x:d,y:f}=this.airAt(l.x,l.y,s,c,t),p=Math.hypot(d-l.vx,f-l.vy),m=l.z>.1||l.vz>0,h=Math.max(0,p-u.threshold)*u.lift;(m||h>u.gravity*.8)&&(l.vz+=(h-u.gravity-l.vz*1.8)*e,l.vz=Math.min(95,l.vz)),l.z+=l.vz*e,l.z<=0&&(l.z=0,l.vz=0),l.z>70&&(l.z=70,l.vz=Math.min(0,l.vz));let g=l.z>.1?1:Math.max(0,Math.min(.7,(p-u.threshold*.5)/70));if(l.vx+=(d-l.vx)*(1-Math.exp(-u.response*g*e)),l.vy+=(f-l.vy)*(1-Math.exp(-u.response*g*e)),l.z<.1){let t=Math.exp(-u.friction*e);l.vx*=t,l.vy*=t}let _=l.x,v=l.y;if(l.x+=l.vx*e,l.y+=l.vy*e,l.z<12){for(let e of i)if(!(l.x<e.x||l.x>e.x+e.width||l.y<e.y||l.y>e.y+e.height)){l.x=_,l.y=v,l.vx*=-.15,l.vy*=-.15;break}}let y=a(this.time*3.2+l.x*.01,l.seed),b=(d*Math.sin(l.angle)-f*Math.cos(l.angle))*.024;if(l.spin+=(b+y*p*.02-l.spin*(l.z>0?1.8:9))*e,l.angle+=l.spin*e,l.kind===`paper`){let t=Math.min(1,Math.max(0,(p-18)/100)),n=d-l.vx,i=f-l.vy,a=Math.max(1,Math.hypot(n,i)),o=(n*Math.cos(l.angle)+i*Math.sin(l.angle))/a,s=(-n*Math.sin(l.angle)+i*Math.cos(l.angle))/a,c=.35+r(l.seed,41)*.4,u=.1+r(l.seed,43)*.35,m=(r(l.seed,47)-.5)*.4,h=c+t*(1.5+Math.abs(o)*1.1+y*.7),g=u+t*(.5+Math.abs(s)*.8-y*.3),_=m+t*(s*.9+y*.8);l.curlVelocityX+=((h-l.curlX)*55-l.curlVelocityX*9)*e,l.curlVelocityY+=((g-l.curlY)*38-l.curlVelocityY*7)*e,l.twistVelocity+=((_-l.twist)*42-l.twistVelocity*7.5)*e,l.curlX+=l.curlVelocityX*e,l.curlY+=l.curlVelocityY*e,l.twist+=l.twistVelocity*e}if(l.z>.5)l.tilt+=(Math.hypot(l.vx,l.vy)*.035+y*2.5)*e,l.fold+=(.18+Math.abs(y)*.5-l.fold)*Math.min(1,e*8);else{let t=Math.round(l.tilt/Math.PI)*Math.PI;l.tilt+=(t-l.tilt)*(1-Math.exp(-e*10)),l.fold+=(.05+r(l.seed,23)*.18-l.fold)*Math.min(1,e*4)}}}}};export{s as n,e as r,l as t};
|