1import{a as e,c as t,i as n,t as r}from"./jsx-runtime-Bf0N1NsO.js";import{a as i,i as a,n as o,r as s,t as c}from"./confetti.module-B7X13UYD.js";import{t as l}from"./external-link-B2dKyqEZ.js";import{t as u}from"./info-_Fc3gY0i.js";import{A as d,B as f,C as p,H as m,I as h,L as g,M as _,O as v,P as y,R as b,S as x,T as S,j as C,o as w,r as T,s as E,w as D,z as O}from"./index-VZxUvskB.js";var k=m(`arrow-up-down`,[[`path`,{d:`m21 16-4 4-4-4`,key:`f6ql7i`}],[`path`,{d:`M17 20V4`,key:`1ejh1v`}],[`path`,{d:`m3 8 4-4 4 4`,key:`11wl7u`}],[`path`,{d:`M7 4v16`,key:`1glfcx`}]]),A=m(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),j=m(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),ee=m(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),te=m(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),ne=m(`map-pin`,[[`path`,{d:`M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0`,key:`1r0f0z`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}]]),re=m(`map`,[[`path`,{d:`M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z`,key:`169xi5`}],[`path`,{d:`M15 5.764v15`,key:`1pn4in`}],[`path`,{d:`M9 3.236v15`,key:`1uimfh`}]]),ie=m(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),ae=m(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),oe=m(`route`,[[`circle`,{cx:`6`,cy:`19`,r:`3`,key:`1kj8tv`}],[`path`,{d:`M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15`,key:`1d8sl`}],[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}]]),se=m(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),ce=m(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),M=m(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),N=m(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),le=m(`target`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`6`,key:`1vlfrh`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),P=m(`zoom-in`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`11`,x2:`11`,y1:`8`,y2:`14`,key:`1vmskp`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]),F=m(`zoom-out`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]),I=t(e(),1),L=2600,R=1500,z=[{tMax:.15,name:`The Whispering Coast & Lowlands`,biome:`coast`},{tMax:.32,name:`The Elderwood Deep Forest`,biome:`forest`},{tMax:.48,name:`River Elden & The Twin Fords`,biome:`river`},{tMax:.68,name:`The Dragon Tooth Mountains & Passes`,biome:`mountain`},{tMax:.83,name:`The Misty Glade & Highland Woods`,biome:`forest`}
1,{tMax:.93,name:`The Roaring Gorge & Cataracts`,biome:`river`},{tMax:1,name:`The Sunstone Peaks & Ancient Citadel`,biome:`ancient_ruins`}],B=[`Pencil marks still visible from the cartographerâs first survey.`,`A calm breeze sweeps through the grass, carrying the scent of pine.`,`Wooden planks creak underfoot as the river roars below.`,`Craggy pencil hatchings reveal steep, unforgiving granite slopes.`,`Ancient roots break through the worn gravel pathway.`,`The sound of rushing water echoes across the canyon walls.`,`A solitary stone marker inscribed with early explorer symbols.`,`Golden light filters softly through the sketched canopy.`,`Distant mountain ridges frame the expanding horizon.`,`A tranquil haven where wanderers rest before the mountain climb.`];function ue(e=[],t={}){let n=[],r=e.length>0?e.length:150,i=[{t:0,x:220,y:1320,elev:10},{t:.08,x:380,y:1140,elev:45},{t:.16,x:580,y:980,elev:120},{t:.24,x:820,y:1120,elev:90},{t:.32,x:940,y:860,elev:180},{t:.4,x:720,y:640,elev:320},{t:.48,x:1050,y:520,elev:580},{t:.56,x:1320,y:720,elev:890},{t:.64,x:1540,y:480,elev:1250},{t:.72,x:1780,y:680,elev:920},{t:.8,x:1980,y:920,elev:460},{t:.88,x:2220,y:760,elev:750},{t:.94,x:2180,y:480,elev:1180},{t:1,x:2420,y:240,elev:1620}];for(let a=0;a<r;a++){let o=r>1?a/(r-1):0,s=0;for(;s<i.length-2&&i[s+1].t<o;)s++;let c=i[Math.max(0,s-1)],l=i[s],u=i[Math.min(i.length-1,s+1)],d=i[Math.min(i.length-1,s+2)],f=u.t-l.t||.001,p=(o-l.t)/f,m=p,h=m*m,g=h*m,_=-.5*g+h-.5*m,v=1.5*g-2.5*h+1,y=-1.5*g+2*h+.5*m,b=.5*g-.5*h,x=_*c.x+v*l.x+y*u.x+b*d.x,S=_*c.y+v*l.y+y*u.y+b*d.y,C=Math.sin(a*.45)*14+Math.cos(a*.9)*8,w=Math.cos(a*.4)*14+Math.sin(a*.85)*8;x=Math.round(x+C),S=Math.round(S+w);let T=Math.round(l.elev+p*(u.elev-l.elev)+Math.sin(a*.5)*15),E=z.find(e=>o<=e.tMax)||z[z.length-1],D=e.length>0?e[a]:a+1,O=t[D]||(D<0?`Custom Challenge ${a+1}`:`LeetCode #${D}`),k=B[a%B.length];n.push({id:D,sequenceIndex:a,x,y:S,name:O,biome:E.biome,regionName:E.name,elevation:Math.max(10,T),lore:k})}return n}var V=[{id:`wm-bg1`,x:380,y:310,size:70,height:85,ridgeShift:-4,hasSnow:!1,layer:0,elevation:840,rangeName:`Western Crags`},{id:`wm-bg2`,x:490,y:280,size:85,height:105,ridgeShift:6,hasSnow:!0,layer:0,elevation:1120,name:`Peak of the North Wind`,rangeName:`Western Crags`},{id:`wm-bg3`,x:620,y:300,size:75,height:95,ridgeShift:-3,hasSnow:!1,layer:0,elevation:960,rangeName:`Western Crags`},{id:`wm-bg4`,x:730,y:320,size:65,height:80,ridgeShift:4,hasSnow:!1,layer:0,elevation:780,rangeName:`Western Crags`},{id:`m1`,x:430,y:375,size:80,height:105,ridgeShift:5,hasSnow:!0,elevation:1240,name:`Crag of the Mist`,rangeName:`Western Crags`},{id:`m2`,x:530,y:345,size:95,height:125,ridgeShift:-7,hasSnow:!0,elevation:1480,name:`Peak of Solitude`,rangeName:`Western Crags`},{id:`m3`,x:630,y:365,size:85,height:110,ridgeShift:3,hasSnow:!0,elevation:1310,name:`Shadowhorn`,rangeName:`Western Crags`},{id:`m4`,x:720,y:385,size:70,height:90,ridgeShift:-4,hasSnow:!1,elevation:990,rangeName:`Western Crags`},{id:`m5`,x:370,y:430,size:55,height:65,ridgeShift:4,hasSnow:!1,layer:2,elevation:620,rangeName:`Western Crags`},{id:`m6`,x:470,y:425,size:68,height:80,ridgeShift:-3,hasSnow:!1,layer:2,elevation:760,name:`Gullwing Bluff`,rangeName:`Western Crags`},{id:`m6b`,x:575,y:420,size:72,height:88,ridgeShift:3,hasSnow:!1,layer:2,elevation:850,rangeName:`Western Crags`},{id:`m6c`,x:670,y:435,size:58,height:70,ridgeShift:-2,hasSnow:!1,layer:2,elevation:680,rangeName:`Western Crags`},{id:`dt-bg1`,x:1130,y:260,size:90,height:120,ridgeShift:-6,hasSnow:!0,layer:0,elevation:1850,rangeName:`Dragon's Tooth Range`},{id:`dt-bg2`,x:1250,y:225,size:115,height:150,ridgeShift:8,hasSnow:!0,layer:0,elevation:2180,name:`Crown of the North`,rangeName:`Dragon's Tooth Range`},{id:`dt-bg3`,x:1380,y:210,size:130,height:175,ridgeShift:-10,hasSnow:!0,layer:0,elevation:2450,name:`Apex of Clouds`,rangeName:`Dragon's Tooth Range`},{id:`dt-bg4`,x:1510,y:240,size:110,height:145,ridgeShift:7,hasSnow:!0,layer:0,elevation:2020,rangeName:`Dragon's Tooth Range`},{id:`dt-bg5`,x:1640,y:280,size:90,height:115,ridgeShift:-5,hasSnow:!0,layer:0,elevation:1690,rangeName:`Dragon's Tooth Range`},{id:`m7`,x:1190,y:325,size:105,height:140,ridgeShift:-8,hasSnow:!0,elevation:1980,name:`The Dragon's Crest`,rangeName:`Dragon's Tooth Range`}
1,{id:`m8`,x:1310,y:295,size:125,height:165,ridgeShift:10,hasSnow:!0,elevation:2360,name:`Frostcrag Pinnacle`,rangeName:`Dragon's Tooth Range`},{id:`m9`,x:1435,y:320,size:115,height:150,ridgeShift:-6,hasSnow:!0,elevation:2120,name:`Thunderhorn Peak`,rangeName:`Dragon's Tooth Range`},{id:`m10`,x:1560,y:355,size:98,height:125,ridgeShift:7,hasSnow:!0,elevation:1780,name:`Screaming Ridge`,rangeName:`Dragon's Tooth Range`},{id:`m10b`,x:1680,y:375,size:85,height:105,ridgeShift:-4,hasSnow:!1,elevation:1420,rangeName:`Dragon's Tooth Range`},{id:`m11`,x:1260,y:415,size:90,height:115,ridgeShift:-5,hasSnow:!0,elevation:1560,name:`Ironhorn Needle`,rangeName:`Dragon's Tooth Range`},{id:`m12`,x:1375,y:405,size:100,height:130,ridgeShift:6,hasSnow:!0,elevation:1720,name:`Shadowcrevasse Crag`,rangeName:`Dragon's Tooth Range`},{id:`m13`,x:1490,y:440,size:88,height:110,ridgeShift:-4,hasSnow:!0,elevation:1490,rangeName:`Dragon's Tooth Range`},{id:`m14`,x:1610,y:435,size:82,height:100,ridgeShift:5,hasSnow:!1,elevation:1320,rangeName:`Dragon's Tooth Range`},{id:`m15`,x:1160,y:590,size:80,height:100,ridgeShift:5,hasSnow:!1,elevation:1180,name:`Wanderer's Bluff`,rangeName:`Mid-Pass Gorge`},{id:`m16`,x:1390,y:610,size:90,height:115,ridgeShift:-6,hasSnow:!0,elevation:1390,name:`Eagle Eye Ridge`,rangeName:`Mid-Pass Gorge`},{id:`m17`,x:1510,y:585,size:95,height:120,ridgeShift:5,hasSnow:!0,elevation:1520,name:`Razorback Spine`,rangeName:`Mid-Pass Gorge`},{id:`m18`,x:1630,y:565,size:85,height:105,ridgeShift:-4,hasSnow:!1,elevation:1280,rangeName:`Mid-Pass Gorge`},{id:`m18b`,x:1740,y:580,size:75,height:90,ridgeShift:3,hasSnow:!1,elevation:1050,rangeName:`Mid-Pass Gorge`},{id:`es-bg1`,x:1980,y:310,size:88,height:115,ridgeShift:-5,hasSnow:!0,layer:0,elevation:1650,rangeName:`Sunstone Highlands`},{id:`es-bg2`,x:2110,y:245,size:105,height:140,ridgeShift:6,hasSnow:!0,layer:0,elevation:1980,name:`Sun Pillar`,rangeName:`Sunstone Highlands`},{id:`es-bg3`,x:2260,y:160,size:135,height:180,ridgeShift:-8,hasSnow:!0,layer:0,elevation:2580,name:`Crown of the Heavens`,rangeName:`Sunstone Highlands`},{id:`es-bg4`,x:2410,y:210,size:115,height:150,ridgeShift:7,hasSnow:!0,layer:0,elevation:2240,rangeName:`Sunstone Highlands`},{id:`m19`,x:2040,y:375,size:98,height:128,ridgeShift:6,hasSnow:!0,elevation:1720,name:`Sunstone Spire`,rangeName:`Sunstone Highlands`},{id:`m20`,x:2170,y:315,size:115,height:150,ridgeShift:-7,hasSnow:!0,elevation:2080,name:`Sanctuary Peak`,rangeName:`Sunstone Highlands`},{id:`m21`,x:2310,y:220,size:130,height:170,ridgeShift:8,hasSnow:!0,elevation:2390,name:`Pinnacle of the Ancients`,rangeName:`Sunstone Highlands`},{id:`m22`,x:2440,y:360,size:90,height:115,ridgeShift:-5,hasSnow:!0,elevation:1610,name:`Falcon Perch`,rangeName:`Sunstone Highlands`},{id:`m23`,x:2260,y:405,size:82,height:98,ridgeShift:4,hasSnow:!1,elevation:1250,name:`Altar Crag`,rangeName:`Sunstone Highlands`},{id:`m24`,x:2380,y:420,size:76,height:88,ridgeShift:-3,hasSnow:!1,elevation:1120,rangeName:`Sunstone Highlands`},{id:`m25`,x:2140,y:450,size:70,height:80,ridgeShift:3,hasSnow:!1,elevation:980,rangeName:`Sunstone Highlands`}],H=[{id:`river-elden`,name:`River Elden`,d:`M 1340,290 C 1310,380 1260,460 1210,540 C 1140,640 1020,700 960,820 C 900,940 930,1060 880,1180 C 840,1280 760,1360 690,1480`,width:14,hasBridges:[{x:945,y:855,angle:-35},{x:890,y:1160,angle:25}]},{id:`river-silver`,name:`Silver Meander`,d:`M 580,410 C 650,490 730,550 780,660 C 830,760 910,810 960,820`,width:8,hasBridges:[{x:740,y:620,angle:45}]},{id:`river-cataract`,name:`Highland Torrent`,d:`M 2150,320 C 2100,450 2050,600 2020,760 C 1990,920 1920,1050 1840,1180 C 1760,1310 1710,1420 1660,1500`,width:11,hasBridges:[{x:2010,y:810,angle:-20}]}],U=[{id:`f1`,name:`The Whispering Pines`,cx:580,cy:1040,rx:230,ry:160,treeCount:42,trees:W(580,1040,210,140,42,`pines`)},{id:`f2`,name:`Elderwood Deep`,cx:820,cy:1140,rx:250,ry:180,treeCount:52,trees:W(820,1140,230,160,52,`oaks`)},{id:`f3`,name:`Mistwood Valley`,cx:860,cy:620,rx:190,ry:140,treeCount:36,trees:W(860,620,170,120,36,`willows`)},{id:`f4`,name:`Highland Spruces`,cx:1760,cy:740,rx:210,ry:155,treeCount:38,trees:W(1760,740,190,135,38,`highland_spruce`)},{id:`f5`,name:`Verdant Basin`,cx:1960,cy:980,rx:200,ry:150,treeCount:38,trees:W(1960,980,180,130,38,`mixed`)}
1,{id:`f6`,name:`Shadowglen Copse`,cx:390,cy:690,rx:140,ry:100,treeCount:22,trees:W(390,690,120,80,22,`pines`)},{id:`f7`,name:`Sunstone Grove`,cx:2360,cy:580,rx:150,ry:110,treeCount:24,trees:W(2360,580,130,90,24,`mixed`)}];function W(e,t,n,r,i,a){let o=[];for(let s=0;s<i;s++){let c=s*2.399963+Math.sin(s*1.7)*.4,l=((s+.5)/i)**.65,u=Math.sin(s*4.3+e)*14,d=Math.cos(s*3.9+t)*12,f=Math.round(e+n*l*Math.cos(c)+u),p=Math.round(t+r*l*Math.sin(c)+d),m=.85+s%4*.1;s===0||s===5?m=1.35:s%7==0&&(m=.68);let h=`pine`;if(a===`pines`)h=s%6==0?`birch`:`pine`;else if(a===`oaks`)h=s===0||s===5?`ancient_oak`:s%5==0?`birch`:`oak`;else if(a===`willows`)h=s%3==0?`willow`:s%4==0?`birch`:`oak`;else if(a===`highland_spruce`)h=s%5==0?`pine`:`spruce`;else{let e=s%5;h=e===0?`ancient_oak`:e===1?`pine`:e===2?`oak`:e===3?`spruce`:`birch`}o.push({x:f,y:p,scale:m,type:h,seed:Math.round(e*7+t*11+s*31)})}return o}function G(e){if(e.length===0)return``;if(e.length===1)return`M ${e[0].x},${e[0].y}`;let t=`M ${e[0].x},${e[0].y}`;for(let n=0;n<e.length-1;n++){let r=e[n],i=e[n+1],a=(r.x+i.x)/2,o=(r.y+i.y)/2;if(n===0)t+=` Q ${r.x},${r.y} ${a},${o}`;else{let a=e[n-1],o=r.x+(i.x-a.x)*.18,s=r.y+(i.y-a.y)*.18;t+=` S ${o},${s} ${i.x},${i.y}`}}return t}function K(e,t){return t<=0||e.length===0?``:G(e.slice(0,t+1))}var de={parchment:{id:`parchment`,name:`Daylight Parchment`,bgClass:`parchment-bg`,textColor:`#2c221a`,pencilColor:`#382e25`,pencilShade:`#8c765c`,riverColor:`#96afbe`,glowColor:`#f59e0b`,glowSubtle:`#fbbf24`,nodeUnlit:`#f0e5ce`,nodeLit:`#fbbf24`,nodeLitStroke:`#ffffff`},dark_parchment:{id:`dark_parchment`,name:`Midnight Cartography`,bgClass:`parchment-dark-bg`,textColor:`#f3e9d2`,pencilColor:`#8a7761`,pencilShade:`#4a3f33`,riverColor:`#365163`,glowColor:`#fbbf24`,glowSubtle:`#f59e0b`,nodeUnlit:`#231e17`,nodeLit:`#f59e0b`,nodeLitStroke:`#fffbeb`}},q=new class{ctx=null;enabled=!0;initCtx(){if(!this.ctx&&typeof window<`u`){let e=window.AudioContext||window.webkitAudioContext;e&&(this.ctx=new e)}this.ctx&&this.ctx.state===`suspended`&&this.ctx.resume()}setEnabled(e){this.enabled=e,e&&this.initCtx()}isEnabled(){return this.enabled}playNodeLightUp(e,t=150){if(this.enabled&&(this.initCtx(),this.ctx))try{let n=this.ctx.currentTime,r=[261.63,293.66,329.63,392,440,523.25,587.33,659.25,783.99,880],i=Math.floor(e/Math.max(1,t)*20),a=1+Math.floor(i/r.length)*.5,o=r[i%r.length]*a,s=this.ctx.createOscillator(),c=this.ctx.createOscillator(),l=this.ctx.createGain();s.type=`sine`,s.frequency.setValueAtTime(o,n),c.type=`triangle`,c.frequency.setValueAtTime(o*2.01,n),l.gain.setValueAtTime(.001,n),l.gain.linearRampToValueAtTime(.12,n+.02),l.gain.exponentialRampToValueAtTime(1e-4,n+.55),s.connect(l),c.connect(l),l.connect(this.ctx.destination),s.start(n),c.start(n),s.stop(n+.6),c.stop(n+.6)}catch{}}playPencilScratch(){if(this.enabled&&(this.initCtx(),this.ctx))try{let e=this.ctx.currentTime,t=Math.floor(this.ctx.sampleRate*.06),n=this.ctx.createBuffer(1,t,this.ctx.sampleRate),r=n.getChannelData(0);for(let e=0;e<t;e++)r[e]=(Math.random()*2-1)*Math.exp(-e/(t*.4));let i=this.ctx.createBufferSource();i.buffer=n;let a=this.ctx.createBiquadFilter();a.type=`bandpass`,a.frequency.setValueAtTime(1400+Math.random()*800,e),a.Q.setValueAtTime(3.5,e);let o=this.ctx.createGain();o.gain.setValueAtTime(.04,e),o.gain.exponentialRampToValueAtTime(.001,e+.05),i.connect(a),a.connect(o),o.connect(this.ctx.destination),i.start(e)}catch{}}playVictoryChime(){this.enabled&&(this.initCtx(),this.ctx&&[523.25,659.25,783.99,1046.5].forEach((e,t)=>{setTimeout(()=>{if(!this.ctx)return;let t=this.ctx.currentTime,n=this.ctx.createOscillator(),r=this.ctx.createGain();n.type=`sine`,n.frequency.setValueAtTime(e,t),r.gain.setValueAtTime(.001,t),r.gain.linearRampToValueAtTime(.15,t+.05),r.gain.exponentialRampToValueAtTime(1e-4,t+1.2),n.connect(r),r.connect(this.ctx.destination),n.start(t),n.stop(t+1.3)},t*120)}))}},J=r();function Y(e){let t=Math.sin(e*12.9898+78.233)*43758.5453;return t-Math.floor(t)}var fe=({mountain:e,theme:t})=>{let n=t.id!==`parchment`,r=t.pencilColor,i=t.pencilShade,{id:a,x:o,y:s,size:c,height:l,ridgeShift:u=0,hasSnow:d=l>95}=e,f=(0,I.useMemo)(()=>{let e=0;for(let t=0;t<a.length;
1t++)e+=a.charCodeAt(t)*(t+1);e+=Math.round(o+s);let t=o+u,n=s-l,r=o-c,i=o+c,f=[{x:t,y:n}];for(let i=1;i<=6;i++){let a=i/6,o=t-(t-r)*a,s=n+l*a,u=(Y(e+i*17)-.48)*(c*.14)*Math.sin(a*Math.PI),d=Y(e+i*31)>.65?l*.04:0;f.push({x:Math.round(o+u),y:Math.round(s+d)})}let p=[];for(let r=1;r<=6;r++){let a=r/6,o=t+(i-t)*a,s=n+l*a,u=(Y(e+r*43)-.48)*(c*.14)*Math.sin(a*Math.PI),d=Y(e+r*59)>.65?l*.04:0;p.push({x:Math.round(o+u),y:Math.round(s+d)})}let m=[{x:t,y:n}];for(let r=1;r<=7;r++){let i=r/7,a=t+(o+u*.25+(Y(e+101)-.5)*(c*.15)-t)*i**1.2,s=n+l*i,d=Math.sin(i*Math.PI*2.2+Y(e+113))*(c*.1);m.push({x:Math.round(a+d),y:Math.round(s)})}let h=[],g=m[Math.min(m.length-1,2)];if(g){let t=o+c*.55+(Y(e+201)-.5)*15,n=s-l*.12,r=(g.x+t)/2+12,i=(g.y+n)/2-6;h.push({d:`M ${g.x},${g.y} Q ${r},${i} ${t},${n}`,side:`right`})}let _=m[Math.min(m.length-1,5)];if(_){let t=o+c*.85+(Y(e+209)-.5)*15,n=s,r=(_.x+t)/2+10,i=(_.y+n)/2-4;h.push({d:`M ${_.x},${_.y} Q ${r},${i} ${t},${n}`,side:`right`})}let v=m[Math.min(m.length-1,3)];if(v){let t=o-c*.6+(Y(e+301)-.5)*15,n=s-l*.15,r=(v.x+t)/2-10,i=(v.y+n)/2-5;h.push({d:`M ${v.x},${v.y} Q ${r},${i} ${t},${n}`,side:`left`})}let y=[],b=Math.max(14,Math.round(l/4.8));for(let r=1;r<=b;r++){let a=r/(b+1),o=m[Math.min(m.length-1,Math.max(0,Math.round(a*(m.length-1))))],s=n+l*a,c=p[Math.min(p.length-1,Math.max(0,Math.round(a*(p.length-1))))]||{x:t+(i-t)*a,y:s},u=o.x+(c.x-o.x)*.08,d=s+(Y(e+r*71)-.5)*3,f=r%3==0?.92:r%2==0?.75:.6,h=u+(c.x-u)*f,g=d+((s-n)*.22+(c.y-s)*.35)+(Y(e+r*83)-.5)*4;y.push({x1:Math.round(u),y1:Math.round(d),x2:Math.round(h),y2:Math.round(g),width:r<4?.9:1.25,opacity:r<3?.6:.85}),r>4&&r%2==0&&y.push({x1:Math.round(u+(h-u)*.3),y1:Math.round(d+(g-d)*.3),x2:Math.round(u+(h-u)*.75),y2:Math.round(d+(g-d)*.15),width:.75,opacity:.55})}let x=[],S=Math.max(4,Math.round(l/18));for(let i=1;i<=S;i++){let a=(i+.3)/(S+1),o=n+l*a,s=m[Math.min(m.length-1,Math.round(a*(m.length-1)))],c=f[Math.min(f.length-1,Math.round(a*(f.length-1)))]||{x:t-(t-r)*a,y:o},u=s.x-(s.x-c.x)*.25,d=o+2,p=s.x-(s.x-c.x)*(.6+Y(e+i*97)*.3),h=o+8+Y(e+i*103)*6,g=(u+p)/2-4,_=(d+h)/2+3;if(x.push({d:`M ${Math.round(u)},${Math.round(d)} Q ${Math.round(g)},${Math.round(_)} ${Math.round(p)},${Math.round(h)}`,width:.9}),i%2==1){let e=u-6,t=d+3;x.push({d:`M ${Math.round(e)},${Math.round(t)} L ${Math.round(e-8)},${Math.round(t+10)}`,width:.75})}}let C=``,w=``;if(d){let e=n+l*.32,a=t-(t-r)*.32,o=t+(i-t)*.32,s=m[Math.min(m.length-1,2)]||{x:t,y:e},c={x:t-(t-r)*.16,y:e-4},u={x:t-(t-r)*.26,y:e+6},d={x:t+(i-t)*.14,y:e+3},h={x:t+(i-t)*.24,y:e-2};C=`M ${t},${n} 2 L ${f[1].x},${f[1].y} 3 L ${a},${e} 4 Q ${u.x},${u.y} ${c.x},${c.y} 5 L ${s.x},${s.y} 6 Q ${d.x},${d.y} ${h.x},${h.y} 7 L ${o},${e} 8 L ${p[1].x},${p[1].y} 9 Z`,w=`M ${t},${n} 10 L ${s.x},${s.y} 11 Q ${d.x},${d.y} ${h.x},${h.y} 12 L ${o},${e} 13 L ${p[1].x},${p[1].y} 14 Z`}let T=[],E=[],D=Math.round(c/8);for(let t=0;t<D;t++){let n=(Y(e+t*131)-.5)*(c*1.8),r=o+n,i=s+(Y(e+t*137)-.3)*12;T.push({x:Math.round(r),y:Math.round(i),r:.75+Y(e+t*149)*.8}),t%2==0&&E.push({x1:Math.round(r-4),y1:Math.round(i-3),x2:Math.round(r+2),y2:Math.round(i+4)})}let O=f.map((e,t)=>t===0?`M ${e.x},${e.y}`:`L ${e.x},${e.y}`).join(` `),k=p.map(e=>`L ${e.x},${e.y}`).join(` `),A=m.map((e,t)=>t===0?`M ${e.x},${e.y}`:`L ${e.x},${e.y}`).join(` `),j=`${O} ${k} Z`,ee=p[p.length-1];return{peakX:t,peakY:n,leftX:r,rightX:i,fullPerimeterPath:j,shadedFacePath:`${A} L ${ee.x},${ee.y} ${p.slice().reverse().map(e=>`L ${e.x},${e.y}`).join(` `)} Z`,ridgePathStr:A,spurs:h,hachures:y,westStrata:x,snowCapPath:C,snowShadePath:w,screeStipples:T,screeLines:E}},[a,o,s,c,l,u,d]),p=n?`#231d17`:`#ded1b4`,m=n?`#1c1712`:`#cdbe9e`,h=n?`#ddd4c5`:`#fcfbf7`,g=n?`#a89c89`:`#e4d8c3`;return(0,J.jsxs)(`g`,{id:`mountain-${a}`,className:`realistic-mountain-group transition-all duration-300 select-none`,children:[(0,J.jsx)(`path`,{d:f.fullPerimeterPath,fill:p,stroke:r,strokeWidth:`1.8`,strokeLinejoin:`round`,strokeLinecap:`round`}),(0,J.jsx)(`path`,{d:f.shadedFacePath,fill:m,opacity:n?.7:.55}),d&&f.snowCapPath&&(0,J.jsxs)(`g`,{id:`snowcap-${a}`,children:[(0,J.jsx)(`path`,{d:f.snowCapPath,fill:h,stroke:r,strokeWidth:`1.1`,strokeLinejoin:`round`,opacity:n?.85:.95}),f.snowShadePath&&(0,J.jsx)(`path`,{d:f.snowShadePath,fill:g,opacity:.65})]}),(0,J.jsx)(`g`,{id:`strata-${a}`,stroke:r,strokeLinecap:`round`,opacity:n?.65:.75,children:f.westStrata.map((e,t)=>(0,J.jsx)(`path`,{d:e.d,fill:`none`,strokeWidth:e.width},t))}),(0,J.jsx)(`g`,{id:`hachures-${a}
14`,stroke:i,strokeLinecap:`round`,children:f.hachures.map((e,t)=>(0,J.jsx)(`line`,{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,strokeWidth:e.width,opacity:e.opacity},t))}),(0,J.jsx)(`g`,{id:`spurs-${a}`,children:f.spurs.map((e,t)=>(0,J.jsx)(`path`,{d:e.d,fill:`none`,stroke:e.side===`right`?r:i,strokeWidth:e.side===`right`?1.6:1.2,strokeLinecap:`round`,opacity:.85},t))}),(0,J.jsx)(`path`,{d:f.ridgePathStr,fill:`none`,stroke:r,strokeWidth:`2.4`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,J.jsxs)(`g`,{id:`scree-${a}`,fill:r,stroke:i,opacity:n?.45:.6,children:[f.screeStipples.map((e,t)=>(0,J.jsx)(`circle`,{cx:e.x,cy:e.y,r:e.r},t)),f.screeLines.map((e,t)=>(0,J.jsx)(`line`,{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,strokeWidth:`0.8`,strokeLinecap:`round`},t))]})]})},pe=({tree:e,theme:t})=>{let{x:n,y:r,scale:i=1,type:a=`pine`}=e,o=t.id!==`parchment`,s=t.pencilColor,c=t.pencilShade,l=o?`#1e281c`:`#d8d4bf`,u=o?`#242a1e`:`#ded6bf`,d=o?`#2e251d`:`#cca98a`,f=o?`#1f2920`:`#d5dcc2`,p=o?`#293222`:`#e2dbcb`;return(0,J.jsx)(`g`,{id:`tree-${n}-${r}`,className:`realistic-tree`,children:(()=>{switch(a){case`pine`:case`spruce`:{let e=a===`spruce`?14:17,t=a===`spruce`?32:28;return(0,J.jsxs)(`g`,{transform:`translate(${n}, ${r}) scale(${i})`,children:[(0,J.jsx)(`ellipse`,{cx:`1`,cy:`2`,rx:e*.75,ry:`3`,fill:s,opacity:o?.25:.2}),(0,J.jsx)(`path`,{d:`M -1.8,2 L -1,-6 L 1,-6 L 1.8,2 Z`,fill:d,stroke:s,strokeWidth:`1.1`,strokeLinejoin:`round`}),(0,J.jsx)(`path`,{d:`M 0,-10 15 Q ${e*.55},-7 ${e*.95},-3 16 Q ${e*.6},0 0, -2 17 Q ${-e*.6},0 ${-e*.95},-3 18 Q ${-e*.55},-7 0,-10 Z`,fill:l,stroke:s,strokeWidth:`1.2`,strokeLinejoin:`round`}),(0,J.jsx)(`path`,{d:`M 1,-6 Q ${e*.5},-4 ${e*.85},-3 Q ${e*.4},-1 0,-2 Z`,fill:s,opacity:o?.4:.3}),(0,J.jsx)(`line`,{x1:`2`,y1:`-7`,x2:e*.75,y2:`-4`,stroke:c,strokeWidth:`0.8`}),(0,J.jsx)(`line`,{x1:`1`,y1:`-4`,x2:e*.65,y2:`-2`,stroke:c,strokeWidth:`0.8`}),(0,J.jsx)(`path`,{d:`M 0,-18 19 Q ${e*.45},-15 ${e*.8},-11 20 Q ${e*.5},-8 0, -10 21 Q ${-e*.5},-8 ${-e*.8},-11 22 Q ${-e*.45},-15 0,-18 Z`,fill:l,stroke:s,strokeWidth:`1.2`,strokeLinejoin:`round`}),(0,J.jsx)(`path`,{d:`M 1,-14 Q ${e*.45},-12 ${e*.7},-11 Q ${e*.35},-9 0,-10 Z`,fill:s,opacity:o?.4:.3}),(0,J.jsx)(`line`,{x1:`1`,y1:`-15`,x2:e*.6,y2:`-12`,stroke:c,strokeWidth:`0.8`}),(0,J.jsx)(`path`,{d:`M 0,-25 23 Q ${e*.35},-22 ${e*.55},-18 24 Q ${e*.3},-16 0, -17 25 Q ${-e*.3},-16 ${-e*.55},-18 26 Q ${-e*.35},-22 0,-25 Z`,fill:l,stroke:s,strokeWidth:`1.1`,strokeLinejoin:`round`}),(0,J.jsx)(`path`,{d:`M 0,-${t} L ${e*.35},-${t-9} Q 0,-${t-8} -${e*.35},-${t-9} Z`,fill:l,stroke:s,strokeWidth:`1.1`,strokeLinejoin:`round`}),(0,J.jsx)(`path`,{d:`M 0,-${t} L ${e*.35},-${t-9} Q 0,-${t-8} 0,-${t-9} Z`,fill:s,opacity:o?.4:.35}),(0,J.jsx)(`path`,{d:`M -5,1 L -3,3 M 3,2 L 5,0 M -1,3 L 0,1`,stroke:s,strokeWidth:`0.8`,strokeLinecap:`round`})]})}case`ancient_oak`:case`oak`:{let e=a===`ancient_oak`,t=e?22:18,l=e?24:20;return(0,J.jsxs)(`g`,{transform:`translate(${n}, ${r}) scale(${i})`,children:[(0,J.jsx)(`ellipse`,{cx:`2`,cy:`2`,rx:t*.8,ry:`4`,fill:s,opacity:o?.3:.22}),(0,J.jsx)(`path`,{d:`M -4,2 Q -3,-4 -2,-8 Q -6,-12 -8,-14 M 4,2 Q 3,-4 2,-8 Q 6,-12 9,-13 M -1,-8 L 0,-15`,fill:`none`,stroke:s,strokeWidth:`1.8`,strokeLinecap:`round`}),(0,J.jsx)(`path`,{d:`M -3.5,2 L -1.5,-8 L 1.5,-8 L 3.5,2 Z`,fill:d,stroke:s,strokeWidth:`1`}),(0,J.jsx)(`line`,{x1:`-0.8`,y1:`0`,x2:`-0.8`,y2:`-6`,stroke:c,strokeWidth:`0.75`}),(0,J.jsx)(`line`,{x1:`0.8`,y1:`1`,x2:`0.8`,y2:`-5`,stroke:c,strokeWidth:`0.75`}),(0,J.jsx)(`ellipse`,{cx:`6`,cy:`-14`,rx:t*.45,ry:l*.4,fill:s,opacity:.25}),(0,J.jsx)(`ellipse`,{cx:`2`,cy:`-8`,rx:t*.55,ry:l*.35,fill:s,opacity:.25}),(0,J.jsx)(`path`,{d:`M -${t*.85},-10 27 C -${t*1.05},-16 -${t*.8},-23 -${t*.45},-24 28 C -${t*.25},-30 ${t*.35},-31 ${t*.65},-25 29 C ${t*1.05},-24 ${t*1.15},-16 ${t*.9},-10 30 C ${t*1.05},-4 ${t*.65},0 0,-1 31 C -${t*.55},0 -${t*.95},-4 -${t*.85},-10 Z`,fill:u,stroke:s,strokeWidth:`1.35`,strokeLinejoin:`round`}),(0,J.jsx)(`path`,{d:`M -${t*.5},-18 Q -${t*.2},-24 ${t*.2},-22 Q ${t*.45},-18 ${t*.3},-14`,fill:`none`,stroke:s,strokeWidth:`1`}),(0,J.jsx)(`path`,{d:`M 1,-12 Q ${t*.5},-15 ${t*.8},-9 Q ${t*.45},-4 1,-6`,fill:s,opacity:o?.35:.28}),(0,J.jsx)(`path`,{d:`M -${t*.65},-10 Q -${t*.3},-13 -${t*.1},-8`,fill:`none`,stroke:s,strokeWidth:`1`}),(0,J.jsx)(`line`,{x1:t*.15,y1:`-17`,x2:t*.55,y2:`-14`,stroke:c,strokeWidth:`0.8`}),(0,J.jsx)(`line`,{x1:t*.25,y1:`-12`,x2:t*.7,y2:`-9`,stroke:c,strokeWidth:`0.8`}),(0,J.jsx)(`line`,{x1:t*.1,y1:`-7`,x2:t*.55,y2:`-4`,stroke:c,strokeWidth:`0.8`}),(0,J.jsx)(`path`,{d:`M -6,1 L -3,2 M 3,2 L 6,1 M -2,3 L -1,1 M 2,3 L 1,1`,stroke:s,strokeWidth:`0.9`,strokeLinecap:`round`})]})}case`willow`:return(0,J.jsxs)(`g`,{transform:`translate(${n}, ${r}) scale(${i})`,children:[(0,J.jsx)(`ellipse`,{cx:`1`,cy:`2`,rx:14.4,ry:`3.5`,fill:s,opacity:o?.28:.2}),(0,J.jsx)(`path`,{d:`M -3,2 Q -1,-4 -2,-9 Q -5,-14 -7,-17 M 3,2 Q 2,-4 3,-9 Q 5,-14 8,-16`,fill:`none`,stroke:s,strokeWidth:`1.6`,strokeLinecap:`round`}),(0,J.jsx)(`path`,{d:`M -2.5,2 L -1.5,-9 L 2,-9 L 2.5,2 Z`,fill:d,stroke:s,strokeWidth:`0.9`}),(0,J.jsx)(`path`,{d:`M -${18*.85},-12 32 C -${18*.95},-20 -9,-27 0,-26 33 C 9,-27 ${18*.95},-20 ${18*.85},-12 34 C ${18*.6},-7 0,-8 -${18*.85},-12 Z`,fill:f,stroke:s,strokeWidth:`1.2`,strokeLinejoin:`round`}),(0,J.jsx)(`path`,{d:`M -13.5,-12 Q -${18*.85},-4 -12.6,0 M -9.9,-14 Q -${18*.65},-3 -8.1,1 M -6.3,-15 Q -8.1,-1 -4.5,2`,fill:`none`,stroke:s,strokeWidth:`1.1`,strokeLinecap:`round`}),(0,J.jsx)(`path`,{d:`M -${18*.15},-16 Q -${18*.15},-2 0,1 M 1.8,-16 Q ${18*.15},-3 3.6,0`,fill:`none`,stroke:s,strokeWidth:`1.1`,strokeLinecap:`round`}),(0,J.jsx)(`path`,{d:`M 6.3,-15 Q 9,-2 7.2,2 M ${18*.6},-14 Q 13.5,-2 ${18*.65},1 M ${18*.78}
34,-12 Q 16.2,-3 14.4,0`,fill:`none`,stroke:s,strokeWidth:`1.2`,strokeLinecap:`round`}),(0,J.jsx)(`path`,{d:`M 1,-23 Q ${18*.6},-20 13.5,-12 Q 7.2,-10 0,-14 Z`,fill:s,opacity:o?.35:.25}),(0,J.jsx)(`path`,{d:`M -7,2 Q -5,-2 -4,0 M -5,2 Q -3,-3 -2,0 M 4,2 Q 6,-2 7,0 M 6,2 Q 8,-1 9,1`,stroke:s,strokeWidth:`0.8`,fill:`none`})]});default:return(0,J.jsxs)(`g`,{transform:`translate(${n}, ${r}) scale(${i})`,children:[(0,J.jsx)(`ellipse`,{cx:`1`,cy:`2`,rx:12*.6,ry:`3`,fill:s,opacity:.25}),(0,J.jsx)(`path`,{d:`M -1.2,2 L -0.6,-16 L 0.6,-16 L 1.2,2 Z`,fill:d,stroke:s,strokeWidth:`1`}),(0,J.jsx)(`line`,{x1:`-1`,y1:`-4`,x2:`0`,y2:`-4`,stroke:s,strokeWidth:`0.9`}),(0,J.jsx)(`line`,{x1:`0`,y1:`-8`,x2:`1`,y2:`-8`,stroke:s,strokeWidth:`0.9`}),(0,J.jsx)(`line`,{x1:`-0.8`,y1:`-12`,x2:`0.2`,y2:`-12`,stroke:s,strokeWidth:`0.9`}),(0,J.jsx)(`path`,{d:`M 0,-26 35 C ${12*.7},-22 ${12*.8},-10.4 5.4,-5.2 36 C 0,-3.9 -5.4,-5.2 -${12*.8},-10.4 37 C -${12*.8},-10.4 -${12*.7},-22 0,-26 Z`,fill:p,stroke:s,strokeWidth:`1.2`,strokeLinejoin:`round`}),(0,J.jsx)(`path`,{d:`M 0,-26 C ${12*.7},-22 ${12*.8},-10.4 5.4,-5.2 C 0,-3.9 0,-10.4 0,-26 Z`,fill:s,opacity:o?.35:.25}),(0,J.jsx)(`line`,{x1:`1`,y1:`-16`,x2:12*.55,y2:`-13`,stroke:c,strokeWidth:`0.8`}),(0,J.jsx)(`line`,{x1:`1`,y1:`-10`,x2:6,y2:`-7`,stroke:c,strokeWidth:`0.8`}),(0,J.jsx)(`line`,{x1:`-3`,y1:`2`,x2:`-1`,y2:`0`,stroke:s,strokeWidth:`0.8`}),(0,J.jsx)(`line`,{x1:`2`,y1:`2`,x2:`4`,y2:`0`,stroke:s,strokeWidth:`0.8`})]})}})()})},me=({river:e,theme:t,showLabels:n})=>{let r=t.id!==`parchment`,i=t.pencilColor,a=t.riverColor,o=(0,I.useMemo)(()=>e.id===`river-elden`?{riverPoly:`M 1340,290 38 C 1318,375 1272,455 1222,535 39 C 1152,635 1032,695 972,815 40 C 910,935 942,1055 892,1175 41 C 850,1275 770,1355 695,1480 42 L 670,1480 43 C 745,1355 825,1275 865,1175 44 C 915,1055 885,935 945,815 45 C 1005,695 1125,635 1195,535 46 C 1245,455 1295,375 1335,290 47 Z`,leftBank:`M 1335,290 C 1295,375 1245,455 1195,535 C 1125,635 1005,695 945,815 C 885,935 915,1055 865,1175 C 825,1275 745,1355 670,1480`,rightBank:`M 1345,290 C 1320,375 1275,455 1225,535 C 1155,635 1035,695 975,815 C 915,935 945,1055 895,1175 C 855,1275 775,1355 700,1480`,labelPos:{x:1040,y:980,rot:-55},islands:[{cx:960,cy:960,rx:14,ry:7,angle:-45,name:`Elden Ait`},{cx:770,cy:1330,rx:18,ry:8,angle:-50,name:`Otter Shoal`}],waterfall:{x:1215,y:540,width:32,height:24,angle:-38,name:`The Elden Cascades`},rapids:[{x:1140,y:660,angle:-40},{x:920,y:1020,angle:60}],sandbars:[{cx:995,cy:750,rx:12,ry:5,angle:30},{cx:900,cy:1110,rx:14,ry:6,angle:-25}],bridges:e.hasBridges||[{x:945,y:855,angle:-35,type:`stone_arch`,name:`Highbridge`},{x:890,y:1160,angle:25,type:`timber_trestle`,name:`Lower Toll Bridge`}]}:e.id===`river-silver`?{riverPoly:`M 580,410 48 C 650,488 730,548 780,658 49 C 830,758 910,808 960,818 50 L 960,824 51 C 908,814 828,764 778,664 52 C 728,554 648,494 578,414 53 Z`,leftBank:`M 578,412 C 648,492 728,552 778,662 C 828,762 908,812 958,822`,rightBank:`M 582,408 C 652,488 732,548 782,658 C 832,758 912,808 962,818`,labelPos:{x:740,y:710,rot:35},islands:[{cx:710,cy:535,rx:10,ry:5,angle:35,name:`Willow Islet`}],waterfall:{x:620,y:450,width:22,height:18,angle:45,name:`Silver Falls`},rapids:[{x:810,y:710,angle:50}],sandbars:[{cx:755,cy:610,rx:9,ry:4,angle:40}],bridges:e.hasBridges||[{x:740,y:620,angle:45,type:`stone_arch`,name:`Silver Arch`}]}:{riverPoly:`M 2150,320 54 C 2100,450 2050,600 2020,760 55 C 1990,920 1920,1050 1840,1180 56 C 1760,1310 1710,1420 1660,1500 57 L 1640,1500 58 C 1690,1420 1740,1310 1820,1180 59 C 1900,1050 1970,920 2000,760 60 C 2030,600 2080,450 2130,320 61 Z`,leftBank:`M 2130,320 C 2080,450 2030,600 2000,760 C 1970,920 1900,1050 1820,1180 C 1740,1310 1690,1420 1640,1500`,rightBank:`M 2150,320 C 2100,450 2050,600 2020,760 C 1990,920 1920,1050 1840,1180 C 1760,1310 1710,1420 1660,1500`,labelPos:{x:1920,y:1080,rot:-65}
61,islands:[{cx:1890,cy:1100,rx:12,ry:6,angle:-60,name:`Crag Islet`}],waterfall:{x:2070,y:520,width:28,height:22,angle:-30,name:`The Great Cataract`},rapids:[{x:1980,y:880,angle:-65}],sandbars:[{cx:1950,cy:980,rx:11,ry:5,angle:-55}],bridges:e.hasBridges||[{x:2010,y:810,angle:-20,type:`stone_arch`,name:`Highland Span`}]},[e.id,e.hasBridges]),s=a,c=r?`#3d3425`:`#e6dcbf`,l=r?`#263422`:`#d2d8ba`;return(0,J.jsxs)(`g`,{id:`realistic-${e.id}`,className:`realistic-river-group select-none`,children:[(0,J.jsx)(`path`,{d:o.riverPoly,fill:s,opacity:.88}),(0,J.jsx)(`path`,{d:o.leftBank,fill:`none`,stroke:i,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,J.jsx)(`path`,{d:o.rightBank,fill:`none`,stroke:i,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,J.jsx)(`path`,{d:o.leftBank,fill:`none`,stroke:r?`#e0d2bd`:`#ffffff`,strokeWidth:`0.8`,strokeDasharray:`14 18 8 22`,opacity:.65,transform:`translate(-2, -1)`}),(0,J.jsx)(`path`,{d:o.rightBank,fill:`none`,stroke:r?`#e0d2bd`:`#ffffff`,strokeWidth:`0.8`,strokeDasharray:`16 20 10 24`,opacity:.65,transform:`translate(2, 1)`}),(0,J.jsx)(`path`,{d:e.d,fill:`none`,stroke:r?`#5a4632`:`#7d6952`,strokeWidth:`1.2`,strokeDasharray:`24 32 14 36`,strokeLinecap:`round`,opacity:.7}),(0,J.jsx)(`path`,{d:e.d,fill:`none`,stroke:r?`#e8dcbe`:`#ffffff`,strokeWidth:`0.8`,strokeDasharray:`10 40 18 35`,strokeLinecap:`round`,opacity:.6,transform:`translate(1.5, -1)`}),o.sandbars.map((e,t)=>(0,J.jsxs)(`g`,{transform:`translate(${e.cx}, ${e.cy}) rotate(${e.angle})`,children:[(0,J.jsx)(`ellipse`,{cx:`0`,cy:`0`,rx:e.rx,ry:e.ry,fill:c,stroke:i,strokeWidth:`1`}),(0,J.jsx)(`circle`,{cx:`-3`,cy:`-1`,r:`0.6`,fill:i}),(0,J.jsx)(`circle`,{cx:`2`,cy:`1`,r:`0.7`,fill:i}),(0,J.jsx)(`circle`,{cx:`0`,cy:`0`,r:`0.5`,fill:i})]},t)),o.rapids.map((e,t)=>(0,J.jsxs)(`g`,{transform:`translate(${e.x}, ${e.y}) rotate(${e.angle})`,children:[(0,J.jsx)(`path`,{d:`M -12,-6 Q -6,-8 0,-6 Q 6,-4 12,-6 M -10,0 Q -4,-2 2,0 Q 8,2 10,0 M -8,6 Q -2,4 4,6`,fill:`none`,stroke:r?`#f4eedd`:`#ffffff`,strokeWidth:`1.4`,strokeLinecap:`round`,opacity:.9}),(0,J.jsx)(`circle`,{cx:`-5`,cy:`-2`,r:`1.8`,fill:r?`#2e251b`:`#6b5742`,stroke:i,strokeWidth:`0.8`}),(0,J.jsx)(`circle`,{cx:`6`,cy:`3`,r:`1.5`,fill:r?`#2e251b`:`#6b5742`,stroke:i,strokeWidth:`0.8`})]},t)),o.islands.map((e,a)=>(0,J.jsxs)(`g`,{transform:`translate(${e.cx}, ${e.cy}) rotate(${e.angle})`,children:[(0,J.jsx)(`ellipse`,{cx:`0`,cy:`0`,rx:e.rx,ry:e.ry,fill:l,stroke:i,strokeWidth:`1.4`}),(0,J.jsx)(`path`,{d:`M -${e.rx},0 Q -${e.rx+8},-2 -${e.rx+14},0 Q -${e.rx+8},2 -${e.rx},0`,fill:c,stroke:i,strokeWidth:`0.9`}),(0,J.jsx)(`g`,{transform:`scale(${e.rx>15?.6:.45})`,children:(0,J.jsx)(pe,{tree:{x:0,y:-1,scale:.65,type:`willow`,seed:a*99+42},theme:t})}),n&&e.name&&e.rx>13&&(0,J.jsx)(`text`,{x:`0`,y:e.ry+10,textAnchor:`middle`,fill:r?`#d4bfa1`:`#57422f`,className:`font-garamond italic text-[10px] font-semibold select-none`,children:e.name})]},a)),o.waterfall&&(0,J.jsxs)(`g`,{id:`waterfall-${e.id}`,transform:`translate(${o.waterfall.x}, ${o.waterfall.y}) rotate(${o.waterfall.angle})`,children:[(0,J.jsx)(`rect`,{x:-o.waterfall.width/2,y:`-4`,width:o.waterfall.width,height:`6`,rx:`2`,fill:r?`#2e251b`:`#6b5742`,stroke:i,strokeWidth:`1.4`}),(0,J.jsxs)(`g`,{stroke:r?`#f4eedd`:`#ffffff`,strokeWidth:`1.2`,opacity:.95,children:[(0,J.jsx)(`line`,{x1:-o.waterfall.width*.4,y1:`2`,x2:-o.waterfall.width*.4,y2:o.waterfall.height}),(0,J.jsx)(`line`,{x1:-o.waterfall.width*.2,y1:`2`,x2:-o.waterfall.width*.2,y2:o.waterfall.height+2,strokeWidth:`1.5`}),(0,J.jsx)(`line`,{x1:`0`,y1:`2`,x2:`0`,y2:o.waterfall.height+3,strokeWidth:`1.6`}),(0,J.jsx)(`line`,{x1:o.waterfall.width*.2,y1:`2`,x2:o.waterfall.width*.2,y2:o.waterfall.height+2,strokeWidth:`1.5`}),(0,J.jsx)(`line`,{x1:o.waterfall.width*.4,y1:`2`,x2:o.waterfall.width*.4,y2:o.waterfall.height})]}),(0,J.jsx)(`ellipse`,{cx:`0`,cy:o.waterfall.height+4,rx:o.waterfall.width*.65,ry:`6`,fill:`none`,stroke:r?`#f4eedd`:`#ffffff`,strokeWidth:`1.2`,strokeDasharray:`4 3 6 2`,opacity:.9}),n&&o.waterfall.name&&(0,J.jsxs)(`text`,{x:`0`,y:-10,textAnchor:`middle`,fill:r?`#e4caa0`:`#4a3420`,className:`font-cinzel text-[11px] font-bold tracking-wider select-none drop-shadow-sm`,children:[`â `,o.waterfall.
61name,` â`]})]}),o.bridges.map((t,a)=>(0,J.jsxs)(`g`,{id:`bridge-${e.id}-${a}`,transform:`translate(${t.x}, ${t.y}) rotate(${t.angle})`,children:[(0,J.jsx)(`rect`,{x:`-24`,y:`-10`,width:`8`,height:`20`,rx:`1`,fill:r?`#2e251b`:`#9c876b`,stroke:i,strokeWidth:`1.2`}),(0,J.jsx)(`rect`,{x:`16`,y:`-10`,width:`8`,height:`20`,rx:`1`,fill:r?`#2e251b`:`#9c876b`,stroke:i,strokeWidth:`1.2`}),(0,J.jsx)(`rect`,{x:`-20`,y:`-8`,width:`40`,height:`16`,rx:`2`,fill:r?`#3d3126`:`#d8c7a8`,stroke:i,strokeWidth:`1.8`}),(0,J.jsx)(`line`,{x1:`-20`,y1:`-8`,x2:`20`,y2:`-8`,stroke:i,strokeWidth:`1.4`}),(0,J.jsx)(`line`,{x1:`-20`,y1:`8`,x2:`20`,y2:`8`,stroke:i,strokeWidth:`1.4`}),(0,J.jsx)(`line`,{x1:`-12`,y1:`-8`,x2:`-12`,y2:`8`,stroke:i,strokeWidth:`1`}),(0,J.jsx)(`line`,{x1:`-6`,y1:`-8`,x2:`-6`,y2:`8`,stroke:i,strokeWidth:`1.1`}),(0,J.jsx)(`line`,{x1:`0`,y1:`-8`,x2:`0`,y2:`8`,stroke:i,strokeWidth:`1.5`}),(0,J.jsx)(`line`,{x1:`6`,y1:`-8`,x2:`6`,y2:`8`,stroke:i,strokeWidth:`1.1`}),(0,J.jsx)(`line`,{x1:`12`,y1:`-8`,x2:`12`,y2:`8`,stroke:i,strokeWidth:`1`}),(0,J.jsx)(`path`,{d:`M 0,-8 L -4,-13 L 4,-13 Z`,fill:r?`#2e251b`:`#9c876b`,stroke:i,strokeWidth:`1`}),(0,J.jsx)(`path`,{d:`M -6,-14 Q 0,-18 6,-14`,fill:`none`,stroke:r?`#f4eedd`:`#ffffff`,strokeWidth:`0.8`,opacity:.8}),n&&t.name&&(0,J.jsx)(`text`,{x:`0`,y:`18`,textAnchor:`middle`,fill:r?`#d4bfa1`:`#4a3726`,className:`font-garamond italic text-[10px] font-semibold select-none`,children:t.name})]},a)),n&&(0,J.jsxs)(`text`,{x:o.labelPos.x,y:o.labelPos.y,fill:r?`#e4caa0`:`#4a3420`,className:`font-cinzel italic text-[15px] font-bold tracking-widest select-none drop-shadow-sm`,opacity:.9,transform:`rotate(${o.labelPos.rot} ${o.labelPos.x} ${o.labelPos.y})`,children:[`~ `,e.name,` ~`]})]})},he=({forest:e,theme:t,showLabels:n})=>{let r=t.id!==`parchment`,i=t.pencilColor,a=t.pencilShade,{id:o,name:s,cx:c,cy:l,rx:u,ry:d,trees:f}=e,p=(0,I.useMemo)(()=>[...f].sort((e,t)=>e.y-t.y),[f]),m=(0,I.useMemo)(()=>{let e=[],t=[],n=[],r=c*13+l*19;for(let i=0;i<6;i++){let a=(i*1.8+r*.1)%(Math.PI*2),o=c+u*.7*Math.cos(a),s=l+d*.7*Math.sin(a);i%2==0?e.push({x:Math.round(o),y:Math.round(s),rx:5+i%3*2,ry:3+i%2*1.5,angle:i*35%60-30}):t.push({x:Math.round(o),y:Math.round(s),length:12+i%4*3,angle:i*45%90-45}),n.push({x:Math.round(c+Math.cos(a+.5)*(u*.5)),y:Math.round(l+Math.sin(a+.5)*(d*.5))})}return{boulders:e,fallenLogs:t,fernClusters:n}},[c,l,u,d]),h=(0,I.useMemo)(()=>{let e=[];for(let t=0;t<16;t++){let n=t/16*Math.PI*2,r=1+Math.sin(n*4+c*.05)*.08+Math.cos(n*3+l*.05)*.06,i=c+u*r*Math.cos(n),a=l+d*r*Math.sin(n);e.push({x:Math.round(i),y:Math.round(a)})}return e.map((e,t)=>t===0?`M ${e.x},${e.y}`:`L ${e.x},${e.y}`).join(` `)+` Z`},[c,l,u,d]);return(0,J.jsxs)(`g`,{id:`forest-zone-${o}`,className:`realistic-forest-group select-none`,children:[(0,J.jsx)(`path`,{d:h,fill:r?`rgba(32, 42, 26, 0.35)`:`rgba(195, 208, 175, 0.22)`,stroke:a,strokeWidth:`0.85`,strokeDasharray:`5 7 2 7`,opacity:.8}),(0,J.jsx)(`g`,{id:`boulders-${o}`,stroke:i,strokeWidth:`1`,children:m.boulders.map((e,t)=>(0,J.jsxs)(`g`,{transform:`translate(${e.x}, ${e.y}) rotate(${e.angle})`,children:[(0,J.jsx)(`ellipse`,{cx:`0`,cy:`0`,rx:e.rx,ry:e.ry,fill:r?`#2b241c`:`#c4b69c`}),(0,J.jsx)(`path`,{d:`M 0,-${e.ry} Q ${e.rx*.6},0 0,${e.ry} Q ${e.rx*.2},0 0,-${e.ry}`,fill:i,opacity:.3})]},t))}),(0,J.jsx)(`g`,{id:`logs-${o}`,stroke:i,strokeWidth:`1.2`,children:m.fallenLogs.map((e,t)=>(0,J.jsxs)(`g`,{transform:`translate(${e.x}, ${e.y}) rotate(${e.angle})`,children:[(0,J.jsx)(`line`,{x1:-e.length/2,y1:`0`,x2:e.length/2,y2:`0`,strokeLinecap:`round`,strokeWidth:`2.2`}),(0,J.jsx)(`circle`,{cx:-e.length/2,cy:`0`,r:`1.2`,fill:i}),(0,J.jsx)(`circle`,{cx:`2`,cy:`-1.5`,r:`0.8`,fill:r?`#d4bfa1`:`#f0e6d2`})]},t))}),(0,J.jsx)(`g`,{id:`ferns-${o}`,stroke:a,strokeWidth:`0.8`,fill:`none`,children:m.fernClusters.map((e,t)=>(0,J.jsx)(`g`,{transform:`translate(${e.x}, ${e.y})`,children:(0,J.jsx)(`path`,{d:`M 0,0 Q -4,-5 -7,-4 M 0,0 Q -2,-7 -2,-10 M 0,0 Q 3,-6 6,-4`})},t))}),(0,J.jsx)(`g`,{id:`trees-${o}`,children:p.map((e,n)=>(0,J.jsx)(pe,{tree:e,theme:t},n))}),n&&s&&(0,J.jsxs)(`g`,{transform:`translate(${c}, ${l-d-12})`,children:[(0,J.jsx)(`rect`,{x:`-90`,y:`-14`,width:`180`,height:`18`,rx:`3`,fill:r?`#1a1510`:`#f2e8d3`,stroke:a,strokeWidth:`0.75`,opacity:.85}),(0,J.jsxs)(`text`,{x:`0`,y:`0`,textAnchor:`middle`,fill:r?`#d8c2a3`:`#453525`,className:`font-garamond italic font-bold text-[13px] tracking-widest select-none drop-shadow-sm`,children:[`â `,s,` â`]})]})]})},ge=({theme:e,showLabels:t,finalNode:n})=>{let r=e.id!==`parchment`,i=e.pencilColor,a=e.pencilShade,o=e.riverColor,s=(0,I.useMemo)(()=>[...V].sort((e,t)=>
61{let n=e.layer??1,r=t.layer??1;return n===r?e.y-t.y:n-r}),[]);return(0,J.jsxs)(`g`,{id:`terrain-layer`,className:`select-none pointer-events-none`,children:[(0,J.jsxs)(`g`,{id:`rhumb-lines`,opacity:r?.08:.12,stroke:i,strokeWidth:`0.8`,strokeDasharray:`6 8`,children:[(0,J.jsx)(`line`,{x1:`0`,y1:`0`,x2:`2600`,y2:`1500`}),(0,J.jsx)(`line`,{x1:`0`,y1:`1500`,x2:`2600`,y2:`0`}),(0,J.jsx)(`line`,{x1:`1300`,y1:`0`,x2:`1300`,y2:`1500`}),(0,J.jsx)(`line`,{x1:`0`,y1:`750`,x2:`2600`,y2:`750`}),(0,J.jsx)(`circle`,{cx:`500`,cy:`400`,r:`300`,fill:`none`,strokeWidth:`0.5`}),(0,J.jsx)(`circle`,{cx:`2100`,cy:`1100`,r:`350`,fill:`none`,strokeWidth:`0.5`}),(0,J.jsx)(`circle`,{cx:`1300`,cy:`750`,r:`450`,fill:`none`,strokeWidth:`0.6`,strokeDasharray:`3 6`})]}),(0,J.jsxs)(`g`,{id:`coastlines`,stroke:i,children:[(0,J.jsx)(`path`,{d:`M 0,1180 Q 140,1220 200,1320 T 320,1500`,fill:`none`,strokeWidth:`2.5`,strokeLinecap:`round`}),(0,J.jsx)(`path`,{d:`M 0,1200 Q 150,1240 215,1340 T 340,1500`,fill:`none`,strokeWidth:`1.2`,strokeDasharray:`12 8 4 8`,opacity:.65}),(0,J.jsx)(`path`,{d:`M 0,1225 Q 160,1265 230,1365 T 365,1500`,fill:`none`,strokeWidth:`0.8`,strokeDasharray:`6 10`,opacity:.4}),(0,J.jsxs)(`g`,{id:`islands`,strokeWidth:`1.5`,children:[(0,J.jsx)(`path`,{d:`M 80,1390 Q 110,1370 140,1395 Q 120,1420 80,1390 Z`,fill:r?`#231d17`:`#e6d8be`}),(0,J.jsx)(`path`,{d:`M 160,1440 Q 185,1425 210,1445 Q 190,1465 160,1440 Z`,fill:r?`#231d17`:`#e6d8be`}),(0,J.jsx)(`line`,{x1:`105`,y1:`1385`,x2:`110`,y2:`1375`,strokeWidth:`1`}),(0,J.jsx)(`line`,{x1:`115`,y1:`1388`,x2:`122`,y2:`1378`,strokeWidth:`1`})]})]}),(0,J.jsx)(`g`,{id:`rivers-layer`,children:H.map(n=>(0,J.jsx)(me,{river:n,theme:e,showLabels:t},n.id))}),(0,J.jsx)(`g`,{id:`forests-layer`,children:U.map(n=>(0,J.jsx)(he,{forest:n,theme:e,showLabels:t},n.id))}),(0,J.jsxs)(`g`,{id:`mountains-layer`,children:[(0,J.jsxs)(`g`,{id:`distant-mountain-ridgelines`,opacity:r?.35:.45,stroke:a,fill:`none`,children:[(0,J.jsx)(`path`,{d:`M 330,330 Q 380,290 440,310 T 540,280 T 650,300 T 760,330`,strokeWidth:`1.2`,strokeDasharray:`4 4`}),(0,J.jsx)(`path`,{d:`M 1080,270 Q 1190,210 1310,195 T 1450,220 T 1580,245 T 1720,290`,strokeWidth:`1.4`,strokeDasharray:`5 4`}),(0,J.jsx)(`path`,{d:`M 1940,320 Q 2060,240 2200,180 T 2350,150 T 2480,230`,strokeWidth:`1.4`,strokeDasharray:`5 4`})]}),(0,J.jsxs)(`g`,{id:`alpine-tarns`,children:[(0,J.jsxs)(`g`,{id:`tarn-dragons-eye`,children:[(0,J.jsx)(`ellipse`,{cx:`1350`,cy:`365`,rx:`22`,ry:`12`,fill:o,stroke:i,strokeWidth:`1.4`,opacity:.9}),(0,J.jsx)(`path`,{d:`M 1335,363 Q 1350,361 1365,363 M 1340,367 Q 1350,369 1360,367`,stroke:r?`#e0d2bd`:`#ffffff`,strokeWidth:`0.8`,fill:`none`,opacity:.7}),(0,J.jsx)(`path`,{d:`M 1350,377 Q 1345,395 1335,410 T 1320,430`,fill:`none`,stroke:o,strokeWidth:`2`,strokeDasharray:`3 2`,opacity:.8}),t&&(0,J.jsx)(`text`,{x:`1350`,y:`350`,textAnchor:`middle`,fill:r?`#c5b597`:`#57422f`,className:`font-garamond italic text-[11px] font-semibold select-none`,children:`Dragon's Eye Tarn`})]}),(0,J.jsxs)(`g`,{id:`tarn-sunstone`,children:[(0,J.jsx)(`ellipse`,{cx:`2210`,cy:`275`,rx:`18`,ry:`10`,fill:o,stroke:i,strokeWidth:`1.3`,opacity:.9}),(0,J.jsx)(`path`,{d:`M 2198,274 Q 2210,272 2222,274`,stroke:r?`#e0d2bd`:`#ffffff`,strokeWidth:`0.75`,fill:`none`,opacity:.7})]}),(0,J.jsx)(`g`,{id:`tarn-mistwood`,children:(0,J.jsx)(`ellipse`,{cx:`585`,cy:`395`,rx:`16`,ry:`9`,fill:o,stroke:i,strokeWidth:`1.2`,opacity:.9})})]}),s.map(t=>(0,J.jsx)(fe,{mountain:t,theme:e},t.id)),t&&(0,J.jsxs)(`g`,{id:`mountain-range-banners`,className:`select-none pointer-events-none`,children:[(0,J.jsx)(`text`,{x:`1380`,y:`180`,textAnchor:`middle`,fill:r?`#e4caa0`:`#4a3420`,className:`font-cinzel-dec font-bold text-[18px] tracking-widest drop-shadow-sm`,opacity:.9,children:`â THE DRAGON TOOTH MOUNTAINS â`}),(0,J.jsx)(`text`,{x:`530`,y:`255`,textAnchor:`middle`,fill:r?`#d0b996`:`#523c28`,className:`font-cinzel font-bold text-[14px] tracking-widest`,opacity:.85,children:`~ THE WESTERN CRAGS ~`}),(0,J.jsx)(`text`,{x:`2260`,y:`135`,textAnchor:`middle`,fill:r?`#e4caa0`:`#4a3420`,className:`font-cinzel-dec font-bold text-[16px] tracking-widest drop-shadow-sm`,opacity:.9,children:`â SUNSTONE CITADEL PEAKS â`})]})]}),(0,J.jsxs)(`g`,{id:`sea-monsters`,opacity:r?.7:.85,children:[(0,J.jsxs)(`g`,{transform:`translate(140, 1260) scale(0.85)`,stroke:i,fill:`none`,children:[(0,J.jsx)(`path`,{d:`M 10,20 Q 30,-15 50,20 Q 70,-20 90,20 Q 110,-10 125,20`,strokeWidth:`2.2`,strokeLinecap:`round`}),(0,J.jsx)(`path`,{d:`M 10,20 Q -5,10 0,-5 Q 10,-15 18,-5 Q 12,5 10,20 Z`,strokeWidth:`2`,fill:r?`#231e18`:`#e0d3b6`}),(0,J.jsx)(`circle`,{cx:`6`,cy:`-6`,r:`1.5`,fill:i}
61),(0,J.jsx)(`path`,{d:`M -2,-4 L -10,-7 L -7,-3`,strokeWidth:`1.2`,strokeLinecap:`round`}),(0,J.jsx)(`line`,{x1:`30`,y1:`-8`,x2:`33`,y2:`-18`,strokeWidth:`1.5`}),(0,J.jsx)(`line`,{x1:`70`,y1:`-12`,x2:`73`,y2:`-22`,strokeWidth:`1.5`}),(0,J.jsx)(`line`,{x1:`108`,y1:`-4`,x2:`111`,y2:`-14`,strokeWidth:`1.5`}),(0,J.jsx)(`path`,{d:`M -15,22 Q 30,28 70,22 Q 110,28 145,22`,strokeWidth:`1.2`,strokeDasharray:`4 6`}),t&&(0,J.jsx)(`text`,{x:`70`,y:`44`,textAnchor:`middle`,fill:r?`#a89476`:`#6b543b`,className:`font-garamond italic text-[12px]`,children:`"Hic Sunt Dracones"`})]}),(0,J.jsxs)(`g`,{transform:`translate(360, 1420) scale(0.65)`,stroke:i,fill:`none`,children:[(0,J.jsx)(`path`,{d:`M -30,10 Q 0,16 35,10 Q 40,0 30,-5 L -35,-5 Q -40,0 -30,10 Z`,strokeWidth:`1.8`,fill:r?`#2a221b`:`#ded1b4`}),(0,J.jsx)(`line`,{x1:`-15`,y1:`-5`,x2:`-15`,y2:`-45`,strokeWidth:`1.8`}),(0,J.jsx)(`line`,{x1:`10`,y1:`-5`,x2:`10`,y2:`-52`,strokeWidth:`1.8`}),(0,J.jsx)(`line`,{x1:`28`,y1:`-5`,x2:`28`,y2:`-36`,strokeWidth:`1.4`}),(0,J.jsx)(`path`,{d:`M -28,-38 Q -15,-44 -2,-38 Q -15,-26 -28,-38 Z`,strokeWidth:`1.3`,fill:r?`#3d3429`:`#f0e6ce`}),(0,J.jsx)(`path`,{d:`M -4,-44 Q 10,-50 24,-44 Q 10,-32 -4,-44 Z`,strokeWidth:`1.3`,fill:r?`#3d3429`:`#f0e6ce`}),(0,J.jsx)(`path`,{d:`M -4,-28 Q 10,-34 24,-28 Q 10,-18 -4,-28 Z`,strokeWidth:`1.3`,fill:r?`#3d3429`:`#f0e6ce`}),(0,J.jsx)(`line`,{x1:`-15`,y1:`-45`,x2:`-35`,y2:`-5`,strokeWidth:`0.8`,strokeDasharray:`3 3`}),(0,J.jsx)(`line`,{x1:`10`,y1:`-52`,x2:`-20`,y2:`-5`,strokeWidth:`0.8`,strokeDasharray:`3 3`}),(0,J.jsx)(`line`,{x1:`10`,y1:`-52`,x2:`35`,y2:`-5`,strokeWidth:`0.8`,strokeDasharray:`3 3`}),(0,J.jsx)(`line`,{x1:`-48`,y1:`12`,x2:`-20`,y2:`12`,strokeWidth:`1`,strokeDasharray:`3 5`})]})]}),(0,J.jsxs)(`g`,{transform:`translate(2360, 1180)`,id:`compass-rose`,children:[(0,J.jsx)(`circle`,{cx:`0`,cy:`0`,r:`75`,fill:r?`rgba(30,25,20,0.85)`:`rgba(245,236,215,0.85)`,stroke:i,strokeWidth:`2`}),(0,J.jsx)(`circle`,{cx:`0`,cy:`0`,r:`66`,fill:`none`,stroke:i,strokeWidth:`1`,strokeDasharray:`2 4`}),(0,J.jsx)(`circle`,{cx:`0`,cy:`0`,r:`48`,fill:`none`,stroke:i,strokeWidth:`1.2`}),(0,J.jsx)(`polygon`,{points:`0,-72 6,-20 0,0`,fill:i}),(0,J.jsx)(`polygon`,{points:`0,-72 -6,-20 0,0`,fill:r?`#4a3f33`:`#cebe9f`,stroke:i,strokeWidth:`1`}),(0,J.jsx)(`polygon`,{points:`0,72 -6,20 0,0`,fill:i}),(0,J.jsx)(`polygon`,{points:`0,72 6,20 0,0`,fill:r?`#4a3f33`:`#cebe9f`,stroke:i,strokeWidth:`1`}),(0,J.jsx)(`polygon`,{points:`72,0 20,6 0,0`,fill:i}),(0,J.jsx)(`polygon`,{points:`72,0 20,-6 0,0`,fill:r?`#4a3f33`:`#cebe9f`,stroke:i,strokeWidth:`1`}),(0,J.jsx)(`polygon`,{points:`-72,0 -20,-6 0,0`,fill:i}),(0,J.jsx)(`polygon`,{points:`-72,0 -20,6 0,0`,fill:r?`#4a3f33`:`#cebe9f`,stroke:i,strokeWidth:`1`}),(0,J.jsx)(`polygon`,{points:`45,-45 14,-5 0,0`,fill:i}),(0,J.jsx)(`polygon`,{points:`45,-45 5,-14 0,0`,fill:r?`#4a3f33`:`#cebe9f`,stroke:i,strokeWidth:`0.8`}),(0,J.jsx)(`polygon`,{points:`-45,-45 -5,-14 0,0`,fill:i}),(0,J.jsx)(`polygon`,{points:`-45,-45 -14,-5 0,0`,fill:r?`#4a3f33`:`#cebe9f`,stroke:i,strokeWidth:`0.8`}),(0,J.jsx)(`polygon`,{points:`45,45 5,14 0,0`,fill:i}),(0,J.jsx)(`polygon`,{points:`45,45 14,5 0,0`,fill:r?`#4a3f33`:`#cebe9f`,stroke:i,strokeWidth:`0.8`}),(0,J.jsx)(`polygon`,{points:`-45,45 -14,5 0,0`,fill:i}),(0,J.jsx)(`polygon`,{points:`-45,45 -5,14 0,0`,fill:r?`#4a3f33`:`#cebe9f`,stroke:i,strokeWidth:`0.8`}),(0,J.jsx)(`circle`,{cx:`0`,cy:`0`,r:`7`,fill:r?`#d4af37`:`#99732d`,stroke:i,strokeWidth:`1.5`}),(0,J.jsx)(`text`,{x:`0`,y:`-80`,textAnchor:`middle`,fill:r?`#f4d27a`:`#852e18`,className:`font-cinzel-dec font-bold text-[18px]`,children:`N`}),(0,J.jsx)(`text`,{x:`0`,y:`94`,textAnchor:`middle`,fill:r?`#d4caa9`:`#3d2e1e`,className:`font-cinzel font-bold text-[14px]`,children:`S`}),(0,J.jsx)(`text`,{x:`88`,y:`5`,textAnchor:`middle`,fill:r?`#d4caa9`:`#3d2e1e`,className:`font-cinzel font-bold text-[14px]`,children:`E`}),(0,J.jsx)(`text`,{x:`-88`,y:`5`,textAnchor:`middle`,fill:r?`#d4caa9`:`#3d2e1e`,className:`font-cinzel font-bold text-[14px]`,children:`W`})]}),(0,J.jsxs)(`g`,{transform:`translate(820, 120)`,id:`map-cartouche`,children:[(0,J.jsx)(`rect`,{x:`-220`,y:`-45`,width:`440`,height:`85`,rx:`6`,fill:r?`#231e17`:`#f5ebd3`,stroke:i,strokeWidth:`2.5`}),(0,J.jsx)(`rect`,{x:`-214`,y:`-39`,width:`428`,height:`73`,rx:`4`,fill:`none`,stroke:i,strokeWidth:`1`,strokeDasharray:`4 2`}),(0,J.jsx)(`path`,{d:`M -210,-30 Q -195,-30 -195,-15 M 210,-30 Q 195,-30 195,-15`,stroke:i,strokeWidth:`1.2`,fill:`none`}),(0,J.jsx)(`path`,{d:`M -210,25 Q -195,25 -195,10 M 210,25 Q 195,25 195,10`,stroke:i,strokeWidth:`1.2`,fill:`none`}),(0,J.jsx)(`text`,{x:`0`,y:`-12`,textAnchor:`middle`,fill:r?`#f4d27a`:`#5a2211`,className:`font-cinzel-dec font-bold text-[22px] tracking-widest`,children:`THE EXPEDITION TRAIL`}),(0,J.jsx)(`text`,{x:`0`,y:`15`,textAnchor:`middle`,fill:r?`#d2c2a5`:`#5c4530`,className:`font-garamond italic font-semibold text-[14px] tracking-wide`,children:`Path to the tower.`})]}),n&&(0,J.jsxs)(`g`,{id:`huge-stone-tower`,transform:`translate(${n.x}, ${n.y})`,children:[(0,J.jsx)(`path`,{d:`M -65,10 Q 0,25 65,10 L 55,-10 Q 0,5 -55,-10 Z`,fill:r?`#1e1a14`:`#d2c4a7`,stroke:i,strokeWidth:`2.5`,strokeLinejoin:`round`}),(0,J.jsx)(`path`,{d:`M -50,-10 L -32,-190 L 32,-190 L 50,-10 Z`,fill:r?`#231e17`:`#e6d7bc`,stroke:i,strokeWidth:`2.5`,strokeLinejoin:`round`}),(0,J.jsx)(`path`,{d:`M -47,-30 Q 0,-20 47,-30 M -43,-70 Q 0,-60 43,-70 M -39,-110 Q 0,-100 39,-110 M -35,-150 Q 0,-140 35,-150`,fill:`none`,stroke:a,strokeWidth:`1.5`,strokeDasharray:`12 6`,opacity:`0.8`}),(0,J.jsxs)(`g`,{stroke:a,strokeWidth:`1.2`,opacity:`0.75`,strokeLinecap:`round`,children:[(0,J.jsx)(`line`,{x1:`-48`,y1:`-20`,x2:`-25`,y2:`-30`}),(0,J.jsx)(`line`,{x1:`-47`,y1:`-40`,x2:`-24`,y2:`-50`}),(0,J.jsx)(`line`,{x1:`-45`,y1:`-60`,x2:`-22`,y2:`-70`}),(0,J.jsx)(`line`,{x1:`-44`,y1:`-80`,x2:`-21`,y2:`-90`}),(0,J.jsx)(`line`,{x1:`-42`,y1:`-100`,x2:`-19`,y2:`-110`}),(0,J.jsx)(`line`,{x1:`-41`,y1:`-120`,x2:`-18`,y2:`-130`}),(0,J.jsx)(`line`,{x1:`-39`,y1:`-140`,x2:`-16`,y2:`-150`}),(0,J.jsx)(`line`,{x1:`-38`,y1:`-160`,x2:`-15`,y2:`-170`}),(0,J.jsx)(`line`,{x1:`-36`,y1:`-180`,x2:`-13`,y2:`-190`})]}),(0,J.jsx)(`path`,{d:`M -18,0 L -18,-35 C -18,-55 18,-55 18,-35 L 18,0 Z`,fill:r?`#0f0c09`:`#33271c`,stroke:i,strokeWidth:`2.5`}),(0,J.jsx)(`rect`,{x:`-6`,y:`-80`,width:`12`,height:`25`,rx:`5`,fill:r?`#0f0c09`:`#33271c`,stroke:i,strokeWidth:`1.5`}),(0,J.jsx)(`rect`,{x:`-22`,y:`-130`,width:`8`,height:`20`,rx:`3`,fill:r?`#0f0c09`:`#33271c`,stroke:i,strokeWidth:`1.5`}),(0,J.jsx)(`rect`,{x:`14`,y:`-130`,width:`8`,height:`20`,rx:`3`,fill:r?`#0f0c09`:`#33271c`,stroke:i,strokeWidth:`1.5`}),(0,J.jsx)(`rect`,{x:`-6`,y:`-170`,width:`12`,height:`25`,rx:`5`,fill:r?`#0f0c09`:`#33271c`,stroke:i,strokeWidth:`1.5`}),(0,J.jsx)(`path`,{d:`M -36,-190 L -36,-210 L -21,-210 L -21,-190 L -6,-190 L -6,-210 L 9,-210 L 9,-190 L 24,-190 L 24,-210 L 39,-210 L 39,-190 Z`,fill:r?`#1e1a14`:`#d2c4a7`,stroke:i,strokeWidth:`2.5`,strokeLinejoin:`round`}),(0,J.jsx)(`path`,{d:`M -45,-40 L -30,-30 L -25,-45 L -10,-40 M 35,-150 L 25,-140 L 30,-120`,fill:`none`,stroke:i,strokeWidth:`1.5`}),(0,J.jsx)(`path`,{d:`M 50,-10 Q 40,-30 45,-50 T 35,-80 T 42,-110 T 30,-130`,fill:`none`,stroke:r?`#3a4a2c`:`#5a6b42`,strokeWidth:`2.5`,strokeLinecap:`round`}),(0,J.jsx)(`path`,{d:`M -50,-15 Q -40,-25 -45,-45 T -35,-75`,fill:`none`,stroke:r?`#3a4a2c`:`#5a6b42`,strokeWidth:`2`,strokeLinecap:`round`}),t&&(0,J.jsx)(`text`,{x:`0`,y:`-235`,textAnchor:`middle`,fill:r?`#e0caa9`:`#3d2e1e`,className:`font-cinzel text-[16px] font-bold tracking-widest select-none drop-shadow-sm`,children:`THE ANCIENT CITADEL`})]})]})},_e=({theme:e,showGrid:t})=>
61{let n=e.id!==`parchment`,r=e.pencilColor,i=n?`#2e261f`:`#3d2f21`;return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`defs`,{children:[(0,J.jsxs)(`filter`,{id:`goldenGlow`,x:`-50%`,y:`-50%`,width:`200%`,height:`200%`,children:[(0,J.jsx)(`feGaussianBlur`,{in:`SourceGraphic`,stdDeviation:`4`,result:`blur1`}),(0,J.jsx)(`feGaussianBlur`,{in:`SourceGraphic`,stdDeviation:`10`,result:`blur2`}),(0,J.jsx)(`feGaussianBlur`,{in:`SourceGraphic`,stdDeviation:`22`,result:`blur3`}),(0,J.jsx)(`feColorMatrix`,{in:`blur3`,type:`matrix`,values:` 62 1 0 0 0 1 63 0 0.8 0 0 0.7 64 0 0 0.2 0 0 65 0 0 0 1.8 0`,result:`coloredBlur`}),(0,J.jsxs)(`feMerge`,{children:[(0,J.jsx)(`feMergeNode`,{in:`coloredBlur`}),(0,J.jsx)(`feMergeNode`,{in:`blur2`}),(0,J.jsx)(`feMergeNode`,{in:`blur1`}),(0,J.jsx)(`feMergeNode`,{in:`SourceGraphic`})]})]}),(0,J.jsxs)(`filter`,{id:`nodeGlow`,x:`-100%`,y:`-100%`,width:`300%`,height:`300%`,children:[(0,J.jsx)(`feGaussianBlur`,{in:`SourceGraphic`,stdDeviation:`6`,result:`blur`}),(0,J.jsxs)(`feMerge`,{children:[(0,J.jsx)(`feMergeNode`,{in:`blur`}),(0,J.jsx)(`feMergeNode`,{in:`SourceGraphic`})]})]}),(0,J.jsxs)(`linearGradient`,{id:`goldPathGradient`,x1:`0%`,y1:`0%`,x2:`100%`,y2:`100%`,children:[(0,J.jsx)(`stop`,{offset:`0%`,stopColor:`#f59e0b`,stopOpacity:`0.95`}),(0,J.jsx)(`stop`,{offset:`50%`,stopColor:`#fbbf24`,stopOpacity:`1`}),(0,J.jsx)(`stop`,{offset:`100%`,stopColor:`#fef08a`,stopOpacity:`1`})]}),(0,J.jsxs)(`radialGradient`,{id:`beaconGlow`,cx:`50%`,cy:`50%`,r:`50%`,children:[(0,J.jsx)(`stop`,{offset:`0%`,stopColor:`#fffbeb`,stopOpacity:`1`}),(0,J.jsx)(`stop`,{offset:`40%`,stopColor:`#f59e0b`,stopOpacity:`0.8`}),(0,J.jsx)(`stop`,{offset:`75%`,stopColor:`#d97706`,stopOpacity:`0.3`}),(0,J.jsx)(`stop`,{offset:`100%`,stopColor:`#b45309`,stopOpacity:`0`})]})]}),t&&(0,J.jsxs)(`g`,{id:`grid-lines`,stroke:r,strokeWidth:`0.6`,strokeDasharray:`3 7`,opacity:n?.15:.22,children:[Array.from({length:13}).map((e,t)=>{let n=(t+1)*200;return(0,J.jsx)(`line`,{x1:n,y1:`0`,x2:n,y2:1500},`gx-${t}`)}),Array.from({length:7}).map((e,t)=>{let n=(t+1)*200;return(0,J.jsx)(`line`,{x1:`0`,y1:n,x2:2600,y2:n},`gy-${t}`)})]}),(0,J.jsxs)(`g`,{id:`map-border`,pointerEvents:`none`,children:[(0,J.jsx)(`rect`,{x:`12`,y:`12`,width:L-24,height:R-24,fill:`none`,stroke:r,strokeWidth:`6`}),(0,J.jsx)(`rect`,{x:`20`,y:`20`,width:L-40,height:`14`,fill:n?`#231e17`:`#eee2ca`,stroke:r,strokeWidth:`1.5`}),(0,J.jsx)(`rect`,{x:`20`,y:R-34,width:L-40,height:`14`,fill:n?`#231e17`:`#eee2ca`,stroke:r,strokeWidth:`1.5`}),(0,J.jsx)(`rect`,{x:`20`,y:`20`,width:`14`,height:R-40,fill:n?`#231e17`:`#eee2ca`,stroke:r,strokeWidth:`1.5`}),(0,J.jsx)(`rect`,{x:L-34,y:`20`,width:`14`,height:R-40,fill:n?`#231e17`:`#eee2ca`,stroke:r,strokeWidth:`1.5`}),Array.from({length:32}).map((e,t)=>{if(t%2==0)return null;let n=(L-40)/32;return(0,J.jsxs)(I.Fragment,{children:[(0,J.jsx)(`rect`,{x:20+t*n,y:`20`,width:n,height:`14`,fill:i}),(0,J.jsx)(`rect`,{x:20+t*n,y:R-34,width:n,height:`14`,fill:i})]},`ruler-h-${t}`)}),(0,J.jsx)(`rect`,{x:`38`,y:`38`,width:L-76,height:R-76,fill:`none`,stroke:r,strokeWidth:`2`}),(0,J.jsxs)(`g`,{transform:`translate(38, 38)`,stroke:r,strokeWidth:`1.6`,fill:`none`,children:[(0,J.jsx)(`path`,{d:`M 0,0 L 45,0 C 25,25 25,25 0,45 Z`,fill:n?`#2f271f`:`#e6d7bc`}),(0,J.jsx)(`circle`,{cx:`20`,cy:`20`,r:`4`,fill:r}),(0,J.jsx)(`line`,{x1:`0`,y1:`0`,x2:`40`,y2:`40`})]}),(0,J.jsxs)(`g`,{transform:`translate(${L-38}, 38)`,stroke:r,strokeWidth:`1.6`,fill:`none`,children:[(0,J.jsx)(`path`,{d:`M 0,0 L -45,0 C -25,25 -25,25 0,45 Z`,fill:n?`#2f271f`:`#e6d7bc`}),(0,J.jsx)(`circle`,{cx:`-20`,cy:`20`,r:`4`,fill:r}),(0,J.jsx)(`line`,{x1:`0`,y1:`0`,x2:`-40`,y2:`40`})]}),(0,J.jsxs)(`g`,{transform:`translate(38, ${R-38})`,stroke:r,strokeWidth:`1.6`,fill:`none`,children:[(0,J.jsx)(`path`,{d:`M 0,0 L 45,0 C 25,-25 25,-25 0,-45 Z`,fill:n?`#2f271f`:`#e6d7bc`}),(0,J.jsx)(`circle`,{cx:`20`,cy:`-20`,r:`4`,fill:r}),(0,J.jsx)(`line`,{x1:`0`,y1:`0`,x2:`40`,y2:`-40`})]}),(0,J.jsxs)(`g`,{transform:`translate(${L-38}, ${R-38})`,stroke:r,strokeWidth:`1.6`,fill:`none`,children:[(0,J.jsx)(`path`,{d:`M 0,0 L -45,0 C -25,-25 -25,-25 0,-45 Z`,fill:n?`#2f271f`:`#e6d7bc`}),(0,J.jsx)(`circle`,{cx:`-20`,cy:`-20`,r:`4`,fill:r}),(0,J.jsx)(`line`,{x1:`0`,y1:`0`,x2:`-40`,y2:`-40`})]}),(0,J.jsxs)(`g`,{transform:`translate(480, 1445)`,stroke:r,children:[(0,J.jsx)(`rect`,{x:`0`,y:`0`,width:`180`,height:`8`,fill:`none`,strokeWidth:`1.2`}),(0,J.jsx)(`rect`,{x:`0`,y:`0`,width:`45`,height:`8`,fill:r}),(0,J.jsx)(`rect`,{x:`90`,y:`0`,width:`45`,height:`8`,fill:r}),(0,J.jsx)(`text`,{x:`0`,y:`-5`,textAnchor:`middle`,fill:n?`#d4c2a5`:`#4d3926`,className:`font-garamond text-[12px] font-bold`,children:`0`}),(0,J.jsx)(`text`,{x:`45`,y:`-5`,textAnchor:`middle`,fill:n?`#d4c2a5`:`#4d3926`,className:`font-garamond text-[12px] font-bold`,children:`25`}),(0,J.jsx)(`text`,{x:`90`,y:`-5`,textAnchor:`middle`,fill:n?`#d4c2a5`:`#4d3926`,className:`font-garamond text-[12px] font-bold`,children:`50`}),(0,J.jsx)(`text`,{x:`180`,y:`-5`,textAnchor:`middle`,fill:n?`#d4c2a5`:`#4d3926`,className:`font-garamond text-[12px] font-bold`,children:`100 Leagues`})]})]})]})},ve=({nodes:e,activeNodeIndex:t,completions:n,theme:r,showNodeNumbers:i,onNodeClick:a,hoveredNodeIndex:o,setHoveredNodeIndex:s})=>{let c=e.reduce((e,t,r)=>n.has(t.id)?Math.max(e,r):e,-1),l=Math.max(t,c),u=G(e),d=K(e,l),f=t>=0&&t<e.length?e[t]:null;return(0,J.jsxs)(`g`,{id:`curvy-path-nodes-layer`,children:[(0,J.jsxs)(`g`,{id:`unlit-path`,children:[(0,J.jsx)(`path`,{d:u,fill:`none`,stroke:r.pencilShade,strokeWidth:`3.2`,strokeDasharray:`6 7`,strokeLinecap:`round`,strokeLinejoin:`round`,opacity:.65}),(0,J.jsx)(`path`,{d:u,fill:`none`,stroke:r.pencilColor,strokeWidth:`2.2`,strokeDasharray:`5 6`,strokeLinecap:`round`,strokeLinejoin:`round`,opacity:.85})]}),l>0&&d&&(0,J.jsxs)(`g`,{id:`lit-path`,children:[(0,J.jsx)(`path`,{d,fill:`none`,stroke:`#f59e0b`,strokeWidth:`14`,strokeLinecap:`round`,strokeLinejoin:`round`,opacity:.35,filter:`url(#goldenGlow)`}),(0,J.jsx)(`path`,{d,fill:`none`,stroke:`url(#goldPathGradient)`,strokeWidth:`6`,strokeLinecap:`round`,strokeLinejoin:`round`,filter:`url(#goldenGlow)`}),(0,J.jsx)(`path`,{d,fill:`none`,stroke:`#fffbeb`,strokeWidth:`2.4`,strokeLinecap:`round`,strokeLinejoin:`round`,opacity:.95})]}),(0,J.jsx)(`g`,{id:`nodes-collection`,children:e.map((c,u)=>{let d=n.has(c.id),f=u<=l||d,p=u===t,m=o===u,h=(u+1)%25==0||u===0||u===e.length-1;return(0,J.jsxs)(`g`,{id:`node-${c.id}`,transform:`translate(${c.x}, ${c.y}
65)`,className:`cursor-pointer transition-transform duration-200`,onClick:e=>{e.stopPropagation(),a(u)},onMouseEnter:()=>s(u),onMouseLeave:()=>s(null),children:[(0,J.jsx)(`circle`,{cx:`0`,cy:`0`,r:`18`,fill:`transparent`}),!f&&!d&&(0,J.jsxs)(`g`,{children:[(0,J.jsx)(`circle`,{cx:`1`,cy:`1.5`,r:h?6.5:4.5,fill:r.pencilShade,opacity:.4}),(0,J.jsx)(`circle`,{cx:`0`,cy:`0`,r:h?6:4,fill:r.id===`parchment`?`#f0e5ce`:`#28221b`,stroke:r.pencilColor,strokeWidth:h?2:1.4}),h&&(0,J.jsx)(`circle`,{cx:`0`,cy:`0`,r:`2`,fill:r.pencilColor})]}),f&&!p&&(0,J.jsxs)(`g`,{filter:`url(#nodeGlow)`,children:[(0,J.jsx)(`circle`,{cx:`0`,cy:`0`,r:h?10:7,fill:d?`#10b981`:`#f59e0b`,opacity:.4}),(0,J.jsx)(`circle`,{cx:`0`,cy:`0`,r:h?7:5,fill:d?`#34d399`:`#fbbf24`,stroke:`#fffbeb`,strokeWidth:`1.6`}),(0,J.jsx)(`circle`,{cx:`0`,cy:`0`,r:h?2.5:1.8,fill:`#ffffff`})]}),p&&(0,J.jsxs)(`g`,{id:`active-node-beacon`,children:[(0,J.jsx)(`circle`,{cx:`0`,cy:`0`,r:`12`,fill:`none`,stroke:`#f59e0b`,strokeWidth:`2.5`,className:`beacon-wave`}),(0,J.jsx)(`circle`,{cx:`0`,cy:`0`,r:`12`,fill:`none`,stroke:`#fbbf24`,strokeWidth:`2`,className:`beacon-wave-delayed`}),(0,J.jsx)(`circle`,{cx:`0`,cy:`0`,r:`20`,fill:`url(#beaconGlow)`}),(0,J.jsx)(`circle`,{cx:`0`,cy:`0`,r:`9.5`,fill:d?`#10b981`:`#f59e0b`,stroke:`#ffffff`,strokeWidth:`2.4`,filter:`url(#goldenGlow)`}),(0,J.jsx)(`circle`,{cx:`0`,cy:`0`,r:`4.5`,fill:`#ffffff`}),(0,J.jsxs)(`g`,{transform:`translate(0, -18)`,children:[(0,J.jsx)(`line`,{x1:`0`,y1:`0`,x2:`0`,y2:`10`,stroke:`#f59e0b`,strokeWidth:`2.2`}),(0,J.jsx)(`polygon`,{points:`0,-10 7,-4 0,2 -7,-4`,fill:d?`#10b981`:`#ef4444`,stroke:`#ffffff`,strokeWidth:`1.5`,filter:`url(#nodeGlow)`}),(0,J.jsx)(`circle`,{cx:`0`,cy:`-4`,r:`2`,fill:`#ffffff`})]})]}),m&&!p&&(0,J.jsx)(`circle`,{cx:`0`,cy:`0`,r:`13`,fill:`none`,stroke:`#f59e0b`,strokeWidth:`2`,strokeDasharray:`3 3`}),(i||h||m)&&(0,J.jsx)(`text`,{x:`0`,y:h?-13:-10,textAnchor:`middle`,fill:d?`#059669`:f?`#d97706`:r.pencilColor,className:`font-pencil font-bold select-none ${h?`text-[13px]`:`text-[10px]`}`,opacity:f?1:.75,children:c.id<0?`P${u+1}`:c.id})]},c.id)})}),f&&(0,J.jsxs)(`g`,{transform:`translate(${f.x}, ${f.y-42})`,className:`pointer-events-none select-none transition-all duration-300`,children:[(0,J.jsx)(`rect`,{x:`-80`,y:`-24`,width:`160`,height:`32`,rx:`6`,fill:r.id===`parchment`?`#2a221b`:`#14120f`,stroke:`#f59e0b`,strokeWidth:`1.8`,filter:`url(#nodeGlow)`}),(0,J.jsx)(`polygon`,{points:`-6,8 6,8 0,14`,fill:r.id===`parchment`?`#2a221b`:`#14120f`,stroke:`#f59e0b`,strokeWidth:`1.8`}),(0,J.jsxs)(`text`,{x:`0`,y:`-8`,textAnchor:`middle`,fill:`#fef08a`,className:`font-cinzel font-bold text-[12px] tracking-wider`,children:[`NODE `,f.sequenceIndex+1,` / `,e.length]}),(0,J.jsx)(`text`,{x:`0`,y:`4`,textAnchor:`middle`,fill:`#ffffff`,className:`font-garamond italic font-semibold text-[11px]`,children:f.name.length>20?f.name.substring(0,18)+`â¦`:f.name})]})]})},ye=({nodes:e,activeNodeIndex:t,completions:n,theme:r,showLabels:i,showGrid:a,showNodeNumbers:o,autoCenterOnActive:s,onNodeClick:c,hoveredNodeIndex:l,setHoveredNodeIndex:u,transform:d,setTransform:f})=>{let p=(0,I.useRef)(null),m=(0,I.useRef)(!1),h=(0,I.useRef)({x:0,y:0}),g=(0,I.useRef)(null),_=(0,I.useRef)(null),[v,y]=(0,I.useState)(!1),b=(0,I.useRef)(d);b.current=d;let x=(0,I.useCallback)(t=>{if(!p.current||t<0||t>=e.length)return;let n=e[t],{clientWidth:r,clientHeight:i}=p.current,a=b.current.scale,o=Math.max(a,.9);f({x:r/2-n.x*o,y:i/2-n.y*o,scale:o})},[e,f]);(0,I.useEffect)(()=>{s&&t>=0&&x(t)},[t,s,x]),(0,I.useEffect)(()=>{if(p.current&&(!s||t<0)){let{clientWidth:e,clientHeight:t}=p.current,n=e/L,r=t/R,i=Math.min(n,r)*.9;f({x:(e-L*i)/2,y:(t-R*i)/2,scale:Math.max(i,.08)})}},[f,s,t]);let S=e=>{if(e.preventDefault(),!p.current)return;y(!0),_.current&&clearTimeout(_.current),_.current=setTimeout(()=>y(!1),140);let t=p.current.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top,i=e.deltaY<0?1.15:.85,a=Math.min(Math.max(d.scale*i,.08),3.5);f({x:n-(n-d.x)/d.scale*a,y:r-(r-d.y)/d.scale*a,scale:a})},C=e=>{e.button===0&&(m.current=!0,y(!0),h.current={x:e.clientX-d.x,y:e.clientY-d.y})},w=e=>{m.current&&f(t=>({...t,x:e.clientX-h.current.x,y:e.clientY-h.current.y}))},T=()=>{m.current=!1,y(!1)},E=e=>{if(y(!0),e.touches.length===1)m.current=!0,h.current={x:e.touches[0].clientX-d.x,y:e.touches[0].clientY-d.y};else if(e.touches.length===2){m.current=!1;let t=e.touches[0].clientX-e.touches[1].clientX,n=e.touches[0].clientY-e.touches[1].clientY;g.current=Math.hypot(t,n)}},D=e=>{if(e.touches.length===1&&m.current)f(t=>({...t,x:e.touches[0].clientX-h.current.x,y:e.touches[0].clientY-h.current.y}));else if(e.touches.length===2&&g.current&&p.current){let t=e.touches[0].clientX-e.touches[1].clientX,n=e.touches[0].clientY-e.touches[1].clientY,r=Math.hypot(t,n),i=r/g.current;g.current=r;let a=p.current.getBoundingClientRect(),o=(e.touches[0].clientX+e.touches[1].clientX)/2-a.left,s=(e.touches[0].clientY+e.touches[1].clientY)/2-a.top;f(e=>{let t=Math.min(Math.max(e.scale*i,.08),3.5);return{scale:t,x:o-(o-e.x)/e.scale*t,y:s-(s-e.y)/e.scale*t}})}},O=()=>{m.current=!1,g.current=null,y(!1)},k=r.id!==`parchment`;return(0,J.jsxs)(`div`,{id:`pencil-map-container`,ref:p,className:`relative w-full h-full overflow-hidden canvas-interactive select-none ${k?`parchment-dark-bg`:`parchment-bg`}`,onWheel:S,onMouseDown:C,onMouseMove:w,onMouseUp:T,onMouseLeave:T,onTouchStart:E,onTouchMove:D,onTouchEnd:O,children:[(0,J.jsx)(`div`,{className:`absolute inset-0 pointer-events-none z-10 ${k?`map-dark-vignette`:`map-vignette`}`}),(0,J.jsxs)(`svg`,{id:`pencil-map-svg`,viewBox:`0 0 ${L} ${R}`,width:L,height:R,style:{transform:`translate(${d.x}px, ${d.y}px) scale(${d.scale})`,transformOrigin:`0 0`,transition:v?`none`:`transform 0.4s cubic-bezier(0.16, 1, 0.3, 1)`},className:`absolute top-0 left-0`,children:[(0,J.jsx)(_e,{theme:r,showGrid:a}),(0,J.jsx)(ge,{theme:r,showLabels:i,finalNode:e[e.length-1]}),(0,J.jsx)(ve,{nodes:e,activeNodeIndex:t,completions:n,theme:r,showNodeNumbers:o,onNodeClick:c,hoveredNodeIndex:l,setHoveredNodeIndex:u})]})]})},be=({theme:e,soundEnabled:t,autoCenterOnActive:n,showLabels:r,showGrid:i,showNodeNumbers:a,tracks:o,activeTrack:c,onTrackChange:l,onToggleSound:u,onToggleAutoCenter:d,onToggleLabels:f,onToggleGrid:p,onToggleNodeNumbers:m,onToggleTheme:h,onZoomIn:g,onZoomOut:_,onResetZoom:v,onCenterActiveNode:b})=>{let x=e.id!==`parchment`;return(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 px-1 text-xs select-none`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-1.5 flex-wrap`,children:[o&&o.length>0&&l&&(0,J.jsxs)(`div`,{className:`flex items-center gap-1.5 bg-black/30 backdrop-blur-md px-2.5 py-1.5 rounded-xl border border-black/20 shadow-md`,children:[(0,J.jsx)(oe,{className:`w-3.5 h-3.5 text-amber-500`}),(0,J.jsx)(`span`,{className:`font-cinzel text-[10px] font-bold tracking-wider text-amber-600 dar
65k:text-amber-400 uppercase hidden sm:inline`,children:`Track:`}),(0,J.jsx)(`select`,{value:c,onChange:e=>l(e.target.value),className:`bg-transparent border-none text-xs font-cinzel font-bold text-amber-700 dark:text-amber-300 cursor-pointer focus:outline-none`,children:o.map(e=>(0,J.jsx)(`option`,{value:e.id,className:`bg-stone-900 text-stone-200`,children:e.name},e.id))})]}),(0,J.jsxs)(`button`,{id:`toggle-sound-btn`,onClick:u,title:t?`Mute Audio`:`Enable Audio`,className:`flex items-center gap-1 px-2.5 py-1.5 rounded-xl border backdrop-blur-md shadow-md transition-all cursor-pointer ${t?`bg-amber-500/20 border-amber-500/50 text-amber-600 dark:text-amber-400`:`bg-black/20 border-black/10 text-stone-500`}`,children:[t?(0,J.jsx)(S,{className:`w-3.5 h-3.5`}):(0,J.jsx)(D,{className:`w-3.5 h-3.5`}),(0,J.jsx)(`span`,{className:`font-garamond font-semibold hidden sm:inline`,children:`Audio`})]}),(0,J.jsxs)(`button`,{id:`toggle-autocenter-btn`,onClick:d,title:`Auto-Center on Active Node`,className:`flex items-center gap-1 px-2.5 py-1.5 rounded-xl border backdrop-blur-md shadow-md transition-all cursor-pointer ${n?`bg-amber-500/20 border-amber-500/50 text-amber-600 dark:text-amber-400`:`bg-black/20 border-black/10 text-stone-500`}`,children:[(0,J.jsx)(y,{className:`w-3.5 h-3.5`}),(0,J.jsx)(`span`,{className:`font-garamond font-semibold hidden sm:inline`,children:`Auto-Track`})]}),(0,J.jsxs)(`button`,{id:`toggle-labels-btn`,onClick:f,title:`Toggle Geographical Labels`,className:`flex items-center gap-1 px-2.5 py-1.5 rounded-xl border backdrop-blur-md shadow-md transition-all cursor-pointer ${r?`bg-amber-500/20 border-amber-500/50 text-amber-600 dark:text-amber-400`:`bg-black/20 border-black/10 text-stone-500`}`,children:[(0,J.jsx)(s,{className:`w-3.5 h-3.5`}),(0,J.jsx)(`span`,{className:`font-garamond font-semibold hidden sm:inline`,children:`Labels`})]}),(0,J.jsx)(`button`,{id:`toggle-grid-btn`,onClick:p,title:`Toggle Coordinate Grid`,className:`px-2.5 py-1.5 rounded-xl border backdrop-blur-md shadow-md font-garamond font-semibold transition-all cursor-pointer ${i?`bg-amber-500/20 border-amber-500/50 text-amber-600 dark:text-amber-400`:`bg-black/20 border-black/10 text-stone-500`}`,children:`Grid`}),(0,J.jsx)(`button`,{id:`toggle-numbers-btn`,onClick:m,title:`Toggle All Node Numbers`,className:`px-2.5 py-1.5 rounded-xl border backdrop-blur-md shadow-md font-garamond font-semibold transition-all cursor-pointer ${a?`bg-amber-500/20 border-amber-500/50 text-amber-600 dark:text-amber-400`:`bg-black/20 border-black/10 text-stone-500`}`,children:`#s`}),(0,J.jsxs)(`button`,{id:`toggle-theme-btn`,onClick:h,title:`Switch Map Lighting Style`,className:`flex items-center gap-1 px-2.5 py-1.5 rounded-xl border backdrop-blur-md shadow-md transition-all cursor-pointer ${x?`bg-amber-500/20 border-amber-500/50 text-amber-300`:`bg-amber-900/10 border-amber-900/20 text-amber-900`}`,children:[x?(0,J.jsx)(N,{className:`w-3.5 h-3.5`}):(0,J.jsx)(ae,{className:`w-3.5 h-3.5`}),(0,J.jsx)(`span`,{className:`font-garamond font-semibold hidden sm:inline`,children:x?`Day`:`Night`})]})]}),(0,J.jsxs)(`div`,{className:`flex items-center gap-1 bg-black/30 backdrop-blur-md p-1 rounded-xl border border-black/20 shadow-md`,children:[(0,J.jsx)(`button`,{id:`zoom-in-btn`,onClick:g,title:`Zoom In`,className:`p-1.5 rounded-lg hover:bg-white/10 text-stone-300 cursor-pointer`,children:(0,J.jsx)(P,{className:`w-4 h-4`})}),(0,J.jsx)(`button`,{id:`zoom-out-btn`,onClick:_,title:`Zoom Out`,className:`p-1.5 rounded-lg hover:bg-white/10 text-stone-300 cursor-pointer`,children:(0,J.jsx)(F,{className:`w-4 h-4`})}),(0,J.jsx)(`button`,{id:`center-active-btn`,onClick:b,title:`Focus Active Node`,className:`p-1.5 rounded-lg hover:bg-white/10 text-stone-300 cursor-pointer`,children:(0,J.jsx)(y,{className:`w-4 h-4 text-amber-400`})}),(0,J.jsx)(`button`,{id:`reset-zoom-btn`,onClick:v,title:`Fit Entire Map`,className:`p-1.5 rounded-lg hover:bg-white/10 text-stone-300 cursor-pointer`,children:(0,J.jsx)(ie,{className:`w-4 h-4`})})]})]})},xe=({node:e,activeNodeIndex:t,totalNodes:n,theme:r,onAdvance:a,onRetreat:o,details:s,modalLoading:c,isCompleted:p,toggleLoading:m,onToggleCompletion:h,onSelectProblemForReview:g})=>{let[v,y]=(0,I.useState)(!1),[S,C]=(0,I.useState)(!1);if(!e)return null;let w=r.id!==`parchment`,D=s.length>0,O=E(e.id);return(0,J.jsxs)(`div`,{id:`node-detail-card`,className:`relative p-4 rounded-2xl border-2 shadow-2xl backdrop-blur-md transition-all duration-300 max-h-[calc(100vh-180px)] overflow-y-auto custom-scrollbar select-none ${w?`bg-[#1c1813]/95 border-[#594634] text-[#f2e6d5]`:`bg-[#fbf5e8]/98 border-[#cbb38e] text-[#2c1d11]`}`,children:[(0,J.jsx)(`div`,{className:`absolute top-2 left-2 w-2.5 h-2.5 border-t-2 border-l-2 border-amber-600/70 pointer-events-none`}),(0,J.jsx)(`div`,{className:`absolute top-2 right-2 w-2.5 h-2.5 border-t-2 border-r-2 border-amber-600/70 pointer-events-none`}),(0,J.jsx)(`div`,{className:`absolute bottom-2 left-2 w-2.5 h-2.5 border-b-2 border-l-2 border-amber-600/70 pointer-events-none`}),(0,J.jsx)(`div`,{className:`absolute bottom-2 right-2 w-2.5 h-2.5 border-b-2 border-r-2 border-amber-600/70 pointer-events-none`}),(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b pb-2 mb-3 ${w?`border-amber-900/40`:`border-amber-900/15`}`,children:[(0,J.jsxs)(`span`,{className:`font-cinzel text-xs font-bold tracking-wider up
65percase ${w?`text-amber-400`:`text-amber-800`}`,children:[`Node `,t+1,` / `,n]}),p&&(0,J.jsx)(`span`,{className:`text-[10px] font-cinzel font-bold px-2 py-0.5 rounded border ${w?`bg-emerald-500/20 text-emerald-400 border-emerald-500/40`:`bg-emerald-600/15 text-emerald-800 border-emerald-600/30`}`,children:`â Solved`})]}),c?(0,J.jsxs)(`div`,{className:`py-6 flex flex-col items-center justify-center gap-2`,children:[(0,J.jsx)(_,{className:`w-5 h-5 text-amber-500 animate-spin`}),(0,J.jsx)(`span`,{className:`text-[10px] font-cinzel font-bold opacity-75 uppercase`,children:`Loading Problem Details...`})]}):D?(0,J.jsx)(`div`,{className:`space-y-3.5`,children:s.map(t=>(0,J.jsxs)(`div`,{className:`space-y-2.5`,children:[(0,J.jsxs)(`div`,{className:`flex justify-between items-start gap-2`,children:[(0,J.jsxs)(`h3`,{className:`font-bold font-headline-md text-base leading-snug m-0 ${w?`text-[#fef3c7]`:`text-[#1c120c]`}`,children:[e.id>0?`${e.id}. `:``,t.name]}),(0,J.jsx)(`span`,{className:`text-[9px] font-cinzel font-bold px-2 py-0.5 rounded border shrink-0 ${t.difficulty===`Easy`?w?`bg-emerald-950/90 text-emerald-300 border-emerald-500/40`:`bg-emerald-100 text-emerald-900 border-emerald-400`:t.difficulty===`Medium`?w?`bg-amber-950/90 text-amber-300 border-amber-500/40`:`bg-amber-100 text-amber-900 border-amber-400`:w?`bg-rose-950/90 text-rose-300 border-rose-500/40`:`bg-rose-100 text-rose-900 border-rose-400`}`,children:t.difficulty?.toUpperCase()||`MEDIUM`})]}),(0,J.jsxs)(`div`,{className:`text-xs font-garamond font-semibold ${w?`text-amber-300`:`text-amber-900`}`,children:[`Pattern: `,(0,J.jsx)(`span`,{className:`italic font-bold`,children:t.pattern||`General`})]}),(0,J.jsxs)(`div`,{className:`flex gap-4 text-xs font-semibold ${w?`text-stone-300`:`text-stone-800`}`,children:[(0,J.jsxs)(`div`,{children:[`Time:`,` `,(0,J.jsx)(`code`,{className:`px-1.5 py-0.5 rounded font-mono text-[11px] font-bold ${w?`bg-black/50 text-emerald-300`:`bg-amber-950/10 text-emerald-800`}`,children:t.optimal_time||`O(N)`})]}),(0,J.jsxs)(`div`,{children:[`Space:`,` `,(0,J.jsx)(`code`,{className:`px-1.5 py-0.5 rounded font-mono text-[11px] font-bold ${w?`bg-black/50 text-emerald-300`:`bg-amber-950/10 text-emerald-800`}`,children:t.optimal_space||`O(1)`})]})]}),(0,J.jsxs)(`div`,{className:`flex flex-col sm:flex-row gap-2 pt-1 border-t ${w?`border-amber-900/30`:`border-amber-900/10`}`,children:[t.google_doc_url&&(0,J.jsxs)(`a`,{href:t.google_doc_url,target:`_blank`,rel:`noreferrer`,className:`flex-1 flex items-center justify-center gap-1.5 py-2 px-2.5 rounded-xl border text-xs font-cinzel font-semibold transition-all cursor-pointer text-center ${w?`border-amber-500/30 bg-amber-500/10 hover:bg-amber-500/20 text-amber-200`:`border-amber-900/20 bg-amber-900/5 hover:bg-amber-900/10 text-amber-900`}`,children:[(0,J.jsx)(l,{className:`w-3.5 h-3.5`}),(0,J.jsx)(`span`,{children:`Google Doc`})]}),(0,J.jsxs)(`button`,{onClick:()=>g(t.id),className:`flex-1 flex items-center justify-center gap-1.5 py-2 px-2.5 rounded-xl bg-amber-600 hover:bg-amber-500 text-white text-xs font-cinzel font-bold shadow transition-all active:scale-95 cursor-pointer text-center`,children:[(0,J.jsx)(M,{className:`w-3.5 h-3.5`}),(0,J.jsx)(`span`,{children:`Review Problem`})]})]})]},t.id))}):O?(0,J.jsxs)(`div`,{className:`space-y-3.5`,children:[(0,J.jsxs)(`div`,{className:`flex justify-between items-start gap-2`,children:[(0,J.jsxs)(`h3`,{className:`font-bold font-headline-md text-base leading-snug m-0 ${w?`text-[#fef3c7]`:`text-[#1c120c]`}`,children:[`LC #`,O.problem_number,`. `,O.name]}),(0,J.jsx)(`span`,{className:`text-[9px] font-cinzel font-bold px-2 py-0.5 rounded border shrink-0 ${O.difficulty===`Easy`?w?`bg-emerald-950/90 text-emerald-300 border-emerald-500/40`:`bg-emerald-100 text-emerald-900 border-emerald-400`:O.difficulty===`Medium`?w?`bg-amber-950/90 text-amber-300 border-amber-500/40`:`bg-amber-100 text-amber-900 border-amber-400`:w?`bg-rose-950/90 text-rose-300 border-rose-500/40`:`bg-rose-100 text-rose-900 border-rose-400`}`,children:O.difficulty?.toUpperCase()||`MEDIUM`})]}),(0,J.jsxs)(`div`,{className:`text-xs font-garamond font-semibold ${w?`text-amber-300`:`text-amber-900`}`,children:[`Pattern: `,(0,J.jsx)(`span`,{className:`italic font-bold`,children:O.pattern})]}),(0,J.jsxs)(`div`,{className:`flex gap-4 text-xs font-semibold ${w?`text-stone-300`:`text-stone-800`}`,children:[(0,J.jsxs)(`div`,{children:[`Time:`,` `,(0,J.jsx)(`code`,{className:`px-1.5 py-0.5 rounded font-mono text-[11px] font-bold ${w?`bg-black/50 text-emerald-300`
65:`bg-amber-950/10 text-emerald-800`}`,children:O.time_complexity})]}),(0,J.jsxs)(`div`,{children:[`Space:`,` `,(0,J.jsx)(`code`,{className:`px-1.5 py-0.5 rounded font-mono text-[11px] font-bold ${w?`bg-black/50 text-emerald-300`:`bg-amber-950/10 text-emerald-800`}`,children:O.space_complexity})]})]}),O.description&&(0,J.jsx)(`div`,{className:`p-2.5 rounded-xl border text-xs leading-relaxed ${w?`bg-[#252019] border-[#5a4836] text-stone-200`:`bg-white/80 border-[#cbb38e] text-stone-800`}`,children:O.description}),(0,J.jsxs)(`div`,{className:`space-y-2 pt-1 border-t border-amber-900/20`,children:[(0,J.jsxs)(`div`,{className:`flex gap-2`,children:[(0,J.jsxs)(`button`,{onClick:async()=>{if(O&&!v){y(!0);try{await T(O),C(!0),p||h(e.id),setTimeout(()=>C(!1),3e3)}catch(e){console.error(`Failed to activate problem:`,e)}finally{y(!1)}}},disabled:v,className:`flex-1 flex items-center justify-center gap-1.5 py-2 px-2.5 rounded-xl border text-xs font-cinzel font-bold shadow-sm transition-all active:scale-95 cursor-pointer disabled:opacity-50 ${S?`bg-emerald-600 text-white border-emerald-400`:w?`bg-amber-500/15 border-amber-500/40 hover:bg-amber-500/25 text-amber-300`:`bg-amber-900/10 border-amber-900/30 hover:bg-amber-900/20 text-amber-900`}`,children:[v?(0,J.jsx)(_,{className:`w-3.5 h-3.5 animate-spin`}):S?(0,J.jsx)(f,{className:`w-3.5 h-3.5`}):(0,J.jsx)(x,{className:`w-3.5 h-3.5 text-amber-500`}),(0,J.jsx)(`span`,{children:S?`Added to Box 1!`:`Learned Today`})]}),(0,J.jsxs)(`button`,{onClick:async()=>{if(O&&!v){y(!0);try{let t=await T(O);p||h(e.id),g(t.problem_id)}catch(e){console.error(`Failed to launch problem:`,e)}finally{y(!1)}}},disabled:v,className:`flex-1 flex items-center justify-center gap-1.5 py-2 px-2.5 rounded-xl bg-amber-600 hover:bg-amber-500 text-white text-xs font-cinzel font-bold shadow transition-all active:scale-95 cursor-pointer disabled:opacity-50`,children:[(0,J.jsx)(M,{className:`w-3.5 h-3.5`}),(0,J.jsx)(`span`,{children:`Solve / Review`})]})]}),(0,J.jsxs)(`a`,{href:O.leetcode_url,target:`_blank`,rel:`noreferrer`,className:`w-full flex items-center justify-center gap-1.5 p-1.5 rounded-xl border text-[11px] font-garamond font-semibold transition-all cursor-pointer ${w?`border-amber-500/20 hover:bg-amber-500/10 text-stone-300`:`border-amber-900/20 hover:bg-amber-900/5 text-stone-800`}`,children:[(0,J.jsx)(l,{className:`w-3 h-3 text-emerald-500`}),(0,J.jsx)(`span`,{children:`Open on LeetCode.com`})]})]})]}):(0,J.jsxs)(`div`,{className:`space-y-3`,children:[(0,J.jsx)(`div`,{children:(0,J.jsx)(`h3`,{className:`font-bold font-headline-md text-base leading-snug m-0 ${w?`text-[#fef3c7]`:`text-[#1c120c]`}`,children:e.name})}),(0,J.jsxs)(`div`,{className:`p-3 rounded-xl border space-y-2 text-xs ${w?`bg-[#252019] border-[#5a4836] text-stone-200`:`bg-white/90 border-[#cbb38e] text-stone-800`}`,children:[(0,J.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,J.jsx)(u,{className:`w-4 h-4 text-amber-500 shrink-0 mt-0.5`}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`h4`,{className:`font-bold text-xs m-0`,children:`No Local Note Synced`}),(0,J.jsxs)(`p`,{className:`text-[10px] opacity-75 mt-0.5 leading-normal`,children:[`Sync Google Drive or create a note for problem #`,e.id,`.`]})]})]}),(0,J.jsxs)(`div`,{className:`space-y-1.5 pt-1 border-t ${w?`border-amber-900/20`:`border-amber-900/10`}`,children:[(0,J.jsx)(`a`,{href:`https://leetcode.com/problemset/?search=${e.id}`,target:`_blank`,rel:`noreferrer`,className:`w-full flex items-center justify-between p-1.5 rounded-lg border text-[11px] font-garamond font-semibold transition-all cursor-pointer ${w?`border-amber-500/20 hover:bg-amber-500/10 text-stone-200`:`border-amber-900/20 hover:bg-amber-900/5 text-stone-800`}`,children:(0,J.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,J.jsx)(l,{className:`w-3 h-3 text-emerald-500`}),`Search LeetCode #`,e.id]})}),(0,J.jsx)(`a`,{href:`https://www.google.com/search?q=leetcode+${e.id}`,target:`_blank`,rel:`noreferrer`,className:`w-full flex items-center justify-between p-1.5 rounded-lg border text-[11px] font-garamond font-semibold transition-all cursor-pointer ${w?`border-amber-500/20 hover:bg-amber-500/10 text-stone-200`:`border-amber-900/20 hover:bg-amber-900/5 text-stone-800`}`,children:(0,J.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,J.jsx)(d,{className:`w-3 h-3 text-amber-500`}),`Search Google Solution`]})})]})]})]}),(0,J.jsx)(`div`,{className:`pt-3 mt-3 border-t ${w?`border-amber-900/40`:`border-amber-900/15`}`,children:(0,J.jsx)(`button`,{onClick:()=>h(e.id),disabled:m,className:`w-full py-2.5 rounded-xl font-cinzel text-xs font-bold tracking-wider up
65percase flex items-center justify-center gap-2 cursor-pointer transition-all border shadow-sm active:scale-95 disabled:opacity-50 ${p?w?`bg-rose-500/15 border-rose-500/40 text-rose-400 hover:bg-rose-500/25`:`bg-rose-600/10 border-rose-600/30 text-rose-800 hover:bg-rose-600/20`:w?`bg-emerald-500/15 border-emerald-500/40 text-emerald-400 hover:bg-emerald-500/25`:`bg-emerald-600/10 border-emerald-600/30 text-emerald-800 hover:bg-emerald-600/20`}`,children:p?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(i,{className:`w-4 h-4`}),(0,J.jsx)(`span`,{children:`Unmark As Completed`})]}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(j,{className:`w-4 h-4`}),(0,J.jsx)(`span`,{children:`Mark As Completed`})]})})}),(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-2 pt-2.5 mt-2.5 border-t ${w?`border-amber-900/40`:`border-amber-900/15`}`,children:[(0,J.jsxs)(`button`,{onClick:o,disabled:t<=0,className:`flex items-center gap-1 text-[11px] font-cinzel font-semibold px-2.5 py-1.5 rounded-lg border transition-all disabled:opacity-30 cursor-pointer ${w?`border-amber-500/30 hover:bg-amber-500/10 text-stone-200`:`border-amber-900/20 hover:bg-amber-900/5 text-stone-800`}`,children:[(0,J.jsx)(A,{className:`w-3 h-3`}),(0,J.jsx)(`span`,{children:`Prev`})]}),(0,J.jsxs)(`span`,{className:`text-[10px] font-garamond italic font-semibold ${w?`text-stone-400`:`text-stone-600`}`,children:[`Waypoint `,t+1]}),(0,J.jsxs)(`button`,{onClick:a,disabled:t>=n-1,className:`flex items-center gap-1 text-[11px] font-cinzel font-semibold px-2.5 py-1.5 rounded-lg bg-amber-600 hover:bg-amber-500 text-white transition-all disabled:opacity-30 cursor-pointer shadow`,children:[(0,J.jsx)(`span`,{children:`Next`}),(0,J.jsx)(b,{className:`w-3 h-3`})]})]})]})},Se=({isOpen:e,onClose:t,nodes:n,theme:r,onReset:i})=>{if(!e)return null;let a=r.id!==`parchment`,s=n.length;return(0,J.jsx)(`div`,{className:`fixed inset-0 z-[120] flex items-center justify-center p-4 bg-black/70 backdrop-blur-sm animate-fade-in select-none`,children:(0,J.jsxs)(`div`,{id:`expedition-complete-modal`,className:`relative w-full max-w-lg p-6 rounded-2xl border-2 shadow-2xl transition-all ${a?`bg-[#1c1813] border-[#594634] text-[#f2e6d5]`:`bg-[#f7efe0] border-[#c8b28f] text-[#332415]`}`,children:[(0,J.jsx)(`button`,{onClick:t,className:`absolute top-4 right-4 p-1.5 rounded-lg opacity-60 hover:opacity-100 hover:bg-black/10 cursor-pointer`,children:(0,J.jsx)(p,{className:`w-5 h-5`})}),(0,J.jsxs)(`div`,{className:`text-center mb-6`,children:[(0,J.jsx)(`div`,{className:`inline-flex p-3 rounded-2xl bg-amber-500/20 border border-amber-500/40 text-amber-500 mb-3 shadow-lg shadow-amber-500/20`,children:(0,J.jsx)(o,{className:`w-10 h-10 animate-bounce`})}),(0,J.jsx)(`h2`,{className:`font-cinzel-dec font-bold text-2xl md:text-3xl text-amber-600 dark:text-amber-400`,children:`Expedition Completed!`}),(0,J.jsxs)(`p`,{className:`font-garamond italic text-sm md:text-base opacity-80 mt-1`,children:[`All `,s,` Waypoints and the entire ancient trail are now fully illuminated.`]})]}),(0,J.jsxs)(`div`,{className:`grid grid-cols-3 gap-3 mb-6`,children:[(0,J.jsxs)(`div`,{className:`p-3 rounded-xl bg-amber-500/10 border border-amber-900/15 text-center`,children:[(0,J.jsx)(`span`,{className:`block font-cinzel font-bold text-xl text-amber-600 dark:text-amber-300`,children:s}),(0,J.jsx)(`span`,{className:`font-garamond text-xs opacity-75`,children:`Nodes Solved`})]}),(0,J.jsxs)(`div`,{className:`p-3 rounded-xl bg-amber-500/10 border border-amber-900/15 text-center`,children:[(0,J.jsx)(`span`,{className:`block font-cinzel font-bold text-xl text-amber-600 dark:text-amber-300`,children:`7`}),(0,J.jsx)(`span`,{className:`font-garamond text-xs opacity-75`,children:`Biomes Crossed`})]}),(0,J.jsxs)(`div`,{className:`p-3 rounded-xl bg-amber-500/10 border border-amber-900/15 text-center`,children:[(0,J.jsx)(`span`,{className:`block font-cinzel font-bold text-xl text-amber-600 dark:text-amber-300`,children:`1,620m`}),(0,J.jsx)(`span`,{className:`font-garamond text-xs opacity-75`,children:`Peak Citadel`})]})]}),(0,J.jsxs)(`div`,{className:`space-y-2 mb-6 max-h-48 overflow-y-auto custom-scrollbar pr-1`,children:[n.length>0&&(0,J.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-garamond`,children:[(0,J.jsx)(h,{className:`w-4 h-4 text-emerald-500 flex-shrink-0`}),(0,J.jsx)(`span`,{className:`font-bold`,children:`Waypoint 1:`}),(0,J.jsx)(`span`,{children:n[0].name})]}),n.length>25&&(0,J.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-garamond`,children:[(0,J.jsx)(h,{className:`w-4 h-4 text-emerald-500 flex-shrink-0`}),(0,J.jsx)(`span`,{className:`font-bold`,children:`Waypoint 25:`}),(0,J.jsx)(`span`,{children:n[24].name})]}),n.length>50&&(0,J.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-garamond`,children:[(0,J.jsx)(h,{className:`w-4 h-4 text-emerald-500 flex-shrink-0`}),(0,J.jsx)(`span`,{className:`font-bold`,children:`Waypoint 50:`}),(0,J.jsx)(`span`,{children:n[49].name})]}),n.length>75&&(0,J.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-garamond`,children:[(0,J.jsx)(h,{className:`w-4 h-4 text-emerald-500 flex-shrink-0`}),(0,J.jsx)(`span`,{className:`font-bold`,children:`Waypoint 75:`}),(0,J.jsx)(`span`,{children:n[74].name})]}),n.length>0&&(0,J.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-garamond`,children:[(0,J.jsx)(h,{className:`w-4 h-4 text-emerald-500 flex-shrink-0`}),(0,J.jsx)(`span`,{className:`font-bold`,children:`Final Milestone:`}
65),(0,J.jsx)(`span`,{className:`text-amber-600 dark:text-amber-300 font-bold`,children:n[n.length-1].name})]})]}),(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,J.jsxs)(`button`,{onClick:()=>{i(),t()},className:`flex-1 flex items-center justify-center gap-1.5 py-2.5 px-4 rounded-xl border border-stone-400 dark:border-stone-700 font-cinzel font-semibold text-xs transition-all hover:bg-stone-500/10 cursor-pointer`,children:[(0,J.jsx)(C,{className:`w-4 h-4`}),(0,J.jsx)(`span`,{children:`Retrace From Start`})]}),(0,J.jsxs)(`button`,{onClick:t,className:`flex-1 flex items-center justify-center gap-1.5 py-2.5 px-4 rounded-xl bg-amber-600 hover:bg-amber-500 text-white font-cinzel font-bold text-xs shadow-lg transition-all cursor-pointer`,children:[(0,J.jsx)(v,{className:`w-4 h-4`}),(0,J.jsx)(`span`,{children:`Admire Map`})]})]})]})})},X=``,Ce=({nodes:e,activeNodeIndex:t,setActiveNodeIndex:r,completions:i,theme:o,onToggleCompletion:s,onSelectProblemForReview:c,onSwitchToMap:u,tracks:f,activeTrack:m,onTrackChange:v})=>{let y=o.id!==`parchment`,[b,x]=(0,I.useState)(``),[S,C]=(0,I.useState)(`all`),[D,A]=(0,I.useState)(`all`),[j,te]=(0,I.useState)(`all`),[re,ie]=(0,I.useState)(`sequence`),[ae,se]=(0,I.useState)(null),[N,P]=(0,I.useState)(null),F=(0,I.useRef)(null),L=(0,I.useMemo)(()=>{let t=new Set;return e.forEach(e=>{let n=E(e.id);n?.pattern&&t.add(n.pattern)}),t.size===0&&w().forEach(e=>t.add(e)),Array.from(t)},[e]),R=e.length,z=(0,I.useMemo)(()=>e.filter(e=>i.has(e.id)).length,[e,i]),B=R>0?Math.round(z/R*100):0,ue=(0,I.useMemo)(()=>{let t=b.trim().toLowerCase(),n=t.replace(/^#/,``);return e.filter(e=>{let r=i.has(e.id);if(S===`solved`&&!r||S===`unsolved`&&r)return!1;let a=E(e.id);if(D!==`all`&&a?.pattern!==D||j!==`all`&&a?.difficulty!==j)return!1;if(t){let r=String(e.id).includes(n),i=String(e.sequenceIndex+1)===n,o=e.name.toLowerCase().includes(t),s=a?.pattern?.toLowerCase().includes(t)??!1,c=a?.difficulty?.toLowerCase().includes(t)??!1;if(!r&&!i&&!o&&!s&&!c)return!1}return!0}).sort((e,t)=>{switch(re){case`number_asc`:return e.id-t.id;case`number_desc`:return t.id-e.id;case`name`:return e.name.localeCompare(t.name);default:return e.sequenceIndex-t.sequenceIndex}})},[e,i,S,D,j,b,re]),V=async e=>{if(N===null){P(e.id);try{let{data:{session:t}}=await n.auth.getSession(),r={Authorization:`Bearer ${t?t.access_token:`sandbox`}`},i=await fetch(`${X}/api/reviews/problems/${e.id}`,{headers:r});if(i.ok){let e=await i.json().catch(()=>[]);if(Array.isArray(e)&&e.length>0&&e[0]?.id){c(e[0].id);return}}let a=E(e.id);if(a){let e=await T(a);if(e?.problem_id){c(e.problem_id);return}}c(String(e.id))}catch(t){console.error(`Failed to prepare problem for review:`,t),c(String(e.id))}finally{P(null)}}};return(0,I.useEffect)(()=>{if(t>=0&&!b&&S===`all`&&D===`all`&&j===`all`){let e=setTimeout(()=>{let e=document.getElementById(`problem-item-${t}`);e&&e.scrollIntoView({behavior:`auto`,block:`center`})},80);return()=>clearTimeout(e)}},[t,b,S,D,j]),(0,J.jsxs)(`div`,{className:`relative w-full h-full flex flex-col overflow-hidden select-none transition-colors duration-300 ${y?`parchment-dark-bg text-[#f4ebd9]`:`parchment-bg text-[#2c2014]`}`,children:[(0,J.jsx)(`div`,{className:`absolute inset-0 pointer-events-none z-10 ${y?`map-dark-vignette`:`map-vignette`}`}),(0,J.jsx)(`div`,{className:`relative z-20 px-4 pt-16 pb-3 border-b backdrop-blur-md transition-colors ${y?`bg-[#1a1612]/90 border-[#4a392b]`:`bg-[#f7efe0]/90 border-[#c8b28f]`}`,children:(0,J.jsxs)(`div`,{className:`max-w-6xl mx-auto space-y-3`,children:[(0,J.jsxs)(`div`,{className:`flex flex-col sm:flex-row gap-2.5 items-stretch sm:items-center justify-between`,children:[(0,J.jsxs)(`div`,{className:`relative flex-1`,children:[(0,J.jsx)(`div`,{className:`absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none`,children:(0,J.jsx)(d,{className:`w-4 h-4 text-amber-600 dark:text-amber-400`})}),(0,J.jsx)(`input`,{id:`journey-search-input`,type:`text`,value:b,onChange:e=>x(e.target.value),placeholder:`Search problem title, #number, or pattern (e.g. 1, Two Sum, Two Pointers)...`,className:`w-full pl-9 pr-8 py-2 rounded-xl text-xs md:text-sm font-garamond font-semibold border-2 shadow-inner focus:outline-none transition-all ${y?`bg-[#231e18] border-[#5a4836] text-[#f4ebd9] placeholder-stone-500 focus:border-amber-500/70`:`bg-[#fcf7ee] border-[#cfbc9c] text-[#2c2014] placeholder-stone-500 focus:border-amber-700/60`}`}),b&&(0,J.jsx)(`button`,{onClick:()=>x(``),title:`Clear search`,className:`absolute inset-y-0 right-0 pr-2.5 flex items-center text-stone-400 hover:text-amber-600 cursor-pointer`,children:(0,J.jsx)(p,{className:`w-4 h-4`})})]}),(0,J.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[f&&f.length>0&&v&&(0,J.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2.5 py-1.5 rounded-xl border text-xs font-cinzel font-bold shadow-sm ${y?`bg-[#231e18] border-[#5a4836] text-amber-300`:`bg-[#fcf7ee] border-[#cfbc9c] text-amber-900`}`,children:[(0,J.jsx)(oe,{className:`w-3.5 h-3.5 text-amber-500 shrink-0`}),(0,J.jsx)(`span`,{className:`text-[10px] uppercase opacity-75 hidden md:inline`,children:`Track:`}),(0,J.jsx)(`select`,{value:m,onChange:e=>v(e.target.value),className:`bg-transparent border-none text-xs font-cinzel font-bold cursor-pointer focus:outline-none`,children:f.map(e=>(0,J.jsx)(`option`,{value:e.id,className:`bg-stone-900 text-stone-200`,children:e.name},e.id))})]}),(0,J.jsxs)(`button`,{onClick:()=>{let e=document.getElementById(`problem-item-${t}`);e&&(e.scrollIntoView({behavior:`smooth`,block:`center`}),q.playPencilScratch())},title:`Scroll to active problem in list`,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-xl border text-xs font-cinzel font-bold transition-all shadow-sm active:scale-95 cursor-pointer ${y?`bg-
65amber-500/20 border-amber-500/40 text-amber-300 hover:bg-amber-500/30`:`bg-amber-600/15 border-amber-600/30 text-amber-900 hover:bg-amber-600/25`}`,children:[(0,J.jsx)(le,{className:`w-3.5 h-3.5 text-amber-500`}),(0,J.jsx)(`span`,{className:`hidden sm:inline`,children:`Current Problem`}),(0,J.jsxs)(`span`,{className:`font-mono text-[11px]`,children:[`#`,t+1]})]})]})]}),(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2.5 pt-1 text-xs`,children:[(0,J.jsx)(`div`,{className:`flex items-center gap-1`,children:[`all`,`solved`,`unsolved`].map(e=>{let t=S===e,n=e===`all`?R:e===`solved`?z:R-z;return(0,J.jsxs)(`button`,{onClick:()=>C(e),className:`px-2.5 py-1 rounded-lg font-cinzel text-xs font-bold capitalize transition-all cursor-pointer border ${t?`bg-amber-600 border-amber-500 text-white shadow-sm`:y?`bg-[#231e18] border-[#4a392b] text-stone-400 hover:text-stone-200`:`bg-[#fcf7ee] border-[#cfbc9c] text-stone-600 hover:text-stone-900`}`,children:[e,` `,(0,J.jsxs)(`span`,{className:`text-[10px] opacity-80`,children:[`(`,n,`)`]})]},e)})}),(0,J.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-1 px-2 py-1 rounded-lg border text-xs font-garamond font-semibold ${y?`bg-[#231e18] border-[#4a392b] text-stone-300`:`bg-[#fcf7ee] border-[#cfbc9c] text-stone-800`}`,children:[(0,J.jsx)(ce,{className:`w-3 h-3 text-amber-500`}),(0,J.jsx)(`span`,{className:`text-[10px] font-cinzel uppercase opacity-75`,children:`Pattern:`}),(0,J.jsxs)(`select`,{value:D,onChange:e=>A(e.target.value),className:`bg-transparent border-none text-xs font-garamond font-bold cursor-pointer focus:outline-none max-w-[150px] truncate`,children:[(0,J.jsxs)(`option`,{value:`all`,className:`bg-stone-900 text-stone-200`,children:[`All Patterns (`,L.length,`)`]}),L.map(e=>(0,J.jsx)(`option`,{value:e,className:`bg-stone-900 text-stone-200`,children:e},e))]})]}),(0,J.jsxs)(`div`,{className:`flex items-center gap-1 px-2 py-1 rounded-lg border text-xs font-garamond font-semibold ${y?`bg-[#231e18] border-[#4a392b] text-stone-300`:`bg-[#fcf7ee] border-[#cfbc9c] text-stone-800`}`,children:[(0,J.jsx)(`span`,{className:`text-[10px] font-cinzel uppercase opacity-75`,children:`Diff:`}),(0,J.jsxs)(`select`,{value:j,onChange:e=>te(e.target.value),className:`bg-transparent border-none text-xs font-garamond font-bold cursor-pointer focus:outline-none`,children:[(0,J.jsx)(`option`,{value:`all`,className:`bg-stone-900 text-stone-200`,children:`All`}),(0,J.jsx)(`option`,{value:`Easy`,className:`bg-stone-900 text-stone-200`,children:`Easy`}),(0,J.jsx)(`option`,{value:`Medium`,className:`bg-stone-900 text-stone-200`,children:`Medium`}),(0,J.jsx)(`option`,{value:`Hard`,className:`bg-stone-900 text-stone-200`,children:`Hard`})]})]}),(0,J.jsxs)(`div`,{className:`flex items-center gap-1 px-2 py-1 rounded-lg border text-xs font-garamond font-semibold ${y?`bg-[#231e18] border-[#4a392b] text-stone-300`:`bg-[#fcf7ee] border-[#cfbc9c] text-stone-800`}`,children:[(0,J.jsx)(k,{className:`w-3 h-3 text-amber-500`}),(0,J.jsx)(`span`,{className:`text-[10px] font-cinzel uppercase opacity-75`,children:`Sort:`}),(0,J.jsxs)(`select`,{value:re,onChange:e=>ie(e.target.value),className:`bg-transparent border-none text-xs font-garamond font-bold cursor-pointer focus:outline-none`,children:[(0,J.jsx)(`option`,{value:`sequence`,className:`bg-stone-900 text-stone-200`,children:`Track Sequence`}),(0,J.jsx)(`option`,{value:`number_asc`,className:`bg-stone-900 text-stone-200`,children:`Problem # (Asc)`}),(0,J.jsx)(`option`,{value:`number_desc`,className:`bg-stone-900 text-stone-200`,children:`Problem # (Desc)`}),(0,J.jsx)(`option`,{value:`name`,className:`bg-stone-900 text-stone-200`,children:`Title (A-Z)`})]})]})]}),(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,J.jsxs)(`span`,{className:`font-garamond italic text-xs opacity-80`,children:[`Showing `,ue.length,` of `,R]}),(0,J.jsx)(`div`,{className:`w-20 sm:w-28 h-2 rounded-full bg-black/20 overflow-hidden border border-amber-900/20`,children:(0,J.jsx)(`div`,{className:`h-full bg-gradient-to-r from-amber-500 to-emerald-500 transition-all duration-500`,style:{width:`${B}%`}})}),(0,J.jsxs)(`span`,{className:`font-cinzel text-[10px] font-bold text-emerald-600 dark:text-emerald-400`,children:[B,`%`]})]})]})]})}),(0,J.jsx)(`div`,{ref:F,className:`relative z-20 flex-1 overflow-y-auto px-4 py-4 custom-scrollbar`,children:(0,J.jsx)(`div`,{className:`max-w-6xl mx-auto
65space-y-2.5 pb-8`,children:ue.length===0?(0,J.jsxs)(`div`,{className:`p-10 text-center rounded-2xl border-2 border-dashed my-8 transition-colors ${y?`border-amber-900/40 bg-[#1e1914]/60 text-stone-400`:`border-amber-900/20 bg-[#f9f2e3]/80 text-stone-600`}`,children:[(0,J.jsx)(a,{className:`w-10 h-10 mx-auto mb-3 text-amber-500 opacity-60`}),(0,J.jsx)(`h3`,{className:`font-cinzel font-bold text-base text-amber-700 dark:text-amber-400 mb-1`,children:`No Problems Found`}),(0,J.jsxs)(`p`,{className:`font-garamond italic text-sm max-w-md mx-auto mb-4`,children:[`No problems matched "`,b||`the current filter settings`,`". Try adjusting your search keywords or filter criteria.`]}),(b||S!==`all`||D!==`all`||j!==`all`)&&(0,J.jsx)(`button`,{onClick:()=>{x(``),C(`all`),A(`all`),te(`all`)},className:`px-4 py-1.5 rounded-xl bg-amber-600 hover:bg-amber-500 text-white font-cinzel text-xs font-bold transition-all shadow cursor-pointer`,children:`Clear All Filters`})]}):ue.map(e=>{let n=i.has(e.id),a=e.sequenceIndex===t,o=ae===e.id,c=E(e.id),d=c?.difficulty,f=c?.pattern;return(0,J.jsxs)(`div`,{id:`problem-item-${e.sequenceIndex}`,className:`group relative rounded-xl border-2 transition-all duration-200 shadow-md ${a?y?`bg-[#2c2217] border-amber-500/80 shadow-amber-500/20 shadow-lg ring-1 ring-amber-500/40`:`bg-[#fffaf0] border-amber-700 shadow-amber-700/20 shadow-lg ring-1 ring-amber-700/30`:y?`bg-[#1f1a14]/90 border-[#4a392b] hover:border-amber-600/50 hover:bg-[#251f18]`:`bg-[#fcf8ef]/95 border-[#c8b28f] hover:border-amber-700/60 hover:bg-[#fcf5e6]`}`,children:[a&&(0,J.jsxs)(`div`,{className:`absolute -top-2.5 left-4 px-2 py-0.5 rounded-md bg-amber-600 text-white font-cinzel text-[9px] font-bold tracking-wider uppercase flex items-center gap-1 shadow`,children:[(0,J.jsx)(le,{className:`w-2.5 h-2.5 text-amber-200`}),`Current Problem`]}),(0,J.jsxs)(`div`,{className:`p-3 sm:p-3.5 flex flex-col sm:flex-row sm:items-center justify-between gap-3`,children:[(0,J.jsxs)(`div`,{className:`flex items-start sm:items-center gap-3 min-w-0 flex-1`,children:[(0,J.jsx)(`button`,{onClick:()=>{s(e.id)},title:n?`Mark as Unsolved`:`Mark as Solved`,className:`mt-0.5 sm:mt-0 p-1 rounded-lg hover:bg-black/10 dark:hover:bg-white/10 transition-colors cursor-pointer shrink-0`,children:n?(0,J.jsx)(h,{className:`w-5 h-5 text-emerald-500 transition-transform active:scale-125`}):(0,J.jsx)(ee,{className:`w-5 h-5 text-stone-400 hover:text-amber-600 transition-colors`})}),(0,J.jsxs)(`div`,{className:`px-2 py-1 rounded-lg border font-cinzel text-[11px] font-bold text-center shrink-0 min-w-[54px] ${a?`bg-amber-500/20 border-amber-500 text-amber-500`:y?`bg-black/30 border-[#4a392b] text-stone-400`:`bg-amber-900/5 border-[#c8b28f] text-stone-600`}`,children:[(0,J.jsx)(`span`,{className:`text-[9px] block uppercase opacity-75 leading-none`,children:`Seq`}),(0,J.jsxs)(`span`,{children:[`#`,e.sequenceIndex+1]})]}),(0,J.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,J.jsx)(`span`,{className:`px-1.5 py-0.5 rounded font-mono text-[10px] font-bold ${y?`bg-[#2d251d] text-amber-400 border border-amber-900/50`:`bg-amber-900/10 text-amber-900 border border-amber-900/20`}`,children:e.id>0?`LC #${e.id}`:`Custom`}),d&&(0,J.jsx)(`span`,{className:`px-1.5 py-0.5 rounded font-cinzel text-[9px] font-bold uppercase tracking-wider border ${d===`Easy`?`bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-500/30`:d===`Medium`?`bg-amber-500/10 text-amber-600 dark:text-amber-400 border-amber-500/30`:`bg-rose-500/10 text-rose-600 dar
65k:text-rose-400 border-rose-500/30`}`,children:d}),f&&(0,J.jsx)(`span`,{className:`px-1.5 py-0.5 rounded font-cinzel text-[9px] font-medium border ${y?`bg-purple-950/30 text-purple-300 border-purple-800/40`:`bg-purple-50 text-purple-800 border-purple-200`}`,children:f}),(0,J.jsx)(`h4`,{onClick:()=>{r(e.sequenceIndex),q.playNodeLightUp(e.sequenceIndex,R)},className:`font-garamond font-bold text-sm sm:text-base leading-tight truncate cursor-pointer hover:underline ${a?`text-amber-700 dark:text-amber-300 font-bold`:y?`text-stone-200 hover:text-amber-300`:`text-stone-900 hover:text-amber-800`}`,children:e.name}),n&&(0,J.jsx)(`span`,{className:`text-[9px] font-cinzel font-bold px-1.5 py-0.5 rounded bg-emerald-500/15 text-emerald-600 dark:text-emerald-400 border border-emerald-500/30`,children:`â Solved`})]}),(c?.time_complexity||c?.space_complexity)&&(0,J.jsxs)(`div`,{className:`flex items-center gap-3 flex-wrap mt-1 text-[11px] font-mono`,children:[c.time_complexity&&(0,J.jsxs)(`span`,{className:`opacity-80`,children:[`Time:`,` `,(0,J.jsx)(`span`,{className:`text-amber-600 dark:text-amber-400 font-semibold`,children:c.time_complexity})]}),c.space_complexity&&(0,J.jsxs)(`span`,{className:`opacity-80`,children:[`Space:`,` `,(0,J.jsx)(`span`,{className:`text-purple-600 dark:text-purple-400 font-semibold`,children:c.space_complexity})]})]})]})]}),(0,J.jsxs)(`div`,{className:`flex items-center gap-1.5 shrink-0 self-end sm:self-center pl-10 sm:pl-0`,children:[(0,J.jsxs)(`button`,{onClick:()=>{r(e.sequenceIndex),q.playNodeLightUp(e.sequenceIndex,R),u(e.sequenceIndex)},title:`View Problem on Hand-Drawn Map`,className:`flex items-center gap-1 px-2.5 py-1.5 rounded-lg border text-xs font-cinzel font-bold transition-all shadow-sm active:scale-95 cursor-pointer ${y?`bg-amber-500/15 border-amber-500/40 text-amber-300 hover:bg-amber-500/25`:`bg-amber-700/10 border-amber-700/30 text-amber-900 hover:bg-amber-700/20`}`,children:[(0,J.jsx)(ne,{className:`w-3.5 h-3.5 text-amber-500`}),(0,J.jsx)(`span`,{className:`hidden md:inline`,children:`Map`})]}),(0,J.jsxs)(`button`,{onClick:()=>V(e),disabled:N===e.id,title:`Launch Spaced Repetition Review for this problem`,className:`flex items-center gap-1 px-2.5 py-1.5 rounded-lg bg-amber-600 hover:bg-amber-500 disabled:opacity-50 text-white text-xs font-cinzel font-bold shadow-sm transition-all active:scale-95 cursor-pointer`,children:[N===e.id?(0,J.jsx)(_,{className:`w-3.5 h-3.5 animate-spin`}):(0,J.jsx)(M,{className:`w-3.5 h-3.5`}),(0,J.jsx)(`span`,{className:`hidden md:inline`,children:N===e.id?`Loading...`:`Review`})]}),(0,J.jsx)(`a`,{href:c?.leetcode_url||(e.id>0?`https://leetcode.com/problemset/?search=${e.id}`:`https://www.google.com/search?q=${encodeURIComponent(e.name)}`),target:`_blank`,rel:`noreferrer`,title:`Open Problem on LeetCode`,className:`p-1.5 rounded-lg border transition-all cursor-pointer ${y?`border-stone-700 text-stone-400 hover:text-stone-200 hover:bg-white/5`:`border-stone-300 text-stone-600 hover:text-stone-900 hover:bg-black/5`}`,children:(0,J.jsx)(l,{className:`w-3.5 h-3.5`})}),(0,J.jsx)(`button`,{onClick:()=>{se(o?null:e.id),o||r(e.sequenceIndex)},title:o?`Hide Problem Details`:`View Problem Details`,className:`p-1.5 rounded-lg border transition-all cursor-pointer ${o?`bg-amber-600/20 border-amber-500 text-amber-500`:y?`border-stone-700 text-stone-400 hover:text-stone-200`:`border-stone-300 text-stone-600 hover:text-stone-900`}`,children:o?(0,J.jsx)(g,{className:`w-3.5 h-3.5`}):(0,J.jsx)(O,{className:`w-3.5 h-3.5`})})]})]}),o&&(0,J.jsx)(`div`,{className:`px-4 py-3 border-t text-xs font-garamond animate-fade-in ${y?`border-amber-900/40 bg-black/20 text-stone-300`:`border-amber-900/15 bg-amber-950/5 text-stone-700`}`,children:(0,J.jsxs)(`div`,{className:`space-y-3`,children:[c?.description?(0,J.jsxs)(`div`,{className:`p-3 rounded border border-amber-900/20 bg-amber-900/5 dark:bg-black/30 font-sans text-xs sm:text-[13px] leading-relaxed whitespace-pre-line text-stone-700 dark:text-stone-300`,children:[(0,J.jsx)(`div`,{className:`font-cinzel font-bold text-amber-600 dark:text-amber-400 text-[10px] uppercase mb-1 tracking-wider`,children:`Canonical Problem Description`}),c.description]}):(0,J.jsx)(`p`,{className:`italic text-stone-500`,children:`Review this problem in CodeStudio to access the full starter code, test suites, and review queue.`}),c?.examples&&c.examples.length>0&&(0,J.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,J.jsx)(`div`,{className:`font-cinzel font-bold text-amber-600 dar
65k:text-amber-400 text-[10px] uppercase tracking-wider`,children:`Examples`}),(0,J.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-2`,children:c.examples.map((e,t)=>(0,J.jsxs)(`div`,{className:`p-2.5 rounded border border-stone-300/40 dark:border-stone-700/50 bg-black/5 dark:bg-black/30 font-mono text-[11px] space-y-1`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`span`,{className:`text-stone-500`,children:`Input: `}),(0,J.jsx)(`span`,{className:`font-semibold text-amber-700 dark:text-amber-300`,children:e.input})]}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`span`,{className:`text-stone-500`,children:`Output: `}),(0,J.jsx)(`span`,{className:`font-semibold text-emerald-600 dark:text-emerald-400`,children:e.output})]}),e.explanation&&(0,J.jsx)(`div`,{className:`text-[10px] text-stone-500 italic font-sans pt-0.5`,children:e.explanation})]},t))})]}),(0,J.jsxs)(`div`,{className:`flex items-center gap-4 text-[11px] pt-1 opacity-85 flex-wrap border-t border-stone-400/20 dark:border-stone-700/30`,children:[f&&(0,J.jsxs)(`span`,{children:[`Pattern: `,(0,J.jsx)(`strong`,{className:`font-cinzel text-amber-600 dark:text-amber-400`,children:f})]}),d&&(0,J.jsxs)(`span`,{children:[`Difficulty: `,(0,J.jsx)(`strong`,{children:d})]}),c?.time_complexity&&(0,J.jsxs)(`span`,{children:[`Time: `,(0,J.jsx)(`strong`,{className:`font-mono text-amber-600 dark:text-amber-400`,children:c.time_complexity})]}),c?.space_complexity&&(0,J.jsxs)(`span`,{children:[`Space: `,(0,J.jsx)(`strong`,{className:`font-mono text-purple-600 dark:text-purple-400`,children:c.space_complexity})]}),c?.constraints&&c.constraints.length>0&&(0,J.jsxs)(`span`,{children:[`Constraints: `,(0,J.jsx)(`strong`,{className:`font-mono text-[10px]`,children:c.constraints.join(` ⢠`)})]})]})]})})]},e.id)})})})]})},Z=``;async function Q(e,t){if(!e.ok||!(e.headers.get(`content-type`)||``).includes(`application/json`))return t;try{return await e.json()}catch{return t}}function we({onSelectProblemForReview:e}){let[t,r]=(0,I.useState)(new Set),[i,a]=(0,I.useState)({}),[o,s]=(0,I.useState)([]),[l,u]=(0,I.useState)([]),[d,f]=(0,I.useState)(()=>localStorage.getItem(`algospaced_active_track`)||`leetcode-150`),[p,m]=(0,I.useState)(!0),[h,g]=(0,I.useState)(0),[v,b]=(0,I.useState)(null),[x,S]=(0,I.useState)([]),[C,w]=(0,I.useState)(!1),[T,E]=(0,I.useState)(!1),[D,O]=(0,I.useState)(`parchment`),[k,A]=(0,I.useState)(`map`),[j,ee]=(0,I.useState)(!0),[ne,ie]=(0,I.useState)(!0),[ae,oe]=(0,I.useState)(!0),[ce,M]=(0,I.useState)(!1),[N,le]=(0,I.useState)(!1),[P,F]=(0,I.useState)(!1),[z,B]=(0,I.useState)(!0),V=de[D]||de.parchment,[H,U]=(0,I.useState)({x:0,y:0,scale:.5}),W=(0,I.useMemo)(()=>ue(o,i),[o,i]),G=W.length,K=h>=0&&h<G?W[h]:null;(0,I.useEffect)(()=>{q.setEnabled(j)},[j]);let Y=async()=>{try{let{data:{session:e}}=await n.auth.getSession(),t={Authorization:`Bearer ${e?e.access_token:`sandbox`}`},i=localStorage.getItem(`algospaced_active_track`)||`leetcode-150`,[o,c,l,d]=await Promise.all([fetch(`${Z}/api/journey-progress`,{headers:t}),fetch(`${Z}/api/journey-progress/titles`,{headers:t}),fetch(`${Z}/api/journey-progress/sequences`,{headers:t}),fetch(`${Z}/api/journey-progress/sequence/${i}`,{headers:t})]),[f,p,m,h]=await Promise.all([Q(o,[]),Q(c,{}),Q(l,[]),Q(d,[])]),_=new Set(f);r(_),a(p),u(m),s(h);let v=h.findIndex(e=>!_.has(e));g(v>=0?v:0)}catch(e){console.error(`Error fetching journey data:`,e)}finally{m(!1)}};(0,I.useEffect)(()=>{Y()},[]);let fe=(0,I.useCallback)(async e=>{S([]),w(!0);try{let{data:{session:t}}=await n.auth.getSession(),r=t?t.access_token:`sandbox`,i=await Q(await fetch(`${Z}/api/reviews/problems/${e}`,{headers:{Authorization:`Bearer ${r}`}}),[]);S(i)}catch(e){console.error(`Error fetching problem details:`,e)}finally{w(!1)}},[]);(0,I.useEffect)(()=>{K&&fe(K.id)},[K?.id,fe]);let pe=async e=>{m(!0),f(e),localStorage.setItem(`algospaced_active_track`,e);try{let{data:{session:r}}=await n.auth.getSession(),i={Authorization:`Bearer ${r?r.access_token:`sandbox`}`},a=await Q(await fetch(`${Z}/api/journey-progress/sequence/${e}`,{headers:i}),[]);if(a.length>0){s(a);let e=a.findIndex(e=>!t.has(e));g(e>=0?e:0)}}catch(e){console.error(`Error switching track:`,e)}finally{m(!1)}},me=(0,I.useCallback)(()=>{g(e=>{if(e<G-1){let t=e+1;return q.playPencilScratch(),q.playNodeLightUp(t,G),t===G-1&&(q.playVictoryChime(),c({particleCount:120,spread:80,origin:{y:.6},colors:[`#f59e0b`,`#fbbf24`,`#d97706`,`#ffffff`,`#eab308`]}),F(!0)),t}return e})}
65,[G]),he=(0,I.useCallback)(()=>{g(e=>e>0?(q.playPencilScratch(),e-1):0)},[]),ge=(0,I.useCallback)(e=>{let t=Math.max(0,Math.min(G-1,e));g(t),q.playNodeLightUp(t,G),t===G-1&&q.playVictoryChime()},[G]),_e=(0,I.useCallback)(()=>{g(0),q.playPencilScratch()},[]),ve=async e=>{E(!0);try{let{data:{session:i}}=await n.auth.getSession(),a=i?i.access_token:`sandbox`;if((await fetch(`${Z}/api/journey-progress/toggle`,{method:`POST`,headers:{"Content-Type":`application/json`,Authorization:`Bearer ${a}`},body:JSON.stringify({problem_number:e})})).ok){let n=new Set(t);n.has(e)?(n.delete(e),q.playPencilScratch()):(n.add(e),q.playNodeLightUp(h,G),o.every(e=>n.has(e))&&(q.playVictoryChime(),c({particleCount:130,spread:85,origin:{y:.6},colors:[`#10b981`,`#34d399`,`#f59e0b`,`#ffffff`]}),F(!0))),r(n)}}catch(e){console.error(`Error toggling progress:`,e)}finally{E(!1)}};(0,I.useEffect)(()=>{let e=e=>{let t=e.target;[`INPUT`,`TEXTAREA`,`SELECT`].includes(t?.tagName)||t?.isContentEditable||k===`map`&&(e.code===`Space`||e.code===`ArrowRight`||e.code===`ArrowDown`?(e.preventDefault(),me()):e.code===`ArrowLeft`||e.code===`ArrowUp`?(e.preventDefault(),he()):e.code===`KeyR`&&(e.preventDefault(),_e()))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[me,he,_e,k]);let X=(0,I.useRef)(null),we=(0,I.useCallback)(()=>{let e=X.current?.clientWidth||window.innerWidth,t=X.current?.clientHeight||window.innerHeight,n=e/2,r=t/2;U(e=>{let t=Math.min(e.scale*1.25,3.5);return{scale:t,x:n-(n-e.x)/e.scale*t,y:r-(r-e.y)/e.scale*t}})},[]),Te=(0,I.useCallback)(()=>{let e=X.current?.clientWidth||window.innerWidth,t=X.current?.clientHeight||window.innerHeight,n=e/2,r=t/2;U(e=>{let t=Math.max(e.scale*.8,.08);return{scale:t,x:n-(n-e.x)/e.scale*t,y:r-(r-e.y)/e.scale*t}})},[]),Ee=(0,I.useCallback)(()=>{let e=X.current?.clientWidth||window.innerWidth,t=X.current?.clientHeight||window.innerHeight,n=e/L,r=t/R,i=Math.min(n,r)*.9;U({x:(e-L*i)/2,y:(t-R*i)/2,scale:i})},[]),De=(0,I.useCallback)(()=>{if(!K)return;let e=X.current?.clientWidth||window.innerWidth,t=X.current?.clientHeight||window.innerHeight,n=Math.max(H.scale,.95);U({x:e/2-K.x*n,y:t/2-K.y*n,scale:n})},[K,H.scale]),Oe=(0,I.useCallback)(e=>{if(A(`map`),typeof e==`number`&&e>=0&&e<G){g(e);let t=W[e];if(t){let e=X.current?.clientWidth||window.innerWidth,n=X.current?.clientHeight||window.innerHeight,r=Math.max(H.scale,.95);U({x:e/2-t.x*r,y:n/2-t.y*r,scale:r})}}},[W,G,H.scale]),$=V.id!==`parchment`;return p?(0,J.jsx)(`div`,{className:`w-full h-full flex items-center justify-center bg-[#fdf8e1] text-ink-black select-none`,children:(0,J.jsxs)(`div`,{className:`flex flex-col items-center gap-3`,children:[(0,J.jsx)(_,{className:`w-8 h-8 text-amber-600 animate-spin`}),(0,J.jsx)(`span`,{className:`font-cinzel text-xs font-bold tracking-widest uppercase`,children:`Surveillancing Expedition Trail...`})]})}):(0,J.jsxs)(`div`,{className:`relative w-full h-full overflow-hidden flex flex-col bg-stone-950 select-none`,children:[(0,J.jsxs)(`header`,{className:`absolute top-2.5 left-2.5 right-2.5 z-30 flex items-center justify-between pointer-events-none gap-2`,children:[(0,J.jsxs)(`div`,{id:`app-header-badge`,className:`pointer-events-auto flex items-center gap-2.5 px-3 py-1.5 md:px-3.5 md:py-2 rounded-2xl border-2 shadow-xl backdrop-blur-md transition-all ${$?`bg-[#1a1612]/90 border-[#4a392b] text-[#f4ebd9]`:`bg-[#f7efe0]/95 border-[#c8b28f] text-[#2c2014]`}`,children:[(0,J.jsx)(`div`,{className:`p-1.5 rounded-xl bg-amber-500/20 text-amber-500 border border-amber-500/40`,children:k===`map`?(0,J.jsx)(y,{className:`w-4 h-4`}):(0,J.jsx)(te,{className:`w-4 h-4`})}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`h1`,{className:`font-cinzel-dec font-bold text-xs md:text-sm leading-tight tracking-wider text-amber-600 dark:text-amber-400`,children:k===`map`?`Expedition Trail Map`:`Problem Directory`}),(0,J.jsx)(`p`,{className:`font-garamond italic text-[11px] opacity-75`,children:k===`map`?`${G} Milestones ⢠Hand-Drawn Cartography`:`${G} Problems ⢠${t.size} Solved`})]})]}),(0,J.jsxs)(`div`,{className:`pointer-events-auto flex items-center gap-2`,children:[(0,J.jsxs)(`div`,{className:`flex items-center p-0.5 rounded-xl border-2 shadow-lg backdrop-blur-md transition-all ${$?`bg-[#1a1612]/90 border-[#4a392b]`:`bg-[#f7efe0]/95 border-[#c8b28f]`}`,children:[(0,J.jsxs)(`button`,{id:`view-mode-map-btn`,onClick:()=>A(`map`),title:`Hand-Drawn Cartography Map`,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg font-cinzel text-xs font-bold transition-all cursor-pointer ${k===`map`?`bg-amber-600 text-white shadow-sm`:$?`text-stone-400 hover:text-stone-200`:`text-stone-600 hover:text-stone-900`}`,children:[(0,J.jsx)(re,{className:`w-3.5 h-3.5`}),(0,J.jsx)(`span`,{children:`Map`})]}),(0,J.jsxs)(`button`,{id:`view-mode-list-btn`,onClick:()=>A(`list`),title:`Problem List View`,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg font-cinzel text-xs font-bold transition-all cursor-pointer ${k===`list`?`bg-amber-600 text-white shadow-sm`:$?`text-stone-400 hover:text-stone-200`:`text-stone-600 hover:text-stone-900`}`,children:[(0,J.jsx)(te,{className:`w-3.5 h-3.5`}),(0,J.jsx)(`span`,{children:`List`})]})]}),k===`map`&&(0,J.jsxs)(`button`,{id:`toggle-journal-btn`,onClick:()=>B(e=>!e),title:`Toggle Explorer Field Notes Journal`,className:`flex items-center gap-1.5 px-3 py-2 rounded-xl border-2 shadow-lg backdrop-blur-md font-cinzel text-xs font-bold transition-all cursor-pointer ${z?`bg-amber-600 border-amber-400 text-white`:$?`bg-[#1a1612]/90 border-[#4a392b] text-[#e2d5c2]`:`bg-[#f7efe0]/95 border-[#c8b28f] text-[#332415]`}`,children:[(0,J.jsx)(se,{className:`w-4 h-4`}),(0,J.jsx)(`span`,{className:`hidden sm:inline`,children:`Journal`})]})]})]}),k===`map`?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`main`,{ref:X,className:`relative flex-1 w-full h-full`,children:[(0,J.jsx)(ye,{nodes:W,activeNodeIndex:h,completions:t,theme:V,showLabels:ae,showGrid:ce,showNodeNumbers:N,autoCenterOnActive:ne,onNodeClick:ge,hoveredNodeIndex:v,setHoveredNodeIndex:b,transform:H,setTransform:U}),z&&(0,J.jsx)(`aside`,{className:`absolute top-16 left-2.5 z-30 w-72 md:w-84 pointer-events-auto transition-all animate-fade-in`,children:(0,J.jsx)(xe,{node:K,activeNodeIndex:h,totalNodes:G,theme:V,onAdvance:me,onRetreat:he,details:x,modalLoading:C,isCompleted:K?t.has(K.id
65):!1,toggleLoading:T,onToggleCompletion:ve,onSelectProblemForReview:e})})]}),(0,J.jsx)(`footer`,{className:`absolute bottom-2.5 left-2.5 right-2.5 z-30 pointer-events-auto max-w-5xl mx-auto w-[calc(100%-1.25rem)]`,children:(0,J.jsx)(be,{theme:V,soundEnabled:j,autoCenterOnActive:ne,showLabels:ae,showGrid:ce,showNodeNumbers:N,tracks:l,activeTrack:d,onTrackChange:pe,onToggleSound:()=>ee(e=>!e),onToggleAutoCenter:()=>ie(e=>!e),onToggleLabels:()=>oe(e=>!e),onToggleGrid:()=>M(e=>!e),onToggleNodeNumbers:()=>le(e=>!e),onToggleTheme:()=>O(e=>e===`parchment`?`dark_parchment`:`parchment`),onZoomIn:we,onZoomOut:Te,onResetZoom:Ee,onCenterActiveNode:De})})]}):(0,J.jsx)(`main`,{className:`relative flex-1 w-full h-full overflow-hidden`,children:(0,J.jsx)(Ce,{nodes:W,activeNodeIndex:h,setActiveNodeIndex:g,completions:t,theme:V,onToggleCompletion:ve,onSelectProblemForReview:e,onSwitchToMap:Oe,tracks:l,activeTrack:d,onTrackChange:pe,onToggleTheme:()=>O(e=>e===`parchment`?`dark_parchment`:`parchment`)})}),(0,J.jsx)(Se,{isOpen:P,onClose:()=>F(!1),nodes:W,theme:V,onReset:_e})]})}export{we as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.