droidsembly 0.4.0-beta.4 → 0.4.0-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/README.it.md +6 -4
  2. package/README.md +6 -4
  3. package/bin/cubefarm.js +2 -296
  4. package/bin/droidsembly.js +304 -0
  5. package/bin/environment.d.ts +3 -0
  6. package/bin/environment.js +48 -0
  7. package/dist/assets/AccessibilitySettings-vd4x_sEq.js +30 -0
  8. package/dist/assets/{AppViewer-CqGa1r0z.js → AppViewer-BB9lvg-4.js} +1 -1
  9. package/dist/assets/{Balloon-dO9J4khp.js → Balloon-CWEK5uK2.js} +1 -1
  10. package/dist/assets/{Batched-CmXZtCvQ.js → Batched-yAiB-c-b.js} +1 -1
  11. package/dist/assets/{Birds-D51xGT0l.js → Birds-ClBZkA83.js} +1 -1
  12. package/dist/assets/{Blimp-C2c_AKRR.js → Blimp-VHMnVBQt.js} +1 -1
  13. package/dist/assets/{BufferGeometryUtils-Dcu0heeS.js → BufferGeometryUtils-B4Tnxtjb.js} +1 -1
  14. package/dist/assets/{Duck-CzFiUF6U.js → Duck-CCThHMtF.js} +1 -1
  15. package/dist/assets/{Effects-DwOi-gSQ.js → Effects-BZfFy3yq.js} +1 -1
  16. package/dist/assets/{Fireworks-Cc2mGzPJ.js → Fireworks-CxvvEwV_.js} +1 -1
  17. package/dist/assets/{Helicopter-ltB-x8hG.js → Helicopter-DXHDrTnQ.js} +1 -1
  18. package/dist/assets/{Hurricane-C2qHsRw4.js → Hurricane-WXNUxoUz.js} +1 -1
  19. package/dist/assets/{Kaiju-DPHVjFjg.js → Kaiju-D-wVgKo-.js} +1 -1
  20. package/dist/assets/{Meteors-CxcguXTJ.js → Meteors-DSr-7bEl.js} +1 -1
  21. package/dist/assets/{MissionConsole-BUE2mijT.js → MissionConsole-4G02S89d.js} +1 -1
  22. package/dist/assets/{Office-NV5zlSnK.js → Office-B_EroD2U.js} +44 -44
  23. package/dist/assets/{PhotoPanel-CDqgU99Z.js → PhotoPanel-ByzwApow.js} +1 -1
  24. package/dist/assets/{PhotoScene-RRXC4_Jv.js → PhotoScene-CW3yZkqH.js} +3 -3
  25. package/dist/assets/{Plane-BQB72TWZ.js → Plane-CT7-QFbA.js} +1 -1
  26. package/dist/assets/Pocket-B0o4siMl.js +2 -0
  27. package/dist/assets/{Rainbow-DIpZi5-z.js → Rainbow-DNvXfTl9.js} +1 -1
  28. package/dist/assets/{Roof-Cd9I0jtG.js → Roof-yLX0ZK0x.js} +1 -1
  29. package/dist/assets/{Shell-DCqHgrm_.js → Shell-lZOZ3aG8.js} +2 -2
  30. package/dist/assets/{Skywriting-BH6FCdEl.js → Skywriting-N1GDZKYR.js} +1 -1
  31. package/dist/assets/{TerminalView-CoH1yh6r.js → TerminalView-cUAMhOxM.js} +11 -11
  32. package/dist/assets/{ToyWorld--k4uqi9k.js → ToyWorld-BYE8776A.js} +1 -1
  33. package/dist/assets/{Ufo-C5cYunS9.js → Ufo-D_Wt75n1.js} +1 -1
  34. package/dist/assets/{Whale-BAXeezd8.js → Whale-Kkz3B36R.js} +1 -1
  35. package/dist/assets/all-BMItClgN.js +11 -0
  36. package/dist/assets/{bloomMarks-JYeAmd4d.js → bloomMarks-C22qSi5d.js} +1 -1
  37. package/dist/assets/{cheerRules-DvM2z9Qg.js → cheerRules-G9WFRB4C.js} +1 -1
  38. package/dist/assets/{cityLayout-VU-ug-r6.js → cityLayout-C8f5-bpM.js} +1 -1
  39. package/dist/assets/{dogState-Bm3YZHwy.js → dogState-9uong8D8.js} +1 -1
  40. package/dist/assets/{doors-D7Z3s-7W.js → doors-DsKuGpOi.js} +1 -1
  41. package/dist/assets/{gallery-CSWmy4Tf.js → gallery-DSKvNkBq.js} +1 -1
  42. package/dist/assets/gate-D6_NXB1w.js +2 -0
  43. package/dist/assets/index-rznd4Djx.js +10 -0
  44. package/dist/assets/{instantReplay-FXf2kJ7B.js → instantReplay-CiWMru53.js} +1 -1
  45. package/dist/assets/{interact-BatJVhca.js → interact-Bt-XX-z4.js} +1 -1
  46. package/dist/assets/{jsx-runtime-CXW0f58S.js → jsx-runtime-CZP6s5wa.js} +1 -1
  47. package/dist/assets/{kit-D3twk12W.js → kit-CZEafHnz.js} +1 -1
  48. package/dist/assets/mic-DeYDrNoY.js +1 -0
  49. package/dist/assets/{photoMode-B8pRCF0O.js → photoMode-BTxq9-gL.js} +1 -1
  50. package/dist/assets/{pipeline-BgOS9JnJ.js → pipeline-DNe3sjnP.js} +1 -1
  51. package/dist/assets/{rapier-BvQbKz0M.js → rapier-C-KFR0AR.js} +1 -1
  52. package/dist/assets/{rig-BgSxc8mA.js → rig-B88WinIa.js} +1 -1
  53. package/dist/assets/{speechLanguage-Cak8tdL0.js → speechLanguage-Bq3BAswq.js} +1 -1
  54. package/dist/assets/store-9CvxLGNQ.js +5 -0
  55. package/dist/assets/useDayTime-Nrdy7kH1.js +1 -0
  56. package/dist/assets/useGraphics-Bhnj8CAm.js +1 -0
  57. package/dist/assets/voiceMessages-BF3P4sjw.js +1 -0
  58. package/dist/assets/{weatherState-BQ3UU4vU.js → weatherState-CufaxiyU.js} +1 -1
  59. package/dist/index.html +3 -3
  60. package/dist-server/index.js +597 -413
  61. package/dist-server/index.js.map +4 -4
  62. package/dist-server/ptyHost.js +6 -2
  63. package/dist-server/ptyHost.js.map +2 -2
  64. package/package.json +2 -2
  65. package/dist/assets/AccessibilitySettings-6ZCswq5I.js +0 -30
  66. package/dist/assets/Pocket-CjK6fv97.js +0 -2
  67. package/dist/assets/all-BsJ98bWd.js +0 -11
  68. package/dist/assets/gate-DwsbbSNS.js +0 -2
  69. package/dist/assets/index-D_Et7Vx8.js +0 -10
  70. package/dist/assets/mic-BJ0eYLIj.js +0 -1
  71. package/dist/assets/store-Buxt6UcJ.js +0 -5
  72. package/dist/assets/useDayTime-0ms3va3h.js +0 -1
  73. package/dist/assets/useGraphics-p7LAuvYj.js +0 -1
  74. package/dist/assets/voiceMessages-hO1SDnOS.js +0 -1
