// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-3.0-or-later // @source: https://gitlab.com/soapbox-pub/ditto/-/tree/f0a3877c import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{$r as t,Ct as n,H as r,J as i,Ki as a,L as o,Lr as s,Nr as c,Q as l,St as u,U as d,W as f,Wn as p,Z as m,cr as h,di as g,en as _,f as v,gn as y,kr as b,lt as x,nr as ee,p as te,qi as S,rt as C,s as w,tr as T,wi as E}from"./lucide-icons-BdRF0moN.js";import{t as D}from"./jsx-runtime-By8HlURe.js";import{r as ne}from"./react-intl-eZirkCBg.js";import{t as O}from"./utils-BFSTDHdM.js";import{o as re}from"./cards-DDSmTmb2.js";import{t as k}from"./TarotReadingSection-DRLtYoI5.js";var A=e(S(),1);function j(){let[e,t]=(0,A.useState)(null),n=(0,A.useRef)([]),r=(0,A.useRef)(void 0),i=(0,A.useCallback)(e=>{let i=n.current[e];if(!i)return;let a=window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;i.scrollIntoView({behavior:a?`auto`:`smooth`,block:`center`}),t(e),window.clearTimeout(r.current),r.current=window.setTimeout(()=>t(null),1800)},[]);return(0,A.useEffect)(()=>()=>window.clearTimeout(r.current),[]),{highlightIndex:e,sectionRefs:n,jumpToSection:i}}var M=D();function N(){return(0,M.jsxs)(`div`,{className:`tarot-card-back`,children:[(0,M.jsx)(`div`,{className:`back-lattice`}),(0,M.jsx)(l,{className:`back-star back-star-1`}),(0,M.jsx)(l,{className:`back-star back-star-2`}),(0,M.jsx)(l,{className:`back-star back-star-3`}),(0,M.jsx)(l,{className:`back-star back-star-4`}),(0,M.jsx)(l,{className:`back-star back-star-5`}),(0,M.jsx)(`div`,{className:`back-ring`,children:(0,M.jsx)(_,{className:`back-emblem`})}),(0,M.jsx)(`div`,{className:`card-sheen`})]})}var P=[[`circle`,{cx:`8`,cy:`3.5`,r:`.5`,key:`snt5uh`}],[`circle`,{cx:`14`,cy:`6`,r:`2`,key:`1m03mk`}],[`path`,{d:`M19 2h.01`,key:`rnvxl6`}],[`path`,{d:`M22 8H2`,key:`ysyahh`}],[`path`,{d:`M7 12V8`,key:`17vupn`}],[`path`,{d:`M11 10V8`,key:`487cu0`}],[`path`,{d:`M4.4 8C2.9 9.5 2 11.4 2 13.5 2 18.2 6.5 22 12 22s10-3.8 10-8.5c0-2.1-.9-4-2.4-5.5`,key:`1dobco`}],[`path`,{d:`m5 20-1 2`,key:`13988j`}],[`path`,{d:`m19 20 1 2`,key:`1piwgg`}]],F=[[`path`,{d:`M8 2c-1.78 2.72-3 6.65-3 9a7 7 0 1 0 14 0c0-2.35-1.22-6.28-3-9Z`,key:`11c6l5`}],[`path`,{d:`M12 18v4`,key:`jadmvz`}],[`path`,{d:`M8 22h8`,key:`rmew8v`}],[`path`,{d:`M5 11c.84-.5 1.68-1 3.5-1 3.5 0 3.5 2 7 2 1.82 0 2.66-.5 3.5-1`,key:`16nt1l`}]],I=[[`path`,{d:`M4 11 3 7.7 5.7 7l.1-2.8 2.7.6 1.3-2.6L12 4l2.2-1.8 1.3 2.6 2.7-.6.1 2.8 2.7.7-1.2 2.5L22 12l-2.2 1.8 1.2 2.5-3 .7`,key:`su90o8`}],[`path`,{d:`M10 17h.01`,key:`nbq80n`}],[`path`,{d:`M3 16c2.8 0 5-2.2 5-5 3.3 0 6 2.7 6 6a4 4 0 0 0 4 4h-8c-1.1 0-2.6-.6-3.4-1.4L3 16v-1`,key:`wsk636`}]],L=[[`path`,{d:`M9 10h.01`,key:`qbtxuw`}],[`path`,{d:`M15 10h.01`,key:`1qmjsl`}],[`path`,{d:`M12 2a8 8 0 0 0-8 8v12l3-3 2.5 2.5L12 19l2.5 2.5L17 19l3 3V10a8 8 0 0 0-8-8z`,key:`uwwb07`}]],R=[[`circle`,{cx:`12`,cy:`12`,r:`8`,key:`46899m`}],[`path`,{d:`M4.05 13c-1.7 1.8-2.5 3.5-1.8 4.5 1.1 1.9 6.4 1 11.8-2s8.9-7.1 7.7-9c-.6-1-2.4-1.2-4.7-.7`,key:`1cniyf`}]],z=[[`path`,{d:`M13 2c-1 1-1 2-1 2`,key:`1hvae7`}],[`path`,{d:`M17 4c-.9 0-1.8.4-2.5 1.2a3.32 3.32 0 0 0-5 0C8.8 4.4 7.9 4 7 4c-2.8 0-5 4-5 9s2.2 9 5 9c.9 0 1.8-.4 2.5-1.2a3.32 3.32 0 0 0 5 0c.7.8 1.6 1.2 2.5 1.2 2.8 0 5-4 5-9s-2.2-9-5-9`,key:`1ialmf`}],[`path`,{d:`M10 11 8 9l-2 2`,key:`4dp8c6`}],[`path`,{d:`m18 11-2-2-2 2`,key:`h39xar`}],[`path`,{d:`m6 15 2 2 2-2 2 2 2-2 2 2 2-2`,key:`ua77yg`}]],B=[[`path`,{d:`M3 13h8`,key:`14j198`}],[`path`,{d:`M5 7s-2 3-2 6a4 4 0 0 0 8 0c0-3-2-6-2-6Z`,key:`1yn5kj`}],[`path`,{d:`M7 17v5`,key:`1yj1jh`}],[`path`,{d:`M4 22h6`,key:`1b5wmr`}],[`path`,{d:`M18 4c0 3-3 3-3 6v11c0 .6.4 1 1 1h4c.6 0 1-.4 1-1V10c0-3-3-3-3-6`,key:`11v778`}],[`path`,{d:`M18 4V2`,key:`1jsdo1`}]],V=a(`Cauldron`,P),H=a(`Goblet`,F),U=a(`Pumpkin`,z),W={sparkles:l,"wand-sparkles":te,"book-open":E,crown:c,castle:g,scroll:u,"hand-heart":p,shield:x,dumbbell:b,hedgehog:a(`Hedgehog`,I),"loader-pinwheel":y,scale:n,ghost:a(`Ghost`,L),skull:C,goblet:H,pumpkin:U,tornado:o,star:i,"moon-star":_,sun:f,gavel:ee,globe:a(`Planet`,R),wand:v,sprout:m,flame:h,wine:w,wineGlassBottle:a(`WineGlassBottle`,B),cauldron:V,sword:d,swords:r,"circle-dollar-sign":t,coins:s,gem:T};function G({card:e}){let t=W[e.icon]||i,n=e.name.toLowerCase();return n===`two of cups`?(0,M.jsxs)(`div`,{className:`two-of-cups`,children:[(0,M.jsx)(w,{className:`card-icon cup-1`}),(0,M.jsx)(w,{className:`card-icon cup-2`})]}):n===`three of swords`?(0,M.jsxs)(`div`,{className:`icon-layout-3 three-of-swords`,children:[(0,M.jsx)(t,{className:`card-icon sword-1`}),(0,M.jsx)(t,{className:`card-icon sword-2`}),(0,M.jsx)(t,{className:`card-icon sword-3`})]}):n.startsWith(`three of`)?(0,M.jsxs)(`div`,{className:`icon-layout-3`,children:[(0,M.jsx)(`div`,{className:`row-1`,children:(0,M.jsx)(t,{className:`card-icon`})}),(0,M.jsxs)(`div`,{className:`row-2`,children:[(0,M.jsx)(t,{className:`card-icon`}),(0,M.jsx)(t,{className:`card-icon`})]})]}):(0,M.jsxs)(`div`,{className:`icon-medallion`,children:[(0,M.jsx)(`div`,{className:`icon-glow`}),(0,M.jsx)(t,{className:`card-icon`})]})}function K({card:e}){let t=e.name.length>14;return(0,M.jsxs)(`div`,{className:`tarot-face suit-${e.suit}`,children:[(0,M.jsx)(`span`,{className:`face-corner face-corner-tl`,"aria-hidden":`true`,children:`✦`}),(0,M.jsx)(`span`,{className:`face-corner face-corner-tr`,"aria-hidden":`true`,children:`✦`}),(0,M.jsx)(`span`,{className:`face-corner face-corner-bl`,"aria-hidden":`true`,children:`✦`}),(0,M.jsx)(`span`,{className:`face-corner face-corner-br`,"aria-hidden":`true`,children:`✦`}),(0,M.jsxs)(`header`,{className:`face-header`,children:[(0,M.jsx)(`span`,{className:`face-eyebrow`,children:re(e)}),(0,M.jsx)(`span`,{className:`face-name ${t?`long`:``}`,children:e.name})]}),(0,M.jsx)(`div`,{className:`face-art`,children:(0,M.jsx)(G,{card:e})}),(0,M.jsx)(`footer`,{className:`face-footer`,children:e.isReversed?(0,M.jsx)(`span`,{className:`reversed`,children:`Reversed`}):(0,M.jsx)(`span`,{children:`Upright`})})]})}var q=950;function J({card:e,isRevealed:t,isSpinning:n,onCardClick:r,onSettledClick:i}){let[a,o]=(0,A.useState)(!!t);if((0,A.useEffect)(()=>{if(!t){o(!1);return}let e=setTimeout(()=>o(!0),q);return()=>clearTimeout(e)},[t]),n||!e)return(0,M.jsx)(`div`,{className:`tarot-card ${n?`spinning`:``}`,children:(0,M.jsx)(`div`,{className:`tarot-card-inner`,children:(0,M.jsx)(N,{})})});let s=t?`${e.name}${e.isReversed?` (Reversed)`:``}`:`Reveal card`;if(t&&a){let t=(0,M.jsx)(`div`,{className:O(`tarot-card-static`,e.isReversed&&`reversed-card`),children:(0,M.jsx)(K,{card:e})});return i?(0,M.jsx)(`button`,{type:`button`,className:`tarot-card settled appearance-none bg-transparent border-0 p-0 text-left rounded-2xl focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,onClick:e=>{e.stopPropagation(),i()},"aria-label":`${s}. Read interpretation`,children:t}):(0,M.jsx)(`div`,{className:`tarot-card settled`,role:`img`,"aria-label":s,children:t})}return(0,M.jsxs)(`button`,{type:`button`,className:O(`tarot-card appearance-none bg-transparent border-0 p-0 text-left rounded-2xl focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,t&&`flipped`),onClick:r,disabled:!r||t,"aria-label":s,children:[(0,M.jsxs)(`div`,{className:`tarot-card-inner`,children:[(0,M.jsx)(N,{}),(0,M.jsx)(`div`,{className:O(`tarot-card-front`,e.isReversed&&`reversed-card`),children:(0,M.jsx)(K,{card:e})})]}),t&&(0,M.jsx)(`span`,{className:`reveal-flash`,"aria-hidden":`true`})]})}var Y=[`-rotate-3 translate-y-2`,`-translate-y-1`,`rotate-3 translate-y-2`];function ie({cards:e,revealed:t,onCardClick:n,onSettledClick:r,className:i}){return(0,M.jsx)(`div`,{className:O(`flex items-start justify-center gap-[4%] sm:gap-8`,i),children:e.map((e,i)=>{let a=t?!!t[i]:!0;return(0,M.jsxs)(`div`,{className:`w-[30%] max-w-[180px]`,children:[(0,M.jsx)(`h3`,{className:`text-center text-xs sm:text-sm font-semibold uppercase tracking-[0.25em] text-muted-foreground mb-3`,children:k[i]?(0,M.jsx)(ne,{...k[i]}):e.position}),(0,M.jsx)(`div`,{className:O(`motion-safe:transition-transform motion-safe:duration-500`,!a&&Y[i]),children:(0,M.jsx)(J,{card:e,isRevealed:a,onCardClick:n&&(()=>n(i)),onSettledClick:r&&(()=>r(i))})})]},`${e.name}-${i}`)})})}var ae=[`#e7c983`,`#c4b5fd`,`#e0d7f0`],X=60;function Z(){let e=getComputedStyle(document.documentElement),t=[`--primary`,`--muted-foreground`,`--foreground`].map(t=>e.getPropertyValue(t).trim()).filter(Boolean).map(e=>`hsl(${e})`);return t.length>0?t:ae}function Q(e,t){return e+Math.random()*(t-e)}function $(e){return e[Math.floor(Math.random()*e.length)]}function oe(e,t,n=5,r=.5){e.save(),e.translate(t.x,t.y),e.rotate(t.rotation),e.moveTo(t.radius,0);for(let i=0;i({x:Q(2,e-2),y:Q(2,t-2),radius:Q(2.5,7),vx:Q(-.15,.15),vy:Q(-.15,.15),rotation:Q(0,Math.PI*2),spin:Q(-.01,.01),phase:Q(0,Math.PI*2),twinkleSpeed:Q(.01,.035),color:$(n)}))}function ce({className:e}){let t=(0,A.useRef)(null);return(0,A.useEffect)(()=>{let e=t.current;if(!e)return;let n=e.getContext(`2d`);if(!n)return;let r=window.matchMedia(`(prefers-reduced-motion: reduce)`).matches,i=0,a=0,o=[],s=0,c=0,l={x:-9999,y:-9999},u=()=>{n.clearRect(0,0,i,a);for(let e of o){let t=s*e.twinkleSpeed+e.phase,r=.12+.38*(Math.sin(t)*.5+.5);n.beginPath(),oe(n,e),n.globalAlpha=r,n.fillStyle=e.color,n.fill()}n.globalAlpha=1},d=()=>{for(let e of o){e.x+=e.vx,e.y+=e.vy,e.rotation+=e.spin,(e.xi-e.radius)&&(e.vx*=-1),(e.ya-e.radius)&&(e.vy*=-1);let t=e.x-l.x,n=e.y-l.y,r=Math.sqrt(t*t+n*n)||1;if(r{s++,d(),u(),c=requestAnimationFrame(f)},p=()=>{let t=e.getBoundingClientRect(),s=window.devicePixelRatio||1,c=i,l=a;if(i=t.width,a=t.height,e.width=Math.round(i*s),e.height=Math.round(a*s),n.setTransform(s,0,0,s,0,0),o.length===0||c===0||l===0)o=se(i,a);else for(let e of o)e.x=e.x/c*i,e.y=e.y/l*a;r&&u()},m=t=>{let n=e.getBoundingClientRect();l.x=t.clientX-n.left,l.y=t.clientY-n.top},h=new ResizeObserver(p);h.observe(e),p();let g=new MutationObserver(()=>{let e=Z();for(let t of o)t.color=$(e);r&&u()});g.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`,`style`]});let _=!1,v=()=>{_||r||(_=!0,window.addEventListener(`pointermove`,m),c=requestAnimationFrame(f))},y=()=>{_&&(_=!1,cancelAnimationFrame(c),window.removeEventListener(`pointermove`,m),l.x=-9999,l.y=-9999)},b=new IntersectionObserver(([e])=>{e.isIntersecting?v():y()});return b.observe(e),()=>{b.disconnect(),y(),h.disconnect(),g.disconnect()}},[]),(0,M.jsx)(`canvas`,{ref:t,className:O(`pointer-events-none absolute inset-0 size-full`,e),"aria-hidden":`true`})}export{j as i,ie as n,J as r,ce as t}; // @license-end