agent-whiteboard 1.2.0 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/README.md +125 -83
  3. package/bin/cli.js +11 -2
  4. package/bin/install-skills.js +108 -0
  5. package/dist/client/assets/{abnfDiagram-VCTEODGH-Dj8sd_5g.js → abnfDiagram-VCTEODGH-Bwh5lUgu.js} +1 -1
  6. package/dist/client/assets/{architectureDiagram-5GKGNRK7-B1QyVL0F.js → architectureDiagram-5GKGNRK7-B_ecYkha.js} +1 -1
  7. package/dist/client/assets/{blockDiagram-I7D4REHJ-CmU2SSFe.js → blockDiagram-I7D4REHJ-yKkzC4XQ.js} +1 -1
  8. package/dist/client/assets/{c4Diagram-7LVT6UL2-DWmhp77c.js → c4Diagram-7LVT6UL2-lHAqFGmA.js} +1 -1
  9. package/dist/client/assets/channel-B2NgRQfI.js +1 -0
  10. package/dist/client/assets/{chunk-2Q5K7J3B-CQLo8Sbv.js → chunk-2Q5K7J3B-B7zuI4_k.js} +1 -1
  11. package/dist/client/assets/{chunk-5VM5RSS4-fJTWmTTt.js → chunk-5VM5RSS4-jBsRKGwk.js} +1 -1
  12. package/dist/client/assets/{chunk-F27PBJKO-DqzEf5gi.js → chunk-F27PBJKO-CGIsMCIr.js} +1 -1
  13. package/dist/client/assets/{chunk-IMKFNOWR-CMamLTz3.js → chunk-IMKFNOWR-WXoBIg3r.js} +1 -1
  14. package/dist/client/assets/{chunk-JWPE2WC7-tyYPyD43.js → chunk-JWPE2WC7-DVxbj6OP.js} +1 -1
  15. package/dist/client/assets/{chunk-POPQ4Y6H-XdY4rO_V.js → chunk-POPQ4Y6H-B6_LAnue.js} +1 -1
  16. package/dist/client/assets/{chunk-SVP7TREG-COvqzqaO.js → chunk-SVP7TREG-DPtBhcA2.js} +1 -1
  17. package/dist/client/assets/{chunk-TICWLB2K-BsJSFuPC.js → chunk-TICWLB2K-BpTvKQOE.js} +1 -1
  18. package/dist/client/assets/{chunk-XXDRQBXY-HfVrYBJb.js → chunk-XXDRQBXY-ChPDJQUM.js} +1 -1
  19. package/dist/client/assets/classDiagram-ZZMXUADV-0PCo-FZi.js +1 -0
  20. package/dist/client/assets/classDiagram-v2-VYDZK3BY-0PCo-FZi.js +1 -0
  21. package/dist/client/assets/{cose-bilkent-JH36ORCC-UXGdwSjS.js → cose-bilkent-JH36ORCC-CNOS6l2h.js} +1 -1
  22. package/dist/client/assets/{cynefin-OW5HDTMX-PWlPYnpn.js → cynefin-OW5HDTMX-yFRC4RbL.js} +1 -1
  23. package/dist/client/assets/{cynefinDiagram-5FMLGOSQ-CYE5H1wR.js → cynefinDiagram-5FMLGOSQ-A1B_XDwz.js} +1 -1
  24. package/dist/client/assets/{dagre-GXQ25YYZ-DaknBOKq.js → dagre-GXQ25YYZ-CsGQlESG.js} +1 -1
  25. package/dist/client/assets/{diagram-S7CK7UJ4-Dz7rZHxF.js → diagram-S7CK7UJ4-oi40Oovb.js} +1 -1
  26. package/dist/client/assets/{diagram-UQ7AKVKN-DzCi6tiS.js → diagram-UQ7AKVKN-fXq7BGyX.js} +1 -1
  27. package/dist/client/assets/{diagram-VSXAHHWV-TlUzhXgv.js → diagram-VSXAHHWV-DGsF5-Gn.js} +1 -1
  28. package/dist/client/assets/{diagram-VX7I27RA-Ds7jdzK7.js → diagram-VX7I27RA-C2kM3ZeN.js} +1 -1
  29. package/dist/client/assets/{diagram-Z3DM3KII-C--JD7cf.js → diagram-Z3DM3KII-B-4vwwDz.js} +1 -1
  30. package/dist/client/assets/{ebnfDiagram-PWID7BFC-Dw5OM-dL.js → ebnfDiagram-PWID7BFC-IQpqM8Er.js} +1 -1
  31. package/dist/client/assets/{erDiagram-RLTQ6QDP-DXalBHjA.js → erDiagram-RLTQ6QDP-DZUhIRFv.js} +1 -1
  32. package/dist/client/assets/{flowDiagram-HODETNUW-DcI3UqyE.js → flowDiagram-HODETNUW-BogyNcsK.js} +1 -1
  33. package/dist/client/assets/{ganttDiagram-EL5Y4UJY-DyrkIo6c.js → ganttDiagram-EL5Y4UJY-DQrF2qTY.js} +1 -1
  34. package/dist/client/assets/{gitGraphDiagram-WWUBYQGX-fJKfGRcg.js → gitGraphDiagram-WWUBYQGX-DCjdibDV.js} +1 -1
  35. package/dist/client/assets/{index-CIhkXT_z.js → index-CwpL9TCq.js} +9 -9
  36. package/dist/client/assets/{infoDiagram-27XIBGKW-Cijiqswb.js → infoDiagram-27XIBGKW-B9fQanxS.js} +1 -1
  37. package/dist/client/assets/{ishikawaDiagram-5VMMS53U-C1WqWU2l.js → ishikawaDiagram-5VMMS53U-C2Vylmfx.js} +1 -1
  38. package/dist/client/assets/{journeyDiagram-3NMN7TZE-7j05mbLR.js → journeyDiagram-3NMN7TZE-D89LoCjM.js} +1 -1
  39. package/dist/client/assets/{kanban-definition-UXKFOSKX-D5mGDfs_.js → kanban-definition-UXKFOSKX-PEjEU0rc.js} +1 -1
  40. package/dist/client/assets/{layout-KEin06-H.js → layout-BFcmmT4m.js} +1 -1
  41. package/dist/client/assets/{mermaid.core-CLvSDmrA.js → mermaid.core-DKnSsFxv.js} +5 -5
  42. package/dist/client/assets/{mindmap-definition-YA3MSWOX-BsCqKd_d.js → mindmap-definition-YA3MSWOX-B7LiyX5g.js} +1 -1
  43. package/dist/client/assets/{pegDiagram-XKGWAZYB-Du5lDU3W.js → pegDiagram-XKGWAZYB-BnJUZrSw.js} +1 -1
  44. package/dist/client/assets/{pieDiagram-E7YTZNPT-hjv5Ao6B.js → pieDiagram-E7YTZNPT-z_3XFa-J.js} +1 -1
  45. package/dist/client/assets/{quadrantDiagram-AXDQQJYC-DNon8LWK.js → quadrantDiagram-AXDQQJYC-B-iV8Ep2.js} +1 -1
  46. package/dist/client/assets/{railroadDiagram-O6MQD6OU-yNZz2zxo.js → railroadDiagram-O6MQD6OU-DWcuukQV.js} +1 -1
  47. package/dist/client/assets/{requirementDiagram-BXWQKSXE-CZiiEUHW.js → requirementDiagram-BXWQKSXE-BL29FbE8.js} +1 -1
  48. package/dist/client/assets/{sankeyDiagram-P5KCCOFB-D-u8ZQUV.js → sankeyDiagram-P5KCCOFB-DncoVK5c.js} +1 -1
  49. package/dist/client/assets/{sequenceDiagram-WJ2MYXX4-BxjTf3q9.js → sequenceDiagram-WJ2MYXX4-4_9ywdq-.js} +1 -1
  50. package/dist/client/assets/{sizeCapture-INFHLROL-Dt4Wg8C5.js → sizeCapture-INFHLROL-DgpEl-H1.js} +1 -1
  51. package/dist/client/assets/{stateDiagram-D77RDMKH-B8BM6dln.js → stateDiagram-D77RDMKH-D3uAsi-s.js} +1 -1
  52. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-BEkx2fLW.js +1 -0
  53. package/dist/client/assets/{swimlanes-42K2YHIH-eGWrsWAA.js → swimlanes-42K2YHIH-DchNJuY0.js} +1 -1
  54. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-BHXAFRx6.js +8 -0
  55. package/dist/client/assets/{timeline-definition-24CTP7MA-CAM-3Qj9.js → timeline-definition-24CTP7MA-KWfqhWGR.js} +1 -1
  56. package/dist/client/assets/{vennDiagram-4TSXK5OY-CuFEwwD0.js → vennDiagram-4TSXK5OY-YJTdSPKH.js} +1 -1
  57. package/dist/client/assets/{wardleyDiagram-VM6X3IG4-DI5yCVh0.js → wardleyDiagram-VM6X3IG4-CSN6rLUa.js} +1 -1
  58. package/dist/client/assets/{xychartDiagram-S5SC5T6Z-BI0Bn-OQ.js → xychartDiagram-S5SC5T6Z-DqPq1Pcp.js} +1 -1
  59. package/dist/client/index.html +1 -1
  60. package/package.json +3 -1
  61. package/skills/agent-whiteboard/SKILL.md +45 -0
  62. package/skills/whiteboard-analysis/SKILL.md +32 -0
  63. package/skills/whiteboard-assessment/SKILL.md +51 -0
  64. package/skills/whiteboard-design/SKILL.md +29 -0
  65. package/skills/whiteboard-teaching/SKILL.md +39 -0
  66. package/dist/client/assets/channel-C9ni1Via.js +0 -1
  67. package/dist/client/assets/classDiagram-ZZMXUADV-DktNEiGC.js +0 -1
  68. package/dist/client/assets/classDiagram-v2-VYDZK3BY-DktNEiGC.js +0 -1
  69. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-MJauX84T.js +0 -1
  70. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-BYFu8tyL.js +0 -8
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mermaid.core-CLvSDmrA.js","assets/step-BEQzeS8V.js","assets/embed-DcNeILcO.js","assets/linear-D1EL1Azg.js","assets/init-Dmth1JHB.js","assets/defaultLocale-CzDG__Ur.js","assets/time-BaoZouO5.js","assets/range-OtVwhkKS.js","assets/ordinal-BeghXfj9.js","assets/colors-Cc3OSVma.js","assets/arc-Aq92EeUK.js","assets/index-Bi7T_FA4.js"])))=>i.map(i=>d[i]);
2
- var yo=Object.defineProperty;var wo=(n,t,e)=>t in n?yo(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var zn=(n,t,e)=>wo(n,typeof t!="symbol"?t+"":t,e);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function e(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=e(i);fetch(i.href,o)}})();function be(){}function kr(n,t){for(const e in t)n[e]=t[e];return n}function Bi(n){return n()}function vr(){return Object.create(null)}function Be(n){n.forEach(Bi)}function Vn(n){return typeof n=="function"}function Xe(n,t){return n!=n?t==t:n!==t||n&&typeof n=="object"||typeof n=="function"}function ko(n){return Object.keys(n).length===0}function Ui(n,...t){if(n==null){for(const r of t)r(void 0);return be}const e=n.subscribe(...t);return e.unsubscribe?()=>e.unsubscribe():e}function mt(n){let t;return Ui(n,e=>t=e)(),t}function _t(n,t,e){n.$$.on_destroy.push(Ui(t,e))}function gn(n){return n&&Vn(n.destroy)?n.destroy:be}const vo=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function R(n,t){n.appendChild(t)}function V(n,t,e){n.insertBefore(t,e||null)}function G(n){n.parentNode&&n.parentNode.removeChild(n)}function Z(n){return document.createElement(n)}function ft(n){return document.createElementNS("http://www.w3.org/2000/svg",n)}function ee(n){return document.createTextNode(n)}function ae(){return ee(" ")}function lt(){return ee("")}function ge(n,t,e,r){return n.addEventListener(t,e,r),()=>n.removeEventListener(t,e,r)}function Eo(n){return function(t){return t.preventDefault(),n.call(this,t)}}function So(n){return function(t){return t.stopPropagation(),n.call(this,t)}}function ji(n){return function(t){t.target===this&&n.call(this,t)}}function A(n,t,e){e==null?n.removeAttribute(t):n.getAttribute(t)!==e&&n.setAttribute(t,e)}function To(n){return Array.from(n.childNodes)}function ye(n,t){t=""+t,n.data!==t&&(n.data=t)}function Er(n,t){n.value=t??""}function gt(n,t,e,r){e==null?n.style.removeProperty(t):n.style.setProperty(t,e,"")}function Le(n,t,e){n.classList.toggle(t,!!e)}function Ao(n,t,{bubbles:e=!1,cancelable:r=!1}={}){return new CustomEvent(n,{detail:t,bubbles:e,cancelable:r})}function Sr(n,t){return new n(t)}let Kt;function Xt(n){Kt=n}function bn(){if(!Kt)throw new Error("Function called outside component initialization");return Kt}function Jt(n){bn().$$.on_mount.push(n)}function yn(n){bn().$$.after_update.push(n)}function Qt(n){bn().$$.on_destroy.push(n)}function $t(){const n=bn();return(t,e,{cancelable:r=!1}={})=>{const i=n.$$.callbacks[t];if(i){const o=Ao(t,e,{cancelable:r});return i.slice().forEach(s=>{s.call(n,o)}),!o.defaultPrevented}return!0}}const Mt=[],Ve=[];let Ut=[];const Hn=[],xi=Promise.resolve();let Zn=!1;function Wi(){Zn||(Zn=!0,xi.then(Hi))}function Co(){return Wi(),xi}function qn(n){Ut.push(n)}function Oo(n){Hn.push(n)}const Rn=new Set;let Nt=0;function Hi(){if(Nt!==0)return;const n=Kt;do{try{for(;Nt<Mt.length;){const t=Mt[Nt];Nt++,Xt(t),Io(t.$$)}}catch(t){throw Mt.length=0,Nt=0,t}for(Xt(null),Mt.length=0,Nt=0;Ve.length;)Ve.pop()();for(let t=0;t<Ut.length;t+=1){const e=Ut[t];Rn.has(e)||(Rn.add(e),e())}Ut.length=0}while(Mt.length);for(;Hn.length;)Hn.pop()();Zn=!1,Rn.clear(),Xt(n)}function Io(n){if(n.fragment!==null){n.update(),Be(n.before_update);const t=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,t),n.after_update.forEach(qn)}}function zo(n){const t=[],e=[];Ut.forEach(r=>n.indexOf(r)===-1?t.push(r):e.push(r)),e.forEach(r=>r()),Ut=t}const mn=new Set;let It;function it(){It={r:0,c:[],p:It}}function ot(){It.r||Be(It.c),It=It.p}function ke(n,t){n&&n.i&&(mn.delete(n),n.i(t))}function Ee(n,t,e,r){if(n&&n.o){if(mn.has(n))return;mn.add(n),It.c.push(()=>{mn.delete(n),r&&(e&&n.d(1),r())}),n.o(t)}else r&&r()}function qe(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function en(n,t){n.d(1),t.delete(n.key)}function Xn(n,t){Ee(n,1,1,()=>{t.delete(n.key)})}function Tt(n,t,e,r,i,o,s,a,l,c,d,p){let h=n.length,u=o.length,g=h;const f={};for(;g--;)f[n[g].key]=g;const _=[],b=new Map,k=new Map,v=[];for(g=u;g--;){const z=p(i,o,g),j=e(z);let N=s.get(j);N?v.push(()=>N.p(z,t)):(N=c(j,z),N.c()),b.set(j,_[g]=N),j in f&&k.set(j,Math.abs(g-f[j]))}const O=new Set,E=new Set;function L(z){ke(z,1),z.m(a,d),s.set(z.key,z),d=z.first,u--}for(;h&&u;){const z=_[u-1],j=n[h-1],N=z.key,I=j.key;z===j?(d=z.first,h--,u--):b.has(I)?!s.has(N)||O.has(N)?L(z):E.has(I)?h--:k.get(N)>k.get(I)?(E.add(N),L(z)):(O.add(I),h--):(l(j,s),h--)}for(;h--;){const z=n[h];b.has(z.key)||l(z,s)}for(;u;)L(_[u-1]);return Be(v),_}function Tr(n,t){const e={},r={},i={$$scope:1};let o=n.length;for(;o--;){const s=n[o],a=t[o];if(a){for(const l in s)l in a||(r[l]=1);for(const l in a)i[l]||(e[l]=a[l],i[l]=1);n[o]=a}else for(const l in s)i[l]=1}for(const s in r)s in e||(e[s]=void 0);return e}function Ar(n){return typeof n=="object"&&n!==null?n:{}}function Ro(n,t,e){const r=n.$$.props[t];r!==void 0&&(n.$$.bound[r]=e,e(n.$$.ctx[r]))}function He(n){n&&n.c()}function je(n,t,e){const{fragment:r,after_update:i}=n.$$;r&&r.m(t,e),qn(()=>{const o=n.$$.on_mount.map(Bi).filter(Vn);n.$$.on_destroy?n.$$.on_destroy.push(...o):Be(o),n.$$.on_mount=[]}),i.forEach(qn)}function xe(n,t){const e=n.$$;e.fragment!==null&&(zo(e.after_update),Be(e.on_destroy),e.fragment&&e.fragment.d(t),e.on_destroy=e.fragment=null,e.ctx=[])}function Do(n,t){n.$$.dirty[0]===-1&&(Mt.push(n),Wi(),n.$$.dirty.fill(0)),n.$$.dirty[t/31|0]|=1<<t%31}function et(n,t,e,r,i,o,s=null,a=[-1]){const l=Kt;Xt(n);const c=n.$$={fragment:null,ctx:[],props:o,update:be,not_equal:i,bound:vr(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(l?l.$$.context:[])),callbacks:vr(),dirty:a,skip_bound:!1,root:t.target||l.$$.root};s&&s(c.root);let d=!1;if(c.ctx=e?e(n,t.props||{},(p,h,...u)=>{const g=u.length?u[0]:h;return c.ctx&&i(c.ctx[p],c.ctx[p]=g)&&(!c.skip_bound&&c.bound[p]&&c.bound[p](g),d&&Do(n,p)),h}):[],c.update(),d=!0,Be(c.before_update),c.fragment=r?r(c.ctx):!1,t.target){if(t.hydrate){const p=To(t.target);c.fragment&&c.fragment.l(p),p.forEach(G)}else c.fragment&&c.fragment.c();t.intro&&ke(n.$$.fragment),je(n,t.target,t.anchor),Hi()}Xt(l)}class tt{constructor(){zn(this,"$$");zn(this,"$$set")}$destroy(){xe(this,1),this.$destroy=be}$on(t,e){if(!Vn(e))return be;const r=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return r.push(e),()=>{const i=r.indexOf(e);i!==-1&&r.splice(i,1)}}$set(t){this.$$set&&!ko(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const Lo="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Lo);const No='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';function wn(n,t={}){const e=document.activeElement;function r(){return Array.from(n.querySelectorAll(No))}function i(s){var d;if(s.key==="Escape"){(d=t.onEscape)==null||d.call(t);return}if(s.key!=="Tab")return;const a=r();if(a.length===0)return;const l=a[0],c=a[a.length-1];s.shiftKey&&document.activeElement===l?(s.preventDefault(),c.focus()):!s.shiftKey&&document.activeElement===c&&(s.preventDefault(),l.focus())}return(r()[0]??n).focus(),n.addEventListener("keydown",i),{update(s){t=s},destroy(){n.removeEventListener("keydown",i),e==null||e.focus()}}}async function Kn(){try{const t=await(await fetch("/snapshots/all")).json();return t.ok&&t.workspaces?{ok:!0,workspaces:t.workspaces}:{ok:!1,error:t.error??"Failed to load snapshots"}}catch{return{ok:!1,error:"Network error loading snapshots"}}}function Cr(n){try{return new Date(n).toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return n}}function Po(n){let t,e=(n[0]??"—")+"",r,i,o,s,a,l,c,d=Cr(n[2])+"",p;return{c(){t=Z("span"),r=ee(e),i=ae(),o=Z("span"),s=Z("span"),a=ee(n[1]),l=ae(),c=Z("span"),p=ee(d),A(t,"class","snapshot-title svelte-14g4p14"),A(s,"class","type-badge svelte-14g4p14"),A(c,"class","snapshot-time svelte-14g4p14"),A(o,"class","snapshot-meta svelte-14g4p14")},m(h,u){V(h,t,u),R(t,r),V(h,i,u),V(h,o,u),R(o,s),R(s,a),R(o,l),R(o,c),R(c,p)},p(h,[u]){u&1&&e!==(e=(h[0]??"—")+"")&&ye(r,e),u&2&&ye(a,h[1]),u&4&&d!==(d=Cr(h[2])+"")&&ye(p,d)},i:be,o:be,d(h){h&&(G(t),G(i),G(o))}}}function Fo(n,t,e){let{title:r}=t,{type:i}=t,{timestamp:o}=t;return n.$$set=s=>{"title"in s&&e(0,r=s.title),"type"in s&&e(1,i=s.type),"timestamp"in s&&e(2,o=s.timestamp)},[r,i,o]}class Zi extends tt{constructor(t){super(),et(this,t,Fo,Po,Xe,{title:0,type:1,timestamp:2})}}function Or(n,t,e){const r=n.slice();return r[13]=t[e],r}function Ir(n,t,e){const r=n.slice();return r[16]=t[e],r}function zr(n){let t,e,r,i,o,s,a,l,c,d,p,h,u,g,f,_,b,k,v;function O(I,U){return I[4]?Bo:Mo}let E=O(n),L=E(n);const z=[Wo,xo,jo,Uo],j=[];function N(I,U){return I[2]?0:I[3]?1:I[5]?3:2}return f=N(n),_=j[f]=z[f](n),{c(){t=Z("div"),e=Z("div"),r=Z("span"),r.textContent="History",i=ae(),o=Z("div"),s=Z("button"),L.c(),c=ae(),d=Z("div"),p=ae(),h=Z("button"),h.textContent="✕",u=ae(),g=Z("div"),_.c(),A(r,"class","panel-title svelte-r3bne1"),A(s,"class","action-btn svelte-r3bne1"),A(s,"aria-label",a=n[4]?"Unlock history panel (stays open)":"Lock history panel (stays open)"),A(s,"aria-pressed",n[4]),A(s,"title",l=n[4]?"Locked — panel stays open after load":"Unlocked — panel closes after load"),Le(s,"locked",n[4]),A(d,"class","header-sep svelte-r3bne1"),A(d,"aria-hidden","true"),A(h,"class","close-btn svelte-r3bne1"),A(h,"aria-label","Close history panel"),A(o,"class","header-actions svelte-r3bne1"),A(e,"class","panel-header svelte-r3bne1"),A(g,"class","panel-body svelte-r3bne1"),A(t,"class","history-panel svelte-r3bne1"),A(t,"role","dialog"),A(t,"aria-modal","true"),A(t,"aria-label","Snapshot history"),A(t,"tabindex","-1")},m(I,U){V(I,t,U),R(t,e),R(e,r),R(e,i),R(e,o),R(o,s),L.m(s,null),R(o,c),R(o,d),R(o,p),R(o,h),R(t,u),R(t,g),j[f].m(g,null),b=!0,k||(v=[ge(s,"click",n[9]),ge(h,"click",n[10]),gn(wn.call(null,t,{onEscape:n[12]}))],k=!0)},p(I,U){E!==(E=O(I))&&(L.d(1),L=E(I),L&&(L.c(),L.m(s,null))),(!b||U&16&&a!==(a=I[4]?"Unlock history panel (stays open)":"Lock history panel (stays open)"))&&A(s,"aria-label",a),(!b||U&16)&&A(s,"aria-pressed",I[4]),(!b||U&16&&l!==(l=I[4]?"Locked — panel stays open after load":"Unlocked — panel closes after load"))&&A(s,"title",l),(!b||U&16)&&Le(s,"locked",I[4]);let C=f;f=N(I),f===C?j[f].p(I,U):(it(),Ee(j[C],1,1,()=>{j[C]=null}),ot(),_=j[f],_?_.p(I,U):(_=j[f]=z[f](I),_.c()),ke(_,1),_.m(g,null))},i(I){b||(ke(_),b=!0)},o(I){Ee(_),b=!1},d(I){I&&G(t),L.d(),j[f].d(),k=!1,Be(v)}}}function Mo(n){let t,e,r;return{c(){t=ft("svg"),e=ft("rect"),r=ft("path"),A(e,"x","3"),A(e,"y","11"),A(e,"width","18"),A(e,"height","11"),A(e,"rx","2"),A(r,"d","M7 11V7a5 5 0 0 1 9.9-1"),A(t,"width","13"),A(t,"height","13"),A(t,"viewBox","0 0 24 24"),A(t,"fill","none"),A(t,"stroke","currentColor"),A(t,"stroke-width","2.5"),A(t,"stroke-linecap","round"),A(t,"stroke-linejoin","round"),A(t,"aria-hidden","true")},m(i,o){V(i,t,o),R(t,e),R(t,r)},d(i){i&&G(t)}}}function Bo(n){let t,e,r;return{c(){t=ft("svg"),e=ft("rect"),r=ft("path"),A(e,"x","3"),A(e,"y","11"),A(e,"width","18"),A(e,"height","11"),A(e,"rx","2"),A(r,"d","M7 11V7a5 5 0 0 1 10 0v4"),A(t,"width","13"),A(t,"height","13"),A(t,"viewBox","0 0 24 24"),A(t,"fill","none"),A(t,"stroke","currentColor"),A(t,"stroke-width","2.5"),A(t,"stroke-linecap","round"),A(t,"stroke-linejoin","round"),A(t,"aria-hidden","true")},m(i,o){V(i,t,o),R(t,e),R(t,r)},d(i){i&&G(t)}}}function Uo(n){let t=[],e=new Map,r,i,o=qe(n[1]);const s=a=>a[13].name;for(let a=0;a<o.length;a+=1){let l=Or(n,o,a),c=s(l);e.set(c,t[a]=Lr(c,l))}return{c(){for(let a=0;a<t.length;a+=1)t[a].c();r=lt()},m(a,l){for(let c=0;c<t.length;c+=1)t[c]&&t[c].m(a,l);V(a,r,l),i=!0},p(a,l){l&130&&(o=qe(a[1]),it(),t=Tt(t,l,s,1,a,o,e,r.parentNode,Xn,Lr,r,Or),ot())},i(a){if(!i){for(let l=0;l<o.length;l+=1)ke(t[l]);i=!0}},o(a){for(let l=0;l<t.length;l+=1)Ee(t[l]);i=!1},d(a){a&&G(r);for(let l=0;l<t.length;l+=1)t[l].d(a)}}}function jo(n){let t;return{c(){t=Z("p"),t.textContent="No snapshots yet.",A(t,"class","panel-message svelte-r3bne1")},m(e,r){V(e,t,r)},p:be,i:be,o:be,d(e){e&&G(t)}}}function xo(n){let t,e;return{c(){t=Z("p"),e=ee(n[3]),A(t,"class","panel-message panel-error svelte-r3bne1")},m(r,i){V(r,t,i),R(t,e)},p(r,i){i&8&&ye(e,r[3])},i:be,o:be,d(r){r&&G(t)}}}function Wo(n){let t;return{c(){t=Z("p"),t.textContent="Loading…",A(t,"class","panel-message svelte-r3bne1")},m(e,r){V(e,t,r)},p:be,i:be,o:be,d(e){e&&G(t)}}}function Rr(n){let t;return{c(){t=Z("span"),t.textContent="current",A(t,"class","current-badge svelte-r3bne1")},m(e,r){V(e,t,r)},d(e){e&&G(t)}}}function Dr(n,t){let e,r,i,o,s,a,l;i=new Zi({props:{title:t[16].title,type:t[16].type,timestamp:t[16].timestamp}});function c(){return t[11](t[13],t[16])}return{key:n,first:null,c(){e=Z("li"),r=Z("button"),He(i.$$.fragment),o=ae(),A(r,"class","snapshot-row svelte-r3bne1"),A(e,"class","snapshot-item svelte-r3bne1"),this.first=e},m(d,p){V(d,e,p),R(e,r),je(i,r,null),R(e,o),s=!0,a||(l=ge(r,"click",c),a=!0)},p(d,p){t=d;const h={};p&2&&(h.title=t[16].title),p&2&&(h.type=t[16].type),p&2&&(h.timestamp=t[16].timestamp),i.$set(h)},i(d){s||(ke(i.$$.fragment,d),s=!0)},o(d){Ee(i.$$.fragment,d),s=!1},d(d){d&&G(e),xe(i),a=!1,l()}}}function Lr(n,t){let e,r,i,o=t[13].name+"",s,a,l,c,d=[],p=new Map,h,u,g,f=t[13].isCurrent&&Rr(),_=qe(t[13].snapshots);const b=k=>k[13].name+"/"+k[16].filename;for(let k=0;k<_.length;k+=1){let v=Ir(t,_,k),O=b(v);p.set(O,d[k]=Dr(O,v))}return{key:n,first:null,c(){e=Z("details"),r=Z("summary"),i=Z("span"),s=ee(o),a=ae(),f&&f.c(),l=ae(),c=Z("ul");for(let k=0;k<d.length;k+=1)d[k].c();h=ae(),A(i,"class","workspace-name svelte-r3bne1"),A(r,"class","workspace-summary svelte-r3bne1"),A(c,"class","snapshot-list svelte-r3bne1"),A(e,"class","workspace-group svelte-r3bne1"),e.open=u=t[13].isCurrent,this.first=e},m(k,v){V(k,e,v),R(e,r),R(r,i),R(i,s),R(r,a),f&&f.m(r,null),R(e,l),R(e,c);for(let O=0;O<d.length;O+=1)d[O]&&d[O].m(c,null);R(e,h),g=!0},p(k,v){t=k,(!g||v&2)&&o!==(o=t[13].name+"")&&ye(s,o),t[13].isCurrent?f||(f=Rr(),f.c(),f.m(r,null)):f&&(f.d(1),f=null),v&130&&(_=qe(t[13].snapshots),it(),d=Tt(d,v,b,1,t,_,p,c,Xn,Dr,null,Ir),ot()),(!g||v&2&&u!==(u=t[13].isCurrent))&&(e.open=u)},i(k){if(!g){for(let v=0;v<_.length;v+=1)ke(d[v]);g=!0}},o(k){for(let v=0;v<d.length;v+=1)Ee(d[v]);g=!1},d(k){k&&G(e),f&&f.d();for(let v=0;v<d.length;v+=1)d[v].d()}}}function Ho(n){let t,e,r=n[0]&&zr(n);return{c(){r&&r.c(),t=lt()},m(i,o){r&&r.m(i,o),V(i,t,o),e=!0},p(i,[o]){i[0]?r?(r.p(i,o),o&1&&ke(r,1)):(r=zr(i),r.c(),ke(r,1),r.m(t.parentNode,t)):r&&(it(),Ee(r,1,1,()=>{r=null}),ot())},i(i){e||(ke(r),e=!0)},o(i){Ee(r),e=!1},d(i){i&&G(t),r&&r.d(i)}}}function Zo(n,t,e){let r,{open:i=!1}=t,o=[],s=!1,a="",l=!1;const c=$t();async function d(){e(2,s=!0),e(3,a="");const _=await Kn();_.ok?e(1,o=_.workspaces):e(3,a=_.error),e(2,s=!1)}async function p(_,b){try{await fetch("/snapshots/load",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspace:_,filename:b})})}catch(k){console.error("[agent-whiteboard] failed to load snapshot:",k)}l||c("close")}const h=()=>{e(4,l=!l)},u=()=>c("close"),g=(_,b)=>p(_.name,b.filename),f=()=>c("close");return n.$$set=_=>{"open"in _&&e(0,i=_.open)},n.$$.update=()=>{n.$$.dirty&1&&(i||e(4,l=!1)),n.$$.dirty&1&&i&&d(),n.$$.dirty&2&&e(5,r=o.some(_=>_.snapshots.length>0))},[i,o,s,a,l,r,c,p,d,h,u,g,f]}class qo extends tt{constructor(t){super(),et(this,t,Zo,Ho,Xe,{open:0,fetchSnapshots:8})}get fetchSnapshots(){return this.$$.ctx[8]}}async function qi(n){const e=(n.headers.get("Content-Disposition")??"").match(/filename="([^"]+)"/),r=(e==null?void 0:e[1])??"export.html",i=await n.blob(),o=URL.createObjectURL(i),s=document.createElement("a");s.href=o,s.download=r,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(o)}async function Go(n){const e=await(await fetch("/snapshots/delete-workspace",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspace:n})})).json();if(!e.ok)throw new Error(e.error??"Delete failed")}async function Yo(n,t){const r=await(await fetch("/snapshots/delete-files",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspace:n,filenames:t})})).json();if(!r.ok)throw new Error(r.error??"Delete failed")}async function Nr(n){const t=await fetch("/export-html",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({items:n})});if(!t.ok){let e="Export failed";try{e=(await t.json()).error??e}catch{}throw new Error(e)}await qi(t)}async function Pr(n){const t=await fetch("/export-zip",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({items:n})});if(!t.ok){let e="Export failed";try{e=(await t.json()).error??e}catch{}throw new Error(e)}await qi(t)}const{Map:Gi}=vo;function Fr(n,t,e){const r=n.slice();return r[37]=t[e],r}function Mr(n,t,e){const r=n.slice();return r[34]=t[e],r}function Br(n){let t,e,r,i,o,s,a,l,c,d,p,h,u,g,f,_,b,k=n[13]&&Ur(n);function v(I,U){if(I[4]===1)return Xo;if(I[5])return Vo}let O=v(n),E=O&&O(n);const L=[$o,Qo,Jo,Ko],z=[];function j(I,U){return I[3]?0:I[12]?1:I[4]===1?2:I[5]?3:-1}~(d=j(n))&&(p=z[d]=L[d](n));let N=n[4]===2&&!n[12]&&Zr(n);return{c(){t=Z("div"),e=Z("div"),r=Z("div"),k&&k.c(),i=ae(),o=Z("span"),E&&E.c(),s=ae(),a=Z("button"),a.textContent="✕",l=ae(),c=Z("div"),p&&p.c(),h=ae(),N&&N.c(),A(o,"class","modal-title svelte-105gz4t"),A(a,"class","modal-close-btn svelte-105gz4t"),A(a,"aria-label","Close"),A(r,"class","modal-header svelte-105gz4t"),A(c,"class","modal-body svelte-105gz4t"),A(e,"class",u="modal mode-"+n[0]+" svelte-105gz4t"),A(e,"role","dialog"),A(e,"aria-modal","true"),A(e,"aria-label",g=n[14]+" snapshots"),A(e,"tabindex","-1"),A(t,"class","modal-overlay svelte-105gz4t")},m(I,U){V(I,t,U),R(t,e),R(e,r),k&&k.m(r,null),R(r,i),R(r,o),E&&E.m(o,null),R(r,s),R(r,a),R(e,l),R(e,c),~d&&z[d].m(c,null),R(e,h),N&&N.m(e,null),f=!0,_||(b=[ge(a,"click",n[17]),gn(wn.call(null,e,{onEscape:n[17]})),ge(t,"click",ji(n[17]))],_=!0)},p(I,U){I[13]?k?k.p(I,U):(k=Ur(I),k.c(),k.m(r,i)):k&&(k.d(1),k=null),O===(O=v(I))&&E?E.p(I,U):(E&&E.d(1),E=O&&O(I),E&&(E.c(),E.m(o,null)));let C=d;d=j(I),d===C?~d&&z[d].p(I,U):(p&&(it(),Ee(z[C],1,1,()=>{z[C]=null}),ot()),~d?(p=z[d],p?p.p(I,U):(p=z[d]=L[d](I),p.c()),ke(p,1),p.m(c,null)):p=null),I[4]===2&&!I[12]?N?N.p(I,U):(N=Zr(I),N.c(),N.m(e,null)):N&&(N.d(1),N=null),(!f||U[0]&1&&u!==(u="modal mode-"+I[0]+" svelte-105gz4t"))&&A(e,"class",u),(!f||U[0]&16384&&g!==(g=I[14]+" snapshots"))&&A(e,"aria-label",g)},i(I){f||(ke(p),f=!0)},o(I){Ee(p),f=!1},d(I){I&&G(t),k&&k.d(),E&&E.d(),~d&&z[d].d(),N&&N.d(),_=!1,Be(b)}}}function Ur(n){let t,e,r;return{c(){t=Z("button"),t.textContent="←",A(t,"class","modal-back-btn svelte-105gz4t"),A(t,"aria-label","Back")},m(i,o){V(i,t,o),e||(r=ge(t,"click",n[16]),e=!0)},p:be,d(i){i&&G(t),e=!1,r()}}}function Vo(n){let t=n[5].name+"",e;return{c(){e=ee(t)},m(r,i){V(r,e,i)},p(r,i){i[0]&32&&t!==(t=r[5].name+"")&&ye(e,t)},d(r){r&&G(e)}}}function Xo(n){let t,e;return{c(){t=ee(n[14]),e=ee(" — choose a workspace")},m(r,i){V(r,t,i),V(r,e,i)},p(r,i){i[0]&16384&&ye(t,r[14])},d(r){r&&(G(t),G(e))}}}function Ko(n){let t,e,r,i,o,s,a,l,c,d,p,h=[],u=new Gi,g,f,_,b,k,v=n[0]==="export"&&jr(n);function O(I,U){return I[0]==="delete"&&I[7]?ts:es}let E=O(n),L=E(n),z=qe(n[5].snapshots);const j=I=>I[37].filename;for(let I=0;I<z.length;I+=1){let U=Fr(n,z,I),C=j(U);u.set(C,h[I]=xr(C,U))}let N=n[11]&&Wr(n);return{c(){t=Z("p"),e=ee("Step 2 of 2 — "),r=ee(n[0]),i=ee(" the whole workspace, or select individual snapshots below."),o=ae(),v&&v.c(),s=ae(),a=Z("button"),L.c(),l=ae(),c=Z("div"),c.textContent="or select individual snapshots",d=ae(),p=Z("ul");for(let I=0;I<h.length;I+=1)h[I].c();g=ae(),N&&N.c(),f=lt(),A(t,"class","modal-step-hint svelte-105gz4t"),A(a,"class","whole-workspace-action svelte-105gz4t"),a.disabled=n[10],A(c,"class","modal-divider svelte-105gz4t"),A(p,"class","modal-snapshot-list svelte-105gz4t")},m(I,U){V(I,t,U),R(t,e),R(t,r),R(t,i),V(I,o,U),v&&v.m(I,U),V(I,s,U),V(I,a,U),L.m(a,null),V(I,l,U),V(I,c,U),V(I,d,U),V(I,p,U);for(let C=0;C<h.length;C+=1)h[C]&&h[C].m(p,null);V(I,g,U),N&&N.m(I,U),V(I,f,U),_=!0,b||(k=ge(a,"click",n[19]),b=!0)},p(I,U){(!_||U[0]&1)&&ye(r,I[0]),I[0]==="export"?v?v.p(I,U):(v=jr(I),v.c(),v.m(s.parentNode,s)):v&&(v.d(1),v=null),E===(E=O(I))&&L?L.p(I,U):(L.d(1),L=E(I),L&&(L.c(),L.m(a,null))),(!_||U[0]&1024)&&(a.disabled=I[10]),U[0]&262240&&(z=qe(I[5].snapshots),it(),h=Tt(h,U,j,1,I,z,u,p,Xn,xr,null,Fr),ot()),I[11]?N?N.p(I,U):(N=Wr(I),N.c(),N.m(f.parentNode,f)):N&&(N.d(1),N=null)},i(I){if(!_){for(let U=0;U<z.length;U+=1)ke(h[U]);_=!0}},o(I){for(let U=0;U<h.length;U+=1)Ee(h[U]);_=!1},d(I){I&&(G(t),G(o),G(s),G(a),G(l),G(c),G(d),G(p),G(g),G(f)),v&&v.d(I),L.d();for(let U=0;U<h.length;U+=1)h[U].d();N&&N.d(I),b=!1,k()}}}function Jo(n){let t,e,r,i,o,s=[],a=new Gi,l,c=qe(n[2]);const d=p=>p[34].name;for(let p=0;p<c.length;p+=1){let h=Mr(n,c,p),u=d(h);a.set(u,s[p]=Hr(u,h))}return{c(){t=Z("p"),e=ee("Step 1 of 2 — pick which workspace's snapshots to "),r=ee(n[0]),i=ee("."),o=ae();for(let p=0;p<s.length;p+=1)s[p].c();l=lt(),A(t,"class","modal-step-hint svelte-105gz4t")},m(p,h){V(p,t,h),R(t,e),R(t,r),R(t,i),V(p,o,h);for(let u=0;u<s.length;u+=1)s[u]&&s[u].m(p,h);V(p,l,h)},p(p,h){h[0]&1&&ye(r,p[0]),h[0]&32772&&(c=qe(p[2]),s=Tt(s,h,d,1,p,c,a,l.parentNode,en,Hr,l,Mr))},i:be,o:be,d(p){p&&(G(t),G(o),G(l));for(let h=0;h<s.length;h+=1)s[h].d(p)}}}function Qo(n){let t,e,r,i,o;return{c(){t=Z("div"),e=Z("span"),e.innerHTML='<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="20 6 9 17 4 12"></polyline></svg>',r=ae(),i=Z("span"),o=ee(n[12]),A(e,"class","check-circle svelte-105gz4t"),A(t,"class","modal-confirm svelte-105gz4t")},m(s,a){V(s,t,a),R(t,e),R(t,r),R(t,i),R(i,o)},p(s,a){a[0]&4096&&ye(o,s[12])},i:be,o:be,d(s){s&&G(t)}}}function $o(n){let t,e,r;return{c(){t=Z("p"),e=ee("Failed to load workspaces: "),r=ee(n[3]),A(t,"class","modal-error svelte-105gz4t")},m(i,o){V(i,t,o),R(t,e),R(t,r)},p(i,o){o[0]&8&&ye(r,i[3])},i:be,o:be,d(i){i&&G(t)}}}function jr(n){let t,e,r,i,o,s,a,l,c,d;return{c(){t=Z("div"),e=Z("button"),r=ee("HTML"),o=ae(),s=Z("button"),a=ee("Zip (for import)"),A(e,"type","button"),A(e,"class","format-toggle-btn svelte-105gz4t"),A(e,"aria-pressed",i=n[9]==="html"),Le(e,"active",n[9]==="html"),A(s,"type","button"),A(s,"class","format-toggle-btn svelte-105gz4t"),A(s,"aria-pressed",l=n[9]==="zip"),Le(s,"active",n[9]==="zip"),A(t,"class","format-toggle svelte-105gz4t"),A(t,"role","group"),A(t,"aria-label","Export format")},m(p,h){V(p,t,h),R(t,e),R(e,r),R(t,o),R(t,s),R(s,a),c||(d=[ge(e,"click",n[23]),ge(s,"click",n[24])],c=!0)},p(p,h){h[0]&512&&i!==(i=p[9]==="html")&&A(e,"aria-pressed",i),h[0]&512&&Le(e,"active",p[9]==="html"),h[0]&512&&l!==(l=p[9]==="zip")&&A(s,"aria-pressed",l),h[0]&512&&Le(s,"active",p[9]==="zip")},d(p){p&&G(t),c=!1,Be(d)}}}function es(n){let t,e,r=n[5].snapshots.length+"",i,o,s=n[5].snapshots.length===1?"":"s",a,l;return{c(){t=ee(n[14]),e=ee(" entire workspace ("),i=ee(r),o=ee(" snapshot"),a=ee(s),l=ee(")")},m(c,d){V(c,t,d),V(c,e,d),V(c,i,d),V(c,o,d),V(c,a,d),V(c,l,d)},p(c,d){d[0]&16384&&ye(t,c[14]),d[0]&32&&r!==(r=c[5].snapshots.length+"")&&ye(i,r),d[0]&32&&s!==(s=c[5].snapshots.length===1?"":"s")&&ye(a,s)},d(c){c&&(G(t),G(e),G(i),G(o),G(a),G(l))}}}function ts(n){let t,e=n[5].name+"",r,i;return{c(){t=ee('Click again to delete "'),r=ee(e),i=ee('"')},m(o,s){V(o,t,s),V(o,r,s),V(o,i,s)},p(o,s){s[0]&32&&e!==(e=o[5].name+"")&&ye(r,e)},d(o){o&&(G(t),G(r),G(i))}}}function xr(n,t){let e,r,i,o,s,a,l,c,d,p,h,u;function g(){return t[25](t[37])}return c=new Zi({props:{title:t[37].title,type:t[37].type,timestamp:t[37].timestamp}}),{key:n,first:null,c(){e=Z("li"),r=Z("label"),i=Z("input"),a=ae(),l=Z("span"),He(c.$$.fragment),d=ae(),A(i,"type","checkbox"),i.checked=o=t[6].has(t[37].filename),A(i,"aria-label",s="Select snapshot "+(t[37].title??t[37].filename)),A(l,"class","modal-snapshot-row svelte-105gz4t"),A(r,"class","svelte-105gz4t"),A(e,"class","modal-snapshot-item svelte-105gz4t"),Le(e,"selected",t[6].has(t[37].filename)),this.first=e},m(f,_){V(f,e,_),R(e,r),R(r,i),R(r,a),R(r,l),je(c,l,null),R(e,d),p=!0,h||(u=ge(i,"change",g),h=!0)},p(f,_){t=f,(!p||_[0]&96&&o!==(o=t[6].has(t[37].filename)))&&(i.checked=o),(!p||_[0]&32&&s!==(s="Select snapshot "+(t[37].title??t[37].filename)))&&A(i,"aria-label",s);const b={};_[0]&32&&(b.title=t[37].title),_[0]&32&&(b.type=t[37].type),_[0]&32&&(b.timestamp=t[37].timestamp),c.$set(b),(!p||_[0]&96)&&Le(e,"selected",t[6].has(t[37].filename))},i(f){p||(ke(c.$$.fragment,f),p=!0)},o(f){Ee(c.$$.fragment,f),p=!1},d(f){f&&G(e),xe(c),h=!1,u()}}}function Wr(n){let t,e;return{c(){t=Z("p"),e=ee(n[11]),A(t,"class","modal-error svelte-105gz4t")},m(r,i){V(r,t,i),R(t,e)},p(r,i){i[0]&2048&&ye(e,r[11])},d(r){r&&G(t)}}}function Hr(n,t){let e,r,i=t[34].name+"",o,s=t[34].isCurrent?" (current)":"",a,l,c,d=t[34].snapshots.length+"",p,h,u=t[34].snapshots.length===1?"":"s",g,f,_,b,k,v;function O(){return t[22](t[34])}return{key:n,first:null,c(){e=Z("button"),r=Z("span"),o=ee(i),a=ee(s),l=ae(),c=Z("span"),p=ee(d),h=ee(" snapshot"),g=ee(u),f=ae(),_=Z("span"),_.textContent="›",b=ae(),A(r,"class","workspace-pick-name svelte-105gz4t"),A(_,"class","workspace-pick-chevron svelte-105gz4t"),A(c,"class","workspace-pick-meta svelte-105gz4t"),A(e,"class","workspace-pick-row svelte-105gz4t"),this.first=e},m(E,L){V(E,e,L),R(e,r),R(r,o),R(r,a),R(e,l),R(e,c),R(c,p),R(c,h),R(c,g),R(c,f),R(c,_),R(e,b),k||(v=ge(e,"click",O),k=!0)},p(E,L){t=E,L[0]&4&&i!==(i=t[34].name+"")&&ye(o,i),L[0]&4&&s!==(s=t[34].isCurrent?" (current)":"")&&ye(a,s),L[0]&4&&d!==(d=t[34].snapshots.length+"")&&ye(p,d),L[0]&4&&u!==(u=t[34].snapshots.length===1?"":"s")&&ye(g,u)},d(E){E&&G(e),k=!1,v()}}}function Zr(n){let t,e,r=n[6].size+"",i,o,s,a,l,c,d,p=n[0]==="delete"&&n[8]?"Click again to confirm":`${n[14]} selected`,h,u,g,f;return{c(){t=Z("div"),e=Z("span"),i=ee(r),o=ee(" selected"),s=ae(),a=Z("div"),l=Z("button"),l.textContent="Cancel",c=ae(),d=Z("button"),h=ee(p),A(e,"class","modal-select-count svelte-105gz4t"),A(l,"class","modal-cancel-btn svelte-105gz4t"),A(d,"class","modal-selected-action svelte-105gz4t"),d.disabled=u=n[6].size===0||n[10],A(a,"class","modal-footer-actions svelte-105gz4t"),A(t,"class","modal-footer svelte-105gz4t")},m(_,b){V(_,t,b),R(t,e),R(e,i),R(e,o),R(t,s),R(t,a),R(a,l),R(a,c),R(a,d),R(d,h),g||(f=[ge(l,"click",n[17]),ge(d,"click",n[20])],g=!0)},p(_,b){b[0]&64&&r!==(r=_[6].size+"")&&ye(i,r),b[0]&16641&&p!==(p=_[0]==="delete"&&_[8]?"Click again to confirm":`${_[14]} selected`)&&ye(h,p),b[0]&1088&&u!==(u=_[6].size===0||_[10])&&(d.disabled=u)},d(_){_&&G(t),g=!1,Be(f)}}}function ns(n){let t,e,r=n[1]&&Br(n);return{c(){r&&r.c(),t=lt()},m(i,o){r&&r.m(i,o),V(i,t,o),e=!0},p(i,o){i[1]?r?(r.p(i,o),o[0]&2&&ke(r,1)):(r=Br(i),r.c(),ke(r,1),r.m(t.parentNode,t)):r&&(it(),Ee(r,1,1,()=>{r=null}),ot())},i(i){e||(ke(r),e=!0)},o(i){Ee(r),e=!1},d(i){i&&G(t),r&&r.d(i)}}}function rs(n,t,e){let r,i,{mode:o}=t,{open:s=!1}=t,{workspaces:a=[]}=t,{loadError:l=null}=t;const c=$t();let d=1,p=null,h=new Set,u=!1,g=!1,f="html",_=!1,b=null,k=null,v=null,O=null,E=!1;function L(){e(11,b=null),e(12,k=null),e(10,_=!1),e(7,u=!1),e(8,g=!1),e(9,f="html"),e(6,h=new Set);const D=a.length===1?a[0]:a.find(F=>F.isCurrent);D?(e(5,p=D),e(4,d=2)):(e(5,p=null),e(4,d=1))}function z(D){e(5,p=D),e(6,h=new Set),e(7,u=!1),e(8,g=!1),e(11,b=null),e(4,d=2)}function j(){a.length<=1||(e(4,d=1),e(5,p=null),e(6,h=new Set),e(11,b=null))}function N(){c("close")}function I(D){const F=new Set(h);F.has(D)?F.delete(D):F.add(D),e(6,h=F),e(8,g=!1)}function U(D){D==="whole"?e(7,u=!0):e(8,g=!0),v&&clearTimeout(v),v=setTimeout(()=>{e(7,u=!1),e(8,g=!1)},3e3)}function C(D){e(12,k=D),O&&clearTimeout(O),O=setTimeout(()=>c("close"),1200)}async function H(){if(p){e(10,_=!0),e(11,b=null);try{if(o==="delete")await Go(p.name),c("deleted"),C(`Deleted entire workspace "${p.name}"`);else{const D=p.snapshots.filter(F=>F.id!==void 0).map(F=>({workspace:p.name,id:F.id}));if(D.length===0)throw new Error("no exportable snapshots in this workspace");f==="zip"?await Pr(D):await Nr(D),C(`Exported entire workspace "${p.name}"`)}}catch(D){e(11,b=D instanceof Error?D.message:"Request failed")}finally{e(10,_=!1)}}}async function y(){if(!p||h.size===0)return;e(10,_=!0),e(11,b=null);const D=[...h];try{if(o==="delete")await Yo(p.name,D),c("deleted"),C(`Deleted ${D.length} snapshot${D.length===1?"":"s"} from "${p.name}"`);else{const F=new Map(p.snapshots.map(oe=>[oe.filename,oe.id])),de=D.map(oe=>({workspace:p.name,id:F.get(oe)})).filter(oe=>oe.id!==void 0);if(de.length===0)throw new Error("no exportable snapshots selected");f==="zip"?await Pr(de):await Nr(de),C(`Exported ${D.length} snapshot${D.length===1?"":"s"} from "${p.name}"`)}}catch(F){e(11,b=F instanceof Error?F.message:"Request failed")}finally{e(10,_=!1)}}function q(){if(o==="delete"&&!u){U("whole");return}v&&clearTimeout(v),H()}function fe(){if(h.size!==0){if(o==="delete"&&!g){U("subset");return}v&&clearTimeout(v),y()}}Qt(()=>{v&&clearTimeout(v),O&&clearTimeout(O)});const K=D=>z(D),ie=()=>e(9,f="html"),Y=()=>e(9,f="zip"),se=D=>I(D.filename);return n.$$set=D=>{"mode"in D&&e(0,o=D.mode),"open"in D&&e(1,s=D.open),"workspaces"in D&&e(2,a=D.workspaces),"loadError"in D&&e(3,l=D.loadError)},n.$$.update=()=>{n.$$.dirty[0]&1&&e(14,r=o==="delete"?"Delete":"Export"),n.$$.dirty[0]&2097154&&(s&&!E&&L(),e(21,E=s)),n.$$.dirty[0]&20&&e(13,i=d===2&&a.length>1)},[o,s,a,l,d,p,h,u,g,f,_,b,k,i,r,z,j,N,I,q,fe,E,K,ie,Y,se]}class is extends tt{constructor(t){super(),et(this,t,rs,ns,Xe,{mode:0,open:1,workspaces:2,loadError:3},null,[-1,-1])}}var dn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function os(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function hn(n){throw new Error('Could not dynamically require "'+n+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Yi={exports:{}};/*!
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mermaid.core-DKnSsFxv.js","assets/step-BEQzeS8V.js","assets/embed-DcNeILcO.js","assets/linear-D1EL1Azg.js","assets/init-Dmth1JHB.js","assets/defaultLocale-CzDG__Ur.js","assets/time-BaoZouO5.js","assets/range-OtVwhkKS.js","assets/ordinal-BeghXfj9.js","assets/colors-Cc3OSVma.js","assets/arc-Aq92EeUK.js","assets/index-Bi7T_FA4.js"])))=>i.map(i=>d[i]);
2
+ var ko=Object.defineProperty;var vo=(n,t,e)=>t in n?ko(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var zn=(n,t,e)=>vo(n,typeof t!="symbol"?t+"":t,e);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function e(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=e(i);fetch(i.href,o)}})();function be(){}function kr(n,t){for(const e in t)n[e]=t[e];return n}function Bi(n){return n()}function vr(){return Object.create(null)}function Be(n){n.forEach(Bi)}function Vn(n){return typeof n=="function"}function Xe(n,t){return n!=n?t==t:n!==t||n&&typeof n=="object"||typeof n=="function"}function Eo(n){return Object.keys(n).length===0}function Ui(n,...t){if(n==null){for(const r of t)r(void 0);return be}const e=n.subscribe(...t);return e.unsubscribe?()=>e.unsubscribe():e}function mt(n){let t;return Ui(n,e=>t=e)(),t}function _t(n,t,e){n.$$.on_destroy.push(Ui(t,e))}function gn(n){return n&&Vn(n.destroy)?n.destroy:be}const ji=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function R(n,t){n.appendChild(t)}function V(n,t,e){n.insertBefore(t,e||null)}function G(n){n.parentNode&&n.parentNode.removeChild(n)}function Z(n){return document.createElement(n)}function ft(n){return document.createElementNS("http://www.w3.org/2000/svg",n)}function ee(n){return document.createTextNode(n)}function ae(){return ee(" ")}function lt(){return ee("")}function ge(n,t,e,r){return n.addEventListener(t,e,r),()=>n.removeEventListener(t,e,r)}function So(n){return function(t){return t.preventDefault(),n.call(this,t)}}function To(n){return function(t){return t.stopPropagation(),n.call(this,t)}}function xi(n){return function(t){t.target===this&&n.call(this,t)}}function A(n,t,e){e==null?n.removeAttribute(t):n.getAttribute(t)!==e&&n.setAttribute(t,e)}function Ao(n){return Array.from(n.childNodes)}function ye(n,t){t=""+t,n.data!==t&&(n.data=t)}function Er(n,t){n.value=t??""}function gt(n,t,e,r){e==null?n.style.removeProperty(t):n.style.setProperty(t,e,"")}function Le(n,t,e){n.classList.toggle(t,!!e)}function Co(n,t,{bubbles:e=!1,cancelable:r=!1}={}){return new CustomEvent(n,{detail:t,bubbles:e,cancelable:r})}function Sr(n,t){return new n(t)}let Kt;function Xt(n){Kt=n}function bn(){if(!Kt)throw new Error("Function called outside component initialization");return Kt}function Jt(n){bn().$$.on_mount.push(n)}function yn(n){bn().$$.after_update.push(n)}function Qt(n){bn().$$.on_destroy.push(n)}function $t(){const n=bn();return(t,e,{cancelable:r=!1}={})=>{const i=n.$$.callbacks[t];if(i){const o=Co(t,e,{cancelable:r});return i.slice().forEach(s=>{s.call(n,o)}),!o.defaultPrevented}return!0}}const Mt=[],Ve=[];let Ut=[];const Hn=[],Wi=Promise.resolve();let Zn=!1;function Hi(){Zn||(Zn=!0,Wi.then(Zi))}function Oo(){return Hi(),Wi}function qn(n){Ut.push(n)}function Io(n){Hn.push(n)}const Rn=new Set;let Nt=0;function Zi(){if(Nt!==0)return;const n=Kt;do{try{for(;Nt<Mt.length;){const t=Mt[Nt];Nt++,Xt(t),zo(t.$$)}}catch(t){throw Mt.length=0,Nt=0,t}for(Xt(null),Mt.length=0,Nt=0;Ve.length;)Ve.pop()();for(let t=0;t<Ut.length;t+=1){const e=Ut[t];Rn.has(e)||(Rn.add(e),e())}Ut.length=0}while(Mt.length);for(;Hn.length;)Hn.pop()();Zn=!1,Rn.clear(),Xt(n)}function zo(n){if(n.fragment!==null){n.update(),Be(n.before_update);const t=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,t),n.after_update.forEach(qn)}}function Ro(n){const t=[],e=[];Ut.forEach(r=>n.indexOf(r)===-1?t.push(r):e.push(r)),e.forEach(r=>r()),Ut=t}const mn=new Set;let It;function it(){It={r:0,c:[],p:It}}function ot(){It.r||Be(It.c),It=It.p}function ke(n,t){n&&n.i&&(mn.delete(n),n.i(t))}function Ee(n,t,e,r){if(n&&n.o){if(mn.has(n))return;mn.add(n),It.c.push(()=>{mn.delete(n),r&&(e&&n.d(1),r())}),n.o(t)}else r&&r()}function qe(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function en(n,t){n.d(1),t.delete(n.key)}function Xn(n,t){Ee(n,1,1,()=>{t.delete(n.key)})}function Tt(n,t,e,r,i,o,s,a,l,c,d,p){let h=n.length,u=o.length,g=h;const f={};for(;g--;)f[n[g].key]=g;const _=[],b=new Map,k=new Map,v=[];for(g=u;g--;){const z=p(i,o,g),U=e(z);let N=s.get(U);N?v.push(()=>N.p(z,t)):(N=c(U,z),N.c()),b.set(U,_[g]=N),U in f&&k.set(U,Math.abs(g-f[U]))}const O=new Set,E=new Set;function L(z){ke(z,1),z.m(a,d),s.set(z.key,z),d=z.first,u--}for(;h&&u;){const z=_[u-1],U=n[h-1],N=z.key,I=U.key;z===U?(d=z.first,h--,u--):b.has(I)?!s.has(N)||O.has(N)?L(z):E.has(I)?h--:k.get(N)>k.get(I)?(E.add(N),L(z)):(O.add(I),h--):(l(U,s),h--)}for(;h--;){const z=n[h];b.has(z.key)||l(z,s)}for(;u;)L(_[u-1]);return Be(v),_}function Tr(n,t){const e={},r={},i={$$scope:1};let o=n.length;for(;o--;){const s=n[o],a=t[o];if(a){for(const l in s)l in a||(r[l]=1);for(const l in a)i[l]||(e[l]=a[l],i[l]=1);n[o]=a}else for(const l in s)i[l]=1}for(const s in r)s in e||(e[s]=void 0);return e}function Ar(n){return typeof n=="object"&&n!==null?n:{}}function Do(n,t,e){const r=n.$$.props[t];r!==void 0&&(n.$$.bound[r]=e,e(n.$$.ctx[r]))}function He(n){n&&n.c()}function je(n,t,e){const{fragment:r,after_update:i}=n.$$;r&&r.m(t,e),qn(()=>{const o=n.$$.on_mount.map(Bi).filter(Vn);n.$$.on_destroy?n.$$.on_destroy.push(...o):Be(o),n.$$.on_mount=[]}),i.forEach(qn)}function xe(n,t){const e=n.$$;e.fragment!==null&&(Ro(e.after_update),Be(e.on_destroy),e.fragment&&e.fragment.d(t),e.on_destroy=e.fragment=null,e.ctx=[])}function Lo(n,t){n.$$.dirty[0]===-1&&(Mt.push(n),Hi(),n.$$.dirty.fill(0)),n.$$.dirty[t/31|0]|=1<<t%31}function et(n,t,e,r,i,o,s=null,a=[-1]){const l=Kt;Xt(n);const c=n.$$={fragment:null,ctx:[],props:o,update:be,not_equal:i,bound:vr(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(l?l.$$.context:[])),callbacks:vr(),dirty:a,skip_bound:!1,root:t.target||l.$$.root};s&&s(c.root);let d=!1;if(c.ctx=e?e(n,t.props||{},(p,h,...u)=>{const g=u.length?u[0]:h;return c.ctx&&i(c.ctx[p],c.ctx[p]=g)&&(!c.skip_bound&&c.bound[p]&&c.bound[p](g),d&&Lo(n,p)),h}):[],c.update(),d=!0,Be(c.before_update),c.fragment=r?r(c.ctx):!1,t.target){if(t.hydrate){const p=Ao(t.target);c.fragment&&c.fragment.l(p),p.forEach(G)}else c.fragment&&c.fragment.c();t.intro&&ke(n.$$.fragment),je(n,t.target,t.anchor),Zi()}Xt(l)}class tt{constructor(){zn(this,"$$");zn(this,"$$set")}$destroy(){xe(this,1),this.$destroy=be}$on(t,e){if(!Vn(e))return be;const r=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return r.push(e),()=>{const i=r.indexOf(e);i!==-1&&r.splice(i,1)}}$set(t){this.$$set&&!Eo(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const No="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(No);const Po='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';function wn(n,t={}){const e=document.activeElement;function r(){return Array.from(n.querySelectorAll(Po))}function i(s){var d;if(s.key==="Escape"){(d=t.onEscape)==null||d.call(t);return}if(s.key!=="Tab")return;const a=r();if(a.length===0)return;const l=a[0],c=a[a.length-1];s.shiftKey&&document.activeElement===l?(s.preventDefault(),c.focus()):!s.shiftKey&&document.activeElement===c&&(s.preventDefault(),l.focus())}return(r()[0]??n).focus(),n.addEventListener("keydown",i),{update(s){t=s},destroy(){n.removeEventListener("keydown",i),e==null||e.focus()}}}async function Kn(){try{const t=await(await fetch("/snapshots/all")).json();return t.ok&&t.workspaces?{ok:!0,workspaces:t.workspaces}:{ok:!1,error:t.error??"Failed to load snapshots"}}catch{return{ok:!1,error:"Network error loading snapshots"}}}function Cr(n){try{return new Date(n).toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return n}}function Fo(n){let t,e=(n[0]??"—")+"",r,i,o,s,a,l,c,d=Cr(n[2])+"",p;return{c(){t=Z("span"),r=ee(e),i=ae(),o=Z("span"),s=Z("span"),a=ee(n[1]),l=ae(),c=Z("span"),p=ee(d),A(t,"class","snapshot-title svelte-14g4p14"),A(s,"class","type-badge svelte-14g4p14"),A(c,"class","snapshot-time svelte-14g4p14"),A(o,"class","snapshot-meta svelte-14g4p14")},m(h,u){V(h,t,u),R(t,r),V(h,i,u),V(h,o,u),R(o,s),R(s,a),R(o,l),R(o,c),R(c,p)},p(h,[u]){u&1&&e!==(e=(h[0]??"—")+"")&&ye(r,e),u&2&&ye(a,h[1]),u&4&&d!==(d=Cr(h[2])+"")&&ye(p,d)},i:be,o:be,d(h){h&&(G(t),G(i),G(o))}}}function Mo(n,t,e){let{title:r}=t,{type:i}=t,{timestamp:o}=t;return n.$$set=s=>{"title"in s&&e(0,r=s.title),"type"in s&&e(1,i=s.type),"timestamp"in s&&e(2,o=s.timestamp)},[r,i,o]}class qi extends tt{constructor(t){super(),et(this,t,Mo,Fo,Xe,{title:0,type:1,timestamp:2})}}function Or(n,t,e){const r=n.slice();return r[13]=t[e],r}function Ir(n,t,e){const r=n.slice();return r[16]=t[e],r}function zr(n){let t,e,r,i,o,s,a,l,c,d,p,h,u,g,f,_,b,k,v;function O(I,j){return I[4]?Uo:Bo}let E=O(n),L=E(n);const z=[Ho,Wo,xo,jo],U=[];function N(I,j){return I[2]?0:I[3]?1:I[5]?3:2}return f=N(n),_=U[f]=z[f](n),{c(){t=Z("div"),e=Z("div"),r=Z("span"),r.textContent="History",i=ae(),o=Z("div"),s=Z("button"),L.c(),c=ae(),d=Z("div"),p=ae(),h=Z("button"),h.textContent="✕",u=ae(),g=Z("div"),_.c(),A(r,"class","panel-title svelte-r3bne1"),A(s,"class","action-btn svelte-r3bne1"),A(s,"aria-label",a=n[4]?"Unlock history panel (stays open)":"Lock history panel (stays open)"),A(s,"aria-pressed",n[4]),A(s,"title",l=n[4]?"Locked — panel stays open after load":"Unlocked — panel closes after load"),Le(s,"locked",n[4]),A(d,"class","header-sep svelte-r3bne1"),A(d,"aria-hidden","true"),A(h,"class","close-btn svelte-r3bne1"),A(h,"aria-label","Close history panel"),A(o,"class","header-actions svelte-r3bne1"),A(e,"class","panel-header svelte-r3bne1"),A(g,"class","panel-body svelte-r3bne1"),A(t,"class","history-panel svelte-r3bne1"),A(t,"role","dialog"),A(t,"aria-modal","true"),A(t,"aria-label","Snapshot history"),A(t,"tabindex","-1")},m(I,j){V(I,t,j),R(t,e),R(e,r),R(e,i),R(e,o),R(o,s),L.m(s,null),R(o,c),R(o,d),R(o,p),R(o,h),R(t,u),R(t,g),U[f].m(g,null),b=!0,k||(v=[ge(s,"click",n[9]),ge(h,"click",n[10]),gn(wn.call(null,t,{onEscape:n[12]}))],k=!0)},p(I,j){E!==(E=O(I))&&(L.d(1),L=E(I),L&&(L.c(),L.m(s,null))),(!b||j&16&&a!==(a=I[4]?"Unlock history panel (stays open)":"Lock history panel (stays open)"))&&A(s,"aria-label",a),(!b||j&16)&&A(s,"aria-pressed",I[4]),(!b||j&16&&l!==(l=I[4]?"Locked — panel stays open after load":"Unlocked — panel closes after load"))&&A(s,"title",l),(!b||j&16)&&Le(s,"locked",I[4]);let C=f;f=N(I),f===C?U[f].p(I,j):(it(),Ee(U[C],1,1,()=>{U[C]=null}),ot(),_=U[f],_?_.p(I,j):(_=U[f]=z[f](I),_.c()),ke(_,1),_.m(g,null))},i(I){b||(ke(_),b=!0)},o(I){Ee(_),b=!1},d(I){I&&G(t),L.d(),U[f].d(),k=!1,Be(v)}}}function Bo(n){let t,e,r;return{c(){t=ft("svg"),e=ft("rect"),r=ft("path"),A(e,"x","3"),A(e,"y","11"),A(e,"width","18"),A(e,"height","11"),A(e,"rx","2"),A(r,"d","M7 11V7a5 5 0 0 1 9.9-1"),A(t,"width","13"),A(t,"height","13"),A(t,"viewBox","0 0 24 24"),A(t,"fill","none"),A(t,"stroke","currentColor"),A(t,"stroke-width","2.5"),A(t,"stroke-linecap","round"),A(t,"stroke-linejoin","round"),A(t,"aria-hidden","true")},m(i,o){V(i,t,o),R(t,e),R(t,r)},d(i){i&&G(t)}}}function Uo(n){let t,e,r;return{c(){t=ft("svg"),e=ft("rect"),r=ft("path"),A(e,"x","3"),A(e,"y","11"),A(e,"width","18"),A(e,"height","11"),A(e,"rx","2"),A(r,"d","M7 11V7a5 5 0 0 1 10 0v4"),A(t,"width","13"),A(t,"height","13"),A(t,"viewBox","0 0 24 24"),A(t,"fill","none"),A(t,"stroke","currentColor"),A(t,"stroke-width","2.5"),A(t,"stroke-linecap","round"),A(t,"stroke-linejoin","round"),A(t,"aria-hidden","true")},m(i,o){V(i,t,o),R(t,e),R(t,r)},d(i){i&&G(t)}}}function jo(n){let t=[],e=new Map,r,i,o=qe(n[1]);const s=a=>a[13].name;for(let a=0;a<o.length;a+=1){let l=Or(n,o,a),c=s(l);e.set(c,t[a]=Lr(c,l))}return{c(){for(let a=0;a<t.length;a+=1)t[a].c();r=lt()},m(a,l){for(let c=0;c<t.length;c+=1)t[c]&&t[c].m(a,l);V(a,r,l),i=!0},p(a,l){l&130&&(o=qe(a[1]),it(),t=Tt(t,l,s,1,a,o,e,r.parentNode,Xn,Lr,r,Or),ot())},i(a){if(!i){for(let l=0;l<o.length;l+=1)ke(t[l]);i=!0}},o(a){for(let l=0;l<t.length;l+=1)Ee(t[l]);i=!1},d(a){a&&G(r);for(let l=0;l<t.length;l+=1)t[l].d(a)}}}function xo(n){let t;return{c(){t=Z("p"),t.textContent="No snapshots yet.",A(t,"class","panel-message svelte-r3bne1")},m(e,r){V(e,t,r)},p:be,i:be,o:be,d(e){e&&G(t)}}}function Wo(n){let t,e;return{c(){t=Z("p"),e=ee(n[3]),A(t,"class","panel-message panel-error svelte-r3bne1")},m(r,i){V(r,t,i),R(t,e)},p(r,i){i&8&&ye(e,r[3])},i:be,o:be,d(r){r&&G(t)}}}function Ho(n){let t;return{c(){t=Z("p"),t.textContent="Loading…",A(t,"class","panel-message svelte-r3bne1")},m(e,r){V(e,t,r)},p:be,i:be,o:be,d(e){e&&G(t)}}}function Rr(n){let t;return{c(){t=Z("span"),t.textContent="current",A(t,"class","current-badge svelte-r3bne1")},m(e,r){V(e,t,r)},d(e){e&&G(t)}}}function Dr(n,t){let e,r,i,o,s,a,l;i=new qi({props:{title:t[16].title,type:t[16].type,timestamp:t[16].timestamp}});function c(){return t[11](t[13],t[16])}return{key:n,first:null,c(){e=Z("li"),r=Z("button"),He(i.$$.fragment),o=ae(),A(r,"class","snapshot-row svelte-r3bne1"),A(e,"class","snapshot-item svelte-r3bne1"),this.first=e},m(d,p){V(d,e,p),R(e,r),je(i,r,null),R(e,o),s=!0,a||(l=ge(r,"click",c),a=!0)},p(d,p){t=d;const h={};p&2&&(h.title=t[16].title),p&2&&(h.type=t[16].type),p&2&&(h.timestamp=t[16].timestamp),i.$set(h)},i(d){s||(ke(i.$$.fragment,d),s=!0)},o(d){Ee(i.$$.fragment,d),s=!1},d(d){d&&G(e),xe(i),a=!1,l()}}}function Lr(n,t){let e,r,i,o=t[13].name+"",s,a,l,c,d=[],p=new Map,h,u,g,f=t[13].isCurrent&&Rr(),_=qe(t[13].snapshots);const b=k=>k[13].name+"/"+k[16].filename;for(let k=0;k<_.length;k+=1){let v=Ir(t,_,k),O=b(v);p.set(O,d[k]=Dr(O,v))}return{key:n,first:null,c(){e=Z("details"),r=Z("summary"),i=Z("span"),s=ee(o),a=ae(),f&&f.c(),l=ae(),c=Z("ul");for(let k=0;k<d.length;k+=1)d[k].c();h=ae(),A(i,"class","workspace-name svelte-r3bne1"),A(r,"class","workspace-summary svelte-r3bne1"),A(c,"class","snapshot-list svelte-r3bne1"),A(e,"class","workspace-group svelte-r3bne1"),e.open=u=t[13].isCurrent,this.first=e},m(k,v){V(k,e,v),R(e,r),R(r,i),R(i,s),R(r,a),f&&f.m(r,null),R(e,l),R(e,c);for(let O=0;O<d.length;O+=1)d[O]&&d[O].m(c,null);R(e,h),g=!0},p(k,v){t=k,(!g||v&2)&&o!==(o=t[13].name+"")&&ye(s,o),t[13].isCurrent?f||(f=Rr(),f.c(),f.m(r,null)):f&&(f.d(1),f=null),v&130&&(_=qe(t[13].snapshots),it(),d=Tt(d,v,b,1,t,_,p,c,Xn,Dr,null,Ir),ot()),(!g||v&2&&u!==(u=t[13].isCurrent))&&(e.open=u)},i(k){if(!g){for(let v=0;v<_.length;v+=1)ke(d[v]);g=!0}},o(k){for(let v=0;v<d.length;v+=1)Ee(d[v]);g=!1},d(k){k&&G(e),f&&f.d();for(let v=0;v<d.length;v+=1)d[v].d()}}}function Zo(n){let t,e,r=n[0]&&zr(n);return{c(){r&&r.c(),t=lt()},m(i,o){r&&r.m(i,o),V(i,t,o),e=!0},p(i,[o]){i[0]?r?(r.p(i,o),o&1&&ke(r,1)):(r=zr(i),r.c(),ke(r,1),r.m(t.parentNode,t)):r&&(it(),Ee(r,1,1,()=>{r=null}),ot())},i(i){e||(ke(r),e=!0)},o(i){Ee(r),e=!1},d(i){i&&G(t),r&&r.d(i)}}}function qo(n,t,e){let r,{open:i=!1}=t,o=[],s=!1,a="",l=!1;const c=$t();async function d(){e(2,s=!0),e(3,a="");const _=await Kn();_.ok?e(1,o=_.workspaces):e(3,a=_.error),e(2,s=!1)}async function p(_,b){try{await fetch("/snapshots/load",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspace:_,filename:b})})}catch(k){console.error("[agent-whiteboard] failed to load snapshot:",k)}l||c("close")}const h=()=>{e(4,l=!l)},u=()=>c("close"),g=(_,b)=>p(_.name,b.filename),f=()=>c("close");return n.$$set=_=>{"open"in _&&e(0,i=_.open)},n.$$.update=()=>{n.$$.dirty&1&&(i||e(4,l=!1)),n.$$.dirty&1&&i&&d(),n.$$.dirty&2&&e(5,r=o.some(_=>_.snapshots.length>0))},[i,o,s,a,l,r,c,p,d,h,u,g,f]}class Go extends tt{constructor(t){super(),et(this,t,qo,Zo,Xe,{open:0,fetchSnapshots:8})}get fetchSnapshots(){return this.$$.ctx[8]}}async function Gi(n){const e=(n.headers.get("Content-Disposition")??"").match(/filename="([^"]+)"/),r=(e==null?void 0:e[1])??"export.html",i=await n.blob(),o=URL.createObjectURL(i),s=document.createElement("a");s.href=o,s.download=r,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(o)}async function Yo(n){const e=await(await fetch("/snapshots/delete-workspace",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspace:n})})).json();if(!e.ok)throw new Error(e.error??"Delete failed")}async function Vo(n,t){const r=await(await fetch("/snapshots/delete-files",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspace:n,filenames:t})})).json();if(!r.ok)throw new Error(r.error??"Delete failed")}async function Nr(n){const t=await fetch("/export-html",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({items:n})});if(!t.ok){let e="Export failed";try{e=(await t.json()).error??e}catch{}throw new Error(e)}await Gi(t)}async function Pr(n){const t=await fetch("/export-zip",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({items:n})});if(!t.ok){let e="Export failed";try{e=(await t.json()).error??e}catch{}throw new Error(e)}await Gi(t)}const{Map:Yi}=ji;function Fr(n,t,e){const r=n.slice();return r[37]=t[e],r}function Mr(n,t,e){const r=n.slice();return r[34]=t[e],r}function Br(n){let t,e,r,i,o,s,a,l,c,d,p,h,u,g,f,_,b,k=n[13]&&Ur(n);function v(I,j){if(I[4]===1)return Ko;if(I[5])return Xo}let O=v(n),E=O&&O(n);const L=[es,$o,Qo,Jo],z=[];function U(I,j){return I[3]?0:I[12]?1:I[4]===1?2:I[5]?3:-1}~(d=U(n))&&(p=z[d]=L[d](n));let N=n[4]===2&&!n[12]&&Zr(n);return{c(){t=Z("div"),e=Z("div"),r=Z("div"),k&&k.c(),i=ae(),o=Z("span"),E&&E.c(),s=ae(),a=Z("button"),a.textContent="✕",l=ae(),c=Z("div"),p&&p.c(),h=ae(),N&&N.c(),A(o,"class","modal-title svelte-105gz4t"),A(a,"class","modal-close-btn svelte-105gz4t"),A(a,"aria-label","Close"),A(r,"class","modal-header svelte-105gz4t"),A(c,"class","modal-body svelte-105gz4t"),A(e,"class",u="modal mode-"+n[0]+" svelte-105gz4t"),A(e,"role","dialog"),A(e,"aria-modal","true"),A(e,"aria-label",g=n[14]+" snapshots"),A(e,"tabindex","-1"),A(t,"class","modal-overlay svelte-105gz4t")},m(I,j){V(I,t,j),R(t,e),R(e,r),k&&k.m(r,null),R(r,i),R(r,o),E&&E.m(o,null),R(r,s),R(r,a),R(e,l),R(e,c),~d&&z[d].m(c,null),R(e,h),N&&N.m(e,null),f=!0,_||(b=[ge(a,"click",n[17]),gn(wn.call(null,e,{onEscape:n[17]})),ge(t,"click",xi(n[17]))],_=!0)},p(I,j){I[13]?k?k.p(I,j):(k=Ur(I),k.c(),k.m(r,i)):k&&(k.d(1),k=null),O===(O=v(I))&&E?E.p(I,j):(E&&E.d(1),E=O&&O(I),E&&(E.c(),E.m(o,null)));let C=d;d=U(I),d===C?~d&&z[d].p(I,j):(p&&(it(),Ee(z[C],1,1,()=>{z[C]=null}),ot()),~d?(p=z[d],p?p.p(I,j):(p=z[d]=L[d](I),p.c()),ke(p,1),p.m(c,null)):p=null),I[4]===2&&!I[12]?N?N.p(I,j):(N=Zr(I),N.c(),N.m(e,null)):N&&(N.d(1),N=null),(!f||j[0]&1&&u!==(u="modal mode-"+I[0]+" svelte-105gz4t"))&&A(e,"class",u),(!f||j[0]&16384&&g!==(g=I[14]+" snapshots"))&&A(e,"aria-label",g)},i(I){f||(ke(p),f=!0)},o(I){Ee(p),f=!1},d(I){I&&G(t),k&&k.d(),E&&E.d(),~d&&z[d].d(),N&&N.d(),_=!1,Be(b)}}}function Ur(n){let t,e,r;return{c(){t=Z("button"),t.textContent="←",A(t,"class","modal-back-btn svelte-105gz4t"),A(t,"aria-label","Back")},m(i,o){V(i,t,o),e||(r=ge(t,"click",n[16]),e=!0)},p:be,d(i){i&&G(t),e=!1,r()}}}function Xo(n){let t=n[5].name+"",e;return{c(){e=ee(t)},m(r,i){V(r,e,i)},p(r,i){i[0]&32&&t!==(t=r[5].name+"")&&ye(e,t)},d(r){r&&G(e)}}}function Ko(n){let t,e;return{c(){t=ee(n[14]),e=ee(" — choose a workspace")},m(r,i){V(r,t,i),V(r,e,i)},p(r,i){i[0]&16384&&ye(t,r[14])},d(r){r&&(G(t),G(e))}}}function Jo(n){let t,e,r,i,o,s,a,l,c,d,p,h=[],u=new Yi,g,f,_,b,k,v=n[0]==="export"&&jr(n);function O(I,j){return I[0]==="delete"&&I[7]?ns:ts}let E=O(n),L=E(n),z=qe(n[5].snapshots);const U=I=>I[37].filename;for(let I=0;I<z.length;I+=1){let j=Fr(n,z,I),C=U(j);u.set(C,h[I]=xr(C,j))}let N=n[11]&&Wr(n);return{c(){t=Z("p"),e=ee("Step 2 of 2 — "),r=ee(n[0]),i=ee(" the whole workspace, or select individual snapshots below."),o=ae(),v&&v.c(),s=ae(),a=Z("button"),L.c(),l=ae(),c=Z("div"),c.textContent="or select individual snapshots",d=ae(),p=Z("ul");for(let I=0;I<h.length;I+=1)h[I].c();g=ae(),N&&N.c(),f=lt(),A(t,"class","modal-step-hint svelte-105gz4t"),A(a,"class","whole-workspace-action svelte-105gz4t"),a.disabled=n[10],A(c,"class","modal-divider svelte-105gz4t"),A(p,"class","modal-snapshot-list svelte-105gz4t")},m(I,j){V(I,t,j),R(t,e),R(t,r),R(t,i),V(I,o,j),v&&v.m(I,j),V(I,s,j),V(I,a,j),L.m(a,null),V(I,l,j),V(I,c,j),V(I,d,j),V(I,p,j);for(let C=0;C<h.length;C+=1)h[C]&&h[C].m(p,null);V(I,g,j),N&&N.m(I,j),V(I,f,j),_=!0,b||(k=ge(a,"click",n[19]),b=!0)},p(I,j){(!_||j[0]&1)&&ye(r,I[0]),I[0]==="export"?v?v.p(I,j):(v=jr(I),v.c(),v.m(s.parentNode,s)):v&&(v.d(1),v=null),E===(E=O(I))&&L?L.p(I,j):(L.d(1),L=E(I),L&&(L.c(),L.m(a,null))),(!_||j[0]&1024)&&(a.disabled=I[10]),j[0]&262240&&(z=qe(I[5].snapshots),it(),h=Tt(h,j,U,1,I,z,u,p,Xn,xr,null,Fr),ot()),I[11]?N?N.p(I,j):(N=Wr(I),N.c(),N.m(f.parentNode,f)):N&&(N.d(1),N=null)},i(I){if(!_){for(let j=0;j<z.length;j+=1)ke(h[j]);_=!0}},o(I){for(let j=0;j<h.length;j+=1)Ee(h[j]);_=!1},d(I){I&&(G(t),G(o),G(s),G(a),G(l),G(c),G(d),G(p),G(g),G(f)),v&&v.d(I),L.d();for(let j=0;j<h.length;j+=1)h[j].d();N&&N.d(I),b=!1,k()}}}function Qo(n){let t,e,r,i,o,s=[],a=new Yi,l,c=qe(n[2]);const d=p=>p[34].name;for(let p=0;p<c.length;p+=1){let h=Mr(n,c,p),u=d(h);a.set(u,s[p]=Hr(u,h))}return{c(){t=Z("p"),e=ee("Step 1 of 2 — pick which workspace's snapshots to "),r=ee(n[0]),i=ee("."),o=ae();for(let p=0;p<s.length;p+=1)s[p].c();l=lt(),A(t,"class","modal-step-hint svelte-105gz4t")},m(p,h){V(p,t,h),R(t,e),R(t,r),R(t,i),V(p,o,h);for(let u=0;u<s.length;u+=1)s[u]&&s[u].m(p,h);V(p,l,h)},p(p,h){h[0]&1&&ye(r,p[0]),h[0]&32772&&(c=qe(p[2]),s=Tt(s,h,d,1,p,c,a,l.parentNode,en,Hr,l,Mr))},i:be,o:be,d(p){p&&(G(t),G(o),G(l));for(let h=0;h<s.length;h+=1)s[h].d(p)}}}function $o(n){let t,e,r,i,o;return{c(){t=Z("div"),e=Z("span"),e.innerHTML='<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="20 6 9 17 4 12"></polyline></svg>',r=ae(),i=Z("span"),o=ee(n[12]),A(e,"class","check-circle svelte-105gz4t"),A(t,"class","modal-confirm svelte-105gz4t")},m(s,a){V(s,t,a),R(t,e),R(t,r),R(t,i),R(i,o)},p(s,a){a[0]&4096&&ye(o,s[12])},i:be,o:be,d(s){s&&G(t)}}}function es(n){let t,e,r;return{c(){t=Z("p"),e=ee("Failed to load workspaces: "),r=ee(n[3]),A(t,"class","modal-error svelte-105gz4t")},m(i,o){V(i,t,o),R(t,e),R(t,r)},p(i,o){o[0]&8&&ye(r,i[3])},i:be,o:be,d(i){i&&G(t)}}}function jr(n){let t,e,r,i,o,s,a,l,c,d;return{c(){t=Z("div"),e=Z("button"),r=ee("HTML"),o=ae(),s=Z("button"),a=ee("Zip (for import)"),A(e,"type","button"),A(e,"class","format-toggle-btn svelte-105gz4t"),A(e,"aria-pressed",i=n[9]==="html"),Le(e,"active",n[9]==="html"),A(s,"type","button"),A(s,"class","format-toggle-btn svelte-105gz4t"),A(s,"aria-pressed",l=n[9]==="zip"),Le(s,"active",n[9]==="zip"),A(t,"class","format-toggle svelte-105gz4t"),A(t,"role","group"),A(t,"aria-label","Export format")},m(p,h){V(p,t,h),R(t,e),R(e,r),R(t,o),R(t,s),R(s,a),c||(d=[ge(e,"click",n[23]),ge(s,"click",n[24])],c=!0)},p(p,h){h[0]&512&&i!==(i=p[9]==="html")&&A(e,"aria-pressed",i),h[0]&512&&Le(e,"active",p[9]==="html"),h[0]&512&&l!==(l=p[9]==="zip")&&A(s,"aria-pressed",l),h[0]&512&&Le(s,"active",p[9]==="zip")},d(p){p&&G(t),c=!1,Be(d)}}}function ts(n){let t,e,r=n[5].snapshots.length+"",i,o,s=n[5].snapshots.length===1?"":"s",a,l;return{c(){t=ee(n[14]),e=ee(" entire workspace ("),i=ee(r),o=ee(" snapshot"),a=ee(s),l=ee(")")},m(c,d){V(c,t,d),V(c,e,d),V(c,i,d),V(c,o,d),V(c,a,d),V(c,l,d)},p(c,d){d[0]&16384&&ye(t,c[14]),d[0]&32&&r!==(r=c[5].snapshots.length+"")&&ye(i,r),d[0]&32&&s!==(s=c[5].snapshots.length===1?"":"s")&&ye(a,s)},d(c){c&&(G(t),G(e),G(i),G(o),G(a),G(l))}}}function ns(n){let t,e=n[5].name+"",r,i;return{c(){t=ee('Click again to delete "'),r=ee(e),i=ee('"')},m(o,s){V(o,t,s),V(o,r,s),V(o,i,s)},p(o,s){s[0]&32&&e!==(e=o[5].name+"")&&ye(r,e)},d(o){o&&(G(t),G(r),G(i))}}}function xr(n,t){let e,r,i,o,s,a,l,c,d,p,h,u;function g(){return t[25](t[37])}return c=new qi({props:{title:t[37].title,type:t[37].type,timestamp:t[37].timestamp}}),{key:n,first:null,c(){e=Z("li"),r=Z("label"),i=Z("input"),a=ae(),l=Z("span"),He(c.$$.fragment),d=ae(),A(i,"type","checkbox"),i.checked=o=t[6].has(t[37].filename),A(i,"aria-label",s="Select snapshot "+(t[37].title??t[37].filename)),A(l,"class","modal-snapshot-row svelte-105gz4t"),A(r,"class","svelte-105gz4t"),A(e,"class","modal-snapshot-item svelte-105gz4t"),Le(e,"selected",t[6].has(t[37].filename)),this.first=e},m(f,_){V(f,e,_),R(e,r),R(r,i),R(r,a),R(r,l),je(c,l,null),R(e,d),p=!0,h||(u=ge(i,"change",g),h=!0)},p(f,_){t=f,(!p||_[0]&96&&o!==(o=t[6].has(t[37].filename)))&&(i.checked=o),(!p||_[0]&32&&s!==(s="Select snapshot "+(t[37].title??t[37].filename)))&&A(i,"aria-label",s);const b={};_[0]&32&&(b.title=t[37].title),_[0]&32&&(b.type=t[37].type),_[0]&32&&(b.timestamp=t[37].timestamp),c.$set(b),(!p||_[0]&96)&&Le(e,"selected",t[6].has(t[37].filename))},i(f){p||(ke(c.$$.fragment,f),p=!0)},o(f){Ee(c.$$.fragment,f),p=!1},d(f){f&&G(e),xe(c),h=!1,u()}}}function Wr(n){let t,e;return{c(){t=Z("p"),e=ee(n[11]),A(t,"class","modal-error svelte-105gz4t")},m(r,i){V(r,t,i),R(t,e)},p(r,i){i[0]&2048&&ye(e,r[11])},d(r){r&&G(t)}}}function Hr(n,t){let e,r,i=t[34].name+"",o,s=t[34].isCurrent?" (current)":"",a,l,c,d=t[34].snapshots.length+"",p,h,u=t[34].snapshots.length===1?"":"s",g,f,_,b,k,v;function O(){return t[22](t[34])}return{key:n,first:null,c(){e=Z("button"),r=Z("span"),o=ee(i),a=ee(s),l=ae(),c=Z("span"),p=ee(d),h=ee(" snapshot"),g=ee(u),f=ae(),_=Z("span"),_.textContent="›",b=ae(),A(r,"class","workspace-pick-name svelte-105gz4t"),A(_,"class","workspace-pick-chevron svelte-105gz4t"),A(c,"class","workspace-pick-meta svelte-105gz4t"),A(e,"class","workspace-pick-row svelte-105gz4t"),this.first=e},m(E,L){V(E,e,L),R(e,r),R(r,o),R(r,a),R(e,l),R(e,c),R(c,p),R(c,h),R(c,g),R(c,f),R(c,_),R(e,b),k||(v=ge(e,"click",O),k=!0)},p(E,L){t=E,L[0]&4&&i!==(i=t[34].name+"")&&ye(o,i),L[0]&4&&s!==(s=t[34].isCurrent?" (current)":"")&&ye(a,s),L[0]&4&&d!==(d=t[34].snapshots.length+"")&&ye(p,d),L[0]&4&&u!==(u=t[34].snapshots.length===1?"":"s")&&ye(g,u)},d(E){E&&G(e),k=!1,v()}}}function Zr(n){let t,e,r=n[6].size+"",i,o,s,a,l,c,d,p=n[0]==="delete"&&n[8]?"Click again to confirm":`${n[14]} selected`,h,u,g,f;return{c(){t=Z("div"),e=Z("span"),i=ee(r),o=ee(" selected"),s=ae(),a=Z("div"),l=Z("button"),l.textContent="Cancel",c=ae(),d=Z("button"),h=ee(p),A(e,"class","modal-select-count svelte-105gz4t"),A(l,"class","modal-cancel-btn svelte-105gz4t"),A(d,"class","modal-selected-action svelte-105gz4t"),d.disabled=u=n[6].size===0||n[10],A(a,"class","modal-footer-actions svelte-105gz4t"),A(t,"class","modal-footer svelte-105gz4t")},m(_,b){V(_,t,b),R(t,e),R(e,i),R(e,o),R(t,s),R(t,a),R(a,l),R(a,c),R(a,d),R(d,h),g||(f=[ge(l,"click",n[17]),ge(d,"click",n[20])],g=!0)},p(_,b){b[0]&64&&r!==(r=_[6].size+"")&&ye(i,r),b[0]&16641&&p!==(p=_[0]==="delete"&&_[8]?"Click again to confirm":`${_[14]} selected`)&&ye(h,p),b[0]&1088&&u!==(u=_[6].size===0||_[10])&&(d.disabled=u)},d(_){_&&G(t),g=!1,Be(f)}}}function rs(n){let t,e,r=n[1]&&Br(n);return{c(){r&&r.c(),t=lt()},m(i,o){r&&r.m(i,o),V(i,t,o),e=!0},p(i,o){i[1]?r?(r.p(i,o),o[0]&2&&ke(r,1)):(r=Br(i),r.c(),ke(r,1),r.m(t.parentNode,t)):r&&(it(),Ee(r,1,1,()=>{r=null}),ot())},i(i){e||(ke(r),e=!0)},o(i){Ee(r),e=!1},d(i){i&&G(t),r&&r.d(i)}}}function is(n,t,e){let r,i,{mode:o}=t,{open:s=!1}=t,{workspaces:a=[]}=t,{loadError:l=null}=t;const c=$t();let d=1,p=null,h=new Set,u=!1,g=!1,f="html",_=!1,b=null,k=null,v=null,O=null,E=!1;function L(){e(11,b=null),e(12,k=null),e(10,_=!1),e(7,u=!1),e(8,g=!1),e(9,f="html"),e(6,h=new Set);const D=a.length===1?a[0]:a.find(F=>F.isCurrent);D?(e(5,p=D),e(4,d=2)):(e(5,p=null),e(4,d=1))}function z(D){e(5,p=D),e(6,h=new Set),e(7,u=!1),e(8,g=!1),e(11,b=null),e(4,d=2)}function U(){a.length<=1||(e(4,d=1),e(5,p=null),e(6,h=new Set),e(11,b=null))}function N(){c("close")}function I(D){const F=new Set(h);F.has(D)?F.delete(D):F.add(D),e(6,h=F),e(8,g=!1)}function j(D){D==="whole"?e(7,u=!0):e(8,g=!0),v&&clearTimeout(v),v=setTimeout(()=>{e(7,u=!1),e(8,g=!1)},3e3)}function C(D){e(12,k=D),O&&clearTimeout(O),O=setTimeout(()=>c("close"),1200)}async function H(){if(p){e(10,_=!0),e(11,b=null);try{if(o==="delete")await Yo(p.name),c("deleted"),C(`Deleted entire workspace "${p.name}"`);else{const D=p.snapshots.filter(F=>F.id!==void 0).map(F=>({workspace:p.name,id:F.id}));if(D.length===0)throw new Error("no exportable snapshots in this workspace");f==="zip"?await Pr(D):await Nr(D),C(`Exported entire workspace "${p.name}"`)}}catch(D){e(11,b=D instanceof Error?D.message:"Request failed")}finally{e(10,_=!1)}}}async function y(){if(!p||h.size===0)return;e(10,_=!0),e(11,b=null);const D=[...h];try{if(o==="delete")await Vo(p.name,D),c("deleted"),C(`Deleted ${D.length} snapshot${D.length===1?"":"s"} from "${p.name}"`);else{const F=new Map(p.snapshots.map(oe=>[oe.filename,oe.id])),de=D.map(oe=>({workspace:p.name,id:F.get(oe)})).filter(oe=>oe.id!==void 0);if(de.length===0)throw new Error("no exportable snapshots selected");f==="zip"?await Pr(de):await Nr(de),C(`Exported ${D.length} snapshot${D.length===1?"":"s"} from "${p.name}"`)}}catch(F){e(11,b=F instanceof Error?F.message:"Request failed")}finally{e(10,_=!1)}}function q(){if(o==="delete"&&!u){j("whole");return}v&&clearTimeout(v),H()}function fe(){if(h.size!==0){if(o==="delete"&&!g){j("subset");return}v&&clearTimeout(v),y()}}Qt(()=>{v&&clearTimeout(v),O&&clearTimeout(O)});const K=D=>z(D),ie=()=>e(9,f="html"),Y=()=>e(9,f="zip"),se=D=>I(D.filename);return n.$$set=D=>{"mode"in D&&e(0,o=D.mode),"open"in D&&e(1,s=D.open),"workspaces"in D&&e(2,a=D.workspaces),"loadError"in D&&e(3,l=D.loadError)},n.$$.update=()=>{n.$$.dirty[0]&1&&e(14,r=o==="delete"?"Delete":"Export"),n.$$.dirty[0]&2097154&&(s&&!E&&L(),e(21,E=s)),n.$$.dirty[0]&20&&e(13,i=d===2&&a.length>1)},[o,s,a,l,d,p,h,u,g,f,_,b,k,i,r,z,U,N,I,q,fe,E,K,ie,Y,se]}class os extends tt{constructor(t){super(),et(this,t,is,rs,Xe,{mode:0,open:1,workspaces:2,loadError:3},null,[-1,-1])}}var dn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ss(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function hn(n){throw new Error('Could not dynamically require "'+n+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Vi={exports:{}};/*!
3
3
 
4
4
  JSZip v3.10.1 - A JavaScript class for generating and reading zip files
5
5
  <http://stuartk.com/jszip>
@@ -9,11 +9,11 @@ Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/js
9
9
 
10
10
  JSZip uses the library pako released under the MIT license :
11
11
  https://github.com/nodeca/pako/blob/main/LICENSE
12
- */(function(n,t){(function(e){n.exports=e()})(function(){return function e(r,i,o){function s(c,d){if(!i[c]){if(!r[c]){var p=typeof hn=="function"&&hn;if(!d&&p)return p(c,!0);if(a)return a(c,!0);var h=new Error("Cannot find module '"+c+"'");throw h.code="MODULE_NOT_FOUND",h}var u=i[c]={exports:{}};r[c][0].call(u.exports,function(g){var f=r[c][1][g];return s(f||g)},u,u.exports,e,r,i,o)}return i[c].exports}for(var a=typeof hn=="function"&&hn,l=0;l<o.length;l++)s(o[l]);return s}({1:[function(e,r,i){var o=e("./utils"),s=e("./support"),a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";i.encode=function(l){for(var c,d,p,h,u,g,f,_=[],b=0,k=l.length,v=k,O=o.getTypeOf(l)!=="string";b<l.length;)v=k-b,p=O?(c=l[b++],d=b<k?l[b++]:0,b<k?l[b++]:0):(c=l.charCodeAt(b++),d=b<k?l.charCodeAt(b++):0,b<k?l.charCodeAt(b++):0),h=c>>2,u=(3&c)<<4|d>>4,g=1<v?(15&d)<<2|p>>6:64,f=2<v?63&p:64,_.push(a.charAt(h)+a.charAt(u)+a.charAt(g)+a.charAt(f));return _.join("")},i.decode=function(l){var c,d,p,h,u,g,f=0,_=0,b="data:";if(l.substr(0,b.length)===b)throw new Error("Invalid base64 input, it looks like a data url.");var k,v=3*(l=l.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(l.charAt(l.length-1)===a.charAt(64)&&v--,l.charAt(l.length-2)===a.charAt(64)&&v--,v%1!=0)throw new Error("Invalid base64 input, bad content length.");for(k=s.uint8array?new Uint8Array(0|v):new Array(0|v);f<l.length;)c=a.indexOf(l.charAt(f++))<<2|(h=a.indexOf(l.charAt(f++)))>>4,d=(15&h)<<4|(u=a.indexOf(l.charAt(f++)))>>2,p=(3&u)<<6|(g=a.indexOf(l.charAt(f++))),k[_++]=c,u!==64&&(k[_++]=d),g!==64&&(k[_++]=p);return k}},{"./support":30,"./utils":32}],2:[function(e,r,i){var o=e("./external"),s=e("./stream/DataWorker"),a=e("./stream/Crc32Probe"),l=e("./stream/DataLengthProbe");function c(d,p,h,u,g){this.compressedSize=d,this.uncompressedSize=p,this.crc32=h,this.compression=u,this.compressedContent=g}c.prototype={getContentWorker:function(){var d=new s(o.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),p=this;return d.on("end",function(){if(this.streamInfo.data_length!==p.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),d},getCompressedWorker:function(){return new s(o.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},c.createWorkerFrom=function(d,p,h){return d.pipe(new a).pipe(new l("uncompressedSize")).pipe(p.compressWorker(h)).pipe(new l("compressedSize")).withStreamInfo("compression",p)},r.exports=c},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,r,i){var o=e("./stream/GenericWorker");i.STORE={magic:"\0\0",compressWorker:function(){return new o("STORE compression")},uncompressWorker:function(){return new o("STORE decompression")}},i.DEFLATE=e("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,r,i){var o=e("./utils"),s=function(){for(var a,l=[],c=0;c<256;c++){a=c;for(var d=0;d<8;d++)a=1&a?3988292384^a>>>1:a>>>1;l[c]=a}return l}();r.exports=function(a,l){return a!==void 0&&a.length?o.getTypeOf(a)!=="string"?function(c,d,p,h){var u=s,g=h+p;c^=-1;for(var f=h;f<g;f++)c=c>>>8^u[255&(c^d[f])];return-1^c}(0|l,a,a.length,0):function(c,d,p,h){var u=s,g=h+p;c^=-1;for(var f=h;f<g;f++)c=c>>>8^u[255&(c^d.charCodeAt(f))];return-1^c}(0|l,a,a.length,0):0}},{"./utils":32}],5:[function(e,r,i){i.base64=!1,i.binary=!1,i.dir=!1,i.createFolders=!0,i.date=null,i.compression=null,i.compressionOptions=null,i.comment=null,i.unixPermissions=null,i.dosPermissions=null},{}],6:[function(e,r,i){var o=null;o=typeof Promise<"u"?Promise:e("lie"),r.exports={Promise:o}},{lie:37}],7:[function(e,r,i){var o=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",s=e("pako"),a=e("./utils"),l=e("./stream/GenericWorker"),c=o?"uint8array":"array";function d(p,h){l.call(this,"FlateWorker/"+p),this._pako=null,this._pakoAction=p,this._pakoOptions=h,this.meta={}}i.magic="\b\0",a.inherits(d,l),d.prototype.processChunk=function(p){this.meta=p.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(c,p.data),!1)},d.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},d.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},d.prototype._createPako=function(){this._pako=new s[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var p=this;this._pako.onData=function(h){p.push({data:h,meta:p.meta})}},i.compressWorker=function(p){return new d("Deflate",p)},i.uncompressWorker=function(){return new d("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,r,i){function o(u,g){var f,_="";for(f=0;f<g;f++)_+=String.fromCharCode(255&u),u>>>=8;return _}function s(u,g,f,_,b,k){var v,O,E=u.file,L=u.compression,z=k!==c.utf8encode,j=a.transformTo("string",k(E.name)),N=a.transformTo("string",c.utf8encode(E.name)),I=E.comment,U=a.transformTo("string",k(I)),C=a.transformTo("string",c.utf8encode(I)),H=N.length!==E.name.length,y=C.length!==I.length,q="",fe="",K="",ie=E.dir,Y=E.date,se={crc32:0,compressedSize:0,uncompressedSize:0};g&&!f||(se.crc32=u.crc32,se.compressedSize=u.compressedSize,se.uncompressedSize=u.uncompressedSize);var D=0;g&&(D|=8),z||!H&&!y||(D|=2048);var F=0,de=0;ie&&(F|=16),b==="UNIX"?(de=798,F|=function(J,ze){var Se=J;return J||(Se=ze?16893:33204),(65535&Se)<<16}(E.unixPermissions,ie)):(de=20,F|=function(J){return 63&(J||0)}(E.dosPermissions)),v=Y.getUTCHours(),v<<=6,v|=Y.getUTCMinutes(),v<<=5,v|=Y.getUTCSeconds()/2,O=Y.getUTCFullYear()-1980,O<<=4,O|=Y.getUTCMonth()+1,O<<=5,O|=Y.getUTCDate(),H&&(fe=o(1,1)+o(d(j),4)+N,q+="up"+o(fe.length,2)+fe),y&&(K=o(1,1)+o(d(U),4)+C,q+="uc"+o(K.length,2)+K);var oe="";return oe+=`
13
- \0`,oe+=o(D,2),oe+=L.magic,oe+=o(v,2),oe+=o(O,2),oe+=o(se.crc32,4),oe+=o(se.compressedSize,4),oe+=o(se.uncompressedSize,4),oe+=o(j.length,2),oe+=o(q.length,2),{fileRecord:p.LOCAL_FILE_HEADER+oe+j+q,dirRecord:p.CENTRAL_FILE_HEADER+o(de,2)+oe+o(U.length,2)+"\0\0\0\0"+o(F,4)+o(_,4)+j+q+U}}var a=e("../utils"),l=e("../stream/GenericWorker"),c=e("../utf8"),d=e("../crc32"),p=e("../signature");function h(u,g,f,_){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=g,this.zipPlatform=f,this.encodeFileName=_,this.streamFiles=u,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(h,l),h.prototype.push=function(u){var g=u.meta.percent||0,f=this.entriesCount,_=this._sources.length;this.accumulate?this.contentBuffer.push(u):(this.bytesWritten+=u.data.length,l.prototype.push.call(this,{data:u.data,meta:{currentFile:this.currentFile,percent:f?(g+100*(f-_-1))/f:100}}))},h.prototype.openedSource=function(u){this.currentSourceOffset=this.bytesWritten,this.currentFile=u.file.name;var g=this.streamFiles&&!u.file.dir;if(g){var f=s(u,g,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:f.fileRecord,meta:{percent:0}})}else this.accumulate=!0},h.prototype.closedSource=function(u){this.accumulate=!1;var g=this.streamFiles&&!u.file.dir,f=s(u,g,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(f.dirRecord),g)this.push({data:function(_){return p.DATA_DESCRIPTOR+o(_.crc32,4)+o(_.compressedSize,4)+o(_.uncompressedSize,4)}(u),meta:{percent:100}});else for(this.push({data:f.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},h.prototype.flush=function(){for(var u=this.bytesWritten,g=0;g<this.dirRecords.length;g++)this.push({data:this.dirRecords[g],meta:{percent:100}});var f=this.bytesWritten-u,_=function(b,k,v,O,E){var L=a.transformTo("string",E(O));return p.CENTRAL_DIRECTORY_END+"\0\0\0\0"+o(b,2)+o(b,2)+o(k,4)+o(v,4)+o(L.length,2)+L}(this.dirRecords.length,f,u,this.zipComment,this.encodeFileName);this.push({data:_,meta:{percent:100}})},h.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},h.prototype.registerPrevious=function(u){this._sources.push(u);var g=this;return u.on("data",function(f){g.processChunk(f)}),u.on("end",function(){g.closedSource(g.previous.streamInfo),g._sources.length?g.prepareNextSource():g.end()}),u.on("error",function(f){g.error(f)}),this},h.prototype.resume=function(){return!!l.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},h.prototype.error=function(u){var g=this._sources;if(!l.prototype.error.call(this,u))return!1;for(var f=0;f<g.length;f++)try{g[f].error(u)}catch{}return!0},h.prototype.lock=function(){l.prototype.lock.call(this);for(var u=this._sources,g=0;g<u.length;g++)u[g].lock()},r.exports=h},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(e,r,i){var o=e("../compressions"),s=e("./ZipFileWorker");i.generateWorker=function(a,l,c){var d=new s(l.streamFiles,c,l.platform,l.encodeFileName),p=0;try{a.forEach(function(h,u){p++;var g=function(k,v){var O=k||v,E=o[O];if(!E)throw new Error(O+" is not a valid compression method !");return E}(u.options.compression,l.compression),f=u.options.compressionOptions||l.compressionOptions||{},_=u.dir,b=u.date;u._compressWorker(g,f).withStreamInfo("file",{name:h,dir:_,date:b,comment:u.comment||"",unixPermissions:u.unixPermissions,dosPermissions:u.dosPermissions}).pipe(d)}),d.entriesCount=p}catch(h){d.error(h)}return d}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(e,r,i){function o(){if(!(this instanceof o))return new o;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var s=new o;for(var a in this)typeof this[a]!="function"&&(s[a]=this[a]);return s}}(o.prototype=e("./object")).loadAsync=e("./load"),o.support=e("./support"),o.defaults=e("./defaults"),o.version="3.10.1",o.loadAsync=function(s,a){return new o().loadAsync(s,a)},o.external=e("./external"),r.exports=o},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(e,r,i){var o=e("./utils"),s=e("./external"),a=e("./utf8"),l=e("./zipEntries"),c=e("./stream/Crc32Probe"),d=e("./nodejsUtils");function p(h){return new s.Promise(function(u,g){var f=h.decompressed.getContentWorker().pipe(new c);f.on("error",function(_){g(_)}).on("end",function(){f.streamInfo.crc32!==h.decompressed.crc32?g(new Error("Corrupted zip : CRC32 mismatch")):u()}).resume()})}r.exports=function(h,u){var g=this;return u=o.extend(u||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:a.utf8decode}),d.isNode&&d.isStream(h)?s.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):o.prepareContent("the loaded zip file",h,!0,u.optimizedBinaryString,u.base64).then(function(f){var _=new l(u);return _.load(f),_}).then(function(f){var _=[s.Promise.resolve(f)],b=f.files;if(u.checkCRC32)for(var k=0;k<b.length;k++)_.push(p(b[k]));return s.Promise.all(_)}).then(function(f){for(var _=f.shift(),b=_.files,k=0;k<b.length;k++){var v=b[k],O=v.fileNameStr,E=o.resolve(v.fileNameStr);g.file(E,v.decompressed,{binary:!0,optimizedBinaryString:!0,date:v.date,dir:v.dir,comment:v.fileCommentStr.length?v.fileCommentStr:null,unixPermissions:v.unixPermissions,dosPermissions:v.dosPermissions,createFolders:u.createFolders}),v.dir||(g.file(E).unsafeOriginalName=O)}return _.zipComment.length&&(g.comment=_.zipComment),g})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(e,r,i){var o=e("../utils"),s=e("../stream/GenericWorker");function a(l,c){s.call(this,"Nodejs stream input adapter for "+l),this._upstreamEnded=!1,this._bindStream(c)}o.inherits(a,s),a.prototype._bindStream=function(l){var c=this;(this._stream=l).pause(),l.on("data",function(d){c.push({data:d,meta:{percent:0}})}).on("error",function(d){c.isPaused?this.generatedError=d:c.error(d)}).on("end",function(){c.isPaused?c._upstreamEnded=!0:c.end()})},a.prototype.pause=function(){return!!s.prototype.pause.call(this)&&(this._stream.pause(),!0)},a.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},r.exports=a},{"../stream/GenericWorker":28,"../utils":32}],13:[function(e,r,i){var o=e("readable-stream").Readable;function s(a,l,c){o.call(this,l),this._helper=a;var d=this;a.on("data",function(p,h){d.push(p)||d._helper.pause(),c&&c(h)}).on("error",function(p){d.emit("error",p)}).on("end",function(){d.push(null)})}e("../utils").inherits(s,o),s.prototype._read=function(){this._helper.resume()},r.exports=s},{"../utils":32,"readable-stream":16}],14:[function(e,r,i){r.exports={isNode:typeof Buffer<"u",newBufferFrom:function(o,s){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(o,s);if(typeof o=="number")throw new Error('The "data" argument must not be a number');return new Buffer(o,s)},allocBuffer:function(o){if(Buffer.alloc)return Buffer.alloc(o);var s=new Buffer(o);return s.fill(0),s},isBuffer:function(o){return Buffer.isBuffer(o)},isStream:function(o){return o&&typeof o.on=="function"&&typeof o.pause=="function"&&typeof o.resume=="function"}}},{}],15:[function(e,r,i){function o(E,L,z){var j,N=a.getTypeOf(L),I=a.extend(z||{},d);I.date=I.date||new Date,I.compression!==null&&(I.compression=I.compression.toUpperCase()),typeof I.unixPermissions=="string"&&(I.unixPermissions=parseInt(I.unixPermissions,8)),I.unixPermissions&&16384&I.unixPermissions&&(I.dir=!0),I.dosPermissions&&16&I.dosPermissions&&(I.dir=!0),I.dir&&(E=b(E)),I.createFolders&&(j=_(E))&&k.call(this,j,!0);var U=N==="string"&&I.binary===!1&&I.base64===!1;z&&z.binary!==void 0||(I.binary=!U),(L instanceof p&&L.uncompressedSize===0||I.dir||!L||L.length===0)&&(I.base64=!1,I.binary=!0,L="",I.compression="STORE",N="string");var C=null;C=L instanceof p||L instanceof l?L:g.isNode&&g.isStream(L)?new f(E,L):a.prepareContent(E,L,I.binary,I.optimizedBinaryString,I.base64);var H=new h(E,C,I);this.files[E]=H}var s=e("./utf8"),a=e("./utils"),l=e("./stream/GenericWorker"),c=e("./stream/StreamHelper"),d=e("./defaults"),p=e("./compressedObject"),h=e("./zipObject"),u=e("./generate"),g=e("./nodejsUtils"),f=e("./nodejs/NodejsStreamInputAdapter"),_=function(E){E.slice(-1)==="/"&&(E=E.substring(0,E.length-1));var L=E.lastIndexOf("/");return 0<L?E.substring(0,L):""},b=function(E){return E.slice(-1)!=="/"&&(E+="/"),E},k=function(E,L){return L=L!==void 0?L:d.createFolders,E=b(E),this.files[E]||o.call(this,E,null,{dir:!0,createFolders:L}),this.files[E]};function v(E){return Object.prototype.toString.call(E)==="[object RegExp]"}var O={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(E){var L,z,j;for(L in this.files)j=this.files[L],(z=L.slice(this.root.length,L.length))&&L.slice(0,this.root.length)===this.root&&E(z,j)},filter:function(E){var L=[];return this.forEach(function(z,j){E(z,j)&&L.push(j)}),L},file:function(E,L,z){if(arguments.length!==1)return E=this.root+E,o.call(this,E,L,z),this;if(v(E)){var j=E;return this.filter(function(I,U){return!U.dir&&j.test(I)})}var N=this.files[this.root+E];return N&&!N.dir?N:null},folder:function(E){if(!E)return this;if(v(E))return this.filter(function(N,I){return I.dir&&E.test(N)});var L=this.root+E,z=k.call(this,L),j=this.clone();return j.root=z.name,j},remove:function(E){E=this.root+E;var L=this.files[E];if(L||(E.slice(-1)!=="/"&&(E+="/"),L=this.files[E]),L&&!L.dir)delete this.files[E];else for(var z=this.filter(function(N,I){return I.name.slice(0,E.length)===E}),j=0;j<z.length;j++)delete this.files[z[j].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(E){var L,z={};try{if((z=a.extend(E||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:s.utf8encode})).type=z.type.toLowerCase(),z.compression=z.compression.toUpperCase(),z.type==="binarystring"&&(z.type="string"),!z.type)throw new Error("No output type specified.");a.checkSupport(z.type),z.platform!=="darwin"&&z.platform!=="freebsd"&&z.platform!=="linux"&&z.platform!=="sunos"||(z.platform="UNIX"),z.platform==="win32"&&(z.platform="DOS");var j=z.comment||this.comment||"";L=u.generateWorker(this,z,j)}catch(N){(L=new l("error")).error(N)}return new c(L,z.type||"string",z.mimeType)},generateAsync:function(E,L){return this.generateInternalStream(E).accumulate(L)},generateNodeStream:function(E,L){return(E=E||{}).type||(E.type="nodebuffer"),this.generateInternalStream(E).toNodejsStream(L)}};r.exports=O},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(e,r,i){r.exports=e("stream")},{stream:void 0}],17:[function(e,r,i){var o=e("./DataReader");function s(a){o.call(this,a);for(var l=0;l<this.data.length;l++)a[l]=255&a[l]}e("../utils").inherits(s,o),s.prototype.byteAt=function(a){return this.data[this.zero+a]},s.prototype.lastIndexOfSignature=function(a){for(var l=a.charCodeAt(0),c=a.charCodeAt(1),d=a.charCodeAt(2),p=a.charCodeAt(3),h=this.length-4;0<=h;--h)if(this.data[h]===l&&this.data[h+1]===c&&this.data[h+2]===d&&this.data[h+3]===p)return h-this.zero;return-1},s.prototype.readAndCheckSignature=function(a){var l=a.charCodeAt(0),c=a.charCodeAt(1),d=a.charCodeAt(2),p=a.charCodeAt(3),h=this.readData(4);return l===h[0]&&c===h[1]&&d===h[2]&&p===h[3]},s.prototype.readData=function(a){if(this.checkOffset(a),a===0)return[];var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},r.exports=s},{"../utils":32,"./DataReader":18}],18:[function(e,r,i){var o=e("../utils");function s(a){this.data=a,this.length=a.length,this.index=0,this.zero=0}s.prototype={checkOffset:function(a){this.checkIndex(this.index+a)},checkIndex:function(a){if(this.length<this.zero+a||a<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+a+"). Corrupted zip ?")},setIndex:function(a){this.checkIndex(a),this.index=a},skip:function(a){this.setIndex(this.index+a)},byteAt:function(){},readInt:function(a){var l,c=0;for(this.checkOffset(a),l=this.index+a-1;l>=this.index;l--)c=(c<<8)+this.byteAt(l);return this.index+=a,c},readString:function(a){return o.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC(1980+(a>>25&127),(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1))}},r.exports=s},{"../utils":32}],19:[function(e,r,i){var o=e("./Uint8ArrayReader");function s(a){o.call(this,a)}e("../utils").inherits(s,o),s.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},r.exports=s},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,r,i){var o=e("./DataReader");function s(a){o.call(this,a)}e("../utils").inherits(s,o),s.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},s.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},s.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},s.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},r.exports=s},{"../utils":32,"./DataReader":18}],21:[function(e,r,i){var o=e("./ArrayReader");function s(a){o.call(this,a)}e("../utils").inherits(s,o),s.prototype.readData=function(a){if(this.checkOffset(a),a===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},r.exports=s},{"../utils":32,"./ArrayReader":17}],22:[function(e,r,i){var o=e("../utils"),s=e("../support"),a=e("./ArrayReader"),l=e("./StringReader"),c=e("./NodeBufferReader"),d=e("./Uint8ArrayReader");r.exports=function(p){var h=o.getTypeOf(p);return o.checkSupport(h),h!=="string"||s.uint8array?h==="nodebuffer"?new c(p):s.uint8array?new d(o.transformTo("uint8array",p)):new a(o.transformTo("array",p)):new l(p)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,r,i){i.LOCAL_FILE_HEADER="PK",i.CENTRAL_FILE_HEADER="PK",i.CENTRAL_DIRECTORY_END="PK",i.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",i.ZIP64_CENTRAL_DIRECTORY_END="PK",i.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(e,r,i){var o=e("./GenericWorker"),s=e("../utils");function a(l){o.call(this,"ConvertWorker to "+l),this.destType=l}s.inherits(a,o),a.prototype.processChunk=function(l){this.push({data:s.transformTo(this.destType,l.data),meta:l.meta})},r.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(e,r,i){var o=e("./GenericWorker"),s=e("../crc32");function a(){o.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}e("../utils").inherits(a,o),a.prototype.processChunk=function(l){this.streamInfo.crc32=s(l.data,this.streamInfo.crc32||0),this.push(l)},r.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,r,i){var o=e("../utils"),s=e("./GenericWorker");function a(l){s.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}o.inherits(a,s),a.prototype.processChunk=function(l){if(l){var c=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=c+l.data.length}s.prototype.processChunk.call(this,l)},r.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(e,r,i){var o=e("../utils"),s=e("./GenericWorker");function a(l){s.call(this,"DataWorker");var c=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(d){c.dataIsReady=!0,c.data=d,c.max=d&&d.length||0,c.type=o.getTypeOf(d),c.isPaused||c._tickAndRepeat()},function(d){c.error(d)})}o.inherits(a,s),a.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,o.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(o.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,c=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,c);break;case"uint8array":l=this.data.subarray(this.index,c);break;case"array":case"nodebuffer":l=this.data.slice(this.index,c)}return this.index=c,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},r.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(e,r,i){function o(s){this.name=s||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}o.prototype={push:function(s){this.emit("data",s)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(s){this.emit("error",s)}return!0},error:function(s){return!this.isFinished&&(this.isPaused?this.generatedError=s:(this.isFinished=!0,this.emit("error",s),this.previous&&this.previous.error(s),this.cleanUp()),!0)},on:function(s,a){return this._listeners[s].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(s,a){if(this._listeners[s])for(var l=0;l<this._listeners[s].length;l++)this._listeners[s][l].call(this,a)},pipe:function(s){return s.registerPrevious(this)},registerPrevious:function(s){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=s.streamInfo,this.mergeStreamInfo(),this.previous=s;var a=this;return s.on("data",function(l){a.processChunk(l)}),s.on("end",function(){a.end()}),s.on("error",function(l){a.error(l)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var s=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),s=!0),this.previous&&this.previous.resume(),!s},flush:function(){},processChunk:function(s){this.push(s)},withStreamInfo:function(s,a){return this.extraStreamInfo[s]=a,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var s in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,s)&&(this.streamInfo[s]=this.extraStreamInfo[s])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var s="Worker "+this.name;return this.previous?this.previous+" -> "+s:s}},r.exports=o},{}],29:[function(e,r,i){var o=e("../utils"),s=e("./ConvertWorker"),a=e("./GenericWorker"),l=e("../base64"),c=e("../support"),d=e("../external"),p=null;if(c.nodestream)try{p=e("../nodejs/NodejsStreamOutputAdapter")}catch{}function h(g,f){return new d.Promise(function(_,b){var k=[],v=g._internalType,O=g._outputType,E=g._mimeType;g.on("data",function(L,z){k.push(L),f&&f(z)}).on("error",function(L){k=[],b(L)}).on("end",function(){try{var L=function(z,j,N){switch(z){case"blob":return o.newBlob(o.transformTo("arraybuffer",j),N);case"base64":return l.encode(j);default:return o.transformTo(z,j)}}(O,function(z,j){var N,I=0,U=null,C=0;for(N=0;N<j.length;N++)C+=j[N].length;switch(z){case"string":return j.join("");case"array":return Array.prototype.concat.apply([],j);case"uint8array":for(U=new Uint8Array(C),N=0;N<j.length;N++)U.set(j[N],I),I+=j[N].length;return U;case"nodebuffer":return Buffer.concat(j);default:throw new Error("concat : unsupported type '"+z+"'")}}(v,k),E);_(L)}catch(z){b(z)}k=[]}).resume()})}function u(g,f,_){var b=f;switch(f){case"blob":case"arraybuffer":b="uint8array";break;case"base64":b="string"}try{this._internalType=b,this._outputType=f,this._mimeType=_,o.checkSupport(b),this._worker=g.pipe(new s(b)),g.lock()}catch(k){this._worker=new a("error"),this._worker.error(k)}}u.prototype={accumulate:function(g){return h(this,g)},on:function(g,f){var _=this;return g==="data"?this._worker.on(g,function(b){f.call(_,b.data,b.meta)}):this._worker.on(g,function(){o.delay(f,arguments,_)}),this},resume:function(){return o.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(g){if(o.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new p(this,{objectMode:this._outputType!=="nodebuffer"},g)}},r.exports=u},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(e,r,i){if(i.base64=!0,i.array=!0,i.string=!0,i.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",i.nodebuffer=typeof Buffer<"u",i.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")i.blob=!1;else{var o=new ArrayBuffer(0);try{i.blob=new Blob([o],{type:"application/zip"}).size===0}catch{try{var s=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);s.append(o),i.blob=s.getBlob("application/zip").size===0}catch{i.blob=!1}}}try{i.nodestream=!!e("readable-stream").Readable}catch{i.nodestream=!1}},{"readable-stream":16}],31:[function(e,r,i){for(var o=e("./utils"),s=e("./support"),a=e("./nodejsUtils"),l=e("./stream/GenericWorker"),c=new Array(256),d=0;d<256;d++)c[d]=252<=d?6:248<=d?5:240<=d?4:224<=d?3:192<=d?2:1;c[254]=c[254]=1;function p(){l.call(this,"utf-8 decode"),this.leftOver=null}function h(){l.call(this,"utf-8 encode")}i.utf8encode=function(u){return s.nodebuffer?a.newBufferFrom(u,"utf-8"):function(g){var f,_,b,k,v,O=g.length,E=0;for(k=0;k<O;k++)(64512&(_=g.charCodeAt(k)))==55296&&k+1<O&&(64512&(b=g.charCodeAt(k+1)))==56320&&(_=65536+(_-55296<<10)+(b-56320),k++),E+=_<128?1:_<2048?2:_<65536?3:4;for(f=s.uint8array?new Uint8Array(E):new Array(E),k=v=0;v<E;k++)(64512&(_=g.charCodeAt(k)))==55296&&k+1<O&&(64512&(b=g.charCodeAt(k+1)))==56320&&(_=65536+(_-55296<<10)+(b-56320),k++),_<128?f[v++]=_:(_<2048?f[v++]=192|_>>>6:(_<65536?f[v++]=224|_>>>12:(f[v++]=240|_>>>18,f[v++]=128|_>>>12&63),f[v++]=128|_>>>6&63),f[v++]=128|63&_);return f}(u)},i.utf8decode=function(u){return s.nodebuffer?o.transformTo("nodebuffer",u).toString("utf-8"):function(g){var f,_,b,k,v=g.length,O=new Array(2*v);for(f=_=0;f<v;)if((b=g[f++])<128)O[_++]=b;else if(4<(k=c[b]))O[_++]=65533,f+=k-1;else{for(b&=k===2?31:k===3?15:7;1<k&&f<v;)b=b<<6|63&g[f++],k--;1<k?O[_++]=65533:b<65536?O[_++]=b:(b-=65536,O[_++]=55296|b>>10&1023,O[_++]=56320|1023&b)}return O.length!==_&&(O.subarray?O=O.subarray(0,_):O.length=_),o.applyFromCharCode(O)}(u=o.transformTo(s.uint8array?"uint8array":"array",u))},o.inherits(p,l),p.prototype.processChunk=function(u){var g=o.transformTo(s.uint8array?"uint8array":"array",u.data);if(this.leftOver&&this.leftOver.length){if(s.uint8array){var f=g;(g=new Uint8Array(f.length+this.leftOver.length)).set(this.leftOver,0),g.set(f,this.leftOver.length)}else g=this.leftOver.concat(g);this.leftOver=null}var _=function(k,v){var O;for((v=v||k.length)>k.length&&(v=k.length),O=v-1;0<=O&&(192&k[O])==128;)O--;return O<0||O===0?v:O+c[k[O]]>v?O:v}(g),b=g;_!==g.length&&(s.uint8array?(b=g.subarray(0,_),this.leftOver=g.subarray(_,g.length)):(b=g.slice(0,_),this.leftOver=g.slice(_,g.length))),this.push({data:i.utf8decode(b),meta:u.meta})},p.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:i.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},i.Utf8DecodeWorker=p,o.inherits(h,l),h.prototype.processChunk=function(u){this.push({data:i.utf8encode(u.data),meta:u.meta})},i.Utf8EncodeWorker=h},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,r,i){var o=e("./support"),s=e("./base64"),a=e("./nodejsUtils"),l=e("./external");function c(f){return f}function d(f,_){for(var b=0;b<f.length;++b)_[b]=255&f.charCodeAt(b);return _}e("setimmediate"),i.newBlob=function(f,_){i.checkSupport("blob");try{return new Blob([f],{type:_})}catch{try{var b=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return b.append(f),b.getBlob(_)}catch{throw new Error("Bug : can't construct the Blob.")}}};var p={stringifyByChunk:function(f,_,b){var k=[],v=0,O=f.length;if(O<=b)return String.fromCharCode.apply(null,f);for(;v<O;)_==="array"||_==="nodebuffer"?k.push(String.fromCharCode.apply(null,f.slice(v,Math.min(v+b,O)))):k.push(String.fromCharCode.apply(null,f.subarray(v,Math.min(v+b,O)))),v+=b;return k.join("")},stringifyByChar:function(f){for(var _="",b=0;b<f.length;b++)_+=String.fromCharCode(f[b]);return _},applyCanBeUsed:{uint8array:function(){try{return o.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}}(),nodebuffer:function(){try{return o.nodebuffer&&String.fromCharCode.apply(null,a.allocBuffer(1)).length===1}catch{return!1}}()}};function h(f){var _=65536,b=i.getTypeOf(f),k=!0;if(b==="uint8array"?k=p.applyCanBeUsed.uint8array:b==="nodebuffer"&&(k=p.applyCanBeUsed.nodebuffer),k)for(;1<_;)try{return p.stringifyByChunk(f,b,_)}catch{_=Math.floor(_/2)}return p.stringifyByChar(f)}function u(f,_){for(var b=0;b<f.length;b++)_[b]=f[b];return _}i.applyFromCharCode=h;var g={};g.string={string:c,array:function(f){return d(f,new Array(f.length))},arraybuffer:function(f){return g.string.uint8array(f).buffer},uint8array:function(f){return d(f,new Uint8Array(f.length))},nodebuffer:function(f){return d(f,a.allocBuffer(f.length))}},g.array={string:h,array:c,arraybuffer:function(f){return new Uint8Array(f).buffer},uint8array:function(f){return new Uint8Array(f)},nodebuffer:function(f){return a.newBufferFrom(f)}},g.arraybuffer={string:function(f){return h(new Uint8Array(f))},array:function(f){return u(new Uint8Array(f),new Array(f.byteLength))},arraybuffer:c,uint8array:function(f){return new Uint8Array(f)},nodebuffer:function(f){return a.newBufferFrom(new Uint8Array(f))}},g.uint8array={string:h,array:function(f){return u(f,new Array(f.length))},arraybuffer:function(f){return f.buffer},uint8array:c,nodebuffer:function(f){return a.newBufferFrom(f)}},g.nodebuffer={string:h,array:function(f){return u(f,new Array(f.length))},arraybuffer:function(f){return g.nodebuffer.uint8array(f).buffer},uint8array:function(f){return u(f,new Uint8Array(f.length))},nodebuffer:c},i.transformTo=function(f,_){if(_=_||"",!f)return _;i.checkSupport(f);var b=i.getTypeOf(_);return g[b][f](_)},i.resolve=function(f){for(var _=f.split("/"),b=[],k=0;k<_.length;k++){var v=_[k];v==="."||v===""&&k!==0&&k!==_.length-1||(v===".."?b.pop():b.push(v))}return b.join("/")},i.getTypeOf=function(f){return typeof f=="string"?"string":Object.prototype.toString.call(f)==="[object Array]"?"array":o.nodebuffer&&a.isBuffer(f)?"nodebuffer":o.uint8array&&f instanceof Uint8Array?"uint8array":o.arraybuffer&&f instanceof ArrayBuffer?"arraybuffer":void 0},i.checkSupport=function(f){if(!o[f.toLowerCase()])throw new Error(f+" is not supported by this platform")},i.MAX_VALUE_16BITS=65535,i.MAX_VALUE_32BITS=-1,i.pretty=function(f){var _,b,k="";for(b=0;b<(f||"").length;b++)k+="\\x"+((_=f.charCodeAt(b))<16?"0":"")+_.toString(16).toUpperCase();return k},i.delay=function(f,_,b){setImmediate(function(){f.apply(b||null,_||[])})},i.inherits=function(f,_){function b(){}b.prototype=_.prototype,f.prototype=new b},i.extend=function(){var f,_,b={};for(f=0;f<arguments.length;f++)for(_ in arguments[f])Object.prototype.hasOwnProperty.call(arguments[f],_)&&b[_]===void 0&&(b[_]=arguments[f][_]);return b},i.prepareContent=function(f,_,b,k,v){return l.Promise.resolve(_).then(function(O){return o.blob&&(O instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(O))!==-1)&&typeof FileReader<"u"?new l.Promise(function(E,L){var z=new FileReader;z.onload=function(j){E(j.target.result)},z.onerror=function(j){L(j.target.error)},z.readAsArrayBuffer(O)}):O}).then(function(O){var E=i.getTypeOf(O);return E?(E==="arraybuffer"?O=i.transformTo("uint8array",O):E==="string"&&(v?O=s.decode(O):b&&k!==!0&&(O=function(L){return d(L,o.uint8array?new Uint8Array(L.length):new Array(L.length))}(O))),O):l.Promise.reject(new Error("Can't read the data of '"+f+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(e,r,i){var o=e("./reader/readerFor"),s=e("./utils"),a=e("./signature"),l=e("./zipEntry"),c=e("./support");function d(p){this.files=[],this.loadOptions=p}d.prototype={checkSignature:function(p){if(!this.reader.readAndCheckSignature(p)){this.reader.index-=4;var h=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+s.pretty(h)+", expected "+s.pretty(p)+")")}},isSignature:function(p,h){var u=this.reader.index;this.reader.setIndex(p);var g=this.reader.readString(4)===h;return this.reader.setIndex(u),g},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var p=this.reader.readData(this.zipCommentLength),h=c.uint8array?"uint8array":"array",u=s.transformTo(h,p);this.zipComment=this.loadOptions.decodeFileName(u)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var p,h,u,g=this.zip64EndOfCentralSize-44;0<g;)p=this.reader.readInt(2),h=this.reader.readInt(4),u=this.reader.readData(h),this.zip64ExtensibleData[p]={id:p,length:h,value:u}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var p,h;for(p=0;p<this.files.length;p++)h=this.files[p],this.reader.setIndex(h.localHeaderOffset),this.checkSignature(a.LOCAL_FILE_HEADER),h.readLocalPart(this.reader),h.handleUTF8(),h.processAttributes()},readCentralDir:function(){var p;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(a.CENTRAL_FILE_HEADER);)(p=new l({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(p);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var p=this.reader.lastIndexOfSignature(a.CENTRAL_DIRECTORY_END);if(p<0)throw this.isSignature(0,a.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(p);var h=p;if(this.checkSignature(a.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===s.MAX_VALUE_16BITS||this.diskWithCentralDirStart===s.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===s.MAX_VALUE_16BITS||this.centralDirRecords===s.MAX_VALUE_16BITS||this.centralDirSize===s.MAX_VALUE_32BITS||this.centralDirOffset===s.MAX_VALUE_32BITS){if(this.zip64=!0,(p=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(p),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,a.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var u=this.centralDirOffset+this.centralDirSize;this.zip64&&(u+=20,u+=12+this.zip64EndOfCentralSize);var g=h-u;if(0<g)this.isSignature(h,a.CENTRAL_FILE_HEADER)||(this.reader.zero=g);else if(g<0)throw new Error("Corrupted zip: missing "+Math.abs(g)+" bytes.")},prepareReader:function(p){this.reader=o(p)},load:function(p){this.prepareReader(p),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},r.exports=d},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(e,r,i){var o=e("./reader/readerFor"),s=e("./utils"),a=e("./compressedObject"),l=e("./crc32"),c=e("./utf8"),d=e("./compressions"),p=e("./support");function h(u,g){this.options=u,this.loadOptions=g}h.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(u){var g,f;if(u.skip(22),this.fileNameLength=u.readInt(2),f=u.readInt(2),this.fileName=u.readData(this.fileNameLength),u.skip(f),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((g=function(_){for(var b in d)if(Object.prototype.hasOwnProperty.call(d,b)&&d[b].magic===_)return d[b];return null}(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+s.pretty(this.compressionMethod)+" unknown (inner file : "+s.transformTo("string",this.fileName)+")");this.decompressed=new a(this.compressedSize,this.uncompressedSize,this.crc32,g,u.readData(this.compressedSize))},readCentralPart:function(u){this.versionMadeBy=u.readInt(2),u.skip(2),this.bitFlag=u.readInt(2),this.compressionMethod=u.readString(2),this.date=u.readDate(),this.crc32=u.readInt(4),this.compressedSize=u.readInt(4),this.uncompressedSize=u.readInt(4);var g=u.readInt(2);if(this.extraFieldsLength=u.readInt(2),this.fileCommentLength=u.readInt(2),this.diskNumberStart=u.readInt(2),this.internalFileAttributes=u.readInt(2),this.externalFileAttributes=u.readInt(4),this.localHeaderOffset=u.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");u.skip(g),this.readExtraFields(u),this.parseZIP64ExtraField(u),this.fileComment=u.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var u=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),u==0&&(this.dosPermissions=63&this.externalFileAttributes),u==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var u=o(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=u.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=u.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=u.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=u.readInt(4))}},readExtraFields:function(u){var g,f,_,b=u.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});u.index+4<b;)g=u.readInt(2),f=u.readInt(2),_=u.readData(f),this.extraFields[g]={id:g,length:f,value:_};u.setIndex(b)},handleUTF8:function(){var u=p.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=c.utf8decode(this.fileName),this.fileCommentStr=c.utf8decode(this.fileComment);else{var g=this.findExtraFieldUnicodePath();if(g!==null)this.fileNameStr=g;else{var f=s.transformTo(u,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(f)}var _=this.findExtraFieldUnicodeComment();if(_!==null)this.fileCommentStr=_;else{var b=s.transformTo(u,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(b)}}},findExtraFieldUnicodePath:function(){var u=this.extraFields[28789];if(u){var g=o(u.value);return g.readInt(1)!==1||l(this.fileName)!==g.readInt(4)?null:c.utf8decode(g.readData(u.length-5))}return null},findExtraFieldUnicodeComment:function(){var u=this.extraFields[25461];if(u){var g=o(u.value);return g.readInt(1)!==1||l(this.fileComment)!==g.readInt(4)?null:c.utf8decode(g.readData(u.length-5))}return null}},r.exports=h},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(e,r,i){function o(g,f,_){this.name=g,this.dir=_.dir,this.date=_.date,this.comment=_.comment,this.unixPermissions=_.unixPermissions,this.dosPermissions=_.dosPermissions,this._data=f,this._dataBinary=_.binary,this.options={compression:_.compression,compressionOptions:_.compressionOptions}}var s=e("./stream/StreamHelper"),a=e("./stream/DataWorker"),l=e("./utf8"),c=e("./compressedObject"),d=e("./stream/GenericWorker");o.prototype={internalStream:function(g){var f=null,_="string";try{if(!g)throw new Error("No output type specified.");var b=(_=g.toLowerCase())==="string"||_==="text";_!=="binarystring"&&_!=="text"||(_="string"),f=this._decompressWorker();var k=!this._dataBinary;k&&!b&&(f=f.pipe(new l.Utf8EncodeWorker)),!k&&b&&(f=f.pipe(new l.Utf8DecodeWorker))}catch(v){(f=new d("error")).error(v)}return new s(f,_,"")},async:function(g,f){return this.internalStream(g).accumulate(f)},nodeStream:function(g,f){return this.internalStream(g||"nodebuffer").toNodejsStream(f)},_compressWorker:function(g,f){if(this._data instanceof c&&this._data.compression.magic===g.magic)return this._data.getCompressedWorker();var _=this._decompressWorker();return this._dataBinary||(_=_.pipe(new l.Utf8EncodeWorker)),c.createWorkerFrom(_,g,f)},_decompressWorker:function(){return this._data instanceof c?this._data.getContentWorker():this._data instanceof d?this._data:new a(this._data)}};for(var p=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],h=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},u=0;u<p.length;u++)o.prototype[p[u]]=h;r.exports=o},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(e,r,i){(function(o){var s,a,l=o.MutationObserver||o.WebKitMutationObserver;if(l){var c=0,d=new l(g),p=o.document.createTextNode("");d.observe(p,{characterData:!0}),s=function(){p.data=c=++c%2}}else if(o.setImmediate||o.MessageChannel===void 0)s="document"in o&&"onreadystatechange"in o.document.createElement("script")?function(){var f=o.document.createElement("script");f.onreadystatechange=function(){g(),f.onreadystatechange=null,f.parentNode.removeChild(f),f=null},o.document.documentElement.appendChild(f)}:function(){setTimeout(g,0)};else{var h=new o.MessageChannel;h.port1.onmessage=g,s=function(){h.port2.postMessage(0)}}var u=[];function g(){var f,_;a=!0;for(var b=u.length;b;){for(_=u,u=[],f=-1;++f<b;)_[f]();b=u.length}a=!1}r.exports=function(f){u.push(f)!==1||a||s()}}).call(this,typeof dn<"u"?dn:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(e,r,i){var o=e("immediate");function s(){}var a={},l=["REJECTED"],c=["FULFILLED"],d=["PENDING"];function p(b){if(typeof b!="function")throw new TypeError("resolver must be a function");this.state=d,this.queue=[],this.outcome=void 0,b!==s&&f(this,b)}function h(b,k,v){this.promise=b,typeof k=="function"&&(this.onFulfilled=k,this.callFulfilled=this.otherCallFulfilled),typeof v=="function"&&(this.onRejected=v,this.callRejected=this.otherCallRejected)}function u(b,k,v){o(function(){var O;try{O=k(v)}catch(E){return a.reject(b,E)}O===b?a.reject(b,new TypeError("Cannot resolve promise with itself")):a.resolve(b,O)})}function g(b){var k=b&&b.then;if(b&&(typeof b=="object"||typeof b=="function")&&typeof k=="function")return function(){k.apply(b,arguments)}}function f(b,k){var v=!1;function O(z){v||(v=!0,a.reject(b,z))}function E(z){v||(v=!0,a.resolve(b,z))}var L=_(function(){k(E,O)});L.status==="error"&&O(L.value)}function _(b,k){var v={};try{v.value=b(k),v.status="success"}catch(O){v.status="error",v.value=O}return v}(r.exports=p).prototype.finally=function(b){if(typeof b!="function")return this;var k=this.constructor;return this.then(function(v){return k.resolve(b()).then(function(){return v})},function(v){return k.resolve(b()).then(function(){throw v})})},p.prototype.catch=function(b){return this.then(null,b)},p.prototype.then=function(b,k){if(typeof b!="function"&&this.state===c||typeof k!="function"&&this.state===l)return this;var v=new this.constructor(s);return this.state!==d?u(v,this.state===c?b:k,this.outcome):this.queue.push(new h(v,b,k)),v},h.prototype.callFulfilled=function(b){a.resolve(this.promise,b)},h.prototype.otherCallFulfilled=function(b){u(this.promise,this.onFulfilled,b)},h.prototype.callRejected=function(b){a.reject(this.promise,b)},h.prototype.otherCallRejected=function(b){u(this.promise,this.onRejected,b)},a.resolve=function(b,k){var v=_(g,k);if(v.status==="error")return a.reject(b,v.value);var O=v.value;if(O)f(b,O);else{b.state=c,b.outcome=k;for(var E=-1,L=b.queue.length;++E<L;)b.queue[E].callFulfilled(k)}return b},a.reject=function(b,k){b.state=l,b.outcome=k;for(var v=-1,O=b.queue.length;++v<O;)b.queue[v].callRejected(k);return b},p.resolve=function(b){return b instanceof this?b:a.resolve(new this(s),b)},p.reject=function(b){var k=new this(s);return a.reject(k,b)},p.all=function(b){var k=this;if(Object.prototype.toString.call(b)!=="[object Array]")return this.reject(new TypeError("must be an array"));var v=b.length,O=!1;if(!v)return this.resolve([]);for(var E=new Array(v),L=0,z=-1,j=new this(s);++z<v;)N(b[z],z);return j;function N(I,U){k.resolve(I).then(function(C){E[U]=C,++L!==v||O||(O=!0,a.resolve(j,E))},function(C){O||(O=!0,a.reject(j,C))})}},p.race=function(b){var k=this;if(Object.prototype.toString.call(b)!=="[object Array]")return this.reject(new TypeError("must be an array"));var v=b.length,O=!1;if(!v)return this.resolve([]);for(var E=-1,L=new this(s);++E<v;)z=b[E],k.resolve(z).then(function(j){O||(O=!0,a.resolve(L,j))},function(j){O||(O=!0,a.reject(L,j))});var z;return L}},{immediate:36}],38:[function(e,r,i){var o={};(0,e("./lib/utils/common").assign)(o,e("./lib/deflate"),e("./lib/inflate"),e("./lib/zlib/constants")),r.exports=o},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(e,r,i){var o=e("./zlib/deflate"),s=e("./utils/common"),a=e("./utils/strings"),l=e("./zlib/messages"),c=e("./zlib/zstream"),d=Object.prototype.toString,p=0,h=-1,u=0,g=8;function f(b){if(!(this instanceof f))return new f(b);this.options=s.assign({level:h,method:g,chunkSize:16384,windowBits:15,memLevel:8,strategy:u,to:""},b||{});var k=this.options;k.raw&&0<k.windowBits?k.windowBits=-k.windowBits:k.gzip&&0<k.windowBits&&k.windowBits<16&&(k.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var v=o.deflateInit2(this.strm,k.level,k.method,k.windowBits,k.memLevel,k.strategy);if(v!==p)throw new Error(l[v]);if(k.header&&o.deflateSetHeader(this.strm,k.header),k.dictionary){var O;if(O=typeof k.dictionary=="string"?a.string2buf(k.dictionary):d.call(k.dictionary)==="[object ArrayBuffer]"?new Uint8Array(k.dictionary):k.dictionary,(v=o.deflateSetDictionary(this.strm,O))!==p)throw new Error(l[v]);this._dict_set=!0}}function _(b,k){var v=new f(k);if(v.push(b,!0),v.err)throw v.msg||l[v.err];return v.result}f.prototype.push=function(b,k){var v,O,E=this.strm,L=this.options.chunkSize;if(this.ended)return!1;O=k===~~k?k:k===!0?4:0,typeof b=="string"?E.input=a.string2buf(b):d.call(b)==="[object ArrayBuffer]"?E.input=new Uint8Array(b):E.input=b,E.next_in=0,E.avail_in=E.input.length;do{if(E.avail_out===0&&(E.output=new s.Buf8(L),E.next_out=0,E.avail_out=L),(v=o.deflate(E,O))!==1&&v!==p)return this.onEnd(v),!(this.ended=!0);E.avail_out!==0&&(E.avail_in!==0||O!==4&&O!==2)||(this.options.to==="string"?this.onData(a.buf2binstring(s.shrinkBuf(E.output,E.next_out))):this.onData(s.shrinkBuf(E.output,E.next_out)))}while((0<E.avail_in||E.avail_out===0)&&v!==1);return O===4?(v=o.deflateEnd(this.strm),this.onEnd(v),this.ended=!0,v===p):O!==2||(this.onEnd(p),!(E.avail_out=0))},f.prototype.onData=function(b){this.chunks.push(b)},f.prototype.onEnd=function(b){b===p&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=b,this.msg=this.strm.msg},i.Deflate=f,i.deflate=_,i.deflateRaw=function(b,k){return(k=k||{}).raw=!0,_(b,k)},i.gzip=function(b,k){return(k=k||{}).gzip=!0,_(b,k)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(e,r,i){var o=e("./zlib/inflate"),s=e("./utils/common"),a=e("./utils/strings"),l=e("./zlib/constants"),c=e("./zlib/messages"),d=e("./zlib/zstream"),p=e("./zlib/gzheader"),h=Object.prototype.toString;function u(f){if(!(this instanceof u))return new u(f);this.options=s.assign({chunkSize:16384,windowBits:0,to:""},f||{});var _=this.options;_.raw&&0<=_.windowBits&&_.windowBits<16&&(_.windowBits=-_.windowBits,_.windowBits===0&&(_.windowBits=-15)),!(0<=_.windowBits&&_.windowBits<16)||f&&f.windowBits||(_.windowBits+=32),15<_.windowBits&&_.windowBits<48&&!(15&_.windowBits)&&(_.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new d,this.strm.avail_out=0;var b=o.inflateInit2(this.strm,_.windowBits);if(b!==l.Z_OK)throw new Error(c[b]);this.header=new p,o.inflateGetHeader(this.strm,this.header)}function g(f,_){var b=new u(_);if(b.push(f,!0),b.err)throw b.msg||c[b.err];return b.result}u.prototype.push=function(f,_){var b,k,v,O,E,L,z=this.strm,j=this.options.chunkSize,N=this.options.dictionary,I=!1;if(this.ended)return!1;k=_===~~_?_:_===!0?l.Z_FINISH:l.Z_NO_FLUSH,typeof f=="string"?z.input=a.binstring2buf(f):h.call(f)==="[object ArrayBuffer]"?z.input=new Uint8Array(f):z.input=f,z.next_in=0,z.avail_in=z.input.length;do{if(z.avail_out===0&&(z.output=new s.Buf8(j),z.next_out=0,z.avail_out=j),(b=o.inflate(z,l.Z_NO_FLUSH))===l.Z_NEED_DICT&&N&&(L=typeof N=="string"?a.string2buf(N):h.call(N)==="[object ArrayBuffer]"?new Uint8Array(N):N,b=o.inflateSetDictionary(this.strm,L)),b===l.Z_BUF_ERROR&&I===!0&&(b=l.Z_OK,I=!1),b!==l.Z_STREAM_END&&b!==l.Z_OK)return this.onEnd(b),!(this.ended=!0);z.next_out&&(z.avail_out!==0&&b!==l.Z_STREAM_END&&(z.avail_in!==0||k!==l.Z_FINISH&&k!==l.Z_SYNC_FLUSH)||(this.options.to==="string"?(v=a.utf8border(z.output,z.next_out),O=z.next_out-v,E=a.buf2string(z.output,v),z.next_out=O,z.avail_out=j-O,O&&s.arraySet(z.output,z.output,v,O,0),this.onData(E)):this.onData(s.shrinkBuf(z.output,z.next_out)))),z.avail_in===0&&z.avail_out===0&&(I=!0)}while((0<z.avail_in||z.avail_out===0)&&b!==l.Z_STREAM_END);return b===l.Z_STREAM_END&&(k=l.Z_FINISH),k===l.Z_FINISH?(b=o.inflateEnd(this.strm),this.onEnd(b),this.ended=!0,b===l.Z_OK):k!==l.Z_SYNC_FLUSH||(this.onEnd(l.Z_OK),!(z.avail_out=0))},u.prototype.onData=function(f){this.chunks.push(f)},u.prototype.onEnd=function(f){f===l.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=f,this.msg=this.strm.msg},i.Inflate=u,i.inflate=g,i.inflateRaw=function(f,_){return(_=_||{}).raw=!0,g(f,_)},i.ungzip=g},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(e,r,i){var o=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";i.assign=function(l){for(var c=Array.prototype.slice.call(arguments,1);c.length;){var d=c.shift();if(d){if(typeof d!="object")throw new TypeError(d+"must be non-object");for(var p in d)d.hasOwnProperty(p)&&(l[p]=d[p])}}return l},i.shrinkBuf=function(l,c){return l.length===c?l:l.subarray?l.subarray(0,c):(l.length=c,l)};var s={arraySet:function(l,c,d,p,h){if(c.subarray&&l.subarray)l.set(c.subarray(d,d+p),h);else for(var u=0;u<p;u++)l[h+u]=c[d+u]},flattenChunks:function(l){var c,d,p,h,u,g;for(c=p=0,d=l.length;c<d;c++)p+=l[c].length;for(g=new Uint8Array(p),c=h=0,d=l.length;c<d;c++)u=l[c],g.set(u,h),h+=u.length;return g}},a={arraySet:function(l,c,d,p,h){for(var u=0;u<p;u++)l[h+u]=c[d+u]},flattenChunks:function(l){return[].concat.apply([],l)}};i.setTyped=function(l){l?(i.Buf8=Uint8Array,i.Buf16=Uint16Array,i.Buf32=Int32Array,i.assign(i,s)):(i.Buf8=Array,i.Buf16=Array,i.Buf32=Array,i.assign(i,a))},i.setTyped(o)},{}],42:[function(e,r,i){var o=e("./common"),s=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch{s=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{a=!1}for(var l=new o.Buf8(256),c=0;c<256;c++)l[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;function d(p,h){if(h<65537&&(p.subarray&&a||!p.subarray&&s))return String.fromCharCode.apply(null,o.shrinkBuf(p,h));for(var u="",g=0;g<h;g++)u+=String.fromCharCode(p[g]);return u}l[254]=l[254]=1,i.string2buf=function(p){var h,u,g,f,_,b=p.length,k=0;for(f=0;f<b;f++)(64512&(u=p.charCodeAt(f)))==55296&&f+1<b&&(64512&(g=p.charCodeAt(f+1)))==56320&&(u=65536+(u-55296<<10)+(g-56320),f++),k+=u<128?1:u<2048?2:u<65536?3:4;for(h=new o.Buf8(k),f=_=0;_<k;f++)(64512&(u=p.charCodeAt(f)))==55296&&f+1<b&&(64512&(g=p.charCodeAt(f+1)))==56320&&(u=65536+(u-55296<<10)+(g-56320),f++),u<128?h[_++]=u:(u<2048?h[_++]=192|u>>>6:(u<65536?h[_++]=224|u>>>12:(h[_++]=240|u>>>18,h[_++]=128|u>>>12&63),h[_++]=128|u>>>6&63),h[_++]=128|63&u);return h},i.buf2binstring=function(p){return d(p,p.length)},i.binstring2buf=function(p){for(var h=new o.Buf8(p.length),u=0,g=h.length;u<g;u++)h[u]=p.charCodeAt(u);return h},i.buf2string=function(p,h){var u,g,f,_,b=h||p.length,k=new Array(2*b);for(u=g=0;u<b;)if((f=p[u++])<128)k[g++]=f;else if(4<(_=l[f]))k[g++]=65533,u+=_-1;else{for(f&=_===2?31:_===3?15:7;1<_&&u<b;)f=f<<6|63&p[u++],_--;1<_?k[g++]=65533:f<65536?k[g++]=f:(f-=65536,k[g++]=55296|f>>10&1023,k[g++]=56320|1023&f)}return d(k,g)},i.utf8border=function(p,h){var u;for((h=h||p.length)>p.length&&(h=p.length),u=h-1;0<=u&&(192&p[u])==128;)u--;return u<0||u===0?h:u+l[p[u]]>h?u:h}},{"./common":41}],43:[function(e,r,i){r.exports=function(o,s,a,l){for(var c=65535&o|0,d=o>>>16&65535|0,p=0;a!==0;){for(a-=p=2e3<a?2e3:a;d=d+(c=c+s[l++]|0)|0,--p;);c%=65521,d%=65521}return c|d<<16|0}},{}],44:[function(e,r,i){r.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(e,r,i){var o=function(){for(var s,a=[],l=0;l<256;l++){s=l;for(var c=0;c<8;c++)s=1&s?3988292384^s>>>1:s>>>1;a[l]=s}return a}();r.exports=function(s,a,l,c){var d=o,p=c+l;s^=-1;for(var h=c;h<p;h++)s=s>>>8^d[255&(s^a[h])];return-1^s}},{}],46:[function(e,r,i){var o,s=e("../utils/common"),a=e("./trees"),l=e("./adler32"),c=e("./crc32"),d=e("./messages"),p=0,h=4,u=0,g=-2,f=-1,_=4,b=2,k=8,v=9,O=286,E=30,L=19,z=2*O+1,j=15,N=3,I=258,U=I+N+1,C=42,H=113,y=1,q=2,fe=3,K=4;function ie(m,W){return m.msg=d[W],W}function Y(m){return(m<<1)-(4<m?9:0)}function se(m){for(var W=m.length;0<=--W;)m[W]=0}function D(m){var W=m.state,x=W.pending;x>m.avail_out&&(x=m.avail_out),x!==0&&(s.arraySet(m.output,W.pending_buf,W.pending_out,x,m.next_out),m.next_out+=x,W.pending_out+=x,m.total_out+=x,m.avail_out-=x,W.pending-=x,W.pending===0&&(W.pending_out=0))}function F(m,W){a._tr_flush_block(m,0<=m.block_start?m.block_start:-1,m.strstart-m.block_start,W),m.block_start=m.strstart,D(m.strm)}function de(m,W){m.pending_buf[m.pending++]=W}function oe(m,W){m.pending_buf[m.pending++]=W>>>8&255,m.pending_buf[m.pending++]=255&W}function J(m,W){var x,w,S=m.max_chain_length,P=m.strstart,X=m.prev_length,Q=m.nice_match,B=m.strstart>m.w_size-U?m.strstart-(m.w_size-U):0,te=m.window,ue=m.w_mask,re=m.prev,_e=m.strstart+I,Ae=te[P+X-1],ve=te[P+X];m.prev_length>=m.good_match&&(S>>=2),Q>m.lookahead&&(Q=m.lookahead);do if(te[(x=W)+X]===ve&&te[x+X-1]===Ae&&te[x]===te[P]&&te[++x]===te[P+1]){P+=2,x++;do;while(te[++P]===te[++x]&&te[++P]===te[++x]&&te[++P]===te[++x]&&te[++P]===te[++x]&&te[++P]===te[++x]&&te[++P]===te[++x]&&te[++P]===te[++x]&&te[++P]===te[++x]&&P<_e);if(w=I-(_e-P),P=_e-I,X<w){if(m.match_start=W,Q<=(X=w))break;Ae=te[P+X-1],ve=te[P+X]}}while((W=re[W&ue])>B&&--S!=0);return X<=m.lookahead?X:m.lookahead}function ze(m){var W,x,w,S,P,X,Q,B,te,ue,re=m.w_size;do{if(S=m.window_size-m.lookahead-m.strstart,m.strstart>=re+(re-U)){for(s.arraySet(m.window,m.window,re,re,0),m.match_start-=re,m.strstart-=re,m.block_start-=re,W=x=m.hash_size;w=m.head[--W],m.head[W]=re<=w?w-re:0,--x;);for(W=x=re;w=m.prev[--W],m.prev[W]=re<=w?w-re:0,--x;);S+=re}if(m.strm.avail_in===0)break;if(X=m.strm,Q=m.window,B=m.strstart+m.lookahead,te=S,ue=void 0,ue=X.avail_in,te<ue&&(ue=te),x=ue===0?0:(X.avail_in-=ue,s.arraySet(Q,X.input,X.next_in,ue,B),X.state.wrap===1?X.adler=l(X.adler,Q,ue,B):X.state.wrap===2&&(X.adler=c(X.adler,Q,ue,B)),X.next_in+=ue,X.total_in+=ue,ue),m.lookahead+=x,m.lookahead+m.insert>=N)for(P=m.strstart-m.insert,m.ins_h=m.window[P],m.ins_h=(m.ins_h<<m.hash_shift^m.window[P+1])&m.hash_mask;m.insert&&(m.ins_h=(m.ins_h<<m.hash_shift^m.window[P+N-1])&m.hash_mask,m.prev[P&m.w_mask]=m.head[m.ins_h],m.head[m.ins_h]=P,P++,m.insert--,!(m.lookahead+m.insert<N)););}while(m.lookahead<U&&m.strm.avail_in!==0)}function Se(m,W){for(var x,w;;){if(m.lookahead<U){if(ze(m),m.lookahead<U&&W===p)return y;if(m.lookahead===0)break}if(x=0,m.lookahead>=N&&(m.ins_h=(m.ins_h<<m.hash_shift^m.window[m.strstart+N-1])&m.hash_mask,x=m.prev[m.strstart&m.w_mask]=m.head[m.ins_h],m.head[m.ins_h]=m.strstart),x!==0&&m.strstart-x<=m.w_size-U&&(m.match_length=J(m,x)),m.match_length>=N)if(w=a._tr_tally(m,m.strstart-m.match_start,m.match_length-N),m.lookahead-=m.match_length,m.match_length<=m.max_lazy_match&&m.lookahead>=N){for(m.match_length--;m.strstart++,m.ins_h=(m.ins_h<<m.hash_shift^m.window[m.strstart+N-1])&m.hash_mask,x=m.prev[m.strstart&m.w_mask]=m.head[m.ins_h],m.head[m.ins_h]=m.strstart,--m.match_length!=0;);m.strstart++}else m.strstart+=m.match_length,m.match_length=0,m.ins_h=m.window[m.strstart],m.ins_h=(m.ins_h<<m.hash_shift^m.window[m.strstart+1])&m.hash_mask;else w=a._tr_tally(m,0,m.window[m.strstart]),m.lookahead--,m.strstart++;if(w&&(F(m,!1),m.strm.avail_out===0))return y}return m.insert=m.strstart<N-1?m.strstart:N-1,W===h?(F(m,!0),m.strm.avail_out===0?fe:K):m.last_lit&&(F(m,!1),m.strm.avail_out===0)?y:q}function me(m,W){for(var x,w,S;;){if(m.lookahead<U){if(ze(m),m.lookahead<U&&W===p)return y;if(m.lookahead===0)break}if(x=0,m.lookahead>=N&&(m.ins_h=(m.ins_h<<m.hash_shift^m.window[m.strstart+N-1])&m.hash_mask,x=m.prev[m.strstart&m.w_mask]=m.head[m.ins_h],m.head[m.ins_h]=m.strstart),m.prev_length=m.match_length,m.prev_match=m.match_start,m.match_length=N-1,x!==0&&m.prev_length<m.max_lazy_match&&m.strstart-x<=m.w_size-U&&(m.match_length=J(m,x),m.match_length<=5&&(m.strategy===1||m.match_length===N&&4096<m.strstart-m.match_start)&&(m.match_length=N-1)),m.prev_length>=N&&m.match_length<=m.prev_length){for(S=m.strstart+m.lookahead-N,w=a._tr_tally(m,m.strstart-1-m.prev_match,m.prev_length-N),m.lookahead-=m.prev_length-1,m.prev_length-=2;++m.strstart<=S&&(m.ins_h=(m.ins_h<<m.hash_shift^m.window[m.strstart+N-1])&m.hash_mask,x=m.prev[m.strstart&m.w_mask]=m.head[m.ins_h],m.head[m.ins_h]=m.strstart),--m.prev_length!=0;);if(m.match_available=0,m.match_length=N-1,m.strstart++,w&&(F(m,!1),m.strm.avail_out===0))return y}else if(m.match_available){if((w=a._tr_tally(m,0,m.window[m.strstart-1]))&&F(m,!1),m.strstart++,m.lookahead--,m.strm.avail_out===0)return y}else m.match_available=1,m.strstart++,m.lookahead--}return m.match_available&&(w=a._tr_tally(m,0,m.window[m.strstart-1]),m.match_available=0),m.insert=m.strstart<N-1?m.strstart:N-1,W===h?(F(m,!0),m.strm.avail_out===0?fe:K):m.last_lit&&(F(m,!1),m.strm.avail_out===0)?y:q}function le(m,W,x,w,S){this.good_length=m,this.max_lazy=W,this.nice_length=x,this.max_chain=w,this.func=S}function Te(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=k,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new s.Buf16(2*z),this.dyn_dtree=new s.Buf16(2*(2*E+1)),this.bl_tree=new s.Buf16(2*(2*L+1)),se(this.dyn_ltree),se(this.dyn_dtree),se(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new s.Buf16(j+1),this.heap=new s.Buf16(2*O+1),se(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new s.Buf16(2*O+1),se(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function Ce(m){var W;return m&&m.state?(m.total_in=m.total_out=0,m.data_type=b,(W=m.state).pending=0,W.pending_out=0,W.wrap<0&&(W.wrap=-W.wrap),W.status=W.wrap?C:H,m.adler=W.wrap===2?0:1,W.last_flush=p,a._tr_init(W),u):ie(m,g)}function Oe(m){var W=Ce(m);return W===u&&function(x){x.window_size=2*x.w_size,se(x.head),x.max_lazy_match=o[x.level].max_lazy,x.good_match=o[x.level].good_length,x.nice_match=o[x.level].nice_length,x.max_chain_length=o[x.level].max_chain,x.strstart=0,x.block_start=0,x.lookahead=0,x.insert=0,x.match_length=x.prev_length=N-1,x.match_available=0,x.ins_h=0}(m.state),W}function he(m,W,x,w,S,P){if(!m)return g;var X=1;if(W===f&&(W=6),w<0?(X=0,w=-w):15<w&&(X=2,w-=16),S<1||v<S||x!==k||w<8||15<w||W<0||9<W||P<0||_<P)return ie(m,g);w===8&&(w=9);var Q=new Te;return(m.state=Q).strm=m,Q.wrap=X,Q.gzhead=null,Q.w_bits=w,Q.w_size=1<<Q.w_bits,Q.w_mask=Q.w_size-1,Q.hash_bits=S+7,Q.hash_size=1<<Q.hash_bits,Q.hash_mask=Q.hash_size-1,Q.hash_shift=~~((Q.hash_bits+N-1)/N),Q.window=new s.Buf8(2*Q.w_size),Q.head=new s.Buf16(Q.hash_size),Q.prev=new s.Buf16(Q.w_size),Q.lit_bufsize=1<<S+6,Q.pending_buf_size=4*Q.lit_bufsize,Q.pending_buf=new s.Buf8(Q.pending_buf_size),Q.d_buf=1*Q.lit_bufsize,Q.l_buf=3*Q.lit_bufsize,Q.level=W,Q.strategy=P,Q.method=x,Oe(m)}o=[new le(0,0,0,0,function(m,W){var x=65535;for(x>m.pending_buf_size-5&&(x=m.pending_buf_size-5);;){if(m.lookahead<=1){if(ze(m),m.lookahead===0&&W===p)return y;if(m.lookahead===0)break}m.strstart+=m.lookahead,m.lookahead=0;var w=m.block_start+x;if((m.strstart===0||m.strstart>=w)&&(m.lookahead=m.strstart-w,m.strstart=w,F(m,!1),m.strm.avail_out===0)||m.strstart-m.block_start>=m.w_size-U&&(F(m,!1),m.strm.avail_out===0))return y}return m.insert=0,W===h?(F(m,!0),m.strm.avail_out===0?fe:K):(m.strstart>m.block_start&&(F(m,!1),m.strm.avail_out),y)}),new le(4,4,8,4,Se),new le(4,5,16,8,Se),new le(4,6,32,32,Se),new le(4,4,16,16,me),new le(8,16,32,32,me),new le(8,16,128,128,me),new le(8,32,128,256,me),new le(32,128,258,1024,me),new le(32,258,258,4096,me)],i.deflateInit=function(m,W){return he(m,W,k,15,8,0)},i.deflateInit2=he,i.deflateReset=Oe,i.deflateResetKeep=Ce,i.deflateSetHeader=function(m,W){return m&&m.state?m.state.wrap!==2?g:(m.state.gzhead=W,u):g},i.deflate=function(m,W){var x,w,S,P;if(!m||!m.state||5<W||W<0)return m?ie(m,g):g;if(w=m.state,!m.output||!m.input&&m.avail_in!==0||w.status===666&&W!==h)return ie(m,m.avail_out===0?-5:g);if(w.strm=m,x=w.last_flush,w.last_flush=W,w.status===C)if(w.wrap===2)m.adler=0,de(w,31),de(w,139),de(w,8),w.gzhead?(de(w,(w.gzhead.text?1:0)+(w.gzhead.hcrc?2:0)+(w.gzhead.extra?4:0)+(w.gzhead.name?8:0)+(w.gzhead.comment?16:0)),de(w,255&w.gzhead.time),de(w,w.gzhead.time>>8&255),de(w,w.gzhead.time>>16&255),de(w,w.gzhead.time>>24&255),de(w,w.level===9?2:2<=w.strategy||w.level<2?4:0),de(w,255&w.gzhead.os),w.gzhead.extra&&w.gzhead.extra.length&&(de(w,255&w.gzhead.extra.length),de(w,w.gzhead.extra.length>>8&255)),w.gzhead.hcrc&&(m.adler=c(m.adler,w.pending_buf,w.pending,0)),w.gzindex=0,w.status=69):(de(w,0),de(w,0),de(w,0),de(w,0),de(w,0),de(w,w.level===9?2:2<=w.strategy||w.level<2?4:0),de(w,3),w.status=H);else{var X=k+(w.w_bits-8<<4)<<8;X|=(2<=w.strategy||w.level<2?0:w.level<6?1:w.level===6?2:3)<<6,w.strstart!==0&&(X|=32),X+=31-X%31,w.status=H,oe(w,X),w.strstart!==0&&(oe(w,m.adler>>>16),oe(w,65535&m.adler)),m.adler=1}if(w.status===69)if(w.gzhead.extra){for(S=w.pending;w.gzindex<(65535&w.gzhead.extra.length)&&(w.pending!==w.pending_buf_size||(w.gzhead.hcrc&&w.pending>S&&(m.adler=c(m.adler,w.pending_buf,w.pending-S,S)),D(m),S=w.pending,w.pending!==w.pending_buf_size));)de(w,255&w.gzhead.extra[w.gzindex]),w.gzindex++;w.gzhead.hcrc&&w.pending>S&&(m.adler=c(m.adler,w.pending_buf,w.pending-S,S)),w.gzindex===w.gzhead.extra.length&&(w.gzindex=0,w.status=73)}else w.status=73;if(w.status===73)if(w.gzhead.name){S=w.pending;do{if(w.pending===w.pending_buf_size&&(w.gzhead.hcrc&&w.pending>S&&(m.adler=c(m.adler,w.pending_buf,w.pending-S,S)),D(m),S=w.pending,w.pending===w.pending_buf_size)){P=1;break}P=w.gzindex<w.gzhead.name.length?255&w.gzhead.name.charCodeAt(w.gzindex++):0,de(w,P)}while(P!==0);w.gzhead.hcrc&&w.pending>S&&(m.adler=c(m.adler,w.pending_buf,w.pending-S,S)),P===0&&(w.gzindex=0,w.status=91)}else w.status=91;if(w.status===91)if(w.gzhead.comment){S=w.pending;do{if(w.pending===w.pending_buf_size&&(w.gzhead.hcrc&&w.pending>S&&(m.adler=c(m.adler,w.pending_buf,w.pending-S,S)),D(m),S=w.pending,w.pending===w.pending_buf_size)){P=1;break}P=w.gzindex<w.gzhead.comment.length?255&w.gzhead.comment.charCodeAt(w.gzindex++):0,de(w,P)}while(P!==0);w.gzhead.hcrc&&w.pending>S&&(m.adler=c(m.adler,w.pending_buf,w.pending-S,S)),P===0&&(w.status=103)}else w.status=103;if(w.status===103&&(w.gzhead.hcrc?(w.pending+2>w.pending_buf_size&&D(m),w.pending+2<=w.pending_buf_size&&(de(w,255&m.adler),de(w,m.adler>>8&255),m.adler=0,w.status=H)):w.status=H),w.pending!==0){if(D(m),m.avail_out===0)return w.last_flush=-1,u}else if(m.avail_in===0&&Y(W)<=Y(x)&&W!==h)return ie(m,-5);if(w.status===666&&m.avail_in!==0)return ie(m,-5);if(m.avail_in!==0||w.lookahead!==0||W!==p&&w.status!==666){var Q=w.strategy===2?function(B,te){for(var ue;;){if(B.lookahead===0&&(ze(B),B.lookahead===0)){if(te===p)return y;break}if(B.match_length=0,ue=a._tr_tally(B,0,B.window[B.strstart]),B.lookahead--,B.strstart++,ue&&(F(B,!1),B.strm.avail_out===0))return y}return B.insert=0,te===h?(F(B,!0),B.strm.avail_out===0?fe:K):B.last_lit&&(F(B,!1),B.strm.avail_out===0)?y:q}(w,W):w.strategy===3?function(B,te){for(var ue,re,_e,Ae,ve=B.window;;){if(B.lookahead<=I){if(ze(B),B.lookahead<=I&&te===p)return y;if(B.lookahead===0)break}if(B.match_length=0,B.lookahead>=N&&0<B.strstart&&(re=ve[_e=B.strstart-1])===ve[++_e]&&re===ve[++_e]&&re===ve[++_e]){Ae=B.strstart+I;do;while(re===ve[++_e]&&re===ve[++_e]&&re===ve[++_e]&&re===ve[++_e]&&re===ve[++_e]&&re===ve[++_e]&&re===ve[++_e]&&re===ve[++_e]&&_e<Ae);B.match_length=I-(Ae-_e),B.match_length>B.lookahead&&(B.match_length=B.lookahead)}if(B.match_length>=N?(ue=a._tr_tally(B,1,B.match_length-N),B.lookahead-=B.match_length,B.strstart+=B.match_length,B.match_length=0):(ue=a._tr_tally(B,0,B.window[B.strstart]),B.lookahead--,B.strstart++),ue&&(F(B,!1),B.strm.avail_out===0))return y}return B.insert=0,te===h?(F(B,!0),B.strm.avail_out===0?fe:K):B.last_lit&&(F(B,!1),B.strm.avail_out===0)?y:q}(w,W):o[w.level].func(w,W);if(Q!==fe&&Q!==K||(w.status=666),Q===y||Q===fe)return m.avail_out===0&&(w.last_flush=-1),u;if(Q===q&&(W===1?a._tr_align(w):W!==5&&(a._tr_stored_block(w,0,0,!1),W===3&&(se(w.head),w.lookahead===0&&(w.strstart=0,w.block_start=0,w.insert=0))),D(m),m.avail_out===0))return w.last_flush=-1,u}return W!==h?u:w.wrap<=0?1:(w.wrap===2?(de(w,255&m.adler),de(w,m.adler>>8&255),de(w,m.adler>>16&255),de(w,m.adler>>24&255),de(w,255&m.total_in),de(w,m.total_in>>8&255),de(w,m.total_in>>16&255),de(w,m.total_in>>24&255)):(oe(w,m.adler>>>16),oe(w,65535&m.adler)),D(m),0<w.wrap&&(w.wrap=-w.wrap),w.pending!==0?u:1)},i.deflateEnd=function(m){var W;return m&&m.state?(W=m.state.status)!==C&&W!==69&&W!==73&&W!==91&&W!==103&&W!==H&&W!==666?ie(m,g):(m.state=null,W===H?ie(m,-3):u):g},i.deflateSetDictionary=function(m,W){var x,w,S,P,X,Q,B,te,ue=W.length;if(!m||!m.state||(P=(x=m.state).wrap)===2||P===1&&x.status!==C||x.lookahead)return g;for(P===1&&(m.adler=l(m.adler,W,ue,0)),x.wrap=0,ue>=x.w_size&&(P===0&&(se(x.head),x.strstart=0,x.block_start=0,x.insert=0),te=new s.Buf8(x.w_size),s.arraySet(te,W,ue-x.w_size,x.w_size,0),W=te,ue=x.w_size),X=m.avail_in,Q=m.next_in,B=m.input,m.avail_in=ue,m.next_in=0,m.input=W,ze(x);x.lookahead>=N;){for(w=x.strstart,S=x.lookahead-(N-1);x.ins_h=(x.ins_h<<x.hash_shift^x.window[w+N-1])&x.hash_mask,x.prev[w&x.w_mask]=x.head[x.ins_h],x.head[x.ins_h]=w,w++,--S;);x.strstart=w,x.lookahead=N-1,ze(x)}return x.strstart+=x.lookahead,x.block_start=x.strstart,x.insert=x.lookahead,x.lookahead=0,x.match_length=x.prev_length=N-1,x.match_available=0,m.next_in=Q,m.input=B,m.avail_in=X,x.wrap=P,u},i.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(e,r,i){r.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(e,r,i){r.exports=function(o,s){var a,l,c,d,p,h,u,g,f,_,b,k,v,O,E,L,z,j,N,I,U,C,H,y,q;a=o.state,l=o.next_in,y=o.input,c=l+(o.avail_in-5),d=o.next_out,q=o.output,p=d-(s-o.avail_out),h=d+(o.avail_out-257),u=a.dmax,g=a.wsize,f=a.whave,_=a.wnext,b=a.window,k=a.hold,v=a.bits,O=a.lencode,E=a.distcode,L=(1<<a.lenbits)-1,z=(1<<a.distbits)-1;e:do{v<15&&(k+=y[l++]<<v,v+=8,k+=y[l++]<<v,v+=8),j=O[k&L];t:for(;;){if(k>>>=N=j>>>24,v-=N,(N=j>>>16&255)===0)q[d++]=65535&j;else{if(!(16&N)){if(!(64&N)){j=O[(65535&j)+(k&(1<<N)-1)];continue t}if(32&N){a.mode=12;break e}o.msg="invalid literal/length code",a.mode=30;break e}I=65535&j,(N&=15)&&(v<N&&(k+=y[l++]<<v,v+=8),I+=k&(1<<N)-1,k>>>=N,v-=N),v<15&&(k+=y[l++]<<v,v+=8,k+=y[l++]<<v,v+=8),j=E[k&z];n:for(;;){if(k>>>=N=j>>>24,v-=N,!(16&(N=j>>>16&255))){if(!(64&N)){j=E[(65535&j)+(k&(1<<N)-1)];continue n}o.msg="invalid distance code",a.mode=30;break e}if(U=65535&j,v<(N&=15)&&(k+=y[l++]<<v,(v+=8)<N&&(k+=y[l++]<<v,v+=8)),u<(U+=k&(1<<N)-1)){o.msg="invalid distance too far back",a.mode=30;break e}if(k>>>=N,v-=N,(N=d-p)<U){if(f<(N=U-N)&&a.sane){o.msg="invalid distance too far back",a.mode=30;break e}if(H=b,(C=0)===_){if(C+=g-N,N<I){for(I-=N;q[d++]=b[C++],--N;);C=d-U,H=q}}else if(_<N){if(C+=g+_-N,(N-=_)<I){for(I-=N;q[d++]=b[C++],--N;);if(C=0,_<I){for(I-=N=_;q[d++]=b[C++],--N;);C=d-U,H=q}}}else if(C+=_-N,N<I){for(I-=N;q[d++]=b[C++],--N;);C=d-U,H=q}for(;2<I;)q[d++]=H[C++],q[d++]=H[C++],q[d++]=H[C++],I-=3;I&&(q[d++]=H[C++],1<I&&(q[d++]=H[C++]))}else{for(C=d-U;q[d++]=q[C++],q[d++]=q[C++],q[d++]=q[C++],2<(I-=3););I&&(q[d++]=q[C++],1<I&&(q[d++]=q[C++]))}break}}break}}while(l<c&&d<h);l-=I=v>>3,k&=(1<<(v-=I<<3))-1,o.next_in=l,o.next_out=d,o.avail_in=l<c?c-l+5:5-(l-c),o.avail_out=d<h?h-d+257:257-(d-h),a.hold=k,a.bits=v}},{}],49:[function(e,r,i){var o=e("../utils/common"),s=e("./adler32"),a=e("./crc32"),l=e("./inffast"),c=e("./inftrees"),d=1,p=2,h=0,u=-2,g=1,f=852,_=592;function b(C){return(C>>>24&255)+(C>>>8&65280)+((65280&C)<<8)+((255&C)<<24)}function k(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new o.Buf16(320),this.work=new o.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function v(C){var H;return C&&C.state?(H=C.state,C.total_in=C.total_out=H.total=0,C.msg="",H.wrap&&(C.adler=1&H.wrap),H.mode=g,H.last=0,H.havedict=0,H.dmax=32768,H.head=null,H.hold=0,H.bits=0,H.lencode=H.lendyn=new o.Buf32(f),H.distcode=H.distdyn=new o.Buf32(_),H.sane=1,H.back=-1,h):u}function O(C){var H;return C&&C.state?((H=C.state).wsize=0,H.whave=0,H.wnext=0,v(C)):u}function E(C,H){var y,q;return C&&C.state?(q=C.state,H<0?(y=0,H=-H):(y=1+(H>>4),H<48&&(H&=15)),H&&(H<8||15<H)?u:(q.window!==null&&q.wbits!==H&&(q.window=null),q.wrap=y,q.wbits=H,O(C))):u}function L(C,H){var y,q;return C?(q=new k,(C.state=q).window=null,(y=E(C,H))!==h&&(C.state=null),y):u}var z,j,N=!0;function I(C){if(N){var H;for(z=new o.Buf32(512),j=new o.Buf32(32),H=0;H<144;)C.lens[H++]=8;for(;H<256;)C.lens[H++]=9;for(;H<280;)C.lens[H++]=7;for(;H<288;)C.lens[H++]=8;for(c(d,C.lens,0,288,z,0,C.work,{bits:9}),H=0;H<32;)C.lens[H++]=5;c(p,C.lens,0,32,j,0,C.work,{bits:5}),N=!1}C.lencode=z,C.lenbits=9,C.distcode=j,C.distbits=5}function U(C,H,y,q){var fe,K=C.state;return K.window===null&&(K.wsize=1<<K.wbits,K.wnext=0,K.whave=0,K.window=new o.Buf8(K.wsize)),q>=K.wsize?(o.arraySet(K.window,H,y-K.wsize,K.wsize,0),K.wnext=0,K.whave=K.wsize):(q<(fe=K.wsize-K.wnext)&&(fe=q),o.arraySet(K.window,H,y-q,fe,K.wnext),(q-=fe)?(o.arraySet(K.window,H,y-q,q,0),K.wnext=q,K.whave=K.wsize):(K.wnext+=fe,K.wnext===K.wsize&&(K.wnext=0),K.whave<K.wsize&&(K.whave+=fe))),0}i.inflateReset=O,i.inflateReset2=E,i.inflateResetKeep=v,i.inflateInit=function(C){return L(C,15)},i.inflateInit2=L,i.inflate=function(C,H){var y,q,fe,K,ie,Y,se,D,F,de,oe,J,ze,Se,me,le,Te,Ce,Oe,he,m,W,x,w,S=0,P=new o.Buf8(4),X=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!C||!C.state||!C.output||!C.input&&C.avail_in!==0)return u;(y=C.state).mode===12&&(y.mode=13),ie=C.next_out,fe=C.output,se=C.avail_out,K=C.next_in,q=C.input,Y=C.avail_in,D=y.hold,F=y.bits,de=Y,oe=se,W=h;e:for(;;)switch(y.mode){case g:if(y.wrap===0){y.mode=13;break}for(;F<16;){if(Y===0)break e;Y--,D+=q[K++]<<F,F+=8}if(2&y.wrap&&D===35615){P[y.check=0]=255&D,P[1]=D>>>8&255,y.check=a(y.check,P,2,0),F=D=0,y.mode=2;break}if(y.flags=0,y.head&&(y.head.done=!1),!(1&y.wrap)||(((255&D)<<8)+(D>>8))%31){C.msg="incorrect header check",y.mode=30;break}if((15&D)!=8){C.msg="unknown compression method",y.mode=30;break}if(F-=4,m=8+(15&(D>>>=4)),y.wbits===0)y.wbits=m;else if(m>y.wbits){C.msg="invalid window size",y.mode=30;break}y.dmax=1<<m,C.adler=y.check=1,y.mode=512&D?10:12,F=D=0;break;case 2:for(;F<16;){if(Y===0)break e;Y--,D+=q[K++]<<F,F+=8}if(y.flags=D,(255&y.flags)!=8){C.msg="unknown compression method",y.mode=30;break}if(57344&y.flags){C.msg="unknown header flags set",y.mode=30;break}y.head&&(y.head.text=D>>8&1),512&y.flags&&(P[0]=255&D,P[1]=D>>>8&255,y.check=a(y.check,P,2,0)),F=D=0,y.mode=3;case 3:for(;F<32;){if(Y===0)break e;Y--,D+=q[K++]<<F,F+=8}y.head&&(y.head.time=D),512&y.flags&&(P[0]=255&D,P[1]=D>>>8&255,P[2]=D>>>16&255,P[3]=D>>>24&255,y.check=a(y.check,P,4,0)),F=D=0,y.mode=4;case 4:for(;F<16;){if(Y===0)break e;Y--,D+=q[K++]<<F,F+=8}y.head&&(y.head.xflags=255&D,y.head.os=D>>8),512&y.flags&&(P[0]=255&D,P[1]=D>>>8&255,y.check=a(y.check,P,2,0)),F=D=0,y.mode=5;case 5:if(1024&y.flags){for(;F<16;){if(Y===0)break e;Y--,D+=q[K++]<<F,F+=8}y.length=D,y.head&&(y.head.extra_len=D),512&y.flags&&(P[0]=255&D,P[1]=D>>>8&255,y.check=a(y.check,P,2,0)),F=D=0}else y.head&&(y.head.extra=null);y.mode=6;case 6:if(1024&y.flags&&(Y<(J=y.length)&&(J=Y),J&&(y.head&&(m=y.head.extra_len-y.length,y.head.extra||(y.head.extra=new Array(y.head.extra_len)),o.arraySet(y.head.extra,q,K,J,m)),512&y.flags&&(y.check=a(y.check,q,J,K)),Y-=J,K+=J,y.length-=J),y.length))break e;y.length=0,y.mode=7;case 7:if(2048&y.flags){if(Y===0)break e;for(J=0;m=q[K+J++],y.head&&m&&y.length<65536&&(y.head.name+=String.fromCharCode(m)),m&&J<Y;);if(512&y.flags&&(y.check=a(y.check,q,J,K)),Y-=J,K+=J,m)break e}else y.head&&(y.head.name=null);y.length=0,y.mode=8;case 8:if(4096&y.flags){if(Y===0)break e;for(J=0;m=q[K+J++],y.head&&m&&y.length<65536&&(y.head.comment+=String.fromCharCode(m)),m&&J<Y;);if(512&y.flags&&(y.check=a(y.check,q,J,K)),Y-=J,K+=J,m)break e}else y.head&&(y.head.comment=null);y.mode=9;case 9:if(512&y.flags){for(;F<16;){if(Y===0)break e;Y--,D+=q[K++]<<F,F+=8}if(D!==(65535&y.check)){C.msg="header crc mismatch",y.mode=30;break}F=D=0}y.head&&(y.head.hcrc=y.flags>>9&1,y.head.done=!0),C.adler=y.check=0,y.mode=12;break;case 10:for(;F<32;){if(Y===0)break e;Y--,D+=q[K++]<<F,F+=8}C.adler=y.check=b(D),F=D=0,y.mode=11;case 11:if(y.havedict===0)return C.next_out=ie,C.avail_out=se,C.next_in=K,C.avail_in=Y,y.hold=D,y.bits=F,2;C.adler=y.check=1,y.mode=12;case 12:if(H===5||H===6)break e;case 13:if(y.last){D>>>=7&F,F-=7&F,y.mode=27;break}for(;F<3;){if(Y===0)break e;Y--,D+=q[K++]<<F,F+=8}switch(y.last=1&D,F-=1,3&(D>>>=1)){case 0:y.mode=14;break;case 1:if(I(y),y.mode=20,H!==6)break;D>>>=2,F-=2;break e;case 2:y.mode=17;break;case 3:C.msg="invalid block type",y.mode=30}D>>>=2,F-=2;break;case 14:for(D>>>=7&F,F-=7&F;F<32;){if(Y===0)break e;Y--,D+=q[K++]<<F,F+=8}if((65535&D)!=(D>>>16^65535)){C.msg="invalid stored block lengths",y.mode=30;break}if(y.length=65535&D,F=D=0,y.mode=15,H===6)break e;case 15:y.mode=16;case 16:if(J=y.length){if(Y<J&&(J=Y),se<J&&(J=se),J===0)break e;o.arraySet(fe,q,K,J,ie),Y-=J,K+=J,se-=J,ie+=J,y.length-=J;break}y.mode=12;break;case 17:for(;F<14;){if(Y===0)break e;Y--,D+=q[K++]<<F,F+=8}if(y.nlen=257+(31&D),D>>>=5,F-=5,y.ndist=1+(31&D),D>>>=5,F-=5,y.ncode=4+(15&D),D>>>=4,F-=4,286<y.nlen||30<y.ndist){C.msg="too many length or distance symbols",y.mode=30;break}y.have=0,y.mode=18;case 18:for(;y.have<y.ncode;){for(;F<3;){if(Y===0)break e;Y--,D+=q[K++]<<F,F+=8}y.lens[X[y.have++]]=7&D,D>>>=3,F-=3}for(;y.have<19;)y.lens[X[y.have++]]=0;if(y.lencode=y.lendyn,y.lenbits=7,x={bits:y.lenbits},W=c(0,y.lens,0,19,y.lencode,0,y.work,x),y.lenbits=x.bits,W){C.msg="invalid code lengths set",y.mode=30;break}y.have=0,y.mode=19;case 19:for(;y.have<y.nlen+y.ndist;){for(;le=(S=y.lencode[D&(1<<y.lenbits)-1])>>>16&255,Te=65535&S,!((me=S>>>24)<=F);){if(Y===0)break e;Y--,D+=q[K++]<<F,F+=8}if(Te<16)D>>>=me,F-=me,y.lens[y.have++]=Te;else{if(Te===16){for(w=me+2;F<w;){if(Y===0)break e;Y--,D+=q[K++]<<F,F+=8}if(D>>>=me,F-=me,y.have===0){C.msg="invalid bit length repeat",y.mode=30;break}m=y.lens[y.have-1],J=3+(3&D),D>>>=2,F-=2}else if(Te===17){for(w=me+3;F<w;){if(Y===0)break e;Y--,D+=q[K++]<<F,F+=8}F-=me,m=0,J=3+(7&(D>>>=me)),D>>>=3,F-=3}else{for(w=me+7;F<w;){if(Y===0)break e;Y--,D+=q[K++]<<F,F+=8}F-=me,m=0,J=11+(127&(D>>>=me)),D>>>=7,F-=7}if(y.have+J>y.nlen+y.ndist){C.msg="invalid bit length repeat",y.mode=30;break}for(;J--;)y.lens[y.have++]=m}}if(y.mode===30)break;if(y.lens[256]===0){C.msg="invalid code -- missing end-of-block",y.mode=30;break}if(y.lenbits=9,x={bits:y.lenbits},W=c(d,y.lens,0,y.nlen,y.lencode,0,y.work,x),y.lenbits=x.bits,W){C.msg="invalid literal/lengths set",y.mode=30;break}if(y.distbits=6,y.distcode=y.distdyn,x={bits:y.distbits},W=c(p,y.lens,y.nlen,y.ndist,y.distcode,0,y.work,x),y.distbits=x.bits,W){C.msg="invalid distances set",y.mode=30;break}if(y.mode=20,H===6)break e;case 20:y.mode=21;case 21:if(6<=Y&&258<=se){C.next_out=ie,C.avail_out=se,C.next_in=K,C.avail_in=Y,y.hold=D,y.bits=F,l(C,oe),ie=C.next_out,fe=C.output,se=C.avail_out,K=C.next_in,q=C.input,Y=C.avail_in,D=y.hold,F=y.bits,y.mode===12&&(y.back=-1);break}for(y.back=0;le=(S=y.lencode[D&(1<<y.lenbits)-1])>>>16&255,Te=65535&S,!((me=S>>>24)<=F);){if(Y===0)break e;Y--,D+=q[K++]<<F,F+=8}if(le&&!(240&le)){for(Ce=me,Oe=le,he=Te;le=(S=y.lencode[he+((D&(1<<Ce+Oe)-1)>>Ce)])>>>16&255,Te=65535&S,!(Ce+(me=S>>>24)<=F);){if(Y===0)break e;Y--,D+=q[K++]<<F,F+=8}D>>>=Ce,F-=Ce,y.back+=Ce}if(D>>>=me,F-=me,y.back+=me,y.length=Te,le===0){y.mode=26;break}if(32&le){y.back=-1,y.mode=12;break}if(64&le){C.msg="invalid literal/length code",y.mode=30;break}y.extra=15&le,y.mode=22;case 22:if(y.extra){for(w=y.extra;F<w;){if(Y===0)break e;Y--,D+=q[K++]<<F,F+=8}y.length+=D&(1<<y.extra)-1,D>>>=y.extra,F-=y.extra,y.back+=y.extra}y.was=y.length,y.mode=23;case 23:for(;le=(S=y.distcode[D&(1<<y.distbits)-1])>>>16&255,Te=65535&S,!((me=S>>>24)<=F);){if(Y===0)break e;Y--,D+=q[K++]<<F,F+=8}if(!(240&le)){for(Ce=me,Oe=le,he=Te;le=(S=y.distcode[he+((D&(1<<Ce+Oe)-1)>>Ce)])>>>16&255,Te=65535&S,!(Ce+(me=S>>>24)<=F);){if(Y===0)break e;Y--,D+=q[K++]<<F,F+=8}D>>>=Ce,F-=Ce,y.back+=Ce}if(D>>>=me,F-=me,y.back+=me,64&le){C.msg="invalid distance code",y.mode=30;break}y.offset=Te,y.extra=15&le,y.mode=24;case 24:if(y.extra){for(w=y.extra;F<w;){if(Y===0)break e;Y--,D+=q[K++]<<F,F+=8}y.offset+=D&(1<<y.extra)-1,D>>>=y.extra,F-=y.extra,y.back+=y.extra}if(y.offset>y.dmax){C.msg="invalid distance too far back",y.mode=30;break}y.mode=25;case 25:if(se===0)break e;if(J=oe-se,y.offset>J){if((J=y.offset-J)>y.whave&&y.sane){C.msg="invalid distance too far back",y.mode=30;break}ze=J>y.wnext?(J-=y.wnext,y.wsize-J):y.wnext-J,J>y.length&&(J=y.length),Se=y.window}else Se=fe,ze=ie-y.offset,J=y.length;for(se<J&&(J=se),se-=J,y.length-=J;fe[ie++]=Se[ze++],--J;);y.length===0&&(y.mode=21);break;case 26:if(se===0)break e;fe[ie++]=y.length,se--,y.mode=21;break;case 27:if(y.wrap){for(;F<32;){if(Y===0)break e;Y--,D|=q[K++]<<F,F+=8}if(oe-=se,C.total_out+=oe,y.total+=oe,oe&&(C.adler=y.check=y.flags?a(y.check,fe,oe,ie-oe):s(y.check,fe,oe,ie-oe)),oe=se,(y.flags?D:b(D))!==y.check){C.msg="incorrect data check",y.mode=30;break}F=D=0}y.mode=28;case 28:if(y.wrap&&y.flags){for(;F<32;){if(Y===0)break e;Y--,D+=q[K++]<<F,F+=8}if(D!==(4294967295&y.total)){C.msg="incorrect length check",y.mode=30;break}F=D=0}y.mode=29;case 29:W=1;break e;case 30:W=-3;break e;case 31:return-4;case 32:default:return u}return C.next_out=ie,C.avail_out=se,C.next_in=K,C.avail_in=Y,y.hold=D,y.bits=F,(y.wsize||oe!==C.avail_out&&y.mode<30&&(y.mode<27||H!==4))&&U(C,C.output,C.next_out,oe-C.avail_out)?(y.mode=31,-4):(de-=C.avail_in,oe-=C.avail_out,C.total_in+=de,C.total_out+=oe,y.total+=oe,y.wrap&&oe&&(C.adler=y.check=y.flags?a(y.check,fe,oe,C.next_out-oe):s(y.check,fe,oe,C.next_out-oe)),C.data_type=y.bits+(y.last?64:0)+(y.mode===12?128:0)+(y.mode===20||y.mode===15?256:0),(de==0&&oe===0||H===4)&&W===h&&(W=-5),W)},i.inflateEnd=function(C){if(!C||!C.state)return u;var H=C.state;return H.window&&(H.window=null),C.state=null,h},i.inflateGetHeader=function(C,H){var y;return C&&C.state&&2&(y=C.state).wrap?((y.head=H).done=!1,h):u},i.inflateSetDictionary=function(C,H){var y,q=H.length;return C&&C.state?(y=C.state).wrap!==0&&y.mode!==11?u:y.mode===11&&s(1,H,q,0)!==y.check?-3:U(C,H,q,q)?(y.mode=31,-4):(y.havedict=1,h):u},i.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(e,r,i){var o=e("../utils/common"),s=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],a=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],l=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],c=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];r.exports=function(d,p,h,u,g,f,_,b){var k,v,O,E,L,z,j,N,I,U=b.bits,C=0,H=0,y=0,q=0,fe=0,K=0,ie=0,Y=0,se=0,D=0,F=null,de=0,oe=new o.Buf16(16),J=new o.Buf16(16),ze=null,Se=0;for(C=0;C<=15;C++)oe[C]=0;for(H=0;H<u;H++)oe[p[h+H]]++;for(fe=U,q=15;1<=q&&oe[q]===0;q--);if(q<fe&&(fe=q),q===0)return g[f++]=20971520,g[f++]=20971520,b.bits=1,0;for(y=1;y<q&&oe[y]===0;y++);for(fe<y&&(fe=y),C=Y=1;C<=15;C++)if(Y<<=1,(Y-=oe[C])<0)return-1;if(0<Y&&(d===0||q!==1))return-1;for(J[1]=0,C=1;C<15;C++)J[C+1]=J[C]+oe[C];for(H=0;H<u;H++)p[h+H]!==0&&(_[J[p[h+H]]++]=H);if(z=d===0?(F=ze=_,19):d===1?(F=s,de-=257,ze=a,Se-=257,256):(F=l,ze=c,-1),C=y,L=f,ie=H=D=0,O=-1,E=(se=1<<(K=fe))-1,d===1&&852<se||d===2&&592<se)return 1;for(;;){for(j=C-ie,I=_[H]<z?(N=0,_[H]):_[H]>z?(N=ze[Se+_[H]],F[de+_[H]]):(N=96,0),k=1<<C-ie,y=v=1<<K;g[L+(D>>ie)+(v-=k)]=j<<24|N<<16|I|0,v!==0;);for(k=1<<C-1;D&k;)k>>=1;if(k!==0?(D&=k-1,D+=k):D=0,H++,--oe[C]==0){if(C===q)break;C=p[h+_[H]]}if(fe<C&&(D&E)!==O){for(ie===0&&(ie=fe),L+=y,Y=1<<(K=C-ie);K+ie<q&&!((Y-=oe[K+ie])<=0);)K++,Y<<=1;if(se+=1<<K,d===1&&852<se||d===2&&592<se)return 1;g[O=D&E]=fe<<24|K<<16|L-f|0}}return D!==0&&(g[L+D]=C-ie<<24|64<<16|0),b.bits=fe,0}},{"../utils/common":41}],51:[function(e,r,i){r.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(e,r,i){var o=e("../utils/common"),s=0,a=1;function l(S){for(var P=S.length;0<=--P;)S[P]=0}var c=0,d=29,p=256,h=p+1+d,u=30,g=19,f=2*h+1,_=15,b=16,k=7,v=256,O=16,E=17,L=18,z=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],j=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],N=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],I=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],U=new Array(2*(h+2));l(U);var C=new Array(2*u);l(C);var H=new Array(512);l(H);var y=new Array(256);l(y);var q=new Array(d);l(q);var fe,K,ie,Y=new Array(u);function se(S,P,X,Q,B){this.static_tree=S,this.extra_bits=P,this.extra_base=X,this.elems=Q,this.max_length=B,this.has_stree=S&&S.length}function D(S,P){this.dyn_tree=S,this.max_code=0,this.stat_desc=P}function F(S){return S<256?H[S]:H[256+(S>>>7)]}function de(S,P){S.pending_buf[S.pending++]=255&P,S.pending_buf[S.pending++]=P>>>8&255}function oe(S,P,X){S.bi_valid>b-X?(S.bi_buf|=P<<S.bi_valid&65535,de(S,S.bi_buf),S.bi_buf=P>>b-S.bi_valid,S.bi_valid+=X-b):(S.bi_buf|=P<<S.bi_valid&65535,S.bi_valid+=X)}function J(S,P,X){oe(S,X[2*P],X[2*P+1])}function ze(S,P){for(var X=0;X|=1&S,S>>>=1,X<<=1,0<--P;);return X>>>1}function Se(S,P,X){var Q,B,te=new Array(_+1),ue=0;for(Q=1;Q<=_;Q++)te[Q]=ue=ue+X[Q-1]<<1;for(B=0;B<=P;B++){var re=S[2*B+1];re!==0&&(S[2*B]=ze(te[re]++,re))}}function me(S){var P;for(P=0;P<h;P++)S.dyn_ltree[2*P]=0;for(P=0;P<u;P++)S.dyn_dtree[2*P]=0;for(P=0;P<g;P++)S.bl_tree[2*P]=0;S.dyn_ltree[2*v]=1,S.opt_len=S.static_len=0,S.last_lit=S.matches=0}function le(S){8<S.bi_valid?de(S,S.bi_buf):0<S.bi_valid&&(S.pending_buf[S.pending++]=S.bi_buf),S.bi_buf=0,S.bi_valid=0}function Te(S,P,X,Q){var B=2*P,te=2*X;return S[B]<S[te]||S[B]===S[te]&&Q[P]<=Q[X]}function Ce(S,P,X){for(var Q=S.heap[X],B=X<<1;B<=S.heap_len&&(B<S.heap_len&&Te(P,S.heap[B+1],S.heap[B],S.depth)&&B++,!Te(P,Q,S.heap[B],S.depth));)S.heap[X]=S.heap[B],X=B,B<<=1;S.heap[X]=Q}function Oe(S,P,X){var Q,B,te,ue,re=0;if(S.last_lit!==0)for(;Q=S.pending_buf[S.d_buf+2*re]<<8|S.pending_buf[S.d_buf+2*re+1],B=S.pending_buf[S.l_buf+re],re++,Q===0?J(S,B,P):(J(S,(te=y[B])+p+1,P),(ue=z[te])!==0&&oe(S,B-=q[te],ue),J(S,te=F(--Q),X),(ue=j[te])!==0&&oe(S,Q-=Y[te],ue)),re<S.last_lit;);J(S,v,P)}function he(S,P){var X,Q,B,te=P.dyn_tree,ue=P.stat_desc.static_tree,re=P.stat_desc.has_stree,_e=P.stat_desc.elems,Ae=-1;for(S.heap_len=0,S.heap_max=f,X=0;X<_e;X++)te[2*X]!==0?(S.heap[++S.heap_len]=Ae=X,S.depth[X]=0):te[2*X+1]=0;for(;S.heap_len<2;)te[2*(B=S.heap[++S.heap_len]=Ae<2?++Ae:0)]=1,S.depth[B]=0,S.opt_len--,re&&(S.static_len-=ue[2*B+1]);for(P.max_code=Ae,X=S.heap_len>>1;1<=X;X--)Ce(S,te,X);for(B=_e;X=S.heap[1],S.heap[1]=S.heap[S.heap_len--],Ce(S,te,1),Q=S.heap[1],S.heap[--S.heap_max]=X,S.heap[--S.heap_max]=Q,te[2*B]=te[2*X]+te[2*Q],S.depth[B]=(S.depth[X]>=S.depth[Q]?S.depth[X]:S.depth[Q])+1,te[2*X+1]=te[2*Q+1]=B,S.heap[1]=B++,Ce(S,te,1),2<=S.heap_len;);S.heap[--S.heap_max]=S.heap[1],function(ve,Fe){var yt,Ge,dt,De,ct,wt,Ke=Fe.dyn_tree,xt=Fe.max_code,tn=Fe.stat_desc.static_tree,nn=Fe.stat_desc.has_stree,Wt=Fe.stat_desc.extra_bits,zt=Fe.stat_desc.extra_base,st=Fe.stat_desc.max_length,ut=0;for(De=0;De<=_;De++)ve.bl_count[De]=0;for(Ke[2*ve.heap[ve.heap_max]+1]=0,yt=ve.heap_max+1;yt<f;yt++)st<(De=Ke[2*Ke[2*(Ge=ve.heap[yt])+1]+1]+1)&&(De=st,ut++),Ke[2*Ge+1]=De,xt<Ge||(ve.bl_count[De]++,ct=0,zt<=Ge&&(ct=Wt[Ge-zt]),wt=Ke[2*Ge],ve.opt_len+=wt*(De+ct),nn&&(ve.static_len+=wt*(tn[2*Ge+1]+ct)));if(ut!==0){do{for(De=st-1;ve.bl_count[De]===0;)De--;ve.bl_count[De]--,ve.bl_count[De+1]+=2,ve.bl_count[st]--,ut-=2}while(0<ut);for(De=st;De!==0;De--)for(Ge=ve.bl_count[De];Ge!==0;)xt<(dt=ve.heap[--yt])||(Ke[2*dt+1]!==De&&(ve.opt_len+=(De-Ke[2*dt+1])*Ke[2*dt],Ke[2*dt+1]=De),Ge--)}}(S,P),Se(te,Ae,S.bl_count)}function m(S,P,X){var Q,B,te=-1,ue=P[1],re=0,_e=7,Ae=4;for(ue===0&&(_e=138,Ae=3),P[2*(X+1)+1]=65535,Q=0;Q<=X;Q++)B=ue,ue=P[2*(Q+1)+1],++re<_e&&B===ue||(re<Ae?S.bl_tree[2*B]+=re:B!==0?(B!==te&&S.bl_tree[2*B]++,S.bl_tree[2*O]++):re<=10?S.bl_tree[2*E]++:S.bl_tree[2*L]++,te=B,Ae=(re=0)===ue?(_e=138,3):B===ue?(_e=6,3):(_e=7,4))}function W(S,P,X){var Q,B,te=-1,ue=P[1],re=0,_e=7,Ae=4;for(ue===0&&(_e=138,Ae=3),Q=0;Q<=X;Q++)if(B=ue,ue=P[2*(Q+1)+1],!(++re<_e&&B===ue)){if(re<Ae)for(;J(S,B,S.bl_tree),--re!=0;);else B!==0?(B!==te&&(J(S,B,S.bl_tree),re--),J(S,O,S.bl_tree),oe(S,re-3,2)):re<=10?(J(S,E,S.bl_tree),oe(S,re-3,3)):(J(S,L,S.bl_tree),oe(S,re-11,7));te=B,Ae=(re=0)===ue?(_e=138,3):B===ue?(_e=6,3):(_e=7,4)}}l(Y);var x=!1;function w(S,P,X,Q){oe(S,(c<<1)+(Q?1:0),3),function(B,te,ue,re){le(B),de(B,ue),de(B,~ue),o.arraySet(B.pending_buf,B.window,te,ue,B.pending),B.pending+=ue}(S,P,X)}i._tr_init=function(S){x||(function(){var P,X,Q,B,te,ue=new Array(_+1);for(B=Q=0;B<d-1;B++)for(q[B]=Q,P=0;P<1<<z[B];P++)y[Q++]=B;for(y[Q-1]=B,B=te=0;B<16;B++)for(Y[B]=te,P=0;P<1<<j[B];P++)H[te++]=B;for(te>>=7;B<u;B++)for(Y[B]=te<<7,P=0;P<1<<j[B]-7;P++)H[256+te++]=B;for(X=0;X<=_;X++)ue[X]=0;for(P=0;P<=143;)U[2*P+1]=8,P++,ue[8]++;for(;P<=255;)U[2*P+1]=9,P++,ue[9]++;for(;P<=279;)U[2*P+1]=7,P++,ue[7]++;for(;P<=287;)U[2*P+1]=8,P++,ue[8]++;for(Se(U,h+1,ue),P=0;P<u;P++)C[2*P+1]=5,C[2*P]=ze(P,5);fe=new se(U,z,p+1,h,_),K=new se(C,j,0,u,_),ie=new se(new Array(0),N,0,g,k)}(),x=!0),S.l_desc=new D(S.dyn_ltree,fe),S.d_desc=new D(S.dyn_dtree,K),S.bl_desc=new D(S.bl_tree,ie),S.bi_buf=0,S.bi_valid=0,me(S)},i._tr_stored_block=w,i._tr_flush_block=function(S,P,X,Q){var B,te,ue=0;0<S.level?(S.strm.data_type===2&&(S.strm.data_type=function(re){var _e,Ae=4093624447;for(_e=0;_e<=31;_e++,Ae>>>=1)if(1&Ae&&re.dyn_ltree[2*_e]!==0)return s;if(re.dyn_ltree[18]!==0||re.dyn_ltree[20]!==0||re.dyn_ltree[26]!==0)return a;for(_e=32;_e<p;_e++)if(re.dyn_ltree[2*_e]!==0)return a;return s}(S)),he(S,S.l_desc),he(S,S.d_desc),ue=function(re){var _e;for(m(re,re.dyn_ltree,re.l_desc.max_code),m(re,re.dyn_dtree,re.d_desc.max_code),he(re,re.bl_desc),_e=g-1;3<=_e&&re.bl_tree[2*I[_e]+1]===0;_e--);return re.opt_len+=3*(_e+1)+5+5+4,_e}(S),B=S.opt_len+3+7>>>3,(te=S.static_len+3+7>>>3)<=B&&(B=te)):B=te=X+5,X+4<=B&&P!==-1?w(S,P,X,Q):S.strategy===4||te===B?(oe(S,2+(Q?1:0),3),Oe(S,U,C)):(oe(S,4+(Q?1:0),3),function(re,_e,Ae,ve){var Fe;for(oe(re,_e-257,5),oe(re,Ae-1,5),oe(re,ve-4,4),Fe=0;Fe<ve;Fe++)oe(re,re.bl_tree[2*I[Fe]+1],3);W(re,re.dyn_ltree,_e-1),W(re,re.dyn_dtree,Ae-1)}(S,S.l_desc.max_code+1,S.d_desc.max_code+1,ue+1),Oe(S,S.dyn_ltree,S.dyn_dtree)),me(S),Q&&le(S)},i._tr_tally=function(S,P,X){return S.pending_buf[S.d_buf+2*S.last_lit]=P>>>8&255,S.pending_buf[S.d_buf+2*S.last_lit+1]=255&P,S.pending_buf[S.l_buf+S.last_lit]=255&X,S.last_lit++,P===0?S.dyn_ltree[2*X]++:(S.matches++,P--,S.dyn_ltree[2*(y[X]+p+1)]++,S.dyn_dtree[2*F(P)]++),S.last_lit===S.lit_bufsize-1},i._tr_align=function(S){oe(S,2,3),J(S,v,U),function(P){P.bi_valid===16?(de(P,P.bi_buf),P.bi_buf=0,P.bi_valid=0):8<=P.bi_valid&&(P.pending_buf[P.pending++]=255&P.bi_buf,P.bi_buf>>=8,P.bi_valid-=8)}(S)}},{"../utils/common":41}],53:[function(e,r,i){r.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(e,r,i){(function(o){(function(s,a){if(!s.setImmediate){var l,c,d,p,h=1,u={},g=!1,f=s.document,_=Object.getPrototypeOf&&Object.getPrototypeOf(s);_=_&&_.setTimeout?_:s,l={}.toString.call(s.process)==="[object process]"?function(O){process.nextTick(function(){k(O)})}:function(){if(s.postMessage&&!s.importScripts){var O=!0,E=s.onmessage;return s.onmessage=function(){O=!1},s.postMessage("","*"),s.onmessage=E,O}}()?(p="setImmediate$"+Math.random()+"$",s.addEventListener?s.addEventListener("message",v,!1):s.attachEvent("onmessage",v),function(O){s.postMessage(p+O,"*")}):s.MessageChannel?((d=new MessageChannel).port1.onmessage=function(O){k(O.data)},function(O){d.port2.postMessage(O)}):f&&"onreadystatechange"in f.createElement("script")?(c=f.documentElement,function(O){var E=f.createElement("script");E.onreadystatechange=function(){k(O),E.onreadystatechange=null,c.removeChild(E),E=null},c.appendChild(E)}):function(O){setTimeout(k,0,O)},_.setImmediate=function(O){typeof O!="function"&&(O=new Function(""+O));for(var E=new Array(arguments.length-1),L=0;L<E.length;L++)E[L]=arguments[L+1];var z={callback:O,args:E};return u[h]=z,l(h),h++},_.clearImmediate=b}function b(O){delete u[O]}function k(O){if(g)setTimeout(k,0,O);else{var E=u[O];if(E){g=!0;try{(function(L){var z=L.callback,j=L.args;switch(j.length){case 0:z();break;case 1:z(j[0]);break;case 2:z(j[0],j[1]);break;case 3:z(j[0],j[1],j[2]);break;default:z.apply(a,j)}})(E)}finally{b(O),g=!1}}}}function v(O){O.source===s&&typeof O.data=="string"&&O.data.indexOf(p)===0&&k(+O.data.slice(p.length))}})(typeof self>"u"?o===void 0?this:o:self)}).call(this,typeof dn<"u"?dn:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(Yi);var ss=Yi.exports;const as=os(ss);async function ls(n){let t;try{t=await as.loadAsync(n)}catch{return{ok:!1,error:"could not read this file as a zip"}}const e=t.file("manifest.json");if(!e)return{ok:!1,error:"not a valid export — manifest.json is missing"};let r;try{r=JSON.parse(await e.async("string"))}catch{return{ok:!1,error:"manifest.json is not valid JSON"}}return typeof r.workspace!="string"||r.workspace.length===0?{ok:!1,error:"manifest.json is missing a workspace name"}:Array.isArray(r.snapshots)?{ok:!0,manifest:{formatVersion:typeof r.formatVersion=="number"?r.formatVersion:1,workspace:r.workspace,exportedAt:typeof r.exportedAt=="string"?r.exportedAt:"",appVersion:typeof r.appVersion=="string"?r.appVersion:"",snapshots:r.snapshots.filter(i=>typeof i=="string")}}:{ok:!1,error:"manifest.json is missing the snapshots list"}}async function cs(n,t,e){const r=new FormData;r.set("file",n),r.set("targetWorkspace",t),r.set("mode",e);try{const o=await(await fetch("/import",{method:"POST",body:r})).json();return o.ok?o:{ok:!1,error:o.error??"Import failed"}}catch{return{ok:!1,error:"Network error during import"}}}async function us(n,t){try{await fetch("/snapshots/load",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspace:n,filename:t})})}catch(e){console.error("[agent-whiteboard] failed to load imported snapshot:",e)}}function qr(n){let t,e,r,i,o,s,a,l,c,d,p,h=n[2]&&Gr(n);function u(_,b){return _[10]?ps:_[7]==="prompt"&&_[1]?hs:_[1]?ds:fs}let g=u(n),f=g(n);return{c(){t=Z("div"),e=Z("div"),r=Z("div"),i=Z("span"),i.textContent="Import workspace",o=ae(),s=Z("button"),s.textContent="✕",a=ae(),l=Z("div"),h&&h.c(),c=ae(),f.c(),A(i,"class","modal-title svelte-1f2jqat"),A(s,"class","modal-close-btn svelte-1f2jqat"),A(s,"aria-label","Close"),A(r,"class","modal-header svelte-1f2jqat"),A(l,"class","modal-body svelte-1f2jqat"),A(e,"class","modal svelte-1f2jqat"),A(e,"role","dialog"),A(e,"aria-modal","true"),A(e,"aria-label","Import workspace"),A(e,"tabindex","-1"),A(t,"class","modal-overlay svelte-1f2jqat")},m(_,b){V(_,t,b),R(t,e),R(e,r),R(r,i),R(r,o),R(r,s),R(e,a),R(e,l),h&&h.m(l,null),R(l,c),f.m(l,null),d||(p=[ge(s,"click",n[18]),gn(wn.call(null,e,{onEscape:n[18]})),ge(t,"click",ji(n[18]))],d=!0)},p(_,b){_[2]?h?h.p(_,b):(h=Gr(_),h.c(),h.m(l,c)):h&&(h.d(1),h=null),g===(g=u(_))&&f?f.p(_,b):(f.d(1),f=g(_),f&&(f.c(),f.m(l,null)))},d(_){_&&G(t),h&&h.d(),f.d(),d=!1,Be(p)}}}function Gr(n){let t,e;return{c(){t=Z("p"),e=ee(n[2]),A(t,"class","modal-error svelte-1f2jqat")},m(r,i){V(r,t,i),R(t,e)},p(r,i){i&4&&ye(e,r[2])},d(r){r&&G(t)}}}function fs(n){let t,e,r,i,o;function s(c,d){return c[3]?_s:ms}let a=s(n),l=a(n);return{c(){t=Z("div"),l.c(),e=ae(),r=Z("input"),A(t,"class","drop-zone svelte-1f2jqat"),A(t,"role","button"),A(t,"tabindex","0"),Le(t,"drag-over",n[4]),A(r,"type","file"),A(r,"accept",".zip"),A(r,"class","visually-hidden-input svelte-1f2jqat"),A(r,"aria-label","Choose a .zip file to import")},m(c,d){V(c,t,d),l.m(t,null),V(c,e,d),V(c,r,d),n[23](r),i||(o=[ge(t,"drop",n[15]),ge(t,"dragover",n[16]),ge(t,"dragleave",n[17]),ge(t,"click",n[21]),ge(t,"keydown",n[22]),ge(r,"change",n[14])],i=!0)},p(c,d){a!==(a=s(c))&&(l.d(1),l=a(c),l&&(l.c(),l.m(t,null))),d&16&&Le(t,"drag-over",c[4])},d(c){c&&(G(t),G(e),G(r)),l.d(),n[23](null),i=!1,Be(o)}}}function ds(n){let t,e,r,i=n[1].workspace+"",o,s,a=n[1].snapshots.length+"",l,c,d=n[1].snapshots.length===1?"":"s",p,h,u,g,f=(n[6]||n[9])&&Yr(n);return{c(){t=Z("p"),e=ee("Workspace: "),r=Z("strong"),o=ee(i),s=ee(`
14
- (`),l=ee(a),c=ee(" snapshot"),p=ee(d),h=ee(")"),u=ae(),f&&f.c(),g=lt(),A(t,"class","import-resolved svelte-1f2jqat")},m(_,b){V(_,t,b),R(t,e),R(t,r),R(r,o),R(t,s),R(t,l),R(t,c),R(t,p),R(t,h),V(_,u,b),f&&f.m(_,b),V(_,g,b)},p(_,b){b&2&&i!==(i=_[1].workspace+"")&&ye(o,i),b&2&&a!==(a=_[1].snapshots.length+"")&&ye(l,a),b&2&&d!==(d=_[1].snapshots.length===1?"":"s")&&ye(p,d),_[6]||_[9]?f?f.p(_,b):(f=Yr(_),f.c(),f.m(g.parentNode,g)):f&&(f.d(1),f=null)},d(_){_&&(G(t),G(u),G(g)),f&&f.d(_)}}}function hs(n){let t,e,r,i=n[1].workspace+"",o,s,a,l,c,d,p,h,u,g,f,_,b,k,v,O,E,L;return{c(){t=Z("p"),e=ee("A workspace named "),r=Z("strong"),o=ee(i),s=ee(" already exists."),a=ae(),l=Z("div"),c=Z("button"),d=ee("Merge"),p=ae(),h=Z("div"),u=Z("input"),g=ae(),f=Z("button"),_=ee("Import as new"),k=ae(),v=Z("button"),O=ee("Cancel"),A(t,"class","import-resolved svelte-1f2jqat"),A(c,"class","collision-btn svelte-1f2jqat"),c.disabled=n[9],A(u,"type","text"),A(u,"aria-label","New workspace name"),u.disabled=n[9],A(u,"class","svelte-1f2jqat"),A(f,"class","collision-btn svelte-1f2jqat"),f.disabled=b=n[9]||n[8].trim().length===0,A(h,"class","collision-new svelte-1f2jqat"),A(v,"class","collision-btn collision-cancel svelte-1f2jqat"),v.disabled=n[9],A(l,"class","collision-actions svelte-1f2jqat")},m(z,j){V(z,t,j),R(t,e),R(t,r),R(r,o),R(t,s),V(z,a,j),V(z,l,j),R(l,c),R(c,d),R(l,p),R(l,h),R(h,u),Er(u,n[8]),R(h,g),R(h,f),R(f,_),R(l,k),R(l,v),R(v,O),E||(L=[ge(c,"click",n[11]),ge(u,"input",n[20]),ge(f,"click",n[12]),ge(v,"click",n[13])],E=!0)},p(z,j){j&2&&i!==(i=z[1].workspace+"")&&ye(o,i),j&512&&(c.disabled=z[9]),j&512&&(u.disabled=z[9]),j&256&&u.value!==z[8]&&Er(u,z[8]),j&768&&b!==(b=z[9]||z[8].trim().length===0)&&(f.disabled=b),j&512&&(v.disabled=z[9])},d(z){z&&(G(t),G(a),G(l)),E=!1,Be(L)}}}function ps(n){let t,e,r,i,o,s,a=n[10].workspace+"",l,c,d=n[10].added+"",p,h,u=n[10].updated+"",g,f,_=n[10].skipped+"",b,k;return{c(){t=Z("div"),e=Z("span"),e.innerHTML='<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="20 6 9 17 4 12"></polyline></svg>',r=ae(),i=Z("span"),o=ee("Imported into "),s=Z("strong"),l=ee(a),c=ee(` —
15
- `),p=ee(d),h=ee(" added, "),g=ee(u),f=ee(" updated, "),b=ee(_),k=ee(" skipped"),A(e,"class","check-circle svelte-1f2jqat"),A(t,"class","modal-confirm svelte-1f2jqat")},m(v,O){V(v,t,O),R(t,e),R(t,r),R(t,i),R(i,o),R(i,s),R(s,l),R(i,c),R(i,p),R(i,h),R(i,g),R(i,f),R(i,b),R(i,k)},p(v,O){O&1024&&a!==(a=v[10].workspace+"")&&ye(l,a),O&1024&&d!==(d=v[10].added+"")&&ye(p,d),O&1024&&u!==(u=v[10].updated+"")&&ye(g,u),O&1024&&_!==(_=v[10].skipped+"")&&ye(b,_)},d(v){v&&G(t)}}}function ms(n){let t;return{c(){t=Z("p"),t.innerHTML='Drop a <code class="svelte-1f2jqat">.zip</code> file here, or click to choose one'},m(e,r){V(e,t,r)},d(e){e&&G(t)}}}function _s(n){let t;return{c(){t=Z("p"),t.textContent="Reading…"},m(e,r){V(e,t,r)},d(e){e&&G(t)}}}function Yr(n){let t,e=n[9]?"Importing…":"Checking for existing workspaces…",r;return{c(){t=Z("p"),r=ee(e),A(t,"class","modal-step-hint svelte-1f2jqat")},m(i,o){V(i,t,o),R(t,r)},p(i,o){o&512&&e!==(e=i[9]?"Importing…":"Checking for existing workspaces…")&&ye(r,e)},d(i){i&&G(t)}}}function gs(n){let t,e=n[0]&&qr(n);return{c(){e&&e.c(),t=lt()},m(r,i){e&&e.m(r,i),V(r,t,i)},p(r,[i]){r[0]?e?e.p(r,i):(e=qr(r),e.c(),e.m(t.parentNode,t)):e&&(e.d(1),e=null)},i:be,o:be,d(r){r&&G(t),e&&e.d(r)}}}function bs(n,t){let e=2,r=`${n} (${e})`;for(;t.includes(r);)e++,r=`${n} (${e})`;return r}function ys(n,t,e){let{open:r=!1}=t;const i=$t();let o=null,s=null,a=null,l=!1,c=!1,d,p=[],h=!1,u=null,g="",f=!1,_=null,b=null;function k(){e(1,o=null),s=null,e(2,a=null),e(3,l=!1),e(4,c=!1),p=[],e(6,h=!1),e(7,u=null),e(8,g=""),e(9,f=!1),e(10,_=null),b&&clearTimeout(b),b=null}Qt(()=>{b&&clearTimeout(b)});async function v(ie){if(!ie.name.toLowerCase().endsWith(".zip")){e(2,a="please select a .zip file exported from this app"),e(1,o=null);return}e(3,l=!0),e(2,a=null);const Y=await ls(ie);if(e(3,l=!1),!Y.ok){e(2,a=Y.error),e(1,o=null);return}e(1,o=Y.manifest),s=ie,await O(Y.manifest.workspace)}async function O(ie){e(6,h=!0);const Y=await Kn();if(e(6,h=!1),p=Y.ok?Y.workspaces.map(se=>se.name):[],p.includes(ie)){e(8,g=bs(ie,p)),e(7,u="prompt");return}await j(ie,"create")}async function E(){o&&(e(7,u=null),await j(o.workspace,"merge"))}async function L(){const ie=g.trim();ie&&(e(7,u=null),await j(ie,"create"))}function z(){k()}async function j(ie,Y){if(!s)return;e(9,f=!0),e(2,a=null);const se=await cs(s,ie,Y);if(e(9,f=!1),!se.ok){e(2,a=se.error);return}e(10,_=se),se.newestFilename&&us(se.workspace,se.newestFilename),i("imported"),b=setTimeout(()=>i("close"),1500)}function N(ie){var D;const Y=ie.currentTarget,se=(D=Y.files)==null?void 0:D[0];se&&v(se),Y.value=""}function I(ie){var se;ie.preventDefault(),e(4,c=!1);const Y=(se=ie.dataTransfer)==null?void 0:se.files[0];Y&&v(Y)}function U(ie){ie.preventDefault(),e(4,c=!0)}function C(){e(4,c=!1)}function H(){i("close")}function y(){g=this.value,e(8,g)}const q=()=>d==null?void 0:d.click(),fe=ie=>{(ie.key==="Enter"||ie.key===" ")&&(d==null||d.click())};function K(ie){Ve[ie?"unshift":"push"](()=>{d=ie,e(5,d)})}return n.$$set=ie=>{"open"in ie&&e(0,r=ie.open)},n.$$.update=()=>{n.$$.dirty&1&&(r||k())},[r,o,a,l,c,d,h,u,g,f,_,E,L,z,N,I,U,C,H,v,y,q,fe,K]}class ws extends tt{constructor(t){super(),et(this,t,ys,gs,Xe,{open:0,acceptFile:19})}get acceptFile(){return this.$$.ctx[19]}}const Vr={sun:[{tag:"circle",cx:12,cy:12,r:4},{tag:"line",x1:12,y1:2,x2:12,y2:4},{tag:"line",x1:12,y1:20,x2:12,y2:22},{tag:"line",x1:4.93,y1:4.93,x2:6.34,y2:6.34},{tag:"line",x1:17.66,y1:17.66,x2:19.07,y2:19.07},{tag:"line",x1:2,y1:12,x2:4,y2:12},{tag:"line",x1:20,y1:12,x2:22,y2:12},{tag:"line",x1:4.93,y1:19.07,x2:6.34,y2:17.66},{tag:"line",x1:17.66,y1:6.34,x2:19.07,y2:4.93}],moon:[{tag:"path",d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"}],history:[{tag:"line",x1:8,y1:6,x2:21,y2:6},{tag:"line",x1:8,y1:12,x2:21,y2:12},{tag:"line",x1:8,y1:18,x2:21,y2:18},{tag:"line",x1:3,y1:6,x2:3.01,y2:6},{tag:"line",x1:3,y1:12,x2:3.01,y2:12},{tag:"line",x1:3,y1:18,x2:3.01,y2:18}],trash:[{tag:"polyline",points:"3 6 5 6 21 6"},{tag:"path",d:"M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6"},{tag:"path",d:"M10 11v6"},{tag:"path",d:"M14 11v6"},{tag:"path",d:"M9 6V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2"}],export:[{tag:"path",d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"},{tag:"polyline",points:"7 10 12 15 17 10"},{tag:"line",x1:12,y1:15,x2:12,y2:3}],check:[{tag:"polyline",points:"20 6 9 17 4 12"}],import:[{tag:"path",d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"},{tag:"polyline",points:"17 8 12 3 7 8"},{tag:"line",x1:12,y1:3,x2:12,y2:15}],transfer:[{tag:"line",x1:7,y1:4,x2:7,y2:20},{tag:"polyline",points:"3 8 7 4 11 8"},{tag:"line",x1:17,y1:20,x2:17,y2:4},{tag:"polyline",points:"13 16 17 20 21 16"}]};function Xr(n,t,e){const r=n.slice();return r[3]=t[e],r[5]=e,r}function ks(n){let t,e;return{c(){t=ft("polyline"),A(t,"points",e=n[3].points)},m(r,i){V(r,t,i)},p(r,i){i&1&&e!==(e=r[3].points)&&A(t,"points",e)},d(r){r&&G(t)}}}function vs(n){let t,e;return{c(){t=ft("path"),A(t,"d",e=n[3].d)},m(r,i){V(r,t,i)},p(r,i){i&1&&e!==(e=r[3].d)&&A(t,"d",e)},d(r){r&&G(t)}}}function Es(n){let t,e,r,i,o;return{c(){t=ft("line"),A(t,"x1",e=n[3].x1),A(t,"y1",r=n[3].y1),A(t,"x2",i=n[3].x2),A(t,"y2",o=n[3].y2)},m(s,a){V(s,t,a)},p(s,a){a&1&&e!==(e=s[3].x1)&&A(t,"x1",e),a&1&&r!==(r=s[3].y1)&&A(t,"y1",r),a&1&&i!==(i=s[3].x2)&&A(t,"x2",i),a&1&&o!==(o=s[3].y2)&&A(t,"y2",o)},d(s){s&&G(t)}}}function Ss(n){let t,e,r,i;return{c(){t=ft("circle"),A(t,"cx",e=n[3].cx),A(t,"cy",r=n[3].cy),A(t,"r",i=n[3].r)},m(o,s){V(o,t,s)},p(o,s){s&1&&e!==(e=o[3].cx)&&A(t,"cx",e),s&1&&r!==(r=o[3].cy)&&A(t,"cy",r),s&1&&i!==(i=o[3].r)&&A(t,"r",i)},d(o){o&&G(t)}}}function Kr(n,t){let e,r;function i(a,l){if(a[3].tag==="circle")return Ss;if(a[3].tag==="line")return Es;if(a[3].tag==="path")return vs;if(a[3].tag==="polyline")return ks}let o=i(t),s=o&&o(t);return{key:n,first:null,c(){e=lt(),s&&s.c(),r=lt(),this.first=e},m(a,l){V(a,e,l),s&&s.m(a,l),V(a,r,l)},p(a,l){t=a,o===(o=i(t))&&s?s.p(t,l):(s&&s.d(1),s=o&&o(t),s&&(s.c(),s.m(r.parentNode,r)))},d(a){a&&(G(e),G(r)),s&&s.d(a)}}}function Ts(n){let t,e=[],r=new Map,i=qe(Vr[n[0]]);const o=s=>s[5];for(let s=0;s<i.length;s+=1){let a=Xr(n,i,s),l=o(a);r.set(l,e[s]=Kr(l,a))}return{c(){t=ft("svg");for(let s=0;s<e.length;s+=1)e[s].c();A(t,"width",n[1]),A(t,"height",n[1]),A(t,"viewBox","0 0 24 24"),A(t,"fill","none"),A(t,"stroke","currentColor"),A(t,"stroke-width",n[2]),A(t,"stroke-linecap","round"),A(t,"stroke-linejoin","round"),A(t,"aria-hidden","true")},m(s,a){V(s,t,a);for(let l=0;l<e.length;l+=1)e[l]&&e[l].m(t,null)},p(s,[a]){a&1&&(i=qe(Vr[s[0]]),e=Tt(e,a,o,1,s,i,r,t,en,Kr,null,Xr)),a&2&&A(t,"width",s[1]),a&2&&A(t,"height",s[1]),a&4&&A(t,"stroke-width",s[2])},i:be,o:be,d(s){s&&G(t);for(let a=0;a<e.length;a+=1)e[a].d()}}}function As(n,t,e){let{name:r}=t,{size:i=15}=t,{strokeWidth:o=2.2}=t;return n.$$set=s=>{"name"in s&&e(0,r=s.name),"size"in s&&e(1,i=s.size),"strokeWidth"in s&&e(2,o=s.strokeWidth)},[r,i,o]}class St extends tt{constructor(t){super(),et(this,t,As,Ts,Xe,{name:0,size:1,strokeWidth:2})}}function Jr(n){let t,e,r,i,o,s,a,l,c,d,p;return r=new St({props:{name:"export",size:14}}),a=new St({props:{name:"import",size:14}}),{c(){t=Z("div"),e=Z("button"),He(r.$$.fragment),i=Z("span"),i.textContent="Export…",o=ae(),s=Z("button"),He(a.$$.fragment),l=Z("span"),l.textContent="Import…",A(e,"class","io-item svelte-npauoa"),A(e,"type","button"),A(e,"role","menuitem"),A(e,"tabindex","-1"),A(s,"class","io-item svelte-npauoa"),A(s,"type","button"),A(s,"role","menuitem"),A(s,"tabindex","-1"),A(t,"class","io-popover svelte-npauoa"),A(t,"role","menu"),A(t,"aria-label","Import / export")},m(h,u){V(h,t,u),R(t,e),je(r,e,null),R(e,i),n[12](e),R(t,o),R(t,s),je(a,s,null),R(s,l),n[14](s),c=!0,d||(p=[ge(e,"click",n[13]),ge(s,"click",n[15]),ge(t,"keydown",n[7])],d=!0)},p:be,i(h){c||(ke(r.$$.fragment,h),ke(a.$$.fragment,h),c=!0)},o(h){Ee(r.$$.fragment,h),Ee(a.$$.fragment,h),c=!1},d(h){h&&G(t),xe(r),n[12](null),xe(a),n[14](null),d=!1,Be(p)}}}function Cs(n){let t,e,r,i,o,s,a;r=new St({props:{name:"transfer"}});let l=n[0]&&Jr(n);return{c(){t=Z("div"),e=Z("button"),He(r.$$.fragment),i=ae(),l&&l.c(),A(e,"class","panel-icon-btn io-btn svelte-npauoa"),A(e,"type","button"),A(e,"aria-haspopup","menu"),A(e,"aria-expanded",n[0]),A(e,"aria-label","Import / export"),A(e,"title","Import / export"),A(t,"class","io-menu svelte-npauoa")},m(c,d){V(c,t,d),R(t,e),je(r,e,null),n[10](e),R(t,i),l&&l.m(t,null),n[16](t),o=!0,s||(a=[ge(window,"pointerdown",n[9]),ge(window,"mousedown",n[9]),ge(e,"click",n[11]),ge(e,"keydown",n[6])],s=!0)},p(c,[d]){(!o||d&1)&&A(e,"aria-expanded",c[0]),c[0]?l?(l.p(c,d),d&1&&ke(l,1)):(l=Jr(c),l.c(),ke(l,1),l.m(t,null)):l&&(it(),Ee(l,1,1,()=>{l=null}),ot())},i(c){o||(ke(r.$$.fragment,c),ke(l),o=!0)},o(c){Ee(r.$$.fragment,c),Ee(l),o=!1},d(c){c&&G(t),xe(r),n[10](null),l&&l.d(),n[16](null),s=!1,Be(a)}}}function Os(n,t,e){const r=$t();let i=!1,o,s,a=[];async function l(E=0){var L;e(0,i=!0),await Co(),(L=a[E])==null||L.focus()}function c(E){i&&(e(0,i=!1),E&&(s==null||s.focus()))}function d(E){E.key==="ArrowDown"?(E.preventDefault(),l(0)):E.key==="ArrowUp"&&(E.preventDefault(),l(1))}function p(E){var z,j;const L=a.findIndex(N=>N===document.activeElement);E.key==="ArrowDown"?(E.preventDefault(),(z=a[(L+1)%a.length])==null||z.focus()):E.key==="ArrowUp"?(E.preventDefault(),(j=a[(L-1+a.length)%a.length])==null||j.focus()):E.key==="Escape"?(E.preventDefault(),c(!0)):E.key==="Tab"&&c(!1)}function h(E){c(!1),r(E==="export"?"export":"import")}function u(E){i&&o&&!o.contains(E.target)&&c(!1)}function g(E){Ve[E?"unshift":"push"](()=>{s=E,e(2,s)})}const f=()=>i?c(!1):void l(0);function _(E){Ve[E?"unshift":"push"](()=>{a[0]=E,e(3,a)})}const b=()=>h("export");function k(E){Ve[E?"unshift":"push"](()=>{a[1]=E,e(3,a)})}const v=()=>h("import");function O(E){Ve[E?"unshift":"push"](()=>{o=E,e(1,o)})}return[i,o,s,a,l,c,d,p,h,u,g,f,_,b,k,v,O]}class Is extends tt{constructor(t){super(),et(this,t,Os,Cs,Xe,{})}}const Pt=[];function bt(n,t=be){let e;const r=new Set;function i(a){if(Xe(n,a)&&(n=a,e)){const l=!Pt.length;for(const c of r)c[1](),Pt.push(c,n);if(l){for(let c=0;c<Pt.length;c+=2)Pt[c][0](Pt[c+1]);Pt.length=0}}}function o(a){i(a(n))}function s(a,l=be){const c=[a,l];return r.add(c),r.size===1&&(e=t(i,o)||be),a(n),()=>{r.delete(c),r.size===0&&e&&(e(),e=null)}}return{set:i,update:o,subscribe:s}}const zs={presentation:null,driver:"static",placeholder:null,clickable:!1,nodeActions:void 0,nodeToFrameEnabled:!1};function Rs(n,t){if(t.action==="clear")return{presentation:null,driver:"static",placeholder:null,clickable:!1,nodeActions:void 0,nodeToFrameEnabled:!1};if(t.action==="replace"&&t.type==="step-frames-placeholder")return{...n,presentation:null,placeholder:{frameCount:t.frameCount,title:t.title},nodeToFrameEnabled:!1};if(t.action==="replace"){const r={cursor:0,frames:[{type:t.type,payload:t.payload,...t.frameLabel!==void 0?{label:t.frameLabel}:{}}],id:t.id,...t.title!==void 0?{title:t.title}:{}};return{...n,presentation:r,driver:t.total>1?"manual":"static",placeholder:null,currentFrame:t.cursor,totalFrames:t.total,viewport:t.viewport,nodeToFrame:t.nodeToFrame,nodeToFrameEnabled:t.nodeToFrame!==void 0}}return t.action==="set_node_actions"?{...n,clickable:t.enabled,nodeActions:t.enabled?t.node_actions??{}:void 0,nodeToFrameEnabled:t.enabled?!1:n.nodeToFrame!==void 0}:n}function Ds(){const{subscribe:n,update:t}=bt(zs);return{subscribe:n,dispatch(e){t(r=>Rs(r,e))}}}const Vi=Ds();function Ls(){const n=bt({armed:!1,sent:!1,error:!1});let t=null,e=null;function r(o){o.action==="set_done_armed"&&n.update(s=>({...s,armed:o.armed}))}async function i(){if(!mt(n).sent){try{const o=await fetch("/user-done",{method:"POST"});if(!o.ok)throw new Error(`unexpected status ${o.status}`)}catch(o){console.error("handleDone: POST /user-done failed",o),n.update(s=>({...s,error:!0})),e&&clearTimeout(e),e=setTimeout(()=>n.update(s=>({...s,error:!1})),2e3);return}n.update(o=>({...o,sent:!0})),t&&clearTimeout(t),t=setTimeout(()=>n.update(o=>({...o,sent:!1})),2e3)}}return{subscribe:n.subscribe,dispatch:r,handleDone:i}}const Jn=Ls();function Ns(){const n=bt({mode:null,workspaces:[],loadError:null});async function t(r){const i=await Kn();i.ok?n.update(o=>({...o,workspaces:i.workspaces,loadError:null,mode:r})):n.update(o=>({...o,workspaces:[],loadError:i.error,mode:r}))}function e(){n.update(r=>({...r,mode:null}))}return{subscribe:n.subscribe,open:t,close:e}}const _n=Ns(),Xi="agent-whiteboard:theme";function Ps(){return localStorage.getItem(Xi)==="dark"?"dark":"light"}function Fs(){const n=bt(Ps());n.subscribe(e=>{document.documentElement.setAttribute("data-theme",e),localStorage.setItem(Xi,e)});function t(){n.update(e=>e==="light"?"dark":"light")}return{subscribe:n.subscribe,toggle:t}}const Ki=Fs();async function Qr(n){await fetch("/step",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({direction:n})})}const Ms=["mermaid","svg","html","katex","vega-lite","quiz"],Bs=["replace","clear","set_node_actions","set_done_armed"];function Us(n){if(typeof n!="object"||n===null)return!1;const t=n.action;if(!Bs.includes(t))return!1;if(t!=="replace")return!0;const e=n.type;return e==="step-frames-placeholder"||Ms.includes(e)}const js=500,xs=1e4,Ws=10;function Hs(n){const e=`${location.protocol==="https:"?"wss":"ws"}://${location.host}/stream`;let r,i=0,o=null,s=!1;function a(){const c=i>=Ws;if(window.dispatchEvent(new CustomEvent("ws:disconnected",{detail:{exhausted:c}})),c)return;const d=Math.min(js*2**i,xs);i++,o=setTimeout(()=>{o=null,l()},d)}function l(){r=new WebSocket(e),r.addEventListener("message",c=>{let d;try{d=JSON.parse(c.data)}catch{console.error("ws: failed to parse message",c.data);return}if(!Us(d)){console.error("ws: received message with unrecognized action/type — ignoring",d);return}n(d)}),r.addEventListener("close",()=>{n({action:"clear"}),s||a()}),r.addEventListener("open",()=>{i=0,window.dispatchEvent(new CustomEvent("ws:connected"))})}return l(),()=>{s=!0,o!==null&&clearTimeout(o),r.close()}}const Qn=bt(!1),$n=bt(!1);function Zs(n){Vi.dispatch(n),Jn.dispatch(n)}function $r(n){Qn.set(!0);const t=n.detail;$n.set((t==null?void 0:t.exhausted)===!0)}function ei(){Qn.set(!1),$n.set(!1)}function qs(){const n=Hs(Zs);return window.addEventListener("ws:disconnected",$r),window.addEventListener("ws:connected",ei),()=>{n(),window.removeEventListener("ws:disconnected",$r),window.removeEventListener("ws:connected",ei)}}const Gs="modulepreload",Ys=function(n){return"/"+n},ti={},kn=function(t,e,r){let i=Promise.resolve();if(e&&e.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),a=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));i=Promise.allSettled(e.map(l=>{if(l=Ys(l),l in ti)return;ti[l]=!0;const c=l.endsWith(".css"),d=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${d}`))return;const p=document.createElement("link");if(p.rel=c?"stylesheet":Gs,c||(p.as="script"),p.crossOrigin="",p.href=l,a&&p.setAttribute("nonce",a),document.head.appendChild(p),c)return new Promise((h,u)=>{p.addEventListener("load",h),p.addEventListener("error",()=>u(new Error(`Unable to preload CSS for ${l}`)))})}))}function o(s){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=s,window.dispatchEvent(a),!a.defaultPrevented)throw s}return i.then(s=>{for(const a of s||[])a.status==="rejected"&&o(a.reason);return t().catch(o)})};/*! @license DOMPurify 3.4.15 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.15/LICENSE */function ni(n,t){(t==null||t>n.length)&&(t=n.length);for(var e=0,r=Array(t);e<t;e++)r[e]=n[e];return r}function Vs(n){if(Array.isArray(n))return n}function Xs(n,t){var e=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(e!=null){var r,i,o,s,a=[],l=!0,c=!1;try{if(o=(e=e.call(n)).next,t!==0)for(;!(l=(r=o.call(e)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(d){c=!0,i=d}finally{try{if(!l&&e.return!=null&&(s=e.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}function Ks(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
16
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Js(n,t){return Vs(n)||Xs(n,t)||Qs(n,t)||Ks()}function Qs(n,t){if(n){if(typeof n=="string")return ni(n,t);var e={}.toString.call(n).slice(8,-1);return e==="Object"&&n.constructor&&(e=n.constructor.name),e==="Map"||e==="Set"?Array.from(n):e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?ni(n,t):void 0}}const Ji=Object.entries,ri=Object.setPrototypeOf,$s=Object.isFrozen,ea=Object.getPrototypeOf,ta=Object.getOwnPropertyDescriptor;let Ue=Object.freeze,We=Object.seal,Bt=Object.create,Qi=typeof Reflect<"u"&&Reflect,Gn=Qi.apply,Yn=Qi.construct;Ue||(Ue=function(t){return t});We||(We=function(t){return t});Gn||(Gn=function(t,e){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];return t.apply(e,i)});Yn||(Yn=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return new t(...r)});const Ot=Me(Array.prototype.forEach),na=Me(Array.prototype.lastIndexOf),ii=Me(Array.prototype.pop),qt=Me(Array.prototype.push),ra=Me(Array.prototype.splice),jt=Array.isArray,Vt=Me(String.prototype.toLowerCase),Dn=Me(String.prototype.toString),oi=Me(String.prototype.match),Gt=Me(String.prototype.replace),si=Me(String.prototype.indexOf),ia=Me(String.prototype.trim),oa=Me(Number.prototype.toString),sa=Me(Boolean.prototype.toString),ai=typeof BigInt>"u"?null:Me(BigInt.prototype.toString),li=typeof Symbol>"u"?null:Me(Symbol.prototype.toString),$e=Me(Object.prototype.hasOwnProperty),Yt=Me(Object.prototype.toString),Ze=Me(RegExp.prototype.test),Ct=aa(TypeError);function Me(n){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return Gn(n,t,r)}}function aa(n){return function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return Yn(n,e)}}function Ie(n,t){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Vt;if(ri&&ri(n,null),!jt(t))return n;let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const o=e(i);o!==i&&($s(t)||(t[r]=o),i=o)}n[i]=!0}return n}function la(n){for(let t=0;t<n.length;t++)$e(n,t)||(n[t]=null);return n}function rt(n){const t=Bt(null);for(const r of Ji(n)){var e=Js(r,2);const i=e[0],o=e[1];$e(n,i)&&(jt(o)?t[i]=la(o):o&&typeof o=="object"&&o.constructor===Object?t[i]=rt(o):t[i]=o)}return t}function ca(n){switch(typeof n){case"string":return n;case"number":return oa(n);case"boolean":return sa(n);case"bigint":return ai?ai(n):"0";case"symbol":return li?li(n):"Symbol()";case"undefined":return Yt(n);case"function":case"object":{if(n===null)return Yt(n);const t=n,e=at(t,"toString");if(typeof e=="function"){const r=e(t);return typeof r=="string"?r:Yt(r)}return Yt(n)}default:return Yt(n)}}function at(n,t){for(;n!==null;){const r=ta(n,t);if(r){if(r.get)return Me(r.get);if(typeof r.value=="function")return Me(r.value)}n=ea(n)}function e(){return null}return e}function ua(n){try{return Ze(n,""),!0}catch{return!1}}const ci=Ue(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Ln=Ue(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Nn=Ue(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),fa=Ue(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Pn=Ue(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),da=Ue(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),ui=Ue(["#text"]),fi=Ue(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Fn=Ue(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),di=Ue(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),pn=Ue(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ha=We(/{{[\w\W]*|^[\w\W]*}}/g),pa=We(/<%[\w\W]*|^[\w\W]*%>/g),ma=We(/\${[\w\W]*/g),_a=We(/^data-[\-\w.\u00B7-\uFFFF]+$/),ga=We(/^aria-[\-\w]+$/),hi=We(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ba=We(/^(?:\w+script|data):/i),ya=We(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),wa=We(/^html$/i),ka=We(/^[a-z][.\w]*(-[.\w]+)+$/i),pi=We(/<[/\w!]/g),mi=We(/<[/\w]/g),va=We(/<\/no(script|embed|frames)/i),Ea=We(/\/>/i),nt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},$i=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],Sa=Ue(Ie({},$i)),Ta=function(){const n={};return Ot($i,t=>{n[t]=We(new RegExp("</"+t+"(?=[\\t\\n\\f\\r />])","i"))}),Ue(n)}(),Aa=function(){return typeof window>"u"?null:window},Ca=function(t,e){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";e&&e.hasAttribute(i)&&(r=e.getAttribute(i));const o="dompurify"+(r?"#"+r:"");try{return t.createPolicy(o,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},_i=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},vt=function(t,e,r,i){return $e(t,e)&&jt(t[e])?Ie(i.base?rt(i.base):{},t[e],i.transform):r},Mn=function(t,e,r){const i=$e(t,e)?t[e]:void 0;return i&&typeof i=="object"?rt(i):r()};function eo(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Aa();const t=ne=>eo(ne);if(t.version="3.4.15",t.removed=[],!n||!n.document||n.document.nodeType!==nt.document||!n.Element)return t.isSupported=!1,t;let e=n.document;const r=e,i=r.currentScript;n.DocumentFragment;const o=n.HTMLTemplateElement,s=n.Node,a=n.Element,l=n.NodeFilter,c=n.NamedNodeMap;c===void 0&&(n.NamedNodeMap||n.MozNamedAttrMap),n.HTMLFormElement;const d=n.DOMParser,p=n.trustedTypes,h=a.prototype,u=at(h,"cloneNode"),g=at(h,"remove"),f=at(h,"removeAttributeNode"),_=at(h,"nextSibling"),b=at(h,"childNodes"),k=at(h,"parentNode"),v=at(h,"shadowRoot"),O=at(h,"attributes"),E=s&&s.prototype?at(s.prototype,"nodeType"):null,L=s&&s.prototype?at(s.prototype,"nodeName"):null,z=s&&s.prototype?at(s.prototype,"ownerDocument"):null,j=function(T){return E?E(T):T.nodeType},N=function(T){return L?L(T):T.nodeName};if(typeof o=="function"){const ne=e.createElement("template");ne.content&&ne.content.ownerDocument&&(e=ne.content.ownerDocument)}let I,U="",C,H=!1,y=0;const q=function(){if(y>0)throw Ct('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},fe=function(T){q(),y++;try{return I.createHTML(T)}finally{y--}},K=function(T){q(),y++;try{return I.createScriptURL(T)}finally{y--}},ie=function(){return H||(C=Ca(p,i),H=!0),C},Y=e,se=Y.implementation,D=Y.createNodeIterator,F=Y.createDocumentFragment,de=Y.getElementsByTagName,oe=r.importNode;let J=_i();t.isSupported=typeof Ji=="function"&&typeof k=="function"&&se&&se.createHTMLDocument!==void 0;const ze=ha,Se=pa,me=ma,le=_a,Te=ga,Ce=ba,Oe=ya,he=ka;let m=hi,W=null;const x=Ie({},[...ci,...Ln,...Nn,...Pn,...ui]);let w=null;const S=Ie({},[...fi,...Fn,...di,...pn]);let P=Object.seal(Bt(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),X=null,Q=null;const B=Object.seal(Bt(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let te=!0,ue=!0,re=!1,_e=!0,Ae=!1,ve=!0,Fe=!1,yt=!1,Ge=null,dt=null,De=!1,ct=!1,wt=!1,Ke=!1,xt=!0,tn=!1;const nn="user-content-";let Wt=!0,zt=!1,st={},ut=null;const er=Ie({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let tr=null;const nr=Ie({},["audio","video","img","source","image","track"]);let rr=null;const ir=Ie({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),rn="http://www.w3.org/1998/Math/MathML",on="http://www.w3.org/2000/svg",ht="http://www.w3.org/1999/xhtml";let Rt=ht,vn=!1,En=null;const no=Ie({},[rn,on,ht],Dn),or=Ue(["mi","mo","mn","ms","mtext"]);let Sn=Ie({},or);const sr=Ue(["annotation-xml"]);let Tn=Ie({},sr);const ro=Ie({},["title","style","font","a","script"]);let Ht=null;const io=["application/xhtml+xml","text/html"],oo="text/html";let Pe=null,Dt=null;const so=e.createElement("form"),ar=function(T){return T instanceof RegExp||T instanceof Function},An=function(){let T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Dt&&Dt===T)return;(!T||typeof T!="object")&&(T={}),T=rt(T),Ht=io.indexOf(T.PARSER_MEDIA_TYPE)===-1?oo:T.PARSER_MEDIA_TYPE,Pe=Ht==="application/xhtml+xml"?Dn:Vt,W=vt(T,"ALLOWED_TAGS",x,{transform:Pe}),w=vt(T,"ALLOWED_ATTR",S,{transform:Pe}),En=vt(T,"ALLOWED_NAMESPACES",no,{transform:Dn}),rr=vt(T,"ADD_URI_SAFE_ATTR",ir,{transform:Pe,base:ir}),tr=vt(T,"ADD_DATA_URI_TAGS",nr,{transform:Pe,base:nr}),ut=vt(T,"FORBID_CONTENTS",er,{transform:Pe}),X=vt(T,"FORBID_TAGS",rt({}),{transform:Pe}),Q=vt(T,"FORBID_ATTR",rt({}),{transform:Pe}),st=$e(T,"USE_PROFILES")?T.USE_PROFILES&&typeof T.USE_PROFILES=="object"?rt(T.USE_PROFILES):T.USE_PROFILES:!1,te=T.ALLOW_ARIA_ATTR!==!1,ue=T.ALLOW_DATA_ATTR!==!1,re=T.ALLOW_UNKNOWN_PROTOCOLS||!1,_e=T.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ae=T.SAFE_FOR_TEMPLATES||!1,ve=T.SAFE_FOR_XML!==!1,Fe=T.WHOLE_DOCUMENT||!1,ct=T.RETURN_DOM||!1,wt=T.RETURN_DOM_FRAGMENT||!1,Ke=T.RETURN_TRUSTED_TYPE||!1,De=T.FORCE_BODY||!1,xt=T.SANITIZE_DOM!==!1,tn=T.SANITIZE_NAMED_PROPS||!1,Wt=T.KEEP_CONTENT!==!1,zt=T.IN_PLACE||!1,m=ua(T.ALLOWED_URI_REGEXP)?T.ALLOWED_URI_REGEXP:hi,Rt=typeof T.NAMESPACE=="string"?T.NAMESPACE:ht,Sn=Mn(T,"MATHML_TEXT_INTEGRATION_POINTS",()=>Ie({},or)),Tn=Mn(T,"HTML_INTEGRATION_POINTS",()=>Ie({},sr));const M=Mn(T,"CUSTOM_ELEMENT_HANDLING",()=>Bt(null));if(P=Bt(null),$e(M,"tagNameCheck")&&ar(M.tagNameCheck)&&(P.tagNameCheck=M.tagNameCheck),$e(M,"attributeNameCheck")&&ar(M.attributeNameCheck)&&(P.attributeNameCheck=M.attributeNameCheck),$e(M,"allowCustomizedBuiltInElements")&&typeof M.allowCustomizedBuiltInElements=="boolean"&&(P.allowCustomizedBuiltInElements=M.allowCustomizedBuiltInElements),We(P),Ae&&(ue=!1),wt&&(ct=!0),st&&(W=Ie({},ui),w=Bt(null),st.html===!0&&(Ie(W,ci),Ie(w,fi)),st.svg===!0&&(Ie(W,Ln),Ie(w,Fn),Ie(w,pn)),st.svgFilters===!0&&(Ie(W,Nn),Ie(w,Fn),Ie(w,pn)),st.mathMl===!0&&(Ie(W,Pn),Ie(w,di),Ie(w,pn))),B.tagCheck=null,B.attributeCheck=null,$e(T,"ADD_TAGS")&&(typeof T.ADD_TAGS=="function"?B.tagCheck=T.ADD_TAGS:jt(T.ADD_TAGS)&&(W===x&&(W=rt(W)),Ie(W,T.ADD_TAGS,Pe))),$e(T,"ADD_ATTR")&&(typeof T.ADD_ATTR=="function"?B.attributeCheck=T.ADD_ATTR:jt(T.ADD_ATTR)&&(w===S&&(w=rt(w)),Ie(w,T.ADD_ATTR,Pe))),$e(T,"ADD_FORBID_CONTENTS")&&jt(T.ADD_FORBID_CONTENTS)&&(ut===er&&(ut=rt(ut)),Ie(ut,T.ADD_FORBID_CONTENTS,Pe)),Wt&&(W["#text"]=!0),Fe&&Ie(W,["html","head","body"]),W.table&&(Ie(W,["tbody"]),delete X.tbody),T.TRUSTED_TYPES_POLICY){if(typeof T.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ct('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof T.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ct('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const $=I;I=T.TRUSTED_TYPES_POLICY;try{U=fe("")}catch(ce){throw I=$,ce}}else T.TRUSTED_TYPES_POLICY===null?(I=void 0,U=""):(I===void 0&&(I=ie()),I&&typeof U=="string"&&(U=fe("")));Ue&&Ue(T),Dt=T},lr=Ie({},[...Ln,...Nn,...fa]),cr=Ie({},[...Pn,...da]),ao=function(T,M,$){return M.namespaceURI===ht?T==="svg":M.namespaceURI===rn?T==="svg"&&($==="annotation-xml"||Sn[$]):!!lr[T]},lo=function(T,M,$){return M.namespaceURI===ht?T==="math":M.namespaceURI===on?T==="math"&&Tn[$]:!!cr[T]},co=function(T,M,$){return M.namespaceURI===on&&!Tn[$]||M.namespaceURI===rn&&!Sn[$]?!1:!cr[T]&&(ro[T]||!lr[T])},uo=function(T){let M=k(T);(!M||!M.tagName)&&(M={namespaceURI:Rt,tagName:"template"});const $=Vt(T.tagName),ce=Vt(M.tagName);return En[T.namespaceURI]?T.namespaceURI===on?ao($,M,ce):T.namespaceURI===rn?lo($,M,ce):T.namespaceURI===ht?co($,M,ce):!!(Ht==="application/xhtml+xml"&&En[T.namespaceURI]):!1},kt=function(T){qt(t.removed,{element:T});try{k(T).removeChild(T)}catch{if(g(T),!k(T))throw Ct("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},ur=function(T,M,$){try{f(T,M)}catch{try{T.removeAttribute($)}catch{}}},sn=function(T){an(T);const M=b(T);if(M){const ce=[];Ot(M,pe=>{qt(ce,pe)}),Ot(ce,pe=>{try{g(pe)}catch{}})}const $=O(T);if($)for(let ce=$.length-1;ce>=0;--ce){const pe=$[ce],we=pe&&pe.name;typeof we=="string"&&ur(T,pe,we)}},At=function(T,M,$){if(!$)try{$=M.getAttributeNode(T)}catch{$=null}qt(t.removed,{attribute:$||null,from:M});try{$?f(M,$):M.removeAttribute(T)}catch{try{M.removeAttribute(T)}catch{}}if(T==="is")if(ct||wt)try{kt(M)}catch{}else try{M.setAttribute(T,"")}catch{}},fo=function(T){const M=O(T);if(M)for(let $=M.length-1;$>=0;--$){const ce=M[$],pe=ce&&ce.name;typeof pe!="string"||w[Pe(pe)]||ur(T,ce,pe)}},an=function(T){const M=[T];for(;M.length>0;){const $=M.pop();j($)===nt.element&&fo($);const pe=b($);if(pe)for(let we=pe.length-1;we>=0;--we)M.push(pe[we])}},fr=function(T,M){return ve?T==="patchsrc"?!0:T==="for"&&M!=="label"&&M!=="output":!1},ho=function(T){if(!ve)return;const M=[T];for(;M.length>0;){const $=M.pop(),ce=j($);if(ce===nt.processingInstruction||ce===nt.comment&&Ze(mi,$.data)){try{g($)}catch{}continue}if(ce===nt.element){const we=$,Re=Pe(N($));try{we.hasAttribute&&we.hasAttribute("patchsrc")&&we.removeAttribute("patchsrc"),we.hasAttribute&&we.hasAttribute("for")&&fr("for",Re)&&we.removeAttribute("for")}catch{}}const pe=b($);if(pe)for(let we=pe.length-1;we>=0;--we)M.push(pe[we])}},dr=function(T){let M=null,$=null;if(De)T="<remove></remove>"+T;else{const we=oi(T,/^[\r\n\t ]+/);$=we&&we[0]}Ht==="application/xhtml+xml"&&Rt===ht&&(T='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+T+"</body></html>");const ce=I?fe(T):T;if(Rt===ht)try{M=new d().parseFromString(ce,Ht)}catch{}if(!M||!M.documentElement){M=se.createDocument(Rt,"template",null);try{M.documentElement.innerHTML=vn?U:ce}catch{}}const pe=M.body||M.documentElement;return T&&$&&pe.insertBefore(e.createTextNode($),pe.childNodes[0]||null),Rt===ht?de.call(M,Fe?"html":"body")[0]:Fe?M.documentElement:pe},hr=function(T){const M=z?z(T):T.ownerDocument;return D.call(M||T,T,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},ln=function(T){return T=Gt(T,ze," "),T=Gt(T,Se," "),T=Gt(T,me," "),T},Cn=function(T){var M;T.normalize();const $=z?z(T):T.ownerDocument,ce=D.call($||T,T,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null);let pe=ce.nextNode();for(;pe;)pe.data=ln(pe.data),pe=ce.nextNode();const we=(M=T.querySelectorAll)===null||M===void 0?void 0:M.call(T,"template");we&&Ot(we,Re=>{Lt(Re.content)&&Cn(Re.content)})},cn=function(T){const M=L?L(T):null;return typeof M!="string"||Pe(M)!=="form"?!1:typeof T.nodeName!="string"||typeof T.textContent!="string"||typeof T.removeChild!="function"||T.attributes!==O(T)||typeof T.removeAttribute!="function"||typeof T.removeAttributeNode!="function"||typeof T.getAttributeNode!="function"||typeof T.setAttribute!="function"||typeof T.namespaceURI!="string"||typeof T.insertBefore!="function"||typeof T.hasChildNodes!="function"||T.nodeType!==E(T)||T.childNodes!==b(T)},Lt=function(T){if(!E||typeof T!="object"||T===null)return!1;try{return E(T)===nt.documentFragment}catch{return!1}},Zt=function(T){if(!E||typeof T!="object"||T===null)return!1;try{return typeof E(T)=="number"}catch{return!1}};function pt(ne,T,M){ne.length!==0&&Ot(ne,$=>{$.call(t,T,M,Dt)})}const po=function(T,M){return!!(ve&&T.hasChildNodes()&&!Zt(T.firstElementChild)&&Ze(pi,T.textContent)&&Ze(pi,T.innerHTML)||ve&&T.namespaceURI===ht&&Sa[M]&&(Zt(T.firstElementChild)||typeof T.textContent=="string"&&Ze(Ta[M],T.textContent))||T.nodeType===nt.processingInstruction||ve&&T.nodeType===nt.comment&&Ze(mi,T.data))},un=function(T,M){if(T instanceof RegExp)return Ze(T,M);if(T instanceof Function){for(var $=arguments.length,ce=new Array($>2?$-2:0),pe=2;pe<$;pe++)ce[pe-2]=arguments[pe];return!!T(M,...ce)}return!1},mo=function(T,M,$){if(!X[M]&&br(M)&&un(P.tagNameCheck,M))return!1;if(Wt&&!ut[M]){const ce=k(T),pe=b(T);if(pe&&ce){const we=pe.length;for(let Re=we-1;Re>=0;--Re){const Ne=T===$?u(pe[Re],!0):pe[Re];ce.insertBefore(Ne,_(T))}}}return kt(T),!0},pr=function(T,M,$,ce){return T.length===0?M:M===$||M===ce?rt(M):M},mr=function(T,M){return T===M||k(T)!==null?!1:(zt&&an(T),!0)},_r=function(T,M){if(pt(J.beforeSanitizeElements,T,null),mr(T,M))return!0;if(cn(T))return kt(T),!0;const $=Pe(N(T));if(W=pr(J.uponSanitizeElement,W,x,Ge),pt(J.uponSanitizeElement,T,{tagName:$,allowedTags:W}),mr(T,M))return!0;if(po(T,$))return kt(T),!0;if(X[$]||!(B.tagCheck instanceof Function&&B.tagCheck($))&&!W[$]){const pe=mo(T,$,M);return pe===!1&&pt(J.afterSanitizeElements,T,null),pe}if(j(T)===nt.element&&!uo(T)||($==="noscript"||$==="noembed"||$==="noframes")&&Ze(va,T.innerHTML))return kt(T),!0;if(Ae&&T.nodeType===nt.text){const pe=ln(T.textContent);T.textContent!==pe&&(qt(t.removed,{element:T.cloneNode()}),T.textContent=pe)}return pt(J.afterSanitizeElements,T,null),!1},gr=function(T,M,$){if(Q[M]||fr(M,T)||xt&&(M==="id"||M==="name")&&($ in e||$ in so))return!1;const ce=w[M]||B.attributeCheck instanceof Function&&B.attributeCheck(M,T);return ue&&Ze(le,M)||te&&Ze(Te,M)?!0:ce?rr[M]||Ze(m,Gt($,Oe,""))||(M==="src"||M==="xlink:href"||M==="href")&&T!=="script"&&si($,"data:")===0&&tr[T]||re&&!Ze(Ce,Gt($,Oe,""))?!0:!$:br(T)&&un(P.tagNameCheck,T)&&un(P.attributeNameCheck,M,T)||M==="is"&&P.allowCustomizedBuiltInElements&&un(P.tagNameCheck,$)},_o=Ie({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),br=function(T){return!_o[Vt(T)]&&Ze(he,T)},go=function(T,M,$,ce){if(I&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!$)switch(p.getAttributeType(T,M)){case"TrustedHTML":return fe(ce);case"TrustedScriptURL":return K(ce)}return ce},bo=function(T,M,$,ce){try{return $?T.setAttributeNS($,M,ce):T.setAttribute(M,ce),cn(T)?(kt(T),!1):!0}catch{return At(M,T),!1}},yr=function(T){pt(J.beforeSanitizeAttributes,T,null);const M=T.attributes;if(!M||cn(T))return;w=pr(J.uponSanitizeAttribute,w,S,dt);const $={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:w,forceKeepAttr:void 0};let ce=M.length;const pe=Pe(T.nodeName);for(;ce--;){const we=M[ce],Re=we.name,Ne=we.namespaceURI,Je=we.value,Qe=Pe(Re),In=Je;let Ye=Re==="value"?In:ia(In),wr=!1;if($.attrName=Qe,$.attrValue=Ye,$.keepAttr=!0,$.forceKeepAttr=void 0,pt(J.uponSanitizeAttribute,T,$),Ye=$.attrValue,tn&&(Qe==="id"||Qe==="name")&&si(Ye,nn)!==0&&(At(Re,T,we),Ye=nn+Ye,wr=!0),ve&&Ze(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Ye)){At(Re,T,we);continue}if(Qe==="attributename"&&oi(Ye,"href")){At(Re,T,we);continue}if(!$.forceKeepAttr){if(!$.keepAttr){At(Re,T,we);continue}if(!_e&&Ze(Ea,Ye)){At(Re,T,we);continue}if(Ae&&(Ye=ln(Ye)),!gr(pe,Qe,Ye)){At(Re,T,we);continue}Ye=go(pe,Qe,Ne,Ye),Ye!==In&&bo(T,Re,Ne,Ye)&&wr&&ii(t.removed)}}pt(J.afterSanitizeAttributes,T,null)},fn=function(T){let M=null;const $=hr(T);for(pt(J.beforeSanitizeShadowDOM,T,null);M=$.nextNode();)if(pt(J.uponSanitizeShadowNode,M,null),_r(M,T),yr(M),Lt(M.content)&&fn(M.content),j(M)===nt.element){const ce=v(M);Lt(ce)&&(On(ce),fn(ce))}pt(J.afterSanitizeShadowDOM,T,null)},On=function(T){const M=[{node:T,shadow:null}];for(;M.length>0;){const $=M.pop();if($.shadow){fn($.shadow);continue}const ce=$.node,we=j(ce)===nt.element,Re=b(ce);if(Re)for(let Ne=Re.length-1;Ne>=0;--Ne)M.push({node:Re[Ne],shadow:null});if(we){const Ne=L?L(ce):null;if(typeof Ne=="string"&&Pe(Ne)==="template"){const Je=ce.content;Lt(Je)&&M.push({node:Je,shadow:null})}}if(we){const Ne=v(ce);Lt(Ne)&&M.push({node:null,shadow:Ne},{node:Ne,shadow:null})}}};return t.sanitize=function(ne){let T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},M=null,$=null,ce=null,pe=null;if(vn=!ne,vn&&(ne="<!-->"),typeof ne!="string"&&!Zt(ne)&&(ne=ca(ne),typeof ne!="string"))throw Ct("dirty is not a string, aborting");if(!t.isSupported)return ne;yt?(W=Ge,w=dt):An(T),(J.uponSanitizeElement.length>0||J.uponSanitizeAttribute.length>0)&&(W=rt(W)),J.uponSanitizeAttribute.length>0&&(w=rt(w)),t.removed=[];const we=zt&&typeof ne!="string"&&Zt(ne);if(we){ho(ne);const Je=N(ne);if(typeof Je=="string"){const Qe=Pe(Je);if(!W[Qe]||X[Qe])throw sn(ne),Ct("root node is forbidden and cannot be sanitized in-place")}if(cn(ne))throw sn(ne),Ct("root node is clobbered and cannot be sanitized in-place");try{On(ne)}catch(Qe){throw sn(ne),Qe}}else if(Zt(ne))M=dr("<!---->"),$=M.ownerDocument.importNode(ne,!0),$.nodeType===nt.element&&$.nodeName==="BODY"||$.nodeName==="HTML"?M=$:M.appendChild($),On(M);else{if(!ct&&!Ae&&!Fe&&ne.indexOf("<")===-1)return I&&Ke?fe(ne):ne;if(M=dr(ne),!M)return ct?null:Ke?U:""}M&&De&&kt(M.firstChild);const Re=we?ne:M;try{const Je=hr(Re);for(;ce=Je.nextNode();)_r(ce,Re),yr(ce),Lt(ce.content)&&fn(ce.content)}catch(Je){throw we&&(sn(ne),Ot(t.removed,Qe=>{Qe.element&&an(Qe.element)})),Je}if(we)return Ot(t.removed,Je=>{Je.element&&an(Je.element)}),Ae&&Cn(ne),ne;if(ct){if(Ae&&Cn(M),wt)for(pe=F.call(M.ownerDocument);M.firstChild;)pe.appendChild(M.firstChild);else pe=M;return(w.shadowroot||w.shadowrootmode)&&(pe=oe.call(r,pe,!0)),pe}let Ne=Fe?M.outerHTML:M.innerHTML;return Fe&&W["!doctype"]&&M.ownerDocument&&M.ownerDocument.doctype&&M.ownerDocument.doctype.name&&Ze(wa,M.ownerDocument.doctype.name)&&(Ne="<!DOCTYPE "+M.ownerDocument.doctype.name+`>
17
- `+Ne),Ae&&(Ne=ln(Ne)),I&&Ke?fe(Ne):Ne},t.setConfig=function(){let ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};An(ne),yt=!0,Ge=W,dt=w},t.clearConfig=function(){Dt=null,yt=!1,Ge=null,dt=null,I=C,U=""},t.isValidAttribute=function(ne,T,M){Dt||An({});const $=Pe(ne),ce=Pe(T);return gr($,ce,M)},t.addHook=function(ne,T){typeof T=="function"&&$e(J,ne)&&qt(J[ne],T)},t.removeHook=function(ne,T){if($e(J,ne)){if(T!==void 0){const M=na(J[ne],T);return M===-1?void 0:ra(J[ne],M,1)[0]}return ii(J[ne])}},t.removeHooks=function(ne){$e(J,ne)&&(J[ne]=[])},t.removeAllHooks=function(){J=_i()},t}var to=eo();const Bn=.1,Un=10,Oa=.001,Ia=.92,za=800;function Ra(n){const t=bt(1),e=bt(0),r=bt(0),i=bt(!1);let o=0,s=0,a=0,l=0,c=null;function d(O){const E=n.getWrapper();if(!E)return;const L=O.getAttribute("viewBox");let z,j;if(L){const H=L.trim().split(/\s+/).map(Number);z=H[2],j=H[3]}else z=O.clientWidth||1,j=O.clientHeight||1;if(!z||!j)return;const N=E.clientWidth,I=E.clientHeight,U=Math.min(N/z,I/j)*Ia,C=Math.min(Un,Math.max(Bn,U));t.set(C),e.set((N-z*C)/2),r.set((I-j*C)/2)}function p(O){const E=n.getWrapper();E&&(t.set(Math.min(Un,Math.max(Bn,O.scale))),e.set(O.positionX*E.clientWidth),r.set(O.positionY*E.clientHeight))}function h(){c&&clearTimeout(c),c=setTimeout(()=>{c=null,u()},za)}function u(){const O=n.getSnapshotId(),E=n.getWrapper();if(!O||!E)return;const L=mt(e)/E.clientWidth,z=mt(r)/E.clientHeight;fetch("/viewport",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:O,frame:n.getCurrentFrame(),scale:mt(t),positionX:L,positionY:z})}).catch(()=>{})}function g(){var E;const O=(E=n.getContainer())==null?void 0:E.querySelector("svg");O?d(O):(t.set(1),e.set(0),r.set(0)),h()}function f(O){O.preventDefault();const E=n.getWrapper();if(!E)return;const L=mt(t),z=-O.deltaY*Oa,j=Math.min(Un,Math.max(Bn,L+z*L)),N=E.getBoundingClientRect(),I=O.clientX-N.left,U=O.clientY-N.top,C=mt(e),H=mt(r);e.set(I-(I-C)*(j/L)),r.set(U-(U-H)*(j/L)),t.set(j),h()}function _(O){O.button===0&&(i.set(!0),o=O.clientX,s=O.clientY,a=mt(e),l=mt(r),O.preventDefault())}function b(O){mt(i)&&(e.set(a+(O.clientX-o)),r.set(l+(O.clientY-s)),h())}function k(){i.set(!1)}function v(){c&&clearTimeout(c),c=null}return{scale:t,tx:e,ty:r,dragging:i,fitToView:d,applyViewport:p,resetTransform:g,onWheel:f,onMousedown:_,onMousemove:b,onMouseup:k,scheduleViewportReport:h,reportViewport:u,destroy:v}}function Ft(n){n.stopPropagation()}async function jn(n){await fetch("/node-click",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}).catch(()=>{})}function Da(n){async function t(d){var f;d.stopPropagation();const p=d.currentTarget.closest(".node")??d.currentTarget,h=n.extractNodeId(p)??p.id,u=n.extractNodeLabel(p),g=(f=n.getNodeActions())==null?void 0:f[h];if(g&&g.length>0){const _=d;n.onPopupRequest({x:_.clientX,y:_.clientY,nodeId:h,nodeLabel:u,actions:g});return}await jn({type:"node",id:h,label:u})}async function e(d){var g;d.stopPropagation();const p=d.currentTarget,h=n.extractEdgeId(p)??"",u=((g=p.textContent)==null?void 0:g.trim())??"";await jn({type:"edge",id:h,label:u})}let r=null;function i(){o();const d=n.getContainer();if(!d)return;const p=d.querySelector("svg");if(!p)return;const h=p.querySelectorAll(".node"),u=p.querySelectorAll(".edgeLabel");for(const g of h)g.addEventListener("click",t),g.addEventListener("mousedown",Ft),g.style.cursor="pointer",g.classList.add("clickable-node");for(const g of u)g.addEventListener("click",e),g.addEventListener("mousedown",Ft),g.style.cursor="pointer";r=()=>{for(const g of h)g.removeEventListener("click",t),g.removeEventListener("mousedown",Ft),g.style.cursor="",g.classList.remove("clickable-node");for(const g of u)g.removeEventListener("click",e),g.removeEventListener("mousedown",Ft),g.style.cursor=""}}function o(){r==null||r(),r=null}let s=null;function a(d){l();const p=n.getContainer();if(!p)return;const h=p.querySelector("svg");if(!h)return;const u=h.querySelectorAll(".node");for(const g of u){const f=n.extractNodeId(g);if(f===null||!(f in d))continue;const _=d[f],b=k=>{k.stopPropagation(),fetch("/seek",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({frame:_})}).catch(()=>{})};g.addEventListener("click",b),g.addEventListener("mousedown",Ft),g.style.cursor="pointer",s=(k=>()=>{k==null||k(),g.removeEventListener("click",b),g.removeEventListener("mousedown",Ft),g.style.cursor=""})(s)}}function l(){s==null||s(),s=null}async function c(d,p){await jn({type:"node",id:d.nodeId,label:d.nodeLabel,action:p})}return{attachClickListeners:i,detachClickListeners:o,attachNodeToFrameListeners:a,detachNodeToFrameListeners:l,selectAction:c}}function gi(n,t,e){const r=n.slice();return r[7]=t[e],r[9]=e,r}function bi(n){let t,e,r,i=[],o=new Map,s,a,l=qe(n[0].actions);const c=d=>d[9];for(let d=0;d<l.length;d+=1){let p=gi(n,l,d),h=c(p);o.set(h,i[d]=yi(h,p))}return{c(){t=Z("div"),e=ae(),r=Z("div");for(let d=0;d<i.length;d+=1)i[d].c();A(t,"class","popup-backdrop svelte-1m6nmjq"),A(r,"class","node-action-popup svelte-1m6nmjq"),gt(r,"position","fixed"),gt(r,"left",n[0].x+"px"),gt(r,"top",n[0].y+"px")},m(d,p){V(d,t,p),V(d,e,p),V(d,r,p);for(let h=0;h<i.length;h+=1)i[h]&&i[h].m(r,null);s||(a=[ge(t,"click",n[3]),ge(r,"click",So(Na)),gn(wn.call(null,r,{onEscape:n[6]}))],s=!0)},p(d,p){p&7&&(l=qe(d[0].actions),i=Tt(i,p,c,1,d,l,o,r,en,yi,null,gi)),p&1&&gt(r,"left",d[0].x+"px"),p&1&&gt(r,"top",d[0].y+"px")},d(d){d&&(G(t),G(e),G(r));for(let p=0;p<i.length;p+=1)i[p].d();s=!1,Be(a)}}}function yi(n,t){let e,r=t[7]+"",i,o,s,a;function l(){return t[4](t[7])}function c(...d){return t[5](t[7],...d)}return{key:n,first:null,c(){e=Z("div"),i=ee(r),o=ae(),A(e,"class","popup-item svelte-1m6nmjq"),A(e,"role","button"),A(e,"tabindex","0"),this.first=e},m(d,p){V(d,e,p),R(e,i),R(e,o),s||(a=[ge(e,"click",l),ge(e,"keydown",c)],s=!0)},p(d,p){t=d,p&1&&r!==(r=t[7]+"")&&ye(i,r)},d(d){d&&G(e),s=!1,Be(a)}}}function La(n){let t,e=n[0]&&bi(n);return{c(){e&&e.c(),t=lt()},m(r,i){e&&e.m(r,i),V(r,t,i)},p(r,[i]){r[0]?e?e.p(r,i):(e=bi(r),e.c(),e.m(t.parentNode,t)):e&&(e.d(1),e=null)},i:be,o:be,d(r){r&&G(t),e&&e.d(r)}}}const Na=()=>{};function Pa(n,t,e){let{popup:r=null}=t;const i=$t();function o(d,p){d.key!=="Enter"&&d.key!==" "||(d.preventDefault(),i("select",p))}const s=()=>i("dismiss"),a=d=>i("select",d),l=(d,p)=>o(p,d),c=()=>i("dismiss");return n.$$set=d=>{"popup"in d&&e(0,r=d.popup)},[r,i,o,s,a,l,c]}class Fa extends tt{constructor(t){super(),et(this,t,Pa,La,Xe,{popup:0})}}function wi(n){let t,e;return{c(){t=Z("pre"),e=ee(n[2]),A(t,"class","render-error svelte-101ypv")},m(r,i){V(r,t,i),R(t,e)},p(r,i){i[0]&4&&ye(e,r[2])},d(r){r&&G(t)}}}function Ma(n){let t,e,r,i,o,s,a,l,c,d,p,h=n[2]&&wi(n);return l=new Fa({props:{popup:n[3]}}),l.$on("select",n[27]),l.$on("dismiss",n[13]),{c(){t=Z("div"),e=Z("div"),r=Z("div"),i=ae(),h&&h.c(),o=ae(),s=Z("div"),s.textContent="scroll to zoom · drag to pan · dbl-click to reset",a=ae(),He(l.$$.fragment),A(r,"class","mermaid-container svelte-101ypv"),A(e,"class","mermaid-canvas svelte-101ypv"),gt(e,"transform",n[5]),gt(e,"transform-origin","0 0"),A(s,"class","zoom-hint svelte-101ypv"),A(t,"class","mermaid-wrapper svelte-101ypv"),A(t,"title","Scroll to zoom · Drag to pan · Double-click to reset"),gt(t,"cursor",n[4])},m(u,g){V(u,t,g),R(t,e),R(e,r),n[26](r),R(t,i),h&&h.m(t,null),R(t,o),R(t,s),R(t,a),je(l,t,null),n[28](t),c=!0,d||(p=[ge(t,"wheel",n[11]),ge(t,"mousedown",n[12]),ge(t,"dblclick",n[10])],d=!0)},p(u,g){(!c||g[0]&32)&&gt(e,"transform",u[5]),u[2]?h?h.p(u,g):(h=wi(u),h.c(),h.m(t,o)):h&&(h.d(1),h=null);const f={};g[0]&8&&(f.popup=u[3]),l.$set(f),(!c||g[0]&16)&&gt(t,"cursor",u[4])},i(u){c||(ke(l.$$.fragment,u),c=!0)},o(u){Ee(l.$$.fragment,u),c=!1},d(u){u&&G(t),n[26](null),h&&h.d(),xe(l),n[28](null),d=!1,Be(p)}}}function Ba(n){const t=n.id.match(/flowchart-(.+?)-\d+$/);return t?t[1]:null}function Ua(n){var e;return((e=(n.querySelector(".nodeLabel")??n.querySelector(".label")??n).textContent)==null?void 0:e.trim())??""}function ja(n){const t=n.closest("[id]");return t&&t.id||null}function xa(n,t,e){let r,i,o,s,a,l,{source:c}=t,{clickable:d=!1}=t,{nodeActions:p=void 0}=t,{nodeToFrame:h=void 0}=t,{snapshotId:u=void 0}=t,{viewport:g=void 0}=t,{currentFrame:f=0}=t,_,b,k=null,v=null,O=0,E;const L=Ra({getWrapper:()=>_,getContainer:()=>b,getSnapshotId:()=>u,getCurrentFrame:()=>f}),{scale:z,tx:j,ty:N,dragging:I,fitToView:U,applyViewport:C,resetTransform:H,onWheel:y,onMousedown:q,onMousemove:fe,onMouseup:K}=L;_t(n,z,he=>e(23,s=he)),_t(n,j,he=>e(25,l=he)),_t(n,N,he=>e(24,a=he)),_t(n,I,he=>e(22,o=he));let ie=null;const Y=Da({getContainer:()=>b,extractNodeId:Ba,extractNodeLabel:Ua,extractEdgeId:ja,getNodeActions:()=>p,onPopupRequest:he=>{e(3,ie=he)}}),{attachClickListeners:se,detachClickListeners:D,attachNodeToFrameListeners:F,detachNodeToFrameListeners:de}=Y;function oe(){e(3,ie=null)}async function J(he){if(!ie)return;const m=ie;e(3,ie=null),await Y.selectAction(m,he)}let ze=null;function Se(){return ze||(ze=kn(()=>import("./mermaid.core-CLvSDmrA.js").then(he=>he.bI),__vite__mapDeps([0,1])).then(he=>{const m=he.default;return m.initialize({startOnLoad:!1,theme:"default",securityLevel:"strict",htmlLabels:!1}),m})),ze}function me(){return u===void 0?!1:`${u}:${f}`!==E}async function le(he,m){const W=++O;if(e(2,k=null),D(),!he){b&&e(1,b.innerHTML="",b);return}try{const x=await Se();if(W!==O)return;const w=`mermaid-${W}`,{svg:S}=await x.render(w,he),P=to.sanitize(S,{USE_PROFILES:{svg:!0,svgFilters:!0}});if(W!==O)return;b&&e(1,b.innerHTML=P,b);const X=b==null?void 0:b.querySelector("svg");if(X){const Q=X.getAttribute("viewBox");if(Q){const B=Q.trim().split(/\s+/).map(Number);B[2]&&B[3]&&(X.setAttribute("width",String(B[2])),X.setAttribute("height",String(B[3])))}}m&&X&&(g?C(g):U(X)),d?se():h&&F(h)}catch(x){if(W!==O)return;e(2,k=x instanceof Error?x.message:String(x)),b&&e(1,b.innerHTML="",b)}}Jt(()=>{const he=me();u!==void 0&&(E=`${u}:${f}`),le(c,he),v=c,window.addEventListener("mousemove",fe),window.addEventListener("mouseup",K)}),yn(()=>{if(c!==v){const he=me();u!==void 0&&(E=`${u}:${f}`),v=c,le(c,he)}}),Qt(()=>{window.removeEventListener("mousemove",fe),window.removeEventListener("mouseup",K),D(),de(),L.destroy()});function Te(he){Ve[he?"unshift":"push"](()=>{b=he,e(1,b)})}const Ce=he=>J(he.detail);function Oe(he){Ve[he?"unshift":"push"](()=>{_=he,e(0,_)})}return n.$$set=he=>{"source"in he&&e(15,c=he.source),"clickable"in he&&e(16,d=he.clickable),"nodeActions"in he&&e(17,p=he.nodeActions),"nodeToFrame"in he&&e(18,h=he.nodeToFrame),"snapshotId"in he&&e(19,u=he.snapshotId),"viewport"in he&&e(20,g=he.viewport),"currentFrame"in he&&e(21,f=he.currentFrame)},n.$$.update=()=>{n.$$.dirty[0]&65536&&(d?se():(D(),e(3,ie=null))),n.$$.dirty[0]&262144&&(h?F(h):de()),n.$$.dirty[0]&58720256&&e(5,r=`translate(${l}px, ${a}px) scale(${s})`),n.$$.dirty[0]&4194304&&e(4,i=o?"grabbing":"grab")},[_,b,k,ie,i,r,z,j,N,I,H,y,q,oe,J,c,d,p,h,u,g,f,o,s,a,l,Te,Ce,Oe]}class Wa extends tt{constructor(t){super(),et(this,t,xa,Ma,Xe,{source:15,clickable:16,nodeActions:17,nodeToFrame:18,snapshotId:19,viewport:20,currentFrame:21},null,[-1,-1])}}function Ha(n,t){return`@scope (${t.map(r=>`#${r}`).join(", ")}) {
12
+ */(function(n,t){(function(e){n.exports=e()})(function(){return function e(r,i,o){function s(c,d){if(!i[c]){if(!r[c]){var p=typeof hn=="function"&&hn;if(!d&&p)return p(c,!0);if(a)return a(c,!0);var h=new Error("Cannot find module '"+c+"'");throw h.code="MODULE_NOT_FOUND",h}var u=i[c]={exports:{}};r[c][0].call(u.exports,function(g){var f=r[c][1][g];return s(f||g)},u,u.exports,e,r,i,o)}return i[c].exports}for(var a=typeof hn=="function"&&hn,l=0;l<o.length;l++)s(o[l]);return s}({1:[function(e,r,i){var o=e("./utils"),s=e("./support"),a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";i.encode=function(l){for(var c,d,p,h,u,g,f,_=[],b=0,k=l.length,v=k,O=o.getTypeOf(l)!=="string";b<l.length;)v=k-b,p=O?(c=l[b++],d=b<k?l[b++]:0,b<k?l[b++]:0):(c=l.charCodeAt(b++),d=b<k?l.charCodeAt(b++):0,b<k?l.charCodeAt(b++):0),h=c>>2,u=(3&c)<<4|d>>4,g=1<v?(15&d)<<2|p>>6:64,f=2<v?63&p:64,_.push(a.charAt(h)+a.charAt(u)+a.charAt(g)+a.charAt(f));return _.join("")},i.decode=function(l){var c,d,p,h,u,g,f=0,_=0,b="data:";if(l.substr(0,b.length)===b)throw new Error("Invalid base64 input, it looks like a data url.");var k,v=3*(l=l.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(l.charAt(l.length-1)===a.charAt(64)&&v--,l.charAt(l.length-2)===a.charAt(64)&&v--,v%1!=0)throw new Error("Invalid base64 input, bad content length.");for(k=s.uint8array?new Uint8Array(0|v):new Array(0|v);f<l.length;)c=a.indexOf(l.charAt(f++))<<2|(h=a.indexOf(l.charAt(f++)))>>4,d=(15&h)<<4|(u=a.indexOf(l.charAt(f++)))>>2,p=(3&u)<<6|(g=a.indexOf(l.charAt(f++))),k[_++]=c,u!==64&&(k[_++]=d),g!==64&&(k[_++]=p);return k}},{"./support":30,"./utils":32}],2:[function(e,r,i){var o=e("./external"),s=e("./stream/DataWorker"),a=e("./stream/Crc32Probe"),l=e("./stream/DataLengthProbe");function c(d,p,h,u,g){this.compressedSize=d,this.uncompressedSize=p,this.crc32=h,this.compression=u,this.compressedContent=g}c.prototype={getContentWorker:function(){var d=new s(o.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),p=this;return d.on("end",function(){if(this.streamInfo.data_length!==p.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),d},getCompressedWorker:function(){return new s(o.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},c.createWorkerFrom=function(d,p,h){return d.pipe(new a).pipe(new l("uncompressedSize")).pipe(p.compressWorker(h)).pipe(new l("compressedSize")).withStreamInfo("compression",p)},r.exports=c},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,r,i){var o=e("./stream/GenericWorker");i.STORE={magic:"\0\0",compressWorker:function(){return new o("STORE compression")},uncompressWorker:function(){return new o("STORE decompression")}},i.DEFLATE=e("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,r,i){var o=e("./utils"),s=function(){for(var a,l=[],c=0;c<256;c++){a=c;for(var d=0;d<8;d++)a=1&a?3988292384^a>>>1:a>>>1;l[c]=a}return l}();r.exports=function(a,l){return a!==void 0&&a.length?o.getTypeOf(a)!=="string"?function(c,d,p,h){var u=s,g=h+p;c^=-1;for(var f=h;f<g;f++)c=c>>>8^u[255&(c^d[f])];return-1^c}(0|l,a,a.length,0):function(c,d,p,h){var u=s,g=h+p;c^=-1;for(var f=h;f<g;f++)c=c>>>8^u[255&(c^d.charCodeAt(f))];return-1^c}(0|l,a,a.length,0):0}},{"./utils":32}],5:[function(e,r,i){i.base64=!1,i.binary=!1,i.dir=!1,i.createFolders=!0,i.date=null,i.compression=null,i.compressionOptions=null,i.comment=null,i.unixPermissions=null,i.dosPermissions=null},{}],6:[function(e,r,i){var o=null;o=typeof Promise<"u"?Promise:e("lie"),r.exports={Promise:o}},{lie:37}],7:[function(e,r,i){var o=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",s=e("pako"),a=e("./utils"),l=e("./stream/GenericWorker"),c=o?"uint8array":"array";function d(p,h){l.call(this,"FlateWorker/"+p),this._pako=null,this._pakoAction=p,this._pakoOptions=h,this.meta={}}i.magic="\b\0",a.inherits(d,l),d.prototype.processChunk=function(p){this.meta=p.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(c,p.data),!1)},d.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},d.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},d.prototype._createPako=function(){this._pako=new s[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var p=this;this._pako.onData=function(h){p.push({data:h,meta:p.meta})}},i.compressWorker=function(p){return new d("Deflate",p)},i.uncompressWorker=function(){return new d("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,r,i){function o(u,g){var f,_="";for(f=0;f<g;f++)_+=String.fromCharCode(255&u),u>>>=8;return _}function s(u,g,f,_,b,k){var v,O,E=u.file,L=u.compression,z=k!==c.utf8encode,U=a.transformTo("string",k(E.name)),N=a.transformTo("string",c.utf8encode(E.name)),I=E.comment,j=a.transformTo("string",k(I)),C=a.transformTo("string",c.utf8encode(I)),H=N.length!==E.name.length,y=C.length!==I.length,q="",fe="",K="",ie=E.dir,Y=E.date,se={crc32:0,compressedSize:0,uncompressedSize:0};g&&!f||(se.crc32=u.crc32,se.compressedSize=u.compressedSize,se.uncompressedSize=u.uncompressedSize);var D=0;g&&(D|=8),z||!H&&!y||(D|=2048);var F=0,de=0;ie&&(F|=16),b==="UNIX"?(de=798,F|=function(J,ze){var Se=J;return J||(Se=ze?16893:33204),(65535&Se)<<16}(E.unixPermissions,ie)):(de=20,F|=function(J){return 63&(J||0)}(E.dosPermissions)),v=Y.getUTCHours(),v<<=6,v|=Y.getUTCMinutes(),v<<=5,v|=Y.getUTCSeconds()/2,O=Y.getUTCFullYear()-1980,O<<=4,O|=Y.getUTCMonth()+1,O<<=5,O|=Y.getUTCDate(),H&&(fe=o(1,1)+o(d(U),4)+N,q+="up"+o(fe.length,2)+fe),y&&(K=o(1,1)+o(d(j),4)+C,q+="uc"+o(K.length,2)+K);var oe="";return oe+=`
13
+ \0`,oe+=o(D,2),oe+=L.magic,oe+=o(v,2),oe+=o(O,2),oe+=o(se.crc32,4),oe+=o(se.compressedSize,4),oe+=o(se.uncompressedSize,4),oe+=o(U.length,2),oe+=o(q.length,2),{fileRecord:p.LOCAL_FILE_HEADER+oe+U+q,dirRecord:p.CENTRAL_FILE_HEADER+o(de,2)+oe+o(j.length,2)+"\0\0\0\0"+o(F,4)+o(_,4)+U+q+j}}var a=e("../utils"),l=e("../stream/GenericWorker"),c=e("../utf8"),d=e("../crc32"),p=e("../signature");function h(u,g,f,_){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=g,this.zipPlatform=f,this.encodeFileName=_,this.streamFiles=u,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(h,l),h.prototype.push=function(u){var g=u.meta.percent||0,f=this.entriesCount,_=this._sources.length;this.accumulate?this.contentBuffer.push(u):(this.bytesWritten+=u.data.length,l.prototype.push.call(this,{data:u.data,meta:{currentFile:this.currentFile,percent:f?(g+100*(f-_-1))/f:100}}))},h.prototype.openedSource=function(u){this.currentSourceOffset=this.bytesWritten,this.currentFile=u.file.name;var g=this.streamFiles&&!u.file.dir;if(g){var f=s(u,g,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:f.fileRecord,meta:{percent:0}})}else this.accumulate=!0},h.prototype.closedSource=function(u){this.accumulate=!1;var g=this.streamFiles&&!u.file.dir,f=s(u,g,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(f.dirRecord),g)this.push({data:function(_){return p.DATA_DESCRIPTOR+o(_.crc32,4)+o(_.compressedSize,4)+o(_.uncompressedSize,4)}(u),meta:{percent:100}});else for(this.push({data:f.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},h.prototype.flush=function(){for(var u=this.bytesWritten,g=0;g<this.dirRecords.length;g++)this.push({data:this.dirRecords[g],meta:{percent:100}});var f=this.bytesWritten-u,_=function(b,k,v,O,E){var L=a.transformTo("string",E(O));return p.CENTRAL_DIRECTORY_END+"\0\0\0\0"+o(b,2)+o(b,2)+o(k,4)+o(v,4)+o(L.length,2)+L}(this.dirRecords.length,f,u,this.zipComment,this.encodeFileName);this.push({data:_,meta:{percent:100}})},h.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},h.prototype.registerPrevious=function(u){this._sources.push(u);var g=this;return u.on("data",function(f){g.processChunk(f)}),u.on("end",function(){g.closedSource(g.previous.streamInfo),g._sources.length?g.prepareNextSource():g.end()}),u.on("error",function(f){g.error(f)}),this},h.prototype.resume=function(){return!!l.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},h.prototype.error=function(u){var g=this._sources;if(!l.prototype.error.call(this,u))return!1;for(var f=0;f<g.length;f++)try{g[f].error(u)}catch{}return!0},h.prototype.lock=function(){l.prototype.lock.call(this);for(var u=this._sources,g=0;g<u.length;g++)u[g].lock()},r.exports=h},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(e,r,i){var o=e("../compressions"),s=e("./ZipFileWorker");i.generateWorker=function(a,l,c){var d=new s(l.streamFiles,c,l.platform,l.encodeFileName),p=0;try{a.forEach(function(h,u){p++;var g=function(k,v){var O=k||v,E=o[O];if(!E)throw new Error(O+" is not a valid compression method !");return E}(u.options.compression,l.compression),f=u.options.compressionOptions||l.compressionOptions||{},_=u.dir,b=u.date;u._compressWorker(g,f).withStreamInfo("file",{name:h,dir:_,date:b,comment:u.comment||"",unixPermissions:u.unixPermissions,dosPermissions:u.dosPermissions}).pipe(d)}),d.entriesCount=p}catch(h){d.error(h)}return d}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(e,r,i){function o(){if(!(this instanceof o))return new o;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var s=new o;for(var a in this)typeof this[a]!="function"&&(s[a]=this[a]);return s}}(o.prototype=e("./object")).loadAsync=e("./load"),o.support=e("./support"),o.defaults=e("./defaults"),o.version="3.10.1",o.loadAsync=function(s,a){return new o().loadAsync(s,a)},o.external=e("./external"),r.exports=o},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(e,r,i){var o=e("./utils"),s=e("./external"),a=e("./utf8"),l=e("./zipEntries"),c=e("./stream/Crc32Probe"),d=e("./nodejsUtils");function p(h){return new s.Promise(function(u,g){var f=h.decompressed.getContentWorker().pipe(new c);f.on("error",function(_){g(_)}).on("end",function(){f.streamInfo.crc32!==h.decompressed.crc32?g(new Error("Corrupted zip : CRC32 mismatch")):u()}).resume()})}r.exports=function(h,u){var g=this;return u=o.extend(u||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:a.utf8decode}),d.isNode&&d.isStream(h)?s.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):o.prepareContent("the loaded zip file",h,!0,u.optimizedBinaryString,u.base64).then(function(f){var _=new l(u);return _.load(f),_}).then(function(f){var _=[s.Promise.resolve(f)],b=f.files;if(u.checkCRC32)for(var k=0;k<b.length;k++)_.push(p(b[k]));return s.Promise.all(_)}).then(function(f){for(var _=f.shift(),b=_.files,k=0;k<b.length;k++){var v=b[k],O=v.fileNameStr,E=o.resolve(v.fileNameStr);g.file(E,v.decompressed,{binary:!0,optimizedBinaryString:!0,date:v.date,dir:v.dir,comment:v.fileCommentStr.length?v.fileCommentStr:null,unixPermissions:v.unixPermissions,dosPermissions:v.dosPermissions,createFolders:u.createFolders}),v.dir||(g.file(E).unsafeOriginalName=O)}return _.zipComment.length&&(g.comment=_.zipComment),g})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(e,r,i){var o=e("../utils"),s=e("../stream/GenericWorker");function a(l,c){s.call(this,"Nodejs stream input adapter for "+l),this._upstreamEnded=!1,this._bindStream(c)}o.inherits(a,s),a.prototype._bindStream=function(l){var c=this;(this._stream=l).pause(),l.on("data",function(d){c.push({data:d,meta:{percent:0}})}).on("error",function(d){c.isPaused?this.generatedError=d:c.error(d)}).on("end",function(){c.isPaused?c._upstreamEnded=!0:c.end()})},a.prototype.pause=function(){return!!s.prototype.pause.call(this)&&(this._stream.pause(),!0)},a.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},r.exports=a},{"../stream/GenericWorker":28,"../utils":32}],13:[function(e,r,i){var o=e("readable-stream").Readable;function s(a,l,c){o.call(this,l),this._helper=a;var d=this;a.on("data",function(p,h){d.push(p)||d._helper.pause(),c&&c(h)}).on("error",function(p){d.emit("error",p)}).on("end",function(){d.push(null)})}e("../utils").inherits(s,o),s.prototype._read=function(){this._helper.resume()},r.exports=s},{"../utils":32,"readable-stream":16}],14:[function(e,r,i){r.exports={isNode:typeof Buffer<"u",newBufferFrom:function(o,s){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(o,s);if(typeof o=="number")throw new Error('The "data" argument must not be a number');return new Buffer(o,s)},allocBuffer:function(o){if(Buffer.alloc)return Buffer.alloc(o);var s=new Buffer(o);return s.fill(0),s},isBuffer:function(o){return Buffer.isBuffer(o)},isStream:function(o){return o&&typeof o.on=="function"&&typeof o.pause=="function"&&typeof o.resume=="function"}}},{}],15:[function(e,r,i){function o(E,L,z){var U,N=a.getTypeOf(L),I=a.extend(z||{},d);I.date=I.date||new Date,I.compression!==null&&(I.compression=I.compression.toUpperCase()),typeof I.unixPermissions=="string"&&(I.unixPermissions=parseInt(I.unixPermissions,8)),I.unixPermissions&&16384&I.unixPermissions&&(I.dir=!0),I.dosPermissions&&16&I.dosPermissions&&(I.dir=!0),I.dir&&(E=b(E)),I.createFolders&&(U=_(E))&&k.call(this,U,!0);var j=N==="string"&&I.binary===!1&&I.base64===!1;z&&z.binary!==void 0||(I.binary=!j),(L instanceof p&&L.uncompressedSize===0||I.dir||!L||L.length===0)&&(I.base64=!1,I.binary=!0,L="",I.compression="STORE",N="string");var C=null;C=L instanceof p||L instanceof l?L:g.isNode&&g.isStream(L)?new f(E,L):a.prepareContent(E,L,I.binary,I.optimizedBinaryString,I.base64);var H=new h(E,C,I);this.files[E]=H}var s=e("./utf8"),a=e("./utils"),l=e("./stream/GenericWorker"),c=e("./stream/StreamHelper"),d=e("./defaults"),p=e("./compressedObject"),h=e("./zipObject"),u=e("./generate"),g=e("./nodejsUtils"),f=e("./nodejs/NodejsStreamInputAdapter"),_=function(E){E.slice(-1)==="/"&&(E=E.substring(0,E.length-1));var L=E.lastIndexOf("/");return 0<L?E.substring(0,L):""},b=function(E){return E.slice(-1)!=="/"&&(E+="/"),E},k=function(E,L){return L=L!==void 0?L:d.createFolders,E=b(E),this.files[E]||o.call(this,E,null,{dir:!0,createFolders:L}),this.files[E]};function v(E){return Object.prototype.toString.call(E)==="[object RegExp]"}var O={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(E){var L,z,U;for(L in this.files)U=this.files[L],(z=L.slice(this.root.length,L.length))&&L.slice(0,this.root.length)===this.root&&E(z,U)},filter:function(E){var L=[];return this.forEach(function(z,U){E(z,U)&&L.push(U)}),L},file:function(E,L,z){if(arguments.length!==1)return E=this.root+E,o.call(this,E,L,z),this;if(v(E)){var U=E;return this.filter(function(I,j){return!j.dir&&U.test(I)})}var N=this.files[this.root+E];return N&&!N.dir?N:null},folder:function(E){if(!E)return this;if(v(E))return this.filter(function(N,I){return I.dir&&E.test(N)});var L=this.root+E,z=k.call(this,L),U=this.clone();return U.root=z.name,U},remove:function(E){E=this.root+E;var L=this.files[E];if(L||(E.slice(-1)!=="/"&&(E+="/"),L=this.files[E]),L&&!L.dir)delete this.files[E];else for(var z=this.filter(function(N,I){return I.name.slice(0,E.length)===E}),U=0;U<z.length;U++)delete this.files[z[U].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(E){var L,z={};try{if((z=a.extend(E||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:s.utf8encode})).type=z.type.toLowerCase(),z.compression=z.compression.toUpperCase(),z.type==="binarystring"&&(z.type="string"),!z.type)throw new Error("No output type specified.");a.checkSupport(z.type),z.platform!=="darwin"&&z.platform!=="freebsd"&&z.platform!=="linux"&&z.platform!=="sunos"||(z.platform="UNIX"),z.platform==="win32"&&(z.platform="DOS");var U=z.comment||this.comment||"";L=u.generateWorker(this,z,U)}catch(N){(L=new l("error")).error(N)}return new c(L,z.type||"string",z.mimeType)},generateAsync:function(E,L){return this.generateInternalStream(E).accumulate(L)},generateNodeStream:function(E,L){return(E=E||{}).type||(E.type="nodebuffer"),this.generateInternalStream(E).toNodejsStream(L)}};r.exports=O},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(e,r,i){r.exports=e("stream")},{stream:void 0}],17:[function(e,r,i){var o=e("./DataReader");function s(a){o.call(this,a);for(var l=0;l<this.data.length;l++)a[l]=255&a[l]}e("../utils").inherits(s,o),s.prototype.byteAt=function(a){return this.data[this.zero+a]},s.prototype.lastIndexOfSignature=function(a){for(var l=a.charCodeAt(0),c=a.charCodeAt(1),d=a.charCodeAt(2),p=a.charCodeAt(3),h=this.length-4;0<=h;--h)if(this.data[h]===l&&this.data[h+1]===c&&this.data[h+2]===d&&this.data[h+3]===p)return h-this.zero;return-1},s.prototype.readAndCheckSignature=function(a){var l=a.charCodeAt(0),c=a.charCodeAt(1),d=a.charCodeAt(2),p=a.charCodeAt(3),h=this.readData(4);return l===h[0]&&c===h[1]&&d===h[2]&&p===h[3]},s.prototype.readData=function(a){if(this.checkOffset(a),a===0)return[];var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},r.exports=s},{"../utils":32,"./DataReader":18}],18:[function(e,r,i){var o=e("../utils");function s(a){this.data=a,this.length=a.length,this.index=0,this.zero=0}s.prototype={checkOffset:function(a){this.checkIndex(this.index+a)},checkIndex:function(a){if(this.length<this.zero+a||a<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+a+"). Corrupted zip ?")},setIndex:function(a){this.checkIndex(a),this.index=a},skip:function(a){this.setIndex(this.index+a)},byteAt:function(){},readInt:function(a){var l,c=0;for(this.checkOffset(a),l=this.index+a-1;l>=this.index;l--)c=(c<<8)+this.byteAt(l);return this.index+=a,c},readString:function(a){return o.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC(1980+(a>>25&127),(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1))}},r.exports=s},{"../utils":32}],19:[function(e,r,i){var o=e("./Uint8ArrayReader");function s(a){o.call(this,a)}e("../utils").inherits(s,o),s.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},r.exports=s},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,r,i){var o=e("./DataReader");function s(a){o.call(this,a)}e("../utils").inherits(s,o),s.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},s.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},s.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},s.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},r.exports=s},{"../utils":32,"./DataReader":18}],21:[function(e,r,i){var o=e("./ArrayReader");function s(a){o.call(this,a)}e("../utils").inherits(s,o),s.prototype.readData=function(a){if(this.checkOffset(a),a===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},r.exports=s},{"../utils":32,"./ArrayReader":17}],22:[function(e,r,i){var o=e("../utils"),s=e("../support"),a=e("./ArrayReader"),l=e("./StringReader"),c=e("./NodeBufferReader"),d=e("./Uint8ArrayReader");r.exports=function(p){var h=o.getTypeOf(p);return o.checkSupport(h),h!=="string"||s.uint8array?h==="nodebuffer"?new c(p):s.uint8array?new d(o.transformTo("uint8array",p)):new a(o.transformTo("array",p)):new l(p)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,r,i){i.LOCAL_FILE_HEADER="PK",i.CENTRAL_FILE_HEADER="PK",i.CENTRAL_DIRECTORY_END="PK",i.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",i.ZIP64_CENTRAL_DIRECTORY_END="PK",i.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(e,r,i){var o=e("./GenericWorker"),s=e("../utils");function a(l){o.call(this,"ConvertWorker to "+l),this.destType=l}s.inherits(a,o),a.prototype.processChunk=function(l){this.push({data:s.transformTo(this.destType,l.data),meta:l.meta})},r.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(e,r,i){var o=e("./GenericWorker"),s=e("../crc32");function a(){o.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}e("../utils").inherits(a,o),a.prototype.processChunk=function(l){this.streamInfo.crc32=s(l.data,this.streamInfo.crc32||0),this.push(l)},r.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,r,i){var o=e("../utils"),s=e("./GenericWorker");function a(l){s.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}o.inherits(a,s),a.prototype.processChunk=function(l){if(l){var c=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=c+l.data.length}s.prototype.processChunk.call(this,l)},r.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(e,r,i){var o=e("../utils"),s=e("./GenericWorker");function a(l){s.call(this,"DataWorker");var c=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(d){c.dataIsReady=!0,c.data=d,c.max=d&&d.length||0,c.type=o.getTypeOf(d),c.isPaused||c._tickAndRepeat()},function(d){c.error(d)})}o.inherits(a,s),a.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,o.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(o.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,c=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,c);break;case"uint8array":l=this.data.subarray(this.index,c);break;case"array":case"nodebuffer":l=this.data.slice(this.index,c)}return this.index=c,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},r.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(e,r,i){function o(s){this.name=s||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}o.prototype={push:function(s){this.emit("data",s)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(s){this.emit("error",s)}return!0},error:function(s){return!this.isFinished&&(this.isPaused?this.generatedError=s:(this.isFinished=!0,this.emit("error",s),this.previous&&this.previous.error(s),this.cleanUp()),!0)},on:function(s,a){return this._listeners[s].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(s,a){if(this._listeners[s])for(var l=0;l<this._listeners[s].length;l++)this._listeners[s][l].call(this,a)},pipe:function(s){return s.registerPrevious(this)},registerPrevious:function(s){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=s.streamInfo,this.mergeStreamInfo(),this.previous=s;var a=this;return s.on("data",function(l){a.processChunk(l)}),s.on("end",function(){a.end()}),s.on("error",function(l){a.error(l)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var s=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),s=!0),this.previous&&this.previous.resume(),!s},flush:function(){},processChunk:function(s){this.push(s)},withStreamInfo:function(s,a){return this.extraStreamInfo[s]=a,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var s in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,s)&&(this.streamInfo[s]=this.extraStreamInfo[s])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var s="Worker "+this.name;return this.previous?this.previous+" -> "+s:s}},r.exports=o},{}],29:[function(e,r,i){var o=e("../utils"),s=e("./ConvertWorker"),a=e("./GenericWorker"),l=e("../base64"),c=e("../support"),d=e("../external"),p=null;if(c.nodestream)try{p=e("../nodejs/NodejsStreamOutputAdapter")}catch{}function h(g,f){return new d.Promise(function(_,b){var k=[],v=g._internalType,O=g._outputType,E=g._mimeType;g.on("data",function(L,z){k.push(L),f&&f(z)}).on("error",function(L){k=[],b(L)}).on("end",function(){try{var L=function(z,U,N){switch(z){case"blob":return o.newBlob(o.transformTo("arraybuffer",U),N);case"base64":return l.encode(U);default:return o.transformTo(z,U)}}(O,function(z,U){var N,I=0,j=null,C=0;for(N=0;N<U.length;N++)C+=U[N].length;switch(z){case"string":return U.join("");case"array":return Array.prototype.concat.apply([],U);case"uint8array":for(j=new Uint8Array(C),N=0;N<U.length;N++)j.set(U[N],I),I+=U[N].length;return j;case"nodebuffer":return Buffer.concat(U);default:throw new Error("concat : unsupported type '"+z+"'")}}(v,k),E);_(L)}catch(z){b(z)}k=[]}).resume()})}function u(g,f,_){var b=f;switch(f){case"blob":case"arraybuffer":b="uint8array";break;case"base64":b="string"}try{this._internalType=b,this._outputType=f,this._mimeType=_,o.checkSupport(b),this._worker=g.pipe(new s(b)),g.lock()}catch(k){this._worker=new a("error"),this._worker.error(k)}}u.prototype={accumulate:function(g){return h(this,g)},on:function(g,f){var _=this;return g==="data"?this._worker.on(g,function(b){f.call(_,b.data,b.meta)}):this._worker.on(g,function(){o.delay(f,arguments,_)}),this},resume:function(){return o.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(g){if(o.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new p(this,{objectMode:this._outputType!=="nodebuffer"},g)}},r.exports=u},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(e,r,i){if(i.base64=!0,i.array=!0,i.string=!0,i.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",i.nodebuffer=typeof Buffer<"u",i.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")i.blob=!1;else{var o=new ArrayBuffer(0);try{i.blob=new Blob([o],{type:"application/zip"}).size===0}catch{try{var s=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);s.append(o),i.blob=s.getBlob("application/zip").size===0}catch{i.blob=!1}}}try{i.nodestream=!!e("readable-stream").Readable}catch{i.nodestream=!1}},{"readable-stream":16}],31:[function(e,r,i){for(var o=e("./utils"),s=e("./support"),a=e("./nodejsUtils"),l=e("./stream/GenericWorker"),c=new Array(256),d=0;d<256;d++)c[d]=252<=d?6:248<=d?5:240<=d?4:224<=d?3:192<=d?2:1;c[254]=c[254]=1;function p(){l.call(this,"utf-8 decode"),this.leftOver=null}function h(){l.call(this,"utf-8 encode")}i.utf8encode=function(u){return s.nodebuffer?a.newBufferFrom(u,"utf-8"):function(g){var f,_,b,k,v,O=g.length,E=0;for(k=0;k<O;k++)(64512&(_=g.charCodeAt(k)))==55296&&k+1<O&&(64512&(b=g.charCodeAt(k+1)))==56320&&(_=65536+(_-55296<<10)+(b-56320),k++),E+=_<128?1:_<2048?2:_<65536?3:4;for(f=s.uint8array?new Uint8Array(E):new Array(E),k=v=0;v<E;k++)(64512&(_=g.charCodeAt(k)))==55296&&k+1<O&&(64512&(b=g.charCodeAt(k+1)))==56320&&(_=65536+(_-55296<<10)+(b-56320),k++),_<128?f[v++]=_:(_<2048?f[v++]=192|_>>>6:(_<65536?f[v++]=224|_>>>12:(f[v++]=240|_>>>18,f[v++]=128|_>>>12&63),f[v++]=128|_>>>6&63),f[v++]=128|63&_);return f}(u)},i.utf8decode=function(u){return s.nodebuffer?o.transformTo("nodebuffer",u).toString("utf-8"):function(g){var f,_,b,k,v=g.length,O=new Array(2*v);for(f=_=0;f<v;)if((b=g[f++])<128)O[_++]=b;else if(4<(k=c[b]))O[_++]=65533,f+=k-1;else{for(b&=k===2?31:k===3?15:7;1<k&&f<v;)b=b<<6|63&g[f++],k--;1<k?O[_++]=65533:b<65536?O[_++]=b:(b-=65536,O[_++]=55296|b>>10&1023,O[_++]=56320|1023&b)}return O.length!==_&&(O.subarray?O=O.subarray(0,_):O.length=_),o.applyFromCharCode(O)}(u=o.transformTo(s.uint8array?"uint8array":"array",u))},o.inherits(p,l),p.prototype.processChunk=function(u){var g=o.transformTo(s.uint8array?"uint8array":"array",u.data);if(this.leftOver&&this.leftOver.length){if(s.uint8array){var f=g;(g=new Uint8Array(f.length+this.leftOver.length)).set(this.leftOver,0),g.set(f,this.leftOver.length)}else g=this.leftOver.concat(g);this.leftOver=null}var _=function(k,v){var O;for((v=v||k.length)>k.length&&(v=k.length),O=v-1;0<=O&&(192&k[O])==128;)O--;return O<0||O===0?v:O+c[k[O]]>v?O:v}(g),b=g;_!==g.length&&(s.uint8array?(b=g.subarray(0,_),this.leftOver=g.subarray(_,g.length)):(b=g.slice(0,_),this.leftOver=g.slice(_,g.length))),this.push({data:i.utf8decode(b),meta:u.meta})},p.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:i.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},i.Utf8DecodeWorker=p,o.inherits(h,l),h.prototype.processChunk=function(u){this.push({data:i.utf8encode(u.data),meta:u.meta})},i.Utf8EncodeWorker=h},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,r,i){var o=e("./support"),s=e("./base64"),a=e("./nodejsUtils"),l=e("./external");function c(f){return f}function d(f,_){for(var b=0;b<f.length;++b)_[b]=255&f.charCodeAt(b);return _}e("setimmediate"),i.newBlob=function(f,_){i.checkSupport("blob");try{return new Blob([f],{type:_})}catch{try{var b=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return b.append(f),b.getBlob(_)}catch{throw new Error("Bug : can't construct the Blob.")}}};var p={stringifyByChunk:function(f,_,b){var k=[],v=0,O=f.length;if(O<=b)return String.fromCharCode.apply(null,f);for(;v<O;)_==="array"||_==="nodebuffer"?k.push(String.fromCharCode.apply(null,f.slice(v,Math.min(v+b,O)))):k.push(String.fromCharCode.apply(null,f.subarray(v,Math.min(v+b,O)))),v+=b;return k.join("")},stringifyByChar:function(f){for(var _="",b=0;b<f.length;b++)_+=String.fromCharCode(f[b]);return _},applyCanBeUsed:{uint8array:function(){try{return o.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}}(),nodebuffer:function(){try{return o.nodebuffer&&String.fromCharCode.apply(null,a.allocBuffer(1)).length===1}catch{return!1}}()}};function h(f){var _=65536,b=i.getTypeOf(f),k=!0;if(b==="uint8array"?k=p.applyCanBeUsed.uint8array:b==="nodebuffer"&&(k=p.applyCanBeUsed.nodebuffer),k)for(;1<_;)try{return p.stringifyByChunk(f,b,_)}catch{_=Math.floor(_/2)}return p.stringifyByChar(f)}function u(f,_){for(var b=0;b<f.length;b++)_[b]=f[b];return _}i.applyFromCharCode=h;var g={};g.string={string:c,array:function(f){return d(f,new Array(f.length))},arraybuffer:function(f){return g.string.uint8array(f).buffer},uint8array:function(f){return d(f,new Uint8Array(f.length))},nodebuffer:function(f){return d(f,a.allocBuffer(f.length))}},g.array={string:h,array:c,arraybuffer:function(f){return new Uint8Array(f).buffer},uint8array:function(f){return new Uint8Array(f)},nodebuffer:function(f){return a.newBufferFrom(f)}},g.arraybuffer={string:function(f){return h(new Uint8Array(f))},array:function(f){return u(new Uint8Array(f),new Array(f.byteLength))},arraybuffer:c,uint8array:function(f){return new Uint8Array(f)},nodebuffer:function(f){return a.newBufferFrom(new Uint8Array(f))}},g.uint8array={string:h,array:function(f){return u(f,new Array(f.length))},arraybuffer:function(f){return f.buffer},uint8array:c,nodebuffer:function(f){return a.newBufferFrom(f)}},g.nodebuffer={string:h,array:function(f){return u(f,new Array(f.length))},arraybuffer:function(f){return g.nodebuffer.uint8array(f).buffer},uint8array:function(f){return u(f,new Uint8Array(f.length))},nodebuffer:c},i.transformTo=function(f,_){if(_=_||"",!f)return _;i.checkSupport(f);var b=i.getTypeOf(_);return g[b][f](_)},i.resolve=function(f){for(var _=f.split("/"),b=[],k=0;k<_.length;k++){var v=_[k];v==="."||v===""&&k!==0&&k!==_.length-1||(v===".."?b.pop():b.push(v))}return b.join("/")},i.getTypeOf=function(f){return typeof f=="string"?"string":Object.prototype.toString.call(f)==="[object Array]"?"array":o.nodebuffer&&a.isBuffer(f)?"nodebuffer":o.uint8array&&f instanceof Uint8Array?"uint8array":o.arraybuffer&&f instanceof ArrayBuffer?"arraybuffer":void 0},i.checkSupport=function(f){if(!o[f.toLowerCase()])throw new Error(f+" is not supported by this platform")},i.MAX_VALUE_16BITS=65535,i.MAX_VALUE_32BITS=-1,i.pretty=function(f){var _,b,k="";for(b=0;b<(f||"").length;b++)k+="\\x"+((_=f.charCodeAt(b))<16?"0":"")+_.toString(16).toUpperCase();return k},i.delay=function(f,_,b){setImmediate(function(){f.apply(b||null,_||[])})},i.inherits=function(f,_){function b(){}b.prototype=_.prototype,f.prototype=new b},i.extend=function(){var f,_,b={};for(f=0;f<arguments.length;f++)for(_ in arguments[f])Object.prototype.hasOwnProperty.call(arguments[f],_)&&b[_]===void 0&&(b[_]=arguments[f][_]);return b},i.prepareContent=function(f,_,b,k,v){return l.Promise.resolve(_).then(function(O){return o.blob&&(O instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(O))!==-1)&&typeof FileReader<"u"?new l.Promise(function(E,L){var z=new FileReader;z.onload=function(U){E(U.target.result)},z.onerror=function(U){L(U.target.error)},z.readAsArrayBuffer(O)}):O}).then(function(O){var E=i.getTypeOf(O);return E?(E==="arraybuffer"?O=i.transformTo("uint8array",O):E==="string"&&(v?O=s.decode(O):b&&k!==!0&&(O=function(L){return d(L,o.uint8array?new Uint8Array(L.length):new Array(L.length))}(O))),O):l.Promise.reject(new Error("Can't read the data of '"+f+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(e,r,i){var o=e("./reader/readerFor"),s=e("./utils"),a=e("./signature"),l=e("./zipEntry"),c=e("./support");function d(p){this.files=[],this.loadOptions=p}d.prototype={checkSignature:function(p){if(!this.reader.readAndCheckSignature(p)){this.reader.index-=4;var h=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+s.pretty(h)+", expected "+s.pretty(p)+")")}},isSignature:function(p,h){var u=this.reader.index;this.reader.setIndex(p);var g=this.reader.readString(4)===h;return this.reader.setIndex(u),g},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var p=this.reader.readData(this.zipCommentLength),h=c.uint8array?"uint8array":"array",u=s.transformTo(h,p);this.zipComment=this.loadOptions.decodeFileName(u)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var p,h,u,g=this.zip64EndOfCentralSize-44;0<g;)p=this.reader.readInt(2),h=this.reader.readInt(4),u=this.reader.readData(h),this.zip64ExtensibleData[p]={id:p,length:h,value:u}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var p,h;for(p=0;p<this.files.length;p++)h=this.files[p],this.reader.setIndex(h.localHeaderOffset),this.checkSignature(a.LOCAL_FILE_HEADER),h.readLocalPart(this.reader),h.handleUTF8(),h.processAttributes()},readCentralDir:function(){var p;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(a.CENTRAL_FILE_HEADER);)(p=new l({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(p);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var p=this.reader.lastIndexOfSignature(a.CENTRAL_DIRECTORY_END);if(p<0)throw this.isSignature(0,a.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(p);var h=p;if(this.checkSignature(a.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===s.MAX_VALUE_16BITS||this.diskWithCentralDirStart===s.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===s.MAX_VALUE_16BITS||this.centralDirRecords===s.MAX_VALUE_16BITS||this.centralDirSize===s.MAX_VALUE_32BITS||this.centralDirOffset===s.MAX_VALUE_32BITS){if(this.zip64=!0,(p=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(p),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,a.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var u=this.centralDirOffset+this.centralDirSize;this.zip64&&(u+=20,u+=12+this.zip64EndOfCentralSize);var g=h-u;if(0<g)this.isSignature(h,a.CENTRAL_FILE_HEADER)||(this.reader.zero=g);else if(g<0)throw new Error("Corrupted zip: missing "+Math.abs(g)+" bytes.")},prepareReader:function(p){this.reader=o(p)},load:function(p){this.prepareReader(p),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},r.exports=d},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(e,r,i){var o=e("./reader/readerFor"),s=e("./utils"),a=e("./compressedObject"),l=e("./crc32"),c=e("./utf8"),d=e("./compressions"),p=e("./support");function h(u,g){this.options=u,this.loadOptions=g}h.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(u){var g,f;if(u.skip(22),this.fileNameLength=u.readInt(2),f=u.readInt(2),this.fileName=u.readData(this.fileNameLength),u.skip(f),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((g=function(_){for(var b in d)if(Object.prototype.hasOwnProperty.call(d,b)&&d[b].magic===_)return d[b];return null}(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+s.pretty(this.compressionMethod)+" unknown (inner file : "+s.transformTo("string",this.fileName)+")");this.decompressed=new a(this.compressedSize,this.uncompressedSize,this.crc32,g,u.readData(this.compressedSize))},readCentralPart:function(u){this.versionMadeBy=u.readInt(2),u.skip(2),this.bitFlag=u.readInt(2),this.compressionMethod=u.readString(2),this.date=u.readDate(),this.crc32=u.readInt(4),this.compressedSize=u.readInt(4),this.uncompressedSize=u.readInt(4);var g=u.readInt(2);if(this.extraFieldsLength=u.readInt(2),this.fileCommentLength=u.readInt(2),this.diskNumberStart=u.readInt(2),this.internalFileAttributes=u.readInt(2),this.externalFileAttributes=u.readInt(4),this.localHeaderOffset=u.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");u.skip(g),this.readExtraFields(u),this.parseZIP64ExtraField(u),this.fileComment=u.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var u=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),u==0&&(this.dosPermissions=63&this.externalFileAttributes),u==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var u=o(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=u.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=u.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=u.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=u.readInt(4))}},readExtraFields:function(u){var g,f,_,b=u.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});u.index+4<b;)g=u.readInt(2),f=u.readInt(2),_=u.readData(f),this.extraFields[g]={id:g,length:f,value:_};u.setIndex(b)},handleUTF8:function(){var u=p.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=c.utf8decode(this.fileName),this.fileCommentStr=c.utf8decode(this.fileComment);else{var g=this.findExtraFieldUnicodePath();if(g!==null)this.fileNameStr=g;else{var f=s.transformTo(u,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(f)}var _=this.findExtraFieldUnicodeComment();if(_!==null)this.fileCommentStr=_;else{var b=s.transformTo(u,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(b)}}},findExtraFieldUnicodePath:function(){var u=this.extraFields[28789];if(u){var g=o(u.value);return g.readInt(1)!==1||l(this.fileName)!==g.readInt(4)?null:c.utf8decode(g.readData(u.length-5))}return null},findExtraFieldUnicodeComment:function(){var u=this.extraFields[25461];if(u){var g=o(u.value);return g.readInt(1)!==1||l(this.fileComment)!==g.readInt(4)?null:c.utf8decode(g.readData(u.length-5))}return null}},r.exports=h},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(e,r,i){function o(g,f,_){this.name=g,this.dir=_.dir,this.date=_.date,this.comment=_.comment,this.unixPermissions=_.unixPermissions,this.dosPermissions=_.dosPermissions,this._data=f,this._dataBinary=_.binary,this.options={compression:_.compression,compressionOptions:_.compressionOptions}}var s=e("./stream/StreamHelper"),a=e("./stream/DataWorker"),l=e("./utf8"),c=e("./compressedObject"),d=e("./stream/GenericWorker");o.prototype={internalStream:function(g){var f=null,_="string";try{if(!g)throw new Error("No output type specified.");var b=(_=g.toLowerCase())==="string"||_==="text";_!=="binarystring"&&_!=="text"||(_="string"),f=this._decompressWorker();var k=!this._dataBinary;k&&!b&&(f=f.pipe(new l.Utf8EncodeWorker)),!k&&b&&(f=f.pipe(new l.Utf8DecodeWorker))}catch(v){(f=new d("error")).error(v)}return new s(f,_,"")},async:function(g,f){return this.internalStream(g).accumulate(f)},nodeStream:function(g,f){return this.internalStream(g||"nodebuffer").toNodejsStream(f)},_compressWorker:function(g,f){if(this._data instanceof c&&this._data.compression.magic===g.magic)return this._data.getCompressedWorker();var _=this._decompressWorker();return this._dataBinary||(_=_.pipe(new l.Utf8EncodeWorker)),c.createWorkerFrom(_,g,f)},_decompressWorker:function(){return this._data instanceof c?this._data.getContentWorker():this._data instanceof d?this._data:new a(this._data)}};for(var p=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],h=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},u=0;u<p.length;u++)o.prototype[p[u]]=h;r.exports=o},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(e,r,i){(function(o){var s,a,l=o.MutationObserver||o.WebKitMutationObserver;if(l){var c=0,d=new l(g),p=o.document.createTextNode("");d.observe(p,{characterData:!0}),s=function(){p.data=c=++c%2}}else if(o.setImmediate||o.MessageChannel===void 0)s="document"in o&&"onreadystatechange"in o.document.createElement("script")?function(){var f=o.document.createElement("script");f.onreadystatechange=function(){g(),f.onreadystatechange=null,f.parentNode.removeChild(f),f=null},o.document.documentElement.appendChild(f)}:function(){setTimeout(g,0)};else{var h=new o.MessageChannel;h.port1.onmessage=g,s=function(){h.port2.postMessage(0)}}var u=[];function g(){var f,_;a=!0;for(var b=u.length;b;){for(_=u,u=[],f=-1;++f<b;)_[f]();b=u.length}a=!1}r.exports=function(f){u.push(f)!==1||a||s()}}).call(this,typeof dn<"u"?dn:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(e,r,i){var o=e("immediate");function s(){}var a={},l=["REJECTED"],c=["FULFILLED"],d=["PENDING"];function p(b){if(typeof b!="function")throw new TypeError("resolver must be a function");this.state=d,this.queue=[],this.outcome=void 0,b!==s&&f(this,b)}function h(b,k,v){this.promise=b,typeof k=="function"&&(this.onFulfilled=k,this.callFulfilled=this.otherCallFulfilled),typeof v=="function"&&(this.onRejected=v,this.callRejected=this.otherCallRejected)}function u(b,k,v){o(function(){var O;try{O=k(v)}catch(E){return a.reject(b,E)}O===b?a.reject(b,new TypeError("Cannot resolve promise with itself")):a.resolve(b,O)})}function g(b){var k=b&&b.then;if(b&&(typeof b=="object"||typeof b=="function")&&typeof k=="function")return function(){k.apply(b,arguments)}}function f(b,k){var v=!1;function O(z){v||(v=!0,a.reject(b,z))}function E(z){v||(v=!0,a.resolve(b,z))}var L=_(function(){k(E,O)});L.status==="error"&&O(L.value)}function _(b,k){var v={};try{v.value=b(k),v.status="success"}catch(O){v.status="error",v.value=O}return v}(r.exports=p).prototype.finally=function(b){if(typeof b!="function")return this;var k=this.constructor;return this.then(function(v){return k.resolve(b()).then(function(){return v})},function(v){return k.resolve(b()).then(function(){throw v})})},p.prototype.catch=function(b){return this.then(null,b)},p.prototype.then=function(b,k){if(typeof b!="function"&&this.state===c||typeof k!="function"&&this.state===l)return this;var v=new this.constructor(s);return this.state!==d?u(v,this.state===c?b:k,this.outcome):this.queue.push(new h(v,b,k)),v},h.prototype.callFulfilled=function(b){a.resolve(this.promise,b)},h.prototype.otherCallFulfilled=function(b){u(this.promise,this.onFulfilled,b)},h.prototype.callRejected=function(b){a.reject(this.promise,b)},h.prototype.otherCallRejected=function(b){u(this.promise,this.onRejected,b)},a.resolve=function(b,k){var v=_(g,k);if(v.status==="error")return a.reject(b,v.value);var O=v.value;if(O)f(b,O);else{b.state=c,b.outcome=k;for(var E=-1,L=b.queue.length;++E<L;)b.queue[E].callFulfilled(k)}return b},a.reject=function(b,k){b.state=l,b.outcome=k;for(var v=-1,O=b.queue.length;++v<O;)b.queue[v].callRejected(k);return b},p.resolve=function(b){return b instanceof this?b:a.resolve(new this(s),b)},p.reject=function(b){var k=new this(s);return a.reject(k,b)},p.all=function(b){var k=this;if(Object.prototype.toString.call(b)!=="[object Array]")return this.reject(new TypeError("must be an array"));var v=b.length,O=!1;if(!v)return this.resolve([]);for(var E=new Array(v),L=0,z=-1,U=new this(s);++z<v;)N(b[z],z);return U;function N(I,j){k.resolve(I).then(function(C){E[j]=C,++L!==v||O||(O=!0,a.resolve(U,E))},function(C){O||(O=!0,a.reject(U,C))})}},p.race=function(b){var k=this;if(Object.prototype.toString.call(b)!=="[object Array]")return this.reject(new TypeError("must be an array"));var v=b.length,O=!1;if(!v)return this.resolve([]);for(var E=-1,L=new this(s);++E<v;)z=b[E],k.resolve(z).then(function(U){O||(O=!0,a.resolve(L,U))},function(U){O||(O=!0,a.reject(L,U))});var z;return L}},{immediate:36}],38:[function(e,r,i){var o={};(0,e("./lib/utils/common").assign)(o,e("./lib/deflate"),e("./lib/inflate"),e("./lib/zlib/constants")),r.exports=o},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(e,r,i){var o=e("./zlib/deflate"),s=e("./utils/common"),a=e("./utils/strings"),l=e("./zlib/messages"),c=e("./zlib/zstream"),d=Object.prototype.toString,p=0,h=-1,u=0,g=8;function f(b){if(!(this instanceof f))return new f(b);this.options=s.assign({level:h,method:g,chunkSize:16384,windowBits:15,memLevel:8,strategy:u,to:""},b||{});var k=this.options;k.raw&&0<k.windowBits?k.windowBits=-k.windowBits:k.gzip&&0<k.windowBits&&k.windowBits<16&&(k.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var v=o.deflateInit2(this.strm,k.level,k.method,k.windowBits,k.memLevel,k.strategy);if(v!==p)throw new Error(l[v]);if(k.header&&o.deflateSetHeader(this.strm,k.header),k.dictionary){var O;if(O=typeof k.dictionary=="string"?a.string2buf(k.dictionary):d.call(k.dictionary)==="[object ArrayBuffer]"?new Uint8Array(k.dictionary):k.dictionary,(v=o.deflateSetDictionary(this.strm,O))!==p)throw new Error(l[v]);this._dict_set=!0}}function _(b,k){var v=new f(k);if(v.push(b,!0),v.err)throw v.msg||l[v.err];return v.result}f.prototype.push=function(b,k){var v,O,E=this.strm,L=this.options.chunkSize;if(this.ended)return!1;O=k===~~k?k:k===!0?4:0,typeof b=="string"?E.input=a.string2buf(b):d.call(b)==="[object ArrayBuffer]"?E.input=new Uint8Array(b):E.input=b,E.next_in=0,E.avail_in=E.input.length;do{if(E.avail_out===0&&(E.output=new s.Buf8(L),E.next_out=0,E.avail_out=L),(v=o.deflate(E,O))!==1&&v!==p)return this.onEnd(v),!(this.ended=!0);E.avail_out!==0&&(E.avail_in!==0||O!==4&&O!==2)||(this.options.to==="string"?this.onData(a.buf2binstring(s.shrinkBuf(E.output,E.next_out))):this.onData(s.shrinkBuf(E.output,E.next_out)))}while((0<E.avail_in||E.avail_out===0)&&v!==1);return O===4?(v=o.deflateEnd(this.strm),this.onEnd(v),this.ended=!0,v===p):O!==2||(this.onEnd(p),!(E.avail_out=0))},f.prototype.onData=function(b){this.chunks.push(b)},f.prototype.onEnd=function(b){b===p&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=b,this.msg=this.strm.msg},i.Deflate=f,i.deflate=_,i.deflateRaw=function(b,k){return(k=k||{}).raw=!0,_(b,k)},i.gzip=function(b,k){return(k=k||{}).gzip=!0,_(b,k)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(e,r,i){var o=e("./zlib/inflate"),s=e("./utils/common"),a=e("./utils/strings"),l=e("./zlib/constants"),c=e("./zlib/messages"),d=e("./zlib/zstream"),p=e("./zlib/gzheader"),h=Object.prototype.toString;function u(f){if(!(this instanceof u))return new u(f);this.options=s.assign({chunkSize:16384,windowBits:0,to:""},f||{});var _=this.options;_.raw&&0<=_.windowBits&&_.windowBits<16&&(_.windowBits=-_.windowBits,_.windowBits===0&&(_.windowBits=-15)),!(0<=_.windowBits&&_.windowBits<16)||f&&f.windowBits||(_.windowBits+=32),15<_.windowBits&&_.windowBits<48&&!(15&_.windowBits)&&(_.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new d,this.strm.avail_out=0;var b=o.inflateInit2(this.strm,_.windowBits);if(b!==l.Z_OK)throw new Error(c[b]);this.header=new p,o.inflateGetHeader(this.strm,this.header)}function g(f,_){var b=new u(_);if(b.push(f,!0),b.err)throw b.msg||c[b.err];return b.result}u.prototype.push=function(f,_){var b,k,v,O,E,L,z=this.strm,U=this.options.chunkSize,N=this.options.dictionary,I=!1;if(this.ended)return!1;k=_===~~_?_:_===!0?l.Z_FINISH:l.Z_NO_FLUSH,typeof f=="string"?z.input=a.binstring2buf(f):h.call(f)==="[object ArrayBuffer]"?z.input=new Uint8Array(f):z.input=f,z.next_in=0,z.avail_in=z.input.length;do{if(z.avail_out===0&&(z.output=new s.Buf8(U),z.next_out=0,z.avail_out=U),(b=o.inflate(z,l.Z_NO_FLUSH))===l.Z_NEED_DICT&&N&&(L=typeof N=="string"?a.string2buf(N):h.call(N)==="[object ArrayBuffer]"?new Uint8Array(N):N,b=o.inflateSetDictionary(this.strm,L)),b===l.Z_BUF_ERROR&&I===!0&&(b=l.Z_OK,I=!1),b!==l.Z_STREAM_END&&b!==l.Z_OK)return this.onEnd(b),!(this.ended=!0);z.next_out&&(z.avail_out!==0&&b!==l.Z_STREAM_END&&(z.avail_in!==0||k!==l.Z_FINISH&&k!==l.Z_SYNC_FLUSH)||(this.options.to==="string"?(v=a.utf8border(z.output,z.next_out),O=z.next_out-v,E=a.buf2string(z.output,v),z.next_out=O,z.avail_out=U-O,O&&s.arraySet(z.output,z.output,v,O,0),this.onData(E)):this.onData(s.shrinkBuf(z.output,z.next_out)))),z.avail_in===0&&z.avail_out===0&&(I=!0)}while((0<z.avail_in||z.avail_out===0)&&b!==l.Z_STREAM_END);return b===l.Z_STREAM_END&&(k=l.Z_FINISH),k===l.Z_FINISH?(b=o.inflateEnd(this.strm),this.onEnd(b),this.ended=!0,b===l.Z_OK):k!==l.Z_SYNC_FLUSH||(this.onEnd(l.Z_OK),!(z.avail_out=0))},u.prototype.onData=function(f){this.chunks.push(f)},u.prototype.onEnd=function(f){f===l.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=f,this.msg=this.strm.msg},i.Inflate=u,i.inflate=g,i.inflateRaw=function(f,_){return(_=_||{}).raw=!0,g(f,_)},i.ungzip=g},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(e,r,i){var o=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";i.assign=function(l){for(var c=Array.prototype.slice.call(arguments,1);c.length;){var d=c.shift();if(d){if(typeof d!="object")throw new TypeError(d+"must be non-object");for(var p in d)d.hasOwnProperty(p)&&(l[p]=d[p])}}return l},i.shrinkBuf=function(l,c){return l.length===c?l:l.subarray?l.subarray(0,c):(l.length=c,l)};var s={arraySet:function(l,c,d,p,h){if(c.subarray&&l.subarray)l.set(c.subarray(d,d+p),h);else for(var u=0;u<p;u++)l[h+u]=c[d+u]},flattenChunks:function(l){var c,d,p,h,u,g;for(c=p=0,d=l.length;c<d;c++)p+=l[c].length;for(g=new Uint8Array(p),c=h=0,d=l.length;c<d;c++)u=l[c],g.set(u,h),h+=u.length;return g}},a={arraySet:function(l,c,d,p,h){for(var u=0;u<p;u++)l[h+u]=c[d+u]},flattenChunks:function(l){return[].concat.apply([],l)}};i.setTyped=function(l){l?(i.Buf8=Uint8Array,i.Buf16=Uint16Array,i.Buf32=Int32Array,i.assign(i,s)):(i.Buf8=Array,i.Buf16=Array,i.Buf32=Array,i.assign(i,a))},i.setTyped(o)},{}],42:[function(e,r,i){var o=e("./common"),s=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch{s=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{a=!1}for(var l=new o.Buf8(256),c=0;c<256;c++)l[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;function d(p,h){if(h<65537&&(p.subarray&&a||!p.subarray&&s))return String.fromCharCode.apply(null,o.shrinkBuf(p,h));for(var u="",g=0;g<h;g++)u+=String.fromCharCode(p[g]);return u}l[254]=l[254]=1,i.string2buf=function(p){var h,u,g,f,_,b=p.length,k=0;for(f=0;f<b;f++)(64512&(u=p.charCodeAt(f)))==55296&&f+1<b&&(64512&(g=p.charCodeAt(f+1)))==56320&&(u=65536+(u-55296<<10)+(g-56320),f++),k+=u<128?1:u<2048?2:u<65536?3:4;for(h=new o.Buf8(k),f=_=0;_<k;f++)(64512&(u=p.charCodeAt(f)))==55296&&f+1<b&&(64512&(g=p.charCodeAt(f+1)))==56320&&(u=65536+(u-55296<<10)+(g-56320),f++),u<128?h[_++]=u:(u<2048?h[_++]=192|u>>>6:(u<65536?h[_++]=224|u>>>12:(h[_++]=240|u>>>18,h[_++]=128|u>>>12&63),h[_++]=128|u>>>6&63),h[_++]=128|63&u);return h},i.buf2binstring=function(p){return d(p,p.length)},i.binstring2buf=function(p){for(var h=new o.Buf8(p.length),u=0,g=h.length;u<g;u++)h[u]=p.charCodeAt(u);return h},i.buf2string=function(p,h){var u,g,f,_,b=h||p.length,k=new Array(2*b);for(u=g=0;u<b;)if((f=p[u++])<128)k[g++]=f;else if(4<(_=l[f]))k[g++]=65533,u+=_-1;else{for(f&=_===2?31:_===3?15:7;1<_&&u<b;)f=f<<6|63&p[u++],_--;1<_?k[g++]=65533:f<65536?k[g++]=f:(f-=65536,k[g++]=55296|f>>10&1023,k[g++]=56320|1023&f)}return d(k,g)},i.utf8border=function(p,h){var u;for((h=h||p.length)>p.length&&(h=p.length),u=h-1;0<=u&&(192&p[u])==128;)u--;return u<0||u===0?h:u+l[p[u]]>h?u:h}},{"./common":41}],43:[function(e,r,i){r.exports=function(o,s,a,l){for(var c=65535&o|0,d=o>>>16&65535|0,p=0;a!==0;){for(a-=p=2e3<a?2e3:a;d=d+(c=c+s[l++]|0)|0,--p;);c%=65521,d%=65521}return c|d<<16|0}},{}],44:[function(e,r,i){r.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(e,r,i){var o=function(){for(var s,a=[],l=0;l<256;l++){s=l;for(var c=0;c<8;c++)s=1&s?3988292384^s>>>1:s>>>1;a[l]=s}return a}();r.exports=function(s,a,l,c){var d=o,p=c+l;s^=-1;for(var h=c;h<p;h++)s=s>>>8^d[255&(s^a[h])];return-1^s}},{}],46:[function(e,r,i){var o,s=e("../utils/common"),a=e("./trees"),l=e("./adler32"),c=e("./crc32"),d=e("./messages"),p=0,h=4,u=0,g=-2,f=-1,_=4,b=2,k=8,v=9,O=286,E=30,L=19,z=2*O+1,U=15,N=3,I=258,j=I+N+1,C=42,H=113,y=1,q=2,fe=3,K=4;function ie(m,W){return m.msg=d[W],W}function Y(m){return(m<<1)-(4<m?9:0)}function se(m){for(var W=m.length;0<=--W;)m[W]=0}function D(m){var W=m.state,x=W.pending;x>m.avail_out&&(x=m.avail_out),x!==0&&(s.arraySet(m.output,W.pending_buf,W.pending_out,x,m.next_out),m.next_out+=x,W.pending_out+=x,m.total_out+=x,m.avail_out-=x,W.pending-=x,W.pending===0&&(W.pending_out=0))}function F(m,W){a._tr_flush_block(m,0<=m.block_start?m.block_start:-1,m.strstart-m.block_start,W),m.block_start=m.strstart,D(m.strm)}function de(m,W){m.pending_buf[m.pending++]=W}function oe(m,W){m.pending_buf[m.pending++]=W>>>8&255,m.pending_buf[m.pending++]=255&W}function J(m,W){var x,w,S=m.max_chain_length,P=m.strstart,X=m.prev_length,Q=m.nice_match,B=m.strstart>m.w_size-j?m.strstart-(m.w_size-j):0,te=m.window,ue=m.w_mask,re=m.prev,_e=m.strstart+I,Ae=te[P+X-1],ve=te[P+X];m.prev_length>=m.good_match&&(S>>=2),Q>m.lookahead&&(Q=m.lookahead);do if(te[(x=W)+X]===ve&&te[x+X-1]===Ae&&te[x]===te[P]&&te[++x]===te[P+1]){P+=2,x++;do;while(te[++P]===te[++x]&&te[++P]===te[++x]&&te[++P]===te[++x]&&te[++P]===te[++x]&&te[++P]===te[++x]&&te[++P]===te[++x]&&te[++P]===te[++x]&&te[++P]===te[++x]&&P<_e);if(w=I-(_e-P),P=_e-I,X<w){if(m.match_start=W,Q<=(X=w))break;Ae=te[P+X-1],ve=te[P+X]}}while((W=re[W&ue])>B&&--S!=0);return X<=m.lookahead?X:m.lookahead}function ze(m){var W,x,w,S,P,X,Q,B,te,ue,re=m.w_size;do{if(S=m.window_size-m.lookahead-m.strstart,m.strstart>=re+(re-j)){for(s.arraySet(m.window,m.window,re,re,0),m.match_start-=re,m.strstart-=re,m.block_start-=re,W=x=m.hash_size;w=m.head[--W],m.head[W]=re<=w?w-re:0,--x;);for(W=x=re;w=m.prev[--W],m.prev[W]=re<=w?w-re:0,--x;);S+=re}if(m.strm.avail_in===0)break;if(X=m.strm,Q=m.window,B=m.strstart+m.lookahead,te=S,ue=void 0,ue=X.avail_in,te<ue&&(ue=te),x=ue===0?0:(X.avail_in-=ue,s.arraySet(Q,X.input,X.next_in,ue,B),X.state.wrap===1?X.adler=l(X.adler,Q,ue,B):X.state.wrap===2&&(X.adler=c(X.adler,Q,ue,B)),X.next_in+=ue,X.total_in+=ue,ue),m.lookahead+=x,m.lookahead+m.insert>=N)for(P=m.strstart-m.insert,m.ins_h=m.window[P],m.ins_h=(m.ins_h<<m.hash_shift^m.window[P+1])&m.hash_mask;m.insert&&(m.ins_h=(m.ins_h<<m.hash_shift^m.window[P+N-1])&m.hash_mask,m.prev[P&m.w_mask]=m.head[m.ins_h],m.head[m.ins_h]=P,P++,m.insert--,!(m.lookahead+m.insert<N)););}while(m.lookahead<j&&m.strm.avail_in!==0)}function Se(m,W){for(var x,w;;){if(m.lookahead<j){if(ze(m),m.lookahead<j&&W===p)return y;if(m.lookahead===0)break}if(x=0,m.lookahead>=N&&(m.ins_h=(m.ins_h<<m.hash_shift^m.window[m.strstart+N-1])&m.hash_mask,x=m.prev[m.strstart&m.w_mask]=m.head[m.ins_h],m.head[m.ins_h]=m.strstart),x!==0&&m.strstart-x<=m.w_size-j&&(m.match_length=J(m,x)),m.match_length>=N)if(w=a._tr_tally(m,m.strstart-m.match_start,m.match_length-N),m.lookahead-=m.match_length,m.match_length<=m.max_lazy_match&&m.lookahead>=N){for(m.match_length--;m.strstart++,m.ins_h=(m.ins_h<<m.hash_shift^m.window[m.strstart+N-1])&m.hash_mask,x=m.prev[m.strstart&m.w_mask]=m.head[m.ins_h],m.head[m.ins_h]=m.strstart,--m.match_length!=0;);m.strstart++}else m.strstart+=m.match_length,m.match_length=0,m.ins_h=m.window[m.strstart],m.ins_h=(m.ins_h<<m.hash_shift^m.window[m.strstart+1])&m.hash_mask;else w=a._tr_tally(m,0,m.window[m.strstart]),m.lookahead--,m.strstart++;if(w&&(F(m,!1),m.strm.avail_out===0))return y}return m.insert=m.strstart<N-1?m.strstart:N-1,W===h?(F(m,!0),m.strm.avail_out===0?fe:K):m.last_lit&&(F(m,!1),m.strm.avail_out===0)?y:q}function me(m,W){for(var x,w,S;;){if(m.lookahead<j){if(ze(m),m.lookahead<j&&W===p)return y;if(m.lookahead===0)break}if(x=0,m.lookahead>=N&&(m.ins_h=(m.ins_h<<m.hash_shift^m.window[m.strstart+N-1])&m.hash_mask,x=m.prev[m.strstart&m.w_mask]=m.head[m.ins_h],m.head[m.ins_h]=m.strstart),m.prev_length=m.match_length,m.prev_match=m.match_start,m.match_length=N-1,x!==0&&m.prev_length<m.max_lazy_match&&m.strstart-x<=m.w_size-j&&(m.match_length=J(m,x),m.match_length<=5&&(m.strategy===1||m.match_length===N&&4096<m.strstart-m.match_start)&&(m.match_length=N-1)),m.prev_length>=N&&m.match_length<=m.prev_length){for(S=m.strstart+m.lookahead-N,w=a._tr_tally(m,m.strstart-1-m.prev_match,m.prev_length-N),m.lookahead-=m.prev_length-1,m.prev_length-=2;++m.strstart<=S&&(m.ins_h=(m.ins_h<<m.hash_shift^m.window[m.strstart+N-1])&m.hash_mask,x=m.prev[m.strstart&m.w_mask]=m.head[m.ins_h],m.head[m.ins_h]=m.strstart),--m.prev_length!=0;);if(m.match_available=0,m.match_length=N-1,m.strstart++,w&&(F(m,!1),m.strm.avail_out===0))return y}else if(m.match_available){if((w=a._tr_tally(m,0,m.window[m.strstart-1]))&&F(m,!1),m.strstart++,m.lookahead--,m.strm.avail_out===0)return y}else m.match_available=1,m.strstart++,m.lookahead--}return m.match_available&&(w=a._tr_tally(m,0,m.window[m.strstart-1]),m.match_available=0),m.insert=m.strstart<N-1?m.strstart:N-1,W===h?(F(m,!0),m.strm.avail_out===0?fe:K):m.last_lit&&(F(m,!1),m.strm.avail_out===0)?y:q}function le(m,W,x,w,S){this.good_length=m,this.max_lazy=W,this.nice_length=x,this.max_chain=w,this.func=S}function Te(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=k,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new s.Buf16(2*z),this.dyn_dtree=new s.Buf16(2*(2*E+1)),this.bl_tree=new s.Buf16(2*(2*L+1)),se(this.dyn_ltree),se(this.dyn_dtree),se(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new s.Buf16(U+1),this.heap=new s.Buf16(2*O+1),se(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new s.Buf16(2*O+1),se(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function Ce(m){var W;return m&&m.state?(m.total_in=m.total_out=0,m.data_type=b,(W=m.state).pending=0,W.pending_out=0,W.wrap<0&&(W.wrap=-W.wrap),W.status=W.wrap?C:H,m.adler=W.wrap===2?0:1,W.last_flush=p,a._tr_init(W),u):ie(m,g)}function Oe(m){var W=Ce(m);return W===u&&function(x){x.window_size=2*x.w_size,se(x.head),x.max_lazy_match=o[x.level].max_lazy,x.good_match=o[x.level].good_length,x.nice_match=o[x.level].nice_length,x.max_chain_length=o[x.level].max_chain,x.strstart=0,x.block_start=0,x.lookahead=0,x.insert=0,x.match_length=x.prev_length=N-1,x.match_available=0,x.ins_h=0}(m.state),W}function he(m,W,x,w,S,P){if(!m)return g;var X=1;if(W===f&&(W=6),w<0?(X=0,w=-w):15<w&&(X=2,w-=16),S<1||v<S||x!==k||w<8||15<w||W<0||9<W||P<0||_<P)return ie(m,g);w===8&&(w=9);var Q=new Te;return(m.state=Q).strm=m,Q.wrap=X,Q.gzhead=null,Q.w_bits=w,Q.w_size=1<<Q.w_bits,Q.w_mask=Q.w_size-1,Q.hash_bits=S+7,Q.hash_size=1<<Q.hash_bits,Q.hash_mask=Q.hash_size-1,Q.hash_shift=~~((Q.hash_bits+N-1)/N),Q.window=new s.Buf8(2*Q.w_size),Q.head=new s.Buf16(Q.hash_size),Q.prev=new s.Buf16(Q.w_size),Q.lit_bufsize=1<<S+6,Q.pending_buf_size=4*Q.lit_bufsize,Q.pending_buf=new s.Buf8(Q.pending_buf_size),Q.d_buf=1*Q.lit_bufsize,Q.l_buf=3*Q.lit_bufsize,Q.level=W,Q.strategy=P,Q.method=x,Oe(m)}o=[new le(0,0,0,0,function(m,W){var x=65535;for(x>m.pending_buf_size-5&&(x=m.pending_buf_size-5);;){if(m.lookahead<=1){if(ze(m),m.lookahead===0&&W===p)return y;if(m.lookahead===0)break}m.strstart+=m.lookahead,m.lookahead=0;var w=m.block_start+x;if((m.strstart===0||m.strstart>=w)&&(m.lookahead=m.strstart-w,m.strstart=w,F(m,!1),m.strm.avail_out===0)||m.strstart-m.block_start>=m.w_size-j&&(F(m,!1),m.strm.avail_out===0))return y}return m.insert=0,W===h?(F(m,!0),m.strm.avail_out===0?fe:K):(m.strstart>m.block_start&&(F(m,!1),m.strm.avail_out),y)}),new le(4,4,8,4,Se),new le(4,5,16,8,Se),new le(4,6,32,32,Se),new le(4,4,16,16,me),new le(8,16,32,32,me),new le(8,16,128,128,me),new le(8,32,128,256,me),new le(32,128,258,1024,me),new le(32,258,258,4096,me)],i.deflateInit=function(m,W){return he(m,W,k,15,8,0)},i.deflateInit2=he,i.deflateReset=Oe,i.deflateResetKeep=Ce,i.deflateSetHeader=function(m,W){return m&&m.state?m.state.wrap!==2?g:(m.state.gzhead=W,u):g},i.deflate=function(m,W){var x,w,S,P;if(!m||!m.state||5<W||W<0)return m?ie(m,g):g;if(w=m.state,!m.output||!m.input&&m.avail_in!==0||w.status===666&&W!==h)return ie(m,m.avail_out===0?-5:g);if(w.strm=m,x=w.last_flush,w.last_flush=W,w.status===C)if(w.wrap===2)m.adler=0,de(w,31),de(w,139),de(w,8),w.gzhead?(de(w,(w.gzhead.text?1:0)+(w.gzhead.hcrc?2:0)+(w.gzhead.extra?4:0)+(w.gzhead.name?8:0)+(w.gzhead.comment?16:0)),de(w,255&w.gzhead.time),de(w,w.gzhead.time>>8&255),de(w,w.gzhead.time>>16&255),de(w,w.gzhead.time>>24&255),de(w,w.level===9?2:2<=w.strategy||w.level<2?4:0),de(w,255&w.gzhead.os),w.gzhead.extra&&w.gzhead.extra.length&&(de(w,255&w.gzhead.extra.length),de(w,w.gzhead.extra.length>>8&255)),w.gzhead.hcrc&&(m.adler=c(m.adler,w.pending_buf,w.pending,0)),w.gzindex=0,w.status=69):(de(w,0),de(w,0),de(w,0),de(w,0),de(w,0),de(w,w.level===9?2:2<=w.strategy||w.level<2?4:0),de(w,3),w.status=H);else{var X=k+(w.w_bits-8<<4)<<8;X|=(2<=w.strategy||w.level<2?0:w.level<6?1:w.level===6?2:3)<<6,w.strstart!==0&&(X|=32),X+=31-X%31,w.status=H,oe(w,X),w.strstart!==0&&(oe(w,m.adler>>>16),oe(w,65535&m.adler)),m.adler=1}if(w.status===69)if(w.gzhead.extra){for(S=w.pending;w.gzindex<(65535&w.gzhead.extra.length)&&(w.pending!==w.pending_buf_size||(w.gzhead.hcrc&&w.pending>S&&(m.adler=c(m.adler,w.pending_buf,w.pending-S,S)),D(m),S=w.pending,w.pending!==w.pending_buf_size));)de(w,255&w.gzhead.extra[w.gzindex]),w.gzindex++;w.gzhead.hcrc&&w.pending>S&&(m.adler=c(m.adler,w.pending_buf,w.pending-S,S)),w.gzindex===w.gzhead.extra.length&&(w.gzindex=0,w.status=73)}else w.status=73;if(w.status===73)if(w.gzhead.name){S=w.pending;do{if(w.pending===w.pending_buf_size&&(w.gzhead.hcrc&&w.pending>S&&(m.adler=c(m.adler,w.pending_buf,w.pending-S,S)),D(m),S=w.pending,w.pending===w.pending_buf_size)){P=1;break}P=w.gzindex<w.gzhead.name.length?255&w.gzhead.name.charCodeAt(w.gzindex++):0,de(w,P)}while(P!==0);w.gzhead.hcrc&&w.pending>S&&(m.adler=c(m.adler,w.pending_buf,w.pending-S,S)),P===0&&(w.gzindex=0,w.status=91)}else w.status=91;if(w.status===91)if(w.gzhead.comment){S=w.pending;do{if(w.pending===w.pending_buf_size&&(w.gzhead.hcrc&&w.pending>S&&(m.adler=c(m.adler,w.pending_buf,w.pending-S,S)),D(m),S=w.pending,w.pending===w.pending_buf_size)){P=1;break}P=w.gzindex<w.gzhead.comment.length?255&w.gzhead.comment.charCodeAt(w.gzindex++):0,de(w,P)}while(P!==0);w.gzhead.hcrc&&w.pending>S&&(m.adler=c(m.adler,w.pending_buf,w.pending-S,S)),P===0&&(w.status=103)}else w.status=103;if(w.status===103&&(w.gzhead.hcrc?(w.pending+2>w.pending_buf_size&&D(m),w.pending+2<=w.pending_buf_size&&(de(w,255&m.adler),de(w,m.adler>>8&255),m.adler=0,w.status=H)):w.status=H),w.pending!==0){if(D(m),m.avail_out===0)return w.last_flush=-1,u}else if(m.avail_in===0&&Y(W)<=Y(x)&&W!==h)return ie(m,-5);if(w.status===666&&m.avail_in!==0)return ie(m,-5);if(m.avail_in!==0||w.lookahead!==0||W!==p&&w.status!==666){var Q=w.strategy===2?function(B,te){for(var ue;;){if(B.lookahead===0&&(ze(B),B.lookahead===0)){if(te===p)return y;break}if(B.match_length=0,ue=a._tr_tally(B,0,B.window[B.strstart]),B.lookahead--,B.strstart++,ue&&(F(B,!1),B.strm.avail_out===0))return y}return B.insert=0,te===h?(F(B,!0),B.strm.avail_out===0?fe:K):B.last_lit&&(F(B,!1),B.strm.avail_out===0)?y:q}(w,W):w.strategy===3?function(B,te){for(var ue,re,_e,Ae,ve=B.window;;){if(B.lookahead<=I){if(ze(B),B.lookahead<=I&&te===p)return y;if(B.lookahead===0)break}if(B.match_length=0,B.lookahead>=N&&0<B.strstart&&(re=ve[_e=B.strstart-1])===ve[++_e]&&re===ve[++_e]&&re===ve[++_e]){Ae=B.strstart+I;do;while(re===ve[++_e]&&re===ve[++_e]&&re===ve[++_e]&&re===ve[++_e]&&re===ve[++_e]&&re===ve[++_e]&&re===ve[++_e]&&re===ve[++_e]&&_e<Ae);B.match_length=I-(Ae-_e),B.match_length>B.lookahead&&(B.match_length=B.lookahead)}if(B.match_length>=N?(ue=a._tr_tally(B,1,B.match_length-N),B.lookahead-=B.match_length,B.strstart+=B.match_length,B.match_length=0):(ue=a._tr_tally(B,0,B.window[B.strstart]),B.lookahead--,B.strstart++),ue&&(F(B,!1),B.strm.avail_out===0))return y}return B.insert=0,te===h?(F(B,!0),B.strm.avail_out===0?fe:K):B.last_lit&&(F(B,!1),B.strm.avail_out===0)?y:q}(w,W):o[w.level].func(w,W);if(Q!==fe&&Q!==K||(w.status=666),Q===y||Q===fe)return m.avail_out===0&&(w.last_flush=-1),u;if(Q===q&&(W===1?a._tr_align(w):W!==5&&(a._tr_stored_block(w,0,0,!1),W===3&&(se(w.head),w.lookahead===0&&(w.strstart=0,w.block_start=0,w.insert=0))),D(m),m.avail_out===0))return w.last_flush=-1,u}return W!==h?u:w.wrap<=0?1:(w.wrap===2?(de(w,255&m.adler),de(w,m.adler>>8&255),de(w,m.adler>>16&255),de(w,m.adler>>24&255),de(w,255&m.total_in),de(w,m.total_in>>8&255),de(w,m.total_in>>16&255),de(w,m.total_in>>24&255)):(oe(w,m.adler>>>16),oe(w,65535&m.adler)),D(m),0<w.wrap&&(w.wrap=-w.wrap),w.pending!==0?u:1)},i.deflateEnd=function(m){var W;return m&&m.state?(W=m.state.status)!==C&&W!==69&&W!==73&&W!==91&&W!==103&&W!==H&&W!==666?ie(m,g):(m.state=null,W===H?ie(m,-3):u):g},i.deflateSetDictionary=function(m,W){var x,w,S,P,X,Q,B,te,ue=W.length;if(!m||!m.state||(P=(x=m.state).wrap)===2||P===1&&x.status!==C||x.lookahead)return g;for(P===1&&(m.adler=l(m.adler,W,ue,0)),x.wrap=0,ue>=x.w_size&&(P===0&&(se(x.head),x.strstart=0,x.block_start=0,x.insert=0),te=new s.Buf8(x.w_size),s.arraySet(te,W,ue-x.w_size,x.w_size,0),W=te,ue=x.w_size),X=m.avail_in,Q=m.next_in,B=m.input,m.avail_in=ue,m.next_in=0,m.input=W,ze(x);x.lookahead>=N;){for(w=x.strstart,S=x.lookahead-(N-1);x.ins_h=(x.ins_h<<x.hash_shift^x.window[w+N-1])&x.hash_mask,x.prev[w&x.w_mask]=x.head[x.ins_h],x.head[x.ins_h]=w,w++,--S;);x.strstart=w,x.lookahead=N-1,ze(x)}return x.strstart+=x.lookahead,x.block_start=x.strstart,x.insert=x.lookahead,x.lookahead=0,x.match_length=x.prev_length=N-1,x.match_available=0,m.next_in=Q,m.input=B,m.avail_in=X,x.wrap=P,u},i.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(e,r,i){r.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(e,r,i){r.exports=function(o,s){var a,l,c,d,p,h,u,g,f,_,b,k,v,O,E,L,z,U,N,I,j,C,H,y,q;a=o.state,l=o.next_in,y=o.input,c=l+(o.avail_in-5),d=o.next_out,q=o.output,p=d-(s-o.avail_out),h=d+(o.avail_out-257),u=a.dmax,g=a.wsize,f=a.whave,_=a.wnext,b=a.window,k=a.hold,v=a.bits,O=a.lencode,E=a.distcode,L=(1<<a.lenbits)-1,z=(1<<a.distbits)-1;e:do{v<15&&(k+=y[l++]<<v,v+=8,k+=y[l++]<<v,v+=8),U=O[k&L];t:for(;;){if(k>>>=N=U>>>24,v-=N,(N=U>>>16&255)===0)q[d++]=65535&U;else{if(!(16&N)){if(!(64&N)){U=O[(65535&U)+(k&(1<<N)-1)];continue t}if(32&N){a.mode=12;break e}o.msg="invalid literal/length code",a.mode=30;break e}I=65535&U,(N&=15)&&(v<N&&(k+=y[l++]<<v,v+=8),I+=k&(1<<N)-1,k>>>=N,v-=N),v<15&&(k+=y[l++]<<v,v+=8,k+=y[l++]<<v,v+=8),U=E[k&z];n:for(;;){if(k>>>=N=U>>>24,v-=N,!(16&(N=U>>>16&255))){if(!(64&N)){U=E[(65535&U)+(k&(1<<N)-1)];continue n}o.msg="invalid distance code",a.mode=30;break e}if(j=65535&U,v<(N&=15)&&(k+=y[l++]<<v,(v+=8)<N&&(k+=y[l++]<<v,v+=8)),u<(j+=k&(1<<N)-1)){o.msg="invalid distance too far back",a.mode=30;break e}if(k>>>=N,v-=N,(N=d-p)<j){if(f<(N=j-N)&&a.sane){o.msg="invalid distance too far back",a.mode=30;break e}if(H=b,(C=0)===_){if(C+=g-N,N<I){for(I-=N;q[d++]=b[C++],--N;);C=d-j,H=q}}else if(_<N){if(C+=g+_-N,(N-=_)<I){for(I-=N;q[d++]=b[C++],--N;);if(C=0,_<I){for(I-=N=_;q[d++]=b[C++],--N;);C=d-j,H=q}}}else if(C+=_-N,N<I){for(I-=N;q[d++]=b[C++],--N;);C=d-j,H=q}for(;2<I;)q[d++]=H[C++],q[d++]=H[C++],q[d++]=H[C++],I-=3;I&&(q[d++]=H[C++],1<I&&(q[d++]=H[C++]))}else{for(C=d-j;q[d++]=q[C++],q[d++]=q[C++],q[d++]=q[C++],2<(I-=3););I&&(q[d++]=q[C++],1<I&&(q[d++]=q[C++]))}break}}break}}while(l<c&&d<h);l-=I=v>>3,k&=(1<<(v-=I<<3))-1,o.next_in=l,o.next_out=d,o.avail_in=l<c?c-l+5:5-(l-c),o.avail_out=d<h?h-d+257:257-(d-h),a.hold=k,a.bits=v}},{}],49:[function(e,r,i){var o=e("../utils/common"),s=e("./adler32"),a=e("./crc32"),l=e("./inffast"),c=e("./inftrees"),d=1,p=2,h=0,u=-2,g=1,f=852,_=592;function b(C){return(C>>>24&255)+(C>>>8&65280)+((65280&C)<<8)+((255&C)<<24)}function k(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new o.Buf16(320),this.work=new o.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function v(C){var H;return C&&C.state?(H=C.state,C.total_in=C.total_out=H.total=0,C.msg="",H.wrap&&(C.adler=1&H.wrap),H.mode=g,H.last=0,H.havedict=0,H.dmax=32768,H.head=null,H.hold=0,H.bits=0,H.lencode=H.lendyn=new o.Buf32(f),H.distcode=H.distdyn=new o.Buf32(_),H.sane=1,H.back=-1,h):u}function O(C){var H;return C&&C.state?((H=C.state).wsize=0,H.whave=0,H.wnext=0,v(C)):u}function E(C,H){var y,q;return C&&C.state?(q=C.state,H<0?(y=0,H=-H):(y=1+(H>>4),H<48&&(H&=15)),H&&(H<8||15<H)?u:(q.window!==null&&q.wbits!==H&&(q.window=null),q.wrap=y,q.wbits=H,O(C))):u}function L(C,H){var y,q;return C?(q=new k,(C.state=q).window=null,(y=E(C,H))!==h&&(C.state=null),y):u}var z,U,N=!0;function I(C){if(N){var H;for(z=new o.Buf32(512),U=new o.Buf32(32),H=0;H<144;)C.lens[H++]=8;for(;H<256;)C.lens[H++]=9;for(;H<280;)C.lens[H++]=7;for(;H<288;)C.lens[H++]=8;for(c(d,C.lens,0,288,z,0,C.work,{bits:9}),H=0;H<32;)C.lens[H++]=5;c(p,C.lens,0,32,U,0,C.work,{bits:5}),N=!1}C.lencode=z,C.lenbits=9,C.distcode=U,C.distbits=5}function j(C,H,y,q){var fe,K=C.state;return K.window===null&&(K.wsize=1<<K.wbits,K.wnext=0,K.whave=0,K.window=new o.Buf8(K.wsize)),q>=K.wsize?(o.arraySet(K.window,H,y-K.wsize,K.wsize,0),K.wnext=0,K.whave=K.wsize):(q<(fe=K.wsize-K.wnext)&&(fe=q),o.arraySet(K.window,H,y-q,fe,K.wnext),(q-=fe)?(o.arraySet(K.window,H,y-q,q,0),K.wnext=q,K.whave=K.wsize):(K.wnext+=fe,K.wnext===K.wsize&&(K.wnext=0),K.whave<K.wsize&&(K.whave+=fe))),0}i.inflateReset=O,i.inflateReset2=E,i.inflateResetKeep=v,i.inflateInit=function(C){return L(C,15)},i.inflateInit2=L,i.inflate=function(C,H){var y,q,fe,K,ie,Y,se,D,F,de,oe,J,ze,Se,me,le,Te,Ce,Oe,he,m,W,x,w,S=0,P=new o.Buf8(4),X=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!C||!C.state||!C.output||!C.input&&C.avail_in!==0)return u;(y=C.state).mode===12&&(y.mode=13),ie=C.next_out,fe=C.output,se=C.avail_out,K=C.next_in,q=C.input,Y=C.avail_in,D=y.hold,F=y.bits,de=Y,oe=se,W=h;e:for(;;)switch(y.mode){case g:if(y.wrap===0){y.mode=13;break}for(;F<16;){if(Y===0)break e;Y--,D+=q[K++]<<F,F+=8}if(2&y.wrap&&D===35615){P[y.check=0]=255&D,P[1]=D>>>8&255,y.check=a(y.check,P,2,0),F=D=0,y.mode=2;break}if(y.flags=0,y.head&&(y.head.done=!1),!(1&y.wrap)||(((255&D)<<8)+(D>>8))%31){C.msg="incorrect header check",y.mode=30;break}if((15&D)!=8){C.msg="unknown compression method",y.mode=30;break}if(F-=4,m=8+(15&(D>>>=4)),y.wbits===0)y.wbits=m;else if(m>y.wbits){C.msg="invalid window size",y.mode=30;break}y.dmax=1<<m,C.adler=y.check=1,y.mode=512&D?10:12,F=D=0;break;case 2:for(;F<16;){if(Y===0)break e;Y--,D+=q[K++]<<F,F+=8}if(y.flags=D,(255&y.flags)!=8){C.msg="unknown compression method",y.mode=30;break}if(57344&y.flags){C.msg="unknown header flags set",y.mode=30;break}y.head&&(y.head.text=D>>8&1),512&y.flags&&(P[0]=255&D,P[1]=D>>>8&255,y.check=a(y.check,P,2,0)),F=D=0,y.mode=3;case 3:for(;F<32;){if(Y===0)break e;Y--,D+=q[K++]<<F,F+=8}y.head&&(y.head.time=D),512&y.flags&&(P[0]=255&D,P[1]=D>>>8&255,P[2]=D>>>16&255,P[3]=D>>>24&255,y.check=a(y.check,P,4,0)),F=D=0,y.mode=4;case 4:for(;F<16;){if(Y===0)break e;Y--,D+=q[K++]<<F,F+=8}y.head&&(y.head.xflags=255&D,y.head.os=D>>8),512&y.flags&&(P[0]=255&D,P[1]=D>>>8&255,y.check=a(y.check,P,2,0)),F=D=0,y.mode=5;case 5:if(1024&y.flags){for(;F<16;){if(Y===0)break e;Y--,D+=q[K++]<<F,F+=8}y.length=D,y.head&&(y.head.extra_len=D),512&y.flags&&(P[0]=255&D,P[1]=D>>>8&255,y.check=a(y.check,P,2,0)),F=D=0}else y.head&&(y.head.extra=null);y.mode=6;case 6:if(1024&y.flags&&(Y<(J=y.length)&&(J=Y),J&&(y.head&&(m=y.head.extra_len-y.length,y.head.extra||(y.head.extra=new Array(y.head.extra_len)),o.arraySet(y.head.extra,q,K,J,m)),512&y.flags&&(y.check=a(y.check,q,J,K)),Y-=J,K+=J,y.length-=J),y.length))break e;y.length=0,y.mode=7;case 7:if(2048&y.flags){if(Y===0)break e;for(J=0;m=q[K+J++],y.head&&m&&y.length<65536&&(y.head.name+=String.fromCharCode(m)),m&&J<Y;);if(512&y.flags&&(y.check=a(y.check,q,J,K)),Y-=J,K+=J,m)break e}else y.head&&(y.head.name=null);y.length=0,y.mode=8;case 8:if(4096&y.flags){if(Y===0)break e;for(J=0;m=q[K+J++],y.head&&m&&y.length<65536&&(y.head.comment+=String.fromCharCode(m)),m&&J<Y;);if(512&y.flags&&(y.check=a(y.check,q,J,K)),Y-=J,K+=J,m)break e}else y.head&&(y.head.comment=null);y.mode=9;case 9:if(512&y.flags){for(;F<16;){if(Y===0)break e;Y--,D+=q[K++]<<F,F+=8}if(D!==(65535&y.check)){C.msg="header crc mismatch",y.mode=30;break}F=D=0}y.head&&(y.head.hcrc=y.flags>>9&1,y.head.done=!0),C.adler=y.check=0,y.mode=12;break;case 10:for(;F<32;){if(Y===0)break e;Y--,D+=q[K++]<<F,F+=8}C.adler=y.check=b(D),F=D=0,y.mode=11;case 11:if(y.havedict===0)return C.next_out=ie,C.avail_out=se,C.next_in=K,C.avail_in=Y,y.hold=D,y.bits=F,2;C.adler=y.check=1,y.mode=12;case 12:if(H===5||H===6)break e;case 13:if(y.last){D>>>=7&F,F-=7&F,y.mode=27;break}for(;F<3;){if(Y===0)break e;Y--,D+=q[K++]<<F,F+=8}switch(y.last=1&D,F-=1,3&(D>>>=1)){case 0:y.mode=14;break;case 1:if(I(y),y.mode=20,H!==6)break;D>>>=2,F-=2;break e;case 2:y.mode=17;break;case 3:C.msg="invalid block type",y.mode=30}D>>>=2,F-=2;break;case 14:for(D>>>=7&F,F-=7&F;F<32;){if(Y===0)break e;Y--,D+=q[K++]<<F,F+=8}if((65535&D)!=(D>>>16^65535)){C.msg="invalid stored block lengths",y.mode=30;break}if(y.length=65535&D,F=D=0,y.mode=15,H===6)break e;case 15:y.mode=16;case 16:if(J=y.length){if(Y<J&&(J=Y),se<J&&(J=se),J===0)break e;o.arraySet(fe,q,K,J,ie),Y-=J,K+=J,se-=J,ie+=J,y.length-=J;break}y.mode=12;break;case 17:for(;F<14;){if(Y===0)break e;Y--,D+=q[K++]<<F,F+=8}if(y.nlen=257+(31&D),D>>>=5,F-=5,y.ndist=1+(31&D),D>>>=5,F-=5,y.ncode=4+(15&D),D>>>=4,F-=4,286<y.nlen||30<y.ndist){C.msg="too many length or distance symbols",y.mode=30;break}y.have=0,y.mode=18;case 18:for(;y.have<y.ncode;){for(;F<3;){if(Y===0)break e;Y--,D+=q[K++]<<F,F+=8}y.lens[X[y.have++]]=7&D,D>>>=3,F-=3}for(;y.have<19;)y.lens[X[y.have++]]=0;if(y.lencode=y.lendyn,y.lenbits=7,x={bits:y.lenbits},W=c(0,y.lens,0,19,y.lencode,0,y.work,x),y.lenbits=x.bits,W){C.msg="invalid code lengths set",y.mode=30;break}y.have=0,y.mode=19;case 19:for(;y.have<y.nlen+y.ndist;){for(;le=(S=y.lencode[D&(1<<y.lenbits)-1])>>>16&255,Te=65535&S,!((me=S>>>24)<=F);){if(Y===0)break e;Y--,D+=q[K++]<<F,F+=8}if(Te<16)D>>>=me,F-=me,y.lens[y.have++]=Te;else{if(Te===16){for(w=me+2;F<w;){if(Y===0)break e;Y--,D+=q[K++]<<F,F+=8}if(D>>>=me,F-=me,y.have===0){C.msg="invalid bit length repeat",y.mode=30;break}m=y.lens[y.have-1],J=3+(3&D),D>>>=2,F-=2}else if(Te===17){for(w=me+3;F<w;){if(Y===0)break e;Y--,D+=q[K++]<<F,F+=8}F-=me,m=0,J=3+(7&(D>>>=me)),D>>>=3,F-=3}else{for(w=me+7;F<w;){if(Y===0)break e;Y--,D+=q[K++]<<F,F+=8}F-=me,m=0,J=11+(127&(D>>>=me)),D>>>=7,F-=7}if(y.have+J>y.nlen+y.ndist){C.msg="invalid bit length repeat",y.mode=30;break}for(;J--;)y.lens[y.have++]=m}}if(y.mode===30)break;if(y.lens[256]===0){C.msg="invalid code -- missing end-of-block",y.mode=30;break}if(y.lenbits=9,x={bits:y.lenbits},W=c(d,y.lens,0,y.nlen,y.lencode,0,y.work,x),y.lenbits=x.bits,W){C.msg="invalid literal/lengths set",y.mode=30;break}if(y.distbits=6,y.distcode=y.distdyn,x={bits:y.distbits},W=c(p,y.lens,y.nlen,y.ndist,y.distcode,0,y.work,x),y.distbits=x.bits,W){C.msg="invalid distances set",y.mode=30;break}if(y.mode=20,H===6)break e;case 20:y.mode=21;case 21:if(6<=Y&&258<=se){C.next_out=ie,C.avail_out=se,C.next_in=K,C.avail_in=Y,y.hold=D,y.bits=F,l(C,oe),ie=C.next_out,fe=C.output,se=C.avail_out,K=C.next_in,q=C.input,Y=C.avail_in,D=y.hold,F=y.bits,y.mode===12&&(y.back=-1);break}for(y.back=0;le=(S=y.lencode[D&(1<<y.lenbits)-1])>>>16&255,Te=65535&S,!((me=S>>>24)<=F);){if(Y===0)break e;Y--,D+=q[K++]<<F,F+=8}if(le&&!(240&le)){for(Ce=me,Oe=le,he=Te;le=(S=y.lencode[he+((D&(1<<Ce+Oe)-1)>>Ce)])>>>16&255,Te=65535&S,!(Ce+(me=S>>>24)<=F);){if(Y===0)break e;Y--,D+=q[K++]<<F,F+=8}D>>>=Ce,F-=Ce,y.back+=Ce}if(D>>>=me,F-=me,y.back+=me,y.length=Te,le===0){y.mode=26;break}if(32&le){y.back=-1,y.mode=12;break}if(64&le){C.msg="invalid literal/length code",y.mode=30;break}y.extra=15&le,y.mode=22;case 22:if(y.extra){for(w=y.extra;F<w;){if(Y===0)break e;Y--,D+=q[K++]<<F,F+=8}y.length+=D&(1<<y.extra)-1,D>>>=y.extra,F-=y.extra,y.back+=y.extra}y.was=y.length,y.mode=23;case 23:for(;le=(S=y.distcode[D&(1<<y.distbits)-1])>>>16&255,Te=65535&S,!((me=S>>>24)<=F);){if(Y===0)break e;Y--,D+=q[K++]<<F,F+=8}if(!(240&le)){for(Ce=me,Oe=le,he=Te;le=(S=y.distcode[he+((D&(1<<Ce+Oe)-1)>>Ce)])>>>16&255,Te=65535&S,!(Ce+(me=S>>>24)<=F);){if(Y===0)break e;Y--,D+=q[K++]<<F,F+=8}D>>>=Ce,F-=Ce,y.back+=Ce}if(D>>>=me,F-=me,y.back+=me,64&le){C.msg="invalid distance code",y.mode=30;break}y.offset=Te,y.extra=15&le,y.mode=24;case 24:if(y.extra){for(w=y.extra;F<w;){if(Y===0)break e;Y--,D+=q[K++]<<F,F+=8}y.offset+=D&(1<<y.extra)-1,D>>>=y.extra,F-=y.extra,y.back+=y.extra}if(y.offset>y.dmax){C.msg="invalid distance too far back",y.mode=30;break}y.mode=25;case 25:if(se===0)break e;if(J=oe-se,y.offset>J){if((J=y.offset-J)>y.whave&&y.sane){C.msg="invalid distance too far back",y.mode=30;break}ze=J>y.wnext?(J-=y.wnext,y.wsize-J):y.wnext-J,J>y.length&&(J=y.length),Se=y.window}else Se=fe,ze=ie-y.offset,J=y.length;for(se<J&&(J=se),se-=J,y.length-=J;fe[ie++]=Se[ze++],--J;);y.length===0&&(y.mode=21);break;case 26:if(se===0)break e;fe[ie++]=y.length,se--,y.mode=21;break;case 27:if(y.wrap){for(;F<32;){if(Y===0)break e;Y--,D|=q[K++]<<F,F+=8}if(oe-=se,C.total_out+=oe,y.total+=oe,oe&&(C.adler=y.check=y.flags?a(y.check,fe,oe,ie-oe):s(y.check,fe,oe,ie-oe)),oe=se,(y.flags?D:b(D))!==y.check){C.msg="incorrect data check",y.mode=30;break}F=D=0}y.mode=28;case 28:if(y.wrap&&y.flags){for(;F<32;){if(Y===0)break e;Y--,D+=q[K++]<<F,F+=8}if(D!==(4294967295&y.total)){C.msg="incorrect length check",y.mode=30;break}F=D=0}y.mode=29;case 29:W=1;break e;case 30:W=-3;break e;case 31:return-4;case 32:default:return u}return C.next_out=ie,C.avail_out=se,C.next_in=K,C.avail_in=Y,y.hold=D,y.bits=F,(y.wsize||oe!==C.avail_out&&y.mode<30&&(y.mode<27||H!==4))&&j(C,C.output,C.next_out,oe-C.avail_out)?(y.mode=31,-4):(de-=C.avail_in,oe-=C.avail_out,C.total_in+=de,C.total_out+=oe,y.total+=oe,y.wrap&&oe&&(C.adler=y.check=y.flags?a(y.check,fe,oe,C.next_out-oe):s(y.check,fe,oe,C.next_out-oe)),C.data_type=y.bits+(y.last?64:0)+(y.mode===12?128:0)+(y.mode===20||y.mode===15?256:0),(de==0&&oe===0||H===4)&&W===h&&(W=-5),W)},i.inflateEnd=function(C){if(!C||!C.state)return u;var H=C.state;return H.window&&(H.window=null),C.state=null,h},i.inflateGetHeader=function(C,H){var y;return C&&C.state&&2&(y=C.state).wrap?((y.head=H).done=!1,h):u},i.inflateSetDictionary=function(C,H){var y,q=H.length;return C&&C.state?(y=C.state).wrap!==0&&y.mode!==11?u:y.mode===11&&s(1,H,q,0)!==y.check?-3:j(C,H,q,q)?(y.mode=31,-4):(y.havedict=1,h):u},i.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(e,r,i){var o=e("../utils/common"),s=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],a=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],l=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],c=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];r.exports=function(d,p,h,u,g,f,_,b){var k,v,O,E,L,z,U,N,I,j=b.bits,C=0,H=0,y=0,q=0,fe=0,K=0,ie=0,Y=0,se=0,D=0,F=null,de=0,oe=new o.Buf16(16),J=new o.Buf16(16),ze=null,Se=0;for(C=0;C<=15;C++)oe[C]=0;for(H=0;H<u;H++)oe[p[h+H]]++;for(fe=j,q=15;1<=q&&oe[q]===0;q--);if(q<fe&&(fe=q),q===0)return g[f++]=20971520,g[f++]=20971520,b.bits=1,0;for(y=1;y<q&&oe[y]===0;y++);for(fe<y&&(fe=y),C=Y=1;C<=15;C++)if(Y<<=1,(Y-=oe[C])<0)return-1;if(0<Y&&(d===0||q!==1))return-1;for(J[1]=0,C=1;C<15;C++)J[C+1]=J[C]+oe[C];for(H=0;H<u;H++)p[h+H]!==0&&(_[J[p[h+H]]++]=H);if(z=d===0?(F=ze=_,19):d===1?(F=s,de-=257,ze=a,Se-=257,256):(F=l,ze=c,-1),C=y,L=f,ie=H=D=0,O=-1,E=(se=1<<(K=fe))-1,d===1&&852<se||d===2&&592<se)return 1;for(;;){for(U=C-ie,I=_[H]<z?(N=0,_[H]):_[H]>z?(N=ze[Se+_[H]],F[de+_[H]]):(N=96,0),k=1<<C-ie,y=v=1<<K;g[L+(D>>ie)+(v-=k)]=U<<24|N<<16|I|0,v!==0;);for(k=1<<C-1;D&k;)k>>=1;if(k!==0?(D&=k-1,D+=k):D=0,H++,--oe[C]==0){if(C===q)break;C=p[h+_[H]]}if(fe<C&&(D&E)!==O){for(ie===0&&(ie=fe),L+=y,Y=1<<(K=C-ie);K+ie<q&&!((Y-=oe[K+ie])<=0);)K++,Y<<=1;if(se+=1<<K,d===1&&852<se||d===2&&592<se)return 1;g[O=D&E]=fe<<24|K<<16|L-f|0}}return D!==0&&(g[L+D]=C-ie<<24|64<<16|0),b.bits=fe,0}},{"../utils/common":41}],51:[function(e,r,i){r.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(e,r,i){var o=e("../utils/common"),s=0,a=1;function l(S){for(var P=S.length;0<=--P;)S[P]=0}var c=0,d=29,p=256,h=p+1+d,u=30,g=19,f=2*h+1,_=15,b=16,k=7,v=256,O=16,E=17,L=18,z=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],U=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],N=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],I=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],j=new Array(2*(h+2));l(j);var C=new Array(2*u);l(C);var H=new Array(512);l(H);var y=new Array(256);l(y);var q=new Array(d);l(q);var fe,K,ie,Y=new Array(u);function se(S,P,X,Q,B){this.static_tree=S,this.extra_bits=P,this.extra_base=X,this.elems=Q,this.max_length=B,this.has_stree=S&&S.length}function D(S,P){this.dyn_tree=S,this.max_code=0,this.stat_desc=P}function F(S){return S<256?H[S]:H[256+(S>>>7)]}function de(S,P){S.pending_buf[S.pending++]=255&P,S.pending_buf[S.pending++]=P>>>8&255}function oe(S,P,X){S.bi_valid>b-X?(S.bi_buf|=P<<S.bi_valid&65535,de(S,S.bi_buf),S.bi_buf=P>>b-S.bi_valid,S.bi_valid+=X-b):(S.bi_buf|=P<<S.bi_valid&65535,S.bi_valid+=X)}function J(S,P,X){oe(S,X[2*P],X[2*P+1])}function ze(S,P){for(var X=0;X|=1&S,S>>>=1,X<<=1,0<--P;);return X>>>1}function Se(S,P,X){var Q,B,te=new Array(_+1),ue=0;for(Q=1;Q<=_;Q++)te[Q]=ue=ue+X[Q-1]<<1;for(B=0;B<=P;B++){var re=S[2*B+1];re!==0&&(S[2*B]=ze(te[re]++,re))}}function me(S){var P;for(P=0;P<h;P++)S.dyn_ltree[2*P]=0;for(P=0;P<u;P++)S.dyn_dtree[2*P]=0;for(P=0;P<g;P++)S.bl_tree[2*P]=0;S.dyn_ltree[2*v]=1,S.opt_len=S.static_len=0,S.last_lit=S.matches=0}function le(S){8<S.bi_valid?de(S,S.bi_buf):0<S.bi_valid&&(S.pending_buf[S.pending++]=S.bi_buf),S.bi_buf=0,S.bi_valid=0}function Te(S,P,X,Q){var B=2*P,te=2*X;return S[B]<S[te]||S[B]===S[te]&&Q[P]<=Q[X]}function Ce(S,P,X){for(var Q=S.heap[X],B=X<<1;B<=S.heap_len&&(B<S.heap_len&&Te(P,S.heap[B+1],S.heap[B],S.depth)&&B++,!Te(P,Q,S.heap[B],S.depth));)S.heap[X]=S.heap[B],X=B,B<<=1;S.heap[X]=Q}function Oe(S,P,X){var Q,B,te,ue,re=0;if(S.last_lit!==0)for(;Q=S.pending_buf[S.d_buf+2*re]<<8|S.pending_buf[S.d_buf+2*re+1],B=S.pending_buf[S.l_buf+re],re++,Q===0?J(S,B,P):(J(S,(te=y[B])+p+1,P),(ue=z[te])!==0&&oe(S,B-=q[te],ue),J(S,te=F(--Q),X),(ue=U[te])!==0&&oe(S,Q-=Y[te],ue)),re<S.last_lit;);J(S,v,P)}function he(S,P){var X,Q,B,te=P.dyn_tree,ue=P.stat_desc.static_tree,re=P.stat_desc.has_stree,_e=P.stat_desc.elems,Ae=-1;for(S.heap_len=0,S.heap_max=f,X=0;X<_e;X++)te[2*X]!==0?(S.heap[++S.heap_len]=Ae=X,S.depth[X]=0):te[2*X+1]=0;for(;S.heap_len<2;)te[2*(B=S.heap[++S.heap_len]=Ae<2?++Ae:0)]=1,S.depth[B]=0,S.opt_len--,re&&(S.static_len-=ue[2*B+1]);for(P.max_code=Ae,X=S.heap_len>>1;1<=X;X--)Ce(S,te,X);for(B=_e;X=S.heap[1],S.heap[1]=S.heap[S.heap_len--],Ce(S,te,1),Q=S.heap[1],S.heap[--S.heap_max]=X,S.heap[--S.heap_max]=Q,te[2*B]=te[2*X]+te[2*Q],S.depth[B]=(S.depth[X]>=S.depth[Q]?S.depth[X]:S.depth[Q])+1,te[2*X+1]=te[2*Q+1]=B,S.heap[1]=B++,Ce(S,te,1),2<=S.heap_len;);S.heap[--S.heap_max]=S.heap[1],function(ve,Fe){var yt,Ge,dt,De,ct,wt,Ke=Fe.dyn_tree,xt=Fe.max_code,tn=Fe.stat_desc.static_tree,nn=Fe.stat_desc.has_stree,Wt=Fe.stat_desc.extra_bits,zt=Fe.stat_desc.extra_base,st=Fe.stat_desc.max_length,ut=0;for(De=0;De<=_;De++)ve.bl_count[De]=0;for(Ke[2*ve.heap[ve.heap_max]+1]=0,yt=ve.heap_max+1;yt<f;yt++)st<(De=Ke[2*Ke[2*(Ge=ve.heap[yt])+1]+1]+1)&&(De=st,ut++),Ke[2*Ge+1]=De,xt<Ge||(ve.bl_count[De]++,ct=0,zt<=Ge&&(ct=Wt[Ge-zt]),wt=Ke[2*Ge],ve.opt_len+=wt*(De+ct),nn&&(ve.static_len+=wt*(tn[2*Ge+1]+ct)));if(ut!==0){do{for(De=st-1;ve.bl_count[De]===0;)De--;ve.bl_count[De]--,ve.bl_count[De+1]+=2,ve.bl_count[st]--,ut-=2}while(0<ut);for(De=st;De!==0;De--)for(Ge=ve.bl_count[De];Ge!==0;)xt<(dt=ve.heap[--yt])||(Ke[2*dt+1]!==De&&(ve.opt_len+=(De-Ke[2*dt+1])*Ke[2*dt],Ke[2*dt+1]=De),Ge--)}}(S,P),Se(te,Ae,S.bl_count)}function m(S,P,X){var Q,B,te=-1,ue=P[1],re=0,_e=7,Ae=4;for(ue===0&&(_e=138,Ae=3),P[2*(X+1)+1]=65535,Q=0;Q<=X;Q++)B=ue,ue=P[2*(Q+1)+1],++re<_e&&B===ue||(re<Ae?S.bl_tree[2*B]+=re:B!==0?(B!==te&&S.bl_tree[2*B]++,S.bl_tree[2*O]++):re<=10?S.bl_tree[2*E]++:S.bl_tree[2*L]++,te=B,Ae=(re=0)===ue?(_e=138,3):B===ue?(_e=6,3):(_e=7,4))}function W(S,P,X){var Q,B,te=-1,ue=P[1],re=0,_e=7,Ae=4;for(ue===0&&(_e=138,Ae=3),Q=0;Q<=X;Q++)if(B=ue,ue=P[2*(Q+1)+1],!(++re<_e&&B===ue)){if(re<Ae)for(;J(S,B,S.bl_tree),--re!=0;);else B!==0?(B!==te&&(J(S,B,S.bl_tree),re--),J(S,O,S.bl_tree),oe(S,re-3,2)):re<=10?(J(S,E,S.bl_tree),oe(S,re-3,3)):(J(S,L,S.bl_tree),oe(S,re-11,7));te=B,Ae=(re=0)===ue?(_e=138,3):B===ue?(_e=6,3):(_e=7,4)}}l(Y);var x=!1;function w(S,P,X,Q){oe(S,(c<<1)+(Q?1:0),3),function(B,te,ue,re){le(B),de(B,ue),de(B,~ue),o.arraySet(B.pending_buf,B.window,te,ue,B.pending),B.pending+=ue}(S,P,X)}i._tr_init=function(S){x||(function(){var P,X,Q,B,te,ue=new Array(_+1);for(B=Q=0;B<d-1;B++)for(q[B]=Q,P=0;P<1<<z[B];P++)y[Q++]=B;for(y[Q-1]=B,B=te=0;B<16;B++)for(Y[B]=te,P=0;P<1<<U[B];P++)H[te++]=B;for(te>>=7;B<u;B++)for(Y[B]=te<<7,P=0;P<1<<U[B]-7;P++)H[256+te++]=B;for(X=0;X<=_;X++)ue[X]=0;for(P=0;P<=143;)j[2*P+1]=8,P++,ue[8]++;for(;P<=255;)j[2*P+1]=9,P++,ue[9]++;for(;P<=279;)j[2*P+1]=7,P++,ue[7]++;for(;P<=287;)j[2*P+1]=8,P++,ue[8]++;for(Se(j,h+1,ue),P=0;P<u;P++)C[2*P+1]=5,C[2*P]=ze(P,5);fe=new se(j,z,p+1,h,_),K=new se(C,U,0,u,_),ie=new se(new Array(0),N,0,g,k)}(),x=!0),S.l_desc=new D(S.dyn_ltree,fe),S.d_desc=new D(S.dyn_dtree,K),S.bl_desc=new D(S.bl_tree,ie),S.bi_buf=0,S.bi_valid=0,me(S)},i._tr_stored_block=w,i._tr_flush_block=function(S,P,X,Q){var B,te,ue=0;0<S.level?(S.strm.data_type===2&&(S.strm.data_type=function(re){var _e,Ae=4093624447;for(_e=0;_e<=31;_e++,Ae>>>=1)if(1&Ae&&re.dyn_ltree[2*_e]!==0)return s;if(re.dyn_ltree[18]!==0||re.dyn_ltree[20]!==0||re.dyn_ltree[26]!==0)return a;for(_e=32;_e<p;_e++)if(re.dyn_ltree[2*_e]!==0)return a;return s}(S)),he(S,S.l_desc),he(S,S.d_desc),ue=function(re){var _e;for(m(re,re.dyn_ltree,re.l_desc.max_code),m(re,re.dyn_dtree,re.d_desc.max_code),he(re,re.bl_desc),_e=g-1;3<=_e&&re.bl_tree[2*I[_e]+1]===0;_e--);return re.opt_len+=3*(_e+1)+5+5+4,_e}(S),B=S.opt_len+3+7>>>3,(te=S.static_len+3+7>>>3)<=B&&(B=te)):B=te=X+5,X+4<=B&&P!==-1?w(S,P,X,Q):S.strategy===4||te===B?(oe(S,2+(Q?1:0),3),Oe(S,j,C)):(oe(S,4+(Q?1:0),3),function(re,_e,Ae,ve){var Fe;for(oe(re,_e-257,5),oe(re,Ae-1,5),oe(re,ve-4,4),Fe=0;Fe<ve;Fe++)oe(re,re.bl_tree[2*I[Fe]+1],3);W(re,re.dyn_ltree,_e-1),W(re,re.dyn_dtree,Ae-1)}(S,S.l_desc.max_code+1,S.d_desc.max_code+1,ue+1),Oe(S,S.dyn_ltree,S.dyn_dtree)),me(S),Q&&le(S)},i._tr_tally=function(S,P,X){return S.pending_buf[S.d_buf+2*S.last_lit]=P>>>8&255,S.pending_buf[S.d_buf+2*S.last_lit+1]=255&P,S.pending_buf[S.l_buf+S.last_lit]=255&X,S.last_lit++,P===0?S.dyn_ltree[2*X]++:(S.matches++,P--,S.dyn_ltree[2*(y[X]+p+1)]++,S.dyn_dtree[2*F(P)]++),S.last_lit===S.lit_bufsize-1},i._tr_align=function(S){oe(S,2,3),J(S,v,j),function(P){P.bi_valid===16?(de(P,P.bi_buf),P.bi_buf=0,P.bi_valid=0):8<=P.bi_valid&&(P.pending_buf[P.pending++]=255&P.bi_buf,P.bi_buf>>=8,P.bi_valid-=8)}(S)}},{"../utils/common":41}],53:[function(e,r,i){r.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(e,r,i){(function(o){(function(s,a){if(!s.setImmediate){var l,c,d,p,h=1,u={},g=!1,f=s.document,_=Object.getPrototypeOf&&Object.getPrototypeOf(s);_=_&&_.setTimeout?_:s,l={}.toString.call(s.process)==="[object process]"?function(O){process.nextTick(function(){k(O)})}:function(){if(s.postMessage&&!s.importScripts){var O=!0,E=s.onmessage;return s.onmessage=function(){O=!1},s.postMessage("","*"),s.onmessage=E,O}}()?(p="setImmediate$"+Math.random()+"$",s.addEventListener?s.addEventListener("message",v,!1):s.attachEvent("onmessage",v),function(O){s.postMessage(p+O,"*")}):s.MessageChannel?((d=new MessageChannel).port1.onmessage=function(O){k(O.data)},function(O){d.port2.postMessage(O)}):f&&"onreadystatechange"in f.createElement("script")?(c=f.documentElement,function(O){var E=f.createElement("script");E.onreadystatechange=function(){k(O),E.onreadystatechange=null,c.removeChild(E),E=null},c.appendChild(E)}):function(O){setTimeout(k,0,O)},_.setImmediate=function(O){typeof O!="function"&&(O=new Function(""+O));for(var E=new Array(arguments.length-1),L=0;L<E.length;L++)E[L]=arguments[L+1];var z={callback:O,args:E};return u[h]=z,l(h),h++},_.clearImmediate=b}function b(O){delete u[O]}function k(O){if(g)setTimeout(k,0,O);else{var E=u[O];if(E){g=!0;try{(function(L){var z=L.callback,U=L.args;switch(U.length){case 0:z();break;case 1:z(U[0]);break;case 2:z(U[0],U[1]);break;case 3:z(U[0],U[1],U[2]);break;default:z.apply(a,U)}})(E)}finally{b(O),g=!1}}}}function v(O){O.source===s&&typeof O.data=="string"&&O.data.indexOf(p)===0&&k(+O.data.slice(p.length))}})(typeof self>"u"?o===void 0?this:o:self)}).call(this,typeof dn<"u"?dn:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(Vi);var as=Vi.exports;const ls=ss(as);async function cs(n){let t;try{t=await ls.loadAsync(n)}catch{return{ok:!1,error:"could not read this file as a zip"}}const e=t.file("manifest.json");if(!e)return{ok:!1,error:"not a valid export — manifest.json is missing"};let r;try{r=JSON.parse(await e.async("string"))}catch{return{ok:!1,error:"manifest.json is not valid JSON"}}return typeof r.workspace!="string"||r.workspace.length===0?{ok:!1,error:"manifest.json is missing a workspace name"}:Array.isArray(r.snapshots)?{ok:!0,manifest:{formatVersion:typeof r.formatVersion=="number"?r.formatVersion:1,workspace:r.workspace,exportedAt:typeof r.exportedAt=="string"?r.exportedAt:"",appVersion:typeof r.appVersion=="string"?r.appVersion:"",snapshots:r.snapshots.filter(i=>typeof i=="string")}}:{ok:!1,error:"manifest.json is missing the snapshots list"}}async function us(n,t,e){const r=new FormData;r.set("file",n),r.set("targetWorkspace",t),r.set("mode",e);try{const o=await(await fetch("/import",{method:"POST",body:r})).json();return o.ok?o:{ok:!1,error:o.error??"Import failed"}}catch{return{ok:!1,error:"Network error during import"}}}async function fs(n,t){try{await fetch("/snapshots/load",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspace:n,filename:t})})}catch(e){console.error("[agent-whiteboard] failed to load imported snapshot:",e)}}function qr(n){let t,e,r,i,o,s,a,l,c,d,p,h=n[2]&&Gr(n);function u(_,b){return _[10]?ms:_[7]==="prompt"&&_[1]?ps:_[1]?hs:ds}let g=u(n),f=g(n);return{c(){t=Z("div"),e=Z("div"),r=Z("div"),i=Z("span"),i.textContent="Import workspace",o=ae(),s=Z("button"),s.textContent="✕",a=ae(),l=Z("div"),h&&h.c(),c=ae(),f.c(),A(i,"class","modal-title svelte-1f2jqat"),A(s,"class","modal-close-btn svelte-1f2jqat"),A(s,"aria-label","Close"),A(r,"class","modal-header svelte-1f2jqat"),A(l,"class","modal-body svelte-1f2jqat"),A(e,"class","modal svelte-1f2jqat"),A(e,"role","dialog"),A(e,"aria-modal","true"),A(e,"aria-label","Import workspace"),A(e,"tabindex","-1"),A(t,"class","modal-overlay svelte-1f2jqat")},m(_,b){V(_,t,b),R(t,e),R(e,r),R(r,i),R(r,o),R(r,s),R(e,a),R(e,l),h&&h.m(l,null),R(l,c),f.m(l,null),d||(p=[ge(s,"click",n[18]),gn(wn.call(null,e,{onEscape:n[18]})),ge(t,"click",xi(n[18]))],d=!0)},p(_,b){_[2]?h?h.p(_,b):(h=Gr(_),h.c(),h.m(l,c)):h&&(h.d(1),h=null),g===(g=u(_))&&f?f.p(_,b):(f.d(1),f=g(_),f&&(f.c(),f.m(l,null)))},d(_){_&&G(t),h&&h.d(),f.d(),d=!1,Be(p)}}}function Gr(n){let t,e;return{c(){t=Z("p"),e=ee(n[2]),A(t,"class","modal-error svelte-1f2jqat")},m(r,i){V(r,t,i),R(t,e)},p(r,i){i&4&&ye(e,r[2])},d(r){r&&G(t)}}}function ds(n){let t,e,r,i,o;function s(c,d){return c[3]?gs:_s}let a=s(n),l=a(n);return{c(){t=Z("div"),l.c(),e=ae(),r=Z("input"),A(t,"class","drop-zone svelte-1f2jqat"),A(t,"role","button"),A(t,"tabindex","0"),Le(t,"drag-over",n[4]),A(r,"type","file"),A(r,"accept",".zip"),A(r,"class","visually-hidden-input svelte-1f2jqat"),A(r,"aria-label","Choose a .zip file to import")},m(c,d){V(c,t,d),l.m(t,null),V(c,e,d),V(c,r,d),n[23](r),i||(o=[ge(t,"drop",n[15]),ge(t,"dragover",n[16]),ge(t,"dragleave",n[17]),ge(t,"click",n[21]),ge(t,"keydown",n[22]),ge(r,"change",n[14])],i=!0)},p(c,d){a!==(a=s(c))&&(l.d(1),l=a(c),l&&(l.c(),l.m(t,null))),d&16&&Le(t,"drag-over",c[4])},d(c){c&&(G(t),G(e),G(r)),l.d(),n[23](null),i=!1,Be(o)}}}function hs(n){let t,e,r,i=n[1].workspace+"",o,s,a=n[1].snapshots.length+"",l,c,d=n[1].snapshots.length===1?"":"s",p,h,u,g,f=(n[6]||n[9])&&Yr(n);return{c(){t=Z("p"),e=ee("Workspace: "),r=Z("strong"),o=ee(i),s=ee(`
14
+ (`),l=ee(a),c=ee(" snapshot"),p=ee(d),h=ee(")"),u=ae(),f&&f.c(),g=lt(),A(t,"class","import-resolved svelte-1f2jqat")},m(_,b){V(_,t,b),R(t,e),R(t,r),R(r,o),R(t,s),R(t,l),R(t,c),R(t,p),R(t,h),V(_,u,b),f&&f.m(_,b),V(_,g,b)},p(_,b){b&2&&i!==(i=_[1].workspace+"")&&ye(o,i),b&2&&a!==(a=_[1].snapshots.length+"")&&ye(l,a),b&2&&d!==(d=_[1].snapshots.length===1?"":"s")&&ye(p,d),_[6]||_[9]?f?f.p(_,b):(f=Yr(_),f.c(),f.m(g.parentNode,g)):f&&(f.d(1),f=null)},d(_){_&&(G(t),G(u),G(g)),f&&f.d(_)}}}function ps(n){let t,e,r,i=n[1].workspace+"",o,s,a,l,c,d,p,h,u,g,f,_,b,k,v,O,E,L;return{c(){t=Z("p"),e=ee("A workspace named "),r=Z("strong"),o=ee(i),s=ee(" already exists."),a=ae(),l=Z("div"),c=Z("button"),d=ee("Merge"),p=ae(),h=Z("div"),u=Z("input"),g=ae(),f=Z("button"),_=ee("Import as new"),k=ae(),v=Z("button"),O=ee("Cancel"),A(t,"class","import-resolved svelte-1f2jqat"),A(c,"class","collision-btn svelte-1f2jqat"),c.disabled=n[9],A(u,"type","text"),A(u,"aria-label","New workspace name"),u.disabled=n[9],A(u,"class","svelte-1f2jqat"),A(f,"class","collision-btn svelte-1f2jqat"),f.disabled=b=n[9]||n[8].trim().length===0,A(h,"class","collision-new svelte-1f2jqat"),A(v,"class","collision-btn collision-cancel svelte-1f2jqat"),v.disabled=n[9],A(l,"class","collision-actions svelte-1f2jqat")},m(z,U){V(z,t,U),R(t,e),R(t,r),R(r,o),R(t,s),V(z,a,U),V(z,l,U),R(l,c),R(c,d),R(l,p),R(l,h),R(h,u),Er(u,n[8]),R(h,g),R(h,f),R(f,_),R(l,k),R(l,v),R(v,O),E||(L=[ge(c,"click",n[11]),ge(u,"input",n[20]),ge(f,"click",n[12]),ge(v,"click",n[13])],E=!0)},p(z,U){U&2&&i!==(i=z[1].workspace+"")&&ye(o,i),U&512&&(c.disabled=z[9]),U&512&&(u.disabled=z[9]),U&256&&u.value!==z[8]&&Er(u,z[8]),U&768&&b!==(b=z[9]||z[8].trim().length===0)&&(f.disabled=b),U&512&&(v.disabled=z[9])},d(z){z&&(G(t),G(a),G(l)),E=!1,Be(L)}}}function ms(n){let t,e,r,i,o,s,a=n[10].workspace+"",l,c,d=n[10].added+"",p,h,u=n[10].updated+"",g,f,_=n[10].skipped+"",b,k;return{c(){t=Z("div"),e=Z("span"),e.innerHTML='<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="20 6 9 17 4 12"></polyline></svg>',r=ae(),i=Z("span"),o=ee("Imported into "),s=Z("strong"),l=ee(a),c=ee(` —
15
+ `),p=ee(d),h=ee(" added, "),g=ee(u),f=ee(" updated, "),b=ee(_),k=ee(" skipped"),A(e,"class","check-circle svelte-1f2jqat"),A(t,"class","modal-confirm svelte-1f2jqat")},m(v,O){V(v,t,O),R(t,e),R(t,r),R(t,i),R(i,o),R(i,s),R(s,l),R(i,c),R(i,p),R(i,h),R(i,g),R(i,f),R(i,b),R(i,k)},p(v,O){O&1024&&a!==(a=v[10].workspace+"")&&ye(l,a),O&1024&&d!==(d=v[10].added+"")&&ye(p,d),O&1024&&u!==(u=v[10].updated+"")&&ye(g,u),O&1024&&_!==(_=v[10].skipped+"")&&ye(b,_)},d(v){v&&G(t)}}}function _s(n){let t;return{c(){t=Z("p"),t.innerHTML='Drop a <code class="svelte-1f2jqat">.zip</code> file here, or click to choose one'},m(e,r){V(e,t,r)},d(e){e&&G(t)}}}function gs(n){let t;return{c(){t=Z("p"),t.textContent="Reading…"},m(e,r){V(e,t,r)},d(e){e&&G(t)}}}function Yr(n){let t,e=n[9]?"Importing…":"Checking for existing workspaces…",r;return{c(){t=Z("p"),r=ee(e),A(t,"class","modal-step-hint svelte-1f2jqat")},m(i,o){V(i,t,o),R(t,r)},p(i,o){o&512&&e!==(e=i[9]?"Importing…":"Checking for existing workspaces…")&&ye(r,e)},d(i){i&&G(t)}}}function bs(n){let t,e=n[0]&&qr(n);return{c(){e&&e.c(),t=lt()},m(r,i){e&&e.m(r,i),V(r,t,i)},p(r,[i]){r[0]?e?e.p(r,i):(e=qr(r),e.c(),e.m(t.parentNode,t)):e&&(e.d(1),e=null)},i:be,o:be,d(r){r&&G(t),e&&e.d(r)}}}function ys(n,t){let e=2,r=`${n} (${e})`;for(;t.includes(r);)e++,r=`${n} (${e})`;return r}function ws(n,t,e){let{open:r=!1}=t;const i=$t();let o=null,s=null,a=null,l=!1,c=!1,d,p=[],h=!1,u=null,g="",f=!1,_=null,b=null;function k(){e(1,o=null),s=null,e(2,a=null),e(3,l=!1),e(4,c=!1),p=[],e(6,h=!1),e(7,u=null),e(8,g=""),e(9,f=!1),e(10,_=null),b&&clearTimeout(b),b=null}Qt(()=>{b&&clearTimeout(b)});async function v(ie){if(!ie.name.toLowerCase().endsWith(".zip")){e(2,a="please select a .zip file exported from this app"),e(1,o=null);return}e(3,l=!0),e(2,a=null);const Y=await cs(ie);if(e(3,l=!1),!Y.ok){e(2,a=Y.error),e(1,o=null);return}e(1,o=Y.manifest),s=ie,await O(Y.manifest.workspace)}async function O(ie){e(6,h=!0);const Y=await Kn();if(e(6,h=!1),p=Y.ok?Y.workspaces.map(se=>se.name):[],p.includes(ie)){e(8,g=ys(ie,p)),e(7,u="prompt");return}await U(ie,"create")}async function E(){o&&(e(7,u=null),await U(o.workspace,"merge"))}async function L(){const ie=g.trim();ie&&(e(7,u=null),await U(ie,"create"))}function z(){k()}async function U(ie,Y){if(!s)return;e(9,f=!0),e(2,a=null);const se=await us(s,ie,Y);if(e(9,f=!1),!se.ok){e(2,a=se.error);return}e(10,_=se),se.newestFilename&&fs(se.workspace,se.newestFilename),i("imported"),b=setTimeout(()=>i("close"),1500)}function N(ie){var D;const Y=ie.currentTarget,se=(D=Y.files)==null?void 0:D[0];se&&v(se),Y.value=""}function I(ie){var se;ie.preventDefault(),e(4,c=!1);const Y=(se=ie.dataTransfer)==null?void 0:se.files[0];Y&&v(Y)}function j(ie){ie.preventDefault(),e(4,c=!0)}function C(){e(4,c=!1)}function H(){i("close")}function y(){g=this.value,e(8,g)}const q=()=>d==null?void 0:d.click(),fe=ie=>{(ie.key==="Enter"||ie.key===" ")&&(d==null||d.click())};function K(ie){Ve[ie?"unshift":"push"](()=>{d=ie,e(5,d)})}return n.$$set=ie=>{"open"in ie&&e(0,r=ie.open)},n.$$.update=()=>{n.$$.dirty&1&&(r||k())},[r,o,a,l,c,d,h,u,g,f,_,E,L,z,N,I,j,C,H,v,y,q,fe,K]}class ks extends tt{constructor(t){super(),et(this,t,ws,bs,Xe,{open:0,acceptFile:19})}get acceptFile(){return this.$$.ctx[19]}}const Vr={sun:[{tag:"circle",cx:12,cy:12,r:4},{tag:"line",x1:12,y1:2,x2:12,y2:4},{tag:"line",x1:12,y1:20,x2:12,y2:22},{tag:"line",x1:4.93,y1:4.93,x2:6.34,y2:6.34},{tag:"line",x1:17.66,y1:17.66,x2:19.07,y2:19.07},{tag:"line",x1:2,y1:12,x2:4,y2:12},{tag:"line",x1:20,y1:12,x2:22,y2:12},{tag:"line",x1:4.93,y1:19.07,x2:6.34,y2:17.66},{tag:"line",x1:17.66,y1:6.34,x2:19.07,y2:4.93}],moon:[{tag:"path",d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"}],history:[{tag:"line",x1:8,y1:6,x2:21,y2:6},{tag:"line",x1:8,y1:12,x2:21,y2:12},{tag:"line",x1:8,y1:18,x2:21,y2:18},{tag:"line",x1:3,y1:6,x2:3.01,y2:6},{tag:"line",x1:3,y1:12,x2:3.01,y2:12},{tag:"line",x1:3,y1:18,x2:3.01,y2:18}],trash:[{tag:"polyline",points:"3 6 5 6 21 6"},{tag:"path",d:"M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6"},{tag:"path",d:"M10 11v6"},{tag:"path",d:"M14 11v6"},{tag:"path",d:"M9 6V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2"}],export:[{tag:"path",d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"},{tag:"polyline",points:"7 10 12 15 17 10"},{tag:"line",x1:12,y1:15,x2:12,y2:3}],check:[{tag:"polyline",points:"20 6 9 17 4 12"}],import:[{tag:"path",d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"},{tag:"polyline",points:"17 8 12 3 7 8"},{tag:"line",x1:12,y1:3,x2:12,y2:15}],transfer:[{tag:"line",x1:7,y1:4,x2:7,y2:20},{tag:"polyline",points:"3 8 7 4 11 8"},{tag:"line",x1:17,y1:20,x2:17,y2:4},{tag:"polyline",points:"13 16 17 20 21 16"}]};function Xr(n,t,e){const r=n.slice();return r[3]=t[e],r[5]=e,r}function vs(n){let t,e;return{c(){t=ft("polyline"),A(t,"points",e=n[3].points)},m(r,i){V(r,t,i)},p(r,i){i&1&&e!==(e=r[3].points)&&A(t,"points",e)},d(r){r&&G(t)}}}function Es(n){let t,e;return{c(){t=ft("path"),A(t,"d",e=n[3].d)},m(r,i){V(r,t,i)},p(r,i){i&1&&e!==(e=r[3].d)&&A(t,"d",e)},d(r){r&&G(t)}}}function Ss(n){let t,e,r,i,o;return{c(){t=ft("line"),A(t,"x1",e=n[3].x1),A(t,"y1",r=n[3].y1),A(t,"x2",i=n[3].x2),A(t,"y2",o=n[3].y2)},m(s,a){V(s,t,a)},p(s,a){a&1&&e!==(e=s[3].x1)&&A(t,"x1",e),a&1&&r!==(r=s[3].y1)&&A(t,"y1",r),a&1&&i!==(i=s[3].x2)&&A(t,"x2",i),a&1&&o!==(o=s[3].y2)&&A(t,"y2",o)},d(s){s&&G(t)}}}function Ts(n){let t,e,r,i;return{c(){t=ft("circle"),A(t,"cx",e=n[3].cx),A(t,"cy",r=n[3].cy),A(t,"r",i=n[3].r)},m(o,s){V(o,t,s)},p(o,s){s&1&&e!==(e=o[3].cx)&&A(t,"cx",e),s&1&&r!==(r=o[3].cy)&&A(t,"cy",r),s&1&&i!==(i=o[3].r)&&A(t,"r",i)},d(o){o&&G(t)}}}function Kr(n,t){let e,r;function i(a,l){if(a[3].tag==="circle")return Ts;if(a[3].tag==="line")return Ss;if(a[3].tag==="path")return Es;if(a[3].tag==="polyline")return vs}let o=i(t),s=o&&o(t);return{key:n,first:null,c(){e=lt(),s&&s.c(),r=lt(),this.first=e},m(a,l){V(a,e,l),s&&s.m(a,l),V(a,r,l)},p(a,l){t=a,o===(o=i(t))&&s?s.p(t,l):(s&&s.d(1),s=o&&o(t),s&&(s.c(),s.m(r.parentNode,r)))},d(a){a&&(G(e),G(r)),s&&s.d(a)}}}function As(n){let t,e=[],r=new Map,i=qe(Vr[n[0]]);const o=s=>s[5];for(let s=0;s<i.length;s+=1){let a=Xr(n,i,s),l=o(a);r.set(l,e[s]=Kr(l,a))}return{c(){t=ft("svg");for(let s=0;s<e.length;s+=1)e[s].c();A(t,"width",n[1]),A(t,"height",n[1]),A(t,"viewBox","0 0 24 24"),A(t,"fill","none"),A(t,"stroke","currentColor"),A(t,"stroke-width",n[2]),A(t,"stroke-linecap","round"),A(t,"stroke-linejoin","round"),A(t,"aria-hidden","true")},m(s,a){V(s,t,a);for(let l=0;l<e.length;l+=1)e[l]&&e[l].m(t,null)},p(s,[a]){a&1&&(i=qe(Vr[s[0]]),e=Tt(e,a,o,1,s,i,r,t,en,Kr,null,Xr)),a&2&&A(t,"width",s[1]),a&2&&A(t,"height",s[1]),a&4&&A(t,"stroke-width",s[2])},i:be,o:be,d(s){s&&G(t);for(let a=0;a<e.length;a+=1)e[a].d()}}}function Cs(n,t,e){let{name:r}=t,{size:i=15}=t,{strokeWidth:o=2.2}=t;return n.$$set=s=>{"name"in s&&e(0,r=s.name),"size"in s&&e(1,i=s.size),"strokeWidth"in s&&e(2,o=s.strokeWidth)},[r,i,o]}class St extends tt{constructor(t){super(),et(this,t,Cs,As,Xe,{name:0,size:1,strokeWidth:2})}}function Jr(n){let t,e,r,i,o,s,a,l,c,d,p;return r=new St({props:{name:"export",size:14}}),a=new St({props:{name:"import",size:14}}),{c(){t=Z("div"),e=Z("button"),He(r.$$.fragment),i=Z("span"),i.textContent="Export…",o=ae(),s=Z("button"),He(a.$$.fragment),l=Z("span"),l.textContent="Import…",A(e,"class","io-item svelte-npauoa"),A(e,"type","button"),A(e,"role","menuitem"),A(e,"tabindex","-1"),A(s,"class","io-item svelte-npauoa"),A(s,"type","button"),A(s,"role","menuitem"),A(s,"tabindex","-1"),A(t,"class","io-popover svelte-npauoa"),A(t,"role","menu"),A(t,"aria-label","Import / export")},m(h,u){V(h,t,u),R(t,e),je(r,e,null),R(e,i),n[12](e),R(t,o),R(t,s),je(a,s,null),R(s,l),n[14](s),c=!0,d||(p=[ge(e,"click",n[13]),ge(s,"click",n[15]),ge(t,"keydown",n[7])],d=!0)},p:be,i(h){c||(ke(r.$$.fragment,h),ke(a.$$.fragment,h),c=!0)},o(h){Ee(r.$$.fragment,h),Ee(a.$$.fragment,h),c=!1},d(h){h&&G(t),xe(r),n[12](null),xe(a),n[14](null),d=!1,Be(p)}}}function Os(n){let t,e,r,i,o,s,a;r=new St({props:{name:"transfer"}});let l=n[0]&&Jr(n);return{c(){t=Z("div"),e=Z("button"),He(r.$$.fragment),i=ae(),l&&l.c(),A(e,"class","panel-icon-btn io-btn svelte-npauoa"),A(e,"type","button"),A(e,"aria-haspopup","menu"),A(e,"aria-expanded",n[0]),A(e,"aria-label","Import / export"),A(e,"title","Import / export"),A(t,"class","io-menu svelte-npauoa")},m(c,d){V(c,t,d),R(t,e),je(r,e,null),n[10](e),R(t,i),l&&l.m(t,null),n[16](t),o=!0,s||(a=[ge(window,"pointerdown",n[9]),ge(window,"mousedown",n[9]),ge(e,"click",n[11]),ge(e,"keydown",n[6])],s=!0)},p(c,[d]){(!o||d&1)&&A(e,"aria-expanded",c[0]),c[0]?l?(l.p(c,d),d&1&&ke(l,1)):(l=Jr(c),l.c(),ke(l,1),l.m(t,null)):l&&(it(),Ee(l,1,1,()=>{l=null}),ot())},i(c){o||(ke(r.$$.fragment,c),ke(l),o=!0)},o(c){Ee(r.$$.fragment,c),Ee(l),o=!1},d(c){c&&G(t),xe(r),n[10](null),l&&l.d(),n[16](null),s=!1,Be(a)}}}function Is(n,t,e){const r=$t();let i=!1,o,s,a=[];async function l(E=0){var L;e(0,i=!0),await Oo(),(L=a[E])==null||L.focus()}function c(E){i&&(e(0,i=!1),E&&(s==null||s.focus()))}function d(E){E.key==="ArrowDown"?(E.preventDefault(),l(0)):E.key==="ArrowUp"&&(E.preventDefault(),l(1))}function p(E){var z,U;const L=a.findIndex(N=>N===document.activeElement);E.key==="ArrowDown"?(E.preventDefault(),(z=a[(L+1)%a.length])==null||z.focus()):E.key==="ArrowUp"?(E.preventDefault(),(U=a[(L-1+a.length)%a.length])==null||U.focus()):E.key==="Escape"?(E.preventDefault(),c(!0)):E.key==="Tab"&&c(!1)}function h(E){c(!1),r(E==="export"?"export":"import")}function u(E){i&&o&&!o.contains(E.target)&&c(!1)}function g(E){Ve[E?"unshift":"push"](()=>{s=E,e(2,s)})}const f=()=>i?c(!1):void l(0);function _(E){Ve[E?"unshift":"push"](()=>{a[0]=E,e(3,a)})}const b=()=>h("export");function k(E){Ve[E?"unshift":"push"](()=>{a[1]=E,e(3,a)})}const v=()=>h("import");function O(E){Ve[E?"unshift":"push"](()=>{o=E,e(1,o)})}return[i,o,s,a,l,c,d,p,h,u,g,f,_,b,k,v,O]}class zs extends tt{constructor(t){super(),et(this,t,Is,Os,Xe,{})}}const Pt=[];function bt(n,t=be){let e;const r=new Set;function i(a){if(Xe(n,a)&&(n=a,e)){const l=!Pt.length;for(const c of r)c[1](),Pt.push(c,n);if(l){for(let c=0;c<Pt.length;c+=2)Pt[c][0](Pt[c+1]);Pt.length=0}}}function o(a){i(a(n))}function s(a,l=be){const c=[a,l];return r.add(c),r.size===1&&(e=t(i,o)||be),a(n),()=>{r.delete(c),r.size===0&&e&&(e(),e=null)}}return{set:i,update:o,subscribe:s}}const Rs={presentation:null,driver:"static",placeholder:null,clickable:!1,nodeActions:void 0,nodeToFrameEnabled:!1};function Ds(n,t){if(t.action==="clear")return{presentation:null,driver:"static",placeholder:null,clickable:!1,nodeActions:void 0,nodeToFrameEnabled:!1};if(t.action==="replace"&&t.type==="step-frames-placeholder")return{...n,presentation:null,placeholder:{frameCount:t.frameCount,title:t.title},nodeToFrameEnabled:!1};if(t.action==="replace"){const r={cursor:0,frames:[{type:t.type,payload:t.payload,...t.frameLabel!==void 0?{label:t.frameLabel}:{}}],id:t.id,...t.title!==void 0?{title:t.title}:{}};return{...n,presentation:r,driver:t.total>1?"manual":"static",placeholder:null,currentFrame:t.cursor,totalFrames:t.total,viewport:t.viewport,nodeToFrame:t.nodeToFrame,nodeToFrameEnabled:t.nodeToFrame!==void 0}}return t.action==="set_node_actions"?{...n,clickable:t.enabled,nodeActions:t.enabled?t.node_actions??{}:void 0,nodeToFrameEnabled:t.enabled?!1:n.nodeToFrame!==void 0}:n}function Ls(){const{subscribe:n,update:t}=bt(Rs);return{subscribe:n,dispatch(e){t(r=>Ds(r,e))}}}const Xi=Ls();function Ns(){const n=bt({armed:!1,sent:!1,error:!1});let t=null,e=null;function r(o){o.action==="set_done_armed"&&n.update(s=>({...s,armed:o.armed}))}async function i(){if(!mt(n).sent){try{const o=await fetch("/user-done",{method:"POST"});if(!o.ok)throw new Error(`unexpected status ${o.status}`)}catch(o){console.error("handleDone: POST /user-done failed",o),n.update(s=>({...s,error:!0})),e&&clearTimeout(e),e=setTimeout(()=>n.update(s=>({...s,error:!1})),2e3);return}n.update(o=>({...o,sent:!0})),t&&clearTimeout(t),t=setTimeout(()=>n.update(o=>({...o,sent:!1})),2e3)}}return{subscribe:n.subscribe,dispatch:r,handleDone:i}}const Jn=Ns();function Ps(){const n=bt({mode:null,workspaces:[],loadError:null});async function t(r){const i=await Kn();i.ok?n.update(o=>({...o,workspaces:i.workspaces,loadError:null,mode:r})):n.update(o=>({...o,workspaces:[],loadError:i.error,mode:r}))}function e(){n.update(r=>({...r,mode:null}))}return{subscribe:n.subscribe,open:t,close:e}}const _n=Ps(),Ki="agent-whiteboard:theme";function Fs(){return localStorage.getItem(Ki)==="dark"?"dark":"light"}function Ms(){const n=bt(Fs());n.subscribe(e=>{document.documentElement.setAttribute("data-theme",e),localStorage.setItem(Ki,e)});function t(){n.update(e=>e==="light"?"dark":"light")}return{subscribe:n.subscribe,toggle:t}}const Ji=Ms();async function Qr(n){await fetch("/step",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({direction:n})})}const Bs=["mermaid","svg","html","katex","vega-lite","quiz"],Us=["replace","clear","set_node_actions","set_done_armed"];function js(n){if(typeof n!="object"||n===null)return!1;const t=n.action;if(!Us.includes(t))return!1;if(t!=="replace")return!0;const e=n.type;return e==="step-frames-placeholder"||Bs.includes(e)}const xs=500,Ws=1e4,Hs=10;function Zs(n){const e=`${location.protocol==="https:"?"wss":"ws"}://${location.host}/stream`;let r,i=0,o=null,s=!1;function a(){const c=i>=Hs;if(window.dispatchEvent(new CustomEvent("ws:disconnected",{detail:{exhausted:c}})),c)return;const d=Math.min(xs*2**i,Ws);i++,o=setTimeout(()=>{o=null,l()},d)}function l(){r=new WebSocket(e),r.addEventListener("message",c=>{let d;try{d=JSON.parse(c.data)}catch{console.error("ws: failed to parse message",c.data);return}if(!js(d)){console.error("ws: received message with unrecognized action/type — ignoring",d);return}n(d)}),r.addEventListener("close",()=>{n({action:"clear"}),s||a()}),r.addEventListener("open",()=>{i=0,window.dispatchEvent(new CustomEvent("ws:connected"))})}return l(),()=>{s=!0,o!==null&&clearTimeout(o),r.close()}}const Qn=bt(!1),$n=bt(!1);function qs(n){Xi.dispatch(n),Jn.dispatch(n)}function $r(n){Qn.set(!0);const t=n.detail;$n.set((t==null?void 0:t.exhausted)===!0)}function ei(){Qn.set(!1),$n.set(!1)}function Gs(){const n=Zs(qs);return window.addEventListener("ws:disconnected",$r),window.addEventListener("ws:connected",ei),()=>{n(),window.removeEventListener("ws:disconnected",$r),window.removeEventListener("ws:connected",ei)}}const Ys="modulepreload",Vs=function(n){return"/"+n},ti={},kn=function(t,e,r){let i=Promise.resolve();if(e&&e.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),a=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));i=Promise.allSettled(e.map(l=>{if(l=Vs(l),l in ti)return;ti[l]=!0;const c=l.endsWith(".css"),d=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${d}`))return;const p=document.createElement("link");if(p.rel=c?"stylesheet":Ys,c||(p.as="script"),p.crossOrigin="",p.href=l,a&&p.setAttribute("nonce",a),document.head.appendChild(p),c)return new Promise((h,u)=>{p.addEventListener("load",h),p.addEventListener("error",()=>u(new Error(`Unable to preload CSS for ${l}`)))})}))}function o(s){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=s,window.dispatchEvent(a),!a.defaultPrevented)throw s}return i.then(s=>{for(const a of s||[])a.status==="rejected"&&o(a.reason);return t().catch(o)})};/*! @license DOMPurify 3.4.15 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.15/LICENSE */function ni(n,t){(t==null||t>n.length)&&(t=n.length);for(var e=0,r=Array(t);e<t;e++)r[e]=n[e];return r}function Xs(n){if(Array.isArray(n))return n}function Ks(n,t){var e=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(e!=null){var r,i,o,s,a=[],l=!0,c=!1;try{if(o=(e=e.call(n)).next,t!==0)for(;!(l=(r=o.call(e)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(d){c=!0,i=d}finally{try{if(!l&&e.return!=null&&(s=e.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}function Js(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
16
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Qs(n,t){return Xs(n)||Ks(n,t)||$s(n,t)||Js()}function $s(n,t){if(n){if(typeof n=="string")return ni(n,t);var e={}.toString.call(n).slice(8,-1);return e==="Object"&&n.constructor&&(e=n.constructor.name),e==="Map"||e==="Set"?Array.from(n):e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?ni(n,t):void 0}}const Qi=Object.entries,ri=Object.setPrototypeOf,ea=Object.isFrozen,ta=Object.getPrototypeOf,na=Object.getOwnPropertyDescriptor;let Ue=Object.freeze,We=Object.seal,Bt=Object.create,$i=typeof Reflect<"u"&&Reflect,Gn=$i.apply,Yn=$i.construct;Ue||(Ue=function(t){return t});We||(We=function(t){return t});Gn||(Gn=function(t,e){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];return t.apply(e,i)});Yn||(Yn=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return new t(...r)});const Ot=Me(Array.prototype.forEach),ra=Me(Array.prototype.lastIndexOf),ii=Me(Array.prototype.pop),qt=Me(Array.prototype.push),ia=Me(Array.prototype.splice),jt=Array.isArray,Vt=Me(String.prototype.toLowerCase),Dn=Me(String.prototype.toString),oi=Me(String.prototype.match),Gt=Me(String.prototype.replace),si=Me(String.prototype.indexOf),oa=Me(String.prototype.trim),sa=Me(Number.prototype.toString),aa=Me(Boolean.prototype.toString),ai=typeof BigInt>"u"?null:Me(BigInt.prototype.toString),li=typeof Symbol>"u"?null:Me(Symbol.prototype.toString),$e=Me(Object.prototype.hasOwnProperty),Yt=Me(Object.prototype.toString),Ze=Me(RegExp.prototype.test),Ct=la(TypeError);function Me(n){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return Gn(n,t,r)}}function la(n){return function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return Yn(n,e)}}function Ie(n,t){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Vt;if(ri&&ri(n,null),!jt(t))return n;let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const o=e(i);o!==i&&(ea(t)||(t[r]=o),i=o)}n[i]=!0}return n}function ca(n){for(let t=0;t<n.length;t++)$e(n,t)||(n[t]=null);return n}function rt(n){const t=Bt(null);for(const r of Qi(n)){var e=Qs(r,2);const i=e[0],o=e[1];$e(n,i)&&(jt(o)?t[i]=ca(o):o&&typeof o=="object"&&o.constructor===Object?t[i]=rt(o):t[i]=o)}return t}function ua(n){switch(typeof n){case"string":return n;case"number":return sa(n);case"boolean":return aa(n);case"bigint":return ai?ai(n):"0";case"symbol":return li?li(n):"Symbol()";case"undefined":return Yt(n);case"function":case"object":{if(n===null)return Yt(n);const t=n,e=at(t,"toString");if(typeof e=="function"){const r=e(t);return typeof r=="string"?r:Yt(r)}return Yt(n)}default:return Yt(n)}}function at(n,t){for(;n!==null;){const r=na(n,t);if(r){if(r.get)return Me(r.get);if(typeof r.value=="function")return Me(r.value)}n=ta(n)}function e(){return null}return e}function fa(n){try{return Ze(n,""),!0}catch{return!1}}const ci=Ue(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Ln=Ue(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Nn=Ue(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),da=Ue(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Pn=Ue(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),ha=Ue(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),ui=Ue(["#text"]),fi=Ue(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Fn=Ue(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),di=Ue(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),pn=Ue(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),pa=We(/{{[\w\W]*|^[\w\W]*}}/g),ma=We(/<%[\w\W]*|^[\w\W]*%>/g),_a=We(/\${[\w\W]*/g),ga=We(/^data-[\-\w.\u00B7-\uFFFF]+$/),ba=We(/^aria-[\-\w]+$/),hi=We(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ya=We(/^(?:\w+script|data):/i),wa=We(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ka=We(/^html$/i),va=We(/^[a-z][.\w]*(-[.\w]+)+$/i),pi=We(/<[/\w!]/g),mi=We(/<[/\w]/g),Ea=We(/<\/no(script|embed|frames)/i),Sa=We(/\/>/i),nt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},eo=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],Ta=Ue(Ie({},eo)),Aa=function(){const n={};return Ot(eo,t=>{n[t]=We(new RegExp("</"+t+"(?=[\\t\\n\\f\\r />])","i"))}),Ue(n)}(),Ca=function(){return typeof window>"u"?null:window},Oa=function(t,e){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";e&&e.hasAttribute(i)&&(r=e.getAttribute(i));const o="dompurify"+(r?"#"+r:"");try{return t.createPolicy(o,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},_i=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},vt=function(t,e,r,i){return $e(t,e)&&jt(t[e])?Ie(i.base?rt(i.base):{},t[e],i.transform):r},Mn=function(t,e,r){const i=$e(t,e)?t[e]:void 0;return i&&typeof i=="object"?rt(i):r()};function to(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ca();const t=ne=>to(ne);if(t.version="3.4.15",t.removed=[],!n||!n.document||n.document.nodeType!==nt.document||!n.Element)return t.isSupported=!1,t;let e=n.document;const r=e,i=r.currentScript;n.DocumentFragment;const o=n.HTMLTemplateElement,s=n.Node,a=n.Element,l=n.NodeFilter,c=n.NamedNodeMap;c===void 0&&(n.NamedNodeMap||n.MozNamedAttrMap),n.HTMLFormElement;const d=n.DOMParser,p=n.trustedTypes,h=a.prototype,u=at(h,"cloneNode"),g=at(h,"remove"),f=at(h,"removeAttributeNode"),_=at(h,"nextSibling"),b=at(h,"childNodes"),k=at(h,"parentNode"),v=at(h,"shadowRoot"),O=at(h,"attributes"),E=s&&s.prototype?at(s.prototype,"nodeType"):null,L=s&&s.prototype?at(s.prototype,"nodeName"):null,z=s&&s.prototype?at(s.prototype,"ownerDocument"):null,U=function(T){return E?E(T):T.nodeType},N=function(T){return L?L(T):T.nodeName};if(typeof o=="function"){const ne=e.createElement("template");ne.content&&ne.content.ownerDocument&&(e=ne.content.ownerDocument)}let I,j="",C,H=!1,y=0;const q=function(){if(y>0)throw Ct('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},fe=function(T){q(),y++;try{return I.createHTML(T)}finally{y--}},K=function(T){q(),y++;try{return I.createScriptURL(T)}finally{y--}},ie=function(){return H||(C=Oa(p,i),H=!0),C},Y=e,se=Y.implementation,D=Y.createNodeIterator,F=Y.createDocumentFragment,de=Y.getElementsByTagName,oe=r.importNode;let J=_i();t.isSupported=typeof Qi=="function"&&typeof k=="function"&&se&&se.createHTMLDocument!==void 0;const ze=pa,Se=ma,me=_a,le=ga,Te=ba,Ce=ya,Oe=wa,he=va;let m=hi,W=null;const x=Ie({},[...ci,...Ln,...Nn,...Pn,...ui]);let w=null;const S=Ie({},[...fi,...Fn,...di,...pn]);let P=Object.seal(Bt(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),X=null,Q=null;const B=Object.seal(Bt(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let te=!0,ue=!0,re=!1,_e=!0,Ae=!1,ve=!0,Fe=!1,yt=!1,Ge=null,dt=null,De=!1,ct=!1,wt=!1,Ke=!1,xt=!0,tn=!1;const nn="user-content-";let Wt=!0,zt=!1,st={},ut=null;const er=Ie({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let tr=null;const nr=Ie({},["audio","video","img","source","image","track"]);let rr=null;const ir=Ie({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),rn="http://www.w3.org/1998/Math/MathML",on="http://www.w3.org/2000/svg",ht="http://www.w3.org/1999/xhtml";let Rt=ht,vn=!1,En=null;const io=Ie({},[rn,on,ht],Dn),or=Ue(["mi","mo","mn","ms","mtext"]);let Sn=Ie({},or);const sr=Ue(["annotation-xml"]);let Tn=Ie({},sr);const oo=Ie({},["title","style","font","a","script"]);let Ht=null;const so=["application/xhtml+xml","text/html"],ao="text/html";let Pe=null,Dt=null;const lo=e.createElement("form"),ar=function(T){return T instanceof RegExp||T instanceof Function},An=function(){let T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Dt&&Dt===T)return;(!T||typeof T!="object")&&(T={}),T=rt(T),Ht=so.indexOf(T.PARSER_MEDIA_TYPE)===-1?ao:T.PARSER_MEDIA_TYPE,Pe=Ht==="application/xhtml+xml"?Dn:Vt,W=vt(T,"ALLOWED_TAGS",x,{transform:Pe}),w=vt(T,"ALLOWED_ATTR",S,{transform:Pe}),En=vt(T,"ALLOWED_NAMESPACES",io,{transform:Dn}),rr=vt(T,"ADD_URI_SAFE_ATTR",ir,{transform:Pe,base:ir}),tr=vt(T,"ADD_DATA_URI_TAGS",nr,{transform:Pe,base:nr}),ut=vt(T,"FORBID_CONTENTS",er,{transform:Pe}),X=vt(T,"FORBID_TAGS",rt({}),{transform:Pe}),Q=vt(T,"FORBID_ATTR",rt({}),{transform:Pe}),st=$e(T,"USE_PROFILES")?T.USE_PROFILES&&typeof T.USE_PROFILES=="object"?rt(T.USE_PROFILES):T.USE_PROFILES:!1,te=T.ALLOW_ARIA_ATTR!==!1,ue=T.ALLOW_DATA_ATTR!==!1,re=T.ALLOW_UNKNOWN_PROTOCOLS||!1,_e=T.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ae=T.SAFE_FOR_TEMPLATES||!1,ve=T.SAFE_FOR_XML!==!1,Fe=T.WHOLE_DOCUMENT||!1,ct=T.RETURN_DOM||!1,wt=T.RETURN_DOM_FRAGMENT||!1,Ke=T.RETURN_TRUSTED_TYPE||!1,De=T.FORCE_BODY||!1,xt=T.SANITIZE_DOM!==!1,tn=T.SANITIZE_NAMED_PROPS||!1,Wt=T.KEEP_CONTENT!==!1,zt=T.IN_PLACE||!1,m=fa(T.ALLOWED_URI_REGEXP)?T.ALLOWED_URI_REGEXP:hi,Rt=typeof T.NAMESPACE=="string"?T.NAMESPACE:ht,Sn=Mn(T,"MATHML_TEXT_INTEGRATION_POINTS",()=>Ie({},or)),Tn=Mn(T,"HTML_INTEGRATION_POINTS",()=>Ie({},sr));const M=Mn(T,"CUSTOM_ELEMENT_HANDLING",()=>Bt(null));if(P=Bt(null),$e(M,"tagNameCheck")&&ar(M.tagNameCheck)&&(P.tagNameCheck=M.tagNameCheck),$e(M,"attributeNameCheck")&&ar(M.attributeNameCheck)&&(P.attributeNameCheck=M.attributeNameCheck),$e(M,"allowCustomizedBuiltInElements")&&typeof M.allowCustomizedBuiltInElements=="boolean"&&(P.allowCustomizedBuiltInElements=M.allowCustomizedBuiltInElements),We(P),Ae&&(ue=!1),wt&&(ct=!0),st&&(W=Ie({},ui),w=Bt(null),st.html===!0&&(Ie(W,ci),Ie(w,fi)),st.svg===!0&&(Ie(W,Ln),Ie(w,Fn),Ie(w,pn)),st.svgFilters===!0&&(Ie(W,Nn),Ie(w,Fn),Ie(w,pn)),st.mathMl===!0&&(Ie(W,Pn),Ie(w,di),Ie(w,pn))),B.tagCheck=null,B.attributeCheck=null,$e(T,"ADD_TAGS")&&(typeof T.ADD_TAGS=="function"?B.tagCheck=T.ADD_TAGS:jt(T.ADD_TAGS)&&(W===x&&(W=rt(W)),Ie(W,T.ADD_TAGS,Pe))),$e(T,"ADD_ATTR")&&(typeof T.ADD_ATTR=="function"?B.attributeCheck=T.ADD_ATTR:jt(T.ADD_ATTR)&&(w===S&&(w=rt(w)),Ie(w,T.ADD_ATTR,Pe))),$e(T,"ADD_FORBID_CONTENTS")&&jt(T.ADD_FORBID_CONTENTS)&&(ut===er&&(ut=rt(ut)),Ie(ut,T.ADD_FORBID_CONTENTS,Pe)),Wt&&(W["#text"]=!0),Fe&&Ie(W,["html","head","body"]),W.table&&(Ie(W,["tbody"]),delete X.tbody),T.TRUSTED_TYPES_POLICY){if(typeof T.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ct('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof T.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ct('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const $=I;I=T.TRUSTED_TYPES_POLICY;try{j=fe("")}catch(ce){throw I=$,ce}}else T.TRUSTED_TYPES_POLICY===null?(I=void 0,j=""):(I===void 0&&(I=ie()),I&&typeof j=="string"&&(j=fe("")));Ue&&Ue(T),Dt=T},lr=Ie({},[...Ln,...Nn,...da]),cr=Ie({},[...Pn,...ha]),co=function(T,M,$){return M.namespaceURI===ht?T==="svg":M.namespaceURI===rn?T==="svg"&&($==="annotation-xml"||Sn[$]):!!lr[T]},uo=function(T,M,$){return M.namespaceURI===ht?T==="math":M.namespaceURI===on?T==="math"&&Tn[$]:!!cr[T]},fo=function(T,M,$){return M.namespaceURI===on&&!Tn[$]||M.namespaceURI===rn&&!Sn[$]?!1:!cr[T]&&(oo[T]||!lr[T])},ho=function(T){let M=k(T);(!M||!M.tagName)&&(M={namespaceURI:Rt,tagName:"template"});const $=Vt(T.tagName),ce=Vt(M.tagName);return En[T.namespaceURI]?T.namespaceURI===on?co($,M,ce):T.namespaceURI===rn?uo($,M,ce):T.namespaceURI===ht?fo($,M,ce):!!(Ht==="application/xhtml+xml"&&En[T.namespaceURI]):!1},kt=function(T){qt(t.removed,{element:T});try{k(T).removeChild(T)}catch{if(g(T),!k(T))throw Ct("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},ur=function(T,M,$){try{f(T,M)}catch{try{T.removeAttribute($)}catch{}}},sn=function(T){an(T);const M=b(T);if(M){const ce=[];Ot(M,pe=>{qt(ce,pe)}),Ot(ce,pe=>{try{g(pe)}catch{}})}const $=O(T);if($)for(let ce=$.length-1;ce>=0;--ce){const pe=$[ce],we=pe&&pe.name;typeof we=="string"&&ur(T,pe,we)}},At=function(T,M,$){if(!$)try{$=M.getAttributeNode(T)}catch{$=null}qt(t.removed,{attribute:$||null,from:M});try{$?f(M,$):M.removeAttribute(T)}catch{try{M.removeAttribute(T)}catch{}}if(T==="is")if(ct||wt)try{kt(M)}catch{}else try{M.setAttribute(T,"")}catch{}},po=function(T){const M=O(T);if(M)for(let $=M.length-1;$>=0;--$){const ce=M[$],pe=ce&&ce.name;typeof pe!="string"||w[Pe(pe)]||ur(T,ce,pe)}},an=function(T){const M=[T];for(;M.length>0;){const $=M.pop();U($)===nt.element&&po($);const pe=b($);if(pe)for(let we=pe.length-1;we>=0;--we)M.push(pe[we])}},fr=function(T,M){return ve?T==="patchsrc"?!0:T==="for"&&M!=="label"&&M!=="output":!1},mo=function(T){if(!ve)return;const M=[T];for(;M.length>0;){const $=M.pop(),ce=U($);if(ce===nt.processingInstruction||ce===nt.comment&&Ze(mi,$.data)){try{g($)}catch{}continue}if(ce===nt.element){const we=$,Re=Pe(N($));try{we.hasAttribute&&we.hasAttribute("patchsrc")&&we.removeAttribute("patchsrc"),we.hasAttribute&&we.hasAttribute("for")&&fr("for",Re)&&we.removeAttribute("for")}catch{}}const pe=b($);if(pe)for(let we=pe.length-1;we>=0;--we)M.push(pe[we])}},dr=function(T){let M=null,$=null;if(De)T="<remove></remove>"+T;else{const we=oi(T,/^[\r\n\t ]+/);$=we&&we[0]}Ht==="application/xhtml+xml"&&Rt===ht&&(T='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+T+"</body></html>");const ce=I?fe(T):T;if(Rt===ht)try{M=new d().parseFromString(ce,Ht)}catch{}if(!M||!M.documentElement){M=se.createDocument(Rt,"template",null);try{M.documentElement.innerHTML=vn?j:ce}catch{}}const pe=M.body||M.documentElement;return T&&$&&pe.insertBefore(e.createTextNode($),pe.childNodes[0]||null),Rt===ht?de.call(M,Fe?"html":"body")[0]:Fe?M.documentElement:pe},hr=function(T){const M=z?z(T):T.ownerDocument;return D.call(M||T,T,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},ln=function(T){return T=Gt(T,ze," "),T=Gt(T,Se," "),T=Gt(T,me," "),T},Cn=function(T){var M;T.normalize();const $=z?z(T):T.ownerDocument,ce=D.call($||T,T,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null);let pe=ce.nextNode();for(;pe;)pe.data=ln(pe.data),pe=ce.nextNode();const we=(M=T.querySelectorAll)===null||M===void 0?void 0:M.call(T,"template");we&&Ot(we,Re=>{Lt(Re.content)&&Cn(Re.content)})},cn=function(T){const M=L?L(T):null;return typeof M!="string"||Pe(M)!=="form"?!1:typeof T.nodeName!="string"||typeof T.textContent!="string"||typeof T.removeChild!="function"||T.attributes!==O(T)||typeof T.removeAttribute!="function"||typeof T.removeAttributeNode!="function"||typeof T.getAttributeNode!="function"||typeof T.setAttribute!="function"||typeof T.namespaceURI!="string"||typeof T.insertBefore!="function"||typeof T.hasChildNodes!="function"||T.nodeType!==E(T)||T.childNodes!==b(T)},Lt=function(T){if(!E||typeof T!="object"||T===null)return!1;try{return E(T)===nt.documentFragment}catch{return!1}},Zt=function(T){if(!E||typeof T!="object"||T===null)return!1;try{return typeof E(T)=="number"}catch{return!1}};function pt(ne,T,M){ne.length!==0&&Ot(ne,$=>{$.call(t,T,M,Dt)})}const _o=function(T,M){return!!(ve&&T.hasChildNodes()&&!Zt(T.firstElementChild)&&Ze(pi,T.textContent)&&Ze(pi,T.innerHTML)||ve&&T.namespaceURI===ht&&Ta[M]&&(Zt(T.firstElementChild)||typeof T.textContent=="string"&&Ze(Aa[M],T.textContent))||T.nodeType===nt.processingInstruction||ve&&T.nodeType===nt.comment&&Ze(mi,T.data))},un=function(T,M){if(T instanceof RegExp)return Ze(T,M);if(T instanceof Function){for(var $=arguments.length,ce=new Array($>2?$-2:0),pe=2;pe<$;pe++)ce[pe-2]=arguments[pe];return!!T(M,...ce)}return!1},go=function(T,M,$){if(!X[M]&&br(M)&&un(P.tagNameCheck,M))return!1;if(Wt&&!ut[M]){const ce=k(T),pe=b(T);if(pe&&ce){const we=pe.length;for(let Re=we-1;Re>=0;--Re){const Ne=T===$?u(pe[Re],!0):pe[Re];ce.insertBefore(Ne,_(T))}}}return kt(T),!0},pr=function(T,M,$,ce){return T.length===0?M:M===$||M===ce?rt(M):M},mr=function(T,M){return T===M||k(T)!==null?!1:(zt&&an(T),!0)},_r=function(T,M){if(pt(J.beforeSanitizeElements,T,null),mr(T,M))return!0;if(cn(T))return kt(T),!0;const $=Pe(N(T));if(W=pr(J.uponSanitizeElement,W,x,Ge),pt(J.uponSanitizeElement,T,{tagName:$,allowedTags:W}),mr(T,M))return!0;if(_o(T,$))return kt(T),!0;if(X[$]||!(B.tagCheck instanceof Function&&B.tagCheck($))&&!W[$]){const pe=go(T,$,M);return pe===!1&&pt(J.afterSanitizeElements,T,null),pe}if(U(T)===nt.element&&!ho(T)||($==="noscript"||$==="noembed"||$==="noframes")&&Ze(Ea,T.innerHTML))return kt(T),!0;if(Ae&&T.nodeType===nt.text){const pe=ln(T.textContent);T.textContent!==pe&&(qt(t.removed,{element:T.cloneNode()}),T.textContent=pe)}return pt(J.afterSanitizeElements,T,null),!1},gr=function(T,M,$){if(Q[M]||fr(M,T)||xt&&(M==="id"||M==="name")&&($ in e||$ in lo))return!1;const ce=w[M]||B.attributeCheck instanceof Function&&B.attributeCheck(M,T);return ue&&Ze(le,M)||te&&Ze(Te,M)?!0:ce?rr[M]||Ze(m,Gt($,Oe,""))||(M==="src"||M==="xlink:href"||M==="href")&&T!=="script"&&si($,"data:")===0&&tr[T]||re&&!Ze(Ce,Gt($,Oe,""))?!0:!$:br(T)&&un(P.tagNameCheck,T)&&un(P.attributeNameCheck,M,T)||M==="is"&&P.allowCustomizedBuiltInElements&&un(P.tagNameCheck,$)},bo=Ie({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),br=function(T){return!bo[Vt(T)]&&Ze(he,T)},yo=function(T,M,$,ce){if(I&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!$)switch(p.getAttributeType(T,M)){case"TrustedHTML":return fe(ce);case"TrustedScriptURL":return K(ce)}return ce},wo=function(T,M,$,ce){try{return $?T.setAttributeNS($,M,ce):T.setAttribute(M,ce),cn(T)?(kt(T),!1):!0}catch{return At(M,T),!1}},yr=function(T){pt(J.beforeSanitizeAttributes,T,null);const M=T.attributes;if(!M||cn(T))return;w=pr(J.uponSanitizeAttribute,w,S,dt);const $={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:w,forceKeepAttr:void 0};let ce=M.length;const pe=Pe(T.nodeName);for(;ce--;){const we=M[ce],Re=we.name,Ne=we.namespaceURI,Je=we.value,Qe=Pe(Re),In=Je;let Ye=Re==="value"?In:oa(In),wr=!1;if($.attrName=Qe,$.attrValue=Ye,$.keepAttr=!0,$.forceKeepAttr=void 0,pt(J.uponSanitizeAttribute,T,$),Ye=$.attrValue,tn&&(Qe==="id"||Qe==="name")&&si(Ye,nn)!==0&&(At(Re,T,we),Ye=nn+Ye,wr=!0),ve&&Ze(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Ye)){At(Re,T,we);continue}if(Qe==="attributename"&&oi(Ye,"href")){At(Re,T,we);continue}if(!$.forceKeepAttr){if(!$.keepAttr){At(Re,T,we);continue}if(!_e&&Ze(Sa,Ye)){At(Re,T,we);continue}if(Ae&&(Ye=ln(Ye)),!gr(pe,Qe,Ye)){At(Re,T,we);continue}Ye=yo(pe,Qe,Ne,Ye),Ye!==In&&wo(T,Re,Ne,Ye)&&wr&&ii(t.removed)}}pt(J.afterSanitizeAttributes,T,null)},fn=function(T){let M=null;const $=hr(T);for(pt(J.beforeSanitizeShadowDOM,T,null);M=$.nextNode();)if(pt(J.uponSanitizeShadowNode,M,null),_r(M,T),yr(M),Lt(M.content)&&fn(M.content),U(M)===nt.element){const ce=v(M);Lt(ce)&&(On(ce),fn(ce))}pt(J.afterSanitizeShadowDOM,T,null)},On=function(T){const M=[{node:T,shadow:null}];for(;M.length>0;){const $=M.pop();if($.shadow){fn($.shadow);continue}const ce=$.node,we=U(ce)===nt.element,Re=b(ce);if(Re)for(let Ne=Re.length-1;Ne>=0;--Ne)M.push({node:Re[Ne],shadow:null});if(we){const Ne=L?L(ce):null;if(typeof Ne=="string"&&Pe(Ne)==="template"){const Je=ce.content;Lt(Je)&&M.push({node:Je,shadow:null})}}if(we){const Ne=v(ce);Lt(Ne)&&M.push({node:null,shadow:Ne},{node:Ne,shadow:null})}}};return t.sanitize=function(ne){let T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},M=null,$=null,ce=null,pe=null;if(vn=!ne,vn&&(ne="<!-->"),typeof ne!="string"&&!Zt(ne)&&(ne=ua(ne),typeof ne!="string"))throw Ct("dirty is not a string, aborting");if(!t.isSupported)return ne;yt?(W=Ge,w=dt):An(T),(J.uponSanitizeElement.length>0||J.uponSanitizeAttribute.length>0)&&(W=rt(W)),J.uponSanitizeAttribute.length>0&&(w=rt(w)),t.removed=[];const we=zt&&typeof ne!="string"&&Zt(ne);if(we){mo(ne);const Je=N(ne);if(typeof Je=="string"){const Qe=Pe(Je);if(!W[Qe]||X[Qe])throw sn(ne),Ct("root node is forbidden and cannot be sanitized in-place")}if(cn(ne))throw sn(ne),Ct("root node is clobbered and cannot be sanitized in-place");try{On(ne)}catch(Qe){throw sn(ne),Qe}}else if(Zt(ne))M=dr("<!---->"),$=M.ownerDocument.importNode(ne,!0),$.nodeType===nt.element&&$.nodeName==="BODY"||$.nodeName==="HTML"?M=$:M.appendChild($),On(M);else{if(!ct&&!Ae&&!Fe&&ne.indexOf("<")===-1)return I&&Ke?fe(ne):ne;if(M=dr(ne),!M)return ct?null:Ke?j:""}M&&De&&kt(M.firstChild);const Re=we?ne:M;try{const Je=hr(Re);for(;ce=Je.nextNode();)_r(ce,Re),yr(ce),Lt(ce.content)&&fn(ce.content)}catch(Je){throw we&&(sn(ne),Ot(t.removed,Qe=>{Qe.element&&an(Qe.element)})),Je}if(we)return Ot(t.removed,Je=>{Je.element&&an(Je.element)}),Ae&&Cn(ne),ne;if(ct){if(Ae&&Cn(M),wt)for(pe=F.call(M.ownerDocument);M.firstChild;)pe.appendChild(M.firstChild);else pe=M;return(w.shadowroot||w.shadowrootmode)&&(pe=oe.call(r,pe,!0)),pe}let Ne=Fe?M.outerHTML:M.innerHTML;return Fe&&W["!doctype"]&&M.ownerDocument&&M.ownerDocument.doctype&&M.ownerDocument.doctype.name&&Ze(ka,M.ownerDocument.doctype.name)&&(Ne="<!DOCTYPE "+M.ownerDocument.doctype.name+`>
17
+ `+Ne),Ae&&(Ne=ln(Ne)),I&&Ke?fe(Ne):Ne},t.setConfig=function(){let ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};An(ne),yt=!0,Ge=W,dt=w},t.clearConfig=function(){Dt=null,yt=!1,Ge=null,dt=null,I=C,j=""},t.isValidAttribute=function(ne,T,M){Dt||An({});const $=Pe(ne),ce=Pe(T);return gr($,ce,M)},t.addHook=function(ne,T){typeof T=="function"&&$e(J,ne)&&qt(J[ne],T)},t.removeHook=function(ne,T){if($e(J,ne)){if(T!==void 0){const M=ra(J[ne],T);return M===-1?void 0:ia(J[ne],M,1)[0]}return ii(J[ne])}},t.removeHooks=function(ne){$e(J,ne)&&(J[ne]=[])},t.removeAllHooks=function(){J=_i()},t}var no=to();const Bn=.1,Un=10,Ia=.001,za=.92,Ra=800;function Da(n){const t=bt(1),e=bt(0),r=bt(0),i=bt(!1);let o=0,s=0,a=0,l=0,c=null;function d(O){const E=n.getWrapper();if(!E)return;const L=O.getAttribute("viewBox");let z,U;if(L){const H=L.trim().split(/\s+/).map(Number);z=H[2],U=H[3]}else z=O.clientWidth||1,U=O.clientHeight||1;if(!z||!U)return;const N=E.clientWidth,I=E.clientHeight,j=Math.min(N/z,I/U)*za,C=Math.min(Un,Math.max(Bn,j));t.set(C),e.set((N-z*C)/2),r.set((I-U*C)/2)}function p(O){const E=n.getWrapper();E&&(t.set(Math.min(Un,Math.max(Bn,O.scale))),e.set(O.positionX*E.clientWidth),r.set(O.positionY*E.clientHeight))}function h(){c&&clearTimeout(c),c=setTimeout(()=>{c=null,u()},Ra)}function u(){const O=n.getSnapshotId(),E=n.getWrapper();if(!O||!E)return;const L=mt(e)/E.clientWidth,z=mt(r)/E.clientHeight;fetch("/viewport",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:O,frame:n.getCurrentFrame(),scale:mt(t),positionX:L,positionY:z})}).catch(()=>{})}function g(){var E;const O=(E=n.getContainer())==null?void 0:E.querySelector("svg");O?d(O):(t.set(1),e.set(0),r.set(0)),h()}function f(O){O.preventDefault();const E=n.getWrapper();if(!E)return;const L=mt(t),z=-O.deltaY*Ia,U=Math.min(Un,Math.max(Bn,L+z*L)),N=E.getBoundingClientRect(),I=O.clientX-N.left,j=O.clientY-N.top,C=mt(e),H=mt(r);e.set(I-(I-C)*(U/L)),r.set(j-(j-H)*(U/L)),t.set(U),h()}function _(O){O.button===0&&(i.set(!0),o=O.clientX,s=O.clientY,a=mt(e),l=mt(r),O.preventDefault())}function b(O){mt(i)&&(e.set(a+(O.clientX-o)),r.set(l+(O.clientY-s)),h())}function k(){i.set(!1)}function v(){c&&clearTimeout(c),c=null}return{scale:t,tx:e,ty:r,dragging:i,fitToView:d,applyViewport:p,resetTransform:g,onWheel:f,onMousedown:_,onMousemove:b,onMouseup:k,scheduleViewportReport:h,reportViewport:u,destroy:v}}function Ft(n){n.stopPropagation()}async function jn(n){await fetch("/node-click",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}).catch(()=>{})}function La(n){async function t(d){var f;d.stopPropagation();const p=d.currentTarget.closest(".node")??d.currentTarget,h=n.extractNodeId(p)??p.id,u=n.extractNodeLabel(p),g=(f=n.getNodeActions())==null?void 0:f[h];if(g&&g.length>0){const _=d;n.onPopupRequest({x:_.clientX,y:_.clientY,nodeId:h,nodeLabel:u,actions:g});return}await jn({type:"node",id:h,label:u})}async function e(d){var g;d.stopPropagation();const p=d.currentTarget,h=n.extractEdgeId(p)??"",u=((g=p.textContent)==null?void 0:g.trim())??"";await jn({type:"edge",id:h,label:u})}let r=null;function i(){o();const d=n.getContainer();if(!d)return;const p=d.querySelector("svg");if(!p)return;const h=p.querySelectorAll(".node"),u=p.querySelectorAll(".edgeLabel");for(const g of h)g.addEventListener("click",t),g.addEventListener("mousedown",Ft),g.style.cursor="pointer",g.classList.add("clickable-node");for(const g of u)g.addEventListener("click",e),g.addEventListener("mousedown",Ft),g.style.cursor="pointer";r=()=>{for(const g of h)g.removeEventListener("click",t),g.removeEventListener("mousedown",Ft),g.style.cursor="",g.classList.remove("clickable-node");for(const g of u)g.removeEventListener("click",e),g.removeEventListener("mousedown",Ft),g.style.cursor=""}}function o(){r==null||r(),r=null}let s=null;function a(d){l();const p=n.getContainer();if(!p)return;const h=p.querySelector("svg");if(!h)return;const u=h.querySelectorAll(".node");for(const g of u){const f=n.extractNodeId(g);if(f===null||!(f in d))continue;const _=d[f],b=k=>{k.stopPropagation(),fetch("/seek",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({frame:_})}).catch(()=>{})};g.addEventListener("click",b),g.addEventListener("mousedown",Ft),g.style.cursor="pointer",s=(k=>()=>{k==null||k(),g.removeEventListener("click",b),g.removeEventListener("mousedown",Ft),g.style.cursor=""})(s)}}function l(){s==null||s(),s=null}async function c(d,p){await jn({type:"node",id:d.nodeId,label:d.nodeLabel,action:p})}return{attachClickListeners:i,detachClickListeners:o,attachNodeToFrameListeners:a,detachNodeToFrameListeners:l,selectAction:c}}function gi(n,t,e){const r=n.slice();return r[7]=t[e],r[9]=e,r}function bi(n){let t,e,r,i=[],o=new Map,s,a,l=qe(n[0].actions);const c=d=>d[9];for(let d=0;d<l.length;d+=1){let p=gi(n,l,d),h=c(p);o.set(h,i[d]=yi(h,p))}return{c(){t=Z("div"),e=ae(),r=Z("div");for(let d=0;d<i.length;d+=1)i[d].c();A(t,"class","popup-backdrop svelte-1m6nmjq"),A(r,"class","node-action-popup svelte-1m6nmjq"),gt(r,"position","fixed"),gt(r,"left",n[0].x+"px"),gt(r,"top",n[0].y+"px")},m(d,p){V(d,t,p),V(d,e,p),V(d,r,p);for(let h=0;h<i.length;h+=1)i[h]&&i[h].m(r,null);s||(a=[ge(t,"click",n[3]),ge(r,"click",To(Pa)),gn(wn.call(null,r,{onEscape:n[6]}))],s=!0)},p(d,p){p&7&&(l=qe(d[0].actions),i=Tt(i,p,c,1,d,l,o,r,en,yi,null,gi)),p&1&&gt(r,"left",d[0].x+"px"),p&1&&gt(r,"top",d[0].y+"px")},d(d){d&&(G(t),G(e),G(r));for(let p=0;p<i.length;p+=1)i[p].d();s=!1,Be(a)}}}function yi(n,t){let e,r=t[7]+"",i,o,s,a;function l(){return t[4](t[7])}function c(...d){return t[5](t[7],...d)}return{key:n,first:null,c(){e=Z("div"),i=ee(r),o=ae(),A(e,"class","popup-item svelte-1m6nmjq"),A(e,"role","button"),A(e,"tabindex","0"),this.first=e},m(d,p){V(d,e,p),R(e,i),R(e,o),s||(a=[ge(e,"click",l),ge(e,"keydown",c)],s=!0)},p(d,p){t=d,p&1&&r!==(r=t[7]+"")&&ye(i,r)},d(d){d&&G(e),s=!1,Be(a)}}}function Na(n){let t,e=n[0]&&bi(n);return{c(){e&&e.c(),t=lt()},m(r,i){e&&e.m(r,i),V(r,t,i)},p(r,[i]){r[0]?e?e.p(r,i):(e=bi(r),e.c(),e.m(t.parentNode,t)):e&&(e.d(1),e=null)},i:be,o:be,d(r){r&&G(t),e&&e.d(r)}}}const Pa=()=>{};function Fa(n,t,e){let{popup:r=null}=t;const i=$t();function o(d,p){d.key!=="Enter"&&d.key!==" "||(d.preventDefault(),i("select",p))}const s=()=>i("dismiss"),a=d=>i("select",d),l=(d,p)=>o(p,d),c=()=>i("dismiss");return n.$$set=d=>{"popup"in d&&e(0,r=d.popup)},[r,i,o,s,a,l,c]}class Ma extends tt{constructor(t){super(),et(this,t,Fa,Na,Xe,{popup:0})}}function wi(n){let t,e;return{c(){t=Z("pre"),e=ee(n[2]),A(t,"class","render-error svelte-101ypv")},m(r,i){V(r,t,i),R(t,e)},p(r,i){i[0]&4&&ye(e,r[2])},d(r){r&&G(t)}}}function Ba(n){let t,e,r,i,o,s,a,l,c,d,p,h=n[2]&&wi(n);return l=new Ma({props:{popup:n[3]}}),l.$on("select",n[27]),l.$on("dismiss",n[13]),{c(){t=Z("div"),e=Z("div"),r=Z("div"),i=ae(),h&&h.c(),o=ae(),s=Z("div"),s.textContent="scroll to zoom · drag to pan · dbl-click to reset",a=ae(),He(l.$$.fragment),A(r,"class","mermaid-container svelte-101ypv"),A(e,"class","mermaid-canvas svelte-101ypv"),gt(e,"transform",n[5]),gt(e,"transform-origin","0 0"),A(s,"class","zoom-hint svelte-101ypv"),A(t,"class","mermaid-wrapper svelte-101ypv"),A(t,"title","Scroll to zoom · Drag to pan · Double-click to reset"),gt(t,"cursor",n[4])},m(u,g){V(u,t,g),R(t,e),R(e,r),n[26](r),R(t,i),h&&h.m(t,null),R(t,o),R(t,s),R(t,a),je(l,t,null),n[28](t),c=!0,d||(p=[ge(t,"wheel",n[11]),ge(t,"mousedown",n[12]),ge(t,"dblclick",n[10])],d=!0)},p(u,g){(!c||g[0]&32)&&gt(e,"transform",u[5]),u[2]?h?h.p(u,g):(h=wi(u),h.c(),h.m(t,o)):h&&(h.d(1),h=null);const f={};g[0]&8&&(f.popup=u[3]),l.$set(f),(!c||g[0]&16)&&gt(t,"cursor",u[4])},i(u){c||(ke(l.$$.fragment,u),c=!0)},o(u){Ee(l.$$.fragment,u),c=!1},d(u){u&&G(t),n[26](null),h&&h.d(),xe(l),n[28](null),d=!1,Be(p)}}}function Ua(n){const t=n.id.match(/flowchart-(.+?)-\d+$/);return t?t[1]:null}function ja(n){var e;return((e=(n.querySelector(".nodeLabel")??n.querySelector(".label")??n).textContent)==null?void 0:e.trim())??""}function xa(n){const t=n.closest("[id]");return t&&t.id||null}function Wa(n,t,e){let r,i,o,s,a,l,{source:c}=t,{clickable:d=!1}=t,{nodeActions:p=void 0}=t,{nodeToFrame:h=void 0}=t,{snapshotId:u=void 0}=t,{viewport:g=void 0}=t,{currentFrame:f=0}=t,_,b,k=null,v=null,O=0,E;const L=Da({getWrapper:()=>_,getContainer:()=>b,getSnapshotId:()=>u,getCurrentFrame:()=>f}),{scale:z,tx:U,ty:N,dragging:I,fitToView:j,applyViewport:C,resetTransform:H,onWheel:y,onMousedown:q,onMousemove:fe,onMouseup:K}=L;_t(n,z,he=>e(23,s=he)),_t(n,U,he=>e(25,l=he)),_t(n,N,he=>e(24,a=he)),_t(n,I,he=>e(22,o=he));let ie=null;const Y=La({getContainer:()=>b,extractNodeId:Ua,extractNodeLabel:ja,extractEdgeId:xa,getNodeActions:()=>p,onPopupRequest:he=>{e(3,ie=he)}}),{attachClickListeners:se,detachClickListeners:D,attachNodeToFrameListeners:F,detachNodeToFrameListeners:de}=Y;function oe(){e(3,ie=null)}async function J(he){if(!ie)return;const m=ie;e(3,ie=null),await Y.selectAction(m,he)}let ze=null;function Se(){return ze||(ze=kn(()=>import("./mermaid.core-DKnSsFxv.js").then(he=>he.bI),__vite__mapDeps([0,1])).then(he=>{const m=he.default;return m.initialize({startOnLoad:!1,theme:"default",securityLevel:"strict",htmlLabels:!1}),m})),ze}function me(){return u===void 0?!1:`${u}:${f}`!==E}async function le(he,m){const W=++O;if(e(2,k=null),D(),!he){b&&e(1,b.innerHTML="",b);return}try{const x=await Se();if(W!==O)return;const w=`mermaid-${W}`,{svg:S}=await x.render(w,he),P=no.sanitize(S,{USE_PROFILES:{svg:!0,svgFilters:!0}});if(W!==O)return;b&&e(1,b.innerHTML=P,b);const X=b==null?void 0:b.querySelector("svg");if(X){const Q=X.getAttribute("viewBox");if(Q){const B=Q.trim().split(/\s+/).map(Number);B[2]&&B[3]&&(X.setAttribute("width",String(B[2])),X.setAttribute("height",String(B[3])))}}m&&X&&(g?C(g):j(X)),d?se():h&&F(h)}catch(x){if(W!==O)return;e(2,k=x instanceof Error?x.message:String(x)),b&&e(1,b.innerHTML="",b)}}Jt(()=>{const he=me();u!==void 0&&(E=`${u}:${f}`),le(c,he),v=c,window.addEventListener("mousemove",fe),window.addEventListener("mouseup",K)}),yn(()=>{if(c!==v){const he=me();u!==void 0&&(E=`${u}:${f}`),v=c,le(c,he)}}),Qt(()=>{window.removeEventListener("mousemove",fe),window.removeEventListener("mouseup",K),D(),de(),L.destroy()});function Te(he){Ve[he?"unshift":"push"](()=>{b=he,e(1,b)})}const Ce=he=>J(he.detail);function Oe(he){Ve[he?"unshift":"push"](()=>{_=he,e(0,_)})}return n.$$set=he=>{"source"in he&&e(15,c=he.source),"clickable"in he&&e(16,d=he.clickable),"nodeActions"in he&&e(17,p=he.nodeActions),"nodeToFrame"in he&&e(18,h=he.nodeToFrame),"snapshotId"in he&&e(19,u=he.snapshotId),"viewport"in he&&e(20,g=he.viewport),"currentFrame"in he&&e(21,f=he.currentFrame)},n.$$.update=()=>{n.$$.dirty[0]&65536&&(d?se():(D(),e(3,ie=null))),n.$$.dirty[0]&262144&&(h?F(h):de()),n.$$.dirty[0]&58720256&&e(5,r=`translate(${l}px, ${a}px) scale(${s})`),n.$$.dirty[0]&4194304&&e(4,i=o?"grabbing":"grab")},[_,b,k,ie,i,r,z,U,N,I,H,y,q,oe,J,c,d,p,h,u,g,f,o,s,a,l,Te,Ce,Oe]}class Ha extends tt{constructor(t){super(),et(this,t,Wa,Ba,Xe,{source:15,clickable:16,nodeActions:17,nodeToFrame:18,snapshotId:19,viewport:20,currentFrame:21},null,[-1,-1])}}function Za(n,t){return`@scope (${t.map(r=>`#${r}`).join(", ")}) {
18
18
  ${n}
19
- }`}function Za(n){let t;return{c(){t=Z("div"),A(t,"class","html-renderer svelte-89qzxr"),A(t,"id","html-renderer-root")},m(e,r){V(e,t,r),n[3](t)},p:be,i:be,o:be,d(e){e&&G(t),n[3](null)}}}const xn="bootstrap-house-style",qa="html-renderer-root";function Ga(n,t,e){let{source:r}=t,{type:i}=t,o,s=null,a=null;function l(){return a||(a=kn(()=>import("./bootstrap.min-UtnB-TxT.js"),[]).then(h=>h.default.replace(/:root/g,":scope"))),a}async function c(){if(document.getElementById(xn))return;const h=await l();if(document.getElementById(xn))return;const u=document.createElement("style");u.id=xn,u.textContent=Ha(h,[qa]),document.head.appendChild(u)}function d(h){if(!o)return;i==="html"&&c();const u=to.sanitize(h,{USE_PROFILES:i==="svg"?{svg:!0,svgFilters:!0}:{html:!0}});e(0,o.innerHTML=u,o)}Jt(()=>{d(r),s=r}),yn(()=>{r!==s&&(s=r,d(r))});function p(h){Ve[h?"unshift":"push"](()=>{o=h,e(0,o)})}return n.$$set=h=>{"source"in h&&e(1,r=h.source),"type"in h&&e(2,i=h.type)},[o,r,i,p]}class ki extends tt{constructor(t){super(),et(this,t,Ga,Za,Xe,{source:1,type:2})}}function vi(n){let t,e;return{c(){t=Z("pre"),e=ee(n[1]),A(t,"class","render-error svelte-m8n5cm")},m(r,i){V(r,t,i),R(t,e)},p(r,i){i&2&&ye(e,r[1])},d(r){r&&G(t)}}}function Ya(n){let t,e,r,i=n[1]&&vi(n);return{c(){t=Z("div"),e=Z("div"),r=ae(),i&&i.c(),A(t,"class","katex-renderer svelte-m8n5cm")},m(o,s){V(o,t,s),R(t,e),n[3](e),R(t,r),i&&i.m(t,null)},p(o,[s]){o[1]?i?i.p(o,s):(i=vi(o),i.c(),i.m(t,null)):i&&(i.d(1),i=null)},i:be,o:be,d(o){o&&G(t),n[3](null),i&&i.d()}}}function Va(n,t,e){let{source:r}=t,i,o=null,s=null,a=0,l=null;function c(){return l||(l=kn(()=>import("./katex-BTI-AXqd.js"),[]).then(h=>h.default)),l}async function d(h){if(!i)return;const u=++a;e(1,o=null);try{const g=await c();if(u!==a)return;g.render(h,i,{displayMode:!0,throwOnError:!0})}catch(g){if(u!==a)return;e(1,o=g instanceof Error?g.message:String(g)),e(0,i.innerHTML="",i)}}Jt(()=>{d(r),s=r}),yn(()=>{r!==s&&(s=r,d(r))});function p(h){Ve[h?"unshift":"push"](()=>{i=h,e(0,i)})}return n.$$set=h=>{"source"in h&&e(2,r=h.source)},[i,o,r,p]}class Xa extends tt{constructor(t){super(),et(this,t,Va,Ya,Xe,{source:2})}}function Ei(n){let t,e;return{c(){t=Z("pre"),e=ee(n[1]),A(t,"class","render-error svelte-x5x50y")},m(r,i){V(r,t,i),R(t,e)},p(r,i){i&2&&ye(e,r[1])},d(r){r&&G(t)}}}function Ka(n){let t,e,r,i=n[1]&&Ei(n);return{c(){t=Z("div"),e=Z("div"),r=ae(),i&&i.c(),A(t,"class","vegalite-renderer svelte-x5x50y")},m(o,s){V(o,t,s),R(t,e),n[3](e),R(t,r),i&&i.m(t,null)},p(o,[s]){o[1]?i?i.p(o,s):(i=Ei(o),i.c(),i.m(t,null)):i&&(i.d(1),i=null)},i:be,o:be,d(o){o&&G(t),n[3](null),i&&i.d()}}}function Ja(n,t,e){let{source:r}=t,i,o=null,s=null,a=null,l=0,c=null;function d(){return c||(c=kn(()=>import("./embed-DcNeILcO.js"),__vite__mapDeps([2,3,1,4,5,6,7,8,9,10,11])).then(u=>u.default)),c}async function p(u){if(!i)return;const g=++l;e(1,o=null),a==null||a(),a=null;try{const f=JSON.parse(u),_=await d();if(g!==l)return;const b=await _(i,f,{actions:!1,renderer:"svg"});if(g!==l){b.view.finalize();return}a=()=>b.view.finalize()}catch(f){if(g!==l)return;e(1,o=f instanceof Error?f.message:String(f))}}Jt(()=>{p(r),s=r}),yn(()=>{r!==s&&(s=r,p(r))}),Qt(()=>{a==null||a()});function h(u){Ve[u?"unshift":"push"](()=>{i=u,e(0,i)})}return n.$$set=u=>{"source"in u&&e(2,r=u.source)},[i,o,r,h]}class Qa extends tt{constructor(t){super(),et(this,t,Ja,Ka,Xe,{source:2})}}function $a(n,t){const e=n.points??1,r=new Set(t),i=n.options.filter(a=>a.correct===!0).map(a=>a.id);let o;n.scoring==="partial"?(o=n.options.filter(a=>a.correct===!0&&r.has(a.id)).reduce((a,l)=>a+(l.weight??0),0),o=Math.min(1,o)):o=r.size===i.length&&i.every(l=>r.has(l))?1:0;const s=o*e;return{questionId:n.id,earned:s,possible:e,correct:Math.abs(s-e)<1e-9}}function el(n,t){const e=new Map(t.map(i=>[i.questionId,i.selected])),r=n.questions.map(i=>$a(i,e.get(i.id)??[]));return{earned:r.reduce((i,o)=>i+o.earned,0),possible:r.reduce((i,o)=>i+o.possible,0),results:r}}function Si(n,t,e){const r=n.slice();r[23]=t[e],r[26]=e;const i=r[7](r[23].id);return r[24]=i,r}function Ti(n,t,e){const r=n.slice();return r[27]=t[e],r}function tl(n){let t,e,r=[],i=new Map,o,s,a,l,c=n[0].title&&Ai(n),d=qe(n[0].questions);const p=f=>f[23].id;for(let f=0;f<d.length;f+=1){let _=Si(n,d,f),b=p(_);i.set(b,r[f]=zi(b,_))}function h(f,_){return f[2]?sl:ol}let u=h(n),g=u(n);return{c(){t=Z("form"),c&&c.c(),e=ae();for(let f=0;f<r.length;f+=1)r[f].c();o=ae(),s=Z("div"),g.c(),A(s,"class","actions svelte-1t7kwcj")},m(f,_){V(f,t,_),c&&c.m(t,null),R(t,e);for(let b=0;b<r.length;b+=1)r[b]&&r[b].m(t,null);R(t,o),R(t,s),g.m(s,null),a||(l=ge(t,"submit",Eo(n[12])),a=!0)},p(f,_){f[0].title?c?c.p(f,_):(c=Ai(f),c.c(),c.m(t,e)):c&&(c.d(1),c=null),_&3463&&(d=qe(f[0].questions),r=Tt(r,_,p,1,f,d,i,t,en,zi,o,Si)),u===(u=h(f))&&g?g.p(f,_):(g.d(1),g=u(f),g&&(g.c(),g.m(s,null)))},d(f){f&&G(t),c&&c.d();for(let _=0;_<r.length;_+=1)r[_].d();g.d(),a=!1,l()}}}function nl(n){let t,e,r;return{c(){t=Z("pre"),e=ee("Invalid quiz: "),r=ee(n[4]),A(t,"class","render-error svelte-1t7kwcj")},m(i,o){V(i,t,o),R(t,e),R(t,r)},p(i,o){o&16&&ye(r,i[4])},d(i){i&&G(t)}}}function Ai(n){let t,e=n[0].title+"",r;return{c(){t=Z("h2"),r=ee(e),A(t,"class","quiz-title svelte-1t7kwcj")},m(i,o){V(i,t,o),R(t,r)},p(i,o){o&1&&e!==(e=i[0].title+"")&&ye(r,e)},d(i){i&&G(t)}}}function Ci(n){let t;return{c(){t=Z("span"),t.textContent="(select all that apply)",A(t,"class","hint svelte-1t7kwcj")},m(e,r){V(e,t,r)},d(e){e&&G(t)}}}function rl(n){let t,e,r,i,o,s;function a(...l){return n[19](n[23],n[27],...l)}return{c(){var l;t=Z("input"),A(t,"type","checkbox"),A(t,"name",e=n[23].id),t.value=r=n[27].id,t.checked=i=((l=n[1][n[23].id])==null?void 0:l.includes(n[27].id))??!1},m(l,c){V(l,t,c),o||(s=ge(t,"change",a),o=!0)},p(l,c){var d;n=l,c&1&&e!==(e=n[23].id)&&A(t,"name",e),c&1&&r!==(r=n[27].id)&&(t.value=r),c&3&&i!==(i=((d=n[1][n[23].id])==null?void 0:d.includes(n[27].id))??!1)&&(t.checked=i)},d(l){l&&G(t),o=!1,s()}}}function il(n){let t,e,r,i,o,s;function a(){return n[18](n[23],n[27])}return{c(){var l;t=Z("input"),A(t,"type","radio"),A(t,"name",e=n[23].id),t.value=r=n[27].id,t.checked=i=((l=n[1][n[23].id])==null?void 0:l[0])===n[27].id},m(l,c){V(l,t,c),o||(s=ge(t,"change",a),o=!0)},p(l,c){var d;n=l,c&1&&e!==(e=n[23].id)&&A(t,"name",e),c&1&&r!==(r=n[27].id)&&(t.value=r),c&3&&i!==(i=((d=n[1][n[23].id])==null?void 0:d[0])===n[27].id)&&(t.checked=i)},d(l){l&&G(t),o=!1,s()}}}function Oi(n,t){let e,r,i,o=t[27].text+"",s;function a(d,p){return d[23].kind==="single"?il:rl}let l=a(t),c=l(t);return{key:n,first:null,c(){var d;e=Z("label"),c.c(),r=ae(),i=Z("span"),s=ee(o),A(i,"class","svelte-1t7kwcj"),A(e,"class","option svelte-1t7kwcj"),Le(e,"correct-opt",t[2]&&t[27].correct),Le(e,"picked",(d=t[1][t[23].id])==null?void 0:d.includes(t[27].id)),this.first=e},m(d,p){V(d,e,p),c.m(e,null),R(e,r),R(e,i),R(i,s)},p(d,p){var h;t=d,l===(l=a(t))&&c?c.p(t,p):(c.d(1),c=l(t),c&&(c.c(),c.m(e,r))),p&1&&o!==(o=t[27].text+"")&&ye(s,o),p&5&&Le(e,"correct-opt",t[2]&&t[27].correct),p&3&&Le(e,"picked",(h=t[1][t[23].id])==null?void 0:h.includes(t[27].id))},d(d){d&&G(e),c.d()}}}function Ii(n){let t,e=n[24].correct?"Correct":n[24].earned>0?"Partially correct":"Incorrect",r,i,o=Et(n[24].earned)+"",s,a,l=Et(n[24].possible)+"",c;return{c(){t=Z("p"),r=ee(e),i=ee(" — "),s=ee(o),a=ee(" / "),c=ee(l),A(t,"class","result svelte-1t7kwcj"),A(t,"role","status")},m(d,p){V(d,t,p),R(t,r),R(t,i),R(t,s),R(t,a),R(t,c)},p(d,p){p&129&&e!==(e=d[24].correct?"Correct":d[24].earned>0?"Partially correct":"Incorrect")&&ye(r,e),p&129&&o!==(o=Et(d[24].earned)+"")&&ye(s,o),p&129&&l!==(l=Et(d[24].possible)+"")&&ye(c,l)},d(d){d&&G(t)}}}function zi(n,t){let e,r,i,o=t[26]+1+"",s,a,l,c=t[23].text+"",d,p,h,u=[],g=new Map,f,_=t[23].kind==="multiple"&&Ci(),b=qe(t[23].options);const k=O=>O[27].id;for(let O=0;O<b.length;O+=1){let E=Ti(t,b,O),L=k(E);g.set(L,u[O]=Oi(L,E))}let v=t[24]&&Ii(t);return{key:n,first:null,c(){var O;e=Z("fieldset"),r=Z("legend"),i=Z("span"),s=ee(o),a=ee("."),l=ae(),d=ee(c),p=ae(),_&&_.c(),h=ae();for(let E=0;E<u.length;E+=1)u[E].c();f=ae(),v&&v.c(),A(i,"class","qnum svelte-1t7kwcj"),A(r,"class","svelte-1t7kwcj"),A(e,"class","question svelte-1t7kwcj"),e.disabled=t[8],Le(e,"right",(O=t[24])==null?void 0:O.correct),Le(e,"wrong",t[24]&&!t[24].correct),this.first=e},m(O,E){V(O,e,E),R(e,r),R(r,i),R(i,s),R(i,a),R(r,l),R(r,d),R(r,p),_&&_.m(r,null),R(e,h);for(let L=0;L<u.length;L+=1)u[L]&&u[L].m(e,null);R(e,f),v&&v.m(e,null)},p(O,E){var L;t=O,E&1&&o!==(o=t[26]+1+"")&&ye(s,o),E&1&&c!==(c=t[23].text+"")&&ye(d,c),t[23].kind==="multiple"?_||(_=Ci(),_.c(),_.m(r,null)):_&&(_.d(1),_=null),E&3079&&(b=qe(t[23].options),u=Tt(u,E,k,1,t,b,g,e,en,Oi,f,Ti)),t[24]?v?v.p(t,E):(v=Ii(t),v.c(),v.m(e,null)):v&&(v.d(1),v=null),E&256&&(e.disabled=t[8]),E&129&&Le(e,"right",(L=t[24])==null?void 0:L.correct),E&129&&Le(e,"wrong",t[24]&&!t[24].correct)},d(O){O&&G(e),_&&_.d();for(let E=0;E<u.length;E+=1)u[E].d();v&&v.d()}}}function ol(n){let t,e,r,i;function o(c,d){return c[3]?ul:c[6]?cl:c[5]?ll:al}let s=o(n),a=s(n),l=!n[9]&&Ri();return{c(){t=Z("button"),a.c(),r=ae(),l&&l.c(),i=lt(),A(t,"type","submit"),A(t,"class","submit-btn svelte-1t7kwcj"),t.disabled=e=!n[9]||n[5]||n[3],Le(t,"sent",n[3]),Le(t,"error",n[6])},m(c,d){V(c,t,d),a.m(t,null),V(c,r,d),l&&l.m(c,d),V(c,i,d)},p(c,d){s!==(s=o(c))&&(a.d(1),a=s(c),a&&(a.c(),a.m(t,null))),d&552&&e!==(e=!c[9]||c[5]||c[3])&&(t.disabled=e),d&8&&Le(t,"sent",c[3]),d&64&&Le(t,"error",c[6]),c[9]?l&&(l.d(1),l=null):l||(l=Ri(),l.c(),l.m(i.parentNode,i))},d(c){c&&(G(t),G(r),G(i)),a.d(),l&&l.d(c)}}}function sl(n){let t,e,r=Et(n[2].earned)+"",i,o,s=Et(n[2].possible)+"",a;return{c(){t=Z("p"),e=ee("Score: "),i=ee(r),o=ee(" / "),a=ee(s),A(t,"class","total svelte-1t7kwcj"),A(t,"role","status")},m(l,c){V(l,t,c),R(t,e),R(t,i),R(t,o),R(t,a)},p(l,c){c&4&&r!==(r=Et(l[2].earned)+"")&&ye(i,r),c&4&&s!==(s=Et(l[2].possible)+"")&&ye(a,s)},d(l){l&&G(t)}}}function al(n){let t;return{c(){t=ee("Submit")},m(e,r){V(e,t,r)},d(e){e&&G(t)}}}function ll(n){let t;return{c(){t=ee("Sending…")},m(e,r){V(e,t,r)},d(e){e&&G(t)}}}function cl(n){let t;return{c(){t=ee("Failed — retry")},m(e,r){V(e,t,r)},d(e){e&&G(t)}}}function ul(n){let t;return{c(){t=ee("Sent ✓")},m(e,r){V(e,t,r)},d(e){e&&G(t)}}}function Ri(n){let t;return{c(){t=Z("span"),t.textContent="Answer every question to submit.",A(t,"class","hint svelte-1t7kwcj")},m(e,r){V(e,t,r)},d(e){e&&G(t)}}}function fl(n){let t;function e(o,s){if(o[4])return nl;if(o[0])return tl}let r=e(n),i=r&&r(n);return{c(){t=Z("div"),i&&i.c(),A(t,"class","quiz-renderer svelte-1t7kwcj")},m(o,s){V(o,t,s),i&&i.m(t,null)},p(o,[s]){r===(r=e(o))&&i?i.p(o,s):(i&&i.d(1),i=r&&r(o),i&&(i.c(),i.m(t,null)))},i:be,o:be,d(o){o&&G(t),i&&i.d()}}}function Et(n){return Number.isInteger(n)?String(n):n.toFixed(2).replace(/\.?0+$/,"")}function dl(n,t,e){let r,i,o,{source:s}=t,{onSubmit:a=void 0}=t,{instance:l=void 0}=t,c=null,d=null,p=!1,h={},u=null,g=!1,f=!1,_=!1,b=null,k;function v(I,U){e(16,b=I),e(17,k=U),e(0,c=null),e(4,d=null),e(1,h={}),e(2,u=null),e(5,g=!1),e(3,f=!1),e(6,_=!1);try{const C=JSON.parse(I);if(!C||!Array.isArray(C.questions))throw new Error("missing questions");e(0,c=C),p=C.questions.length>0&&C.questions.every(H=>H.options.some(y=>y.correct===!0))}catch(C){e(4,d=C instanceof Error?C.message:String(C))}}function O(I,U){e(1,h={...h,[I]:[U]})}function E(I,U,C){const H=h[I]??[];e(1,h={...h,[I]:C?[...H,U]:H.filter(y=>y!==U)})}function L(){return((c==null?void 0:c.questions)??[]).map(I=>({questionId:I.id,selected:h[I.id]??[]}))}async function z(){if(!c||!i||r||g)return;const I=L();if(p){e(2,u=el(c,I)),a==null||a(I,u).catch(()=>{});return}if(a){e(5,g=!0),e(6,_=!1);try{await a(I),e(3,f=!0)}catch{e(6,_=!0)}finally{e(5,g=!1)}}}const j=(I,U)=>O(I.id,U.id),N=(I,U,C)=>E(I.id,U.id,C.currentTarget.checked);return n.$$set=I=>{"source"in I&&e(13,s=I.source),"onSubmit"in I&&e(14,a=I.onSubmit),"instance"in I&&e(15,l=I.instance)},n.$$.update=()=>{n.$$.dirty&237568&&(s!==b||l!==k)&&v(s,l),n.$$.dirty&12&&e(8,r=u!==null||f),n.$$.dirty&3&&e(9,i=c!==null&&c.questions.every(I=>{var U;return(((U=h[I.id])==null?void 0:U.length)??0)>0})),n.$$.dirty&4&&e(7,o=I=>u==null?void 0:u.results.find(U=>U.questionId===I))},[c,h,u,f,d,g,_,o,r,i,O,E,z,s,a,l,b,k,j,N]}class hl extends tt{constructor(t){super(),et(this,t,dl,fl,Xe,{source:13,onSubmit:14,instance:15})}}async function pl(n,t){const e=await fetch("/quiz/submit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({answers:n,...t?{score:{earned:t.earned,possible:t.possible}}:{}})}),r=await e.json().catch(()=>({ok:!1}));if(!e.ok||!r.ok)throw new Error(r.error??"Quiz submit failed")}function ml(n){let t,e,r,i;return{c(){t=Z("p"),e=ee("Building step-frames… "),r=ee(n[0]),i=ee(" frames"),A(t,"class","placeholder svelte-7z4kp7")},m(o,s){V(o,t,s),R(t,e),R(t,r),R(t,i)},p(o,[s]){s&1&&ye(r,o[0])},i:be,o:be,d(o){o&&G(t)}}}function _l(n,t,e){let{frameCount:r}=t;return n.$$set=i=>{"frameCount"in i&&e(0,r=i.frameCount)},[r]}class gl extends tt{constructor(t){super(),et(this,t,_l,ml,Xe,{frameCount:0})}}function Di(n){return({presentation:t})=>({source:t.frames[0].payload,type:n})}const Wn={mermaid:{load:()=>Promise.resolve(Wa),props:({presentation:n,clickable:t,nodeActions:e,nodeToFrameEnabled:r,nodeToFrame:i,viewport:o,currentFrame:s})=>({source:n.frames[0].payload,clickable:t,nodeActions:e,nodeToFrame:r?i:void 0,snapshotId:n.id,viewport:o,currentFrame:s})},svg:{load:()=>Promise.resolve(ki),props:Di("svg")},html:{load:()=>Promise.resolve(ki),props:Di("html")},katex:{load:()=>Promise.resolve(Xa),props:({presentation:n})=>({source:n.frames[0].payload})},"vega-lite":{load:()=>Promise.resolve(Qa),props:({presentation:n})=>({source:n.frames[0].payload})},quiz:{load:()=>Promise.resolve(hl),props:({presentation:n})=>({source:n.frames[0].payload,instance:n,onSubmit:pl})},"step-frames-placeholder":{load:()=>Promise.resolve(gl),props:({placeholder:n})=>({frameCount:n.frameCount})}};function Li(n){let t;function e(o,s){return o[15]?yl:bl}let r=e(n),i=r(n);return{c(){t=Z("div"),i.c(),A(t,"class","banner svelte-1wrabyi"),A(t,"role","alert"),A(t,"aria-live","assertive")},m(o,s){V(o,t,s),i.m(t,null)},p(o,s){r!==(r=e(o))&&(i.d(1),i=r(o),i&&(i.c(),i.m(t,null)))},d(o){o&&G(t),i.d()}}}function bl(n){let t;return{c(){t=ee("Server disconnected. Reconnecting…")},m(e,r){V(e,t,r)},d(e){e&&G(t)}}}function yl(n){let t,e,r;return{c(){t=ee("Server disconnected. Restart "),e=Z("code"),e.textContent="npm run dev",r=ee("."),A(e,"class","svelte-1wrabyi")},m(i,o){V(i,t,o),V(i,e,o),V(i,r,o)},d(i){i&&(G(t),G(e),G(r))}}}function Ni(n){let t,e=n[2].title+"",r;return{c(){t=Z("header"),r=ee(e),A(t,"class","canvas-title svelte-1wrabyi")},m(i,o){V(i,t,o),R(t,r)},p(i,o){o[0]&4&&e!==(e=i[2].title+"")&&ye(r,e)},d(i){i&&G(t)}}}function wl(n){let t,e,r;const i=[n[10]];var o=n[5];function s(a,l){let c={};for(let d=0;d<i.length;d+=1)c=kr(c,i[d]);return l!==void 0&&l[0]&1024&&(c=kr(c,Tr(i,[Ar(a[10])]))),{props:c}}return o&&(t=Sr(o,s(n))),{c(){t&&He(t.$$.fragment),e=lt()},m(a,l){t&&je(t,a,l),V(a,e,l),r=!0},p(a,l){if(l[0]&32&&o!==(o=a[5])){if(t){it();const c=t;Ee(c.$$.fragment,1,0,()=>{xe(c,1)}),ot()}o?(t=Sr(o,s(a,l)),He(t.$$.fragment),ke(t.$$.fragment,1),je(t,e.parentNode,e)):t=null}else if(o){const c=l[0]&1024?Tr(i,[Ar(a[10])]):{};t.$set(c)}},i(a){r||(t&&ke(t.$$.fragment,a),r=!0)},o(a){t&&Ee(t.$$.fragment,a),r=!1},d(a){a&&G(e),t&&xe(t,a)}}}function kl(n){let t;return{c(){t=Z("p"),t.textContent="Waiting for content…",A(t,"class","placeholder svelte-1wrabyi")},m(e,r){V(e,t,r)},p:be,i:be,o:be,d(e){e&&G(t)}}}function Pi(n){let t,e,r,i,o,s,a,l,c,d,p,h=n[2].frames[0].label&&Fi(n);return{c(){t=Z("div"),e=Z("button"),r=ee("← Prev"),o=ae(),h&&h.c(),s=ae(),a=Z("button"),l=ee("Next →"),A(e,"class","step-btn svelte-1wrabyi"),A(e,"aria-label","Previous frame"),e.disabled=i=n[1]===0,A(a,"class","step-btn svelte-1wrabyi"),A(a,"aria-label","Next frame"),a.disabled=c=n[11]!==void 0&&n[1]===n[11]-1,A(t,"class","step-bar svelte-1wrabyi")},m(u,g){V(u,t,g),R(t,e),R(e,r),R(t,o),h&&h.m(t,null),R(t,s),R(t,a),R(a,l),d||(p=[ge(e,"click",n[32]),ge(a,"click",n[33])],d=!0)},p(u,g){g[0]&2&&i!==(i=u[1]===0)&&(e.disabled=i),u[2].frames[0].label?h?h.p(u,g):(h=Fi(u),h.c(),h.m(t,s)):h&&(h.d(1),h=null),g[0]&2050&&c!==(c=u[11]!==void 0&&u[1]===u[11]-1)&&(a.disabled=c)},d(u){u&&G(t),h&&h.d(),d=!1,Be(p)}}}function Fi(n){let t,e=n[2].frames[0].label+"",r;return{c(){t=Z("span"),r=ee(e),A(t,"class","step-label svelte-1wrabyi")},m(i,o){V(i,t,o),R(t,r)},p(i,o){o[0]&4&&e!==(e=i[2].frames[0].label+"")&&ye(r,e)},d(i){i&&G(t)}}}function vl(n){let t,e;return t=new St({props:{name:"moon"}}),{c(){He(t.$$.fragment)},m(r,i){je(t,r,i),e=!0},i(r){e||(ke(t.$$.fragment,r),e=!0)},o(r){Ee(t.$$.fragment,r),e=!1},d(r){xe(t,r)}}}function El(n){let t,e;return t=new St({props:{name:"sun"}}),{c(){He(t.$$.fragment)},m(r,i){je(t,r,i),e=!0},i(r){e||(ke(t.$$.fragment,r),e=!0)},o(r){Ee(t.$$.fragment,r),e=!1},d(r){xe(t,r)}}}function Mi(n){let t,e,r,i,o,s,a,l,c,d;const p=[Al,Tl,Sl],h=[];function u(g,f){return g[17].sent?0:g[17].error?1:2}return i=u(n),o=h[i]=p[i](n),{c(){t=Z("div"),e=ae(),r=Z("button"),o.c(),A(t,"class","panel-sep svelte-1wrabyi"),A(r,"class","done-btn svelte-1wrabyi"),r.disabled=s=n[17].sent,A(r,"title",a=n[17].error?"Failed to send — click to retry":"Done"),A(r,"aria-live","polite"),Le(r,"done-btn-error",n[17].error)},m(g,f){V(g,t,f),V(g,e,f),V(g,r,f),h[i].m(r,null),l=!0,c||(d=ge(r,"click",Jn.handleDone),c=!0)},p(g,f){let _=i;i=u(g),i!==_&&(it(),Ee(h[_],1,1,()=>{h[_]=null}),ot(),o=h[i],o||(o=h[i]=p[i](g),o.c()),ke(o,1),o.m(r,null)),(!l||f[0]&131072&&s!==(s=g[17].sent))&&(r.disabled=s),(!l||f[0]&131072&&a!==(a=g[17].error?"Failed to send — click to retry":"Done"))&&A(r,"title",a),(!l||f[0]&131072)&&Le(r,"done-btn-error",g[17].error)},i(g){l||(ke(o),l=!0)},o(g){Ee(o),l=!1},d(g){g&&(G(t),G(e),G(r)),h[i].d(),c=!1,d()}}}function Sl(n){let t,e;return t=new St({props:{name:"check",size:16,strokeWidth:2.5}}),{c(){He(t.$$.fragment)},m(r,i){je(t,r,i),e=!0},i(r){e||(ke(t.$$.fragment,r),e=!0)},o(r){Ee(t.$$.fragment,r),e=!1},d(r){xe(t,r)}}}function Tl(n){let t;return{c(){t=ee("Failed ✗")},m(e,r){V(e,t,r)},i:be,o:be,d(e){e&&G(t)}}}function Al(n){let t;return{c(){t=ee("Sent ✓")},m(e,r){V(e,t,r)},i:be,o:be,d(e){e&&G(t)}}}function Cl(n){let t,e,r,i,o,s,a,l,c,d,p,h,u,g,f,_,b,k,v,O,E,L,z,j,N,I,U,C,H,y,q,fe,K,ie,Y,se,D,F,de;function oe(w){n[28](w)}let J={};n[6]!==void 0&&(J.open=n[6]),t=new qo({props:J}),n[27](t),Ve.push(()=>Ro(t,"open",oe)),t.$on("close",n[29]),i=new is({props:{mode:n[13].mode??"delete",open:n[13].mode!==null,workspaces:n[13].workspaces,loadError:n[13].loadError}}),i.$on("close",_n.close),i.$on("deleted",n[18]);let ze={open:n[8]};s=new ws({props:ze}),n[30](s),s.$on("close",n[31]),s.$on("imported",n[20]);let Se=n[14]&&Li(n),me=n[2]!==null&&n[2].title&&Ni(n);const le=[kl,wl],Te=[];function Ce(w,S){return w[2]===null&&w[3]===null?0:w[5]&&w[0]===w[4]?1:-1}~(u=Ce(n))&&(g=Te[u]=le[u](n));let Oe=n[2]!==null&&n[12]==="manual"&&Pi(n);const he=[El,vl],m=[];function W(w,S){return w[16]==="dark"?0:1}v=W(n),O=m[v]=he[v](n),C=new St({props:{name:"history"}}),K=new St({props:{name:"trash"}}),Y=new Is({}),Y.$on("export",n[36]),Y.$on("import",n[37]);let x=(n[17].armed||n[17].sent||n[17].error)&&Mi(n);return{c(){He(t.$$.fragment),r=ae(),He(i.$$.fragment),o=ae(),He(s.$$.fragment),a=ae(),l=Z("main"),Se&&Se.c(),c=ae(),d=Z("div"),me&&me.c(),p=ae(),h=Z("div"),g&&g.c(),f=ae(),Oe&&Oe.c(),_=ae(),b=Z("div"),k=Z("button"),O.c(),j=ae(),N=Z("div"),I=ae(),U=Z("button"),He(C.$$.fragment),H=ae(),y=Z("div"),q=ae(),fe=Z("button"),He(K.$$.fragment),ie=ae(),He(Y.$$.fragment),se=ae(),x&&x.c(),A(h,"class","canvas svelte-1wrabyi"),A(d,"class","canvas-frame svelte-1wrabyi"),A(k,"class","panel-icon-btn svelte-1wrabyi"),A(k,"aria-label",E=n[16]==="dark"?"Switch to light theme":"Switch to dark theme"),A(k,"aria-pressed",L=n[16]==="dark"),A(k,"title",z=n[16]==="dark"?"Switch to light theme":"Switch to dark theme"),A(N,"class","panel-sep svelte-1wrabyi"),A(U,"class","panel-icon-btn svelte-1wrabyi"),A(U,"aria-label","Toggle history panel"),A(U,"aria-pressed",n[6]),A(U,"title","History"),A(y,"class","panel-sep svelte-1wrabyi"),A(fe,"class","panel-icon-btn delete-btn svelte-1wrabyi"),A(fe,"aria-label","Delete snapshots"),A(fe,"title","Delete snapshots"),A(b,"class","controls-panel svelte-1wrabyi"),A(l,"class","svelte-1wrabyi")},m(w,S){je(t,w,S),V(w,r,S),je(i,w,S),V(w,o,S),je(s,w,S),V(w,a,S),V(w,l,S),Se&&Se.m(l,null),R(l,c),R(l,d),me&&me.m(d,null),R(d,p),R(d,h),~u&&Te[u].m(h,null),R(l,f),Oe&&Oe.m(l,null),R(l,_),R(l,b),R(b,k),m[v].m(k,null),R(b,j),R(b,N),R(b,I),R(b,U),je(C,U,null),R(b,H),R(b,y),R(b,q),R(b,fe),je(K,fe,null),R(b,ie),je(Y,b,null),R(b,se),x&&x.m(b,null),D=!0,F||(de=[ge(k,"click",Ki.toggle),ge(U,"click",n[34]),ge(fe,"click",n[35]),ge(l,"dragover",Ol),ge(l,"drop",n[19])],F=!0)},p(w,S){const P={};!e&&S[0]&64&&(e=!0,P.open=w[6],Oo(()=>e=!1)),t.$set(P);const X={};S[0]&8192&&(X.mode=w[13].mode??"delete"),S[0]&8192&&(X.open=w[13].mode!==null),S[0]&8192&&(X.workspaces=w[13].workspaces),S[0]&8192&&(X.loadError=w[13].loadError),i.$set(X);const Q={};S[0]&256&&(Q.open=w[8]),s.$set(Q),w[14]?Se?Se.p(w,S):(Se=Li(w),Se.c(),Se.m(l,c)):Se&&(Se.d(1),Se=null),w[2]!==null&&w[2].title?me?me.p(w,S):(me=Ni(w),me.c(),me.m(d,p)):me&&(me.d(1),me=null);let B=u;u=Ce(w),u===B?~u&&Te[u].p(w,S):(g&&(it(),Ee(Te[B],1,1,()=>{Te[B]=null}),ot()),~u?(g=Te[u],g?g.p(w,S):(g=Te[u]=le[u](w),g.c()),ke(g,1),g.m(h,null)):g=null),w[2]!==null&&w[12]==="manual"?Oe?Oe.p(w,S):(Oe=Pi(w),Oe.c(),Oe.m(l,_)):Oe&&(Oe.d(1),Oe=null);let te=v;v=W(w),v!==te&&(it(),Ee(m[te],1,1,()=>{m[te]=null}),ot(),O=m[v],O||(O=m[v]=he[v](w),O.c()),ke(O,1),O.m(k,null)),(!D||S[0]&65536&&E!==(E=w[16]==="dark"?"Switch to light theme":"Switch to dark theme"))&&A(k,"aria-label",E),(!D||S[0]&65536&&L!==(L=w[16]==="dark"))&&A(k,"aria-pressed",L),(!D||S[0]&65536&&z!==(z=w[16]==="dark"?"Switch to light theme":"Switch to dark theme"))&&A(k,"title",z),(!D||S[0]&64)&&A(U,"aria-pressed",w[6]),w[17].armed||w[17].sent||w[17].error?x?(x.p(w,S),S[0]&131072&&ke(x,1)):(x=Mi(w),x.c(),ke(x,1),x.m(b,null)):x&&(it(),Ee(x,1,1,()=>{x=null}),ot())},i(w){D||(ke(t.$$.fragment,w),ke(i.$$.fragment,w),ke(s.$$.fragment,w),ke(g),ke(O),ke(C.$$.fragment,w),ke(K.$$.fragment,w),ke(Y.$$.fragment,w),ke(x),D=!0)},o(w){Ee(t.$$.fragment,w),Ee(i.$$.fragment,w),Ee(s.$$.fragment,w),Ee(g),Ee(O),Ee(C.$$.fragment,w),Ee(K.$$.fragment,w),Ee(Y.$$.fragment,w),Ee(x),D=!1},d(w){w&&(G(r),G(o),G(a),G(l)),n[27](null),xe(t,w),xe(i,w),n[30](null),xe(s,w),Se&&Se.d(),me&&me.d(),~u&&Te[u].d(),Oe&&Oe.d(),m[v].d(),xe(C),xe(K),xe(Y),x&&x.d(),F=!1,Be(de)}}}function Ol(n){var t;(t=n.dataTransfer)!=null&&t.types.includes("Files")&&n.preventDefault()}function Il(n,t,e){let r,i,o,s,a,l,c,d,p,h,u,g,f,_,b,k,v,O;_t(n,Vi,le=>e(26,f=le)),_t(n,_n,le=>e(13,_=le)),_t(n,Qn,le=>e(14,b=le)),_t(n,$n,le=>e(15,k=le)),_t(n,Ki,le=>e(16,v=le)),_t(n,Jn,le=>e(17,O=le));const E=new Map;let L,z,j=0;async function N(le){if(le===void 0){e(5,L=void 0),e(0,z=void 0);return}const Te=E.get(le);if(Te){e(5,L=Te),e(0,z=le);return}const Ce=++j,Oe=await Wn[le].load();Ce===j&&(E.set(le,Oe),e(5,L=Oe),e(0,z=le))}let I=null;Jt(()=>{I=qs()}),Qt(()=>{I==null||I()});let U=!1,C;function H(){U&&(C==null||C.fetchSnapshots())}let y=!1,q;function fe(le){var Ce;const Te=(Ce=le.dataTransfer)==null?void 0:Ce.files[0];Te&&(le.preventDefault(),e(8,y=!0),q==null||q.acceptFile(Te))}function K(){U&&(C==null||C.fetchSnapshots())}function ie(le){Ve[le?"unshift":"push"](()=>{C=le,e(7,C)})}function Y(le){U=le,e(6,U)}const se=()=>{e(6,U=!1)};function D(le){Ve[le?"unshift":"push"](()=>{q=le,e(9,q)})}const F=()=>{e(8,y=!1)},de=()=>Qr("prev"),oe=()=>Qr("next"),J=()=>{e(6,U=!U)},ze=()=>_n.open("delete"),Se=()=>_n.open("export"),me=()=>{e(8,y=!0)};return n.$$.update=()=>{var le;n.$$.dirty[0]&67108864&&e(2,{presentation:r,driver:i,placeholder:o,currentFrame:s,totalFrames:a,viewport:l,nodeToFrame:c,clickable:d,nodeActions:p,nodeToFrameEnabled:h}=f,r,(e(12,i),e(26,f)),(e(3,o),e(26,f)),(e(1,s),e(26,f)),(e(11,a),e(26,f)),(e(21,l),e(26,f)),(e(22,c),e(26,f)),(e(25,d),e(26,f)),(e(24,p),e(26,f)),(e(23,h),e(26,f))),n.$$.dirty[0]&12&&e(4,u=o!==null?"step-frames-placeholder":(le=r==null?void 0:r.frames[0])==null?void 0:le.type),n.$$.dirty[0]&16&&N(u),n.$$.dirty[0]&65011743&&e(10,g=!z||z!==u?{}:z==="step-frames-placeholder"?o?Wn["step-frames-placeholder"].props({placeholder:o}):{}:r?Wn[z].props({presentation:r,clickable:d,nodeActions:p,nodeToFrameEnabled:h,nodeToFrame:c,viewport:l,currentFrame:s??0}):{})},[z,s,r,o,u,L,U,C,y,q,g,a,i,_,b,k,v,O,H,fe,K,l,c,h,p,d,f,ie,Y,se,D,F,de,oe,J,ze,Se,me]}class zl extends tt{constructor(t){super(),et(this,t,Il,Cl,Xe,{},null,[-1,-1])}}new zl({target:document.getElementById("app")});export{kn as _,dn as c,os as g,to as p};
19
+ }`}function qa(n){let t;return{c(){t=Z("div"),A(t,"class","html-renderer svelte-89qzxr"),A(t,"id","html-renderer-root")},m(e,r){V(e,t,r),n[3](t)},p:be,i:be,o:be,d(e){e&&G(t),n[3](null)}}}const xn="bootstrap-house-style",Ga="html-renderer-root";function Ya(n,t,e){let{source:r}=t,{type:i}=t,o,s=null,a=null;function l(){return a||(a=kn(()=>import("./bootstrap.min-UtnB-TxT.js"),[]).then(h=>h.default.replace(/:root/g,":scope"))),a}async function c(){if(document.getElementById(xn))return;const h=await l();if(document.getElementById(xn))return;const u=document.createElement("style");u.id=xn,u.textContent=Za(h,[Ga]),document.head.appendChild(u)}function d(h){if(!o)return;i==="html"&&c();const u=no.sanitize(h,{USE_PROFILES:i==="svg"?{svg:!0,svgFilters:!0}:{html:!0}});e(0,o.innerHTML=u,o)}Jt(()=>{d(r),s=r}),yn(()=>{r!==s&&(s=r,d(r))});function p(h){Ve[h?"unshift":"push"](()=>{o=h,e(0,o)})}return n.$$set=h=>{"source"in h&&e(1,r=h.source),"type"in h&&e(2,i=h.type)},[o,r,i,p]}class ki extends tt{constructor(t){super(),et(this,t,Ya,qa,Xe,{source:1,type:2})}}function vi(n){let t,e;return{c(){t=Z("pre"),e=ee(n[1]),A(t,"class","render-error svelte-m8n5cm")},m(r,i){V(r,t,i),R(t,e)},p(r,i){i&2&&ye(e,r[1])},d(r){r&&G(t)}}}function Va(n){let t,e,r,i=n[1]&&vi(n);return{c(){t=Z("div"),e=Z("div"),r=ae(),i&&i.c(),A(t,"class","katex-renderer svelte-m8n5cm")},m(o,s){V(o,t,s),R(t,e),n[3](e),R(t,r),i&&i.m(t,null)},p(o,[s]){o[1]?i?i.p(o,s):(i=vi(o),i.c(),i.m(t,null)):i&&(i.d(1),i=null)},i:be,o:be,d(o){o&&G(t),n[3](null),i&&i.d()}}}function Xa(n,t,e){let{source:r}=t,i,o=null,s=null,a=0,l=null;function c(){return l||(l=kn(()=>import("./katex-BTI-AXqd.js"),[]).then(h=>h.default)),l}async function d(h){if(!i)return;const u=++a;e(1,o=null);try{const g=await c();if(u!==a)return;g.render(h,i,{displayMode:!0,throwOnError:!0})}catch(g){if(u!==a)return;e(1,o=g instanceof Error?g.message:String(g)),e(0,i.innerHTML="",i)}}Jt(()=>{d(r),s=r}),yn(()=>{r!==s&&(s=r,d(r))});function p(h){Ve[h?"unshift":"push"](()=>{i=h,e(0,i)})}return n.$$set=h=>{"source"in h&&e(2,r=h.source)},[i,o,r,p]}class Ka extends tt{constructor(t){super(),et(this,t,Xa,Va,Xe,{source:2})}}function Ei(n){let t,e;return{c(){t=Z("pre"),e=ee(n[1]),A(t,"class","render-error svelte-x5x50y")},m(r,i){V(r,t,i),R(t,e)},p(r,i){i&2&&ye(e,r[1])},d(r){r&&G(t)}}}function Ja(n){let t,e,r,i=n[1]&&Ei(n);return{c(){t=Z("div"),e=Z("div"),r=ae(),i&&i.c(),A(t,"class","vegalite-renderer svelte-x5x50y")},m(o,s){V(o,t,s),R(t,e),n[3](e),R(t,r),i&&i.m(t,null)},p(o,[s]){o[1]?i?i.p(o,s):(i=Ei(o),i.c(),i.m(t,null)):i&&(i.d(1),i=null)},i:be,o:be,d(o){o&&G(t),n[3](null),i&&i.d()}}}function Qa(n,t,e){let{source:r}=t,i,o=null,s=null,a=null,l=0,c=null;function d(){return c||(c=kn(()=>import("./embed-DcNeILcO.js"),__vite__mapDeps([2,3,1,4,5,6,7,8,9,10,11])).then(u=>u.default)),c}async function p(u){if(!i)return;const g=++l;e(1,o=null),a==null||a(),a=null;try{const f=JSON.parse(u),_=await d();if(g!==l)return;const b=await _(i,f,{actions:!1,renderer:"svg"});if(g!==l){b.view.finalize();return}a=()=>b.view.finalize()}catch(f){if(g!==l)return;e(1,o=f instanceof Error?f.message:String(f))}}Jt(()=>{p(r),s=r}),yn(()=>{r!==s&&(s=r,p(r))}),Qt(()=>{a==null||a()});function h(u){Ve[u?"unshift":"push"](()=>{i=u,e(0,i)})}return n.$$set=u=>{"source"in u&&e(2,r=u.source)},[i,o,r,h]}class $a extends tt{constructor(t){super(),et(this,t,Qa,Ja,Xe,{source:2})}}function el(n,t){const e=n.points??1,r=new Set(t),i=n.options.filter(a=>a.correct===!0).map(a=>a.id);let o;n.scoring==="partial"?(o=n.options.filter(a=>a.correct===!0&&r.has(a.id)).reduce((a,l)=>a+(l.weight??0),0),o=Math.min(1,o)):o=r.size===i.length&&i.every(l=>r.has(l))?1:0;const s=o*e;return{questionId:n.id,earned:s,possible:e,correct:Math.abs(s-e)<1e-9}}function tl(n,t){const e=new Map(t.map(i=>[i.questionId,i.selected])),r=n.questions.map(i=>el(i,e.get(i.id)??[]));return{earned:r.reduce((i,o)=>i+o.earned,0),possible:r.reduce((i,o)=>i+o.possible,0),results:r}}const{Map:ro}=ji;function Si(n,t,e){const r=n.slice();r[23]=t[e],r[26]=e;const i=r[7].get(r[23].id);return r[24]=i,r}function Ti(n,t,e){const r=n.slice();return r[27]=t[e],r}function nl(n){let t,e,r=[],i=new ro,o,s,a,l,c=n[0].title&&Ai(n),d=qe(n[0].questions);const p=f=>f[23].id;for(let f=0;f<d.length;f+=1){let _=Si(n,d,f),b=p(_);i.set(b,r[f]=zi(b,_))}function h(f,_){return f[2]?al:sl}let u=h(n),g=u(n);return{c(){t=Z("form"),c&&c.c(),e=ae();for(let f=0;f<r.length;f+=1)r[f].c();o=ae(),s=Z("div"),g.c(),A(s,"class","actions svelte-1t7kwcj")},m(f,_){V(f,t,_),c&&c.m(t,null),R(t,e);for(let b=0;b<r.length;b+=1)r[b]&&r[b].m(t,null);R(t,o),R(t,s),g.m(s,null),a||(l=ge(t,"submit",So(n[12])),a=!0)},p(f,_){f[0].title?c?c.p(f,_):(c=Ai(f),c.c(),c.m(t,e)):c&&(c.d(1),c=null),_&3463&&(d=qe(f[0].questions),r=Tt(r,_,p,1,f,d,i,t,en,zi,o,Si)),u===(u=h(f))&&g?g.p(f,_):(g.d(1),g=u(f),g&&(g.c(),g.m(s,null)))},d(f){f&&G(t),c&&c.d();for(let _=0;_<r.length;_+=1)r[_].d();g.d(),a=!1,l()}}}function rl(n){let t,e,r;return{c(){t=Z("pre"),e=ee("Invalid quiz: "),r=ee(n[4]),A(t,"class","render-error svelte-1t7kwcj")},m(i,o){V(i,t,o),R(t,e),R(t,r)},p(i,o){o&16&&ye(r,i[4])},d(i){i&&G(t)}}}function Ai(n){let t,e=n[0].title+"",r;return{c(){t=Z("h2"),r=ee(e),A(t,"class","quiz-title svelte-1t7kwcj")},m(i,o){V(i,t,o),R(t,r)},p(i,o){o&1&&e!==(e=i[0].title+"")&&ye(r,e)},d(i){i&&G(t)}}}function Ci(n){let t;return{c(){t=Z("span"),t.textContent="(select all that apply)",A(t,"class","hint svelte-1t7kwcj")},m(e,r){V(e,t,r)},d(e){e&&G(t)}}}function il(n){let t,e,r,i,o,s;function a(...l){return n[19](n[23],n[27],...l)}return{c(){var l;t=Z("input"),A(t,"type","checkbox"),A(t,"name",e=n[23].id),t.value=r=n[27].id,t.checked=i=((l=n[1][n[23].id])==null?void 0:l.includes(n[27].id))??!1},m(l,c){V(l,t,c),o||(s=ge(t,"change",a),o=!0)},p(l,c){var d;n=l,c&1&&e!==(e=n[23].id)&&A(t,"name",e),c&1&&r!==(r=n[27].id)&&(t.value=r),c&3&&i!==(i=((d=n[1][n[23].id])==null?void 0:d.includes(n[27].id))??!1)&&(t.checked=i)},d(l){l&&G(t),o=!1,s()}}}function ol(n){let t,e,r,i,o,s;function a(){return n[18](n[23],n[27])}return{c(){var l;t=Z("input"),A(t,"type","radio"),A(t,"name",e=n[23].id),t.value=r=n[27].id,t.checked=i=((l=n[1][n[23].id])==null?void 0:l[0])===n[27].id},m(l,c){V(l,t,c),o||(s=ge(t,"change",a),o=!0)},p(l,c){var d;n=l,c&1&&e!==(e=n[23].id)&&A(t,"name",e),c&1&&r!==(r=n[27].id)&&(t.value=r),c&3&&i!==(i=((d=n[1][n[23].id])==null?void 0:d[0])===n[27].id)&&(t.checked=i)},d(l){l&&G(t),o=!1,s()}}}function Oi(n,t){let e,r,i,o=t[27].text+"",s;function a(d,p){return d[23].kind==="single"?ol:il}let l=a(t),c=l(t);return{key:n,first:null,c(){var d;e=Z("label"),c.c(),r=ae(),i=Z("span"),s=ee(o),A(i,"class","svelte-1t7kwcj"),A(e,"class","option svelte-1t7kwcj"),Le(e,"correct-opt",t[2]&&t[27].correct),Le(e,"picked",(d=t[1][t[23].id])==null?void 0:d.includes(t[27].id)),this.first=e},m(d,p){V(d,e,p),c.m(e,null),R(e,r),R(e,i),R(i,s)},p(d,p){var h;t=d,l===(l=a(t))&&c?c.p(t,p):(c.d(1),c=l(t),c&&(c.c(),c.m(e,r))),p&1&&o!==(o=t[27].text+"")&&ye(s,o),p&5&&Le(e,"correct-opt",t[2]&&t[27].correct),p&3&&Le(e,"picked",(h=t[1][t[23].id])==null?void 0:h.includes(t[27].id))},d(d){d&&G(e),c.d()}}}function Ii(n){let t,e=n[24].correct?"Correct":n[24].earned>0?"Partially correct":"Incorrect",r,i,o=Et(n[24].earned)+"",s,a,l=Et(n[24].possible)+"",c;return{c(){t=Z("p"),r=ee(e),i=ee(" — "),s=ee(o),a=ee(" / "),c=ee(l),A(t,"class","result svelte-1t7kwcj"),A(t,"role","status")},m(d,p){V(d,t,p),R(t,r),R(t,i),R(t,s),R(t,a),R(t,c)},p(d,p){p&129&&e!==(e=d[24].correct?"Correct":d[24].earned>0?"Partially correct":"Incorrect")&&ye(r,e),p&129&&o!==(o=Et(d[24].earned)+"")&&ye(s,o),p&129&&l!==(l=Et(d[24].possible)+"")&&ye(c,l)},d(d){d&&G(t)}}}function zi(n,t){let e,r,i,o=t[26]+1+"",s,a,l,c=t[23].text+"",d,p,h,u=[],g=new ro,f,_=t[23].kind==="multiple"&&Ci(),b=qe(t[23].options);const k=O=>O[27].id;for(let O=0;O<b.length;O+=1){let E=Ti(t,b,O),L=k(E);g.set(L,u[O]=Oi(L,E))}let v=t[24]&&Ii(t);return{key:n,first:null,c(){var O;e=Z("fieldset"),r=Z("legend"),i=Z("span"),s=ee(o),a=ee("."),l=ae(),d=ee(c),p=ae(),_&&_.c(),h=ae();for(let E=0;E<u.length;E+=1)u[E].c();f=ae(),v&&v.c(),A(i,"class","qnum svelte-1t7kwcj"),A(r,"class","svelte-1t7kwcj"),A(e,"class","question svelte-1t7kwcj"),e.disabled=t[8],Le(e,"right",(O=t[24])==null?void 0:O.correct),Le(e,"wrong",t[24]&&!t[24].correct),this.first=e},m(O,E){V(O,e,E),R(e,r),R(r,i),R(i,s),R(i,a),R(r,l),R(r,d),R(r,p),_&&_.m(r,null),R(e,h);for(let L=0;L<u.length;L+=1)u[L]&&u[L].m(e,null);R(e,f),v&&v.m(e,null)},p(O,E){var L;t=O,E&1&&o!==(o=t[26]+1+"")&&ye(s,o),E&1&&c!==(c=t[23].text+"")&&ye(d,c),t[23].kind==="multiple"?_||(_=Ci(),_.c(),_.m(r,null)):_&&(_.d(1),_=null),E&3079&&(b=qe(t[23].options),u=Tt(u,E,k,1,t,b,g,e,en,Oi,f,Ti)),t[24]?v?v.p(t,E):(v=Ii(t),v.c(),v.m(e,null)):v&&(v.d(1),v=null),E&256&&(e.disabled=t[8]),E&129&&Le(e,"right",(L=t[24])==null?void 0:L.correct),E&129&&Le(e,"wrong",t[24]&&!t[24].correct)},d(O){O&&G(e),_&&_.d();for(let E=0;E<u.length;E+=1)u[E].d();v&&v.d()}}}function sl(n){let t,e,r,i;function o(c,d){return c[3]?fl:c[6]?ul:c[5]?cl:ll}let s=o(n),a=s(n),l=!n[9]&&Ri();return{c(){t=Z("button"),a.c(),r=ae(),l&&l.c(),i=lt(),A(t,"type","submit"),A(t,"class","submit-btn svelte-1t7kwcj"),t.disabled=e=!n[9]||n[5]||n[3],Le(t,"sent",n[3]),Le(t,"error",n[6])},m(c,d){V(c,t,d),a.m(t,null),V(c,r,d),l&&l.m(c,d),V(c,i,d)},p(c,d){s!==(s=o(c))&&(a.d(1),a=s(c),a&&(a.c(),a.m(t,null))),d&552&&e!==(e=!c[9]||c[5]||c[3])&&(t.disabled=e),d&8&&Le(t,"sent",c[3]),d&64&&Le(t,"error",c[6]),c[9]?l&&(l.d(1),l=null):l||(l=Ri(),l.c(),l.m(i.parentNode,i))},d(c){c&&(G(t),G(r),G(i)),a.d(),l&&l.d(c)}}}function al(n){let t,e,r=Et(n[2].earned)+"",i,o,s=Et(n[2].possible)+"",a;return{c(){t=Z("p"),e=ee("Score: "),i=ee(r),o=ee(" / "),a=ee(s),A(t,"class","total svelte-1t7kwcj"),A(t,"role","status")},m(l,c){V(l,t,c),R(t,e),R(t,i),R(t,o),R(t,a)},p(l,c){c&4&&r!==(r=Et(l[2].earned)+"")&&ye(i,r),c&4&&s!==(s=Et(l[2].possible)+"")&&ye(a,s)},d(l){l&&G(t)}}}function ll(n){let t;return{c(){t=ee("Submit")},m(e,r){V(e,t,r)},d(e){e&&G(t)}}}function cl(n){let t;return{c(){t=ee("Sending…")},m(e,r){V(e,t,r)},d(e){e&&G(t)}}}function ul(n){let t;return{c(){t=ee("Failed — retry")},m(e,r){V(e,t,r)},d(e){e&&G(t)}}}function fl(n){let t;return{c(){t=ee("Sent ✓")},m(e,r){V(e,t,r)},d(e){e&&G(t)}}}function Ri(n){let t;return{c(){t=Z("span"),t.textContent="Answer every question to submit.",A(t,"class","hint svelte-1t7kwcj")},m(e,r){V(e,t,r)},d(e){e&&G(t)}}}function dl(n){let t;function e(o,s){if(o[4])return rl;if(o[0])return nl}let r=e(n),i=r&&r(n);return{c(){t=Z("div"),i&&i.c(),A(t,"class","quiz-renderer svelte-1t7kwcj")},m(o,s){V(o,t,s),i&&i.m(t,null)},p(o,[s]){r===(r=e(o))&&i?i.p(o,s):(i&&i.d(1),i=r&&r(o),i&&(i.c(),i.m(t,null)))},i:be,o:be,d(o){o&&G(t),i&&i.d()}}}function Et(n){return Number.isInteger(n)?String(n):n.toFixed(2).replace(/\.?0+$/,"")}function hl(n,t,e){let r,i,o,{source:s}=t,{onSubmit:a=void 0}=t,{instance:l=void 0}=t,c=null,d=null,p=!1,h={},u=null,g=!1,f=!1,_=!1,b=null,k;function v(I,j){e(16,b=I),e(17,k=j),e(0,c=null),e(4,d=null),e(1,h={}),e(2,u=null),e(5,g=!1),e(3,f=!1),e(6,_=!1);try{const C=JSON.parse(I);if(!C||!Array.isArray(C.questions))throw new Error("missing questions");e(0,c=C),p=C.questions.length>0&&C.questions.every(H=>H.options.some(y=>y.correct===!0))}catch(C){e(4,d=C instanceof Error?C.message:String(C))}}function O(I,j){e(1,h={...h,[I]:[j]})}function E(I,j,C){const H=h[I]??[];e(1,h={...h,[I]:C?[...H,j]:H.filter(y=>y!==j)})}function L(){return((c==null?void 0:c.questions)??[]).map(I=>({questionId:I.id,selected:h[I.id]??[]}))}async function z(){if(!c||!i||r||g)return;const I=L();if(p){e(2,u=tl(c,I)),a==null||a(I,u).catch(()=>{});return}if(a){e(5,g=!0),e(6,_=!1);try{await a(I),e(3,f=!0)}catch{e(6,_=!0)}finally{e(5,g=!1)}}}const U=(I,j)=>O(I.id,j.id),N=(I,j,C)=>E(I.id,j.id,C.currentTarget.checked);return n.$$set=I=>{"source"in I&&e(13,s=I.source),"onSubmit"in I&&e(14,a=I.onSubmit),"instance"in I&&e(15,l=I.instance)},n.$$.update=()=>{n.$$.dirty&237568&&(s!==b||l!==k)&&v(s,l),n.$$.dirty&12&&e(8,r=u!==null||f),n.$$.dirty&3&&e(9,i=c!==null&&c.questions.every(I=>{var j;return(((j=h[I.id])==null?void 0:j.length)??0)>0})),n.$$.dirty&4&&e(7,o=new Map(((u==null?void 0:u.results)??[]).map(I=>[I.questionId,I])))},[c,h,u,f,d,g,_,o,r,i,O,E,z,s,a,l,b,k,U,N]}class pl extends tt{constructor(t){super(),et(this,t,hl,dl,Xe,{source:13,onSubmit:14,instance:15})}}async function ml(n,t){const e=await fetch("/quiz/submit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({answers:n,...t?{score:{earned:t.earned,possible:t.possible}}:{}})}),r=await e.json().catch(()=>({ok:!1}));if(!e.ok||!r.ok)throw new Error(r.error??"Quiz submit failed")}function _l(n){let t,e,r,i;return{c(){t=Z("p"),e=ee("Building step-frames… "),r=ee(n[0]),i=ee(" frames"),A(t,"class","placeholder svelte-7z4kp7")},m(o,s){V(o,t,s),R(t,e),R(t,r),R(t,i)},p(o,[s]){s&1&&ye(r,o[0])},i:be,o:be,d(o){o&&G(t)}}}function gl(n,t,e){let{frameCount:r}=t;return n.$$set=i=>{"frameCount"in i&&e(0,r=i.frameCount)},[r]}class bl extends tt{constructor(t){super(),et(this,t,gl,_l,Xe,{frameCount:0})}}function Di(n){return({presentation:t})=>({source:t.frames[0].payload,type:n})}const Wn={mermaid:{load:()=>Promise.resolve(Ha),props:({presentation:n,clickable:t,nodeActions:e,nodeToFrameEnabled:r,nodeToFrame:i,viewport:o,currentFrame:s})=>({source:n.frames[0].payload,clickable:t,nodeActions:e,nodeToFrame:r?i:void 0,snapshotId:n.id,viewport:o,currentFrame:s})},svg:{load:()=>Promise.resolve(ki),props:Di("svg")},html:{load:()=>Promise.resolve(ki),props:Di("html")},katex:{load:()=>Promise.resolve(Ka),props:({presentation:n})=>({source:n.frames[0].payload})},"vega-lite":{load:()=>Promise.resolve($a),props:({presentation:n})=>({source:n.frames[0].payload})},quiz:{load:()=>Promise.resolve(pl),props:({presentation:n})=>({source:n.frames[0].payload,instance:n,onSubmit:ml})},"step-frames-placeholder":{load:()=>Promise.resolve(bl),props:({placeholder:n})=>({frameCount:n.frameCount})}};function Li(n){let t;function e(o,s){return o[15]?wl:yl}let r=e(n),i=r(n);return{c(){t=Z("div"),i.c(),A(t,"class","banner svelte-1wrabyi"),A(t,"role","alert"),A(t,"aria-live","assertive")},m(o,s){V(o,t,s),i.m(t,null)},p(o,s){r!==(r=e(o))&&(i.d(1),i=r(o),i&&(i.c(),i.m(t,null)))},d(o){o&&G(t),i.d()}}}function yl(n){let t;return{c(){t=ee("Server disconnected. Reconnecting…")},m(e,r){V(e,t,r)},d(e){e&&G(t)}}}function wl(n){let t,e,r;return{c(){t=ee("Server disconnected. Restart "),e=Z("code"),e.textContent="npm run dev",r=ee("."),A(e,"class","svelte-1wrabyi")},m(i,o){V(i,t,o),V(i,e,o),V(i,r,o)},d(i){i&&(G(t),G(e),G(r))}}}function Ni(n){let t,e=n[2].title+"",r;return{c(){t=Z("header"),r=ee(e),A(t,"class","canvas-title svelte-1wrabyi")},m(i,o){V(i,t,o),R(t,r)},p(i,o){o[0]&4&&e!==(e=i[2].title+"")&&ye(r,e)},d(i){i&&G(t)}}}function kl(n){let t,e,r;const i=[n[10]];var o=n[5];function s(a,l){let c={};for(let d=0;d<i.length;d+=1)c=kr(c,i[d]);return l!==void 0&&l[0]&1024&&(c=kr(c,Tr(i,[Ar(a[10])]))),{props:c}}return o&&(t=Sr(o,s(n))),{c(){t&&He(t.$$.fragment),e=lt()},m(a,l){t&&je(t,a,l),V(a,e,l),r=!0},p(a,l){if(l[0]&32&&o!==(o=a[5])){if(t){it();const c=t;Ee(c.$$.fragment,1,0,()=>{xe(c,1)}),ot()}o?(t=Sr(o,s(a,l)),He(t.$$.fragment),ke(t.$$.fragment,1),je(t,e.parentNode,e)):t=null}else if(o){const c=l[0]&1024?Tr(i,[Ar(a[10])]):{};t.$set(c)}},i(a){r||(t&&ke(t.$$.fragment,a),r=!0)},o(a){t&&Ee(t.$$.fragment,a),r=!1},d(a){a&&G(e),t&&xe(t,a)}}}function vl(n){let t;return{c(){t=Z("p"),t.textContent="Waiting for content…",A(t,"class","placeholder svelte-1wrabyi")},m(e,r){V(e,t,r)},p:be,i:be,o:be,d(e){e&&G(t)}}}function Pi(n){let t,e,r,i,o,s,a,l,c,d,p,h=n[2].frames[0].label&&Fi(n);return{c(){t=Z("div"),e=Z("button"),r=ee("← Prev"),o=ae(),h&&h.c(),s=ae(),a=Z("button"),l=ee("Next →"),A(e,"class","step-btn svelte-1wrabyi"),A(e,"aria-label","Previous frame"),e.disabled=i=n[1]===0,A(a,"class","step-btn svelte-1wrabyi"),A(a,"aria-label","Next frame"),a.disabled=c=n[11]!==void 0&&n[1]===n[11]-1,A(t,"class","step-bar svelte-1wrabyi")},m(u,g){V(u,t,g),R(t,e),R(e,r),R(t,o),h&&h.m(t,null),R(t,s),R(t,a),R(a,l),d||(p=[ge(e,"click",n[32]),ge(a,"click",n[33])],d=!0)},p(u,g){g[0]&2&&i!==(i=u[1]===0)&&(e.disabled=i),u[2].frames[0].label?h?h.p(u,g):(h=Fi(u),h.c(),h.m(t,s)):h&&(h.d(1),h=null),g[0]&2050&&c!==(c=u[11]!==void 0&&u[1]===u[11]-1)&&(a.disabled=c)},d(u){u&&G(t),h&&h.d(),d=!1,Be(p)}}}function Fi(n){let t,e=n[2].frames[0].label+"",r;return{c(){t=Z("span"),r=ee(e),A(t,"class","step-label svelte-1wrabyi")},m(i,o){V(i,t,o),R(t,r)},p(i,o){o[0]&4&&e!==(e=i[2].frames[0].label+"")&&ye(r,e)},d(i){i&&G(t)}}}function El(n){let t,e;return t=new St({props:{name:"moon"}}),{c(){He(t.$$.fragment)},m(r,i){je(t,r,i),e=!0},i(r){e||(ke(t.$$.fragment,r),e=!0)},o(r){Ee(t.$$.fragment,r),e=!1},d(r){xe(t,r)}}}function Sl(n){let t,e;return t=new St({props:{name:"sun"}}),{c(){He(t.$$.fragment)},m(r,i){je(t,r,i),e=!0},i(r){e||(ke(t.$$.fragment,r),e=!0)},o(r){Ee(t.$$.fragment,r),e=!1},d(r){xe(t,r)}}}function Mi(n){let t,e,r,i,o,s,a,l,c,d;const p=[Cl,Al,Tl],h=[];function u(g,f){return g[17].sent?0:g[17].error?1:2}return i=u(n),o=h[i]=p[i](n),{c(){t=Z("div"),e=ae(),r=Z("button"),o.c(),A(t,"class","panel-sep svelte-1wrabyi"),A(r,"class","done-btn svelte-1wrabyi"),r.disabled=s=n[17].sent,A(r,"title",a=n[17].error?"Failed to send — click to retry":"Done"),A(r,"aria-live","polite"),Le(r,"done-btn-error",n[17].error)},m(g,f){V(g,t,f),V(g,e,f),V(g,r,f),h[i].m(r,null),l=!0,c||(d=ge(r,"click",Jn.handleDone),c=!0)},p(g,f){let _=i;i=u(g),i!==_&&(it(),Ee(h[_],1,1,()=>{h[_]=null}),ot(),o=h[i],o||(o=h[i]=p[i](g),o.c()),ke(o,1),o.m(r,null)),(!l||f[0]&131072&&s!==(s=g[17].sent))&&(r.disabled=s),(!l||f[0]&131072&&a!==(a=g[17].error?"Failed to send — click to retry":"Done"))&&A(r,"title",a),(!l||f[0]&131072)&&Le(r,"done-btn-error",g[17].error)},i(g){l||(ke(o),l=!0)},o(g){Ee(o),l=!1},d(g){g&&(G(t),G(e),G(r)),h[i].d(),c=!1,d()}}}function Tl(n){let t,e;return t=new St({props:{name:"check",size:16,strokeWidth:2.5}}),{c(){He(t.$$.fragment)},m(r,i){je(t,r,i),e=!0},i(r){e||(ke(t.$$.fragment,r),e=!0)},o(r){Ee(t.$$.fragment,r),e=!1},d(r){xe(t,r)}}}function Al(n){let t;return{c(){t=ee("Failed ✗")},m(e,r){V(e,t,r)},i:be,o:be,d(e){e&&G(t)}}}function Cl(n){let t;return{c(){t=ee("Sent ✓")},m(e,r){V(e,t,r)},i:be,o:be,d(e){e&&G(t)}}}function Ol(n){let t,e,r,i,o,s,a,l,c,d,p,h,u,g,f,_,b,k,v,O,E,L,z,U,N,I,j,C,H,y,q,fe,K,ie,Y,se,D,F,de;function oe(w){n[28](w)}let J={};n[6]!==void 0&&(J.open=n[6]),t=new Go({props:J}),n[27](t),Ve.push(()=>Do(t,"open",oe)),t.$on("close",n[29]),i=new os({props:{mode:n[13].mode??"delete",open:n[13].mode!==null,workspaces:n[13].workspaces,loadError:n[13].loadError}}),i.$on("close",_n.close),i.$on("deleted",n[18]);let ze={open:n[8]};s=new ks({props:ze}),n[30](s),s.$on("close",n[31]),s.$on("imported",n[20]);let Se=n[14]&&Li(n),me=n[2]!==null&&n[2].title&&Ni(n);const le=[vl,kl],Te=[];function Ce(w,S){return w[2]===null&&w[3]===null?0:w[5]&&w[0]===w[4]?1:-1}~(u=Ce(n))&&(g=Te[u]=le[u](n));let Oe=n[2]!==null&&n[12]==="manual"&&Pi(n);const he=[Sl,El],m=[];function W(w,S){return w[16]==="dark"?0:1}v=W(n),O=m[v]=he[v](n),C=new St({props:{name:"history"}}),K=new St({props:{name:"trash"}}),Y=new zs({}),Y.$on("export",n[36]),Y.$on("import",n[37]);let x=(n[17].armed||n[17].sent||n[17].error)&&Mi(n);return{c(){He(t.$$.fragment),r=ae(),He(i.$$.fragment),o=ae(),He(s.$$.fragment),a=ae(),l=Z("main"),Se&&Se.c(),c=ae(),d=Z("div"),me&&me.c(),p=ae(),h=Z("div"),g&&g.c(),f=ae(),Oe&&Oe.c(),_=ae(),b=Z("div"),k=Z("button"),O.c(),U=ae(),N=Z("div"),I=ae(),j=Z("button"),He(C.$$.fragment),H=ae(),y=Z("div"),q=ae(),fe=Z("button"),He(K.$$.fragment),ie=ae(),He(Y.$$.fragment),se=ae(),x&&x.c(),A(h,"class","canvas svelte-1wrabyi"),A(d,"class","canvas-frame svelte-1wrabyi"),A(k,"class","panel-icon-btn svelte-1wrabyi"),A(k,"aria-label",E=n[16]==="dark"?"Switch to light theme":"Switch to dark theme"),A(k,"aria-pressed",L=n[16]==="dark"),A(k,"title",z=n[16]==="dark"?"Switch to light theme":"Switch to dark theme"),A(N,"class","panel-sep svelte-1wrabyi"),A(j,"class","panel-icon-btn svelte-1wrabyi"),A(j,"aria-label","Toggle history panel"),A(j,"aria-pressed",n[6]),A(j,"title","History"),A(y,"class","panel-sep svelte-1wrabyi"),A(fe,"class","panel-icon-btn delete-btn svelte-1wrabyi"),A(fe,"aria-label","Delete snapshots"),A(fe,"title","Delete snapshots"),A(b,"class","controls-panel svelte-1wrabyi"),A(l,"class","svelte-1wrabyi")},m(w,S){je(t,w,S),V(w,r,S),je(i,w,S),V(w,o,S),je(s,w,S),V(w,a,S),V(w,l,S),Se&&Se.m(l,null),R(l,c),R(l,d),me&&me.m(d,null),R(d,p),R(d,h),~u&&Te[u].m(h,null),R(l,f),Oe&&Oe.m(l,null),R(l,_),R(l,b),R(b,k),m[v].m(k,null),R(b,U),R(b,N),R(b,I),R(b,j),je(C,j,null),R(b,H),R(b,y),R(b,q),R(b,fe),je(K,fe,null),R(b,ie),je(Y,b,null),R(b,se),x&&x.m(b,null),D=!0,F||(de=[ge(k,"click",Ji.toggle),ge(j,"click",n[34]),ge(fe,"click",n[35]),ge(l,"dragover",Il),ge(l,"drop",n[19])],F=!0)},p(w,S){const P={};!e&&S[0]&64&&(e=!0,P.open=w[6],Io(()=>e=!1)),t.$set(P);const X={};S[0]&8192&&(X.mode=w[13].mode??"delete"),S[0]&8192&&(X.open=w[13].mode!==null),S[0]&8192&&(X.workspaces=w[13].workspaces),S[0]&8192&&(X.loadError=w[13].loadError),i.$set(X);const Q={};S[0]&256&&(Q.open=w[8]),s.$set(Q),w[14]?Se?Se.p(w,S):(Se=Li(w),Se.c(),Se.m(l,c)):Se&&(Se.d(1),Se=null),w[2]!==null&&w[2].title?me?me.p(w,S):(me=Ni(w),me.c(),me.m(d,p)):me&&(me.d(1),me=null);let B=u;u=Ce(w),u===B?~u&&Te[u].p(w,S):(g&&(it(),Ee(Te[B],1,1,()=>{Te[B]=null}),ot()),~u?(g=Te[u],g?g.p(w,S):(g=Te[u]=le[u](w),g.c()),ke(g,1),g.m(h,null)):g=null),w[2]!==null&&w[12]==="manual"?Oe?Oe.p(w,S):(Oe=Pi(w),Oe.c(),Oe.m(l,_)):Oe&&(Oe.d(1),Oe=null);let te=v;v=W(w),v!==te&&(it(),Ee(m[te],1,1,()=>{m[te]=null}),ot(),O=m[v],O||(O=m[v]=he[v](w),O.c()),ke(O,1),O.m(k,null)),(!D||S[0]&65536&&E!==(E=w[16]==="dark"?"Switch to light theme":"Switch to dark theme"))&&A(k,"aria-label",E),(!D||S[0]&65536&&L!==(L=w[16]==="dark"))&&A(k,"aria-pressed",L),(!D||S[0]&65536&&z!==(z=w[16]==="dark"?"Switch to light theme":"Switch to dark theme"))&&A(k,"title",z),(!D||S[0]&64)&&A(j,"aria-pressed",w[6]),w[17].armed||w[17].sent||w[17].error?x?(x.p(w,S),S[0]&131072&&ke(x,1)):(x=Mi(w),x.c(),ke(x,1),x.m(b,null)):x&&(it(),Ee(x,1,1,()=>{x=null}),ot())},i(w){D||(ke(t.$$.fragment,w),ke(i.$$.fragment,w),ke(s.$$.fragment,w),ke(g),ke(O),ke(C.$$.fragment,w),ke(K.$$.fragment,w),ke(Y.$$.fragment,w),ke(x),D=!0)},o(w){Ee(t.$$.fragment,w),Ee(i.$$.fragment,w),Ee(s.$$.fragment,w),Ee(g),Ee(O),Ee(C.$$.fragment,w),Ee(K.$$.fragment,w),Ee(Y.$$.fragment,w),Ee(x),D=!1},d(w){w&&(G(r),G(o),G(a),G(l)),n[27](null),xe(t,w),xe(i,w),n[30](null),xe(s,w),Se&&Se.d(),me&&me.d(),~u&&Te[u].d(),Oe&&Oe.d(),m[v].d(),xe(C),xe(K),xe(Y),x&&x.d(),F=!1,Be(de)}}}function Il(n){var t;(t=n.dataTransfer)!=null&&t.types.includes("Files")&&n.preventDefault()}function zl(n,t,e){let r,i,o,s,a,l,c,d,p,h,u,g,f,_,b,k,v,O;_t(n,Xi,le=>e(26,f=le)),_t(n,_n,le=>e(13,_=le)),_t(n,Qn,le=>e(14,b=le)),_t(n,$n,le=>e(15,k=le)),_t(n,Ji,le=>e(16,v=le)),_t(n,Jn,le=>e(17,O=le));const E=new Map;let L,z,U=0;async function N(le){if(le===void 0){e(5,L=void 0),e(0,z=void 0);return}const Te=E.get(le);if(Te){e(5,L=Te),e(0,z=le);return}const Ce=++U,Oe=await Wn[le].load();Ce===U&&(E.set(le,Oe),e(5,L=Oe),e(0,z=le))}let I=null;Jt(()=>{I=Gs()}),Qt(()=>{I==null||I()});let j=!1,C;function H(){j&&(C==null||C.fetchSnapshots())}let y=!1,q;function fe(le){var Ce;const Te=(Ce=le.dataTransfer)==null?void 0:Ce.files[0];Te&&(le.preventDefault(),e(8,y=!0),q==null||q.acceptFile(Te))}function K(){j&&(C==null||C.fetchSnapshots())}function ie(le){Ve[le?"unshift":"push"](()=>{C=le,e(7,C)})}function Y(le){j=le,e(6,j)}const se=()=>{e(6,j=!1)};function D(le){Ve[le?"unshift":"push"](()=>{q=le,e(9,q)})}const F=()=>{e(8,y=!1)},de=()=>Qr("prev"),oe=()=>Qr("next"),J=()=>{e(6,j=!j)},ze=()=>_n.open("delete"),Se=()=>_n.open("export"),me=()=>{e(8,y=!0)};return n.$$.update=()=>{var le;n.$$.dirty[0]&67108864&&e(2,{presentation:r,driver:i,placeholder:o,currentFrame:s,totalFrames:a,viewport:l,nodeToFrame:c,clickable:d,nodeActions:p,nodeToFrameEnabled:h}=f,r,(e(12,i),e(26,f)),(e(3,o),e(26,f)),(e(1,s),e(26,f)),(e(11,a),e(26,f)),(e(21,l),e(26,f)),(e(22,c),e(26,f)),(e(25,d),e(26,f)),(e(24,p),e(26,f)),(e(23,h),e(26,f))),n.$$.dirty[0]&12&&e(4,u=o!==null?"step-frames-placeholder":(le=r==null?void 0:r.frames[0])==null?void 0:le.type),n.$$.dirty[0]&16&&N(u),n.$$.dirty[0]&65011743&&e(10,g=!z||z!==u?{}:z==="step-frames-placeholder"?o?Wn["step-frames-placeholder"].props({placeholder:o}):{}:r?Wn[z].props({presentation:r,clickable:d,nodeActions:p,nodeToFrameEnabled:h,nodeToFrame:c,viewport:l,currentFrame:s??0}):{})},[z,s,r,o,u,L,j,C,y,q,g,a,i,_,b,k,v,O,H,fe,K,l,c,h,p,d,f,ie,Y,se,D,F,de,oe,J,ze,Se,me]}class Rl extends tt{constructor(t){super(),et(this,t,zl,Ol,Xe,{},null,[-1,-1])}}new Rl({target:document.getElementById("app")});export{kn as _,dn as c,ss as g,no as p};