slidetake 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.html +6 -2
- package/dist/slidetake.js +7 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -96,7 +96,7 @@ window.SLIDETAKE = {
|
|
|
96
96
|
// recording: true // optional: always show Camera and Record
|
|
97
97
|
};
|
|
98
98
|
</script>
|
|
99
|
-
<script src="https://cdn.jsdelivr.net/npm/slidetake@0.3.
|
|
99
|
+
<script src="https://cdn.jsdelivr.net/npm/slidetake@0.3.1/dist/slidetake.js"></script>
|
|
100
100
|
```
|
|
101
101
|
|
|
102
102
|
`colors` takes any CSS colour per token, for both modes or under `light` / `dark`: `accent` (text and the current slide), `accentSoft` (smaller headings), `line` (borders and the active path), `ring` (the current slide's outline), `header` and `headerText` (a band of colour behind the header). A deck can also set its own with `accent:` in its top block.
|
package/dist/index.html
CHANGED
|
@@ -197,6 +197,10 @@
|
|
|
197
197
|
.btn.icon svg{width:15px;height:15px;display:block;}
|
|
198
198
|
/* in the header, icon buttons stand as tall as the layout switch and the text buttons beside them */
|
|
199
199
|
.hdr-actions .btn.icon{height:32px;min-width:32px;padding:0 8px;}
|
|
200
|
+
/* every header control is exactly 32px, whatever the font's line height, so they line up on any machine */
|
|
201
|
+
.hdr-actions > .btn, .hdr-actions > .seg{height:32px;}
|
|
202
|
+
.hdr-actions > .btn:not(.icon){padding-top:0;padding-bottom:0;}
|
|
203
|
+
.hdr-actions .seg-btn{height:100%;display:flex;align-items:center;padding-top:0;padding-bottom:0;}
|
|
200
204
|
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;}
|
|
201
205
|
.pane-label{
|
|
202
206
|
font-family:var(--mono);font-size:10px;letter-spacing:.12em;text-transform:uppercase;
|
|
@@ -748,7 +752,7 @@
|
|
|
748
752
|
<tr><td><kbd>K</kbd> <kbd>?</kbd></td><td>this card; again or <kbd>Esc</kbd> closes it</td></tr>
|
|
749
753
|
</table>
|
|
750
754
|
<p>Drag to pan, scroll or pinch to zoom, click a card to fly to it.</p>
|
|
751
|
-
<p><a href="/docs" target="_blank" rel="noopener">The docs →</a> writing decks, sharing, recording, camera, review and cut.</p>
|
|
755
|
+
<p><a href="https://slidetake.com/docs" target="_blank" rel="noopener">The docs →</a> writing decks, sharing, recording, camera, review and cut.</p>
|
|
752
756
|
</div>
|
|
753
757
|
</div>
|
|
754
758
|
|
|
@@ -2176,7 +2180,7 @@
|
|
|
2176
2180
|
const v = el.getAttribute(attr);
|
|
2177
2181
|
if (!v || /^(#|[a-z][a-z0-9+.-]*:|\/\/)/i.test(v)) return;
|
|
2178
2182
|
if (!base) {
|
|
2179
|
-
if (attr === "src") unresolved++;
|
|
2183
|
+
if (attr === "src" && !v.startsWith("/")) unresolved++;
|
|
2180
2184
|
return;
|
|
2181
2185
|
}
|
|
2182
2186
|
let site = base;
|
package/dist/slidetake.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Slidetake 0.3.
|
|
1
|
+
/* Slidetake 0.3.1 · https://slidetake.com · Apache-2.0 */
|
|
2
2
|
"use strict";(()=>{var R=(e,t)=>()=>(e&&(t=e(e=0)),t);var Yt,Ha=R(()=>{Yt=`---
|
|
3
3
|
title: Slidetake \u2014 write in markdown, record without timeline editing
|
|
4
4
|
brand: slidetake
|
|
@@ -850,7 +850,7 @@ outpoint `+To(C.end)).join(`
|
|
|
850
850
|
`+m+`
|
|
851
851
|
EOF
|
|
852
852
|
`+_+"ffmpeg -f concat -safe 0 -i /tmp/slidetake-cuts.txt -i /tmp/slidetake-chapters.txt"+O+" -c copy -movflags +faststart "+yt(i)}let y=vt(e),S=m=>(m/y).toFixed(6),g=m=>((m-.5)/y).toFixed(6),B=r.map(m=>"gte(t,"+g(m.f0)+")*lt(t,"+g(m.f1)+")").join("+"),V=r.map(m=>"gte(t,"+S(m.f0)+")*lt(t,"+S(m.f1)+")").join("+"),x=t==="mac"?"-c:v h264_videotoolbox -b:v 12M":"-c:v libx264 -crf 18 -preset medium";return _+"ffmpeg -i "+yt(a)+" -i /tmp/slidetake-chapters.txt"+O+` -vf "select='`+B+`',setpts=N/FRAME_RATE/TB" -af "asetnsamples=n=48:p=0,aselect='`+V+`',asetpts=N/SR/TB" `+x+" -c:a aac -b:a 192k -movflags +faststart "+yt(i)}var Co,vt,Lo,Me,sr,yt,To,Ao=R(()=>{"use strict";ht();Co=e=>e.obsT??e.t,vt=e=>e.fps||60,Lo=(e,t)=>Math.round(e*t/1e3);Me=e=>String(e||"").split(/[\\/]/).pop()||"",sr=e=>{let t=Math.max(String(e).lastIndexOf("/"),String(e).lastIndexOf("\\"));return t>=0?String(e).slice(0,t+1):""},yt=e=>"'"+String(e).replace(/'/g,"'\\''")+"'",To=e=>(e/1e3).toFixed(3)});var Ui={};function Q(e){try{let t=localStorage.getItem(e);if(t!==null||!e.startsWith("slidetake:"))return t;let a=e.slice(10);return localStorage.getItem("slidetake:"+a)??localStorage.getItem("traverse:"+a)}catch{return null}}function Z(e,t){try{localStorage.setItem(e,t)}catch{}}function yr(e){try{return{html:window.marked?window.marked.parse(e):"<pre>"+T(e)+"</pre>",err:null}}catch{return{html:"<p>(could not render)</p>",err:"render error"}}}function Lt(){let e=w.brand||"",t=w.logo||"",a=/^chip$/i.test(w.brand_style||""),o=/^slidetake$/i.test(e)?'<span class="st-mark">'+Jo+'<span class="word">Slide<span>take</span></span></span>':(t?'<img alt="" src="'+T(t)+'">':"")+(e?"<span"+(a?' class="chip"':"")+">"+T(e)+"</span>":"");if(pe.dataset.html!==o){pe.dataset.html=o,pe.innerHTML=o;let n=pe.querySelector("img");n&&(n.onload=n.onerror=()=>ne(!0))}pe.hidden=!o,ka(),document.title=w.title||"Slidetake",wr(),Xo()}function vr(){let e=String(w.accent||"").trim();if(!e||!window.CSS||!CSS.supports("color",e))return null;if(!CSS.supports("color","oklch(from red l c h)"))return{accent:e,line:e};let t=a=>"oklch(from "+e+" "+a+" c h)";return{dark:{accent:t(.8),accentSoft:t(.87),line:t(.5)},light:{accent:t(.45),accentSoft:t(.4),line:t(.75),ring:t(.7)}}}function wr(){let e="",t=(o,n)=>{let r=Object.entries(n||{}).filter(([i,s])=>Io[i]&&s&&typeof s!="object").map(([i,s])=>Io[i]+":"+String(s).replace(/[;{}<>]/g,"")).join(";");r&&(e+=o+"{"+r+`}
|
|
853
|
-
`)};[A&&A.colors,vr()].filter(Boolean).forEach(o=>{["dark","light"].forEach(n=>{let r={...o,...o[n]||{}},i=n==="dark";r.accent&&typeof r.accent=="string"&&(r.accentSoft=r.accentSoft||r.accent,r.line=r.line||"color-mix(in srgb, "+r.accent+(i?" 45%, #09090b)":" 55%, #fff)"),r.ring=r.ring||(i?r.accent:r.line),r.onAccent=r.onAccent||(i?"color-mix(in srgb, "+r.accent+" 15%, #000)":"#fff")),t(i?'body:not([data-mode="light"])':'body[data-mode="light"]',r)})});let a=document.getElementById("st-colors");a||(a=document.createElement("style"),a.id="st-colors",document.head.appendChild(a)),a.textContent!==e&&(a.textContent=e),document.body.classList.toggle("st-header-color",e.includes("--header-bg"))}function Ve(e){let t=document.createElement("span");t.style.color="var("+e+")",document.body.appendChild(t);let a=getComputedStyle(t).color;return t.remove(),ve=ve||Object.assign(document.createElement("canvas"),{width:1,height:1}).getContext("2d",{willReadFrequently:!0}),ve.clearRect(0,0,1,1),ve.fillStyle="#000",ve.fillStyle=a,ve.fillRect(0,0,1,1),"#"+[...ve.getImageData(0,0,1,1).data.slice(0,3)].map(o=>o.toString(16).padStart(2,"0")).join("")}function xr(e,t,a){let o=i=>[1,3,5].map(s=>parseInt(i.slice(s,s+2),16)),n=o(e),r=o(t);return"#"+n.map((i,s)=>Math.round(i*a+r[s]*(1-a)).toString(16).padStart(2,"0")).join("")}function Dt(){if(A&&A.themeKey&&!zo){let t=Q(A.themeKey);return t==="light"||t==="dark"?t:matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}return String(zo||Q("slidetake:mode")||w.mode||"dark").toLowerCase()==="light"?"light":"dark"}function Xo(){let e=Dt()==="light";e?document.body.dataset.mode="light":delete document.body.dataset.mode;let t=document.getElementById("btn-mode");t&&(t.innerHTML=e?'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z"/></svg>':'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><circle cx="12" cy="12" r="4.5"/><path d="M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"/></svg>',t.title=(e?"Dark theme":"Light theme")+" (L)",t.setAttribute("aria-label",t.title))}function Qo(){let e=Dt()==="light"?"dark":"light";A&&A.themeKey?(Z(A.themeKey,e),document.documentElement.classList.toggle("dark",e==="dark")):Z("slidetake:mode",e),Xo(),q.querySelector(".echarts-container, .diagram.d2")&&je(!0)}function kr(){let t=(w.camera||"").replace(/^\[|\]$/g,"").split(",").map(a=>a.trim().replace(/^["']|["']$/g,"")).filter(Boolean);return t.length?t:["on","full","off"]}function pa(e){return!G&&e?po(e.camera):[]}function Le(e){return ho(pa(e),e&&e.frags?e.frags.length:0)}function Zo(){let e=Le(d.get(p));return e[Math.min(oe,e.length-1)]||{cam:0,frag:0}}function Sr(){if(!p)return null;let e=d.get(p),t=pa(e);if(t.length)return t[Math.min(Zo().cam,t.length-1)];if(e&&e.el&&e.el.classList.contains("card-full"))return"off";for(let a=u.indexOf(p)-1;a>=0;a--){let o=pa(d.get(u[a]));if(o.length)return o[o.length-1]}return null}function Er(){let e={corner:(w.pip||"none").toLowerCase(),size:Vt(parseFloat(w.pip_size)||24),circle:(w.pip_shape||"").toLowerCase()==="circle",mirror:!/^(no|false|off)$/i.test(w.pip_mirror||""),full:!1,off:!1,flip:!1,used:!1};return ut(e,Sr()),te&&!/\b(off|hide)\b/i.test(te)&&(e.off=!1),ut(e,te),!qe.includes(e.corner)&&(Y||e.used)&&(e.corner="bottom-right"),e.flip&&qe.includes(e.corner)&&(e.corner=e.corner.includes("left")?e.corner.replace("left","right"):e.corner.replace("right","left")),e}function ka(){let e=!L.hidden&&L.offsetWidth?L.getBoundingClientRect():null,t=ze=Er(),a=qe.includes(t.corner);if(L.className=a?[t.corner,t.circle&&"circle",Y&&"live",t.mirror&&"mirror",t.full&&"full",L.classList.contains("msg")&&"msg"].filter(Boolean).join(" "):"",L.style.width=t.size+"%",L.hidden=!a||G||t.off,br.dataset.pip=L.hidden||t.full?"none":t.corner,L.hidden||Fe||!L.animate)return;let o="cubic-bezier(.65,0,.35,1)";if(!e){L.animate([{opacity:0},{opacity:1}],{duration:300,easing:"ease-out"});return}let n=L.getBoundingClientRect();Math.abs(e.left-n.left)+Math.abs(e.top-n.top)+Math.abs(e.width-n.width)+Math.abs(e.height-n.height)<2||L.animate([{transformOrigin:"0 0",transform:"translate("+(e.left-n.left)+"px,"+(e.top-n.top)+"px) scale("+e.width/n.width+","+e.height/n.height+")"},{transformOrigin:"0 0",transform:"none"}],{duration:600,easing:o})}function Cr(){let e=ze;if(!e||L.hidden||e.full)return null;let t=M.clientWidth,a=M.clientHeight,o=16,n=t*e.size/100,r=e.circle?n:n*9/16,i=e.corner.includes("left")?o:t-o-n,s=e.corner.includes("top")?o:a-o-r;return{x0:i,y0:s,x1:i+n,y1:s+r}}function Lr(){if(!nt)return;if(G){ja(!0);return}let e=kr();he=(he+1)%e.length,te=e[he],ka(),D||Ae("Camera: "+te),!Y&&!L.hidden?dt():ne()}function en(e){let t=lo(e,{render:yr});w=t.deck,d=t.nodes,Lt();let a={"+++":"+++ format",reveal:"reveal.js format",headings:"headings"}[t.format];lr.textContent=d.size+(d.size===1?" card":" cards")+" \xB7 "+a,et.textContent=t.errCount?t.errCount+" card(s) had errors":""}function tn(){ce=[...d.values()].filter(o=>!o.parent).map(o=>o.id);let e=0;function t(o,n){let r=d.get(o);if(r.depth=n,r.children.length===0)r._slot=e++;else{r.children.forEach(s=>t(s,n+1));let i=r.children.map(s=>d.get(s)._slot);r._slot=(Math.min(...i)+Math.max(...i))/2}}ce.forEach(o=>t(o,0)),u=[];function a(o){u.push(o),d.get(o).children.forEach(a)}return ce.forEach(a),Math.max(1,e)}function Tr(){let e=[],t=[],a=[];return d.forEach(o=>{e[o.depth]=Math.max(e[o.depth]||0,o._h),t[o.depth]=Math.max(t[o.depth]||0,o._w),a[o.depth]=(a[o.depth]||0)+1}),{maxH:e,maxW:t,count:a,maxDepth:e.length-1}}function an(e){e.x!==null&&!isNaN(e.x)&&(e.cx=e.x+e._w/2),e.y!==null&&!isNaN(e.y)&&(e.cy=e.y+e._h/2)}function Mr(){let{maxH:e,maxDepth:t}=Tr(),a=[0];for(let l=1;l<=t;l++)a[l]=a[l-1]+e[l-1]+hr;let o=pr-Ie,n=[],r=(l,c)=>{let f=d.get(l);f.cx+=c,f.children.forEach(_=>r(_,c))},i=l=>{let c=d.get(l);n[c.depth]=Math.max(n[c.depth]??-1/0,c.cx+c._w/2),c.children.forEach(i)};function s(l){let c=d.get(l),f=n[c.depth]!==void 0?n[c.depth]+o:-1/0;c.children.length?(c.children.forEach(s),c.cx=(d.get(c.children[0]).cx+d.get(c.children[c.children.length-1]).cx)/2,c.cx-c._w/2<f&&r(l,f-(c.cx-c._w/2))):c.cx=(f===-1/0?0:f)+c._w/2,i(l)}ce.forEach(s),d.forEach(l=>{l.cy=a[l.depth]+l._h/2,an(l)})}function Or(e){let t=Math.PI*2/e,a=32,o=[],n=(s,l)=>Math.abs(s.cx-l.cx)<(s._w+l._w)/2+a&&Math.abs(s.cy-l.cy)<(s._h+l._h)/2+a,r=Math.max(0,...[...d.values()].map(s=>s.depth)),i=0;for(let s=0;s<=r;s++){let l=[...d.values()].filter(f=>f.depth===s);if(!l.length)continue;let c=s===0?ce.length>1?mr*.5:0:i+ur;for(let f=0;f<400&&(l.forEach(O=>{let y=(O._slot+.5)*t-Math.PI/2;O.cx=c*Math.cos(y),O.cy=c*Math.sin(y),an(O)}),!!l.some((O,y)=>l.some((S,g)=>g>y&&n(O,S))||o.some(S=>n(O,S))));f++)c=c*1.02+10;i=c,o.push(...l)}}function Ar(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT),a=[];for(;t.nextNode();)a.push(t.currentNode);a.forEach(o=>{let n=o.data.match(/^\s*\.element:\s*([\s\S]*)$/);if(!n)return;let r=o.previousSibling;for(;r&&r.nodeType===3&&!r.data.trim();)r=r.previousSibling;let i=r&&r.nodeType===1?r:o.parentElement;i&&Object.entries(He(n[1])).forEach(([s,l])=>{s==="class"?i.classList.add(...l.split(/\s+/).filter(Boolean)):s==="style"?i.style.cssText+=";"+l:i.setAttribute(s,l)})})}function na(e){let t=document.createElement("figure");t.className="media",e.replaceWith(t),t.appendChild(e);let a=e.getAttribute("alt");return a&&t.insertAdjacentHTML("beforeend","<figcaption>"+T(a)+"</figcaption>"),t}function Br(e,t){let a=document.createElement("figure");return a.className="media yt fragment yt-play"+(e.portrait?" portrait":""),a.innerHTML='<div class="frame"><iframe src="'+So(e)+'" title="'+T(t||"YouTube video")+'" allow="autoplay; encrypted-media; picture-in-picture; fullscreen" allowfullscreen loading="lazy"></iframe></div>'+(t?"<figcaption>"+T(t)+"</figcaption>":""),a}function Po(e,t){let a=t<=4?t:t<=6?3:4;e.style.setProperty("--cols",a),e.style.setProperty("--rows",Math.ceil(t/a))}function zr(e,t){t.querySelectorAll("pre > code.language-svg").forEach(r=>{let i=document.createElement("img");i.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(r.textContent.trim()),i.alt="";let s=document.createElement("p");s.appendChild(i),r.parentElement.replaceWith(s)}),t.querySelectorAll(":scope > p").forEach(r=>{let i=r.children.length===1?r.children[0]:null;if(!i)return;let s=i.tagName==="A"&&r.textContent.trim()===i.textContent.trim()?i.getAttribute("href"):i.tagName==="IMG"?i.getAttribute("src"):null,l=s&&ko(s);l&&r.replaceWith(Br(l,i.tagName==="IMG"?i.getAttribute("alt"):""))}),t.querySelectorAll(":scope > ul, :scope > ol").forEach(r=>{let i=[...r.children];!i.length||!i.every(s=>s.querySelector("img")&&!s.textContent.trim())||(r.classList.add("gallery"),i.forEach(s=>{let l=s.querySelector("img");s.innerHTML="",s.appendChild(l),na(l)}),i.length>1&&i.every(s=>s.classList.contains("fragment"))?(r.classList.add("carousel"),i[0].classList.remove("fragment","fade-up"),i.forEach((s,l)=>{s.classList.replace("fade-up","current-visible");let c=s.querySelector("figcaption");c&&(c.dataset.count=l+1+" / "+i.length)})):Po(r,i.length))}),t.querySelectorAll(":scope > p").forEach(r=>{if(!Ir(r))return;let i=[...r.querySelectorAll("img")];if(i.length===1){r.replaceWith(i[0]),na(i[0]);return}let s=document.createElement("div");s.className="gallery grid",r.replaceWith(s),i.forEach(l=>{s.appendChild(l),na(l)}),Po(s,i.length)});let a=[...t.children].filter(r=>!/^H[1-6]$/.test(r.tagName)&&!(r.nodeType===1&&r.tagName==="HR")),o=a.filter(r=>r.matches("figure.media"));o.length===1&&a.length===1&&e.classList.add("card-media"),a.length===1&&(a[0].matches("figure.media:not(.yt)")||a[0].matches(".gallery.carousel"))&&e.classList.add("card-bleed");let n=document.createTreeWalker(t,NodeFilter.SHOW_COMMENT);for(;n.nextNode();)if(/^\s*view\s*:\s*full\s*$/i.test(n.currentNode.data))e.classList.add("card-full");else if(o.length===1){e.classList.add("card-split",a.indexOf(o[0])===0?"media-first":"media-last");let r=document.createElement("div");r.className="split-text",a.filter(i=>i!==o[0]).forEach(i=>r.appendChild(i)),o[0].after(r),a.indexOf(o[0])!==0&&r.after(o[0])}t.querySelector(".gallery")&&e.classList.add("card-gallery")}function on(e,t){let a=e.querySelector("iframe");a&&a.contentWindow&&a.contentWindow.postMessage(JSON.stringify({event:"command",func:t,args:[]}),"*")}function Pr(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT),a=[];for(;t.nextNode();)/^\s*steps\s*$/i.test(t.currentNode.data)&&a.push(t.currentNode);a.forEach(o=>{let n=o.nextSibling;for(;n&&n.nodeType!==1;)n=n.nextSibling;n&&/^(UL|OL)$/.test(n.tagName)&&n.querySelectorAll(":scope > li").forEach(r=>r.classList.add("fragment","fade-up"))})}function Rr(e){let t=[...e.querySelectorAll(".fragment")].map((n,r)=>({e:n,i:r,k:n.dataset.fragmentIndex}));if(t.every(n=>n.k===void 0))return t.map(n=>[n.e]);let a=0;t.forEach(n=>{n.k=n.k===void 0?a:parseFloat(n.k),a=Math.max(a,n.k)+1}),t.sort((n,r)=>n.k-r.k||n.i-r.i);let o=[];return t.forEach((n,r)=>{r&&t[r-1].k===n.k?o[o.length-1].push(n.e):o.push([n.e])}),o}function Sa(e,t,a){!e||!e.frags||(a&&e.el.classList.add("snap"),e.frags.forEach((o,n)=>o.forEach(r=>{let i=r.classList.contains("visible");r.classList.toggle("visible",n<t),r.classList.toggle("current-fragment",n===t-1),r.classList.contains("yt-play")&&i!==n<t&&!a&&on(r,n<t?"playVideo":"pauseVideo")})),a&&(e.el.offsetWidth,e.el.classList.remove("snap")))}function Dr(){try{return w.base?new URL(w.base,ae||location.href):ae?new URL(ae):null}catch{return null}}function jr(e){let t=Dr(),a=0;return e.querySelectorAll("img[src], source[src], video[src], iframe[src], a[href]").forEach(o=>{let n=o.hasAttribute("src")?"src":"href",r=o.getAttribute(n);if(!r||/^(#|[a-z][a-z0-9+.-]*:|\/\/)/i.test(r))return;if(!t){n==="src"&&a++;return}let i=t;try{w.site&&(i=new URL(w.site,t))}catch{}o.setAttribute(n,new URL(r,r.startsWith("/")?i:t).href)}),a}function jt(e){let t=e.el,a=t.querySelector(".body");t.classList.add("measuring"),a.style.zoom="";let o=Ie;e.visual=!!a.querySelector("iframe, .echarts-container, pre > code.language-dot, pre > code.language-d2, pre > code.language-echarts, .diagram, figure.media"),e.visual&&(o=J);let n=t.classList.contains("card-full");if(t.classList.remove("img-portrait","img-landscape","img-overlay"),n&&(o=J),t.classList.contains("card-bleed")){let s=Math.max(0,...[...a.querySelectorAll("img")].map(c=>c.naturalWidth&&c.naturalHeight?c.naturalWidth/c.naturalHeight:0))||1.7777777777777777,l=J-wt*s>=260;if(n&&l)t.classList.add("img-portrait"),t.style.setProperty("--img-w",Math.round(wt*s)+"px"),o=J;else if(n||Math.abs(s-16/9)<.08)t.classList.add("img-overlay"),o=J;else if(s<1.3){let c=Math.min(Math.round(wt*s),J-300);t.classList.add("img-portrait"),t.style.setProperty("--img-w",c+"px"),o=Math.min(J,Math.max(oa,c*2))}else t.classList.add("img-landscape"),o=Math.round(Math.max(Ie,Math.min(J,(wt-dr)*s))),t.style.setProperty("--img-h",Math.round(o/s)+"px")}else(a.querySelector('[style*="flex"], [style*="grid"], .r-hstack')||a.querySelectorAll("img").length>=4)&&(o=oa);let r=a.querySelectorAll("table");if(r.length){t.style.width=J+"px";let s=t.offsetWidth-a.clientWidth;r.forEach(l=>{o=Math.max(o,Math.min(oa,Math.ceil(l.offsetWidth)+s+12))})}let i=a.querySelectorAll(".fragment.grow");if(i.length){t.style.width=o+"px";let s=t.offsetWidth-a.clientWidth;i.forEach(l=>{o=Math.max(o,Math.min(J,Math.ceil(l.offsetWidth*1.3)+s))})}t.style.width=o+"px",t.scrollWidth>o+2&&(t.style.width=(o=Math.min(J,t.scrollWidth+24))+"px"),a.scrollWidth>a.clientWidth+2&&(a.style.zoom=(a.clientWidth/a.scrollWidth).toFixed(3)),e._w=o,e._h=t.offsetHeight||da,t.classList.remove("measuring")}function Fr(){clearTimeout(Ro),Ro=setTimeout(()=>{d.forEach(jt),rt(),ne(!0)},200)}function Hr(){let e=Dt()==="light"?"light":"dark",t=Ve(e==="light"?"--accent-ring":"--accent"),a="slidetake-"+e+"-"+t.slice(1);return Do.has(a)||(Ur(a,Wr[e],t),Do.add(a)),a}function Ur(e,t,a){let o={axisLine:{lineStyle:{color:t.line}},axisTick:{lineStyle:{color:t.line}},axisLabel:{color:t.muted},splitLine:{lineStyle:{color:t.split}},nameTextStyle:{color:t.muted}};echarts.registerTheme(e,{color:[a,...t.palette],backgroundColor:"transparent",textStyle:{color:t.text,fontFamily:"'IBM Plex Sans', sans-serif"},title:{textStyle:{color:t.text},subtextStyle:{color:t.muted}},legend:{textStyle:{color:t.text}},tooltip:{backgroundColor:t.tip,borderColor:t.line,textStyle:{color:t.text}},categoryAxis:o,valueAxis:o,logAxis:o,timeAxis:o,line:{symbolSize:6,lineStyle:{width:2.5}},pie:{label:{color:t.text,textBorderWidth:0},labelLine:{lineStyle:{color:t.muted}}},funnel:{label:{color:t.text,textBorderWidth:0}}})}function Gr(){let e=Dt()==="light"?"light":"dark",t=Ve("--node-bg"),a=Ve(e==="dark"?"--accent":"--accent-line"),o=e==="dark"?[.58,.38,.25,.18,.12]:[.7,.45,.25,.15,.08],n={...Yr[e],N7:t,B1:Ve("--accent")};return o.forEach((r,i)=>{n["B"+(i+2)]=xr(a,t,r)}),n}function ha(e){return ra[e]||(ra[e]=new Promise((t,a)=>{let o=document.createElement("script");o.src=e,o.onload=t,o.onerror=()=>{delete ra[e],a(new Error("could not load "+e))},document.head.appendChild(o)}))}async function Vr(){let e=we,t=[...q.querySelectorAll(".node pre > code.language-dot")];q.querySelectorAll(".node pre > code.language-echarts").forEach(r=>{let i=document.createElement("div");i.className="echarts-container",i.dataset.chart=r.textContent,r.parentElement.replaceWith(i)});let a=[...q.querySelectorAll(".node .echarts-container[data-chart]")],o=[...q.querySelectorAll(".node pre > code.language-d2")];if(!t.length&&!a.length&&!o.length)return;let n=[];if(t.length)try{if(await ha(Nr),ia=ia||await Viz.instance(),e!==we)return;t.forEach(r=>{let i=document.createElement("div");i.className="diagram";try{i.appendChild(ia.renderSVGElement(r.textContent))}catch(s){i.className="diagram err",i.textContent="Diagram error: "+s.message}r.parentElement.replaceWith(i)})}catch{n.push("diagrams")}if(o.length)try{if(!xt){let i=await import(qr);xt=new i.D2}if(e!==we)return;let r=Gr();for(let i of o){let s=document.createElement("div");s.className="diagram d2";try{let l=await xt.compile(Kr(i.textContent));s.innerHTML=await xt.render(l.diagram,{...l.renderOptions||{},themeOverrides:r,darkThemeOverrides:r})}catch(l){s.className="diagram err",s.textContent="Diagram error: "+(l.message||l)}if(e!==we)return;i.parentElement.replaceWith(s)}}catch{n.push("D2 diagrams")}if(a.length)try{if(await ha(_r),e!==we)return;let r=Hr();a.forEach(i=>{let s;try{s=JSON.parse(i.dataset.chart)}catch{i.textContent="Chart data is not valid JSON.";return}echarts.init(i,r,{renderer:"svg"}).setOption(Object.assign({backgroundColor:"transparent",animation:!Fe},s))})}catch{n.push("charts")}e===we&&(n.length&&(et.textContent="Could not load the "+n.join(" and ")+" renderer (offline?)"),d.forEach(jt),rt(),ne(!0))}function $r(){let e=[];return u.forEach(t=>{let a=at(t),o=e[e.length-1];o&&o.sec===a?o.ids.push(t):e.push({sec:a,ids:[t]})}),e}function Jr(){let a=0,o=0,n=0;$r().forEach((r,i)=>{let s=Math.max(...r.ids.map(f=>d.get(f)._h));i&&(a+=n/2+120+s/2);let l=o,c=o;r.ids.forEach((f,_)=>{let O=d.get(f);_&&(l+=90+O._w/2),O.cx=l,O.cy=a,c=l,l+=O._w/2}),o=c,n=s})}function Xr(){d.forEach(e=>{e.cx=0,e.cy=0})}function nn(){we++,window.echarts&&q.querySelectorAll(".echarts-container").forEach(a=>{let o=echarts.getInstanceByDom(a);o&&o.dispose()}),q.querySelectorAll("div.node").forEach(a=>a.remove());let e=tn(),t=0;d.forEach(a=>{let o=document.createElement("div");o.className="node",o.tabIndex=0,o.dataset.id=a.id;let n=a.parent?Ft(a.id).slice(0,-1).map(i=>d.get(i).title).join(" / "):"";o.innerHTML=(n?'<div class="crumb">'+T(n)+"</div>":"")+'<div class="body">'+a.html+"</div>"+(a.err?'<div class="err-badge">!</div>':"");let r=o.querySelector(".body");Ar(r),Pr(r),zr(o,r),r.querySelectorAll("thead").forEach(i=>{i.textContent.trim()||i.remove()}),t+=jr(r),a.frags=Rr(r),r.querySelectorAll("img").forEach(i=>{i.complete||i.addEventListener("load",Fr,{once:!0})}),o.querySelectorAll("a[href]").forEach(i=>{let s=i.getAttribute("href");if(s.startsWith("#")){let l=decodeURIComponent(s.slice(1));d.has(l)&&(i.classList.add("xlink"),i.addEventListener("click",c=>{c.preventDefault(),c.stopPropagation(),h.active||P(l)}))}else i.target="_blank",i.rel="noopener",i.addEventListener("click",l=>l.stopPropagation())}),o.addEventListener("click",()=>{h.active||P(a.id)}),o.addEventListener("keydown",i=>{i.key==="Enter"&&i.target===o&&P(a.id)}),q.appendChild(o),a.el=o,Sa(a,a.frags.length)}),t&&!et.textContent&&(et.textContent=t+" image(s) use relative paths: add base: to the deck, or open it with ?src="),d.forEach(jt),rt(e),Vr()}function rt(e){e===void 0&&(e=tn()),z==="radial"?Or(e):z==="path"?Jr():z==="focus"?Xr():Mr(),q.classList.toggle("focus",z==="focus"),d.forEach(t=>{let a=t.el.style;a.setProperty("--cx",t.cx),a.setProperty("--cy",t.cy)}),Qr(),Ne(),Ta()}function Qr(){let e="";if(z==="focus"){aa.innerHTML="";return}if(z==="path"){for(let t=1;t<u.length;t++){let a=d.get(u[t-1]),o=d.get(u[t]);e+='<path data-from="'+a.id+'" data-to="'+o.id+'" d="M '+a.cx+" "+a.cy+" L "+o.cx+" "+o.cy+'"/>'}aa.innerHTML=e;return}d.forEach(t=>{if(!t.parent)return;let a=d.get(t.parent);if(z==="radial")e+='<path data-from="'+a.id+'" data-to="'+t.id+'" d="M '+a.cx+" "+a.cy+" L "+t.cx+" "+t.cy+'"/>';else{let o=a.cy+a._h/2,n=t.cy-t._h/2,r=o+(n-o)/2;e+='<path data-from="'+a.id+'" data-to="'+t.id+'" d="M '+a.cx+" "+o+" L "+a.cx+" "+r+" L "+t.cx+" "+r+" L "+t.cx+" "+n+'"/>'}}),aa.innerHTML=e}function Ft(e){let t=[],a=e;for(;a;)t.unshift(a),a=d.get(a).parent;return t}function Pe(){let e=M.clientWidth,t=M.clientHeight;q.style.transform="translate("+e/2+"px,"+t/2+"px) scale("+E.zoom+") translate("+-E.x+"px,"+-E.y+"px)",un()}function Ea(){Qe&&(Qe.kill(),Qe=null)}function rn(e,t){if(Ea(),t||Fe||!window.gsap){Object.assign(E,e),Pe();return}let a=M.clientWidth,o=Math.hypot(e.x-E.x,e.y-E.y),n=e.zoom,r=gsap.timeline({onUpdate:Pe,onComplete:()=>{Qe=null}}),{zoom:i,...s}=e,l=o*Math.min(E.zoom,n),c=Math.max(.55,Math.min(1.3,.55+l/a*.3));if(r.to(E,{...s,duration:c,ease:"power2.inOut"},0),l>a*1.2){let f=Math.max(.06,Math.min(E.zoom,n,a*.9/(o+Ie)));r.to(E,{zoom:f,duration:c/2,ease:"sine.out"},0).to(E,{zoom:n,duration:c/2,ease:"sine.in"},c/2)}else r.to(E,{zoom:n,duration:c,ease:"power2.inOut"},0);Qe=r}function Zr(){let e=M.getBoundingClientRect(),t=14,a=[];if(!pe.hidden&&pe.offsetWidth){let n=pe.getBoundingClientRect();a.push({x0:n.left-e.left-t,y0:n.top-e.top-t,x1:n.right-e.left+t,y1:n.bottom-e.top+t})}let o=Cr();return o&&a.push({x0:o.x0-t,y0:o.y0-t,x1:o.x1+t,y1:o.y1+t}),a}function ei(){let e=M.clientWidth,t=M.clientHeight,a=[{x0:16,y0:D?20:56,x1:e-16,y1:t-(D?20:74)}];return Zr().forEach(o=>{let n=[];a.forEach(r=>{if(o.x1<=r.x0||o.x0>=r.x1||o.y1<=r.y0||o.y0>=r.y1){n.push(r);return}[{...r,x1:Math.min(r.x1,o.x0)},{...r,x0:Math.max(r.x0,o.x1)},{...r,y1:Math.min(r.y1,o.y0)},{...r,y0:Math.max(r.y0,o.y1)}].forEach(i=>{i.x1-i.x0>80&&i.y1-i.y0>80&&n.push(i)})}),n.length&&(a=n)}),a}function ua(e,t,a){let o=M.clientWidth,n=M.clientHeight,r=null;return ei().forEach(i=>{let s=a*Math.min((i.x1-i.x0)/e,(i.y1-i.y0)/t);(!r||s>r.zoom)&&(r={zoom:s,sx:(i.x0+i.x1)/2-o/2,sy:(i.y0+i.y1)/2-n/2})}),r}function sn(e,t,a,o){return{x:e-a.sx/o,y:t-a.sy/o}}function Ce(e,t){let a=d.get(e);if(!a)return;let o=ua(a._w,a._h,tt),n=at(e),r=u.filter(l=>at(l)===n&&!d.get(l).visual).map(l=>{let c=d.get(l);return ua(c._w,c._h,tt).zoom}).sort((l,c)=>l-c),i=r.length?r[Math.floor((r.length-1)/2)]:o.zoom,s=Math.max(.2,Math.min(5,o.zoom,i));rn(Object.assign(sn(a.cx,a.cy,o,s),{zoom:s}),t)}function it(e){let t=[...d.values()];if(!t.length)return;let a=M.clientWidth,o=M.clientHeight,n=Math.min(...t.map(f=>f.cx-f._w/2)),r=Math.max(...t.map(f=>f.cx+f._w/2)),i=Math.min(...t.map(f=>f.cy-f._h/2)),s=Math.max(...t.map(f=>f.cy+f._h/2)),l=ua(r-n,s-i,.94),c=Math.max(.05,Math.min(1,l.zoom));rn(Object.assign(sn((n+r)/2,(i+s)/2,l,c),{zoom:c}),e)}function ne(e){p&&d.has(p)?Ce(p,e):it(e)}function Ne(){let e=p?Ft(p):[];d.forEach(t=>{let a=t.el;a.classList.toggle("current",t.id===p),a.classList.toggle("active-path",e.includes(t.id))}),q.querySelectorAll("#connectors path").forEach(t=>{let a=z==="path"?!!p&&u.indexOf(t.dataset.to)<=u.indexOf(p):e.includes(t.dataset.from)&&e.includes(t.dataset.to);t.classList.toggle("active",a)}),ni(e),cn()}function ln(){return no(new URLSearchParams(location.search).get("duration")??w.duration)}function ti(){return D&&ln()>0&&(!h.active||/^always$/i.test(w.timer||""))}function Tt(){let e=ti()&&ue.start>0;if(ke.classList.toggle("timed",e),!e){ke.classList.remove("over");return}let a=(h.active&&h.t0?Bt():performance.now()-ue.start)/ln();ke.firstChild.style.width=Math.min(100,a*100)+"%",ke.classList.toggle("over",a>=1)}function ai(){ue.start=performance.now(),clearInterval(ue.timer),ue.timer=setInterval(Tt,1e3),Tt()}function oi(){clearInterval(ue.timer),ue.timer=null,ue.start=0,Tt()}function cn(){let e=D&&u.length>1&&!/^(off|no|false)$/i.test(w.progress||"");if(ke.classList.toggle("show",e),!e)return;Tt();let t=u.indexOf(p),a=0,o=0;u.forEach((n,r)=>{let i=Le(d.get(n)).length;a+=i,r<t?o+=i:r===t&&(o+=Math.min(oe,i-1)+1)}),ke.lastChild.style.width=(a?o/a*100:0)+"%"}function ni(e){Bo.innerHTML=e.map((t,a)=>(a>0?'<span class="sep">\u203A</span>':"")+'<button class="crumb-btn'+(t===p?" here":"")+'" data-id="'+T(t)+'">'+T(d.get(t).title)+"</button>").join(""),Bo.querySelectorAll(".crumb-btn").forEach(t=>t.addEventListener("click",()=>{h.active||P(t.dataset.id)}))}function st(e){let t=d.get(p);t&&(Sa(t,Zo().frag,e),ka(),(L.hidden||!ze||!ze.full)&&si(t),La(t))}function ii(e){return!u.length||e.id!==u[0]&&e.id!==u[u.length-1]||e.el.querySelector("[data-gsap], .title-scramble")?null:[...e.el.querySelector(".body").children].filter(t=>!t.classList.contains("fragment"))}function si(e){if(e._played||!window.gsap||Fe)return;e._played=!0;let t=ii(e);if(t&&t.length){e._auto=t;let[a,...o]=t;/^H[1-3]$/.test(a.tagName)&&!a.children.length?(a.classList.add("auto-scramble"),jo(a)):o.unshift(a),gsap.from(o,{opacity:0,y:24,duration:.7,ease:"power2.out",delay:.5,stagger:.45})}e.el.querySelectorAll("[data-gsap]").forEach(a=>{let o;try{o=JSON.parse(a.dataset.gsap)}catch{return}let n={duration:o.duration??1,delay:o.delay??0,ease:o.ease||"power2.out"};o.to?gsap.fromTo(a,o.from||{},Object.assign({},o.to,n)):o.from&&gsap.from(a,Object.assign({},o.from,n))}),e.el.querySelectorAll(".title-scramble").forEach(jo)}function Ca(e){!e||!e._played||(e._played=!1,window.gsap&&(e._auto&&(e._auto.forEach(t=>{gsap.killTweensOf(t),gsap.set(t,{clearProps:"opacity,transform"})}),e._auto=null),e.el.querySelectorAll("[data-gsap]").forEach(t=>{gsap.killTweensOf(t);let a={};try{a=JSON.parse(t.dataset.gsap)}catch{}let o=new Set(Object.keys(Object.assign({},a.from,a.to)).map(n=>ri.includes(n)?"transform":n));o.size&&gsap.set(t,{clearProps:[...o].join(",")})}),e.el.querySelectorAll(".title-scramble, .auto-scramble").forEach(t=>{t._scramble&&t._scramble.kill(),t.dataset.text&&(t.textContent=t.dataset.text)})))}function jo(e){let t=e.dataset.text||(e.dataset.text=e.textContent),a=Array.from(t),o="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789#%&*+=?",n={p:0};e._scramble=gsap.to(n,{p:1,duration:1.4,ease:"none",onUpdate(){let r=Math.floor(n.p*a.length);e.textContent=a.map((i,s)=>s<r||/\s/.test(i)?i:o[Math.random()*o.length|0]).join("")},onComplete(){e.textContent=t}})}function La(e){clearTimeout(Re),!(!D||!e||!e.autoslide||h.active&&(!h.t0||h.paused))&&(Re=setTimeout(()=>{p===e.id&&De(1)},e.autoslide))}function dn(e){let t=e&&e!==u[0]?e:"";try{b&&b.kind==="share"?history.replaceState(null,"",location.pathname+location.search+Zt(b.data,t)):history.replaceState(null,"",e?"#"+encodeURIComponent(e):location.pathname+location.search)}catch{}}function P(e,t,a){if(!d.has(e))return;if(e!==p){te=null,he=-1,oe=a?Le(d.get(e)).length-1:0;let r=d.get(p);r&&z==="focus"&&!t&&(r.el.classList.add("leaving"),setTimeout(()=>r.el.classList.remove("leaving"),600)),pn()}let o=e!==p;if(p=e,clearTimeout(ee),ee=null,o&&z==="focus"&&!t&&!Fe){let r=d.get(e).el;r.classList.add("entering"),r.offsetWidth,r.classList.remove("entering")}st(o),o&&za("slide",e);let n=d.get(e);o&&n.mapFirst&&!a&&!t&&z!=="focus"?(it(),ee=setTimeout(()=>{ee=null,p===e&&Ce(e)},1900)):Ce(e,t),Ne(),Ta(),dn(e)}function pn(){let e=d.get(p);e&&(e.el.querySelectorAll("figure.yt").forEach(t=>on(t,"pauseVideo")),Sa(e,e.frags.length,!0),Ca(e))}function li(){if(!p&&Se&&d.has(Se)){hn();return}p&&(Se=p),z==="focus"&&Nt("path"),pn(),clearTimeout(Re),p=null,Ne(),Ta(),it(),dn(null)}function hn(){if(ee)return clearTimeout(ee),ee=null,Ce(p),!0;if(!p&&Se&&d.has(Se)){let e=Se;return Se=null,P(e),!0}return!1}function De(e){if(!p){u.length&&P(u[e>0?0:u.length-1]);return}if(ee&&e>0){clearTimeout(ee),ee=null,Ce(p);return}let t=Le(d.get(p)),a=Math.min(oe,t.length-1)+e;if(a>=0&&a<t.length){oe=a,te=null,he=-1,st(),!Y&&!L.hidden&&ze.used?dt():ne(),Ne();return}let o=u.indexOf(p)+e;o>=0&&o<u.length&&P(u[o],!1,e<0)}function ci(){let e=d.get(p);e&&e.parent&&P(e.parent)}function di(){let e=d.get(p);e&&e.children.length?P(e.children[0]):!p&&u.length&&P(u[0])}function Ta(){let e=[...d.values()];if(!e.length){ca.innerHTML="",se=null;return}cr.textContent="map";let t=g=>g.cx,a=g=>g.cy,o=Math.min(...e.map(t))-Ie/2,n=Math.max(...e.map(t))+Ie/2,r=Math.min(...e.map(a))-da/2,i=Math.max(...e.map(a))+da/2,s=16,l=180,c=130,f=Math.min((l-2*s)/Math.max(1,n-o),(c-2*s-6)/Math.max(1,i-r)),_=l/2-(o+n)/2*f,O=c/2+5-(r+i)/2*f,y=p?Ft(p):[],S="";e.forEach(g=>{if(!g.parent)return;let B=d.get(g.parent);S+='<line x1="'+(t(B)*f+_)+'" y1="'+(a(B)*f+O)+'" x2="'+(t(g)*f+_)+'" y2="'+(a(g)*f+O)+'" stroke="var(--panel-line)" stroke-width="1"/>'}),e.forEach(g=>{let B=g.id===p?"var(--accent)":y.includes(g.id)?"var(--accent-teal)":"var(--node-border)";S+='<circle data-id="'+T(g.id)+'" cx="'+(t(g)*f+_)+'" cy="'+(a(g)*f+O)+'" r="'+(g.id===p?4:3)+'" fill="'+B+'"><title>'+T(g.title)+"</title></circle>"}),S+='<rect id="mm-viewport" fill="none" stroke="var(--accent)" stroke-width="1" opacity="0.7"/>',ca.innerHTML=S,se={s:f,ox:_,oy:O},un()}function un(){let e=document.getElementById("mm-viewport");if(!e||!se)return;let t=M.clientWidth/E.zoom,a=M.clientHeight/E.zoom;e.setAttribute("x",(E.x-t/2)*se.s+se.ox),e.setAttribute("y",(E.y-a/2)*se.s+se.oy),e.setAttribute("width",Math.max(2,t*se.s)),e.setAttribute("height",Math.max(2,a*se.s))}function je(e){en(U.value),p&&!d.has(p)&&(p=null),nn(),p?P(p,e):u.length?P(u[0],e):(p=null,it(!0))}function Nt(e,t){z=e,Z("slidetake:layout",e),document.querySelectorAll("#layout-toggle .seg-btn").forEach(a=>a.classList.toggle("active",a.dataset.mode===e)),d.size&&(!t&&!Fe&&(q.classList.add("morph"),setTimeout(()=>q.classList.remove("morph"),700)),rt(),Pe(),p?Ce(p,t):it(t))}function mn(e){return Math.max(.04,Math.min(5,e))}function pi(e){tt=Math.round(Math.max(fr,Math.min(gr,e))*100)/100,Z("slidetake:slideSize",tt),p&&Ce(p)}function Fo(e){p?pi(tt+e*.1):fn(e>0?1.2:1/1.2)}function fn(e,t,a){Ea();let o=mn(E.zoom*e);if(t!==void 0){let n=M.getBoundingClientRect(),r=t-n.left-n.width/2,i=a-n.top-n.height/2;E.x+=r/E.zoom-r/o,E.y+=i/E.zoom-i/o}E.zoom=o,Pe()}function _t(){A||(ge.classList.toggle("collapsed"),document.getElementById("btn-edit-toggle").classList.toggle("active",!ge.classList.contains("collapsed")))}function be(e){D=e,document.body.classList.toggle("presenting",e),Rn();let t=document.documentElement;e&&t.requestFullscreen&&!document.fullscreenElement&&t.requestFullscreen().catch(()=>{}),!e&&document.fullscreenElement&&document.exitFullscreen&&document.exitFullscreen().catch(()=>{}),e&&!p&&u.length&&P(u[0]);let a=w.camera||[...d.values()].some(o=>o.camera);e&&a&&!Y&&!G&&dt(),e?La(d.get(p)):clearTimeout(Re),e?ai():oi(),cn()}function Bt(){return(h.paused?h.pauseAt:performance.now())-h.t0-h.pausedMs}function lt(e){e.classList.add("open")}function bi(e){if(Z("slidetake:analytics",e?"on":"off"),!e){window["ga-disable-"+fi]=!0;let t=["","; Domain="+location.hostname,"; Domain=."+location.hostname.replace(/^www\./,"")];document.cookie.split(";").map(a=>a.split("=")[0].trim()).filter(a=>a==="_ga"||a.startsWith("_ga_")).forEach(a=>t.forEach(o=>{document.cookie=a+"=; Max-Age=0; Path=/"+o}))}yn()}function yn(){Aa.querySelectorAll("[data-analytics]").forEach(e=>e.setAttribute("aria-checked",String(e.dataset.analytics==="on"===gi())))}function Ba(){document.querySelectorAll(".modal.open").forEach(e=>e.classList.remove("open"))}function yi(){let e=new URLSearchParams(location.search).get("obs");if(e){let[t,a,...o]=e.split(":");return Mt.value=t||"localhost",Ot.value=a||"4455",At.value=o.join(":"),!0}try{let t=JSON.parse(Q("slidetake:obs")||"null");t&&(Mt.value=t.host||"localhost",Ot.value=t.port||"4455",At.value=t.password||"",Ma.checked=!0)}catch{}return!1}function wn(){if(Ma.checked)Z("slidetake:obs",JSON.stringify({host:Mt.value.trim(),port:Ot.value.trim(),password:At.value}));else try{localStorage.removeItem("slidetake:obs")}catch{}}function Ke(e,t){Uo.textContent=e,Uo.className=t||""}function wi(e){return location.protocol==="https:"&&!vi(e)}async function xn(){let e=Mt.value.trim()||"localhost",t="ws://"+e+":"+(Ot.value.trim()||"4455");if(wi(e)){xe=!1,Ze.disabled=!0,Ke(xi,"err");return}Ke("Connecting to "+t+"\u2026");try{await ha(hi);let a=window.OBSWebSocket&&(window.OBSWebSocket.default||window.OBSWebSocket);if(H)try{await H.disconnect()}catch{}H=new a,H.on("ConnectionClosed",()=>{xe=!1,Ke("Disconnected from OBS","err"),Ze.disabled=!0}),H.on("RecordStateChanged",n=>{n.outputState==="OBS_WEBSOCKET_OUTPUT_STARTED"&&Ee&&(Ee(),Ee=null),n.outputState==="OBS_WEBSOCKET_OUTPUT_STOPPED"&&h.active&&h.withObs&&!h.finishing&&Wt("Stopped in OBS")});let o=await H.connect(t,At.value||void 0);xe=!0;try{let n=await H.call("GetVideoSettings");n&&n.fpsNumerator&&n.fpsDenominator&&(gn=n.fpsNumerator/n.fpsDenominator)}catch{}Ke("Connected"+(o&&o.obsWebSocketVersion?" \xB7 OBS WebSocket "+o.obsWebSocketVersion:""),"ok"),wn()}catch(a){xe=!1,Ke("Could not connect ("+(a&&a.message||a)+"). Is OBS running with its WebSocket server on, and is the password right?","err")}Ze.disabled=!xe}function ki(){let e=document.getElementById("rec-screen"),t=screen.width,a=screen.height;if(Math.abs(t/a-16/9)<.02){e.innerHTML='<span class="ok">This screen is 16:9 ('+t+"\xD7"+a+"), right for YouTube.</span>";return}let o=[["16:10",1.6],["3:2",1.5],["4:3",4/3],["21:9",21/9],["16:9",16/9]],[n,r]=o.reduce((s,l)=>Math.abs(l[1]-t/a)<Math.abs(s[1]-t/a)?l:s),i=Math.abs(r-t/a)<.005?n:"about "+n;e.innerHTML='<span class="warn">This screen is '+i+" ("+t+"\xD7"+a+"), not 16:9, so the video will have bars or be cropped. Move this window to a 16:9 screen, physical or virtual (say 1920\xD71080), then press F there.</span>"}function fa(){if(!nt)return;let e=u.reduce((a,o)=>a+Le(d.get(o)).length,0),t=w.camera||[...d.values()].some(a=>a.camera);document.getElementById("rec-deck-info").innerHTML=T(w.title||(ce[0]?d.get(ce[0]).title:"This deck"))+" \xB7 "+u.length+" slides \xB7 "+e+" presses"+(t&&G?'<br><span class="warn">The camera is off. Press C first if this take should include your webcam.</span>':""),Ze.disabled=!xe,Ti(),ki(),lt(ui)}async function kn(e){if(h.active||!u.length)return;Ba(),Object.assign(h,{active:!0,withObs:e,counting:!0,paused:!1,finishing:!1,t0:0,pausedMs:0,events:[],outputPath:null}),document.body.classList.add("recording"),Ra();let t=document.getElementById("rec-layout").value;t!=="current"&&t!==z&&Nt(t,!0),D||be(!0),p===u[0]&&(oe=0,te=null,he=-1),P(u[0],!0);for(let o=3;o>0;o--)if(St.querySelector(".num").textContent=o,St.classList.add("show"),await Oa(1e3),!h.active)return;if(St.classList.remove("show"),await bn(),e){let o=new Promise(n=>{Ee=n,setTimeout(()=>{Ee&&(Ee(),Ee=null)},2500)});try{await H.call("StartRecord")}catch(n){Ia("OBS could not start recording: "+(n&&n.message||n));return}if(await o,!h.active)return}h.counting=!1,h.t0=performance.now();let a=d.get(p);Ca(a),st(!0),za("slide",p)}function Ia(e){h.active=!1,h.counting=!1,St.classList.remove("show"),document.body.classList.remove("recording"),D&&be(!1),Ae(e)}function za(e,t){if(!h.active||!h.t0||h.finishing)return;let a=d.get(t),o={id:t,title:a?a.title:t,retake:e==="retake",t:Math.round(Bt()),obsT:null};h.events.push(o),h.withObs&&xe&&(H.call("GetRecordStatus").then(n=>{n&&typeof n.outputDuration=="number"&&(o.obsT=n.outputDuration)}).catch(()=>{}),a&&H.call("CreateRecordChapter",{chapterName:(o.retake?"RETAKE \xB7 ":"")+a.title}).catch(()=>{}))}function Si(e){let t=e.key;if((_o.includes(t)||Wo.includes(t)||Ho.includes(t)||t==="Escape")&&e.preventDefault(),t==="Escape"){h.counting?Ia("Take cancelled"):Wt("Stopped early");return}if(!(h.counting||h.finishing)){if(Ho.includes(t)){Li();return}h.paused||(_o.includes(t)?Ei():Wo.includes(t)&&Ci())}}function Ei(){let e=Le(d.get(p));Math.min(oe,e.length-1)>=e.length-1&&u.indexOf(p)===u.length-1?Wt():De(1)}function Ci(){let e=d.get(p);e&&(za("retake",p),oe=0,te=null,he=-1,Ca(e),st(!0),!Y&&!L.hidden&&ze.used?dt():ne(),Ne())}async function Li(){h.t0&&(h.paused?(ma.classList.remove("show"),await bn(),h.withObs&&await H.call("ResumeRecord").catch(()=>{}),h.pausedMs+=performance.now()-h.pauseAt,h.paused=!1,La(d.get(p))):(h.paused=!0,h.pauseAt=performance.now(),clearTimeout(Re),h.withObs&&await H.call("PauseRecord").catch(()=>{}),ma.classList.add("show")))}async function Wt(e){if(!h.active||h.finishing)return;if(h.counting){Ia("Take cancelled");return}h.finishing=!0,clearTimeout(Re),h.paused&&(h.pausedMs+=performance.now()-h.pauseAt,h.paused=!1,ma.classList.remove("show"));let t=Math.round(Bt()),a=null;if(h.withObs){await Oa(1200),t=Math.round(Bt());try{let n=await H.call("GetRecordStatus");n&&typeof n.outputDuration=="number"&&(a=n.outputDuration)}catch{}try{let n=await H.call("StopRecord");h.outputPath=n&&n.outputPath}catch(n){e=(e?e+". ":"")+"OBS did not confirm the stop ("+(n&&n.message||n)+")"}}h.active=!1,h.finishing=!1,document.body.classList.remove("recording"),D&&be(!1);let o={key:Ht(),deckTitle:w.title||d.get(u[0]).title,date:new Date().toISOString(),withObs:h.withObs,outputPath:h.outputPath,reason:e||"",total:t,totalObs:a,fps:gn,events:h.events.map(n=>({id:n.id,title:n.title,retake:n.retake,t:n.t,obsT:n.obsT})),picks:{}};Pa(o),On(o)}function Ht(){return Te(w.title||(u[0]?d.get(u[0]).title:"deck"))}function Sn(){try{return JSON.parse(Q("slidetake:sessions")||"[]")}catch{return[]}}function Pa(e){let t=Sn().filter(a=>a.date!==e.date);t.unshift(e),Z("slidetake:sessions",JSON.stringify(t.slice(0,12)))}function Ti(){let e=document.getElementById("rec-sessions"),t=Sn().filter(a=>a.key===Ht());e.innerHTML=t.length?"<h3>Earlier takes of this deck</h3>"+t.map((a,o)=>'<div class="row"><button class="btn small" data-session="'+o+'">Review</button><span>'+T(new Date(a.date).toLocaleString())+" \xB7 "+$(a.totalObs??a.total)+(a.withObs?"":" \xB7 rehearsal")+(a.outputPath?" \xB7 "+T(Me(a.outputPath)):"")+"</span></div>").join(""):"",e.querySelectorAll("[data-session]").forEach(a=>a.onclick=()=>{Ba(),On(t[+a.dataset.session])})}function at(e){let t=d.has(e)?Ft(e):[e];return t[Math.min(1,t.length-1)]}function En(e,t){let a=at(e);return{sec:a,title:d.has(a)?d.get(a).title:t}}function Tn(){let e=Object.keys(w).filter(t=>t==="tags"||/_tags$/.test(t)).flatMap(t=>[].concat(w[t])).filter(t=>typeof t=="string");return[...new Set(e.map(t=>t.trim()).filter(Boolean))]}function Mi(){return[].concat(w.related||[]).map(e=>{let t=String(e).match(/^\[([^\]]+)\]\(([^)]+)\)$/),a=String(e).split("|");return t?t[1]+": "+t[2]:a.length===2?a[0].trim()+": "+a[1].trim():String(e)})}function Oi(){if(w.permalink||w.url)return w.permalink||w.url;let e=w.site||Q("slidetake:site");if(!e||!ae)return"";try{let t=new URL(ae).pathname.replace(/\/index\.md$/i,"/").replace(/\.md$/i,"/");return new URL(t,e).href}catch{return""}}function Mn(e){let t=Cn(e),a=document.getElementById("rv-link").value.trim(),o=Mi(),n=Tn(),r=[];w.summary&&r.push(w.summary),a&&r.push("\u{1F4D1} Slides: "+a),t.lines.length>=3&&r.push(`Chapters
|
|
853
|
+
`)};[A&&A.colors,vr()].filter(Boolean).forEach(o=>{["dark","light"].forEach(n=>{let r={...o,...o[n]||{}},i=n==="dark";r.accent&&typeof r.accent=="string"&&(r.accentSoft=r.accentSoft||r.accent,r.line=r.line||"color-mix(in srgb, "+r.accent+(i?" 45%, #09090b)":" 55%, #fff)"),r.ring=r.ring||(i?r.accent:r.line),r.onAccent=r.onAccent||(i?"color-mix(in srgb, "+r.accent+" 15%, #000)":"#fff")),t(i?'body:not([data-mode="light"])':'body[data-mode="light"]',r)})});let a=document.getElementById("st-colors");a||(a=document.createElement("style"),a.id="st-colors",document.head.appendChild(a)),a.textContent!==e&&(a.textContent=e),document.body.classList.toggle("st-header-color",e.includes("--header-bg"))}function Ve(e){let t=document.createElement("span");t.style.color="var("+e+")",document.body.appendChild(t);let a=getComputedStyle(t).color;return t.remove(),ve=ve||Object.assign(document.createElement("canvas"),{width:1,height:1}).getContext("2d",{willReadFrequently:!0}),ve.clearRect(0,0,1,1),ve.fillStyle="#000",ve.fillStyle=a,ve.fillRect(0,0,1,1),"#"+[...ve.getImageData(0,0,1,1).data.slice(0,3)].map(o=>o.toString(16).padStart(2,"0")).join("")}function xr(e,t,a){let o=i=>[1,3,5].map(s=>parseInt(i.slice(s,s+2),16)),n=o(e),r=o(t);return"#"+n.map((i,s)=>Math.round(i*a+r[s]*(1-a)).toString(16).padStart(2,"0")).join("")}function Dt(){if(A&&A.themeKey&&!zo){let t=Q(A.themeKey);return t==="light"||t==="dark"?t:matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}return String(zo||Q("slidetake:mode")||w.mode||"dark").toLowerCase()==="light"?"light":"dark"}function Xo(){let e=Dt()==="light";e?document.body.dataset.mode="light":delete document.body.dataset.mode;let t=document.getElementById("btn-mode");t&&(t.innerHTML=e?'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z"/></svg>':'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><circle cx="12" cy="12" r="4.5"/><path d="M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"/></svg>',t.title=(e?"Dark theme":"Light theme")+" (L)",t.setAttribute("aria-label",t.title))}function Qo(){let e=Dt()==="light"?"dark":"light";A&&A.themeKey?(Z(A.themeKey,e),document.documentElement.classList.toggle("dark",e==="dark")):Z("slidetake:mode",e),Xo(),q.querySelector(".echarts-container, .diagram.d2")&&je(!0)}function kr(){let t=(w.camera||"").replace(/^\[|\]$/g,"").split(",").map(a=>a.trim().replace(/^["']|["']$/g,"")).filter(Boolean);return t.length?t:["on","full","off"]}function pa(e){return!G&&e?po(e.camera):[]}function Le(e){return ho(pa(e),e&&e.frags?e.frags.length:0)}function Zo(){let e=Le(d.get(p));return e[Math.min(oe,e.length-1)]||{cam:0,frag:0}}function Sr(){if(!p)return null;let e=d.get(p),t=pa(e);if(t.length)return t[Math.min(Zo().cam,t.length-1)];if(e&&e.el&&e.el.classList.contains("card-full"))return"off";for(let a=u.indexOf(p)-1;a>=0;a--){let o=pa(d.get(u[a]));if(o.length)return o[o.length-1]}return null}function Er(){let e={corner:(w.pip||"none").toLowerCase(),size:Vt(parseFloat(w.pip_size)||24),circle:(w.pip_shape||"").toLowerCase()==="circle",mirror:!/^(no|false|off)$/i.test(w.pip_mirror||""),full:!1,off:!1,flip:!1,used:!1};return ut(e,Sr()),te&&!/\b(off|hide)\b/i.test(te)&&(e.off=!1),ut(e,te),!qe.includes(e.corner)&&(Y||e.used)&&(e.corner="bottom-right"),e.flip&&qe.includes(e.corner)&&(e.corner=e.corner.includes("left")?e.corner.replace("left","right"):e.corner.replace("right","left")),e}function ka(){let e=!L.hidden&&L.offsetWidth?L.getBoundingClientRect():null,t=ze=Er(),a=qe.includes(t.corner);if(L.className=a?[t.corner,t.circle&&"circle",Y&&"live",t.mirror&&"mirror",t.full&&"full",L.classList.contains("msg")&&"msg"].filter(Boolean).join(" "):"",L.style.width=t.size+"%",L.hidden=!a||G||t.off,br.dataset.pip=L.hidden||t.full?"none":t.corner,L.hidden||Fe||!L.animate)return;let o="cubic-bezier(.65,0,.35,1)";if(!e){L.animate([{opacity:0},{opacity:1}],{duration:300,easing:"ease-out"});return}let n=L.getBoundingClientRect();Math.abs(e.left-n.left)+Math.abs(e.top-n.top)+Math.abs(e.width-n.width)+Math.abs(e.height-n.height)<2||L.animate([{transformOrigin:"0 0",transform:"translate("+(e.left-n.left)+"px,"+(e.top-n.top)+"px) scale("+e.width/n.width+","+e.height/n.height+")"},{transformOrigin:"0 0",transform:"none"}],{duration:600,easing:o})}function Cr(){let e=ze;if(!e||L.hidden||e.full)return null;let t=M.clientWidth,a=M.clientHeight,o=16,n=t*e.size/100,r=e.circle?n:n*9/16,i=e.corner.includes("left")?o:t-o-n,s=e.corner.includes("top")?o:a-o-r;return{x0:i,y0:s,x1:i+n,y1:s+r}}function Lr(){if(!nt)return;if(G){ja(!0);return}let e=kr();he=(he+1)%e.length,te=e[he],ka(),D||Ae("Camera: "+te),!Y&&!L.hidden?dt():ne()}function en(e){let t=lo(e,{render:yr});w=t.deck,d=t.nodes,Lt();let a={"+++":"+++ format",reveal:"reveal.js format",headings:"headings"}[t.format];lr.textContent=d.size+(d.size===1?" card":" cards")+" \xB7 "+a,et.textContent=t.errCount?t.errCount+" card(s) had errors":""}function tn(){ce=[...d.values()].filter(o=>!o.parent).map(o=>o.id);let e=0;function t(o,n){let r=d.get(o);if(r.depth=n,r.children.length===0)r._slot=e++;else{r.children.forEach(s=>t(s,n+1));let i=r.children.map(s=>d.get(s)._slot);r._slot=(Math.min(...i)+Math.max(...i))/2}}ce.forEach(o=>t(o,0)),u=[];function a(o){u.push(o),d.get(o).children.forEach(a)}return ce.forEach(a),Math.max(1,e)}function Tr(){let e=[],t=[],a=[];return d.forEach(o=>{e[o.depth]=Math.max(e[o.depth]||0,o._h),t[o.depth]=Math.max(t[o.depth]||0,o._w),a[o.depth]=(a[o.depth]||0)+1}),{maxH:e,maxW:t,count:a,maxDepth:e.length-1}}function an(e){e.x!==null&&!isNaN(e.x)&&(e.cx=e.x+e._w/2),e.y!==null&&!isNaN(e.y)&&(e.cy=e.y+e._h/2)}function Mr(){let{maxH:e,maxDepth:t}=Tr(),a=[0];for(let l=1;l<=t;l++)a[l]=a[l-1]+e[l-1]+hr;let o=pr-Ie,n=[],r=(l,c)=>{let f=d.get(l);f.cx+=c,f.children.forEach(_=>r(_,c))},i=l=>{let c=d.get(l);n[c.depth]=Math.max(n[c.depth]??-1/0,c.cx+c._w/2),c.children.forEach(i)};function s(l){let c=d.get(l),f=n[c.depth]!==void 0?n[c.depth]+o:-1/0;c.children.length?(c.children.forEach(s),c.cx=(d.get(c.children[0]).cx+d.get(c.children[c.children.length-1]).cx)/2,c.cx-c._w/2<f&&r(l,f-(c.cx-c._w/2))):c.cx=(f===-1/0?0:f)+c._w/2,i(l)}ce.forEach(s),d.forEach(l=>{l.cy=a[l.depth]+l._h/2,an(l)})}function Or(e){let t=Math.PI*2/e,a=32,o=[],n=(s,l)=>Math.abs(s.cx-l.cx)<(s._w+l._w)/2+a&&Math.abs(s.cy-l.cy)<(s._h+l._h)/2+a,r=Math.max(0,...[...d.values()].map(s=>s.depth)),i=0;for(let s=0;s<=r;s++){let l=[...d.values()].filter(f=>f.depth===s);if(!l.length)continue;let c=s===0?ce.length>1?mr*.5:0:i+ur;for(let f=0;f<400&&(l.forEach(O=>{let y=(O._slot+.5)*t-Math.PI/2;O.cx=c*Math.cos(y),O.cy=c*Math.sin(y),an(O)}),!!l.some((O,y)=>l.some((S,g)=>g>y&&n(O,S))||o.some(S=>n(O,S))));f++)c=c*1.02+10;i=c,o.push(...l)}}function Ar(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT),a=[];for(;t.nextNode();)a.push(t.currentNode);a.forEach(o=>{let n=o.data.match(/^\s*\.element:\s*([\s\S]*)$/);if(!n)return;let r=o.previousSibling;for(;r&&r.nodeType===3&&!r.data.trim();)r=r.previousSibling;let i=r&&r.nodeType===1?r:o.parentElement;i&&Object.entries(He(n[1])).forEach(([s,l])=>{s==="class"?i.classList.add(...l.split(/\s+/).filter(Boolean)):s==="style"?i.style.cssText+=";"+l:i.setAttribute(s,l)})})}function na(e){let t=document.createElement("figure");t.className="media",e.replaceWith(t),t.appendChild(e);let a=e.getAttribute("alt");return a&&t.insertAdjacentHTML("beforeend","<figcaption>"+T(a)+"</figcaption>"),t}function Br(e,t){let a=document.createElement("figure");return a.className="media yt fragment yt-play"+(e.portrait?" portrait":""),a.innerHTML='<div class="frame"><iframe src="'+So(e)+'" title="'+T(t||"YouTube video")+'" allow="autoplay; encrypted-media; picture-in-picture; fullscreen" allowfullscreen loading="lazy"></iframe></div>'+(t?"<figcaption>"+T(t)+"</figcaption>":""),a}function Po(e,t){let a=t<=4?t:t<=6?3:4;e.style.setProperty("--cols",a),e.style.setProperty("--rows",Math.ceil(t/a))}function zr(e,t){t.querySelectorAll("pre > code.language-svg").forEach(r=>{let i=document.createElement("img");i.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(r.textContent.trim()),i.alt="";let s=document.createElement("p");s.appendChild(i),r.parentElement.replaceWith(s)}),t.querySelectorAll(":scope > p").forEach(r=>{let i=r.children.length===1?r.children[0]:null;if(!i)return;let s=i.tagName==="A"&&r.textContent.trim()===i.textContent.trim()?i.getAttribute("href"):i.tagName==="IMG"?i.getAttribute("src"):null,l=s&&ko(s);l&&r.replaceWith(Br(l,i.tagName==="IMG"?i.getAttribute("alt"):""))}),t.querySelectorAll(":scope > ul, :scope > ol").forEach(r=>{let i=[...r.children];!i.length||!i.every(s=>s.querySelector("img")&&!s.textContent.trim())||(r.classList.add("gallery"),i.forEach(s=>{let l=s.querySelector("img");s.innerHTML="",s.appendChild(l),na(l)}),i.length>1&&i.every(s=>s.classList.contains("fragment"))?(r.classList.add("carousel"),i[0].classList.remove("fragment","fade-up"),i.forEach((s,l)=>{s.classList.replace("fade-up","current-visible");let c=s.querySelector("figcaption");c&&(c.dataset.count=l+1+" / "+i.length)})):Po(r,i.length))}),t.querySelectorAll(":scope > p").forEach(r=>{if(!Ir(r))return;let i=[...r.querySelectorAll("img")];if(i.length===1){r.replaceWith(i[0]),na(i[0]);return}let s=document.createElement("div");s.className="gallery grid",r.replaceWith(s),i.forEach(l=>{s.appendChild(l),na(l)}),Po(s,i.length)});let a=[...t.children].filter(r=>!/^H[1-6]$/.test(r.tagName)&&!(r.nodeType===1&&r.tagName==="HR")),o=a.filter(r=>r.matches("figure.media"));o.length===1&&a.length===1&&e.classList.add("card-media"),a.length===1&&(a[0].matches("figure.media:not(.yt)")||a[0].matches(".gallery.carousel"))&&e.classList.add("card-bleed");let n=document.createTreeWalker(t,NodeFilter.SHOW_COMMENT);for(;n.nextNode();)if(/^\s*view\s*:\s*full\s*$/i.test(n.currentNode.data))e.classList.add("card-full");else if(o.length===1){e.classList.add("card-split",a.indexOf(o[0])===0?"media-first":"media-last");let r=document.createElement("div");r.className="split-text",a.filter(i=>i!==o[0]).forEach(i=>r.appendChild(i)),o[0].after(r),a.indexOf(o[0])!==0&&r.after(o[0])}t.querySelector(".gallery")&&e.classList.add("card-gallery")}function on(e,t){let a=e.querySelector("iframe");a&&a.contentWindow&&a.contentWindow.postMessage(JSON.stringify({event:"command",func:t,args:[]}),"*")}function Pr(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT),a=[];for(;t.nextNode();)/^\s*steps\s*$/i.test(t.currentNode.data)&&a.push(t.currentNode);a.forEach(o=>{let n=o.nextSibling;for(;n&&n.nodeType!==1;)n=n.nextSibling;n&&/^(UL|OL)$/.test(n.tagName)&&n.querySelectorAll(":scope > li").forEach(r=>r.classList.add("fragment","fade-up"))})}function Rr(e){let t=[...e.querySelectorAll(".fragment")].map((n,r)=>({e:n,i:r,k:n.dataset.fragmentIndex}));if(t.every(n=>n.k===void 0))return t.map(n=>[n.e]);let a=0;t.forEach(n=>{n.k=n.k===void 0?a:parseFloat(n.k),a=Math.max(a,n.k)+1}),t.sort((n,r)=>n.k-r.k||n.i-r.i);let o=[];return t.forEach((n,r)=>{r&&t[r-1].k===n.k?o[o.length-1].push(n.e):o.push([n.e])}),o}function Sa(e,t,a){!e||!e.frags||(a&&e.el.classList.add("snap"),e.frags.forEach((o,n)=>o.forEach(r=>{let i=r.classList.contains("visible");r.classList.toggle("visible",n<t),r.classList.toggle("current-fragment",n===t-1),r.classList.contains("yt-play")&&i!==n<t&&!a&&on(r,n<t?"playVideo":"pauseVideo")})),a&&(e.el.offsetWidth,e.el.classList.remove("snap")))}function Dr(){try{return w.base?new URL(w.base,ae||location.href):ae?new URL(ae):null}catch{return null}}function jr(e){let t=Dr(),a=0;return e.querySelectorAll("img[src], source[src], video[src], iframe[src], a[href]").forEach(o=>{let n=o.hasAttribute("src")?"src":"href",r=o.getAttribute(n);if(!r||/^(#|[a-z][a-z0-9+.-]*:|\/\/)/i.test(r))return;if(!t){n==="src"&&!r.startsWith("/")&&a++;return}let i=t;try{w.site&&(i=new URL(w.site,t))}catch{}o.setAttribute(n,new URL(r,r.startsWith("/")?i:t).href)}),a}function jt(e){let t=e.el,a=t.querySelector(".body");t.classList.add("measuring"),a.style.zoom="";let o=Ie;e.visual=!!a.querySelector("iframe, .echarts-container, pre > code.language-dot, pre > code.language-d2, pre > code.language-echarts, .diagram, figure.media"),e.visual&&(o=J);let n=t.classList.contains("card-full");if(t.classList.remove("img-portrait","img-landscape","img-overlay"),n&&(o=J),t.classList.contains("card-bleed")){let s=Math.max(0,...[...a.querySelectorAll("img")].map(c=>c.naturalWidth&&c.naturalHeight?c.naturalWidth/c.naturalHeight:0))||1.7777777777777777,l=J-wt*s>=260;if(n&&l)t.classList.add("img-portrait"),t.style.setProperty("--img-w",Math.round(wt*s)+"px"),o=J;else if(n||Math.abs(s-16/9)<.08)t.classList.add("img-overlay"),o=J;else if(s<1.3){let c=Math.min(Math.round(wt*s),J-300);t.classList.add("img-portrait"),t.style.setProperty("--img-w",c+"px"),o=Math.min(J,Math.max(oa,c*2))}else t.classList.add("img-landscape"),o=Math.round(Math.max(Ie,Math.min(J,(wt-dr)*s))),t.style.setProperty("--img-h",Math.round(o/s)+"px")}else(a.querySelector('[style*="flex"], [style*="grid"], .r-hstack')||a.querySelectorAll("img").length>=4)&&(o=oa);let r=a.querySelectorAll("table");if(r.length){t.style.width=J+"px";let s=t.offsetWidth-a.clientWidth;r.forEach(l=>{o=Math.max(o,Math.min(oa,Math.ceil(l.offsetWidth)+s+12))})}let i=a.querySelectorAll(".fragment.grow");if(i.length){t.style.width=o+"px";let s=t.offsetWidth-a.clientWidth;i.forEach(l=>{o=Math.max(o,Math.min(J,Math.ceil(l.offsetWidth*1.3)+s))})}t.style.width=o+"px",t.scrollWidth>o+2&&(t.style.width=(o=Math.min(J,t.scrollWidth+24))+"px"),a.scrollWidth>a.clientWidth+2&&(a.style.zoom=(a.clientWidth/a.scrollWidth).toFixed(3)),e._w=o,e._h=t.offsetHeight||da,t.classList.remove("measuring")}function Fr(){clearTimeout(Ro),Ro=setTimeout(()=>{d.forEach(jt),rt(),ne(!0)},200)}function Hr(){let e=Dt()==="light"?"light":"dark",t=Ve(e==="light"?"--accent-ring":"--accent"),a="slidetake-"+e+"-"+t.slice(1);return Do.has(a)||(Ur(a,Wr[e],t),Do.add(a)),a}function Ur(e,t,a){let o={axisLine:{lineStyle:{color:t.line}},axisTick:{lineStyle:{color:t.line}},axisLabel:{color:t.muted},splitLine:{lineStyle:{color:t.split}},nameTextStyle:{color:t.muted}};echarts.registerTheme(e,{color:[a,...t.palette],backgroundColor:"transparent",textStyle:{color:t.text,fontFamily:"'IBM Plex Sans', sans-serif"},title:{textStyle:{color:t.text},subtextStyle:{color:t.muted}},legend:{textStyle:{color:t.text}},tooltip:{backgroundColor:t.tip,borderColor:t.line,textStyle:{color:t.text}},categoryAxis:o,valueAxis:o,logAxis:o,timeAxis:o,line:{symbolSize:6,lineStyle:{width:2.5}},pie:{label:{color:t.text,textBorderWidth:0},labelLine:{lineStyle:{color:t.muted}}},funnel:{label:{color:t.text,textBorderWidth:0}}})}function Gr(){let e=Dt()==="light"?"light":"dark",t=Ve("--node-bg"),a=Ve(e==="dark"?"--accent":"--accent-line"),o=e==="dark"?[.58,.38,.25,.18,.12]:[.7,.45,.25,.15,.08],n={...Yr[e],N7:t,B1:Ve("--accent")};return o.forEach((r,i)=>{n["B"+(i+2)]=xr(a,t,r)}),n}function ha(e){return ra[e]||(ra[e]=new Promise((t,a)=>{let o=document.createElement("script");o.src=e,o.onload=t,o.onerror=()=>{delete ra[e],a(new Error("could not load "+e))},document.head.appendChild(o)}))}async function Vr(){let e=we,t=[...q.querySelectorAll(".node pre > code.language-dot")];q.querySelectorAll(".node pre > code.language-echarts").forEach(r=>{let i=document.createElement("div");i.className="echarts-container",i.dataset.chart=r.textContent,r.parentElement.replaceWith(i)});let a=[...q.querySelectorAll(".node .echarts-container[data-chart]")],o=[...q.querySelectorAll(".node pre > code.language-d2")];if(!t.length&&!a.length&&!o.length)return;let n=[];if(t.length)try{if(await ha(Nr),ia=ia||await Viz.instance(),e!==we)return;t.forEach(r=>{let i=document.createElement("div");i.className="diagram";try{i.appendChild(ia.renderSVGElement(r.textContent))}catch(s){i.className="diagram err",i.textContent="Diagram error: "+s.message}r.parentElement.replaceWith(i)})}catch{n.push("diagrams")}if(o.length)try{if(!xt){let i=await import(qr);xt=new i.D2}if(e!==we)return;let r=Gr();for(let i of o){let s=document.createElement("div");s.className="diagram d2";try{let l=await xt.compile(Kr(i.textContent));s.innerHTML=await xt.render(l.diagram,{...l.renderOptions||{},themeOverrides:r,darkThemeOverrides:r})}catch(l){s.className="diagram err",s.textContent="Diagram error: "+(l.message||l)}if(e!==we)return;i.parentElement.replaceWith(s)}}catch{n.push("D2 diagrams")}if(a.length)try{if(await ha(_r),e!==we)return;let r=Hr();a.forEach(i=>{let s;try{s=JSON.parse(i.dataset.chart)}catch{i.textContent="Chart data is not valid JSON.";return}echarts.init(i,r,{renderer:"svg"}).setOption(Object.assign({backgroundColor:"transparent",animation:!Fe},s))})}catch{n.push("charts")}e===we&&(n.length&&(et.textContent="Could not load the "+n.join(" and ")+" renderer (offline?)"),d.forEach(jt),rt(),ne(!0))}function $r(){let e=[];return u.forEach(t=>{let a=at(t),o=e[e.length-1];o&&o.sec===a?o.ids.push(t):e.push({sec:a,ids:[t]})}),e}function Jr(){let a=0,o=0,n=0;$r().forEach((r,i)=>{let s=Math.max(...r.ids.map(f=>d.get(f)._h));i&&(a+=n/2+120+s/2);let l=o,c=o;r.ids.forEach((f,_)=>{let O=d.get(f);_&&(l+=90+O._w/2),O.cx=l,O.cy=a,c=l,l+=O._w/2}),o=c,n=s})}function Xr(){d.forEach(e=>{e.cx=0,e.cy=0})}function nn(){we++,window.echarts&&q.querySelectorAll(".echarts-container").forEach(a=>{let o=echarts.getInstanceByDom(a);o&&o.dispose()}),q.querySelectorAll("div.node").forEach(a=>a.remove());let e=tn(),t=0;d.forEach(a=>{let o=document.createElement("div");o.className="node",o.tabIndex=0,o.dataset.id=a.id;let n=a.parent?Ft(a.id).slice(0,-1).map(i=>d.get(i).title).join(" / "):"";o.innerHTML=(n?'<div class="crumb">'+T(n)+"</div>":"")+'<div class="body">'+a.html+"</div>"+(a.err?'<div class="err-badge">!</div>':"");let r=o.querySelector(".body");Ar(r),Pr(r),zr(o,r),r.querySelectorAll("thead").forEach(i=>{i.textContent.trim()||i.remove()}),t+=jr(r),a.frags=Rr(r),r.querySelectorAll("img").forEach(i=>{i.complete||i.addEventListener("load",Fr,{once:!0})}),o.querySelectorAll("a[href]").forEach(i=>{let s=i.getAttribute("href");if(s.startsWith("#")){let l=decodeURIComponent(s.slice(1));d.has(l)&&(i.classList.add("xlink"),i.addEventListener("click",c=>{c.preventDefault(),c.stopPropagation(),h.active||P(l)}))}else i.target="_blank",i.rel="noopener",i.addEventListener("click",l=>l.stopPropagation())}),o.addEventListener("click",()=>{h.active||P(a.id)}),o.addEventListener("keydown",i=>{i.key==="Enter"&&i.target===o&&P(a.id)}),q.appendChild(o),a.el=o,Sa(a,a.frags.length)}),t&&!et.textContent&&(et.textContent=t+" image(s) use relative paths: add base: to the deck, or open it with ?src="),d.forEach(jt),rt(e),Vr()}function rt(e){e===void 0&&(e=tn()),z==="radial"?Or(e):z==="path"?Jr():z==="focus"?Xr():Mr(),q.classList.toggle("focus",z==="focus"),d.forEach(t=>{let a=t.el.style;a.setProperty("--cx",t.cx),a.setProperty("--cy",t.cy)}),Qr(),Ne(),Ta()}function Qr(){let e="";if(z==="focus"){aa.innerHTML="";return}if(z==="path"){for(let t=1;t<u.length;t++){let a=d.get(u[t-1]),o=d.get(u[t]);e+='<path data-from="'+a.id+'" data-to="'+o.id+'" d="M '+a.cx+" "+a.cy+" L "+o.cx+" "+o.cy+'"/>'}aa.innerHTML=e;return}d.forEach(t=>{if(!t.parent)return;let a=d.get(t.parent);if(z==="radial")e+='<path data-from="'+a.id+'" data-to="'+t.id+'" d="M '+a.cx+" "+a.cy+" L "+t.cx+" "+t.cy+'"/>';else{let o=a.cy+a._h/2,n=t.cy-t._h/2,r=o+(n-o)/2;e+='<path data-from="'+a.id+'" data-to="'+t.id+'" d="M '+a.cx+" "+o+" L "+a.cx+" "+r+" L "+t.cx+" "+r+" L "+t.cx+" "+n+'"/>'}}),aa.innerHTML=e}function Ft(e){let t=[],a=e;for(;a;)t.unshift(a),a=d.get(a).parent;return t}function Pe(){let e=M.clientWidth,t=M.clientHeight;q.style.transform="translate("+e/2+"px,"+t/2+"px) scale("+E.zoom+") translate("+-E.x+"px,"+-E.y+"px)",un()}function Ea(){Qe&&(Qe.kill(),Qe=null)}function rn(e,t){if(Ea(),t||Fe||!window.gsap){Object.assign(E,e),Pe();return}let a=M.clientWidth,o=Math.hypot(e.x-E.x,e.y-E.y),n=e.zoom,r=gsap.timeline({onUpdate:Pe,onComplete:()=>{Qe=null}}),{zoom:i,...s}=e,l=o*Math.min(E.zoom,n),c=Math.max(.55,Math.min(1.3,.55+l/a*.3));if(r.to(E,{...s,duration:c,ease:"power2.inOut"},0),l>a*1.2){let f=Math.max(.06,Math.min(E.zoom,n,a*.9/(o+Ie)));r.to(E,{zoom:f,duration:c/2,ease:"sine.out"},0).to(E,{zoom:n,duration:c/2,ease:"sine.in"},c/2)}else r.to(E,{zoom:n,duration:c,ease:"power2.inOut"},0);Qe=r}function Zr(){let e=M.getBoundingClientRect(),t=14,a=[];if(!pe.hidden&&pe.offsetWidth){let n=pe.getBoundingClientRect();a.push({x0:n.left-e.left-t,y0:n.top-e.top-t,x1:n.right-e.left+t,y1:n.bottom-e.top+t})}let o=Cr();return o&&a.push({x0:o.x0-t,y0:o.y0-t,x1:o.x1+t,y1:o.y1+t}),a}function ei(){let e=M.clientWidth,t=M.clientHeight,a=[{x0:16,y0:D?20:56,x1:e-16,y1:t-(D?20:74)}];return Zr().forEach(o=>{let n=[];a.forEach(r=>{if(o.x1<=r.x0||o.x0>=r.x1||o.y1<=r.y0||o.y0>=r.y1){n.push(r);return}[{...r,x1:Math.min(r.x1,o.x0)},{...r,x0:Math.max(r.x0,o.x1)},{...r,y1:Math.min(r.y1,o.y0)},{...r,y0:Math.max(r.y0,o.y1)}].forEach(i=>{i.x1-i.x0>80&&i.y1-i.y0>80&&n.push(i)})}),n.length&&(a=n)}),a}function ua(e,t,a){let o=M.clientWidth,n=M.clientHeight,r=null;return ei().forEach(i=>{let s=a*Math.min((i.x1-i.x0)/e,(i.y1-i.y0)/t);(!r||s>r.zoom)&&(r={zoom:s,sx:(i.x0+i.x1)/2-o/2,sy:(i.y0+i.y1)/2-n/2})}),r}function sn(e,t,a,o){return{x:e-a.sx/o,y:t-a.sy/o}}function Ce(e,t){let a=d.get(e);if(!a)return;let o=ua(a._w,a._h,tt),n=at(e),r=u.filter(l=>at(l)===n&&!d.get(l).visual).map(l=>{let c=d.get(l);return ua(c._w,c._h,tt).zoom}).sort((l,c)=>l-c),i=r.length?r[Math.floor((r.length-1)/2)]:o.zoom,s=Math.max(.2,Math.min(5,o.zoom,i));rn(Object.assign(sn(a.cx,a.cy,o,s),{zoom:s}),t)}function it(e){let t=[...d.values()];if(!t.length)return;let a=M.clientWidth,o=M.clientHeight,n=Math.min(...t.map(f=>f.cx-f._w/2)),r=Math.max(...t.map(f=>f.cx+f._w/2)),i=Math.min(...t.map(f=>f.cy-f._h/2)),s=Math.max(...t.map(f=>f.cy+f._h/2)),l=ua(r-n,s-i,.94),c=Math.max(.05,Math.min(1,l.zoom));rn(Object.assign(sn((n+r)/2,(i+s)/2,l,c),{zoom:c}),e)}function ne(e){p&&d.has(p)?Ce(p,e):it(e)}function Ne(){let e=p?Ft(p):[];d.forEach(t=>{let a=t.el;a.classList.toggle("current",t.id===p),a.classList.toggle("active-path",e.includes(t.id))}),q.querySelectorAll("#connectors path").forEach(t=>{let a=z==="path"?!!p&&u.indexOf(t.dataset.to)<=u.indexOf(p):e.includes(t.dataset.from)&&e.includes(t.dataset.to);t.classList.toggle("active",a)}),ni(e),cn()}function ln(){return no(new URLSearchParams(location.search).get("duration")??w.duration)}function ti(){return D&&ln()>0&&(!h.active||/^always$/i.test(w.timer||""))}function Tt(){let e=ti()&&ue.start>0;if(ke.classList.toggle("timed",e),!e){ke.classList.remove("over");return}let a=(h.active&&h.t0?Bt():performance.now()-ue.start)/ln();ke.firstChild.style.width=Math.min(100,a*100)+"%",ke.classList.toggle("over",a>=1)}function ai(){ue.start=performance.now(),clearInterval(ue.timer),ue.timer=setInterval(Tt,1e3),Tt()}function oi(){clearInterval(ue.timer),ue.timer=null,ue.start=0,Tt()}function cn(){let e=D&&u.length>1&&!/^(off|no|false)$/i.test(w.progress||"");if(ke.classList.toggle("show",e),!e)return;Tt();let t=u.indexOf(p),a=0,o=0;u.forEach((n,r)=>{let i=Le(d.get(n)).length;a+=i,r<t?o+=i:r===t&&(o+=Math.min(oe,i-1)+1)}),ke.lastChild.style.width=(a?o/a*100:0)+"%"}function ni(e){Bo.innerHTML=e.map((t,a)=>(a>0?'<span class="sep">\u203A</span>':"")+'<button class="crumb-btn'+(t===p?" here":"")+'" data-id="'+T(t)+'">'+T(d.get(t).title)+"</button>").join(""),Bo.querySelectorAll(".crumb-btn").forEach(t=>t.addEventListener("click",()=>{h.active||P(t.dataset.id)}))}function st(e){let t=d.get(p);t&&(Sa(t,Zo().frag,e),ka(),(L.hidden||!ze||!ze.full)&&si(t),La(t))}function ii(e){return!u.length||e.id!==u[0]&&e.id!==u[u.length-1]||e.el.querySelector("[data-gsap], .title-scramble")?null:[...e.el.querySelector(".body").children].filter(t=>!t.classList.contains("fragment"))}function si(e){if(e._played||!window.gsap||Fe)return;e._played=!0;let t=ii(e);if(t&&t.length){e._auto=t;let[a,...o]=t;/^H[1-3]$/.test(a.tagName)&&!a.children.length?(a.classList.add("auto-scramble"),jo(a)):o.unshift(a),gsap.from(o,{opacity:0,y:24,duration:.7,ease:"power2.out",delay:.5,stagger:.45})}e.el.querySelectorAll("[data-gsap]").forEach(a=>{let o;try{o=JSON.parse(a.dataset.gsap)}catch{return}let n={duration:o.duration??1,delay:o.delay??0,ease:o.ease||"power2.out"};o.to?gsap.fromTo(a,o.from||{},Object.assign({},o.to,n)):o.from&&gsap.from(a,Object.assign({},o.from,n))}),e.el.querySelectorAll(".title-scramble").forEach(jo)}function Ca(e){!e||!e._played||(e._played=!1,window.gsap&&(e._auto&&(e._auto.forEach(t=>{gsap.killTweensOf(t),gsap.set(t,{clearProps:"opacity,transform"})}),e._auto=null),e.el.querySelectorAll("[data-gsap]").forEach(t=>{gsap.killTweensOf(t);let a={};try{a=JSON.parse(t.dataset.gsap)}catch{}let o=new Set(Object.keys(Object.assign({},a.from,a.to)).map(n=>ri.includes(n)?"transform":n));o.size&&gsap.set(t,{clearProps:[...o].join(",")})}),e.el.querySelectorAll(".title-scramble, .auto-scramble").forEach(t=>{t._scramble&&t._scramble.kill(),t.dataset.text&&(t.textContent=t.dataset.text)})))}function jo(e){let t=e.dataset.text||(e.dataset.text=e.textContent),a=Array.from(t),o="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789#%&*+=?",n={p:0};e._scramble=gsap.to(n,{p:1,duration:1.4,ease:"none",onUpdate(){let r=Math.floor(n.p*a.length);e.textContent=a.map((i,s)=>s<r||/\s/.test(i)?i:o[Math.random()*o.length|0]).join("")},onComplete(){e.textContent=t}})}function La(e){clearTimeout(Re),!(!D||!e||!e.autoslide||h.active&&(!h.t0||h.paused))&&(Re=setTimeout(()=>{p===e.id&&De(1)},e.autoslide))}function dn(e){let t=e&&e!==u[0]?e:"";try{b&&b.kind==="share"?history.replaceState(null,"",location.pathname+location.search+Zt(b.data,t)):history.replaceState(null,"",e?"#"+encodeURIComponent(e):location.pathname+location.search)}catch{}}function P(e,t,a){if(!d.has(e))return;if(e!==p){te=null,he=-1,oe=a?Le(d.get(e)).length-1:0;let r=d.get(p);r&&z==="focus"&&!t&&(r.el.classList.add("leaving"),setTimeout(()=>r.el.classList.remove("leaving"),600)),pn()}let o=e!==p;if(p=e,clearTimeout(ee),ee=null,o&&z==="focus"&&!t&&!Fe){let r=d.get(e).el;r.classList.add("entering"),r.offsetWidth,r.classList.remove("entering")}st(o),o&&za("slide",e);let n=d.get(e);o&&n.mapFirst&&!a&&!t&&z!=="focus"?(it(),ee=setTimeout(()=>{ee=null,p===e&&Ce(e)},1900)):Ce(e,t),Ne(),Ta(),dn(e)}function pn(){let e=d.get(p);e&&(e.el.querySelectorAll("figure.yt").forEach(t=>on(t,"pauseVideo")),Sa(e,e.frags.length,!0),Ca(e))}function li(){if(!p&&Se&&d.has(Se)){hn();return}p&&(Se=p),z==="focus"&&Nt("path"),pn(),clearTimeout(Re),p=null,Ne(),Ta(),it(),dn(null)}function hn(){if(ee)return clearTimeout(ee),ee=null,Ce(p),!0;if(!p&&Se&&d.has(Se)){let e=Se;return Se=null,P(e),!0}return!1}function De(e){if(!p){u.length&&P(u[e>0?0:u.length-1]);return}if(ee&&e>0){clearTimeout(ee),ee=null,Ce(p);return}let t=Le(d.get(p)),a=Math.min(oe,t.length-1)+e;if(a>=0&&a<t.length){oe=a,te=null,he=-1,st(),!Y&&!L.hidden&&ze.used?dt():ne(),Ne();return}let o=u.indexOf(p)+e;o>=0&&o<u.length&&P(u[o],!1,e<0)}function ci(){let e=d.get(p);e&&e.parent&&P(e.parent)}function di(){let e=d.get(p);e&&e.children.length?P(e.children[0]):!p&&u.length&&P(u[0])}function Ta(){let e=[...d.values()];if(!e.length){ca.innerHTML="",se=null;return}cr.textContent="map";let t=g=>g.cx,a=g=>g.cy,o=Math.min(...e.map(t))-Ie/2,n=Math.max(...e.map(t))+Ie/2,r=Math.min(...e.map(a))-da/2,i=Math.max(...e.map(a))+da/2,s=16,l=180,c=130,f=Math.min((l-2*s)/Math.max(1,n-o),(c-2*s-6)/Math.max(1,i-r)),_=l/2-(o+n)/2*f,O=c/2+5-(r+i)/2*f,y=p?Ft(p):[],S="";e.forEach(g=>{if(!g.parent)return;let B=d.get(g.parent);S+='<line x1="'+(t(B)*f+_)+'" y1="'+(a(B)*f+O)+'" x2="'+(t(g)*f+_)+'" y2="'+(a(g)*f+O)+'" stroke="var(--panel-line)" stroke-width="1"/>'}),e.forEach(g=>{let B=g.id===p?"var(--accent)":y.includes(g.id)?"var(--accent-teal)":"var(--node-border)";S+='<circle data-id="'+T(g.id)+'" cx="'+(t(g)*f+_)+'" cy="'+(a(g)*f+O)+'" r="'+(g.id===p?4:3)+'" fill="'+B+'"><title>'+T(g.title)+"</title></circle>"}),S+='<rect id="mm-viewport" fill="none" stroke="var(--accent)" stroke-width="1" opacity="0.7"/>',ca.innerHTML=S,se={s:f,ox:_,oy:O},un()}function un(){let e=document.getElementById("mm-viewport");if(!e||!se)return;let t=M.clientWidth/E.zoom,a=M.clientHeight/E.zoom;e.setAttribute("x",(E.x-t/2)*se.s+se.ox),e.setAttribute("y",(E.y-a/2)*se.s+se.oy),e.setAttribute("width",Math.max(2,t*se.s)),e.setAttribute("height",Math.max(2,a*se.s))}function je(e){en(U.value),p&&!d.has(p)&&(p=null),nn(),p?P(p,e):u.length?P(u[0],e):(p=null,it(!0))}function Nt(e,t){z=e,Z("slidetake:layout",e),document.querySelectorAll("#layout-toggle .seg-btn").forEach(a=>a.classList.toggle("active",a.dataset.mode===e)),d.size&&(!t&&!Fe&&(q.classList.add("morph"),setTimeout(()=>q.classList.remove("morph"),700)),rt(),Pe(),p?Ce(p,t):it(t))}function mn(e){return Math.max(.04,Math.min(5,e))}function pi(e){tt=Math.round(Math.max(fr,Math.min(gr,e))*100)/100,Z("slidetake:slideSize",tt),p&&Ce(p)}function Fo(e){p?pi(tt+e*.1):fn(e>0?1.2:1/1.2)}function fn(e,t,a){Ea();let o=mn(E.zoom*e);if(t!==void 0){let n=M.getBoundingClientRect(),r=t-n.left-n.width/2,i=a-n.top-n.height/2;E.x+=r/E.zoom-r/o,E.y+=i/E.zoom-i/o}E.zoom=o,Pe()}function _t(){A||(ge.classList.toggle("collapsed"),document.getElementById("btn-edit-toggle").classList.toggle("active",!ge.classList.contains("collapsed")))}function be(e){D=e,document.body.classList.toggle("presenting",e),Rn();let t=document.documentElement;e&&t.requestFullscreen&&!document.fullscreenElement&&t.requestFullscreen().catch(()=>{}),!e&&document.fullscreenElement&&document.exitFullscreen&&document.exitFullscreen().catch(()=>{}),e&&!p&&u.length&&P(u[0]);let a=w.camera||[...d.values()].some(o=>o.camera);e&&a&&!Y&&!G&&dt(),e?La(d.get(p)):clearTimeout(Re),e?ai():oi(),cn()}function Bt(){return(h.paused?h.pauseAt:performance.now())-h.t0-h.pausedMs}function lt(e){e.classList.add("open")}function bi(e){if(Z("slidetake:analytics",e?"on":"off"),!e){window["ga-disable-"+fi]=!0;let t=["","; Domain="+location.hostname,"; Domain=."+location.hostname.replace(/^www\./,"")];document.cookie.split(";").map(a=>a.split("=")[0].trim()).filter(a=>a==="_ga"||a.startsWith("_ga_")).forEach(a=>t.forEach(o=>{document.cookie=a+"=; Max-Age=0; Path=/"+o}))}yn()}function yn(){Aa.querySelectorAll("[data-analytics]").forEach(e=>e.setAttribute("aria-checked",String(e.dataset.analytics==="on"===gi())))}function Ba(){document.querySelectorAll(".modal.open").forEach(e=>e.classList.remove("open"))}function yi(){let e=new URLSearchParams(location.search).get("obs");if(e){let[t,a,...o]=e.split(":");return Mt.value=t||"localhost",Ot.value=a||"4455",At.value=o.join(":"),!0}try{let t=JSON.parse(Q("slidetake:obs")||"null");t&&(Mt.value=t.host||"localhost",Ot.value=t.port||"4455",At.value=t.password||"",Ma.checked=!0)}catch{}return!1}function wn(){if(Ma.checked)Z("slidetake:obs",JSON.stringify({host:Mt.value.trim(),port:Ot.value.trim(),password:At.value}));else try{localStorage.removeItem("slidetake:obs")}catch{}}function Ke(e,t){Uo.textContent=e,Uo.className=t||""}function wi(e){return location.protocol==="https:"&&!vi(e)}async function xn(){let e=Mt.value.trim()||"localhost",t="ws://"+e+":"+(Ot.value.trim()||"4455");if(wi(e)){xe=!1,Ze.disabled=!0,Ke(xi,"err");return}Ke("Connecting to "+t+"\u2026");try{await ha(hi);let a=window.OBSWebSocket&&(window.OBSWebSocket.default||window.OBSWebSocket);if(H)try{await H.disconnect()}catch{}H=new a,H.on("ConnectionClosed",()=>{xe=!1,Ke("Disconnected from OBS","err"),Ze.disabled=!0}),H.on("RecordStateChanged",n=>{n.outputState==="OBS_WEBSOCKET_OUTPUT_STARTED"&&Ee&&(Ee(),Ee=null),n.outputState==="OBS_WEBSOCKET_OUTPUT_STOPPED"&&h.active&&h.withObs&&!h.finishing&&Wt("Stopped in OBS")});let o=await H.connect(t,At.value||void 0);xe=!0;try{let n=await H.call("GetVideoSettings");n&&n.fpsNumerator&&n.fpsDenominator&&(gn=n.fpsNumerator/n.fpsDenominator)}catch{}Ke("Connected"+(o&&o.obsWebSocketVersion?" \xB7 OBS WebSocket "+o.obsWebSocketVersion:""),"ok"),wn()}catch(a){xe=!1,Ke("Could not connect ("+(a&&a.message||a)+"). Is OBS running with its WebSocket server on, and is the password right?","err")}Ze.disabled=!xe}function ki(){let e=document.getElementById("rec-screen"),t=screen.width,a=screen.height;if(Math.abs(t/a-16/9)<.02){e.innerHTML='<span class="ok">This screen is 16:9 ('+t+"\xD7"+a+"), right for YouTube.</span>";return}let o=[["16:10",1.6],["3:2",1.5],["4:3",4/3],["21:9",21/9],["16:9",16/9]],[n,r]=o.reduce((s,l)=>Math.abs(l[1]-t/a)<Math.abs(s[1]-t/a)?l:s),i=Math.abs(r-t/a)<.005?n:"about "+n;e.innerHTML='<span class="warn">This screen is '+i+" ("+t+"\xD7"+a+"), not 16:9, so the video will have bars or be cropped. Move this window to a 16:9 screen, physical or virtual (say 1920\xD71080), then press F there.</span>"}function fa(){if(!nt)return;let e=u.reduce((a,o)=>a+Le(d.get(o)).length,0),t=w.camera||[...d.values()].some(a=>a.camera);document.getElementById("rec-deck-info").innerHTML=T(w.title||(ce[0]?d.get(ce[0]).title:"This deck"))+" \xB7 "+u.length+" slides \xB7 "+e+" presses"+(t&&G?'<br><span class="warn">The camera is off. Press C first if this take should include your webcam.</span>':""),Ze.disabled=!xe,Ti(),ki(),lt(ui)}async function kn(e){if(h.active||!u.length)return;Ba(),Object.assign(h,{active:!0,withObs:e,counting:!0,paused:!1,finishing:!1,t0:0,pausedMs:0,events:[],outputPath:null}),document.body.classList.add("recording"),Ra();let t=document.getElementById("rec-layout").value;t!=="current"&&t!==z&&Nt(t,!0),D||be(!0),p===u[0]&&(oe=0,te=null,he=-1),P(u[0],!0);for(let o=3;o>0;o--)if(St.querySelector(".num").textContent=o,St.classList.add("show"),await Oa(1e3),!h.active)return;if(St.classList.remove("show"),await bn(),e){let o=new Promise(n=>{Ee=n,setTimeout(()=>{Ee&&(Ee(),Ee=null)},2500)});try{await H.call("StartRecord")}catch(n){Ia("OBS could not start recording: "+(n&&n.message||n));return}if(await o,!h.active)return}h.counting=!1,h.t0=performance.now();let a=d.get(p);Ca(a),st(!0),za("slide",p)}function Ia(e){h.active=!1,h.counting=!1,St.classList.remove("show"),document.body.classList.remove("recording"),D&&be(!1),Ae(e)}function za(e,t){if(!h.active||!h.t0||h.finishing)return;let a=d.get(t),o={id:t,title:a?a.title:t,retake:e==="retake",t:Math.round(Bt()),obsT:null};h.events.push(o),h.withObs&&xe&&(H.call("GetRecordStatus").then(n=>{n&&typeof n.outputDuration=="number"&&(o.obsT=n.outputDuration)}).catch(()=>{}),a&&H.call("CreateRecordChapter",{chapterName:(o.retake?"RETAKE \xB7 ":"")+a.title}).catch(()=>{}))}function Si(e){let t=e.key;if((_o.includes(t)||Wo.includes(t)||Ho.includes(t)||t==="Escape")&&e.preventDefault(),t==="Escape"){h.counting?Ia("Take cancelled"):Wt("Stopped early");return}if(!(h.counting||h.finishing)){if(Ho.includes(t)){Li();return}h.paused||(_o.includes(t)?Ei():Wo.includes(t)&&Ci())}}function Ei(){let e=Le(d.get(p));Math.min(oe,e.length-1)>=e.length-1&&u.indexOf(p)===u.length-1?Wt():De(1)}function Ci(){let e=d.get(p);e&&(za("retake",p),oe=0,te=null,he=-1,Ca(e),st(!0),!Y&&!L.hidden&&ze.used?dt():ne(),Ne())}async function Li(){h.t0&&(h.paused?(ma.classList.remove("show"),await bn(),h.withObs&&await H.call("ResumeRecord").catch(()=>{}),h.pausedMs+=performance.now()-h.pauseAt,h.paused=!1,La(d.get(p))):(h.paused=!0,h.pauseAt=performance.now(),clearTimeout(Re),h.withObs&&await H.call("PauseRecord").catch(()=>{}),ma.classList.add("show")))}async function Wt(e){if(!h.active||h.finishing)return;if(h.counting){Ia("Take cancelled");return}h.finishing=!0,clearTimeout(Re),h.paused&&(h.pausedMs+=performance.now()-h.pauseAt,h.paused=!1,ma.classList.remove("show"));let t=Math.round(Bt()),a=null;if(h.withObs){await Oa(1200),t=Math.round(Bt());try{let n=await H.call("GetRecordStatus");n&&typeof n.outputDuration=="number"&&(a=n.outputDuration)}catch{}try{let n=await H.call("StopRecord");h.outputPath=n&&n.outputPath}catch(n){e=(e?e+". ":"")+"OBS did not confirm the stop ("+(n&&n.message||n)+")"}}h.active=!1,h.finishing=!1,document.body.classList.remove("recording"),D&&be(!1);let o={key:Ht(),deckTitle:w.title||d.get(u[0]).title,date:new Date().toISOString(),withObs:h.withObs,outputPath:h.outputPath,reason:e||"",total:t,totalObs:a,fps:gn,events:h.events.map(n=>({id:n.id,title:n.title,retake:n.retake,t:n.t,obsT:n.obsT})),picks:{}};Pa(o),On(o)}function Ht(){return Te(w.title||(u[0]?d.get(u[0]).title:"deck"))}function Sn(){try{return JSON.parse(Q("slidetake:sessions")||"[]")}catch{return[]}}function Pa(e){let t=Sn().filter(a=>a.date!==e.date);t.unshift(e),Z("slidetake:sessions",JSON.stringify(t.slice(0,12)))}function Ti(){let e=document.getElementById("rec-sessions"),t=Sn().filter(a=>a.key===Ht());e.innerHTML=t.length?"<h3>Earlier takes of this deck</h3>"+t.map((a,o)=>'<div class="row"><button class="btn small" data-session="'+o+'">Review</button><span>'+T(new Date(a.date).toLocaleString())+" \xB7 "+$(a.totalObs??a.total)+(a.withObs?"":" \xB7 rehearsal")+(a.outputPath?" \xB7 "+T(Me(a.outputPath)):"")+"</span></div>").join(""):"",e.querySelectorAll("[data-session]").forEach(a=>a.onclick=()=>{Ba(),On(t[+a.dataset.session])})}function at(e){let t=d.has(e)?Ft(e):[e];return t[Math.min(1,t.length-1)]}function En(e,t){let a=at(e);return{sec:a,title:d.has(a)?d.get(a).title:t}}function Tn(){let e=Object.keys(w).filter(t=>t==="tags"||/_tags$/.test(t)).flatMap(t=>[].concat(w[t])).filter(t=>typeof t=="string");return[...new Set(e.map(t=>t.trim()).filter(Boolean))]}function Mi(){return[].concat(w.related||[]).map(e=>{let t=String(e).match(/^\[([^\]]+)\]\(([^)]+)\)$/),a=String(e).split("|");return t?t[1]+": "+t[2]:a.length===2?a[0].trim()+": "+a[1].trim():String(e)})}function Oi(){if(w.permalink||w.url)return w.permalink||w.url;let e=w.site||Q("slidetake:site");if(!e||!ae)return"";try{let t=new URL(ae).pathname.replace(/\/index\.md$/i,"/").replace(/\.md$/i,"/");return new URL(t,e).href}catch{return""}}function Mn(e){let t=Cn(e),a=document.getElementById("rv-link").value.trim(),o=Mi(),n=Tn(),r=[];w.summary&&r.push(w.summary),a&&r.push("\u{1F4D1} Slides: "+a),t.lines.length>=3&&r.push(`Chapters
|
|
854
854
|
`+t.lines.join(`
|
|
855
855
|
`)),o.length&&r.push(`Related
|
|
856
856
|
`+o.map(i=>"\u2022 "+i).join(`
|
|
@@ -1045,6 +1045,10 @@ Recorded `+new Date(e.date).toLocaleString()+(e.outputPath?" \xB7 "+e.outputPath
|
|
|
1045
1045
|
.btn.icon svg{width:15px;height:15px;display:block;}
|
|
1046
1046
|
/* in the header, icon buttons stand as tall as the layout switch and the text buttons beside them */
|
|
1047
1047
|
.hdr-actions .btn.icon{height:32px;min-width:32px;padding:0 8px;}
|
|
1048
|
+
/* every header control is exactly 32px, whatever the font's line height, so they line up on any machine */
|
|
1049
|
+
.hdr-actions > .btn, .hdr-actions > .seg{height:32px;}
|
|
1050
|
+
.hdr-actions > .btn:not(.icon){padding-top:0;padding-bottom:0;}
|
|
1051
|
+
.hdr-actions .seg-btn{height:100%;display:flex;align-items:center;padding-top:0;padding-bottom:0;}
|
|
1048
1052
|
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;}
|
|
1049
1053
|
.pane-label{
|
|
1050
1054
|
font-family:var(--mono);font-size:10px;letter-spacing:.12em;text-transform:uppercase;
|
|
@@ -1594,7 +1598,7 @@ Recorded `+new Date(e.date).toLocaleString()+(e.outputPath?" \xB7 "+e.outputPath
|
|
|
1594
1598
|
<tr><td><kbd>K</kbd> <kbd>?</kbd></td><td>this card; again or <kbd>Esc</kbd> closes it</td></tr>
|
|
1595
1599
|
</table>
|
|
1596
1600
|
<p>Drag to pan, scroll or pinch to zoom, click a card to fly to it.</p>
|
|
1597
|
-
<p><a href="/docs" target="_blank" rel="noopener">The docs \u2192</a> writing decks, sharing, recording, camera, review and cut.</p>
|
|
1601
|
+
<p><a href="https://slidetake.com/docs" target="_blank" rel="noopener">The docs \u2192</a> writing decks, sharing, recording, camera, review and cut.</p>
|
|
1598
1602
|
</div>
|
|
1599
1603
|
</div>
|
|
1600
1604
|
|