@@ -0,0 +1,30 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/voiceMessages-BF3P4sjw.js","assets/store-9CvxLGNQ.js","assets/rolldown-runtime-XKyaHtl9.js","assets/jsx-runtime-CZP6s5wa.js","assets/speechLanguage-Bq3BAswq.js","assets/index-rznd4Djx.js","assets/index-COpmc42S.css","assets/mic-DeYDrNoY.js","assets/jukeboxSongs-CUwHJ1cS.js"])))=>i.map(i=>d[i]);
2
+ import{n as e,r as t,t as n}from"./rolldown-runtime-XKyaHtl9.js";import{a as r,l as i,o as a,s as o,t as s}from"./jsx-runtime-CZP6s5wa.js";import{As as c,Do as l,Fs as u,Is as d,Li as f,Ms as p,Ps as m,a as h,bi as g,cs as _,d as v,ea as y,gs as b,i as x,js as S,ks as C,kt as w,m as T,p as E,pt as ee,qt as D,r as te,s as ne,t as re,ts as ie,ys as O,zo as ae}from"./store-9CvxLGNQ.js";import{C as oe,D as se,E as ce,T as le,b as ue,c as k,i as de,l as fe,n as pe,o as A,p as me,r as he,s as j,t as ge,u as _e,w as ve,x as ye}from"./index-rznd4Djx.js";import{I as be,K as xe,L as Se,d as Ce,i as we,j as Te,l as Ee,n as De,o as Oe,r as ke,s as Ae,t as je,u as Me}from"./mic-DeYDrNoY.js";var M=t(i(),1),N=s(),Ne=[`halloween`,`christmas`,`newyear`,`valentines`,`easter`,`birthday`],Pe=e=>typeof e==`string`&&Ne.includes(e),Fe={mode:`auto`,disabled:[],birthday:null},Ie={halloween:{name:`Halloween`,emoji:`🎃`,when:`24–31 Oct`},christmas:{name:`Christmas`,emoji:`🎄`,when:`1–26 Dec`},newyear:{name:`New Year's Eve`,emoji:`🎆`,when:`31 Dec–1 Jan`},valentines:{name:`Valentine's Day`,emoji:`💘`,when:`12–14 Feb`},easter:{name:`Easter`,emoji:`🐣`,when:`Good Friday to Easter Monday`},birthday:{name:`Your birthday`,emoji:`🎂`,when:`on the day you set`}};function Le(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`}function Re(e){let t=e%19,n=Math.floor(e/100),r=e%100,i=Math.floor(n/4),a=n%4,o=Math.floor((n+8)/25),s=Math.floor((n-o+1)/3),c=(19*t+n-i-s+15)%30,l=Math.floor(r/4),u=r%4,d=(32+2*a+2*l-c-u)%7,f=Math.floor((t+11*c+22*d)/451),p=c+d-7*f+114;return{month:Math.floor(p/31),day:p%31+1}}var ze=e=>e%4==0&&e%100!=0||e%400==0,Be=(e,t,n)=>Math.floor(Date.UTC(e,t-1,n)/864e5);function Ve(e,t,n=null){let r=t.getFullYear(),i=t.getMonth()+1,a=t.getDate(),o=i*100+a;switch(e){case`halloween`:return o>=1024&&o<=1031;case`christmas`:return o>=1201&&o<=1226;case`newyear`:return o===1231||o===101;case`valentines`:return o>=212&&o<=214;case`easter`:{let e=Re(r),t=Be(r,i,a)-Be(r,e.month,e.day);return t>=-2&&t<=1}case`birthday`:{if(!n)return!1;let e=n.month===2&&n.day===29&&!ze(r)?28:n.day;return i===n.month&&a===e}}}function He(e,t){let n=n=>!t.disabled.includes(n)&&Ve(n,e,t.birthday);return n(`birthday`)?`birthday`:Ne.find(e=>e!==`birthday`&&n(e))??null}function Ue(e){let t=new URLSearchParams(e).get(`theme`)?.trim().toLowerCase();return t===`auto`||t===`off`||Pe(t)?t:null}function We(e){let t=new URLSearchParams(e).get(`date`)?.trim();if(!t)return null;let n=/^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2}))?)?$/.exec(t);if(!n)return null;let[r,i,a,o=`12`,s=`0`,c=`0`]=n.slice(1),l=new Date(Number(r),Number(i)-1,Number(a),Number(o),Number(s),Number(c));return l.getMonth()===Number(i)-1&&l.getDate()===Number(a)?l.getTime():null}function Ge(e,t,n=null){let r=n??t.mode,i=n&&n!==`auto`?`url`:r===`off`?`off`:r===`auto`?`auto`:`forced`;return r===`off`?{id:null,source:i}:r===`auto`?{id:He(e,t),source:`auto`}:{id:r,source:i}}var Ke=[`crop`,`long`,`ponytail`,`bun`,`quiff`,`afro`,`sidePart`,`buzz`,`bald`,`curls`,`bob`,`mohawk`,`locs`],qe=[`none`,`stubble`,`beard`,`moustache`],Je=[`none`,`round`,`square`],Ye=[`none`,`beanie`,`cap`],Xe=[`tee`,`hoodie`,`stripe`,`sweater`,`cardigan`,`turtleneck`],Ze=[`slim`,`average`,`broad`],Qe=[`#ffffff`,`#ffd166`,`#ef476f`,`#06d6a0`,`#118ab2`,`#2b2d42`],$e={slim:{width:.88,depth:.92},average:{width:1,depth:1},broad:{width:1.15,depth:1.1}},et=[`quiff`,`afro`,`bun`,`curls`,`mohawk`],tt={feminine:[[`long`,4],[`ponytail`,3],[`bun`,3],[`curls`,2],[`afro`,2],[`sidePart`,2],[`buzz`,1]],masculine:[[`crop`,2],[`quiff`,3],[`sidePart`,3],[`buzz`,2],[`bald`,2],[`curls`,2],[`afro`,2],[`long`,1],[`ponytail`,1],[`bun`,1]]},nt={feminine:[[`bob`,3],[`locs`,2],[`mohawk`,1]],masculine:[[`locs`,2],[`mohawk`,2],[`bob`,1]]},rt=.22,it=.3;function at(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0}function ot(e){let t=e;return()=>{t=t+1831565813|0;let e=Math.imul(t^t>>>15,1|t);return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/4294967296}}function st(e,t){let n=e*t.reduce((e,[,t])=>e+t,0);for(let[e,r]of t)if((n-=r)<0)return e;return t[t.length-1][0]}function ct(e){let t=ot(at(e.id)),[n,r,i,a,o,s,c,l,u,d,f,p]=Array.from({length:12},t),m=e.role!==`ceo`,h=e.look===`masculine`,g=e.role!==`ceo`&&f<rt?st(n,nt[e.look]):st(n,tt[e.look]),_=h?st(r,[[`none`,5],[`stubble`,2],[`beard`,2],[`moustache`,1]]):`none`,v=st(i,[[`none`,6],[`round`,2],[`square`,2]]),y=m&&g!==`afro`&&g!==`mohawk`&&a<.3;return{hair:g,facialHair:_,glasses:v,headphones:y,headwear:m&&!y&&!et.includes(g)?st(o,[[`none`,7],[`beanie`,1],[`cap`,1]]):`none`,outfit:m?p<it?st(s,[[`cardigan`,1],[`turtleneck`,1]]):st(s,[[`tee`,1],[`hoodie`,1],[`stripe`,1],[`sweater`,1]]):`tee`,height:+(.9+c*.2).toFixed(3),shoulders:+(.95+l*.1).toFixed(3),build:st(d,[[`slim`,1],[`average`,2],[`broad`,1]]),accent:Math.floor(u*Qe.length),hairColor:e.hair??`#2b2118`,skin:e.skin??`#f1c27d`}}function lt(e){let t=ct(e),n=e.style;if(!n)return t;let r=n.hair??t.hair,i=et.includes(r)?`none`:n.headwear??t.headwear;return{...t,hair:r,facialHair:n.facialHair??t.facialHair,glasses:n.glasses??t.glasses,headphones:t.headphones&&i===`none`&&r!==`afro`&&r!==`mohawk`,headwear:i,outfit:e.role===`ceo`?`tee`:n.outfit??t.outfit,build:n.build??t.build,accent:n.accent??t.accent,hairColor:n.hairColor??t.hairColor,skin:n.skin??t.skin}}var ut={halloween:{id:`halloween`,decor:[{slots:`desk-*`,item:`jackOLantern`},{slots:`reception-w`,item:`jackOLantern`},{slots:`reception-e`,item:`candyBowl`},{slots:`balcony-*`,item:`bigPumpkin`},{slots:`corner-*`,item:`cobweb`},{slots:`elevator-e`,item:`broom`},{slots:`lobby-feature`,item:`gravestone`},{slots:`patio`,item:`inflatablePumpkin`}],lights:[`#ff7b00`,`#9d4edd`],tint:{color:`#b48cff`,amount:.12},sky:{color:`#5a189a`,amount:.45,fog:.35},costumes:{agent:[`witchHat`,`pumpkinHead`,`vampire`,`ghost`,`catEars`,`skeleton`],ceo:[`crown`]},playlist:[`haunted-hotfix`,`monster-merge`],confetti:{colors:[`#ff7b00`,`#ff9e1f`,`#7b2cbf`,`#9d4edd`,`#1b1b1f`,`#2b2d42`],shape:`paper`}},christmas:{id:`christmas`,decor:[{slots:`lobby-feature`,item:`tree`},{slots:`reception-w`,item:`snowman`},{slots:`elevator-w`,item:`snowman`,kind:`lobby`}],lights:[`#ff3b3b`,`#2dc653`,`#ffd23f`,`#4cc9f0`],garland:!0,tint:{color:`#ffd6a0`,amount:.1},sky:{color:`#c8d7ff`,amount:.2,fog:.2},costumes:{agent:[`santaHat`,`antlers`,`uglySweater`],ceo:[`santaHat`]},playlist:[`snowed-in-standup`,`cocoa-and-code`],confetti:{colors:[`#e63946`,`#2a9d8f`,`#ffd166`,`#ffffff`,`#52b788`],shape:`paper`}},newyear:{id:`newyear`,decor:[{slots:`reception-w`,item:`champagne`},{slots:`reception-e`,item:`champagne`}],lights:[`#ffd23f`,`#f8f9fa`,`#c0c0ff`],bunting:[`#ffd23f`,`#1b1b3a`,`#f8f9fa`,`#c77dff`],tint:{color:`#ffe8b0`,amount:.08},sky:{color:`#1b1b4a`,amount:.25,fog:0},costumes:{agent:[`partyHat`],ceo:[`crown`]},playlist:[`countdown-commit`],confetti:{colors:[`#ffd23f`,`#f8f9fa`,`#c0c0c0`,`#c77dff`,`#4cc9f0`],shape:`paper`}},valentines:{id:`valentines`,decor:[{slots:`desk-*`,item:`heartBalloon`},{slots:`reception-*`,item:`heartBalloon`}],lights:[`#ff4d6d`,`#ff8fab`,`#c9184a`],tint:{color:`#ff9eb5`,amount:.12},costumes:{agent:[`heartBoppers`],ceo:[`crown`]},playlist:[`pair-programming`],confetti:{colors:[`#ff4d6d`,`#ff8fab`,`#c9184a`,`#ffccd5`,`#ffffff`],shape:`heart`}},easter:{id:`easter`,decor:[{slots:`reception-w`,item:`eggBasket`},{slots:`elevator-e`,item:`eggBasket`},{slots:`cabinet-top`,item:`goldenEgg`}],lights:null,bunting:[`#ffc8dd`,`#bde0fe`,`#caffbf`,`#fdffb6`,`#e4c1f9`],tint:{color:`#e9ffd6`,amount:.08},costumes:{agent:[`bunnyEars`],ceo:[`bunnyEars`]},playlist:[`egg-hunt-hop`],confetti:{colors:[`#ffc8dd`,`#bde0fe`,`#caffbf`,`#fdffb6`,`#e4c1f9`],shape:`paper`}},birthday:{id:`birthday`,decor:[{slots:`banner`,item:`banner`},{slots:`reception-*`,item:`balloons`},{slots:`elevator-*`,item:`balloons`},{slots:`desk-*`,item:`balloons`},{slots:`manager-desk`,item:`cake`}],lights:[`#ffd23f`,`#ff5d8f`,`#3a86ff`,`#06d6a0`],bunting:[`#ff5d8f`,`#ffd23f`,`#3bceac`,`#3a86ff`,`#9b5de5`],tint:{color:`#fff0c2`,amount:.06},costumes:{agent:[`partyHat`],ceo:[`partyHat`]},playlist:[`another-year-of-uptime`],confetti:{colors:[`#ff5d8f`,`#ffd23f`,`#3bceac`,`#3a86ff`,`#ff8c42`,`#9b5de5`],shape:`paper`}}},dt=(e,t)=>e.endsWith(`*`)?t.startsWith(e.slice(0,-1)):t===e;function ft(e,t){if(!e)return[];let n=ut[e].decor,r=[];for(let e of l(t)){let i=n.find(n=>(!n.kind||n.kind===t)&&dt(n.slots,e.id));i&&r.push({slot:e,item:i.item})}return r}var pt={bigPumpkin:{w:.55,d:.55,h:.45},broom:{w:.35,d:.3,h:1.3},gravestone:{w:1,d:.5,h:1.25},inflatablePumpkin:{w:1.7,d:1.7,h:1.6},tree:{w:2.6,d:2.6,h:3.2},snowman:{w:.7,d:.7,h:1.3},balloons:{w:.45,d:.45,h:.3},eggBasket:{w:.5,d:.5,h:.4}};function mt(e,t){return ft(e,t).flatMap(({slot:e,item:t})=>{let n=pt[t];if(!e.floor||!n)return[];let r=Math.abs(Math.sin(e.rotY))>.7;return[ae(e.x,e.z,r?n.d:n.w,r?n.w:n.d,n.h)]})}function ht(e,t){if(!e)return null;let n=ut[e].costumes[t.role];return n.length?n[at(`${e}:${t.id}`)%n.length]:null}var gt=typeof window<`u`?window.location.search:``,_t=Ue(gt),vt=(()=>{let e=We(gt);return e===null?0:e-Date.now()})(),yt=()=>Date.now()+vt;function bt(){let e=new Date(yt());return{...Ge(e,E.getState().settings.themes??Fe,_t),day:Le(e)}}var xt=o(()=>bt());function St(){let e=bt(),t=xt.getState();(e.id!==t.id||e.source!==t.source||e.day!==t.day)&&xt.setState(e)}E.subscribe((e,t)=>{e.settings.themes!==t.settings.themes&&St()}),typeof window<`u`&&setInterval(St,5e3);var Ct=()=>{let e=xt.getState().id;return e?ut[e].playlist:[]},wt=()=>xt(e=>e.id?ut[e.id].confetti:void 0),Tt=o(()=>({costume:null,act:null,status:null}));function Et(e){Tt.getState().act?.(e)}var Dt=new Map;function Ot(e){let t=Object.keys(e);for(let n of t)Dt.set(n,e[n]);return()=>t.forEach(t=>Dt.get(t)===e[t]&&Dt.delete(t))}var kt=null,At=null,jt=e=>void(At=e);function Mt(){let e={calls:0,meshes:0,instances:0,lines:0,points:0};return At?.traverseVisible(t=>{let n=t;n.isInstancedMesh&&(e.instances+=n.count??0),n.isMesh&&e.meshes++,n.isLine&&e.lines++,n.isPoints&&e.points++,(n.isMesh||n.isLine||n.isPoints)&&e.calls++}),e}function Nt(e){kt=e}typeof window<`u`&&!Object.getOwnPropertyDescriptor(window,`__swarmTheme`)&&Object.defineProperty(window,"__swarmTheme",{value:{get id(){return xt.getState().id},get source(){return xt.getState().source},get day(){return xt.getState().day},get now(){return new Date(yt()).toString()},get override(){return _t},get placed(){let e=xt.getState().id;return!kt||!e||kt.kind===`roof`?[]:ft(e,kt.kind).map(({slot:e,item:t})=>({slot:e.id,item:t,x:e.x,y:e.y,z:e.z}))},get floor(){return kt},get drawn(){return Mt()},get confetti(){let e=xt.getState().id;return e?ut[e].confetti??null:null},get calls(){return[...Dt.keys()]},set(e){_t=e,St()},setDate(e){let t=e?We(`?date=${encodeURIComponent(e)}`):null;return vt=t===null?0:t-Date.now(),St(),new Date(yt()).toString()},call(e,...t){let n=Dt.get(e);if(!n)throw Error(`no theme call "${e}" (have: ${[...Dt.keys()].join(`, `)||`none`})`);return n(...t)}},enumerable:!1});function Pt(e,t){let n=e.split(`#`)[0];return n?n+(t?`#${t}`:``):``}function Ft(e,t,n=``){let r=t.trim().toLowerCase().split(/\s+/).filter(Boolean);return e.filter(e=>(!n||e.provider===n)&&r.every(t=>`${e.id} ${e.name}`.toLowerCase().includes(t)))}function It({value:e,onSelect:t,agent:n,repo:r,disabled:i,inherited:a}){let[o,s]=(0,M.useState)(!1);return(0,N.jsxs)(`span`,{style:{display:`inline-block`,maxWidth:`100%`},children:[(0,N.jsx)(`button`,{type:`button`,className:`btn btn-small`,disabled:i,"aria-expanded":o,onClick:()=>s(!o),children:(0,N.jsx)(A,{children:`Browse OpenCode models`})}),(0,N.jsxs)(`span`,{className:`muted small`,style:{display:`block`,overflowWrap:`anywhere`},children:[(0,N.jsx)(A,{children:`Selected:`}),` `,e||a||(0,N.jsx)(A,{children:`OpenCode default`})]}),o&&!i&&(0,N.jsx)(Lt,{value:e,agent:n,repo:r,inherited:a,onSelect:e=>{t(e),s(!1)}},`${n}:${r}`)]})}function Lt({value:e,onSelect:t,agent:n,repo:r,inherited:i}){let a=(0,M.useId)(),o=j(),[s,c]=(0,M.useState)(null),[l,u]=(0,M.useState)(``),[d,f]=(0,M.useState)(0),[p,m]=(0,M.useState)(!0),[h,g]=(0,M.useState)(``),[_,v]=(0,M.useState)(``),[y,b]=(0,M.useState)(e.split(`#`)[0]),[x,S]=(0,M.useState)(e.split(`#`)[1]??``);(0,M.useEffect)(()=>{let e=!0;return m(!0),u(``),k.openCodeModels({...n?{agent:n}:{},...r?{repo:r}:{}},d>0).then(t=>{e&&c(t)}).catch(t=>{e&&u(t instanceof Error?t.message:`Could not load models`)}).finally(()=>{e&&m(!1)}),()=>{e=!1}},[n,r,d]);let C=(0,M.useMemo)(()=>Ft(s?.models??[],h,_),[s,h,_]),w=s?.models.find(e=>e.id===y),T=[...new Set(s?.models.map(e=>e.provider))];return(0,N.jsxs)(`span`,{className:`card`,style:{display:`block`,marginTop:8,minWidth:220},children:[(0,N.jsx)(`span`,{className:`muted small`,style:{display:`block`},children:(0,N.jsx)(A,{children:`Choose a model and variant, then press “Use model” to save. Changes apply to the next task. Manual entry remains available.`})}),s&&(0,N.jsxs)(`span`,{className:`muted small`,style:{display:`block`,overflowWrap:`anywhere`},children:[`Project: `,s.directory]}),(0,N.jsx)(`button`,{type:`button`,className:`btn btn-small`,onClick:()=>t(``),children:i?`Office default (${i})`:`OpenCode default${s?.defaultModel?` (${s.defaultModel})`:``}`}),(0,N.jsx)(`button`,{type:`button`,className:`btn btn-small`,disabled:p,onClick:()=>f(e=>e+1),children:(0,N.jsx)(A,{children:`Refresh`})}),p&&(0,N.jsx)(`span`,{role:`status`,children:(0,N.jsx)(A,{children:`Loading models…`})}),l&&(0,N.jsx)(`span`,{role:`alert`,children:l}),s&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`span`,{className:`field`,children:(0,N.jsx)(A,{children:`Search models`})}),(0,N.jsx)(`input`,{id:`${a}-search`,"aria-label":o(`Search OpenCode models`),value:h,onChange:e=>g(e.target.value)}),(0,N.jsx)(`span`,{className:`field`,children:(0,N.jsx)(A,{children:`Provider`})}),(0,N.jsxs)(`select`,{id:`${a}-provider`,"aria-label":o(`OpenCode provider`),value:_,onChange:e=>v(e.target.value),children:[(0,N.jsx)(`option`,{value:``,children:o(`All providers`)}),T.map(e=>(0,N.jsx)(`option`,{children:e},e))]}),(0,N.jsx)(`span`,{className:`field`,children:o(`Available models ({count})`,{count:C.length})}),(0,N.jsxs)(`select`,{id:`${a}-model`,"aria-label":o(`Available OpenCode models`),value:C.some(e=>e.id===y)?y:``,onChange:e=>{b(e.target.value),S(``)},children:[(0,N.jsx)(`option`,{value:``,children:o(`Select a model`)}),C.map(e=>(0,N.jsxs)(`option`,{value:e.id,disabled:!e.tools,children:[e.name,` — `,e.id,e.tools?``:` (no tools)`]},e.id))]}),!C.length&&(0,N.jsx)(`span`,{role:`status`,children:(0,N.jsx)(A,{children:`No matching models.`})}),(0,N.jsx)(`span`,{className:`field`,children:(0,N.jsx)(A,{children:`Variant`})}),(0,N.jsxs)(`select`,{id:`${a}-variant`,"aria-label":o(`OpenCode variant`),value:x,disabled:!w?.variants.length,onChange:e=>S(e.target.value),children:[(0,N.jsx)(`option`,{value:``,children:o(`Model default`)}),w?.variants.map(e=>(0,N.jsx)(`option`,{children:e},e))]}),(0,N.jsx)(`button`,{type:`button`,className:`btn btn-small`,disabled:p||!w?.tools||!C.some(e=>e.id===y)||!!x&&!w.variants.includes(x),onClick:()=>t(y+(x?`#${x}`:``)),children:(0,N.jsx)(A,{children:`Use model`})})]})]})}function Rt({value:e,inherited:t,agent:n,repo:r,onSelect:i,id:a,style:o,disabled:s}){let[c,l]=(0,M.useState)(null),[u,d]=(0,M.useState)(``);(0,M.useEffect)(()=>{if(s)return;let e=!0;return k.openCodeModels({...n?{agent:n}:{},...r?{repo:r}:{}}).then(t=>{e&&(l(t),d(``))}).catch(()=>{e&&d(`Could not load variants; use Browse OpenCode models to refresh or enter #variant manually.`)}),()=>{e=!1}},[n,r,s]);let f=e||t||c?.defaultModel||``,[p,m=``]=f.split(`#`),h=c?.models.find(e=>e.id===p)?.variants??[];return(0,N.jsxs)(`select`,{id:a,"aria-label":a?void 0:`OpenCode variant`,style:o,value:m,disabled:s||!h.length,title:u||(h.length?`OpenCode reasoning variant; applies to the next task`:c?`No variants available for this model; manual #variant entry remains available`:`Loading OpenCode variants…`),onChange:e=>i(Pt(f,e.target.value)),children:[(0,N.jsx)(`option`,{value:``,children:c?`model default`:`loading variants…`}),m&&!h.includes(m)&&(0,N.jsx)(`option`,{value:m,children:m}),h.map(e=>(0,N.jsx)(`option`,{value:e,children:e},e))]})}function zt(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var Bt=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Vt=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ht={};function Ut(e,t){return((t||Ht).jsx?Vt:Bt).test(e)}var Wt=/[ \t\n\f\r]/g;function Gt(e){return typeof e==`object`?e.type===`text`&&Kt(e.value):Kt(e)}function Kt(e){return e.replace(Wt,``)===``}var qt=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};qt.prototype.normal={},qt.prototype.property={},qt.prototype.space=void 0;function Jt(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new qt(n,r,t)}function Yt(e){return e.toLowerCase()}var Xt=class{constructor(e,t){this.attribute=t,this.property=e}};Xt.prototype.attribute=``,Xt.prototype.booleanish=!1,Xt.prototype.boolean=!1,Xt.prototype.commaOrSpaceSeparated=!1,Xt.prototype.commaSeparated=!1,Xt.prototype.defined=!1,Xt.prototype.mustUseProperty=!1,Xt.prototype.number=!1,Xt.prototype.overloadedBoolean=!1,Xt.prototype.property=``,Xt.prototype.spaceSeparated=!1,Xt.prototype.space=void 0;var Zt=e({boolean:()=>P,booleanish:()=>F,commaOrSpaceSeparated:()=>tn,commaSeparated:()=>en,number:()=>I,overloadedBoolean:()=>$t,spaceSeparated:()=>L}),Qt=0,P=nn(),F=nn(),$t=nn(),I=nn(),L=nn(),en=nn(),tn=nn();function nn(){return 2**++Qt}var rn=Object.keys(Zt),an=class extends Xt{constructor(e,t,n,r){let i=-1;if(super(e,t),on(this,`space`,r),typeof n==`number`)for(;++i<rn.length;){let e=rn[i];on(this,rn[i],(n&Zt[e])===Zt[e])}}};an.prototype.defined=!0;function on(e,t,n){n&&(e[t]=n)}function sn(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new an(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Yt(r)]=r,n[Yt(a.attribute)]=r}return new qt(t,n,e.space)}var cn=sn({properties:{ariaActiveDescendant:null,ariaAtomic:F,ariaAutoComplete:null,ariaBusy:F,ariaChecked:F,ariaColCount:I,ariaColIndex:I,ariaColSpan:I,ariaControls:L,ariaCurrent:null,ariaDescribedBy:L,ariaDetails:null,ariaDisabled:F,ariaDropEffect:L,ariaErrorMessage:null,ariaExpanded:F,ariaFlowTo:L,ariaGrabbed:F,ariaHasPopup:null,ariaHidden:F,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:L,ariaLevel:I,ariaLive:null,ariaModal:F,ariaMultiLine:F,ariaMultiSelectable:F,ariaOrientation:null,ariaOwns:L,ariaPlaceholder:null,ariaPosInSet:I,ariaPressed:F,ariaReadOnly:F,ariaRelevant:null,ariaRequired:F,ariaRoleDescription:L,ariaRowCount:I,ariaRowIndex:I,ariaRowSpan:I,ariaSelected:F,ariaSetSize:I,ariaSort:null,ariaValueMax:I,ariaValueMin:I,ariaValueNow:I,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function ln(e,t){return t in e?e[t]:t}function un(e,t){return ln(e,t.toLowerCase())}var dn=sn({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:en,acceptCharset:L,accessKey:L,action:null,allow:null,allowFullScreen:P,allowPaymentRequest:P,allowUserMedia:P,alpha:P,alt:null,as:null,async:P,autoCapitalize:null,autoComplete:L,autoFocus:P,autoPlay:P,blocking:L,capture:null,charSet:null,checked:P,cite:null,className:L,closedBy:null,colorSpace:null,cols:I,colSpan:I,command:null,commandFor:null,content:null,contentEditable:F,controls:P,controlsList:L,coords:I|en,crossOrigin:null,data:null,dateTime:null,decoding:null,default:P,defer:P,dir:null,dirName:null,disabled:P,download:$t,draggable:F,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:P,formTarget:null,headers:L,height:I,hidden:$t,high:I,href:null,hrefLang:null,htmlFor:L,httpEquiv:L,id:null,imageSizes:null,imageSrcSet:null,inert:P,inputMode:null,integrity:null,is:null,isMap:P,itemId:null,itemProp:L,itemRef:L,itemScope:P,itemType:L,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:P,low:I,manifest:null,max:null,maxLength:I,media:null,method:null,min:null,minLength:I,multiple:P,muted:P,name:null,nonce:null,noModule:P,noValidate:P,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:P,optimum:I,pattern:null,ping:L,placeholder:null,playsInline:P,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:P,referrerPolicy:null,rel:L,required:P,reversed:P,rows:I,rowSpan:I,sandbox:L,scope:null,scoped:P,seamless:P,selected:P,shadowRootClonable:P,shadowRootCustomElementRegistry:P,shadowRootDelegatesFocus:P,shadowRootMode:null,shadowRootSerializable:P,shape:null,size:I,sizes:null,slot:null,span:I,spellCheck:F,src:null,srcDoc:null,srcLang:null,srcSet:null,start:I,step:null,style:null,tabIndex:I,target:null,title:null,translate:null,type:null,typeMustMatch:P,useMap:null,value:F,width:I,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:L,axis:null,background:null,bgColor:null,border:I,borderColor:null,bottomMargin:I,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:P,declare:P,event:null,face:null,frame:null,frameBorder:null,hSpace:I,leftMargin:I,link:null,longDesc:null,lowSrc:null,marginHeight:I,marginWidth:I,noResize:P,noHref:P,noShade:P,noWrap:P,object:null,profile:null,prompt:null,rev:null,rightMargin:I,rules:null,scheme:null,scrolling:F,standby:null,summary:null,text:null,topMargin:I,valueType:null,version:null,vAlign:null,vLink:null,vSpace:I,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:P,disablePictureInPicture:P,disableRemotePlayback:P,exportParts:en,part:L,prefix:null,property:null,results:I,security:null,unselectable:null},space:`html`,transform:un}),fn=sn({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:tn,accentHeight:I,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:I,amplitude:I,arabicForm:null,ascent:I,attributeName:null,attributeType:null,azimuth:I,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:I,by:null,calcMode:null,capHeight:I,className:L,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:I,diffuseConstant:I,direction:null,display:null,dur:null,divisor:I,dominantBaseline:null,download:P,dx:null,dy:null,edgeMode:null,editable:null,elevation:I,enableBackground:null,end:null,event:null,exponent:I,externalResourcesRequired:null,fill:null,fillOpacity:I,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:en,g2:en,glyphName:en,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:I,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:I,horizOriginX:I,horizOriginY:I,id:null,ideographic:I,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:I,k:I,k1:I,k2:I,k3:I,k4:I,kernelMatrix:tn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:I,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:I,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:I,overlineThickness:I,paintOrder:null,panose1:null,path:null,pathLength:I,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:L,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:I,pointsAtY:I,pointsAtZ:I,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:tn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:tn,rev:tn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:tn,requiredFeatures:tn,requiredFonts:tn,requiredFormats:tn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:I,specularExponent:I,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:I,strikethroughThickness:I,string:null,stroke:null,strokeDashArray:tn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:I,strokeOpacity:I,strokeWidth:null,style:null,surfaceScale:I,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:tn,tabIndex:I,tableValues:null,target:null,targetX:I,targetY:I,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:tn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:I,underlineThickness:I,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:I,values:null,vAlphabetic:I,vMathematical:I,vectorEffect:null,vHanging:I,vIdeographic:I,version:null,vertAdvY:I,vertOriginX:I,vertOriginY:I,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:I,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:ln}),pn=sn({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),mn=sn({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:un}),hn=sn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),gn={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},_n=/[A-Z]/g,vn=/-[a-z]/g,yn=/^data[-\w.:]+$/i;function bn(e,t){let n=Yt(t),r=t,i=Xt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&yn.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(vn,Sn);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!vn.test(e)){let n=e.replace(_n,xn);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=an}return new i(r,t)}function xn(e){return`-`+e.toLowerCase()}function Sn(e){return e.charAt(1).toUpperCase()}var Cn=Jt([cn,dn,pn,mn,hn],`html`),wn=Jt([cn,fn,pn,mn,hn],`svg`);function Tn(e){return e.join(` `).trim()}var En=n(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
3
+ `);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),Dn=n(((e,t,n)=>{var r=n&&n.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var i=r(En());function a(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=(0,i.default)(e),a=typeof t==`function`;return r.forEach(e=>{if(e.type!==`declaration`)return;let{property:r,value:i}=e;a?t(r,i,e):i&&(n||={},n[r]=i)}),n}})),On=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),kn=n(((e,t,n)=>{var r=(n&&n.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(Dn()),i=On();function a(e,t){var n={};return!e||typeof e!=`string`||(0,r.default)(e,function(e,r){e&&r&&(n[(0,i.camelCase)(e,t)]=r)}),n}a.default=a,t.exports=a})),An=Mn(`end`),jn=Mn(`start`);function Mn(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function Nn(e){let t=jn(e),n=An(e);if(t&&n)return{start:t,end:n}}function Pn(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?In(e.position):`start`in e||`end`in e?In(e):`line`in e||`column`in e?Fn(e):``}function Fn(e){return Ln(e&&e.line)+`:`+Ln(e&&e.column)}function In(e){return Fn(e&&e.start)+`-`+Fn(e&&e.end)}function Ln(e){return e&&typeof e==`number`?e:1}var R=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=Pn(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};R.prototype.file=``,R.prototype.name=``,R.prototype.reason=``,R.prototype.message=``,R.prototype.stack=``,R.prototype.column=void 0,R.prototype.line=void 0,R.prototype.ancestors=void 0,R.prototype.cause=void 0,R.prototype.fatal=void 0,R.prototype.place=void 0,R.prototype.ruleId=void 0,R.prototype.source=void 0;var Rn=t(kn(),1),zn={}.hasOwnProperty,Bn=new Map,Vn=/[A-Z]/g,Hn=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Un=new Set([`td`,`th`]),Wn=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function Gn(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=nr(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=tr(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?wn:Cn,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Kn(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Kn(e,t,n){if(t.type===`element`)return qn(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return Jn(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Xn(e,t,n);if(t.type===`mdxjsEsm`)return Yn(e,t);if(t.type===`root`)return Zn(e,t,n);if(t.type===`text`)return Qn(e,t)}function qn(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=wn,e.schema=i),e.ancestors.push(t);let a=cr(e,t.tagName,!1),o=rr(e,t),s=ar(e,t);return Hn.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!Gt(e)})),$n(e,o,a,t),er(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Jn(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}lr(e,t.position)}function Yn(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);lr(e,t.position)}function Xn(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=wn,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:cr(e,t.name,!0),o=ir(e,t),s=ar(e,t);return $n(e,o,a,t),er(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Zn(e,t,n){let r={};return er(r,ar(e,t)),e.create(t,e.Fragment,r,n)}function Qn(e,t){return t.value}function $n(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function er(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function tr(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function nr(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=jn(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function rr(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&zn.call(t.properties,i)){let a=or(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Un.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function ir(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else lr(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else lr(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function ar(e,t){let n=[],r=-1,i=e.passKeys?new Map:Bn;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=Kn(e,a,o);s!==void 0&&n.push(s)}return n}function or(e,t,n){let r=bn(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?zt(n):Tn(n)),r.property===`style`){let t=typeof n==`object`?n:sr(e,String(n));return e.stylePropertyNameCase===`css`&&(t=ur(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?gn[r.property]||r.property:r.attribute,n]}}function sr(e,t){try{return(0,Rn.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new R("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=Wn+`#cannot-parse-style-attribute`,r}}function cr(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=Ut(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=Ut(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return zn.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);lr(e)}function lr(e,t){let n=new R("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=Wn+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function ur(e){let t={},n;for(n in e)zn.call(e,n)&&(t[dr(n)]=e[n]);return t}function dr(e){let t=e.replace(Vn,fr);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function fr(e){return`-`+e.toLowerCase()}var pr={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},mr={};function hr(e,t){let n=t||mr;return gr(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function gr(e,t,n){if(vr(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return _r(e.children,t,n)}return Array.isArray(e)?_r(e,t,n):``}function _r(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=gr(e[i],t,n);return r.join(``)}function vr(e){return!!(e&&typeof e==`object`)}var yr=document.createElement(`i`);function br(e){let t=`&`+e+`;`;yr.innerHTML=t;let n=yr.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function xr(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function Sr(e,t){return e.length>0?(xr(e,e.length,0,t),e):t}var Cr={}.hasOwnProperty;function wr(e){let t={},n=-1;for(;++n<e.length;)Tr(t,e[n]);return t}function Tr(e,t){let n;for(n in t){let r=(Cr.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){Cr.call(r,a)||(r[a]=[]);let e=i[a];Er(r[a],Array.isArray(e)?e:e?[e]:[])}}}function Er(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);xr(e,0,0,r)}function Dr(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function Or(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var z=Ir(/[A-Za-z]/),B=Ir(/[\dA-Za-z]/),kr=Ir(/[#-'*+\--9=?A-Z^-~]/);function Ar(e){return e!==null&&(e<32||e===127)}var jr=Ir(/\d/),Mr=Ir(/[\dA-Fa-f]/),Nr=Ir(/[!-/:-@[-`{-~]/);function V(e){return e!==null&&e<-2}function H(e){return e!==null&&(e<0||e===32)}function U(e){return e===-2||e===-1||e===32}var Pr=Ir(/\p{P}|\p{S}/u),Fr=Ir(/\s/);function Ir(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Lr(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&B(e.charCodeAt(n+1))&&B(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function W(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return U(r)?(e.enter(n),s(r)):t(r)}function s(r){return U(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}function Rr(e,t,n,r,i,a){let o=0;return s;function s(t){return a>0&&U(t)?(e.enter(r),c(t)):l(t)}function c(t){return U(t)&&o<a?(e.consume(t),o++,c):(e.exit(r),l(t))}function l(e){return o>=i?t(e):n(e)}}var zr={tokenize:Br};function Br(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null)e.consume(n);else return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),W(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null)e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);else return V(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var Vr=class{constructor(){this.index=new Map,this.map=[]}add(e,t,n){Hr(this,e,t,n,!1)}addBefore(e,t,n){Hr(this,e,t,n,!0)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function Hr(e,t,n,r,i){if(n===0&&r.length===0)return;let a=e.index.get(t);if(a){a[1]+=n,i?(r.push(...a[2]),a[2]=r):a[2].push(...r);return}let o=[t,n,r];e.map.push(o),e.index.set(t,o)}var Ur={tokenize:Gr},Wr={tokenize:Kr};function Gr(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;let c=new Vr;return c.add(a+1,0,t.events.slice(n)),c.add(n,s-n,[]),c.consume(t.events),l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!(!i.currentConstruct||i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Wr,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(Wr,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null)i&&v(),_(0),e.consume(n);else return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null)g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);else return V(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;let l=new Vr;l.add(a+1,0,t.events.slice(n)),l.add(n,e-n,[]),l.consume(t.events)}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Kr(e,t,n){return W(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function qr(e){if(e===null||H(e)||Fr(e))return 1;if(Pr(e))return 2}function Jr(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var Yr={name:`attention`,resolveAll:Xr,tokenize:Zr};function Xr(e,t){let n=-1,r;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){let i=n;for(;i--;)if(e[i][0]===`exit`&&e[i][1].type===`attentionSequence`&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;let a=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,o={...e[i][1].end},s={...e[n][1].start};Qr(o,-a),Qr(s,a);let c={type:a>1?`strongSequence`:`emphasisSequence`,start:o,end:{...e[i][1].end}},l={type:a>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:s},u={type:a>1?`strongText`:`emphasisText`,start:{...e[i][1].end},end:{...e[n][1].start}},d={type:a>1?`strong`:`emphasis`,start:{...c.start},end:{...l.end}};e[i][1].end={...c.start},e[n][1].start={...l.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=Sr(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=Sr(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=Sr(r,Jr(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=Sr(r,[[`exit`,u,t],[`enter`,l,t],[`exit`,l,t],[`exit`,d,t]]);let f=0;e[n][1].end.offset-e[n][1].start.offset&&(f=2,r=Sr(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),xr(e,i-1,n-i+3,r),n=i+r.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function Zr(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=qr(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=qr(o),u=!l||l===2&&i||n.includes(o)&&o!==42&&o!==95,d=!i||i===2&&l||n.includes(r)&&r!==42&&r!==95;return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function Qr(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var $r={name:`autolink`,tokenize:ei};function ei(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return z(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||B(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||B(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||Ar(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):kr(t)?(e.consume(t),l):n(t)}function u(e){return B(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||B(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var ti={partial:!0,tokenize:ni};function ni(e,t,n){return r;function r(t){return U(t)?W(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||V(e)?t(e):n(e)}}var ri={continuation:{tokenize:ai},exit:oi,name:`blockQuote`,tokenize:ii};function ii(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return U(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function ai(e,t,n){let r=this;return i;function i(t){return U(t)?W(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(ri,t,n)(r)}}function oi(e){e.exit(`blockQuote`)}var si={name:`characterEscape`,tokenize:ci};function ci(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return Nr(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var li={name:`characterReference`,tokenize:ui};function ui(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=B,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=Mr,u):(e.enter(`characterReferenceValue`),a=7,o=jr,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===B&&!br(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var di={partial:!0,tokenize:fi};function fi(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var pi={concrete:!0,name:`codeFenced`,tokenize:mi};function mi(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),U(t)?W(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||V(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(di,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||V(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):U(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),W(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||V(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||V(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&U(t)?W(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||V(t)?e.check(di,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||V(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),U(t)?W(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),U(t)?W(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||V(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}var hi={name:`codeIndented`,tokenize:_i},gi={partial:!0,tokenize:vi};function _i(e,t,n){return r;function r(t){return e.enter(`codeIndented`),Rr(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):V(t)?e.attempt(gi,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||V(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function vi(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):V(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):Rr(e,t,a,`linePrefix`,4,4)(o)}function a(e){return V(e)?i(e):n(e)}}var yi={name:`codeText`,previous:xi,resolve:bi,tokenize:Si};function bi(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function xi(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function Si(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):V(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||V(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var Ci=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&wi(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),wi(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),wi(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);wi(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);wi(this.left,t.reverse())}}}};function wi(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Ti(e){let t={},n=-1,r,i,a,o,s,c,l,u=new Ci(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,Ei(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return xr(e,0,1/0,u.slice(0)),!l}function Ei(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var Di={resolve:ki,tokenize:Ai},Oi={partial:!0,tokenize:ji};function ki(e){return Ti(e),e}function Ai(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):V(t)?e.check(Oi,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function ji(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),W(e,a,`linePrefix`)}function a(i){if(i===null||V(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function Mi(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||Ar(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||V(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||H(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||Ar(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function Ni(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):V(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||V(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!U(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Pi(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):V(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),W(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||V(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function Fi(e,t){let n;return r;function r(i){return V(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):U(i)?W(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var Ii={name:`definition`,tokenize:Ri},Li={partial:!0,tokenize:zi};function Ri(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return Ni.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=Or(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return H(t)?Fi(e,l)(t):l(t)}function l(t){return Mi(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Li,d,d)(t)}function d(t){return U(t)?W(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||V(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function zi(e,t,n){return r;function r(t){return H(t)?Fi(e,i)(t):n(t)}function i(t){return Pi(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return U(t)?W(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||V(e)?t(e):n(e)}}var Bi={name:`hardBreakEscape`,tokenize:Vi};function Vi(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return V(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var Hi={name:`headingAtx`,resolve:Ui,tokenize:Wi};function Ui(e,t){let n=e.length-2,r=3;if(e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r){let i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`};xr(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function Wi(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||H(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||V(n)?(e.exit(`atxHeading`),t(n)):U(n)?W(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||H(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var Gi=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),Ki=[`pre`,`script`,`style`,`textarea`],qi={concrete:!0,name:`htmlFlow`,resolveTo:Yi,tokenize:Xi},Ji={partial:!0,tokenize:Zi};function Yi(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Xi(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:se):z(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):z(a)?(e.consume(a),i=4,r.interrupt?t:se):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:se):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:D:m):n(i)}function h(t){return z(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||H(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Ki.includes(l)?(i=1,r.interrupt?t(s):D(s)):Gi.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):D(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||B(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:D):n(i)}function v(t){return U(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||z(t)?(e.consume(t),b):U(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||B(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):U(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):U(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||V(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||H(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||U(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),ee):n(t)}function ee(t){return t===null||V(t)?D(t):U(t)?(e.consume(t),ee):n(t)}function D(t){return t===45&&i===2?(e.consume(t),ie):t===60&&i===1?(e.consume(t),O):t===62&&i===4?(e.consume(t),ce):t===63&&i===3?(e.consume(t),se):t===93&&i===5?(e.consume(t),oe):V(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Ji,le,te)(t)):t===null||V(t)?(e.exit(`htmlFlowData`),te(t)):(e.consume(t),D)}function te(t){return e.check(di,ne,le)(t)}function ne(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),re}function re(t){return t===null||V(t)?te(t):(e.enter(`htmlFlowData`),D(t))}function ie(t){return t===45?(e.consume(t),se):D(t)}function O(t){return t===47?(e.consume(t),o=``,ae):D(t)}function ae(t){if(t===62){let n=o.toLowerCase();return Ki.includes(n)?(e.consume(t),ce):D(t)}return z(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),ae):D(t)}function oe(t){return t===93?(e.consume(t),se):D(t)}function se(t){return t===62?(e.consume(t),ce):t===45&&i===2?(e.consume(t),se):D(t)}function ce(t){return t===null||V(t)?(e.exit(`htmlFlowData`),le(t)):(e.consume(t),ce)}function le(n){return e.exit(`htmlFlow`),t(n)}}function Zi(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(ti,t,n)}}var Qi={name:`htmlText`,tokenize:$i};function $i(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):z(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):z(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):V(t)?(o=d,O(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?ie(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):V(t)?(o=h,O(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?ie(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?ie(t):V(t)?(o=v,O(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):V(t)?(o=y,O(t)):(e.consume(t),y)}function b(e){return e===62?ie(e):y(e)}function x(t){return z(t)?(e.consume(t),S):n(t)}function S(t){return t===45||B(t)?(e.consume(t),S):C(t)}function C(t){return V(t)?(o=C,O(t)):U(t)?(e.consume(t),C):ie(t)}function w(t){return t===45||B(t)?(e.consume(t),w):t===47||t===62||H(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),ie):t===58||t===95||z(t)?(e.consume(t),E):V(t)?(o=T,O(t)):U(t)?(e.consume(t),T):ie(t)}function E(t){return t===45||t===46||t===58||t===95||B(t)?(e.consume(t),E):ee(t)}function ee(t){return t===61?(e.consume(t),D):V(t)?(o=ee,O(t)):U(t)?(e.consume(t),ee):T(t)}function D(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,te):V(t)?(o=D,O(t)):U(t)?(e.consume(t),D):(e.consume(t),ne)}function te(t){return t===i?(e.consume(t),i=void 0,re):t===null?n(t):V(t)?(o=te,O(t)):(e.consume(t),te)}function ne(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||H(t)?T(t):(e.consume(t),ne)}function re(e){return e===47||e===62||H(e)?T(e):n(e)}function ie(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function O(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ae}function ae(t){return U(t)?W(e,oe,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):oe(t)}function oe(t){return e.enter(`htmlTextData`),o(t)}}var ea={name:`labelEnd`,resolveAll:ia,resolveTo:aa,tokenize:oa},ta={tokenize:sa},na={tokenize:ca},ra={tokenize:la};function ia(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&xr(e,0,e.length,n),e}function aa(e,t){let n=e.length,r=0,i,a,o;for(;n--;){let t=e[n][1];if(i){if(t.type===`link`||t.type===`labelLink`&&t._inactive)break;e[n][0]===`enter`&&t.type===`labelLink`&&(t._inactive=!0)}else if(a){if(e[n][0]===`enter`&&(t.type===`labelImage`||t.type===`labelLink`)&&!t._balanced&&(i=n,t.type!==`labelLink`)){r=2;break}}else t.type===`labelEnd`&&(a=n)}let s={type:e[i][1].type===`labelLink`?`link`:`image`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:`label`,start:{...e[i][1].start},end:{...e[a][1].end}},l={type:`labelText`,start:{...e[i+r+2][1].end},end:{...e[a-2][1].start}};return o=[[`enter`,s,t],[`enter`,c,t]],o=Sr(o,e.slice(i+1,i+r+3)),o=Sr(o,[[`enter`,l,t]]),o=Sr(o,Jr(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),o=Sr(o,[[`exit`,l,t],e[a-2],e[a-1],[`exit`,c,t]]),o=Sr(o,e.slice(a+1)),o=Sr(o,[[`exit`,s,t]]),xr(e,i,e.length,o),e}function oa(e,t,n){let r=this,i=r._labelStarts,a,o;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();a=i[i.length-1]}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(Or(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(ta,u,o?u:d)(t):t===91?e.attempt(na,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(ra,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function sa(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return H(t)?Fi(e,a)(t):a(t)}function a(t){return t===41?u(t):Mi(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return H(t)?Fi(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Pi(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return H(t)?Fi(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function ca(e,t,n){let r=this;return i;function i(t){return Ni.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(Or(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function la(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var ua={name:`labelStartImage`,resolveAll:ea.resolveAll,tokenize:da};function da(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),o}function o(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelImage`),s):n(t)}function s(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var fa={name:`labelStartLink`,resolveAll:ea.resolveAll,tokenize:pa};function pa(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelLink`),o}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var ma={name:`lineEnding`,tokenize:ha};function ha(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),W(e,t,`linePrefix`)}}var ga={name:`thematicBreak`,tokenize:_a};function _a(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||V(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),U(t)?W(e,s,`whitespace`)(t):s(t))}}var G={continuation:{tokenize:xa},exit:Ca,name:`list`,tokenize:ba},va={partial:!0,tokenize:wa},ya={partial:!0,tokenize:Sa};function ba(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:jr(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(ga,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return jr(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(ti,r.interrupt?n:u,e.attempt(va,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return U(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function xa(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(ti,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,W(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!U(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(ya,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,W(e,e.attempt(G,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function Sa(e,t,n){let r=this;return W(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function Ca(e){e.exit(this.containerState.type)}function wa(e,t,n){let r=this;return W(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!U(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var Ta={name:`setextUnderline`,resolveTo:Ea,tokenize:Da};function Ea(e,t){let n=new Vr,r=e.length,i,a,o;for(;r--;)if(e[r][0]===`enter`){if(e[r][1].type===`content`){i=r;break}e[r][1].type===`paragraph`&&(a=r)}else e[r][1].type===`content`&&n.add(r,1,[]),!o&&e[r][1].type===`definition`&&(o=r);let s={type:`setextHeading`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type=`setextHeadingText`,o?(n.add(a,0,[[`enter`,s,t]]),n.add(o+1,0,[[`exit`,e[i][1],t]]),e[i][1].end={...e[o][1].end}):e[i][1]=s,n.add(e.length,0,[[`exit`,s,t]]),n.consume(e),e}function Da(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),U(t)?W(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||V(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var Oa={tokenize:ka};function ka(e){let t=this,n=e.attempt(ti,r,e.attempt(this.parser.constructs.flowInitial,i,W(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Di,i)),`linePrefix`)));return n;function r(r){if(r===null)e.consume(r);else return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null)e.consume(r);else return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var Aa={resolveAll:Pa()},ja=Na(`string`),Ma=Na(`text`);function Na(e){return{resolveAll:Pa(e===`text`?Fa:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null)t.consume(e);else return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function Pa(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):t[r]&&t[r][1].type===`data`||(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function Fa(e,t){let n=new Vr,r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type===`lineEnding`)&&e[r-1][1].type===`data`){let i=e[r-1][1],a=t.sliceStream(i),o=a.length,s=-1,c=0,l;for(;o--;){let e=a[o];if(typeof e==`string`){for(s=e.length;e.charCodeAt(s-1)===32;)c++,s--;if(s)break;s=-1}else if(e===-2)l=!0,c++;else if(e!==-1){o++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(c=0),c){let a={type:r===e.length||l||c<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:o?s:i.start._bufferIndex+s,_index:i.start._index+o,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:{...i.end}};i.end={...a.start},i.start.offset===i.end.offset?Object.assign(i,a):n.add(r,0,[[`enter`,a,t],[`exit`,a,t]])}r++}return n.consume(e),e}var Ia=e({attentionMarkers:()=>Wa,contentInitial:()=>Ra,disable:()=>Ga,document:()=>La,flow:()=>Ba,flowInitial:()=>za,insideSpan:()=>Ua,string:()=>Va,text:()=>Ha}),La={42:G,43:G,45:G,48:G,49:G,50:G,51:G,52:G,53:G,54:G,55:G,56:G,57:G,62:ri},Ra={91:Ii},za={[-2]:hi,[-1]:hi,32:hi},Ba={35:Hi,42:ga,45:[Ta,ga],60:qi,61:Ta,95:ga,96:pi,126:pi},Va={38:li,92:si},Ha={[-5]:ma,[-4]:ma,[-3]:ma,33:ua,38:li,42:Yr,60:[$r,Qi],91:fa,92:[Bi,si],93:ea,95:Yr,96:yi},Ua={null:[Yr,Aa]},Wa={null:[42,95]},Ga={null:[]};function Ka(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=Sr(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=Jr(a,l.events,l),l.events):[]}function f(e,t){return Ja(p(e),t)}function p(e){return qa(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){for(;r._index<o.length;){let e=o[r._index];if(typeof e==`string`){let t=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===t&&r._bufferIndex<e.length;)_(e.charCodeAt(r._bufferIndex))}else _(e)}}function _(e){u=u(e)}function v(e){V(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&xr(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function qa(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function Ja(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
4
+ `;break;case-3:o=`\r
5
+ `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function Ya(e){let t={constructs:wr([Ia,...(e||{}).extensions||[]]),content:n(zr),defined:[],document:n(Ur),flow:n(Oa),lazy:{},string:n(ja),text:n(Ma)};return t;function n(e){return n;function n(n){return Ka(t,e,n)}}}function Xa(e){for(;!Ti(e););return e}var Za=/[\0\t\n\r]/g;function Qa(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i));let s=[],c=0;for(t=``,n&&=(i.charCodeAt(0)===65279&&c++,void 0);c<i.length;){Za.lastIndex=c;let n=Za.exec(i),a=n&&n.index!==void 0?n.index:i.length,o=i.charCodeAt(a);if(!n){t=i.slice(c);break}if(o===10&&c===a&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),c<a&&(s.push(i.slice(c,a)),e+=a-c),o){case 0:s.push(65533),e++;break;case 9:{let t=Math.ceil(e/4)*4;for(s.push(-2);e++<t;)s.push(-1);break}case 10:s.push(-4),e=1;break;default:r=!0,e=1}c=a+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var $a=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function eo(e){return e.replace($a,to)}function to(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return Dr(n.slice(t?2:1),t?16:10)}return br(n)||e}var no={}.hasOwnProperty;function ro(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),io(n)(Xa(Ya(n).document().write(Qa()(e,t,!0))))}function io(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(Ce),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(ye),blockQuote:a(he),characterEscape:T,characterReference:T,codeFenced:a(j),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(j,o),codeText:a(ge,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(_e),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(ve),hardBreakEscape:a(be),hardBreakTrailing:a(be),htmlFlow:a(xe,o),htmlFlowData:T,htmlText:a(xe,o),htmlTextData:T,image:a(Se),label:o,link:a(Ce),listItem:a(Te),listItemValue:f,listOrdered:a(we,d),listUnordered:a(we),paragraph:a(Ee),reference:ue,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(ye),strong:a(De),thematicBreak:a(ke)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:me,autolinkProtocol:A,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:de,characterReferenceMarkerNumeric:de,characterReferenceValue:fe,characterReference:pe,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(re),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(D),hardBreakTrailing:c(D),htmlFlow:c(te),htmlFlowData:E,htmlText:c(ne),htmlTextData:E,image:c(O),label:oe,labelText:ae,lineEnding:ee,link:c(ie),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:k,resourceDestinationString:se,resourceTitleString:ce,resource:le,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};oo(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];no.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||co).call(a,void 0,e[0])}for(r.position={start:ao(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:ao(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:ao(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||co).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+Pn({start:e.start,end:e.end})+`): it’s not open`);n.position.end=ao(e.end)}function u(){return hr(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Or(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];n&&n.type===`text`||(n=Oe(),n.position={start:ao(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=ao(e.end)}function ee(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=ao(e.end),this.data.atHardBreak=void 0}else!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function D(){this.data.atHardBreak=!0}function te(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ne(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function re(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ie(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function O(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function ae(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=eo(t),n.identifier=Or(t).toLowerCase()}function oe(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function se(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function ce(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function le(){this.data.inReference=void 0}function ue(){this.data.referenceType=`collapsed`}function k(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Or(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function de(e){this.data.characterReferenceType=e.type}function fe(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=Dr(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=br(t);let i=this.stack[this.stack.length-1];i.value+=r}function pe(e){let t=this.stack.pop();t.position.end=ao(e.end)}function A(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function me(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function he(){return{type:`blockquote`,children:[]}}function j(){return{type:`code`,lang:null,meta:null,value:``}}function ge(){return{type:`inlineCode`,value:``}}function _e(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function ve(){return{type:`emphasis`,children:[]}}function ye(){return{type:`heading`,depth:0,children:[]}}function be(){return{type:`break`}}function xe(){return{type:`html`,value:``}}function Se(){return{type:`image`,title:null,url:``,alt:null}}function Ce(){return{type:`link`,title:null,url:``,children:[]}}function we(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function Te(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function Ee(){return{type:`paragraph`,children:[]}}function De(){return{type:`strong`,children:[]}}function Oe(){return{type:`text`,value:``}}function ke(){return{type:`thematicBreak`}}}function ao(e){return{line:e.line,column:e.column,offset:e.offset}}function oo(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?oo(e,r):so(e,r)}}function so(e,t){let n;for(n in t)if(no.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function co(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+Pn({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Pn({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+Pn({start:t.start,end:t.end})+`) is still open`)}function lo(e){let t=this;t.parser=n;function n(n){return ro(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function uo(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function fo(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
6
+ `}]}function po(e,t){let n=t.value?t.value+`
7
+ `:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function mo(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ho(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function go(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=Lr(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function _o(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function vo(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function yo(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function bo(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return yo(e,t);let i={src:Lr(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function xo(e,t){let n={src:Lr(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function So(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Co(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return yo(e,t);let i={href:Lr(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function wo(e,t){let n={href:Lr(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function To(e,t,n){let r=e.all(t),i=n?Eo(n):Do(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
8
+ `}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
9
+ `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function Eo(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=Do(n[r])}return t}function Do(e){return e.spread??e.children.length>1}function Oo(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function ko(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ao(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function jo(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Mo(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=jn(t.children[1]),o=An(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function No(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function Po(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var Fo=9,Io=32;function Lo(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(Ro(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(Ro(t.slice(i),i>0,!1)),a.join(``)}function Ro(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===Fo||t===Io;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===Fo||t===Io;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function zo(e,t){let n={type:`text`,value:Lo(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Bo(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var Vo={blockquote:uo,break:fo,code:po,delete:mo,emphasis:ho,footnoteReference:go,heading:_o,html:vo,imageReference:bo,image:xo,inlineCode:So,linkReference:Co,link:wo,listItem:To,list:Oo,paragraph:ko,root:Ao,strong:jo,table:Mo,tableCell:Po,tableRow:No,text:zo,thematicBreak:Bo,toml:Ho,yaml:Ho,definition:Ho,footnoteDefinition:Ho};function Ho(){}var{defineProperty:Uo}=Object,Wo=typeof self==`object`?self:globalThis,Go=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new Wo[e](t)},Ko=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o){let i=r(t),a=r(n);i===`__proto__`?Uo(e,i,{value:a,configurable:!0,enumerable:!0,writable:!0}):e[i]=a}return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof Wo[e]==`function`?Go(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}case`-0`:return-0}return n(Go(a,o),i)};return r},qo=e=>Ko(new Map,e)(0),Jo=``,{toString:Yo}={},{keys:Xo,is:Zo}=Object,Qo=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=Yo.call(e).slice(8,-1);switch(n){case`Array`:return[1,Jo];case`Object`:return[2,Jo];case`Date`:return[3,Jo];case`RegExp`:return[4,Jo];case`Map`:return[5,Jo];case`Set`:return[6,Jo];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},$o=([e,t])=>e===0&&(t===`function`||t===`symbol`),es=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=o=>{if(n.has(o))return n.get(o);let[s,c]=Qo(o);switch(s){case 0:{let t=o;switch(c){case`bigint`:s=8,t=o.toString();break;case`number`:if(!o&&Zo(o,-0))return r.push([`-0`])-1;break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+c);t=null;break;case`undefined`:return i([-1],o)}return i([s,t],o)}case 1:{if(c){let e=o;return c===`DataView`?e=new Uint8Array(o.buffer):c===`ArrayBuffer`&&(e=new Uint8Array(o)),i([c,[...e]],o)}let e=[],t=i([s,e],o);for(let t of o)e.push(a(t));return t}case 2:{if(c)switch(c){case`BigInt`:return i([c,o.toString()],o);case`Boolean`:case`Number`:case`String`:return i([c,o.valueOf()],o)}if(t&&`toJSON`in o)return a(o.toJSON());let n=[],r=i([s,n],o);for(let t of Xo(o))(e||!$o(Qo(o[t])))&&n.push([a(t),a(o[t])]);return r}case 3:return i([s,isNaN(o.getTime())?Jo:o.toISOString()],o);case 4:{let{source:e,flags:t}=o;return i([s,{source:e,flags:t}],o)}case 5:{let t=[],n=i([s,t],o);for(let[n,r]of o)(e||!($o(Qo(n))||$o(Qo(r))))&&t.push([a(n),a(r)]);return n}case 6:{let t=[],n=i([s,t],o);for(let n of o)(e||!$o(Qo(n)))&&t.push(a(n));return n}}let{message:l}=o;return i([s,{name:c,message:l}],o)};return a},ts=(e,{json:t,lossy:n}={})=>{let r=[];return es(!(t||n),!!t,new Map,r)(e),r},ns=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?qo(ts(e,t)):structuredClone(e):(e,t)=>qo(ts(e,t));function rs(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function is(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function as(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||rs,r=e.options.footnoteBackLabel||is,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=Lr(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...ns(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
10
+ `},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
11
+ `}]}}var os=(function(e){if(e==null)return ds;if(typeof e==`function`)return us(e);if(typeof e==`object`)return Array.isArray(e)?ss(e):cs(e);if(typeof e==`string`)return ls(e);throw Error(`Expected function, string, or object as test`)});function ss(e){let t=[],n=-1;for(;++n<e.length;)t[n]=os(e[n]);return us(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function cs(e){let t=e;return us(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function ls(e){return us(t);function t(t){return t&&t.type===e}}function us(e){return t;function t(t,n,r){return!!(fs(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function ds(){return!0}function fs(e){return typeof e==`object`&&!!e&&`type`in e}function ps(e){return e}var ms=[];function hs(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=os(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+ps(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=ms,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=gs(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function gs(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?ms:[e]}function _s(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),hs(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var vs={}.hasOwnProperty,ys={};function bs(e,t){let n=t||ys,r=new Map,i=new Map,a={all:s,applyData:Ss,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...Vo,...n.handlers},one:o,options:n,patch:xs,wrap:ws};return _s(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(vs.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=ns(n);return r.children=a.all(e),r}return ns(e)}return(a.options.unknownHandler||Cs)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=Ts(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=Ts(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function xs(e,t){e.position&&(t.position=Nn(e))}function Ss(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,ns(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function Cs(e,t){let n=t.data||{},r=`value`in t&&!(vs.call(n,`hProperties`)||vs.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function ws(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
12
+ `});++r<e.length;)r&&n.push({type:`text`,value:`
13
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
14
+ `}),n}function Ts(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Es(e,t){let n=bs(e,t),r=n.one(e,void 0),i=as(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
15
+ `},i)),a}function Ds(e,t){return e&&`run`in e?async function(n,r){let i=Es(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Es(n,{file:r,...e||t})}}function Os(e){if(e)throw e}var ks=t(n(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}))(),1);function As(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function js(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a)r(a);else{for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?Ms(s,i)(...o):r(null,...o)}}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function Ms(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var Ns={basename:Ps,dirname:Fs,extname:Is,join:Ls,sep:`/`};function Ps(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);Bs(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function Fs(e){if(Bs(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function Is(e){Bs(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}}else n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function Ls(...e){let t=-1,n;for(;++t<e.length;)Bs(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:Rs(n)}function Rs(e){Bs(e);let t=e.codePointAt(0)===47,n=zs(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function zs(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function Bs(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var Vs={cwd:Hs};function Hs(){return`/`}function Us(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function Ws(e){if(typeof e==`string`)e=new URL(e);else if(!Us(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return Gs(e)}function Gs(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var Ks=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],qs=class{constructor(e){let t;t=e?Us(e)?{path:e}:typeof e==`string`||Zs(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:Vs.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<Ks.length;){let e=Ks[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)Ks.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?Ns.basename(this.path):void 0}set basename(e){Ys(e,`basename`),Js(e,`basename`),this.path=Ns.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?Ns.dirname(this.path):void 0}set dirname(e){Xs(this.basename,`dirname`),this.path=Ns.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?Ns.extname(this.path):void 0}set extname(e){if(Js(e,`extname`),Xs(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=Ns.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){Us(e)&&(e=Ws(e)),Ys(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?Ns.basename(this.path,this.extname):void 0}set stem(e){Ys(e,`stem`),Js(e,`stem`),this.path=Ns.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new R(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function Js(e,t){if(e&&e.includes(Ns.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+Ns.sep+"`")}function Ys(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function Xs(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function Zs(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var Qs=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),$s={}.hasOwnProperty,ec=new class e extends Qs{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=js()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,ks.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(rc(`data`,this.frozen),this.namespace[e]=t,this):$s.call(this.namespace,e)&&this.namespace[e]||void 0:e?(rc(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=oc(e),n=this.parser||this.Parser;return tc(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),tc(`process`,this.parser||this.Parser),nc(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=oc(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);cc(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),tc(`processSync`,this.parser||this.Parser),nc(`processSync`,this.compiler||this.Compiler),this.process(e,r),ac(`processSync`,`process`,t),n;function r(e,r){t=!0,Os(e),n=r}}run(e,t,n){ic(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=oc(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),ac(`runSync`,`run`,n),r;function i(e,t){Os(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=oc(t),r=this.compiler||this.Compiler;return nc(`stringify`,r),ic(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(rc(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,ks.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];As(o)&&As(r)&&(r=(0,ks.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function tc(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function nc(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function rc(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function ic(e){if(!As(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function ac(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function oc(e){return sc(e)?e:new qs(e)}function sc(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function cc(e){return typeof e==`string`||lc(e)}function lc(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var uc=[],dc={allowDangerousHtml:!0},fc=/^(https?|ircs?|mailto|xmpp)$/i,pc=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function mc(e){let t=hc(e),n=gc(e);return _c(t.runSync(t.parse(n),n),e)}function hc(e){let t=e.rehypePlugins||uc,n=e.remarkPlugins||uc,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...dc}:dc;return ec().use(lo).use(n).use(Ds,r).use(t)}function gc(e){let t=e.children||``,n=new qs;return typeof t==`string`?n.value=t:``+t,n}function _c(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||vc;for(let e of pc)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return _s(e,l),Gn(e,{Fragment:N.Fragment,components:i,ignoreInvalidStyle:!0,jsx:N.jsx,jsxs:N.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in pr)if(Object.hasOwn(pr,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=pr[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function vc(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||fc.test(e.slice(0,t))?e:``}function yc(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function bc(e,t,n){let r=os((n||{}).ignore||[]),i=xc(t),a=-1;for(;++a<i.length;)hs(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function xc(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([Sc(e[0]),Cc(e[1])])}return t}function Sc(e){return typeof e==`string`?new RegExp(yc(e),`g`):e}function Cc(e){return typeof e==`function`?e:function(){return e}}function wc(e){bc(e,[/\r?\n|\r/g,Tc])}function Tc(){return{type:`break`}}function Ec(){return function(e){wc(e)}}function Dc(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}var Oc=`phrasing`,kc=[`autolink`,`link`,`image`,`label`];function Ac(){return{transforms:[Rc],enter:{literalAutolink:Mc,literalAutolinkEmail:Nc,literalAutolinkHttp:Nc,literalAutolinkWww:Nc},exit:{literalAutolink:Lc,literalAutolinkEmail:Ic,literalAutolinkHttp:Pc,literalAutolinkWww:Fc}}}function jc(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:Oc,notInConstruct:kc},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:Oc,notInConstruct:kc},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:Oc,notInConstruct:kc}]}}function Mc(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function Nc(e){this.config.enter.autolinkProtocol.call(this,e)}function Pc(e){this.config.exit.autolinkProtocol.call(this,e)}function Fc(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function Ic(e){this.config.exit.autolinkEmail.call(this,e)}function Lc(e){this.exit(e)}function Rc(e){bc(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,zc],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,Bc]],{ignore:[`link`,`linkReference`]})}function zc(e,t,n,r,i){let a=``;if(!Uc(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!Vc(n)))return!1;let o=Hc(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function Bc(e,t,n,r){return!Uc(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function Vc(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function Hc(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=Dc(e,`(`),a=Dc(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function Uc(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||Fr(n)||Pr(n))&&(!t||n!==47)}$c.peek=Qc;function Wc(){this.buffer()}function Gc(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function Kc(){this.buffer()}function qc(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function Jc(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Or(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Yc(e){this.exit(e)}function Xc(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Or(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Zc(e){this.exit(e)}function Qc(){return`[`}function $c(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function el(){return{enter:{gfmFootnoteCallString:Wc,gfmFootnoteCall:Gc,gfmFootnoteDefinitionLabelString:Kc,gfmFootnoteDefinition:qc},exit:{gfmFootnoteCallString:Jc,gfmFootnoteCall:Yc,gfmFootnoteDefinitionLabelString:Xc,gfmFootnoteDefinition:Zc}}}function tl(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:$c},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
16
+ `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?rl:nl))),s(),o}}function nl(e,t,n){return t===0?e:rl(e,t,n)}function rl(e,t,n){return(n?``:` `)+e}var il=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];ll.peek=ul;function al(){return{canContainEols:[`delete`],enter:{strikethrough:sl},exit:{strikethrough:cl}}}function ol(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:il}],handlers:{delete:ll}}}function sl(e){this.enter({type:`delete`,children:[]},e)}function cl(e){this.exit(e)}function ll(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function ul(){return`~`}function dl(e){return e.length}function fl(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||dl,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=pl(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=ml(r[d]);else{let e=ml(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding===!1||n.alignDelimiters===!1&&i===``||n.delimiterStart===!1&&!d||r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
17
+ `)}function pl(e){return e==null?``:String(e)}function ml(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}var hl=os([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function gl(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),_l);return i(),o}function _l(e,t,n){return`>`+(n?``:` `)+e}function vl(e,t){return yl(e,t.inConstruct,!0)&&!yl(e,t.notInConstruct,!1)}function yl(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function bl(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;){let e=n.unsafe[i];if(e.character===`
18
+ `&&!e.before&&!e.after&&vl(n.stack,e))return/[\t ]/.test(r.before)?``:` `}return`\\
19
+ `}function xl(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function Sl(e,t){return!(t.options.fences!==!1||!e.value||e.lang||!/[^\n\r ]/.test(e.value)||/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(e.value))}function Cl(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function wl(e,t,n,r){let i=Cl(n),a=e.value||``;if(Sl(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,Tl);return e(),t}let o=n.createTracker(r),s=i.repeat(Math.max(xl(a,i)+1,3)),c=n.enter(`codeFenced`),l=i==="`"?`GraveAccent`:`Tilde`,u=o.move(s);if(e.lang){let t=n.enter(`codeFencedLang${l}`);u+=o.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...o.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${l}`);u+=o.move(` `),u+=o.move(n.safe(e.meta,{before:u,after:`
20
+ `,encode:["`"],...o.current()})),t()}return u+=o.move(`
21
+ `),a&&(u+=o.move(a+`
22
+ `)),u+=o.move(s),c(),u}function Tl(e,t,n){return(n?``:` `)+e}function El(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Dl(e,t,n,r){let i=El(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
23
+ `,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function Ol(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}kl.attention=Al,kl.peek=jl;function kl(e,t,n,r){let i=n.enter(`phrasing`),a=n.containerPhrasing({type:`root`,children:[e]},r);return i(),a}function Al(e,t){return{construct:`emphasis`,markers:Ol(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[1]}}function jl(e,t,n){return n.options.emphasis||`*`}function Ml(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function Nl(e,t){let n=!1;return _s(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&hr(e)&&(t.options.setext||n))}function Pl(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(Nl(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
24
+ `,after:`
25
+ `});return r(),t(),o+`
26
+ `+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
27
+ `))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
28
+ `,...a.current()}),u=l.charCodeAt(0);return(u===9||u===32)&&(l=Ml(u)+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}Fl.peek=Il;function Fl(e){return e.value||``}function Il(){return`<`}Ll.peek=Rl;function Ll(e,t,n,r){let i=El(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function Rl(){return`!`}zl.peek=Bl;function zl(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function Bl(){return`!`}Vl.peek=Hl;function Vl(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^\n\r ]/.test(r)&&(/^[\n\r ]/.test(r)&&/[\n\r ]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e);if(!e.atBreak)continue;let i;for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function Hl(){return"`"}function Ul(e,t){let n=hr(e);return!(t.options.resourceLink||!e.url||e.title||!e.children||e.children.length!==1||e.children[0].type!==`text`||n!==e.url&&`mailto:`+n!==e.url||!/^[a-z][+\-.a-z]+:/i.test(e.url)||/[\0- <>\u007F]/.test(e.url))}Wl.peek=Gl;function Wl(e,t,n,r){let i=El(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r);if(Ul(e,n)){let t=n.stack;n.stack=t.filter(function(e){return e!==`phrasing`});let r=n.enter(`autolink`),i=o.move(`<`);return i+=o.move(n.containerPhrasing(e,{before:i,after:`>`,...o.current()})),i+=o.move(`>`),r(),n.stack=t,i}let s=n.enter(`link`),c=n.enter(`label`),l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function Gl(e,t,n){return Ul(e,n)?`<`:`[`}Kl.peek=ql;function Kl(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function ql(){return`[`}function Jl(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Yl(e){let t=Jl(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Xl(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Zl(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Ql(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?Xl(n):Jl(n),s=e.ordered?o===`.`?`)`:`.`:Yl(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if(o!==`*`&&o!==`-`||!t||t.children&&t.children[0]||n.stack[n.stack.length-1]!==`list`||n.stack[n.stack.length-2]!==`listItem`||n.stack[n.stack.length-3]!==`list`||n.stack[n.stack.length-4]!==`listItem`||n.indexStack[n.indexStack.length-1]!==0||n.indexStack[n.indexStack.length-2]!==0||n.indexStack[n.indexStack.length-3]!==0||(c=!0),Zl(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function $l(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function eu(e,t,n,r){let i=$l(n),a=n.bulletCurrent||Jl(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function tu(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}function nu(e,t,n,r){if(!e.children.some(function(e){return hl(e)}))return n.containerFlow(e,r);let i=n.enter(`phrasing`),a=n.containerPhrasing(e,r);return i(),a}function ru(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}iu.attention=au,iu.peek=ou;function iu(e,t,n,r){let i=n.enter(`phrasing`),a=n.containerPhrasing({type:`root`,children:[e]},r);return i(),a}function au(e,t){return{construct:`strong`,markers:ru(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[2]}}function ou(e,t,n){return n.options.strong||`*`}function su(e,t,n,r){return n.safe(e.value,r)}function cu(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function lu(e,t,n){let r=(Zl(n)+(n.options.ruleSpaces?` `:``)).repeat(cu(n));return n.options.ruleSpaces?r.slice(0,-1):r}var uu={blockquote:gl,break:bl,code:wl,definition:Dl,emphasis:kl,hardBreak:bl,heading:Pl,html:Fl,image:Ll,imageReference:zl,inlineCode:Vl,link:Wl,linkReference:Kl,list:Ql,listItem:eu,paragraph:tu,root:nu,strong:iu,text:su,thematicBreak:lu};function du(){return{enter:{table:fu,tableData:gu,tableHeader:gu,tableRow:mu},exit:{codeText:_u,table:pu,tableData:hu,tableHeader:hu,tableRow:hu}}}function fu(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function pu(e){this.exit(e),this.data.inTable=void 0}function mu(e){this.enter({type:`tableRow`,children:[]},e)}function hu(e){this.exit(e)}function gu(e){this.enter({type:`tableCell`,children:[]},e)}function _u(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,vu));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function vu(e,t){return t===`|`?t:e}function yu(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
29
+ `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
30
+ `))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return fl(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=uu.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function bu(){return{exit:{taskListCheckValueChecked:Su,taskListCheckValueUnchecked:Su,paragraph:Cu}}}function xu(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:wu}}}function Su(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function Cu(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function wu(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=uu.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function Tu(){return[Ac(),el(),al(),du(),bu()]}function Eu(e){return{extensions:[jc(),tl(e),ol(),yu(e),xu()]}}var Du={tokenize:Vu,partial:!0},Ou={tokenize:Hu,partial:!0},ku={tokenize:Uu,partial:!0},Au={tokenize:Wu,partial:!0},ju={tokenize:Gu,partial:!0},Mu={name:`wwwAutolink`,tokenize:zu,previous:Ku},Nu={name:`protocolAutolink`,tokenize:Bu,previous:qu},Pu={name:`emailAutolink`,tokenize:Ru,previous:Ju},Fu={};function Iu(){return{text:Fu}}for(var Lu=48;Lu<123;)Fu[Lu]=Pu,Lu++,Lu===58?Lu=65:Lu===91&&(Lu=97);Fu[43]=Pu,Fu[45]=Pu,Fu[46]=Pu,Fu[95]=Pu,Fu[72]=[Pu,Nu],Fu[104]=[Pu,Nu],Fu[87]=[Pu,Mu],Fu[119]=[Pu,Mu];function Ru(e,t,n){let r=this,i,a;return o;function o(t){return!Yu(t)||!Ju.call(r,r.previous)||Xu(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return Yu(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(ju,u,l)(t):t===45||t===95||B(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&z(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function zu(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!Ku.call(r,r.previous)||Xu(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(Du,e.attempt(Ou,e.attempt(ku,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function Bu(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&qu.call(r,r.previous)&&!Xu(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(z(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||Ar(t)||H(t)||Fr(t)||Pr(t)?n(t):e.attempt(Ou,e.attempt(ku,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function Vu(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function Hu(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(Au,c,s)(t):t===null||H(t)||Fr(t)||t!==45&&Pr(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function Uu(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(Au,t,a)(o):o===null||H(o)||Fr(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function Wu(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||H(o)||Fr(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||H(e)||Fr(e)?t(e):r(e)}function a(e){return z(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):z(t)?(e.consume(t),o):n(t)}}function Gu(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return B(e)?n(e):t(e)}}function Ku(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||H(e)}function qu(e){return!z(e)}function Ju(e){return!(e===47||Yu(e))}function Yu(e){return e===43||e===45||e===46||e===95||B(e)}function Xu(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var Zu={tokenize:ad,partial:!0};function Qu(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:nd,continuation:{tokenize:rd},exit:id}},text:{91:{name:`gfmFootnoteCall`,tokenize:td},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:$u,resolveTo:ed}}}}function $u(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=Or(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function ed(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function td(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||H(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(Or(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return H(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function nd(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||H(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=Or(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return H(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),W(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function rd(e,t,n){return e.check(ti,t,e.attempt(Zu,t,n))}function id(e){e.exit(`gfmFootnoteDefinition`)}function ad(e,t,n){let r=this;return W(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function od(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&xr(o,o.length,0,Jr(s,e.slice(r+1,n),t)),xr(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),xr(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=qr(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=qr(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var sd=class{constructor(){this.map=[],this.index=new Map}add(e,t,n){cd(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function cd(e,t,n,r){if(n===0&&r.length===0)return;let i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r);return}let a=[t,n,r];e.map.push(a),e.index.set(t,a)}function ld(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function ud(){return{flow:{null:{name:`table`,tokenize:dd,resolveAll:fd}}}}function dd(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let{type:e}=r.events[t][1];if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124||(o=!0,a+=1),u(e)}function u(t){return t===null?n(t):V(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):U(t)?W(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||H(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,U(t)?W(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return U(t)?W(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||V(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return U(t)?W(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||V(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||V(n)?(e.exit(`tableRow`),t(n)):U(n)?W(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||H(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function fd(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new sd;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(md(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=pd(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=pd(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=pd(f,t,o,i,n,d)):(o[0]=o[1],d=pd(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&md(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=ld(t.events,n))}return e}function pd(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},hd(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=hd(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=hd(t.events,n[2]),a=hd(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},hd(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function md(e,t,n,r,i){let a=[],o=hd(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function hd(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var gd={name:`tasklistCheck`,tokenize:vd};function _d(){return{text:{91:gd}}}function vd(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return H(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return V(r)?t(r):U(r)?e.check({tokenize:yd},t,n)(r):n(r)}}function yd(e,t,n){return W(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function bd(e){return wr([Iu(),Qu(),od(e),ud(),_d()])}var xd={};function Sd(e){let t=this,n=e||xd,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(bd(n)),a.push(Tu()),o.push(Eu(n))}function Cd(){let e=t=>{t.type===`html`&&(t.type=`text`),t.children?.forEach(e)};return e}var wd=/^(https?:|mailto:)/i,Td=e=>wd.test(e.trim())?e:``,Ed={a:({href:e,children:t})=>e?(0,N.jsx)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,children:t}):(0,N.jsx)(`span`,{className:`md-deadlink`,children:t}),img:({src:e,alt:t})=>typeof e==`string`&&e?(0,N.jsxs)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,children:[`🖼 `,t||e]}):(0,N.jsxs)(`span`,{children:[`🖼 `,t]}),table:({children:e})=>(0,N.jsx)(`div`,{className:`md-table`,tabIndex:0,children:(0,N.jsx)(`table`,{children:e})}),pre:({children:e})=>(0,N.jsx)(`pre`,{tabIndex:0,children:e})},Dd=[Sd,Cd,Ec];function Od({text:e,className:t}){return(0,N.jsx)(`div`,{className:t?`md ${t}`:`md`,children:(0,N.jsx)(mc,{remarkPlugins:Dd,components:Ed,urlTransform:Td,children:e})})}function kd({value:e,onChange:t,className:n,onKeyDown:r,...i}){let a=(0,M.useRef)(null);return(0,M.useLayoutEffect)(()=>{let e=a.current;e&&(e.style.height=`auto`,e.style.height=`${e.scrollHeight+e.offsetHeight-e.clientHeight}px`)},[e]),(0,N.jsx)(`textarea`,{...i,ref:a,rows:1,enterKeyHint:`send`,className:`msg-box ${n??``}`,value:e,onChange:e=>t(e.target.value),onKeyDown:e=>{if(r?.(e),e.defaultPrevented||e.key!==`Enter`||e.shiftKey||e.nativeEvent.isComposing||e.keyCode===229)return;e.preventDefault();let t=e.currentTarget.form,n=t?.querySelector(`button:not([type="button"])`);t&&!n?.disabled&&t.requestSubmit()}})}function Ad(e,t,n){return t?e.state===`transcribing`?`Turning your words into text…`:e.state===`listening`?e.live?e.mode===`handsfree`?`🎧 Listening… just talk`:e.mode===`tap`?`Listening… stop talking or tap 🎙️ to finish`:`Listening… let go to finish`:`Starting the mic…`:``:n?`🎧 Listening in a moment…`:``}function jd({kind:e,value:t,onChange:n,onSend:r,disabled:i}){let a=j(),o=(0,M.useId)(),s=(0,M.useRef)(null),c=(0,M.useRef)({value:t,onChange:n,onSend:r,disabled:i});c.current={value:t,onChange:n,onSend:r,disabled:i};let l=E(e=>e.settings.listen?.provider??`off`);E(e=>e.voiceKeySet);let u=Ce(),d=(0,M.useRef)(null),f=Se(`talk`);if((0,M.useEffect)(()=>Ae({id:o,kind:e,form:()=>s.current?.form??null,text:()=>c.current.value,setText:e=>c.current.onChange(e),send:e=>c.current.onSend(e),disabled:()=>!!c.current.disabled}),[o,e,l]),(0,M.useEffect)(()=>{let e=s.current?.form;if(!e)return;let t=()=>Me(o);return e.addEventListener(`submit`,t,!0),()=>e.removeEventListener(`submit`,t,!0)},[o,l]),(0,M.useEffect)(()=>{i&&Me(o)},[i,o]),l===`off`)return null;let p=Oe(),m=u.target===o,h=m?u.state:`idle`,g=h===`listening`,_=g&&!u.live,v=e===`phone`&&u.chiming,y=()=>{if(!i){if(p)return we(o,`hold`);if(h===`listening`||h===`transcribing`)return je(o);d.current=performance.now(),we(o,`hold`)}},b=()=>{let e=d.current;d.current=null,e!==null&&(performance.now()-e<300?ke(o):je(o))},x=Ad(u,m,v),S=p||(g?a(`Listening: Esc stops`):a(`Hold to talk (or hold {key}); tap to talk until you stop`,{key:f}));return(0,N.jsxs)(`span`,{className:`mic`,children:[x&&(0,N.jsxs)(`span`,{className:`mic-status small`,role:`status`,children:[a(x),g&&!_&&(0,N.jsxs)(N.Fragment,{children:[` `,`· `,(0,N.jsx)(`kbd`,{children:`Esc`})]})]}),(0,N.jsx)(`button`,{type:`button`,ref:s,className:`mic-btn ${g&&!_||v?`mic-on`:``} ${_||h===`transcribing`?`mic-busy`:``} ${p?`mic-cant`:``}`,"aria-label":a(g?`Stop listening`:`Talk instead of type`),"aria-pressed":g,title:S,disabled:i,onPointerDown:e=>{e.button===0&&(e.preventDefault(),e.currentTarget.setPointerCapture?.(e.pointerId),y())},onPointerUp:b,onPointerCancel:b,onKeyDown:e=>{e.key!==` `&&e.key!==`Enter`||e.repeat||(e.preventDefault(),y())},onKeyUp:e=>{(e.key===` `||e.key===`Enter`)&&(e.preventDefault(),b())},children:h===`transcribing`?`⏳`:`🎙️`})]})}function Md(){E.getState().openOverlay(null)}function Nd({title:e,children:t,wide:n,accent:r,className:i,onClose:a}){let o=(0,M.useRef)(null),s=(0,M.useId)(),c=j();return me(o),(0,M.useEffect)(()=>{let e=e=>{e.key===`Escape`&&(e.preventDefault(),a?a():Md())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[a]),(0,N.jsx)(`div`,{className:`overlay`,onMouseDown:e=>e.target===e.currentTarget&&(a?a():Md()),children:(0,N.jsxs)(`div`,{ref:o,className:`panel ${n?`panel-wide`:``} ${i??``}`,style:{"--accent":r??`#ff8a5b`},role:`dialog`,"aria-modal":`true`,"aria-labelledby":s,tabIndex:-1,children:[(0,N.jsxs)(`div`,{className:`panel-head`,children:[(0,N.jsx)(`h2`,{className:`panel-title`,id:s,children:typeof e==`string`?c(e):e}),(0,N.jsx)(`button`,{className:`panel-x`,onClick:()=>a?a():Md(),"aria-label":c(`Close`),children:`✕`})]}),(0,N.jsx)(`div`,{className:`panel-body`,children:t})]})})}function Pd({action:e}){return(0,N.jsx)(`kbd`,{children:Se(e)})}var Fd=[`forward`,`left`,`back`,`right`];function Id({joined:e=!1}){let t=be(e=>Fd.map(t=>e.bindings[t][0]?xe(e.bindings[t][0]):`—`).join(`\0`)).split(`\0`);return e&&t.every(e=>e.length===1)?(0,N.jsx)(`kbd`,{children:t.join(``)}):(0,N.jsx)(N.Fragment,{children:t.map((e,t)=>(0,N.jsx)(`kbd`,{children:e},t))})}function Ld({width:e,height:t,frame:n,onPointer:r,label:i}){let a=(0,M.useRef)(null),o=(0,M.useRef)(null),s=(0,M.useRef)(n),c=(0,M.useRef)(r);(0,M.useEffect)(()=>{s.current=n,c.current=r}),(0,M.useEffect)(()=>{let n=a.current,r=o.current;if(!n||!r)return;let i=1,c=()=>{let a=getComputedStyle(n),o=n.clientWidth-parseFloat(a.paddingLeft)-parseFloat(a.paddingRight),s=n.clientHeight-parseFloat(a.paddingTop)-parseFloat(a.paddingBottom),c=Math.max(.4,Math.min(o/e,s/t,1.5)),l=Math.min(2,window.devicePixelRatio||1);r.style.width=`${Math.floor(e*c)}px`,r.style.height=`${Math.floor(t*c)}px`,r.width=Math.round(e*c*l),r.height=Math.round(t*c*l),i=r.width/e};c();let l=new ResizeObserver(c);l.observe(n);let u=0,d=performance.now(),f=n=>{let a=Math.min(.1,Math.max(0,(n-d)/1e3));d=n;let o=r.getContext(`2d`);o&&(o.setTransform(i,0,0,i,0,0),o.clearRect(0,0,e,t),s.current(o,a,n)),u=requestAnimationFrame(f)};return u=requestAnimationFrame(f),()=>{cancelAnimationFrame(u),l.disconnect()}},[e,t]);let l=(n,r)=>{let i=n.currentTarget.getBoundingClientRect();c.current?.(r,(n.clientX-i.left)/i.width*e,(n.clientY-i.top)/i.height*t)};return(0,N.jsx)(`div`,{ref:a,className:`game-canvas-wrap`,children:(0,N.jsx)(`canvas`,{ref:o,className:`game-canvas`,role:`img`,"aria-label":i,onPointerDown:e=>{e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),l(e,`down`)},onPointerMove:e=>e.buttons&&l(e,`move`),onPointerUp:e=>l(e,`up`)})})}function Rd(e){let t=(0,M.useRef)(e);(0,M.useEffect)(()=>{t.current=e}),(0,M.useEffect)(()=>{let e=e=>{e.ctrlKey||e.metaKey||e.altKey||_e()||e.code===`Escape`||Te(`phone`,e.code)||e.target?.closest?.(`input, textarea, select, [contenteditable="true"]`)||t.current(e)&&(e.preventDefault(),e.stopPropagation())};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[])}function zd({title:e,color:t,onBack:n,children:r}){let i=j();return(0,N.jsxs)(`div`,{className:`game-head`,style:{"--game":t},children:[(0,N.jsx)(`button`,{type:`button`,className:`game-back`,onClick:n,title:i(`Back to the games (Backspace)`),children:(0,N.jsx)(A,{children:`‹ Games`})}),(0,N.jsx)(`b`,{className:`game-title`,children:e}),(0,N.jsx)(`span`,{className:`game-head-right`,children:r})]})}function Bd(e){switch(e){case`ArrowUp`:case`KeyW`:return`up`;case`ArrowDown`:case`KeyS`:return`down`;case`ArrowLeft`:case`KeyA`:return`left`;case`ArrowRight`:case`KeyD`:return`right`}return null}var Vd=e=>e===`Space`||e===`Enter`||e===`NumpadEnter`;function Hd(e){let t=(0,M.useRef)(e);(0,M.useEffect)(()=>{t.current=e}),(0,M.useEffect)(()=>{let e=()=>t.current(),n=()=>document.hidden&&e();return window.addEventListener(`blur`,e),document.addEventListener(`visibilitychange`,n),()=>{window.removeEventListener(`blur`,e),document.removeEventListener(`visibilitychange`,n)}},[])}function Ud({onPress:e,repeat:t,label:n,className:r,children:i}){let a=(0,M.useRef)(null),o=(0,M.useRef)(e);(0,M.useEffect)(()=>{o.current=e});let s=()=>{a.current&&clearTimeout(a.current),a.current=null};return(0,M.useEffect)(()=>s,[]),(0,N.jsx)(`button`,{type:`button`,tabIndex:-1,className:`game-pad ${r??``}`,"aria-label":n,title:n,onPointerDown:e=>{if(e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),o.current(),!t)return;s();let n=e=>{a.current=setTimeout(()=>{o.current(),n(70)},e)};n(190)},onPointerUp:s,onPointerCancel:s,onLostPointerCapture:s,children:i})}var K=`#1f1d2b`,Wd=`#fffdf6`,Gd=`#6c7086`,q=[`#ff8a5b`,`#4fb3e8`,`#8fd14f`,`#c77dff`,`#ffc93c`,`#ff6fb5`,`#2ec4b6`,`#f25f5c`];function J(e,t,n,r,i,a,o=Math.min(r,i)*.24,s=2){w(e,t+s/2,n+s/2,r-s,i-s,o),e.fillStyle=a,e.fill(),e.save(),e.clip(),e.fillStyle=`rgba(255,255,255,0.38)`,e.fillRect(t,n,r,i*.26),e.fillStyle=`rgba(0,0,0,0.13)`,e.fillRect(t,n+i*.74,r,i*.26),e.restore(),e.lineWidth=s,e.strokeStyle=K,e.stroke()}function Kd(e,t,n,r,i,a=`#ffffff`,o=10){w(e,t,n+3,r,i,o),e.fillStyle=K,e.fill(),w(e,t,n,r,i,o),e.fillStyle=a,e.fill(),e.lineWidth=2.5,e.strokeStyle=K,e.stroke()}function qd(e,t,n,r,i,a=K,o=700,s=`center`){e.font=`${o} ${i}px ${ee}`,e.fillStyle=a,e.textAlign=s,e.textBaseline=`middle`,e.fillText(t,n,r)}function Jd(e,t,n,r,i,a){e.font=`700 ${i}px ${ee}`,e.textAlign=`center`,e.textBaseline=`middle`,e.lineJoin=`round`,e.lineWidth=Math.max(3,i/5),e.strokeStyle=K,e.strokeText(t,n,r),e.fillStyle=a,e.fillText(t,n,r)}function Yd(e,t,n,r,i,a=0,o=0,s=!1){for(let c of[-1,1]){let l=t+c*r/2;s?(e.beginPath(),e.moveTo(l-i,n),e.quadraticCurveTo(l,n+i*.6,l+i,n),e.lineWidth=Math.max(1.5,i*.35),e.lineCap=`round`,e.strokeStyle=K,e.stroke()):(e.beginPath(),e.ellipse(l,n,i,i*1.15,0,0,Math.PI*2),e.fillStyle=`#ffffff`,e.fill(),e.lineWidth=Math.max(1.2,i*.28),e.strokeStyle=K,e.stroke(),e.beginPath(),e.arc(l+a*i*.35,n+o*i*.35,i*.52,0,Math.PI*2),e.fillStyle=K,e.fill(),e.beginPath(),e.arc(l+a*i*.35-i*.18,n+o*i*.35-i*.2,i*.16,0,Math.PI*2),e.fillStyle=`#ffffff`,e.fill())}}function Xd(e,t){let n=parseInt(e.slice(1),16),[r,i,a]=[n>>16&255,n>>8&255,n&255].map(e=>Math.round(t>=0?e+(255-e)*t:e*(1+t)));return`#${(1<<24|r<<16|i<<8|a).toString(16).slice(1)}`}function Zd(e,t,n,r,i=12,a=120){for(let o=0;o<i;o++){let i=Math.random()*Math.PI*2,s=a*(.4+Math.random()*.8);e.push({x:t,y:n,vx:Math.cos(i)*s,vy:Math.sin(i)*s-a*.4,life:.6+Math.random()*.4,color:r[o%r.length],size:3+Math.random()*3})}}function Qd(e,t,n,r,i,a=18){e.push({x:t,y:n,vx:0,vy:-40,life:1.1,color:i,size:a,text:r})}function $d(e,t,n){for(let r=t.length-1;r>=0;r--){let i=t[r];i.life-=n,i.life<=0?t.splice(r,1):(i.x+=i.vx*n,i.y+=i.vy*n,i.text||(i.vy+=320*n),e.globalAlpha=Math.min(1,i.life*2),i.text?Jd(e,i.text,i.x,i.y,i.size,i.color):(e.fillStyle=i.color,e.fillRect(i.x-i.size/2,i.y-i.size/2,i.size,i.size),e.lineWidth=1,e.strokeStyle=K,e.strokeRect(i.x-i.size/2,i.y-i.size/2,i.size,i.size)),e.globalAlpha=1)}}function ef(e,t,n,r,i,a){e.fillStyle=`rgba(31,29,43,0.45)`,e.fillRect(0,0,t,n);let o=Math.min(t-36,250),s=70+i.length*22,c=(t-o)/2,l=(n-s)/2;Kd(e,c,l,o,s,Wd,16),e.save(),e.clip(),e.fillStyle=a,e.fillRect(c,l,o,10),e.restore(),e.stroke();let u=(t,n,r)=>{e.font=`${r} ${n}px ${ee}`;let i=e.measureText(t).width;return i>o-24?n*(o-24)/i:n};Jd(e,r,t/2,l+36,u(r,24,700),a),i.forEach((n,r)=>{let a=r===i.length-1;qd(e,n,t/2,l+68+r*22,u(n,a?13:15,a?600:700),a?Gd:K,a?600:700)})}var tf=36e5,nf=720*tf,rf={awake:{food:-12,fun:-10,energy:-7},asleep:{food:-5,fun:-3,energy:35}},af=[`Cubey`,`Pixel`,`Widget`,`Sprocket`,`Nugget`,`Mochi`,`Byte`,`Tofu`],of=[`#ff8a5b`,`#4fb3e8`,`#8fd14f`,`#c77dff`,`#ffc93c`,`#ff6fb5`,`#2ec4b6`],sf=[{xp:0,title:`Intern`},{xp:12,title:`Junior`},{xp:40,title:`Senior`},{xp:90,title:`Tech Lead`}],cf=e=>Math.max(0,Math.min(100,e));function lf(e){let t=0;for(;t+1<sf.length&&e>=sf[t+1].xp;)t++;return t}function uf(e,t,n){let r=af[Math.floor(t*af.length)%af.length];return{v:1,name:r,color:of[Math.floor(n*of.length)%of.length],born:e,at:e,food:80,fun:80,energy:80,asleep:!1,xp:0,coffeeAt:0,pettedAt:0,say:{text:`Hi! I'm ${r}, your new desk pet. Keep me fed, busy and rested!`,at:e}}}function df(e,t){let n=Math.min(Math.max(0,t-e.at),nf)/tf,{food:r,fun:i,energy:a,asleep:o}=e;for(let e=0;n>0&&e<1e3;e++){let e=o?rf.asleep:rf.awake,t=o?(100-a)/e.energy:a/-e.energy,s=Math.min(n,t);r=cf(r+e.food*s),i=cf(i+e.fun*s),a=cf(a+e.energy*s),n-=s,s===t&&(o=!o)}return{...e,at:Math.max(t,e.at),food:r,fun:i,energy:a,asleep:o}}function ff(e){return e.asleep?`asleep`:[e.food,e.fun,e.energy].filter(e=>e<25).length>=2||Math.min(e.food,e.fun,e.energy)<=0?`grumpy`:e.food<25?`hungry`:e.energy<25?`tired`:e.fun<25?`bored`:e.food+e.fun+e.energy>=210?`happy`:`content`}var pf={asleep:`Zzz… 💤`,happy:`Best. Job. Ever. ✨`,content:`Just vibing at my desk.`,hungry:`I'm hungry… got a donut? 🍩`,bored:`I'm bored. Play with me? 🎾`,tired:`So… sleepy… 🥱`,grumpy:`Hmph. Nobody looks after me. 😤`},mf=(e,t)=>e[Math.floor(t/1e3)%e.length];function hf(e,t,n){let r=df(e,n),i=gf(r,t,n);return i===r?r:lf(i.xp)>lf(r.xp)?{...i,fun:cf(i.fun+10),say:{text:`Promoted to ${sf[lf(i.xp)].title}! 🎉`,at:n}}:i}function gf(e,t,n){let r=e=>({text:e,at:n}),i=(t,n)=>({...e,food:cf(e.food+(t.food??0)),fun:cf(e.fun+(t.fun??0)),energy:cf(e.energy+(t.energy??0)),xp:e.xp+(t.xp??0),say:r(n)});if(t===`nap`)return e.asleep?e.energy<40?{...i({fun:-4},`Five more minutes… 😒`),asleep:!1}:{...i({},`Good morning! ☀️`),asleep:!1}:e.energy>=90?i({},`I'm not sleepy!`):{...i({xp:+(e.energy<50)},`Nap time… 💤`),asleep:!0};if(e.asleep)return t===`pet`?e:i({},`Zzz… (shh, still asleep) 💤`);switch(t){case`snack`:return e.food>=90?i({fun:-2},`I'm stuffed! No more donuts.`):i({food:30,fun:3,xp:1},mf([`Nom nom nom! 🍩`,`Sprinkles! My favourite.`,`Donut-driven development!`],n));case`coffee`:return n-e.coffeeAt<6e5?i({energy:5,fun:-6},`Too… much… coffee! 😵‍💫`):{...i({energy:25,food:3,xp:1},mf([`☕ Ready to ship!`,`Caffeine: loaded.`,`Brb, refactoring everything.`],n)),coffeeAt:n};case`play`:return e.energy<15?i({},`Too tired to play… 🥱`):i({fun:25,energy:-10,food:-6,xp:1},mf([`Wheee! 🎾`,`Again! Again!`,`Best. Break. Ever.`],n));case`pet`:return n-e.pettedAt<3e3?e:{...i({fun:3},mf([`Hehe ❤️`,`*happy wiggle*`,`You're the best manager!`],n)),pettedAt:n}}return e}function _f(e,t,n){let r=df(e,n);return{...r,fun:cf(r.fun+8),xp:r.xp+1,say:{text:t,at:n}}}function vf(e){if(!e||typeof e!=`object`)return null;let t=e,n=[t.born,t.at,t.food,t.fun,t.energy,t.xp,t.coffeeAt,t.pettedAt];if(t.v!==1||typeof t.name!=`string`||typeof t.color!=`string`||typeof t.asleep!=`boolean`||!n.every(e=>typeof e==`number`&&Number.isFinite(e)))return null;let r=t.say&&typeof t.say.text==`string`&&typeof t.say.at==`number`?{text:t.say.text,at:t.say.at}:null;return{...t,food:cf(t.food),fun:cf(t.fun),energy:cf(t.energy),say:r}}function yf(e){try{return JSON.parse(a.getItem(e)??`null`)}catch{return null}}function bf(e,t){try{a.setItem(e,JSON.stringify(t))}catch{}}var xf=`droidsembly:games:best`;function Sf(e){let t=yf(xf),n=Number(t?.[e]);return Number.isFinite(n)&&n>0?n:0}function Cf(e,t){if(t<=Sf(e))return!1;let n=yf(xf);return bf(xf,{...n&&typeof n==`object`?n:{},[e]:t}),!0}var wf=`droidsembly:games:pet`,Tf=vf(yf(wf)),Ef=new Set,Df=()=>Ef.forEach(e=>e()),Of=()=>Tf;function kf(e){Tf=e,bf(wf,e),Df()}function Af(e){return Ef.add(e),()=>void Ef.delete(e)}function jf(e){return e.task===`qa`?`Yay! ${e.name} finished testing${e.prNumber?` PR #${e.prNumber}`:` a PR`}! 🧪`:e.task===`fix`?`Yay! ${e.name} fixed${e.prNumber?` PR #${e.prNumber}`:` a PR`}! 🔧`:e.issueNumber?`Yay! ${e.name} finished issue #${e.issueNumber}! 🎉`:`Yay! ${e.name} finished a job! 🎉`}E.subscribe((e,t)=>{if(Tf&&t.loaded&&e.agents!==t.agents)for(let n of Object.values(e.agents)){let e=t.agents[n.id];n.role!==`ceo`&&n.status===`done`&&e&&e.status!==`done`&&kf(_f(Tf,jf(n),Date.now()))}}),window.addEventListener(`storage`,e=>{if(!r(e.key,wf))return;let t=vf(yf(wf));JSON.stringify(t)!==JSON.stringify(Tf)&&(Tf=t,Df())});var Y={move:()=>y({freq:420,type:`square`,dur:.03,peak:.012}),rotate:()=>y({freq:560,to:700,type:`triangle`,dur:.06,peak:.04}),land:()=>{f({dur:.07,peak:.07,freq:500,q:.8}),y({freq:180,to:120,type:`triangle`,dur:.08,peak:.05})},lines:e=>[659,784,988,1318.5].slice(0,Math.max(2,e+1)).forEach((e,t)=>y({freq:e,type:`triangle`,at:t*.06,dur:.22,peak:.07})),levelUp:()=>[523,659,784,1046.5].forEach((e,t)=>y({freq:e,type:`square`,at:t*.08,dur:.14,peak:.03})),over:()=>{y({freq:392,to:370,type:`triangle`,dur:.22,peak:.1}),y({freq:311,to:156,type:`triangle`,at:.22,dur:.6,peak:.1})},best:()=>[784,988,1175,1568].forEach((e,t)=>y({freq:e,type:`triangle`,at:.5+t*.07,dur:.28,peak:.08})),chomp:()=>y({freq:300,to:620,type:`square`,dur:.07,peak:.035}),slurp:()=>{f({dur:.2,peak:.05,filter:`bandpass`,freq:400,to:2200,q:2,attack:.03}),y({freq:523,to:1046,type:`triangle`,at:.12,dur:.16,peak:.06})},start:()=>[523,784].forEach((e,t)=>y({freq:e,type:`triangle`,at:t*.08,dur:.14,peak:.07})),pause:()=>y({freq:660,to:440,type:`triangle`,dur:.12,peak:.05}),happy:()=>{y({freq:660,to:1320,type:`square`,dur:.1,peak:.03}),y({freq:1320,to:990,type:`triangle`,at:.1,dur:.12,peak:.07})},nom:()=>[0,.12,.24].forEach(e=>y({freq:250,to:180,type:`triangle`,at:e,dur:.08,peak:.06})),boing:()=>y({freq:220,to:660,type:`sine`,dur:.25,peak:.1}),snore:()=>y({freq:140,to:90,type:`sine`,dur:.6,peak:.05,attack:.2}),grumble:()=>y({freq:160,to:120,type:`sawtooth`,dur:.25,peak:.025})},Mf=[...Object.values(pf),`Five more minutes… 😒`,`Good morning! ☀️`,`I'm not sleepy!`,`Nap time… 💤`,`Zzz… (shh, still asleep) 💤`,`I'm stuffed! No more donuts.`,`Nom nom nom! 🍩`,`Sprinkles! My favourite.`,`Donut-driven development!`,`Too… much… coffee! 😵‍💫`,`☕ Ready to ship!`,`Caffeine: loaded.`,`Brb, refactoring everything.`,`Too tired to play… 🥱`,`Wheee! 🎾`,`Again! Again!`,`Best. Break. Ever.`,`Hehe ❤️`,`*happy wiggle*`,`You're the best manager!`];function Nf(e,t,n){if(n!==`it`)return e;if(Mf.some(t=>t===e))return O(n,e);if(e===`Hi! I'm ${t}, your new desk pet. Keep me fed, busy and rested!`)return O(n,`Hi! I’m {name}, your new desk pet. Keep me fed, busy and rested!`,{name:t});for(let{title:t}of sf)if(e===`Promoted to ${t}! 🎉`)return O(n,`Promoted to {stage}! 🎉`,{stage:O(n,t)});return e}var Pf=`#ff6fb5`,X=320,Ff=260,If=212,Lf=[52,60,68,74],Rf=1.4,zf=Date.now(),Bf=[{action:`snack`,icon:`🍩`,label:`Snack`,key:`1`},{action:`coffee`,icon:`☕`,label:`Coffee`,key:`2`},{action:`play`,icon:`🎾`,label:`Play`,key:`3`},{action:`nap`,icon:`💤`,label:`Nap`,key:`4`}];function Vf(e,t){let n=t.size,r=-n,i=Math.max(2,n/22),a=Xd(t.color,-.3);e.lineCap=`round`,e.lineJoin=`round`,e.fillStyle=`rgba(31,29,43,0.16)`,e.beginPath(),e.ellipse(0,2,n*.46,n*.07,0,0,Math.PI*2),e.fill();for(let o of[-1,1])e.beginPath(),e.ellipse(o*n*.22,-3,n*.14,n*.08,0,0,Math.PI*2),e.fillStyle=a,e.fill(),e.lineWidth=i,e.strokeStyle=K,e.stroke(),e.beginPath(),t.arms?e.ellipse(o*n*.52,r+n*.3,n*.09,n*.15,o*.5,0,Math.PI*2):e.ellipse(o*n*.5,r+n*.62,n*.09,n*.14,-o*.35,0,Math.PI*2),e.fillStyle=t.color,e.fill(),e.stroke();J(e,-n/2,r,n,n-4,t.color,n*.3,i*1.3);let o=r+n*.4,s=n*.36,c=n*.1,l=t.mood===`asleep`;if(Yd(e,0,o,s,c,0,t.mood===`hungry`?.5:.1,l||t.blink),t.mood===`tired`&&!t.blink)for(let n of[-1,1])e.beginPath(),e.ellipse(n*s/2,o,c*1.12,c*1.3,0,Math.PI,Math.PI*2),e.fillStyle=Xd(t.color,-.08),e.fill(),e.lineWidth=i*.8,e.strokeStyle=K,e.beginPath(),e.moveTo(n*s/2-c*1.1,o),e.lineTo(n*s/2+c*1.1,o),e.stroke();if(t.mood===`grumpy`){e.lineWidth=i*1.1,e.strokeStyle=K;for(let t of[-1,1])e.beginPath(),e.moveTo(t*(s/2+c*1.2),o-c*2),e.lineTo(t*(s/2-c*.9),o-c*1.3),e.stroke()}if(t.stage>=2){e.lineWidth=i*.9,e.strokeStyle=K;for(let t of[-1,1])e.beginPath(),e.roundRect(t*s/2-c*1.6,o-c*1.5,c*3.2,c*3,c*.6),e.stroke();e.beginPath(),e.moveTo(-s/2+c*1.6,o-c*.4),e.lineTo(s/2-c*1.6,o-c*.4),e.stroke()}e.fillStyle=`rgba(255,111,181,0.45)`;for(let t of[-1,1])e.beginPath(),e.ellipse(t*n*.3,r+n*.58,n*.075,n*.045,0,0,Math.PI*2),e.fill();let u=r+n*.62,d=n*.12;e.lineWidth=i,e.strokeStyle=K,e.fillStyle=K,e.beginPath(),t.open||t.mood===`hungry`?(e.ellipse(0,u+1,d*.55,d*.65,0,0,Math.PI*2),e.fill()):t.mood===`happy`?(e.arc(0,u-1,d,0,Math.PI),e.closePath(),e.fill(),e.beginPath(),e.ellipse(0,u+d*.55,d*.5,d*.3,0,0,Math.PI*2),e.fillStyle=`#ff8fa3`,e.fill()):t.mood===`content`?(e.arc(0,u-d*.6,d,Math.PI*.15,Math.PI*.85),e.stroke()):t.mood===`grumpy`?(e.arc(0,u+d*.9,d,Math.PI*1.2,Math.PI*1.8),e.stroke()):t.mood===`asleep`?(e.ellipse(0,u+1,d*.3,d*.35,0,0,Math.PI*2),e.fill()):t.mood===`tired`?(e.moveTo(-d,u+1),e.quadraticCurveTo(-d/2,u-2,0,u+1),e.quadraticCurveTo(d/2,u+4,d,u+1),e.stroke()):(e.moveTo(-d*.8,u+1),e.lineTo(d*.8,u+1),e.stroke());let f=r+n*.76;if(t.stage===0?(e.strokeStyle=`#4fb3e8`,e.lineWidth=i*.9,e.beginPath(),e.moveTo(-n*.2,r+n*.7),e.lineTo(0,f+n*.02),e.lineTo(n*.2,r+n*.7),e.stroke(),J(e,-n*.09,f,n*.18,n*.14,`#ffffff`,n*.03,i*.8),e.fillStyle=`#4fb3e8`,e.fillRect(-n*.06,f+n*.04,n*.12,n*.025)):(e.beginPath(),e.moveTo(-n*.05,f-n*.04),e.lineTo(n*.05,f-n*.04),e.lineTo(n*.035,f+n*.02),e.lineTo(n*.065,f+n*.15),e.lineTo(0,f+n*.2),e.lineTo(-n*.065,f+n*.15),e.lineTo(-n*.035,f+n*.02),e.closePath(),e.fillStyle=t.color===`#f25f5c`||t.color===`#ff6fb5`?`#2b2d42`:`#f25f5c`,e.fill(),e.lineWidth=i*.8,e.strokeStyle=K,e.stroke()),t.stage>=3){e.lineWidth=i*1.4,e.strokeStyle=K,e.beginPath(),e.arc(0,r+n*.4,n*.53,Math.PI*1.12,Math.PI*1.88),e.stroke();for(let t of[-1,1])J(e,t*n*.52-n*.08,r+n*.28,n*.16,n*.24,`#2b2d42`,n*.05,i*.8);e.lineWidth=i,e.beginPath(),e.moveTo(-n*.52,r+n*.5),e.quadraticCurveTo(-n*.4,u+n*.08,-d*1.6,u+2),e.stroke(),e.beginPath(),e.arc(-d*1.6,u+2,i*1.2,0,Math.PI*2),e.fillStyle=K,e.fill()}}function Hf(e,t,n,r,i){e.beginPath();for(let i=0;i<10;i++){let a=-Math.PI/2+i*Math.PI/5,o=i%2?r*.45:r;e.lineTo(t+Math.cos(a)*o,n+Math.sin(a)*o)}e.closePath(),e.fillStyle=i,e.fill(),e.lineWidth=2,e.strokeStyle=K,e.stroke()}function Uf(e,t,n,r,i=0){e.save(),e.translate(t,n),e.beginPath(),e.arc(0,0,r,i*Math.PI*1.5,Math.PI*2),e.arc(0,0,r*.38,Math.PI*2,i*Math.PI*1.5,!0),e.closePath(),e.fillStyle=`#e0ac69`,e.fill(),e.lineWidth=2,e.strokeStyle=K,e.stroke(),e.beginPath(),e.arc(0,0,r*.78,i*Math.PI*1.5,Math.PI*2),e.arc(0,0,r*.45,Math.PI*2,i*Math.PI*1.5,!0),e.fillStyle=`#ff8fc7`,e.fill(),[`#4fb3e8`,`#ffc93c`,`#8fd14f`,`#ffffff`].forEach((t,n)=>{let a=n*1.7+.4;a/(Math.PI*2)<i*.75||(e.fillStyle=t,e.fillRect(Math.cos(a)*r*.62-1.5,Math.sin(a)*r*.62-1,3,2))}),e.restore()}function Wf(e,t,n,r){e.lineWidth=2,e.strokeStyle=K,e.beginPath(),e.arc(t+9,n+8,5,-Math.PI/2,Math.PI/2),e.stroke(),J(e,t-9,n,18,18,`#ffffff`,4,2),e.beginPath(),e.ellipse(t,n+3,6.5,2,0,0,Math.PI*2),e.fillStyle=`#8d5524`,e.fill(),e.strokeStyle=`rgba(31,29,43,0.45)`,e.lineWidth=1.5;for(let i of[-3,3]){let a=(r/600+i/7)%1;e.globalAlpha=1-a,e.beginPath(),e.moveTo(t+i,n-3-a*10),e.quadraticCurveTo(t+i+3,n-6-a*10,t+i,n-9-a*10),e.stroke()}e.globalAlpha=1}function Gf(e,t,n,r){e.fillStyle=`#d6e2ef`,e.fillRect(0,0,X,If),e.fillStyle=`rgba(255,255,255,0.28)`;for(let t=6;t<X;t+=12)e.fillRect(t,12,1.5,200);e.fillStyle=`#b9c9dc`,e.fillRect(0,0,X,12),e.fillStyle=K,e.fillRect(0,12,X,2),J(e,16,58,76,52,`#d9a066`,6,2);for(let[t,n,r,i]of[[24,66,`#fff3b0`,-.08],[56,70,`#ffd6e8`,.1]]){e.save(),e.translate(t+13,n+13),e.rotate(i),e.fillStyle=r,e.fillRect(-13,-13,26,26),e.strokeStyle=K,e.lineWidth=1.5,e.strokeRect(-13,-13,26,26),e.strokeStyle=`rgba(31,29,43,0.4)`,e.lineWidth=1.2;for(let t=0;t<3;t++)e.beginPath(),e.moveTo(-8,-6+t*6),e.lineTo(8-t*4,-6+t*6),e.stroke();e.beginPath(),e.arc(0,-11,2.5,0,Math.PI*2),e.fillStyle=`#f25f5c`,e.fill(),e.restore()}J(e,232,54,66,60,`#ffffff`,5,2),qd(e,r(`EMPLOYEE`),265,64,7.5,K,700),qd(e,r(`OF THE MONTH`),265,73,7,K,700),Hf(e,265,93,13,n?`#ffc93c`:`#e3e7ee`);let i=new Date;e.beginPath(),e.arc(160,42,17,0,Math.PI*2),e.fillStyle=`#ffffff`,e.fill(),e.lineWidth=3,e.strokeStyle=K,e.stroke(),e.lineCap=`round`;for(let[t,n,r]of[[(i.getHours()%12+i.getMinutes()/60)/12,8,3],[(i.getMinutes()+i.getSeconds()/60)/60,12,2]]){let i=t*Math.PI*2-Math.PI/2;e.beginPath(),e.moveTo(160,42),e.lineTo(160+Math.cos(i)*n,42+Math.sin(i)*n),e.lineWidth=r,e.stroke()}e.beginPath(),e.arc(160,42,2.5,0,Math.PI*2),e.fillStyle=`#f25f5c`,e.fill(),e.fillStyle=`#d9b48a`,e.fillRect(0,224,X,36),e.fillStyle=K,e.fillRect(0,224,X,2),J(e,-6,If,332,14,`#f1d19b`,5,2.5),J(e,48,200,18,12,`#3d4152`,2,2),J(e,18,146,78,54,`#2b2d42`,7,2.5),e.fillStyle=`#1b1b29`,e.fillRect(25,153,64,40);let a=Math.floor(t/700);for(let t=0;t<5;t++){let n=a+t;e.fillStyle=q[n*3%q.length],e.fillRect(29+n%3*5,157+t*7,14+n*17%30,3)}e.lineWidth=2;for(let[t,n,r]of[[262,176,13],[276,168,11],[252,164,10]])e.beginPath(),e.arc(t,n,r,0,Math.PI*2),e.fillStyle=`#52b788`,e.fill(),e.strokeStyle=K,e.stroke();J(e,248,186,32,26,`#e07a5f`,5,2)}function Kf(e,t=1,n=e=>e){e.save(),e.scale(t,t),J(e,-38,-56,76,56,`#d9a066`,6,2.5),e.fillStyle=`rgba(241,209,155,0.9)`,e.fillRect(-7,-55,14,54),J(e,-30,-34,38,16,`#ffffff`,3,1.5),qd(e,n(`NEW HIRE`),-11,-26,7.5,K,700),e.restore()}function qf(e,t,n,r){e.lineWidth=2,e.strokeStyle=K,e.fillStyle=`#ffffff`;for(let[r,i,a]of[[-16,22,3],[-10,14,5]])e.beginPath(),e.arc(t+r,n+i,a,0,Math.PI*2),e.fill(),e.stroke();e.beginPath(),e.ellipse(t+8,n-4,20,15,0,0,Math.PI*2),e.fill(),e.stroke(),e.save(),e.translate(t+8,n-4),r(),e.restore()}function Jf({onBack:e}){let t=j(),n=E(e=>e.settings.language),r=(0,M.useSyncExternalStore)(Af,Of),[i,a]=(0,M.useState)(Date.now()),o=(0,M.useRef)(null),s=(0,M.useRef)([]),c=(0,M.useRef)(0),l=(0,M.useRef)(r?.say?.at??0),[u]=(0,M.useState)(()=>Date.now()),[d]=(0,M.useState)(()=>r?.say&&r.say.at>zf&&u-r.say.at>5e3?r.say:null);(0,M.useEffect)(()=>{let e=setInterval(()=>a(Date.now()),1e3);return()=>{clearInterval(e),zf=Date.now()}},[]);let f=r?.say?.at??0;(0,M.useEffect)(()=>{f!==l.current&&(l.current=f,f!==c.current&&Date.now()-f<3e3&&(o.current={kind:`cheer`,t:0},Zd(s.current,X/2,152,q,16,140),Y.happy()))},[f]);let p=()=>{if(Of())return;let e=uf(Date.now(),Math.random(),Math.random());c.current=e.say?.at??0,o.current={kind:`hatch`,t:0},Zd(s.current,X/2,182,[`#d9a066`,`#f1d19b`,...q],22,170),Y.levelUp(),kf(e)},m=e=>{let t=Of();if(!t)return;let n=Date.now(),r=hf(t,e,n);r.say?.at===n&&(c.current=n),kf(r),a(n);let i=r.xp>t.xp,l=Lf[lf(r.xp)];if(r.say?.text.startsWith(`Promoted`))Y.levelUp(),Zd(s.current,X/2,If-l,q,22,160),o.current={kind:`cheer`,t:0};else switch(e){case`snack`:case`play`:i?(o.current={kind:e,t:0},(e===`snack`?Y.nom:Y.boing)()):r.asleep||Y.grumble();break;case`coffee`:i?(o.current={kind:`coffee`,t:0},Y.slurp()):r.asleep||(o.current={kind:`jitter`,t:0},Y.grumble());break;case`nap`:r.asleep?Y.snore():t.asleep&&(o.current={kind:`wake`,t:0},Y.happy());break;case`pet`:if(r.pettedAt===n){o.current={kind:`pet`,t:0};for(let e=0;e<3;e++)s.current.push({x:X/2+(e-1)*16,y:If-l-6,vx:(e-1)*14,vy:-50-e*8,life:1.1,color:`#ff6fb5`,size:16+e*2,text:`♥`});Y.happy()}}};Rd(e=>{if(e.repeat)return!1;let t=Bf.find(t=>e.code===`Digit${t.key}`||e.code===`Numpad${t.key}`);return t?(m(t.action),!0):Vd(e.code)?(Of()?m(`pet`):p(),!0):!1});let h=(e,n,r)=>{let i=Of(),a=i?df(i,Date.now()):null,c=a?ff(a):`content`,l=a?lf(a.xp):0;Gf(e,r,l>=2||c===`happy`,t);let u=o.current;if(u&&(u.t+=n,u.t>Rf&&(o.current=null)),a){let t=Lf[l],n=X/2,i=0,o=1,s=1,d=Math.sin(r/(c===`asleep`?900:450));s+=d*(c===`asleep`?.04:.025),o-=d*.015;let f=u?u.t/Rf:0;if((u?.kind===`play`||u?.kind===`cheer`||u?.kind===`wake`)&&(i=Math.abs(Math.sin(f*Math.PI*(u.kind===`wake`?1:4)))*(u.kind===`wake`?10:16)*(1-f*.5)),(u?.kind===`coffee`||u?.kind===`jitter`)&&(n+=Math.sin(u.t*70)*(u.kind===`jitter`?2.5:1.2)),u?.kind===`pet`){let e=Math.sin(Math.min(1,f*3)*Math.PI)*.1;s-=e,o+=e}if(u?.kind===`hatch`){let e=Math.min(1,f*3);o*=.3+e*.7,s*=.3+e*.7}e.save(),e.translate(n,214-i),e.scale(o,s);let p=u?.kind===`snack`&&f>.3&&Math.floor(u.t*8)%2==0;Vf(e,{size:t,color:a.color,mood:u?.kind===`jitter`?`grumpy`:u?.kind===`cheer`||u?.kind===`play`?`happy`:c,stage:l,blink:Math.floor(r/160)%24==0,open:p,arms:u?.kind===`cheer`||u?.kind===`play`}),e.restore();let m=If-t-i;if(u?.kind===`snack`){let r=Math.min(1,f/.3);Uf(e,n+t*.2+60*(1-r),202+(12-t*.38)*r-Math.sin(r*Math.PI)*24,10*(1-Math.max(0,f-.3)*.6),Math.max(0,(f-.3)/.7))}if(u?.kind===`coffee`&&Wf(e,n+t/2+16,194,r),u?.kind===`play`){let t=X/2+Math.cos(f*Math.PI*2)*70,n=196-Math.abs(Math.sin(f*Math.PI*5))*60;e.beginPath(),e.arc(t,n,8,0,Math.PI*2),e.fillStyle=`#d4f25c`,e.fill(),e.lineWidth=2,e.strokeStyle=K,e.stroke(),e.beginPath(),e.arc(t-8,n,7,-.9,.9),e.strokeStyle=`#ffffff`,e.stroke()}if(!u){let i=Math.sin(r/400)*2;if(c===`asleep`){for(let i=0;i<3;i++){let a=(r/1400+i/3)%1;e.globalAlpha=Math.min(1,(1-a)*2),Jd(e,`z`,n+t*.35+a*26,m-a*34,12+a*10,`#ffffff`)}e.globalAlpha=1}else if(c===`hungry`)qf(e,n+t*.55+18,m-8+i,()=>Uf(e,0,0,9));else if(c===`bored`)qf(e,n+t*.55+18,m-8+i,()=>qd(e,`…`,0,-2,20,K,700));else if(c===`tired`)qf(e,n+t*.55+18,m-8+i,()=>qd(e,`💤`,0,0,14,K,400));else if(c===`grumpy`){let t=n,a=m-22+i;e.fillStyle=`#8e93a8`,e.strokeStyle=K,e.lineWidth=2,e.beginPath(),e.arc(t-12,a,9,0,Math.PI*2),e.arc(t,a-5,11,0,Math.PI*2),e.arc(t+12,a,9,0,Math.PI*2),e.fill(),e.stroke(),e.fill(),Math.floor(r/250)%6==0&&(e.beginPath(),e.moveTo(t+2,a+8),e.lineTo(t-3,a+16),e.lineTo(t+2,a+16),e.lineTo(t-2,a+24),e.strokeStyle=`#ffc93c`,e.lineWidth=2.5,e.stroke())}else if(c===`happy`&&Math.floor(r/900)%3==0){let i=r%900/900;e.globalAlpha=Math.sin(i*Math.PI),Jd(e,`✦`,n-t*.6,m+10-i*8,14,`#ffc93c`),Jd(e,`✦`,n+t*.62,m+22-i*6,11,`#ffffff`),e.globalAlpha=1}}c===`asleep`&&(e.fillStyle=`rgba(28,36,82,0.32)`,e.fillRect(0,0,X,Ff))}else{let n=r%2600<450?Math.sin(r/45)*.06:0;e.save(),e.translate(X/2,213),e.rotate(n),Kf(e,1,t),e.restore(),Jd(e,`?`,194,142+Math.sin(r/300)*3,20,`#ffc93c`)}$d(e,s.current,n)},g=(e,t,n)=>{if(e!==`down`)return;let r=Of();if(!r){Math.abs(t-X/2)<50&&n>142&&p();return}let i=Lf[lf(r.xp)];Math.abs(t-X/2)<i/2+8&&n>If-i-12&&n<218&&m(`pet`)},_=r?df(r,i):null,v=_?ff(_):null,y=_?.say&&i-_.say.at<2e4?Nf(_.say.text,_.name,n):null,b=_?y??(d&&i-u<1e4?t(`While you were away: {text}`,{text:Nf(d.text,_.name,n)}):t(pf[v])):t(`A delivery just arrived at your desk…`),x=_?t(sf[lf(_.xp)].title):``,S=_?Math.floor((i-_.born)/864e5)+1:0,C=_?[[`🍩`,`Food`,_.food,`#ffc93c`],[`🎾`,`Fun`,_.fun,`#ff6fb5`],[`⚡`,`Energy`,_.energy,`#4fb3e8`]]:[];return(0,N.jsxs)(`div`,{className:`game pet`,children:[(0,N.jsx)(zd,{title:`Desk Pet`,color:Pf,onBack:e,children:_&&(0,N.jsxs)(`span`,{className:`game-chip`,title:t(`{count} care points`,{count:_.xp}),children:[_.name,` · `,x]})}),(0,N.jsx)(`div`,{className:`pet-say`,"aria-live":`polite`,children:b}),(0,N.jsx)(Ld,{width:X,height:Ff,frame:h,label:_?t(`{name}, your desk pet, is {mood}`,{name:_.name,mood:t(v)}):t(`A delivery box`),onPointer:g}),_?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`div`,{className:`pet-bars`,children:C.map(([e,n,r,i])=>(0,N.jsxs)(`div`,{className:`pet-bar ${r<25?`pet-bar-low`:``}`,title:`${t(n)}: ${Math.round(r)}%`,children:[(0,N.jsxs)(`span`,{className:`pet-bar-label`,children:[e,` `,t(n)]}),(0,N.jsx)(`span`,{className:`pet-meter`,children:(0,N.jsx)(`i`,{style:{width:`${Math.max(2,r)}%`,background:i}})})]},n))}),(0,N.jsx)(`div`,{className:`pet-actions`,children:Bf.map(e=>{let n=e.action===`nap`&&_.asleep;return(0,N.jsxs)(`button`,{type:`button`,className:`btn btn-small pet-act`,tabIndex:-1,onPointerDown:e=>e.preventDefault(),onClick:()=>m(e.action),disabled:_.asleep&&!n,title:`${t(n?`Wake up`:e.action===`play`?`Play with pet`:e.label)} (${e.key})`,children:[(0,N.jsx)(`span`,{className:`pet-act-icon`,children:n?`☀️`:e.icon}),t(n?`Wake`:e.action===`play`?`Play with pet`:e.label)]},e.action)})}),(0,N.jsxs)(`div`,{className:`game-keys`,children:[(0,N.jsx)(`kbd`,{children:`1`}),`–`,(0,N.jsx)(`kbd`,{children:`4`}),` `,(0,N.jsx)(A,{children:`care · click`}),` `,_.name,` (`,(0,N.jsx)(A,{children:`or`}),` `,(0,N.jsx)(`kbd`,{children:`Space`}),`) `,t(`for a pat · day {day}`,{day:S})]})]}):(0,N.jsx)(`div`,{className:`pet-actions`,children:(0,N.jsx)(`button`,{type:`button`,className:`btn btn-good pet-unbox`,onClick:p,children:(0,N.jsx)(A,{children:`📦 Unbox your desk pet`})})})]})}function Yf(e){let t=e+1831565813|0,n=Math.imul(t^t>>>15,1|t);return n=n+Math.imul(n^n>>>7,61|n)^n,[((n^n>>>14)>>>0)/4294967296,t]}var Xf=()=>Math.floor(Math.random()*2**31),Zf={up:{x:0,y:-1},down:{x:0,y:1},left:{x:-1,y:0},right:{x:1,y:0}},Qf={up:`down`,down:`up`,left:`right`,right:`left`},$f={bug:10,coffee:50},ep={bug:1,coffee:2},tp=(e,t)=>e.x===t.x&&e.y===t.y;function np(e,t){let n=Math.floor(e*.2),r=e-n-2,i=Math.floor(t*.2),a=t-i-1;return[n,r].flatMap(e=>[i,a].flatMap(t=>[{x:e,y:t},{x:e+1,y:t}]))}function rp(e,t,n,r){let i=new Set(n.map(t=>t.y*e+t.x)),a=[];for(let n=0;n<t;n++)for(let t=0;t<e;t++)i.has(n*e+t)||a.push({x:t,y:n});if(!a.length)return{at:null,seed:r};let[o,s]=Yf(r);return{at:a[Math.floor(o*a.length)],seed:s}}function ip(e,t=16,n=16){let r=Math.floor(n/2),i=Math.floor(t/2)-1,a=[0,1,2].map(e=>({x:i-e,y:r})),o=np(t,n),s=rp(t,n,[...a,...o],e);return{cols:t,rows:n,body:a,dir:`right`,queue:[],desks:o,food:{...s.at??{x:0,y:0},kind:`bug`},grow:0,score:0,eaten:0,seed:s.seed,over:null,ate:null}}function ap(e,t){if(e.over)return e;let n=e.queue[e.queue.length-1]??e.dir;return t===n||t===Qf[n]||e.queue.length>=2?e:{...e,queue:[...e.queue,t]}}function op(e){if(e.over)return e;let[t=e.dir,...n]=e.queue,r=Zf[t],i={x:e.body[0].x+r.x,y:e.body[0].y+r.y},a=r=>({...e,dir:t,queue:n,over:r,ate:null});if(i.x<0||i.y<0||i.x>=e.cols||i.y>=e.rows)return a(`wall`);if(e.desks.some(e=>tp(e,i)))return a(`desk`);let o=e.grow>0?e.body:e.body.slice(0,-1);if(o.some(e=>tp(e,i)))return a(`self`);let s=[i,...o],c=Math.max(0,e.grow-1);if(!tp(i,e.food))return{...e,body:s,dir:t,queue:n,grow:c,ate:null};let l=e.food.kind,u=e.eaten+1;c+=ep[l];let d=rp(e.cols,e.rows,[...s,...e.desks],e.seed),f={...e,body:s,dir:t,queue:n,grow:c,eaten:u,score:e.score+$f[l],seed:d.seed,ate:l};return d.at?{...f,food:{...d.at,kind:(u+1)%5==0?`coffee`:`bug`}}:{...f,over:`won`}}var sp=e=>Math.max(70,165-e.eaten*4),cp=`#4fb3e8`,lp=20,up=6,dp=38,fp=16,pp=16,mp=332,hp=364,gp=`#4fb3e8`,_p=null,vp=()=>_p!==null,yp={wall:`Unplugged!`,self:`Tangled up!`,desk:`Desk crash!`,won:`Office wired! 🎉`},bp={right:0,down:Math.PI/2,left:Math.PI,up:-Math.PI/2},xp={right:[1,0],down:[0,1],left:[-1,0],up:[0,-1]},Sp=e=>up+e.x*lp+lp/2,Cp=e=>dp+e.y*lp+lp/2;function wp({onBack:e}){let t=j(),[n,r]=(0,M.useState)(_p?`paused`:`ready`),i=(0,M.useRef)({game:_p??ip(Xf(),fp,pp),status:_p?`paused`:`ready`,acc:0,best:Sf(`snake`),newBest:!1,particles:[],shake:0,chomp:0,swipe:null}),a=e=>{i.current.status=e,r(e),_p=e===`over`||e===`ready`?null:i.current.game},o=e=>{let t=i.current,n=t.game;if(e!==n){if(t.game=e,t.status===`playing`&&(_p=e),e.ate){let n=e.body[0];e.ate===`coffee`?Y.slurp():Y.chomp(),t.chomp=.18,Zd(t.particles,Sp(n),Cp(n),e.ate===`coffee`?[`#8d5524`,`#ffffff`,`#ffc93c`]:[`#f25f5c`,`#8fd14f`,`#ffffff`],8,90),Qd(t.particles,Sp(n),Cp(n)-12,e.ate===`coffee`?`+50 ☕`:`+10`,e.ate===`coffee`?`#ffc93c`:`#ffffff`,15)}e.over&&!n.over&&(t.newBest=Cf(`snake`,e.score),t.newBest&&(t.best=e.score),t.shake=e.over===`won`?0:.3,e.over===`won`?Y.best():Y.over(),t.newBest&&e.over!==`won`&&Y.best(),a(`over`))}},s=()=>{let e=i.current;e.status!==`playing`&&(e.status===`over`&&(e.game=ip(Xf(),fp,pp)),e.status!==`paused`&&(e.newBest=!1,e.particles.length=0),e.acc=0,Y.start(),a(`playing`))},c=()=>{i.current.status===`playing`&&(Y.pause(),a(`paused`))},l=e=>{if(i.current.status!==`playing`){if(i.current.status===`paused`)return s();s()}o(ap(i.current.game,e))};Rd(e=>{let t=Bd(e.code);return t?(e.repeat||l(t),!0):Vd(e.code)?(e.repeat||(i.current.status===`playing`?c:s)(),!0):!1}),Hd(c);let u=(e,t,n)=>{let r=i.current;if(e===`down`){r.swipe={x:t,y:n};return}if(!r.swipe)return;let a=t-r.swipe.x,o=n-r.swipe.y;e===`move`&&Math.max(Math.abs(a),Math.abs(o))>18?(l(Math.abs(a)>Math.abs(o)?a>0?`right`:`left`:o>0?`down`:`up`),r.swipe={x:t,y:n}):e===`up`&&(Math.max(Math.abs(a),Math.abs(o))<8&&r.status!==`playing`&&s(),r.swipe=null)},d=(e,n,r)=>{let a=i.current;if(a.status===`playing`){a.acc+=n*1e3;let e=sp(a.game);for(;a.acc>=e&&a.status===`playing`;)a.acc-=e,o(op(a.game)),e=sp(a.game)}let s=a.game;Kd(e,up,4,96,26,`#ffffff`,9),qd(e,t(`🐛 {count} eaten`,{count:s.eaten}),54,17,12,K,700),Kd(e,mp/2-50,4,100,26,`#ffffff`,9),qd(e,t(`SCORE {score}`,{score:s.score}),mp/2,17,12,K,700),Kd(e,230,4,96,26,`#ffffff`,9);let c=Math.max(a.best,s.score);qd(e,t(`BEST {score}`,{score:c}),278,17,12,s.score>a.best?`#e05a2b`:Gd,700),e.save(),a.shake>0&&(a.shake-=n,e.translate((Math.random()-.5)*12*a.shake,(Math.random()-.5)*12*a.shake)),Kd(e,3,35,326,326,`#e6ebf3`,8),e.save(),e.beginPath(),e.roundRect(up,dp,320,320,6),e.clip(),e.fillStyle=`#dce3ee`;for(let t=0;t<pp;t++)for(let n=0;n<fp;n++)(n+t)%2&&e.fillRect(up+n*lp,dp+t*lp,lp,lp);e.restore();for(let t=0;t+1<s.desks.length;t+=2){let n=s.desks[t],r=up+n.x*lp,i=dp+n.y*lp;J(e,r+1,i+2,38,17,`#f1d19b`,5),J(e,r+lp-8,i-3,16,12,`#2b2d42`,3,1.5),e.fillStyle=q[t/2%q.length],e.fillRect(r+lp-5,i,10,5)}Tp(e,s,r),Ep(e,s,a.chomp,r),a.chomp=Math.max(0,a.chomp-n),e.restore(),$d(e,a.particles,n),a.status===`ready`?ef(e,mp,hp,`Cable Snake`,[t(`Eat bugs 🐛, sip coffee ☕`),t(`Dodge desks, walls & yourself`),t(`Arrows, swipe or tap to start`)],cp):a.status===`paused`?ef(e,mp,hp,t(`Coffee break ☕`),[t(`Score {score}`,{score:s.score}),t(`Space or tap to resume`)],cp):a.status===`over`&&ef(e,mp,hp,t(yp[s.over??`self`]),[t(`Score {score} · {length} long`,{score:s.score,length:s.body.length}),a.newBest?t(`🏆 New best!`):t(`Best {score}`,{score:a.best}),t(`Space or tap to play again`)],s.over===`won`?`#8fd14f`:`#f25f5c`)},f=(e,n,r)=>(0,N.jsx)(Ud,{label:t(r),className:`game-pad-${e}`,onPress:()=>l(e),children:n});return(0,N.jsxs)(`div`,{className:`game`,children:[(0,N.jsx)(zd,{title:`Cable Snake`,color:cp,onBack:e,children:(0,N.jsx)(`button`,{type:`button`,className:`game-mini`,tabIndex:-1,onPointerDown:e=>e.preventDefault(),onClick:()=>n===`playing`?c():s(),title:t(n===`playing`?`Pause (Space)`:`Play (Space)`),children:n===`playing`?`⏸`:`▶`})}),(0,N.jsx)(Ld,{width:mp,height:hp,frame:d,label:t(`Cable Snake board`),onPointer:u}),(0,N.jsxs)(`div`,{className:`game-dpad`,children:[f(`up`,`▲`,`Up`),f(`left`,`◀`,`Left`),f(`right`,`▶`,`Right`),f(`down`,`▼`,`Down`)]}),(0,N.jsxs)(`div`,{className:`game-keys`,children:[(0,N.jsx)(`kbd`,{children:`←`}),(0,N.jsx)(`kbd`,{children:`↑`}),(0,N.jsx)(`kbd`,{children:`→`}),(0,N.jsx)(`kbd`,{children:`↓`}),` `,(0,N.jsx)(A,{children:`or`}),` `,(0,N.jsx)(`kbd`,{children:`WASD`}),` `,(0,N.jsx)(A,{children:`steer · swipe on the board ·`}),` `,(0,N.jsx)(`kbd`,{children:`Space`}),` `,(0,N.jsx)(A,{children:`pause`})]})]})}function Tp(e,t,n){let r=Sp(t.food),i=Cp(t.food);if(e.save(),e.translate(r,i),t.food.kind===`coffee`){let t=.5+Math.sin(n/200)*.5;e.beginPath(),e.arc(0,0,10+t*2,0,Math.PI*2),e.fillStyle=`rgba(255,201,60,${.25+t*.2})`,e.fill(),e.lineWidth=2,e.strokeStyle=K,e.beginPath(),e.arc(5,1,3.5,-Math.PI/2,Math.PI/2),e.stroke(),e.beginPath(),e.roundRect(-7,-5,12,12,2.5),e.fillStyle=`#ffffff`,e.fill(),e.stroke(),e.beginPath(),e.ellipse(-1,-4,5,1.6,0,0,Math.PI*2),e.fillStyle=`#8d5524`,e.fill(),e.strokeStyle=`rgba(31,29,43,0.5)`,e.lineWidth=1.2;for(let t of[-3,1]){let r=(n/400+t)%1;e.globalAlpha=1-r,e.beginPath(),e.moveTo(t,-7-r*6),e.quadraticCurveTo(t+2,-9-r*6,t,-11-r*6),e.stroke()}e.globalAlpha=1}else{e.rotate(Math.sin(n/160)*.18),e.strokeStyle=K,e.lineWidth=1.4,e.lineCap=`round`;for(let t of[-1,1])for(let r of[-3,.5,4])e.beginPath(),e.moveTo(t*3,r),e.lineTo(t*8,r+Math.sin(n/90+r)*1.5-1),e.stroke();e.beginPath(),e.moveTo(-1.5,-7),e.lineTo(-4,-10),e.moveTo(1.5,-7),e.lineTo(4,-10),e.stroke(),e.beginPath(),e.arc(0,-6,3,0,Math.PI*2),e.fillStyle=K,e.fill(),e.beginPath(),e.ellipse(0,1,5.5,6.5,0,0,Math.PI*2),e.fillStyle=`#f25f5c`,e.fill(),e.lineWidth=1.8,e.stroke(),e.beginPath(),e.moveTo(0,-5),e.lineTo(0,7),e.lineWidth=1.2,e.stroke(),e.fillStyle=K;for(let[t,n]of[[-2.6,-.5],[2.6,-.5],[-2.4,3.5],[2.4,3.5]])e.beginPath(),e.arc(t,n,1.1,0,Math.PI*2),e.fill()}e.restore()}function Ep(e,t,n,r){let i=t.body;e.lineCap=`round`,e.lineJoin=`round`,(()=>{e.beginPath(),e.moveTo(Sp(i[i.length-1]),Cp(i[i.length-1]));for(let t=i.length-2;t>=0;t--)e.lineTo(Sp(i[t]),Cp(i[t]))})(),e.strokeStyle=K,e.lineWidth=14,e.stroke(),e.strokeStyle=gp,e.lineWidth=10,e.stroke(),e.save(),e.translate(0,-2),e.strokeStyle=`rgba(255,255,255,0.4)`,e.lineWidth=3,e.stroke(),e.restore(),e.strokeStyle=Xd(gp,-.45),e.lineWidth=3;for(let t=3;t<i.length-1;t+=4){let n=i[t],r=i[t+1],a=(Sp(n)+Sp(r))/2,o=(Cp(n)+Cp(r))/2,s=n.x===r.x;e.beginPath(),e.moveTo(a-(s?5:0),o-(s?0:5)),e.lineTo(a+(s?5:0),o+(s?0:5)),e.stroke()}let a=i[0],o=t.queue[0]??t.dir,s=Sp(a),c=Cp(a);e.save(),e.translate(s,c),e.rotate(bp[t.dir]);let l=n>0?1.12:1;e.scale(l,l),e.beginPath(),e.roundRect(-8,-8,16,16,3.5),e.fillStyle=`#e4f4ff`,e.fill(),e.lineWidth=2,e.strokeStyle=K,e.stroke(),e.fillStyle=`#ffc93c`;for(let t=0;t<4;t++)e.fillRect(5,-6+t*3.3,3,1.8);e.restore();let[u,d]=xp[o],f=s-xp[t.dir][0]*2,p=c-xp[t.dir][1]*2-1;if(t.over&&t.over!==`won`){e.strokeStyle=K,e.lineWidth=2;for(let t of[-1,1]){let n=f+t*4;e.beginPath(),e.moveTo(n-2.5,p-2.5),e.lineTo(n+2.5,p+2.5),e.moveTo(n+2.5,p-2.5),e.lineTo(n-2.5,p+2.5),e.stroke()}}else Yd(e,f,p,8,3.2,u,d,Math.floor(r/170)%25==0)}var Dp=[`I`,`O`,`T`,`S`,`Z`,`J`,`L`],Op={I:[`....`,`XXXX`,`....`,`....`],O:[`XX`,`XX`],T:[`.X.`,`XXX`,`...`],S:[`.XX`,`XX.`,`...`],Z:[`XX.`,`.XX`,`...`],J:[`X..`,`XXX`,`...`],L:[`..X`,`XXX`,`...`]};function kp(e){let t=[];return e.forEach((e,n)=>[...e].forEach((e,r)=>e===`X`&&t.push([r,n]))),t}function Ap(e){let t=e.length;return e.map((n,r)=>e.map((n,i)=>e[t-1-i][r]).join(``))}var jp=Object.fromEntries(Dp.map(e=>{let t=[Op[e]];for(let e=1;e<4;e++)t.push(Ap(t[e-1]));return[e,t.map(kp)]})),Mp=()=>Array.from({length:20},()=>Array(10).fill(null));function Np(e){return jp[e.type][e.rot].map(([t,n])=>[e.x+t,e.y+n])}var Pp=e=>jp[e][0];function Fp(e,t){return Np(t).some(([t,n])=>t<0||t>=10||n>=20||n>=0&&e[n][t]!==null)}function Ip(e){let t=Op[e].length,n=Math.min(...jp[e][0].map(([,e])=>e));return{type:e,rot:0,x:Math.floor((10-t)/2),y:-n}}function Lp(e,t){let n=[...e],r=t;for(;n.length<Dp.length;){let e=[...Dp];for(let t=e.length-1;t>0;t--){let[n,i]=Yf(r);r=i;let a=Math.floor(n*(t+1));[e[t],e[a]]=[e[a],e[t]]}n.push(...e)}return{queue:n,seed:r}}function Rp(e){let t=Lp([],e),[n,...r]=t.queue,i=Lp(r,t.seed);return{board:Mp(),piece:Ip(n),queue:i.queue,seed:i.seed,score:0,lines:0,level:1,over:!1,cleared:[],locks:0}}var zp=e=>Math.max(80,Math.round(800*.85**(e-1))),Bp=[0,100,300,500,800];function Vp(e){let t=[],n=e.filter((e,n)=>{let r=e.every(e=>e!==null);return r&&t.push(n),!r});return t.length?{board:[...Array.from({length:t.length},()=>Array(10).fill(null)),...n],rows:t}:{board:e,rows:t}}function Hp(e,t,n=0){if(e.over)return e;let r={...e.piece,x:e.piece.x+t,y:e.piece.y+n};return Fp(e.board,r)?e:{...e,piece:r}}var Up=[[0,0],[-1,0],[1,0],[0,-1],[-1,-1],[1,-1]],Wp=[[0,0],[-1,0],[1,0],[-2,0],[2,0],[0,-1]];function Gp(e,t=1){if(e.over||e.piece.type===`O`)return e;let n=(e.piece.rot+t+4)%4;for(let[t,r]of e.piece.type===`I`?Wp:Up){let i={...e.piece,rot:n,x:e.piece.x+t,y:e.piece.y+r};if(!Fp(e.board,i))return{...e,piece:i}}return e}function Kp(e){let t=0;for(;!Fp(e.board,{...e.piece,y:e.piece.y+t+1});)t++;return t}function qp(e){if(e.over)return e;let t=Np(e.piece),n=e.board.map(e=>[...e]),r=!1;for(let[i,a]of t)a<0?r=!0:n[a][i]=e.piece.type;let{board:i,rows:a}=Vp(n),o=e.lines+a.length,s=e.score+Bp[a.length]*e.level,c=1+Math.floor(o/10),[l,...u]=e.queue,d=Lp(u,e.seed),f=Ip(l),p=r||Fp(i,f);return{board:i,piece:f,queue:d.queue,seed:d.seed,score:s,lines:o,level:c,over:p,cleared:a,locks:e.locks+1}}function Jp(e){if(e.over)return e;let t=Hp(e,0,1);return t===e?qp(e):t}function Yp(e){if(e.over)return e;let t=Hp(e,0,1);return t===e?qp(e):{...t,score:t.score+1}}function Xp(e){if(e.over)return e;let t=Kp(e);return qp({...e,piece:{...e.piece,y:e.piece.y+t},score:e.score+t*2})}var Zp=`#c77dff`,Qp={I:q[1],O:q[4],T:q[3],S:q[2],Z:q[7],J:q[6],L:q[0]},Z=18,Q=8,$=8,$p=10*Z,em=20*Z,tm=Q+$p+12,nm=tm+92+6,rm=$+em+8,im=null,am=()=>im!==null,om=[``,`Shipped!`,`Double ship!`,`Triple ship!`,`CUBETRIS!`];function sm({onBack:e}){let t=j(),[n,r]=(0,M.useState)(im?`paused`:`ready`),i=(0,M.useRef)({game:im??Rp(Xf()),status:im?`paused`:`ready`,acc:0,best:Sf(`tetris`),newBest:!1,flash:[],particles:[],shake:0,lastDx:0}),a=e=>{i.current.status=e,r(e),im=e===`over`||e===`ready`?null:i.current.game},o=e=>{let n=i.current,r=n.game;if(e===r)return!1;if(n.game=e,im=n.status===`playing`?e:im,e.locks!==r.locks){let i=e.cleared.length;if(i){Y.lines(i);let a=e.score-r.score;for(let t of e.cleared)n.flash.push({y:t,t:.35}),Zd(n.particles,Q+$p/2,$+t*Z+Z/2,q,10,150);let o=$+e.cleared.reduce((e,t)=>e+t,0)/i*Z;Qd(n.particles,Q+$p/2,o-14,t(om[i]),i===4?`#ffc93c`:`#ffffff`,i===4?26:20),Qd(n.particles,Q+$p/2,o+12,`+${a}`,`#80ed99`,16),i===4&&(n.shake=.35)}else Y.land();e.level>r.level&&(Y.levelUp(),Qd(n.particles,Q+$p/2,$+em/3,t(`Level {level}!`,{level:e.level}),`#4fb3e8`,24)),e.over&&(n.newBest=Cf(`tetris`,e.score),n.newBest&&(n.best=e.score),Y.over(),n.newBest&&Y.best(),a(`over`))}return!0},s=()=>{let e=i.current;e.status!==`playing`&&((e.status===`over`||e.status===`ready`)&&(e.status===`over`&&(e.game=Rp(Xf())),e.newBest=!1,e.particles.length=0),e.acc=0,Y.start(),a(`playing`))},c=()=>{i.current.status===`playing`&&(Y.pause(),a(`paused`))},l=e=>{i.current.lastDx=e,o(Hp(i.current.game,e))&&Y.move()},u=e=>o(Gp(i.current.game,e))&&Y.rotate(),d=()=>{i.current.acc=0,o(Yp(i.current.game))},f=()=>{i.current.acc=0,o(Xp(i.current.game))},p=e=>()=>i.current.status===`playing`?e():s();return Rd(e=>{let t=i.current.status===`playing`,n=Bd(e.code);return Vd(e.code)?(e.repeat||(t?e.code===`Space`?f():c():s()),!0):n?(t&&(n===`left`||n===`right`?l(n===`left`?-1:1):n===`down`?d():e.repeat||u(1)),!0):e.code===`KeyZ`||e.code===`KeyQ`||e.code===`KeyX`?(t&&!e.repeat&&u(e.code===`KeyX`?1:-1),!0):!1}),Hd(c),(0,N.jsxs)(`div`,{className:`game`,children:[(0,N.jsx)(zd,{title:`Cubetris`,color:Zp,onBack:e,children:(0,N.jsx)(`button`,{type:`button`,className:`game-mini`,tabIndex:-1,onPointerDown:e=>e.preventDefault(),onClick:()=>n===`playing`?c():s(),title:t(n===`playing`?`Pause (Enter)`:`Play (Space)`),children:n===`playing`?`⏸`:`▶`})}),(0,N.jsx)(Ld,{width:nm,height:rm,frame:(e,n,r)=>{let a=i.current;if(a.status===`playing`){a.acc+=n*1e3;let e=zp(a.game.level);for(;a.acc>=e&&a.status===`playing`;)a.acc-=e,o(Jp(a.game))}let s=a.game;e.save(),a.shake>0&&(a.shake-=n,e.translate((Math.random()-.5)*6*a.shake*3,(Math.random()-.5)*6*a.shake*3)),Kd(e,5,5,$p+6,em+6,`#e3e9f3`,8),e.strokeStyle=`rgba(80,100,140,0.12)`,e.lineWidth=1,e.beginPath();for(let t=1;t<10;t++)e.moveTo(Q+t*Z,$),e.lineTo(Q+t*Z,$+em);for(let t=1;t<20;t++)e.moveTo(Q,$+t*Z),e.lineTo(Q+$p,$+t*Z);if(e.stroke(),s.board.forEach((t,n)=>t.forEach((t,r)=>t&&J(e,Q+r*Z,$+n*Z,Z,Z,Qp[t],4.5))),!s.over){let t=Kp(s);e.setLineDash([3,3]);for(let[n,r]of Np({...s.piece,y:s.piece.y+t}))r<0||(e.beginPath(),e.roundRect(Q+n*Z+2,$+r*Z+2,14,14,4),e.fillStyle=`${Qp[s.piece.type]}44`,e.fill(),e.strokeStyle=`rgba(31,29,43,0.45)`,e.lineWidth=1.5,e.stroke());e.setLineDash([]);let n=Np(s.piece);e.save(),e.beginPath(),e.rect(6,$,$p+4,em+4),e.clip();for(let[t,r]of n)J(e,Q+t*Z,$+r*Z,Z,Z,Qp[s.piece.type],4.5);let i=n.reduce((e,[t])=>e+t,0)/n.length,o=n.reduce((e,[,t])=>e+t,0)/n.length,[c,l]=n.reduce((e,t)=>Math.hypot(t[0]-i,t[1]-o)<Math.hypot(e[0]-i,e[1]-o)?t:e);l>=0&&Yd(e,Q+c*Z+Z/2,$+l*Z+Z/2-1,8,2.7,a.lastDx,.6,Math.floor(r/180)%22==0),e.restore()}a.flash=a.flash.filter(e=>(e.t-=n)>0);for(let t of a.flash)e.fillStyle=`rgba(255,255,255,${Math.min(1,t.t*3)})`,e.fillRect(Q,$+t.y*Z,$p,Z);e.restore(),Kd(e,tm,$,92,110,`#ffffff`,10),qd(e,t(`NEXT`),tm+46,21,11,Gd,700),s.queue.slice(0,3).forEach((t,n)=>{let r=n===0?14:9,i=Pp(t),a=i.map(([e])=>e),o=i.map(([,e])=>e),s=(Math.max(...a)-Math.min(...a)+1)*r,c=(Math.max(...o)-Math.min(...o)+1)*r,l=n===0?tm+46-s/2:tm+(n===1?24:68)-s/2,u=n===0?52-c/2:98-c/2;for(let[s,c]of i)J(e,l+(s-Math.min(...a))*r,u+(c-Math.min(...o))*r,r,r,Qp[t],r*.25,n===0?2:1.5)});let c=(n,r,i,a=K)=>{Kd(e,tm,i,92,46,`#ffffff`,10),qd(e,t(n),tm+46,i+13,10,Gd,700),qd(e,r,tm+46,i+31,17,a,700)};if(c(`SCORE`,s.score.toLocaleString(),130),c(`LINES`,String(s.lines),186),c(`LEVEL`,String(s.level),242),c(`BEST`,Math.max(a.best,s.score).toLocaleString(),298,s.score>a.best?`#e05a2b`:K),$d(e,a.particles,n),a.status!==`playing`){let n=t(a.status===`ready`?`Space or tap to start`:a.status===`paused`?`Space or tap to resume`:`Space or tap to play again`);a.status===`ready`?ef(e,nm,rm,`Cubetris`,[t(`Stack the blocks.`),t(`Fill a row to ship it!`),n],Zp):a.status===`paused`?ef(e,nm,rm,t(`Coffee break ☕`),[t(`Score {score}`,{score:s.score.toLocaleString()}),n],Zp):ef(e,nm,rm,t(`Stack overflow!`),[t(`Score {score}`,{score:s.score.toLocaleString()}),a.newBest?t(`🏆 New best!`):t(`Best {score}`,{score:a.best.toLocaleString()}),n],`#f25f5c`)}else s.score===0&&s.locks===0&&Jd(e,t(`Go!`),Q+$p/2,$+em/2,30+Math.sin(r/120)*2,`#80ed99`)},label:t(`Cubetris board`),onPointer:e=>e===`down`&&p(()=>u(1))()}),(0,N.jsxs)(`div`,{className:`game-pads`,children:[(0,N.jsx)(Ud,{label:t(`Move left`),repeat:!0,onPress:p(()=>l(-1)),children:`◀`}),(0,N.jsx)(Ud,{label:t(`Soft drop`),repeat:!0,onPress:p(d),children:`▼`}),(0,N.jsx)(Ud,{label:t(`Move right`),repeat:!0,onPress:p(()=>l(1)),children:`▶`}),(0,N.jsx)(`span`,{className:`game-pad-gap`}),(0,N.jsx)(Ud,{label:t(`Rotate`),className:`game-pad-round`,onPress:p(()=>u(1)),children:`⟳`}),(0,N.jsx)(Ud,{label:t(`Hard drop`),className:`game-pad-round game-pad-hot`,onPress:p(f),children:`⤓`})]}),(0,N.jsxs)(`div`,{className:`game-keys`,children:[(0,N.jsx)(`kbd`,{children:`←`}),(0,N.jsx)(`kbd`,{children:`→`}),` `,(0,N.jsx)(A,{children:`move`}),` · `,(0,N.jsx)(`kbd`,{children:`↑`}),` `,(0,N.jsx)(A,{children:`turn`}),` · `,(0,N.jsx)(`kbd`,{children:`↓`}),` `,(0,N.jsx)(A,{children:`down`}),` · `,(0,N.jsx)(`kbd`,{children:`Space`}),` `,(0,N.jsx)(A,{children:`hard drop`}),` · `,(0,N.jsx)(`kbd`,{children:`Enter`}),` `,(0,N.jsx)(A,{children:`pause`})]})]})}function cm({draw:e}){let t=(0,M.useRef)(null);return(0,M.useEffect)(()=>{let n=t.current,r=n?.getContext(`2d`);if(!n||!r)return;let i=Math.min(2,window.devicePixelRatio||1);n.width=56*i,n.height=56*i,r.setTransform(i,0,0,i,0,0),e(r)},[e]),(0,N.jsx)(`canvas`,{ref:t,className:`game-thumb`,style:{width:56,height:56},"aria-hidden":!0})}var lm=e=>{let t=(t,n,r)=>J(e,2+t*13,2+n*13,13,13,r,3.5,1.8);for(let[e,n]of[[`#ffc93c`,[[0,2],[1,2],[0,3],[1,3]]],[`#ff8a5b`,[[3,1],[3,2],[3,3],[2,3]]],[`#c77dff`,[[0,0],[1,0],[2,0],[1,1]]]])for(let[r,i]of n)t(r,i,e);Yd(e,21.5,8.5,7,2.4,0,.5)},um=e=>{e.lineCap=`round`,e.lineJoin=`round`,e.beginPath(),e.moveTo(8,48),e.lineTo(8,34),e.lineTo(28,34),e.lineTo(28,16),e.lineTo(36,16),e.strokeStyle=K,e.lineWidth=11,e.stroke(),e.strokeStyle=`#4fb3e8`,e.lineWidth=7,e.stroke(),e.beginPath(),e.roundRect(33,9,14,14,3),e.fillStyle=`#e4f4ff`,e.fill(),e.lineWidth=2,e.strokeStyle=K,e.stroke(),e.fillStyle=`#ffc93c`;for(let t=0;t<3;t++)e.fillRect(44,11+t*3.6,2.5,1.8);Yd(e,39,15,6,2.4,1,0),e.beginPath(),e.ellipse(46,44,5,6,0,0,Math.PI*2),e.fillStyle=`#f25f5c`,e.fill(),e.lineWidth=1.6,e.stroke(),e.beginPath(),e.arc(46,38,2.6,0,Math.PI*2),e.fillStyle=K,e.fill()};function dm({icon:e,name:t,what:n,status:r,color:i,onOpen:a}){let o=j();return(0,N.jsxs)(`button`,{type:`button`,className:`game-card`,style:{"--game":i},onClick:a,children:[(0,N.jsx)(cm,{draw:e}),(0,N.jsxs)(`span`,{className:`game-card-text`,children:[(0,N.jsx)(`b`,{children:t}),(0,N.jsx)(`span`,{className:`game-card-what`,children:o(n)}),(0,N.jsx)(`span`,{className:`game-card-status`,children:r})]}),(0,N.jsx)(`span`,{className:`game-card-go`,children:`▶`})]})}function fm({onGame:e}){let t=j(),n=(0,M.useSyncExternalStore)(Af,Of),[r]=(0,M.useState)(Date.now),i=n?df(n,r):null,a=e=>{e.translate(28,50),i?Vf(e,{size:38,color:i.color,mood:ff(i),stage:lf(i.xp),blink:!1}):Kf(e,.6,t)},o=e=>Sf(e)?t(`Best {score}`,{score:Sf(e).toLocaleString()}):t(`No best score yet`);return Rd(t=>{let n=[`Digit1`,`Digit2`,`Digit3`].indexOf(t.code);return n<0||t.repeat?!1:(e([`tetris`,`snake`,`pet`][n]),!0)}),(0,N.jsxs)(`div`,{className:`phone-scroll games-list`,children:[(0,N.jsx)(`h3`,{className:`phone-h`,children:(0,N.jsx)(A,{children:`🎮 Games`})}),(0,N.jsx)(`p`,{className:`muted small games-blurb`,children:(0,N.jsx)(A,{children:`Something to do while the team works. They pause when you put the phone away.`})}),(0,N.jsx)(dm,{icon:lm,name:`Cubetris`,what:`Falling blocks (a Tetris clone)`,status:am()?t(`⏸ Game paused, tap to resume`):o(`tetris`),color:Zp,onOpen:()=>e(`tetris`)}),(0,N.jsx)(dm,{icon:um,name:`Cable Snake`,what:`Eat the bugs (a Snake clone)`,status:vp()?t(`⏸ Game paused, tap to resume`):o(`snake`),color:cp,onOpen:()=>e(`snake`)}),(0,N.jsx)(dm,{icon:a,name:`Desk Pet`,what:`Your office pet (a Tamagotchi clone)`,status:i?t(`{name} the {stage} {mood}`,{name:i.name,stage:t(sf[lf(i.xp)].title).toLowerCase(),mood:t({asleep:`is napping`,happy:`is thrilled`,content:`is doing fine`,hungry:`is hungry`,bored:`is bored`,tired:`is sleepy`,grumpy:`is grumpy, needs you`}[ff(i)])}):t(`📦 A delivery is waiting for you`),color:Pf,onOpen:()=>e(`pet`)}),(0,N.jsxs)(`p`,{className:`muted small games-blurb`,children:[(0,N.jsx)(`kbd`,{children:`1`}),` `,(0,N.jsx)(`kbd`,{children:`2`}),` `,(0,N.jsx)(`kbd`,{children:`3`}),` `,(0,N.jsx)(A,{children:`open a game`}),` · `,(0,N.jsx)(`kbd`,{children:`Backspace`}),` `,(0,N.jsx)(A,{children:`comes back here`})]})]})}function pm({game:e,onGame:t}){Rd(n=>!e||n.code!==`Backspace`?!1:(t(null),!0));let n=()=>t(null);return e===`tetris`?(0,N.jsx)(sm,{onBack:n}):e===`snake`?(0,N.jsx)(wp,{onBack:n}):e===`pet`?(0,N.jsx)(Jf,{onBack:n}):(0,N.jsx)(fm,{onGame:t})}function mm(){let e=xt(e=>e.id),t=Tt(e=>e.status);if(!e)return null;let n=Ie[e];return(0,N.jsx)(`div`,{className:`phone-holiday`,role:`status`,style:{margin:`0 6px 6px`,padding:`5px 10px`,borderRadius:12,fontSize:13,fontWeight:600,textAlign:`center`,color:`#23263a`,background:`#ffd6a5`},children:t??`${n.emoji} Happy ${n.name.replace(/^Your /,``)}`})}var hm=e=>/^(claude|opus|sonnet|haiku|fable|default|best|opusplan)\b/i.test(e.trim());function gm(e,t,n,r){let i=e=>e.trim()!==``&&t===`claude`===hm(e);return i(e)?e.trim():t===n.defaultCli&&i(n.defaultModel)?n.defaultModel.trim():t===`claude`?r:``}var _m=[`claude-opus-5-5`,`claude-opus-5`,`claude-fable-5-1`,`claude-sonnet-5`,`claude-haiku-4-5`];function vm(e){return e===`claude`?_m:e===`codex`?[`gpt-5.5-codex`,`gpt-5.5`,`ollama/gpt-oss:20b`,`lmstudio/openai/gpt-oss-20b`]:[..._m.map(e=>`anthropic/${e}`),`ollama/qwen3-coder`,`lmstudio/qwen/qwen3-coder-30b`,`llamacpp/default`]}async function ym(e){try{return await e()}catch{return}}var bm=e=>new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`});function xm({name:e,color:t,size:n=34}){return(0,N.jsx)(`span`,{className:`avatar`,style:{background:t,width:n,height:n,fontSize:n*.45},children:e[0]})}var Sm=[`low`,`medium`,`high`,`xhigh`,`max`],Cm=(e,t)=>e.find(e=>e.id===t)?.label??t,wm=(e,t)=>t.runtime===`terminal`?e||t.defaultCli:`claude`,Tm=e=>({name:e.name,cli:e.cli,model:e.model,effort:e.effort,host:e.host??``}),Em=(e,t)=>({name:t.name.trim()||e.name,cli:t.cli,model:t.model.trim(),effort:t.effort,host:t.host});function Dm(e,t,n){let r=wm(e.cli,t),i=(e,n)=>O(t.language,e,n);return`${Cm(n,r)} · ${gm(e.model,r,t,_m[0])||i(`its default model`)} · ${i(`{effort} effort`,{effort:e.effort||t.defaultEffort})}`}function Om({value:e,onChange:t,disabled:n,repo:r}){let i=j(),a=E(e=>e.settings),o=E(e=>e.clis),s=(0,M.useId)(),c=E(e=>e.cloud.keySet),l=a.runtime!==`terminal`,u=wm(e.cli,a),d=(e.host||a.cloud.machineKind)===`box`,f=n=>t({...e,...n});return(0,N.jsxs)(`div`,{className:`hire-setup`,children:[(0,N.jsxs)(`label`,{className:`field`,htmlFor:`${s}-name`,children:[(0,N.jsx)(`span`,{children:(0,N.jsx)(A,{children:`Name`})}),(0,N.jsx)(`input`,{id:`${s}-name`,value:e.name,maxLength:24,disabled:n,onChange:e=>f({name:e.target.value})})]}),(0,N.jsxs)(`label`,{className:`field`,htmlFor:`${s}-cli`,children:[(0,N.jsx)(`span`,{children:(0,N.jsx)(A,{children:`Coding agent`})}),(0,N.jsxs)(`select`,{id:`${s}-cli`,value:l?``:e.cli,disabled:n||l,title:l?i(`The Agent SDK runs Claude Code for every agent (Settings → How agents run)`):void 0,onChange:e=>f({cli:e.target.value}),children:[(0,N.jsx)(`option`,{value:``,children:l?`Claude Code`:`${Cm(o,a.defaultCli)} ${i(`(default)`)}`}),[...o].sort((e,t)=>Number(t.installed)-Number(e.installed)).map(e=>(0,N.jsxs)(`option`,{value:e.id,disabled:!d&&(!e.installed||!!e.problem),title:d?void 0:e.problem,children:[e.label,i(d?``:e.installed?e.problem?` (incompatible version)`:``:` (not installed)`)]},e.id))]})]}),(0,N.jsxs)(`label`,{className:`field`,htmlFor:`${s}-model`,children:[(0,N.jsx)(`span`,{children:(0,N.jsx)(A,{children:`Model`})}),(0,N.jsx)(`input`,{id:`${s}-model`,list:`${s}-models`,value:e.model,disabled:n,placeholder:gm(``,u,a,_m[0])||i(`agent default`),title:i(`Empty: the default for their coding agent`),onChange:e=>f({model:e.target.value})}),(0,N.jsx)(`datalist`,{id:`${s}-models`,children:vm(u).map(e=>(0,N.jsx)(`option`,{value:e},e))})]}),u===`opencode`&&(0,N.jsx)(It,{value:e.model,repo:r,disabled:n||d,inherited:a.defaultCli===`opencode`?a.defaultModel:void 0,onSelect:e=>f({model:e})}),(0,N.jsxs)(`label`,{className:`field`,htmlFor:`${s}-effort`,children:[(0,N.jsx)(`span`,{children:i(u===`opencode`?`Variant`:`Effort`)}),u===`opencode`?(0,N.jsx)(Rt,{id:`${s}-effort`,value:e.model,repo:r,disabled:n||d,inherited:a.defaultCli===`opencode`?a.defaultModel:void 0,onSelect:e=>f({model:e})}):(0,N.jsxs)(`select`,{id:`${s}-effort`,value:e.effort,disabled:n,onChange:e=>f({effort:e.target.value}),children:[(0,N.jsx)(`option`,{value:``,children:i(`default ({effort})`,{effort:a.defaultEffort})}),Sm.map(e=>(0,N.jsx)(`option`,{value:e,children:e},e))]})]}),(c||e.host===`box`)&&(0,N.jsxs)(`label`,{className:`field`,htmlFor:`${s}-host`,children:[(0,N.jsx)(`span`,{children:(0,N.jsx)(A,{children:`Works on`})}),(0,N.jsxs)(`select`,{id:`${s}-host`,value:e.host,disabled:n,onChange:e=>f({host:e.target.value}),children:[(0,N.jsxs)(`option`,{value:``,children:[a.cloud.machineKind===`box`?`☁️ Upstash Box`:i(`🖥️ This computer`),` `,i(`(default)`)]}),(0,N.jsx)(`option`,{value:`local`,children:i(`🖥️ This computer`)}),(0,N.jsx)(`option`,{value:`box`,children:`☁️ Upstash Box`})]})]})]})}function km({req:e,highlight:t}){let n=j(),r=E(t=>t.repos.find(t=>t.id===e.repoId)),i=E(e=>e.settings),a=E(e=>e.clis),[o,s]=(0,M.useState)(()=>Tm(e)),[c,l]=(0,M.useState)(!1),[u,d]=(0,M.useState)(!1),[f,p]=(0,M.useState)(``),[m,h]=(0,M.useState)(!1),g=(0,M.useRef)(null);(0,M.useEffect)(()=>{t&&g.current?.scrollIntoView({block:`center`})},[t]);let _=e.status===`pending`,v=e.kind===`hire`,y=v&&_&&o.name.trim()||e.name,b=async e=>{h(!0),await ym(e),h(!1)},x=e.status===`approved`?v?`✅ hired`:`👋 left`:v?`✋ declined`:`🤝 kept`;return(0,N.jsxs)(`div`,{ref:g,className:`resume ${v?``:`resume-letgo`} ${t?`resume-hot`:``} ${_?``:`resume-done`}`,children:[(0,N.jsxs)(`div`,{className:`resume-head`,children:[(0,N.jsx)(xm,{name:y,color:e.color,size:42}),(0,N.jsxs)(`div`,{className:`grow`,children:[(0,N.jsx)(`div`,{className:`resume-name`,children:v?y:n(`Let {name} go?`,{name:e.name})}),(0,N.jsx)(`div`,{className:`resume-title`,children:n(v?`A new agent`:`Leaving the team`)})]}),!_&&(0,N.jsx)(`span`,{className:`chip ${e.status===`approved`?`chip-good`:``}`,children:n(x)})]}),(0,N.jsxs)(`div`,{className:`resume-meta`,children:[(0,N.jsx)(`span`,{className:`chip`,style:{background:r?.color},children:n(`Floor {floor}`,{floor:r?.floor??`?`})}),(0,N.jsx)(`span`,{className:`muted small`,children:r?.fullName.split(`/`)[1]??n(`removed floor`)})]}),e.reason&&(0,N.jsx)(Od,{className:`resume-reason`,text:e.reason}),v&&(0,N.jsxs)(`div`,{className:`resume-meta small`,children:[(0,N.jsxs)(`span`,{className:`grow`,children:[`⚙️ `,Dm(_?o:e,i,a)]}),_&&(0,N.jsx)(`button`,{className:`linkish small`,"aria-expanded":c,onClick:()=>l(!c),children:n(c?`Done`:`Change`)})]}),v&&_&&c&&(0,N.jsx)(Om,{value:o,onChange:s,disabled:m,repo:r?.id}),!_&&e.note&&(0,N.jsx)(`div`,{className:`muted small`,children:n(`Your note: “{note}”`,{note:e.note})}),_&&!u&&(0,N.jsxs)(`div`,{className:`row`,children:[(0,N.jsx)(`button`,{className:`btn btn-small btn-ghost`,disabled:m,onClick:()=>d(!0),children:n(v?`Decline`:`Keep them`)}),(0,N.jsx)(`span`,{className:`spacer`}),(0,N.jsx)(`button`,{className:`btn btn-small btn-good`,disabled:m,onClick:()=>b(()=>k.approveRequest(e.id,v?Em(e,o):{})),children:n(v?`Hire {name}`:`Let {name} go`,{name:v?y:e.name})})]}),_&&u&&(0,N.jsxs)(`form`,{className:`row`,onSubmit:t=>{t.preventDefault(),b(()=>k.rejectRequest(e.id,f))},children:[(0,N.jsx)(`input`,{value:f,onChange:e=>p(e.target.value),placeholder:n(`Why not? (optional, the CEO reads it)`),autoFocus:!0}),(0,N.jsx)(`button`,{className:`btn btn-small btn-bad`,disabled:m,children:n(v?`Decline`:`Keep`)})]})]})}function Am(){let e=j(),t=E(e=>ne(e.requests).filter(e=>e.kind===`hire`).length),n=E(e=>e.floor===0),r=E(e=>e.goToFloor);return t?(0,N.jsxs)(`div`,{className:`phone-nudge`,role:`status`,children:[(0,N.jsx)(`span`,{children:`🪑`}),(0,N.jsx)(`span`,{className:`grow`,children:e(t===1?`{count} new agent waiting in the lobby`:`{count} new agents waiting in the lobby`,{count:t})}),!n&&(0,N.jsx)(`button`,{className:`btn btn-small`,onClick:()=>r(0),children:(0,N.jsx)(A,{children:`Meet them`})})]}):null}function jm({focusId:e}){let t=E(e=>e.requests),n=E(e=>e.demo),r=ne(t),i=t.filter(e=>e.status!==`pending`).slice(-8).reverse();return(0,N.jsxs)(`div`,{className:`phone-scroll`,children:[(0,N.jsxs)(`h3`,{className:`phone-h`,children:[(0,N.jsx)(A,{children:`👥 Waiting on you`}),` `,r.length>0&&(0,N.jsx)(`span`,{className:`badge`,children:r.length})]}),r.length===0&&(0,N.jsx)(`p`,{className:`muted small phone-empty`,children:(0,N.jsx)(A,{children:`Nothing waiting. When the CEO wants a floor’s team to grow or shrink, the change shows up here for your OK.`})}),r.map(t=>(0,N.jsx)(km,{req:t,highlight:t.id===e},t.id)),n&&(0,N.jsxs)(`div`,{className:`row wrap`,children:[(0,N.jsx)(`span`,{className:`muted small`,children:`Demo:`}),(0,N.jsx)(`button`,{className:`btn btn-small btn-ghost`,onClick:()=>void ym(()=>k.demoPropose(`hire`)),children:(0,N.jsx)(A,{children:`👥 Grow a floor`})}),(0,N.jsx)(`button`,{className:`btn btn-small btn-ghost`,onClick:()=>void ym(()=>k.demoPropose(`let-go`)),children:(0,N.jsx)(A,{children:`✉️ Shrink a floor`})})]}),i.length>0&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`h3`,{className:`phone-h`,children:(0,N.jsx)(A,{children:`Earlier`})}),i.map(e=>(0,N.jsx)(km,{req:e},e.id))]})]})}function Mm({m:e}){let t=j(),n=E(t=>t.voiceCache.saved.includes(e.id)),r=E(t=>t.voiceSpeaking===e.id),i=g(e,n,typeof speechSynthesis<`u`);if(!i)return null;let a=i===`gone`;return(0,N.jsx)(`button`,{type:`button`,className:`bubble-play ${r?`bubble-play-on`:``}`,disabled:a&&!r,title:a?t(`Audio no longer saved`):void 0,"aria-label":t(r?`Stop this message`:`Play this message`),onClick:()=>void T(()=>import(`./voiceMessages-BF3P4sjw.js`).then(t=>r?t.stopSpeaking():i!==`gone`&&t.replayMessage(e,i)),__vite__mapDeps([0,1,2,3,4,5,6,7,8])),children:r?`⏹`:`▶`})}var Nm=[`What's everyone working on?`,`Should a team grow?`,`Plan the next milestone for the busiest floor.`];function Pm({ceoName:e}){let t=j(),n=E(e=>e.settings.listen);if(E(e=>`${e.voiceKeySet}:${e.settings.voice.provider}`),!n||n.provider===`off`)return null;let r=n.handsFree,i=De(e);return(0,N.jsxs)(`button`,{type:`button`,className:`hands-free ${r?`hands-free-on`:``}`,"aria-pressed":r,title:r?t(`Hands-free is on: after {name}’s spoken reply the phone listens for up to 8 s and sends what you say. Esc or M closes the mic.`,{name:e}):i||t(`Hands-free: talk with {name} without touching anything`,{name:e}),onClick:()=>void Ee(!r,e),children:[`🎧 `,t(r?`Hands-free on`:`Hands-free`)]})}function Fm({m:e,ceoName:t}){let n=E(t=>e.requestId?t.requests.find(t=>t.id===e.requestId):void 0);if(e.from===`office`)return(0,N.jsx)(`div`,{className:`bubble-office`,children:e.text});let r=e.from===`manager`;return(0,N.jsx)(`div`,{className:`bubble-row ${r?`bubble-row-me`:``}`,children:(0,N.jsxs)(`div`,{className:`bubble ${r?`bubble-me`:`bubble-them`}`,children:[!r&&(0,N.jsx)(`div`,{className:`bubble-from`,children:t}),r?(0,N.jsx)(`div`,{className:`bubble-text`,children:e.text}):(0,N.jsx)(Od,{className:`bubble-md`,text:e.text}),n&&n.status===`pending`&&e.from===`ceo`&&(0,N.jsx)(km,{req:n}),(0,N.jsxs)(`div`,{className:`bubble-time`,children:[!r&&(0,N.jsx)(Mm,{m:e}),bm(e.at)]})]})})}function Im({autoFocus:e=!0}){let t=j(),n=E(e=>e.messages),r=E(e=>e.phoneReadAt),i=E(e=>e.agents.ceo),a=E(e=>e.ceo),o=E(e=>e.settings),s=E(e=>Object.values(e.agents).filter(x).length),[c,l]=(0,M.useState)(``),u=(0,M.useRef)(null);if((0,M.useEffect)(()=>{let e=[...n].reverse().find(e=>e.from===`ceo`);e&&e.at>r&&ym(()=>k.phoneRead(e.at))},[n,r]),(0,M.useLayoutEffect)(()=>{let e=u.current;e&&(e.scrollTop=e.scrollHeight)},[n.length,a.job?.kind]),!i)return(0,N.jsx)(`p`,{className:`muted phone-empty`,children:(0,N.jsx)(A,{children:`The corner office is empty.`})});let d=e=>{let t=e.trim();t&&(l(``),ym(()=>k.messageCeo(t)))},f=i.status===`working`&&a.job?.kind===`chat`,p=a.queue.some(e=>e.kind===`chat`),m=i.status===`working`?f?t(`typing…`):t(`busy: {job}`,{job:a.job?.label??t(`working`)}):p?o.sessionLimit&&s>=o.sessionLimit?t(`will reply when a session slot frees up ({running}/{max} busy)`,{running:s,max:o.sessionLimit}):t(`reading your message…`):a.queue.length?t(`next up: {job}`,{job:a.queue[0].label}):t(`available`);return(0,N.jsxs)(`div`,{className:`phone-chat`,children:[(0,N.jsxs)(`div`,{className:`chat-head`,children:[(0,N.jsx)(xm,{name:i.name,color:i.color}),(0,N.jsxs)(`div`,{className:`grow`,children:[(0,N.jsx)(`b`,{children:i.name}),` `,(0,N.jsx)(`span`,{className:`muted small`,children:`CEO`}),(0,N.jsx)(`div`,{className:`small ${i.status===`working`?`presence-busy`:`muted`}`,children:m})]}),(0,N.jsx)(Pm,{ceoName:i.name})]}),(0,N.jsxs)(`div`,{className:`chat-log`,ref:u,"aria-label":t(`Messages with {name}`,{name:i.name}),tabIndex:0,children:[n.length===0&&(0,N.jsx)(`p`,{className:`muted small phone-empty`,children:t(`Say hi to {name}. Ask how things are going, hand over a project brief, or ask whether a team should grow. Replies land here, and the phone buzzes when {name} needs you.`,{name:i.name})}),n.map(e=>(0,N.jsx)(Fm,{m:e,ceoName:i.name},e.id)),f&&(0,N.jsx)(`div`,{className:`bubble-row`,children:(0,N.jsxs)(`div`,{className:`bubble bubble-them bubble-typing`,children:[(0,N.jsx)(`span`,{}),(0,N.jsx)(`span`,{}),(0,N.jsx)(`span`,{})]})})]}),(0,N.jsx)(`div`,{className:`quick`,children:Nm.map(e=>(0,N.jsx)(`button`,{className:`quick-chip`,onClick:()=>d(t(e)),children:t(e)},e))}),(0,N.jsxs)(`form`,{className:`chat-input`,onSubmit:e=>{e.preventDefault(),d(c)},children:[(0,N.jsx)(kd,{value:c,onChange:l,placeholder:`${t(`Message {name}`,{name:i.name})}…`,"aria-label":t(`Message {name}`,{name:i.name}),title:t(`Enter sends · Shift+Enter adds a new line`),autoFocus:e}),(0,N.jsx)(jd,{kind:`phone`,value:c,onChange:l,onSend:d}),(0,N.jsx)(`button`,{className:`btn btn-small btn-good`,disabled:!c.trim(),children:(0,N.jsx)(A,{children:`Send`})})]})]})}function Lm(){let e=j(),t=E(e=>e.repos),n=E(e=>e.agents),r=E(e=>e.qa),i=E(e=>e.requests),a=E(e=>e.settings),o=E(e=>e.ceo);return(0,M.useMemo)(()=>{let s=Object.values(n).filter(e=>e.role!==`ceo`),c=n.ceo,l=Object.values(n).filter(x).length,u=t.map(e=>{let t=s.filter(t=>t.repoId===e.id),n=te(e,r);return{repo:e,team:t.length,working:t.filter(x).length,idle:t.filter(e=>!x(e)).length,issues:e.issues.length,prs:e.pulls.filter(e=>e.state===`OPEN`).length,inQa:n.inQa,ready:n.ready,stuck:n.needsYou,merged:e.pulls.filter(e=>e.state===`MERGED`).length}}),d=e=>u.reduce((t,n)=>t+n[e],0),f=ne(i).length,p=[],m=u.filter(e=>e.ready>0);m.length&&p.push({icon:`✅`,text:e(d(`ready`)===1?`{count} pull request passed QA and is ready for you to merge ({projects}).`:`{count} pull requests passed QA and are ready for you to merge ({projects}).`,{count:d(`ready`),projects:m.map(e=>`${e.repo.fullName.split(`/`)[1]}: ${e.ready}`).join(`, `)}),tone:`good`}),d(`stuck`)&&p.push({icon:`⚠️`,text:e(d(`stuck`)===1?`{count} pull request needs your call: the team can’t move it on alone.`:`{count} pull requests need your call: the team can’t move them on alone.`,{count:d(`stuck`)}),tone:`warn`}),f&&p.push({icon:`👥`,text:e(f===1?`{count} team change is waiting in Team.`:`{count} team changes are waiting in Team.`,{count:f}),tone:`warn`}),p.push({icon:`⚙️`,text:a.sessionLimit?l?e(`{running} of {max} session slots are busy right now.`,{running:l,max:a.sessionLimit}):e(`Nobody is working at the moment ({max} session slots free).`,{max:a.sessionLimit}):l?e(l===1?`{count} session is running right now.`:`{count} sessions are running right now.`,{count:l}):e(`Nobody is working at the moment.`)});for(let t of u)t.issues>0&&!t.repo.autoAssign&&t.working===0&&t.idle>0&&p.push({icon:`💤`,text:e(`{repo} has {count} open issues and free agents, but auto-assign is off.`,{repo:t.repo.fullName.split(`/`)[1],count:t.issues})});let h=[...u].sort((e,t)=>t.issues+t.prs-(e.issues+e.prs))[0];return h&&h.issues+h.prs>0&&u.length>1&&p.push({icon:`🔥`,text:e(`Most work in flight: {repo} ({issues} issues, {pulls} PRs).`,{repo:h.repo.fullName.split(`/`)[1],issues:h.issues,pulls:h.prs})}),c&&p.push({icon:`🧠`,text:c.status===`working`?e(`{name} is {job}.`,{name:c.name,job:(o.job?.label??e(`working`)).replace(/^\w/,e=>e.toLowerCase())}):o.nextReviewAt?e(`{name} reviews the company next at {time}.`,{name:c.name,time:bm(o.nextReviewAt)}):e(`{name}’s periodic reviews are off.`,{name:c.name})}),u.length===0&&p.splice(0,p.length,{icon:`👋`,text:e(`No projects yet. Connect a repo in the manager’s office (lobby, back left) and the CEO will staff it.`)}),{floors:u,staff:s.length,running:l,max:a.sessionLimit,issues:d(`issues`),prs:d(`prs`),report:p}},[t,n,r,i,a,o,e])}function Rm(){let e=j(),t=E(e=>e.openOverlay),n=E(e=>e.repos.find(t=>t.floor===e.floor)?.id);return(0,N.jsxs)(`nav`,{className:`phone-links`,"aria-label":e(`Open a panel`),children:[(0,N.jsx)(`button`,{className:`btn btn-small`,onClick:()=>t({kind:`manager`}),children:(0,N.jsx)(A,{children:`🧑‍💼 Console`})}),n&&(0,N.jsx)(`button`,{className:`btn btn-small`,onClick:()=>t({kind:`kanban`,repoId:n}),children:(0,N.jsx)(A,{children:`📋 Kanban`})}),(0,N.jsx)(`button`,{className:`btn btn-small`,onClick:()=>t({kind:`floorList`}),children:(0,N.jsx)(A,{children:`👥 Floor list`})}),(0,N.jsx)(`button`,{className:`btn btn-small`,onClick:()=>t({kind:`help`}),children:(0,N.jsx)(A,{children:`❓ Help`})}),(0,N.jsx)(`button`,{className:`btn btn-small`,onClick:()=>t({kind:`manager`,tab:`access`}),children:(0,N.jsx)(A,{children:`♿ Accessibility`})})]})}function zm(){let e=j(),t=Lm(),n=E(e=>e.goToFloor),r=[[`🏢`,t.floors.length,t.floors.length===1?`project`:`projects`],[`📋`,t.issues,`open issues`],[`🔀`,t.prs,`open PRs`],[`👥`,t.staff,`on staff`],[`⚙️`,t.max?`${t.running}/${t.max}`:`${t.running}`,`working now`]];return(0,N.jsxs)(`div`,{className:`phone-scroll`,children:[(0,N.jsx)(`div`,{className:`tiles`,children:r.map(([t,n,r])=>(0,N.jsxs)(`div`,{className:`tile`,children:[(0,N.jsxs)(`div`,{className:`tile-value`,children:[t,` `,n]}),(0,N.jsx)(`div`,{className:`tile-label`,children:e(r)})]},r))}),(0,N.jsx)(Rm,{}),(0,N.jsx)(`h3`,{className:`phone-h`,children:(0,N.jsx)(A,{children:`Today’s report`})}),(0,N.jsx)(`ul`,{className:`report`,children:t.report.map((e,t)=>(0,N.jsxs)(`li`,{className:e.tone?`report-${e.tone}`:``,children:[(0,N.jsx)(`span`,{children:e.icon}),(0,N.jsx)(`span`,{children:e.text})]},t))}),t.floors.length>0&&(0,N.jsx)(`h3`,{className:`phone-h`,children:(0,N.jsx)(A,{children:`Projects`})}),t.floors.map(t=>(0,N.jsxs)(`div`,{className:`proj`,style:{"--accent":t.repo.color},children:[(0,N.jsxs)(`div`,{className:`row`,children:[(0,N.jsx)(`span`,{className:`floor-badge`,children:t.repo.floor}),(0,N.jsxs)(`div`,{className:`grow`,style:{minWidth:0},children:[(0,N.jsx)(`b`,{className:`proj-name`,children:t.repo.fullName.split(`/`)[1]}),(0,N.jsx)(`div`,{className:`muted small proj-sum`,children:t.repo.summary||t.repo.description||t.repo.fullName})]}),(0,N.jsx)(`button`,{className:`btn btn-small`,onClick:()=>n(t.repo.floor),children:(0,N.jsx)(A,{children:`Go`})})]}),(0,N.jsxs)(`div`,{className:`proj-stats small`,children:[(0,N.jsxs)(`span`,{children:[`👥 `,t.team,t.working?e(` ({count} busy)`,{count:t.working}):``]}),(0,N.jsxs)(`span`,{children:[`📋 `,t.issues]}),(0,N.jsxs)(`span`,{children:[`🔍 `,t.inQa]}),(0,N.jsxs)(`span`,{className:t.ready?`proj-ready`:``,children:[`✅ `,t.ready]}),(0,N.jsxs)(`span`,{children:[`🎉 `,t.merged]})]})]},t.repo.id))]})}var Bm=null,Vm=()=>{let e=E.getState();return ne(e.requests).length+v(e.messages,e.phoneReadAt)};function Hm({tab:e,requestId:t}){let n=j(),[r,i]=(0,M.useState)(()=>Bm&&!t&&Vm()<=Bm.waiting?`games`:e??(t?`hires`:`chat`)),[a,o]=(0,M.useState)(()=>r===`games`?Bm?.game??null:null),s=(0,M.useRef)({tab:r,game:a});(0,M.useEffect)(()=>{s.current={tab:r,game:a}}),(0,M.useEffect)(()=>()=>{Bm=s.current.tab===`games`?{game:s.current.game,waiting:Vm()}:null},[]);let c=E(e=>e.openOverlay),l=(0,M.useRef)(null);me(l);let u=E(e=>e.requests),d=E(e=>e.messages),f=E(e=>e.phoneReadAt),p=E(e=>e.agents.ceo?.name??`CEO`),m=E(e=>(e.settings.listen?.provider??`off`)!==`off`),[h,g]=(0,M.useState)(Date.now());(0,M.useEffect)(()=>{let e=setInterval(()=>g(Date.now()),2e4);return()=>clearInterval(e)},[]),(0,M.useEffect)(()=>{c({kind:`phone`,tab:r,requestId:t})},[r]),(0,M.useEffect)(()=>{let e=e=>{let t=e.target,n=!!t&&(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.tagName===`SELECT`);(e.key===`Escape`||!n&&Te(`phone`,e.code))&&(e.preventDefault(),Md())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let _=ne(u).length,y=v(d,f),b=[[`chat`,`💬`,p,r===`chat`?0:y],[`hires`,`👥`,`Team`,_],[`company`,`📊`,`Company`,0],[`games`,`🎮`,`Games`,0]];return(0,N.jsx)(`div`,{className:`overlay phone-overlay`,onMouseDown:e=>e.target===e.currentTarget&&Md(),children:(0,N.jsxs)(`div`,{className:`phone`,ref:l,role:`dialog`,"aria-modal":`true`,"aria-label":n(`Your phone`),tabIndex:-1,children:[(0,N.jsxs)(`div`,{className:`phone-status`,"aria-hidden":!0,children:[(0,N.jsx)(`span`,{children:bm(h)}),(0,N.jsx)(`span`,{className:`phone-notch`}),(0,N.jsx)(`span`,{children:`📶 🔋`})]}),(0,N.jsx)(mm,{}),(0,N.jsxs)(`div`,{className:`phone-screen`,children:[r!==`games`&&(0,N.jsx)(Am,{}),r===`chat`&&(0,N.jsx)(Im,{}),r===`hires`&&(0,N.jsx)(jm,{focusId:t}),r===`company`&&(0,N.jsx)(zm,{}),r===`games`&&(0,N.jsx)(pm,{game:a,onGame:o})]}),(0,N.jsx)(`nav`,{className:`phone-tabs`,role:`tablist`,"aria-label":n(`Phone`),children:b.map(([e,t,a,s])=>(0,N.jsxs)(`button`,{role:`tab`,"aria-selected":r===e,"aria-label":s>0?`${e===`chat`?a:n(a)}, ${s}`:e===`chat`?a:n(a),className:`phone-tab ${r===e?`phone-tab-on`:``}`,onClick:()=>e===`games`&&r===`games`?o(null):i(e),children:[(0,N.jsxs)(`span`,{className:`phone-tab-icon`,"aria-hidden":!0,children:[t,s>0&&(0,N.jsx)(`span`,{className:`badge badge-dot`,children:s})]}),(0,N.jsx)(`span`,{children:e===`chat`?a:n(a)})]},e))}),(0,N.jsxs)(`div`,{className:`phone-hint`,children:[r===`chat`&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`kbd`,{children:`Shift`}),`+`,(0,N.jsx)(`kbd`,{children:`Enter`}),` `,n(`new line`),` ·`,` `,m&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Pd,{action:`talk`}),` `,n(`to talk`),` ·`,` `]})]}),r===`games`&&a&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`kbd`,{children:`Backspace`}),` `,n(`games`),` ·`,` `]}),(0,N.jsx)(Pd,{action:`phone`}),` `,n(`or`),` `,(0,N.jsx)(`kbd`,{children:`Esc`}),` `,n(`to put it away`)]})]})})}var Um={idle:`Idle`,preparing:`Setting up`,working:`Working`,done:`Finished`,error:`Needs help`,stopped:`Stopped`},Wm={claude:`Claude Code`,codex:`Codex`,opencode:`OpenCode`},Gm=(e,t)=>t.runtime===`terminal`?e.cli||(e.role===`ceo`?`opencode`:t.defaultCli):`claude`;function Km(e,t,n){if(e.role===`ceo`)return`CEO`;let r=Gm(e,t);return n.find(e=>e.id===r)?.label??Wm[r]}function qm(e,t){return e.role!==`ceo`&&e.host===`box`&&e.needsSignIn?Wm[e.cli||t.defaultCli]:null}function Jm(e,t){let n=(e,n)=>O(t,e,n);if(e.role===`ceo`)return e.status===`working`?e.issueTitle??n(`Working`):n(`Free for a chat`);if(e.status===`idle`)return n(`Nothing assigned`);if(e.task===`analysis`)return n(`Read-only analysis`);let r=e.issueTitle?`: ${e.issueTitle}`:``;return e.task===`qa`?e.prNumber?n(`Testing PR #{number}`,{number:e.prNumber})+r:n(`Testing`):e.task===`fix`&&e.prNumber?n(`Fixing PR #{number}`,{number:e.prNumber})+r:e.issueNumber?n(`Issue #{number}`,{number:e.issueNumber})+r:e.issueTitle??n(`Working`)}function Ym(e,t,n){return e.map(e=>{let r=qm(e,t),i=r?`attention`:m[e.status];return{id:e.id,name:e.name,agent:Km(e,t,n),status:O(t.language,r?`Needs you to sign in`:Um[e.status]),kind:i,icon:C[i],doing:r?`${O(t.language,`Waiting for {provider} to be signed in`,{provider:r})}${e.status===`idle`?``:` · ${Jm(e,t.language)}`}`:Jm(e,t.language),signIn:r}})}function Xm(e){return e.local?`local`:e.protocol===`https:`?e.secure&&e.serviceWorker?`https`:`unsupported`:`remote-http`}var Zm=e=>[`remote-http`,`unsupported`].includes(Xm(e));function Qm(e){return Number.isInteger(e)&&e>0&&e<=65535?`tailscale serve --bg --https=443 http://127.0.0.1:${e}`:null}function $m(e){try{let t=new URL(e.trim());return t.protocol!==`https:`||t.username||t.password||t.pathname!==`/`||t.search||t.hash?null:`${t.origin}/?pocket=1`}catch{return null}}function eh(e,t){if(!e||typeof e!=`object`)return!1;let n=e;return n.type===`cubefarm-preview-check`&&n.nonce===t&&typeof n.worker==`boolean`&&typeof n.script==`boolean`&&typeof n.styles==`boolean`}function th(){return{local:D(location),protocol:location.protocol,secure:window.isSecureContext,serviceWorker:`serviceWorker`in navigator}}function nh({blocked:e=!1}){let t=j(),[n,r]=(0,M.useState)(e),[i,a]=(0,M.useState)(`tailscale`),[o,s]=(0,M.useState)(null),[c,l]=(0,M.useState)(!1),[u,d]=(0,M.useState)(0),[f,p]=(0,M.useState)(``),[m,h]=(0,M.useState)(null),[g,_]=(0,M.useState)(`idle`),[v,y]=(0,M.useState)(!1),b=th(),x=Xm(b),S=b.secure&&b.serviceWorker,C=$m(f),w=o?.supportsLoopbackProxy?Qm(o.port):null;return(0,M.useEffect)(()=>{if(!n)return;let e=!1;return l(!1),k.phoneAccess().then(t=>{e||s(t)},()=>{e||l(!0)}),()=>{e=!0}},[n,u]),(0,M.useEffect)(()=>{if(!m)return;let e=e=>{let t=document.getElementById(`phone-access-${m}`);e.origin===location.origin&&e.source===t?.contentWindow&&eh(e.data,m)&&(_(e.data.worker&&e.data.script&&e.data.styles?`passed`:`failed`),h(null))};window.addEventListener(`message`,e);let t=setTimeout(()=>{_(`failed`),h(null)},15e3);return()=>{clearTimeout(t),window.removeEventListener(`message`,e)}},[m]),(0,N.jsxs)(`section`,{className:`card phone-access ${e?`phone-access-blocked`:``}`,"aria-label":t(`Phone access`),children:[(0,N.jsx)(`h3`,{children:(0,N.jsx)(A,{children:`📱 Phone access`})}),(0,N.jsx)(`p`,{role:e?`alert`:`status`,children:t(x===`local`?`You are on the office computer. Local previews need no remote setup.`:x===`https`?`HTTPS and service workers are available in this browser. Verify the preview transport below.`:x===`remote-http`?`Remote HTTP cannot load previews reliably. CSS and scripts may go missing. Use a private HTTPS address.`:`This browser cannot use the preview service worker. Check the certificate, browser support and whether an insecure page is embedding the office.`)}),n?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`p`,{className:`term-error`,children:(0,N.jsx)(A,{children:`HTTPS encrypts the connection; it does not authorize visitors. Anyone with access to this office can control agents and run commands. Keep it private or behind authentication.`})}),(0,N.jsx)(`p`,{className:`muted small`,children:(0,N.jsx)(A,{children:`This guide never changes your network, certificates, firewall or office settings. Run commands yourself on the office computer only after reviewing them.`})}),o&&!o.loopbackOnly&&(0,N.jsx)(`p`,{className:`term-error`,children:(0,N.jsx)(A,{children:`The office currently listens beyond loopback. HTTPS will not close that existing access. Review the bind address and firewall separately.`})}),(0,N.jsxs)(`div`,{className:`seg`,role:`group`,"aria-label":t(`HTTPS setup method`),children:[(0,N.jsx)(`button`,{className:`seg-btn ${i===`tailscale`?`seg-on`:``}`,"aria-pressed":i===`tailscale`,onClick:()=>a(`tailscale`),children:`Tailscale`}),(0,N.jsx)(`button`,{className:`seg-btn ${i===`proxy`?`seg-on`:``}`,"aria-pressed":i===`proxy`,onClick:()=>a(`proxy`),children:(0,N.jsx)(A,{children:`Own HTTPS proxy`})})]}),i===`tailscale`?(0,N.jsxs)(`ol`,{children:[(0,N.jsx)(`li`,{children:(0,N.jsx)(A,{children:`Install Tailscale on the office computer and phone, sign in to your tailnet, and allow only trusted users/devices in its access rules.`})}),(0,N.jsxs)(`li`,{children:[(0,N.jsx)(A,{children:`On the office computer, inspect existing Serve routes first. Do not overwrite a route used by another service.`}),(0,N.jsx)(`pre`,{className:`term`,children:`tailscale serve status`})]}),(0,N.jsxs)(`li`,{children:[(0,N.jsx)(A,{children:`After reviewing the route and any HTTPS/certificate prompts, run the following command yourself. It persists across restarts.`}),w?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`pre`,{className:`term`,children:w}),(0,N.jsx)(`button`,{className:`btn btn-small`,disabled:!navigator.clipboard?.writeText,onClick:()=>void navigator.clipboard.writeText(w).then(()=>y(!0),()=>y(!1)),children:t(v?`Copied`:`Copy command`)})]}):(0,N.jsx)(`p`,{className:`muted small`,children:t(c?`Could not read the office port. Retry; no command has been generated.`:o?`This bind address is not confirmed reachable through 127.0.0.1. Review SWARM_HOST on the office computer before configuring a loopback proxy.`:`Reading the actual office port…`)}),c&&(0,N.jsx)(`button`,{className:`btn btn-small`,onClick:()=>d(e=>e+1),children:(0,N.jsx)(A,{children:`Retry port check`})})]}),(0,N.jsx)(`li`,{children:(0,N.jsx)(A,{children:`Use the HTTPS address printed by Serve on your phone. Enable HTTPS in the tailnet if Tailscale asks. Serve is private to your tailnet; do not use Funnel or open a public router port.`})})]}):(0,N.jsxs)(`ol`,{children:[(0,N.jsx)(`li`,{children:(0,N.jsx)(A,{children:`Use a trusted private proxy or an identity-aware HTTPS proxy. Put authentication/access control in front of the whole office, including API, preview and WebSocket routes; a public certificate alone is not enough.`})}),(0,N.jsxs)(`li`,{children:[(0,N.jsx)(A,{children:`Mount the office at the root of a dedicated HTTPS origin, not a subpath. Forward all paths unchanged, support WebSocket upgrades, and proxy to the office’s local listening port.`}),o&&(0,N.jsx)(`pre`,{className:`term`,children:t(`Office listening port: {port}`,{port:o.port})})]}),(0,N.jsx)(`li`,{children:(0,N.jsx)(A,{children:`Use a certificate trusted by the phone. Do not bypass browser certificate warnings or disable browser security. Follow your proxy’s authentication and TLS documentation.`})})]}),(0,N.jsx)(`p`,{className:`small`,children:(0,N.jsx)(`a`,{href:`https://tailscale.com/kb/1242/tailscale-serve`,target:`_blank`,rel:`noopener noreferrer`,children:(0,N.jsx)(A,{children:`Tailscale Serve documentation ↗`})})}),(0,N.jsxs)(`label`,{className:`field`,children:[(0,N.jsx)(`span`,{children:(0,N.jsx)(A,{children:`Your private HTTPS office address`})}),(0,N.jsx)(`input`,{type:`url`,value:f,onChange:e=>p(e.target.value),placeholder:`https://your-office.example`,autoComplete:`off`,spellCheck:!1})]}),f&&!C&&(0,N.jsx)(`p`,{className:`term-error`,children:(0,N.jsx)(A,{children:`Enter an HTTPS origin only, without a path, query, fragment or embedded credentials.`})}),C&&(0,N.jsx)(`a`,{className:`btn`,href:C,target:`_blank`,rel:`noopener noreferrer`,children:(0,N.jsx)(A,{children:`Open HTTPS office ↗`})}),(0,N.jsx)(`p`,{className:`muted small`,children:(0,N.jsx)(A,{children:`After verifying the address, you may enter it under Notifications → Office address for links. That field only changes notification links; it does not configure remote access.`})}),(0,N.jsx)(`h4`,{children:(0,N.jsx)(A,{children:`Verify on the phone`})}),(0,N.jsx)(`p`,{className:`muted small`,children:(0,N.jsx)(A,{children:`Open the private HTTPS office on your phone and run this check there. A local check does not validate the phone or your access rules.`})}),(0,N.jsx)(`button`,{className:`btn`,disabled:!S||g===`checking`,onClick:()=>{if(!S)return;let e=crypto.getRandomValues(new Uint8Array(16));_(`checking`),h(Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``))},children:t(g===`checking`?`Checking preview transport…`:`Check preview CSS and scripts`)}),!S&&(0,N.jsx)(`p`,{className:`muted small`,children:(0,N.jsx)(A,{children:`The check needs a secure browser context with service workers. Reopen the office over trusted HTTPS first.`})}),g===`passed`&&(0,N.jsx)(`p`,{role:`status`,children:(0,N.jsx)(A,{children:`✓ The preview worker loaded the test CSS and JavaScript correctly in this browser.`})}),g===`failed`&&(0,N.jsx)(`p`,{role:`alert`,children:(0,N.jsx)(A,{children:`The transport check failed or timed out. Check the certificate, browser service-worker permissions and proxy routes, then retry. No project was started.`})}),(0,N.jsx)(`p`,{className:`muted small`,children:(0,N.jsx)(A,{children:`This uses synthetic test assets only, with no AI work or dependency installs. It verifies worker/CSS/JavaScript routing, not every app’s compatibility, authentication or WebSocket connection.`})}),m&&(0,N.jsx)(`iframe`,{id:`phone-access-${m}`,hidden:!0,title:t(`Preview transport check`),sandbox:`allow-scripts allow-same-origin`,src:`/preview/0/__cubefarm_check__?nonce=${m}`},m)]}):(0,N.jsx)(`button`,{className:`btn`,onClick:()=>r(!0),children:(0,N.jsx)(A,{children:`Set up phone access`})})]})}var rh=!1;function ih({animated:e=!1}){let[t]=(0,M.useState)(()=>e&&!rh);return(0,M.useEffect)(()=>{t&&(rh=!0)},[t]),(0,N.jsxs)(`span`,{className:`brand-icon${t?` brand-assemble`:``}`,"aria-hidden":`true`,children:[(0,N.jsx)(`img`,{className:`brand-static`,src:`/icons/icon.svg`,alt:``,width:`152`,height:`170`}),t&&(0,N.jsx)(`span`,{className:`brand-parts`,children:[`wire`,`shell`,`eyes`,`antenna`,`spark`].map(e=>(0,N.jsx)(`img`,{className:`brand-part brand-${e}`,src:`/icons/droid-${e}.svg`,alt:``,width:`152`,height:`170`},e))})]})}function ah({animated:e=!1}){return(0,N.jsxs)(`div`,{className:`brand-lockup`,children:[(0,N.jsx)(ih,{animated:e}),(0,N.jsxs)(`div`,{className:`brand-type`,children:[(0,N.jsxs)(`div`,{className:`brand-name`,"aria-label":`Droidsembly`,children:[`Droid`,(0,N.jsx)(`span`,{children:`sembly`})]}),(0,N.jsx)(`div`,{className:`brand-payoff`,lang:`en`,children:`Software, assembled by agents.`})]})]})}function oh({agent:e,card:t}){return e?(0,N.jsxs)(`span`,{className:`agent-chip`,children:[(0,N.jsx)(`span`,{className:`dot`,style:{background:e.color}}),e.name,e.task===`qa`&&t.prNumber!=null&&e.prNumber===t.prNumber&&(0,N.jsx)(`span`,{className:`chip`,children:`QA`})]}):null}function sh({repoId:e,agents:t,onDone:n}){let r=j(),[i,a]=(0,M.useState)(``),[o,s]=(0,M.useState)(``),[c,l]=(0,M.useState)(``),[u,d]=(0,M.useState)(!1),f=t.filter(e=>e.role!==`ceo`&&e.status!==`working`&&e.status!==`preparing`);return(0,N.jsxs)(`form`,{className:`issue-form`,onSubmit:async t=>{if(t.preventDefault(),i.trim()){d(!0);try{await k.createIssue(e,i,o,c||void 0),a(``),s(``),l(``),n?.()}catch{}finally{d(!1)}}},children:[(0,N.jsx)(`input`,{value:i,onChange:e=>a(e.target.value),placeholder:r(`Issue title, e.g. Add a dark mode toggle`),"aria-label":r(`Issue title`),autoFocus:!0}),(0,N.jsx)(`textarea`,{value:o,onChange:e=>s(e.target.value),placeholder:r(`Describe what you want. Acceptance criteria help the agent who builds it and the one who tests it a lot.`),"aria-label":r(`Issue description`),rows:5}),(0,N.jsxs)(`div`,{className:`row`,children:[(0,N.jsxs)(`select`,{value:c,onChange:e=>l(e.target.value),"aria-label":r(`Who works on it`),children:[(0,N.jsx)(`option`,{value:``,children:r(`Leave in backlog (auto-assign picks it up if enabled)`)}),f.map(e=>(0,N.jsx)(`option`,{value:e.id,children:r(`Give it to {name} right away`,{name:e.name})},e.id))]}),(0,N.jsx)(`button`,{className:`btn btn-good`,disabled:u||!i.trim(),children:r(u?`Filing…`:`File issue on GitHub`)})]})]})}function ch({embedded:e,...t}){return e?(0,N.jsxs)(`section`,{className:`kanban-embedded ${t.className??``}`,style:{"--accent":t.accent},children:[(0,N.jsx)(`h2`,{className:`kanban-embedded-title`,children:t.title}),t.children]}):(0,N.jsx)(Nd,{...t})}function lh({card:e}){return e.qa?.commentUrl?(0,N.jsx)(`a`,{className:`small`,href:e.qa.commentUrl,target:`_blank`,rel:`noreferrer`,title:e.qa.summary??``,children:(0,N.jsx)(A,{children:`QA report ↗`})}):null}function uh({repoId:e,embedded:t}){let n=j(),r=E(t=>t.repos.find(t=>t.id===e)),i=E(e=>e.agents),a=E(e=>e.qa),o=E(e=>e.usage.state),s=E(e=>e.settings.language),c=E(e=>e.openOverlay),l=(0,M.useMemo)(()=>re(i,e),[i,e]),u=(0,M.useMemo)(()=>r?h(r,l,a,{state:o},s):null,[r,l,a,o,s]),[d,f]=(0,M.useState)(!1),[p,m]=(0,M.useState)(null);if(!r||!u)return(0,N.jsx)(ch,{title:`Kanban`,embedded:t,children:(0,N.jsx)(`p`,{className:`muted`,children:(0,N.jsx)(A,{children:`This floor no longer exists.`})})});let g=async(e,t)=>{m(e);try{await t()}catch{}finally{m(null)}},_=l.filter(e=>e.role!==`ceo`),v=_.filter(e=>e.status===`idle`||e.status===`done`||e.status===`stopped`||e.status===`error`),y=async e=>{let t=e.qa?.status===`passed`;await fe(t?{icon:`🎉`,title:n(`Merge PR #{number}?`,{number:e.number}),body:n(`“{title}” passed QA. It will be squash-merged into {branch}.`,{title:e.title,branch:r.defaultBranch}),confirm:n(`Squash & merge`),cancel:n(`Cancel`)}:{tone:`warn`,title:n(`Merge PR #{number} without QA?`,{number:e.number}),body:n(`“{title}” has not passed QA yet. Merge it into {branch} anyway?`,{title:e.title,branch:r.defaultBranch}),confirm:n(`Merge anyway`),cancel:n(`Cancel`)})&&g(e.key,()=>k.mergePull(r.id,e.number))},b=async e=>{let t=``,i=e.qa?.status===`passed`;await fe({icon:`🔧`,title:n(i?`Request changes on PR #{number}?`:`Send PR #{number} back for a fix?`,{number:e.number}),body:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`p`,{children:n(i?`QA passed. Describe the additional changes you want. The previous report is preserved and the changes must pass a new QA round. This starts agent work and may consume AI quota.`:`Its author, or any free agent, fixes it with QA’s findings, then it’s tested once more.`)}),(0,N.jsx)(`input`,{maxLength:1e3,placeholder:n(i?`Required: describe the requested changes`:`Optional note, e.g. merge main and keep both e2e tests`),"aria-label":n(i?`Required: describe the requested changes`:`Note for whoever fixes it`),"aria-required":i,ref:e=>void(e&&setTimeout(()=>e.focus(),0)),onChange:e=>t=e.target.value})]}),confirm:n(i?`Request changes`:`Send back`)})&&g(e.key,()=>k.sendBack(r.id,e.number,t.trim()||void 0))},x=async e=>{await fe({tone:`danger`,title:n(`Close PR #{number}?`,{number:e.number}),body:n(`“{title}” will be closed without merging, and any QA or fix work on it stops. Its issue stays open and waits for you to assign it again. The branch stays on GitHub.`,{title:e.title}),confirm:n(`Close PR`)})&&g(e.key,()=>k.closePull(r.id,e.number))},S=e=>(0,N.jsx)(`button`,{className:`btn btn-small btn-ghost`,disabled:p===e.key,onClick:()=>void x(e),children:(0,N.jsx)(A,{children:`Close`})}),C=e=>(0,N.jsx)(`button`,{className:`btn btn-small`,title:n(`Run PR #{number} beside {branch} and open it in the app viewer`,{number:e.number,branch:r.defaultBranch}),onClick:()=>c({kind:`app`,repoId:r.id,pr:e.number}),children:(0,N.jsx)(A,{children:`Preview`})}),w=e=>e.agent&&(0,N.jsx)(`button`,{className:`btn btn-small`,onClick:()=>c({kind:`terminal`,agentId:e.agent.id}),children:(0,N.jsx)(A,{children:`Terminal`})}),T=(e,t,r,i,a)=>(0,N.jsxs)(`div`,{className:`kcol ${t}`,children:[(0,N.jsxs)(`div`,{className:`kcol-head`,children:[n(e),` `,(0,N.jsx)(`span`,{className:`count`,children:r.length})]}),(0,N.jsxs)(`div`,{className:`kcol-body`,children:[r.length===0&&(0,N.jsx)(`div`,{className:`muted small kempty`,children:n(a)}),r.map(e=>(0,N.jsxs)(`div`,{className:`kcard ${e.tone?`kcard-${e.tone}`:``}`,children:[(0,N.jsxs)(`div`,{className:`kcard-title`,children:[e.url?(0,N.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`,children:[e.prNumber?`PR `:``,`#`,e.number]}):(0,N.jsxs)(`b`,{children:[`#`,e.number]}),` `,e.title]}),i(e)]},e.key))]})]});return(0,N.jsxs)(ch,{embedded:t,wide:!0,className:`cyan-panel`,accent:`#65d8ef`,title:(0,N.jsxs)(`span`,{style:{borderLeft:`4px solid ${r.color}`,paddingLeft:8},children:[`📋 `,r.fullName,` `,(0,N.jsx)(`a`,{className:`small`,href:r.url,target:`_blank`,rel:`noreferrer`,children:`GitHub ↗`})]}),children:[(0,N.jsxs)(`div`,{className:`kanban-toolbar`,children:[(0,N.jsx)(`button`,{className:`btn btn-good`,onClick:()=>f(e=>!e),children:n(d?`Cancel`:`+ New issue`)}),(0,N.jsxs)(`label`,{className:`toggle`,children:[(0,N.jsx)(`input`,{type:`checkbox`,checked:r.autoAssign,onChange:e=>void k.updateRepo(r.id,{autoAssign:e.target.checked}).catch(()=>void 0)}),(0,N.jsx)(A,{children:`⚡ Auto-assign work to free agents`})]}),(0,N.jsxs)(`label`,{className:`toggle`,title:n(`Merge a PR as soon as QA has signed off on its latest commit and GitHub’s checks are green`),children:[(0,N.jsx)(`input`,{type:`checkbox`,checked:r.autoMerge,onChange:e=>void k.updateRepo(r.id,{autoMerge:e.target.checked}).catch(()=>void 0)}),(0,N.jsx)(A,{children:`🔀 Auto-merge when QA and checks pass`})]}),(0,N.jsx)(`span`,{className:`spacer`}),(0,N.jsx)(`button`,{className:`btn`,onClick:()=>c({kind:`app`,repoId:r.id}),title:n(`Open this floor’s running app`),children:(0,N.jsx)(A,{children:`🖥️ View app`})}),(0,N.jsx)(`span`,{className:`muted small`,children:r.lastSync?n(`Synced {time}`,{time:new Date(r.lastSync).toLocaleTimeString()}):n(`Syncing…`)}),(0,N.jsx)(`button`,{className:`btn`,disabled:p===`sync`,onClick:()=>g(`sync`,()=>k.syncRepo(r.id)),children:(0,N.jsx)(A,{children:`⟳ Sync`})})]}),r.syncError&&(0,N.jsxs)(`div`,{className:`term-error`,children:[`⚠️ `,r.syncError]}),d&&(0,N.jsx)(sh,{repoId:r.id,agents:_,onDone:()=>f(!1)}),(0,N.jsxs)(`div`,{className:`kanban kanban-5`,children:[T(`📋 Backlog`,`kcol-backlog`,u.backlog,e=>(0,N.jsxs)(`div`,{className:`kcard-foot`,children:[e.note&&(0,N.jsx)(`span`,{className:`muted small`,children:e.note}),(0,N.jsxs)(`select`,{value:``,disabled:p===e.key||v.length===0,onChange:t=>t.target.value&&g(e.key,()=>k.assign(t.target.value,e.number)),"aria-label":n(`Assign issue #{number}`,{number:e.number}),children:[(0,N.jsx)(`option`,{value:``,children:n(v.length?`Assign to…`:`Everyone is busy`)}),v.map(e=>(0,N.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]}),`No open issues. File one above!`),T(`🔨 In progress`,`kcol-progress`,u.progress,e=>(0,N.jsxs)(`div`,{className:`kcard-foot`,children:[(0,N.jsx)(oh,{agent:e.agent,card:e}),(0,N.jsx)(`span`,{className:`muted small`,children:e.note}),(0,N.jsx)(`span`,{className:`spacer`}),w(e)]}),`Nobody is coding right now.`),T(`🔍 In QA`,`kcol-qa`,u.qa,e=>{let t=e.qa?.status;return(0,N.jsxs)(`div`,{className:`kcard-foot kcard-foot-wrap`,children:[(0,N.jsx)(oh,{agent:e.agent,card:e}),(0,N.jsx)(`span`,{className:`muted small`,children:e.note}),(0,N.jsx)(`span`,{className:`spacer`}),(0,N.jsx)(lh,{card:e}),C(e),(t===`testing`||t===`fixing`)&&w(e),(!t||t===`needs-human`)&&(0,N.jsx)(`button`,{className:`btn btn-small btn-good`,disabled:p===e.key,onClick:()=>g(e.key,()=>k.sendToQa(r.id,e.number)),children:n(t===`needs-human`?`Retry QA`:`Send to QA`)}),(t===`needs-human`||t===`failed`)&&(0,N.jsx)(`button`,{className:`btn btn-small`,disabled:p===e.key,title:n(`Hand it to its author, or any free agent, with QA’s findings and your note, without another QA round first`),onClick:()=>b(e),children:(0,N.jsx)(A,{children:`Send back for a fix`})}),t===`needs-human`&&(0,N.jsx)(`button`,{className:`btn btn-small btn-ghost`,disabled:p===e.key,onClick:()=>y(e),children:(0,N.jsx)(A,{children:`Merge anyway`})}),S(e)]})},`Nothing waiting for testing.`),T(`✅ Ready to merge`,`kcol-review`,u.ready,e=>{let t=r.pulls.find(t=>t.number===e.prNumber);return(0,N.jsxs)(`div`,{className:`kcard-foot kcard-foot-wrap`,children:[(0,N.jsx)(oh,{agent:e.agent,card:e}),(0,N.jsxs)(`span`,{className:`muted small`,children:[e.note,t?` · +${t.additions} −${t.deletions}`:``]}),(0,N.jsx)(`span`,{className:`spacer`}),(0,N.jsx)(lh,{card:e}),C(e),(0,N.jsx)(`button`,{className:`btn btn-small btn-good`,disabled:p===e.key||t?.isDraft,onClick:()=>y(e),children:(0,N.jsx)(A,{children:`Merge`})}),(0,N.jsx)(`button`,{className:`btn btn-small`,disabled:p===e.key,onClick:()=>b(e),children:n(`Request changes`)}),S(e)]})},`No tested pull requests yet.`),T(`🎉 Merged`,`kcol-merged`,u.merged,e=>(0,N.jsx)(`div`,{className:`kcard-foot`,children:(0,N.jsx)(oh,{agent:e.agent,card:e})}),`Nothing merged yet.`)]})]})}var dh=`https://github.com/leonvanzyl/cubefarm/blob/main/docs/pocket.md`,fh=[{id:`ntfy`,label:`ntfy`,help:`Pick a long, hard-to-guess topic and subscribe to it in the ntfy app. Anyone who knows the topic can read it.`,fields:[{key:`url`,label:`Topic URL`,placeholder:`https://ntfy.sh/my-office-7f3k9q`,secret:!0},{key:`token`,label:`Access token (optional)`,placeholder:`tk_…`,secret:!0,optional:!0}]}];function ph(e){let[t,n]=(0,M.useState)({busy:!1,result:null,ok:!1}),r=async()=>{n({busy:!0,result:null,ok:!1});try{await k.testNotify(e),n({busy:!1,result:`✓ Sent`,ok:!0})}catch(e){n({busy:!1,result:e instanceof Error?e.message:String(e),ok:!1})}};return{...t,run:r}}function mh({result:e,ok:t}){let n=j();return e?(0,N.jsx)(`span`,{className:`small ${t?`notify-ok`:`term-error`}`,role:`status`,children:t?n(`✓ Sent`):e}):null}function hh({hook:e,notify:t,save:n}){let r=j(),i=E(t=>t.notifyChannels.webhooks[e.id]),[a,o]=(0,M.useState)(!1),[s,c]=(0,M.useState)({}),[l,u]=(0,M.useState)(``),[d,f]=(0,M.useState)(!1),p=ph(e.id),m=(0,M.useId)(),h=async t=>{f(!0),u(``);try{await k.setWebhook(e.id,t),c({}),o(!1)}catch(e){u(e instanceof Error?e.message:String(e))}finally{f(!1)}},g=t.channels[e.id];return(0,N.jsxs)(`div`,{className:`notify-hook`,children:[(0,N.jsxs)(`div`,{className:`row wrap`,children:[(0,N.jsx)(`b`,{className:`grow`,children:e.label}),i.set&&(0,N.jsxs)(`label`,{className:`toggle small`,children:[(0,N.jsx)(`input`,{type:`checkbox`,checked:g,onChange:r=>n({channels:{...t.channels,[e.id]:r.target.checked}})}),` `,(0,N.jsx)(A,{children:`On`})]})]}),i.set&&!a?(0,N.jsxs)(`div`,{className:`row wrap`,children:[(0,N.jsxs)(`span`,{className:`grow small`,children:[(0,N.jsx)(A,{children:`🔑 Saved`}),` `,(0,N.jsx)(`code`,{children:i.hint})]}),(0,N.jsx)(`button`,{className:`btn btn-small`,disabled:p.busy,onClick:()=>void p.run(),children:r(p.busy?`Sending…`:`Test`)}),(0,N.jsx)(`button`,{className:`btn btn-small btn-ghost`,onClick:()=>o(!0),children:(0,N.jsx)(A,{children:`Replace`})}),(0,N.jsx)(`button`,{className:`btn btn-small btn-ghost`,disabled:d,onClick:()=>void fe({tone:`danger`,title:r(`Remove the {service} settings?`,{service:e.label}),body:r(`They are deleted from the office. Nothing more is sent there until you add them again.`),confirm:r(`Remove`)}).then(e=>{e&&h({})}),children:(0,N.jsx)(A,{children:`Remove`})}),(0,N.jsx)(mh,{result:p.result,ok:p.ok})]}):(0,N.jsxs)(`form`,{className:`notify-form`,onSubmit:e=>{e.preventDefault(),h(s)},children:[(0,N.jsx)(`p`,{className:`muted small`,children:r(e.help)}),e.fields.map(e=>(0,N.jsxs)(`label`,{className:`field`,children:[(0,N.jsx)(`span`,{children:r(e.label)}),(0,N.jsx)(`input`,{type:e.secret?`password`:`text`,value:s[e.key]??``,onChange:t=>c({...s,[e.key]:t.target.value}),placeholder:e.placeholder,autoComplete:`off`,spellCheck:!1,"aria-invalid":!!l,"aria-describedby":l?m:void 0})]},e.key)),l&&(0,N.jsx)(`div`,{id:m,className:`term-error small`,role:`alert`,children:l}),(0,N.jsxs)(`div`,{className:`row`,children:[(0,N.jsx)(`button`,{className:`btn btn-small btn-good`,disabled:d||e.fields.some(e=>!e.optional&&!s[e.key]?.trim()),children:r(d?`Saving…`:`Save`)}),a&&(0,N.jsx)(`button`,{type:`button`,className:`btn btn-small btn-ghost`,onClick:()=>{o(!1),c({}),u(``)},children:(0,N.jsx)(A,{children:`Cancel`})})]})]})]})}var gh=()=>typeof Notification>`u`?`unsupported`:Notification.permission;function _h({notify:e,save:t}){let n=j(),r=E(e=>e.notifyChannels.pushDevices),[i,a]=(0,M.useState)(gh),[o,s]=(0,M.useState)(null),[c,l]=(0,M.useState)(!1),[u,d]=(0,M.useState)(``),f=ph(`push`),p=typeof window>`u`?`unsupported`:de();(0,M.useEffect)(()=>{p===`ok`&&ge().then(e=>s(!!e),()=>s(!1))},[p,r]);let m=async()=>a(await Notification.requestPermission()),h=async e=>{l(!0),d(``);try{e?await he():await pe(),s(e),a(gh())}catch(e){d(e instanceof Error?e.message:String(e))}finally{l(!1)}};return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(`div`,{className:`notify-hook`,children:[(0,N.jsxs)(`div`,{className:`row wrap`,children:[(0,N.jsx)(`b`,{className:`grow`,children:(0,N.jsx)(A,{children:`Desktop notifications`})}),(0,N.jsxs)(`label`,{className:`toggle small`,children:[(0,N.jsx)(`input`,{type:`checkbox`,checked:e.channels.desktop,onChange:n=>t({channels:{...e.channels,desktop:n.target.checked}})}),` `,(0,N.jsx)(A,{children:`On`})]})]}),(0,N.jsx)(`p`,{className:`muted small`,children:(0,N.jsx)(A,{children:`From any browser with the office open in a background tab.`})}),(0,N.jsxs)(`div`,{className:`row wrap`,children:[i===`granted`&&(0,N.jsx)(`span`,{className:`small grow`,children:(0,N.jsx)(A,{children:`✓ Allowed in this browser`})}),i===`denied`&&(0,N.jsx)(`span`,{className:`small grow term-error`,children:(0,N.jsx)(A,{children:`Blocked in this browser: allow notifications for this site in its settings.`})}),i===`unsupported`&&(0,N.jsx)(`span`,{className:`small grow muted`,children:(0,N.jsx)(A,{children:`This browser can’t show notifications.`})}),i==="default"&&(0,N.jsx)(`button`,{className:`btn btn-small btn-good`,onClick:()=>void m(),children:(0,N.jsx)(A,{children:`Allow in this browser`})}),i===`granted`&&(0,N.jsx)(`button`,{className:`btn btn-small`,onClick:()=>void ie(),children:(0,N.jsx)(A,{children:`Test`})})]})]}),(0,N.jsxs)(`div`,{className:`notify-hook`,children:[(0,N.jsxs)(`div`,{className:`row wrap`,children:[(0,N.jsx)(`b`,{className:`grow`,children:(0,N.jsx)(A,{children:`Push to my devices`})}),(0,N.jsxs)(`label`,{className:`toggle small`,children:[(0,N.jsx)(`input`,{type:`checkbox`,checked:e.channels.push,onChange:n=>t({channels:{...e.channels,push:n.target.checked}})}),` `,(0,N.jsx)(A,{children:`On`})]})]}),(0,N.jsxs)(`p`,{className:`muted small`,children:[(0,N.jsx)(A,{children:`Reaches a phone or PC even with the office closed.`}),` `,r?n(r===1?`{count} device signed up.`:`{count} devices signed up.`,{count:r}):n(`No devices signed up yet.`)]}),p===`insecure`&&(0,N.jsxs)(`p`,{className:`small term-error`,children:[(0,N.jsx)(A,{children:`Push needs HTTPS (or localhost on the office’s own PC). Open the office through an HTTPS address such as Tailscale Serve: see`}),` `,(0,N.jsx)(`a`,{href:dh,children:`docs/pocket.md`}),`.`]}),p===`unsupported`&&(0,N.jsx)(`p`,{className:`small muted`,children:(0,N.jsx)(A,{children:`This browser has no Web Push. On an iPhone, add the office to the home screen first, then turn push on from there.`})}),p===`dev`&&(0,N.jsx)(`p`,{className:`small muted`,children:(0,N.jsx)(A,{children:`Push works in a built office (npm run build), not under the dev server.`})}),p===`ok`&&(0,N.jsxs)(`div`,{className:`row wrap`,children:[o?(0,N.jsx)(`button`,{className:`btn btn-small btn-ghost`,disabled:c,onClick:()=>void h(!1),children:(0,N.jsx)(A,{children:`Stop push to this device`})}):(0,N.jsx)(`button`,{className:`btn btn-small btn-good`,disabled:c||o===null,onClick:()=>void h(!0),children:n(c?`Signing up…`:`Push to this device`)}),(0,N.jsx)(`button`,{className:`btn btn-small`,disabled:f.busy||!r,onClick:()=>void f.run(),children:(0,N.jsx)(A,{children:`Send test`})}),(0,N.jsx)(mh,{result:f.result,ok:f.ok})]}),u&&(0,N.jsx)(`div`,{className:`term-error small`,role:`alert`,children:u})]})]})}function vh(){let e=j(),t=E(e=>e.settings.notify),[n,r]=(0,M.useState)(t.officeUrl);(0,M.useEffect)(()=>r(t.officeUrl),[t.officeUrl]);let i=e=>void k.updateSettings({notify:{...t,...e}}).catch(()=>void 0);return(0,N.jsxs)(`div`,{className:`card notify-settings`,children:[(0,N.jsx)(`h3`,{children:(0,N.jsx)(A,{children:`🔔 Notifications`})}),(0,N.jsx)(`p`,{className:`muted small`,children:(0,N.jsx)(A,{children:`What the office tells you when you’re not looking. At most one of each kind a minute; a burst arrives as one summary.`})}),(0,N.jsx)(`div`,{className:`notify-events`,role:`group`,"aria-label":e(`Tell me when`),children:_.map(n=>(0,N.jsxs)(`label`,{className:`toggle block`,children:[(0,N.jsx)(`input`,{type:`checkbox`,checked:t.events[n.id],onChange:e=>i({events:{...t.events,[n.id]:e.target.checked}})}),(0,N.jsx)(`span`,{children:e(n.label)})]},n.id))}),(0,N.jsxs)(`label`,{className:`field`,children:[(0,N.jsx)(`span`,{children:(0,N.jsx)(A,{children:`Office address for links (optional)`})}),(0,N.jsx)(`input`,{type:`url`,value:n,onChange:e=>r(e.target.value),onBlur:()=>n.trim()!==t.officeUrl&&i({officeUrl:n.trim()}),placeholder:`https://office.your-tailnet.ts.net`,inputMode:`url`})]}),(0,N.jsx)(`h4`,{className:`notify-h`,children:(0,N.jsx)(A,{children:`This device`})}),(0,N.jsx)(_h,{notify:t,save:i}),(0,N.jsx)(`h4`,{className:`notify-h`,children:(0,N.jsx)(A,{children:`Phone app`})}),fh.map(e=>(0,N.jsx)(hh,{hook:e,notify:t,save:i},e.id)),(0,N.jsxs)(`p`,{className:`muted small`,children:[(0,N.jsx)(A,{children:`The topic and token stay on the office’s PC and are never shown again. Setup for each, and how to reach the office from your phone safely:`}),` `,(0,N.jsx)(`a`,{href:dh,children:`docs/pocket.md`}),`.`]})]})}function yh(e){let t={backlog:e.backlog.length,building:e.progress.length,qa:0,fixing:0,ready:e.ready.length,needsYou:0};for(let n of e.qa)b(n.qa)?t.needsYou++:n.qa?.status===`failed`||n.qa?.status===`fixing`?t.fixing++:t.qa++;return t}function bh(e){let t=e.status===`preparing`||e.status===`working`;return{stop:t,assign:!t,clear:!t&&e.status!==`idle`,message:t||e.task!==`qa`&&!!e.branch&&e.status!==`idle`}}function xh(e){if(!e)return[];let t=e.qa.filter(e=>!e.qa||e.qa.status===`needs-human`||e.qa.status===`queued`);return[...e.backlog.map(e=>({key:e.key,kind:`issue`,number:e.number,title:e.title})),...t.map(e=>({key:e.key,kind:`qa`,number:e.number,title:e.title}))]}function Sh(e,t){return e.status===`idle`?O(t,`Free`):e.task===`qa`||e.task===`fix`?O(t,e.task===`qa`?`Testing PR #{number}`:`Fixing PR #{number}`,{number:e.prNumber??`?`})+(e.issueTitle?`: ${e.issueTitle}`:``):e.issueNumber==null?e.status===`done`?O(t,`Finished`):``:`#${e.issueNumber}${e.issueTitle?` ${e.issueTitle}`:``}`}function Ch(e,t,n){let r=(e,t)=>e.pulls.some(e=>e.number===t.prNumber&&e.state===`OPEN`),i={requests:n.filter(e=>e.status===`pending`),stuck:[],ready:[]};for(let n of Object.values(t).sort((e,t)=>e.updatedAt-t.updatedAt)){let t=e.find(e=>e.id===n.repoId);t&&r(t,n)&&(n.status===`needs-human`?i.stuck.push({repo:t,qa:n}):n.status===`passed`&&!t.autoMerge&&i.ready.push({repo:t,qa:n}))}return i}var wh=e=>e.requests.length+e.stuck.filter(e=>b(e.qa)).length;function Th({k:e,children:t,hint:n,disabled:r}){let i=j(),a=oe(t=>t.prefs[e]),o=(0,M.useId)();return(0,N.jsxs)(`label`,{className:`toggle block`,children:[(0,N.jsx)(`input`,{type:`checkbox`,checked:a||!!r,disabled:r,onChange:t=>ye({[e]:t.target.checked}),"aria-describedby":n?o:void 0}),(0,N.jsxs)(`span`,{children:[(0,N.jsx)(`b`,{children:t}),n&&(0,N.jsxs)(`span`,{className:`muted small a11y-hint`,id:o,children:[` `,i(n)]})]})]})}function Eh({k:e,label:t,unit:n,describe:r}){let i=j(),a=oe(t=>t.prefs[e]),{min:o,max:s,step:c}=le[e];return(0,N.jsxs)(`label`,{className:`a11y-slider`,children:[(0,N.jsx)(`span`,{children:i(t)}),(0,N.jsx)(`input`,{type:`range`,min:o,max:s,step:c,value:a,"aria-valuetext":`${a}${n}${r?`, ${i(r(a))}`:``}`,onChange:t=>ye({[e]:Number(t.target.value)})}),(0,N.jsxs)(`b`,{children:[a,n]}),a!==ve[e]&&(0,N.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-small`,onClick:()=>ye({[e]:ve[e]}),"aria-label":i(`Reset {label}`,{label:i(t).toLowerCase()}),children:(0,N.jsx)(A,{children:`Reset`})})]})}function Dh({palette:e,shapes:t}){let n=j();return(0,N.jsx)(`ul`,{className:`status-swatches`,"aria-label":n(`How statuses look`),children:u.map(r=>(0,N.jsxs)(`li`,{className:`status-kind status-kind-${r}`,style:{"--kind":d(r,e)},children:[t&&(0,N.jsx)(`span`,{"aria-hidden":!0,children:C[r]}),` `,n(c[r])]},r))})}var Oh={system:`Follow my system setting`,on:`Always reduce motion`,off:`Full motion`};function kh({pocket:e=!1}){let t=j(),n=oe(e=>e.prefs),r=oe(e=>e.systemReduced),i=E(e=>e.openOverlay),a=(0,M.useId)(),o=se(n),s=e=>ye(e);return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(`section`,{className:`card a11y-card`,"aria-labelledby":`${a}-cap`,children:[(0,N.jsx)(`h3`,{id:`${a}-cap`,children:(0,N.jsx)(A,{children:`💬 Captions`})}),(0,N.jsx)(Th,{k:`captions`,hint:`The CEO’s messages written out as they’re read aloud, and short captions for important sounds (the gong, a merge cheer, alarms, the jukebox) with an arrow towards where they came from.`,children:(0,N.jsx)(A,{children:`Show captions`})}),(0,N.jsx)(Eh,{k:`captionSize`,label:`Caption size`,unit:`%`}),(0,N.jsx)(Eh,{k:`captionBg`,label:`Caption background`,unit:`%`}),(0,N.jsxs)(`div`,{className:`captions captions-preview`,"aria-hidden":!0,style:{"--caption-scale":n.captionSize/100,"--caption-bg":n.captionBg/100},children:[(0,N.jsx)(`div`,{className:`caption`,children:`[gong] ↗`}),(0,N.jsxs)(`div`,{className:`caption caption-speech`,children:[(0,N.jsx)(`b`,{children:`CEO:`}),` `,(0,N.jsx)(A,{children:`PR number 12 is ready to merge.`})]})]})]}),(0,N.jsxs)(`section`,{className:`card a11y-card`,"aria-labelledby":`${a}-col`,children:[(0,N.jsx)(`h3`,{id:`${a}-col`,children:(0,N.jsx)(A,{children:`🎨 Colour and status`})}),(0,N.jsxs)(`fieldset`,{className:`a11y-fieldset`,children:[(0,N.jsx)(`legend`,{children:(0,N.jsx)(A,{children:`Status colours`})}),S.map(e=>(0,N.jsxs)(`label`,{className:`toggle block`,children:[(0,N.jsx)(`input`,{type:`radio`,name:`${a}-palette`,checked:n.palette===e,onChange:()=>s({palette:e})}),` `,t(p[e])]},e))]}),(0,N.jsx)(Th,{k:`statusShapes`,disabled:n.palette!==`standard`,hint:n.palette===`standard`?`On name tags, the whiteboard, Kanban cards, status pills and toasts.`:`Always on with a colour-blind palette.`,children:(0,N.jsx)(A,{children:`Shapes beside status colours (✓ ✕ ! ⏳)`})}),(0,N.jsx)(Dh,{palette:n.palette,shapes:o})]}),!e&&(0,N.jsxs)(`section`,{className:`card a11y-card`,"aria-labelledby":`${a}-mot`,children:[(0,N.jsx)(`h3`,{id:`${a}-mot`,children:(0,N.jsx)(A,{children:`🌀 Motion`})}),(0,N.jsx)(Eh,{k:`fov`,label:`Field of view`,unit:`°`,describe:e=>e<72?`narrower`:e>72?`wider`:`normal`}),(0,N.jsx)(Th,{k:`headBob`,children:(0,N.jsx)(A,{children:`Head bob while walking`})}),(0,N.jsx)(Th,{k:`cameraShake`,hint:`The view tipping back when you sip a coffee, and any screen shake.`,children:(0,N.jsx)(A,{children:`Camera sway and shake`})}),(0,N.jsxs)(`fieldset`,{className:`a11y-fieldset`,children:[(0,N.jsx)(`legend`,{children:(0,N.jsx)(A,{children:`Reduce motion`})}),Object.keys(Oh).map(e=>(0,N.jsxs)(`label`,{className:`toggle block`,children:[(0,N.jsx)(`input`,{type:`radio`,name:`${a}-motion`,checked:n.reduceMotion===e,onChange:()=>s({reduceMotion:e})}),` `,t(Oh[e]),e===`system`&&(0,N.jsx)(`span`,{className:`muted small`,children:t(r?`(your system asks for less motion)`:`(your system doesn’t ask for less motion)`)})]},e)),(0,N.jsxs)(`p`,{className:`muted small`,children:[(0,N.jsx)(A,{children:`Reduced motion: confetti bursts become a glow, the elevator doors cut to a fade, and panels, toasts and badges appear without moving.`}),` `,t(ce(n.reduceMotion,r)?`On now.`:`Off now.`)]})]}),(0,N.jsx)(Th,{k:`centerDot`,hint:`A dot fixed in the middle of the view, which helps some people with motion sickness.`,children:(0,N.jsx)(A,{children:`Centre dot`})})]}),(0,N.jsxs)(`section`,{className:`card a11y-card`,"aria-labelledby":`${a}-read`,children:[(0,N.jsx)(`h3`,{id:`${a}-read`,children:(0,N.jsx)(A,{children:`🔎 Size and readability`})}),(0,N.jsx)(Eh,{k:`uiScale`,label:`UI scale`,unit:`%`}),(0,N.jsx)(`p`,{className:`muted small`,children:(0,N.jsx)(A,{children:`The HUD, the phone, the console and every panel, from 80% to 150%.`})}),(0,N.jsx)(Th,{k:`readableFont`,hint:`Verdana, with wider letter, word and line spacing, as dyslexia style guides recommend.`,children:(0,N.jsx)(A,{children:`Dyslexia-friendly font`})}),(0,N.jsx)(Th,{k:`highContrast`,hint:`Plain white panels, darker grey text, heavier borders and focus rings.`,children:(0,N.jsx)(A,{children:`High-contrast panels`})})]}),!e&&(0,N.jsxs)(`section`,{className:`card a11y-card`,"aria-labelledby":`${a}-kb`,children:[(0,N.jsx)(`h3`,{id:`${a}-kb`,children:(0,N.jsx)(A,{children:`⌨️ Keyboard and screen readers`})}),(0,N.jsxs)(`p`,{className:`small`,children:[(0,N.jsx)(Pd,{action:`phone`}),` `,(0,N.jsx)(A,{children:`opens your phone from anywhere: its`}),` `,(0,N.jsx)(`b`,{children:(0,N.jsx)(A,{children:`Company`})}),` `,(0,N.jsx)(A,{children:`tab opens the console, this floor’s Kanban, the floor list, help and these settings.`}),` `,(0,N.jsx)(Pd,{action:`help`}),` `,(0,N.jsx)(A,{children:`opens help. In any panel,`}),` `,(0,N.jsx)(`kbd`,{children:`Tab`}),` `,(0,N.jsx)(A,{children:`and`}),` `,(0,N.jsx)(`kbd`,{children:`Shift`}),`+`,(0,N.jsx)(`kbd`,{children:`Tab`}),` `,(0,N.jsx)(A,{children:`move between controls,`}),` `,(0,N.jsx)(`kbd`,{children:`Enter`}),` `,(0,N.jsx)(A,{children:`or`}),` `,(0,N.jsx)(`kbd`,{children:`Space`}),` `,(0,N.jsx)(A,{children:`uses one and`}),` `,(0,N.jsx)(`kbd`,{children:`Esc`}),` `,(0,N.jsx)(A,{children:`closes it; focus goes back where it was. Screen readers hear the CEO’s messages and alarms as they happen.`})]}),(0,N.jsx)(`div`,{className:`row wrap`,children:(0,N.jsx)(`button`,{className:`btn btn-small`,onClick:()=>i({kind:`floorList`}),children:(0,N.jsx)(A,{children:`👥 List view of this floor`})})})]}),(0,N.jsx)(`div`,{className:`row`,children:(0,N.jsx)(`button`,{className:`btn btn-ghost btn-small`,onClick:ue,children:(0,N.jsx)(A,{children:`Reset accessibility settings`})})})]})}export{$e as $,vm as A,Ot as B,km as C,Tm as D,Em as E,jd as F,Ct as G,jt as H,kd as I,Tt as J,xt as K,Od as L,Id as M,Nd as N,_m as O,Md as P,ft as Q,It as R,Hm as S,wm as T,Et as U,Nt as V,yt as W,ht as X,ut as Y,mt as Z,Ym as _,Sh as a,Ke as at,Im as b,vh as c,Fe as ct,ah as d,lt as et,ih as f,Km as g,Zm as h,xh as i,Je as it,Pd as j,gm as k,sh as l,Ne as lt,th as m,bh as n,Ze as nt,yh as o,Ye as ot,nh as p,wt as q,wh as r,qe as rt,Ch as s,Xe as st,kh as t,at as tt,uh as u,Ie as ut,qm as v,Cm as w,Om as x,Gm as y,Rt as z};