vlbthambawita commited on
Commit
d3896c0
·
verified ·
1 Parent(s): 7c0dce6

Release transformer-v2-v2 (part 2)

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. transformer-v2/class/assets/SlideWrapper-pRl27kyE.js +2 -0
  2. transformer-v2/class/assets/default-DNkhSshI.js +1 -0
  3. transformer-v2/class/assets/index-CG-YcYMB.js +46 -0
  4. transformer-v2/class/assets/index-yJq2pcYZ.css +0 -0
  5. transformer-v2/class/assets/interactive-BWtflKDO.js +1 -0
  6. transformer-v2/class/assets/md--uzs3-nr.js +1 -0
  7. transformer-v2/class/assets/md-21gIQvU7.js +12 -0
  8. transformer-v2/class/assets/md-9XBO3-oF.js +1 -0
  9. transformer-v2/class/assets/md-BMyZhACr.js +1 -0
  10. transformer-v2/class/assets/md-BhcOSUhc2.js +1 -0
  11. transformer-v2/class/assets/md-BiZADt9E2.js +1 -0
  12. transformer-v2/class/assets/md-BnB9SH19.css +1 -0
  13. transformer-v2/class/assets/md-BtOPVTXq.js +12 -0
  14. transformer-v2/class/assets/md-CLXMAmt7.js +1 -0
  15. transformer-v2/class/assets/md-CMYKcO_R2.js +1 -0
  16. transformer-v2/class/assets/md-C_GB20rl.js +1 -0
  17. transformer-v2/class/assets/md-Cp2JbSgr2.js +1 -0
  18. transformer-v2/class/assets/md-Cr3oc_4w.js +1 -0
  19. transformer-v2/class/assets/md-CxsD1lHT.js +1 -0
  20. transformer-v2/class/assets/md-D2pt8njL2.js +1 -0
  21. transformer-v2/class/assets/md-D998G7fY.js +1 -0
  22. transformer-v2/class/assets/md-DI3YoSU9.js +1 -0
  23. transformer-v2/class/assets/md-Dj7Ob5HE.js +1 -0
  24. transformer-v2/class/assets/md-DqDqvOgd.js +1 -0
  25. transformer-v2/class/assets/md-DqOsl9vh2.js +1 -0
  26. transformer-v2/class/assets/md-DudY36k42.js +1 -0
  27. transformer-v2/class/assets/md-DwsE30sf.js +1 -0
  28. transformer-v2/class/assets/md-JRz44VMn.js +1 -0
  29. transformer-v2/class/assets/md-KUcQvTcE2.js +1 -0
  30. transformer-v2/class/assets/md-NSW4bfl4.js +1 -0
  31. transformer-v2/class/assets/md-OYW6iyOh2.js +1 -0
  32. transformer-v2/class/assets/md-QCLonc1o.js +12 -0
  33. transformer-v2/class/assets/md-RBwePVOC.js +12 -0
  34. transformer-v2/class/assets/md-ZGOnVPQo.js +1 -0
  35. transformer-v2/class/assets/md-_akb8Fqt.js +1 -0
  36. transformer-v2/class/assets/md-nAt0vl3t.js +1 -0
  37. transformer-v2/class/assets/md-nDqRXqVN2.js +1 -0
  38. transformer-v2/class/assets/md-rUO3nW2M2.js +1 -0
  39. transformer-v2/class/assets/slidev/404-Cskqm_iE.js +1 -0
  40. transformer-v2/class/assets/slidev/DrawingControls-CHqchiV_.js +1 -0
  41. transformer-v2/class/assets/slidev/DrawingLayer-CMBVuwdP.js +1 -0
  42. transformer-v2/class/assets/slidev/KaTexBlockWrapper-Ck43xKMc.js +1 -0
  43. transformer-v2/class/assets/slidev/NoteDisplay-CB14pFWa.js +1 -0
  44. transformer-v2/class/assets/slidev/NoteEditable-C9cjRYMU.js +1 -0
  45. transformer-v2/class/assets/slidev/TimerBar-D1wAIpGN.js +1 -0
  46. transformer-v2/class/assets/slidev/VClicks-DR1s1I9G.js +1 -0
  47. transformer-v2/class/assets/slidev/client-BNcmSz3b.js +1 -0
  48. transformer-v2/class/assets/slidev/notes-DsoPOK4i.js +1 -0
  49. transformer-v2/class/assets/slidev/notes-edit-i_aqIsEu.js +2 -0
  50. transformer-v2/class/assets/slidev/overview-C0t3M0qP.js +1 -0
transformer-v2/class/assets/SlideWrapper-pRl27kyE.js ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ import{D as e,G as t,H as n,L as r,R as i,S as a,X as o,Y as s,Z as ee,_ as c,_t as l,b as u,bt as d,f,g as p,i as m,lt as h,m as g,mt as _,st as v,v as y,vt as b,w as x,y as S,z as C}from"./modules/shiki-BFOesOFp.js";import{A as w,Q as T,X as E,Z as D,t as te,tt as O,z as k}from"./useNav-BZQi666j.js";import{t as A}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{M as j,f as ne}from"./modules/vue-CXhtJkbE.js";import{_ as re,d as ie,f as M,g as N,h as P,m as F,n as I,p as L,v as R}from"./slidev/context-ChHKJoK9.js";import{n as z,r as B,t as V}from"./syncState-BrWO1mSt.js";import{a as H,f as U}from"./index-CG-YcYMB.js";import"./slidev/client-BNcmSz3b.js";import{t as W}from"./useDrawings-DFNMQL0q.js";var G=[`innerHTML`],K=x({__name:`DrawingPreview`,props:{page:{}},setup(e){let{drawingState:t}=W();return(n,r)=>l(t)[e.page]?(C(),u(`svg`,{key:0,class:`w-full h-full absolute top-0 pointer-events-none`,innerHTML:l(t)[e.page]},null,8,G)):S(`v-if`,!0)}}),q=v({}),J=[],Y=[];z(q,`$syncUp`,!0),z(q,`$syncDown`,!0),z(q,`$paused`,!1),z(q,`$onSet`,e=>J.push(e)),z(q,`$onPatch`,e=>Y.push(e)),B(),z(q,`$patch`,async()=>!1);var ae=V(q,q,!0),X=window.navigator.userAgent.match(/Chrome\/(\d+)/)?.[1];X&&Number(X);var Z=window.navigator.userAgent.match(/Chrome\/(\d+)/)?.[1];Z&&Number(Z);var oe=new class{_screenshotSession=null;getSnapshot(e,t){let n=e+(t?`-dark`:`-light`),r=ae.state[n];if(!r)return;let i=k(e);if(i&&r?.revision===i?.meta.slide.revision)return r.image}async saveSnapshot(e,t,n){return!1}async startCapturing(e){return!1}},se=[`id`],ce=[`id`],le={class:`slidev-slide-container w-full h-full relative`},ue=[`src`],Q=h(null),de=A(x({__name:`SlideContainer`,props:{width:{type:Number},meta:{default:()=>({})},isMain:{type:Boolean,default:!1},no:{type:Number,required:!1},useSnapshot:{type:Boolean,default:!1},contentStyle:{type:Object,default:()=>({})}},setup(e){let t=e,{isPrintMode:a}=te(),l=h(null),f=ne(l),_=h(null),v=p(()=>t.width??f.width.value),y=p(()=>t.width?t.width/E.value:f.height.value),b=p(()=>w.value&&!a.value?+w.value:Math.min(v.value/T.value,y.value/D.value)),x=p(()=>({...t.contentStyle,height:`${D.value}px`,width:`${T.value}px`,"--slidev-slide-scale":b.value})),O=p(()=>t.width?{width:`${t.width}px`,height:`${t.width/E.value}px`}:{});if(t.isMain){let e=document.documentElement.style;o(()=>e.setProperty(`--slidev-slide-scale`,b.value.toString())),i(()=>e.removeProperty(`--slidev-slide-scale`))}j(re,b),j(N,_),ee(()=>{t.isMain&&(Q.value=_.value)}),r(()=>{s(()=>t.isMain&&b.value,()=>{m()})});let k=p(()=>{if(!(t.no==null||!t.useSnapshot))return oe.getSnapshot(t.no,U.value)});return(t,r)=>k.value?(C(),u(g,{key:1},[S(` Image Snapshot `),c(`div`,le,[c(`img`,{src:k.value,class:`w-full h-full object-cover`,style:d(O.value)},null,12,ue),r[0]||=c(`div`,{absolute:``,"bottom-1":``,"right-1":``,"p0.5":``,"text-cyan:75":``,"bg-cyan:10":``,rounded:``,title:`Snapshot`},[c(`div`,{class:`i-carbon-camera`})],-1)])],2112)):(C(),u(`div`,{key:0,id:e.isMain?`slide-container`:void 0,ref_key:`container`,ref:l,class:`slidev-slide-container`,style:d(O.value)},[c(`div`,{id:e.isMain?`slide-content`:void 0,ref_key:`slideElement`,ref:_,class:`slidev-slide-content`,style:d(x.value)},[n(t.$slots,`default`,{},void 0,!0)],12,ce),n(t.$slots,`controls`,{},void 0,!0)],12,se))}}),[[`__scopeId`,`data-v-0167a76e`]]),fe=Object.assign({}),pe=Object.assign({}),me=Object.assign({}),he=Object.assign({}),ge=Object.assign({}),_e=Object.assign({}),ve={course:{code:`PGR207`,year:2026,title:`Deep Learning`,instructor:`Vajira Thambawita (PhD)`,email:`vajira@simula.no`},space:`DeepLearning-VT/DeepLearning_2026`,repo:`vlbthambawita/DeepLearning`,decks:[{id:`lecture-01`,title:`Introduction to Deep Learning`,subtitle:`Course overview, what deep learning is, and where it is used`,week:1,published:!0,notebook:null,source:`old_slides/2025/Teaching - Deep Leaning - 2025- Lecture 01.pdf`},{id:`lecture-02`,title:`Basics of Neural Networks`,subtitle:`Artificial neurons, the perceptron, Adaline and gradient descent`,week:2,published:!0,notebook:null,source:`old_slides/2025/Teaching - Deep Leaning - 2025 - Lecture 02 .pdf`},{id:`lecture-03`,title:`PyTorch for Deep Learning`,subtitle:`Tensors, autograd, and a fully-connected network on MNIST`,week:3,published:!0,notebook:null,source:null},{id:`lecture-04`,title:`Deep Convolutional Neural Networks`,subtitle:`Locality and weight sharing, the convolution operation, and CNNs in PyTorch`,week:4,published:!0,notebook:null,source:`old_slides/2025/Teaching - Deep Leaning - 2025 - Lecture 03.pdf`},{id:`lecture-05`,title:`Recurrent Neural Networks`,subtitle:`Sequence data, the recurrent layer, LSTM and GRU, and an RNN in PyTorch`,week:6,published:!0,publicNotes:!0,notebook:null,source:`old_slides/2025/Teaching - Deep Leaning - 2025 - Lecture 5_6.pdf`},{id:`lecture-06`,title:`Transformers`,subtitle:`Query, key and value; the original architecture, and what modern transformers changed`,week:7,published:!0,notebook:null,source:`old_slides/2025/Teaching - Deep Leaning - 2025 - Lecture 5_6.pdf`},{id:`transformer-v2`,title:`Transformer v2: The Illustrated Transformer`,subtitle:`Self-attention by hand, many heads, the decoder and training — after Jay Alammar’s The Illustrated Transformer`,week:7,published:!0,notebook:null,source:`https://jalammar.github.io/illustrated-transformer/`},{id:`lecture-07`,title:`Generative Models and GANs`,subtitle:`Autoencoders, VAEs, the adversarial game — and how diffusion took over`,week:9,published:!0,notebook:null,source:`old_slides/2025/Teaching - Deep Leaning - 2025 - Lecture 07.pdf`}]},ye=[`href`],be=Object.assign({"../../../../../packages/slidev-theme-dl2026/slide-top.vue":A(x({__name:`slide-top`,setup(e){let{$slidev:t,$page:n,$renderContext:r}=I(),i=p(()=>r.value===`slide`&&!t.nav.isPrintMode),a=p(()=>t.themeConfigs?.lecture??``),o=p(()=>t.themeConfigs?.lectureTitle??``),s=p(()=>{let e=n.value,t=`[${a.value?`Lecture ${a.value}, slide ${e}`:`Slide ${e}`}] `,r=[`**Lecture:** ${a.value}${o.value?` — ${o.value}`:``}`,`**Slide:** ${e}`,`**Link:** ${typeof window<`u`?`${window.location.origin}${window.location.pathname}#/${e}`:``}`,``,`**What is wrong?**`,`<!-- e.g. typo, wrong equation, broken figure, unclear explanation -->`,``].join(`
2
+ `),i=new URLSearchParams({title:t,body:r,labels:`slides`});return`https://github.com/${ve.repo}/issues/new?${i}`});return(e,t)=>i.value?(C(),u(`a`,{key:0,class:`dl-report`,href:s.value,target:`_blank`,rel:`noopener`,title:`Report a problem with this slide on GitHub`,onClick:t[0]||=f(()=>{},[`stop`])},`Report issue`,8,ye)):S(`v-if`,!0)}}),[[`__scopeId`,`data-v-6b2267dc`]])}),xe=Object.assign({}),Se=Object.assign({}),Ce=Object.assign({}),we=Object.assign({}),Te=Object.assign({}),Ee=[Object.values(fe)[0],Object.values(pe)[0],Object.values(me)[0]].filter(Boolean),De={render:()=>Ee.map(t=>e(t))},$=[Object.values(he)[0],Object.values(ge)[0],Object.values(_e)[0]].filter(Boolean),Oe={render:()=>$.map(t=>e(t))},ke=[Object.values(be)[0],Object.values(xe)[0],Object.values(Se)[0]].filter(Boolean),Ae={render:()=>ke.map(t=>e(t))},je=[Object.values(Ce)[0],Object.values(we)[0],Object.values(Te)[0]].filter(Boolean),Me={render:()=>je.map(t=>e(t))},Ne=[`data-slidev-no`,`lang`],Pe=A(x({__name:`SlideWrapper`,props:{clicksContext:{type:Object,required:!0},renderContext:{type:String,default:`slide`},route:{type:Object,required:!0}},setup(e){let n=e,r=p(()=>n.route.meta?.slide?.frontmatter.zoom??1);j(P,n.route),j(L,n.route.meta.slide.frontmatter),j(M,h(n.route.no)),j(F,h(n.renderContext)),j(ie,_(n,`clicksContext`)),j(R,r);let i=p(()=>({"user-select":O.selectable?void 0:`none`,"--slidev-slide-zoom-scale":r.value===1?void 0:r.value}));return(r,o)=>(C(),u(`div`,{"data-slidev-no":n.route.no,class:b(l(H)(e.route,[`slide`,`presenter`].includes(n.renderContext)?``:`disable-view-transition`)),style:d(i.value),lang:n.route.meta.slide.frontmatter.lang},[a(l(Me)),(C(),y(t(n.route.component))),a(l(Ae))],14,Ne))}}),[[`__scopeId`,`data-v-a7136532`]]);export{Q as a,de as i,Oe as n,K as o,De as r,Pe as t};
transformer-v2/class/assets/default-DNkhSshI.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{H as e,S as t,b as n,z as r}from"./modules/shiki-BFOesOFp.js";import{t as i}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as a}from"./slidev/context-ChHKJoK9.js";import{t as o}from"./DeckFooter-RCcsEW0N.js";var s={class:`slidev-layout dl-default`},c=i({__name:`default`,setup(i){let{$slidev:c,$nav:l,$clicksContext:u,$clicks:d,$page:f,$renderContext:p,$frontmatter:m}=a();return(i,a)=>{let c=o;return r(),n(`div`,s,[e(i.$slots,`default`,{},void 0,!0),t(c)])}}},[[`__scopeId`,`data-v-3f3da7ce`]]);export{c as t};
transformer-v2/class/assets/index-CG-YcYMB.js ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./modules/file-saver-BpWusTEB.js","./rolldown-runtime-hePW80VL.js","./slidev/entry-DSOswi5I.js","./modules/shiki-BFOesOFp.js","./modules/shiki-BrmBd2_v.css","./_plugin-vue_export-helper-BDNMzG2s.js","./entry-Dba4BKje.css","./slidev/overview-C0t3M0qP.js","./useNav-BZQi666j.js","./modules/vue-CXhtJkbE.js","./slidev/context-ChHKJoK9.js","./slidev/IconButton-B5keGFol.js","./slidev/NoteDisplay-CB14pFWa.js","./NoteDisplay-DCBzjb4F.css","./modules/unplugin-icons-Btg0kt9H.js","./SlideWrapper-pRl27kyE.js","./syncState-BrWO1mSt.js","./slidev/client-BNcmSz3b.js","./useDrawings-DFNMQL0q.js","./SlideWrapper-DBNQYNtZ.css","./slidev/NoteEditable-C9cjRYMU.js","./overview-BIQ10iVu.css","./slidev/notes-DsoPOK4i.js","./slidev/Modal-BkELU18P.js","./slidev/TimerBar-D1wAIpGN.js","./slidev/notes-edit-i_aqIsEu.js","./slidev/presenter-DgDN81hj.js","./slidev/DrawingControls-CHqchiV_.js","./slidev/VerticalDivider-D_ScNBWw.js","./DrawingControls-Dhbx0szf.css","./slidev/shortcuts-CyV2fbdd.js","./shortcuts-nRB69a7e.css","./presenter-J5ibmAMh.css","./slidev/play-7plMx0AG.js","./play-D_7yfuao.css","./slidev/404-Cskqm_iE.js","./404-bkedjYjP.css"])))=>i.map(i=>d[i]);
2
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{F as t,I as n,O as r,P as i,S as a,T as o,U as s,X as c,Y as l,_t as u,b as d,ft as f,g as p,gt as m,it as h,k as g,lt as _,m as v,nt as y,s as b,st as x,t as S,w as C,y as w,z as T}from"./modules/shiki-BFOesOFp.js";import{$ as E,A as ee,B as te,G as ne,Q as re,R as D,Z as ie,c as ae,et as oe,h as O,j as se,l as ce,n as le,p as ue,q as k,t as de,tt as A,w as fe,z as pe}from"./useNav-BZQi666j.js";import{A as me,B as he,I as ge,L as _e,R as ve,b as ye,d as be,h as xe,i as Se,k as Ce,o as we,w as Te,x as Ee}from"./modules/vue-CXhtJkbE.js";import{a as De,c as Oe,d as ke,f as Ae,g as je,i as Me,m as Ne,o as Pe,p as Fe,r as Ie,s as Le,u as Re,y as ze}from"./slidev/context-ChHKJoK9.js";import{n as j,r as Be,t as Ve}from"./syncState-BrWO1mSt.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})(),_(!1),_(!1);var He=new Set([`link`,`style`,`script`,`noscript`]),Ue=new Set([`title`,`titleTemplate`,`script`,`style`,`noscript`]),We=new Set([`base`,`meta`,`link`,`style`,`script`,`noscript`]),Ge=new Set([`title`,`base`,`htmlAttrs`,`bodyAttrs`,`meta`,`link`,`style`,`script`,`noscript`]),Ke=new Set([`base`,`title`,`titleTemplate`,`bodyAttrs`,`htmlAttrs`,`templateParams`]),qe=new Set([`key`,`tagPosition`,`tagPriority`,`tagDuplicateStrategy`,`innerHTML`,`textContent`,`processTemplateParams`]),Je=new Set([`templateParams`,`htmlAttrs`,`bodyAttrs`]),Ye=new Set([`theme-color`,`google-site-verification`,`author`,`og:locale:alternate`,`og:image`,`og:video`,`og:audio`,`article:author`,`article:tag`,`book:author`,`book:tag`,`twitter:image`]),Xe={critical:-8,high:-1,low:2},Ze=e=>typeof e==`number`?Number.isFinite(e):e;function Qe(e){return e===`__proto__`||e===`constructor`||e===`prototype`}function $e(e,t,n,r){for(let i=n;i<e.length;i+=1)try{let n=r?r.run(()=>e[i](...t)):e[i](...t);if(n&&typeof n.then==`function`)return Promise.resolve(n).then(()=>$e(e,t,i+1,r))}catch(e){return Promise.reject(e)}}var et=class{_hooks;constructor(){this._hooks={}}hook(e,t){return!e||typeof t!=`function`?()=>{}:(this._hooks[e]=this._hooks[e]||[],this._hooks[e].push(t),()=>{t&&=(this.removeHook(e,t),void 0)})}removeHook(e,t){let n=this._hooks[e];if(n){let r=n.indexOf(t);r!==-1&&n.splice(r,1),n.length===0&&(this._hooks[e]=void 0)}}callHook(e,...t){let n=this._hooks[e];if(!(!n||n.length===0))return $e(n,t,0)}};function tt(e){let t=new et;for(let n in e||{})t.hook(n,e[n]);return t}function M(e,t,n){if(e.hooks?._hooks?.[t]?.length)return e.hooks?.callHook(t,n)}var nt=/^(?:viewport|description|keywords|robots)$/,rt=[`name`,`property`,`http-equiv`];function it(e){let t=e.indexOf(`:`);if(t===-1)return!1;let n=e.slice(t+1);return Ye.has(n)||n.startsWith(`og:image:`)||n.startsWith(`og:video:`)||n.startsWith(`og:audio:`)||n.startsWith(`twitter:image:`)}function at(e){let{props:t,tag:n,key:r}=e;if(Ke.has(n))return n;if(n===`link`){if(t.rel===`canonical`)return`canonical`;if(t.rel===`alternate`&&t.hreflang)return`alternate:${t.hreflang}`}if(t.charset)return`charset`;if(n===`meta`)for(let e of rt){let n=t[e];if(n!==void 0)return`meta:${n}${(typeof n!=`string`||!n.includes(`:`))&&!nt.test(n)&&r?`:key:${r}`:``}`}return r?`${n}:key:${r}`:t.id?`${n}:id:${t.id}`:n===`link`&&t.rel&&t.href?`link:${t.rel}:${t.href}`:Ue.has(n)&&(e.textContent||e.innerHTML)?`${n}:content:${e.textContent||e.innerHTML}`:void 0}function ot(e){let t=e._h||e._d||e.textContent||e.innerHTML;if(t)return t;let n=Object.keys(e.props).sort(),r=`${e.tag}:`,i=``;for(let t of n)r+=`${i}${t}:${String(e.props[t])}`,i=`,`;return r}function st(e,t,n){if(n===`_resolver`)return e;typeof e==`function`&&(!n||n!==`titleTemplate`&&!n.startsWith(`on`))&&(e=e());let r=t?t(n,e):e;if(Array.isArray(r)){let e;for(let n=0;n<r.length;n++){let i=st(r[n],t);e?e[n]=i:i!==r[n]&&(e=r.slice(0,n),e[n]=i)}return e||r}if(r?.constructor===Object){let e;for(let n in r){let i=Qe(n),a=i?void 0:st(r[n],t,n);if(!e&&(i||a!==r[n])){e={};for(let t in r){if(t===n)break;e[t]=r[t]}}e&&!i&&(e[n]=a)}return e||r}return r}var ct=/[\s"'<>/=\x00-\x1F\x7F]/;function lt(e,t){let n=e===`style`,r=n?new Map:new Set,i=e=>{if(e){if(n){let t=e.indexOf(`:`);t>0&&r.set(e.slice(0,t).trim(),e.slice(t+1).trim())}else e.split(` `).forEach(e=>e&&r.add(e))}};if(typeof t==`string`)(n?t.split(`;`):[t]).forEach(i);else if(Array.isArray(t))t.forEach(i);else if(t&&typeof t==`object`)for(let e in t){let a=t[e];a&&a!==`false`&&(n?r.set(e.trim(),String(a)):i(e))}return r}function ut(e,t){if(e.props=e.props||{},!t)return e;if(e.tag===`templateParams`)return e.props=t,e;let n=We.has(e.tag)||e.tag===`htmlAttrs`||e.tag===`bodyAttrs`;for(let r in t){if(Qe(r))continue;let i=r.startsWith(`data-`),a=n&&!qe.has(r),o=a&&!i?r.toLowerCase():r;if(a&&(!o||ct.test(o)))continue;let s=t[r];if(s===null)e.props[o]=null;else if(r===`class`||r===`style`)e.props[r]=lt(r,s);else if(qe.has(r)){if((r===`textContent`||r===`innerHTML`)&&typeof s==`object`){let n=t.type||`application/json`;(n.endsWith(`json`)||n===`speculationrules`||n===`importmap`)&&(e.props.type=t.type=n,e[r]=JSON.stringify(s))}else e[r]=s}else if(s!==void 0){let t=String(s),n=e.tag===`meta`&&o===`content`;e.props[o]=t===`true`||t===``?i||n?t:!0:!s&&i&&t===`false`?`false`:s}}return e}function dt(e,t){let n;return t.length&&(n=(e,n)=>{for(let r=0;r<t.length;r++)n=t[r](e,n);return n},e=n(void 0,e)),st(e,n)}function ft(e,t){let n=ut({tag:e,props:{}},typeof t==`object`&&typeof t!=`function`?t:{[e===`script`||e===`noscript`||e===`style`?`innerHTML`:`textContent`]:t});if(n.key&&He.has(n.tag)&&(n.props[`data-hid`]=n._h=n.key),n.tag===`script`&&typeof n.innerHTML==`object`&&(n.innerHTML=JSON.stringify(n.innerHTML),n.props.type=n.props.type||`application/json`),Array.isArray(n.props.content)){let e=[];for(let t of n.props.content)e.push({...n,props:{...n.props,content:t}});return e}return n}function pt(e,t){if(Array.isArray(t))for(let n of t)e.push(n);else e.push(t)}function mt(e,t){if(!e)return[];typeof e==`function`&&(e=e()),e=dt(e,t);let n=[];for(let t in e){let r=e[t];if(r!==void 0){if(Array.isArray(r))for(let e of r)pt(n,ft(t,e));else pt(n,ft(t,r))}}return n}var ht=/</g,gt=/<\/script/g,_t=(e,t)=>e._w===t._w?e._p-t._p:e._w-t._w,vt=()=>100;function yt(e){for(let t in e)return!1;return!0}var bt=/^tags:|:render/;function xt(e,t){let n=(t[`entries:resolve`]?.length||0)+(t[`entries:normalize`]?.length||0);if(e._h!==n){e._h=n;for(let t of e.entries.values())delete t._tags}}function St(e){for(let t=0;t<e.length;t++){let n=e[t],r={...n.props};r.class instanceof Set&&(r.class=new Set(r.class)),r.style instanceof Map&&(r.style=new Map(r.style)),e[t]={...n,props:r}}}function Ct(e,t){let n=e.tags,r=0;for(let t of e.tagMap.values())if(Array.isArray(t))for(let e of t)n[r++]=e;else n[r++]=t;n.length=r,t&&n.sort(_t)}function wt(e){let t=!1;for(let n of e.tags.sort(_t)){let r=n._d||ot(n);if(!r)continue;let i=e.tagMap.get(r);if(!i){e.tagMap.set(r,n);continue}if((n.tagDuplicateStrategy||(Je.has(n.tag)?`merge`:null)||(n.key&&n.key===i.key?`merge`:null))===`merge`){let t={...i.props};for(let e in n.props)t[e]=e===`style`?new Map([...i.props.style||new Map,...n.props[e]]):e===`class`?new Set([...i.props.class||[],...n.props[e]]):n.props[e];e.tagMap.set(r,{...n,props:t})}else n._p>>10==i._p>>10&&n.tag===`meta`&&it(r)?(e.tagMap.set(r,Object.assign([...Array.isArray(i)?i:[i],n],n)),t=!0):(n._w===i._w?n._p>i._p:n._w<i._w)&&e.tagMap.set(r,n)}return t}function Tt(e,t){let n=e.tagMap.get(`title`),r=e.tagMap.get(`titleTemplate`);if(t._title=n?.textContent,!r)return;let i=r.textContent;if(t._titleTemplate=i,!i)return;let a=typeof i==`function`?i(n?.textContent):i;typeof a==`string`&&!t.plugins.has(`template-params`)&&(a=a.replace(`%s`,n?.textContent||``)),n?a===null?e.tagMap.delete(`title`):e.tagMap.set(`title`,{...n,textContent:a}):e.tagMap.set(`titleTemplate`,{...r,tag:`title`,textContent:a})}function Et(e){let t=0;for(let n of e){let{innerHTML:r,tag:i,props:a}=n;if(!(!Ge.has(i)||yt(a)&&!Ze(r)&&!Ze(n.textContent))&&!(i===`meta`&&!Ze(a.content)&&!a[`http-equiv`]&&!a.charset)){if(i===`script`&&(r||n.textContent)){let e=String(a.type),t=e.endsWith(`json`)||e===`importmap`||e===`speculationrules`,i=e=>t?(typeof e==`string`?e:JSON.stringify(e)).replace(ht,`\\u003C`):typeof e==`string`?e.replace(gt,`<\\/script`):e;n={...n},r&&(n.innerHTML=i(r)),n.textContent&&(n.textContent=i(n.textContent)),n._d=at(n)}e[t++]=n}}return e.length=t,e}function Dt(e,t){let n=t?.tagWeight??e.resolvedOptions._tagWeight??vt,r={tagMap:new Map,tags:[]},i=e.hooks?._hooks||{};xt(e,i);for(let t of e.entries.values())t._pending!==void 0&&(t.input=t._pending,delete t._pending,delete t._tags,delete t._precomputedTags);let a;(i[`entries:resolve`]?.length||i[`entries:normalize`]?.length)&&(a=[...e.entries.values()],i[`entries:resolve`]?.length&&M(e,`entries:resolve`,{entries:a,...r})),xt(e,i);for(let t of a||e.entries.values()){let a=t._tags;if(!a){if(t._precomputedTags&&n===e.resolvedOptions._tagWeight&&!i[`entries:normalize`]?.length&&!i[`entries:resolve`]?.length&&(!t.options||yt(t.options)))a=t._precomputedTags;else{if(a=mt(t.input,e.resolvedOptions.propResolvers||[]),t.options&&!yt(t.options))for(let e of a)Object.assign(e,t.options);if(i[`entries:normalize`]?.length){let n={tags:a,entry:t};M(e,`entries:normalize`,n),a=n.tags}for(let e=0;e<a.length;e++){let r=a[e];r._w=n(r),r._p=(t._i<<10)+e,r._d=at(r),r._d||(r._h=ot(r))}t._tags=a}}r.tags.push(...a)}for(let e in i)if(i[e]?.length&&bt.test(e)){St(r.tags);break}let o=wt(r);return Tt(r,e),Ct(r,o),M(e,`tags:beforeResolve`,r),M(e,`tags:resolve`,r),M(e,`tags:afterResolve`,r),Et(r.tags)}var Ot=`usehead`;function kt(){if(r()){let e=g(Ot);if(e)return e}throw Error(`useHead() was called without provide context, ensure you call it through the setup() function.`)}function At(e){return{install(t){t.config.globalProperties.$unhead=e,t.config.globalProperties.$head=e,t.provide(Ot,e)}}.install}var jt=Object.assign((e,t)=>h(t)?m(t):t,{_static:!0});function Mt(e,t={}){let n=t.head||kt();return n.ssr?n.push(e||{},t):Nt(n,e,t)}function Nt(e,r,a={}){let s=y();if(s&&!s.active)return{patch(){},dispose(){},_i:-1};let l=_(!1);if(a.onRendered&&s){let e=a.onRendered;a={...a,onRendered:t=>s.run(()=>e(t))}}let u;return c(()=>{let t=l.value?{}:st(r,jt);u?u.patch(t):u=e.push(t,a)}),o()&&(t(()=>{u.dispose()}),n(()=>{l.value=!0}),i(()=>{l.value=!1})),u}function Pt(e,t){if(typeof t==`function`&&t.key&&e.plugins.has(t.key))return;let n=typeof t==`function`?t(e):t,r=n.key||String(e.plugins.size+1);if(!e.plugins.get(r)){e.plugins.set(r,n);for(let t in n.hooks||{})e.hooks?.hook(t,n.hooks[t])}}function Ft(e,t={}){let n=!t.document,r=new Map,i={_entryCount:1,_h:0,plugins:new Map,resolvedOptions:t,ssr:n,entries:r,hooks:void 0,render:()=>e(i),use:e=>Pt(i,e),push(e,t){let a=t?._index??i._entryCount++,o=t?{...t}:{};delete o.head,delete o.onRendered,delete o._index;let s={_i:a,input:e,options:o};return r.set(a,s),{_i:a,dispose(){r.delete(a)},patch(e){n?(s.input=e,delete s._tags):s._pending=e,r.has(a)||r.set(a,s)}}}};return t.init?.forEach(e=>e&&i.push(e)),i}var It=Object.assign({}),Lt=Object.assign({}),Rt=Object.assign({}),zt=[Object.values(It)[0],Object.values(Lt)[0],Object.values(Rt)[0]].filter(Boolean),Bt=ye(),Vt=xe(`slidev-color-schema`,`auto`),Ht=p(()=>A.colorSchema!==`auto`),Ut=p({get(){return Ht.value?A.colorSchema===`dark`:Vt.value===`auto`?Bt.value:Vt.value===`dark`},set(e){Ht.value||(Vt.value=e===Bt.value?`auto`:e?`dark`:`light`)}}),Wt=ge(Ut);me&&l(Ut,e=>{let t=window.document.createElement(`style`);t.appendChild(document.createTextNode(`*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}`)),window.document.head.appendChild(t);let n=document.querySelector(`html`);n.classList.toggle(`dark`,e),n.classList.toggle(`light`,!e),window.getComputedStyle(t).opacity,document.head.removeChild(t)},{immediate:!0});function Gt(){let{isPrintMode:e}=de();Ee(p(()=>e.value?`
3
+ @page {
4
+ size: ${re.value}px ${ie.value}px;
5
+ margin: 0px;
6
+ }
7
+
8
+ * {
9
+ transition: none !important;
10
+ transition-duration: 0s !important;
11
+ }`:``))}var Kt=Symbol.for(`yaml.alias`),qt=Symbol.for(`yaml.document`),N=Symbol.for(`yaml.map`),Jt=Symbol.for(`yaml.pair`),Yt=Symbol.for(`yaml.scalar`),Xt=Symbol.for(`yaml.seq`),P=Symbol.for(`yaml.node.type`),Zt=e=>!!e&&typeof e==`object`&&e[P]===Kt,Qt=e=>!!e&&typeof e==`object`&&e[P]===qt,$t=e=>!!e&&typeof e==`object`&&e[P]===N,F=e=>!!e&&typeof e==`object`&&e[P]===Jt,I=e=>!!e&&typeof e==`object`&&e[P]===Yt,en=e=>!!e&&typeof e==`object`&&e[P]===Xt;function L(e){if(e&&typeof e==`object`)switch(e[P]){case N:case Xt:return!0}return!1}function R(e){if(e&&typeof e==`object`)switch(e[P]){case Kt:case N:case Yt:case Xt:return!0}return!1}var tn=e=>(I(e)||L(e))&&!!e.anchor,z=Symbol(`break visit`),nn=Symbol(`skip children`),rn=Symbol(`remove node`);function an(e,t){let n=sn(t);Qt(e)?on(null,e.contents,n,Object.freeze([e]))===rn&&(e.contents=null):on(null,e,n,Object.freeze([]))}an.BREAK=z,an.SKIP=nn,an.REMOVE=rn;function on(e,t,n,r){let i=cn(e,t,n,r);if(R(i)||F(i))return ln(e,r,i),on(e,i,n,r);if(typeof i!=`symbol`){if(L(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=on(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===z)return z;else i===rn&&(t.items.splice(e,1),--e)}}else if(F(t)){r=Object.freeze(r.concat(t));let e=on(`key`,t.key,n,r);if(e===z)return z;e===rn&&(t.key=null);let i=on(`value`,t.value,n,r);if(i===z)return z;i===rn&&(t.value=null)}}return i}function sn(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function cn(e,t,n,r){if(typeof n==`function`)return n(e,t,r);if($t(t))return n.Map?.(e,t,r);if(en(t))return n.Seq?.(e,t,r);if(F(t))return n.Pair?.(e,t,r);if(I(t))return n.Scalar?.(e,t,r);if(Zt(t))return n.Alias?.(e,t,r)}function ln(e,t,n){let r=t[t.length-1];if(L(r))r.items[e]=n;else if(F(r))e===`key`?r.key=n:r.value=n;else if(Qt(r))r.contents=n;else{let e=Zt(r)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}function un(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function dn(e,t,n,r){if(r&&typeof r==`object`){if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=dn(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=dn(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=dn(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=dn(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function B(e,t,n){if(Array.isArray(e))return e.map((e,t)=>B(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!tn(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var fn=class{constructor(e){Object.defineProperty(this,P,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!Qt(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=B(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?dn(i,{"":o},``,o):o}},pn=class extends fn{constructor(e){super(Kt),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],an(e,{Node:(e,t)=>{(Zt(t)||tn(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}return r}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:r,maxAliasCount:i}=t,a=this.resolve(r,t);if(!a){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}let o=n.get(a);if(o||=(B(a,null,t),n.get(a)),o?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=mn(r,a,n)),o.count*o.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`);return o.res}toString(e,t,n){let r=`*${this.source}`;if(e){if(un(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function mn(e,t,n){if(Zt(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(L(t)){let r=0;for(let i of t.items){let t=mn(e,i,n);t>r&&(r=t)}return r}if(F(t)){let r=mn(e,t.key,n),i=mn(e,t.value,n);return Math.max(r,i)}return 1}var hn=e=>!e||typeof e!=`function`&&typeof e!=`object`,V=class extends fn{constructor(e){super(Yt),this.value=e}toJSON(e,t){return t?.keep?this.value:B(this.value,e,t)}toString(){return String(this.value)}};V.BLOCK_FOLDED=`BLOCK_FOLDED`,V.BLOCK_LITERAL=`BLOCK_LITERAL`,V.PLAIN=`PLAIN`,V.QUOTE_DOUBLE=`QUOTE_DOUBLE`,V.QUOTE_SINGLE=`QUOTE_SINGLE`;var gn=`tag:yaml.org,2002:`;function _n(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function vn(e,t,n){if(Qt(e)&&(e=e.contents),R(e))return e;if(F(e)){let t=n.schema[N].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??(c.anchor=i(e)),new pn(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=gn+t.slice(2));let l=_n(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new V(e);return c&&(c.node=t),t}l=e instanceof Map?o[N]:Symbol.iterator in Object(e)?o[Xt]:o[N]}a&&(a(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from==`function`?l.nodeClass.from(n.schema,e,n):new V(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}function yn(e,t,n){let r=n;for(let e=t.length-1;e>=0;--e){let n=t[e];if(typeof n==`number`&&Number.isInteger(n)&&n>=0){let e=[];e[n]=r,r=e}else r=new Map([[n,r]])}return vn(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}var bn=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done,xn=class extends fn{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>R(t)||F(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(bn(e))this.add(t);else{let[n,...r]=e,i=this.get(n,!0);if(L(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(n,yn(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let r=this.get(t,!0);if(L(r))return r.deleteIn(n);throw Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...r]=e,i=this.get(n,!0);return r.length===0?!t&&I(i)?i.value:i:L(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!F(t))return!1;let n=t.value;return n==null||e&&I(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let r=this.get(t,!0);return L(r)?r.hasIn(n):!1}setIn(e,t){let[n,...r]=e;if(r.length===0)this.set(n,t);else{let e=this.get(n,!0);if(L(e))e.setIn(r,t);else if(e===void 0&&this.schema)this.set(n,yn(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}},Sn=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function Cn(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var wn=(e,t,n)=>e.endsWith(`
12
+ `)?Cn(n,t):n.includes(`
13
+ `)?`
14
+ `+Cn(n,t):(e.endsWith(` `)?``:` `)+n,Tn=`flow`,En=`block`,Dn=`quoted`;function On(e,t,n=`flow`,{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!i||i<0)return e;i<a&&(a=0);let c=Math.max(1+a,1+i-t.length);if(e.length<=c)return e;let l=[],u={},d=i-t.length;typeof r==`number`&&(r>i-Math.max(2,a)?l.push(0):d=i-r);let f,p,m=!1,h=-1,g=-1,_=-1;n===`block`&&(h=kn(e,h,t.length),h!==-1&&(d=h+c));for(let r;r=e[h+=1];){if(n===`quoted`&&r===`\\`){switch(g=h,e[h+1]){case`x`:h+=3;break;case`u`:h+=5;break;case`U`:h+=9;break;default:h+=1}_=h}if(r===`
15
+ `)n===`block`&&(h=kn(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==`
16
+ `&&p!==` `){let t=e[h+1];t&&t!==` `&&t!==`
17
+ `&&t!==` `&&(f=h)}if(h>=d){if(f)l.push(f),d=f+c,f=void 0;else if(n===`quoted`){for(;p===` `||p===` `;)p=r,r=e[h+=1],m=!0;let t=h>_+1?h-2:g-1;if(u[t])return e;l.push(t),u[t]=!0,d=t+c,f=void 0}else m=!0}}p=r}if(m&&s&&s(),l.length===0)return e;o&&o();let v=e.slice(0,l[0]);for(let r=0;r<l.length;++r){let i=l[r],a=l[r+1]||e.length;i===0?v=`\n${t}${e.slice(0,a)}`:(n===`quoted`&&u[i]&&(v+=`${e[i]}\\`),v+=`\n${t}${e.slice(i+1,a)}`)}return v}function kn(e,t,n){let r=t,i=t+1,a=e[i];for(;a===` `||a===` `;)if(t<i+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
18
+ `);r=t,i=t+1,a=e[i]}return r}var An=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),jn=e=>/^(%|---|\.\.\.)/m.test(e);function Mn(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let t=0,n=0;t<i;++t)if(e[t]===`
19
+ `){if(t-n>r)return!0;if(n=t+1,i-n<=r)return!1}return!0}function Nn(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(jn(e)?` `:``),o=``,s=0;for(let e=0,t=n[e];t;t=n[++e])if(t===` `&&n[e+1]===`\\`&&n[e+2]===`n`&&(o+=n.slice(s,e)+`\\ `,e+=1,s=e,t=`\\`),t===`\\`)switch(n[e+1]){case`u`:{o+=n.slice(s,e);let t=n.substr(e+2,4);switch(t){case`0000`:o+=`\\0`;break;case`0007`:o+=`\\a`;break;case`000b`:o+=`\\v`;break;case`001b`:o+=`\\e`;break;case`0085`:o+=`\\N`;break;case`00a0`:o+=`\\_`;break;case`2028`:o+=`\\L`;break;case`2029`:o+=`\\P`;break;default:t.substr(0,2)===`00`?o+=`\\x`+t.substr(2):o+=n.substr(e,6)}e+=5,s=e+1}break;case`n`:if(r||n[e+2]===`"`||n.length<i)e+=1;else{for(o+=n.slice(s,e)+`
20
+
21
+ `;n[e+2]===`\\`&&n[e+3]===`n`&&n[e+4]!==`"`;)o+=`
22
+ `,e+=2;o+=a,n[e+2]===` `&&(o+=`\\`),e+=1,s=e+1}break;default:e+=1}return o=s?o+n.slice(s):n,r?o:On(o,a,Dn,An(t,!1))}function Pn(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
23
+ `)||/[ \t]\n|\n[ \t]/.test(e))return Nn(e,t);let n=t.indent||(jn(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:On(r,n,Tn,An(t,!1))}function Fn(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=Nn;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?Pn:i&&!t?Nn:n?Pn:Nn}return r(e,t)}var In;try{In=RegExp(`(^|(?<!
24
+ ))
25
+ +(?!
26
+ |$)`,`g`)}catch{In=/\n+(?!\n|$)/g}function Ln({comment:e,type:t,value:n},r,i,a){let{blockQuote:o,commentString:s,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n))return Fn(n,r);let l=r.indent||(r.forceBlockIndent||jn(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===V.BLOCK_FOLDED?!1:t===V.BLOCK_LITERAL||!Mn(n,c,l.length);if(!n)return u?`|
27
+ `:`>
28
+ `;let d,f;for(f=n.length;f>0;--f){let e=n[f-1];if(e!==`
29
+ `&&e!==` `&&e!==` `)break}let p=n.substring(f),m=p.indexOf(`
30
+ `);m===-1?d=`-`:n===p||m!==p.length-1?(d=`+`,a&&a()):d=``,p&&=(n=n.slice(0,-p.length),p[p.length-1]===`
31
+ `&&(p=p.slice(0,-1)),p.replace(In,`$&${l}`));let h=!1,g,_=-1;for(g=0;g<n.length;++g){let e=n[g];if(e===` `)h=!0;else if(e===`
32
+ `)_=g;else break}let v=n.substring(0,_<g?_+1:g);v&&=(n=n.substring(v.length),v.replace(/\n+/g,`$&${l}`));let y=(h?l?`2`:`1`:``)+d;if(e&&(y+=` `+s(e.replace(/ ?[\r\n]+/g,` `)),i&&i()),!u){let e=n.replace(/\n+/g,`
33
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\n+/g,`$&${l}`),i=!1,a=An(r,!0);o!==`folded`&&t!==V.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=On(`${v}${e}${p}`,l,En,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function Rn(e,t,n,r){let{type:i,value:a}=e,{actualString:o,implicitKey:s,indent:c,indentStep:l,inFlow:u}=t;if(s&&a.includes(`
34
+ `)||u&&/[[\]{},]/.test(a))return Fn(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
35
+ `)?Fn(a,t):Ln(e,t,n,r);if(!s&&!u&&i!==V.PLAIN&&a.includes(`
36
+ `))return Ln(e,t,n,r);if(jn(a)){if(c===``)return t.forceBlockIndent=!0,Ln(e,t,n,r);if(s&&c===l)return Fn(a,t)}let d=a.replace(/\n+/g,`$&\n${c}`);if(o){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(d),{compat:n,tags:r}=t.doc.schema;if(r.some(e)||n?.some(e))return Fn(a,t)}return s?d:On(d,c,Tn,An(t,!1))}function zn(e,t,n,r){let{implicitKey:i,inFlow:a}=t,o=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:s}=e;s!==V.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=V.QUOTE_DOUBLE);let c=e=>{switch(e){case V.BLOCK_FOLDED:case V.BLOCK_LITERAL:return i||a?Fn(o.value,t):Ln(o,t,n,r);case V.QUOTE_DOUBLE:return Nn(o.value,t);case V.QUOTE_SINGLE:return Pn(o.value,t);case V.PLAIN:return Rn(o,t,n,r);default:return null}},l=c(s);if(l===null){let{defaultKeyType:e,defaultStringType:n}=t.options,r=i&&e||n;if(l=c(r),l===null)throw Error(`Unsupported default string type ${r}`)}return l}function Bn(e,t){let n=Object.assign({blockQuote:!0,commentString:Sn,defaultKeyType:null,defaultStringType:`PLAIN`,directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:`false`,flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:`null`,simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:`true`,verifyAliasOrder:!0},e.schema.toStringOptions,t),r;switch(n.collectionStyle){case`block`:r=!1;break;case`flow`:r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:r,options:n}}function Vn(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let n,r;if(I(t)){r=t.value;let i=e.filter(e=>e.identify?.(r));if(i.length>1){let e=i.filter(e=>e.test);e.length>0&&(i=e)}n=i.find(e=>e.format===t.format)??i.find(e=>!e.format)}else r=t,n=e.find(e=>e.nodeClass&&r instanceof e.nodeClass);if(!n){let e=r?.constructor?.name??(r===null?`null`:typeof r);throw Error(`Tag not resolved for ${e} value`)}return n}function Hn(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(I(e)||L(e))&&e.anchor;a&&un(a)&&(n.add(a),i.push(`&${a}`));let o=e.tag??(t.default?null:t.tag);return o&&i.push(r.directives.tagString(o)),i.join(` `)}function Un(e,t,n,r){if(F(e))return e.toString(t,n,r);if(Zt(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,a=R(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=Vn(t.doc.schema.tags,a);let o=Hn(a,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);let s=typeof i.stringify==`function`?i.stringify(a,t,n,r):I(a)?zn(a,t,n,r):a.toString(t,n,r);return o?I(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function Wn({key:e,value:t},n,r,i){let{allNullValues:a,doc:o,indent:s,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,f=R(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(L(e)||!R(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let p=!d&&(!e||f&&t==null&&!n.inFlow||L(e)||(I(e)?e.type===V.BLOCK_FOLDED||e.type===V.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=Un(e,n,()=>m=!0,()=>h=!0);if(!p&&!n.inFlow&&g.length>1024){if(d)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);p=!0}if(n.inFlow){if(a||t==null)return m&&r&&r(),g===``?`?`:p?`? ${g}`:g}else if(a&&!d||t==null&&p)return g=`? ${g}`,f&&!m?g+=wn(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=wn(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=wn(g,n.indent,l(f))));let _,v,y;R(t)?(_=!!t.spaceBefore,v=t.commentBefore,y=t.comment):(_=!1,v=null,y=null,t&&typeof t==`object`&&(t=o.createNode(t))),n.implicitKey=!1,!p&&!f&&I(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&en(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=Un(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
37
+ `:``,v){let e=l(v);S+=`\n${Cn(e,n.indent)}`}x===``&&!n.inFlow?S===`
38
+ `&&y&&(S=`
39
+
40
+ `):S+=`\n${n.indent}`}else if(!p&&L(t)){let e=x[0],r=x.indexOf(`
41
+ `),i=r!==-1,a=n.inFlow??t.flow??t.items.length===0;if(i||!a){let t=!1;if(i&&(e===`&`||e===`!`)){let n=x.indexOf(` `);e===`&`&&n!==-1&&n<r&&x[n+1]===`!`&&(n=x.indexOf(` `,n+1)),(n===-1||r<n)&&(t=!0)}t||(S=`\n${n.indent}`)}}else(x===``||x[0]===`
42
+ `)&&(S=``);return g+=S+x,n.inFlow?b&&r&&r():y&&!b?g+=wn(g,n.indent,l(y)):h&&i&&i(),g}function Gn(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var Kn=`<<`,qn={identify:e=>e===Kn||typeof e==`symbol`&&e.description===Kn,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new V(Symbol(Kn)),{addToJSMap:Yn}),stringify:()=>Kn},Jn=(e,t)=>(qn.identify(t)||I(t)&&(!t.type||t.type===V.PLAIN)&&qn.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===qn.tag&&e.default);function Yn(e,t,n){let r=Zn(e,n);if(en(r))for(let n of r.items)Xn(e,t,n);else if(Array.isArray(r))for(let n of r)Xn(e,t,n);else Xn(e,t,r)}function Xn(e,t,n){let r=Zn(e,n);if(!$t(r))throw Error(`Merge sources must be maps or map aliases`);let i=r.toJSON(null,e,Map);for(let[e,n]of i)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0});return t}function Zn(e,t){return e&&Zt(t)?t.resolve(e.doc,e):t}function Qn(e,t,{key:n,value:r}){if(R(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(Jn(e,n))Yn(e,t,r);else{let i=B(n,``,e);if(t instanceof Map)t.set(i,B(r,i,e));else if(t instanceof Set)t.add(i);else{let a=$n(n,i,e),o=B(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function $n(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(R(e)&&n?.doc){let t=Bn(n.doc,{});t.anchors=new Set;for(let e of n.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;let r=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(r);e.length>40&&(e=e.substring(0,36)+`..."`),Gn(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function er(e,t,n){return new H(vn(e,void 0,n),vn(t,void 0,n))}var H=class e{constructor(e,t=null){Object.defineProperty(this,P,{value:Jt}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return R(n)&&(n=n.clone(t)),R(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return Qn(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?Wn(this,e,t,n):JSON.stringify(this)}};function tr(e,t,n){return(t.inFlow??e.flow?rr:nr)(e,t,n)}function nr({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:a,type:null}),d=!1,f=[];for(let e=0;e<t.length;++e){let i=t[e],o=null;if(R(i))!d&&i.spaceBefore&&f.push(``),ir(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(F(i)){let e=R(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),ir(n,f,e.commentBefore,d))}d=!1;let s=Un(i,u,()=>o=null,()=>d=!0);o&&(s+=wn(s,a,l(o))),d&&o&&(d=!1),f.push(r+s)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let e=1;e<f.length;++e){let t=f[e];p+=t?`\n${c}${t}`:`
43
+ `}}return e?(p+=`
44
+ `+Cn(l(e),c),s&&s()):d&&o&&o(),p}function rr({items:e},t,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:a,flowCollectionPadding:o,options:{commentString:s}}=t;r+=a;let c=Object.assign({},t,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let n=0;n<e.length;++n){let i=e[n],a=null;if(R(i))i.spaceBefore&&d.push(``),ir(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(F(i)){let e=R(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),ir(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=R(i.value)?i.value:null;n?(n.comment&&(a=n.comment),n.commentBefore&&(l=!0)):i.value==null&&e?.comment&&(a=e.comment)}a&&(l=!0);let o=Un(i,c,()=>a=null);l||=d.length>u||o.includes(`
45
+ `),n<e.length-1?o+=`,`:t.options.trailingComma&&(t.options.lineWidth>0&&(l||=d.reduce((e,t)=>e+t.length+2,2)+(o.length+2)>t.options.lineWidth),l&&(o+=`,`)),a&&(o+=wn(o,r,s(a))),d.push(o),u=d.length}let{start:f,end:p}=n;if(d.length===0)return f+p;if(!l){let e=d.reduce((e,t)=>e+t.length+2,2);l=t.options.lineWidth>0&&e>t.options.lineWidth}if(l){let e=f;for(let t of d)e+=t?`\n${a}${i}${t}`:`
46
+ `;return`${e}\n${i}${p}`}return`${f}${o}${d.join(` `)}${o}${p}`}function ir({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=Cn(t(r),e);n.push(i.trimStart())}}function U(e,t){let n=I(t)?t.value:t;for(let r of e)if(F(r)&&(r.key===t||r.key===n||I(r.key)&&r.key.value===n))return r}var W=class extends xn{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(N,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,a=new this(e),o=(e,o)=>{if(typeof i==`function`)o=i.call(t,e,o);else if(Array.isArray(i)&&!i.includes(e))return;(o!==void 0||r)&&a.items.push(er(e,o,n))};if(t instanceof Map)for(let[e,n]of t)o(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))o(e,t[e]);return typeof e.sortMapEntries==`function`&&a.items.sort(e.sortMapEntries),a}add(e,t){let n;n=F(e)?e:!e||typeof e!=`object`||!(`key`in e)?new H(e,e?.value):new H(e.key,e.value);let r=U(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);I(r.value)&&hn(n.value)?r.value.value=n.value:r.value=n.value}else if(i){let e=this.items.findIndex(e=>i(n,e)<0);e===-1?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=U(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=U(this.items,e)?.value;return(!t&&I(n)?n.value:n)??void 0}has(e){return!!U(this.items,e)}set(e,t){this.add(new H(e,t),!0)}toJSON(e,t,n){let r=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(let e of this.items)Qn(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!F(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),tr(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},ar={collection:`map`,default:!0,nodeClass:W,tag:`tag:yaml.org,2002:map`,resolve(e,t){return $t(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>W.from(e,t,n)},or=class extends xn{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(Xt,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=sr(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=sr(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&I(r)?r.value:r}has(e){let t=sr(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=sr(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];I(r)&&hn(t)?r.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let r=0;for(let e of this.items)n.push(B(e,String(r++),t));return n}toString(e,t,n){return e?tr(this,e,{blockItemPrefix:`- `,flowChars:{start:`[`,end:`]`},itemIndent:(e.indent||``)+` `,onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let a of t){if(typeof r==`function`){let n=t instanceof Set?a:String(e++);a=r.call(t,n,a)}i.items.push(vn(a,void 0,n))}}return i}};function sr(e){let t=I(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var cr={collection:`seq`,default:!0,nodeClass:or,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return en(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>or.from(e,t,n)};function lr(e){return typeof e==`bigint`||Number.isInteger(e)}var ur=({value:e})=>JSON.stringify(e),dr=[{identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify:ur},{identify:e=>e==null,createNode:()=>new V(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^null$/,resolve:()=>null,stringify:ur},{identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^true$|^false$/,resolve:e=>e===`true`,stringify:ur},{identify:lr,default:!0,tag:`tag:yaml.org,2002:int`,test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>lr(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:ur}];[ar,cr].concat(dr,{default:!0,tag:``,test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}});function fr(e,t,n){let{replacer:r}=n,i=new or(e);i.tag=`tag:yaml.org,2002:pairs`;let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof r==`function`&&(e=r.call(t,String(a++),e));let o,s;if(Array.isArray(e)){if(e.length===2)o=e[0],s=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`)}else if(e&&e instanceof Object){let t=Object.keys(e);if(t.length===1)o=t[0],s=e[o];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else o=e;i.items.push(er(o,s,n))}return i}var pr=class e extends or{constructor(){super(),this.add=W.prototype.add.bind(this),this.delete=W.prototype.delete.bind(this),this.get=W.prototype.get.bind(this),this.has=W.prototype.has.bind(this),this.set=W.prototype.set.bind(this),this.tag=e.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let e of this.items){let r,i;if(F(e)?(r=B(e.key,``,t),i=B(e.value,r,t)):r=B(e,``,t),n.has(r))throw Error(`Ordered maps must not include duplicate keys`);n.set(r,i)}return n}static from(e,t,n){let r=fr(e,t,n),i=new this;return i.items=r.items,i}};pr.tag=`tag:yaml.org,2002:omap`;var mr=class e extends W{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=F(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new H(e.key,null):new H(e,null),U(this.items,t.key)||this.items.push(t)}get(e,t){let n=U(this.items,e);return!t&&F(n)?I(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=U(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new H(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw Error(`Set items must all have null values`)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)typeof r==`function`&&(e=r.call(t,e,e)),i.items.push(er(e,null,n));return i}};mr.tag=`tag:yaml.org,2002:set`;var hr=Symbol(`break visit`),gr=Symbol(`skip children`),_r=Symbol(`remove item`);function vr(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),yr(Object.freeze([]),e,t)}vr.BREAK=hr,vr.SKIP=gr,vr.REMOVE=_r,vr.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(t&&`items`in t)n=t.items[r];else return}return n},vr.parentCollection=(e,t)=>{let n=vr.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&`items`in i)return i;throw Error(`Parent collection not found`)};function yr(e,t,n){let r=n(t,e);if(typeof r==`symbol`)return r;for(let i of[`key`,`value`]){let a=t[i];if(a&&`items`in a){for(let t=0;t<a.items.length;++t){let r=yr(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===hr)return hr;else r===_r&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}function br(e=5){let t=[];for(let n=0;n<e;n++)t.push(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`.charAt(Math.floor(Math.random()*52)));return t.join(``)}var G=x({}),xr=[],Sr=[];j(G,`$syncUp`,!0),j(G,`$syncDown`,!0),j(G,`$paused`,!1),j(G,`$onSet`,e=>xr.push(e)),j(G,`$onPatch`,e=>Sr.push(e)),Be(),j(G,`$patch`,async()=>!1);var{init:Cr,onPatch:wr,onUpdate:Tr,patch:Er,state:Dr}=Ve(G,G,!1),K=x({page:0,clicks:0,timer:{status:`stopped`,slides:{},startedAt:0,pausedAt:0}}),Or=[],kr=[];j(K,`$syncUp`,!0),j(K,`$syncDown`,!0),j(K,`$paused`,!1),j(K,`$onSet`,e=>Or.push(e)),j(K,`$onPatch`,e=>kr.push(e)),Be(),j(K,`$patch`,async()=>!1);var{init:Ar,onPatch:jr,onUpdate:Mr,patch:Nr,state:Pr}=Ve(K,{page:1,clicks:0,clicksTotal:0,timer:{status:`stopped`,slides:{},startedAt:0,pausedAt:0}});function Fr(){let e=o().appContext.app,t=x({nav:de(),configs:A,themeConfigs:p(()=>A.themeConfig)});e.provide(Ne,_(`none`)),e.provide(ze,t),e.provide(Ae,p(()=>t.nav.currentSlideNo)),e.provide(ke,f(ne()));for(let e of zt)e();let{clicksContext:n,currentSlideNo:r,hasPrimarySlide:i,isNotesViewer:a,isPresenter:s,isPrintMode:c}=de();Mt({title:E,htmlAttrs:A.htmlAttrs}),Gt(),Ar(`${E} - shared`),Cr(`${E} - drawings`);let u=`${location.origin}_${br()}`,d=p(()=>s.value?`presenter`:`viewer`);function m(){(s.value?se.value.presenterSend:se.value.viewerSend)&&(a.value||c.value||!s.value&&!Re.includes(location.host.split(`:`)[0])||(Nr(`page`,+r.value),Nr(`clicks`,n.value.current),Nr(`clicksTotal`,n.value.total),Nr(`lastUpdate`,{id:u,type:d.value,time:Date.now()})))}let h=he();h.afterEach(m),l(n,m),jr(e=>{(s.value?se.value.presenterReceive:se.value.viewerReceive)&&(!i.value||c.value||e.lastUpdate?.type!==d.value&&(+e.page!=+r.value||+n.value.current!=+e.clicks)&&(ue.value=!1,h.replace({path:te(e.page,s.value),query:{...h.currentRoute.value.query,clicks:e.clicks||0}})))})}var Ir=C({__name:`App`,setup(e){return Fr(),c(()=>{for(let[e,t]of Object.entries(oe.value))document.body.style.setProperty(e,t.toString())}),(e,t)=>{let n=s(`RouterView`);return T(),d(v,null,[a(n),w(`v-if`,!0)],64)}}});function Lr(e,t,n){let r=e.push,i=e;return i.ssr=!1,i.hooks=t,i.dirty=!!i.dirty,i.use=e=>Pt(i,e),i.render=()=>n(i),i.invalidate=()=>{for(let e of i.entries.values())delete e._tags;i.dirty=!0,t.callHook(`entries:updated`,i)},i.push=(n,a)=>{let o=a?.onRendered?t.hook(`dom:rendered`,a.onRendered):void 0,s=r(n,a),c=e.entries.get(s._i);return c&&(c._o=n),i.dirty=!0,t.callHook(`entries:updated`,i),{_i:s._i,patch(e){s.patch(e),i.dirty=!0,t.callHook(`entries:updated`,i)},dispose(){o?.(),e.entries.has(s._i)&&(s.dispose(),i.invalidate())}}},t.hook(`entries:updated`,()=>{i.render()}),i}var Rr=/\s+/;function zr(e={}){return t=>Hr(t,e)}function Br(e){for(let t of e.entries.values())if(t._pending!==void 0)return!0;return!1}function Vr(e,t){let n={_d:t,_t:t.title,_e:new Map([[`htmlAttrs`,t.documentElement],[`bodyAttrs`,t.body]]),_p:{},_s:{},_l:new Map};for(let e of[...t.body.children,...t.head.children]){let t=e.tagName.toLowerCase();if(!We.has(t))continue;let r={innerHTML:e.innerHTML};for(let t of e.getAttributeNames())r[t]=e.getAttribute(t);let i=ut({tag:t,props:{}},r);i.key=e.getAttribute(`data-hid`)||void 0;let a=at(i)||ot(i),o=a,s=1;for(;n._e.has(o);)o=`${a}:${s++}`;n._e.set(o,e)}for(let t of e.entries.values())if(t._o!==void 0){let e=t._o;for(let t of[`bodyAttrs`,`htmlAttrs`]){let r=e[t]?.class;if(typeof r==`string`){let e=n._e.get(t);for(let i of r.split(Rr))i&&(n._p[`${t}:attr:class:${i}`]=()=>e.classList.remove(i))}}}return n}function Hr(e,t={}){let n=t.document||e.resolvedOptions.document,r=e._dom,i=!!r&&r._d!==n;if(!n||r&&!i&&!e.dirty&&!Br(e)||e._du)return!1;let a=n.defaultView;e._du=!0;let o=!1;try{let i=function(e,t,n){d._s[e]=!n&&f[e]||t,delete f[e]},s=function(e,t,n,r,a,o){let s=`${e}:event:${t}`,c=d._l.get(s);if(c&&c[0]===o&&c[1]===n&&c[2]===r){i(s,c[4]);return}c?.[4]();let l=`data-${t}`,u=(e=>r.call(a,e)),f=()=>{o.removeEventListener(n,u),a.getAttribute(l)===``&&a.removeAttribute(l),d._l.get(s)?.[3]===u&&d._l.delete(s)};o.addEventListener(n,u),d._l.set(s,[o,n,r,u,f]),a.setAttribute(l,``),i(s,f,!0)},c=function({id:e,$el:t,tag:n}){let r=n.tag.endsWith(`Attrs`);if(d._e.set(e,t),!r){let r=n.textContent;r!=null&&r!==``&&(r!==t.textContent&&(t.textContent=r),i(`${e}:text`,()=>{t.textContent===r&&(t.textContent=``)},!0));let a=n.innerHTML;a!=null&&a!==``&&(a!==t.innerHTML&&(t.innerHTML=a),i(`${e}:html`,()=>{t.innerHTML===a&&(t.innerHTML=``)},!0));let o=`${e}:el`;i(o,f[o]||(()=>{t?.remove(),d._e.delete(e)}))}for(let r in n.props){let o=n.props[r];if(r[0]===`o`&&r[1]===`n`&&typeof o==`function`){let i=r.slice(2);t?.dataset?.[`${r}fired`]&&o.call(t,new((a?.Event)||Event)(i)),s(e,r,i,o,t,n.tag===`bodyAttrs`&&a?a:t);continue}let c=`${e}:attr:${r}`;if(r===`class`&&o)for(let e of o){let n=`${c}:${e}`;i(n,f[n]||(()=>t.classList.remove(e))),t.classList.contains(e)||t.classList.add(e)}else if(r===`style`&&o)for(let[e,n]of o){let r=`${c}:${e}`;i(r,f[r]||(()=>t.style.removeProperty(e))),t.style.setProperty(e,n)}else o!==!1&&o!==null&&(t.getAttribute(r)!==o&&t.setAttribute(r,o===!0?``:String(o)),i(c,f[c]||(()=>t.removeAttribute(r))))}},l={shouldRender:!0,tags:[]};if(M(e,`dom:beforeRender`,l),!l.shouldRender)return!1;let u=r;if(u?._d!==n){if(u){for(let e in u._s)u._s[e]();for(let e in u._p)u._p[e]();u._s=u._p={},u._e.clear(),u._l.clear()}u=void 0}u?u._p=u._s:u=Vr(e,n),u._s={};let d=u,f=d._p,p=[],m={};e.dirty=!1;let h=Dt(e,t.tagWeight?{tagWeight:t.tagWeight}:void 0),g=[],_={};for(let e of h){let t=_[e._d]||0,r=(t?`${e._d}:${t}`:e._d)||e._h,a={tag:e,id:r,shouldRender:!0};if(e.tag===`meta`&&e._d&&it(e._d)&&(_[e._d]=t+1),g.push(a),e.tag===`title`){n.title=e.textContent,i(`title:`,()=>n.title=d._t);continue}a.$el=d._e.get(r),a.$el?c(a):We.has(e.tag)&&p.push(a)}for(let e of p)e.$el=n.createElement(e.tag.tag),c(e),(m[e.tag.tagPosition||`head`]??=n.createDocumentFragment()).appendChild(e.$el);m.head&&n.head.appendChild(m.head),m.bodyOpen&&n.body.insertBefore(m.bodyOpen,n.body.firstChild),m.bodyClose&&n.body.appendChild(m.bodyClose);for(let e in f)f[e]();e._dom=d,o=!0,M(e,`dom:rendered`,{renders:g})}catch(t){throw e.dirty=!0,t}finally{e._du=!1}return o&&(e.dirty||Br(e))&&Hr(e,t),o}var Ur=e=>typeof e.tagPriority==`number`?e.tagPriority:100+(Xe[e.tagPriority]||0);function Wr(e={}){e.document=e.document||(typeof window<`u`?document:void 0);let t=e.render||zr({document:e.document}),n=Lr(Ft(t,{document:e.document,propResolvers:e.propResolvers,_tagWeight:Ur,init:[]}),tt(e.hooks),t);return e.plugins?.forEach(e=>n.use(e)),e.init?.forEach(e=>e&&n.push(e)),n}function Gr(e={}){let t=zr(),n,r=0;return n=Wr({render:()=>{let e=++r;setTimeout(()=>{e===r&&t(n)},0)},...e}),n.install=At(n),n}var Kr=Object.assign({}),qr=Object.assign({}),Jr=Object.assign({}),Yr=[Object.values(Kr)[0],Object.values(qr)[0],Object.values(Jr)[0]].filter(Boolean);function Xr(e,t=``){let n=[`slidev-page`,t],r=e?.meta?.slide?.no;return r!=null&&n.push(`slidev-page-${r}`),n.filter(Boolean).join(` `)}async function Zr(){let{saveAs:t}=await k(async()=>{let{saveAs:t}=await import(`./modules/file-saver-BpWusTEB.js`).then(t=>e(t.t(),1));return{saveAs:t}},__vite__mapDeps([0,1]),import.meta.url);t(typeof A.download==`string`?A.download:A.exportFilename?`${A.exportFilename}.pdf`:`./slidev-exported.pdf`,`${A.title}.pdf`)}function Qr(e,t,n){return(e.instance?.$).provides[t]??n}var $r=/[\s,]+/;function ei(e,t){let n=t.map(e=>`${Ie}${e}`);e.classList.forEach(t=>{t.startsWith(`slidev-vclick-anim-`)&&!n.includes(t)&&e.classList.remove(t)}),n.forEach(t=>e.classList.add(t))}function ti(){return{install(e){e.directive(`click`,{name:`v-click`,mounted(e,t){let n=ri(e,t,t.value);n!=null&&(e.classList.toggle(Oe,!0),e.dataset.slidevClicksStart=String(n.start),Number.isFinite(n.end)&&(e.dataset.slidevClicksEnd=String(n.end)),e.watchStopHandle=c(()=>{let t=n.isActive.value,r=n.isCurrent.value,i=t&&!r;n.flagHide?(e.classList.toggle(De,t),e.classList.toggle(Pe,t)):e.classList.toggle(De,!t),ei(e,n.flagAnimations.value),e.classList.toggle(Me,r),e.classList.toggle(Le,i)}))},unmounted:ii}),e.directive(`after`,{name:`v-after`,mounted(e,t){let n=ri(e,t,`+0`);n!=null&&(e.classList.toggle(Oe,!0),e.watchStopHandle=c(()=>{let t=n.isActive.value,r=n.isCurrent.value,i=t&&!r;n.flagHide?(e.classList.toggle(De,t),e.classList.toggle(Pe,t)):e.classList.toggle(De,!t),ei(e,n.flagAnimations.value),e.classList.toggle(Me,r),e.classList.toggle(Le,i)}))},unmounted:ii}),e.directive(`click-hide`,{name:`v-click-hide`,mounted(e,t){let n=ri(e,t,t.value,!0);n!=null&&(e.classList.toggle(Oe,!0),e.watchStopHandle=c(()=>{let t=n.isActive.value,r=n.isCurrent.value,i=t&&!r;e.classList.toggle(De,t),e.classList.toggle(Pe,t),ei(e,n.flagAnimations.value),e.classList.toggle(Me,r),e.classList.toggle(Le,i)}))},unmounted:ii})}}}var ni=new Map;function ri(e,t,n,r=!1){let i=Qr(t,ke)?.value,a=Qr(t,Fe);if(!e||!i)return null;let o=r||t.modifiers.hide!==!1&&t.modifiers.hide!=null,s=Object.keys({...t.modifiers}).filter(e=>e!==`hide`),c=p(()=>{if(s.length>0)return s;let e=a?.clickAnimation||A.clickAnimation;return e?e.split($r).filter(Boolean):[]}),l=i.calculate(n);if(!l)return null;i.register(e,l);let u=p(()=>o?!l.isActive.value:l.isActive.value),d=p(()=>u.value?`shown`:Number.isFinite(l.end)?i.current<l.start?`before`:`after`:o?`after`:`before`),f={...l,isShown:u,visibilityState:d,flagHide:o,flagAnimations:c};return ni.set(e,f),f}function ii(e,t){e.classList.toggle(Oe,!1),(Qr(t,ke)?.value)?.unregister(e),e.watchStopHandle?.()}function ai(e=g(je,_())){let t=be(e),n=l([fe,O,ce,ae,ee,D.width,D.height],()=>{setTimeout(t.update,300)},{flush:`post`,immediate:!0});return{...t,stop:n}}function oi(e){return{info:_(pe(e)?.meta.slide??null),update:async()=>{}}}var si={};function ci(e){function t(e){return si[e]??=oi(e)}return{info:p({get(){return t(u(e)).info.value},set(n){t(u(e)).info.value=n}}),update:async(n,r)=>{let i=t(r??u(e)),a=await i.update(n);return a&&(i.info.value=a),a}}}function li(e){return()=>{}}function ui(e,t,n,r=!1){function i(t){return e?Qr(e,t):Ce(t)}let a=i(Ne),o=i(`$$slidev-fontmatter`)??{},s=i(Ae),c=p(()=>li(s.value)),u=i(`$$slidev-slide-scale`)??_(1),d=i(`$$slidev-slide-zoom`)??_(1),{left:f,top:m,stop:h}=ai(i(`$$slidev-slide-element`)??_()),{isPrintMode:g}=de(),v=[`slide`,`presenter`].includes(a.value)&&!g.value,y=e?`directive`:`prop`,b=br(),x;if(Array.isArray(t)?x=t:typeof t==`string`&&t.includes(`,`)?x=t.split(`,`).map(Number):t!=null&&(y=`frontmatter`,b=`${t}`,t=o?.dragPos?.[b],x=t?.split(`,`).map(Number)),y!==`frontmatter`&&!n)throw Error("[Slidev] Can not identify the source position of the v-drag element, please provide an explicit `id` prop.");let S=[h],C=!r&&t!=null&&!Number.isFinite(x?.[3]);x??=[NaN,NaN,0];let w=_(x[2]),T=_(x[0]+x[2]/2),E=_(r?0:x[4]??0),ee=p(()=>E.value*Math.PI/180),te=p(()=>Math.sin(ee.value)),ne=p(()=>Math.cos(ee.value)),re=_(),D=_({left:0,top:0,width:0,height:0}),ie=_(0);function ae(){if(!re.value)return;let e=re.value.getBoundingClientRect();D.value={left:e.left/d.value,top:e.top/d.value,width:e.width/d.value,height:e.height/d.value},ie.value=(D.value.width+D.value.height)/u.value/(Math.abs(te.value)+Math.abs(ne.value))-w.value}S.push(l(w,ae,{flush:`post`}));let oe=_(x[3]??0),O=C?p({get:()=>(C?ie.value:oe.value)||0,set:e=>!C&&(oe.value=e)}):oe,se=_(C?x[1]:x[1]+x[3]/2),ce=C?p({get:()=>se.value+O.value/2,set:e=>se.value=e-O.value/2}):se,ue=p(()=>Number.isFinite(T.value)?{position:`absolute`,zIndex:100,left:`${T.value-w.value/2}px`,top:`${ce.value-O.value/2}px`,width:`${w.value}px`,height:C?void 0:`${O.value}px`,transformOrigin:`center center`,transform:`rotate(${E.value}deg)`}:{position:`absolute`,zIndex:100});S.push(l([T,ce,w,O,E],([e,t,r,i,a])=>{let o=[e-r/2,t-i/2,r].map(Math.round).join();o+=C?y===`directive`?`,NaN`:`,_`:`,${Math.round(i)}`,Math.round(a)!==0&&(o+=`,${Math.round(a)}`),y===`directive`&&(o=`[${o}]`),c.value(b,o,y,n)}));let k={dragId:b,dataSource:y,markdownSource:n,isArrow:r,zoom:d,autoHeight:C,x0:T,y0:ce,width:w,height:O,rotate:E,container:re,containerStyle:ue,watchStopHandles:S,dragging:p(()=>le.value===k),mounted(){v&&(ae(),t||setTimeout(()=>{ae(),T.value=(D.value.left+D.value.width/2-f.value)/u.value,ce.value=(D.value.top-m.value)/u.value,w.value=D.value.width/u.value,O.value=D.value.height/u.value},100))},unmounted(){v&&k.stopDragging()},startDragging(){v&&(ae(),le.value=k)},stopDragging(){v&&le.value===k&&(le.value=null)}};return S.push(we(re,e=>{let t=document.querySelector(`#drag-control-container`);t&&e.target&&t.contains(e.target)||k.stopDragging()}),l(Te(),e=>{e||k.stopDragging()})),k}function di(){return{install(e){e.directive(`drag`,{name:`v-drag`,created(e,t,n){let r=ui(t,t.value,n.props?.markdownSource);n.props&&(n.props={...n.props},delete n.props.markdownSource),r.container.value=e,e.draggingState=r,e.dataset.dragId=r.dragId,r.watchStopHandles.push(l(r.containerStyle,t=>{for(let[n,r]of Object.entries(t))r&&(e.style[n]=r)},{immediate:!0})),e.addEventListener(`dblclick`,r.startDragging)},mounted(e){e.draggingState.mounted()},unmounted(e){let t=e.draggingState;t.unmounted(),e.removeEventListener(`dblclick`,t.startDragging),t.watchStopHandles.forEach(e=>e())}})}}}function fi(){return Math.floor(Math.random()*2**31)}var pi=class{constructor(e){this.seed=e}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}};function mi(e,t,n){if(e&&e.length){let[r,i]=t,a=Math.PI/180*n,o=Math.cos(a),s=Math.sin(a);for(let t of e){let[e,n]=t;t[0]=(e-r)*o-(n-i)*s+r,t[1]=(e-r)*s+(n-i)*o+i}}}function hi(e,t,n){let r=[];e.forEach(e=>r.push(...e)),mi(r,t,n)}function gi(e,t){return e[0]===t[0]&&e[1]===t[1]}function _i(e,t,n,r=1){let i=n,a=Math.max(t,.1),o=e[0]&&e[0][0]&&typeof e[0][0]==`number`?[e]:e,s=[0,0];if(i)for(let e of o)mi(e,s,i);let c=vi(o,a,r);if(i){for(let e of o)mi(e,s,-i);hi(c,s,-i)}return c}function vi(e,t,n){let r=[];for(let t of e){let e=[...t];gi(e[0],e[e.length-1])||e.push([e[0][0],e[0][1]]),e.length>2&&r.push(e)}let i=[];t=Math.max(t,.1);let a=[];for(let e of r)for(let t=0;t<e.length-1;t++){let n=e[t],r=e[t+1];if(n[1]!==r[1]){let e=Math.min(n[1],r[1]);a.push({ymin:e,ymax:Math.max(n[1],r[1]),x:e===n[1]?n[0]:r[0],islope:(r[0]-n[0])/(r[1]-n[1])})}}if(a.sort((e,t)=>e.ymin<t.ymin?-1:e.ymin>t.ymin?1:e.x<t.x?-1:e.x>t.x?1:e.ymax===t.ymax?0:(e.ymax-t.ymax)/Math.abs(e.ymax-t.ymax)),!a.length)return i;let o=[],s=a[0].ymin,c=0;for(;o.length||a.length;){if(a.length){let e=-1;for(let t=0;t<a.length&&!(a[t].ymin>s);t++)e=t;a.splice(0,e+1).forEach(e=>{o.push({s,edge:e})})}if(o=o.filter(e=>!(e.edge.ymax<=s)),o.sort((e,t)=>e.edge.x===t.edge.x?0:(e.edge.x-t.edge.x)/Math.abs(e.edge.x-t.edge.x)),(n!==1||c%t===0)&&o.length>1)for(let e=0;e<o.length;e+=2){let t=e+1;if(t>=o.length)break;let n=o[e].edge,r=o[t].edge;i.push([[Math.round(n.x),s],[Math.round(r.x),s]])}s+=n,o.forEach(e=>{e.edge.x=e.edge.x+n*e.edge.islope}),c++}return i}function yi(e,t){let n=t.hachureAngle+90,r=t.hachureGap;r<0&&(r=t.strokeWidth*4),r=Math.round(Math.max(r,.1));let i=1;return t.roughness>=1&&(t.randomizer?.next()||Math.random())>.7&&(i=r),_i(e,r,n,i||1)}var bi=class{constructor(e){this.helper=e}fillPolygons(e,t){return this._fillPolygons(e,t)}_fillPolygons(e,t){let n=yi(e,t);return{type:`fillSketch`,ops:this.renderLines(n,t)}}renderLines(e,t){let n=[];for(let r of e)n.push(...this.helper.doubleLineOps(r[0][0],r[0][1],r[1][0],r[1][1],t));return n}};function xi(e){let t=e[0],n=e[1];return Math.sqrt((t[0]-n[0])**2+(t[1]-n[1])**2)}var Si=class extends bi{fillPolygons(e,t){let n=t.hachureGap;n<0&&(n=t.strokeWidth*4),n=Math.max(n,.1);let r=yi(e,Object.assign({},t,{hachureGap:n})),i=Math.PI/180*t.hachureAngle,a=[],o=n*.5*Math.cos(i),s=n*.5*Math.sin(i);for(let[e,t]of r)xi([e,t])&&a.push([[e[0]-o,e[1]+s],[...t]],[[e[0]+o,e[1]-s],[...t]]);return{type:`fillSketch`,ops:this.renderLines(a,t)}}},Ci=class extends bi{fillPolygons(e,t){let n=this._fillPolygons(e,t),r=Object.assign({},t,{hachureAngle:t.hachureAngle+90}),i=this._fillPolygons(e,r);return n.ops=n.ops.concat(i.ops),n}},wi=class{constructor(e){this.helper=e}fillPolygons(e,t){t=Object.assign({},t,{hachureAngle:0});let n=yi(e,t);return this.dotsOnLines(n,t)}dotsOnLines(e,t){let n=[],r=t.hachureGap;r<0&&(r=t.strokeWidth*4),r=Math.max(r,.1);let i=t.fillWeight;i<0&&(i=t.strokeWidth/2);let a=r/4;for(let o of e){let e=xi(o),s=e/r,c=Math.ceil(s)-1,l=e-c*r,u=(o[0][0]+o[1][0])/2-r/4,d=Math.min(o[0][1],o[1][1]);for(let e=0;e<c;e++){let o=d+l+e*r,s=u-a+Math.random()*2*a,c=o-a+Math.random()*2*a,f=this.helper.ellipse(s,c,i,i,t);n.push(...f.ops)}}return{type:`fillSketch`,ops:n}}},Ti=class{constructor(e){this.helper=e}fillPolygons(e,t){let n=yi(e,t);return{type:`fillSketch`,ops:this.dashedLine(n,t)}}dashedLine(e,t){let n=t.dashOffset<0?t.hachureGap<0?t.strokeWidth*4:t.hachureGap:t.dashOffset,r=t.dashGap<0?t.hachureGap<0?t.strokeWidth*4:t.hachureGap:t.dashGap,i=[];return e.forEach(e=>{let a=xi(e),o=Math.floor(a/(n+r)),s=(a+r-o*(n+r))/2,c=e[0],l=e[1];c[0]>l[0]&&(c=e[1],l=e[0]);let u=Math.atan((l[1]-c[1])/(l[0]-c[0]));for(let e=0;e<o;e++){let a=e*(n+r),o=a+n,l=[c[0]+a*Math.cos(u)+s*Math.cos(u),c[1]+a*Math.sin(u)+s*Math.sin(u)],d=[c[0]+o*Math.cos(u)+s*Math.cos(u),c[1]+o*Math.sin(u)+s*Math.sin(u)];i.push(...this.helper.doubleLineOps(l[0],l[1],d[0],d[1],t))}}),i}},Ei=class{constructor(e){this.helper=e}fillPolygons(e,t){let n=t.hachureGap<0?t.strokeWidth*4:t.hachureGap,r=t.zigzagOffset<0?n:t.zigzagOffset;t=Object.assign({},t,{hachureGap:n+r});let i=yi(e,t);return{type:`fillSketch`,ops:this.zigzagLines(i,r,t)}}zigzagLines(e,t,n){let r=[];return e.forEach(e=>{let i=xi(e),a=Math.round(i/(2*t)),o=e[0],s=e[1];o[0]>s[0]&&(o=e[1],s=e[0]);let c=Math.atan((s[1]-o[1])/(s[0]-o[0]));for(let e=0;e<a;e++){let i=e*2*t,a=(e+1)*2*t,s=Math.sqrt(2*t**2),l=[o[0]+i*Math.cos(c),o[1]+i*Math.sin(c)],u=[o[0]+a*Math.cos(c),o[1]+a*Math.sin(c)],d=[l[0]+s*Math.cos(c+Math.PI/4),l[1]+s*Math.sin(c+Math.PI/4)];r.push(...this.helper.doubleLineOps(l[0],l[1],d[0],d[1],n),...this.helper.doubleLineOps(d[0],d[1],u[0],u[1],n))}}),r}},q={};function Di(e,t){let n=e.fillStyle||`hachure`;if(!q[n])switch(n){case`zigzag`:q[n]||(q[n]=new Si(t));break;case`cross-hatch`:q[n]||(q[n]=new Ci(t));break;case`dots`:q[n]||(q[n]=new wi(t));break;case`dashed`:q[n]||(q[n]=new Ti(t));break;case`zigzag-line`:q[n]||(q[n]=new Ei(t));break;default:n=`hachure`,q[n]||(q[n]=new bi(t))}return q[n]}var Oi=0,ki=1,Ai=2,ji={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function Mi(e){let t=[];for(;e!==``;)if(e.match(/^([ \t\r\n,]+)/))e=e.substr(RegExp.$1.length);else if(e.match(/^([aAcChHlLmMqQsStTvVzZ])/))t[t.length]={type:Oi,text:RegExp.$1},e=e.substr(RegExp.$1.length);else if(e.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))t[t.length]={type:ki,text:`${parseFloat(RegExp.$1)}`},e=e.substr(RegExp.$1.length);else return[];return t[t.length]={type:Ai,text:``},t}function Ni(e,t){return e.type===t}function Pi(e){let t=[],n=Mi(e),r=`BOD`,i=0,a=n[i];for(;!Ni(a,Ai);){let o=0,s=[];if(r===`BOD`){if(a.text===`M`||a.text===`m`)i++,o=ji[a.text],r=a.text;else return Pi(`M0,0`+e)}else Ni(a,ki)?o=ji[r]:(i++,o=ji[a.text],r=a.text);if(i+o<n.length){for(let e=i;e<i+o;e++){let t=n[e];if(Ni(t,ki))s[s.length]=+t.text;else throw Error(`Param not a number: `+r+`,`+t.text)}if(typeof ji[r]==`number`){let e={key:r,data:s};t.push(e),i+=o,a=n[i],r===`M`&&(r=`L`),r===`m`&&(r=`l`)}else throw Error(`Bad segment: `+r)}else throw Error(`Path data ended short`)}return t}function Fi(e){let t=0,n=0,r=0,i=0,a=[];for(let{key:o,data:s}of e)switch(o){case`M`:a.push({key:`M`,data:[...s]}),[t,n]=s,[r,i]=s;break;case`m`:t+=s[0],n+=s[1],a.push({key:`M`,data:[t,n]}),r=t,i=n;break;case`L`:a.push({key:`L`,data:[...s]}),[t,n]=s;break;case`l`:t+=s[0],n+=s[1],a.push({key:`L`,data:[t,n]});break;case`C`:a.push({key:`C`,data:[...s]}),t=s[4],n=s[5];break;case`c`:{let e=s.map((e,r)=>r%2?e+n:e+t);a.push({key:`C`,data:e}),t=e[4],n=e[5];break}case`Q`:a.push({key:`Q`,data:[...s]}),t=s[2],n=s[3];break;case`q`:{let e=s.map((e,r)=>r%2?e+n:e+t);a.push({key:`Q`,data:e}),t=e[2],n=e[3];break}case`A`:a.push({key:`A`,data:[...s]}),t=s[5],n=s[6];break;case`a`:t+=s[5],n+=s[6],a.push({key:`A`,data:[s[0],s[1],s[2],s[3],s[4],t,n]});break;case`H`:a.push({key:`H`,data:[...s]}),t=s[0];break;case`h`:t+=s[0],a.push({key:`H`,data:[t]});break;case`V`:a.push({key:`V`,data:[...s]}),n=s[0];break;case`v`:n+=s[0],a.push({key:`V`,data:[n]});break;case`S`:a.push({key:`S`,data:[...s]}),t=s[2],n=s[3];break;case`s`:{let e=s.map((e,r)=>r%2?e+n:e+t);a.push({key:`S`,data:e}),t=e[2],n=e[3];break}case`T`:a.push({key:`T`,data:[...s]}),t=s[0],n=s[1];break;case`t`:t+=s[0],n+=s[1],a.push({key:`T`,data:[t,n]});break;case`Z`:case`z`:a.push({key:`Z`,data:[]}),t=r,n=i}return a}function Ii(e){let t=[],n=``,r=0,i=0,a=0,o=0,s=0,c=0;for(let{key:l,data:u}of e){switch(l){case`M`:t.push({key:`M`,data:[...u]}),[r,i]=u,[a,o]=u;break;case`C`:t.push({key:`C`,data:[...u]}),r=u[4],i=u[5],s=u[2],c=u[3];break;case`L`:t.push({key:`L`,data:[...u]}),[r,i]=u;break;case`H`:r=u[0],t.push({key:`L`,data:[r,i]});break;case`V`:i=u[0],t.push({key:`L`,data:[r,i]});break;case`S`:{let e=0,a=0;n===`C`||n===`S`?(e=r+(r-s),a=i+(i-c)):(e=r,a=i),t.push({key:`C`,data:[e,a,...u]}),s=u[0],c=u[1],r=u[2],i=u[3];break}case`T`:{let[e,a]=u,o=0,l=0;n===`Q`||n===`T`?(o=r+(r-s),l=i+(i-c)):(o=r,l=i);let d=r+2*(o-r)/3,f=i+2*(l-i)/3,p=e+2*(o-e)/3,m=a+2*(l-a)/3;t.push({key:`C`,data:[d,f,p,m,e,a]}),s=o,c=l,r=e,i=a;break}case`Q`:{let[e,n,a,o]=u,l=r+2*(e-r)/3,d=i+2*(n-i)/3,f=a+2*(e-a)/3,p=o+2*(n-o)/3;t.push({key:`C`,data:[l,d,f,p,a,o]}),s=e,c=n,r=a,i=o;break}case`A`:{let e=Math.abs(u[0]),n=Math.abs(u[1]),a=u[2],o=u[3],s=u[4],c=u[5],l=u[6];e===0||n===0?(t.push({key:`C`,data:[r,i,c,l,c,l]}),r=c,i=l):(r!==c||i!==l)&&(zi(r,i,c,l,e,n,a,o,s).forEach(function(e){t.push({key:`C`,data:e})}),r=c,i=l);break}case`Z`:t.push({key:`Z`,data:[]}),r=a,i=o}n=l}return t}function Li(e){return Math.PI*e/180}function Ri(e,t,n){return[e*Math.cos(n)-t*Math.sin(n),e*Math.sin(n)+t*Math.cos(n)]}function zi(e,t,n,r,i,a,o,s,c,l){let u=Li(o),d=[],f=0,p=0,m=0,h=0;if(l)[f,p,m,h]=l;else{[e,t]=Ri(e,t,-u),[n,r]=Ri(n,r,-u);let o=(e-n)/2,l=(t-r)/2,d=o*o/(i*i)+l*l/(a*a);d>1&&(d=Math.sqrt(d),i=d*i,a=d*a);let g=s===c?-1:1,_=i*i,v=a*a,y=_*v-_*l*l-v*o*o,b=_*l*l+v*o*o,x=g*Math.sqrt(Math.abs(y/b));m=x*i*l/a+(e+n)/2,h=x*-a*o/i+(t+r)/2,f=Math.asin(parseFloat(((t-h)/a).toFixed(9))),p=Math.asin(parseFloat(((r-h)/a).toFixed(9))),e<m&&(f=Math.PI-f),n<m&&(p=Math.PI-p),f<0&&(f=Math.PI*2+f),p<0&&(p=Math.PI*2+p),c&&f>p&&(f-=Math.PI*2),!c&&p>f&&(p-=Math.PI*2)}let g=p-f;if(Math.abs(g)>Math.PI*120/180){let e=p,t=n,s=r;p=c&&p>f?f+Math.PI*120/180*1:f+Math.PI*120/180*-1,n=m+i*Math.cos(p),r=h+a*Math.sin(p),d=zi(n,r,t,s,i,a,o,0,c,[p,e,m,h])}g=p-f;let _=Math.cos(f),v=Math.sin(f),y=Math.cos(p),b=Math.sin(p),x=Math.tan(g/4),S=4/3*i*x,C=4/3*a*x,w=[e,t],T=[e+S*v,t-C*_],E=[n+S*b,r-C*y],ee=[n,r];if(T[0]=2*w[0]-T[0],T[1]=2*w[1]-T[1],l)return[T,E,ee].concat(d);{d=[T,E,ee].concat(d);let e=[];for(let t=0;t<d.length;t+=3){let n=Ri(d[t][0],d[t][1],u),r=Ri(d[t+1][0],d[t+1][1],u),i=Ri(d[t+2][0],d[t+2][1],u);e.push([n[0],n[1],r[0],r[1],i[0],i[1]])}return e}}var Bi={randOffset:$i,randOffsetWithRange:ea,ellipse:Gi,doubleLineOps:ta};function J(e,t,n,r,i){return{type:`path`,ops:X(e,t,n,r,i)}}function Vi(e,t,n){let r=(e||[]).length;if(r>2){let i=[];for(let t=0;t<r-1;t++)i.push(...X(e[t][0],e[t][1],e[t+1][0],e[t+1][1],n));return t&&i.push(...X(e[r-1][0],e[r-1][1],e[0][0],e[0][1],n)),{type:`path`,ops:i}}return r===2?J(e[0][0],e[0][1],e[1][0],e[1][1],n):{type:`path`,ops:[]}}function Hi(e,t){return Vi(e,!0,t)}function Ui(e,t,n,r,i){return Hi([[e,t],[e+n,t],[e+n,t+r],[e,t+r]],i)}function Wi(e,t){if(e.length){let n=typeof e[0][0]==`number`?[e]:e,r=oa(n[0],1*(1+t.roughness*.2),t),i=t.disableMultiStroke?[]:oa(n[0],1.5*(1+t.roughness*.22),na(t));for(let e=1;e<n.length;e++){let a=n[e];if(a.length){let e=oa(a,1*(1+t.roughness*.2),t),n=t.disableMultiStroke?[]:oa(a,1.5*(1+t.roughness*.22),na(t));for(let t of e)t.op!==`move`&&r.push(t);for(let e of n)e.op!==`move`&&i.push(e)}}return{type:`path`,ops:r.concat(i)}}return{type:`path`,ops:[]}}function Gi(e,t,n,r,i){return qi(e,t,i,Ki(n,r,i)).opset}function Ki(e,t,n){let r=Math.sqrt(Math.PI*2*Math.sqrt(((e/2)**2+(t/2)**2)/2)),i=Math.ceil(Math.max(n.curveStepCount,n.curveStepCount/Math.sqrt(200)*r)),a=Math.PI*2/i,o=Math.abs(e/2),s=Math.abs(t/2),c=1-n.curveFitting;return o+=Y(o*c,n),s+=Y(s*c,n),{increment:a,rx:o,ry:s}}function qi(e,t,n,r){let[i,a]=ca(r.increment,e,t,r.rx,r.ry,1,r.increment*ia(.1,ia(.4,1,n),n),n),o=sa(i,null,n);if(!n.disableMultiStroke&&n.roughness!==0){let[i]=ca(r.increment,e,t,r.rx,r.ry,1.5,0,n),a=sa(i,null,n);o=o.concat(a)}return{estimatedPoints:a,opset:{type:`path`,ops:o}}}function Ji(e,t,n,r,i,a,o,s,c){let l=e,u=t,d=Math.abs(n/2),f=Math.abs(r/2);d+=Y(d*.01,c),f+=Y(f*.01,c);let p=i,m=a;for(;p<0;)p+=Math.PI*2,m+=Math.PI*2;m-p>Math.PI*2&&(p=0,m=Math.PI*2);let h=Math.PI*2/c.curveStepCount,g=Math.min(h/2,(m-p)/2),_=la(g,l,u,d,f,p,m,1,c);if(!c.disableMultiStroke){let e=la(g,l,u,d,f,p,m,1.5,c);_.push(...e)}return o&&(s?_.push(...X(l,u,l+d*Math.cos(p),u+f*Math.sin(p),c),...X(l,u,l+d*Math.cos(m),u+f*Math.sin(m),c)):_.push({op:`lineTo`,data:[l,u]},{op:`lineTo`,data:[l+d*Math.cos(p),u+f*Math.sin(p)]})),{type:`path`,ops:_}}function Yi(e,t){let n=Ii(Fi(Pi(e))),r=[],i=[0,0],a=[0,0];for(let{key:e,data:o}of n)switch(e){case`M`:a=[o[0],o[1]],i=[o[0],o[1]];break;case`L`:r.push(...X(a[0],a[1],o[0],o[1],t)),a=[o[0],o[1]];break;case`C`:{let[e,n,i,s,c,l]=o;r.push(...ua(e,n,i,s,c,l,a,t)),a=[c,l];break}case`Z`:r.push(...X(a[0],a[1],i[0],i[1],t)),a=[i[0],i[1]]}return{type:`path`,ops:r}}function Xi(e,t){let n=[];for(let r of e)if(r.length){let e=t.maxRandomnessOffset||0,i=r.length;if(i>2){n.push({op:`move`,data:[r[0][0]+Y(e,t),r[0][1]+Y(e,t)]});for(let a=1;a<i;a++)n.push({op:`lineTo`,data:[r[a][0]+Y(e,t),r[a][1]+Y(e,t)]})}}return{type:`fillPath`,ops:n}}function Zi(e,t){return Di(t,Bi).fillPolygons(e,t)}function Qi(e,t,n,r,i,a,o){let s=e,c=t,l=Math.abs(n/2),u=Math.abs(r/2);l+=Y(l*.01,o),u+=Y(u*.01,o);let d=i,f=a;for(;d<0;)d+=Math.PI*2,f+=Math.PI*2;f-d>Math.PI*2&&(d=0,f=Math.PI*2);let p=(f-d)/o.curveStepCount,m=[];for(let e=d;e<=f;e+=p)m.push([s+l*Math.cos(e),c+u*Math.sin(e)]);return m.push([s+l*Math.cos(f),c+u*Math.sin(f)]),m.push([s,c]),Zi([m],o)}function $i(e,t){return Y(e,t)}function ea(e,t,n){return ia(e,t,n)}function ta(e,t,n,r,i){return X(e,t,n,r,i,!0)}function na(e){let t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function ra(e){return e.randomizer||=new pi(e.seed||0),e.randomizer.next()}function ia(e,t,n,r=1){return n.roughness*r*(ra(n)*(t-e)+e)}function Y(e,t,n=1){return ia(-e,e,t,n)}function X(e,t,n,r,i,a=!1){let o=a?i.disableMultiStrokeFill:i.disableMultiStroke,s=aa(e,t,n,r,i,!0,!1);if(o)return s;let c=aa(e,t,n,r,i,!0,!0);return s.concat(c)}function aa(e,t,n,r,i,a,o){let s=(e-n)**2+(t-r)**2,c=Math.sqrt(s),l=1;l=c<200?1:c>500?.4:-.0016668*c+1.233334;let u=i.maxRandomnessOffset||0;u*u*100>s&&(u=c/10);let d=u/2,f=.2+ra(i)*.2,p=i.bowing*i.maxRandomnessOffset*(r-t)/200,m=i.bowing*i.maxRandomnessOffset*(e-n)/200;p=Y(p,i,l),m=Y(m,i,l);let h=[],g=()=>Y(d,i,l),_=()=>Y(u,i,l),v=i.preserveVertices;return a&&(o?h.push({op:`move`,data:[e+(v?0:g()),t+(v?0:g())]}):h.push({op:`move`,data:[e+(v?0:Y(u,i,l)),t+(v?0:Y(u,i,l))]})),o?h.push({op:`bcurveTo`,data:[p+e+(n-e)*f+g(),m+t+(r-t)*f+g(),p+e+2*(n-e)*f+g(),m+t+2*(r-t)*f+g(),n+(v?0:g()),r+(v?0:g())]}):h.push({op:`bcurveTo`,data:[p+e+(n-e)*f+_(),m+t+(r-t)*f+_(),p+e+2*(n-e)*f+_(),m+t+2*(r-t)*f+_(),n+(v?0:_()),r+(v?0:_())]}),h}function oa(e,t,n){if(!e.length)return[];let r=[];r.push([e[0][0]+Y(t,n),e[0][1]+Y(t,n)]),r.push([e[0][0]+Y(t,n),e[0][1]+Y(t,n)]);for(let i=1;i<e.length;i++)r.push([e[i][0]+Y(t,n),e[i][1]+Y(t,n)]),i===e.length-1&&r.push([e[i][0]+Y(t,n),e[i][1]+Y(t,n)]);return sa(r,null,n)}function sa(e,t,n){let r=e.length,i=[];if(r>3){let a=[],o=1-n.curveTightness;i.push({op:`move`,data:[e[1][0],e[1][1]]});for(let t=1;t+2<r;t++){let n=e[t];a[0]=[n[0],n[1]],a[1]=[n[0]+(o*e[t+1][0]-o*e[t-1][0])/6,n[1]+(o*e[t+1][1]-o*e[t-1][1])/6],a[2]=[e[t+1][0]+(o*e[t][0]-o*e[t+2][0])/6,e[t+1][1]+(o*e[t][1]-o*e[t+2][1])/6],a[3]=[e[t+1][0],e[t+1][1]],i.push({op:`bcurveTo`,data:[a[1][0],a[1][1],a[2][0],a[2][1],a[3][0],a[3][1]]})}if(t&&t.length===2){let e=n.maxRandomnessOffset;i.push({op:`lineTo`,data:[t[0]+Y(e,n),t[1]+Y(e,n)]})}}else r===3?(i.push({op:`move`,data:[e[1][0],e[1][1]]}),i.push({op:`bcurveTo`,data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):r===2&&i.push(...aa(e[0][0],e[0][1],e[1][0],e[1][1],n,!0,!0));return i}function ca(e,t,n,r,i,a,o,s){let c=s.roughness===0,l=[],u=[];if(c){e/=4,u.push([t+r*Math.cos(-e),n+i*Math.sin(-e)]);for(let a=0;a<=Math.PI*2;a+=e){let e=[t+r*Math.cos(a),n+i*Math.sin(a)];l.push(e),u.push(e)}u.push([t+r*Math.cos(0),n+i*Math.sin(0)]),u.push([t+r*Math.cos(e),n+i*Math.sin(e)])}else{let c=Y(.5,s)-Math.PI/2;u.push([Y(a,s)+t+.9*r*Math.cos(c-e),Y(a,s)+n+.9*i*Math.sin(c-e)]);let d=Math.PI*2+c-.01;for(let o=c;o<d;o+=e){let e=[Y(a,s)+t+r*Math.cos(o),Y(a,s)+n+i*Math.sin(o)];l.push(e),u.push(e)}u.push([Y(a,s)+t+r*Math.cos(c+Math.PI*2+o*.5),Y(a,s)+n+i*Math.sin(c+Math.PI*2+o*.5)]),u.push([Y(a,s)+t+.98*r*Math.cos(c+o),Y(a,s)+n+.98*i*Math.sin(c+o)]),u.push([Y(a,s)+t+.9*r*Math.cos(c+o*.5),Y(a,s)+n+.9*i*Math.sin(c+o*.5)])}return[u,l]}function la(e,t,n,r,i,a,o,s,c){let l=a+Y(.1,c),u=[];u.push([Y(s,c)+t+.9*r*Math.cos(l-e),Y(s,c)+n+.9*i*Math.sin(l-e)]);for(let a=l;a<=o;a+=e)u.push([Y(s,c)+t+r*Math.cos(a),Y(s,c)+n+i*Math.sin(a)]);return u.push([t+r*Math.cos(o),n+i*Math.sin(o)]),u.push([t+r*Math.cos(o),n+i*Math.sin(o)]),sa(u,null,c)}function ua(e,t,n,r,i,a,o,s){let c=[],l=[s.maxRandomnessOffset||1,(s.maxRandomnessOffset||1)+.3],u=[0,0],d=s.disableMultiStroke?1:2,f=s.preserveVertices;for(let p=0;p<d;p++)p===0?c.push({op:`move`,data:[o[0],o[1]]}):c.push({op:`move`,data:[o[0]+(f?0:Y(l[0],s)),o[1]+(f?0:Y(l[0],s))]}),u=f?[i,a]:[i+Y(l[p],s),a+Y(l[p],s)],c.push({op:`bcurveTo`,data:[e+Y(l[p],s),t+Y(l[p],s),n+Y(l[p],s),r+Y(l[p],s),u[0],u[1]]});return c}function da(e){return[...e]}function fa(e,t=0){let n=e.length;if(n<3)throw Error(`A curve must have at least three points.`);let r=[];if(n===3)r.push(da(e[0]),da(e[1]),da(e[2]),da(e[2]));else{let n=[];n.push(e[0],e[0]);for(let t=1;t<e.length;t++)n.push(e[t]),t===e.length-1&&n.push(e[t]);let i=[],a=1-t;r.push(da(n[0]));for(let e=1;e+2<n.length;e++){let t=n[e];i[0]=[t[0],t[1]],i[1]=[t[0]+(a*n[e+1][0]-a*n[e-1][0])/6,t[1]+(a*n[e+1][1]-a*n[e-1][1])/6],i[2]=[n[e+1][0]+(a*n[e][0]-a*n[e+2][0])/6,n[e+1][1]+(a*n[e][1]-a*n[e+2][1])/6],i[3]=[n[e+1][0],n[e+1][1]],r.push(i[1],i[2],i[3])}}return r}function pa(e,t){return Math.sqrt(ma(e,t))}function ma(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2}function ha(e,t,n){let r=ma(t,n);if(r===0)return ma(e,t);let i=((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/r;return i=Math.max(0,Math.min(1,i)),ma(e,ga(t,n,i))}function ga(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function _a(e,t){let n=e[t+0],r=e[t+1],i=e[t+2],a=e[t+3],o=3*r[0]-2*n[0]-a[0];o*=o;let s=3*r[1]-2*n[1]-a[1];s*=s;let c=3*i[0]-2*a[0]-n[0];c*=c;let l=3*i[1]-2*a[1]-n[1];return l*=l,o<c&&(o=c),s<l&&(s=l),o+s}function va(e,t,n,r){let i=r||[];if(_a(e,t)<n){let n=e[t+0];i.length?pa(i[i.length-1],n)>1&&i.push(n):i.push(n),i.push(e[t+3])}else{let r=.5,a=e[t+0],o=e[t+1],s=e[t+2],c=e[t+3],l=ga(a,o,r),u=ga(o,s,r),d=ga(s,c,r),f=ga(l,u,r),p=ga(u,d,r),m=ga(f,p,r);va([a,l,f,m],0,n,i),va([m,p,d,c],0,n,i)}return i}function ya(e,t){return ba(e,0,e.length,t)}function ba(e,t,n,r,i){let a=i||[],o=e[t],s=e[n-1],c=0,l=1;for(let r=t+1;r<n-1;++r){let t=ha(e[r],o,s);t>c&&(c=t,l=r)}return Math.sqrt(c)>r?(ba(e,t,l+1,r,a),ba(e,l,n,r,a)):(a.length||a.push(o),a.push(s)),a}function xa(e,t=.15,n){let r=[],i=(e.length-1)/3;for(let n=0;n<i;n++)va(e,n*3,t,r);return n&&n>0?ba(r,0,r.length,n):r}function Sa(e,t,n){let r=Ii(Fi(Pi(e))),i=[],a=[],o=[0,0],s=[],c=()=>{s.length>=4&&a.push(...xa(s,t)),s=[]},l=()=>{c(),a.length&&(i.push(a),a=[])};for(let{key:e,data:t}of r)switch(e){case`M`:l(),o=[t[0],t[1]],a.push(o);break;case`L`:c(),a.push([t[0],t[1]]);break;case`C`:if(!s.length){let e=a.length?a[a.length-1]:o;s.push([e[0],e[1]])}s.push([t[0],t[1]]),s.push([t[2],t[3]]),s.push([t[4],t[5]]);break;case`Z`:c(),a.push([o[0],o[1]])}if(l(),!n)return i;let u=[];for(let e of i){let t=ya(e,n);t.length&&u.push(t)}return u}var Z=`none`,Ca=class{constructor(e){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:`#000`,strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:`hachure`,fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=e||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return fi()}_o(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}_d(e,t,n){return{shape:e,sets:t||[],options:n||this.defaultOptions}}line(e,t,n,r,i){let a=this._o(i);return this._d(`line`,[J(e,t,n,r,a)],a)}rectangle(e,t,n,r,i){let a=this._o(i),o=[],s=Ui(e,t,n,r,a);if(a.fill){let i=[[e,t],[e+n,t],[e+n,t+r],[e,t+r]];a.fillStyle===`solid`?o.push(Xi([i],a)):o.push(Zi([i],a))}return a.stroke!==Z&&o.push(s),this._d(`rectangle`,o,a)}ellipse(e,t,n,r,i){let a=this._o(i),o=[],s=Ki(n,r,a),c=qi(e,t,a,s);if(a.fill){if(a.fillStyle===`solid`){let n=qi(e,t,a,s).opset;n.type=`fillPath`,o.push(n)}else o.push(Zi([c.estimatedPoints],a))}return a.stroke!==Z&&o.push(c.opset),this._d(`ellipse`,o,a)}circle(e,t,n,r){let i=this.ellipse(e,t,n,n,r);return i.shape=`circle`,i}linearPath(e,t){let n=this._o(t);return this._d(`linearPath`,[Vi(e,!1,n)],n)}arc(e,t,n,r,i,a,o=!1,s){let c=this._o(s),l=[],u=Ji(e,t,n,r,i,a,o,!0,c);if(o&&c.fill){if(c.fillStyle===`solid`){let o=Object.assign({},c);o.disableMultiStroke=!0;let s=Ji(e,t,n,r,i,a,!0,!1,o);s.type=`fillPath`,l.push(s)}else l.push(Qi(e,t,n,r,i,a,c))}return c.stroke!==Z&&l.push(u),this._d(`arc`,l,c)}curve(e,t){let n=this._o(t),r=[],i=Wi(e,n);if(n.fill&&n.fill!==Z){if(n.fillStyle===`solid`){let t=Wi(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));r.push({type:`fillPath`,ops:this._mergedShape(t.ops)})}else{let t=[],i=e;if(i.length){let e=typeof i[0][0]==`number`?[i]:i;for(let r of e)r.length<3?t.push(...r):r.length===3?t.push(...xa(fa([r[0],r[0],r[1],r[2]]),10,(1+n.roughness)/2)):t.push(...xa(fa(r),10,(1+n.roughness)/2))}t.length&&r.push(Zi([t],n))}}return n.stroke!==Z&&r.push(i),this._d(`curve`,r,n)}polygon(e,t){let n=this._o(t),r=[],i=Vi(e,!0,n);return n.fill&&(n.fillStyle===`solid`?r.push(Xi([e],n)):r.push(Zi([e],n))),n.stroke!==Z&&r.push(i),this._d(`polygon`,r,n)}path(e,t){let n=this._o(t),r=[];if(!e)return this._d(`path`,r,n);e=(e||``).replace(/\n/g,` `).replace(/(-\s)/g,`-`).replace(`/(ss)/g`,` `);let i=n.fill&&n.fill!==`transparent`&&n.fill!==Z,a=n.stroke!==Z,o=!!(n.simplification&&n.simplification<1),s=o?4-4*(n.simplification||1):(1+n.roughness)/2,c=Sa(e,1,s),l=Yi(e,n);if(i){if(n.fillStyle===`solid`){if(c.length===1){let t=Yi(e,Object.assign(Object.assign({},n),{disableMultiStroke:!0,roughness:n.roughness?n.roughness+n.fillShapeRoughnessGain:0}));r.push({type:`fillPath`,ops:this._mergedShape(t.ops)})}else r.push(Xi(c,n))}else r.push(Zi(c,n))}return a&&(o?c.forEach(e=>{r.push(Vi(e,!1,n))}):r.push(l)),this._d(`path`,r,n)}opsToPath(e,t){let n=``;for(let r of e.ops){let e=typeof t==`number`&&t>=0?r.data.map(e=>+e.toFixed(t)):r.data;switch(r.op){case`move`:n+=`M${e[0]} ${e[1]} `;break;case`bcurveTo`:n+=`C${e[0]} ${e[1]}, ${e[2]} ${e[3]}, ${e[4]} ${e[5]} `;break;case`lineTo`:n+=`L${e[0]} ${e[1]} `}}return n.trim()}toPaths(e){let t=e.sets||[],n=e.options||this.defaultOptions,r=[];for(let e of t){let t=null;switch(e.type){case`path`:t={d:this.opsToPath(e),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:Z};break;case`fillPath`:t={d:this.opsToPath(e),stroke:Z,strokeWidth:0,fill:n.fill||Z};break;case`fillSketch`:t=this.fillSketch(e,n)}t&&r.push(t)}return r}fillSketch(e,t){let n=t.fillWeight;return n<0&&(n=t.strokeWidth/2),{d:this.opsToPath(e),stroke:t.fill||Z,strokeWidth:n,fill:Z}}_mergedShape(e){return e.filter((e,t)=>t===0||e.op!==`move`)}},wa=`http://www.w3.org/2000/svg`,Ta=800,Ea=null;function Da(){return Ea||=new Ca().defaultOptions,Ea}function Oa(e,t,n){return{...Da(),maxRandomnessOffset:2,roughness:e===`highlight`?3:1.5,bowing:1,stroke:`#000`,strokeWidth:1.5,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:`hachure`,fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,disableMultiStroke:e!==`double`,disableMultiStrokeFill:!1,seed:t,...n}}function ka(e){let t=e.padding;if(t||t===0){if(typeof t==`number`)return[t,t,t,t];if(Array.isArray(t)){let e=t;if(e.length)switch(e.length){case 4:return[...e];case 1:return[e[0],e[0],e[0],e[0]];case 2:return[...e,...e];case 3:return[...e,e[1]];default:return[e[0],e[1],e[2],e[3]]}}}return[5,5,5,5]}function Aa(e,t,n,r,i,a){let o=[],s=n.strokeWidth||2,c=ka(n),l=n.animate===void 0||!!n.animate,u=n.iterations||2,d=+!!n.rtl,f=Oa(`single`,a,n);switch(n.type){case`underline`:{let e=t.y+t.h+c[2];for(let n=d;n<u+d;n++)n%2?o.push(J(t.x+t.w,e,t.x,e,f)):o.push(J(t.x,e,t.x+t.w,e,f));break}case`strike-through`:{let e=t.y+t.h/2;for(let n=d;n<u+d;n++)n%2?o.push(J(t.x+t.w,e,t.x,e,f)):o.push(J(t.x,e,t.x+t.w,e,f));break}case`box`:{let e=t.x-c[3],n=t.y-c[0],r=t.w+(c[1]+c[3]),i=t.h+(c[0]+c[2]);for(let t=0;t<u;t++)o.push(Ui(e,n,r,i,f));break}case`bracket`:{let e=Array.isArray(n.brackets)?n.brackets:n.brackets?[n.brackets]:[`right`],r=t.x-c[3]*2,i=t.x+t.w+c[1]*2,a=t.y-c[0]*2,s=t.y+t.h+c[2]*2;for(let n of e){let e;switch(n){case`bottom`:e=[[r,t.y+t.h],[r,s],[i,s],[i,t.y+t.h]];break;case`top`:e=[[r,t.y],[r,a],[i,a],[i,t.y]];break;case`left`:e=[[t.x,a],[r,a],[r,s],[t.x,s]];break;case`right`:e=[[t.x+t.w,a],[i,a],[i,s],[t.x+t.w,s]]}e&&o.push(Vi(e,!1,f))}break}case`crossed-off`:{let e=t.x,n=t.y,r=e+t.w,i=n+t.h;for(let t=d;t<u+d;t++)t%2?o.push(J(r,i,e,n,f)):o.push(J(e,n,r,i,f));for(let t=d;t<u+d;t++)t%2?o.push(J(e,i,r,n,f)):o.push(J(r,n,e,i,f));break}case`circle`:{let e=Oa(`double`,a,n),r=t.w+(c[1]+c[3]),i=t.h+(c[0]+c[2]),s=t.x-c[3]+r/2,l=t.y-c[0]+i/2,d=Math.floor(u/2),p=u-d*2;for(let t=0;t<d;t++)o.push(Gi(s,l,r,i,e));for(let e=0;e<p;e++)o.push(Gi(s,l,r,i,f));break}case`highlight`:{let e=Oa(`highlight`,a,n);s=t.h*.95;let r=t.y+t.h/2;for(let n=d;n<u+d;n++)n%2?o.push(J(t.x+t.w,r,t.x,r,e)):o.push(J(t.x,r,t.x+t.w,r,e));break}}if(o.length){let t=Ma(o),a=[],c=[],u=0,d=(e,t,n)=>e.setAttribute(t,n);for(let r of t){let t=document.createElementNS(wa,`path`);if(d(t,`d`,r),d(t,`fill`,`none`),d(t,`stroke`,n.color||`currentColor`),d(t,`stroke-width`,`${s}`),n.opacity!==void 0&&d(t,`style`,`opacity:${n.opacity}`),l){let e=t.getTotalLength();a.push(e),u+=e}e.appendChild(t),c.push(t)}if(l){let e=0;for(let t=0;t<c.length;t++){let n=c[t],o=a[t],s=u?o/u*i:0,l=r+e,d=n.style;d.strokeDashoffset=`${o}`,d.strokeDasharray=`${o}`,d.animation=`rough-notation-dash ${s}ms ease-out ${l}ms forwards`,e+=s}return ja(i+r)}}return ja(0)}function ja(e){return new Promise(t=>setTimeout(t,e))}function Ma(e){let t=[];for(let n of e){let e=``;for(let r of n.ops){let n=r.data;switch(r.op){case`move`:e.trim()&&t.push(e.trim()),e=`M${n[0]} ${n[1]} `;break;case`bcurveTo`:e+=`C${n[0]} ${n[1]}, ${n[2]} ${n[3]}, ${n[4]} ${n[5]} `;break;case`lineTo`:e+=`L${n[0]} ${n[1]} `}}e.trim()&&t.push(e.trim())}return t}function Na(){if(!window.__rno_kf_s){let e=window.__rno_kf_s=document.createElement(`style`);e.textContent=`@keyframes rough-notation-dash { to { stroke-dashoffset: 0; } }`,document.head.appendChild(e)}}var Pa=Object.defineProperty,Fa=(e,t,n)=>t in e?Pa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Q=(e,t,n)=>(Fa(e,typeof t==`symbol`?t:t+``,n),n),Ia=class{constructor(e,t){Q(this,`_state`,`unattached`),Q(this,`_config`),Q(this,`_resizing`,!1),Q(this,`_ro`),Q(this,`_seed`,fi()),Q(this,`_e`),Q(this,`_svg`),Q(this,`_lastSizes`,[]),Q(this,`_animationDelay`,0),Q(this,`_resizeListener`,()=>{this._resizing||(this._resizing=!0,setTimeout(()=>{this._resizing=!1,this._state===`showing`&&this.haveRectsChanged()&&this.show()},400))}),Q(this,`pendingRefresh`),this._e=e,this._config=JSON.parse(JSON.stringify(t)),this.attach()}getConfig(e){return this._config[e]}setConfig(e,t){this._config[e]!==t&&(this._config[e]=t,this.refresh())}get animate(){return this._config.animate}set animate(e){this._config.animate=e}get animationDuration(){return this._config.animationDuration}set animationDuration(e){this._config.animationDuration=e}get iterations(){return this._config.iterations}set iterations(e){this._config.iterations=e}get color(){return this._config.color}set color(e){this._config.color!==e&&(this._config.color=e,this.refresh())}get class(){return this._config.class}set class(e){this._config.class!==e&&(this._config.class=e,this._svg&&this._svg.setAttribute(`class`,[`rough-annotation`,this._config.class||``].filter(Boolean).join(` `)))}get strokeWidth(){return this._config.strokeWidth}set strokeWidth(e){this._config.strokeWidth!==e&&(this._config.strokeWidth=e,this.refresh())}get padding(){return this._config.padding}set padding(e){this._config.padding!==e&&(this._config.padding=e,this.refresh())}attach(){if(this._state===`unattached`&&this._e.parentElement){Na();let e=this._svg=document.createElementNS(wa,`svg`);e.setAttribute(`class`,[`rough-annotation`,this._config.class||``].filter(Boolean).join(` `));let t=e.style;t.position=`absolute`,t.top=`0`,t.left=`0`,t.overflow=`visible`,t.pointerEvents=`none`,t.width=`100px`,t.height=`100px`;let n=this._config.type===`highlight`;if(this._e.insertAdjacentElement(n?`beforebegin`:`afterend`,e),this._state=`not-showing`,n){let e=window.getComputedStyle(this._e).position;(!e||e===`static`)&&(this._e.style.position=`relative`)}this.attachListeners()}}detachListeners(){window.removeEventListener(`resize`,this._resizeListener),this._ro&&this._ro.unobserve(this._e)}attachListeners(){this.detachListeners(),window.addEventListener(`resize`,this._resizeListener,{passive:!0}),!this._ro&&`ResizeObserver`in window&&(this._ro=new window.ResizeObserver(e=>{for(let t of e)t.contentRect&&this._resizeListener()})),this._ro&&this._ro.observe(this._e)}haveRectsChanged(){if(this._lastSizes.length){let e=this.rects();if(e.length===this._lastSizes.length){for(let t=0;t<e.length;t++)if(!this.isSameRect(e[t],this._lastSizes[t]))return!0}else return!0}return!1}isSameRect(e,t){let n=(e,t)=>Math.round(e)===Math.round(t);return n(e.x,t.x)&&n(e.y,t.y)&&n(e.w,t.w)&&n(e.h,t.h)}isShowing(){return this._state!==`not-showing`}refresh(){this.isShowing()&&!this.pendingRefresh&&(this.pendingRefresh=Promise.resolve().then(()=>{this.isShowing()&&this.show(),delete this.pendingRefresh}))}async show(){switch(this._state){case`unattached`:break;case`showing`:this.hide(),this._svg&&await this.render(this._svg,!0);break;case`not-showing`:this.attach(),this._svg&&await this.render(this._svg,!1)}}hide(){if(this._svg)for(;this._svg.lastChild;)this._svg.removeChild(this._svg.lastChild);this._state=`not-showing`}remove(){this._svg&&this._svg.parentElement&&this._svg.parentElement.removeChild(this._svg),this._svg=void 0,this._state=`unattached`,this.detachListeners()}async render(e,t){let n=this._config;t&&(n=JSON.parse(JSON.stringify(this._config)),n.animate=!1);let r=this.rects(),i=0;r.forEach(e=>i+=e.w);let a=n.animationDuration||Ta,o=0,s=[];for(let t=0;t<r.length;t++){let c=a*(r[t].w/i);s.push(Aa(e,r[t],n,o+this._animationDelay+(this._config.delay||0),c,this._seed)),o+=c}return this._lastSizes=r,this._state=`showing`,await Promise.all(s)}rects(){let e=[];if(this._svg){if(this._config.multiline){let t=this._e.getClientRects();for(let n=0;n<t.length;n++)e.push(this.svgRect(this._svg,t[n]))}else e.push(this.svgRect(this._svg,this._e.getBoundingClientRect()))}return e}svgRect(e,t){let n=e.getBoundingClientRect(),r=t;return{x:(r.x||r.left)-(n.x||n.left),y:(r.y||r.top)-(n.y||n.top),w:r.width,h:r.height}}};function La(e,t){return new Ia(e,t)}function $(e,t){return e.class=[e.class,t].filter(Boolean).join(` `),e}var Ra={box:e=>Object.assign(e,{type:`box`}),circle:e=>Object.assign(e,{type:`circle`}),underline:e=>Object.assign(e,{type:`underline`}),highlight:e=>Object.assign(e,{type:`highlight`}),"strike-through":e=>Object.assign(e,{type:`strike-through`}),"crossed-off":e=>Object.assign(e,{type:`crossed-off`}),bracket:e=>Object.assign(e,{type:`bracket`}),strike:e=>Object.assign(e,{type:`strike-through`}),cross:e=>Object.assign(e,{type:`crossed-off`}),crossed:e=>Object.assign(e,{type:`crossed-off`}),linethrough:e=>Object.assign(e,{type:`strike-through`}),"line-through":e=>Object.assign(e,{type:`strike-through`}),black:e=>$(e,`text-black`),blue:e=>$(e,`text-blue`),cyan:e=>$(e,`text-cyan`),gray:e=>$(e,`text-gray`),green:e=>$(e,`text-green`),indigo:e=>$(e,`text-indigo`),lime:e=>$(e,`text-lime`),orange:e=>$(e,`text-orange`),pink:e=>$(e,`text-pink`),purple:e=>$(e,`text-purple`),red:e=>$(e,`text-red`),teal:e=>$(e,`text-teal`),white:e=>$(e,`text-white`),yellow:e=>$(e,`text-yellow`)},za=[[/^delay-?(\d+)?$/,(e,t,n)=>(t.delay=(e[1]?Number.parseInt(e[1]):n)||300,t)],[/^(?:op|opacity)-?(\d+)?$/,(e,t,n)=>(t.opacity=((e[1]?Number.parseInt(e[1]):n)||100)/100,t)]];function Ba(){return{install(e){e.directive(`mark`,{name:`v-mark`,mounted:(e,t)=>{let{isPrintMode:n}=de(),r=p(()=>{let e=typeof t.value==`object`&&!Array.isArray(t.value)?{...t.value}:{at:t.value},r={at:e.at},i=Object.entries(t.modifiers).filter(([e,t])=>{if(Ra[e])return r=Ra[e](r,t),!1;for(let[n,i]of za){let a=e.match(n);if(a)return r=i(a,r,t),!1}return!0});i.length&&console.warn(`[Slidev] Invalid modifiers for v-mark:`,i);let a={...r,...e};return a.type||=`underline`,n.value&&(a.animationDuration=1),a}),i=La(e,r.value),a=ri(e,t,r.value.at);if(!a){i.show();return}e.watchStopHandle=c(()=>{let e;r.value.class&&(i.class=r.value.class),r.value.color&&(i.color=r.value.color);let t=r.value.at;e=t===!0||t!==!1&&a.isActive.value,e!=null&&(e?i.show():i.hide())})},unmounted:e=>{e.watchStopHandle?.()}})}}}function Va(){return{install(e){let t=Se();e.directive(`motion`,{name:`v-motion`,mounted(e,n,r,i){let a=Qr(n,ke),o=Qr(n,Ae),s=Qr(n,Ne),{currentPage:c,clicks:u,isPrintMode:d}=de(),f=r.props={...r.props},p={...f.initial,...f.variants?.[`slidev-initial`]},m={...f.enter,...f.variants?.[`slidev-enter`]},h={...f.leave,...f.variants?.[`slidev-leave`]};delete f.initial,delete f.enter,delete f.leave;let g=`${br()}-`,_=[];for(let e of Object.keys(f))if(e.startsWith(`click-`)){let t=e.slice(6),n=t.includes(`-`)?t.split(`-`).map(Number):+t,r=g+t;_.push({id:r,at:n,variant:{...f[e]},info:a?.value.calculate(n)}),delete f[e]}_.sort((e,t)=>(Array.isArray(e.at)?e.at[0]:e.at)-(Array.isArray(t.at)?t.at[0]:t.at)),t.created(e,n,r,i),t.mounted(e,n,r,i);let v=e.motionInstance;v.clickIds=_.map(e=>e.id),v.set(p),v.watchStopHandle=l([o,c,u].filter(Boolean),()=>{let t=ni.get(e)?.visibilityState.value??`shown`;if(!a?.value||![`slide`,`presenter`].includes(s?.value??``)){let e={...p,...m};for(let{variant:t}of _)Object.assign(e,t);v.set(e)}else if(d.value||o?.value===c.value){if(t===`shown`){let e={...p,...m};for(let{variant:t,info:n}of _)(!n||n.isActive.value)&&Object.assign(e,t);d.value?v.set(e):v.apply(e)}else v.apply(t===`before`?p:h)}else v.apply((o?.value??-1)>c.value?p:h)},{immediate:!0})},unmounted(e){e.motionInstance.watchStopHandle()}})}}}var Ha=Object.assign({}),Ua=Object.assign({}),Wa=Object.assign({}),Ga=[Object.values(Ha)[0],Object.values(Ua)[0],Object.values(Wa)[0]].filter(Boolean);function Ka(){let e=[];function t(e){if(!A.remote||A.remote===e.query.password)return!0;if(A.remote&&e.query.password===void 0){let e=prompt(`Enter password`);if(A.remote===e)return!0}return e.params.no?{path:`/${e.params.no}`}:{path:``}}return e.push({name:`entry`,path:`/entry`,component:()=>k(()=>import(`./slidev/entry-DSOswi5I.js`),__vite__mapDeps([2,3,1,4,5,6]),import.meta.url),beforeEnter:t},{name:`overview`,path:`/overview`,component:()=>k(()=>import(`./slidev/overview-C0t3M0qP.js`),__vite__mapDeps([7,3,1,4,8,5,9,10,11,12,13,14,15,16,17,18,19,20,21]),import.meta.url),beforeEnter:t},{name:`notes`,path:`/notes`,component:()=>k(()=>import(`./slidev/notes-DsoPOK4i.js`),__vite__mapDeps([22,3,1,4,8,5,9,10,11,23,12,13,24]),import.meta.url),beforeEnter:t},{name:`notes-edit`,path:`/notes-edit`,component:()=>k(()=>import(`./slidev/notes-edit-i_aqIsEu.js`),__vite__mapDeps([25,3,1,4,8,5,9,10,11,23]),import.meta.url),beforeEnter:t},{name:`presenter`,path:`/presenter/:no`,component:()=>k(()=>import(`./slidev/presenter-DgDN81hj.js`),__vite__mapDeps([26,3,1,4,8,5,9,10,18,27,11,28,29,12,13,24,15,16,17,19,20,30,31,32]),import.meta.url),beforeEnter:t},{path:`/presenter`,redirect:{path:`/presenter/1`}}),e.push({name:`play`,path:`/:no`,component:()=>k(()=>import(`./slidev/play-7plMx0AG.js`),__vite__mapDeps([33,3,1,4,8,5,9,10,18,23,14,15,16,17,19,30,11,28,31,34]),import.meta.url)},{path:``,redirect:{path:`/1`}},{path:`/:pathMatch(.*)*`,name:`NotFound`,component:()=>k(()=>import(`./slidev/404-Cskqm_iE.js`),__vite__mapDeps([35,3,1,4,8,5,9,10,36]),import.meta.url)}),Ga.reduce((e,t)=>t(e),e)}async function qa(e){function t(){document.documentElement.style.setProperty(`--vh`,`${window.innerHeight*.01}px`)}t(),window.addEventListener(`resize`,t);let n=_e({history:ve(`./`),routes:Ka()});e.use(n),e.use(Gr()),e.use(ti()),e.use(Ba()),e.use(di()),e.use(Va()),e.use(S,{container:`#twoslash-container`});let r={app:e,router:n};for(let e of Yr)await e(r)}async function Ja(){let e=b(Ir);await qa(e),e.mount(`#app`)}Ja();export{Xr as a,wr as c,Ht as d,Ut as f,Zr as i,Er as l,Mt as m,oi as n,Pr as o,Wt as p,ai as r,Dr as s,ci as t,br as u};
transformer-v2/class/assets/index-yJq2pcYZ.css ADDED
The diff for this file is too large to render. See raw diff
 
transformer-v2/class/assets/interactive-BWtflKDO.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{H as e,S as t,_ as n,b as r,bt as i,vt as a,w as o,x as s,xt as c,y as l,z as u}from"./modules/shiki-BFOesOFp.js";import{t as d}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as f}from"./slidev/context-ChHKJoK9.js";import{t as p}from"./DeckFooter-RCcsEW0N.js";var m={class:`dl-widget__stage`},h={class:`dl-widget__controls`},g={class:`dl-widget__readout`},_=d(o({__name:`WidgetFrame`,props:{maxWidth:{default:`100%`},controlsFirst:{type:Boolean}},setup(t){let{$slidev:o,$nav:s,$clicksContext:c,$clicks:l,$page:d,$renderContext:p,$frontmatter:_}=f(),v=t;return(t,o)=>(u(),r(`div`,{class:a([`dl-widget`,{"is-controls-first":v.controlsFirst}]),style:i({maxWidth:v.maxWidth})},[n(`div`,m,[e(t.$slots,`default`,{},void 0,!0)]),n(`div`,h,[e(t.$slots,`controls`,{},void 0,!0)]),n(`div`,g,[e(t.$slots,`readout`,{},void 0,!0)])],6))}}),[[`__scopeId`,`data-v-0f64089e`]]),v=[`disabled`],y={key:0,class:`dl-btn__glyph`,"aria-hidden":`true`},b=d(o({__name:`StepButton`,props:{label:{},variant:{default:`primary`},disabled:{type:Boolean,default:!1},glyph:{}},emits:[`click`],setup(e,{emit:t}){let{$slidev:n,$nav:i,$clicksContext:o,$clicks:d,$page:p,$renderContext:m,$frontmatter:h}=f(),g=e,_=t;return(e,t)=>(u(),r(`button`,{type:`button`,class:a([`dl-btn`,`is-${g.variant}`]),disabled:g.disabled,onClick:t[0]||=e=>_(`click`)},[g.glyph?(u(),r(`span`,y,c(g.glyph),1)):l(`v-if`,!0),s(` `+c(g.label),1)],10,v))}}),[[`__scopeId`,`data-v-f82500e8`]]),x={class:`slidev-layout dl-interactive`},S={key:0,class:`dl-interactive__title`},C={class:`dl-interactive__stage`},w=d(o({__name:`interactive`,props:{heading:{},asideWidth:{},asideLeft:{type:Boolean}},setup(o){let{$slidev:s,$nav:d,$clicksContext:m,$clicks:h,$page:g,$renderContext:_,$frontmatter:v}=f(),y=o;return(o,s)=>{let d=p;return u(),r(`div`,x,[y.heading?(u(),r(`h1`,S,c(y.heading),1)):l(`v-if`,!0),n(`div`,{class:a([`dl-interactive__grid`,{"is-aside-left":y.asideLeft}])},[n(`div`,C,[e(o.$slots,`default`,{},void 0,!0)]),n(`div`,{class:`dl-interactive__aside`,style:i({flexBasis:y.asideWidth??`17rem`})},[e(o.$slots,`aside`,{},void 0,!0)],4)],2),t(d)])}}}),[[`__scopeId`,`data-v-0c449bbd`]]);export{b as n,_ as r,w as t};
transformer-v2/class/assets/md--uzs3-nr.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,K as n,Q as r,S as i,V as a,_ as o,_t as s,b as c,bt as l,g as u,j as d,l as f,lt as p,m,v as h,vt as g,w as _,x as v,xt as y,y as b,yt as x,z as S}from"./modules/shiki-BFOesOFp.js";import{t as C}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as w,t as T}from"./slidev/context-ChHKJoK9.js";import{n as E,r as D,t as O}from"./interactive-BWtflKDO.js";import{t as k}from"./slidev/VClicks-DR1s1I9G.js";import{t as A}from"./useConvolution-qO1u8ksh.js";var j={key:0,class:`dl-slider__label`},M=[`min`,`max`,`step`,`disabled`],N={class:`dl-slider__value`},P={key:0,class:`dl-slider__unit`},F=C(_({__name:`Slider`,props:d({label:{},min:{default:0},max:{default:1},step:{default:.01},precision:{default:2},unit:{},format:{},disabled:{type:Boolean,default:!1}},{modelValue:{required:!0},modelModifiers:{}}),emits:[`update:modelValue`],setup(t){let{$slidev:r,$nav:i,$clicksContext:a,$clicks:s,$page:l,$renderContext:d,$frontmatter:p}=w(),m=t,h=n(t,`modelValue`),_=u(()=>m.format?m.format(h.value):h.value.toFixed(m.precision)),x=new Set([`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`,`Home`,`End`,`PageUp`,`PageDown`,` `]);function C(e){x.has(e.key)&&e.stopPropagation()}return(t,n)=>(S(),c(`label`,{class:g([`dl-slider`,{"is-disabled":m.disabled}])},[m.label?(S(),c(`span`,j,y(m.label),1)):b(`v-if`,!0),e(o(`input`,{"onUpdate:modelValue":n[0]||=e=>h.value=e,type:`range`,min:m.min,max:m.max,step:m.step,disabled:m.disabled,onKeydown:C},null,40,M),[[f,h.value,void 0,{number:!0}]]),o(`output`,N,[v(y(_.value),1),m.unit?(S(),c(`span`,P,y(m.unit),1)):b(`v-if`,!0)])],2))}}),[[`__scopeId`,`data-v-b8762282`]]),I={class:`dl-logit`},L={class:`dl-logit__track`},R={class:`dl-logit__zval`},z={class:`dl-logit__track is-prob`},B={class:`dl-logit__pval`},V={class:`dl-logit__loss`},H={key:0},U={key:1,class:`dl-logit__muted`},W=C(_({__name:`LogitLab`,props:{mode:{default:`multiclass`},classes:{default:()=>[`cat`,`dog`,`bird`]},logits:{default:()=>[2,.5,-1]},trueClass:{default:0},range:{default:()=>[-6,6]}},setup(e){let{$slidev:t,$nav:n,$clicksContext:d,$clicks:f,$page:_,$renderContext:x,$frontmatter:C}=w(),T=e,O=p([...T.logits]),k=p(T.trueClass);function j(){O.value=[...T.logits],k.value=T.trueClass}function M(){O.value=O.value.map(e=>Math.min(T.range[1],e+2))}let N=e=>1/(1+Math.exp(-e)),P=u(()=>{if(T.mode===`binary`){let e=N(O.value[0]);return[1-e,e]}let e=Math.max(...O.value),t=O.value.map(t=>Math.exp(t-e)),n=t.reduce((e,t)=>e+t,0);return t.map(e=>e/n)}),W=u(()=>T.mode===`binary`?T.classes.length>=2?[`${T.classes[0]} (y=0)`,`${T.classes[1]} (y=1)`]:[`y = 0`,`y = 1`]:T.classes),G=u(()=>-Math.log(Math.max(P.value[k.value]??1e-12,1e-12))),K=u(()=>W.value.map((e,t)=>({i:t,name:e,z:T.mode===`binary`?t===1?O.value[0]:-O.value[0]:O.value[t],p:P.value[t],isTrue:t===k.value}))),q=u(()=>T.range[1]-T.range[0]),J=u(()=>(0-T.range[0])/q.value*100);function Y(e){let t=Math.abs(e)/q.value*100;return{left:`${e>=0?J.value:J.value-t}%`,width:`${t}%`}}let X=u(()=>P.value.reduce((e,t)=>e+t,0));return(e,t)=>{let n=F,u=E,d=D;return S(),h(d,{"max-width":`40rem`},{controls:r(()=>[T.mode===`binary`?(S(),h(n,{key:0,modelValue:O.value[0],"onUpdate:modelValue":t[0]||=e=>O.value[0]=e,label:`score z`,min:T.range[0],max:T.range[1],step:.25,precision:2},null,8,[`modelValue`,`min`,`max`])):(S(),c(m,{key:1},[(S(!0),c(m,null,a(O.value,(e,t)=>(S(),h(n,{key:`s${t}`,modelValue:O.value[t],"onUpdate:modelValue":e=>O.value[t]=e,label:`z(${T.classes[t]})`,min:T.range[0],max:T.range[1],step:.25,precision:2},null,8,[`modelValue`,`onUpdate:modelValue`,`label`,`min`,`max`]))),128)),i(u,{label:`+2 to every logit`,variant:`ghost`,glyph:`↑`,onClick:M})],64)),(S(!0),c(m,null,a(K.value,e=>(S(),h(u,{key:`t${e.i}`,label:`truth: ${e.name}`,variant:e.isTrue?`primary`:`ghost`,onClick:t=>k.value=e.i},null,8,[`label`,`variant`,`onClick`]))),128)),i(u,{label:`Reset`,variant:`ghost`,glyph:`↺`,onClick:j})]),readout:r(()=>[T.mode===`binary`?(S(),c(m,{key:0},[t[5]||=v(` One score in, one probability out: `,-1),o(`strong`,null,`σ(`+y(s(A)(O.value[0]))+`) = `+y(s(A)(P.value[1])),1),v(`, and the other class takes the remaining `+y(s(A)(P.value[0]))+`. z = 0 is exactly 0.5 — the decision threshold. With the label as it stands, the loss is `,1),o(`strong`,null,y(s(A)(G.value)),1),t[6]||=v(`. `,-1)],64)):(S(),c(m,{key:1},[v(` The `+y(O.value.length)+` probabilities sum to `+y(s(A)(X.value))+` — always. Only the `,1),o(`strong`,null,y(W.value[k.value]),1),t[7]||=v(` bar enters the loss; the others act on it by taking away probability. Press `,-1),t[8]||=o(`strong`,null,`+2 to every logit`,-1),t[9]||=v(`: every score moves, nothing else does. `,-1)],64))]),default:r(()=>[o(`div`,I,[t[1]||=o(`span`,{class:`dl-logit__head`},null,-1),t[2]||=o(`span`,{class:`dl-logit__head`},[v(`raw score `),o(`em`,null,`z`),v(` — a logit`)],-1),t[3]||=o(`span`,{class:`dl-logit__head`},`probability`,-1),t[4]||=o(`span`,{class:`dl-logit__head`},null,-1),(S(!0),c(m,null,a(K.value,e=>(S(),c(m,{key:e.i},[o(`div`,{class:g([`dl-logit__name`,{"is-true":e.isTrue}])},y(e.name),3),b(` Logits are signed, so the track carries a zero line. `),o(`div`,L,[o(`div`,{class:`dl-logit__zero`,style:l({left:`${J.value}%`})},null,4),o(`div`,{class:g([`dl-logit__z`,{"is-neg":e.z<0}]),style:l(Y(e.z))},null,6),o(`span`,R,y(s(A)(e.z)),1)]),o(`div`,z,[o(`div`,{class:g([`dl-logit__p`,{"is-true":e.isTrue}]),style:l({width:`${e.p*100}%`})},null,6),o(`span`,B,y(s(A)(e.p)),1)]),o(`div`,V,[e.isTrue?(S(),c(`span`,H,[v(`−log `+y(s(A)(e.p))+` = `,1),o(`strong`,null,y(s(A)(G.value)),1)])):(S(),c(`span`,U,`—`))])],64))),128))])]),_:1})}}}),[[`__scopeId`,`data-v-e48eef9f`]]),G={style:{zoom:`0.72`}},K={__name:`class.md__slidev_35`,setup(e){let{$slidev:n,$nav:a,$clicksContext:c,$clicks:l,$page:u,$renderContext:d,$frontmatter:f}=w();return c.setup(),(e,n)=>{let a=W,c=k;return S(),h(O,x(t(s(T)(s(f),34))),{aside:r(e=>[n[1]||=o(`p`,null,[v(`Input `),o(`em`,null,`merci`),v(`, right answer `),o(`em`,null,`thanks`),v(`.`)],-1),i(c,null,{default:r(()=>[...n[0]||=[o(`ul`,null,[o(`li`,null,[v(`Untrained: all logits 0, so every word gets `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mn`,null,`1`),o(`mi`,{mathvariant:`normal`},`/`),o(`mn`,null,`6`),o(`mo`,null,`=`),o(`mn`,null,`0.17`)]),o(`annotation`,{encoding:`application/x-tex`},`1/6 = 0.17`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),o(`span`,{class:`mord`},`1/6`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),o(`span`,{class:`mrel`},`=`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),o(`span`,{class:`mord`},`0.17`)])])])]),o(`li`,null,[v(`Loss `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mo`,null,`=`),o(`mo`,null,`−`),o(`mi`,null,`log`),o(`mo`,null,`⁡`),o(`mn`,null,`0.17`),o(`mo`,null,`=`),o(`mn`,null,`1.79`)]),o(`annotation`,{encoding:`application/x-tex`},`= -\\log 0.17 = 1.79`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.3669em`}}),o(`span`,{class:`mrel`},`=`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.8889em`,"vertical-align":`-0.1944em`}}),o(`span`,{class:`mord`},`−`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mop`},[v(`lo`),o(`span`,{style:{"margin-right":`0.0139em`}},`g`)]),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord`},`0.17`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),o(`span`,{class:`mrel`},`=`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),o(`span`,{class:`mord`},`1.79`)])])])]),o(`li`,null,[v(`Drag `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,null,`z`)]),o(`annotation`,{encoding:`application/x-tex`},`z`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.4306em`}}),o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.044em`}},`z`)])])]),v(`(thanks) up: the loss falls`)]),o(`li`,null,[v(`Backpropagation nudges `),o(`strong`,null,`every`),v(` weight that way`)])],-1)]]),_:1})]),default:r(()=>[o(`div`,G,[i(a,{mode:`multiclass`,classes:[`a`,`am`,`i`,`thanks`,`student`,`⟨eos⟩`],logits:[0,0,0,0,0,0],"true-class":3,range:[-4,6]})])]),_:1},16)}}};export{K as default};
transformer-v2/class/assets/md-21gIQvU7.js ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import{$ as e,E as t,Q as n,S as r,V as i,W as a,_ as o,_t as s,b as c,m as l,v as u,vt as d,x as f,xt as p,y as m,yt as h,z as g}from"./modules/shiki-BFOesOFp.js";import{n as _,t as v}from"./slidev/context-ChHKJoK9.js";import{t as y}from"./FlowDot-CpcqfMjQ.js";import{t as b}from"./default-DNkhSshI.js";import{t as x}from"./slidev/KaTexBlockWrapper-Ck43xKMc.js";var S={class:`dl-math-sm`},C={class:`flex justify-center`},w={viewBox:`0 0 660 150`,class:`dl-diagram`,style:{"max-height":`10.5rem`},role:`img`,"aria-label":`Q K transpose is 4 1 over 2 0. Divided by root 2: 2.83 0.71 over 1.41 0. Softmax of each row: 0.89 0.11 over 0.80 0.20. Times V gives Z: 1.79 0.21 over 1.61 0.39`},T=[`x`],E=[`x`,`y`],D=[`x`,`y`],O=[`d`],k={class:`mt-1 dl-callout`},A={__name:`class.md__slidev_19`,setup(A){let{$slidev:j,$nav:M,$clicksContext:N,$clicks:P,$page:F,$renderContext:I,$frontmatter:L}=_();return N.setup(),(_,A)=>{let j=x,M=y,N=a(`click`);return g(),u(b,h(t(s(v)(s(L),18))),{default:n(()=>[A[7]||=o(`h1`,null,`The whole layer in one line`,-1),A[8]||=o(`p`,null,`Steps 2 to 6, for every word at once, as matrices.`,-1),o(`div`,S,[r(j,{ranges:[]},{default:n(()=>[...A[0]||=[o(`p`,null,[o(`span`,{class:`katex-display`},[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`,display:`block`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,null,`Z`),o(`mo`,null,`=`),o(`mi`,{mathvariant:`normal`},`softmax`),o(`mo`,null,`⁡`),o(`mtext`,null,` ⁣`),o(`mrow`,null,[o(`mo`,{fence:`true`},`(`),o(`mfrac`,null,[o(`mrow`,null,[o(`mi`,null,`Q`),o(`msup`,null,[o(`mi`,null,`K`),o(`mi`,{mathvariant:`normal`},`⊤`)])]),o(`msqrt`,null,[o(`msub`,null,[o(`mi`,null,`d`),o(`mi`,null,`k`)])])]),o(`mo`,{fence:`true`},`)`)]),o(`mi`,null,`V`)]),o(`annotation`,{encoding:`application/x-tex`},`Z = \\operatorname{softmax}\\!\\left(\\frac{QK^\\top}{\\sqrt{d_k}}\\right) V `)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0715em`}},`Z`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),o(`span`,{class:`mrel`},`=`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`2.4761em`,"vertical-align":`-0.95em`}}),o(`span`,{class:`mop`},[o(`span`,{class:`mord mathrm`},`softmax`)]),o(`span`,{class:`mspace`,style:{"margin-right":`-0.1667em`}}),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`minner`},[o(`span`,{class:`mopen delimcenter`,style:{top:`0em`}},[o(`span`,{class:`delimsizing size3`},`(`)]),o(`span`,{class:`mord`},[o(`span`,{class:`mopen nulldelimiter`}),o(`span`,{class:`mfrac`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`1.5261em`}},[o(`span`,{style:{top:`-2.2528em`}},[o(`span`,{class:`pstrut`,style:{height:`3em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord sqrt`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.8572em`}},[o(`span`,{class:`svg-align`,style:{top:`-3em`}},[o(`span`,{class:`pstrut`,style:{height:`3em`}}),o(`span`,{class:`mord`,style:{"padding-left":`0.833em`}},[o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`},`d`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3361em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0315em`}},`k`)])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])])])]),o(`span`,{style:{top:`-2.8172em`}},[o(`span`,{class:`pstrut`,style:{height:`3em`}}),o(`span`,{class:`hide-tail`,style:{"min-width":`0.853em`,height:`1.08em`}},[o(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`400em`,height:`1.08em`,viewBox:`0 0 400000 1080`,preserveAspectRatio:`xMinYMin slice`},[o(`path`,{d:`M95,702
2
+ c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
3
+ c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
4
+ c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
5
+ s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
6
+ c69,-144,104.5,-217.7,106.5,-221
7
+ l0 -0
8
+ c5.3,-9.3,12,-14,20,-14
9
+ H400000v40H845.2724
10
+ s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
11
+ c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
12
+ M834 80h400000v40h-400000z`})])])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.1828em`}},[o(`span`)])])])])])]),o(`span`,{style:{top:`-3.23em`}},[o(`span`,{class:`pstrut`,style:{height:`3em`}}),o(`span`,{class:`frac-line`,style:{"border-bottom-width":`0.04em`}})]),o(`span`,{style:{top:`-3.677em`}},[o(`span`,{class:`pstrut`,style:{height:`3em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`},`Q`),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0715em`}},`K`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.8491em`}},[o(`span`,{style:{top:`-3.063em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},`⊤`)])])])])])])])])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.93em`}},[o(`span`)])])])]),o(`span`,{class:`mclose nulldelimiter`})]),o(`span`,{class:`mclose delimcenter`,style:{top:`0em`}},[o(`span`,{class:`delimsizing size3`},`)`)])]),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.2222em`}},`V`)])])])])],-1)]]),_:1})]),o(`div`,C,[(g(),c(`svg`,w,[A[1]||=o(`defs`,null,[o(`marker`,{id:`tv2s2-one-head`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[o(`path`,{class:`dl-dg-head is-accent`,d:`M0 0 L7 3.5 L0 7 z`})])],-1),A[2]||=o(`text`,{class:`dl-dg-small`,x:`84`,y:`66`,"text-anchor":`end`},`Thinking`,-1),A[3]||=o(`text`,{class:`dl-dg-small`,x:`84`,y:`96`,"text-anchor":`end`},`Machines`,-1),(g(),c(l,null,i([[`score: QKᵀ`,[[`4`,`1`],[`2`,`0`]]],[`scale: ÷ √2`,[[`2.83`,`0.71`],[`1.41`,`0`]]],[`softmax, each row`,[[`0.89`,`0.11`],[`0.80`,`0.20`]]],[`× V = Z`,[[`1.79`,`0.21`],[`1.61`,`0.39`]]]],(t,n)=>o(`g`,{key:n},[e((g(),c(`g`,null,[o(`text`,{class:`dl-dg-small`,x:136+n*140,y:`30`,"text-anchor":`middle`},p(t[0]),9,T),(g(!0),c(l,null,i(t[1],(e,t)=>(g(),c(`g`,{key:t},[(g(!0),c(l,null,i(e,(e,r)=>(g(),c(`g`,{key:r},[o(`rect`,{class:d(n===3?t===0?`dl-dg-box is-accent dl-dg-pulse`:`dl-dg-box is-accent`:`dl-dg-box`),x:90+n*140+r*46,y:44+t*30,width:`46`,height:`30`},null,10,E),o(`text`,{class:`dl-dg-lab is-sm`,x:113+n*140+r*46,y:64+t*30,"text-anchor":`middle`},p(e),9,D)]))),128))]))),128)),n<3?(g(),c(`path`,{key:0,class:`dl-dg-arrow is-accent dl-dg-flow`,"marker-end":`url(#tv2s2-one-head)`,d:`M${186+n*140} 74 H${224+n*140}`},null,8,O)):m(`v-if`,!0),n<3?(g(),u(M,{key:1,path:`M${186+n*140} 74 H${224+n*140}`,role:`accent`,dur:1,delay:n*.3},null,8,[`path`,`delay`])):m(`v-if`,!0)])),[[N]])])),64)),A[4]||=o(`text`,{class:`dl-dg-small`,x:`136`,y:`128`,"text-anchor":`middle`},`columns: the key read`,-1),A[5]||=o(`text`,{class:`dl-dg-small is-good`,x:`556`,y:`128`,"text-anchor":`middle`},`row 1 = z₁`,-1)]))]),e((g(),c(`div`,k,[...A[6]||=[o(`p`,null,[f(`Row 1 of `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,null,`Z`)]),o(`annotation`,{encoding:`application/x-tex`},`Z`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0715em`}},`Z`)])])]),f(` is `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mo`,{stretchy:`false`},`[`),o(`mn`,null,`1.79`),o(`mo`,{separator:`true`},`,`),o(`mn`,null,`0.21`),o(`mo`,{stretchy:`false`},`]`)]),o(`annotation`,{encoding:`application/x-tex`},`[1.79, 0.21]`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),o(`span`,{class:`mopen`},`[`),o(`span`,{class:`mord`},`1.79`),o(`span`,{class:`mpunct`},`,`),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord`},`0.21`),o(`span`,{class:`mclose`},`]`)])])]),f(`: the `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`msub`,null,[o(`mi`,{mathvariant:`bold`},`z`),o(`mn`,null,`1`)])]),o(`annotation`,{encoding:`application/x-tex`},`\\mathbf{z}_1`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.5944em`,"vertical-align":`-0.15em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathbf`},`z`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3011em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},`1`)])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])])])])]),f(` you computed by hand. One line does the same work for `),o(`strong`,null,`every word at once`),f(`.`)],-1)]])),[[N]])]),_:1},16)}}};export{A as default};
transformer-v2/class/assets/md-9XBO3-oF.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,Q as n,S as r,V as i,W as a,_ as o,_t as s,b as c,m as l,v as u,vt as d,x as f,xt as p,yt as m,z as h}from"./modules/shiki-BFOesOFp.js";import{n as g,t as _}from"./slidev/context-ChHKJoK9.js";import{t as v}from"./FlowDot-CpcqfMjQ.js";import{t as y}from"./default-DNkhSshI.js";var b={class:`mt-1 flex justify-center`},x={viewBox:`0 0 660 230`,class:`dl-diagram`,role:`img`,"aria-label":`X goes into eight heads, each giving a T by 64 output. The eight outputs are put side by side into one T by 512 matrix, then multiplied by W_O, 512 by 512, to give Z, T by 512`},S=[`d`],C=[`y`],w=[`y`],T=[`d`],E=[`x`],D={class:`mt-1 dl-callout`},O={__name:`class.md__slidev_21`,setup(O){let{$slidev:k,$nav:A,$clicksContext:j,$clicks:M,$page:N,$renderContext:P,$frontmatter:F}=g();return j.setup(),(g,O)=>{let k=v,A=a(`click`);return h(),u(y,m(t(s(_)(s(F),20))),{default:n(()=>[O[15]||=o(`h1`,null,`Eight heads, then glue them back`,-1),o(`div`,b,[(h(),c(`svg`,x,[O[9]||=o(`defs`,null,[o(`marker`,{id:`tv2s2-glue`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[o(`path`,{class:`dl-dg-head is-accent`,d:`M0 0 L7 3.5 L0 7 z`})])],-1),O[10]||=o(`rect`,{class:`dl-dg-box`,x:`10`,y:`82`,width:`56`,height:`60`,rx:`3`},null,-1),O[11]||=o(`text`,{class:`dl-dg-lab is-sm`,x:`38`,y:`117`,"text-anchor":`middle`},`X`,-1),O[12]||=o(`text`,{class:`dl-dg-small`,x:`38`,y:`160`,"text-anchor":`middle`},`T × 512`,-1),(h(),c(l,null,i(8,e=>o(`g`,{key:e},[o(`path`,{class:d([`dl-dg-arrow dl-dg-flow is-slow`,e===1?`is-accent`:e===2?`is-k`:``]),d:`M66 112 L104 ${21+(e-1)*24}`},null,10,S),o(`rect`,{class:d(e===1?`dl-dg-box is-accent`:e===2?`dl-dg-box is-k`:`dl-dg-box`),x:`106`,y:12+(e-1)*24,width:`96`,height:`19`,rx:`3`},null,10,C),o(`text`,{class:`dl-dg-small`,x:`154`,y:26+(e-1)*24,"text-anchor":`middle`},`head `+p(e)+` → Z`+p(e),9,w)])),64)),r(k,{path:`M66 112 L104 21`,role:`accent`,dur:1.2}),r(k,{path:`M66 112 L104 45`,role:`k`,dur:1.2,delay:.6}),O[13]||=o(`text`,{class:`dl-dg-small`,x:`154`,y:`218`,"text-anchor":`middle`},`each Zᵢ is T × 64`,-1),e((h(),c(`g`,null,[(h(),c(l,null,i(8,e=>o(`g`,{key:`c`+e},[o(`path`,{class:d([`dl-dg-arrow dl-dg-flow is-slow`,e===1?`is-accent`:e===2?`is-k`:``]),d:`M202 ${21+(e-1)*24} L${246+(e-1)*22} 92`},null,10,T),o(`rect`,{class:d(e===1?`dl-dg-box is-accent`:e===2?`dl-dg-box is-k`:`dl-dg-box`),x:240+(e-1)*22,y:`94`,width:`22`,height:`40`},null,10,E),r(k,{path:`M202 ${21+(e-1)*24} L${246+(e-1)*22} 92`,role:e===1?`accent`:e===2?`k`:`body`,r:3,dur:1.4,delay:(e-1)*.17},null,8,[`path`,`role`,`delay`])])),64)),O[0]||=o(`text`,{class:`dl-dg-small`,x:`328`,y:`156`,"text-anchor":`middle`},`concatenate: T × 512`,-1)])),[[A]]),e((h(),c(`g`,null,[O[1]||=o(`path`,{class:`dl-dg-arrow is-accent dl-dg-flow`,"marker-end":`url(#tv2s2-glue)`,d:`M420 114 H446`},null,-1),O[2]||=o(`rect`,{class:`dl-dg-fill is-muted`,x:`450`,y:`84`,width:`76`,height:`60`,rx:`3`},null,-1),O[3]||=o(`text`,{class:`dl-dg-lab is-sm`,x:`488`,y:`119`,"text-anchor":`middle`},`× W_O`,-1),O[4]||=o(`text`,{class:`dl-dg-small`,x:`488`,y:`160`,"text-anchor":`middle`},`512 × 512, learned`,-1),O[5]||=o(`path`,{class:`dl-dg-arrow is-accent dl-dg-flow`,"marker-end":`url(#tv2s2-glue)`,d:`M526 114 H556`},null,-1),r(k,{path:`M420 114 H556`,role:`accent`,dur:1.4}),O[6]||=o(`rect`,{class:`dl-dg-box is-accent`,x:`560`,y:`84`,width:`60`,height:`60`,rx:`3`},null,-1),O[7]||=o(`text`,{class:`dl-dg-lab is-sm`,x:`590`,y:`119`,"text-anchor":`middle`},`Z`,-1),O[8]||=o(`text`,{class:`dl-dg-small`,x:`590`,y:`160`,"text-anchor":`middle`},`T × 512`,-1)])),[[A]])]))]),e((h(),c(`div`,D,[...O[14]||=[o(`p`,null,[f(`Eight outputs of width 64, side by side, are 512 wide. `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`msub`,null,[o(`mi`,null,`W`),o(`mi`,null,`O`)])]),o(`annotation`,{encoding:`application/x-tex`},`W_O`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.8333em`,"vertical-align":`-0.15em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`W`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3283em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`-0.1389em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0278em`}},`O`)])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])])])])]),f(` mixes them into one `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,null,`T`),o(`mo`,null,`×`),o(`mn`,null,`512`)]),o(`annotation`,{encoding:`application/x-tex`},`T \\times 512`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.7667em`,"vertical-align":`-0.0833em`}}),o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`T`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),o(`span`,{class:`mbin`},`×`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),o(`span`,{class:`mord`},`512`)])])]),f(` matrix, the width the next part expects.`)],-1)]])),[[A]])]),_:1},16)}}};export{O as default};
transformer-v2/class/assets/md-BMyZhACr.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,Q as n,S as r,W as i,_ as a,_t as o,b as s,v as c,x as l,yt as u,z as d}from"./modules/shiki-BFOesOFp.js";import{n as f,t as p}from"./slidev/context-ChHKJoK9.js";import{t as m}from"./interactive-BWtflKDO.js";import{t as h}from"./ItAttention-Bn_pC1Mv.js";var g={class:`mt-3 dl-callout`},_={__name:`class.md__slidev_10`,setup(_){let{$slidev:v,$nav:y,$clicksContext:b,$clicks:x,$page:S,$renderContext:C,$frontmatter:w}=f();return b.setup(),(f,_)=>{let v=h,y=i(`click`);return d(),c(m,u(t(o(p)(o(w),9))),{aside:n(t=>[_[1]||=a(`p`,null,[a(`em`,null,[l(`The animal didn’t cross the street because `),a(`strong`,null,`it`),l(` was too tired.`)])],-1),_[2]||=a(`p`,null,[l(`To understand `),a(`strong`,null,`it`),l(`, the model must find `),a(`strong`,null,`animal`),l(`.`)],-1),e((d(),s(`div`,g,[..._[0]||=[a(`p`,null,[a(`strong`,null,`Self-attention`),l(`: every word reads every word, and takes most from the ones that matter to it.`)],-1)]])),[[y]])]),default:n(()=>[r(v,{head:0,switchable:!1})]),_:1},16)}}};export{_ as default};
transformer-v2/class/assets/md-BhcOSUhc2.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{E as e,Q as t,S as n,_ as r,_t as i,v as a,yt as o,z as s}from"./modules/shiki-BFOesOFp.js";import{n as c,t as l}from"./slidev/context-ChHKJoK9.js";import{t as u}from"./TransformerGlyph-XWvPPlsx.js";import{t as d}from"./section-YCe7iaDx.js";var f={class:`absolute right-18 top-1/2 -translate-y-1/2`},p={__name:`class.md__slidev_22`,setup(p){let{$slidev:m,$nav:h,$clicksContext:g,$clicks:_,$page:v,$renderContext:y,$frontmatter:b}=c();return g.setup(),(c,p)=>{let m=u;return s(),a(d,o(e(i(l)(i(b),21))),{default:t(()=>[p[0]||=r(`h1`,null,`Word order`,-1),r(`div`,f,[n(m,{kind:`position`,size:190})])]),_:1},16)}}};export{p as default};
transformer-v2/class/assets/md-BiZADt9E2.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,Q as n,S as r,W as i,_ as a,_t as o,b as s,v as c,x as l,yt as u,z as d}from"./modules/shiki-BFOesOFp.js";import{n as f,t as p}from"./slidev/context-ChHKJoK9.js";import{t as m}from"./FlowDot-CpcqfMjQ.js";import{t as h}from"./default-DNkhSshI.js";import{t as g}from"./slidev/VClicks-DR1s1I9G.js";var _={class:`mt-1 flex justify-center`},v={viewBox:`0 0 660 220`,class:`dl-diagram`,style:{"max-height":`11.5rem`},role:`img`,"aria-label":`Step 1 keeps i 0.80 and a 0.08. Step 2 extends both: i am 0.60, i a 0.08, a student 0.032, a am 0.016. Beam size 2 keeps i am and i a`},y={class:`mt-1 dl-callout`},b={__name:`class.md__slidev_37`,setup(b){let{$slidev:x,$nav:S,$clicksContext:C,$clicks:w,$page:T,$renderContext:E,$frontmatter:D}=f();return C.setup(),(f,b)=>{let x=m,S=g,C=i(`click`);return d(),c(h,u(t(o(p)(o(D),36))),{default:n(()=>[b[27]||=a(`h1`,null,`Greedy or beam search`,-1),a(`div`,_,[(d(),s(`svg`,v,[b[12]||=a(`defs`,null,[a(`marker`,{id:`tv2s6-beam-head`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[a(`path`,{class:`dl-dg-head`,d:`M0 0 L7 3.5 L0 7 z`})]),a(`marker`,{id:`tv2s6-beam-acc`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[a(`path`,{class:`dl-dg-head is-accent`,d:`M0 0 L7 3.5 L0 7 z`})])],-1),b[13]||=a(`text`,{class:`dl-dg-small`,x:`60`,y:`16`,"text-anchor":`middle`},`start`,-1),b[14]||=a(`text`,{class:`dl-dg-small`,x:`250`,y:`16`,"text-anchor":`middle`},`step 1`,-1),b[15]||=a(`text`,{class:`dl-dg-small`,x:`500`,y:`16`,"text-anchor":`middle`},`step 2: score = product`,-1),b[16]||=a(`rect`,{class:`dl-dg-box is-dec`,x:`20`,y:`96`,width:`80`,height:`30`,rx:`4`},null,-1),b[17]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`60`,y:`116`,"text-anchor":`middle`},`⟨start⟩`,-1),b[18]||=a(`path`,{class:`dl-dg-arrow is-accent dl-dg-flow`,"marker-end":`url(#tv2s6-beam-acc)`,d:`M100 104 L196 66`,style:{"stroke-width":`2.6`}},null,-1),r(x,{path:`M100 104 L196 66`,role:`accent`,dur:1.4}),b[19]||=a(`path`,{class:`dl-dg-arrow dl-dg-flow is-slow`,"marker-end":`url(#tv2s6-beam-head)`,d:`M100 118 L196 156`},null,-1),b[20]||=a(`rect`,{class:`dl-dg-box is-accent`,x:`200`,y:`48`,width:`100`,height:`32`,rx:`4`},null,-1),b[21]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`250`,y:`69`,"text-anchor":`middle`},`i 0.80`,-1),b[22]||=a(`rect`,{class:`dl-dg-box`,x:`200`,y:`140`,width:`100`,height:`32`,rx:`4`},null,-1),b[23]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`250`,y:`161`,"text-anchor":`middle`},`a 0.08`,-1),e((d(),s(`g`,null,[b[0]||=a(`path`,{class:`dl-dg-arrow is-accent dl-dg-flow`,"marker-end":`url(#tv2s6-beam-acc)`,d:`M300 58 L416 36`,style:{"stroke-width":`2.6`}},null,-1),r(x,{path:`M300 58 L416 36`,role:`accent`,dur:1.4,delay:.7}),b[1]||=a(`path`,{class:`dl-dg-arrow is-accent dl-dg-flow is-slow`,"marker-end":`url(#tv2s6-beam-acc)`,d:`M300 70 L416 84`},null,-1),r(x,{path:`M300 70 L416 84`,role:`accent`,dur:1.8,delay:.3,r:`3.5`}),b[2]||=a(`path`,{class:`dl-dg-arrow`,"marker-end":`url(#tv2s6-beam-head)`,d:`M300 150 L416 136`},null,-1),b[3]||=a(`path`,{class:`dl-dg-arrow`,"marker-end":`url(#tv2s6-beam-head)`,d:`M300 162 L416 184`},null,-1),b[4]||=a(`rect`,{class:`dl-dg-box is-accent`,x:`420`,y:`22`,width:`220`,height:`28`,rx:`4`},null,-1),b[5]||=a(`text`,{class:`dl-dg-small`,x:`430`,y:`41`},`i am: 0.80 × 0.75 = 0.60`,-1),b[6]||=a(`rect`,{class:`dl-dg-box is-accent`,x:`420`,y:`70`,width:`220`,height:`28`,rx:`4`},null,-1),b[7]||=a(`text`,{class:`dl-dg-small`,x:`430`,y:`89`},`i a: 0.80 × 0.10 = 0.08`,-1),b[8]||=a(`rect`,{class:`dl-dg-box is-bad`,x:`420`,y:`122`,width:`220`,height:`28`,rx:`4`},null,-1),b[9]||=a(`text`,{class:`dl-dg-small`,x:`430`,y:`141`},`a student: 0.08 × 0.40 = 0.032`,-1),b[10]||=a(`rect`,{class:`dl-dg-box is-bad`,x:`420`,y:`170`,width:`220`,height:`28`,rx:`4`},null,-1),b[11]||=a(`text`,{class:`dl-dg-small`,x:`430`,y:`189`},`a am: 0.08 × 0.20 = 0.016`,-1)])),[[C]]),b[24]||=a(`text`,{class:`dl-dg-small`,x:`330`,y:`214`,"text-anchor":`middle`},`toy numbers; beam size 2 keeps the two teal boxes`,-1)]))]),r(S,null,{default:n(()=>[...b[25]||=[a(`ul`,null,[a(`li`,null,[a(`strong`,null,`Greedy`),l(`: keep only the top word at each step`)]),a(`li`,null,[a(`strong`,null,`Beam search`),l(` (size 2): keep the 2 best partial sentences; score = product of probabilities`)])],-1)]]),_:1}),e((d(),s(`div`,y,[...b[26]||=[a(`p`,null,`Beam search can recover from a wrong first word. Beam size is set by hand.`,-1)]])),[[C]])]),_:1},16)}}};export{b as default};
transformer-v2/class/assets/md-BnB9SH19.css ADDED
@@ -0,0 +1 @@
 
 
1
+ .dl-sas[data-v-d9cb833e]{flex-direction:column;align-items:center;gap:.35rem;width:100%;display:flex}.dl-sas__ask[data-v-d9cb833e]{align-items:center;gap:.4rem;display:flex}.dl-sas__label[data-v-d9cb833e]{letter-spacing:.1em;text-transform:uppercase;color:var(--dl-muted);font-size:.72rem}.dl-sas__word[data-v-d9cb833e]{border:1px solid var(--dl-border);background:var(--dl-bg);color:var(--dl-body);font:inherit;cursor:pointer;border-radius:5px;padding:.12rem .7rem;font-size:.88rem}.dl-sas__word.is-current[data-v-d9cb833e]{background:var(--dl-accent);border-color:var(--dl-accent-strong);color:#fff;font-weight:600}.dl-sas__word[data-v-d9cb833e]:focus-visible{outline:2px solid var(--dl-accent);outline-offset:2px}.dl-sas__grid[data-v-d9cb833e]{border-collapse:collapse;table-layout:fixed;font-variant-numeric:tabular-nums;width:100%;max-width:34rem}.dl-sas__grid th[data-v-d9cb833e],.dl-sas__grid td[data-v-d9cb833e]{text-align:center;color:var(--dl-heading);padding:.1rem .25rem;font-size:.84rem}.dl-sas__rl[data-v-d9cb833e]{white-space:nowrap;width:8.4rem;font-weight:500;text-align:right!important;color:var(--dl-muted)!important;font-size:.76rem!important}.dl-sas__col[data-v-d9cb833e]{border-bottom:2px solid var(--dl-border);font-weight:600}.dl-sas__col.is-ask[data-v-d9cb833e]{border-bottom-color:var(--dl-accent);color:var(--dl-accent)!important}.dl-sas__grid td.is-given[data-v-d9cb833e]{color:var(--dl-muted)}.dl-sas__grid td.is-ask[data-v-d9cb833e]{color:var(--dl-accent-strong);font-weight:700}.dl-sas__grid tr.is-step td[data-v-d9cb833e]{font-weight:600}.dl-sas__grid tr.is-q td[data-v-d9cb833e],.dl-sas__grid tr.is-q th[data-v-d9cb833e]{color:var(--dl-q)!important}.dl-sas__grid tr.is-k td[data-v-d9cb833e],.dl-sas__grid tr.is-k th[data-v-d9cb833e]{color:var(--dl-k)!important}.dl-sas__grid tr.is-v td[data-v-d9cb833e],.dl-sas__grid tr.is-v th[data-v-d9cb833e]{color:var(--dl-v)!important}.dl-sas__grid tr.is-q td.is-ask[data-v-d9cb833e]{background:color-mix(in srgb, var(--dl-q) 12%, transparent);border-radius:4px}.is-hidden[data-v-d9cb833e]{visibility:hidden}.dl-sas__n[data-v-d9cb833e]{background:var(--dl-accent-soft);width:1.05rem;height:1.05rem;color:var(--dl-accent);vertical-align:middle;border-radius:50%;place-items:center;margin-right:.25rem;font-size:.62rem;font-weight:700;display:inline-grid}.dl-sas__bar[data-v-d9cb833e]{background:var(--dl-border);border-radius:2px;width:80%;height:4px;margin:.1rem auto 0;overflow:hidden}.dl-sas__bar span[data-v-d9cb833e]{background:var(--dl-accent);height:100%;display:block}.dl-sas__out[data-v-d9cb833e]{border-top:1px solid var(--dl-border);justify-content:center;align-items:center;gap:.45rem;width:100%;max-width:34rem;padding-top:.3rem;display:flex}.dl-sas__z[data-v-d9cb833e]{border:1px solid var(--dl-accent);background:var(--dl-accent-soft);color:var(--dl-heading);font-variant-numeric:tabular-nums;border-radius:4px;padding:.12rem .6rem;font-weight:700}
transformer-v2/class/assets/md-BtOPVTXq.js ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import{$ as e,E as t,Q as n,S as r,W as i,_ as a,_t as o,b as s,v as c,x as l,yt as u,z as d}from"./modules/shiki-BFOesOFp.js";import{n as f,t as p}from"./slidev/context-ChHKJoK9.js";import{t as m}from"./default-DNkhSshI.js";import{t as h}from"./slidev/VClicks-DR1s1I9G.js";var g={class:`grid grid-cols-[1.2fr_1fr] gap-8 mt-1 items-center`},_={viewBox:`0 0 380 210`,class:`dl-diagram`,role:`img`,"aria-label":`Scores 4 and 1 divided by root 2 give 2.83 and 0.71; softmax turns them into weights 0.89 and 0.11`},v={class:`mt-1 dl-callout`},y={__name:`class.md__slidev_13`,setup(y){let{$slidev:b,$nav:x,$clicksContext:S,$clicks:C,$page:w,$renderContext:T,$frontmatter:E}=f();return S.setup(),(f,y)=>{let b=h,x=i(`click`);return d(),c(m,u(t(o(p)(o(E),12))),{default:n(()=>[y[9]||=a(`h1`,null,`Steps 3 and 4: scale, then softmax`,-1),a(`div`,g,[a(`div`,null,[(d(),s(`svg`,_,[y[2]||=a(`text`,{class:`dl-dg-small`,x:`120`,y:`16`,"text-anchor":`middle`},`Thinking`,-1),y[3]||=a(`text`,{class:`dl-dg-small`,x:`250`,y:`16`,"text-anchor":`middle`},`Machines`,-1),y[4]||=a(`text`,{class:`dl-dg-small`,x:`10`,y:`44`},`score`,-1),y[5]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`120`,y:`44`,"text-anchor":`middle`},`4`,-1),y[6]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`250`,y:`44`,"text-anchor":`middle`},`1`,-1),e((d(),s(`g`,null,[...y[0]||=[a(`defs`,null,[a(`marker`,{id:`tv2s1-scale`,markerWidth:`6`,markerHeight:`6`,refX:`5`,refY:`3`,orient:`auto`},[a(`path`,{class:`dl-dg-head is-accent`,d:`M0 0 L6 3 L0 6 z`})])],-1),a(`path`,{class:`dl-dg-arrow is-accent dl-dg-flow`,"marker-end":`url(#tv2s1-scale)`,d:`M150 40 V62`},null,-1),a(`path`,{class:`dl-dg-arrow is-accent dl-dg-flow`,"marker-end":`url(#tv2s1-scale)`,d:`M280 40 V62`},null,-1),a(`text`,{class:`dl-dg-small`,x:`10`,y:`78`},`÷ √2`,-1),a(`text`,{class:`dl-dg-lab is-sm`,x:`120`,y:`78`,"text-anchor":`middle`},`2.83`,-1),a(`text`,{class:`dl-dg-lab is-sm`,x:`250`,y:`78`,"text-anchor":`middle`},`0.71`,-1)]])),[[x]]),e((d(),s(`g`,null,[...y[1]||=[a(`text`,{class:`dl-dg-small`,x:`10`,y:`150`},`softmax`,-1),a(`line`,{class:`dl-dg-split`,x1:`80`,y1:`190`,x2:`300`,y2:`190`},null,-1),a(`rect`,{class:`dl-dg-bar is-q`,x:`95`,y:101,width:`50`,height:89},null,-1),a(`rect`,{class:`dl-dg-bar`,x:`225`,y:179,width:`50`,height:11},null,-1),a(`text`,{class:`dl-dg-lab is-sm`,x:`120`,y:95,"text-anchor":`middle`},`0.89`,-1),a(`text`,{class:`dl-dg-lab is-sm`,x:`250`,y:173,"text-anchor":`middle`},`0.11`,-1),a(`text`,{class:`dl-dg-small`,x:`190`,y:`206`,"text-anchor":`middle`},`positive, add up to 1`,-1)]])),[[x]])]))]),a(`div`,null,[r(b,null,{default:n(()=>[...y[7]||=[a(`ul`,null,[a(`li`,null,[a(`strong`,null,`Scale`),l(`: divide by `),a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`msqrt`,null,[a(`msub`,null,[a(`mi`,null,`d`),a(`mi`,null,`k`)])])]),a(`annotation`,{encoding:`application/x-tex`},`\\sqrt{d_k}`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`1.04em`,"vertical-align":`-0.1828em`}}),a(`span`,{class:`mord sqrt`},[a(`span`,{class:`vlist-t vlist-t2`},[a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.8572em`}},[a(`span`,{class:`svg-align`,style:{top:`-3em`}},[a(`span`,{class:`pstrut`,style:{height:`3em`}}),a(`span`,{class:`mord`,style:{"padding-left":`0.833em`}},[a(`span`,{class:`mord`},[a(`span`,{class:`mord mathnormal`},`d`),a(`span`,{class:`msupsub`},[a(`span`,{class:`vlist-t vlist-t2`},[a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.3361em`}},[a(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[a(`span`,{class:`pstrut`,style:{height:`2.7em`}}),a(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[a(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0315em`}},`k`)])])]),a(`span`,{class:`vlist-s`},`​`)]),a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.15em`}},[a(`span`)])])])])])])]),a(`span`,{style:{top:`-2.8172em`}},[a(`span`,{class:`pstrut`,style:{height:`3em`}}),a(`span`,{class:`hide-tail`,style:{"min-width":`0.853em`,height:`1.08em`}},[a(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`400em`,height:`1.08em`,viewBox:`0 0 400000 1080`,preserveAspectRatio:`xMinYMin slice`},[a(`path`,{d:`M95,702
2
+ c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
3
+ c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
4
+ c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
5
+ s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
6
+ c69,-144,104.5,-217.7,106.5,-221
7
+ l0 -0
8
+ c5.3,-9.3,12,-14,20,-14
9
+ H400000v40H845.2724
10
+ s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
11
+ c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
12
+ M834 80h400000v40h-400000z`})])])])]),a(`span`,{class:`vlist-s`},`​`)]),a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.1828em`}},[a(`span`)])])])])])])]),l(`, the root of the key length`)]),a(`li`,null,[a(`strong`,null,`Softmax`),l(`: positive weights that add up to 1`)]),a(`li`,null,[l(`Paper: `),a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`msub`,null,[a(`mi`,null,`d`),a(`mi`,null,`k`)]),a(`mo`,null,`=`),a(`mn`,null,`64`)]),a(`annotation`,{encoding:`application/x-tex`},`d_k = 64`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.8444em`,"vertical-align":`-0.15em`}}),a(`span`,{class:`mord`},[a(`span`,{class:`mord mathnormal`},`d`),a(`span`,{class:`msupsub`},[a(`span`,{class:`vlist-t vlist-t2`},[a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.3361em`}},[a(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[a(`span`,{class:`pstrut`,style:{height:`2.7em`}}),a(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[a(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0315em`}},`k`)])])]),a(`span`,{class:`vlist-s`},`​`)]),a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.15em`}},[a(`span`)])])])])]),a(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),a(`span`,{class:`mrel`},`=`),a(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),a(`span`,{class:`mord`},`64`)])])]),l(`, divide by `),a(`strong`,null,`8`),l(`. Scores 112, 96 → 14, 12 → 0.88, 0.12`)])],-1)]]),_:1})])]),e((d(),s(`div`,v,[...y[8]||=[a(`p`,null,`Unscaled, long keys give huge scores. The softmax then saturates and its gradients vanish.`,-1)]])),[[x]])]),_:1},16)}}};export{y as default};
transformer-v2/class/assets/md-CLXMAmt7.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,Q as n,S as r,W as i,_ as a,_t as o,b as s,v as c,x as l,yt as u,z as d}from"./modules/shiki-BFOesOFp.js";import{n as f,t as p}from"./slidev/context-ChHKJoK9.js";import{t as m}from"./FlowDot-CpcqfMjQ.js";import{t as h}from"./default-DNkhSshI.js";import{t as g}from"./slidev/VClicks-DR1s1I9G.js";var _={class:`mt-1 flex justify-center`},v={viewBox:`0 0 660 200`,class:`dl-diagram`,role:`img`,"aria-label":`Thinking Machines gives Thinking 1.79 0.21 and Machines 1.61 0.39. Machines Thinking gives the same two vectors, just in the other order`},y={class:`mt-2 dl-callout`},b={__name:`class.md__slidev_23`,setup(b){let{$slidev:x,$nav:S,$clicksContext:C,$clicks:w,$page:T,$renderContext:E,$frontmatter:D}=f();return C.setup(),(f,b)=>{let x=m,S=g,C=i(`click`);return d(),c(h,u(t(o(p)(o(D),22))),{default:n(()=>[b[28]||=a(`h1`,null,`Attention does not see order`,-1),a(`div`,_,[(d(),s(`svg`,v,[b[24]||=a(`defs`,null,[a(`marker`,{id:`tv2s3-order`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[a(`path`,{class:`dl-dg-head is-accent`,d:`M0 0 L7 3.5 L0 7 z`})])],-1),a(`g`,null,[b[0]||=a(`text`,{class:`dl-dg-small`,x:`160`,y:`16`,"text-anchor":`middle`},`“Thinking Machines”`,-1),b[1]||=a(`rect`,{class:`dl-dg-box`,x:`40`,y:`150`,width:`110`,height:`30`,rx:`4`},null,-1),b[2]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`95`,y:`170`,"text-anchor":`middle`},`Thinking`,-1),b[3]||=a(`rect`,{class:`dl-dg-box`,x:`170`,y:`150`,width:`110`,height:`30`,rx:`4`},null,-1),b[4]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`225`,y:`170`,"text-anchor":`middle`},`Machines`,-1),b[5]||=a(`rect`,{class:`dl-dg-fill`,x:`40`,y:`86`,width:`240`,height:`34`,rx:`4`},null,-1),b[6]||=a(`text`,{class:`dl-dg-in`,x:`160`,y:`108`,"text-anchor":`middle`},`self-attention`,-1),b[7]||=a(`path`,{class:`dl-dg-arrow is-accent dl-dg-flow`,"marker-end":`url(#tv2s3-order)`,d:`M95 150 V122 M225 150 V122 M95 86 V62 M225 86 V62`},null,-1),r(x,{path:`M95 150 V62`,role:`accent`,dur:1.6}),r(x,{path:`M225 150 V62`,role:`accent`,dur:1.6,delay:.8}),b[8]||=a(`rect`,{class:`dl-dg-box is-accent`,x:`40`,y:`30`,width:`110`,height:`30`,rx:`4`},null,-1),b[9]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`95`,y:`50`,"text-anchor":`middle`},`[1.79, 0.21]`,-1),b[10]||=a(`rect`,{class:`dl-dg-box is-accent`,x:`170`,y:`30`,width:`110`,height:`30`,rx:`4`},null,-1),b[11]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`225`,y:`50`,"text-anchor":`middle`},`[1.61, 0.39]`,-1)]),b[25]||=a(`line`,{class:`dl-dg-split`,x1:`330`,y1:`10`,x2:`330`,y2:`190`},null,-1),e((d(),s(`g`,null,[b[12]||=a(`text`,{class:`dl-dg-small`,x:`500`,y:`16`,"text-anchor":`middle`},`“Machines Thinking”`,-1),b[13]||=a(`rect`,{class:`dl-dg-box`,x:`380`,y:`150`,width:`110`,height:`30`,rx:`4`},null,-1),b[14]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`435`,y:`170`,"text-anchor":`middle`},`Machines`,-1),b[15]||=a(`rect`,{class:`dl-dg-box`,x:`510`,y:`150`,width:`110`,height:`30`,rx:`4`},null,-1),b[16]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`565`,y:`170`,"text-anchor":`middle`},`Thinking`,-1),b[17]||=a(`rect`,{class:`dl-dg-fill`,x:`380`,y:`86`,width:`240`,height:`34`,rx:`4`},null,-1),b[18]||=a(`text`,{class:`dl-dg-in`,x:`500`,y:`108`,"text-anchor":`middle`},`self-attention`,-1),b[19]||=a(`path`,{class:`dl-dg-arrow is-accent dl-dg-flow`,"marker-end":`url(#tv2s3-order)`,d:`M435 150 V122 M565 150 V122 M435 86 V62 M565 86 V62`},null,-1),r(x,{path:`M435 150 V62`,role:`accent`,dur:1.6}),r(x,{path:`M565 150 V62`,role:`accent`,dur:1.6,delay:.8}),b[20]||=a(`rect`,{class:`dl-dg-box is-accent`,x:`380`,y:`30`,width:`110`,height:`30`,rx:`4`},null,-1),b[21]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`435`,y:`50`,"text-anchor":`middle`},`[1.61, 0.39]`,-1),b[22]||=a(`rect`,{class:`dl-dg-box is-accent`,x:`510`,y:`30`,width:`110`,height:`30`,rx:`4`},null,-1),b[23]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`565`,y:`50`,"text-anchor":`middle`},`[1.79, 0.21]`,-1)])),[[C]])]))]),r(S,null,{default:n(()=>[...b[26]||=[a(`ul`,null,[a(`li`,null,[l(`Same words, other order: the `),a(`strong`,null,`same`),l(` two outputs, only swapped`)]),a(`li`,null,[l(`Each word’s output depends on `),a(`strong`,null,`which`),l(` words are there, not `),a(`strong`,null,`where`)])],-1)]]),_:1}),e((d(),s(`div`,y,[...b[27]||=[a(`p`,null,[l(`Word order changes meaning, so it has to go `),a(`strong`,null,`into the vectors`),l(`.`)],-1)]])),[[C]])]),_:1},16)}}};export{b as default};
transformer-v2/class/assets/md-CMYKcO_R2.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,Q as n,S as r,W as i,_ as a,_t as o,b as s,v as c,x as l,yt as u,z as d}from"./modules/shiki-BFOesOFp.js";import{n as f,t as p}from"./slidev/context-ChHKJoK9.js";import{t as m}from"./FlowDot-CpcqfMjQ.js";import{t as h}from"./default-DNkhSshI.js";import{t as g}from"./slidev/VClicks-DR1s1I9G.js";var _={class:`mt-1 flex justify-center`},v={viewBox:`0 0 640 230`,class:`dl-diagram`,style:{"max-height":`12rem`},role:`img`,"aria-label":`The decoder position about to write am sends its query down to the three encoder outputs je, suis, étudiant; the line to suis is thickest at 0.8`},y={class:`mt-2 dl-callout`},b={__name:`class.md__slidev_32`,setup(b){let{$slidev:x,$nav:S,$clicksContext:C,$clicks:w,$page:T,$renderContext:E,$frontmatter:D}=f();return C.setup(),(f,b)=>{let x=m,S=g,C=i(`click`);return d(),c(h,u(t(o(p)(o(D),31))),{default:n(()=>[b[20]||=a(`h1`,null,`Encoder–decoder attention`,-1),a(`div`,_,[(d(),s(`svg`,v,[b[6]||=a(`text`,{class:`dl-dg-small is-dec`,x:`320`,y:`16`,"text-anchor":`middle`},`decoder: the position about to write "am"`,-1),b[7]||=a(`circle`,{class:`dl-dg-dot`,cx:`320`,cy:`44`,r:`13`,style:{fill:`var(--dl-q)`}},null,-1),b[8]||=a(`text`,{class:`dl-dg-in`,x:`320`,y:`49`,"text-anchor":`middle`,style:{fill:`var(--dl-bg)`}},`q`,-1),b[9]||=a(`text`,{class:`dl-dg-small is-q`,x:`346`,y:`48`},`query from the decoder layer below`,-1),e((d(),s(`g`,null,[b[0]||=a(`line`,{class:`dl-dg-line is-q dl-dg-flow is-slow`,x1:`312`,y1:`56`,x2:`140`,y2:`150`,style:{"stroke-width":`1.6`}},null,-1),b[1]||=a(`line`,{class:`dl-dg-line is-q`,x1:`320`,y1:`58`,x2:`320`,y2:`150`,style:{"stroke-width":`9`}},null,-1),b[2]||=a(`line`,{class:`dl-dg-line is-q dl-dg-flow is-slow`,x1:`328`,y1:`56`,x2:`500`,y2:`150`,style:{"stroke-width":`1.6`}},null,-1),r(x,{path:`M320 58 V150`,role:`q`,dur:2,delay:0}),r(x,{path:`M320 150 V58`,role:`v`,dur:2,delay:1,r:`5`}),b[3]||=a(`text`,{class:`dl-dg-small`,x:`214`,y:`98`,"text-anchor":`end`},`0.1`,-1),b[4]||=a(`text`,{class:`dl-dg-small is-good`,x:`332`,y:`110`},`0.8`,-1),b[5]||=a(`text`,{class:`dl-dg-small`,x:`426`,y:`98`},`0.1`,-1)])),[[C]]),b[10]||=a(`rect`,{class:`dl-dg-box is-k`,x:`100`,y:`152`,width:`80`,height:`30`,rx:`4`},null,-1),b[11]||=a(`rect`,{class:`dl-dg-box is-k`,x:`280`,y:`152`,width:`80`,height:`30`,rx:`4`,style:{"stroke-width":`3`}},null,-1),b[12]||=a(`rect`,{class:`dl-dg-box is-k`,x:`460`,y:`152`,width:`80`,height:`30`,rx:`4`},null,-1),b[13]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`140`,y:`172`,"text-anchor":`middle`},`je`,-1),b[14]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`320`,y:`172`,"text-anchor":`middle`},`suis`,-1),b[15]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`500`,y:`172`,"text-anchor":`middle`},`étudiant`,-1),b[16]||=a(`text`,{class:`dl-dg-small`,x:`320`,y:`204`,"text-anchor":`middle`},[a(`tspan`,{style:{fill:`var(--dl-k)`}},`keys`),l(` and `),a(`tspan`,{style:{fill:`var(--dl-v)`}},`values`),l(` from the top encoder's output`)],-1),b[17]||=a(`text`,{class:`dl-dg-small`,x:`320`,y:`222`,"text-anchor":`middle`},`weights drawn to show the idea, not from a trained model`,-1)]))]),r(S,null,{default:n(()=>[...b[18]||=[a(`ul`,null,[a(`li`,null,[a(`strong`,null,`Query`),l(`: from the decoder. "What do I need to write next?"`)]),a(`li`,null,[a(`strong`,null,`Keys and values`),l(`: from the encoder’s output. "What did the input say?"`)])],-1)]]),_:1}),e((d(),s(`div`,y,[...b[19]||=[a(`p`,null,[l(`Same attention. Only the sources differ: `),a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mi`,null,`Q`)]),a(`annotation`,{encoding:`application/x-tex`},`Q`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.8778em`,"vertical-align":`-0.1944em`}}),a(`span`,{class:`mord mathnormal`},`Q`)])])]),l(` from one stack, `),a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mi`,null,`K`)]),a(`annotation`,{encoding:`application/x-tex`},`K`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),a(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0715em`}},`K`)])])]),l(` and `),a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mi`,null,`V`)]),a(`annotation`,{encoding:`application/x-tex`},`V`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),a(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.2222em`}},`V`)])])]),l(` from the other.`)],-1)]])),[[C]])]),_:1},16)}}};export{b as default};
transformer-v2/class/assets/md-C_GB20rl.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,Q as n,S as r,V as i,W as a,_ as o,_t as s,b as c,m as l,v as u,w as d,x as f,xt as p,yt as m,z as h}from"./modules/shiki-BFOesOFp.js";import{t as g}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as _,t as v}from"./slidev/context-ChHKJoK9.js";import{t as y}from"./FlowDot-CpcqfMjQ.js";import{t as b}from"./default-DNkhSshI.js";import{t as x}from"./slidev/VClicks-DR1s1I9G.js";var S={class:`dl-poll`},C={class:`dl-poll__question`},w=g(d({__name:`PollSlide`,props:{question:{},items:{}},setup(e){let{$slidev:t,$nav:a,$clicksContext:s,$clicks:u,$page:d,$renderContext:f,$frontmatter:m}=_(),g=e;return(e,t)=>{let a=x;return h(),c(`div`,S,[o(`div`,C,p(g.question),1),r(a,null,{default:n(()=>[(h(!0),c(l,null,i(g.items,e=>(h(),c(`div`,{key:e,class:`dl-poll__item`},[t[0]||=o(`span`,{class:`dl-poll__bullet`},`?`,-1),o(`span`,null,p(e),1)]))),128))]),_:1})])}}}),[[`__scopeId`,`data-v-743a908f`]]),T={class:`grid grid-cols-[1.7fr_1fr] gap-6 items-start`},E={class:`mt-12`},D={viewBox:`0 0 240 150`,class:`dl-diagram`,role:`img`,"aria-label":`Machines asks: one line to Thinking, one line back to itself, weights hidden`},O={class:`mt-3 dl-reveal`},k={class:`mt-2 dl-secondary`},A={__name:`class.md__slidev_16`,setup(i){let{$slidev:l,$nav:d,$clicksContext:p,$clicks:g,$page:x,$renderContext:S,$frontmatter:C}=_();return p.setup(),(i,l)=>{let d=w,p=y,g=a(`click`);return h(),u(b,m(t(s(v)(s(C),15))),{default:n(()=>[o(`div`,T,[o(`div`,null,[r(d,{question:`In self-attention, does every word give its largest weight to itself?`,items:[`Yes, always`,`Yes, but only after dividing by √d_k`,`No: it depends on the learned matrices`,`No: a word never attends to itself`]})]),o(`div`,E,[(h(),c(`svg`,D,[l[0]||=o(`rect`,{class:`dl-dg-box is-k`,x:`10`,y:`20`,width:`96`,height:`30`,rx:`4`},null,-1),l[1]||=o(`text`,{class:`dl-dg-small`,x:`58`,y:`40`,"text-anchor":`middle`},`Thinking`,-1),l[2]||=o(`rect`,{class:`dl-dg-box is-q`,x:`10`,y:`100`,width:`96`,height:`30`,rx:`4`},null,-1),l[3]||=o(`text`,{class:`dl-dg-small`,x:`58`,y:`120`,"text-anchor":`middle`},`Machines`,-1),l[4]||=o(`path`,{class:`dl-dg-line is-q dl-dg-flow is-slow`,d:`M106 115 C 170 115, 170 35, 106 35`},null,-1),l[5]||=o(`path`,{class:`dl-dg-line is-q dl-dg-flow is-slow`,d:`M106 122 C 150 140, 150 100, 106 108`},null,-1),r(p,{path:`M106 115 C 170 115, 170 35, 106 35`,role:`q`,dur:1.8,r:3.5}),r(p,{path:`M106 122 C 150 140, 150 100, 106 108`,role:`q`,dur:1.8,delay:.9,r:3.5}),l[6]||=o(`text`,{class:`dl-dg-small`,x:`168`,y:`80`},`?`,-1),l[7]||=o(`text`,{class:`dl-dg-small`,x:`150`,y:`146`},`?`,-1)]))])]),e((h(),c(`div`,O,[...l[8]||=[o(`p`,null,`No: it depends on the learned matrices`,-1)]])),[[g]]),e((h(),c(`div`,k,[...l[9]||=[o(`p`,null,[o(`em`,null,`Machines`),f(` gives 0.80 to `),o(`em`,null,`Thinking`),f(` and only 0.20 to itself.`)],-1)]])),[[g]])]),_:1},16)}}};export{A as default};
transformer-v2/class/assets/md-Cp2JbSgr2.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{E as e,Q as t,S as n,_ as r,_t as i,v as a,x as o,yt as s,z as c}from"./modules/shiki-BFOesOFp.js";import{n as l,t as u}from"./slidev/context-ChHKJoK9.js";import{t as d}from"./interactive-BWtflKDO.js";import{t as f}from"./slidev/VClicks-DR1s1I9G.js";import{t as p}from"./DecodeLoop-Dzi8nT4a.js";var m={__name:`class.md__slidev_36`,setup(m){let{$slidev:h,$nav:g,$clicksContext:_,$clicks:v,$page:y,$renderContext:b,$frontmatter:x}=l();return _.setup(),(l,m)=>{let h=p,g=f;return c(),a(d,s(e(i(u)(i(x),35))),{aside:t(e=>[m[1]||=r(`p`,null,[o(`The sentence loss adds one `),r(`span`,{class:`katex`},[r(`span`,{class:`katex-mathml`},[r(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[r(`semantics`,null,[r(`mrow`,null,[r(`mo`,null,`−`),r(`mi`,null,`log`),r(`mo`,null,`⁡`),r(`mi`,null,`p`)]),r(`annotation`,{encoding:`application/x-tex`},`-\\log p`)])])]),r(`span`,{class:`katex-html`,"aria-hidden":`true`},[r(`span`,{class:`katex-base`},[r(`span`,{class:`katex-strut`,style:{height:`0.8889em`,"vertical-align":`-0.1944em`}}),r(`span`,{class:`mord`},`−`),r(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),r(`span`,{class:`mop`},[o(`lo`),r(`span`,{style:{"margin-right":`0.0139em`}},`g`)]),r(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),r(`span`,{class:`mord mathnormal`},`p`)])])]),o(` per position.`)],-1),n(g,null,{default:t(()=>[...m[0]||=[r(`ul`,null,[r(`li`,null,[o(`Untrained: `),r(`span`,{class:`katex`},[r(`span`,{class:`katex-mathml`},[r(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[r(`semantics`,null,[r(`mrow`,null,[r(`mn`,null,`1.79`)]),r(`annotation`,{encoding:`application/x-tex`},`1.79`)])])]),r(`span`,{class:`katex-html`,"aria-hidden":`true`},[r(`span`,{class:`katex-base`},[r(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),r(`span`,{class:`mord`},`1.79`)])])]),o(` per word, `),r(`span`,{class:`katex`},[r(`span`,{class:`katex-mathml`},[r(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[r(`semantics`,null,[r(`mrow`,null,[r(`mn`,null,`8.96`)]),r(`annotation`,{encoding:`application/x-tex`},`8.96`)])])]),r(`span`,{class:`katex-html`,"aria-hidden":`true`},[r(`span`,{class:`katex-base`},[r(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),r(`span`,{class:`mord`},`8.96`)])])]),o(` in total`)]),r(`li`,null,[o(`Press `),r(`em`,null,`Show a trained model`),o(`: `),r(`span`,{class:`katex`},[r(`span`,{class:`katex-mathml`},[r(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[r(`semantics`,null,[r(`mrow`,null,[r(`mn`,null,`1.14`)]),r(`annotation`,{encoding:`application/x-tex`},`1.14`)])])]),r(`span`,{class:`katex-html`,"aria-hidden":`true`},[r(`span`,{class:`katex-base`},[r(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),r(`span`,{class:`mord`},`1.14`)])])]),o(` in total`)]),r(`li`,null,[o(`In training the decoder is fed the `),r(`strong`,null,`right`),o(` previous words, not its own guesses (teacher forcing)`)])],-1)]]),_:1})]),default:t(()=>[n(h,{mode:`untrained`,loss:!0,step:i(v)},null,8,[`step`])]),_:1},16)}}};export{m as default};
transformer-v2/class/assets/md-Cr3oc_4w.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,Q as n,S as r,W as i,_ as a,_t as o,b as s,v as c,x as l,yt as u,z as d}from"./modules/shiki-BFOesOFp.js";import{n as f,t as p}from"./slidev/context-ChHKJoK9.js";import{t as m}from"./FlowDot-CpcqfMjQ.js";import{t as h}from"./default-DNkhSshI.js";import{t as g}from"./slidev/VClicks-DR1s1I9G.js";var _={class:`grid grid-cols-[1.3fr_1fr] gap-8 mt-2 items-center`},v={viewBox:`0 0 380 200`,class:`dl-diagram`,role:`img`,"aria-label":`Thinking's query [1,1] dotted with Thinking's key [2,2] gives 4; with Machines' key [1,0] gives 1`},y={class:`mt-2 dl-callout`},b={__name:`class.md__slidev_12`,setup(b){let{$slidev:x,$nav:S,$clicksContext:C,$clicks:w,$page:T,$renderContext:E,$frontmatter:D}=f();return C.setup(),(f,b)=>{let x=m,S=g,C=i(`click`);return d(),c(h,u(t(o(p)(o(D),11))),{default:n(()=>[b[16]||=a(`h1`,null,`Step 2: score every word`,-1),a(`div`,_,[a(`div`,null,[(d(),s(`svg`,v,[b[10]||=a(`text`,{class:`dl-dg-small`,x:`10`,y:`16`},`asking: "Thinking"`,-1),b[11]||=a(`rect`,{class:`dl-dg-box is-q dl-dg-pulse`,x:`10`,y:`80`,width:`70`,height:`36`,rx:`4`},null,-1),b[12]||=a(`text`,{class:`dl-dg-in is-q`,x:`45`,y:`103`,"text-anchor":`middle`},`q₁ [1, 1]`,-1),e((d(),s(`g`,null,[b[0]||=a(`path`,{class:`dl-dg-line is-q dl-dg-flow`,d:`M82 92 L180 52`},null,-1),r(x,{path:`M82 92 L180 52`,role:`q`,dur:1.2}),b[1]||=a(`rect`,{class:`dl-dg-box is-k`,x:`182`,y:`34`,width:`86`,height:`36`,rx:`4`},null,-1),b[2]||=a(`text`,{class:`dl-dg-small is-k`,x:`225`,y:`56`,"text-anchor":`middle`},`k₁ [2, 2]`,-1),b[3]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`290`,y:`46`},`1·2 + 1·2`,-1),b[4]||=a(`text`,{class:`dl-dg-lab`,x:`290`,y:`68`},`= 4`,-1)])),[[C]]),e((d(),s(`g`,null,[b[5]||=a(`path`,{class:`dl-dg-line is-q dl-dg-flow is-slow`,d:`M82 104 L180 146`,style:{"stroke-width":`1.2`}},null,-1),r(x,{path:`M82 104 L180 146`,role:`q`,dur:1.2,delay:.6,r:3}),b[6]||=a(`rect`,{class:`dl-dg-box is-k`,x:`182`,y:`128`,width:`86`,height:`36`,rx:`4`},null,-1),b[7]||=a(`text`,{class:`dl-dg-small is-k`,x:`225`,y:`150`,"text-anchor":`middle`},`k₂ [1, 0]`,-1),b[8]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`290`,y:`140`},`1·1 + 1·0`,-1),b[9]||=a(`text`,{class:`dl-dg-lab`,x:`290`,y:`162`},`= 1`,-1)])),[[C]]),b[13]||=a(`text`,{class:`dl-dg-small`,x:`225`,y:`192`,"text-anchor":`middle`},`keys of Thinking and Machines`,-1)]))]),a(`div`,null,[r(S,null,{default:n(()=>[...b[14]||=[a(`ul`,null,[a(`li`,null,[a(`strong`,null,`Score`),l(` = the asking word’s query `),a(`strong`,null,`dot`),l(` each word’s key`)]),a(`li`,null,[l(`Large score: the two vectors `),a(`strong`,null,`point the same way`)]),a(`li`,null,[l(`The word also scores `),a(`strong`,null,`itself`)])],-1)]]),_:1})])]),e((d(),s(`div`,y,[...b[15]||=[a(`p`,null,[a(`em`,null,`Thinking`),l(` scores 4 with itself and 1 with `),a(`em`,null,`Machines`),l(`.`)],-1)]])),[[C]])]),_:1},16)}}};export{b as default};
transformer-v2/class/assets/md-CxsD1lHT.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,Q as n,S as r,V as i,W as a,_ as o,_t as s,b as c,m as l,v as u,vt as d,x as f,xt as p,yt as m,z as h}from"./modules/shiki-BFOesOFp.js";import{n as g,t as _}from"./slidev/context-ChHKJoK9.js";import{t as v}from"./FlowDot-CpcqfMjQ.js";import{t as y}from"./default-DNkhSshI.js";var b={class:`mt-1 flex justify-center`},x={viewBox:`0 0 660 216`,class:`dl-diagram`,role:`img`,"aria-label":`The embedding x1 = [1,0,1,0] times three learned matrices gives the query q1 = [1,1], the key k1 = [2,2] and the value v1 = [2,0]`},S=[`id`],C=[`x`],w=[`x`],T=[`marker-end`,`d`],E=[`y`],D=[`x`,`y`],O=[`y`],k=[`y`],A=[`x`,`y`],j=[`x`,`y`],M=[`y`],N=[`y`],P={class:`dl-callout`},F={__name:`class.md__slidev_11`,setup(F){let{$slidev:I,$nav:L,$clicksContext:R,$clicks:z,$page:B,$renderContext:V,$frontmatter:H}=g();return R.setup(),(g,F)=>{let I=v,L=a(`click`);return h(),u(y,m(t(s(_)(s(H),10))),{default:n(()=>[F[3]||=o(`h1`,null,`Step 1: three vectors for every word`,-1),o(`div`,b,[(h(),c(`svg`,x,[o(`defs`,null,[(h(),c(l,null,i([`q`,`k`,`v`],e=>o(`marker`,{id:`tv2s1-qkv-${e}`,key:e,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[o(`path`,{class:d(`dl-dg-head is-${e}`),d:`M0 0 L7 3.5 L0 7 z`},null,2)],8,S)),64))]),F[0]||=o(`text`,{class:`dl-dg-small`,x:`10`,y:`14`},`"Thinking"`,-1),(h(),c(l,null,i([1,0,1,0],(e,t)=>o(`rect`,{key:`x${t}`,class:`dl-dg-box`,x:10+t*28,y:`86`,width:`24`,height:`24`,rx:`2`},null,8,C)),64)),(h(),c(l,null,i([1,0,1,0],(e,t)=>o(`text`,{key:`xt${t}`,class:`dl-dg-small`,x:22+t*28,y:`102`,"text-anchor":`middle`},p(e),9,w)),64)),F[1]||=o(`text`,{class:`dl-dg-lab is-sm`,x:`62`,y:`132`,"text-anchor":`middle`},`x₁`,-1),(h(),c(l,null,i([{n:`W_Q`,c:`q`,w:[[1,0],[0,1],[0,1],[0,0]],out:[1,1],o:`q₁`,role:`query: what I look for`},{n:`W_K`,c:`k`,w:[[1,1],[1,0],[1,1],[0,0]],out:[2,2],o:`k₁`,role:`key: what I offer to match`},{n:`W_V`,c:`v`,w:[[2,0],[0,2],[0,0],[0,0]],out:[2,0],o:`v₁`,role:`value: what I hand over`}],(t,n)=>e((h(),c(`g`,{key:t.n},[o(`path`,{class:d(`dl-dg-arrow is-${t.c} dl-dg-flow`),"marker-end":`url(#tv2s1-qkv-${t.c})`,d:`M118 98 C 126 98, 122 ${26+n*66}, 134 ${26+n*66}`},null,10,T),r(I,{path:`M118 98 C 126 98, 122 ${26+n*66}, 134 ${26+n*66}`,role:t.c,dur:1.1,r:3.5},null,8,[`path`,`role`]),o(`text`,{class:d(`dl-dg-small is-${t.c}`),x:`140`,y:30+n*66},`× `+p(t.n),11,E),(h(!0),c(l,null,i(t.w,(e,t)=>(h(),c(`g`,{key:t},[(h(!0),c(l,null,i(e,(e,r)=>(h(),c(`text`,{key:r,class:`dl-dg-small`,x:196+r*18,y:18+n*66+t*13,"text-anchor":`middle`},p(e),9,D))),128))]))),128)),o(`rect`,{class:`dl-dg-box`,x:`184`,y:6+n*66,width:`42`,height:`54`,rx:`2`,style:{fill:`none`}},null,8,O),o(`text`,{class:`dl-dg-small`,x:`248`,y:36+n*66,"text-anchor":`middle`},`=`,8,k),(h(!0),c(l,null,i(t.out,(e,r)=>(h(),c(`rect`,{key:`o${r}`,class:d(`dl-dg-box is-${t.c}`),x:268+r*28,y:20+n*66,width:`24`,height:`24`,rx:`2`},null,10,A))),128)),(h(!0),c(l,null,i(t.out,(e,t)=>(h(),c(`text`,{key:`ot${t}`,class:`dl-dg-small`,x:280+t*28,y:36+n*66,"text-anchor":`middle`},p(e),9,j))),128)),o(`text`,{class:d(`dl-dg-lab is-sm is-${t.c}`),x:`334`,y:37+n*66},p(t.o),11,M),o(`text`,{class:d(`dl-dg-small is-${t.c}`),x:`370`,y:37+n*66},p(t.role),11,N)])),[[L]])),64))]))]),e((h(),c(`div`,P,[...F[2]||=[o(`p`,null,[f(`Three `),o(`strong`,null,`learned`),f(` matrices, `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`msub`,null,[o(`mi`,null,`W`),o(`mi`,null,`Q`)])]),o(`annotation`,{encoding:`application/x-tex`},`W_Q`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.9694em`,"vertical-align":`-0.2861em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`W`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3283em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`-0.1389em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mathnormal mtight`},`Q`)])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.2861em`}},[o(`span`)])])])])])])])]),f(`, `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`msub`,null,[o(`mi`,null,`W`),o(`mi`,null,`K`)])]),o(`annotation`,{encoding:`application/x-tex`},`W_K`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.8333em`,"vertical-align":`-0.15em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`W`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3283em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`-0.1389em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0715em`}},`K`)])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])])])])]),f(` and `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`msub`,null,[o(`mi`,null,`W`),o(`mi`,null,`V`)])]),o(`annotation`,{encoding:`application/x-tex`},`W_V`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.8333em`,"vertical-align":`-0.15em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.1389em`}},`W`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3283em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`-0.1389em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.2222em`}},`V`)])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])])])])]),f(`, shared by every word. Each turns 4 numbers into 2 (paper: 512 into 64).`)],-1)]])),[[L]])]),_:1},16)}}};export{F as default};
transformer-v2/class/assets/md-D2pt8njL2.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{E as e,Q as t,S as n,_ as r,_t as i,v as a,x as o,yt as s,z as c}from"./modules/shiki-BFOesOFp.js";import{n as l,t as u}from"./slidev/context-ChHKJoK9.js";import{t as d}from"./interactive-BWtflKDO.js";import{t as f}from"./slidev/VClicks-DR1s1I9G.js";import{t as p}from"./DecodeLoop-Dzi8nT4a.js";var m={__name:`class.md__slidev_30`,setup(m){let{$slidev:h,$nav:g,$clicksContext:_,$clicks:v,$page:y,$renderContext:b,$frontmatter:x}=l();return _.setup(),(l,m)=>{let h=p,g=f;return c(),a(d,s(e(i(u)(i(x),29))),{aside:t(e=>[m[1]||=r(`p`,null,[o(`The decoder writes `),r(`strong`,null,`one word per step`),o(`.`)],-1),n(g,null,{default:t(()=>[...m[0]||=[r(`ul`,null,[r(`li`,null,`The word it writes is fed back in as its next input.`),r(`li`,null,`That input is embedded and gets a position vector, as on the encoder side.`),r(`li`,null,`It stops when it writes ⟨eos⟩, "end of sentence".`)],-1)]]),_:1})]),default:t(()=>[n(h,{step:i(v),switchable:!1},null,8,[`step`])]),_:1},16)}}};export{m as default};
transformer-v2/class/assets/md-D998G7fY.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{E as e,Q as t,S as n,_ as r,_t as i,v as a,yt as o,z as s}from"./modules/shiki-BFOesOFp.js";import{n as c,t as l}from"./slidev/context-ChHKJoK9.js";import{t as u}from"./TransformerGlyph-XWvPPlsx.js";import{t as d}from"./section-YCe7iaDx.js";var f={class:`absolute right-18 top-1/2 -translate-y-1/2`},p={__name:`class.md__slidev_3`,setup(p){let{$slidev:m,$nav:h,$clicksContext:g,$clicks:_,$page:v,$renderContext:y,$frontmatter:b}=c();return g.setup(),(c,p)=>{let m=u;return s(),a(d,o(e(i(l)(i(b),2))),{default:t(()=>[p[0]||=r(`h1`,null,`The big picture`,-1),r(`div`,f,[n(m,{kind:`encdec`,size:190})])]),_:1},16)}}};export{p as default};
transformer-v2/class/assets/md-DI3YoSU9.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{E as e,Q as t,S as n,V as r,Y as i,_ as a,_t as o,b as s,bt as c,g as l,lt as u,m as d,v as f,vt as p,w as m,x as h,xt as g,yt as _,z as v}from"./modules/shiki-BFOesOFp.js";import{t as y}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{n as b,t as x}from"./slidev/context-ChHKJoK9.js";import{n as S,r as C,t as w}from"./interactive-BWtflKDO.js";import{a as T,d as E,o as D}from"./useIllustrated-DSSyJg4J.js";import{t as O}from"./useConvolution-qO1u8ksh.js";var k={class:`dl-sas`},A={class:`dl-sas__ask`},j=[`disabled`,`onClick`],M={class:`dl-sas__grid`},N={class:`dl-sas__bar`},P={class:`dl-sas__z`},F=6,I=y(m({__name:`SelfAttentionSteps`,props:{query:{default:0},step:{default:0},switchable:{type:Boolean,default:!0}},setup(e){let{$slidev:m,$nav:_,$clicksContext:y,$clicks:x,$page:w,$renderContext:I,$frontmatter:L}=b(),R=e,z=u(R.query),B=u(null),V=l(()=>Math.min(F,Math.max(0,B.value??R.step)));i(()=>R.step,()=>{B.value=null});let H=E(),U=l(()=>H.rows[z.value]),W=l(()=>V.value>=F);function G(){B.value=W.value?0:V.value+1}function K(e){z.value=e}let q=e=>`[${e.map(e=>O(e)).join(`, `)}]`,J=[`two words, each a vector of four numbers — nothing computed yet`,`step 1: every word makes a query, a key and a value (x times W_Q, W_K, W_V)`,`step 2: score — the asking word's query dotted with every key`,`step 3: divide each score by √d_k = √2`,`step 4: softmax — weights that are positive and add up to 1`,`step 5: multiply each value by its weight`,`step 6: add the weighted values — the layer’s output for this word`];return(e,i)=>{let l=S,u=C;return v(),f(u,{"max-width":`46rem`},{controls:t(()=>[n(l,{label:W.value?`Start over`:`Next step`,glyph:`▸`,onClick:G},null,8,[`label`])]),readout:t(()=>[W.value?(v(),s(d,{key:1},[a(`strong`,null,g(U.value.word),1),h(` gives `+g(U.value.weights[z.value].toFixed(2))+` of its attention to itself and `+g(U.value.weights[1-z.value].toFixed(2))+` to `,1),a(`strong`,null,g(o(T)[1-z.value]),1),i[14]||=h(`. Its output z`,-1),a(`sub`,null,g(z.value+1),1),h(` = `+g(q(U.value.z))+` is mostly `,1),a(`em`,null,g(o(T)[U.value.weights[0]>=U.value.weights[1]?0:1]),1),i[15]||=h(`’s value. `,-1)],64)):(v(),s(d,{key:0},[h(g(J[V.value])+`. `,1)],64))]),default:t(()=>[a(`div`,k,[a(`div`,A,[i[0]||=a(`span`,{class:`dl-sas__label`},`asking word`,-1),(v(!0),s(d,null,r(o(T),(e,t)=>(v(),s(`button`,{key:e,type:`button`,class:p([`dl-sas__word`,{"is-current":t===z.value}]),disabled:!R.switchable&&t!==z.value,onClick:e=>K(t)},g(e),11,j))),128))]),a(`table`,M,[a(`thead`,null,[a(`tr`,null,[i[1]||=a(`th`,{class:`dl-sas__rl`},null,-1),(v(!0),s(d,null,r(o(T),(e,t)=>(v(),s(`th`,{key:e,class:p([`dl-sas__col`,{"is-ask":t===z.value}])},g(e),3))),128))])]),a(`tbody`,null,[a(`tr`,null,[i[2]||=a(`th`,{class:`dl-sas__rl`},`embedding x`,-1),(v(!0),s(d,null,r(o(D),(e,t)=>(v(),s(`td`,{key:`x${t}`,class:`is-given`},g(q(e)),1))),128))]),a(`tr`,{class:p([{"is-hidden":V.value<1},`is-q`])},[i[3]||=a(`th`,{class:`dl-sas__rl`},[a(`span`,{class:`dl-sas__n`},`1`),h(` query q`)],-1),(v(!0),s(d,null,r(o(H).q,(e,t)=>(v(),s(`td`,{key:`q${t}`,class:p({"is-ask":t===z.value})},g(q(e)),3))),128))],2),a(`tr`,{class:p([{"is-hidden":V.value<1},`is-k`])},[i[4]||=a(`th`,{class:`dl-sas__rl`},`key k`,-1),(v(!0),s(d,null,r(o(H).k,(e,t)=>(v(),s(`td`,{key:`k${t}`},g(q(e)),1))),128))],2),a(`tr`,{class:p([{"is-hidden":V.value<1},`is-v`])},[i[5]||=a(`th`,{class:`dl-sas__rl`},`value v`,-1),(v(!0),s(d,null,r(o(H).v,(e,t)=>(v(),s(`td`,{key:`v${t}`},g(q(e)),1))),128))],2),a(`tr`,{class:p([{"is-hidden":V.value<2},`is-step`])},[i[6]||=a(`th`,{class:`dl-sas__rl`},[a(`span`,{class:`dl-sas__n`},`2`),h(` score q · k`)],-1),(v(!0),s(d,null,r(U.value.raw,(e,t)=>(v(),s(`td`,{key:`s${t}`},g(o(O)(e)),1))),128))],2),a(`tr`,{class:p([{"is-hidden":V.value<3},`is-step`])},[i[7]||=a(`th`,{class:`dl-sas__rl`},[a(`span`,{class:`dl-sas__n`},`3`),h(` ÷ √2`)],-1),(v(!0),s(d,null,r(U.value.scaled,(e,t)=>(v(),s(`td`,{key:`c${t}`},g(o(O)(e)),1))),128))],2),a(`tr`,{class:p([{"is-hidden":V.value<4},`is-step`])},[i[8]||=a(`th`,{class:`dl-sas__rl`},[a(`span`,{class:`dl-sas__n`},`4`),h(` softmax`)],-1),(v(!0),s(d,null,r(U.value.weights,(e,t)=>(v(),s(`td`,{key:`w${t}`},[a(`div`,null,g(e.toFixed(2)),1),a(`div`,N,[a(`span`,{style:c({width:`${e*100}%`})},null,4)])]))),128))],2),a(`tr`,{class:p([{"is-hidden":V.value<5},`is-step is-v`])},[i[9]||=a(`th`,{class:`dl-sas__rl`},[a(`span`,{class:`dl-sas__n`},`5`),h(` weight × v`)],-1),(v(!0),s(d,null,r(U.value.terms,(e,t)=>(v(),s(`td`,{key:`t${t}`},g(q(e)),1))),128))],2)])]),a(`div`,{class:p([`dl-sas__out`,{"is-hidden":V.value<6}])},[i[11]||=a(`span`,{class:`dl-sas__n`},`6`,-1),i[12]||=a(`span`,{class:`dl-sas__label`},`sum`,-1),i[13]||=a(`span`,null,`→`,-1),a(`span`,P,[i[10]||=h(`z`,-1),a(`sub`,null,g(z.value+1),1),h(` = `+g(q(U.value.z)),1)])],2)])]),_:1})}}}),[[`__scopeId`,`data-v-d9cb833e`]]),L={__name:`class.md__slidev_15`,setup(r){let{$slidev:i,$nav:s,$clicksContext:c,$clicks:l,$page:u,$renderContext:d,$frontmatter:p}=b();return c.setup(),(r,i)=>{let s=I;return v(),f(w,_(e(o(x)(o(p),14))),{aside:t(e=>[...i[0]||=[a(`p`,null,`Each click adds one step.`,-1),a(`p`,null,[a(`strong`,null,`Then`),h(` press `),a(`em`,null,`Machines`),h(` and compute its output yourself first.`)],-1),a(`div`,{class:`dl-secondary mt-3`},[a(`p`,null,[h(`Check: `),a(`em`,null,`Machines`),h(` gives 0.80 to `),a(`em`,null,`Thinking`),h(`, and its output is `),a(`span`,null,`1.61, 0.39`),h(`.`)])],-1)]]),default:t(()=>[n(s,{step:o(l)},null,8,[`step`])]),_:1},16)}}};export{L as default};
transformer-v2/class/assets/md-Dj7Ob5HE.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,Q as n,S as r,V as i,W as a,_ as o,_t as s,b as c,m as l,v as u,xt as d,yt as f,z as p}from"./modules/shiki-BFOesOFp.js";import{n as m,t as h}from"./slidev/context-ChHKJoK9.js";import{t as g}from"./FlowDot-CpcqfMjQ.js";import{t as _}from"./default-DNkhSshI.js";var v={class:`flex justify-center`},y={viewBox:`0 0 660 324`,class:`dl-diagram`,style:{"max-height":`19.5rem`},role:`img`,"aria-label":`Two encoder layers stacked on the left, each with self-attention and feed-forward, each followed by add and norm. Two decoder layers on the right with self-attention, encoder-decoder attention and feed-forward. The top encoder's output feeds the encoder-decoder attention of both decoders. Above the decoders: linear, then softmax`},b=[`y`],x=[`y`],S=[`y`],C=[`y`],w=[`y`],T=[`y`],E=[`y`],D=[`y`],O=[`y`],k=[`y`],A=[`y`],j=[`y`],M=[`y`],N=[`y`],P=[`y`],F=[`y`],I=[`y`],L=[`y`],R=[`y`],z=[`y`],B=[`y`],V=[`y`],H=[`y`],U=[`y`],W={__name:`class.md__slidev_27`,setup(W){let{$slidev:G,$nav:K,$clicksContext:q,$clicks:J,$page:Y,$renderContext:X,$frontmatter:Z}=m();return q.setup(),(m,W)=>{let G=g,K=a(`click`);return p(),u(_,f(t(s(h)(s(Z),26))),{default:n(()=>[W[12]||=o(`h1`,null,`The full picture, two layers deep`,-1),o(`div`,v,[(p(),c(`svg`,y,[W[8]||=o(`defs`,null,[o(`marker`,{id:`tv2s4-full`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[o(`path`,{class:`dl-dg-head`,d:`M0 0 L7 3.5 L0 7 z`})]),o(`marker`,{id:`tv2s4-full-k`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[o(`path`,{class:`dl-dg-head is-k`,d:`M0 0 L7 3.5 L0 7 z`})])],-1),(p(),c(l,null,i([214,120],(e,t)=>o(`g`,{key:`e`+t},[o(`rect`,{class:`dl-dg-fill is-enc`,x:`60`,y:e,width:`220`,height:`86`,rx:`5`},null,8,b),o(`rect`,{class:`dl-dg-fill`,x:`70`,y:e+4,width:`200`,height:`14`,rx:`2`},null,8,x),o(`text`,{class:`dl-dg-small`,x:`170`,y:e+15,"text-anchor":`middle`},`add & norm`,8,S),o(`rect`,{class:`dl-dg-box`,x:`70`,y:e+21,width:`200`,height:`20`,rx:`3`},null,8,C),o(`text`,{class:`dl-dg-small`,x:`170`,y:e+35,"text-anchor":`middle`},`feed-forward`,8,w),o(`rect`,{class:`dl-dg-fill`,x:`70`,y:e+44,width:`200`,height:`14`,rx:`2`},null,8,T),o(`text`,{class:`dl-dg-small`,x:`170`,y:e+55,"text-anchor":`middle`},`add & norm`,8,E),o(`rect`,{class:`dl-dg-box is-accent`,x:`70`,y:e+61,width:`200`,height:`20`,rx:`3`},null,8,D),o(`text`,{class:`dl-dg-small`,x:`170`,y:e+75,"text-anchor":`middle`},`self-attention`,8,O),o(`text`,{class:`dl-dg-small is-enc`,x:`286`,y:e+48},`encoder `+d(2-t),9,k)])),64)),W[9]||=o(`path`,{class:`dl-dg-arrow`,"marker-end":`url(#tv2s4-full)`,d:`M170 304 V302`},null,-1),W[10]||=o(`path`,{class:`dl-dg-arrow`,"marker-end":`url(#tv2s4-full)`,d:`M170 214 V208`},null,-1),W[11]||=o(`text`,{class:`dl-dg-small`,x:`170`,y:`318`,"text-anchor":`middle`},`Thinking, Machines + positions`,-1),r(G,{path:`M170 306 V100`,role:`enc`,dur:3}),r(G,{path:`M170 306 V100`,role:`enc`,dur:3,delay:1.5}),e((p(),c(`g`,null,[(p(),c(l,null,i([174,40],(e,t)=>o(`g`,{key:`d`+t},[o(`rect`,{class:`dl-dg-fill is-dec`,x:`380`,y:e,width:`220`,height:`126`,rx:`5`},null,8,A),o(`rect`,{class:`dl-dg-fill`,x:`390`,y:e+4,width:`200`,height:`14`,rx:`2`},null,8,j),o(`text`,{class:`dl-dg-small`,x:`490`,y:e+15,"text-anchor":`middle`},`add & norm`,8,M),o(`rect`,{class:`dl-dg-box`,x:`390`,y:e+21,width:`200`,height:`20`,rx:`3`},null,8,N),o(`text`,{class:`dl-dg-small`,x:`490`,y:e+35,"text-anchor":`middle`},`feed-forward`,8,P),o(`rect`,{class:`dl-dg-fill`,x:`390`,y:e+44,width:`200`,height:`14`,rx:`2`},null,8,F),o(`text`,{class:`dl-dg-small`,x:`490`,y:e+55,"text-anchor":`middle`},`add & norm`,8,I),o(`rect`,{class:`dl-dg-box is-accent`,x:`390`,y:e+61,width:`200`,height:`20`,rx:`3`},null,8,L),o(`text`,{class:`dl-dg-small`,x:`490`,y:e+75,"text-anchor":`middle`},`encoder–decoder attention`,8,R),o(`rect`,{class:`dl-dg-fill`,x:`390`,y:e+84,width:`200`,height:`14`,rx:`2`},null,8,z),o(`text`,{class:`dl-dg-small`,x:`490`,y:e+95,"text-anchor":`middle`},`add & norm`,8,B),o(`rect`,{class:`dl-dg-box is-accent`,x:`390`,y:e+101,width:`200`,height:`20`,rx:`3`},null,8,V),o(`text`,{class:`dl-dg-small`,x:`490`,y:e+115,"text-anchor":`middle`},`self-attention`,8,H),o(`text`,{class:`dl-dg-small is-dec`,x:`606`,y:e+68},`decoder `+d(2-t),9,U)])),64)),W[0]||=o(`path`,{class:`dl-dg-arrow`,"marker-end":`url(#tv2s4-full)`,d:`M490 174 V168`},null,-1),W[1]||=o(`text`,{class:`dl-dg-small`,x:`490`,y:`318`,"text-anchor":`middle`},`outputs so far + positions`,-1),W[2]||=o(`path`,{class:`dl-dg-arrow`,"marker-end":`url(#tv2s4-full)`,d:`M490 310 V302`},null,-1),W[3]||=o(`path`,{class:`dl-dg-arrow is-k dl-dg-flow`,d:`M170 120 V104 H345`},null,-1),W[4]||=o(`path`,{class:`dl-dg-arrow is-k dl-dg-flow`,"marker-end":`url(#tv2s4-full-k)`,d:`M345 104 V111 H388`},null,-1),W[5]||=o(`path`,{class:`dl-dg-arrow is-k dl-dg-flow`,"marker-end":`url(#tv2s4-full-k)`,d:`M345 104 V245 H388`},null,-1),r(G,{path:`M170 120 V104 H345 V111 H388`,role:`k`,dur:2}),r(G,{path:`M170 120 V104 H345 V245 H388`,role:`v`,dur:2.6,delay:1}),r(G,{path:`M490 312 V40`,role:`dec`,dur:3}),W[6]||=o(`text`,{class:`dl-dg-small is-k`,x:`186`,y:`97`},`K, V for every decoder`,-1)])),[[K]]),e((p(),c(`g`,null,[...W[7]||=[o(`path`,{class:`dl-dg-arrow`,"marker-end":`url(#tv2s4-full)`,d:`M490 40 V32`},null,-1),o(`rect`,{class:`dl-dg-box`,x:`390`,y:`8`,width:`200`,height:`22`,rx:`3`},null,-1),o(`text`,{class:`dl-dg-small`,x:`490`,y:`23`,"text-anchor":`middle`},`linear → softmax: next word`,-1)]])),[[K]])]))])]),_:1},16)}}};export{W as default};
transformer-v2/class/assets/md-DqDqvOgd.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,Q as n,S as r,V as i,W as a,_ as o,_t as s,b as c,m as l,v as u,x as d,xt as f,yt as p,z as m}from"./modules/shiki-BFOesOFp.js";import{n as h,t as g}from"./slidev/context-ChHKJoK9.js";import{t as _}from"./FlowDot-CpcqfMjQ.js";import{t as v}from"./default-DNkhSshI.js";var y={class:`mt-1 flex justify-center`},b={viewBox:`0 0 660 210`,class:`dl-diagram`,role:`img`,"aria-label":`X, two rows of four numbers, times W_Q, four rows of two, gives Q, two rows of two. The same X times W_K and W_V gives K and V`},x=[`x`,`y`],S=[`x`,`y`],C=[`x`,`y`],w=[`x`,`y`],T=[`x`,`y`],E=[`x`,`y`],D=[`x`,`y`],O=[`x`,`y`],k=[`x`,`y`],A=[`x`,`y`],j={class:`mt-2 dl-callout`},M={__name:`class.md__slidev_18`,setup(M){let{$slidev:N,$nav:P,$clicksContext:F,$clicks:I,$page:L,$renderContext:R,$frontmatter:z}=h();return F.setup(),(h,M)=>{let N=_,P=a(`click`);return m(),u(v,p(t(s(g)(s(z),17))),{default:n(()=>[M[15]||=o(`h1`,null,`Every word at once: matrices`,-1),M[16]||=o(`p`,null,[d(`Stack the word vectors as the rows of one matrix `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,null,`X`)]),o(`annotation`,{encoding:`application/x-tex`},`X`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0785em`}},`X`)])])]),d(`. One product per matrix gives every query, key and value at once.`)],-1),o(`div`,y,[(m(),c(`svg`,b,[M[5]||=o(`defs`,null,[o(`marker`,{id:`tv2s2-mat-q`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[o(`path`,{class:`dl-dg-head is-q`,d:`M0 0 L7 3.5 L0 7 z`})]),o(`marker`,{id:`tv2s2-mat-k`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[o(`path`,{class:`dl-dg-head is-k`,d:`M0 0 L7 3.5 L0 7 z`})]),o(`marker`,{id:`tv2s2-mat-v`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[o(`path`,{class:`dl-dg-head is-v`,d:`M0 0 L7 3.5 L0 7 z`})])],-1),M[6]||=o(`path`,{class:`dl-dg-arrow is-q dl-dg-flow`,"marker-end":`url(#tv2s2-mat-q)`,d:`M150 40 C 205 12, 320 12, 368 40`},null,-1),r(N,{path:`M150 40 C 205 12, 320 12, 368 40`,role:`q`,dur:2}),M[7]||=o(`text`,{class:`dl-dg-small`,x:`84`,y:`62`,"text-anchor":`end`},`Thinking`,-1),M[8]||=o(`text`,{class:`dl-dg-small`,x:`84`,y:`88`,"text-anchor":`end`},`Machines`,-1),(m(),c(l,null,i([[1,0,1,0],[0,1,0,1]],(e,t)=>o(`g`,{key:`x`+t},[(m(!0),c(l,null,i(e,(e,n)=>(m(),c(`g`,{key:n},[o(`rect`,{class:`dl-dg-box`,x:90+n*30,y:44+t*26,width:`30`,height:`26`},null,8,x),o(`text`,{class:`dl-dg-lab is-sm`,x:105+n*30,y:62+t*26,"text-anchor":`middle`},f(e),9,S)]))),128))])),64)),M[9]||=o(`text`,{class:`dl-dg-small`,x:`150`,y:`118`,"text-anchor":`middle`},`X (2 × 4)`,-1),M[10]||=o(`text`,{class:`dl-dg-lab`,x:`226`,y:`76`,"text-anchor":`middle`},`×`,-1),(m(),c(l,null,i([[1,0],[0,1],[0,1],[0,0]],(e,t)=>o(`g`,{key:`w`+t},[(m(!0),c(l,null,i(e,(e,n)=>(m(),c(`g`,{key:n},[o(`rect`,{class:`dl-dg-box is-q`,x:244+n*30,y:26+t*22,width:`30`,height:`22`},null,8,C),o(`text`,{class:`dl-dg-lab is-sm`,x:259+n*30,y:42+t*22,"text-anchor":`middle`},f(e),9,w)]))),128))])),64)),M[11]||=o(`text`,{class:`dl-dg-small is-q`,x:`274`,y:`130`,"text-anchor":`middle`},`W_Q (4 × 2)`,-1),M[12]||=o(`text`,{class:`dl-dg-lab`,x:`324`,y:`76`,"text-anchor":`middle`},`=`,-1),(m(),c(l,null,i([[1,1],[0,1]],(e,t)=>o(`g`,{key:`q`+t},[(m(!0),c(l,null,i(e,(e,n)=>(m(),c(`g`,{key:n},[o(`rect`,{class:`dl-dg-box is-q`,x:344+n*30,y:44+t*26,width:`30`,height:`26`},null,8,T),o(`text`,{class:`dl-dg-lab is-sm`,x:359+n*30,y:62+t*26,"text-anchor":`middle`},f(e),9,E)]))),128))])),64)),M[13]||=o(`text`,{class:`dl-dg-small is-q`,x:`374`,y:`118`,"text-anchor":`middle`},`Q (2 × 2)`,-1),e((m(),c(`g`,null,[M[0]||=o(`path`,{class:`dl-dg-arrow is-k dl-dg-flow`,"marker-end":`url(#tv2s2-mat-k)`,d:`M150 40 C 230 4, 420 4, 474 40`},null,-1),M[1]||=o(`path`,{class:`dl-dg-arrow is-v dl-dg-flow`,"marker-end":`url(#tv2s2-mat-v)`,d:`M150 40 C 250 -2, 520 -2, 584 40`},null,-1),r(N,{path:`M150 40 C 230 4, 420 4, 474 40`,role:`k`,dur:2.2,delay:.7}),r(N,{path:`M150 40 C 250 -2, 520 -2, 584 40`,role:`v`,dur:2.4,delay:1.4}),(m(),c(l,null,i([[2,2],[1,0]],(e,t)=>o(`g`,{key:`k`+t},[(m(!0),c(l,null,i(e,(e,n)=>(m(),c(`g`,{key:n},[o(`rect`,{class:`dl-dg-box is-k`,x:450+n*30,y:44+t*26,width:`30`,height:`26`},null,8,D),o(`text`,{class:`dl-dg-lab is-sm`,x:465+n*30,y:62+t*26,"text-anchor":`middle`},f(e),9,O)]))),128))])),64)),M[2]||=o(`text`,{class:`dl-dg-small is-k`,x:`480`,y:`118`,"text-anchor":`middle`},`K = X W_K`,-1),(m(),c(l,null,i([[2,0],[0,2]],(e,t)=>o(`g`,{key:`v`+t},[(m(!0),c(l,null,i(e,(e,n)=>(m(),c(`g`,{key:n},[o(`rect`,{class:`dl-dg-box is-v`,x:560+n*30,y:44+t*26,width:`30`,height:`26`},null,8,k),o(`text`,{class:`dl-dg-lab is-sm`,x:575+n*30,y:62+t*26,"text-anchor":`middle`},f(e),9,A)]))),128))])),64)),M[3]||=o(`text`,{class:`dl-dg-small is-v`,x:`590`,y:`118`,"text-anchor":`middle`},`V = X W_V`,-1)])),[[P]]),e((m(),c(`g`,null,[...M[4]||=[o(`line`,{class:`dl-dg-split`,x1:`10`,y1:`150`,x2:`650`,y2:`150`},null,-1),o(`text`,{class:`dl-dg-small`,x:`330`,y:`174`,"text-anchor":`middle`},`row 1 of Q, K and V belongs to Thinking, row 2 to Machines`,-1),o(`text`,{class:`dl-dg-small is-good`,x:`330`,y:`196`,"text-anchor":`middle`},`the same three weight matrices serve every word`,-1)]])),[[P]])]))]),e((m(),c(`div`,j,[...M[14]||=[o(`p`,null,[d(`Three matrix products replace step 1 for `),o(`strong`,null,`every word at once`),d(`. A computer does this fast, in parallel.`)],-1)]])),[[P]])]),_:1},16)}}};export{M as default};
transformer-v2/class/assets/md-DqOsl9vh2.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,Q as n,S as r,V as i,W as a,_ as o,_t as s,b as c,m as l,v as u,x as d,xt as f,yt as p,z as m}from"./modules/shiki-BFOesOFp.js";import{n as h,t as g}from"./slidev/context-ChHKJoK9.js";import{t as _}from"./FlowDot-CpcqfMjQ.js";import{t as v}from"./default-DNkhSshI.js";var y={class:`mt-1 flex justify-center`},b={viewBox:`0 0 640 250`,class:`dl-diagram`,role:`img`,"aria-label":`Three word vectors enter an encoder; in self-attention the three paths are joined by lines; in the feed-forward network each path has its own copy of the same network`},x=[`x`],S=[`x`],C=[`d`],w=[`d`],T=[`d`],E=[`x`],D=[`x`],O={class:`dl-callout`},k={__name:`class.md__slidev_8`,setup(k){let{$slidev:A,$nav:j,$clicksContext:M,$clicks:N,$page:P,$renderContext:F,$frontmatter:I}=h();return M.setup(),(h,k)=>{let A=_,j=a(`click`);return m(),u(v,p(t(s(g)(s(I),7))),{default:n(()=>[k[8]||=o(`h1`,null,`A list of vectors flows up the stack`,-1),o(`div`,y,[(m(),c(`svg`,b,[k[4]||=o(`defs`,null,[o(`marker`,{id:`tv2s0-flow`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[o(`path`,{class:`dl-dg-head is-enc`,d:`M0 0 L7 3.5 L0 7 z`})])],-1),(m(),c(l,null,i([`je`,`suis`,`étudiant`],(e,t)=>o(`g`,{key:e},[o(`text`,{class:`dl-dg-small`,x:150+t*170,y:`244`,"text-anchor":`middle`},f(e),9,x),(m(),c(l,null,i(4,e=>o(`rect`,{key:e,class:`dl-dg-box is-accent`,x:114+t*170+(e-1)*18,y:`208`,width:`16`,height:`16`,rx:`2`},null,8,S)),64)),o(`path`,{class:`dl-dg-arrow is-enc dl-dg-flow`,"marker-end":`url(#tv2s0-flow)`,d:`M${150+t*170} 206 V176`},null,8,C),o(`path`,{class:`dl-dg-arrow is-enc dl-dg-flow`,"marker-end":`url(#tv2s0-flow)`,d:`M${150+t*170} 128 V96`},null,8,w),o(`path`,{class:`dl-dg-arrow is-enc dl-dg-flow`,"marker-end":`url(#tv2s0-flow)`,d:`M${150+t*170} 52 V18`},null,8,T),r(A,{path:`M${150+t*170} 206 V178`,role:`enc`,dur:.9,delay:t*.3},null,8,[`path`,`delay`]),r(A,{path:`M${150+t*170} 128 V98`,role:`enc`,dur:.9,delay:.3+t*.3},null,8,[`path`,`delay`]),r(A,{path:`M${150+t*170} 52 V20`,role:`enc`,dur:.9,delay:.6+t*.3},null,8,[`path`,`delay`])])),64)),k[5]||=o(`rect`,{class:`dl-dg-box`,x:`90`,y:`130`,width:`460`,height:`44`,rx:`6`},null,-1),k[6]||=o(`text`,{class:`dl-dg-small`,x:`566`,y:`156`},`self-attention`,-1),e((m(),c(`g`,null,[k[0]||=o(`path`,{class:`dl-dg-line dl-dg-flow is-slow`,d:`M150 152 L320 152 L490 152`},null,-1),k[1]||=o(`path`,{class:`dl-dg-line dl-dg-flow is-slow`,d:`M150 152 C 220 136, 420 136, 490 152`},null,-1),r(A,{path:`M150 152 L320 152 L490 152 L320 152 Z`,dur:3,r:4}),r(A,{path:`M490 152 C 420 136, 220 136, 150 152 C 220 136, 420 136, 490 152`,dur:3.4,r:4}),k[2]||=o(`text`,{class:`dl-dg-small is-good`,x:`320`,y:`169`,"text-anchor":`middle`},`paths depend on each other`,-1)])),[[j]]),(m(),c(l,null,i(3,e=>o(`g`,{key:`f${e}`},[o(`rect`,{class:`dl-dg-box`,x:100+(e-1)*170,y:`54`,width:`100`,height:`40`,rx:`5`},null,8,E),o(`text`,{class:`dl-dg-small`,x:150+(e-1)*170,y:`78`,"text-anchor":`middle`},`feed-forward`,8,D)])),64)),e((m(),c(`g`,null,[...k[3]||=[o(`text`,{class:`dl-dg-small is-good`,x:`320`,y:`112`,"text-anchor":`middle`},`same network, each word alone — run all three at once`,-1)]])),[[j]])]))]),e((m(),c(`div`,O,[...k[7]||=[o(`p`,null,[d(`Each word keeps its `),o(`strong`,null,`own path`),d(` through the encoder. Only self-attention connects the paths.`)],-1)]])),[[j]])]),_:1},16)}}};export{k as default};
transformer-v2/class/assets/md-DudY36k42.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,Q as n,S as r,W as i,_ as a,_t as o,b as s,v as c,x as l,yt as u,z as d}from"./modules/shiki-BFOesOFp.js";import{n as f,t as p}from"./slidev/context-ChHKJoK9.js";import{t as m}from"./FlowDot-CpcqfMjQ.js";import{t as h}from"./default-DNkhSshI.js";import{t as g}from"./slidev/VClicks-DR1s1I9G.js";var _={class:`mt-2 flex justify-center`},v={viewBox:`0 0 660 250`,class:`dl-diagram`,role:`img`,"aria-label":`A French sentence goes into a box labelled transformer and an English sentence comes out; opened, the box holds an encoder part and a decoder part`},y={__name:`class.md__slidev_4`,setup(y){let{$slidev:b,$nav:x,$clicksContext:S,$clicks:C,$page:w,$renderContext:T,$frontmatter:E}=f();return S.setup(),(f,y)=>{let b=m,x=g,S=i(`click`);return d(),c(h,u(t(o(p)(o(E),3))),{default:n(()=>[y[20]||=a(`h1`,null,`A black box that translates`,-1),a(`div`,_,[(d(),s(`svg`,v,[y[12]||=a(`defs`,null,[a(`marker`,{id:`tv2s0-box`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[a(`path`,{class:`dl-dg-head`,d:`M0 0 L7 3.5 L0 7 z`})]),a(`marker`,{id:`tv2s0-box-enc`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[a(`path`,{class:`dl-dg-head is-enc`,d:`M0 0 L7 3.5 L0 7 z`})]),a(`marker`,{id:`tv2s0-box-dec`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[a(`path`,{class:`dl-dg-head is-dec`,d:`M0 0 L7 3.5 L0 7 z`})])],-1),y[13]||=a(`text`,{class:`dl-dg-lab is-sm is-enc`,x:`70`,y:`58`,"text-anchor":`middle`},`je suis étudiant`,-1),y[14]||=a(`path`,{class:`dl-dg-arrow is-enc dl-dg-flow`,"marker-end":`url(#tv2s0-box-enc)`,d:`M140 54 H200`},null,-1),r(b,{path:`M140 54 H200`,role:`enc`,dur:1.2}),y[15]||=a(`rect`,{class:`dl-dg-box is-accent`,x:`206`,y:`22`,width:`248`,height:`64`,rx:`8`},null,-1),y[16]||=a(`text`,{class:`dl-dg-in`,x:`330`,y:`59`,"text-anchor":`middle`},`TRANSFORMER`,-1),y[17]||=a(`path`,{class:`dl-dg-arrow is-dec dl-dg-flow`,"marker-end":`url(#tv2s0-box-dec)`,d:`M454 54 H514`},null,-1),r(b,{path:`M454 54 H514`,role:`dec`,dur:1.2,delay:.6}),y[18]||=a(`text`,{class:`dl-dg-lab is-sm is-dec`,x:`588`,y:`58`,"text-anchor":`middle`},`i am a student`,-1),e((d(),s(`g`,null,[y[0]||=a(`line`,{class:`dl-dg-split`,x1:`10`,y1:`108`,x2:`650`,y2:`108`},null,-1),y[1]||=a(`text`,{class:`dl-dg-small`,x:`330`,y:`128`,"text-anchor":`middle`},`open the box`,-1),y[2]||=a(`rect`,{class:`dl-dg-box`,x:`206`,y:`144`,width:`248`,height:`96`,rx:`8`},null,-1),y[3]||=a(`rect`,{class:`dl-dg-box is-enc`,x:`222`,y:`166`,width:`96`,height:`56`,rx:`5`},null,-1),y[4]||=a(`text`,{class:`dl-dg-in is-enc`,x:`270`,y:`199`,"text-anchor":`middle`},`ENCODERS`,-1),y[5]||=a(`rect`,{class:`dl-dg-box is-dec`,x:`342`,y:`166`,width:`96`,height:`56`,rx:`5`},null,-1),y[6]||=a(`text`,{class:`dl-dg-in is-dec`,x:`390`,y:`199`,"text-anchor":`middle`},`DECODERS`,-1),y[7]||=a(`path`,{class:`dl-dg-arrow is-enc dl-dg-flow`,"marker-end":`url(#tv2s0-box-enc)`,d:`M318 194 H340`},null,-1),y[8]||=a(`text`,{class:`dl-dg-lab is-sm is-enc`,x:`70`,y:`198`,"text-anchor":`middle`},`je suis étudiant`,-1),y[9]||=a(`path`,{class:`dl-dg-arrow is-enc dl-dg-flow`,"marker-end":`url(#tv2s0-box-enc)`,d:`M140 194 H220`},null,-1),r(b,{path:`M140 194 H220`,role:`enc`,dur:1.2}),r(b,{path:`M318 194 H340`,role:`enc`,dur:.8}),y[10]||=a(`path`,{class:`dl-dg-arrow is-dec dl-dg-flow`,"marker-end":`url(#tv2s0-box-dec)`,d:`M438 194 H514`},null,-1),r(b,{path:`M438 194 H514`,role:`dec`,dur:1.2,delay:.6}),y[11]||=a(`text`,{class:`dl-dg-lab is-sm is-dec`,x:`588`,y:`198`,"text-anchor":`middle`},`i am a student`,-1)])),[[S]])]))]),r(x,null,{default:n(()=>[...y[19]||=[a(`ul`,null,[a(`li`,null,[l(`The `),a(`strong`,null,`encoder`),l(` part reads the whole input sentence`)]),a(`li`,null,[l(`The `),a(`strong`,null,`decoder`),l(` part writes the output sentence, using what the encoder found`)])],-1)]]),_:1})]),_:1},16)}}};export{y as default};
transformer-v2/class/assets/md-DwsE30sf.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,Q as n,S as r,V as i,W as a,_ as o,_t as s,b as c,m as l,v as u,x as d,xt as f,yt as p,z as m}from"./modules/shiki-BFOesOFp.js";import{n as h,t as g}from"./slidev/context-ChHKJoK9.js";import{t as _}from"./FlowDot-CpcqfMjQ.js";import{t as v}from"./default-DNkhSshI.js";var y={class:`mt-1 flex justify-center`},b={viewBox:`0 0 660 200`,class:`dl-diagram`,role:`img`,"aria-label":`Thinking at position 0: 1 0 1 0 plus 0 1 0 1 equals 1 1 1 1. Machines at position 1: 0 1 0 1 plus 0.84 0.54 0.01 1.00 equals 0.84 1.54 0.01 2.00`},x=[`x`],S=[`x`],C=[`x`],w=[`x`],T=[`x`],E=[`x`],D={class:`dl-dg-small is-good`,x:`330`,y:`190`,"text-anchor":`middle`},O={class:`mt-1 dl-callout`},k={__name:`class.md__slidev_24`,setup(k){let{$slidev:A,$nav:j,$clicksContext:M,$clicks:N,$page:P,$renderContext:F,$frontmatter:I}=h();return M.setup(),(h,k)=>{let A=_,j=a(`click`);return m(),u(v,p(t(s(g)(s(I),23))),{default:n(()=>[k[7]||=o(`h1`,null,`Add a position vector`,-1),k[8]||=o(`p`,null,[d(`Before the first layer, add a fixed `),o(`strong`,null,`position vector`),d(` to each word’s embedding. Same width, so nothing else changes.`)],-1),o(`div`,y,[(m(),c(`svg`,b,[k[1]||=o(`text`,{class:`dl-dg-small`,x:`10`,y:`54`},`embedding`,-1),k[2]||=o(`text`,{class:`dl-dg-small is-pos`,x:`10`,y:`104`},`+ position`,-1),k[3]||=o(`text`,{class:`dl-dg-small`,x:`10`,y:`154`},`= input`,-1),k[4]||=o(`text`,{class:`dl-dg-lab is-sm`,x:`218`,y:`20`,"text-anchor":`middle`},`Thinking · position 0`,-1),k[5]||=o(`text`,{class:`dl-dg-lab is-sm`,x:`498`,y:`20`,"text-anchor":`middle`},`Machines · position 1`,-1),(m(),c(l,null,i([[[1,0,1,0],[0,1,0,1],[1,1,1,1]],[[0,1,0,1],[`0.84`,`0.54`,`0.01`,`1.00`],[`0.84`,`1.54`,`0.01`,`2.00`]]],(t,n)=>o(`g`,{key:n},[(m(),c(l,null,i(4,e=>o(`g`,{key:`e`+e},[o(`rect`,{class:`dl-dg-box`,x:120+n*280+(e-1)*49,y:`34`,width:`49`,height:`28`},null,8,x),o(`text`,{class:`dl-dg-lab is-sm`,x:144+n*280+(e-1)*49,y:`53`,"text-anchor":`middle`},f(t[0][e-1]),9,S)])),64)),e((m(),c(`g`,null,[(m(),c(l,null,i(4,e=>o(`g`,{key:`p`+e},[o(`rect`,{class:`dl-dg-fill is-pos`,x:120+n*280+(e-1)*49,y:`84`,width:`49`,height:`28`},null,8,C),o(`text`,{class:`dl-dg-lab is-sm`,x:144+n*280+(e-1)*49,y:`103`,"text-anchor":`middle`},f(t[1][e-1]),9,w)])),64))])),[[j,1]]),e((m(),c(`g`,null,[(m(),c(l,null,i(4,e=>r(A,{key:`d`+e,path:`M${144+n*280+(e-1)*49} 112 V134`,role:`pos`,r:3.5,dur:1.1,delay:(e-1)*.25},null,8,[`path`,`delay`])),64)),(m(),c(l,null,i(4,e=>o(`g`,{key:`s`+e},[o(`rect`,{class:`dl-dg-box is-accent`,x:120+n*280+(e-1)*49,y:`134`,width:`49`,height:`28`},null,8,T),o(`text`,{class:`dl-dg-lab is-sm`,x:144+n*280+(e-1)*49,y:`153`,"text-anchor":`middle`},f(t[2][e-1]),9,E)])),64))])),[[j,2]])])),64)),e((m(),c(`text`,D,[...k[0]||=[d(`the input now says what the word is and where it stands`,-1)]])),[[j,2]])]))]),e((m(),c(`div`,O,[...k[6]||=[o(`p`,null,[d(`The position vectors are `),o(`strong`,null,`not learned`),d(`. Each one follows a fixed pattern of sine and cosine waves.`)],-1)]])),[[j,3]])]),_:1},16)}}};export{k as default};
transformer-v2/class/assets/md-JRz44VMn.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,Q as n,S as r,W as i,_ as a,_t as o,b as s,v as c,yt as l,z as u}from"./modules/shiki-BFOesOFp.js";import{n as d,t as f}from"./slidev/context-ChHKJoK9.js";import{t as p}from"./TransformerGlyph-XWvPPlsx.js";import{t as m}from"./default-DNkhSshI.js";var h={class:`grid grid-cols-4 gap-x-4 gap-y-2 mt-2`},g={class:`flex flex-col items-center text-center gap-1`},_={class:`flex flex-col items-center text-center gap-1`},v={class:`flex flex-col items-center text-center gap-1`},y={class:`flex flex-col items-center text-center gap-1`},b={class:`flex flex-col items-center text-center gap-1`},x={class:`flex flex-col items-center text-center gap-1`},S={class:`flex flex-col items-center text-center gap-1`},C={class:`flex flex-col items-center text-center gap-1`},w={class:`mt-2 dl-callout`},T={__name:`class.md__slidev_2`,setup(T){let{$slidev:E,$nav:D,$clicksContext:O,$clicks:k,$page:A,$renderContext:j,$frontmatter:M}=d();return O.setup(),(d,T)=>{let E=p,D=i(`click`);return u(),c(m,l(t(o(f)(o(M),1))),{default:n(()=>[T[9]||=a(`h1`,null,`Today, in eight parts`,-1),T[10]||=a(`p`,null,`The whole machine, its core step, then the parts around it.`,-1),a(`div`,h,[a(`div`,g,[r(E,{kind:`encdec`,size:56}),T[0]||=a(`span`,{class:`dl-secondary`},`00 The big picture`,-1)]),a(`div`,_,[r(E,{kind:`qkv`,size:56}),T[1]||=a(`span`,{class:`dl-secondary`},`01 Self-attention`,-1)]),a(`div`,v,[r(E,{kind:`heads`,size:56}),T[2]||=a(`span`,{class:`dl-secondary`},`02 Matrices and many heads`,-1)]),a(`div`,y,[r(E,{kind:`position`,size:56}),T[3]||=a(`span`,{class:`dl-secondary`},`03 Word order`,-1)]),a(`div`,b,[r(E,{kind:`block`,size:56}),T[4]||=a(`span`,{class:`dl-secondary`},`04 Add & norm`,-1)]),a(`div`,x,[r(E,{kind:`decoder`,size:56}),T[5]||=a(`span`,{class:`dl-secondary`},`05 The decoder side`,-1)]),a(`div`,S,[r(E,{kind:`train`,size:56}),T[6]||=a(`span`,{class:`dl-secondary`},`06 Training and decoding`,-1)]),a(`div`,C,[r(E,{kind:`encdec`,size:56}),T[7]||=a(`span`,{class:`dl-secondary`},`07 Recap`,-1)])]),e((u(),s(`div`,w,[...T[8]||=[a(`p`,null,`Section 01 is the heart: one word’s output, computed by hand.`,-1)]])),[[D]])]),_:1},16)}}};export{T as default};
transformer-v2/class/assets/md-KUcQvTcE2.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,Q as n,S as r,V as i,W as a,_ as o,_t as s,b as c,m as l,v as u,vt as d,x as f,xt as p,yt as m,z as h}from"./modules/shiki-BFOesOFp.js";import{n as g,t as _}from"./slidev/context-ChHKJoK9.js";import{t as v}from"./FlowDot-CpcqfMjQ.js";import{t as y}from"./default-DNkhSshI.js";import{t as b}from"./slidev/VClicks-DR1s1I9G.js";var x={class:`grid grid-cols-[1.3fr_1fr] gap-8 mt-1 items-center`},S={viewBox:`0 0 400 230`,class:`dl-diagram`,role:`img`,"aria-label":`An embedding table with one row per vocabulary word; looking up a word returns its row, a vector of numbers`},C=[`y`],w=[`x`,`y`],T=[`x`],E=[`x`],D={__name:`class.md__slidev_7`,setup(D){let{$slidev:O,$nav:k,$clicksContext:A,$clicks:j,$page:M,$renderContext:N,$frontmatter:P}=g();return A.setup(),(g,D)=>{let O=v,k=b,A=a(`click`);return h(),u(y,m(t(s(_)(s(P),6))),{default:n(()=>[D[7]||=o(`h1`,null,`Refresher: a word becomes a vector`,-1),o(`div`,x,[o(`div`,null,[(h(),c(`svg`,S,[D[4]||=o(`defs`,null,[o(`marker`,{id:`tv2s0-emb`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[o(`path`,{class:`dl-dg-head is-accent`,d:`M0 0 L7 3.5 L0 7 z`})])],-1),D[5]||=o(`text`,{class:`dl-dg-small`,x:`150`,y:`14`,"text-anchor":`middle`},`embedding table (learned)`,-1),(h(),c(l,null,i([`…`,`je`,`machines`,`suis`,`thinking`,`…`],(e,t)=>o(`g`,{key:t},[o(`text`,{class:`dl-dg-small`,x:`70`,y:44+t*30,"text-anchor":`end`},p(e),9,C),(h(),c(l,null,i(4,e=>o(`rect`,{key:e,class:d(t===4?`dl-dg-box is-accent`:`dl-dg-box`),x:80+(e-1)*34,y:28+t*30,width:`30`,height:`22`,rx:`2`},null,10,w)),64))])),64)),e((h(),c(`g`,null,[D[0]||=o(`rect`,{class:`dl-dg-fill dl-dg-pulse`,x:`76`,y:`144`,width:`140`,height:`30`,rx:`4`,style:{fill:`none`}},null,-1),D[1]||=o(`path`,{class:`dl-dg-arrow is-accent dl-dg-flow`,"marker-end":`url(#tv2s0-emb)`,d:`M220 159 H262`},null,-1),r(O,{path:`M220 159 H260`,dur:.9}),(h(),c(l,null,i([1,0,1,0],(e,t)=>o(`rect`,{key:`x${t}`,class:`dl-dg-box is-accent`,x:270+t*30,y:`146`,width:`26`,height:`26`,rx:`2`},null,8,T)),64)),(h(),c(l,null,i([1,0,1,0],(e,t)=>o(`text`,{key:`t${t}`,class:`dl-dg-small`,x:283+t*30,y:`164`,"text-anchor":`middle`},p(e),9,E)),64)),D[2]||=o(`text`,{class:`dl-dg-lab is-sm`,x:`330`,y:`196`,"text-anchor":`middle`},`x₁ for "Thinking"`,-1),D[3]||=o(`text`,{class:`dl-dg-small`,x:`330`,y:`214`,"text-anchor":`middle`},`toy: 4 numbers · paper: 512`,-1)])),[[A]])]))]),o(`div`,null,[r(k,null,{default:n(()=>[...D[6]||=[o(`ul`,null,[o(`li`,null,[f(`A network needs `),o(`strong`,null,`numbers`),f(`, not words`)]),o(`li`,null,[f(`An `),o(`strong`,null,`embedding table`),f(` has one row of numbers per word`)]),o(`li`,null,[f(`Looking up a word returns its row: a `),o(`strong`,null,`vector`)]),o(`li`,null,[f(`The rows are `),o(`strong`,null,`learned`),f(` in training, like any weight`)])],-1)]]),_:1})])])]),_:1},16)}}};export{D as default};
transformer-v2/class/assets/md-NSW4bfl4.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,Q as n,S as r,W as i,_ as a,_t as o,b as s,v as c,x as l,yt as u,z as d}from"./modules/shiki-BFOesOFp.js";import{n as f,t as p}from"./slidev/context-ChHKJoK9.js";import{t as m}from"./interactive-BWtflKDO.js";import{t as h}from"./ItAttention-Bn_pC1Mv.js";import{t as g}from"./slidev/VClicks-DR1s1I9G.js";var _={class:`mt-2 dl-callout`},v={__name:`class.md__slidev_20`,setup(v){let{$slidev:y,$nav:b,$clicksContext:x,$clicks:S,$page:C,$renderContext:w,$frontmatter:T}=f();return x.setup(),(f,v)=>{let y=h,b=g,x=i(`click`);return d(),c(m,u(t(o(p)(o(T),19))),{aside:n(t=>[v[2]||=a(`p`,null,[l(`One softmax gives `),a(`strong`,null,`one`),l(` set of weights. `),a(`em`,null,`It`),l(` needs two: `),a(`strong`,null,`who`),l(` is it, and `),a(`strong`,null,`what`),l(` is it?`)],-1),r(b,null,{default:n(()=>[...v[0]||=[a(`ul`,null,[a(`li`,null,[l(`Head 1 puts 0.55 on `),a(`em`,null,`animal`)]),a(`li`,null,[l(`Head 2 puts 0.45 on `),a(`em`,null,`tired`)]),a(`li`,null,`Each head has its own query, key and value weights`)],-1)]]),_:1}),e((d(),s(`div`,_,[...v[1]||=[a(`p`,null,`Several heads look in several places at once.`,-1)]])),[[x]])]),default:n(()=>[r(y,{head:`both`,switchable:!0})]),_:1},16)}}};export{v as default};
transformer-v2/class/assets/md-OYW6iyOh2.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,Q as n,S as r,W as i,_ as a,_t as o,b as s,v as c,x as l,yt as u,z as d}from"./modules/shiki-BFOesOFp.js";import{n as f,t as p}from"./slidev/context-ChHKJoK9.js";import{t as m}from"./FlowDot-CpcqfMjQ.js";import{t as h}from"./default-DNkhSshI.js";var g={class:`mt-1 flex justify-center`},_={viewBox:`0 0 660 256`,class:`dl-diagram`,role:`img`,"aria-label":`The encoder stack reads je suis étudiant once; its top output is turned into keys and values that go to every one of the six decoders`},v={class:`mt-1 dl-callout`},y={__name:`class.md__slidev_29`,setup(y){let{$slidev:b,$nav:x,$clicksContext:S,$clicks:C,$page:w,$renderContext:T,$frontmatter:E}=f();return S.setup(),(f,y)=>{let b=m,x=i(`click`);return d(),c(h,u(t(o(p)(o(E),28))),{default:n(()=>[y[39]||=a(`h1`,null,`The encoder hands over keys and values`,-1),a(`div`,g,[(d(),s(`svg`,_,[y[6]||=a(`defs`,null,[a(`marker`,{id:`tv2s5-kv-enc`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[a(`path`,{class:`dl-dg-head is-enc`,d:`M0 0 L7 3.5 L0 7 z`})]),a(`marker`,{id:`tv2s5-kv-dec`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[a(`path`,{class:`dl-dg-head is-dec`,d:`M0 0 L7 3.5 L0 7 z`})]),a(`marker`,{id:`tv2s5-kv-k`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[a(`path`,{class:`dl-dg-head is-k`,d:`M0 0 L7 3.5 L0 7 z`})])],-1),y[7]||=a(`text`,{class:`dl-dg-small is-enc`,x:`130`,y:`250`,"text-anchor":`middle`},`input: je suis étudiant`,-1),y[8]||=a(`rect`,{class:`dl-dg-box is-enc`,x:`50`,y:`204`,width:`50`,height:`24`,rx:`4`},null,-1),y[9]||=a(`rect`,{class:`dl-dg-box is-enc`,x:`105`,y:`204`,width:`50`,height:`24`,rx:`4`},null,-1),y[10]||=a(`rect`,{class:`dl-dg-box is-enc`,x:`160`,y:`204`,width:`50`,height:`24`,rx:`4`},null,-1),y[11]||=a(`text`,{class:`dl-dg-small`,x:`75`,y:`220`,"text-anchor":`middle`},`je`,-1),y[12]||=a(`text`,{class:`dl-dg-small`,x:`130`,y:`220`,"text-anchor":`middle`},`suis`,-1),y[13]||=a(`text`,{class:`dl-dg-small`,x:`185`,y:`220`,"text-anchor":`middle`},`étudiant`,-1),y[14]||=a(`path`,{class:`dl-dg-arrow is-enc dl-dg-flow is-slow`,"marker-end":`url(#tv2s5-kv-enc)`,d:`M130 202 V186`},null,-1),y[15]||=a(`rect`,{class:`dl-dg-box is-enc`,x:`40`,y:`150`,width:`180`,height:`34`,rx:`4`},null,-1),y[16]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`130`,y:`172`,"text-anchor":`middle`},`encoder 1`,-1),y[17]||=a(`path`,{class:`dl-dg-arrow is-enc dl-dg-flow is-slow`,"marker-end":`url(#tv2s5-kv-enc)`,d:`M130 148 V134`},null,-1),y[18]||=a(`text`,{class:`dl-dg-small is-enc`,x:`130`,y:`124`,"text-anchor":`middle`},`encoders 2 to 5`,-1),y[19]||=a(`path`,{class:`dl-dg-arrow is-enc dl-dg-flow is-slow`,"marker-end":`url(#tv2s5-kv-enc)`,d:`M130 112 V98`},null,-1),y[20]||=a(`rect`,{class:`dl-dg-box is-enc`,x:`40`,y:`62`,width:`180`,height:`34`,rx:`4`},null,-1),y[21]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`130`,y:`84`,"text-anchor":`middle`},`encoder 6`,-1),y[22]||=a(`path`,{class:`dl-dg-arrow is-enc dl-dg-flow is-slow`,"marker-end":`url(#tv2s5-kv-enc)`,d:`M130 60 V44`},null,-1),y[23]||=a(`rect`,{class:`dl-dg-box is-enc`,x:`70`,y:`20`,width:`36`,height:`22`,rx:`3`},null,-1),y[24]||=a(`rect`,{class:`dl-dg-box is-enc`,x:`112`,y:`20`,width:`36`,height:`22`,rx:`3`},null,-1),y[25]||=a(`rect`,{class:`dl-dg-box is-enc`,x:`154`,y:`20`,width:`36`,height:`22`,rx:`3`},null,-1),y[26]||=a(`text`,{class:`dl-dg-small`,x:`130`,y:`13`,"text-anchor":`middle`},`one vector per input word`,-1),y[27]||=a(`rect`,{class:`dl-dg-box is-dec`,x:`440`,y:`150`,width:`180`,height:`34`,rx:`4`},null,-1),y[28]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`530`,y:`172`,"text-anchor":`middle`},`decoder 1`,-1),y[29]||=a(`path`,{class:`dl-dg-arrow is-dec`,"marker-end":`url(#tv2s5-kv-dec)`,d:`M530 148 V134`},null,-1),y[30]||=a(`text`,{class:`dl-dg-small is-dec`,x:`530`,y:`124`,"text-anchor":`middle`},`decoders 2 to 5`,-1),y[31]||=a(`path`,{class:`dl-dg-arrow is-dec`,"marker-end":`url(#tv2s5-kv-dec)`,d:`M530 112 V98`},null,-1),y[32]||=a(`rect`,{class:`dl-dg-box is-dec`,x:`440`,y:`62`,width:`180`,height:`34`,rx:`4`},null,-1),y[33]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`530`,y:`84`,"text-anchor":`middle`},`decoder 6`,-1),y[34]||=a(`path`,{class:`dl-dg-arrow is-dec`,"marker-end":`url(#tv2s5-kv-dec)`,d:`M530 60 V44`},null,-1),y[35]||=a(`text`,{class:`dl-dg-small is-dec`,x:`530`,y:`34`,"text-anchor":`middle`},`the next output word`,-1),y[36]||=a(`path`,{class:`dl-dg-arrow is-dec`,"marker-end":`url(#tv2s5-kv-dec)`,d:`M530 230 V186`},null,-1),y[37]||=a(`text`,{class:`dl-dg-small is-dec`,x:`530`,y:`248`,"text-anchor":`middle`},`output so far: ⟨start⟩ …`,-1),e((d(),s(`g`,null,[y[0]||=a(`path`,{class:`dl-dg-arrow is-k dl-dg-flow`,"marker-end":`url(#tv2s5-kv-k)`,d:`M192 31 C 330 31, 330 167, 436 167`},null,-1),y[1]||=a(`path`,{class:`dl-dg-arrow is-k dl-dg-flow`,"marker-end":`url(#tv2s5-kv-k)`,d:`M192 31 C 330 31, 340 122, 436 122`},null,-1),y[2]||=a(`path`,{class:`dl-dg-arrow is-k dl-dg-flow`,"marker-end":`url(#tv2s5-kv-k)`,d:`M192 31 C 330 31, 350 79, 436 79`},null,-1),r(b,{path:`M192 31 C 330 31, 330 167, 436 167`,role:`k`,dur:2.4,delay:0}),r(b,{path:`M192 31 C 330 31, 330 167, 436 167`,role:`v`,dur:2.4,delay:1.2}),r(b,{path:`M192 31 C 330 31, 340 122, 436 122`,role:`k`,dur:2.4,delay:.4}),r(b,{path:`M192 31 C 330 31, 340 122, 436 122`,role:`v`,dur:2.4,delay:1.6}),r(b,{path:`M192 31 C 330 31, 350 79, 436 79`,role:`k`,dur:2.4,delay:.8}),r(b,{path:`M192 31 C 330 31, 350 79, 436 79`,role:`v`,dur:2.4,delay:2}),y[3]||=a(`text`,{class:`dl-dg-in`,x:`300`,y:`22`,"text-anchor":`middle`},[a(`tspan`,{style:{fill:`var(--dl-k)`}},`K`),l(` and `),a(`tspan`,{style:{fill:`var(--dl-v)`}},`V`)],-1),y[4]||=a(`text`,{class:`dl-dg-small is-good`,x:`330`,y:`200`,"text-anchor":`middle`},`the same K and V`,-1),y[5]||=a(`text`,{class:`dl-dg-small is-good`,x:`330`,y:`214`,"text-anchor":`middle`},`go to every decoder`,-1)])),[[x]])]))]),e((d(),s(`div`,v,[...y[38]||=[a(`p`,null,[l(`The encoder runs `),a(`strong`,null,`once`),l(`. Its top output becomes keys `),a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mi`,null,`K`)]),a(`annotation`,{encoding:`application/x-tex`},`K`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),a(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0715em`}},`K`)])])]),l(` and values `),a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mi`,null,`V`)]),a(`annotation`,{encoding:`application/x-tex`},`V`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.6833em`}}),a(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.2222em`}},`V`)])])]),l(` that every decoder reads.`)],-1)]])),[[x]])]),_:1},16)}}};export{y as default};
transformer-v2/class/assets/md-QCLonc1o.js ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import{$ as e,E as t,Q as n,S as r,V as i,W as a,_ as o,_t as s,b as c,m as l,v as u,vt as d,x as f,xt as p,yt as m,z as h}from"./modules/shiki-BFOesOFp.js";import{n as g,t as _}from"./slidev/context-ChHKJoK9.js";import{t as v}from"./default-DNkhSshI.js";import{t as y}from"./slidev/VClicks-DR1s1I9G.js";import{t as b}from"./slidev/KaTexBlockWrapper-Ck43xKMc.js";var x={class:`grid grid-cols-[1fr_1.05fr] gap-8 mt-1 items-start`},S={viewBox:`0 0 320 210`,class:`dl-diagram`,role:`img`,"aria-label":`Scaled scores for three decoder positions. Every cell to the right of the diagonal is minus infinity. After softmax the rows are 1 0 0, 0.5 0.5 0, and 0.79 0.11 0.11`},C=[`x`],w=[`y`],T=[`x`,`y`],E=[`x`,`y`],D={class:`dl-tight`},O={class:`dl-math-sm`},k={class:`mt-2 dl-callout`},A={__name:`class.md__slidev_31`,setup(A){let{$slidev:j,$nav:M,$clicksContext:N,$clicks:P,$page:F,$renderContext:I,$frontmatter:L}=g();return N.setup(),(g,A)=>{let j=y,M=b,N=a(`click`);return h(),u(v,m(t(s(_)(s(L),30))),{default:n(()=>[A[5]||=o(`h1`,null,`No looking ahead: the mask`,-1),o(`div`,x,[o(`div`,null,[(h(),c(`svg`,S,[A[1]||=o(`text`,{class:`dl-dg-small`,x:`10`,y:`14`},`scaled scores, one row per asking position`,-1),(h(),c(l,null,i([`⟨start⟩`,`i`,`am`],(e,t)=>o(`text`,{key:`h`+t,class:`dl-dg-small is-dec`,x:128+t*64,y:`36`,"text-anchor":`middle`},p(e),9,C)),64)),(h(),c(l,null,i([[`⟨start⟩`,[`3`,`−∞`,`−∞`]],[`i`,[`1`,`1`,`−∞`]],[`am`,[`2`,`0`,`0`]]],(e,t)=>o(`g`,{key:t},[o(`text`,{class:`dl-dg-small is-dec`,x:`88`,y:64+t*40,"text-anchor":`end`},p(e[0]),9,w),(h(!0),c(l,null,i(e[1],(e,n)=>(h(),c(`g`,{key:n},[o(`rect`,{class:d(n>t?`dl-dg-box is-bad dl-dg-pulse`:`dl-dg-box is-accent`),x:100+n*64,y:44+t*40,width:`56`,height:`32`,rx:`3`},null,10,T),o(`text`,{class:d(n>t?`dl-dg-small is-bad`:`dl-dg-lab is-sm`),x:128+n*64,y:65+t*40,"text-anchor":`middle`},p(e),11,E)]))),128))])),64)),e((h(),c(`g`,null,[...A[0]||=[o(`text`,{class:`dl-dg-small is-good`,x:`10`,y:`182`},`after softmax:`,-1),o(`text`,{class:`dl-dg-small is-good`,x:`10`,y:`198`},`1, 0, 0 · 0.5, 0.5, 0 · 0.79, 0.11, 0.11`,-1)]])),[[N]])]))]),o(`div`,D,[r(j,null,{default:n(()=>[...A[2]||=[o(`ul`,null,[o(`li`,null,[f(`In training, the decoder sees the `),o(`strong`,null,`whole`),f(` right answer at once`)]),o(`li`,null,[f(`Position `),o(`em`,null,`t`),f(` must not read the words after `),o(`em`,null,`t`),f(`: those are the answer`)]),o(`li`,null,[f(`So the future cells get `),o(`strong`,null,`−∞`),f(` before the softmax, and weight `),o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[o(`semantics`,null,[o(`mrow`,null,[o(`msup`,null,[o(`mi`,null,`e`),o(`mrow`,null,[o(`mo`,null,`−`),o(`mi`,{mathvariant:`normal`},`∞`)])]),o(`mo`,null,`=`),o(`mn`,null,`0`)]),o(`annotation`,{encoding:`application/x-tex`},`e^{-\\infty} = 0`)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.7713em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`},`e`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.7713em`}},[o(`span`,{style:{top:`-3.063em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},[o(`span`,{class:`mord mtight`},`−`),o(`span`,{class:`mord mtight`},`∞`)])])])])])])])]),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}}),o(`span`,{class:`mrel`},`=`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2778em`}})]),o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`0.6444em`}}),o(`span`,{class:`mord`},`0`)])])])])],-1)]]),_:1}),e((h(),c(`div`,O,[r(M,{ranges:[]},{default:n(()=>[...A[3]||=[o(`p`,null,[o(`span`,{class:`katex-display`},[o(`span`,{class:`katex`},[o(`span`,{class:`katex-mathml`},[o(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`,display:`block`},[o(`semantics`,null,[o(`mrow`,null,[o(`mi`,{mathvariant:`normal`},`softmax`),o(`mo`,null,`⁡`),o(`mtext`,null,` ⁣`),o(`mrow`,null,[o(`mo`,{fence:`true`},`(`),o(`mfrac`,null,[o(`mrow`,null,[o(`mi`,null,`Q`),o(`msup`,null,[o(`mi`,null,`K`),o(`mi`,{mathvariant:`normal`},`⊤`)])]),o(`msqrt`,null,[o(`msub`,null,[o(`mi`,null,`d`),o(`mi`,null,`k`)])])]),o(`mo`,null,`+`),o(`mi`,null,`M`),o(`mo`,{fence:`true`},`)`)]),o(`mi`,null,`V`)]),o(`annotation`,{encoding:`application/x-tex`},`\\operatorname{softmax}\\!\\left(\\frac{QK^\\top}{\\sqrt{d_k}} + M\\right) V `)])])]),o(`span`,{class:`katex-html`,"aria-hidden":`true`},[o(`span`,{class:`katex-base`},[o(`span`,{class:`katex-strut`,style:{height:`2.4761em`,"vertical-align":`-0.95em`}}),o(`span`,{class:`mop`},[o(`span`,{class:`mord mathrm`},`softmax`)]),o(`span`,{class:`mspace`,style:{"margin-right":`-0.1667em`}}),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`minner`},[o(`span`,{class:`mopen delimcenter`,style:{top:`0em`}},[o(`span`,{class:`delimsizing size3`},`(`)]),o(`span`,{class:`mord`},[o(`span`,{class:`mopen nulldelimiter`}),o(`span`,{class:`mfrac`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`1.5261em`}},[o(`span`,{style:{top:`-2.2528em`}},[o(`span`,{class:`pstrut`,style:{height:`3em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord sqrt`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.8572em`}},[o(`span`,{class:`svg-align`,style:{top:`-3em`}},[o(`span`,{class:`pstrut`,style:{height:`3em`}}),o(`span`,{class:`mord`,style:{"padding-left":`0.833em`}},[o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`},`d`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t vlist-t2`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.3361em`}},[o(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0315em`}},`k`)])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.15em`}},[o(`span`)])])])])])])]),o(`span`,{style:{top:`-2.8172em`}},[o(`span`,{class:`pstrut`,style:{height:`3em`}}),o(`span`,{class:`hide-tail`,style:{"min-width":`0.853em`,height:`1.08em`}},[o(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`400em`,height:`1.08em`,viewBox:`0 0 400000 1080`,preserveAspectRatio:`xMinYMin slice`},[o(`path`,{d:`M95,702
2
+ c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
3
+ c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
4
+ c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
5
+ s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
6
+ c69,-144,104.5,-217.7,106.5,-221
7
+ l0 -0
8
+ c5.3,-9.3,12,-14,20,-14
9
+ H400000v40H845.2724
10
+ s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
11
+ c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
12
+ M834 80h400000v40h-400000z`})])])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.1828em`}},[o(`span`)])])])])])]),o(`span`,{style:{top:`-3.23em`}},[o(`span`,{class:`pstrut`,style:{height:`3em`}}),o(`span`,{class:`frac-line`,style:{"border-bottom-width":`0.04em`}})]),o(`span`,{style:{top:`-3.677em`}},[o(`span`,{class:`pstrut`,style:{height:`3em`}}),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`},`Q`),o(`span`,{class:`mord`},[o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.0715em`}},`K`),o(`span`,{class:`msupsub`},[o(`span`,{class:`vlist-t`},[o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.8491em`}},[o(`span`,{style:{top:`-3.063em`,"margin-right":`0.05em`}},[o(`span`,{class:`pstrut`,style:{height:`2.7em`}}),o(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[o(`span`,{class:`mord mtight`},`⊤`)])])])])])])])])])]),o(`span`,{class:`vlist-s`},`​`)]),o(`span`,{class:`vlist-r`},[o(`span`,{class:`vlist`,style:{height:`0.93em`}},[o(`span`)])])])]),o(`span`,{class:`mclose nulldelimiter`})]),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),o(`span`,{class:`mbin`},`+`),o(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.109em`}},`M`),o(`span`,{class:`mclose delimcenter`,style:{top:`0em`}},[o(`span`,{class:`delimsizing size3`},`)`)])]),o(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),o(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.2222em`}},`V`)])])])])],-1)]]),_:1})])),[[N]])])]),e((h(),c(`div`,k,[...A[4]||=[o(`p`,null,`The mask blocks the future. Each word is predicted from the words before it only.`,-1)]])),[[N]])]),_:1},16)}}};export{A as default};
transformer-v2/class/assets/md-RBwePVOC.js ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import{$ as e,E as t,Q as n,S as r,W as i,_ as a,_t as o,b as s,v as c,x as l,yt as u,z as d}from"./modules/shiki-BFOesOFp.js";import{n as f,t as p}from"./slidev/context-ChHKJoK9.js";import{t as m}from"./Citation-DTpwAx0S.js";import{t as h}from"./TransformerGlyph-XWvPPlsx.js";import{t as g}from"./default-DNkhSshI.js";var _={class:`grid grid-cols-4 gap-x-4 gap-y-2 mt-2`},v={class:`flex flex-col items-center text-center gap-1`},y={class:`flex flex-col items-center text-center gap-1`},b={class:`flex flex-col items-center text-center gap-1`},x={class:`flex flex-col items-center text-center gap-1`},S={class:`flex flex-col items-center text-center gap-1`},C={class:`flex flex-col items-center text-center gap-1`},w={class:`flex flex-col items-center text-center gap-1`},T={class:`mt-3 dl-callout`},E={class:`mt-2 dl-secondary`},D={__name:`class.md__slidev_38`,setup(D){let{$slidev:O,$nav:k,$clicksContext:A,$clicks:j,$page:M,$renderContext:N,$frontmatter:P}=f();return A.setup(),(f,D)=>{let O=h,k=m,A=i(`click`);return d(),c(g,u(t(o(p)(o(P),37))),{default:n(()=>[D[10]||=a(`h1`,null,`The whole transformer, in one picture`,-1),a(`div`,_,[a(`div`,v,[r(O,{kind:`encdec`,size:70}),D[0]||=a(`span`,{class:`dl-secondary`},`Encoders read, decoders write`,-1)]),a(`div`,y,[r(O,{kind:`qkv`,size:70}),D[1]||=a(`span`,{class:`dl-secondary`},`Score, scale, softmax, sum`,-1)]),a(`div`,b,[r(O,{kind:`heads`,size:70}),D[2]||=a(`span`,{class:`dl-secondary`},`Many heads, joined by $W_O$`,-1)]),a(`div`,x,[r(O,{kind:`position`,size:70}),D[3]||=a(`span`,{class:`dl-secondary`},`Position added to each word`,-1)]),a(`div`,S,[r(O,{kind:`block`,size:70}),D[4]||=a(`span`,{class:`dl-secondary`},`Add and norm around each sub-layer`,-1)]),a(`div`,C,[r(O,{kind:`decoder`,size:70}),D[5]||=a(`span`,{class:`dl-secondary`},`Mask, then read the encoder`,-1)]),a(`div`,w,[r(O,{kind:`train`,size:70}),D[6]||=a(`span`,{class:`dl-secondary`},`Loss: −log p of the right word`,-1)]),D[7]||=a(`div`,{class:`flex flex-col items-center justify-center text-center gap-1 dl-secondary`},[a(`p`,null,[a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mi`,{mathvariant:`normal`},`softmax`),a(`mo`,null,`⁡`),a(`mtext`,null,` ⁣`),a(`mrow`,null,[a(`mo`,{fence:`true`},`(`),a(`mfrac`,null,[a(`mrow`,null,[a(`mi`,null,`Q`),a(`msup`,null,[a(`mi`,null,`K`),a(`mi`,{mathvariant:`normal`},`⊤`)])]),a(`msqrt`,null,[a(`msub`,null,[a(`mi`,null,`d`),a(`mi`,null,`k`)])])]),a(`mo`,{fence:`true`},`)`)]),a(`mi`,null,`V`)]),a(`annotation`,{encoding:`application/x-tex`},`\\operatorname{softmax}\\!\\left(\\frac{QK^\\top}{\\sqrt{d_k}}\\right)V`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`1.8em`,"vertical-align":`-0.65em`}}),a(`span`,{class:`mop`},[a(`span`,{class:`mord mathrm`},`softmax`)]),a(`span`,{class:`mspace`,style:{"margin-right":`-0.1667em`}}),a(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),a(`span`,{class:`minner`},[a(`span`,{class:`mopen delimcenter`,style:{top:`0em`}},[a(`span`,{class:`delimsizing size2`},`(`)]),a(`span`,{class:`mord`},[a(`span`,{class:`mopen nulldelimiter`}),a(`span`,{class:`mfrac`},[a(`span`,{class:`vlist-t vlist-t2`},[a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`1.095em`}},[a(`span`,{style:{top:`-2.5864em`}},[a(`span`,{class:`pstrut`,style:{height:`3em`}}),a(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[a(`span`,{class:`mord mtight`},[a(`span`,{class:`mord sqrt mtight`},[a(`span`,{class:`vlist-t vlist-t2`},[a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.8622em`}},[a(`span`,{class:`svg-align`,style:{top:`-3em`}},[a(`span`,{class:`pstrut`,style:{height:`3em`}}),a(`span`,{class:`mord mtight`,style:{"padding-left":`0.833em`}},[a(`span`,{class:`mord mtight`},[a(`span`,{class:`mord mathnormal mtight`},`d`),a(`span`,{class:`msupsub`},[a(`span`,{class:`vlist-t vlist-t2`},[a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.3448em`}},[a(`span`,{style:{top:`-2.3488em`,"margin-left":`0em`,"margin-right":`0.0714em`}},[a(`span`,{class:`pstrut`,style:{height:`2.5em`}}),a(`span`,{class:`katex-sizing reset-size3 size1 mtight`},[a(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0315em`}},`k`)])])]),a(`span`,{class:`vlist-s`},`​`)]),a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.1512em`}},[a(`span`)])])])])])])]),a(`span`,{style:{top:`-2.8222em`}},[a(`span`,{class:`pstrut`,style:{height:`3em`}}),a(`span`,{class:`hide-tail mtight`,style:{"min-width":`0.853em`,height:`1.08em`}},[a(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`400em`,height:`1.08em`,viewBox:`0 0 400000 1080`,preserveAspectRatio:`xMinYMin slice`},[a(`path`,{d:`M95,702
2
+ c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
3
+ c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
4
+ c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
5
+ s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
6
+ c69,-144,104.5,-217.7,106.5,-221
7
+ l0 -0
8
+ c5.3,-9.3,12,-14,20,-14
9
+ H400000v40H845.2724
10
+ s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
11
+ c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
12
+ M834 80h400000v40h-400000z`})])])])]),a(`span`,{class:`vlist-s`},`​`)]),a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.1778em`}},[a(`span`)])])])])])])]),a(`span`,{style:{top:`-3.23em`}},[a(`span`,{class:`pstrut`,style:{height:`3em`}}),a(`span`,{class:`frac-line`,style:{"border-bottom-width":`0.04em`}})]),a(`span`,{style:{top:`-3.4461em`}},[a(`span`,{class:`pstrut`,style:{height:`3em`}}),a(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[a(`span`,{class:`mord mtight`},[a(`span`,{class:`mord mathnormal mtight`},`Q`),a(`span`,{class:`mord mtight`},[a(`span`,{class:`mord mathnormal mtight`,style:{"margin-right":`0.0715em`}},`K`),a(`span`,{class:`msupsub`},[a(`span`,{class:`vlist-t`},[a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.927em`}},[a(`span`,{style:{top:`-2.931em`,"margin-right":`0.0714em`}},[a(`span`,{class:`pstrut`,style:{height:`2.5em`}}),a(`span`,{class:`katex-sizing reset-size3 size1 mtight`},[a(`span`,{class:`mord mtight`},`⊤`)])])])])])])])])])])]),a(`span`,{class:`vlist-s`},`​`)]),a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.538em`}},[a(`span`)])])])]),a(`span`,{class:`mclose nulldelimiter`})]),a(`span`,{class:`mclose delimcenter`,style:{top:`0em`}},[a(`span`,{class:`delimsizing size2`},`)`)])]),a(`span`,{class:`mspace`,style:{"margin-right":`0.1667em`}}),a(`span`,{class:`mord mathnormal`,style:{"margin-right":`0.2222em`}},`V`)])])])])],-1)]),e((d(),s(`div`,T,[...D[8]||=[a(`p`,null,`Every word reads every other word, in one weighted sum. The rest makes that stackable and trainable.`,-1)]])),[[A]]),a(`div`,E,[r(k,{source:`Alammar, J. (2018). The Illustrated Transformer`,url:`https://jalammar.github.io/illustrated-transformer/`}),D[9]||=l(` · `,-1),r(k,{source:`Vaswani et al. (2017). Attention Is All You Need`,url:`https://arxiv.org/abs/1706.03762`})])]),_:1},16)}}};export{D as default};
transformer-v2/class/assets/md-ZGOnVPQo.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,Q as n,S as r,W as i,_ as a,_t as o,b as s,v as c,x as l,yt as u,z as d}from"./modules/shiki-BFOesOFp.js";import{n as f,t as p}from"./slidev/context-ChHKJoK9.js";import{t as m}from"./FlowDot-CpcqfMjQ.js";import{t as h}from"./default-DNkhSshI.js";import{t as g}from"./slidev/VClicks-DR1s1I9G.js";var _={class:`mt-1 flex justify-center`},v={viewBox:`0 0 660 160`,class:`dl-diagram`,role:`img`,"aria-label":`x goes through self-attention, then add, then normalise, then feed-forward, then add, then normalise. A dashed shortcut carries x around self-attention to the first add, and another carries the normalised vector around the feed-forward network to the second add`},y={class:`mt-1 dl-callout`},b={__name:`class.md__slidev_26`,setup(b){let{$slidev:x,$nav:S,$clicksContext:C,$clicks:w,$page:T,$renderContext:E,$frontmatter:D}=f();return C.setup(),(f,b)=>{let x=m,S=g,C=i(`click`);return d(),c(h,u(t(o(p)(o(D),25))),{default:n(()=>[b[28]||=a(`h1`,null,`A shortcut around every sub-layer`,-1),a(`div`,_,[(d(),s(`svg`,v,[b[4]||=a(`defs`,null,[a(`marker`,{id:`tv2s4-res`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[a(`path`,{class:`dl-dg-head is-enc`,d:`M0 0 L7 3.5 L0 7 z`})]),a(`marker`,{id:`tv2s4-res-acc`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[a(`path`,{d:`M0 0 L7 3.5 L0 7 z`,style:{fill:`var(--dl-accent)`}})])],-1),b[5]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`18`,y:`120`,"text-anchor":`middle`},`x`,-1),b[6]||=a(`path`,{class:`dl-dg-arrow is-enc dl-dg-flow`,"marker-end":`url(#tv2s4-res)`,d:`M28 115 H58`},null,-1),b[7]||=a(`rect`,{class:`dl-dg-box is-accent`,x:`60`,y:`94`,width:`110`,height:`42`,rx:`4`},null,-1),b[8]||=a(`text`,{class:`dl-dg-small`,x:`115`,y:`120`,"text-anchor":`middle`},`self-attention`,-1),b[9]||=a(`path`,{class:`dl-dg-arrow is-enc dl-dg-flow`,"marker-end":`url(#tv2s4-res)`,d:`M170 115 H189`},null,-1),b[10]||=a(`circle`,{class:`dl-dg-op`,cx:`205`,cy:`115`,r:`14`},null,-1),b[11]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`205`,y:`120`,"text-anchor":`middle`},`+`,-1),b[12]||=a(`path`,{class:`dl-dg-arrow is-enc dl-dg-flow`,"marker-end":`url(#tv2s4-res)`,d:`M219 115 H233`},null,-1),b[13]||=a(`rect`,{class:`dl-dg-fill`,x:`235`,y:`94`,width:`76`,height:`42`,rx:`4`},null,-1),b[14]||=a(`text`,{class:`dl-dg-small`,x:`273`,y:`120`,"text-anchor":`middle`},`normalise`,-1),b[15]||=a(`path`,{class:`dl-dg-arrow is-enc dl-dg-flow`,"marker-end":`url(#tv2s4-res)`,d:`M311 115 H333`},null,-1),b[16]||=a(`rect`,{class:`dl-dg-box`,x:`335`,y:`94`,width:`110`,height:`42`,rx:`4`},null,-1),b[17]||=a(`text`,{class:`dl-dg-small`,x:`390`,y:`120`,"text-anchor":`middle`},`feed-forward`,-1),b[18]||=a(`path`,{class:`dl-dg-arrow is-enc dl-dg-flow`,"marker-end":`url(#tv2s4-res)`,d:`M445 115 H464`},null,-1),b[19]||=a(`circle`,{class:`dl-dg-op`,cx:`480`,cy:`115`,r:`14`},null,-1),b[20]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`480`,y:`120`,"text-anchor":`middle`},`+`,-1),b[21]||=a(`path`,{class:`dl-dg-arrow is-enc dl-dg-flow`,"marker-end":`url(#tv2s4-res)`,d:`M494 115 H508`},null,-1),b[22]||=a(`rect`,{class:`dl-dg-fill`,x:`510`,y:`94`,width:`76`,height:`42`,rx:`4`},null,-1),b[23]||=a(`text`,{class:`dl-dg-small`,x:`548`,y:`120`,"text-anchor":`middle`},`normalise`,-1),b[24]||=a(`path`,{class:`dl-dg-arrow is-enc dl-dg-flow`,"marker-end":`url(#tv2s4-res)`,d:`M586 115 H620`},null,-1),b[25]||=a(`text`,{class:`dl-dg-small`,x:`640`,y:`120`,"text-anchor":`middle`},`out`,-1),r(x,{path:`M28 115 H620`,role:`enc`,dur:4}),e((d(),s(`g`,null,[b[0]||=a(`path`,{class:`dl-dg-flow`,d:`M44 115 V56 H205 V99`,"marker-end":`url(#tv2s4-res-acc)`,style:{fill:`none`,stroke:`var(--dl-accent)`,"stroke-width":`2`}},null,-1),b[1]||=a(`path`,{class:`dl-dg-flow`,d:`M323 115 V56 H480 V99`,"marker-end":`url(#tv2s4-res-acc)`,style:{fill:`none`,stroke:`var(--dl-accent)`,"stroke-width":`2`}},null,-1),r(x,{path:`M44 115 V56 H205 V99`,role:`accent`,dur:2.2}),r(x,{path:`M323 115 V56 H480 V99`,role:`accent`,dur:2.2,delay:1.1}),b[2]||=a(`text`,{class:`dl-dg-small is-good`,x:`125`,y:`48`,"text-anchor":`middle`},`shortcut: add x back`,-1),b[3]||=a(`text`,{class:`dl-dg-small is-good`,x:`401`,y:`48`,"text-anchor":`middle`},`shortcut: add its input back`,-1)])),[[C]])]))]),r(S,null,{default:n(()=>[...b[26]||=[a(`ul`,null,[a(`li`,null,[l(`Each sub-layer’s output is `),a(`strong`,null,`added`),l(` to its input: `),a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mi`,{mathvariant:`bold`},`x`),a(`mo`,null,`+`),a(`mtext`,null,`Sublayer`),a(`mo`,{stretchy:`false`},`(`),a(`mi`,{mathvariant:`bold`},`x`),a(`mo`,{stretchy:`false`},`)`)]),a(`annotation`,{encoding:`application/x-tex`},`\\mathbf{x} + \\text{Sublayer}(\\mathbf{x})`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.6667em`,"vertical-align":`-0.0833em`}}),a(`span`,{class:`mord mathbf`},`x`),a(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}}),a(`span`,{class:`mbin`},`+`),a(`span`,{class:`mspace`,style:{"margin-right":`0.2222em`}})]),a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`1em`,"vertical-align":`-0.25em`}}),a(`span`,{class:`mord text`},[a(`span`,{class:`mord`},`Sublayer`)]),a(`span`,{class:`mopen`},`(`),a(`span`,{class:`mord mathbf`},`x`),a(`span`,{class:`mclose`},`)`)])])])]),a(`li`,null,[l(`The sub-layer only has to learn a `),a(`strong`,null,`change`),l(` to `),a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`mi`,{mathvariant:`bold`},`x`)]),a(`annotation`,{encoding:`application/x-tex`},`\\mathbf{x}`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.4444em`}}),a(`span`,{class:`mord mathbf`},`x`)])])])]),a(`li`,null,[l(`The signal and the gradient get a path with `),a(`strong`,null,`no weight matrix`),l(` on it`)])],-1)]]),_:1}),e((d(),s(`div`,y,[...b[27]||=[a(`p`,null,`"Add & norm": add the shortcut, then normalise each word’s vector. This is what lets six (or many more) layers stack and still train.`,-1)]])),[[C]])]),_:1},16)}}};export{b as default};
transformer-v2/class/assets/md-_akb8Fqt.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,Q as n,S as r,V as i,W as a,_ as o,_t as s,b as c,m as l,v as u,x as d,xt as f,yt as p,z as m}from"./modules/shiki-BFOesOFp.js";import{n as h,t as g}from"./slidev/context-ChHKJoK9.js";import{t as _}from"./FlowDot-CpcqfMjQ.js";import{t as v}from"./default-DNkhSshI.js";import{t as y}from"./slidev/VClicks-DR1s1I9G.js";var b={class:`grid grid-cols-[1.25fr_1fr] gap-8 mt-1 items-center`},x={viewBox:`0 0 380 300`,class:`dl-diagram`,role:`img`,"aria-label":`Six encoder boxes stacked on the left, six decoder boxes stacked on the right; the top encoder's output feeds every decoder`},S=[`y`],C=[`y`],w=[`y`],T=[`y`],E=[`d`],D={__name:`class.md__slidev_5`,setup(D){let{$slidev:O,$nav:k,$clicksContext:A,$clicks:j,$page:M,$renderContext:N,$frontmatter:P}=h();return A.setup(),(h,D)=>{let O=_,k=y,A=a(`click`);return m(),u(v,p(t(s(g)(s(P),4))),{default:n(()=>[D[6]||=o(`h1`,null,`Six encoders, six decoders`,-1),o(`div`,b,[o(`div`,null,[(m(),c(`svg`,x,[D[2]||=o(`defs`,null,[o(`marker`,{id:`tv2s0-stack`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[o(`path`,{class:`dl-dg-head is-enc`,d:`M0 0 L7 3.5 L0 7 z`})])],-1),(m(),c(l,null,i(6,e=>o(`g`,{key:`e${e}`},[o(`rect`,{class:`dl-dg-box is-enc`,x:`30`,y:258-e*38,width:`120`,height:`28`,rx:`4`},null,8,S),o(`text`,{class:`dl-dg-small`,x:`90`,y:277-e*38,"text-anchor":`middle`},`encoder `+f(e),9,C)])),64)),(m(),c(l,null,i(6,e=>o(`g`,{key:`d${e}`},[o(`rect`,{class:`dl-dg-box is-dec`,x:`230`,y:258-e*38,width:`120`,height:`28`,rx:`4`},null,8,w),o(`text`,{class:`dl-dg-small`,x:`290`,y:277-e*38,"text-anchor":`middle`},`decoder `+f(e),9,T)])),64)),D[3]||=o(`text`,{class:`dl-dg-small is-enc`,x:`90`,y:`292`,"text-anchor":`middle`},`je suis étudiant ↑`,-1),(m(),c(l,null,i(3,e=>r(O,{key:`fd${e}`,path:`M42 270 V26`,role:`enc`,dur:3,delay:e,r:4},null,8,[`delay`])),64)),D[4]||=o(`text`,{class:`dl-dg-small`,x:`290`,y:`12`,"text-anchor":`middle`},`↑ i am a student`,-1),e((m(),c(`g`,null,[D[0]||=o(`path`,{class:`dl-dg-arrow is-enc dl-dg-flow`,d:`M150 34 H190 V244`},null,-1),(m(),c(l,null,i(6,e=>o(`path`,{key:`a${e}`,class:`dl-dg-arrow is-enc dl-dg-flow`,"marker-end":`url(#tv2s0-stack)`,d:`M190 ${244-(e-1)*38} H228`},null,8,E)),64)),(m(),c(l,null,i(3,e=>r(O,{key:`wd${e}`,path:`M150 34 H190 V244`,role:`enc`,dur:2.4,delay:e*.8},null,8,[`delay`])),64)),D[1]||=o(`text`,{class:`dl-dg-small is-enc`,x:`196`,y:`292`},`top encoder → every decoder`,-1)])),[[A]])]))]),o(`div`,null,[r(k,null,{default:n(()=>[...D[5]||=[o(`ul`,null,[o(`li`,null,[d(`The paper uses `),o(`strong`,null,`6`),d(` of each. The number is a choice, not a law`)]),o(`li`,null,[d(`Each encoder has the `),o(`strong`,null,`same design`),d(` and its own weights`)]),o(`li`,null,[d(`The input enters the `),o(`strong`,null,`bottom`),d(` encoder and climbs the stack`)]),o(`li`,null,[d(`The `),o(`strong`,null,`top`),d(` encoder’s output goes to `),o(`strong`,null,`every`),d(` decoder`)])],-1)]]),_:1})])])]),_:1},16)}}};export{D as default};
transformer-v2/class/assets/md-nAt0vl3t.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,Q as n,S as r,W as i,_ as a,_t as o,b as s,v as c,x as l,yt as u,z as d}from"./modules/shiki-BFOesOFp.js";import{n as f,t as p}from"./slidev/context-ChHKJoK9.js";import{t as m}from"./FlowDot-CpcqfMjQ.js";import{t as h}from"./default-DNkhSshI.js";import{t as g}from"./slidev/VClicks-DR1s1I9G.js";var _={class:`mt-1 flex justify-center`},v={viewBox:`0 0 640 200`,class:`dl-diagram`,role:`img`,"aria-label":`0.89 times v1 = [2,0] gives [1.79, 0]; 0.11 times v2 = [0,2] gives [0, 0.21]; their sum is z1 = [1.79, 0.21]`},y={__name:`class.md__slidev_14`,setup(y){let{$slidev:b,$nav:x,$clicksContext:S,$clicks:C,$page:w,$renderContext:T,$frontmatter:E}=f();return S.setup(),(f,y)=>{let b=m,x=g,S=i(`click`);return d(),c(h,u(t(o(p)(o(E),13))),{default:n(()=>[y[17]||=a(`h1`,null,`Steps 5 and 6: weigh the values, then add`,-1),a(`div`,_,[(d(),s(`svg`,v,[y[9]||=a(`defs`,null,[a(`marker`,{id:`tv2s1-sum`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[a(`path`,{class:`dl-dg-head is-v`,d:`M0 0 L7 3.5 L0 7 z`})]),a(`marker`,{id:`tv2s1-sum-out`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[a(`path`,{class:`dl-dg-head is-accent`,d:`M0 0 L7 3.5 L0 7 z`})])],-1),y[10]||=a(`text`,{class:`dl-dg-small`,x:`10`,y:`44`},`Thinking`,-1),y[11]||=a(`text`,{class:`dl-dg-small`,x:`10`,y:`134`},`Machines`,-1),y[12]||=a(`rect`,{class:`dl-dg-box is-v`,x:`90`,y:`24`,width:`90`,height:`32`,rx:`4`},null,-1),y[13]||=a(`text`,{class:`dl-dg-small is-v`,x:`135`,y:`45`,"text-anchor":`middle`},`v₁ [2, 0]`,-1),y[14]||=a(`rect`,{class:`dl-dg-box is-v`,x:`90`,y:`114`,width:`90`,height:`32`,rx:`4`},null,-1),y[15]||=a(`text`,{class:`dl-dg-small is-v`,x:`135`,y:`135`,"text-anchor":`middle`},`v₂ [0, 2]`,-1),e((d(),s(`g`,null,[...y[0]||=[a(`text`,{class:`dl-dg-lab is-sm`,x:`214`,y:`45`,"text-anchor":`middle`},`× 0.893`,-1),a(`text`,{class:`dl-dg-lab is-sm`,x:`214`,y:`135`,"text-anchor":`middle`},`× 0.107`,-1),a(`rect`,{class:`dl-dg-box is-v`,x:`250`,y:`20`,width:`110`,height:`40`,rx:`4`,style:{"stroke-width":`2.6`}},null,-1),a(`text`,{class:`dl-dg-in is-v`,x:`305`,y:`45`,"text-anchor":`middle`},`[1.79, 0]`,-1),a(`rect`,{class:`dl-dg-box is-v`,x:`250`,y:`110`,width:`110`,height:`40`,rx:`4`,style:{"stroke-width":`0.8`}},null,-1),a(`text`,{class:`dl-dg-small`,x:`305`,y:`135`,"text-anchor":`middle`},`[0, 0.21]`,-1),a(`text`,{class:`dl-dg-small`,x:`305`,y:`176`,"text-anchor":`middle`},`nearly gone`,-1)]])),[[S]]),e((d(),s(`g`,null,[y[1]||=a(`path`,{class:`dl-dg-arrow is-v dl-dg-flow`,"marker-end":`url(#tv2s1-sum)`,d:`M362 40 L440 78`,style:{"stroke-width":`3`}},null,-1),y[2]||=a(`path`,{class:`dl-dg-arrow is-v dl-dg-flow`,"marker-end":`url(#tv2s1-sum)`,d:`M362 130 L440 94`,style:{"stroke-width":`1`}},null,-1),r(b,{path:`M362 40 L438 77`,role:`v`,dur:1.1,r:5.5}),r(b,{path:`M362 130 L438 95`,role:`v`,dur:1.1,delay:.4,r:2.2}),y[3]||=a(`circle`,{class:`dl-dg-op`,cx:`458`,cy:`86`,r:`16`},null,-1),y[4]||=a(`text`,{class:`dl-dg-lab is-sm`,x:`458`,y:`91`,"text-anchor":`middle`},`+`,-1),y[5]||=a(`path`,{class:`dl-dg-arrow is-accent dl-dg-flow`,"marker-end":`url(#tv2s1-sum-out)`,d:`M474 86 H500`},null,-1),y[6]||=a(`rect`,{class:`dl-dg-box is-accent dl-dg-pulse`,x:`504`,y:`64`,width:`126`,height:`44`,rx:`4`},null,-1),y[7]||=a(`text`,{class:`dl-dg-in`,x:`567`,y:`91`,"text-anchor":`middle`},`z₁ [1.79, 0.21]`,-1),y[8]||=a(`text`,{class:`dl-dg-small`,x:`567`,y:`128`,"text-anchor":`middle`},`Thinking's output`,-1)])),[[S]])]))]),r(x,null,{default:n(()=>[...y[16]||=[a(`ul`,null,[a(`li`,null,[a(`strong`,null,`Weigh`),l(`: each value times its weight. Words with tiny weights almost vanish`)]),a(`li`,null,[a(`strong`,null,`Add`),l(`: the sum is the asking word’s output, `),a(`span`,{class:`katex`},[a(`span`,{class:`katex-mathml`},[a(`math`,{xmlns:`http://www.w3.org/1998/Math/MathML`},[a(`semantics`,null,[a(`mrow`,null,[a(`msub`,null,[a(`mi`,{mathvariant:`bold`},`z`),a(`mn`,null,`1`)])]),a(`annotation`,{encoding:`application/x-tex`},`\\mathbf{z}_1`)])])]),a(`span`,{class:`katex-html`,"aria-hidden":`true`},[a(`span`,{class:`katex-base`},[a(`span`,{class:`katex-strut`,style:{height:`0.5944em`,"vertical-align":`-0.15em`}}),a(`span`,{class:`mord`},[a(`span`,{class:`mord mathbf`},`z`),a(`span`,{class:`msupsub`},[a(`span`,{class:`vlist-t vlist-t2`},[a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.3011em`}},[a(`span`,{style:{top:`-2.55em`,"margin-left":`0em`,"margin-right":`0.05em`}},[a(`span`,{class:`pstrut`,style:{height:`2.7em`}}),a(`span`,{class:`katex-sizing reset-size6 size3 mtight`},[a(`span`,{class:`mord mtight`},`1`)])])]),a(`span`,{class:`vlist-s`},`​`)]),a(`span`,{class:`vlist-r`},[a(`span`,{class:`vlist`,style:{height:`0.15em`}},[a(`span`)])])])])])])])])])],-1)]]),_:1})]),_:1},16)}}};export{y as default};
transformer-v2/class/assets/md-nDqRXqVN2.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,Q as n,S as r,W as i,_ as a,_t as o,b as s,v as c,x as l,yt as u,z as d}from"./modules/shiki-BFOesOFp.js";import{n as f,t as p}from"./slidev/context-ChHKJoK9.js";import{t as m}from"./FlowDot-CpcqfMjQ.js";import{t as h}from"./default-DNkhSshI.js";var g={class:`mt-1 flex justify-center`},_={viewBox:`0 0 640 250`,class:`dl-diagram`,role:`img`,"aria-label":`An encoder holds self-attention under a feed-forward network; a decoder holds self-attention, then encoder-decoder attention, then a feed-forward network`},v={class:`mt-1 dl-callout`},y={__name:`class.md__slidev_6`,setup(y){let{$slidev:b,$nav:x,$clicksContext:S,$clicks:C,$page:w,$renderContext:T,$frontmatter:E}=f();return S.setup(),(f,y)=>{let b=m,x=i(`click`);return d(),c(h,u(t(o(p)(o(E),5))),{default:n(()=>[y[25]||=a(`h1`,null,`Inside one encoder, inside one decoder`,-1),a(`div`,g,[(d(),s(`svg`,_,[y[14]||=a(`defs`,null,[a(`marker`,{id:`tv2s0-inside`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[a(`path`,{class:`dl-dg-head is-enc`,d:`M0 0 L7 3.5 L0 7 z`})]),a(`marker`,{id:`tv2s0-inside-dec`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[a(`path`,{class:`dl-dg-head is-dec`,d:`M0 0 L7 3.5 L0 7 z`})])],-1),y[15]||=a(`rect`,{class:`dl-dg-box is-enc`,x:`40`,y:`20`,width:`230`,height:`200`,rx:`8`},null,-1),y[16]||=a(`text`,{class:`dl-dg-small is-enc`,x:`155`,y:`40`,"text-anchor":`middle`},`ENCODER`,-1),y[17]||=a(`rect`,{class:`dl-dg-box is-accent`,x:`65`,y:`60`,width:`180`,height:`44`,rx:`5`},null,-1),y[18]||=a(`text`,{class:`dl-dg-in`,x:`155`,y:`87`,"text-anchor":`middle`},`Feed-forward`,-1),y[19]||=a(`rect`,{class:`dl-dg-box is-accent`,x:`65`,y:`150`,width:`180`,height:`44`,rx:`5`},null,-1),y[20]||=a(`text`,{class:`dl-dg-in`,x:`155`,y:`177`,"text-anchor":`middle`},`Self-attention`,-1),y[21]||=a(`path`,{class:`dl-dg-arrow is-enc dl-dg-flow`,"marker-end":`url(#tv2s0-inside)`,d:`M155 150 V106`},null,-1),y[22]||=a(`path`,{class:`dl-dg-arrow is-enc dl-dg-flow`,"marker-end":`url(#tv2s0-inside)`,d:`M155 244 V196`},null,-1),y[23]||=a(`path`,{class:`dl-dg-arrow is-enc dl-dg-flow`,"marker-end":`url(#tv2s0-inside)`,d:`M155 60 V4`},null,-1),r(b,{path:`M155 244 V198`,role:`enc`,dur:1}),r(b,{path:`M155 150 V108`,role:`enc`,dur:1,delay:.33}),r(b,{path:`M155 60 V6`,role:`enc`,dur:1,delay:.66}),e((d(),s(`g`,null,[y[0]||=a(`rect`,{class:`dl-dg-box is-dec`,x:`370`,y:`10`,width:`230`,height:`226`,rx:`8`},null,-1),y[1]||=a(`text`,{class:`dl-dg-small is-dec`,x:`485`,y:`28`,"text-anchor":`middle`},`DECODER`,-1),y[2]||=a(`rect`,{class:`dl-dg-box is-accent`,x:`395`,y:`40`,width:`180`,height:`40`,rx:`5`},null,-1),y[3]||=a(`text`,{class:`dl-dg-in`,x:`485`,y:`65`,"text-anchor":`middle`},`Feed-forward`,-1),y[4]||=a(`rect`,{class:`dl-dg-box is-accent`,x:`395`,y:`106`,width:`180`,height:`40`,rx:`5`},null,-1),y[5]||=a(`text`,{class:`dl-dg-in`,x:`485`,y:`131`,"text-anchor":`middle`},`Encoder–decoder attention`,-1),y[6]||=a(`rect`,{class:`dl-dg-box is-accent`,x:`395`,y:`172`,width:`180`,height:`40`,rx:`5`},null,-1),y[7]||=a(`text`,{class:`dl-dg-in`,x:`485`,y:`197`,"text-anchor":`middle`},`Self-attention`,-1),y[8]||=a(`path`,{class:`dl-dg-arrow is-dec dl-dg-flow`,"marker-end":`url(#tv2s0-inside-dec)`,d:`M485 172 V148`},null,-1),y[9]||=a(`path`,{class:`dl-dg-arrow is-dec dl-dg-flow`,"marker-end":`url(#tv2s0-inside-dec)`,d:`M485 106 V82`},null,-1),y[10]||=a(`path`,{class:`dl-dg-arrow is-dec dl-dg-flow`,"marker-end":`url(#tv2s0-inside-dec)`,d:`M485 244 V214`},null,-1),r(b,{path:`M485 244 V216`,role:`dec`,dur:1}),r(b,{path:`M485 172 V150`,role:`dec`,dur:1,delay:.33}),r(b,{path:`M485 106 V84`,role:`dec`,dur:1,delay:.66}),y[11]||=a(`path`,{class:`dl-dg-arrow is-enc dl-dg-flow`,"marker-end":`url(#tv2s0-inside)`,d:`M272 126 H392`},null,-1),r(b,{path:`M272 126 H390`,role:`enc`,dur:1.4}),y[12]||=a(`text`,{class:`dl-dg-small is-enc`,x:`320`,y:`114`,"text-anchor":`middle`},`from the`,-1),y[13]||=a(`text`,{class:`dl-dg-small is-enc`,x:`320`,y:`144`,"text-anchor":`middle`},`top encoder`,-1)])),[[x]])]))]),e((d(),s(`div`,v,[...y[24]||=[a(`p`,null,[l(`Self-attention lets each word `),a(`strong`,null,`look at the other words`),l(`. The feed-forward network then works on `),a(`strong`,null,`each word alone`),l(`.`)],-1)]])),[[x]])]),_:1},16)}}};export{y as default};
transformer-v2/class/assets/md-rUO3nW2M2.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,E as t,Q as n,S as r,V as i,W as a,_ as o,_t as s,b as c,m as l,v as u,vt as d,xt as f,yt as p,z as m}from"./modules/shiki-BFOesOFp.js";import{n as h,t as g}from"./slidev/context-ChHKJoK9.js";import{t as _}from"./FlowDot-CpcqfMjQ.js";import{t as v}from"./default-DNkhSshI.js";var y={class:`mt-1 flex justify-center`},b={viewBox:`0 0 680 230`,class:`dl-diagram`,role:`img`,"aria-label":`The decoder's 512-number output goes through a linear layer to six logits, 0.5 0.2 2.6 0.1 0.4 -0.5, then softmax to probabilities 0.08 0.06 0.69 0.06 0.08 0.03; the largest is i`},x=[`y`],S=[`x`,`y`,`width`],C=[`x`,`y`],w=[`y`],T=[`y`,`width`],E=[`x`,`y`],D={class:`mt-1 dl-callout`},O={__name:`class.md__slidev_33`,setup(O){let{$slidev:k,$nav:A,$clicksContext:j,$clicks:M,$page:N,$renderContext:P,$frontmatter:F}=h();return j.setup(),(h,O)=>{let k=_,A=a(`click`);return m(),u(v,p(t(s(g)(s(F),32))),{default:n(()=>[O[16]||=o(`h1`,null,`From a vector to a word: linear and softmax`,-1),o(`div`,y,[(m(),c(`svg`,b,[O[7]||=o(`defs`,null,[o(`marker`,{id:`tv2s5-out-head`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[o(`path`,{class:`dl-dg-head`,d:`M0 0 L7 3.5 L0 7 z`})]),o(`marker`,{id:`tv2s5-out-dec`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[o(`path`,{class:`dl-dg-head is-dec`,d:`M0 0 L7 3.5 L0 7 z`})]),o(`marker`,{id:`tv2s5-out-acc`,markerWidth:`7`,markerHeight:`7`,refX:`6`,refY:`3.5`,orient:`auto`},[o(`path`,{class:`dl-dg-head is-accent`,d:`M0 0 L7 3.5 L0 7 z`})])],-1),O[8]||=o(`rect`,{class:`dl-dg-box is-dec`,x:`10`,y:`40`,width:`34`,height:`150`,rx:`4`},null,-1),O[9]||=o(`text`,{class:`dl-dg-small`,x:`27`,y:`210`,"text-anchor":`middle`},`512 numbers`,-1),O[10]||=o(`text`,{class:`dl-dg-small is-dec`,x:`27`,y:`26`,"text-anchor":`middle`},`decoder`,-1),O[11]||=o(`path`,{class:`dl-dg-arrow is-dec dl-dg-flow`,"marker-end":`url(#tv2s5-out-dec)`,d:`M48 115 H72`},null,-1),r(k,{path:`M27 115 H76`,role:`dec`,dur:1.2}),O[12]||=o(`polygon`,{class:`dl-dg-net`,points:`76,70 156,40 156,190 76,160`},null,-1),O[13]||=o(`text`,{class:`dl-dg-in`,x:`116`,y:`120`,"text-anchor":`middle`},`linear`,-1),O[14]||=o(`path`,{class:`dl-dg-arrow dl-dg-flow`,"marker-end":`url(#tv2s5-out-head)`,d:`M160 115 H184`},null,-1),e((m(),c(`g`,null,[O[0]||=o(`text`,{class:`dl-dg-small`,x:`252`,y:`26`,"text-anchor":`middle`},`logits: one score per word`,-1),O[1]||=o(`line`,{class:`dl-dg-split`,x1:`252`,y1:`40`,x2:`252`,y2:`190`},null,-1),(m(),c(l,null,i([[`a`,.5],[`am`,.2],[`i`,2.6],[`thanks`,.1],[`student`,.4],[`⟨eos⟩`,-.5]],(e,t)=>o(`g`,{key:`z`+t},[o(`text`,{class:`dl-dg-small`,x:`228`,y:56+t*25,"text-anchor":`end`},f(e[0]),9,x),o(`rect`,{class:d(e[1]<0?`dl-dg-bar is-bad`:`dl-dg-bar`),x:e[1]<0?252+e[1]*30:252,y:45+t*25,width:Math.abs(e[1])*30,height:`14`,rx:`2`},null,10,S),o(`text`,{class:`dl-dg-small`,x:e[1]<0?262:258+e[1]*30,y:56+t*25},f(e[1]),9,C)])),64))])),[[A]]),e((m(),c(`g`,null,[O[2]||=o(`path`,{class:`dl-dg-arrow is-accent dl-dg-flow`,"marker-end":`url(#tv2s5-out-acc)`,d:`M380 115 H420`},null,-1),r(k,{path:`M376 115 H422`,role:`accent`,dur:1.2}),O[3]||=o(`text`,{class:`dl-dg-small`,x:`400`,y:`105`,"text-anchor":`middle`},`softmax`,-1),O[4]||=o(`text`,{class:`dl-dg-small`,x:`520`,y:`26`,"text-anchor":`middle`},`probabilities: sum to 1`,-1),O[5]||=o(`line`,{class:`dl-dg-split`,x1:`490`,y1:`40`,x2:`490`,y2:`190`},null,-1),(m(),c(l,null,i([[`a`,.08],[`am`,.06],[`i`,.69],[`thanks`,.06],[`student`,.08],[`⟨eos⟩`,.03]],(e,t)=>o(`g`,{key:`p`+t},[o(`text`,{class:`dl-dg-small`,x:`482`,y:56+t*25,"text-anchor":`end`},f(e[0]),9,w),o(`rect`,{class:d(t===2?`dl-dg-bar is-q`:`dl-dg-bar`),x:`490`,y:45+t*25,width:e[1]*120,height:`14`,rx:`2`},null,10,T),o(`text`,{class:`dl-dg-small`,x:496+e[1]*120,y:56+t*25},f(e[1].toFixed(2)),9,E)])),64))])),[[A]]),e((m(),c(`g`,null,[...O[6]||=[o(`text`,{class:`dl-dg-lab is-dec`,x:`645`,y:`110`,"text-anchor":`middle`},`"i"`,-1),o(`text`,{class:`dl-dg-small is-good`,x:`645`,y:`128`,"text-anchor":`middle`},`the largest`,-1)]])),[[A]])]))]),e((m(),c(`div`,D,[...O[15]||=[o(`p`,null,`A linear layer gives one score per vocabulary word. Softmax turns the scores into probabilities.`,-1)]])),[[A]])]),_:1},16)}}};export{O as default};
transformer-v2/class/assets/slidev/404-Cskqm_iE.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{Q as e,U as t,_ as n,_t as r,b as i,g as a,v as o,w as s,x as c,xt as l,y as u,z as d}from"../modules/shiki-BFOesOFp.js";import{t as f}from"../useNav-BZQi666j.js";import{t as p}from"../_plugin-vue_export-helper-BDNMzG2s.js";import{B as m}from"../modules/vue-CXhtJkbE.js";var h={class:`grid justify-center text-center pt-15% gap-5`},g={class:`text-2xl`},_={class:`op-60`},v={class:`mt-3 flex flex-col gap-2 max-w-xs mx-auto w-full`},y=p(s({__name:`404`,setup(s){let p=/\d+/,{currentRoute:y}=m(),{total:b}=f(),x=a(()=>{let e=y.value.path.match(p);if(e){let t=+e[0];if(t>0&&t<=b.value)return t}return null});return(a,s)=>{let f=t(`RouterLink`);return d(),i(`div`,h,[n(`div`,null,[s[2]||=n(`h1`,{class:`text-9xl font-light`},` 404 `,-1),n(`p`,g,[s[0]||=c(` Page `,-1),n(`code`,_,l(r(y).path),1),s[1]||=c(` not found `,-1)])]),n(`div`,v,[x.value===1?u(`v-if`,!0):(d(),o(f,{key:0,to:`/`,class:`page-link`},{default:e(()=>[...s[3]||=[c(` Go Home `,-1)]]),_:1})),x.value?(d(),o(f,{key:1,to:`/${x.value}`,class:`page-link`},{default:e(()=>[c(` Go to Slide `+l(x.value),1)]),_:1},8,[`to`])):u(`v-if`,!0)])])}}}),[[`__scopeId`,`data-v-b584852f`]]);export{y as default};
transformer-v2/class/assets/slidev/DrawingControls-CHqchiV_.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{n as e}from"../rolldown-runtime-hePW80VL.js";import{$ as t,H as n,Q as r,S as i,V as a,_ as o,_t as s,b as c,bt as l,l as u,lt as d,m as f,r as p,u as m,v as h,vt as g,w as _,xt as v,y,z as b}from"../modules/shiki-BFOesOFp.js";import{h as x,u as S}from"../modules/vue-CXhtJkbE.js";import{t as C}from"../useDrawings-DFNMQL0q.js";import{t as w}from"./IconButton-B5keGFol.js";import{t as T}from"./VerticalDivider-D_ScNBWw.js";var E=_({__name:`Draggable`,props:{storageKey:{},initial:{}},setup(e){let t=e,r=d(null),i=t.initial??{x:0,y:0},a=t.storageKey?x(t.storageKey,i):d(i),{style:o}=S(r,{initialValue:a});return(e,t)=>(b(),c(`div`,{ref_key:`el`,ref:r,class:`fixed`,style:l(s(o))},[n(e.$slots,`default`)],4))}}),D={class:`flex bg-main p-2`},O={class:`inline-block w-7 text-center`},k={class:`pt-.5`},A={class:`i-carbon:pin-filled transform -rotate-45`},j={class:`i-carbon:pin`},M={class:`i-carbon:error`},N={class:`i-carbon:close-outline`},P=_({__name:`DrawingControls`,setup(e){let{brush:n,canClear:_,canRedo:x,canUndo:S,clear:P,drauu:F,drawingEnabled:I,drawingMode:L,drawingPinned:R,brushColors:z}=C(),B=d(!1);function V(e){e.preventDefault(),e.stopPropagation(),requestAnimationFrame(()=>{requestAnimationFrame(()=>{B.value=!0})})}function H(e){e.pointerType!==`mouse`&&V(e)}function U(){F.undo()}function W(){F.redo()}let G=`stylus`;function K(e){L.value=e,I.value=!0,e!==`eraseLine`&&(G=e)}function q(e){n.value.color=e,I.value=!0,L.value=G}return(e,d)=>s(I)||s(R)?(b(),h(E,{key:0,class:g([`flex flex-wrap text-xl p-2 gap-1 rounded-md bg-main shadow transition-opacity duration-200 z-nav border border-main`,!s(I)&&s(R)?`opacity-40 hover:opacity-90`:``]),"storage-key":`slidev-drawing-pos`,"initial-x":10,"initial-y":10},{default:r(()=>[i(w,{title:`Draw with stylus`,class:g({shallow:s(L)!==`stylus`}),onClick:d[0]||=e=>K(`stylus`)},{default:r(()=>[...d[14]||=[o(`div`,{class:`i-carbon:pen`},null,-1)]]),_:1},8,[`class`]),i(w,{title:`Draw a line`,class:g({shallow:s(L)!==`line`}),onClick:d[1]||=e=>K(`line`)},{default:r(()=>[...d[15]||=[o(`svg`,{width:`1em`,height:`1em`,class:`-mt-0.5`,preserveAspectRatio:`xMidYMid meet`,viewBox:`0 0 24 24`},[o(`path`,{d:`M21.71 3.29a1 1 0 0 0-1.42 0l-18 18a1 1 0 0 0 0 1.42a1 1 0 0 0 1.42 0l18-18a1 1 0 0 0 0-1.42z`,fill:`currentColor`})],-1)]]),_:1},8,[`class`]),i(w,{title:`Draw an arrow`,class:g({shallow:s(L)!==`arrow`}),onClick:d[2]||=e=>K(`arrow`)},{default:r(()=>[...d[16]||=[o(`div`,{class:`i-carbon:arrow-up-right`},null,-1)]]),_:1},8,[`class`]),i(w,{title:`Draw an ellipse`,class:g({shallow:s(L)!==`ellipse`}),onClick:d[3]||=e=>K(`ellipse`)},{default:r(()=>[...d[17]||=[o(`div`,{class:`i-carbon:radio-button`},null,-1)]]),_:1},8,[`class`]),i(w,{title:`Draw a rectangle`,class:g({shallow:s(L)!==`rectangle`}),onClick:d[4]||=e=>K(`rectangle`)},{default:r(()=>[...d[18]||=[o(`div`,{class:`i-carbon:checkbox`},null,-1)]]),_:1},8,[`class`]),i(w,{title:`Erase`,class:g({shallow:s(L)!==`eraseLine`}),onClick:d[5]||=e=>K(`eraseLine`)},{default:r(()=>[...d[19]||=[o(`div`,{class:`i-carbon:erase`},null,-1)]]),_:1},8,[`class`]),i(T),i(s(p),{shown:B.value,"onUpdate:shown":d[8]||=e=>B.value=e,triggers:[]},{popper:r(()=>[o(`div`,D,[o(`div`,O,v(s(n).size),1),o(`div`,k,[t(o(`input`,{"onUpdate:modelValue":d[6]||=e=>s(n).size=e,type:`range`,min:`1`,max:`15`,onChange:d[7]||=e=>L.value=s(G)},null,544),[[u,s(n).size]])])])]),default:r(()=>[i(w,{title:`Adjust stroke width`,class:g({shallow:s(L)===`eraseLine`}),onClick:V,onPointerdown:H,onPointerup:H,onTouchend:V},{default:r(()=>[...d[20]||=[o(`svg`,{viewBox:`0 0 32 32`,width:`1.2em`,height:`1.2em`},[o(`line`,{x1:`2`,y1:`15`,x2:`22`,y2:`4`,stroke:`currentColor`,"stroke-width":`1`,"stroke-linecap":`round`}),o(`line`,{x1:`2`,y1:`24`,x2:`28`,y2:`10`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`}),o(`line`,{x1:`7`,y1:`31`,x2:`29`,y2:`19`,stroke:`currentColor`,"stroke-width":`3`,"stroke-linecap":`round`})],-1)]]),_:1},8,[`class`])]),_:1},8,[`shown`]),(b(!0),c(f,null,a(s(z),e=>(b(),h(w,{key:e,title:`Set brush color`,class:g(s(n).color===e&&s(L)!==`eraseLine`?`active`:`shallow`),onClick:t=>q(e)},{default:r(()=>[o(`div`,{class:g([`w-6 h-6 transition-all transform border`,s(n).color===e?`rounded-md border-gray-300/50`:`rounded-1/2 scale-85 border-white`]),style:l(s(I)?{background:e}:{borderColor:e})},null,6)]),_:2},1032,[`class`,`onClick`]))),128)),i(T),i(w,{title:`Undo`,class:g({disabled:!s(S)}),onClick:d[9]||=e=>U()},{default:r(()=>[...d[21]||=[o(`div`,{class:`i-carbon:undo`},null,-1)]]),_:1},8,[`class`]),i(w,{title:`Redo`,class:g({disabled:!s(x)}),onClick:d[10]||=e=>W()},{default:r(()=>[...d[22]||=[o(`div`,{class:`i-carbon:redo`},null,-1)]]),_:1},8,[`class`]),i(w,{title:`Delete`,class:g({disabled:!s(_)}),onClick:d[11]||=e=>s(P)()},{default:r(()=>[...d[23]||=[o(`div`,{class:`i-carbon:trash-can`},null,-1)]]),_:1},8,[`class`]),i(T),i(w,{title:s(R)?`Unpin drawing`:`Pin drawing`,class:g({shallow:!s(R)}),onClick:d[12]||=e=>R.value=!s(R)},{default:r(()=>[t(o(`div`,A,null,512),[[m,s(R)]]),t(o(`div`,j,null,512),[[m,!s(R)]])]),_:1},8,[`title`,`class`]),s(I)?(b(),h(w,{key:0,title:s(R)?`Drawing pinned`:`Drawing unpinned`,class:g({shallow:!s(I)}),onClick:d[13]||=e=>I.value=!s(I)},{default:r(()=>[t(o(`div`,M,null,512),[[m,s(R)]]),t(o(`div`,N,null,512),[[m,!s(R)]])]),_:1},8,[`title`,`class`])):y(`v-if`,!0)]),_:1},8,[`class`])):y(`v-if`,!0)}}),F=e({default:()=>I}),I=P;export{F as n,I as t};
transformer-v2/class/assets/slidev/DrawingLayer-CMBVuwdP.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{F as e,L as t,Y as n,_t as r,b as i,lt as a,vt as o,w as s,z as c}from"../modules/shiki-BFOesOFp.js";import{n as l}from"./context-ChHKJoK9.js";import{t as u}from"../useDrawings-DFNMQL0q.js";var d=s({__name:`DrawingLayer`,setup(s){let{drauu:d,drawingEnabled:f,loadCanvas:p}=u(),m=l().$scale,h=a();return t(()=>{d.mount(h.value,h.value.parentElement),n(m,e=>d.options.coordinateScale=1/e,{immediate:!0}),p()}),e(()=>{d.unmount()}),(e,t)=>(c(),i(`svg`,{ref_key:`svg`,ref:h,class:o([`w-full h-full absolute top-0`,{"pointer-events-none":!r(f),"touch-none":r(f)}])},null,2))}});export{d as default};
transformer-v2/class/assets/slidev/KaTexBlockWrapper-Ck43xKMc.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{H as e,L as t,R as n,X as r,b as i,g as a,lt as o,w as s,z as c}from"../modules/shiki-BFOesOFp.js";import{H as l}from"../useNav-BZQi666j.js";import{a as u,c as d,l as f,n as p}from"./context-ChHKJoK9.js";import{u as m}from"../index-CG-YcYMB.js";var h=`.mtable > [class*=col-align]`,g=`:scope > .vlist-t > .vlist-r > .vlist > span > .mord`;function _(e){let t=Array.from(e.querySelectorAll(h)).filter(e=>!e.parentElement?.closest(h)),n=[];for(let e of t)Array.from(e.querySelectorAll(g)).forEach((e,t)=>{e&&(Array.isArray(n[t])?n[t].push(e):n[t]=[e])});return n}var v=s({__name:`KaTexBlockWrapper`,props:{ranges:{type:Array,default:()=>[]},finally:{type:[String,Number],default:`last`},startLine:{type:Number,default:1},at:{type:[String,Number],default:`+1`}},setup(s){let h=s,{$clicksContext:g}=p(),v=o(),y=m();return n(()=>{g.unregister(y)}),t(()=>{if(!g||!h.ranges?.length)return;let e=g.calculateSince(h.at,h.ranges.length-1);g.register(y,e);let t=a(()=>e?Math.max(0,g.current-e.start+1):f),n=a(()=>h.finally===`last`?h.ranges.at(-1):h.finally.toString());r(()=>{if(!v.value)return;let e=h.ranges[t.value]??n.value,r=e===`hide`;v.value.classList.toggle(u,r),r&&(e=h.ranges[t.value+1]??n.value);let i=_(v.value);if(!i.length)return;let a=h.startLine,o=l(i.length+a-1,e);i.forEach((e,t)=>{let n=o.includes(t+a);e.forEach(e=>{e.classList.toggle(d,!0),e.classList.toggle(`highlighted`,n),e.classList.toggle(`dishonored`,!n)})})})}),(t,n)=>(c(),i(`div`,{ref_key:`el`,ref:v,class:`slidev-katex-wrapper`},[e(t.$slots,`default`)],512))}});export{v as t};
transformer-v2/class/assets/slidev/NoteDisplay-CB14pFWa.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{L as e,N as t,V as n,X as r,Y as i,_ as a,_t as o,b as s,bt as c,g as l,it as u,lt as d,m as f,vt as p,w as m,xt as h,y as g,z as _}from"../modules/shiki-BFOesOFp.js";import{nt as v,rt as y}from"../useNav-BZQi666j.js";import{l as b}from"./context-ChHKJoK9.js";var x=[`title`],S={key:0,"flex-auto":``},C={"text-primary":``},w={op50:``,"text-sm":``},T={key:0,absolute:``,"inset-y-0":``,"right-0":``,"w-0.5":``,"bg-primary":``,"z-1":``},E=m({__name:`ClicksSlider`,props:{clicksContext:{},readonly:{type:Boolean},active:{type:Boolean,default:!0},resettable:{type:Boolean},compact:{type:Boolean},attached:{type:Boolean}},emits:[`activate`,`reset`],setup(e,{emit:t}){let r=e,i=t,m=l(()=>r.clicksContext.total),E=l(()=>v(0,r.clicksContext.clicksStart,m.value)),D=l(()=>m.value-E.value+1),O=l({get(){return r.resettable&&!r.active||r.clicksContext.current>m.value?-1:r.clicksContext.current},set(e){if(r.resettable&&e<0){i(`reset`),r.clicksContext.current=b;return}i(`activate`),r.clicksContext.current=e}}),k=l(()=>r.resettable&&O.value<0),A=l(()=>y(E.value,m.value+1)),j=d(),M;function N(e){let t=j.value.getBoundingClientRect();return(e.clientX-t.left)/Math.max(1,t.width)}function P(e,t){if(r.readonly||!j.value||!t&&!(e.buttons&1))return;let n=N(e);if(r.resettable&&n<0){O.value=-1;return}let i=v(0,n,t?.999999:1)*D.value,a=v(0,O.value-E.value,D.value-1),o=t?E.value+Math.floor(i):O.value;!t&&i>=a+1.5?o=E.value+Math.floor(i-.5):!t&&i<a-.5&&(o=E.value+Math.ceil(i-.5)),O.value=v(E.value,o,m.value)}function F(e){r.readonly||(j.value?.setPointerCapture(e.pointerId),M={id:e.pointerId,x:e.clientX,y:e.clientY},P(e,!0))}function I(e){if(M?.id===e.pointerId){if(Math.abs(e.clientX-M.x)<=3&&Math.abs(e.clientY-M.y)<=3)return;M=void 0}P(e,!1)}return(t,i)=>(_(),s(`div`,{class:p([`flex gap-1 select-none`,[e.attached?`items-end`:`items-center`,D.value&&r.clicksContext.isMounted?``:`op50`]]),title:`Clicks in this slide: ${D.value}`},[a(`div`,{class:p([`flex items-center font-mono`,[e.compact?`gap-1 min-w-0 mr0`:`gap-0.2 min-w-16 mr1`,e.attached?`h-[22px]`:``]])},[a(`div`,{class:p([`i-carbon:cursor-1 text-sm op50`,e.compact?`ml-1`:``])},null,2),O.value>=0&&O.value!==o(999999)&&e.active?(_(),s(f,{key:0},[e.compact?g(`v-if`,!0):(_(),s(`div`,S)),a(`span`,null,[a(`span`,C,h(O.value),1),i[2]||=a(`span`,{op25:``,"text-sm":``},`/`,-1),a(`span`,w,h(m.value),1)])],64)):(_(),s(`div`,{key:1,op50:``,class:p(e.compact?``:`flex-auto pl1`)},[a(`span`,{class:p(e.compact?`inline-block text-center`:``),style:c(e.compact?{width:`${String(m.value).length*2+1}ch`,marginLeft:`-0.25ch`}:void 0)},h(m.value),7)],2))],2),a(`div`,{ref_key:`sliderEl`,ref:j,relative:``,"flex-auto":``,"font-mono":``,flex:`~`,"touch-none":``,class:p([e.attached?`h-[22px]`:`h5`,k.value?`op80`:``]),onPointerdownCapture:F,onPointermove:I,onPointerup:i[0]||=e=>u(M)?M.value=void 0:M=void 0,onPointercancel:i[1]||=e=>u(M)?M.value=void 0:M=void 0},[(_(!0),s(f,null,n(A.value,t=>(_(),s(`div`,{key:t,border:`y main`,"of-hidden":``,relative:``,class:p([t===0?`border-l`:``,t===0?e.attached?`rounded-tl`:`rounded-l`:``,t===m.value?`border-r`:``,t===m.value&&+t!=+O.value?e.attached?`rounded-tr`:`rounded-r`:``,e.attached?`border-b-0`:``]),style:c({width:D.value>0?`${1/D.value*100}%`:`100%`})},[a(`div`,{absolute:``,"inset-0":``,class:p(t<=O.value&&e.active?`bg-primary op15`:``)},null,2),+t==+O.value&&e.active?(_(),s(`div`,T)):g(`v-if`,!0),a(`div`,{class:p([+t==+O.value&&e.active?`text-primary font-bold op100`:`op30`,t===m.value?``:`border-r-2 border-main`]),"w-full":``,"h-full":``,"text-xs":``,flex:``,"items-center":``,"justify-center":``,"z-1":``},h(t),3)],6))),128))],34)],10,x))}}),D=[`innerHTML`],O=[`textContent`],k=[`textContent`],A=`slidev-note-fade`,j=`slidev-note-click-mark`,M=m({__name:`NoteDisplay`,props:{class:{},noteHtml:{},note:{},highlight:{type:Boolean,default:!0},placeholder:{},clicksContext:{},autoScroll:{type:Boolean}},emits:[`markerDblclick`,`markerClick`],setup(n,{emit:o}){let c=n,u=o,f=l(()=>c.clicksContext!=null&&c.noteHtml?.includes(j)),m=d(null);function g(){if(!m.value||!f.value)return;let e=Array.from(m.value.querySelectorAll(`.${j}`)),t=new Map,n=new Map,r=0;for(let i of e){let e=Number(i.dataset.clicks);t.set(i,e);let a=i,o=i.parentElement;for(;o&&a!==m.value;)n.has(o)||n.set(o,[[null,r]]),n.get(o).push([a,e]),a=o,o=o.parentElement;r=e}let i=new Map;for(let[e,t]of n){let n=!1,r=0;for(let a of Array.from(e.childNodes)){let o=!1;for(;a===t[r+1]?.[0];)o=!0,r++;if(o)continue;let s=a;if(a.nodeType===3){if(!a.textContent?.trim())continue;s=document.createElement(`span`),s.textContent=a.textContent,e.insertBefore(s,a),a.remove()}n||=r===0,i.set(s,t[r][1])}n||(t[0][1]=-1)}return e=>{let r=c.highlight;for(let[t,i]of n)t.classList.toggle(A,r&&!i.some(([t,n])=>n===e));for(let[t,n]of i)t.classList.toggle(A,r&&n!==e);for(let[n,i]of t)n.classList.remove(A),n.classList.toggle(`${j}-past`,r&&i<e),n.classList.toggle(`${j}-active`,r&&i===e),n.classList.toggle(`${j}-next`,r&&i===e+1),n.classList.toggle(`${j}-future`,r&&i>e+1),n.ondblclick=e=>{r&&(u(`markerDblclick`,e,i),!e.defaultPrevented&&(c.clicksContext.current=i,e.stopPropagation(),e.stopImmediatePropagation()))},n.onclick=e=>{r&&u(`markerClick`,e,i)},r&&c.autoScroll&&i===e&&n.scrollIntoView({block:`center`,behavior:`smooth`})}}let v=d();return i(()=>[c.noteHtml,c.highlight],()=>{t(()=>{v.value=g()})},{immediate:!0}),e(()=>{g()}),r(()=>{let e=c.clicksContext?.current??999999;v.value?.(e)}),(e,t)=>n.noteHtml?(_(),s(`div`,{key:0,ref_key:`noteDisplay`,ref:m,class:p([`prose dark:prose-invert overflow-auto outline-none slidev-note`,[c.class,f.value?`slidev-note-with-clicks`:``]]),innerHTML:n.noteHtml},null,10,D)):n.note?(_(),s(`div`,{key:1,class:p([`prose dark:prose-invert overflow-auto outline-none slidev-note`,c.class])},[a(`p`,{textContent:h(n.note)},null,8,O)],2)):(_(),s(`div`,{key:2,class:p([`prose dark:prose-invert overflow-auto outline-none opacity-50 italic select-none slidev-note`,c.class])},[a(`p`,{textContent:h(c.placeholder||`No notes.`)},null,8,k)],2))}});export{E as n,M as t};
transformer-v2/class/assets/slidev/NoteEditable-C9cjRYMU.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,N as t,X as n,Y as r,_t as i,b as a,bt as o,d as s,l as c,lt as l,mt as u,v as d,vt as f,w as p,z as m}from"../modules/shiki-BFOesOFp.js";import{O as h,S as g,o as _}from"../modules/vue-CXhtJkbE.js";import{t as v}from"../index-CG-YcYMB.js";import{t as y}from"./NoteDisplay-CB14pFWa.js";var b=[`placeholder`],x=p({__name:`NoteEditable`,props:{no:{type:Number,required:!0},class:{default:``},editing:{default:!1},style:{default:()=>({})},placeholder:{default:`No notes for this slide`},clicksContext:{type:Object},highlight:{default:!0},autoHeight:{default:!1}},emits:[`update:editing`,`markerDblclick`,`markerClick`],setup(p,{emit:x}){let S=p,C=x,w=g(S,`editing`,C,{passive:!0}),{info:T,update:E}=v(u(S,`no`)),D=l(``),O,{ignoreUpdates:k}=h(D,e=>{if(!w.value)return;let t=S.no;clearTimeout(O),O=setTimeout(()=>{E({note:e},t)},500)});r(()=>T.value?.note,(e=``)=>{w.value||(clearTimeout(O),k(()=>{D.value=e}))},{immediate:!0,flush:`sync`});let A=l(),j=l();n(()=>{w.value&&A.value?.focus()}),_(A,()=>{w.value=!1});function M(){!S.autoHeight||!A.value||!w.value||A.value.scrollHeight>A.value.clientHeight&&(A.value.style.height=`${A.value.scrollHeight}px`)}function N(e){w.value&&e.metaKey&&e.key===`s`&&(e.preventDefault(),E({note:D.value},S.no))}return r([D,w],()=>{t(()=>{M()})},{flush:`post`,immediate:!0}),(t,n)=>i(w)?e((m(),a(`textarea`,{key:1,ref_key:`inputEl`,ref:A,"onUpdate:modelValue":n[2]||=e=>D.value=e,class:f([`prose dark:prose-invert resize-none overflow-auto outline-none bg-transparent block border-primary border-2 slidev-note placeholder:op25`,[S.class,D.value?``:`italic`]]),style:o([S.style,j.value==null?{}:{height:`${j.value}px`}]),placeholder:p.placeholder,onKeydown:[n[3]||=s(e=>w.value=!1,[`esc`]),N]},null,46,b)),[[c,D.value]]):(m(),d(y,{key:0,class:f([`border-transparent border-2`,[S.class,D.value?``:`opacity-25 italic select-none`]]),style:o(S.style),note:D.value||p.placeholder,"note-html":i(T)?.noteHTML,"clicks-context":p.clicksContext,"auto-scroll":!p.autoHeight,highlight:S.highlight,onMarkerClick:n[0]||=(e,t)=>C(`markerClick`,e,t),onMarkerDblclick:n[1]||=(e,t)=>C(`markerDblclick`,e,t)},null,8,[`class`,`style`,`note`,`note-html`,`clicks-context`,`auto-scroll`,`highlight`]))}});export{x as t};
transformer-v2/class/assets/slidev/TimerBar-D1wAIpGN.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{Q as e,S as t,V as n,_t as r,a as i,b as a,bt as o,g as s,m as c,mt as l,st as u,vt as d,w as f,y as p,z as m}from"../modules/shiki-BFOesOFp.js";import{U as h,t as g,tt as _}from"../useNav-BZQi666j.js";import{P as v}from"../modules/vue-CXhtJkbE.js";import{o as y}from"../index-CG-YcYMB.js";var b={class:`relative flex gap-px`},x=f({__name:`CurrentProgressBar`,props:{clicksContext:{},current:{}},setup(l){let u=l,f=g(),h=s(()=>u.clicksContext??f.clicksContext.value),_=s(()=>u.current??f.currentSlideNo.value),{total:v}=f;return(s,l)=>(m(),a(`div`,b,[(m(!0),a(c,null,n(r(v)-1,n=>(m(),a(`div`,{key:n,class:d([`border-x border-b border-main h-4px transition-all`,n<_.value?`bg-primary border-primary`:``]),style:o({width:`${1/(r(v)-1)*100}%`})},[t(i,{name:`fade`},{default:e(()=>[n===_.value?(m(),a(`div`,{key:0,class:`h-full bg-primary op75 transition-all`,style:o({width:`${h.value.total===0?0:h.value.current/(h.value.total+1)*100}%`})},null,4)):p(`v-if`,!0)]),_:2},1024)],6))),128))]))}});function S(){let e=s(()=>_.timer||`stopwatch`),t=s(()=>h(_.duration).seconds),n=v(100,{controls:!0}),r=l(y,`timer`),i=s(()=>r.value?.status),a=s(()=>(n.counter.value,r.value.status===`stopped`||!r.value.startedAt?0:r.value.status===`paused`?r.value.pausedAt-r.value.startedAt:Date.now()-r.value.startedAt)),o=s(()=>a.value/1e3),c=s(()=>o.value/t.value*100),u=s(()=>{if(e.value===`stopwatch`&&(r.value.status===`stopped`||!r.value.startedAt))return{h:``,m:`-`,s:`--`,ms:`-`};let n=e.value===`countdown`?t.value*1e3-a.value:a.value,i=Math.floor(n/1e3/60/60).toString();i===`0`&&(i=``);let o=Math.floor(n/1e3/60%60).toString();i&&(o=o.padStart(2,`0`));let s=Math.floor(n/1e3%60).toString().padStart(2,`0`),c=Math.floor(n%1e3/100).toString();return{h:i,m:o,s,ms:c}});function d(){n.pause(),r.value={status:`stopped`,slides:{},startedAt:0,pausedAt:0}}function f(){r.value&&(r.value?.status===`stopped`?(r.value.status=`running`,r.value.startedAt=Date.now()):r.value.status===`paused`&&(r.value.status=`running`,r.value.startedAt=Date.now()-(r.value.pausedAt-r.value.startedAt)),n.resume())}function p(){r.value.status=`paused`,r.value.pausedAt=Date.now(),n.pause()}function m(){r.value.status===`running`?p():f()}return{state:r,status:i,timer:u,reset:d,toggle:m,resume:f,pause:p,passed:o,percentage:c,duration:t,mode:e}}var C={class:`border-b mt-px border-main relative flex h-4px`},w=f({__name:`TimerBar`,setup(e){let t=u(S()),n=s(()=>t.status===`stopped`?`op50`:t.status===`paused`?`bg-blue`:t.percentage>100?`bg-red`:t.percentage>80?`bg-yellow`:`bg-green`);return(e,r)=>(m(),a(`div`,C,[t.status===`stopped`?p(`v-if`,!0):(m(),a(`div`,{key:0,class:d([`h-4px`,n.value]),style:o({width:`${t.percentage}%`})},null,6)),p(` {{ timesplits }} `)]))}});export{S as n,x as r,w as t};
transformer-v2/class/assets/slidev/VClicks-DR1s1I9G.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{$ as e,A as t,D as n,L as r,R as i,S as a,W as o,m as s,p as c,v as l,w as u,z as d}from"../modules/shiki-BFOesOFp.js";import{K as f,it as p}from"../useNav-BZQi666j.js";import{n as m}from"./context-ChHKJoK9.js";import{u as h}from"../index-CG-YcYMB.js";var g=u({__name:`VClickGap`,props:{size:{type:[String,Number],default:1}},setup(e){let t=e,{$clicksContext:n}=m(),a=h(),o=+t.size;return Number.isNaN(o)&&(console.warn(`[slidev] Invalid size for VClickGap: ${t.size}`),o=1),r(()=>{let e=n.currentOffset+o-1;n.register(a,{max:e,delta:o})}),i(()=>{n.unregister(a)}),(e,t)=>(d(),l(s))}}),_=[`ul`,`ol`],v=/[\s,]+/,y=u({props:{depth:{type:[Number,String],default:1},every:{type:[Number,String],default:1},at:{type:[Number,String],default:`+1`},hide:{type:Boolean,default:!1},fade:{type:Boolean,default:!1},animation:{type:[String,Array],default:void 0},handleSpecialElements:{type:Boolean,default:!0}},render(){let r=+this.every,i=f(this.at),s=typeof i==`string`,l=this.$slots.default?.();if(i==null||!l)return l;let u=o(`click`),d=(t,n)=>{let r={hide:this.hide};return typeof this.animation==`string`?this.animation.split(v).forEach(e=>{e&&(r[e]=!0)}):Array.isArray(this.animation)&&this.animation.forEach(e=>r[e]=!0),this.fade&&(r.fade=!0),e(t,[[u,n,``,r]])},m=e=>e.flatMap(e=>t(e)&&typeof e.type==`symbol`&&Array.isArray(e.children)?m(e.children):[e]);l=m(p(l));let h=(e,r=1)=>m(e).map(e=>{if(!t(e))return e;if(_.includes(e.type)&&Array.isArray(e.children)){let t=x(e.children,r+1);return n(e,{},t)}return n(e)}),y=1,b=0,x=(e,a=1)=>m(e).map(e=>{if(!t(e)||e.type===c)return e;let o=+i+Math.ceil(y++/r)-1,l;l=a<+this.depth&&Array.isArray(e.children)?n(e,{},h(e.children,a)):n(e);let u=o-b;return b=o,d(l,s?u>=0?`+${u}`:`${u}`:o)}),S=()=>a(g,{size:+i+Math.ceil((y-1)/r)-1-b});if(this.handleSpecialElements){if(l.length===1&&_.includes(l[0].type)&&Array.isArray(l[0].children))return n(l[0],{},[...x(l[0].children),S()]);if(l.length===1&&l[0].type===`table`){let e=l[0];if(Array.isArray(e.children))return n(e,{},e.children.map(e=>t(e)?e.type===`tbody`&&Array.isArray(e.children)?n(e,{},[...x(e.children),S()]):n(e):e))}}return[...x(l),S()]}});export{y as t};
transformer-v2/class/assets/slidev/client-BNcmSz3b.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import"../useNav-BZQi666j.js";import"./context-ChHKJoK9.js";import"../syncState-BrWO1mSt.js";import"../index-CG-YcYMB.js";import"../useDrawings-DFNMQL0q.js";
transformer-v2/class/assets/slidev/notes-DsoPOK4i.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{Q as e,S as t,Y as n,_ as r,_t as i,b as a,bt as o,g as s,lt as c,m as l,w as u,x as d,xt as f,z as p}from"../modules/shiki-BFOesOFp.js";import{$ as m,W as h,t as g,u as _}from"../useNav-BZQi666j.js";import{h as v}from"../modules/vue-CXhtJkbE.js";import{m as y,o as b}from"../index-CG-YcYMB.js";import{t as x}from"./IconButton-B5keGFol.js";import{t as S}from"./Modal-BkELU18P.js";import{n as C,t as w}from"./NoteDisplay-CB14pFWa.js";import{r as T,t as E}from"./TimerBar-D1wAIpGN.js";var D={class:`flex my-1`},O={class:`h-full flex flex-col`},k={class:`flex-none border-t border-main`,px3:``,py2:``},A={class:`flex-none border-t border-main`},j={class:`flex gap-1 items-center px-6 py-3`},M={key:0,class:`i-carbon:minimize`},N={key:1,class:`i-carbon:maximize`},P={class:`px2 my-auto`},F={class:`text-lg`},I={class:`opacity-50 text-sm`},L=u({__name:`notes`,setup(u){y({title:`Notes - ${m}`});let{slides:L,total:R}=g(),{isFullscreen:z,toggle:B}=_,V=c(),H=v(`slidev-notes-font-size`,18),U=s(()=>b.page),W=c(!1),G=s(()=>L.value.find(e=>e.no===U.value));n(U,()=>{V.value?.scrollTo({left:0,top:0,behavior:`smooth`}),window.scrollTo({left:0,top:0,behavior:`smooth`})});function K(){H.value+=1}function q(){--H.value}let J=s(()=>{let e=b.clicks,t=b.clicksTotal;return h(c(e),void 0,t)});return(n,s)=>(p(),a(l,null,[t(S,{modelValue:W.value,"onUpdate:modelValue":s[1]||=e=>W.value=e,class:`px-6 py-4 flex flex-col gap-2`},{default:e(()=>[s[3]||=r(`div`,{class:`flex gap-2 text-xl`},[r(`div`,{class:`i-carbon:information my-auto`}),d(` Help `)],-1),s[4]||=r(`div`,{class:`prose dark:prose-invert`},[r(`p`,null,`This is the hands-free live notes viewer.`),r(`p`,null,`It's designed to be used in a separate view or device. The progress is controlled by and auto synced with the main presenter or slide.`)],-1),r(`div`,D,[r(`button`,{class:`slidev-form-button`,onClick:s[0]||=e=>W.value=!1},` Close `)])]),_:1},8,[`modelValue`]),r(`div`,O,[t(T,{"clicks-context":J.value,current:U.value},null,8,[`clicks-context`,`current`]),t(E),r(`div`,{ref_key:`scroller`,ref:V,class:`px-5 py-3 flex-auto h-full overflow-auto`,style:o({fontSize:`${i(H)}px`})},[t(w,{note:G.value?.meta.slide.note,"note-html":G.value?.meta.slide.noteHTML,placeholder:`No notes for Slide ${U.value}.`,"clicks-context":J.value,"auto-scroll":!0},null,8,[`note`,`note-html`,`placeholder`,`clicks-context`])],4),r(`div`,k,[t(C,{"clicks-context":J.value,readonly:``},null,8,[`clicks-context`])]),r(`div`,A,[r(`div`,j,[t(x,{title:i(z)?`Close fullscreen`:`Enter fullscreen`,onClick:i(B)},{default:e(()=>[i(z)?(p(),a(`div`,M)):(p(),a(`div`,N))]),_:1},8,[`title`,`onClick`]),t(x,{title:`Increase font size`,onClick:K},{default:e(()=>[...s[5]||=[r(`div`,{class:`i-carbon:zoom-in`},null,-1)]]),_:1}),t(x,{title:`Decrease font size`,onClick:q},{default:e(()=>[...s[6]||=[r(`div`,{class:`i-carbon:zoom-out`},null,-1)]]),_:1}),t(x,{title:`Edit notes`,to:`/notes-edit`,target:`_blank`},{default:e(()=>[...s[7]||=[r(`div`,{class:`i-carbon:edit`},null,-1)]]),_:1}),t(x,{title:`Help`,class:`rounded-full`,onClick:s[2]||=e=>W.value=!0},{default:e(()=>[...s[8]||=[r(`div`,{class:`i-carbon:help`},null,-1)]]),_:1}),s[9]||=r(`div`,{class:`flex-auto`},null,-1),r(`div`,P,[r(`span`,F,f(U.value),1),r(`span`,I,` / `+f(i(R)),1)])])])])],64))}});export{L as default};
transformer-v2/class/assets/slidev/notes-edit-i_aqIsEu.js ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ import{$ as e,Q as t,S as n,_ as r,b as i,l as a,lt as o,m as s,w as c,x as l,z as u}from"../modules/shiki-BFOesOFp.js";import{$ as d,t as f}from"../useNav-BZQi666j.js";import{D as p}from"../modules/vue-CXhtJkbE.js";import{m,t as h}from"../index-CG-YcYMB.js";import{t as g}from"./IconButton-B5keGFol.js";import{t as _}from"./Modal-BkELU18P.js";var v={class:`flex my-1`},y={class:`h-full`},b={class:`slidev-glass-effect fixed bottom-5 right-5 rounded-full border border-main`},x=c({__name:`notes-edit`,setup(c){let x=/^---\s*#(\d+)\s*$/;m({title:`Notes Edit - ${d}`});let{slides:S}=f(),C=o(!1),w=o(T(S.value));function T(e){let t=[];for(let n of e)n.meta.slide.note?.trim()&&(t.push(`--- #${n.no}`),t.push(``),t.push(n.meta.slide.note),t.push(``));return t.join(`
2
+ `)}function E(e,t){let n=e.split(/^(---\s*#\d+\s*)$/gm);n.forEach((e,r)=>{let i=e.match(x);if(i){let e=Number.parseInt(i[1]),a=n[r+1].trim(),o=t.find(t=>t.no===e);o&&(o.meta.slide.note=a,h(e).update({note:a}))}})}return p(w,e=>{E(e,S.value)},{debounce:300}),(o,c)=>(u(),i(s,null,[n(_,{modelValue:C.value,"onUpdate:modelValue":c[1]||=e=>C.value=e,class:`px-6 py-4 flex flex-col gap-2`},{default:t(()=>[c[4]||=r(`div`,{class:`flex gap-2 text-xl`},[r(`div`,{class:`i-carbon:information my-auto`}),l(` Help `)],-1),c[5]||=r(`div`,{class:`prose dark:prose-invert`},[r(`p`,null,`This is the batch notes editor. You can edit the notes for all the slides at once here.`),r(`p`,null,[l(`The note for each slide are separated by `),r(`code`,null,`--- #[no]`),l(` lines, you might want to keep them while editing.`)])],-1),r(`div`,v,[r(`button`,{class:`slidev-form-button`,onClick:c[0]||=e=>C.value=!1},` Close `)])]),_:1},8,[`modelValue`]),r(`div`,y,[r(`div`,b,[n(g,{title:`Help`,class:`rounded-full`,onClick:c[2]||=e=>C.value=!0},{default:t(()=>[...c[6]||=[r(`div`,{class:`i-carbon:help text-2xl`},null,-1)]]),_:1})]),e(r(`textarea`,{"onUpdate:modelValue":c[3]||=e=>w.value=e,class:`prose dark:prose-invert resize-none p5 outline-none bg-transparent block h-full w-full! max-w-full! max-h-full! min-h-full! min-w-full!`},null,512),[[a,w.value]])])],64))}});export{x as default};
transformer-v2/class/assets/slidev/overview-C0t3M0qP.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{L as e,N as t,Q as n,R as r,S as i,V as a,_ as o,_t as s,b as c,bt as l,ft as u,g as d,lt as f,m as p,st as m,v as h,vt as g,w as ee,xt as _,y as v,z as y}from"../modules/shiki-BFOesOFp.js";import{$ as te,B as b,G as ne,R as x,X as re,Y as S,t as ie}from"../useNav-BZQi666j.js";import{t as C}from"../_plugin-vue_export-helper-BDNMzG2s.js";import{B as ae,z as oe}from"../modules/vue-CXhtJkbE.js";import{l as w}from"./context-ChHKJoK9.js";import{d as se,f as T,m as ce,p as le}from"../index-CG-YcYMB.js";import{t as E}from"./IconButton-B5keGFol.js";import{n as D}from"./NoteDisplay-CB14pFWa.js";import{n as ue,r as de}from"../modules/unplugin-icons-Btg0kt9H.js";import{i as fe,o as pe,t as me}from"../SlideWrapper-pRl27kyE.js";import{t as he}from"./NoteEditable-C9cjRYMU.js";var ge={class:`h-screen w-screen of-hidden flex`},_e={key:0,class:`grid grid-rows-[auto_max-content] border-r border-main select-none max-h-full h-full`},ve={class:`relative`},ye={class:`absolute left-0 top-0 bottom-0 w-200 flex flex-col flex-auto items-end group p-6px md:p-10px gap-1 max-h-full of-x-visible of-y-auto`,style:{direction:`rtl`}},be=[`onClick`],xe={p2:``,border:`t main`},Se={class:`flex flex-col gap-1 mx-1 items-end`},Ce={key:0,class:`flex items-end gap-2`},we=[`onClick`],Te=[`onDblclick`],Ee={key:2,class:`select-none absolute bottom-0 right-0 bg-main rounded-tl p2 op35 text-xs`},De={key:1,class:`absolute z-2 top-0 right-0 px3 py1.5 border-b border-l rounded-lb bg-main/80 backdrop-blur border-main select-none`},Oe={class:`text-xs op50`},O=450,k=C(ee({__name:`overview`,setup(ee){ce({title:`Overview - ${te}`});let C=oe(),k=ae(),{openInEditor:ke,slides:A,isEmbedded:j}=ie(),M=d(()=>C.query.mode===`preview`),N=d(()=>M.value&&j.value),P=d(()=>M.value?N.value?Math.max(0,x.width.value-16):Math.min(900,Math.max(320,x.width.value-160)):O),Ae=d(()=>P.value/re.value),F=m(new Map),I=m(new Map),L=f([]),R=f(),z=f(null),B=0,V,H,U=d(()=>A.value.map(e=>Pe(e.meta?.slide?.note||``))),je=d(()=>U.value.reduce((e,t)=>e+t,0)),Me=d(()=>A.value.map(e=>q(e)).reduce((e,t)=>e+t,0)),Ne=d(()=>String(Math.max(1,A.value.length)).length),W=u(),G=new WeakMap;function K(e){return G.has(e)||G.set(e,ne(e,w)),G.get(e)}function q(e){return e.meta?.clicks||K(e)?.total}function J(e){W.value===e?W.value=void 0:W.value=e}function Pe(e){let t=e.match(/[\w`'\-\u0392-\u03C9\u00C0-\u00FF\u0600-\u06FF\u0400-\u04FF]+|[\u4E00-\u9FFF\u3400-\u4DBF\uF900-\uFAFF\u3040-\u309F\uAC00-\uD7AF]+/g),n=0;if(!t)return 0;for(let e=0;e<t.length;e++)t[e].charCodeAt(0)>=19968?n+=t[e].length:n+=1;return n}function Fe(){let e=window.innerHeight||document.documentElement.clientHeight,t,n=[];for(let[r,i]of F.entries()){let a=i.getBoundingClientRect(),o=Math.max(0,Math.min(a.bottom,e)-Math.max(a.top,0));o!==0&&(o>=a.height&&n.push(r),(!t||o>t.visibleHeight)&&(t={idx:r,visibleHeight:o}))}L.value=n.length?n:t?[t.idx]:[]}function Y(e){let t=document.createElement(`a`);t.target=`_blank`,t.href=S+e.slice(1),t.click()}function Ie(e){let t=new URL(S+e.slice(1),location.href).href;if(j.value){window.parent.postMessage({target:`slidev`,sender:`slidev`,type:`open-external`,url:t},`*`);return}Y(e)}function Le(e){let t=F.get(e);t&&t.scrollIntoView({behavior:`smooth`,block:`start`})}function X(e){let t=I.get(e)||F.get(e);if(!t||!R.value)return null;let n=R.value.getBoundingClientRect();return t.getBoundingClientRect().top-n.top+R.value.scrollTop}function Z(e){if(!R.value||A.value.length===0)return;let t=Math.min(Math.max(e,1),A.value.length),n=Math.floor(t)-1,r=t-(n+1),i=X(n),a=X(n+1);if(i==null)return;let o=i+(a==null?0:(a-i)*r)-R.value.clientHeight*.5;Math.abs(R.value.scrollTop-o)<1||R.value.scrollTo({top:o})}function Re(){let e=C.query.slideNo,t=Number(Array.isArray(e)?e[0]:e);return Number.isFinite(t)&&t>0?t:void 0}function Q(e){if(!N.value)return;let t=Number(e.toFixed(3)).toString();C.query.slideNo!==t&&k.replace({query:{...C.query,slideNo:t}})}function ze(){if(!R.value||A.value.length===0)return null;let e=R.value.scrollTop+R.value.clientHeight*.5,t=A.value.map((e,t)=>X(t)).filter(e=>e!=null);if(t.length===0)return null;if(t.length===1||e<=t[0])return 1;for(let n=1;n<t.length;n++)if(e<=t[n]){let r=Math.max(1,t[n]-t[n-1]);return n+(e-t[n-1])/r}return A.value.length}function Be(e){V=e,!H&&(H=setTimeout(()=>{H=void 0;let e=V;V=void 0,e!=null&&(Q(e),!(Date.now()<B)&&window.parent.postMessage({target:`slidev`,sender:`slidev`,type:`overview-scroll`,no:e},`*`))},50))}function Ve(){if(Fe(),!N.value||Date.now()<B)return;let e=ze();e!=null&&Be(e)}function $({data:e}){if(!N.value||e?.target!==`slidev`||e.sender!==`vscode`||e.type!==`overview-scroll`)return;let t=Number(e.no);t>0&&(B=Date.now()+300,V=void 0,Q(t),Z(t))}function He(e,t,n){let r=K(n);r.current=r.current===t?w:t,e.preventDefault()}function Ue(e,t){if(e.ctrlKey||e.metaKey){e.preventDefault(),Ie(b(t,!1));return}let n=t.meta?.slide;n&&window.parent.postMessage({target:`slidev`,type:`command`,command:`goto`,args:[n.filepath,n.sourceIndex]},`*`)}return e(()=>{window.addEventListener(`message`,$);let e=N.value?Re():void 0;e!=null&&(B=Date.now()+300,Z(e)),t(()=>{e!=null&&Z(e),Fe()})}),r(()=>{window.removeEventListener(`message`,$),H&&clearTimeout(H)}),(e,t)=>{let r=ue,u=de;return y(),c(`div`,ge,[s(j)?v(`v-if`,!0):(y(),c(`nav`,_e,[o(`div`,ve,[o(`div`,ye,[(y(!0),c(p,null,a(s(A),(e,t)=>(y(),c(`div`,{key:e.no,class:`relative`,style:{direction:`ltr`}},[o(`button`,{class:g([`relative transition duration-300 w-8 h-8 rounded hover:bg-active hover:op100`,L.value.includes(t)?`op100 text-primary bg-gray:5`:`op20`]),onClick:e=>Le(t)},[o(`div`,null,_(t+1),1)],10,be),e.meta?.slide?.title?(y(),c(`div`,{key:0,class:g([`pointer-events-none select-none absolute left-110% top-50% translate-y--50% ws-nowrap z-label px2 slidev-glass-effect transition duration-400 op0 group-hover:op100`,L.value.includes(t)?`text-primary`:`text-main important-text-op-50`])},_(e.meta?.slide?.title),3)):v(`v-if`,!0)]))),128))])]),o(`div`,xe,[s(se)?(y(),h(E,{key:1,title:s(T)?`Dark mode`:`Light mode`,"pointer-events-none":``,op50:``},{default:n(()=>[s(T)?(y(),h(r,{key:0})):(y(),h(u,{key:1}))]),_:1},8,[`title`])):(y(),h(E,{key:0,title:s(T)?`Switch to light mode theme`:`Switch to dark mode theme`,onClick:t[0]||=e=>s(le)()},{default:n(()=>[s(T)?(y(),h(r,{key:0})):(y(),h(u,{key:1}))]),_:1},8,[`title`]))])])),o(`main`,{ref_key:`scroller`,ref:R,class:`flex-1 h-full of-auto`,style:l(`grid-template-columns: repeat(auto-fit,minmax(${O}px,1fr))`),onScroll:Ve},[(y(!0),c(p,null,a(s(A),(e,r)=>(y(),c(`div`,{key:e.no,ref_for:!0,ref:e=>F.set(r,e),class:g([`overview-slide-block relative of-hidden flex gap-4 min-h-50`,[r===0&&!N.value?`pt2`:``,N.value?`justify-center`:`border-t border-main`]])},[N.value?v(`v-if`,!0):(y(),c(`div`,{key:0,class:g([`select-none text-right my5 flex flex-col justify-between items-end`,M.value?`w-9`:`w-13`]),style:l({height:`${Ae.value}px`})},[o(`div`,{class:`self-center text-3xl op20 mb2 text-center mr--14px tabular-nums`,style:l({width:`${Ne.value}ch`})},_(r+1),5),o(`div`,Se,[i(E,{class:g([`overview-slide-action mr--4 op0`,M.value?`text-lg`:``]),title:`Play in new tab`,onClick:t=>Y(s(b)(e,!1))},{default:n(()=>[...t[4]||=[o(`div`,{class:`i-carbon:presentation-file`},null,-1)]]),_:1},8,[`class`,`onClick`]),v(`v-if`,!0)])],6)),o(`div`,{class:g([`flex flex-col`,N.value?`my1 gap-0`:`my5 gap-2`]),style:l({width:`${P.value}px`})},[N.value?(y(),c(`div`,Ce,[o(`button`,{type:`button`,class:`select-none pl-1 text-lg leading-tight op60 tabular-nums hover:op90 hover:underline underline-offset-2`,onClick:t=>Ue(t,e)},_(r+1),9,we),q(e)?(y(),h(D,{key:0,active:W.value===e,"clicks-context":K(e),resettable:``,compact:``,attached:``,class:`ml-auto w-88 min-w-[70%] max-w-[calc(100%-3rem)]`,onDblclick:t=>J(e),onActivate:t=>W.value=e,onReset:t[1]||=e=>W.value=void 0},null,8,[`active`,`clicks-context`,`onDblclick`,`onActivate`])):v(`v-if`,!0)])):v(`v-if`,!0),o(`div`,{ref_for:!0,ref:e=>I.set(r,e),class:g([`border rounded border-main overflow-hidden bg-main h-max`,[N.value&&q(e)?`rounded-tr-0`:``,N.value?``:`select-none`]]),onDblclick:t=>!N.value&&Y(s(b)(e,!1))},[(y(),h(fe,{key:e.no,width:P.value,class:g(N.value?``:`pointer-events-none important:[&_*]:select-none`)},{default:n(()=>[i(me,{"clicks-context":K(e),route:e,"render-context":`overview`},null,8,[`clicks-context`,`route`]),i(pe,{page:e.no},null,8,[`page`])]),_:2},1032,[`width`,`class`]))],42,Te),q(e)&&!N.value?(y(),h(D,{key:1,active:W.value===e,"clicks-context":K(e),resettable:``,class:g([`ml-1 w-[calc(100%-0.25rem)]`,M.value?``:`mt-2`]),onDblclick:t=>J(e),onActivate:t=>W.value=e,onReset:t[2]||=e=>W.value=void 0},null,8,[`active`,`clicks-context`,`class`,`onDblclick`,`onActivate`])):v(`v-if`,!0)],6),M.value?v(`v-if`,!0):(y(),h(he,{key:1,no:e.no,class:`relative z-1 max-w-250 w-250 text-lg rounded p3`,"auto-height":!0,highlight:W.value===e,editing:z.value===e.no,"clicks-context":K(e),onDblclick:t=>z.value===e.no?null:z.value=e.no,"onUpdate:editing":t[3]||=e=>z.value=null,onMarkerClick:(t,n)=>He(t,n,e)},null,8,[`no`,`highlight`,`editing`,`clicks-context`,`onDblclick`,`onMarkerClick`])),!M.value&&U.value[r]>0?(y(),c(`div`,Ee,_(U.value[r])+` words `,1)):v(`v-if`,!0)],2))),128))],36),s(j)?v(`v-if`,!0):(y(),c(`div`,De,[o(`div`,Oe,_(s(A).length)+` slides · `+_(Me.value+s(A).length-1)+` clicks · `+_(je.value)+` words `,1)]))])}}}),[[`__scopeId`,`data-v-47f32601`]]);export{k as default};