Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@observablehq/runtime

Package Overview
Dependencies
Maintainers
3
Versions
134
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@observablehq/runtime - npm Package Compare versions

Comparing version 3.0.6 to 3.0.7

4

dist/runtime.js

@@ -1,2 +0,2 @@

// @observablehq/runtime v3.0.6 Copyright 2019 Observable, Inc.
function e(e,t,n){n=n||{};var r=e.ownerDocument,o=r.defaultView.CustomEvent;"function"==typeof o?o=new o(t,{detail:n}):((o=r.createEvent("Event")).initEvent(t,!1,!1),o.detail=n),e.dispatchEvent(o)}function t(e){return Array.isArray(e)||e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function n(e){return e===(0|e)+""}function r(e){const t=document.createElement("span");return t.className="observablehq--cellname",t.textContent=`${e} = `,t}const o=Symbol.prototype.toString;function i(e){return o.call(e)}const{getOwnPropertySymbols:a,prototype:{hasOwnProperty:u}}=Object,{toStringTag:s}=Symbol,l={},c=a;function d(e,t){return u.call(e,t)}function f(e){return e[s]||e.constructor&&e.constructor.name||"Object"}function p(e,t){try{const n=e[t];return n&&n.constructor,n}catch(e){return l}}function h(n,o,i){const a=t(n);let u,s,l;n instanceof Map?(u=`Map(${n.size})`,s=m):n instanceof Set?(u=`Set(${n.size})`,s=v):a?(u=`${n.constructor.name}(${n.length})`,s=b):(u=f(n),s=w);const c=document.createElement("span");c.className="observablehq--expanded",i&&c.appendChild(r(i));const d=c.appendChild(document.createElement("a"));d.innerHTML="<svg width=8 height=8 class='observablehq--caret'>\n <path d='M4 7L0 1h8z' fill='currentColor' />\n </svg>",d.appendChild(document.createTextNode(`${u}${a?" [":" {"}`)),d.addEventListener("mouseup",function(e){e.stopPropagation(),G(c,x(n,null,i))}),s=s(n);for(let e=0;!(l=s.next()).done&&e<20;++e)c.appendChild(l.value);if(!l.done){const t=c.appendChild(document.createElement("a"));t.className="observablehq--field",t.style.display="block",t.appendChild(document.createTextNode(" … more")),t.addEventListener("mouseup",function(t){t.stopPropagation(),c.insertBefore(l.value,c.lastChild.previousSibling);for(let e=0;!(l=s.next()).done&&e<19;++e)c.insertBefore(l.value,c.lastChild.previousSibling);l.done&&c.removeChild(c.lastChild.previousSibling),e(c,"load")})}return c.appendChild(document.createTextNode(a?"]":"}")),c}function*m(e){for(const[t,n]of e)yield g(t,n);yield*w(e)}function*v(e){for(const t of e)yield y(t);yield*w(e)}function*b(e){for(let t=0,n=e.length;t<n;++t)t in e&&(yield _(t,p(e,t),"observablehq--index"));for(const t in e)!n(t)&&d(e,t)&&(yield _(t,p(e,t),"observablehq--key"));for(const t of c(e))yield _(i(t),p(e,t),"observablehq--symbol")}function*w(e){for(const t in e)d(e,t)&&(yield _(t,p(e,t),"observablehq--key"));for(const t of c(e))yield _(i(t),p(e,t),"observablehq--symbol")}function _(e,t,n){const r=document.createElement("div"),o=r.appendChild(document.createElement("span"));return r.className="observablehq--field",o.className=n,o.textContent=` ${e}`,r.appendChild(document.createTextNode(": ")),r.appendChild(V(t)),r}function g(e,t){const n=document.createElement("div");return n.className="observablehq--field",n.appendChild(document.createTextNode(" ")),n.appendChild(V(e)),n.appendChild(document.createTextNode(" => ")),n.appendChild(V(t)),n}function y(e){const t=document.createElement("div");return t.className="observablehq--field",t.appendChild(document.createTextNode(" ")),t.appendChild(V(e)),t}function x(e,n,o){const i=t(e);let a,u,s;if(e instanceof Map?(a=`Map(${e.size})`,u=C):e instanceof Set?(a=`Set(${e.size})`,u=E):i?(a=`${e.constructor.name}(${e.length})`,u=N):(a=f(e),u=S),n){const t=document.createElement("span");return t.className="observablehq--shallow",o&&t.appendChild(r(o)),t.appendChild(document.createTextNode(a)),t.addEventListener("mouseup",function(n){n.stopPropagation(),G(t,x(e))}),t}const l=document.createElement("span");l.className="observablehq--collapsed",o&&l.appendChild(r(o));const c=l.appendChild(document.createElement("a"));c.innerHTML="<svg width=8 height=8 class='observablehq--caret'>\n <path d='M7 4L1 8V0z' fill='currentColor' />\n </svg>",c.appendChild(document.createTextNode(`${a}${i?" [":" {"}`)),l.addEventListener("mouseup",function(t){t.stopPropagation(),G(l,h(e,0,o))},!0),u=u(e);for(let e=0;!(s=u.next()).done&&e<20;++e)e>0&&l.appendChild(document.createTextNode(", ")),l.appendChild(s.value);return s.done||l.appendChild(document.createTextNode(", …")),l.appendChild(document.createTextNode(i?"]":"}")),l}function*C(e){for(const[t,n]of e)yield k(t,n);yield*S(e)}function*E(e){for(const t of e)yield V(t,!0);yield*S(e)}function*N(e){let t=-1,r=0;for(const n=e.length;r<n;++r)r in e&&(r>t+1&&(yield P(r-t-1)),yield V(p(e,r),!0),t=r);r>t+1&&(yield P(r-t-1));for(const t in e)!n(t)&&d(e,t)&&(yield q(t,p(e,t),"observablehq--key"));for(const t of c(e))yield q(i(t),p(e,t),"observablehq--symbol")}function*S(e){for(const t in e)d(e,t)&&(yield q(t,p(e,t),"observablehq--key"));for(const t of c(e))yield q(i(t),p(e,t),"observablehq--symbol")}function P(e){const t=document.createElement("span");return t.className="observablehq--empty",t.textContent=1===e?"empty":`empty × ${e}`,t}function q(e,t,n){const r=document.createDocumentFragment(),o=r.appendChild(document.createElement("span"));return o.className=n,o.textContent=e,r.appendChild(document.createTextNode(": ")),r.appendChild(V(t,!0)),r}function k(e,t){const n=document.createDocumentFragment();return n.appendChild(V(e,!0)),n.appendChild(document.createTextNode(" => ")),n.appendChild(V(t,!0)),n}function j(e,t){var n=e+"",r=n.length;return r<t?new Array(t-r+1).join(0)+n:n}function $(e){return e<0?"-"+j(-e,6):e>9999?"+"+j(e,6):j(e,4)}var L=Error.prototype.toString;var M=RegExp.prototype.toString;const O=20;function T(e){return e.replace(/[\\`\x00-\x09\x0b-\x19]|\${/g,A)}function A(e){var t=e.charCodeAt(0);switch(t){case 8:return"\\b";case 9:return"\\t";case 11:return"\\v";case 12:return"\\f";case 13:return"\\r"}return t<16?"\\x0"+t.toString(16):t<32?"\\x"+t.toString(16):"\\"+e}function U(e,t){for(var n=0;t.exec(e);)++n;return n}var F=Function.prototype.toString,D={prefix:"async ƒ"},R={prefix:"async ƒ*"},z={prefix:"class"},H={prefix:"ƒ"},I={prefix:"ƒ*"};function W(e,t,n){var o=document.createElement("span");o.className="observablehq--function",n&&o.appendChild(r(n));var i=o.appendChild(document.createElement("span"));return i.className="observablehq--keyword",i.textContent=e.prefix,o.appendChild(document.createTextNode(t)),o}const{prototype:{toString:B}}=Object;function V(e,t,n,o){let a=typeof e;switch(a){case"boolean":case"undefined":e+="";break;case"number":e=0===e&&1/e<0?"-0":e+"";break;case"bigint":e+="n";break;case"symbol":e=i(e);break;case"function":return function(e,t){var n,r,o=F.call(e);switch(e.constructor&&e.constructor.name){case"AsyncFunction":n=D;break;case"AsyncGeneratorFunction":n=R;break;case"GeneratorFunction":n=I;break;default:n=/^class\b/.test(o)?z:H}return n===z?W(n,"",t):(r=/^(?:async\s*)?(\w+)\s*=>/.exec(o))?W(n,"("+r[1]+")",t):(r=/^(?:async\s*)?\(\s*(\w+(?:\s*,\s*\w+)*)?\s*\)/.exec(o))?W(n,r[1]?"("+r[1].replace(/\s*,\s*/g,", ")+")":"()",t):(r=/^(?:async\s*)?function(?:\s*\*)?(?:\s*\w+)?\s*\(\s*(\w+(?:\s*,\s*\w+)*)?\s*\)/.exec(o))?W(n,r[1]?"("+r[1].replace(/\s*,\s*/g,", ")+")":"()",t):W(n,"(…)",t)}(e,o);case"string":return function(e,t,n,o){if(!1===t){if(U(e,/["\n]/g)<=U(e,/`|\${/g)){const t=document.createElement("span");o&&t.appendChild(r(o));const n=t.appendChild(document.createElement("span"));return n.className="observablehq--string",n.textContent=JSON.stringify(e),t}const i=e.split("\n");if(i.length>O&&!n){const n=document.createElement("div");o&&n.appendChild(r(o));const a=n.appendChild(document.createElement("span"));a.className="observablehq--string",a.textContent="`"+T(i.slice(0,O).join("\n"));const u=n.appendChild(document.createElement("span")),s=i.length-O;return u.textContent=`Show ${s} truncated line${s>1?"s":""}`,u.className="observablehq--string-expand",u.addEventListener("mouseup",function(r){r.stopPropagation(),G(n,V(e,t,!0,o))}),n}const a=document.createElement("span");o&&a.appendChild(r(o));const u=a.appendChild(document.createElement("span"));return u.className=`observablehq--string${n?" observablehq--expanded":""}`,u.textContent="`"+T(e)+"`",a}const i=document.createElement("span");o&&i.appendChild(r(o));const a=i.appendChild(document.createElement("span"));return a.className="observablehq--string",a.textContent=JSON.stringify(e.length>100?`${e.slice(0,50)}…${e.slice(-49)}`:e),i}(e,t,n,o);default:if(null===e){a=null,e="null";break}if(e instanceof Date){a="date",u=e,e=isNaN(u)?"Invalid Date":function(e){return 0===e.getUTCMilliseconds()&&0===e.getUTCSeconds()&&0===e.getUTCMinutes()&&0===e.getUTCHours()}(u)?$(u.getUTCFullYear())+"-"+j(u.getUTCMonth()+1,2)+"-"+j(u.getUTCDate(),2):$(u.getFullYear())+"-"+j(u.getMonth()+1,2)+"-"+j(u.getDate(),2)+"T"+j(u.getHours(),2)+":"+j(u.getMinutes(),2)+(u.getMilliseconds()?":"+j(u.getSeconds(),2)+"."+j(u.getMilliseconds(),3):u.getSeconds()?":"+j(u.getSeconds(),2):"");break}if(e===l){a="forbidden",e="[forbidden]";break}switch(B.call(e)){case"[object RegExp]":a="regexp",e=function(e){return M.call(e)}(e);break;case"[object Error]":case"[object DOMException]":a="error",e=function(e){return e.stack||L.call(e)}(e);break;default:return(n?h:x)(e,t,o)}}var u;const s=document.createElement("span");o&&s.appendChild(r(o));const c=s.appendChild(document.createElement("span"));return c.className=`observablehq--${a}`,c.textContent=e,s}function G(t,n){t.classList.contains("observablehq--inspect")&&n.classList.add("observablehq--inspect"),t.parentNode.replaceChild(n,t),e(n,"load")}const J=/\s+\(\d+:\d+\)$/m;class Y{constructor(e){if(!e)throw new Error("invalid node");this._node=e,e.classList.add("observablehq")}pending(){const{_node:e}=this;e.classList.remove("observablehq--error"),e.classList.add("observablehq--running")}fulfilled(t,n){const{_node:r}=this;if((!(t instanceof Element||t instanceof Text)||t.parentNode&&t.parentNode!==r)&&(t=V(t,!1,r.firstChild&&r.firstChild.classList&&r.firstChild.classList.contains("observablehq--expanded"),n)).classList.add("observablehq--inspect"),r.classList.remove("observablehq--running","observablehq--error"),r.firstChild!==t)if(r.firstChild){for(;r.lastChild!==r.firstChild;)r.removeChild(r.lastChild);r.replaceChild(t,r.firstChild)}else r.appendChild(t);e(r,"update")}rejected(t,n){const{_node:o}=this;for(o.classList.remove("observablehq--running"),o.classList.add("observablehq--error");o.lastChild;)o.removeChild(o.lastChild);var i=document.createElement("div");i.className="observablehq--inspect",n&&i.appendChild(r(n)),i.appendChild(document.createTextNode((t+"").replace(J,""))),o.appendChild(i),e(o,"error",{error:t})}}function X(e){return function(){return e}}Y.into=function(e){if("string"==typeof e&&null==(e=document.querySelector(e)))throw new Error("container not found");return function(){return new Y(e.appendChild(document.createElement("div")))}};var K={math:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};var Q=0;function Z(e){this.id=e,this.href=window.location.href+"#"+e}Z.prototype.toString=function(){return"url("+this.href+")"};var ee={canvas:function(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,n},context2d:function(e,t,n){null==n&&(n=devicePixelRatio);var r=document.createElement("canvas");r.width=e*n,r.height=t*n,r.style.width=e+"px";var o=r.getContext("2d");return o.scale(n,n),o},download:function(e,t="untitled",n="Save"){const r=document.createElement("a"),o=r.appendChild(document.createElement("button"));async function i(){await new Promise(requestAnimationFrame),URL.revokeObjectURL(r.href),r.removeAttribute("href"),o.textContent=n,o.disabled=!1}return o.textContent=n,r.download=t,r.onclick=(async t=>{if(o.disabled=!0,r.href)return i();o.textContent="Saving…";try{const t=await("function"==typeof e?e():e);o.textContent="Download",r.href=URL.createObjectURL(t)}catch(e){o.textContent=n}if(t.eventPhase)return i();o.disabled=!1}),r},element:function(e,t){var n,r=e+="",o=r.indexOf(":");o>=0&&"xmlns"!==(r=e.slice(0,o))&&(e=e.slice(o+1));var i=K.hasOwnProperty(r)?document.createElementNS(K[r],e):document.createElement(e);if(t)for(var a in t)o=(r=a).indexOf(":"),n=t[a],o>=0&&"xmlns"!==(r=a.slice(0,o))&&(a=a.slice(o+1)),K.hasOwnProperty(r)?i.setAttributeNS(K[r],a,n):i.setAttribute(a,n);return i},input:function(e){var t=document.createElement("input");return null!=e&&(t.type=e),t},range:function(e,t,n){1===arguments.length&&(t=e,e=null);var r=document.createElement("input");return r.min=e=null==e?0:+e,r.max=t=null==t?1:+t,r.step=null==n?"any":n=+n,r.type="range",r},select:function(e){var t=document.createElement("select");return Array.prototype.forEach.call(e,function(e){var n=document.createElement("option");n.value=n.textContent=e,t.appendChild(n)}),t},svg:function(e,t){var n=document.createElementNS("http://www.w3.org/2000/svg","svg");return n.setAttribute("viewBox",[0,0,e,t]),n.setAttribute("width",e),n.setAttribute("height",t),n},text:function(e){return document.createTextNode(e)},uid:function(e){return new Z("O-"+(null==e?"":e+"-")+ ++Q)}};var te={buffer:function(e){return new Promise(function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsArrayBuffer(e)})},text:function(e){return new Promise(function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsText(e)})},url:function(e){return new Promise(function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsDataURL(e)})}};function ne(){return this}function re(e,t){let n=!1;return{[Symbol.iterator]:ne,next:()=>n?{done:!0}:(n=!0,{done:!1,value:e}),return:()=>(n=!0,t(e),{done:!0}),throw:()=>({done:n=!0})}}function oe(e){let t,n,r=!1;const o=e(function(e){n?(n(e),n=null):r=!0;return t=e});return{[Symbol.iterator]:ne,throw:()=>({done:!0}),return:()=>(null!=o&&o(),{done:!0}),next:function(){return{done:!1,value:r?(r=!1,Promise.resolve(t)):new Promise(e=>n=e)}}}}function ie(e){switch(e.type){case"range":case"number":return e.valueAsNumber;case"date":return e.valueAsDate;case"checkbox":return e.checked;case"file":return e.multiple?e.files:e.files[0];default:return e.value}}var ae={disposable:re,filter:function*(e,t){for(var n,r=-1;!(n=e.next()).done;)t(n.value,++r)&&(yield n.value)},input:function(e){return oe(function(t){var n=function(e){switch(e.type){case"button":case"submit":case"checkbox":return"click";case"file":return"change";default:return"input"}}(e),r=ie(e);function o(){t(ie(e))}return e.addEventListener(n,o),void 0!==r&&t(r),function(){e.removeEventListener(n,o)}})},map:function*(e,t){for(var n,r=-1;!(n=e.next()).done;)yield t(n.value,++r)},observe:oe,queue:function(e){let t;const n=[],r=e(function(e){return n.push(e),t&&(t(n.shift()),t=null),e});return{[Symbol.iterator]:ne,throw:()=>({done:!0}),return:()=>(null!=r&&r(),{done:!0}),next:function(){return{done:!1,value:n.length?Promise.resolve(n.shift()):new Promise(e=>t=e)}}}},range:function*(e,t,n){e=+e,t=+t,n=(o=arguments.length)<2?(t=e,e=0,1):o<3?1:+n;for(var r=-1,o=0|Math.max(0,Math.ceil((t-e)/n));++r<o;)yield e+r*n},valueAt:function(e,t){if(!(!isFinite(t=+t)||t<0||t!=t|0))for(var n,r=-1;!(n=e.next()).done;)if(++r===t)return n.value},worker:function(e){const t=URL.createObjectURL(new Blob([e],{type:"text/javascript"})),n=new Worker(t);return re(n,()=>{n.terminate(),URL.revokeObjectURL(t)})}};function ue(e,t){return function(n){var r,o,i,a,u,s,l,c,d=n[0],f=[],p=null,h=-1;for(u=1,s=arguments.length;u<s;++u){if((r=arguments[u])instanceof Node)f[++h]=r,d+="\x3c!--o:"+h+"--\x3e";else if(Array.isArray(r)){for(l=0,c=r.length;l<c;++l)(o=r[l])instanceof Node?(null===p&&(f[++h]=p=document.createDocumentFragment(),d+="\x3c!--o:"+h+"--\x3e"),p.appendChild(o)):(p=null,d+=o);p=null}else d+=r;d+=n[u]}if(p=e(d),++h>0){for(i=new Array(h),a=document.createTreeWalker(p,NodeFilter.SHOW_COMMENT,null,!1);a.nextNode();)o=a.currentNode,/^o:/.test(o.nodeValue)&&(i[+o.nodeValue.slice(2)]=o);for(u=0;u<h;++u)(o=i[u])&&o.parentNode.replaceChild(f[u],o)}return 1===p.childNodes.length?p.removeChild(p.firstChild):11===p.nodeType?((o=t()).appendChild(p),o):p}}var se=ue(function(e){var t=document.createElement("template");return t.innerHTML=e.trim(),document.importNode(t.content,!0)},function(){return document.createElement("span")});function le(e){return function(){return e("marked@0.3.12/marked.min.js").then(function(t){return ue(function(n){var r=document.createElement("span");r.innerHTML=t(n,{langPrefix:""}).trim();var o=r.querySelectorAll("pre code[class]");return o.length>0&&e("@observablehq/highlight.js@1.1.1/highlight.min.js").then(function(e){o.forEach(function(t){e.highlightBlock(t),t.parentNode.classList.add("observablehq--md-pre")})}),r},function(){return document.createElement("span")})})}}function ce(e){let t;Object.defineProperties(this,{generator:{value:oe(e=>void(t=e))},value:{get:()=>e,set:n=>t(e=n)}}),void 0!==e&&t(e)}function*de(){for(;;)yield Date.now()}var fe=new Map;function pe(e,t){var n;return(n=fe.get(e=+e))?n.then(X(t)):(n=Date.now())>=e?Promise.resolve(t):function(e,t){var n=new Promise(function(n){fe.delete(t);var r=t-e;if(!(r>0))throw new Error("invalid time");if(r>2147483647)throw new Error("too long to wait");setTimeout(n,r)});return fe.set(t,n),n}(n,e).then(X(t))}var he={delay:function(e,t){return new Promise(function(n){setTimeout(function(){n(t)},e)})},tick:function(e,t){return pe(Math.ceil((Date.now()+1)/e)*e,t)},when:pe};function me(e,t){if(/^(\w+:)|\/\//i.test(e))return e;if(/^[.]{0,2}\//i.test(e))return new URL(e,null==t?location:t).href;if(!e.length||/^[\s._]/.test(e)||/\s$/.test(e))throw new Error("illegal name");return"https://unpkg.com/"+e}const ve=new Map,be=[],we=be.map,_e=be.some,ge=be.hasOwnProperty,ye="https://cdn.jsdelivr.net/npm/",xe=/^((?:@[^\/@]+\/)?[^\/@]+)(?:@([^\/]+))?(?:\/(.*))?$/,Ce=/^\d+\.\d+\.\d+(-[\w-.+]+)?$/,Ee=/\.[^\/]*$/,Ne=["unpkg","jsdelivr","browser","main"];class RequireError extends Error{constructor(e){super(e)}}function Se(e){const t=xe.exec(e);return t&&{name:t[1],version:t[2],path:t[3]}}function Pe(e){const t=`${ye}${e.name}${e.version?`@${e.version}`:""}/package.json`;let n=ve.get(t);return n||ve.set(t,n=fetch(t).then(e=>{if(!e.ok)throw new RequireError("unable to load package.json");return e.redirected&&!ve.has(e.url)&&ve.set(e.url,n),e.json()})),n}RequireError.prototype.name=RequireError.name;const qe=ke(async function(e,t){if(e.startsWith(ye)&&(e=e.substring(ye.length)),/^(\w+:)|\/\//i.test(e))return e;if(/^[.]{0,2}\//i.test(e))return new URL(e,null==t?location:t).href;if(!e.length||/^[\s._]/.test(e)||/\s$/.test(e))throw new RequireError("illegal name");const n=Se(e);if(!n)return`${ye}${e}`;if(!n.version&&null!=t&&t.startsWith(ye)){const e=await Pe(Se(t.substring(ye.length)));n.version=e.dependencies&&e.dependencies[n.name]||e.peerDependencies&&e.peerDependencies[n.name]}if(n.path&&!Ee.test(n.path)&&(n.path+=".js"),n.path&&n.version&&Ce.test(n.version))return`${ye}${n.name}@${n.version}/${n.path}`;const r=await Pe(n);return`${ye}${r.name}@${r.version}/${n.path||function(e){for(const t of Ne){const n=e[t];if("string"==typeof n)return Ee.test(n)?n:`${n}.js`}}(r)||"index.js"}`});function ke(e){const t=new Map,n=o(null);function r(e){if("string"!=typeof e)return e;let n=t.get(e);return n||t.set(e,n=new Promise((t,n)=>{const r=document.createElement("script");r.onload=(()=>{try{t(be.pop()(o(e)))}catch(e){n(new RequireError("invalid module"))}r.remove()}),r.onerror=(()=>{n(new RequireError("unable to load module")),r.remove()}),r.async=!0,r.src=e,window.define=Me,document.head.appendChild(r)})),n}function o(t){return n=>Promise.resolve(e(n,t)).then(r)}function i(e){return arguments.length>1?Promise.all(we.call(arguments,n)).then(je):n(e)}return i.alias=function(t){return ke((n,r)=>n in t&&(r=null,"string"!=typeof(n=t[n]))?n:e(n,r))},i.resolve=e,i}function je(e){const t={};for(const n of e)for(const e in n)ge.call(n,e)&&(null==n[e]?Object.defineProperty(t,e,{get:$e(n,e)}):t[e]=n[e]);return t}function $e(e,t){return()=>e[t]}function Le(e){return e+""=="exports"}function Me(e,t,n){const r=arguments.length;r<2?(n=e,t=[]):r<3&&(n=t,t="string"==typeof e?[]:e),be.push(_e.call(t,Le)?e=>{const r={};return Promise.all(we.call(t,t=>Le(t+="")?r:e(t))).then(e=>(n.apply(null,e),r))}:e=>Promise.all(we.call(t,e)).then(e=>"function"==typeof n?n.apply(null,e):n))}function Oe(e){return null==e?qe:ke(e)}Me.amd={};var Te=ue(function(e){var t=document.createElementNS("http://www.w3.org/2000/svg","g");return t.innerHTML=e.trim(),t},function(){return document.createElementNS("http://www.w3.org/2000/svg","g")}),Ae=String.raw;function Ue(e){return new Promise(function(t,n){var r=document.createElement("link");r.rel="stylesheet",r.href=e,r.onerror=n,r.onload=t,document.head.appendChild(r)})}function Fe(e){return function(){return Promise.all([e("@observablehq/katex@0.10.1/dist/katex.min.js"),e.resolve("@observablehq/katex@0.10.1/dist/katex.min.css").then(Ue)]).then(function(e){var t=e[0],n=r();function r(e){return function(){var n=document.createElement("div");return t.render(Ae.apply(String,arguments),n,e),n.removeChild(n.firstChild)}}return n.options=r,n.block=r({displayMode:!0}),n})}}function De(){return oe(function(e){var t=e(document.body.clientWidth);function n(){var n=document.body.clientWidth;n!==t&&e(t=n)}return window.addEventListener("resize",n),function(){window.removeEventListener("resize",n)}})}function Re(e){const t=Oe(e);Object.defineProperties(this,{DOM:{value:ee,writable:!0,enumerable:!0},Files:{value:te,writable:!0,enumerable:!0},Generators:{value:ae,writable:!0,enumerable:!0},html:{value:X(se),writable:!0,enumerable:!0},md:{value:le(t),writable:!0,enumerable:!0},Mutable:{value:X(ce),writable:!0,enumerable:!0},now:{value:de,writable:!0,enumerable:!0},Promises:{value:he,writable:!0,enumerable:!0},require:{value:X(t),writable:!0,enumerable:!0},resolve:{value:X(me),writable:!0,enumerable:!0},svg:{value:X(Te),writable:!0,enumerable:!0},tex:{value:Fe(t),writable:!0,enumerable:!0},width:{value:De,writable:!0,enumerable:!0}})}function ze(e,t){this.message=e+"",this.input=t}ze.prototype=Object.create(Error.prototype),ze.prototype.name="RuntimeError",ze.prototype.constructor=ze;var He=Array.prototype,Ie=He.map,We=He.forEach;function Be(e){return function(){return e}}function Ve(e){return e}function Ge(){}var Je=1,Ye=2,Xe=3,Ke={};function Qe(e,t,n){var r;null==n&&(n=Ke),Object.defineProperties(this,{_observer:{value:n,writable:!0},_definition:{value:tt,writable:!0},_duplicate:{value:void 0,writable:!0},_duplicates:{value:void 0,writable:!0},_indegree:{value:-1,writable:!0},_inputs:{value:[],writable:!0},_invalidate:{value:Ge,writable:!0},_module:{value:t},_name:{value:null,writable:!0},_outputs:{value:new Set,writable:!0},_promise:{value:Promise.resolve(void 0),writable:!0},_reachable:{value:n!==Ke,writable:!0},_rejector:{value:(r=this,function(e){if(e===tt)throw new ze(r._name+" is not defined",r._name);throw new ze(r._name+" could not be resolved",r._name)})},_type:{value:e},_value:{value:void 0,writable:!0},_version:{value:0,writable:!0}})}function Ze(e){e._module._runtime._dirty.add(e),e._outputs.add(this)}function et(e){e._module._runtime._dirty.add(e),e._outputs.delete(this)}function tt(){throw tt}function nt(e){return function(){throw new ze(e+" is defined more than once")}}function rt(e,t,n){var r=this._module._scope,o=this._module._runtime;if(this._inputs.forEach(et,this),t.forEach(Ze,this),this._inputs=t,this._definition=n,this._value=void 0,e==this._name&&r.get(e)===this)this._outputs.forEach(o._updates.add,o._updates);else{var i,a;if(this._name)if(this._outputs.size)r.delete(this._name),(a=this._module._resolve(this._name))._outputs=this._outputs,this._outputs=new Set,a._outputs.forEach(function(e){e._inputs[e._inputs.indexOf(this)]=a},this),a._outputs.forEach(o._updates.add,o._updates),o._dirty.add(a).add(this),r.set(this._name,a);else if((a=r.get(this._name))===this)r.delete(this._name);else{if(a._type!==Xe)throw new Error;a._duplicates.delete(this),this._duplicate=void 0,1===a._duplicates.size&&(a=a._duplicates.keys().next().value,i=r.get(this._name),a._outputs=i._outputs,i._outputs=new Set,a._outputs.forEach(function(e){e._inputs[e._inputs.indexOf(i)]=a}),a._definition=a._duplicate,a._duplicate=void 0,o._dirty.add(i).add(a),o._updates.add(a),r.set(this._name,a))}if(this._outputs.size)throw new Error;e&&((a=r.get(e))?a._type===Xe?(this._definition=nt(e),this._duplicate=n,a._duplicates.add(this)):a._type===Ye?(this._outputs=a._outputs,a._outputs=new Set,this._outputs.forEach(function(e){e._inputs[e._inputs.indexOf(a)]=this},this),o._dirty.add(a).add(this),r.set(e,this)):(a._duplicate=a._definition,this._duplicate=n,(i=new Qe(Xe,this._module))._name=e,i._definition=this._definition=a._definition=nt(e),i._outputs=a._outputs,a._outputs=new Set,i._outputs.forEach(function(e){e._inputs[e._inputs.indexOf(a)]=i}),i._duplicates=new Set([this,a]),o._dirty.add(a).add(i),o._updates.add(a).add(i),r.set(e,i)):r.set(e,this)),this._name=e}return o._updates.add(this),o._compute(),this}Object.defineProperties(Qe.prototype,{_pending:{value:function(){this._observer.pending&&this._observer.pending()},writable:!0,configurable:!0},_fulfilled:{value:function(e){this._observer.fulfilled&&this._observer.fulfilled(e,this._name)},writable:!0,configurable:!0},_rejected:{value:function(e){this._observer.rejected&&this._observer.rejected(e,this._name)},writable:!0,configurable:!0},define:{value:function(e,t,n){switch(arguments.length){case 1:n=e,e=t=null;break;case 2:n=t,"string"==typeof e?t=null:(t=e,e=null)}return rt.call(this,null==e?null:e+"",null==t?[]:Ie.call(t,this._module._resolve,this._module),"function"==typeof n?n:Be(n))},writable:!0,configurable:!0},delete:{value:function(){return rt.call(this,null,[],Ge)},writable:!0,configurable:!0},import:{value:function(e,t,n){arguments.length<3&&(n=t,t=e);return rt.call(this,t+"",[n._resolve(e+"")],Ve)},writable:!0,configurable:!0}});var ot=new Map;function it(e){Object.defineProperties(this,{_runtime:{value:e},_scope:{value:new Map}})}function at(e){return e._name}Object.defineProperties(it.prototype,{_copy:{value:function(e,t,n){var r=new it(this._runtime);return n.set(this,r),this._scope.forEach(function(o,i){var a,u=new Qe(o._type,r);if(a=e.get(i))u.import(a.name,a.alias,t);else if(o._definition===Ve){var s=o._inputs[0],l=s._module,c=n.get(l)||l._copy(ot,null,n);u.import(s._name,i,c)}else u.define(i,o._inputs.map(at),o._definition)}),r},writable:!0,configurable:!0},_resolve:{value:function(e){var t,n=this._scope.get(e);if(!n)if(n=new Qe(Ye,this),this._runtime._builtin._scope.has(e))n.import(e,this._runtime._builtin);else if("invalidation"===e)n.define(e,ut);else if("visibility"===e)n.define(e,st);else{try{t=this._runtime._global(e)}catch(t){return n.define(e,(r=t,function(){throw r}))}void 0===t?this._scope.set(n._name=e,n):n.define(e,Be(t))}var r;return n},writable:!0,configurable:!0},redefine:{value:function(e){var t=this._scope.get(e);if(!t)throw new ze(e+" is not defined");if(t._type===Xe)throw new ze(e+" is defined more than once");return t.define.apply(t,arguments)},writable:!0,configurable:!0},define:{value:function(){var e=new Qe(Je,this);return e.define.apply(e,arguments)},writable:!0,configurable:!0},derive:{value:function(e,t){var n=new Map;return We.call(e,function(e){"object"!=typeof e&&(e={name:e+""}),null==e.alias&&(e.alias=e.name),n.set(e.alias,e)}),this._copy(n,t,new Map)},writable:!0,configurable:!0},import:{value:function(){var e=new Qe(Je,this);return e.import.apply(e,arguments)},writable:!0,configurable:!0},variable:{value:function(e){return new Qe(Je,this,e)},writable:!0,configurable:!0}});var ut={},st={};function lt(e=new Re,t=function(e){return window[e]}){var n=this.module();if(Object.defineProperties(this,{_dirty:{value:new Set},_updates:{value:new Set},_computing:{value:null,writable:!0},_modules:{value:new Map},_builtin:{value:n},_global:{value:t}}),e)for(var r in e)new Qe(Ye,n).define(r,[],e[r])}function ct(e){++e._indegree}function dt(e){return e._promise.catch(e._rejector)}function ft(e){return new Promise(function(t){e._invalidate=t})}function pt(e,t){let n,r,o="function"==typeof IntersectionObserver&&t._observer&&t._observer._node,i=!o,a=Ge,u=Ge;return o&&((r=new IntersectionObserver(([e])=>(i=e.isIntersecting)&&(n=null,a()))).observe(o),e.then(()=>(r.disconnect(),r=null,u()))),function(e){return i?Promise.resolve(e):r?(n||(n=new Promise((e,t)=>(a=e,u=t))),n.then(()=>e)):Promise.reject()}}function ht(e){e._invalidate(),e._invalidate=Ge,e._pending();var t=e._value,n=++e._version,r=null,o=e._promise=Promise.all(e._inputs.map(dt)).then(function(o){if(e._version===n){for(var i=0,a=o.length;i<a;++i)switch(o[i]){case ut:o[i]=r=ft(e);break;case st:r||(r=ft(e)),o[i]=pt(r,e)}return e._definition.apply(t,o)}}).then(function(t){return function(e){return e&&"function"==typeof e.next&&"function"==typeof e.return}(t)?((r||ft(e)).then((i=t,function(){i.return()})),function(e,t,n,r){function o(){var n=new Promise(function(e){e(r.next())}).then(function(r){return r.done?void 0:Promise.resolve(r.value).then(function(r){if(e._version===t)return mt(e,r,n).then(o),e._fulfilled(r),r})});n.catch(function(r){e._version===t&&(mt(e,void 0,n),e._rejected(r))})}return new Promise(function(e){e(r.next())}).then(function(e){if(!e.done)return n.then(o),e.value})}(e,n,o,t)):t;var i});o.then(function(t){e._version===n&&(e._value=t,e._fulfilled(t))},function(t){e._version===n&&(e._value=void 0,e._rejected(t))})}function mt(e,t,n){var r=e._module._runtime;return e._value=t,e._promise=n,e._outputs.forEach(r._updates.add,r._updates),r._compute()}Object.defineProperties(lt,{load:{value:function(e,t,n){if("function"==typeof t&&(n=t,t=null),"function"!=typeof n)throw new Error("invalid observer");null==t&&(t=new Re);const{modules:r,id:o}=e,i=new Map,a=new lt(t),u=s(o);function s(e){let t=i.get(e);return t||i.set(e,t=a.module()),t}for(const e of r){const t=s(e.id);let r=0;for(const o of e.variables)o.from?t.import(o.remote,o.name,s(o.from)):t===u?t.variable(n(o,r,e.variables)).define(o.name,o.inputs,o.value):t.define(o.name,o.inputs,o.value),++r}return a},writable:!0,configurable:!0}}),Object.defineProperties(lt.prototype,{_compute:{value:function(){return this._computing||(this._computing=this._computeSoon())},writable:!0,configurable:!0},_computeSoon:{value:function(){var e=this;return new Promise(function(t){requestAnimationFrame(function(){t(),e._computeNow()})})},writable:!0,configurable:!0},_computeNow:{value:function(){var e,t,n=[];(e=new Set(this._dirty)).forEach(function(t){t._inputs.forEach(e.add,e);const n=function(e){if(e._observer!==Ke)return!0;var t=new Set(e._outputs);for(const e of t){if(e._observer!==Ke)return!0;e._outputs.forEach(t.add,t)}return!1}(t);n>t._reachable?this._updates.add(t):n<t._reachable&&t._invalidate(),t._reachable=n},this),(e=new Set(this._updates)).forEach(function(t){t._reachable?(t._indegree=0,t._outputs.forEach(e.add,e)):(t._indegree=-1,e.delete(t))}),this._computing=null,this._updates.clear(),this._dirty.clear(),e.forEach(function(e){e._outputs.forEach(ct)}),e.forEach(function(e){0===e._indegree&&n.push(e)});for(;t=n.pop();)ht(t),t._outputs.forEach(r),e.delete(t);function r(e){0==--e._indegree&&n.push(e)}e.forEach(function(e){var t=new ze("circular definition");e._value=void 0,(e._promise=Promise.reject(t)).catch(Ge),e._rejected(t)})},writable:!0,configurable:!0},module:{value:function(e,t=Ge){if(void 0===e)return new it(this);let n=this._modules.get(e);return n||(this._modules.set(e,n=e(this,t)),n)},writable:!0,configurable:!0}});export{Y as Inspector,Re as Library,lt as Runtime,ze as RuntimeError};
// @observablehq/runtime v3.0.7 Copyright 2019 Observable, Inc.
function e(e,t,n){n=n||{};var r=e.ownerDocument,o=r.defaultView.CustomEvent;"function"==typeof o?o=new o(t,{detail:n}):((o=r.createEvent("Event")).initEvent(t,!1,!1),o.detail=n),e.dispatchEvent(o)}function t(e){return Array.isArray(e)||e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function n(e){return e===(0|e)+""}function r(e){const t=document.createElement("span");return t.className="observablehq--cellname",t.textContent=`${e} = `,t}const o=Symbol.prototype.toString;function i(e){return o.call(e)}const{getOwnPropertySymbols:a,prototype:{hasOwnProperty:u}}=Object,{toStringTag:s}=Symbol,l={},c=a;function d(e,t){return u.call(e,t)}function f(e){return e[s]||e.constructor&&e.constructor.name||"Object"}function p(e,t){try{const n=e[t];return n&&n.constructor,n}catch(e){return l}}function h(n,o,i){const a=t(n);let u,s,l;n instanceof Map?(u=`Map(${n.size})`,s=m):n instanceof Set?(u=`Set(${n.size})`,s=v):a?(u=`${n.constructor.name}(${n.length})`,s=b):(u=f(n),s=w);const c=document.createElement("span");c.className="observablehq--expanded",i&&c.appendChild(r(i));const d=c.appendChild(document.createElement("a"));d.innerHTML="<svg width=8 height=8 class='observablehq--caret'>\n <path d='M4 7L0 1h8z' fill='currentColor' />\n </svg>",d.appendChild(document.createTextNode(`${u}${a?" [":" {"}`)),d.addEventListener("mouseup",function(e){e.stopPropagation(),G(c,x(n,null,i))}),s=s(n);for(let e=0;!(l=s.next()).done&&e<20;++e)c.appendChild(l.value);if(!l.done){const t=c.appendChild(document.createElement("a"));t.className="observablehq--field",t.style.display="block",t.appendChild(document.createTextNode(" … more")),t.addEventListener("mouseup",function(t){t.stopPropagation(),c.insertBefore(l.value,c.lastChild.previousSibling);for(let e=0;!(l=s.next()).done&&e<19;++e)c.insertBefore(l.value,c.lastChild.previousSibling);l.done&&c.removeChild(c.lastChild.previousSibling),e(c,"load")})}return c.appendChild(document.createTextNode(a?"]":"}")),c}function*m(e){for(const[t,n]of e)yield g(t,n);yield*w(e)}function*v(e){for(const t of e)yield y(t);yield*w(e)}function*b(e){for(let t=0,n=e.length;t<n;++t)t in e&&(yield _(t,p(e,t),"observablehq--index"));for(const t in e)!n(t)&&d(e,t)&&(yield _(t,p(e,t),"observablehq--key"));for(const t of c(e))yield _(i(t),p(e,t),"observablehq--symbol")}function*w(e){for(const t in e)d(e,t)&&(yield _(t,p(e,t),"observablehq--key"));for(const t of c(e))yield _(i(t),p(e,t),"observablehq--symbol")}function _(e,t,n){const r=document.createElement("div"),o=r.appendChild(document.createElement("span"));return r.className="observablehq--field",o.className=n,o.textContent=` ${e}`,r.appendChild(document.createTextNode(": ")),r.appendChild(V(t)),r}function g(e,t){const n=document.createElement("div");return n.className="observablehq--field",n.appendChild(document.createTextNode(" ")),n.appendChild(V(e)),n.appendChild(document.createTextNode(" => ")),n.appendChild(V(t)),n}function y(e){const t=document.createElement("div");return t.className="observablehq--field",t.appendChild(document.createTextNode(" ")),t.appendChild(V(e)),t}function x(e,n,o){const i=t(e);let a,u,s;if(e instanceof Map?(a=`Map(${e.size})`,u=C):e instanceof Set?(a=`Set(${e.size})`,u=E):i?(a=`${e.constructor.name}(${e.length})`,u=N):(a=f(e),u=S),n){const t=document.createElement("span");return t.className="observablehq--shallow",o&&t.appendChild(r(o)),t.appendChild(document.createTextNode(a)),t.addEventListener("mouseup",function(n){n.stopPropagation(),G(t,x(e))}),t}const l=document.createElement("span");l.className="observablehq--collapsed",o&&l.appendChild(r(o));const c=l.appendChild(document.createElement("a"));c.innerHTML="<svg width=8 height=8 class='observablehq--caret'>\n <path d='M7 4L1 8V0z' fill='currentColor' />\n </svg>",c.appendChild(document.createTextNode(`${a}${i?" [":" {"}`)),l.addEventListener("mouseup",function(t){t.stopPropagation(),G(l,h(e,0,o))},!0),u=u(e);for(let e=0;!(s=u.next()).done&&e<20;++e)e>0&&l.appendChild(document.createTextNode(", ")),l.appendChild(s.value);return s.done||l.appendChild(document.createTextNode(", …")),l.appendChild(document.createTextNode(i?"]":"}")),l}function*C(e){for(const[t,n]of e)yield k(t,n);yield*S(e)}function*E(e){for(const t of e)yield V(t,!0);yield*S(e)}function*N(e){let t=-1,r=0;for(const n=e.length;r<n;++r)r in e&&(r>t+1&&(yield P(r-t-1)),yield V(p(e,r),!0),t=r);r>t+1&&(yield P(r-t-1));for(const t in e)!n(t)&&d(e,t)&&(yield q(t,p(e,t),"observablehq--key"));for(const t of c(e))yield q(i(t),p(e,t),"observablehq--symbol")}function*S(e){for(const t in e)d(e,t)&&(yield q(t,p(e,t),"observablehq--key"));for(const t of c(e))yield q(i(t),p(e,t),"observablehq--symbol")}function P(e){const t=document.createElement("span");return t.className="observablehq--empty",t.textContent=1===e?"empty":`empty × ${e}`,t}function q(e,t,n){const r=document.createDocumentFragment(),o=r.appendChild(document.createElement("span"));return o.className=n,o.textContent=e,r.appendChild(document.createTextNode(": ")),r.appendChild(V(t,!0)),r}function k(e,t){const n=document.createDocumentFragment();return n.appendChild(V(e,!0)),n.appendChild(document.createTextNode(" => ")),n.appendChild(V(t,!0)),n}function j(e,t){var n=e+"",r=n.length;return r<t?new Array(t-r+1).join(0)+n:n}function $(e){return e<0?"-"+j(-e,6):e>9999?"+"+j(e,6):j(e,4)}var L=Error.prototype.toString;var M=RegExp.prototype.toString;const O=20;function T(e){return e.replace(/[\\`\x00-\x09\x0b-\x19]|\${/g,A)}function A(e){var t=e.charCodeAt(0);switch(t){case 8:return"\\b";case 9:return"\\t";case 11:return"\\v";case 12:return"\\f";case 13:return"\\r"}return t<16?"\\x0"+t.toString(16):t<32?"\\x"+t.toString(16):"\\"+e}function U(e,t){for(var n=0;t.exec(e);)++n;return n}var F=Function.prototype.toString,D={prefix:"async ƒ"},R={prefix:"async ƒ*"},z={prefix:"class"},H={prefix:"ƒ"},I={prefix:"ƒ*"};function W(e,t,n){var o=document.createElement("span");o.className="observablehq--function",n&&o.appendChild(r(n));var i=o.appendChild(document.createElement("span"));return i.className="observablehq--keyword",i.textContent=e.prefix,o.appendChild(document.createTextNode(t)),o}const{prototype:{toString:B}}=Object;function V(e,t,n,o){let a=typeof e;switch(a){case"boolean":case"undefined":e+="";break;case"number":e=0===e&&1/e<0?"-0":e+"";break;case"bigint":e+="n";break;case"symbol":e=i(e);break;case"function":return function(e,t){var n,r,o=F.call(e);switch(e.constructor&&e.constructor.name){case"AsyncFunction":n=D;break;case"AsyncGeneratorFunction":n=R;break;case"GeneratorFunction":n=I;break;default:n=/^class\b/.test(o)?z:H}return n===z?W(n,"",t):(r=/^(?:async\s*)?(\w+)\s*=>/.exec(o))?W(n,"("+r[1]+")",t):(r=/^(?:async\s*)?\(\s*(\w+(?:\s*,\s*\w+)*)?\s*\)/.exec(o))?W(n,r[1]?"("+r[1].replace(/\s*,\s*/g,", ")+")":"()",t):(r=/^(?:async\s*)?function(?:\s*\*)?(?:\s*\w+)?\s*\(\s*(\w+(?:\s*,\s*\w+)*)?\s*\)/.exec(o))?W(n,r[1]?"("+r[1].replace(/\s*,\s*/g,", ")+")":"()",t):W(n,"(…)",t)}(e,o);case"string":return function(e,t,n,o){if(!1===t){if(U(e,/["\n]/g)<=U(e,/`|\${/g)){const t=document.createElement("span");o&&t.appendChild(r(o));const n=t.appendChild(document.createElement("span"));return n.className="observablehq--string",n.textContent=JSON.stringify(e),t}const i=e.split("\n");if(i.length>O&&!n){const n=document.createElement("div");o&&n.appendChild(r(o));const a=n.appendChild(document.createElement("span"));a.className="observablehq--string",a.textContent="`"+T(i.slice(0,O).join("\n"));const u=n.appendChild(document.createElement("span")),s=i.length-O;return u.textContent=`Show ${s} truncated line${s>1?"s":""}`,u.className="observablehq--string-expand",u.addEventListener("mouseup",function(r){r.stopPropagation(),G(n,V(e,t,!0,o))}),n}const a=document.createElement("span");o&&a.appendChild(r(o));const u=a.appendChild(document.createElement("span"));return u.className=`observablehq--string${n?" observablehq--expanded":""}`,u.textContent="`"+T(e)+"`",a}const i=document.createElement("span");o&&i.appendChild(r(o));const a=i.appendChild(document.createElement("span"));return a.className="observablehq--string",a.textContent=JSON.stringify(e.length>100?`${e.slice(0,50)}…${e.slice(-49)}`:e),i}(e,t,n,o);default:if(null===e){a=null,e="null";break}if(e instanceof Date){a="date",u=e,e=isNaN(u)?"Invalid Date":function(e){return 0===e.getUTCMilliseconds()&&0===e.getUTCSeconds()&&0===e.getUTCMinutes()&&0===e.getUTCHours()}(u)?$(u.getUTCFullYear())+"-"+j(u.getUTCMonth()+1,2)+"-"+j(u.getUTCDate(),2):$(u.getFullYear())+"-"+j(u.getMonth()+1,2)+"-"+j(u.getDate(),2)+"T"+j(u.getHours(),2)+":"+j(u.getMinutes(),2)+(u.getMilliseconds()?":"+j(u.getSeconds(),2)+"."+j(u.getMilliseconds(),3):u.getSeconds()?":"+j(u.getSeconds(),2):"");break}if(e===l){a="forbidden",e="[forbidden]";break}switch(B.call(e)){case"[object RegExp]":a="regexp",e=function(e){return M.call(e)}(e);break;case"[object Error]":case"[object DOMException]":a="error",e=function(e){return e.stack||L.call(e)}(e);break;default:return(n?h:x)(e,t,o)}}var u;const s=document.createElement("span");o&&s.appendChild(r(o));const c=s.appendChild(document.createElement("span"));return c.className=`observablehq--${a}`,c.textContent=e,s}function G(t,n){t.classList.contains("observablehq--inspect")&&n.classList.add("observablehq--inspect"),t.parentNode.replaceChild(n,t),e(n,"load")}const J=/\s+\(\d+:\d+\)$/m;class Y{constructor(e){if(!e)throw new Error("invalid node");this._node=e,e.classList.add("observablehq")}pending(){const{_node:e}=this;e.classList.remove("observablehq--error"),e.classList.add("observablehq--running")}fulfilled(t,n){const{_node:r}=this;if((!(t instanceof Element||t instanceof Text)||t.parentNode&&t.parentNode!==r)&&(t=V(t,!1,r.firstChild&&r.firstChild.classList&&r.firstChild.classList.contains("observablehq--expanded"),n)).classList.add("observablehq--inspect"),r.classList.remove("observablehq--running","observablehq--error"),r.firstChild!==t)if(r.firstChild){for(;r.lastChild!==r.firstChild;)r.removeChild(r.lastChild);r.replaceChild(t,r.firstChild)}else r.appendChild(t);e(r,"update")}rejected(t,n){const{_node:o}=this;for(o.classList.remove("observablehq--running"),o.classList.add("observablehq--error");o.lastChild;)o.removeChild(o.lastChild);var i=document.createElement("div");i.className="observablehq--inspect",n&&i.appendChild(r(n)),i.appendChild(document.createTextNode((t+"").replace(J,""))),o.appendChild(i),e(o,"error",{error:t})}}function X(e){return function(){return e}}Y.into=function(e){if("string"==typeof e&&null==(e=document.querySelector(e)))throw new Error("container not found");return function(){return new Y(e.appendChild(document.createElement("div")))}};var K={math:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};var Q=0;function Z(e){this.id=e,this.href=window.location.href+"#"+e}Z.prototype.toString=function(){return"url("+this.href+")"};var ee={canvas:function(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,n},context2d:function(e,t,n){null==n&&(n=devicePixelRatio);var r=document.createElement("canvas");r.width=e*n,r.height=t*n,r.style.width=e+"px";var o=r.getContext("2d");return o.scale(n,n),o},download:function(e,t="untitled",n="Save"){const r=document.createElement("a"),o=r.appendChild(document.createElement("button"));async function i(){await new Promise(requestAnimationFrame),URL.revokeObjectURL(r.href),r.removeAttribute("href"),o.textContent=n,o.disabled=!1}return o.textContent=n,r.download=t,r.onclick=(async t=>{if(o.disabled=!0,r.href)return i();o.textContent="Saving…";try{const t=await("function"==typeof e?e():e);o.textContent="Download",r.href=URL.createObjectURL(t)}catch(e){o.textContent=n}if(t.eventPhase)return i();o.disabled=!1}),r},element:function(e,t){var n,r=e+="",o=r.indexOf(":");o>=0&&"xmlns"!==(r=e.slice(0,o))&&(e=e.slice(o+1));var i=K.hasOwnProperty(r)?document.createElementNS(K[r],e):document.createElement(e);if(t)for(var a in t)o=(r=a).indexOf(":"),n=t[a],o>=0&&"xmlns"!==(r=a.slice(0,o))&&(a=a.slice(o+1)),K.hasOwnProperty(r)?i.setAttributeNS(K[r],a,n):i.setAttribute(a,n);return i},input:function(e){var t=document.createElement("input");return null!=e&&(t.type=e),t},range:function(e,t,n){1===arguments.length&&(t=e,e=null);var r=document.createElement("input");return r.min=e=null==e?0:+e,r.max=t=null==t?1:+t,r.step=null==n?"any":n=+n,r.type="range",r},select:function(e){var t=document.createElement("select");return Array.prototype.forEach.call(e,function(e){var n=document.createElement("option");n.value=n.textContent=e,t.appendChild(n)}),t},svg:function(e,t){var n=document.createElementNS("http://www.w3.org/2000/svg","svg");return n.setAttribute("viewBox",[0,0,e,t]),n.setAttribute("width",e),n.setAttribute("height",t),n},text:function(e){return document.createTextNode(e)},uid:function(e){return new Z("O-"+(null==e?"":e+"-")+ ++Q)}};var te={buffer:function(e){return new Promise(function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsArrayBuffer(e)})},text:function(e){return new Promise(function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsText(e)})},url:function(e){return new Promise(function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsDataURL(e)})}};function ne(){return this}function re(e,t){let n=!1;return{[Symbol.iterator]:ne,next:()=>n?{done:!0}:(n=!0,{done:!1,value:e}),return:()=>(n=!0,t(e),{done:!0}),throw:()=>({done:n=!0})}}function oe(e){let t,n,r=!1;const o=e(function(e){n?(n(e),n=null):r=!0;return t=e});return{[Symbol.iterator]:ne,throw:()=>({done:!0}),return:()=>(null!=o&&o(),{done:!0}),next:function(){return{done:!1,value:r?(r=!1,Promise.resolve(t)):new Promise(e=>n=e)}}}}function ie(e){switch(e.type){case"range":case"number":return e.valueAsNumber;case"date":return e.valueAsDate;case"checkbox":return e.checked;case"file":return e.multiple?e.files:e.files[0];default:return e.value}}var ae={disposable:re,filter:function*(e,t){for(var n,r=-1;!(n=e.next()).done;)t(n.value,++r)&&(yield n.value)},input:function(e){return oe(function(t){var n=function(e){switch(e.type){case"button":case"submit":case"checkbox":return"click";case"file":return"change";default:return"input"}}(e),r=ie(e);function o(){t(ie(e))}return e.addEventListener(n,o),void 0!==r&&t(r),function(){e.removeEventListener(n,o)}})},map:function*(e,t){for(var n,r=-1;!(n=e.next()).done;)yield t(n.value,++r)},observe:oe,queue:function(e){let t;const n=[],r=e(function(e){return n.push(e),t&&(t(n.shift()),t=null),e});return{[Symbol.iterator]:ne,throw:()=>({done:!0}),return:()=>(null!=r&&r(),{done:!0}),next:function(){return{done:!1,value:n.length?Promise.resolve(n.shift()):new Promise(e=>t=e)}}}},range:function*(e,t,n){e=+e,t=+t,n=(o=arguments.length)<2?(t=e,e=0,1):o<3?1:+n;for(var r=-1,o=0|Math.max(0,Math.ceil((t-e)/n));++r<o;)yield e+r*n},valueAt:function(e,t){if(!(!isFinite(t=+t)||t<0||t!=t|0))for(var n,r=-1;!(n=e.next()).done;)if(++r===t)return n.value},worker:function(e){const t=URL.createObjectURL(new Blob([e],{type:"text/javascript"})),n=new Worker(t);return re(n,()=>{n.terminate(),URL.revokeObjectURL(t)})}};function ue(e,t){return function(n){var r,o,i,a,u,s,l,c,d=n[0],f=[],p=null,h=-1;for(u=1,s=arguments.length;u<s;++u){if((r=arguments[u])instanceof Node)f[++h]=r,d+="\x3c!--o:"+h+"--\x3e";else if(Array.isArray(r)){for(l=0,c=r.length;l<c;++l)(o=r[l])instanceof Node?(null===p&&(f[++h]=p=document.createDocumentFragment(),d+="\x3c!--o:"+h+"--\x3e"),p.appendChild(o)):(p=null,d+=o);p=null}else d+=r;d+=n[u]}if(p=e(d),++h>0){for(i=new Array(h),a=document.createTreeWalker(p,NodeFilter.SHOW_COMMENT,null,!1);a.nextNode();)o=a.currentNode,/^o:/.test(o.nodeValue)&&(i[+o.nodeValue.slice(2)]=o);for(u=0;u<h;++u)(o=i[u])&&o.parentNode.replaceChild(f[u],o)}return 1===p.childNodes.length?p.removeChild(p.firstChild):11===p.nodeType?((o=t()).appendChild(p),o):p}}var se=ue(function(e){var t=document.createElement("template");return t.innerHTML=e.trim(),document.importNode(t.content,!0)},function(){return document.createElement("span")});function le(e){return function(){return e("marked@0.3.12/marked.min.js").then(function(t){return ue(function(n){var r=document.createElement("div");r.innerHTML=t(n,{langPrefix:""}).trim();var o=r.querySelectorAll("pre code[class]");return o.length>0&&e("@observablehq/highlight.js@1.1.1/highlight.min.js").then(function(e){o.forEach(function(t){e.highlightBlock(t),t.parentNode.classList.add("observablehq--md-pre")})}),r},function(){return document.createElement("div")})})}}function ce(e){let t;Object.defineProperties(this,{generator:{value:oe(e=>void(t=e))},value:{get:()=>e,set:n=>t(e=n)}}),void 0!==e&&t(e)}function*de(){for(;;)yield Date.now()}var fe=new Map;function pe(e,t){var n;return(n=fe.get(e=+e))?n.then(X(t)):(n=Date.now())>=e?Promise.resolve(t):function(e,t){var n=new Promise(function(n){fe.delete(t);var r=t-e;if(!(r>0))throw new Error("invalid time");if(r>2147483647)throw new Error("too long to wait");setTimeout(n,r)});return fe.set(t,n),n}(n,e).then(X(t))}var he={delay:function(e,t){return new Promise(function(n){setTimeout(function(){n(t)},e)})},tick:function(e,t){return pe(Math.ceil((Date.now()+1)/e)*e,t)},when:pe};function me(e,t){if(/^(\w+:)|\/\//i.test(e))return e;if(/^[.]{0,2}\//i.test(e))return new URL(e,null==t?location:t).href;if(!e.length||/^[\s._]/.test(e)||/\s$/.test(e))throw new Error("illegal name");return"https://unpkg.com/"+e}const ve=new Map,be=[],we=be.map,_e=be.some,ge=be.hasOwnProperty,ye="https://cdn.jsdelivr.net/npm/",xe=/^((?:@[^\/@]+\/)?[^\/@]+)(?:@([^\/]+))?(?:\/(.*))?$/,Ce=/^\d+\.\d+\.\d+(-[\w-.+]+)?$/,Ee=/\.[^\/]*$/,Ne=["unpkg","jsdelivr","browser","main"];class RequireError extends Error{constructor(e){super(e)}}function Se(e){const t=xe.exec(e);return t&&{name:t[1],version:t[2],path:t[3]}}function Pe(e){const t=`${ye}${e.name}${e.version?`@${e.version}`:""}/package.json`;let n=ve.get(t);return n||ve.set(t,n=fetch(t).then(e=>{if(!e.ok)throw new RequireError("unable to load package.json");return e.redirected&&!ve.has(e.url)&&ve.set(e.url,n),e.json()})),n}RequireError.prototype.name=RequireError.name;const qe=ke(async function(e,t){if(e.startsWith(ye)&&(e=e.substring(ye.length)),/^(\w+:)|\/\//i.test(e))return e;if(/^[.]{0,2}\//i.test(e))return new URL(e,null==t?location:t).href;if(!e.length||/^[\s._]/.test(e)||/\s$/.test(e))throw new RequireError("illegal name");const n=Se(e);if(!n)return`${ye}${e}`;if(!n.version&&null!=t&&t.startsWith(ye)){const e=await Pe(Se(t.substring(ye.length)));n.version=e.dependencies&&e.dependencies[n.name]||e.peerDependencies&&e.peerDependencies[n.name]}if(n.path&&!Ee.test(n.path)&&(n.path+=".js"),n.path&&n.version&&Ce.test(n.version))return`${ye}${n.name}@${n.version}/${n.path}`;const r=await Pe(n);return`${ye}${r.name}@${r.version}/${n.path||function(e){for(const t of Ne){const n=e[t];if("string"==typeof n)return Ee.test(n)?n:`${n}.js`}}(r)||"index.js"}`});function ke(e){const t=new Map,n=o(null);function r(e){if("string"!=typeof e)return e;let n=t.get(e);return n||t.set(e,n=new Promise((t,n)=>{const r=document.createElement("script");r.onload=(()=>{try{t(be.pop()(o(e)))}catch(e){n(new RequireError("invalid module"))}r.remove()}),r.onerror=(()=>{n(new RequireError("unable to load module")),r.remove()}),r.async=!0,r.src=e,window.define=Me,document.head.appendChild(r)})),n}function o(t){return n=>Promise.resolve(e(n,t)).then(r)}function i(e){return arguments.length>1?Promise.all(we.call(arguments,n)).then(je):n(e)}return i.alias=function(t){return ke((n,r)=>n in t&&(r=null,"string"!=typeof(n=t[n]))?n:e(n,r))},i.resolve=e,i}function je(e){const t={};for(const n of e)for(const e in n)ge.call(n,e)&&(null==n[e]?Object.defineProperty(t,e,{get:$e(n,e)}):t[e]=n[e]);return t}function $e(e,t){return()=>e[t]}function Le(e){return e+""=="exports"}function Me(e,t,n){const r=arguments.length;r<2?(n=e,t=[]):r<3&&(n=t,t="string"==typeof e?[]:e),be.push(_e.call(t,Le)?e=>{const r={};return Promise.all(we.call(t,t=>Le(t+="")?r:e(t))).then(e=>(n.apply(null,e),r))}:e=>Promise.all(we.call(t,e)).then(e=>"function"==typeof n?n.apply(null,e):n))}function Oe(e){return null==e?qe:ke(e)}Me.amd={};var Te=ue(function(e){var t=document.createElementNS("http://www.w3.org/2000/svg","g");return t.innerHTML=e.trim(),t},function(){return document.createElementNS("http://www.w3.org/2000/svg","g")}),Ae=String.raw;function Ue(e){return new Promise(function(t,n){var r=document.createElement("link");r.rel="stylesheet",r.href=e,r.onerror=n,r.onload=t,document.head.appendChild(r)})}function Fe(e){return function(){return Promise.all([e("@observablehq/katex@0.10.1/dist/katex.min.js"),e.resolve("@observablehq/katex@0.10.1/dist/katex.min.css").then(Ue)]).then(function(e){var t=e[0],n=r();function r(e){return function(){var n=document.createElement("div");return t.render(Ae.apply(String,arguments),n,e),n.removeChild(n.firstChild)}}return n.options=r,n.block=r({displayMode:!0}),n})}}function De(){return oe(function(e){var t=e(document.body.clientWidth);function n(){var n=document.body.clientWidth;n!==t&&e(t=n)}return window.addEventListener("resize",n),function(){window.removeEventListener("resize",n)}})}function Re(e){const t=Oe(e);Object.defineProperties(this,{DOM:{value:ee,writable:!0,enumerable:!0},Files:{value:te,writable:!0,enumerable:!0},Generators:{value:ae,writable:!0,enumerable:!0},html:{value:X(se),writable:!0,enumerable:!0},md:{value:le(t),writable:!0,enumerable:!0},Mutable:{value:X(ce),writable:!0,enumerable:!0},now:{value:de,writable:!0,enumerable:!0},Promises:{value:he,writable:!0,enumerable:!0},require:{value:X(t),writable:!0,enumerable:!0},resolve:{value:X(me),writable:!0,enumerable:!0},svg:{value:X(Te),writable:!0,enumerable:!0},tex:{value:Fe(t),writable:!0,enumerable:!0},width:{value:De,writable:!0,enumerable:!0}})}function ze(e,t){this.message=e+"",this.input=t}ze.prototype=Object.create(Error.prototype),ze.prototype.name="RuntimeError",ze.prototype.constructor=ze;var He=Array.prototype,Ie=He.map,We=He.forEach;function Be(e){return function(){return e}}function Ve(e){return e}function Ge(){}var Je=1,Ye=2,Xe=3,Ke={};function Qe(e,t,n){var r;null==n&&(n=Ke),Object.defineProperties(this,{_observer:{value:n,writable:!0},_definition:{value:tt,writable:!0},_duplicate:{value:void 0,writable:!0},_duplicates:{value:void 0,writable:!0},_indegree:{value:-1,writable:!0},_inputs:{value:[],writable:!0},_invalidate:{value:Ge,writable:!0},_module:{value:t},_name:{value:null,writable:!0},_outputs:{value:new Set,writable:!0},_promise:{value:Promise.resolve(void 0),writable:!0},_reachable:{value:n!==Ke,writable:!0},_rejector:{value:(r=this,function(e){if(e===tt)throw new ze(r._name+" is not defined",r._name);throw new ze(r._name+" could not be resolved",r._name)})},_type:{value:e},_value:{value:void 0,writable:!0},_version:{value:0,writable:!0}})}function Ze(e){e._module._runtime._dirty.add(e),e._outputs.add(this)}function et(e){e._module._runtime._dirty.add(e),e._outputs.delete(this)}function tt(){throw tt}function nt(e){return function(){throw new ze(e+" is defined more than once")}}function rt(e,t,n){var r=this._module._scope,o=this._module._runtime;if(this._inputs.forEach(et,this),t.forEach(Ze,this),this._inputs=t,this._definition=n,this._value=void 0,e==this._name&&r.get(e)===this)this._outputs.forEach(o._updates.add,o._updates);else{var i,a;if(this._name)if(this._outputs.size)r.delete(this._name),(a=this._module._resolve(this._name))._outputs=this._outputs,this._outputs=new Set,a._outputs.forEach(function(e){e._inputs[e._inputs.indexOf(this)]=a},this),a._outputs.forEach(o._updates.add,o._updates),o._dirty.add(a).add(this),r.set(this._name,a);else if((a=r.get(this._name))===this)r.delete(this._name);else{if(a._type!==Xe)throw new Error;a._duplicates.delete(this),this._duplicate=void 0,1===a._duplicates.size&&(a=a._duplicates.keys().next().value,i=r.get(this._name),a._outputs=i._outputs,i._outputs=new Set,a._outputs.forEach(function(e){e._inputs[e._inputs.indexOf(i)]=a}),a._definition=a._duplicate,a._duplicate=void 0,o._dirty.add(i).add(a),o._updates.add(a),r.set(this._name,a))}if(this._outputs.size)throw new Error;e&&((a=r.get(e))?a._type===Xe?(this._definition=nt(e),this._duplicate=n,a._duplicates.add(this)):a._type===Ye?(this._outputs=a._outputs,a._outputs=new Set,this._outputs.forEach(function(e){e._inputs[e._inputs.indexOf(a)]=this},this),o._dirty.add(a).add(this),r.set(e,this)):(a._duplicate=a._definition,this._duplicate=n,(i=new Qe(Xe,this._module))._name=e,i._definition=this._definition=a._definition=nt(e),i._outputs=a._outputs,a._outputs=new Set,i._outputs.forEach(function(e){e._inputs[e._inputs.indexOf(a)]=i}),i._duplicates=new Set([this,a]),o._dirty.add(a).add(i),o._updates.add(a).add(i),r.set(e,i)):r.set(e,this)),this._name=e}return o._updates.add(this),o._compute(),this}Object.defineProperties(Qe.prototype,{_pending:{value:function(){this._observer.pending&&this._observer.pending()},writable:!0,configurable:!0},_fulfilled:{value:function(e){this._observer.fulfilled&&this._observer.fulfilled(e,this._name)},writable:!0,configurable:!0},_rejected:{value:function(e){this._observer.rejected&&this._observer.rejected(e,this._name)},writable:!0,configurable:!0},define:{value:function(e,t,n){switch(arguments.length){case 1:n=e,e=t=null;break;case 2:n=t,"string"==typeof e?t=null:(t=e,e=null)}return rt.call(this,null==e?null:e+"",null==t?[]:Ie.call(t,this._module._resolve,this._module),"function"==typeof n?n:Be(n))},writable:!0,configurable:!0},delete:{value:function(){return rt.call(this,null,[],Ge)},writable:!0,configurable:!0},import:{value:function(e,t,n){arguments.length<3&&(n=t,t=e);return rt.call(this,t+"",[n._resolve(e+"")],Ve)},writable:!0,configurable:!0}});var ot=new Map;function it(e){Object.defineProperties(this,{_runtime:{value:e},_scope:{value:new Map}})}function at(e){return e._name}Object.defineProperties(it.prototype,{_copy:{value:function(e,t,n){var r=new it(this._runtime);return n.set(this,r),this._scope.forEach(function(o,i){var a,u=new Qe(o._type,r);if(a=e.get(i))u.import(a.name,a.alias,t);else if(o._definition===Ve){var s=o._inputs[0],l=s._module,c=n.get(l)||l._copy(ot,null,n);u.import(s._name,i,c)}else u.define(i,o._inputs.map(at),o._definition)}),r},writable:!0,configurable:!0},_resolve:{value:function(e){var t,n=this._scope.get(e);if(!n)if(n=new Qe(Ye,this),this._runtime._builtin._scope.has(e))n.import(e,this._runtime._builtin);else if("invalidation"===e)n.define(e,st);else if("visibility"===e)n.define(e,lt);else{try{t=this._runtime._global(e)}catch(t){return n.define(e,(r=t,function(){throw r}))}void 0===t?this._scope.set(n._name=e,n):n.define(e,Be(t))}var r;return n},writable:!0,configurable:!0},redefine:{value:function(e){var t=this._scope.get(e);if(!t)throw new ze(e+" is not defined");if(t._type===Xe)throw new ze(e+" is defined more than once");return t.define.apply(t,arguments)},writable:!0,configurable:!0},define:{value:function(){var e=new Qe(Je,this);return e.define.apply(e,arguments)},writable:!0,configurable:!0},derive:{value:function(e,t){var n=new Map;return We.call(e,function(e){"object"!=typeof e&&(e={name:e+""}),null==e.alias&&(e.alias=e.name),n.set(e.alias,e)}),this._copy(n,t,new Map)},writable:!0,configurable:!0},import:{value:function(){var e=new Qe(Je,this);return e.import.apply(e,arguments)},writable:!0,configurable:!0},variable:{value:function(e){return new Qe(Je,this,e)},writable:!0,configurable:!0}});const ut="function"==typeof requestAnimationFrame?requestAnimationFrame:setImmediate;var st={},lt={};function ct(e=new Re,t=function(e){return window[e]}){var n=this.module();if(Object.defineProperties(this,{_dirty:{value:new Set},_updates:{value:new Set},_computing:{value:null,writable:!0},_modules:{value:new Map},_builtin:{value:n},_global:{value:t}}),e)for(var r in e)new Qe(Ye,n).define(r,[],e[r])}function dt(e){++e._indegree}function ft(e){return e._promise.catch(e._rejector)}function pt(e){return new Promise(function(t){e._invalidate=t})}function ht(e,t){let n,r,o="function"==typeof IntersectionObserver&&t._observer&&t._observer._node,i=!o,a=Ge,u=Ge;return o&&((r=new IntersectionObserver(([e])=>(i=e.isIntersecting)&&(n=null,a()))).observe(o),e.then(()=>(r.disconnect(),r=null,u()))),function(e){return i?Promise.resolve(e):r?(n||(n=new Promise((e,t)=>(a=e,u=t))),n.then(()=>e)):Promise.reject()}}function mt(e){e._invalidate(),e._invalidate=Ge,e._pending();var t=e._value,n=++e._version,r=null,o=e._promise=Promise.all(e._inputs.map(ft)).then(function(o){if(e._version===n){for(var i=0,a=o.length;i<a;++i)switch(o[i]){case st:o[i]=r=pt(e);break;case lt:r||(r=pt(e)),o[i]=ht(r,e)}return e._definition.apply(t,o)}}).then(function(t){return function(e){return e&&"function"==typeof e.next&&"function"==typeof e.return}(t)?((r||pt(e)).then((i=t,function(){i.return()})),function(e,t,n,r){function o(){var n=new Promise(function(e){e(r.next())}).then(function(r){return r.done?void 0:Promise.resolve(r.value).then(function(r){if(e._version===t)return vt(e,r,n).then(o),e._fulfilled(r),r})});n.catch(function(r){e._version===t&&(vt(e,void 0,n),e._rejected(r))})}return new Promise(function(e){e(r.next())}).then(function(e){if(!e.done)return n.then(o),e.value})}(e,n,o,t)):t;var i});o.then(function(t){e._version===n&&(e._value=t,e._fulfilled(t))},function(t){e._version===n&&(e._value=void 0,e._rejected(t))})}function vt(e,t,n){var r=e._module._runtime;return e._value=t,e._promise=n,e._outputs.forEach(r._updates.add,r._updates),r._compute()}Object.defineProperties(ct,{load:{value:function(e,t,n){if("function"==typeof t&&(n=t,t=null),"function"!=typeof n)throw new Error("invalid observer");null==t&&(t=new Re);const{modules:r,id:o}=e,i=new Map,a=new ct(t),u=s(o);function s(e){let t=i.get(e);return t||i.set(e,t=a.module()),t}for(const e of r){const t=s(e.id);let r=0;for(const o of e.variables)o.from?t.import(o.remote,o.name,s(o.from)):t===u?t.variable(n(o,r,e.variables)).define(o.name,o.inputs,o.value):t.define(o.name,o.inputs,o.value),++r}return a},writable:!0,configurable:!0}}),Object.defineProperties(ct.prototype,{_compute:{value:function(){return this._computing||(this._computing=this._computeSoon())},writable:!0,configurable:!0},_computeSoon:{value:function(){var e=this;return new Promise(function(t){ut(function(){t(),e._computeNow()})})},writable:!0,configurable:!0},_computeNow:{value:function(){var e,t,n=[];(e=new Set(this._dirty)).forEach(function(t){t._inputs.forEach(e.add,e);const n=function(e){if(e._observer!==Ke)return!0;var t=new Set(e._outputs);for(const e of t){if(e._observer!==Ke)return!0;e._outputs.forEach(t.add,t)}return!1}(t);n>t._reachable?this._updates.add(t):n<t._reachable&&t._invalidate(),t._reachable=n},this),(e=new Set(this._updates)).forEach(function(t){t._reachable?(t._indegree=0,t._outputs.forEach(e.add,e)):(t._indegree=-1,e.delete(t))}),this._computing=null,this._updates.clear(),this._dirty.clear(),e.forEach(function(e){e._outputs.forEach(dt)}),e.forEach(function(e){0===e._indegree&&n.push(e)});for(;t=n.pop();)mt(t),t._outputs.forEach(r),e.delete(t);function r(e){0==--e._indegree&&n.push(e)}e.forEach(function(e){var t=new ze("circular definition");e._value=void 0,(e._promise=Promise.reject(t)).catch(Ge),e._rejected(t)})},writable:!0,configurable:!0},module:{value:function(e,t=Ge){if(void 0===e)return new it(this);let n=this._modules.get(e);return n||(this._modules.set(e,n=e(this,t)),n)},writable:!0,configurable:!0}});export{Y as Inspector,Re as Library,ct as Runtime,ze as RuntimeError};

@@ -1,2 +0,2 @@

// @observablehq/runtime v3.0.6 Copyright 2019 Observable, Inc.
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.observablehq=e.observablehq||{})}(this,function(e){"use strict";function t(e,t,n){n=n||{};var r=e.ownerDocument,o=r.defaultView.CustomEvent;"function"==typeof o?o=new o(t,{detail:n}):((o=r.createEvent("Event")).initEvent(t,!1,!1),o.detail=n),e.dispatchEvent(o)}function n(e){return Array.isArray(e)||e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function r(e){return e===(0|e)+""}function o(e){const t=document.createElement("span");return t.className="observablehq--cellname",t.textContent=`${e} = `,t}const i=Symbol.prototype.toString;function a(e){return i.call(e)}const{getOwnPropertySymbols:u,prototype:{hasOwnProperty:s}}=Object,{toStringTag:l}=Symbol,c={},d=u;function f(e,t){return s.call(e,t)}function p(e){return e[l]||e.constructor&&e.constructor.name||"Object"}function h(e,t){try{const n=e[t];return n&&n.constructor,n}catch(e){return c}}function m(e,r,i){const a=n(e);let u,s,l;e instanceof Map?(u=`Map(${e.size})`,s=v):e instanceof Set?(u=`Set(${e.size})`,s=b):a?(u=`${e.constructor.name}(${e.length})`,s=w):(u=p(e),s=_);const c=document.createElement("span");c.className="observablehq--expanded",i&&c.appendChild(o(i));const d=c.appendChild(document.createElement("a"));d.innerHTML="<svg width=8 height=8 class='observablehq--caret'>\n <path d='M4 7L0 1h8z' fill='currentColor' />\n </svg>",d.appendChild(document.createTextNode(`${u}${a?" [":" {"}`)),d.addEventListener("mouseup",function(t){t.stopPropagation(),J(c,C(e,null,i))}),s=s(e);for(let e=0;!(l=s.next()).done&&e<20;++e)c.appendChild(l.value);if(!l.done){const e=c.appendChild(document.createElement("a"));e.className="observablehq--field",e.style.display="block",e.appendChild(document.createTextNode(" … more")),e.addEventListener("mouseup",function(e){e.stopPropagation(),c.insertBefore(l.value,c.lastChild.previousSibling);for(let e=0;!(l=s.next()).done&&e<19;++e)c.insertBefore(l.value,c.lastChild.previousSibling);l.done&&c.removeChild(c.lastChild.previousSibling),t(c,"load")})}return c.appendChild(document.createTextNode(a?"]":"}")),c}function*v(e){for(const[t,n]of e)yield y(t,n);yield*_(e)}function*b(e){for(const t of e)yield x(t);yield*_(e)}function*w(e){for(let t=0,n=e.length;t<n;++t)t in e&&(yield g(t,h(e,t),"observablehq--index"));for(const t in e)!r(t)&&f(e,t)&&(yield g(t,h(e,t),"observablehq--key"));for(const t of d(e))yield g(a(t),h(e,t),"observablehq--symbol")}function*_(e){for(const t in e)f(e,t)&&(yield g(t,h(e,t),"observablehq--key"));for(const t of d(e))yield g(a(t),h(e,t),"observablehq--symbol")}function g(e,t,n){const r=document.createElement("div"),o=r.appendChild(document.createElement("span"));return r.className="observablehq--field",o.className=n,o.textContent=` ${e}`,r.appendChild(document.createTextNode(": ")),r.appendChild(G(t)),r}function y(e,t){const n=document.createElement("div");return n.className="observablehq--field",n.appendChild(document.createTextNode(" ")),n.appendChild(G(e)),n.appendChild(document.createTextNode(" => ")),n.appendChild(G(t)),n}function x(e){const t=document.createElement("div");return t.className="observablehq--field",t.appendChild(document.createTextNode(" ")),t.appendChild(G(e)),t}function C(e,t,r){const i=n(e);let a,u,s;if(e instanceof Map?(a=`Map(${e.size})`,u=E):e instanceof Set?(a=`Set(${e.size})`,u=N):i?(a=`${e.constructor.name}(${e.length})`,u=P):(a=p(e),u=S),t){const t=document.createElement("span");return t.className="observablehq--shallow",r&&t.appendChild(o(r)),t.appendChild(document.createTextNode(a)),t.addEventListener("mouseup",function(n){n.stopPropagation(),J(t,C(e))}),t}const l=document.createElement("span");l.className="observablehq--collapsed",r&&l.appendChild(o(r));const c=l.appendChild(document.createElement("a"));c.innerHTML="<svg width=8 height=8 class='observablehq--caret'>\n <path d='M7 4L1 8V0z' fill='currentColor' />\n </svg>",c.appendChild(document.createTextNode(`${a}${i?" [":" {"}`)),l.addEventListener("mouseup",function(t){t.stopPropagation(),J(l,m(e,0,r))},!0),u=u(e);for(let e=0;!(s=u.next()).done&&e<20;++e)e>0&&l.appendChild(document.createTextNode(", ")),l.appendChild(s.value);return s.done||l.appendChild(document.createTextNode(", …")),l.appendChild(document.createTextNode(i?"]":"}")),l}function*E(e){for(const[t,n]of e)yield k(t,n);yield*S(e)}function*N(e){for(const t of e)yield G(t,!0);yield*S(e)}function*P(e){let t=-1,n=0;for(const r=e.length;n<r;++n)n in e&&(n>t+1&&(yield q(n-t-1)),yield G(h(e,n),!0),t=n);n>t+1&&(yield q(n-t-1));for(const t in e)!r(t)&&f(e,t)&&(yield j(t,h(e,t),"observablehq--key"));for(const t of d(e))yield j(a(t),h(e,t),"observablehq--symbol")}function*S(e){for(const t in e)f(e,t)&&(yield j(t,h(e,t),"observablehq--key"));for(const t of d(e))yield j(a(t),h(e,t),"observablehq--symbol")}function q(e){const t=document.createElement("span");return t.className="observablehq--empty",t.textContent=1===e?"empty":`empty × ${e}`,t}function j(e,t,n){const r=document.createDocumentFragment(),o=r.appendChild(document.createElement("span"));return o.className=n,o.textContent=e,r.appendChild(document.createTextNode(": ")),r.appendChild(G(t,!0)),r}function k(e,t){const n=document.createDocumentFragment();return n.appendChild(G(e,!0)),n.appendChild(document.createTextNode(" => ")),n.appendChild(G(t,!0)),n}function $(e,t){var n=e+"",r=n.length;return r<t?new Array(t-r+1).join(0)+n:n}function L(e){return e<0?"-"+$(-e,6):e>9999?"+"+$(e,6):$(e,4)}var M=Error.prototype.toString;var O=RegExp.prototype.toString;const T=20;function A(e){return e.replace(/[\\`\x00-\x09\x0b-\x19]|\${/g,U)}function U(e){var t=e.charCodeAt(0);switch(t){case 8:return"\\b";case 9:return"\\t";case 11:return"\\v";case 12:return"\\f";case 13:return"\\r"}return t<16?"\\x0"+t.toString(16):t<32?"\\x"+t.toString(16):"\\"+e}function R(e,t){for(var n=0;t.exec(e);)++n;return n}var F=Function.prototype.toString,D={prefix:"async ƒ"},z={prefix:"async ƒ*"},H={prefix:"class"},I={prefix:"ƒ"},W={prefix:"ƒ*"};function B(e,t,n){var r=document.createElement("span");r.className="observablehq--function",n&&r.appendChild(o(n));var i=r.appendChild(document.createElement("span"));return i.className="observablehq--keyword",i.textContent=e.prefix,r.appendChild(document.createTextNode(t)),r}const{prototype:{toString:V}}=Object;function G(e,t,n,r){let i=typeof e;switch(i){case"boolean":case"undefined":e+="";break;case"number":e=0===e&&1/e<0?"-0":e+"";break;case"bigint":e+="n";break;case"symbol":e=a(e);break;case"function":return function(e,t){var n,r,o=F.call(e);switch(e.constructor&&e.constructor.name){case"AsyncFunction":n=D;break;case"AsyncGeneratorFunction":n=z;break;case"GeneratorFunction":n=W;break;default:n=/^class\b/.test(o)?H:I}return n===H?B(n,"",t):(r=/^(?:async\s*)?(\w+)\s*=>/.exec(o))?B(n,"("+r[1]+")",t):(r=/^(?:async\s*)?\(\s*(\w+(?:\s*,\s*\w+)*)?\s*\)/.exec(o))?B(n,r[1]?"("+r[1].replace(/\s*,\s*/g,", ")+")":"()",t):(r=/^(?:async\s*)?function(?:\s*\*)?(?:\s*\w+)?\s*\(\s*(\w+(?:\s*,\s*\w+)*)?\s*\)/.exec(o))?B(n,r[1]?"("+r[1].replace(/\s*,\s*/g,", ")+")":"()",t):B(n,"(…)",t)}(e,r);case"string":return function(e,t,n,r){if(!1===t){if(R(e,/["\n]/g)<=R(e,/`|\${/g)){const t=document.createElement("span");r&&t.appendChild(o(r));const n=t.appendChild(document.createElement("span"));return n.className="observablehq--string",n.textContent=JSON.stringify(e),t}const i=e.split("\n");if(i.length>T&&!n){const n=document.createElement("div");r&&n.appendChild(o(r));const a=n.appendChild(document.createElement("span"));a.className="observablehq--string",a.textContent="`"+A(i.slice(0,T).join("\n"));const u=n.appendChild(document.createElement("span")),s=i.length-T;return u.textContent=`Show ${s} truncated line${s>1?"s":""}`,u.className="observablehq--string-expand",u.addEventListener("mouseup",function(o){o.stopPropagation(),J(n,G(e,t,!0,r))}),n}const a=document.createElement("span");r&&a.appendChild(o(r));const u=a.appendChild(document.createElement("span"));return u.className=`observablehq--string${n?" observablehq--expanded":""}`,u.textContent="`"+A(e)+"`",a}const i=document.createElement("span");r&&i.appendChild(o(r));const a=i.appendChild(document.createElement("span"));return a.className="observablehq--string",a.textContent=JSON.stringify(e.length>100?`${e.slice(0,50)}…${e.slice(-49)}`:e),i}(e,t,n,r);default:if(null===e){i=null,e="null";break}if(e instanceof Date){i="date",u=e,e=isNaN(u)?"Invalid Date":function(e){return 0===e.getUTCMilliseconds()&&0===e.getUTCSeconds()&&0===e.getUTCMinutes()&&0===e.getUTCHours()}(u)?L(u.getUTCFullYear())+"-"+$(u.getUTCMonth()+1,2)+"-"+$(u.getUTCDate(),2):L(u.getFullYear())+"-"+$(u.getMonth()+1,2)+"-"+$(u.getDate(),2)+"T"+$(u.getHours(),2)+":"+$(u.getMinutes(),2)+(u.getMilliseconds()?":"+$(u.getSeconds(),2)+"."+$(u.getMilliseconds(),3):u.getSeconds()?":"+$(u.getSeconds(),2):"");break}if(e===c){i="forbidden",e="[forbidden]";break}switch(V.call(e)){case"[object RegExp]":i="regexp",e=function(e){return O.call(e)}(e);break;case"[object Error]":case"[object DOMException]":i="error",e=function(e){return e.stack||M.call(e)}(e);break;default:return(n?m:C)(e,t,r)}}var u;const s=document.createElement("span");r&&s.appendChild(o(r));const l=s.appendChild(document.createElement("span"));return l.className=`observablehq--${i}`,l.textContent=e,s}function J(e,n){e.classList.contains("observablehq--inspect")&&n.classList.add("observablehq--inspect"),e.parentNode.replaceChild(n,e),t(n,"load")}const Y=/\s+\(\d+:\d+\)$/m;class X{constructor(e){if(!e)throw new Error("invalid node");this._node=e,e.classList.add("observablehq")}pending(){const{_node:e}=this;e.classList.remove("observablehq--error"),e.classList.add("observablehq--running")}fulfilled(e,n){const{_node:r}=this;if((!(e instanceof Element||e instanceof Text)||e.parentNode&&e.parentNode!==r)&&(e=G(e,!1,r.firstChild&&r.firstChild.classList&&r.firstChild.classList.contains("observablehq--expanded"),n)).classList.add("observablehq--inspect"),r.classList.remove("observablehq--running","observablehq--error"),r.firstChild!==e)if(r.firstChild){for(;r.lastChild!==r.firstChild;)r.removeChild(r.lastChild);r.replaceChild(e,r.firstChild)}else r.appendChild(e);t(r,"update")}rejected(e,n){const{_node:r}=this;for(r.classList.remove("observablehq--running"),r.classList.add("observablehq--error");r.lastChild;)r.removeChild(r.lastChild);var i=document.createElement("div");i.className="observablehq--inspect",n&&i.appendChild(o(n)),i.appendChild(document.createTextNode((e+"").replace(Y,""))),r.appendChild(i),t(r,"error",{error:e})}}function K(e){return function(){return e}}X.into=function(e){if("string"==typeof e&&null==(e=document.querySelector(e)))throw new Error("container not found");return function(){return new X(e.appendChild(document.createElement("div")))}};var Q={math:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};var Z=0;function ee(e){this.id=e,this.href=window.location.href+"#"+e}ee.prototype.toString=function(){return"url("+this.href+")"};var te={canvas:function(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,n},context2d:function(e,t,n){null==n&&(n=devicePixelRatio);var r=document.createElement("canvas");r.width=e*n,r.height=t*n,r.style.width=e+"px";var o=r.getContext("2d");return o.scale(n,n),o},download:function(e,t="untitled",n="Save"){const r=document.createElement("a"),o=r.appendChild(document.createElement("button"));async function i(){await new Promise(requestAnimationFrame),URL.revokeObjectURL(r.href),r.removeAttribute("href"),o.textContent=n,o.disabled=!1}return o.textContent=n,r.download=t,r.onclick=(async t=>{if(o.disabled=!0,r.href)return i();o.textContent="Saving…";try{const t=await("function"==typeof e?e():e);o.textContent="Download",r.href=URL.createObjectURL(t)}catch(e){o.textContent=n}if(t.eventPhase)return i();o.disabled=!1}),r},element:function(e,t){var n,r=e+="",o=r.indexOf(":");o>=0&&"xmlns"!==(r=e.slice(0,o))&&(e=e.slice(o+1));var i=Q.hasOwnProperty(r)?document.createElementNS(Q[r],e):document.createElement(e);if(t)for(var a in t)o=(r=a).indexOf(":"),n=t[a],o>=0&&"xmlns"!==(r=a.slice(0,o))&&(a=a.slice(o+1)),Q.hasOwnProperty(r)?i.setAttributeNS(Q[r],a,n):i.setAttribute(a,n);return i},input:function(e){var t=document.createElement("input");return null!=e&&(t.type=e),t},range:function(e,t,n){1===arguments.length&&(t=e,e=null);var r=document.createElement("input");return r.min=e=null==e?0:+e,r.max=t=null==t?1:+t,r.step=null==n?"any":n=+n,r.type="range",r},select:function(e){var t=document.createElement("select");return Array.prototype.forEach.call(e,function(e){var n=document.createElement("option");n.value=n.textContent=e,t.appendChild(n)}),t},svg:function(e,t){var n=document.createElementNS("http://www.w3.org/2000/svg","svg");return n.setAttribute("viewBox",[0,0,e,t]),n.setAttribute("width",e),n.setAttribute("height",t),n},text:function(e){return document.createTextNode(e)},uid:function(e){return new ee("O-"+(null==e?"":e+"-")+ ++Z)}};var ne={buffer:function(e){return new Promise(function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsArrayBuffer(e)})},text:function(e){return new Promise(function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsText(e)})},url:function(e){return new Promise(function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsDataURL(e)})}};function re(){return this}function oe(e,t){let n=!1;return{[Symbol.iterator]:re,next:()=>n?{done:!0}:(n=!0,{done:!1,value:e}),return:()=>(n=!0,t(e),{done:!0}),throw:()=>({done:n=!0})}}function ie(e){let t,n,r=!1;const o=e(function(e){n?(n(e),n=null):r=!0;return t=e});return{[Symbol.iterator]:re,throw:()=>({done:!0}),return:()=>(null!=o&&o(),{done:!0}),next:function(){return{done:!1,value:r?(r=!1,Promise.resolve(t)):new Promise(e=>n=e)}}}}function ae(e){switch(e.type){case"range":case"number":return e.valueAsNumber;case"date":return e.valueAsDate;case"checkbox":return e.checked;case"file":return e.multiple?e.files:e.files[0];default:return e.value}}var ue={disposable:oe,filter:function*(e,t){for(var n,r=-1;!(n=e.next()).done;)t(n.value,++r)&&(yield n.value)},input:function(e){return ie(function(t){var n=function(e){switch(e.type){case"button":case"submit":case"checkbox":return"click";case"file":return"change";default:return"input"}}(e),r=ae(e);function o(){t(ae(e))}return e.addEventListener(n,o),void 0!==r&&t(r),function(){e.removeEventListener(n,o)}})},map:function*(e,t){for(var n,r=-1;!(n=e.next()).done;)yield t(n.value,++r)},observe:ie,queue:function(e){let t;const n=[],r=e(function(e){return n.push(e),t&&(t(n.shift()),t=null),e});return{[Symbol.iterator]:re,throw:()=>({done:!0}),return:()=>(null!=r&&r(),{done:!0}),next:function(){return{done:!1,value:n.length?Promise.resolve(n.shift()):new Promise(e=>t=e)}}}},range:function*(e,t,n){e=+e,t=+t,n=(o=arguments.length)<2?(t=e,e=0,1):o<3?1:+n;for(var r=-1,o=0|Math.max(0,Math.ceil((t-e)/n));++r<o;)yield e+r*n},valueAt:function(e,t){if(!(!isFinite(t=+t)||t<0||t!=t|0))for(var n,r=-1;!(n=e.next()).done;)if(++r===t)return n.value},worker:function(e){const t=URL.createObjectURL(new Blob([e],{type:"text/javascript"})),n=new Worker(t);return oe(n,()=>{n.terminate(),URL.revokeObjectURL(t)})}};function se(e,t){return function(n){var r,o,i,a,u,s,l,c,d=n[0],f=[],p=null,h=-1;for(u=1,s=arguments.length;u<s;++u){if((r=arguments[u])instanceof Node)f[++h]=r,d+="\x3c!--o:"+h+"--\x3e";else if(Array.isArray(r)){for(l=0,c=r.length;l<c;++l)(o=r[l])instanceof Node?(null===p&&(f[++h]=p=document.createDocumentFragment(),d+="\x3c!--o:"+h+"--\x3e"),p.appendChild(o)):(p=null,d+=o);p=null}else d+=r;d+=n[u]}if(p=e(d),++h>0){for(i=new Array(h),a=document.createTreeWalker(p,NodeFilter.SHOW_COMMENT,null,!1);a.nextNode();)o=a.currentNode,/^o:/.test(o.nodeValue)&&(i[+o.nodeValue.slice(2)]=o);for(u=0;u<h;++u)(o=i[u])&&o.parentNode.replaceChild(f[u],o)}return 1===p.childNodes.length?p.removeChild(p.firstChild):11===p.nodeType?((o=t()).appendChild(p),o):p}}var le=se(function(e){var t=document.createElement("template");return t.innerHTML=e.trim(),document.importNode(t.content,!0)},function(){return document.createElement("span")});function ce(e){return function(){return e("marked@0.3.12/marked.min.js").then(function(t){return se(function(n){var r=document.createElement("span");r.innerHTML=t(n,{langPrefix:""}).trim();var o=r.querySelectorAll("pre code[class]");return o.length>0&&e("@observablehq/highlight.js@1.1.1/highlight.min.js").then(function(e){o.forEach(function(t){e.highlightBlock(t),t.parentNode.classList.add("observablehq--md-pre")})}),r},function(){return document.createElement("span")})})}}function de(e){let t;Object.defineProperties(this,{generator:{value:ie(e=>void(t=e))},value:{get:()=>e,set:n=>t(e=n)}}),void 0!==e&&t(e)}function*fe(){for(;;)yield Date.now()}var pe=new Map;function he(e,t){var n;return(n=pe.get(e=+e))?n.then(K(t)):(n=Date.now())>=e?Promise.resolve(t):function(e,t){var n=new Promise(function(n){pe.delete(t);var r=t-e;if(!(r>0))throw new Error("invalid time");if(r>2147483647)throw new Error("too long to wait");setTimeout(n,r)});return pe.set(t,n),n}(n,e).then(K(t))}var me={delay:function(e,t){return new Promise(function(n){setTimeout(function(){n(t)},e)})},tick:function(e,t){return he(Math.ceil((Date.now()+1)/e)*e,t)},when:he};function ve(e,t){if(/^(\w+:)|\/\//i.test(e))return e;if(/^[.]{0,2}\//i.test(e))return new URL(e,null==t?location:t).href;if(!e.length||/^[\s._]/.test(e)||/\s$/.test(e))throw new Error("illegal name");return"https://unpkg.com/"+e}const be=new Map,we=[],_e=we.map,ge=we.some,ye=we.hasOwnProperty,xe="https://cdn.jsdelivr.net/npm/",Ce=/^((?:@[^\/@]+\/)?[^\/@]+)(?:@([^\/]+))?(?:\/(.*))?$/,Ee=/^\d+\.\d+\.\d+(-[\w-.+]+)?$/,Ne=/\.[^\/]*$/,Pe=["unpkg","jsdelivr","browser","main"];class RequireError extends Error{constructor(e){super(e)}}function Se(e){const t=Ce.exec(e);return t&&{name:t[1],version:t[2],path:t[3]}}function qe(e){const t=`${xe}${e.name}${e.version?`@${e.version}`:""}/package.json`;let n=be.get(t);return n||be.set(t,n=fetch(t).then(e=>{if(!e.ok)throw new RequireError("unable to load package.json");return e.redirected&&!be.has(e.url)&&be.set(e.url,n),e.json()})),n}RequireError.prototype.name=RequireError.name;const je=ke(async function(e,t){if(e.startsWith(xe)&&(e=e.substring(xe.length)),/^(\w+:)|\/\//i.test(e))return e;if(/^[.]{0,2}\//i.test(e))return new URL(e,null==t?location:t).href;if(!e.length||/^[\s._]/.test(e)||/\s$/.test(e))throw new RequireError("illegal name");const n=Se(e);if(!n)return`${xe}${e}`;if(!n.version&&null!=t&&t.startsWith(xe)){const e=await qe(Se(t.substring(xe.length)));n.version=e.dependencies&&e.dependencies[n.name]||e.peerDependencies&&e.peerDependencies[n.name]}if(n.path&&!Ne.test(n.path)&&(n.path+=".js"),n.path&&n.version&&Ee.test(n.version))return`${xe}${n.name}@${n.version}/${n.path}`;const r=await qe(n);return`${xe}${r.name}@${r.version}/${n.path||function(e){for(const t of Pe){const n=e[t];if("string"==typeof n)return Ne.test(n)?n:`${n}.js`}}(r)||"index.js"}`});function ke(e){const t=new Map,n=o(null);function r(e){if("string"!=typeof e)return e;let n=t.get(e);return n||t.set(e,n=new Promise((t,n)=>{const r=document.createElement("script");r.onload=(()=>{try{t(we.pop()(o(e)))}catch(e){n(new RequireError("invalid module"))}r.remove()}),r.onerror=(()=>{n(new RequireError("unable to load module")),r.remove()}),r.async=!0,r.src=e,window.define=Oe,document.head.appendChild(r)})),n}function o(t){return n=>Promise.resolve(e(n,t)).then(r)}function i(e){return arguments.length>1?Promise.all(_e.call(arguments,n)).then($e):n(e)}return i.alias=function(t){return ke((n,r)=>n in t&&(r=null,"string"!=typeof(n=t[n]))?n:e(n,r))},i.resolve=e,i}function $e(e){const t={};for(const n of e)for(const e in n)ye.call(n,e)&&(null==n[e]?Object.defineProperty(t,e,{get:Le(n,e)}):t[e]=n[e]);return t}function Le(e,t){return()=>e[t]}function Me(e){return e+""=="exports"}function Oe(e,t,n){const r=arguments.length;r<2?(n=e,t=[]):r<3&&(n=t,t="string"==typeof e?[]:e),we.push(ge.call(t,Me)?e=>{const r={};return Promise.all(_e.call(t,t=>Me(t+="")?r:e(t))).then(e=>(n.apply(null,e),r))}:e=>Promise.all(_e.call(t,e)).then(e=>"function"==typeof n?n.apply(null,e):n))}function Te(e){return null==e?je:ke(e)}Oe.amd={};var Ae=se(function(e){var t=document.createElementNS("http://www.w3.org/2000/svg","g");return t.innerHTML=e.trim(),t},function(){return document.createElementNS("http://www.w3.org/2000/svg","g")}),Ue=String.raw;function Re(e){return new Promise(function(t,n){var r=document.createElement("link");r.rel="stylesheet",r.href=e,r.onerror=n,r.onload=t,document.head.appendChild(r)})}function Fe(e){return function(){return Promise.all([e("@observablehq/katex@0.10.1/dist/katex.min.js"),e.resolve("@observablehq/katex@0.10.1/dist/katex.min.css").then(Re)]).then(function(e){var t=e[0],n=r();function r(e){return function(){var n=document.createElement("div");return t.render(Ue.apply(String,arguments),n,e),n.removeChild(n.firstChild)}}return n.options=r,n.block=r({displayMode:!0}),n})}}function De(){return ie(function(e){var t=e(document.body.clientWidth);function n(){var n=document.body.clientWidth;n!==t&&e(t=n)}return window.addEventListener("resize",n),function(){window.removeEventListener("resize",n)}})}function ze(e){const t=Te(e);Object.defineProperties(this,{DOM:{value:te,writable:!0,enumerable:!0},Files:{value:ne,writable:!0,enumerable:!0},Generators:{value:ue,writable:!0,enumerable:!0},html:{value:K(le),writable:!0,enumerable:!0},md:{value:ce(t),writable:!0,enumerable:!0},Mutable:{value:K(de),writable:!0,enumerable:!0},now:{value:fe,writable:!0,enumerable:!0},Promises:{value:me,writable:!0,enumerable:!0},require:{value:K(t),writable:!0,enumerable:!0},resolve:{value:K(ve),writable:!0,enumerable:!0},svg:{value:K(Ae),writable:!0,enumerable:!0},tex:{value:Fe(t),writable:!0,enumerable:!0},width:{value:De,writable:!0,enumerable:!0}})}function He(e,t){this.message=e+"",this.input=t}He.prototype=Object.create(Error.prototype),He.prototype.name="RuntimeError",He.prototype.constructor=He;var Ie=Array.prototype,We=Ie.map,Be=Ie.forEach;function Ve(e){return function(){return e}}function Ge(e){return e}function Je(){}var Ye=1,Xe=2,Ke=3,Qe={};function Ze(e,t,n){var r;null==n&&(n=Qe),Object.defineProperties(this,{_observer:{value:n,writable:!0},_definition:{value:nt,writable:!0},_duplicate:{value:void 0,writable:!0},_duplicates:{value:void 0,writable:!0},_indegree:{value:-1,writable:!0},_inputs:{value:[],writable:!0},_invalidate:{value:Je,writable:!0},_module:{value:t},_name:{value:null,writable:!0},_outputs:{value:new Set,writable:!0},_promise:{value:Promise.resolve(void 0),writable:!0},_reachable:{value:n!==Qe,writable:!0},_rejector:{value:(r=this,function(e){if(e===nt)throw new He(r._name+" is not defined",r._name);throw new He(r._name+" could not be resolved",r._name)})},_type:{value:e},_value:{value:void 0,writable:!0},_version:{value:0,writable:!0}})}function et(e){e._module._runtime._dirty.add(e),e._outputs.add(this)}function tt(e){e._module._runtime._dirty.add(e),e._outputs.delete(this)}function nt(){throw nt}function rt(e){return function(){throw new He(e+" is defined more than once")}}function ot(e,t,n){var r=this._module._scope,o=this._module._runtime;if(this._inputs.forEach(tt,this),t.forEach(et,this),this._inputs=t,this._definition=n,this._value=void 0,e==this._name&&r.get(e)===this)this._outputs.forEach(o._updates.add,o._updates);else{var i,a;if(this._name)if(this._outputs.size)r.delete(this._name),(a=this._module._resolve(this._name))._outputs=this._outputs,this._outputs=new Set,a._outputs.forEach(function(e){e._inputs[e._inputs.indexOf(this)]=a},this),a._outputs.forEach(o._updates.add,o._updates),o._dirty.add(a).add(this),r.set(this._name,a);else if((a=r.get(this._name))===this)r.delete(this._name);else{if(a._type!==Ke)throw new Error;a._duplicates.delete(this),this._duplicate=void 0,1===a._duplicates.size&&(a=a._duplicates.keys().next().value,i=r.get(this._name),a._outputs=i._outputs,i._outputs=new Set,a._outputs.forEach(function(e){e._inputs[e._inputs.indexOf(i)]=a}),a._definition=a._duplicate,a._duplicate=void 0,o._dirty.add(i).add(a),o._updates.add(a),r.set(this._name,a))}if(this._outputs.size)throw new Error;e&&((a=r.get(e))?a._type===Ke?(this._definition=rt(e),this._duplicate=n,a._duplicates.add(this)):a._type===Xe?(this._outputs=a._outputs,a._outputs=new Set,this._outputs.forEach(function(e){e._inputs[e._inputs.indexOf(a)]=this},this),o._dirty.add(a).add(this),r.set(e,this)):(a._duplicate=a._definition,this._duplicate=n,(i=new Ze(Ke,this._module))._name=e,i._definition=this._definition=a._definition=rt(e),i._outputs=a._outputs,a._outputs=new Set,i._outputs.forEach(function(e){e._inputs[e._inputs.indexOf(a)]=i}),i._duplicates=new Set([this,a]),o._dirty.add(a).add(i),o._updates.add(a).add(i),r.set(e,i)):r.set(e,this)),this._name=e}return o._updates.add(this),o._compute(),this}Object.defineProperties(Ze.prototype,{_pending:{value:function(){this._observer.pending&&this._observer.pending()},writable:!0,configurable:!0},_fulfilled:{value:function(e){this._observer.fulfilled&&this._observer.fulfilled(e,this._name)},writable:!0,configurable:!0},_rejected:{value:function(e){this._observer.rejected&&this._observer.rejected(e,this._name)},writable:!0,configurable:!0},define:{value:function(e,t,n){switch(arguments.length){case 1:n=e,e=t=null;break;case 2:n=t,"string"==typeof e?t=null:(t=e,e=null)}return ot.call(this,null==e?null:e+"",null==t?[]:We.call(t,this._module._resolve,this._module),"function"==typeof n?n:Ve(n))},writable:!0,configurable:!0},delete:{value:function(){return ot.call(this,null,[],Je)},writable:!0,configurable:!0},import:{value:function(e,t,n){arguments.length<3&&(n=t,t=e);return ot.call(this,t+"",[n._resolve(e+"")],Ge)},writable:!0,configurable:!0}});var it=new Map;function at(e){Object.defineProperties(this,{_runtime:{value:e},_scope:{value:new Map}})}function ut(e){return e._name}Object.defineProperties(at.prototype,{_copy:{value:function(e,t,n){var r=new at(this._runtime);return n.set(this,r),this._scope.forEach(function(o,i){var a,u=new Ze(o._type,r);if(a=e.get(i))u.import(a.name,a.alias,t);else if(o._definition===Ge){var s=o._inputs[0],l=s._module,c=n.get(l)||l._copy(it,null,n);u.import(s._name,i,c)}else u.define(i,o._inputs.map(ut),o._definition)}),r},writable:!0,configurable:!0},_resolve:{value:function(e){var t,n=this._scope.get(e);if(!n)if(n=new Ze(Xe,this),this._runtime._builtin._scope.has(e))n.import(e,this._runtime._builtin);else if("invalidation"===e)n.define(e,st);else if("visibility"===e)n.define(e,lt);else{try{t=this._runtime._global(e)}catch(t){return n.define(e,(r=t,function(){throw r}))}void 0===t?this._scope.set(n._name=e,n):n.define(e,Ve(t))}var r;return n},writable:!0,configurable:!0},redefine:{value:function(e){var t=this._scope.get(e);if(!t)throw new He(e+" is not defined");if(t._type===Ke)throw new He(e+" is defined more than once");return t.define.apply(t,arguments)},writable:!0,configurable:!0},define:{value:function(){var e=new Ze(Ye,this);return e.define.apply(e,arguments)},writable:!0,configurable:!0},derive:{value:function(e,t){var n=new Map;return Be.call(e,function(e){"object"!=typeof e&&(e={name:e+""}),null==e.alias&&(e.alias=e.name),n.set(e.alias,e)}),this._copy(n,t,new Map)},writable:!0,configurable:!0},import:{value:function(){var e=new Ze(Ye,this);return e.import.apply(e,arguments)},writable:!0,configurable:!0},variable:{value:function(e){return new Ze(Ye,this,e)},writable:!0,configurable:!0}});var st={},lt={};function ct(e=new ze,t=function(e){return window[e]}){var n=this.module();if(Object.defineProperties(this,{_dirty:{value:new Set},_updates:{value:new Set},_computing:{value:null,writable:!0},_modules:{value:new Map},_builtin:{value:n},_global:{value:t}}),e)for(var r in e)new Ze(Xe,n).define(r,[],e[r])}function dt(e){++e._indegree}function ft(e){return e._promise.catch(e._rejector)}function pt(e){return new Promise(function(t){e._invalidate=t})}function ht(e,t){let n,r,o="function"==typeof IntersectionObserver&&t._observer&&t._observer._node,i=!o,a=Je,u=Je;return o&&((r=new IntersectionObserver(([e])=>(i=e.isIntersecting)&&(n=null,a()))).observe(o),e.then(()=>(r.disconnect(),r=null,u()))),function(e){return i?Promise.resolve(e):r?(n||(n=new Promise((e,t)=>(a=e,u=t))),n.then(()=>e)):Promise.reject()}}function mt(e){e._invalidate(),e._invalidate=Je,e._pending();var t=e._value,n=++e._version,r=null,o=e._promise=Promise.all(e._inputs.map(ft)).then(function(o){if(e._version===n){for(var i=0,a=o.length;i<a;++i)switch(o[i]){case st:o[i]=r=pt(e);break;case lt:r||(r=pt(e)),o[i]=ht(r,e)}return e._definition.apply(t,o)}}).then(function(t){return function(e){return e&&"function"==typeof e.next&&"function"==typeof e.return}(t)?((r||pt(e)).then((i=t,function(){i.return()})),function(e,t,n,r){function o(){var n=new Promise(function(e){e(r.next())}).then(function(r){return r.done?void 0:Promise.resolve(r.value).then(function(r){if(e._version===t)return vt(e,r,n).then(o),e._fulfilled(r),r})});n.catch(function(r){e._version===t&&(vt(e,void 0,n),e._rejected(r))})}return new Promise(function(e){e(r.next())}).then(function(e){if(!e.done)return n.then(o),e.value})}(e,n,o,t)):t;var i});o.then(function(t){e._version===n&&(e._value=t,e._fulfilled(t))},function(t){e._version===n&&(e._value=void 0,e._rejected(t))})}function vt(e,t,n){var r=e._module._runtime;return e._value=t,e._promise=n,e._outputs.forEach(r._updates.add,r._updates),r._compute()}Object.defineProperties(ct,{load:{value:function(e,t,n){if("function"==typeof t&&(n=t,t=null),"function"!=typeof n)throw new Error("invalid observer");null==t&&(t=new ze);const{modules:r,id:o}=e,i=new Map,a=new ct(t),u=s(o);function s(e){let t=i.get(e);return t||i.set(e,t=a.module()),t}for(const e of r){const t=s(e.id);let r=0;for(const o of e.variables)o.from?t.import(o.remote,o.name,s(o.from)):t===u?t.variable(n(o,r,e.variables)).define(o.name,o.inputs,o.value):t.define(o.name,o.inputs,o.value),++r}return a},writable:!0,configurable:!0}}),Object.defineProperties(ct.prototype,{_compute:{value:function(){return this._computing||(this._computing=this._computeSoon())},writable:!0,configurable:!0},_computeSoon:{value:function(){var e=this;return new Promise(function(t){requestAnimationFrame(function(){t(),e._computeNow()})})},writable:!0,configurable:!0},_computeNow:{value:function(){var e,t,n=[];(e=new Set(this._dirty)).forEach(function(t){t._inputs.forEach(e.add,e);const n=function(e){if(e._observer!==Qe)return!0;var t=new Set(e._outputs);for(const e of t){if(e._observer!==Qe)return!0;e._outputs.forEach(t.add,t)}return!1}(t);n>t._reachable?this._updates.add(t):n<t._reachable&&t._invalidate(),t._reachable=n},this),(e=new Set(this._updates)).forEach(function(t){t._reachable?(t._indegree=0,t._outputs.forEach(e.add,e)):(t._indegree=-1,e.delete(t))}),this._computing=null,this._updates.clear(),this._dirty.clear(),e.forEach(function(e){e._outputs.forEach(dt)}),e.forEach(function(e){0===e._indegree&&n.push(e)});for(;t=n.pop();)mt(t),t._outputs.forEach(r),e.delete(t);function r(e){0==--e._indegree&&n.push(e)}e.forEach(function(e){var t=new He("circular definition");e._value=void 0,(e._promise=Promise.reject(t)).catch(Je),e._rejected(t)})},writable:!0,configurable:!0},module:{value:function(e,t=Je){if(void 0===e)return new at(this);let n=this._modules.get(e);return n||(this._modules.set(e,n=e(this,t)),n)},writable:!0,configurable:!0}}),e.Inspector=X,e.Library=ze,e.Runtime=ct,e.RuntimeError=He,Object.defineProperty(e,"__esModule",{value:!0})});
// @observablehq/runtime v3.0.7 Copyright 2019 Observable, Inc.
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.observablehq=e.observablehq||{})}(this,function(e){"use strict";function t(e,t,n){n=n||{};var r=e.ownerDocument,o=r.defaultView.CustomEvent;"function"==typeof o?o=new o(t,{detail:n}):((o=r.createEvent("Event")).initEvent(t,!1,!1),o.detail=n),e.dispatchEvent(o)}function n(e){return Array.isArray(e)||e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function r(e){return e===(0|e)+""}function o(e){const t=document.createElement("span");return t.className="observablehq--cellname",t.textContent=`${e} = `,t}const i=Symbol.prototype.toString;function a(e){return i.call(e)}const{getOwnPropertySymbols:u,prototype:{hasOwnProperty:s}}=Object,{toStringTag:l}=Symbol,c={},d=u;function f(e,t){return s.call(e,t)}function p(e){return e[l]||e.constructor&&e.constructor.name||"Object"}function h(e,t){try{const n=e[t];return n&&n.constructor,n}catch(e){return c}}function m(e,r,i){const a=n(e);let u,s,l;e instanceof Map?(u=`Map(${e.size})`,s=v):e instanceof Set?(u=`Set(${e.size})`,s=b):a?(u=`${e.constructor.name}(${e.length})`,s=w):(u=p(e),s=_);const c=document.createElement("span");c.className="observablehq--expanded",i&&c.appendChild(o(i));const d=c.appendChild(document.createElement("a"));d.innerHTML="<svg width=8 height=8 class='observablehq--caret'>\n <path d='M4 7L0 1h8z' fill='currentColor' />\n </svg>",d.appendChild(document.createTextNode(`${u}${a?" [":" {"}`)),d.addEventListener("mouseup",function(t){t.stopPropagation(),J(c,C(e,null,i))}),s=s(e);for(let e=0;!(l=s.next()).done&&e<20;++e)c.appendChild(l.value);if(!l.done){const e=c.appendChild(document.createElement("a"));e.className="observablehq--field",e.style.display="block",e.appendChild(document.createTextNode(" … more")),e.addEventListener("mouseup",function(e){e.stopPropagation(),c.insertBefore(l.value,c.lastChild.previousSibling);for(let e=0;!(l=s.next()).done&&e<19;++e)c.insertBefore(l.value,c.lastChild.previousSibling);l.done&&c.removeChild(c.lastChild.previousSibling),t(c,"load")})}return c.appendChild(document.createTextNode(a?"]":"}")),c}function*v(e){for(const[t,n]of e)yield y(t,n);yield*_(e)}function*b(e){for(const t of e)yield x(t);yield*_(e)}function*w(e){for(let t=0,n=e.length;t<n;++t)t in e&&(yield g(t,h(e,t),"observablehq--index"));for(const t in e)!r(t)&&f(e,t)&&(yield g(t,h(e,t),"observablehq--key"));for(const t of d(e))yield g(a(t),h(e,t),"observablehq--symbol")}function*_(e){for(const t in e)f(e,t)&&(yield g(t,h(e,t),"observablehq--key"));for(const t of d(e))yield g(a(t),h(e,t),"observablehq--symbol")}function g(e,t,n){const r=document.createElement("div"),o=r.appendChild(document.createElement("span"));return r.className="observablehq--field",o.className=n,o.textContent=` ${e}`,r.appendChild(document.createTextNode(": ")),r.appendChild(G(t)),r}function y(e,t){const n=document.createElement("div");return n.className="observablehq--field",n.appendChild(document.createTextNode(" ")),n.appendChild(G(e)),n.appendChild(document.createTextNode(" => ")),n.appendChild(G(t)),n}function x(e){const t=document.createElement("div");return t.className="observablehq--field",t.appendChild(document.createTextNode(" ")),t.appendChild(G(e)),t}function C(e,t,r){const i=n(e);let a,u,s;if(e instanceof Map?(a=`Map(${e.size})`,u=E):e instanceof Set?(a=`Set(${e.size})`,u=N):i?(a=`${e.constructor.name}(${e.length})`,u=q):(a=p(e),u=P),t){const t=document.createElement("span");return t.className="observablehq--shallow",r&&t.appendChild(o(r)),t.appendChild(document.createTextNode(a)),t.addEventListener("mouseup",function(n){n.stopPropagation(),J(t,C(e))}),t}const l=document.createElement("span");l.className="observablehq--collapsed",r&&l.appendChild(o(r));const c=l.appendChild(document.createElement("a"));c.innerHTML="<svg width=8 height=8 class='observablehq--caret'>\n <path d='M7 4L1 8V0z' fill='currentColor' />\n </svg>",c.appendChild(document.createTextNode(`${a}${i?" [":" {"}`)),l.addEventListener("mouseup",function(t){t.stopPropagation(),J(l,m(e,0,r))},!0),u=u(e);for(let e=0;!(s=u.next()).done&&e<20;++e)e>0&&l.appendChild(document.createTextNode(", ")),l.appendChild(s.value);return s.done||l.appendChild(document.createTextNode(", …")),l.appendChild(document.createTextNode(i?"]":"}")),l}function*E(e){for(const[t,n]of e)yield k(t,n);yield*P(e)}function*N(e){for(const t of e)yield G(t,!0);yield*P(e)}function*q(e){let t=-1,n=0;for(const r=e.length;n<r;++n)n in e&&(n>t+1&&(yield S(n-t-1)),yield G(h(e,n),!0),t=n);n>t+1&&(yield S(n-t-1));for(const t in e)!r(t)&&f(e,t)&&(yield j(t,h(e,t),"observablehq--key"));for(const t of d(e))yield j(a(t),h(e,t),"observablehq--symbol")}function*P(e){for(const t in e)f(e,t)&&(yield j(t,h(e,t),"observablehq--key"));for(const t of d(e))yield j(a(t),h(e,t),"observablehq--symbol")}function S(e){const t=document.createElement("span");return t.className="observablehq--empty",t.textContent=1===e?"empty":`empty × ${e}`,t}function j(e,t,n){const r=document.createDocumentFragment(),o=r.appendChild(document.createElement("span"));return o.className=n,o.textContent=e,r.appendChild(document.createTextNode(": ")),r.appendChild(G(t,!0)),r}function k(e,t){const n=document.createDocumentFragment();return n.appendChild(G(e,!0)),n.appendChild(document.createTextNode(" => ")),n.appendChild(G(t,!0)),n}function $(e,t){var n=e+"",r=n.length;return r<t?new Array(t-r+1).join(0)+n:n}function L(e){return e<0?"-"+$(-e,6):e>9999?"+"+$(e,6):$(e,4)}var M=Error.prototype.toString;var O=RegExp.prototype.toString;const T=20;function A(e){return e.replace(/[\\`\x00-\x09\x0b-\x19]|\${/g,U)}function U(e){var t=e.charCodeAt(0);switch(t){case 8:return"\\b";case 9:return"\\t";case 11:return"\\v";case 12:return"\\f";case 13:return"\\r"}return t<16?"\\x0"+t.toString(16):t<32?"\\x"+t.toString(16):"\\"+e}function F(e,t){for(var n=0;t.exec(e);)++n;return n}var R=Function.prototype.toString,D={prefix:"async ƒ"},z={prefix:"async ƒ*"},I={prefix:"class"},H={prefix:"ƒ"},W={prefix:"ƒ*"};function B(e,t,n){var r=document.createElement("span");r.className="observablehq--function",n&&r.appendChild(o(n));var i=r.appendChild(document.createElement("span"));return i.className="observablehq--keyword",i.textContent=e.prefix,r.appendChild(document.createTextNode(t)),r}const{prototype:{toString:V}}=Object;function G(e,t,n,r){let i=typeof e;switch(i){case"boolean":case"undefined":e+="";break;case"number":e=0===e&&1/e<0?"-0":e+"";break;case"bigint":e+="n";break;case"symbol":e=a(e);break;case"function":return function(e,t){var n,r,o=R.call(e);switch(e.constructor&&e.constructor.name){case"AsyncFunction":n=D;break;case"AsyncGeneratorFunction":n=z;break;case"GeneratorFunction":n=W;break;default:n=/^class\b/.test(o)?I:H}return n===I?B(n,"",t):(r=/^(?:async\s*)?(\w+)\s*=>/.exec(o))?B(n,"("+r[1]+")",t):(r=/^(?:async\s*)?\(\s*(\w+(?:\s*,\s*\w+)*)?\s*\)/.exec(o))?B(n,r[1]?"("+r[1].replace(/\s*,\s*/g,", ")+")":"()",t):(r=/^(?:async\s*)?function(?:\s*\*)?(?:\s*\w+)?\s*\(\s*(\w+(?:\s*,\s*\w+)*)?\s*\)/.exec(o))?B(n,r[1]?"("+r[1].replace(/\s*,\s*/g,", ")+")":"()",t):B(n,"(…)",t)}(e,r);case"string":return function(e,t,n,r){if(!1===t){if(F(e,/["\n]/g)<=F(e,/`|\${/g)){const t=document.createElement("span");r&&t.appendChild(o(r));const n=t.appendChild(document.createElement("span"));return n.className="observablehq--string",n.textContent=JSON.stringify(e),t}const i=e.split("\n");if(i.length>T&&!n){const n=document.createElement("div");r&&n.appendChild(o(r));const a=n.appendChild(document.createElement("span"));a.className="observablehq--string",a.textContent="`"+A(i.slice(0,T).join("\n"));const u=n.appendChild(document.createElement("span")),s=i.length-T;return u.textContent=`Show ${s} truncated line${s>1?"s":""}`,u.className="observablehq--string-expand",u.addEventListener("mouseup",function(o){o.stopPropagation(),J(n,G(e,t,!0,r))}),n}const a=document.createElement("span");r&&a.appendChild(o(r));const u=a.appendChild(document.createElement("span"));return u.className=`observablehq--string${n?" observablehq--expanded":""}`,u.textContent="`"+A(e)+"`",a}const i=document.createElement("span");r&&i.appendChild(o(r));const a=i.appendChild(document.createElement("span"));return a.className="observablehq--string",a.textContent=JSON.stringify(e.length>100?`${e.slice(0,50)}…${e.slice(-49)}`:e),i}(e,t,n,r);default:if(null===e){i=null,e="null";break}if(e instanceof Date){i="date",u=e,e=isNaN(u)?"Invalid Date":function(e){return 0===e.getUTCMilliseconds()&&0===e.getUTCSeconds()&&0===e.getUTCMinutes()&&0===e.getUTCHours()}(u)?L(u.getUTCFullYear())+"-"+$(u.getUTCMonth()+1,2)+"-"+$(u.getUTCDate(),2):L(u.getFullYear())+"-"+$(u.getMonth()+1,2)+"-"+$(u.getDate(),2)+"T"+$(u.getHours(),2)+":"+$(u.getMinutes(),2)+(u.getMilliseconds()?":"+$(u.getSeconds(),2)+"."+$(u.getMilliseconds(),3):u.getSeconds()?":"+$(u.getSeconds(),2):"");break}if(e===c){i="forbidden",e="[forbidden]";break}switch(V.call(e)){case"[object RegExp]":i="regexp",e=function(e){return O.call(e)}(e);break;case"[object Error]":case"[object DOMException]":i="error",e=function(e){return e.stack||M.call(e)}(e);break;default:return(n?m:C)(e,t,r)}}var u;const s=document.createElement("span");r&&s.appendChild(o(r));const l=s.appendChild(document.createElement("span"));return l.className=`observablehq--${i}`,l.textContent=e,s}function J(e,n){e.classList.contains("observablehq--inspect")&&n.classList.add("observablehq--inspect"),e.parentNode.replaceChild(n,e),t(n,"load")}const Y=/\s+\(\d+:\d+\)$/m;class X{constructor(e){if(!e)throw new Error("invalid node");this._node=e,e.classList.add("observablehq")}pending(){const{_node:e}=this;e.classList.remove("observablehq--error"),e.classList.add("observablehq--running")}fulfilled(e,n){const{_node:r}=this;if((!(e instanceof Element||e instanceof Text)||e.parentNode&&e.parentNode!==r)&&(e=G(e,!1,r.firstChild&&r.firstChild.classList&&r.firstChild.classList.contains("observablehq--expanded"),n)).classList.add("observablehq--inspect"),r.classList.remove("observablehq--running","observablehq--error"),r.firstChild!==e)if(r.firstChild){for(;r.lastChild!==r.firstChild;)r.removeChild(r.lastChild);r.replaceChild(e,r.firstChild)}else r.appendChild(e);t(r,"update")}rejected(e,n){const{_node:r}=this;for(r.classList.remove("observablehq--running"),r.classList.add("observablehq--error");r.lastChild;)r.removeChild(r.lastChild);var i=document.createElement("div");i.className="observablehq--inspect",n&&i.appendChild(o(n)),i.appendChild(document.createTextNode((e+"").replace(Y,""))),r.appendChild(i),t(r,"error",{error:e})}}function K(e){return function(){return e}}X.into=function(e){if("string"==typeof e&&null==(e=document.querySelector(e)))throw new Error("container not found");return function(){return new X(e.appendChild(document.createElement("div")))}};var Q={math:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};var Z=0;function ee(e){this.id=e,this.href=window.location.href+"#"+e}ee.prototype.toString=function(){return"url("+this.href+")"};var te={canvas:function(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,n},context2d:function(e,t,n){null==n&&(n=devicePixelRatio);var r=document.createElement("canvas");r.width=e*n,r.height=t*n,r.style.width=e+"px";var o=r.getContext("2d");return o.scale(n,n),o},download:function(e,t="untitled",n="Save"){const r=document.createElement("a"),o=r.appendChild(document.createElement("button"));async function i(){await new Promise(requestAnimationFrame),URL.revokeObjectURL(r.href),r.removeAttribute("href"),o.textContent=n,o.disabled=!1}return o.textContent=n,r.download=t,r.onclick=(async t=>{if(o.disabled=!0,r.href)return i();o.textContent="Saving…";try{const t=await("function"==typeof e?e():e);o.textContent="Download",r.href=URL.createObjectURL(t)}catch(e){o.textContent=n}if(t.eventPhase)return i();o.disabled=!1}),r},element:function(e,t){var n,r=e+="",o=r.indexOf(":");o>=0&&"xmlns"!==(r=e.slice(0,o))&&(e=e.slice(o+1));var i=Q.hasOwnProperty(r)?document.createElementNS(Q[r],e):document.createElement(e);if(t)for(var a in t)o=(r=a).indexOf(":"),n=t[a],o>=0&&"xmlns"!==(r=a.slice(0,o))&&(a=a.slice(o+1)),Q.hasOwnProperty(r)?i.setAttributeNS(Q[r],a,n):i.setAttribute(a,n);return i},input:function(e){var t=document.createElement("input");return null!=e&&(t.type=e),t},range:function(e,t,n){1===arguments.length&&(t=e,e=null);var r=document.createElement("input");return r.min=e=null==e?0:+e,r.max=t=null==t?1:+t,r.step=null==n?"any":n=+n,r.type="range",r},select:function(e){var t=document.createElement("select");return Array.prototype.forEach.call(e,function(e){var n=document.createElement("option");n.value=n.textContent=e,t.appendChild(n)}),t},svg:function(e,t){var n=document.createElementNS("http://www.w3.org/2000/svg","svg");return n.setAttribute("viewBox",[0,0,e,t]),n.setAttribute("width",e),n.setAttribute("height",t),n},text:function(e){return document.createTextNode(e)},uid:function(e){return new ee("O-"+(null==e?"":e+"-")+ ++Z)}};var ne={buffer:function(e){return new Promise(function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsArrayBuffer(e)})},text:function(e){return new Promise(function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsText(e)})},url:function(e){return new Promise(function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsDataURL(e)})}};function re(){return this}function oe(e,t){let n=!1;return{[Symbol.iterator]:re,next:()=>n?{done:!0}:(n=!0,{done:!1,value:e}),return:()=>(n=!0,t(e),{done:!0}),throw:()=>({done:n=!0})}}function ie(e){let t,n,r=!1;const o=e(function(e){n?(n(e),n=null):r=!0;return t=e});return{[Symbol.iterator]:re,throw:()=>({done:!0}),return:()=>(null!=o&&o(),{done:!0}),next:function(){return{done:!1,value:r?(r=!1,Promise.resolve(t)):new Promise(e=>n=e)}}}}function ae(e){switch(e.type){case"range":case"number":return e.valueAsNumber;case"date":return e.valueAsDate;case"checkbox":return e.checked;case"file":return e.multiple?e.files:e.files[0];default:return e.value}}var ue={disposable:oe,filter:function*(e,t){for(var n,r=-1;!(n=e.next()).done;)t(n.value,++r)&&(yield n.value)},input:function(e){return ie(function(t){var n=function(e){switch(e.type){case"button":case"submit":case"checkbox":return"click";case"file":return"change";default:return"input"}}(e),r=ae(e);function o(){t(ae(e))}return e.addEventListener(n,o),void 0!==r&&t(r),function(){e.removeEventListener(n,o)}})},map:function*(e,t){for(var n,r=-1;!(n=e.next()).done;)yield t(n.value,++r)},observe:ie,queue:function(e){let t;const n=[],r=e(function(e){return n.push(e),t&&(t(n.shift()),t=null),e});return{[Symbol.iterator]:re,throw:()=>({done:!0}),return:()=>(null!=r&&r(),{done:!0}),next:function(){return{done:!1,value:n.length?Promise.resolve(n.shift()):new Promise(e=>t=e)}}}},range:function*(e,t,n){e=+e,t=+t,n=(o=arguments.length)<2?(t=e,e=0,1):o<3?1:+n;for(var r=-1,o=0|Math.max(0,Math.ceil((t-e)/n));++r<o;)yield e+r*n},valueAt:function(e,t){if(!(!isFinite(t=+t)||t<0||t!=t|0))for(var n,r=-1;!(n=e.next()).done;)if(++r===t)return n.value},worker:function(e){const t=URL.createObjectURL(new Blob([e],{type:"text/javascript"})),n=new Worker(t);return oe(n,()=>{n.terminate(),URL.revokeObjectURL(t)})}};function se(e,t){return function(n){var r,o,i,a,u,s,l,c,d=n[0],f=[],p=null,h=-1;for(u=1,s=arguments.length;u<s;++u){if((r=arguments[u])instanceof Node)f[++h]=r,d+="\x3c!--o:"+h+"--\x3e";else if(Array.isArray(r)){for(l=0,c=r.length;l<c;++l)(o=r[l])instanceof Node?(null===p&&(f[++h]=p=document.createDocumentFragment(),d+="\x3c!--o:"+h+"--\x3e"),p.appendChild(o)):(p=null,d+=o);p=null}else d+=r;d+=n[u]}if(p=e(d),++h>0){for(i=new Array(h),a=document.createTreeWalker(p,NodeFilter.SHOW_COMMENT,null,!1);a.nextNode();)o=a.currentNode,/^o:/.test(o.nodeValue)&&(i[+o.nodeValue.slice(2)]=o);for(u=0;u<h;++u)(o=i[u])&&o.parentNode.replaceChild(f[u],o)}return 1===p.childNodes.length?p.removeChild(p.firstChild):11===p.nodeType?((o=t()).appendChild(p),o):p}}var le=se(function(e){var t=document.createElement("template");return t.innerHTML=e.trim(),document.importNode(t.content,!0)},function(){return document.createElement("span")});function ce(e){return function(){return e("marked@0.3.12/marked.min.js").then(function(t){return se(function(n){var r=document.createElement("div");r.innerHTML=t(n,{langPrefix:""}).trim();var o=r.querySelectorAll("pre code[class]");return o.length>0&&e("@observablehq/highlight.js@1.1.1/highlight.min.js").then(function(e){o.forEach(function(t){e.highlightBlock(t),t.parentNode.classList.add("observablehq--md-pre")})}),r},function(){return document.createElement("div")})})}}function de(e){let t;Object.defineProperties(this,{generator:{value:ie(e=>void(t=e))},value:{get:()=>e,set:n=>t(e=n)}}),void 0!==e&&t(e)}function*fe(){for(;;)yield Date.now()}var pe=new Map;function he(e,t){var n;return(n=pe.get(e=+e))?n.then(K(t)):(n=Date.now())>=e?Promise.resolve(t):function(e,t){var n=new Promise(function(n){pe.delete(t);var r=t-e;if(!(r>0))throw new Error("invalid time");if(r>2147483647)throw new Error("too long to wait");setTimeout(n,r)});return pe.set(t,n),n}(n,e).then(K(t))}var me={delay:function(e,t){return new Promise(function(n){setTimeout(function(){n(t)},e)})},tick:function(e,t){return he(Math.ceil((Date.now()+1)/e)*e,t)},when:he};function ve(e,t){if(/^(\w+:)|\/\//i.test(e))return e;if(/^[.]{0,2}\//i.test(e))return new URL(e,null==t?location:t).href;if(!e.length||/^[\s._]/.test(e)||/\s$/.test(e))throw new Error("illegal name");return"https://unpkg.com/"+e}const be=new Map,we=[],_e=we.map,ge=we.some,ye=we.hasOwnProperty,xe="https://cdn.jsdelivr.net/npm/",Ce=/^((?:@[^\/@]+\/)?[^\/@]+)(?:@([^\/]+))?(?:\/(.*))?$/,Ee=/^\d+\.\d+\.\d+(-[\w-.+]+)?$/,Ne=/\.[^\/]*$/,qe=["unpkg","jsdelivr","browser","main"];class RequireError extends Error{constructor(e){super(e)}}function Pe(e){const t=Ce.exec(e);return t&&{name:t[1],version:t[2],path:t[3]}}function Se(e){const t=`${xe}${e.name}${e.version?`@${e.version}`:""}/package.json`;let n=be.get(t);return n||be.set(t,n=fetch(t).then(e=>{if(!e.ok)throw new RequireError("unable to load package.json");return e.redirected&&!be.has(e.url)&&be.set(e.url,n),e.json()})),n}RequireError.prototype.name=RequireError.name;const je=ke(async function(e,t){if(e.startsWith(xe)&&(e=e.substring(xe.length)),/^(\w+:)|\/\//i.test(e))return e;if(/^[.]{0,2}\//i.test(e))return new URL(e,null==t?location:t).href;if(!e.length||/^[\s._]/.test(e)||/\s$/.test(e))throw new RequireError("illegal name");const n=Pe(e);if(!n)return`${xe}${e}`;if(!n.version&&null!=t&&t.startsWith(xe)){const e=await Se(Pe(t.substring(xe.length)));n.version=e.dependencies&&e.dependencies[n.name]||e.peerDependencies&&e.peerDependencies[n.name]}if(n.path&&!Ne.test(n.path)&&(n.path+=".js"),n.path&&n.version&&Ee.test(n.version))return`${xe}${n.name}@${n.version}/${n.path}`;const r=await Se(n);return`${xe}${r.name}@${r.version}/${n.path||function(e){for(const t of qe){const n=e[t];if("string"==typeof n)return Ne.test(n)?n:`${n}.js`}}(r)||"index.js"}`});function ke(e){const t=new Map,n=o(null);function r(e){if("string"!=typeof e)return e;let n=t.get(e);return n||t.set(e,n=new Promise((t,n)=>{const r=document.createElement("script");r.onload=(()=>{try{t(we.pop()(o(e)))}catch(e){n(new RequireError("invalid module"))}r.remove()}),r.onerror=(()=>{n(new RequireError("unable to load module")),r.remove()}),r.async=!0,r.src=e,window.define=Oe,document.head.appendChild(r)})),n}function o(t){return n=>Promise.resolve(e(n,t)).then(r)}function i(e){return arguments.length>1?Promise.all(_e.call(arguments,n)).then($e):n(e)}return i.alias=function(t){return ke((n,r)=>n in t&&(r=null,"string"!=typeof(n=t[n]))?n:e(n,r))},i.resolve=e,i}function $e(e){const t={};for(const n of e)for(const e in n)ye.call(n,e)&&(null==n[e]?Object.defineProperty(t,e,{get:Le(n,e)}):t[e]=n[e]);return t}function Le(e,t){return()=>e[t]}function Me(e){return e+""=="exports"}function Oe(e,t,n){const r=arguments.length;r<2?(n=e,t=[]):r<3&&(n=t,t="string"==typeof e?[]:e),we.push(ge.call(t,Me)?e=>{const r={};return Promise.all(_e.call(t,t=>Me(t+="")?r:e(t))).then(e=>(n.apply(null,e),r))}:e=>Promise.all(_e.call(t,e)).then(e=>"function"==typeof n?n.apply(null,e):n))}function Te(e){return null==e?je:ke(e)}Oe.amd={};var Ae=se(function(e){var t=document.createElementNS("http://www.w3.org/2000/svg","g");return t.innerHTML=e.trim(),t},function(){return document.createElementNS("http://www.w3.org/2000/svg","g")}),Ue=String.raw;function Fe(e){return new Promise(function(t,n){var r=document.createElement("link");r.rel="stylesheet",r.href=e,r.onerror=n,r.onload=t,document.head.appendChild(r)})}function Re(e){return function(){return Promise.all([e("@observablehq/katex@0.10.1/dist/katex.min.js"),e.resolve("@observablehq/katex@0.10.1/dist/katex.min.css").then(Fe)]).then(function(e){var t=e[0],n=r();function r(e){return function(){var n=document.createElement("div");return t.render(Ue.apply(String,arguments),n,e),n.removeChild(n.firstChild)}}return n.options=r,n.block=r({displayMode:!0}),n})}}function De(){return ie(function(e){var t=e(document.body.clientWidth);function n(){var n=document.body.clientWidth;n!==t&&e(t=n)}return window.addEventListener("resize",n),function(){window.removeEventListener("resize",n)}})}function ze(e){const t=Te(e);Object.defineProperties(this,{DOM:{value:te,writable:!0,enumerable:!0},Files:{value:ne,writable:!0,enumerable:!0},Generators:{value:ue,writable:!0,enumerable:!0},html:{value:K(le),writable:!0,enumerable:!0},md:{value:ce(t),writable:!0,enumerable:!0},Mutable:{value:K(de),writable:!0,enumerable:!0},now:{value:fe,writable:!0,enumerable:!0},Promises:{value:me,writable:!0,enumerable:!0},require:{value:K(t),writable:!0,enumerable:!0},resolve:{value:K(ve),writable:!0,enumerable:!0},svg:{value:K(Ae),writable:!0,enumerable:!0},tex:{value:Re(t),writable:!0,enumerable:!0},width:{value:De,writable:!0,enumerable:!0}})}function Ie(e,t){this.message=e+"",this.input=t}Ie.prototype=Object.create(Error.prototype),Ie.prototype.name="RuntimeError",Ie.prototype.constructor=Ie;var He=Array.prototype,We=He.map,Be=He.forEach;function Ve(e){return function(){return e}}function Ge(e){return e}function Je(){}var Ye=1,Xe=2,Ke=3,Qe={};function Ze(e,t,n){var r;null==n&&(n=Qe),Object.defineProperties(this,{_observer:{value:n,writable:!0},_definition:{value:nt,writable:!0},_duplicate:{value:void 0,writable:!0},_duplicates:{value:void 0,writable:!0},_indegree:{value:-1,writable:!0},_inputs:{value:[],writable:!0},_invalidate:{value:Je,writable:!0},_module:{value:t},_name:{value:null,writable:!0},_outputs:{value:new Set,writable:!0},_promise:{value:Promise.resolve(void 0),writable:!0},_reachable:{value:n!==Qe,writable:!0},_rejector:{value:(r=this,function(e){if(e===nt)throw new Ie(r._name+" is not defined",r._name);throw new Ie(r._name+" could not be resolved",r._name)})},_type:{value:e},_value:{value:void 0,writable:!0},_version:{value:0,writable:!0}})}function et(e){e._module._runtime._dirty.add(e),e._outputs.add(this)}function tt(e){e._module._runtime._dirty.add(e),e._outputs.delete(this)}function nt(){throw nt}function rt(e){return function(){throw new Ie(e+" is defined more than once")}}function ot(e,t,n){var r=this._module._scope,o=this._module._runtime;if(this._inputs.forEach(tt,this),t.forEach(et,this),this._inputs=t,this._definition=n,this._value=void 0,e==this._name&&r.get(e)===this)this._outputs.forEach(o._updates.add,o._updates);else{var i,a;if(this._name)if(this._outputs.size)r.delete(this._name),(a=this._module._resolve(this._name))._outputs=this._outputs,this._outputs=new Set,a._outputs.forEach(function(e){e._inputs[e._inputs.indexOf(this)]=a},this),a._outputs.forEach(o._updates.add,o._updates),o._dirty.add(a).add(this),r.set(this._name,a);else if((a=r.get(this._name))===this)r.delete(this._name);else{if(a._type!==Ke)throw new Error;a._duplicates.delete(this),this._duplicate=void 0,1===a._duplicates.size&&(a=a._duplicates.keys().next().value,i=r.get(this._name),a._outputs=i._outputs,i._outputs=new Set,a._outputs.forEach(function(e){e._inputs[e._inputs.indexOf(i)]=a}),a._definition=a._duplicate,a._duplicate=void 0,o._dirty.add(i).add(a),o._updates.add(a),r.set(this._name,a))}if(this._outputs.size)throw new Error;e&&((a=r.get(e))?a._type===Ke?(this._definition=rt(e),this._duplicate=n,a._duplicates.add(this)):a._type===Xe?(this._outputs=a._outputs,a._outputs=new Set,this._outputs.forEach(function(e){e._inputs[e._inputs.indexOf(a)]=this},this),o._dirty.add(a).add(this),r.set(e,this)):(a._duplicate=a._definition,this._duplicate=n,(i=new Ze(Ke,this._module))._name=e,i._definition=this._definition=a._definition=rt(e),i._outputs=a._outputs,a._outputs=new Set,i._outputs.forEach(function(e){e._inputs[e._inputs.indexOf(a)]=i}),i._duplicates=new Set([this,a]),o._dirty.add(a).add(i),o._updates.add(a).add(i),r.set(e,i)):r.set(e,this)),this._name=e}return o._updates.add(this),o._compute(),this}Object.defineProperties(Ze.prototype,{_pending:{value:function(){this._observer.pending&&this._observer.pending()},writable:!0,configurable:!0},_fulfilled:{value:function(e){this._observer.fulfilled&&this._observer.fulfilled(e,this._name)},writable:!0,configurable:!0},_rejected:{value:function(e){this._observer.rejected&&this._observer.rejected(e,this._name)},writable:!0,configurable:!0},define:{value:function(e,t,n){switch(arguments.length){case 1:n=e,e=t=null;break;case 2:n=t,"string"==typeof e?t=null:(t=e,e=null)}return ot.call(this,null==e?null:e+"",null==t?[]:We.call(t,this._module._resolve,this._module),"function"==typeof n?n:Ve(n))},writable:!0,configurable:!0},delete:{value:function(){return ot.call(this,null,[],Je)},writable:!0,configurable:!0},import:{value:function(e,t,n){arguments.length<3&&(n=t,t=e);return ot.call(this,t+"",[n._resolve(e+"")],Ge)},writable:!0,configurable:!0}});var it=new Map;function at(e){Object.defineProperties(this,{_runtime:{value:e},_scope:{value:new Map}})}function ut(e){return e._name}Object.defineProperties(at.prototype,{_copy:{value:function(e,t,n){var r=new at(this._runtime);return n.set(this,r),this._scope.forEach(function(o,i){var a,u=new Ze(o._type,r);if(a=e.get(i))u.import(a.name,a.alias,t);else if(o._definition===Ge){var s=o._inputs[0],l=s._module,c=n.get(l)||l._copy(it,null,n);u.import(s._name,i,c)}else u.define(i,o._inputs.map(ut),o._definition)}),r},writable:!0,configurable:!0},_resolve:{value:function(e){var t,n=this._scope.get(e);if(!n)if(n=new Ze(Xe,this),this._runtime._builtin._scope.has(e))n.import(e,this._runtime._builtin);else if("invalidation"===e)n.define(e,lt);else if("visibility"===e)n.define(e,ct);else{try{t=this._runtime._global(e)}catch(t){return n.define(e,(r=t,function(){throw r}))}void 0===t?this._scope.set(n._name=e,n):n.define(e,Ve(t))}var r;return n},writable:!0,configurable:!0},redefine:{value:function(e){var t=this._scope.get(e);if(!t)throw new Ie(e+" is not defined");if(t._type===Ke)throw new Ie(e+" is defined more than once");return t.define.apply(t,arguments)},writable:!0,configurable:!0},define:{value:function(){var e=new Ze(Ye,this);return e.define.apply(e,arguments)},writable:!0,configurable:!0},derive:{value:function(e,t){var n=new Map;return Be.call(e,function(e){"object"!=typeof e&&(e={name:e+""}),null==e.alias&&(e.alias=e.name),n.set(e.alias,e)}),this._copy(n,t,new Map)},writable:!0,configurable:!0},import:{value:function(){var e=new Ze(Ye,this);return e.import.apply(e,arguments)},writable:!0,configurable:!0},variable:{value:function(e){return new Ze(Ye,this,e)},writable:!0,configurable:!0}});const st="function"==typeof requestAnimationFrame?requestAnimationFrame:setImmediate;var lt={},ct={};function dt(e=new ze,t=function(e){return window[e]}){var n=this.module();if(Object.defineProperties(this,{_dirty:{value:new Set},_updates:{value:new Set},_computing:{value:null,writable:!0},_modules:{value:new Map},_builtin:{value:n},_global:{value:t}}),e)for(var r in e)new Ze(Xe,n).define(r,[],e[r])}function ft(e){++e._indegree}function pt(e){return e._promise.catch(e._rejector)}function ht(e){return new Promise(function(t){e._invalidate=t})}function mt(e,t){let n,r,o="function"==typeof IntersectionObserver&&t._observer&&t._observer._node,i=!o,a=Je,u=Je;return o&&((r=new IntersectionObserver(([e])=>(i=e.isIntersecting)&&(n=null,a()))).observe(o),e.then(()=>(r.disconnect(),r=null,u()))),function(e){return i?Promise.resolve(e):r?(n||(n=new Promise((e,t)=>(a=e,u=t))),n.then(()=>e)):Promise.reject()}}function vt(e){e._invalidate(),e._invalidate=Je,e._pending();var t=e._value,n=++e._version,r=null,o=e._promise=Promise.all(e._inputs.map(pt)).then(function(o){if(e._version===n){for(var i=0,a=o.length;i<a;++i)switch(o[i]){case lt:o[i]=r=ht(e);break;case ct:r||(r=ht(e)),o[i]=mt(r,e)}return e._definition.apply(t,o)}}).then(function(t){return function(e){return e&&"function"==typeof e.next&&"function"==typeof e.return}(t)?((r||ht(e)).then((i=t,function(){i.return()})),function(e,t,n,r){function o(){var n=new Promise(function(e){e(r.next())}).then(function(r){return r.done?void 0:Promise.resolve(r.value).then(function(r){if(e._version===t)return bt(e,r,n).then(o),e._fulfilled(r),r})});n.catch(function(r){e._version===t&&(bt(e,void 0,n),e._rejected(r))})}return new Promise(function(e){e(r.next())}).then(function(e){if(!e.done)return n.then(o),e.value})}(e,n,o,t)):t;var i});o.then(function(t){e._version===n&&(e._value=t,e._fulfilled(t))},function(t){e._version===n&&(e._value=void 0,e._rejected(t))})}function bt(e,t,n){var r=e._module._runtime;return e._value=t,e._promise=n,e._outputs.forEach(r._updates.add,r._updates),r._compute()}Object.defineProperties(dt,{load:{value:function(e,t,n){if("function"==typeof t&&(n=t,t=null),"function"!=typeof n)throw new Error("invalid observer");null==t&&(t=new ze);const{modules:r,id:o}=e,i=new Map,a=new dt(t),u=s(o);function s(e){let t=i.get(e);return t||i.set(e,t=a.module()),t}for(const e of r){const t=s(e.id);let r=0;for(const o of e.variables)o.from?t.import(o.remote,o.name,s(o.from)):t===u?t.variable(n(o,r,e.variables)).define(o.name,o.inputs,o.value):t.define(o.name,o.inputs,o.value),++r}return a},writable:!0,configurable:!0}}),Object.defineProperties(dt.prototype,{_compute:{value:function(){return this._computing||(this._computing=this._computeSoon())},writable:!0,configurable:!0},_computeSoon:{value:function(){var e=this;return new Promise(function(t){st(function(){t(),e._computeNow()})})},writable:!0,configurable:!0},_computeNow:{value:function(){var e,t,n=[];(e=new Set(this._dirty)).forEach(function(t){t._inputs.forEach(e.add,e);const n=function(e){if(e._observer!==Qe)return!0;var t=new Set(e._outputs);for(const e of t){if(e._observer!==Qe)return!0;e._outputs.forEach(t.add,t)}return!1}(t);n>t._reachable?this._updates.add(t):n<t._reachable&&t._invalidate(),t._reachable=n},this),(e=new Set(this._updates)).forEach(function(t){t._reachable?(t._indegree=0,t._outputs.forEach(e.add,e)):(t._indegree=-1,e.delete(t))}),this._computing=null,this._updates.clear(),this._dirty.clear(),e.forEach(function(e){e._outputs.forEach(ft)}),e.forEach(function(e){0===e._indegree&&n.push(e)});for(;t=n.pop();)vt(t),t._outputs.forEach(r),e.delete(t);function r(e){0==--e._indegree&&n.push(e)}e.forEach(function(e){var t=new Ie("circular definition");e._value=void 0,(e._promise=Promise.reject(t)).catch(Je),e._rejected(t)})},writable:!0,configurable:!0},module:{value:function(e,t=Je){if(void 0===e)return new at(this);let n=this._modules.get(e);return n||(this._modules.set(e,n=e(this,t)),n)},writable:!0,configurable:!0}}),e.Inspector=X,e.Library=ze,e.Runtime=dt,e.RuntimeError=Ie,Object.defineProperty(e,"__esModule",{value:!0})});
{
"name": "@observablehq/runtime",
"version": "3.0.6",
"version": "3.0.7",
"license": "ISC",

@@ -5,0 +5,0 @@ "main": "dist/runtime.umd.js",

@@ -9,2 +9,4 @@ import {Library} from "@observablehq/stdlib";

const frame = typeof requestAnimationFrame === "function" ? requestAnimationFrame : setImmediate;
export var variable_invalidation = {};

@@ -54,3 +56,3 @@ export var variable_visibility = {};

return new Promise(function(resolve) {
requestAnimationFrame(function() {
frame(function() {
resolve();

@@ -57,0 +59,0 @@ runtime._computeNow();

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc