agent-whiteboard 1.1.0 → 1.2.0

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 (75) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.md +49 -4
  3. package/dist/client/assets/{abnfDiagram-VCTEODGH-CcuBIZ5h.js → abnfDiagram-VCTEODGH-Dj8sd_5g.js} +1 -1
  4. package/dist/client/assets/{architectureDiagram-5GKGNRK7-CpMRoWIY.js → architectureDiagram-5GKGNRK7-B1QyVL0F.js} +1 -1
  5. package/dist/client/assets/{blockDiagram-I7D4REHJ-Dee0m4lz.js → blockDiagram-I7D4REHJ-CmU2SSFe.js} +1 -1
  6. package/dist/client/assets/{c4Diagram-7LVT6UL2-D_qs3YTM.js → c4Diagram-7LVT6UL2-DWmhp77c.js} +1 -1
  7. package/dist/client/assets/channel-C9ni1Via.js +1 -0
  8. package/dist/client/assets/{chunk-2Q5K7J3B-CBwQ-uNF.js → chunk-2Q5K7J3B-CQLo8Sbv.js} +1 -1
  9. package/dist/client/assets/{chunk-5VM5RSS4-yGvVHapR.js → chunk-5VM5RSS4-fJTWmTTt.js} +1 -1
  10. package/dist/client/assets/{chunk-F27PBJKO-BzFUf98n.js → chunk-F27PBJKO-DqzEf5gi.js} +1 -1
  11. package/dist/client/assets/{chunk-IMKFNOWR-D-Zj1GaL.js → chunk-IMKFNOWR-CMamLTz3.js} +1 -1
  12. package/dist/client/assets/{chunk-JWPE2WC7-C8Aj4MVR.js → chunk-JWPE2WC7-tyYPyD43.js} +1 -1
  13. package/dist/client/assets/{chunk-POPQ4Y6H-DZP2a-yV.js → chunk-POPQ4Y6H-XdY4rO_V.js} +1 -1
  14. package/dist/client/assets/{chunk-SVP7TREG-COihS1MQ.js → chunk-SVP7TREG-COvqzqaO.js} +1 -1
  15. package/dist/client/assets/{chunk-TICWLB2K-DNZTRqyJ.js → chunk-TICWLB2K-BsJSFuPC.js} +1 -1
  16. package/dist/client/assets/{chunk-XXDRQBXY-BC_9L4PF.js → chunk-XXDRQBXY-HfVrYBJb.js} +1 -1
  17. package/dist/client/assets/classDiagram-ZZMXUADV-DktNEiGC.js +1 -0
  18. package/dist/client/assets/classDiagram-v2-VYDZK3BY-DktNEiGC.js +1 -0
  19. package/dist/client/assets/{cose-bilkent-JH36ORCC-DrJ8c1cV.js → cose-bilkent-JH36ORCC-UXGdwSjS.js} +1 -1
  20. package/dist/client/assets/{cynefin-OW5HDTMX-CMVAR4fd.js → cynefin-OW5HDTMX-PWlPYnpn.js} +1 -1
  21. package/dist/client/assets/{cynefinDiagram-5FMLGOSQ-CdAQ0Lst.js → cynefinDiagram-5FMLGOSQ-CYE5H1wR.js} +1 -1
  22. package/dist/client/assets/{dagre-GXQ25YYZ-CybK0L_u.js → dagre-GXQ25YYZ-DaknBOKq.js} +1 -1
  23. package/dist/client/assets/{diagram-S7CK7UJ4-CHjTv5Sr.js → diagram-S7CK7UJ4-Dz7rZHxF.js} +1 -1
  24. package/dist/client/assets/{diagram-UQ7AKVKN-DfypPsGR.js → diagram-UQ7AKVKN-DzCi6tiS.js} +1 -1
  25. package/dist/client/assets/{diagram-VSXAHHWV-DHsmmCug.js → diagram-VSXAHHWV-TlUzhXgv.js} +1 -1
  26. package/dist/client/assets/{diagram-VX7I27RA-CHZoTi9k.js → diagram-VX7I27RA-Ds7jdzK7.js} +1 -1
  27. package/dist/client/assets/{diagram-Z3DM3KII-Ceb2h13y.js → diagram-Z3DM3KII-C--JD7cf.js} +1 -1
  28. package/dist/client/assets/{ebnfDiagram-PWID7BFC-BlZ247wB.js → ebnfDiagram-PWID7BFC-Dw5OM-dL.js} +1 -1
  29. package/dist/client/assets/{erDiagram-RLTQ6QDP-BQdw-U-S.js → erDiagram-RLTQ6QDP-DXalBHjA.js} +1 -1
  30. package/dist/client/assets/{flowDiagram-HODETNUW-DjUWHA94.js → flowDiagram-HODETNUW-DcI3UqyE.js} +1 -1
  31. package/dist/client/assets/{ganttDiagram-EL5Y4UJY-CXu2s5vq.js → ganttDiagram-EL5Y4UJY-DyrkIo6c.js} +1 -1
  32. package/dist/client/assets/{gitGraphDiagram-WWUBYQGX-CwlsB28k.js → gitGraphDiagram-WWUBYQGX-fJKfGRcg.js} +1 -1
  33. package/dist/client/assets/index-CIhkXT_z.js +19 -0
  34. package/dist/client/assets/index-DEiH2AE7.css +1 -0
  35. package/dist/client/assets/{infoDiagram-27XIBGKW-C7nvTbsQ.js → infoDiagram-27XIBGKW-Cijiqswb.js} +1 -1
  36. package/dist/client/assets/{ishikawaDiagram-5VMMS53U-DGFXG874.js → ishikawaDiagram-5VMMS53U-C1WqWU2l.js} +1 -1
  37. package/dist/client/assets/{journeyDiagram-3NMN7TZE-BDdRMcmq.js → journeyDiagram-3NMN7TZE-7j05mbLR.js} +1 -1
  38. package/dist/client/assets/{kanban-definition-UXKFOSKX-C3fnvfeO.js → kanban-definition-UXKFOSKX-D5mGDfs_.js} +1 -1
  39. package/dist/client/assets/{layout-BfegUiqt.js → layout-KEin06-H.js} +1 -1
  40. package/dist/client/assets/{mermaid.core-DioArgDk.js → mermaid.core-CLvSDmrA.js} +5 -5
  41. package/dist/client/assets/{mindmap-definition-YA3MSWOX-CFCbAUC0.js → mindmap-definition-YA3MSWOX-BsCqKd_d.js} +1 -1
  42. package/dist/client/assets/{pegDiagram-XKGWAZYB-B1ULJH6S.js → pegDiagram-XKGWAZYB-Du5lDU3W.js} +1 -1
  43. package/dist/client/assets/{pieDiagram-E7YTZNPT-B9H3HosU.js → pieDiagram-E7YTZNPT-hjv5Ao6B.js} +1 -1
  44. package/dist/client/assets/{quadrantDiagram-AXDQQJYC-eWc3HHkM.js → quadrantDiagram-AXDQQJYC-DNon8LWK.js} +1 -1
  45. package/dist/client/assets/{railroadDiagram-O6MQD6OU-DT7c-KwW.js → railroadDiagram-O6MQD6OU-yNZz2zxo.js} +1 -1
  46. package/dist/client/assets/{requirementDiagram-BXWQKSXE-Dk1yVWV5.js → requirementDiagram-BXWQKSXE-CZiiEUHW.js} +1 -1
  47. package/dist/client/assets/{sankeyDiagram-P5KCCOFB-B5a__hiX.js → sankeyDiagram-P5KCCOFB-D-u8ZQUV.js} +1 -1
  48. package/dist/client/assets/{sequenceDiagram-WJ2MYXX4-CkCIByRS.js → sequenceDiagram-WJ2MYXX4-BxjTf3q9.js} +1 -1
  49. package/dist/client/assets/{sizeCapture-INFHLROL-CnZIW94r.js → sizeCapture-INFHLROL-Dt4Wg8C5.js} +1 -1
  50. package/dist/client/assets/{stateDiagram-D77RDMKH-89Sfaoz9.js → stateDiagram-D77RDMKH-B8BM6dln.js} +1 -1
  51. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-MJauX84T.js +1 -0
  52. package/dist/client/assets/{swimlanes-42K2YHIH-C7m88XIh.js → swimlanes-42K2YHIH-eGWrsWAA.js} +1 -1
  53. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-BYFu8tyL.js +8 -0
  54. package/dist/client/assets/{timeline-definition-24CTP7MA-BHKHgHq9.js → timeline-definition-24CTP7MA-CAM-3Qj9.js} +1 -1
  55. package/dist/client/assets/{vennDiagram-4TSXK5OY-BqKaRdWu.js → vennDiagram-4TSXK5OY-CuFEwwD0.js} +1 -1
  56. package/dist/client/assets/{wardleyDiagram-VM6X3IG4-XiDVRZV5.js → wardleyDiagram-VM6X3IG4-DI5yCVh0.js} +1 -1
  57. package/dist/client/assets/{xychartDiagram-S5SC5T6Z-CxP4dIVd.js → xychartDiagram-S5SC5T6Z-BI0Bn-OQ.js} +1 -1
  58. package/dist/client/index.html +2 -2
  59. package/dist/server/app.js +2 -0
  60. package/dist/server/export-html.js +4 -0
  61. package/dist/server/mcp.js +19 -4
  62. package/dist/server/quiz-submission.js +116 -0
  63. package/dist/server/quiz.js +110 -0
  64. package/dist/server/render-core.js +3 -2
  65. package/dist/server/routes/quiz.js +12 -0
  66. package/dist/server/routes/render.js +4 -4
  67. package/dist/server/validate.js +14 -0
  68. package/package.json +1 -1
  69. package/dist/client/assets/channel-9qggtmY_.js +0 -1
  70. package/dist/client/assets/classDiagram-ZZMXUADV-BUnGzX-0.js +0 -1
  71. package/dist/client/assets/classDiagram-v2-VYDZK3BY-BUnGzX-0.js +0 -1
  72. package/dist/client/assets/index-CFelVSRu.js +0 -19
  73. package/dist/client/assets/index-GF8Uj64S.css +0 -1
  74. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-CP--cdl-.js +0 -1
  75. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-DmG2scPu.js +0 -8
@@ -1,19 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mermaid.core-DioArgDk.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 so=Object.defineProperty;var ao=(n,t,e)=>t in n?so(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var On=(n,t,e)=>ao(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 ge(){}function wr(n,t){for(const e in t)n[e]=t[e];return n}function Oi(n){return n()}function vr(){return Object.create(null)}function Be(n){n.forEach(Oi)}function Yn(n){return typeof n=="function"}function Qe(n,t){return n!=n?t==t:n!==t||n&&typeof n=="object"||typeof n=="function"}function lo(n){return Object.keys(n).length===0}function Ii(n,...t){if(n==null){for(const r of t)r(void 0);return ge}const e=n.subscribe(...t);return e.unsubscribe?()=>e.unsubscribe():e}function mt(n){let t;return Ii(n,e=>t=e)(),t}function _t(n,t,e){n.$$.on_destroy.push(Ii(t,e))}function pn(n){return n&&Yn(n.destroy)?n.destroy:ge}const co=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function F(n,t){n.appendChild(t)}function $(n,t,e){n.insertBefore(t,e||null)}function Q(n){n.parentNode&&n.parentNode.removeChild(n)}function V(n){return document.createElement(n)}function ct(n){return document.createElementNS("http://www.w3.org/2000/svg",n)}function se(n){return document.createTextNode(n)}function de(){return se(" ")}function ut(){return se("")}function ve(n,t,e,r){return n.addEventListener(t,e,r),()=>n.removeEventListener(t,e,r)}function uo(n){return function(t){return t.stopPropagation(),n.call(this,t)}}function zi(n){return function(t){t.target===this&&n.call(this,t)}}function O(n,t,e){e==null?n.removeAttribute(t):n.getAttribute(t)!==e&&n.setAttribute(t,e)}function fo(n){return Array.from(n.childNodes)}function Se(n,t){t=""+t,n.data!==t&&(n.data=t)}function kr(n,t){n.value=t??""}function gt(n,t,e,r){e==null?n.style.removeProperty(t):n.style.setProperty(t,e,"")}function tt(n,t,e){n.classList.toggle(t,!!e)}function ho(n,t,{bubbles:e=!1,cancelable:r=!1}={}){return new CustomEvent(n,{detail:t,bubbles:e,cancelable:r})}function Er(n,t){return new n(t)}let Xt;function Vt(n){Xt=n}function mn(){if(!Xt)throw new Error("Function called outside component initialization");return Xt}function Kt(n){mn().$$.on_mount.push(n)}function _n(n){mn().$$.after_update.push(n)}function Jt(n){mn().$$.on_destroy.push(n)}function gn(){const n=mn();return(t,e,{cancelable:r=!1}={})=>{const i=n.$$.callbacks[t];if(i){const o=ho(t,e,{cancelable:r});return i.slice().forEach(s=>{s.call(n,o)}),!o.defaultPrevented}return!0}}const Pt=[],ft=[];let Ft=[];const jn=[],po=Promise.resolve();let Wn=!1;function mo(){Wn||(Wn=!0,po.then(Ri))}function Hn(n){Ft.push(n)}function _o(n){jn.push(n)}const In=new Set;let Lt=0;function Ri(){if(Lt!==0)return;const n=Xt;do{try{for(;Lt<Pt.length;){const t=Pt[Lt];Lt++,Vt(t),go(t.$$)}}catch(t){throw Pt.length=0,Lt=0,t}for(Vt(null),Pt.length=0,Lt=0;ft.length;)ft.pop()();for(let t=0;t<Ft.length;t+=1){const e=Ft[t];In.has(e)||(In.add(e),e())}Ft.length=0}while(Pt.length);for(;jn.length;)jn.pop()();Wn=!1,In.clear(),Vt(n)}function go(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(Hn)}}function bo(n){const t=[],e=[];Ft.forEach(r=>n.indexOf(r)===-1?t.push(r):e.push(r)),e.forEach(r=>r()),Ft=t}const dn=new Set;let At;function nt(){At={r:0,c:[],p:At}}function rt(){At.r||Be(At.c),At=At.p}function Ee(n,t){n&&n.i&&(dn.delete(n),n.i(t))}function Te(n,t,e,r){if(n&&n.o){if(dn.has(n))return;dn.add(n),At.c.push(()=>{dn.delete(n),r&&(e&&n.d(1),r())}),n.o(t)}else r&&r()}function it(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function qn(n,t){n.d(1),t.delete(n.key)}function Vn(n,t){Te(n,1,1,()=>{t.delete(n.key)})}function Bt(n,t,e,r,i,o,s,a,l,p,h,m){let d=n.length,c=o.length,g=d;const u={};for(;g--;)u[n[g].key]=g;const b=[],_=new Map,w=new Map,v=[];for(g=c;g--;){const z=m(i,o,g),U=e(z);let N=s.get(U);N?v.push(()=>N.p(z,t)):(N=p(U,z),N.c()),_.set(U,b[g]=N),U in u&&w.set(U,Math.abs(g-u[U]))}const A=new Set,C=new Set;function x(z){Ee(z,1),z.m(a,h),s.set(z.key,z),h=z.first,c--}for(;d&&c;){const z=b[c-1],U=n[d-1],N=z.key,I=U.key;z===U?(h=z.first,d--,c--):_.has(I)?!s.has(N)||A.has(N)?x(z):C.has(I)?d--:w.get(N)>w.get(I)?(C.add(N),x(z)):(A.add(I),d--):(l(U,s),d--)}for(;d--;){const z=n[d];_.has(z.key)||l(z,s)}for(;c;)x(b[c-1]);return Be(v),b}function Sr(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 Tr(n){return typeof n=="object"&&n!==null?n:{}}function yo(n,t,e){const r=n.$$.props[t];r!==void 0&&(n.$$.bound[r]=e,e(n.$$.ctx[r]))}function Ge(n){n&&n.c()}function je(n,t,e){const{fragment:r,after_update:i}=n.$$;r&&r.m(t,e),Hn(()=>{const o=n.$$.on_mount.map(Oi).filter(Yn);n.$$.on_destroy?n.$$.on_destroy.push(...o):Be(o),n.$$.on_mount=[]}),i.forEach(Hn)}function We(n,t){const e=n.$$;e.fragment!==null&&(bo(e.after_update),Be(e.on_destroy),e.fragment&&e.fragment.d(t),e.on_destroy=e.fragment=null,e.ctx=[])}function wo(n,t){n.$$.dirty[0]===-1&&(Pt.push(n),mo(),n.$$.dirty.fill(0)),n.$$.dirty[t/31|0]|=1<<t%31}function ot(n,t,e,r,i,o,s=null,a=[-1]){const l=Xt;Vt(n);const p=n.$$={fragment:null,ctx:[],props:o,update:ge,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(p.root);let h=!1;if(p.ctx=e?e(n,t.props||{},(m,d,...c)=>{const g=c.length?c[0]:d;return p.ctx&&i(p.ctx[m],p.ctx[m]=g)&&(!p.skip_bound&&p.bound[m]&&p.bound[m](g),h&&wo(n,m)),d}):[],p.update(),h=!0,Be(p.before_update),p.fragment=r?r(p.ctx):!1,t.target){if(t.hydrate){const m=fo(t.target);p.fragment&&p.fragment.l(m),m.forEach(Q)}else p.fragment&&p.fragment.c();t.intro&&Ee(n.$$.fragment),je(n,t.target,t.anchor),Ri()}Vt(l)}class st{constructor(){On(this,"$$");On(this,"$$set")}$destroy(){We(this,1),this.$destroy=ge}$on(t,e){if(!Yn(e))return ge;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&&!lo(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const vo="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(vo);const ko='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';function bn(n,t={}){const e=document.activeElement;function r(){return Array.from(n.querySelectorAll(ko))}function i(s){var h;if(s.key==="Escape"){(h=t.onEscape)==null||h.call(t);return}if(s.key!=="Tab")return;const a=r();if(a.length===0)return;const l=a[0],p=a[a.length-1];s.shiftKey&&document.activeElement===l?(s.preventDefault(),p.focus()):!s.shiftKey&&document.activeElement===p&&(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 Xn(){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 Ar(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 Eo(n){let t,e=(n[0]??"—")+"",r,i,o,s,a,l,p,h=Ar(n[2])+"",m;return{c(){t=V("span"),r=se(e),i=de(),o=V("span"),s=V("span"),a=se(n[1]),l=de(),p=V("span"),m=se(h),O(t,"class","snapshot-title svelte-14g4p14"),O(s,"class","type-badge svelte-14g4p14"),O(p,"class","snapshot-time svelte-14g4p14"),O(o,"class","snapshot-meta svelte-14g4p14")},m(d,c){$(d,t,c),F(t,r),$(d,i,c),$(d,o,c),F(o,s),F(s,a),F(o,l),F(o,p),F(p,m)},p(d,[c]){c&1&&e!==(e=(d[0]??"—")+"")&&Se(r,e),c&2&&Se(a,d[1]),c&4&&h!==(h=Ar(d[2])+"")&&Se(m,h)},i:ge,o:ge,d(d){d&&(Q(t),Q(i),Q(o))}}}function So(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 Li extends st{constructor(t){super(),ot(this,t,So,Eo,Qe,{title:0,type:1,timestamp:2})}}function Cr(n,t,e){const r=n.slice();return r[13]=t[e],r}function Or(n,t,e){const r=n.slice();return r[16]=t[e],r}function Ir(n){let t,e,r,i,o,s,a,l,p,h,m,d,c,g,u,b,_,w,v;function A(I,W){return I[4]?Ao:To}let C=A(n),x=C(n);const z=[zo,Io,Oo,Co],U=[];function N(I,W){return I[2]?0:I[3]?1:I[5]?3:2}return u=N(n),b=U[u]=z[u](n),{c(){t=V("div"),e=V("div"),r=V("span"),r.textContent="History",i=de(),o=V("div"),s=V("button"),x.c(),p=de(),h=V("div"),m=de(),d=V("button"),d.textContent="✕",c=de(),g=V("div"),b.c(),O(r,"class","panel-title svelte-r3bne1"),O(s,"class","action-btn svelte-r3bne1"),O(s,"aria-label",a=n[4]?"Unlock history panel (stays open)":"Lock history panel (stays open)"),O(s,"aria-pressed",n[4]),O(s,"title",l=n[4]?"Locked — panel stays open after load":"Unlocked — panel closes after load"),tt(s,"locked",n[4]),O(h,"class","header-sep svelte-r3bne1"),O(h,"aria-hidden","true"),O(d,"class","close-btn svelte-r3bne1"),O(d,"aria-label","Close history panel"),O(o,"class","header-actions svelte-r3bne1"),O(e,"class","panel-header svelte-r3bne1"),O(g,"class","panel-body svelte-r3bne1"),O(t,"class","history-panel svelte-r3bne1"),O(t,"role","dialog"),O(t,"aria-modal","true"),O(t,"aria-label","Snapshot history"),O(t,"tabindex","-1")},m(I,W){$(I,t,W),F(t,e),F(e,r),F(e,i),F(e,o),F(o,s),x.m(s,null),F(o,p),F(o,h),F(o,m),F(o,d),F(t,c),F(t,g),U[u].m(g,null),_=!0,w||(v=[ve(s,"click",n[9]),ve(d,"click",n[10]),pn(bn.call(null,t,{onEscape:n[12]}))],w=!0)},p(I,W){C!==(C=A(I))&&(x.d(1),x=C(I),x&&(x.c(),x.m(s,null))),(!_||W&16&&a!==(a=I[4]?"Unlock history panel (stays open)":"Lock history panel (stays open)"))&&O(s,"aria-label",a),(!_||W&16)&&O(s,"aria-pressed",I[4]),(!_||W&16&&l!==(l=I[4]?"Locked — panel stays open after load":"Unlocked — panel closes after load"))&&O(s,"title",l),(!_||W&16)&&tt(s,"locked",I[4]);let T=u;u=N(I),u===T?U[u].p(I,W):(nt(),Te(U[T],1,1,()=>{U[T]=null}),rt(),b=U[u],b?b.p(I,W):(b=U[u]=z[u](I),b.c()),Ee(b,1),b.m(g,null))},i(I){_||(Ee(b),_=!0)},o(I){Te(b),_=!1},d(I){I&&Q(t),x.d(),U[u].d(),w=!1,Be(v)}}}function To(n){let t,e,r;return{c(){t=ct("svg"),e=ct("rect"),r=ct("path"),O(e,"x","3"),O(e,"y","11"),O(e,"width","18"),O(e,"height","11"),O(e,"rx","2"),O(r,"d","M7 11V7a5 5 0 0 1 9.9-1"),O(t,"width","13"),O(t,"height","13"),O(t,"viewBox","0 0 24 24"),O(t,"fill","none"),O(t,"stroke","currentColor"),O(t,"stroke-width","2.5"),O(t,"stroke-linecap","round"),O(t,"stroke-linejoin","round"),O(t,"aria-hidden","true")},m(i,o){$(i,t,o),F(t,e),F(t,r)},d(i){i&&Q(t)}}}function Ao(n){let t,e,r;return{c(){t=ct("svg"),e=ct("rect"),r=ct("path"),O(e,"x","3"),O(e,"y","11"),O(e,"width","18"),O(e,"height","11"),O(e,"rx","2"),O(r,"d","M7 11V7a5 5 0 0 1 10 0v4"),O(t,"width","13"),O(t,"height","13"),O(t,"viewBox","0 0 24 24"),O(t,"fill","none"),O(t,"stroke","currentColor"),O(t,"stroke-width","2.5"),O(t,"stroke-linecap","round"),O(t,"stroke-linejoin","round"),O(t,"aria-hidden","true")},m(i,o){$(i,t,o),F(t,e),F(t,r)},d(i){i&&Q(t)}}}function Co(n){let t=[],e=new Map,r,i,o=it(n[1]);const s=a=>a[13].name;for(let a=0;a<o.length;a+=1){let l=Cr(n,o,a),p=s(l);e.set(p,t[a]=Lr(p,l))}return{c(){for(let a=0;a<t.length;a+=1)t[a].c();r=ut()},m(a,l){for(let p=0;p<t.length;p+=1)t[p]&&t[p].m(a,l);$(a,r,l),i=!0},p(a,l){l&130&&(o=it(a[1]),nt(),t=Bt(t,l,s,1,a,o,e,r.parentNode,Vn,Lr,r,Cr),rt())},i(a){if(!i){for(let l=0;l<o.length;l+=1)Ee(t[l]);i=!0}},o(a){for(let l=0;l<t.length;l+=1)Te(t[l]);i=!1},d(a){a&&Q(r);for(let l=0;l<t.length;l+=1)t[l].d(a)}}}function Oo(n){let t;return{c(){t=V("p"),t.textContent="No snapshots yet.",O(t,"class","panel-message svelte-r3bne1")},m(e,r){$(e,t,r)},p:ge,i:ge,o:ge,d(e){e&&Q(t)}}}function Io(n){let t,e;return{c(){t=V("p"),e=se(n[3]),O(t,"class","panel-message panel-error svelte-r3bne1")},m(r,i){$(r,t,i),F(t,e)},p(r,i){i&8&&Se(e,r[3])},i:ge,o:ge,d(r){r&&Q(t)}}}function zo(n){let t;return{c(){t=V("p"),t.textContent="Loading…",O(t,"class","panel-message svelte-r3bne1")},m(e,r){$(e,t,r)},p:ge,i:ge,o:ge,d(e){e&&Q(t)}}}function zr(n){let t;return{c(){t=V("span"),t.textContent="current",O(t,"class","current-badge svelte-r3bne1")},m(e,r){$(e,t,r)},d(e){e&&Q(t)}}}function Rr(n,t){let e,r,i,o,s,a,l;i=new Li({props:{title:t[16].title,type:t[16].type,timestamp:t[16].timestamp}});function p(){return t[11](t[13],t[16])}return{key:n,first:null,c(){e=V("li"),r=V("button"),Ge(i.$$.fragment),o=de(),O(r,"class","snapshot-row svelte-r3bne1"),O(e,"class","snapshot-item svelte-r3bne1"),this.first=e},m(h,m){$(h,e,m),F(e,r),je(i,r,null),F(e,o),s=!0,a||(l=ve(r,"click",p),a=!0)},p(h,m){t=h;const d={};m&2&&(d.title=t[16].title),m&2&&(d.type=t[16].type),m&2&&(d.timestamp=t[16].timestamp),i.$set(d)},i(h){s||(Ee(i.$$.fragment,h),s=!0)},o(h){Te(i.$$.fragment,h),s=!1},d(h){h&&Q(e),We(i),a=!1,l()}}}function Lr(n,t){let e,r,i,o=t[13].name+"",s,a,l,p,h=[],m=new Map,d,c,g,u=t[13].isCurrent&&zr(),b=it(t[13].snapshots);const _=w=>w[13].name+"/"+w[16].filename;for(let w=0;w<b.length;w+=1){let v=Or(t,b,w),A=_(v);m.set(A,h[w]=Rr(A,v))}return{key:n,first:null,c(){e=V("details"),r=V("summary"),i=V("span"),s=se(o),a=de(),u&&u.c(),l=de(),p=V("ul");for(let w=0;w<h.length;w+=1)h[w].c();d=de(),O(i,"class","workspace-name svelte-r3bne1"),O(r,"class","workspace-summary svelte-r3bne1"),O(p,"class","snapshot-list svelte-r3bne1"),O(e,"class","workspace-group svelte-r3bne1"),e.open=c=t[13].isCurrent,this.first=e},m(w,v){$(w,e,v),F(e,r),F(r,i),F(i,s),F(r,a),u&&u.m(r,null),F(e,l),F(e,p);for(let A=0;A<h.length;A+=1)h[A]&&h[A].m(p,null);F(e,d),g=!0},p(w,v){t=w,(!g||v&2)&&o!==(o=t[13].name+"")&&Se(s,o),t[13].isCurrent?u||(u=zr(),u.c(),u.m(r,null)):u&&(u.d(1),u=null),v&130&&(b=it(t[13].snapshots),nt(),h=Bt(h,v,_,1,t,b,m,p,Vn,Rr,null,Or),rt()),(!g||v&2&&c!==(c=t[13].isCurrent))&&(e.open=c)},i(w){if(!g){for(let v=0;v<b.length;v+=1)Ee(h[v]);g=!0}},o(w){for(let v=0;v<h.length;v+=1)Te(h[v]);g=!1},d(w){w&&Q(e),u&&u.d();for(let v=0;v<h.length;v+=1)h[v].d()}}}function Ro(n){let t,e,r=n[0]&&Ir(n);return{c(){r&&r.c(),t=ut()},m(i,o){r&&r.m(i,o),$(i,t,o),e=!0},p(i,[o]){i[0]?r?(r.p(i,o),o&1&&Ee(r,1)):(r=Ir(i),r.c(),Ee(r,1),r.m(t.parentNode,t)):r&&(nt(),Te(r,1,1,()=>{r=null}),rt())},i(i){e||(Ee(r),e=!0)},o(i){Te(r),e=!1},d(i){i&&Q(t),r&&r.d(i)}}}function Lo(n,t,e){let r,{open:i=!1}=t,o=[],s=!1,a="",l=!1;const p=gn();async function h(){e(2,s=!0),e(3,a="");const b=await Xn();b.ok?e(1,o=b.workspaces):e(3,a=b.error),e(2,s=!1)}async function m(b,_){try{await fetch("/snapshots/load",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspace:b,filename:_})})}catch(w){console.error("[agent-whiteboard] failed to load snapshot:",w)}l||p("close")}const d=()=>{e(4,l=!l)},c=()=>p("close"),g=(b,_)=>m(b.name,_.filename),u=()=>p("close");return n.$$set=b=>{"open"in b&&e(0,i=b.open)},n.$$.update=()=>{n.$$.dirty&1&&(i||e(4,l=!1)),n.$$.dirty&1&&i&&h(),n.$$.dirty&2&&e(5,r=o.some(b=>b.snapshots.length>0))},[i,o,s,a,l,r,p,m,h,d,c,g,u]}class Do extends st{constructor(t){super(),ot(this,t,Lo,Ro,Qe,{open:0,fetchSnapshots:8})}get fetchSnapshots(){return this.$$.ctx[8]}}async function Di(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 No(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 Po(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 Dr(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 Di(t)}async function Nr(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 Di(t)}const{Map:Ni}=co;function Pr(n,t,e){const r=n.slice();return r[37]=t[e],r}function xr(n,t,e){const r=n.slice();return r[34]=t[e],r}function Fr(n){let t,e,r,i,o,s,a,l,p,h,m,d,c,g,u,b,_,w=n[13]&&Mr(n);function v(I,W){if(I[4]===1)return Fo;if(I[5])return xo}let A=v(n),C=A&&A(n);const x=[jo,Uo,Bo,Mo],z=[];function U(I,W){return I[3]?0:I[12]?1:I[4]===1?2:I[5]?3:-1}~(h=U(n))&&(m=z[h]=x[h](n));let N=n[4]===2&&!n[12]&&Hr(n);return{c(){t=V("div"),e=V("div"),r=V("div"),w&&w.c(),i=de(),o=V("span"),C&&C.c(),s=de(),a=V("button"),a.textContent="✕",l=de(),p=V("div"),m&&m.c(),d=de(),N&&N.c(),O(o,"class","modal-title svelte-105gz4t"),O(a,"class","modal-close-btn svelte-105gz4t"),O(a,"aria-label","Close"),O(r,"class","modal-header svelte-105gz4t"),O(p,"class","modal-body svelte-105gz4t"),O(e,"class",c="modal mode-"+n[0]+" svelte-105gz4t"),O(e,"role","dialog"),O(e,"aria-modal","true"),O(e,"aria-label",g=n[14]+" snapshots"),O(e,"tabindex","-1"),O(t,"class","modal-overlay svelte-105gz4t")},m(I,W){$(I,t,W),F(t,e),F(e,r),w&&w.m(r,null),F(r,i),F(r,o),C&&C.m(o,null),F(r,s),F(r,a),F(e,l),F(e,p),~h&&z[h].m(p,null),F(e,d),N&&N.m(e,null),u=!0,b||(_=[ve(a,"click",n[17]),pn(bn.call(null,e,{onEscape:n[17]})),ve(t,"click",zi(n[17]))],b=!0)},p(I,W){I[13]?w?w.p(I,W):(w=Mr(I),w.c(),w.m(r,i)):w&&(w.d(1),w=null),A===(A=v(I))&&C?C.p(I,W):(C&&C.d(1),C=A&&A(I),C&&(C.c(),C.m(o,null)));let T=h;h=U(I),h===T?~h&&z[h].p(I,W):(m&&(nt(),Te(z[T],1,1,()=>{z[T]=null}),rt()),~h?(m=z[h],m?m.p(I,W):(m=z[h]=x[h](I),m.c()),Ee(m,1),m.m(p,null)):m=null),I[4]===2&&!I[12]?N?N.p(I,W):(N=Hr(I),N.c(),N.m(e,null)):N&&(N.d(1),N=null),(!u||W[0]&1&&c!==(c="modal mode-"+I[0]+" svelte-105gz4t"))&&O(e,"class",c),(!u||W[0]&16384&&g!==(g=I[14]+" snapshots"))&&O(e,"aria-label",g)},i(I){u||(Ee(m),u=!0)},o(I){Te(m),u=!1},d(I){I&&Q(t),w&&w.d(),C&&C.d(),~h&&z[h].d(),N&&N.d(),b=!1,Be(_)}}}function Mr(n){let t,e,r;return{c(){t=V("button"),t.textContent="←",O(t,"class","modal-back-btn svelte-105gz4t"),O(t,"aria-label","Back")},m(i,o){$(i,t,o),e||(r=ve(t,"click",n[16]),e=!0)},p:ge,d(i){i&&Q(t),e=!1,r()}}}function xo(n){let t=n[5].name+"",e;return{c(){e=se(t)},m(r,i){$(r,e,i)},p(r,i){i[0]&32&&t!==(t=r[5].name+"")&&Se(e,t)},d(r){r&&Q(e)}}}function Fo(n){let t,e;return{c(){t=se(n[14]),e=se(" — choose a workspace")},m(r,i){$(r,t,i),$(r,e,i)},p(r,i){i[0]&16384&&Se(t,r[14])},d(r){r&&(Q(t),Q(e))}}}function Mo(n){let t,e,r,i,o,s,a,l,p,h,m,d=[],c=new Ni,g,u,b,_,w,v=n[0]==="export"&&Br(n);function A(I,W){return I[0]==="delete"&&I[7]?Ho:Wo}let C=A(n),x=C(n),z=it(n[5].snapshots);const U=I=>I[37].filename;for(let I=0;I<z.length;I+=1){let W=Pr(n,z,I),T=U(W);c.set(T,d[I]=Ur(T,W))}let N=n[11]&&jr(n);return{c(){t=V("p"),e=se("Step 2 of 2 — "),r=se(n[0]),i=se(" the whole workspace, or select individual snapshots below."),o=de(),v&&v.c(),s=de(),a=V("button"),x.c(),l=de(),p=V("div"),p.textContent="or select individual snapshots",h=de(),m=V("ul");for(let I=0;I<d.length;I+=1)d[I].c();g=de(),N&&N.c(),u=ut(),O(t,"class","modal-step-hint svelte-105gz4t"),O(a,"class","whole-workspace-action svelte-105gz4t"),a.disabled=n[10],O(p,"class","modal-divider svelte-105gz4t"),O(m,"class","modal-snapshot-list svelte-105gz4t")},m(I,W){$(I,t,W),F(t,e),F(t,r),F(t,i),$(I,o,W),v&&v.m(I,W),$(I,s,W),$(I,a,W),x.m(a,null),$(I,l,W),$(I,p,W),$(I,h,W),$(I,m,W);for(let T=0;T<d.length;T+=1)d[T]&&d[T].m(m,null);$(I,g,W),N&&N.m(I,W),$(I,u,W),b=!0,_||(w=ve(a,"click",n[19]),_=!0)},p(I,W){(!b||W[0]&1)&&Se(r,I[0]),I[0]==="export"?v?v.p(I,W):(v=Br(I),v.c(),v.m(s.parentNode,s)):v&&(v.d(1),v=null),C===(C=A(I))&&x?x.p(I,W):(x.d(1),x=C(I),x&&(x.c(),x.m(a,null))),(!b||W[0]&1024)&&(a.disabled=I[10]),W[0]&262240&&(z=it(I[5].snapshots),nt(),d=Bt(d,W,U,1,I,z,c,m,Vn,Ur,null,Pr),rt()),I[11]?N?N.p(I,W):(N=jr(I),N.c(),N.m(u.parentNode,u)):N&&(N.d(1),N=null)},i(I){if(!b){for(let W=0;W<z.length;W+=1)Ee(d[W]);b=!0}},o(I){for(let W=0;W<d.length;W+=1)Te(d[W]);b=!1},d(I){I&&(Q(t),Q(o),Q(s),Q(a),Q(l),Q(p),Q(h),Q(m),Q(g),Q(u)),v&&v.d(I),x.d();for(let W=0;W<d.length;W+=1)d[W].d();N&&N.d(I),_=!1,w()}}}function Bo(n){let t,e,r,i,o,s=[],a=new Ni,l,p=it(n[2]);const h=m=>m[34].name;for(let m=0;m<p.length;m+=1){let d=xr(n,p,m),c=h(d);a.set(c,s[m]=Wr(c,d))}return{c(){t=V("p"),e=se("Step 1 of 2 — pick which workspace's snapshots to "),r=se(n[0]),i=se("."),o=de();for(let m=0;m<s.length;m+=1)s[m].c();l=ut(),O(t,"class","modal-step-hint svelte-105gz4t")},m(m,d){$(m,t,d),F(t,e),F(t,r),F(t,i),$(m,o,d);for(let c=0;c<s.length;c+=1)s[c]&&s[c].m(m,d);$(m,l,d)},p(m,d){d[0]&1&&Se(r,m[0]),d[0]&32772&&(p=it(m[2]),s=Bt(s,d,h,1,m,p,a,l.parentNode,qn,Wr,l,xr))},i:ge,o:ge,d(m){m&&(Q(t),Q(o),Q(l));for(let d=0;d<s.length;d+=1)s[d].d(m)}}}function Uo(n){let t,e,r,i,o;return{c(){t=V("div"),e=V("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=de(),i=V("span"),o=se(n[12]),O(e,"class","check-circle svelte-105gz4t"),O(t,"class","modal-confirm svelte-105gz4t")},m(s,a){$(s,t,a),F(t,e),F(t,r),F(t,i),F(i,o)},p(s,a){a[0]&4096&&Se(o,s[12])},i:ge,o:ge,d(s){s&&Q(t)}}}function jo(n){let t,e,r;return{c(){t=V("p"),e=se("Failed to load workspaces: "),r=se(n[3]),O(t,"class","modal-error svelte-105gz4t")},m(i,o){$(i,t,o),F(t,e),F(t,r)},p(i,o){o[0]&8&&Se(r,i[3])},i:ge,o:ge,d(i){i&&Q(t)}}}function Br(n){let t,e,r,i,o,s,a,l,p,h;return{c(){t=V("div"),e=V("button"),r=se("HTML"),o=de(),s=V("button"),a=se("Zip (for import)"),O(e,"type","button"),O(e,"class","format-toggle-btn svelte-105gz4t"),O(e,"aria-pressed",i=n[9]==="html"),tt(e,"active",n[9]==="html"),O(s,"type","button"),O(s,"class","format-toggle-btn svelte-105gz4t"),O(s,"aria-pressed",l=n[9]==="zip"),tt(s,"active",n[9]==="zip"),O(t,"class","format-toggle svelte-105gz4t"),O(t,"role","group"),O(t,"aria-label","Export format")},m(m,d){$(m,t,d),F(t,e),F(e,r),F(t,o),F(t,s),F(s,a),p||(h=[ve(e,"click",n[23]),ve(s,"click",n[24])],p=!0)},p(m,d){d[0]&512&&i!==(i=m[9]==="html")&&O(e,"aria-pressed",i),d[0]&512&&tt(e,"active",m[9]==="html"),d[0]&512&&l!==(l=m[9]==="zip")&&O(s,"aria-pressed",l),d[0]&512&&tt(s,"active",m[9]==="zip")},d(m){m&&Q(t),p=!1,Be(h)}}}function Wo(n){let t,e,r=n[5].snapshots.length+"",i,o,s=n[5].snapshots.length===1?"":"s",a,l;return{c(){t=se(n[14]),e=se(" entire workspace ("),i=se(r),o=se(" snapshot"),a=se(s),l=se(")")},m(p,h){$(p,t,h),$(p,e,h),$(p,i,h),$(p,o,h),$(p,a,h),$(p,l,h)},p(p,h){h[0]&16384&&Se(t,p[14]),h[0]&32&&r!==(r=p[5].snapshots.length+"")&&Se(i,r),h[0]&32&&s!==(s=p[5].snapshots.length===1?"":"s")&&Se(a,s)},d(p){p&&(Q(t),Q(e),Q(i),Q(o),Q(a),Q(l))}}}function Ho(n){let t,e=n[5].name+"",r,i;return{c(){t=se('Click again to delete "'),r=se(e),i=se('"')},m(o,s){$(o,t,s),$(o,r,s),$(o,i,s)},p(o,s){s[0]&32&&e!==(e=o[5].name+"")&&Se(r,e)},d(o){o&&(Q(t),Q(r),Q(i))}}}function Ur(n,t){let e,r,i,o,s,a,l,p,h,m,d,c;function g(){return t[25](t[37])}return p=new Li({props:{title:t[37].title,type:t[37].type,timestamp:t[37].timestamp}}),{key:n,first:null,c(){e=V("li"),r=V("label"),i=V("input"),a=de(),l=V("span"),Ge(p.$$.fragment),h=de(),O(i,"type","checkbox"),i.checked=o=t[6].has(t[37].filename),O(i,"aria-label",s="Select snapshot "+(t[37].title??t[37].filename)),O(l,"class","modal-snapshot-row svelte-105gz4t"),O(r,"class","svelte-105gz4t"),O(e,"class","modal-snapshot-item svelte-105gz4t"),tt(e,"selected",t[6].has(t[37].filename)),this.first=e},m(u,b){$(u,e,b),F(e,r),F(r,i),F(r,a),F(r,l),je(p,l,null),F(e,h),m=!0,d||(c=ve(i,"change",g),d=!0)},p(u,b){t=u,(!m||b[0]&96&&o!==(o=t[6].has(t[37].filename)))&&(i.checked=o),(!m||b[0]&32&&s!==(s="Select snapshot "+(t[37].title??t[37].filename)))&&O(i,"aria-label",s);const _={};b[0]&32&&(_.title=t[37].title),b[0]&32&&(_.type=t[37].type),b[0]&32&&(_.timestamp=t[37].timestamp),p.$set(_),(!m||b[0]&96)&&tt(e,"selected",t[6].has(t[37].filename))},i(u){m||(Ee(p.$$.fragment,u),m=!0)},o(u){Te(p.$$.fragment,u),m=!1},d(u){u&&Q(e),We(p),d=!1,c()}}}function jr(n){let t,e;return{c(){t=V("p"),e=se(n[11]),O(t,"class","modal-error svelte-105gz4t")},m(r,i){$(r,t,i),F(t,e)},p(r,i){i[0]&2048&&Se(e,r[11])},d(r){r&&Q(t)}}}function Wr(n,t){let e,r,i=t[34].name+"",o,s=t[34].isCurrent?" (current)":"",a,l,p,h=t[34].snapshots.length+"",m,d,c=t[34].snapshots.length===1?"":"s",g,u,b,_,w,v;function A(){return t[22](t[34])}return{key:n,first:null,c(){e=V("button"),r=V("span"),o=se(i),a=se(s),l=de(),p=V("span"),m=se(h),d=se(" snapshot"),g=se(c),u=de(),b=V("span"),b.textContent="›",_=de(),O(r,"class","workspace-pick-name svelte-105gz4t"),O(b,"class","workspace-pick-chevron svelte-105gz4t"),O(p,"class","workspace-pick-meta svelte-105gz4t"),O(e,"class","workspace-pick-row svelte-105gz4t"),this.first=e},m(C,x){$(C,e,x),F(e,r),F(r,o),F(r,a),F(e,l),F(e,p),F(p,m),F(p,d),F(p,g),F(p,u),F(p,b),F(e,_),w||(v=ve(e,"click",A),w=!0)},p(C,x){t=C,x[0]&4&&i!==(i=t[34].name+"")&&Se(o,i),x[0]&4&&s!==(s=t[34].isCurrent?" (current)":"")&&Se(a,s),x[0]&4&&h!==(h=t[34].snapshots.length+"")&&Se(m,h),x[0]&4&&c!==(c=t[34].snapshots.length===1?"":"s")&&Se(g,c)},d(C){C&&Q(e),w=!1,v()}}}function Hr(n){let t,e,r=n[6].size+"",i,o,s,a,l,p,h,m=n[0]==="delete"&&n[8]?"Click again to confirm":`${n[14]} selected`,d,c,g,u;return{c(){t=V("div"),e=V("span"),i=se(r),o=se(" selected"),s=de(),a=V("div"),l=V("button"),l.textContent="Cancel",p=de(),h=V("button"),d=se(m),O(e,"class","modal-select-count svelte-105gz4t"),O(l,"class","modal-cancel-btn svelte-105gz4t"),O(h,"class","modal-selected-action svelte-105gz4t"),h.disabled=c=n[6].size===0||n[10],O(a,"class","modal-footer-actions svelte-105gz4t"),O(t,"class","modal-footer svelte-105gz4t")},m(b,_){$(b,t,_),F(t,e),F(e,i),F(e,o),F(t,s),F(t,a),F(a,l),F(a,p),F(a,h),F(h,d),g||(u=[ve(l,"click",n[17]),ve(h,"click",n[20])],g=!0)},p(b,_){_[0]&64&&r!==(r=b[6].size+"")&&Se(i,r),_[0]&16641&&m!==(m=b[0]==="delete"&&b[8]?"Click again to confirm":`${b[14]} selected`)&&Se(d,m),_[0]&1088&&c!==(c=b[6].size===0||b[10])&&(h.disabled=c)},d(b){b&&Q(t),g=!1,Be(u)}}}function Zo(n){let t,e,r=n[1]&&Fr(n);return{c(){r&&r.c(),t=ut()},m(i,o){r&&r.m(i,o),$(i,t,o),e=!0},p(i,o){i[1]?r?(r.p(i,o),o[0]&2&&Ee(r,1)):(r=Fr(i),r.c(),Ee(r,1),r.m(t.parentNode,t)):r&&(nt(),Te(r,1,1,()=>{r=null}),rt())},i(i){e||(Ee(r),e=!0)},o(i){Te(r),e=!1},d(i){i&&Q(t),r&&r.d(i)}}}function Go(n,t,e){let r,i,{mode:o}=t,{open:s=!1}=t,{workspaces:a=[]}=t,{loadError:l=null}=t;const p=gn();let h=1,m=null,d=new Set,c=!1,g=!1,u="html",b=!1,_=null,w=null,v=null,A=null,C=!1;function x(){e(11,_=null),e(12,w=null),e(10,b=!1),e(7,c=!1),e(8,g=!1),e(9,u="html"),e(6,d=new Set);const D=a.length===1?a[0]:a.find(M=>M.isCurrent);D?(e(5,m=D),e(4,h=2)):(e(5,m=null),e(4,h=1))}function z(D){e(5,m=D),e(6,d=new Set),e(7,c=!1),e(8,g=!1),e(11,_=null),e(4,h=2)}function U(){a.length<=1||(e(4,h=1),e(5,m=null),e(6,d=new Set),e(11,_=null))}function N(){p("close")}function I(D){const M=new Set(d);M.has(D)?M.delete(D):M.add(D),e(6,d=M),e(8,g=!1)}function W(D){D==="whole"?e(7,c=!0):e(8,g=!0),v&&clearTimeout(v),v=setTimeout(()=>{e(7,c=!1),e(8,g=!1)},3e3)}function T(D){e(12,w=D),A&&clearTimeout(A),A=setTimeout(()=>p("close"),1200)}async function Z(){if(m){e(10,b=!0),e(11,_=null);try{if(o==="delete")await No(m.name),p("deleted"),T(`Deleted entire workspace "${m.name}"`);else{const D=m.snapshots.filter(M=>M.id!==void 0).map(M=>({workspace:m.name,id:M.id}));if(D.length===0)throw new Error("no exportable snapshots in this workspace");u==="zip"?await Nr(D):await Dr(D),T(`Exported entire workspace "${m.name}"`)}}catch(D){e(11,_=D instanceof Error?D.message:"Request failed")}finally{e(10,b=!1)}}}async function y(){if(!m||d.size===0)return;e(10,b=!0),e(11,_=null);const D=[...d];try{if(o==="delete")await Po(m.name,D),p("deleted"),T(`Deleted ${D.length} snapshot${D.length===1?"":"s"} from "${m.name}"`);else{const M=new Map(m.snapshots.map(ie=>[ie.filename,ie.id])),ue=D.map(ie=>({workspace:m.name,id:M.get(ie)})).filter(ie=>ie.id!==void 0);if(ue.length===0)throw new Error("no exportable snapshots selected");u==="zip"?await Nr(ue):await Dr(ue),T(`Exported ${D.length} snapshot${D.length===1?"":"s"} from "${m.name}"`)}}catch(M){e(11,_=M instanceof Error?M.message:"Request failed")}finally{e(10,b=!1)}}function Y(){if(o==="delete"&&!c){W("whole");return}v&&clearTimeout(v),Z()}function fe(){if(d.size!==0){if(o==="delete"&&!g){W("subset");return}v&&clearTimeout(v),y()}}Jt(()=>{v&&clearTimeout(v),A&&clearTimeout(A)});const K=D=>z(D),re=()=>e(9,u="html"),q=()=>e(9,u="zip"),oe=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&&!C&&x(),e(21,C=s)),n.$$.dirty[0]&20&&e(13,i=h===2&&a.length>1)},[o,s,a,l,h,m,d,c,g,u,b,_,w,i,r,z,U,N,I,Y,fe,C,K,re,q,oe]}class Yo extends st{constructor(t){super(),ot(this,t,Go,Zo,Qe,{mode:0,open:1,workspaces:2,loadError:3},null,[-1,-1])}}var cn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function qo(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function un(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 Pi={exports:{}};/*!
3
-
4
- JSZip v3.10.1 - A JavaScript class for generating and reading zip files
5
- <http://stuartk.com/jszip>
6
-
7
- (c) 2009-2016 Stuart Knightley <stuart [at] stuartk.com>
8
- Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown.
9
-
10
- JSZip uses the library pako released under the MIT license :
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(p,h){if(!i[p]){if(!r[p]){var m=typeof un=="function"&&un;if(!h&&m)return m(p,!0);if(a)return a(p,!0);var d=new Error("Cannot find module '"+p+"'");throw d.code="MODULE_NOT_FOUND",d}var c=i[p]={exports:{}};r[p][0].call(c.exports,function(g){var u=r[p][1][g];return s(u||g)},c,c.exports,e,r,i,o)}return i[p].exports}for(var a=typeof un=="function"&&un,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 p,h,m,d,c,g,u,b=[],_=0,w=l.length,v=w,A=o.getTypeOf(l)!=="string";_<l.length;)v=w-_,m=A?(p=l[_++],h=_<w?l[_++]:0,_<w?l[_++]:0):(p=l.charCodeAt(_++),h=_<w?l.charCodeAt(_++):0,_<w?l.charCodeAt(_++):0),d=p>>2,c=(3&p)<<4|h>>4,g=1<v?(15&h)<<2|m>>6:64,u=2<v?63&m:64,b.push(a.charAt(d)+a.charAt(c)+a.charAt(g)+a.charAt(u));return b.join("")},i.decode=function(l){var p,h,m,d,c,g,u=0,b=0,_="data:";if(l.substr(0,_.length)===_)throw new Error("Invalid base64 input, it looks like a data url.");var w,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(w=s.uint8array?new Uint8Array(0|v):new Array(0|v);u<l.length;)p=a.indexOf(l.charAt(u++))<<2|(d=a.indexOf(l.charAt(u++)))>>4,h=(15&d)<<4|(c=a.indexOf(l.charAt(u++)))>>2,m=(3&c)<<6|(g=a.indexOf(l.charAt(u++))),w[b++]=p,c!==64&&(w[b++]=h),g!==64&&(w[b++]=m);return w}},{"./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 p(h,m,d,c,g){this.compressedSize=h,this.uncompressedSize=m,this.crc32=d,this.compression=c,this.compressedContent=g}p.prototype={getContentWorker:function(){var h=new s(o.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),m=this;return h.on("end",function(){if(this.streamInfo.data_length!==m.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),h},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)}},p.createWorkerFrom=function(h,m,d){return h.pipe(new a).pipe(new l("uncompressedSize")).pipe(m.compressWorker(d)).pipe(new l("compressedSize")).withStreamInfo("compression",m)},r.exports=p},{"./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=[],p=0;p<256;p++){a=p;for(var h=0;h<8;h++)a=1&a?3988292384^a>>>1:a>>>1;l[p]=a}return l}();r.exports=function(a,l){return a!==void 0&&a.length?o.getTypeOf(a)!=="string"?function(p,h,m,d){var c=s,g=d+m;p^=-1;for(var u=d;u<g;u++)p=p>>>8^c[255&(p^h[u])];return-1^p}(0|l,a,a.length,0):function(p,h,m,d){var c=s,g=d+m;p^=-1;for(var u=d;u<g;u++)p=p>>>8^c[255&(p^h.charCodeAt(u))];return-1^p}(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"),p=o?"uint8array":"array";function h(m,d){l.call(this,"FlateWorker/"+m),this._pako=null,this._pakoAction=m,this._pakoOptions=d,this.meta={}}i.magic="\b\0",a.inherits(h,l),h.prototype.processChunk=function(m){this.meta=m.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(p,m.data),!1)},h.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},h.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},h.prototype._createPako=function(){this._pako=new s[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var m=this;this._pako.onData=function(d){m.push({data:d,meta:m.meta})}},i.compressWorker=function(m){return new h("Deflate",m)},i.uncompressWorker=function(){return new h("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,r,i){function o(c,g){var u,b="";for(u=0;u<g;u++)b+=String.fromCharCode(255&c),c>>>=8;return b}function s(c,g,u,b,_,w){var v,A,C=c.file,x=c.compression,z=w!==p.utf8encode,U=a.transformTo("string",w(C.name)),N=a.transformTo("string",p.utf8encode(C.name)),I=C.comment,W=a.transformTo("string",w(I)),T=a.transformTo("string",p.utf8encode(I)),Z=N.length!==C.name.length,y=T.length!==I.length,Y="",fe="",K="",re=C.dir,q=C.date,oe={crc32:0,compressedSize:0,uncompressedSize:0};g&&!u||(oe.crc32=c.crc32,oe.compressedSize=c.compressedSize,oe.uncompressedSize=c.uncompressedSize);var D=0;g&&(D|=8),z||!Z&&!y||(D|=2048);var M=0,ue=0;re&&(M|=16),_==="UNIX"?(ue=798,M|=function(X,Ae){var Re=X;return X||(Re=Ae?16893:33204),(65535&Re)<<16}(C.unixPermissions,re)):(ue=20,M|=function(X){return 63&(X||0)}(C.dosPermissions)),v=q.getUTCHours(),v<<=6,v|=q.getUTCMinutes(),v<<=5,v|=q.getUTCSeconds()/2,A=q.getUTCFullYear()-1980,A<<=4,A|=q.getUTCMonth()+1,A<<=5,A|=q.getUTCDate(),Z&&(fe=o(1,1)+o(h(U),4)+N,Y+="up"+o(fe.length,2)+fe),y&&(K=o(1,1)+o(h(W),4)+T,Y+="uc"+o(K.length,2)+K);var ie="";return ie+=`
13
- \0`,ie+=o(D,2),ie+=x.magic,ie+=o(v,2),ie+=o(A,2),ie+=o(oe.crc32,4),ie+=o(oe.compressedSize,4),ie+=o(oe.uncompressedSize,4),ie+=o(U.length,2),ie+=o(Y.length,2),{fileRecord:m.LOCAL_FILE_HEADER+ie+U+Y,dirRecord:m.CENTRAL_FILE_HEADER+o(ue,2)+ie+o(W.length,2)+"\0\0\0\0"+o(M,4)+o(b,4)+U+Y+W}}var a=e("../utils"),l=e("../stream/GenericWorker"),p=e("../utf8"),h=e("../crc32"),m=e("../signature");function d(c,g,u,b){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=g,this.zipPlatform=u,this.encodeFileName=b,this.streamFiles=c,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(d,l),d.prototype.push=function(c){var g=c.meta.percent||0,u=this.entriesCount,b=this._sources.length;this.accumulate?this.contentBuffer.push(c):(this.bytesWritten+=c.data.length,l.prototype.push.call(this,{data:c.data,meta:{currentFile:this.currentFile,percent:u?(g+100*(u-b-1))/u:100}}))},d.prototype.openedSource=function(c){this.currentSourceOffset=this.bytesWritten,this.currentFile=c.file.name;var g=this.streamFiles&&!c.file.dir;if(g){var u=s(c,g,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:u.fileRecord,meta:{percent:0}})}else this.accumulate=!0},d.prototype.closedSource=function(c){this.accumulate=!1;var g=this.streamFiles&&!c.file.dir,u=s(c,g,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(u.dirRecord),g)this.push({data:function(b){return m.DATA_DESCRIPTOR+o(b.crc32,4)+o(b.compressedSize,4)+o(b.uncompressedSize,4)}(c),meta:{percent:100}});else for(this.push({data:u.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},d.prototype.flush=function(){for(var c=this.bytesWritten,g=0;g<this.dirRecords.length;g++)this.push({data:this.dirRecords[g],meta:{percent:100}});var u=this.bytesWritten-c,b=function(_,w,v,A,C){var x=a.transformTo("string",C(A));return m.CENTRAL_DIRECTORY_END+"\0\0\0\0"+o(_,2)+o(_,2)+o(w,4)+o(v,4)+o(x.length,2)+x}(this.dirRecords.length,u,c,this.zipComment,this.encodeFileName);this.push({data:b,meta:{percent:100}})},d.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},d.prototype.registerPrevious=function(c){this._sources.push(c);var g=this;return c.on("data",function(u){g.processChunk(u)}),c.on("end",function(){g.closedSource(g.previous.streamInfo),g._sources.length?g.prepareNextSource():g.end()}),c.on("error",function(u){g.error(u)}),this},d.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))},d.prototype.error=function(c){var g=this._sources;if(!l.prototype.error.call(this,c))return!1;for(var u=0;u<g.length;u++)try{g[u].error(c)}catch{}return!0},d.prototype.lock=function(){l.prototype.lock.call(this);for(var c=this._sources,g=0;g<c.length;g++)c[g].lock()},r.exports=d},{"../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,p){var h=new s(l.streamFiles,p,l.platform,l.encodeFileName),m=0;try{a.forEach(function(d,c){m++;var g=function(w,v){var A=w||v,C=o[A];if(!C)throw new Error(A+" is not a valid compression method !");return C}(c.options.compression,l.compression),u=c.options.compressionOptions||l.compressionOptions||{},b=c.dir,_=c.date;c._compressWorker(g,u).withStreamInfo("file",{name:d,dir:b,date:_,comment:c.comment||"",unixPermissions:c.unixPermissions,dosPermissions:c.dosPermissions}).pipe(h)}),h.entriesCount=m}catch(d){h.error(d)}return h}},{"../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"),p=e("./stream/Crc32Probe"),h=e("./nodejsUtils");function m(d){return new s.Promise(function(c,g){var u=d.decompressed.getContentWorker().pipe(new p);u.on("error",function(b){g(b)}).on("end",function(){u.streamInfo.crc32!==d.decompressed.crc32?g(new Error("Corrupted zip : CRC32 mismatch")):c()}).resume()})}r.exports=function(d,c){var g=this;return c=o.extend(c||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:a.utf8decode}),h.isNode&&h.isStream(d)?s.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):o.prepareContent("the loaded zip file",d,!0,c.optimizedBinaryString,c.base64).then(function(u){var b=new l(c);return b.load(u),b}).then(function(u){var b=[s.Promise.resolve(u)],_=u.files;if(c.checkCRC32)for(var w=0;w<_.length;w++)b.push(m(_[w]));return s.Promise.all(b)}).then(function(u){for(var b=u.shift(),_=b.files,w=0;w<_.length;w++){var v=_[w],A=v.fileNameStr,C=o.resolve(v.fileNameStr);g.file(C,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:c.createFolders}),v.dir||(g.file(C).unsafeOriginalName=A)}return b.zipComment.length&&(g.comment=b.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,p){s.call(this,"Nodejs stream input adapter for "+l),this._upstreamEnded=!1,this._bindStream(p)}o.inherits(a,s),a.prototype._bindStream=function(l){var p=this;(this._stream=l).pause(),l.on("data",function(h){p.push({data:h,meta:{percent:0}})}).on("error",function(h){p.isPaused?this.generatedError=h:p.error(h)}).on("end",function(){p.isPaused?p._upstreamEnded=!0:p.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,p){o.call(this,l),this._helper=a;var h=this;a.on("data",function(m,d){h.push(m)||h._helper.pause(),p&&p(d)}).on("error",function(m){h.emit("error",m)}).on("end",function(){h.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(C,x,z){var U,N=a.getTypeOf(x),I=a.extend(z||{},h);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&&(C=_(C)),I.createFolders&&(U=b(C))&&w.call(this,U,!0);var W=N==="string"&&I.binary===!1&&I.base64===!1;z&&z.binary!==void 0||(I.binary=!W),(x instanceof m&&x.uncompressedSize===0||I.dir||!x||x.length===0)&&(I.base64=!1,I.binary=!0,x="",I.compression="STORE",N="string");var T=null;T=x instanceof m||x instanceof l?x:g.isNode&&g.isStream(x)?new u(C,x):a.prepareContent(C,x,I.binary,I.optimizedBinaryString,I.base64);var Z=new d(C,T,I);this.files[C]=Z}var s=e("./utf8"),a=e("./utils"),l=e("./stream/GenericWorker"),p=e("./stream/StreamHelper"),h=e("./defaults"),m=e("./compressedObject"),d=e("./zipObject"),c=e("./generate"),g=e("./nodejsUtils"),u=e("./nodejs/NodejsStreamInputAdapter"),b=function(C){C.slice(-1)==="/"&&(C=C.substring(0,C.length-1));var x=C.lastIndexOf("/");return 0<x?C.substring(0,x):""},_=function(C){return C.slice(-1)!=="/"&&(C+="/"),C},w=function(C,x){return x=x!==void 0?x:h.createFolders,C=_(C),this.files[C]||o.call(this,C,null,{dir:!0,createFolders:x}),this.files[C]};function v(C){return Object.prototype.toString.call(C)==="[object RegExp]"}var A={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(C){var x,z,U;for(x in this.files)U=this.files[x],(z=x.slice(this.root.length,x.length))&&x.slice(0,this.root.length)===this.root&&C(z,U)},filter:function(C){var x=[];return this.forEach(function(z,U){C(z,U)&&x.push(U)}),x},file:function(C,x,z){if(arguments.length!==1)return C=this.root+C,o.call(this,C,x,z),this;if(v(C)){var U=C;return this.filter(function(I,W){return!W.dir&&U.test(I)})}var N=this.files[this.root+C];return N&&!N.dir?N:null},folder:function(C){if(!C)return this;if(v(C))return this.filter(function(N,I){return I.dir&&C.test(N)});var x=this.root+C,z=w.call(this,x),U=this.clone();return U.root=z.name,U},remove:function(C){C=this.root+C;var x=this.files[C];if(x||(C.slice(-1)!=="/"&&(C+="/"),x=this.files[C]),x&&!x.dir)delete this.files[C];else for(var z=this.filter(function(N,I){return I.name.slice(0,C.length)===C}),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(C){var x,z={};try{if((z=a.extend(C||{},{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||"";x=c.generateWorker(this,z,U)}catch(N){(x=new l("error")).error(N)}return new p(x,z.type||"string",z.mimeType)},generateAsync:function(C,x){return this.generateInternalStream(C).accumulate(x)},generateNodeStream:function(C,x){return(C=C||{}).type||(C.type="nodebuffer"),this.generateInternalStream(C).toNodejsStream(x)}};r.exports=A},{"./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),p=a.charCodeAt(1),h=a.charCodeAt(2),m=a.charCodeAt(3),d=this.length-4;0<=d;--d)if(this.data[d]===l&&this.data[d+1]===p&&this.data[d+2]===h&&this.data[d+3]===m)return d-this.zero;return-1},s.prototype.readAndCheckSignature=function(a){var l=a.charCodeAt(0),p=a.charCodeAt(1),h=a.charCodeAt(2),m=a.charCodeAt(3),d=this.readData(4);return l===d[0]&&p===d[1]&&h===d[2]&&m===d[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,p=0;for(this.checkOffset(a),l=this.index+a-1;l>=this.index;l--)p=(p<<8)+this.byteAt(l);return this.index+=a,p},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"),p=e("./NodeBufferReader"),h=e("./Uint8ArrayReader");r.exports=function(m){var d=o.getTypeOf(m);return o.checkSupport(d),d!=="string"||s.uint8array?d==="nodebuffer"?new p(m):s.uint8array?new h(o.transformTo("uint8array",m)):new a(o.transformTo("array",m)):new l(m)}},{"../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 p=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=p+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 p=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(h){p.dataIsReady=!0,p.data=h,p.max=h&&h.length||0,p.type=o.getTypeOf(h),p.isPaused||p._tickAndRepeat()},function(h){p.error(h)})}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,p=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,p);break;case"uint8array":l=this.data.subarray(this.index,p);break;case"array":case"nodebuffer":l=this.data.slice(this.index,p)}return this.index=p,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"),p=e("../support"),h=e("../external"),m=null;if(p.nodestream)try{m=e("../nodejs/NodejsStreamOutputAdapter")}catch{}function d(g,u){return new h.Promise(function(b,_){var w=[],v=g._internalType,A=g._outputType,C=g._mimeType;g.on("data",function(x,z){w.push(x),u&&u(z)}).on("error",function(x){w=[],_(x)}).on("end",function(){try{var x=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)}}(A,function(z,U){var N,I=0,W=null,T=0;for(N=0;N<U.length;N++)T+=U[N].length;switch(z){case"string":return U.join("");case"array":return Array.prototype.concat.apply([],U);case"uint8array":for(W=new Uint8Array(T),N=0;N<U.length;N++)W.set(U[N],I),I+=U[N].length;return W;case"nodebuffer":return Buffer.concat(U);default:throw new Error("concat : unsupported type '"+z+"'")}}(v,w),C);b(x)}catch(z){_(z)}w=[]}).resume()})}function c(g,u,b){var _=u;switch(u){case"blob":case"arraybuffer":_="uint8array";break;case"base64":_="string"}try{this._internalType=_,this._outputType=u,this._mimeType=b,o.checkSupport(_),this._worker=g.pipe(new s(_)),g.lock()}catch(w){this._worker=new a("error"),this._worker.error(w)}}c.prototype={accumulate:function(g){return d(this,g)},on:function(g,u){var b=this;return g==="data"?this._worker.on(g,function(_){u.call(b,_.data,_.meta)}):this._worker.on(g,function(){o.delay(u,arguments,b)}),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 m(this,{objectMode:this._outputType!=="nodebuffer"},g)}},r.exports=c},{"../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"),p=new Array(256),h=0;h<256;h++)p[h]=252<=h?6:248<=h?5:240<=h?4:224<=h?3:192<=h?2:1;p[254]=p[254]=1;function m(){l.call(this,"utf-8 decode"),this.leftOver=null}function d(){l.call(this,"utf-8 encode")}i.utf8encode=function(c){return s.nodebuffer?a.newBufferFrom(c,"utf-8"):function(g){var u,b,_,w,v,A=g.length,C=0;for(w=0;w<A;w++)(64512&(b=g.charCodeAt(w)))==55296&&w+1<A&&(64512&(_=g.charCodeAt(w+1)))==56320&&(b=65536+(b-55296<<10)+(_-56320),w++),C+=b<128?1:b<2048?2:b<65536?3:4;for(u=s.uint8array?new Uint8Array(C):new Array(C),w=v=0;v<C;w++)(64512&(b=g.charCodeAt(w)))==55296&&w+1<A&&(64512&(_=g.charCodeAt(w+1)))==56320&&(b=65536+(b-55296<<10)+(_-56320),w++),b<128?u[v++]=b:(b<2048?u[v++]=192|b>>>6:(b<65536?u[v++]=224|b>>>12:(u[v++]=240|b>>>18,u[v++]=128|b>>>12&63),u[v++]=128|b>>>6&63),u[v++]=128|63&b);return u}(c)},i.utf8decode=function(c){return s.nodebuffer?o.transformTo("nodebuffer",c).toString("utf-8"):function(g){var u,b,_,w,v=g.length,A=new Array(2*v);for(u=b=0;u<v;)if((_=g[u++])<128)A[b++]=_;else if(4<(w=p[_]))A[b++]=65533,u+=w-1;else{for(_&=w===2?31:w===3?15:7;1<w&&u<v;)_=_<<6|63&g[u++],w--;1<w?A[b++]=65533:_<65536?A[b++]=_:(_-=65536,A[b++]=55296|_>>10&1023,A[b++]=56320|1023&_)}return A.length!==b&&(A.subarray?A=A.subarray(0,b):A.length=b),o.applyFromCharCode(A)}(c=o.transformTo(s.uint8array?"uint8array":"array",c))},o.inherits(m,l),m.prototype.processChunk=function(c){var g=o.transformTo(s.uint8array?"uint8array":"array",c.data);if(this.leftOver&&this.leftOver.length){if(s.uint8array){var u=g;(g=new Uint8Array(u.length+this.leftOver.length)).set(this.leftOver,0),g.set(u,this.leftOver.length)}else g=this.leftOver.concat(g);this.leftOver=null}var b=function(w,v){var A;for((v=v||w.length)>w.length&&(v=w.length),A=v-1;0<=A&&(192&w[A])==128;)A--;return A<0||A===0?v:A+p[w[A]]>v?A:v}(g),_=g;b!==g.length&&(s.uint8array?(_=g.subarray(0,b),this.leftOver=g.subarray(b,g.length)):(_=g.slice(0,b),this.leftOver=g.slice(b,g.length))),this.push({data:i.utf8decode(_),meta:c.meta})},m.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:i.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},i.Utf8DecodeWorker=m,o.inherits(d,l),d.prototype.processChunk=function(c){this.push({data:i.utf8encode(c.data),meta:c.meta})},i.Utf8EncodeWorker=d},{"./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 p(u){return u}function h(u,b){for(var _=0;_<u.length;++_)b[_]=255&u.charCodeAt(_);return b}e("setimmediate"),i.newBlob=function(u,b){i.checkSupport("blob");try{return new Blob([u],{type:b})}catch{try{var _=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return _.append(u),_.getBlob(b)}catch{throw new Error("Bug : can't construct the Blob.")}}};var m={stringifyByChunk:function(u,b,_){var w=[],v=0,A=u.length;if(A<=_)return String.fromCharCode.apply(null,u);for(;v<A;)b==="array"||b==="nodebuffer"?w.push(String.fromCharCode.apply(null,u.slice(v,Math.min(v+_,A)))):w.push(String.fromCharCode.apply(null,u.subarray(v,Math.min(v+_,A)))),v+=_;return w.join("")},stringifyByChar:function(u){for(var b="",_=0;_<u.length;_++)b+=String.fromCharCode(u[_]);return b},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 d(u){var b=65536,_=i.getTypeOf(u),w=!0;if(_==="uint8array"?w=m.applyCanBeUsed.uint8array:_==="nodebuffer"&&(w=m.applyCanBeUsed.nodebuffer),w)for(;1<b;)try{return m.stringifyByChunk(u,_,b)}catch{b=Math.floor(b/2)}return m.stringifyByChar(u)}function c(u,b){for(var _=0;_<u.length;_++)b[_]=u[_];return b}i.applyFromCharCode=d;var g={};g.string={string:p,array:function(u){return h(u,new Array(u.length))},arraybuffer:function(u){return g.string.uint8array(u).buffer},uint8array:function(u){return h(u,new Uint8Array(u.length))},nodebuffer:function(u){return h(u,a.allocBuffer(u.length))}},g.array={string:d,array:p,arraybuffer:function(u){return new Uint8Array(u).buffer},uint8array:function(u){return new Uint8Array(u)},nodebuffer:function(u){return a.newBufferFrom(u)}},g.arraybuffer={string:function(u){return d(new Uint8Array(u))},array:function(u){return c(new Uint8Array(u),new Array(u.byteLength))},arraybuffer:p,uint8array:function(u){return new Uint8Array(u)},nodebuffer:function(u){return a.newBufferFrom(new Uint8Array(u))}},g.uint8array={string:d,array:function(u){return c(u,new Array(u.length))},arraybuffer:function(u){return u.buffer},uint8array:p,nodebuffer:function(u){return a.newBufferFrom(u)}},g.nodebuffer={string:d,array:function(u){return c(u,new Array(u.length))},arraybuffer:function(u){return g.nodebuffer.uint8array(u).buffer},uint8array:function(u){return c(u,new Uint8Array(u.length))},nodebuffer:p},i.transformTo=function(u,b){if(b=b||"",!u)return b;i.checkSupport(u);var _=i.getTypeOf(b);return g[_][u](b)},i.resolve=function(u){for(var b=u.split("/"),_=[],w=0;w<b.length;w++){var v=b[w];v==="."||v===""&&w!==0&&w!==b.length-1||(v===".."?_.pop():_.push(v))}return _.join("/")},i.getTypeOf=function(u){return typeof u=="string"?"string":Object.prototype.toString.call(u)==="[object Array]"?"array":o.nodebuffer&&a.isBuffer(u)?"nodebuffer":o.uint8array&&u instanceof Uint8Array?"uint8array":o.arraybuffer&&u instanceof ArrayBuffer?"arraybuffer":void 0},i.checkSupport=function(u){if(!o[u.toLowerCase()])throw new Error(u+" is not supported by this platform")},i.MAX_VALUE_16BITS=65535,i.MAX_VALUE_32BITS=-1,i.pretty=function(u){var b,_,w="";for(_=0;_<(u||"").length;_++)w+="\\x"+((b=u.charCodeAt(_))<16?"0":"")+b.toString(16).toUpperCase();return w},i.delay=function(u,b,_){setImmediate(function(){u.apply(_||null,b||[])})},i.inherits=function(u,b){function _(){}_.prototype=b.prototype,u.prototype=new _},i.extend=function(){var u,b,_={};for(u=0;u<arguments.length;u++)for(b in arguments[u])Object.prototype.hasOwnProperty.call(arguments[u],b)&&_[b]===void 0&&(_[b]=arguments[u][b]);return _},i.prepareContent=function(u,b,_,w,v){return l.Promise.resolve(b).then(function(A){return o.blob&&(A instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(A))!==-1)&&typeof FileReader<"u"?new l.Promise(function(C,x){var z=new FileReader;z.onload=function(U){C(U.target.result)},z.onerror=function(U){x(U.target.error)},z.readAsArrayBuffer(A)}):A}).then(function(A){var C=i.getTypeOf(A);return C?(C==="arraybuffer"?A=i.transformTo("uint8array",A):C==="string"&&(v?A=s.decode(A):_&&w!==!0&&(A=function(x){return h(x,o.uint8array?new Uint8Array(x.length):new Array(x.length))}(A))),A):l.Promise.reject(new Error("Can't read the data of '"+u+"'. 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"),p=e("./support");function h(m){this.files=[],this.loadOptions=m}h.prototype={checkSignature:function(m){if(!this.reader.readAndCheckSignature(m)){this.reader.index-=4;var d=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+s.pretty(d)+", expected "+s.pretty(m)+")")}},isSignature:function(m,d){var c=this.reader.index;this.reader.setIndex(m);var g=this.reader.readString(4)===d;return this.reader.setIndex(c),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 m=this.reader.readData(this.zipCommentLength),d=p.uint8array?"uint8array":"array",c=s.transformTo(d,m);this.zipComment=this.loadOptions.decodeFileName(c)},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 m,d,c,g=this.zip64EndOfCentralSize-44;0<g;)m=this.reader.readInt(2),d=this.reader.readInt(4),c=this.reader.readData(d),this.zip64ExtensibleData[m]={id:m,length:d,value:c}},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 m,d;for(m=0;m<this.files.length;m++)d=this.files[m],this.reader.setIndex(d.localHeaderOffset),this.checkSignature(a.LOCAL_FILE_HEADER),d.readLocalPart(this.reader),d.handleUTF8(),d.processAttributes()},readCentralDir:function(){var m;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(a.CENTRAL_FILE_HEADER);)(m=new l({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(m);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 m=this.reader.lastIndexOfSignature(a.CENTRAL_DIRECTORY_END);if(m<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(m);var d=m;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,(m=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(m),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 c=this.centralDirOffset+this.centralDirSize;this.zip64&&(c+=20,c+=12+this.zip64EndOfCentralSize);var g=d-c;if(0<g)this.isSignature(d,a.CENTRAL_FILE_HEADER)||(this.reader.zero=g);else if(g<0)throw new Error("Corrupted zip: missing "+Math.abs(g)+" bytes.")},prepareReader:function(m){this.reader=o(m)},load:function(m){this.prepareReader(m),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},r.exports=h},{"./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"),p=e("./utf8"),h=e("./compressions"),m=e("./support");function d(c,g){this.options=c,this.loadOptions=g}d.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(c){var g,u;if(c.skip(22),this.fileNameLength=c.readInt(2),u=c.readInt(2),this.fileName=c.readData(this.fileNameLength),c.skip(u),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(b){for(var _ in h)if(Object.prototype.hasOwnProperty.call(h,_)&&h[_].magic===b)return h[_];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,c.readData(this.compressedSize))},readCentralPart:function(c){this.versionMadeBy=c.readInt(2),c.skip(2),this.bitFlag=c.readInt(2),this.compressionMethod=c.readString(2),this.date=c.readDate(),this.crc32=c.readInt(4),this.compressedSize=c.readInt(4),this.uncompressedSize=c.readInt(4);var g=c.readInt(2);if(this.extraFieldsLength=c.readInt(2),this.fileCommentLength=c.readInt(2),this.diskNumberStart=c.readInt(2),this.internalFileAttributes=c.readInt(2),this.externalFileAttributes=c.readInt(4),this.localHeaderOffset=c.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");c.skip(g),this.readExtraFields(c),this.parseZIP64ExtraField(c),this.fileComment=c.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var c=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),c==0&&(this.dosPermissions=63&this.externalFileAttributes),c==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var c=o(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=c.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=c.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=c.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=c.readInt(4))}},readExtraFields:function(c){var g,u,b,_=c.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});c.index+4<_;)g=c.readInt(2),u=c.readInt(2),b=c.readData(u),this.extraFields[g]={id:g,length:u,value:b};c.setIndex(_)},handleUTF8:function(){var c=m.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=p.utf8decode(this.fileName),this.fileCommentStr=p.utf8decode(this.fileComment);else{var g=this.findExtraFieldUnicodePath();if(g!==null)this.fileNameStr=g;else{var u=s.transformTo(c,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(u)}var b=this.findExtraFieldUnicodeComment();if(b!==null)this.fileCommentStr=b;else{var _=s.transformTo(c,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(_)}}},findExtraFieldUnicodePath:function(){var c=this.extraFields[28789];if(c){var g=o(c.value);return g.readInt(1)!==1||l(this.fileName)!==g.readInt(4)?null:p.utf8decode(g.readData(c.length-5))}return null},findExtraFieldUnicodeComment:function(){var c=this.extraFields[25461];if(c){var g=o(c.value);return g.readInt(1)!==1||l(this.fileComment)!==g.readInt(4)?null:p.utf8decode(g.readData(c.length-5))}return null}},r.exports=d},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(e,r,i){function o(g,u,b){this.name=g,this.dir=b.dir,this.date=b.date,this.comment=b.comment,this.unixPermissions=b.unixPermissions,this.dosPermissions=b.dosPermissions,this._data=u,this._dataBinary=b.binary,this.options={compression:b.compression,compressionOptions:b.compressionOptions}}var s=e("./stream/StreamHelper"),a=e("./stream/DataWorker"),l=e("./utf8"),p=e("./compressedObject"),h=e("./stream/GenericWorker");o.prototype={internalStream:function(g){var u=null,b="string";try{if(!g)throw new Error("No output type specified.");var _=(b=g.toLowerCase())==="string"||b==="text";b!=="binarystring"&&b!=="text"||(b="string"),u=this._decompressWorker();var w=!this._dataBinary;w&&!_&&(u=u.pipe(new l.Utf8EncodeWorker)),!w&&_&&(u=u.pipe(new l.Utf8DecodeWorker))}catch(v){(u=new h("error")).error(v)}return new s(u,b,"")},async:function(g,u){return this.internalStream(g).accumulate(u)},nodeStream:function(g,u){return this.internalStream(g||"nodebuffer").toNodejsStream(u)},_compressWorker:function(g,u){if(this._data instanceof p&&this._data.compression.magic===g.magic)return this._data.getCompressedWorker();var b=this._decompressWorker();return this._dataBinary||(b=b.pipe(new l.Utf8EncodeWorker)),p.createWorkerFrom(b,g,u)},_decompressWorker:function(){return this._data instanceof p?this._data.getContentWorker():this._data instanceof h?this._data:new a(this._data)}};for(var m=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],d=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},c=0;c<m.length;c++)o.prototype[m[c]]=d;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 p=0,h=new l(g),m=o.document.createTextNode("");h.observe(m,{characterData:!0}),s=function(){m.data=p=++p%2}}else if(o.setImmediate||o.MessageChannel===void 0)s="document"in o&&"onreadystatechange"in o.document.createElement("script")?function(){var u=o.document.createElement("script");u.onreadystatechange=function(){g(),u.onreadystatechange=null,u.parentNode.removeChild(u),u=null},o.document.documentElement.appendChild(u)}:function(){setTimeout(g,0)};else{var d=new o.MessageChannel;d.port1.onmessage=g,s=function(){d.port2.postMessage(0)}}var c=[];function g(){var u,b;a=!0;for(var _=c.length;_;){for(b=c,c=[],u=-1;++u<_;)b[u]();_=c.length}a=!1}r.exports=function(u){c.push(u)!==1||a||s()}}).call(this,typeof cn<"u"?cn:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(e,r,i){var o=e("immediate");function s(){}var a={},l=["REJECTED"],p=["FULFILLED"],h=["PENDING"];function m(_){if(typeof _!="function")throw new TypeError("resolver must be a function");this.state=h,this.queue=[],this.outcome=void 0,_!==s&&u(this,_)}function d(_,w,v){this.promise=_,typeof w=="function"&&(this.onFulfilled=w,this.callFulfilled=this.otherCallFulfilled),typeof v=="function"&&(this.onRejected=v,this.callRejected=this.otherCallRejected)}function c(_,w,v){o(function(){var A;try{A=w(v)}catch(C){return a.reject(_,C)}A===_?a.reject(_,new TypeError("Cannot resolve promise with itself")):a.resolve(_,A)})}function g(_){var w=_&&_.then;if(_&&(typeof _=="object"||typeof _=="function")&&typeof w=="function")return function(){w.apply(_,arguments)}}function u(_,w){var v=!1;function A(z){v||(v=!0,a.reject(_,z))}function C(z){v||(v=!0,a.resolve(_,z))}var x=b(function(){w(C,A)});x.status==="error"&&A(x.value)}function b(_,w){var v={};try{v.value=_(w),v.status="success"}catch(A){v.status="error",v.value=A}return v}(r.exports=m).prototype.finally=function(_){if(typeof _!="function")return this;var w=this.constructor;return this.then(function(v){return w.resolve(_()).then(function(){return v})},function(v){return w.resolve(_()).then(function(){throw v})})},m.prototype.catch=function(_){return this.then(null,_)},m.prototype.then=function(_,w){if(typeof _!="function"&&this.state===p||typeof w!="function"&&this.state===l)return this;var v=new this.constructor(s);return this.state!==h?c(v,this.state===p?_:w,this.outcome):this.queue.push(new d(v,_,w)),v},d.prototype.callFulfilled=function(_){a.resolve(this.promise,_)},d.prototype.otherCallFulfilled=function(_){c(this.promise,this.onFulfilled,_)},d.prototype.callRejected=function(_){a.reject(this.promise,_)},d.prototype.otherCallRejected=function(_){c(this.promise,this.onRejected,_)},a.resolve=function(_,w){var v=b(g,w);if(v.status==="error")return a.reject(_,v.value);var A=v.value;if(A)u(_,A);else{_.state=p,_.outcome=w;for(var C=-1,x=_.queue.length;++C<x;)_.queue[C].callFulfilled(w)}return _},a.reject=function(_,w){_.state=l,_.outcome=w;for(var v=-1,A=_.queue.length;++v<A;)_.queue[v].callRejected(w);return _},m.resolve=function(_){return _ instanceof this?_:a.resolve(new this(s),_)},m.reject=function(_){var w=new this(s);return a.reject(w,_)},m.all=function(_){var w=this;if(Object.prototype.toString.call(_)!=="[object Array]")return this.reject(new TypeError("must be an array"));var v=_.length,A=!1;if(!v)return this.resolve([]);for(var C=new Array(v),x=0,z=-1,U=new this(s);++z<v;)N(_[z],z);return U;function N(I,W){w.resolve(I).then(function(T){C[W]=T,++x!==v||A||(A=!0,a.resolve(U,C))},function(T){A||(A=!0,a.reject(U,T))})}},m.race=function(_){var w=this;if(Object.prototype.toString.call(_)!=="[object Array]")return this.reject(new TypeError("must be an array"));var v=_.length,A=!1;if(!v)return this.resolve([]);for(var C=-1,x=new this(s);++C<v;)z=_[C],w.resolve(z).then(function(U){A||(A=!0,a.resolve(x,U))},function(U){A||(A=!0,a.reject(x,U))});var z;return x}},{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"),p=e("./zlib/zstream"),h=Object.prototype.toString,m=0,d=-1,c=0,g=8;function u(_){if(!(this instanceof u))return new u(_);this.options=s.assign({level:d,method:g,chunkSize:16384,windowBits:15,memLevel:8,strategy:c,to:""},_||{});var w=this.options;w.raw&&0<w.windowBits?w.windowBits=-w.windowBits:w.gzip&&0<w.windowBits&&w.windowBits<16&&(w.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new p,this.strm.avail_out=0;var v=o.deflateInit2(this.strm,w.level,w.method,w.windowBits,w.memLevel,w.strategy);if(v!==m)throw new Error(l[v]);if(w.header&&o.deflateSetHeader(this.strm,w.header),w.dictionary){var A;if(A=typeof w.dictionary=="string"?a.string2buf(w.dictionary):h.call(w.dictionary)==="[object ArrayBuffer]"?new Uint8Array(w.dictionary):w.dictionary,(v=o.deflateSetDictionary(this.strm,A))!==m)throw new Error(l[v]);this._dict_set=!0}}function b(_,w){var v=new u(w);if(v.push(_,!0),v.err)throw v.msg||l[v.err];return v.result}u.prototype.push=function(_,w){var v,A,C=this.strm,x=this.options.chunkSize;if(this.ended)return!1;A=w===~~w?w:w===!0?4:0,typeof _=="string"?C.input=a.string2buf(_):h.call(_)==="[object ArrayBuffer]"?C.input=new Uint8Array(_):C.input=_,C.next_in=0,C.avail_in=C.input.length;do{if(C.avail_out===0&&(C.output=new s.Buf8(x),C.next_out=0,C.avail_out=x),(v=o.deflate(C,A))!==1&&v!==m)return this.onEnd(v),!(this.ended=!0);C.avail_out!==0&&(C.avail_in!==0||A!==4&&A!==2)||(this.options.to==="string"?this.onData(a.buf2binstring(s.shrinkBuf(C.output,C.next_out))):this.onData(s.shrinkBuf(C.output,C.next_out)))}while((0<C.avail_in||C.avail_out===0)&&v!==1);return A===4?(v=o.deflateEnd(this.strm),this.onEnd(v),this.ended=!0,v===m):A!==2||(this.onEnd(m),!(C.avail_out=0))},u.prototype.onData=function(_){this.chunks.push(_)},u.prototype.onEnd=function(_){_===m&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=_,this.msg=this.strm.msg},i.Deflate=u,i.deflate=b,i.deflateRaw=function(_,w){return(w=w||{}).raw=!0,b(_,w)},i.gzip=function(_,w){return(w=w||{}).gzip=!0,b(_,w)}},{"./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"),p=e("./zlib/messages"),h=e("./zlib/zstream"),m=e("./zlib/gzheader"),d=Object.prototype.toString;function c(u){if(!(this instanceof c))return new c(u);this.options=s.assign({chunkSize:16384,windowBits:0,to:""},u||{});var b=this.options;b.raw&&0<=b.windowBits&&b.windowBits<16&&(b.windowBits=-b.windowBits,b.windowBits===0&&(b.windowBits=-15)),!(0<=b.windowBits&&b.windowBits<16)||u&&u.windowBits||(b.windowBits+=32),15<b.windowBits&&b.windowBits<48&&!(15&b.windowBits)&&(b.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new h,this.strm.avail_out=0;var _=o.inflateInit2(this.strm,b.windowBits);if(_!==l.Z_OK)throw new Error(p[_]);this.header=new m,o.inflateGetHeader(this.strm,this.header)}function g(u,b){var _=new c(b);if(_.push(u,!0),_.err)throw _.msg||p[_.err];return _.result}c.prototype.push=function(u,b){var _,w,v,A,C,x,z=this.strm,U=this.options.chunkSize,N=this.options.dictionary,I=!1;if(this.ended)return!1;w=b===~~b?b:b===!0?l.Z_FINISH:l.Z_NO_FLUSH,typeof u=="string"?z.input=a.binstring2buf(u):d.call(u)==="[object ArrayBuffer]"?z.input=new Uint8Array(u):z.input=u,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),(_=o.inflate(z,l.Z_NO_FLUSH))===l.Z_NEED_DICT&&N&&(x=typeof N=="string"?a.string2buf(N):d.call(N)==="[object ArrayBuffer]"?new Uint8Array(N):N,_=o.inflateSetDictionary(this.strm,x)),_===l.Z_BUF_ERROR&&I===!0&&(_=l.Z_OK,I=!1),_!==l.Z_STREAM_END&&_!==l.Z_OK)return this.onEnd(_),!(this.ended=!0);z.next_out&&(z.avail_out!==0&&_!==l.Z_STREAM_END&&(z.avail_in!==0||w!==l.Z_FINISH&&w!==l.Z_SYNC_FLUSH)||(this.options.to==="string"?(v=a.utf8border(z.output,z.next_out),A=z.next_out-v,C=a.buf2string(z.output,v),z.next_out=A,z.avail_out=U-A,A&&s.arraySet(z.output,z.output,v,A,0),this.onData(C)):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)&&_!==l.Z_STREAM_END);return _===l.Z_STREAM_END&&(w=l.Z_FINISH),w===l.Z_FINISH?(_=o.inflateEnd(this.strm),this.onEnd(_),this.ended=!0,_===l.Z_OK):w!==l.Z_SYNC_FLUSH||(this.onEnd(l.Z_OK),!(z.avail_out=0))},c.prototype.onData=function(u){this.chunks.push(u)},c.prototype.onEnd=function(u){u===l.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=u,this.msg=this.strm.msg},i.Inflate=c,i.inflate=g,i.inflateRaw=function(u,b){return(b=b||{}).raw=!0,g(u,b)},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 p=Array.prototype.slice.call(arguments,1);p.length;){var h=p.shift();if(h){if(typeof h!="object")throw new TypeError(h+"must be non-object");for(var m in h)h.hasOwnProperty(m)&&(l[m]=h[m])}}return l},i.shrinkBuf=function(l,p){return l.length===p?l:l.subarray?l.subarray(0,p):(l.length=p,l)};var s={arraySet:function(l,p,h,m,d){if(p.subarray&&l.subarray)l.set(p.subarray(h,h+m),d);else for(var c=0;c<m;c++)l[d+c]=p[h+c]},flattenChunks:function(l){var p,h,m,d,c,g;for(p=m=0,h=l.length;p<h;p++)m+=l[p].length;for(g=new Uint8Array(m),p=d=0,h=l.length;p<h;p++)c=l[p],g.set(c,d),d+=c.length;return g}},a={arraySet:function(l,p,h,m,d){for(var c=0;c<m;c++)l[d+c]=p[h+c]},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),p=0;p<256;p++)l[p]=252<=p?6:248<=p?5:240<=p?4:224<=p?3:192<=p?2:1;function h(m,d){if(d<65537&&(m.subarray&&a||!m.subarray&&s))return String.fromCharCode.apply(null,o.shrinkBuf(m,d));for(var c="",g=0;g<d;g++)c+=String.fromCharCode(m[g]);return c}l[254]=l[254]=1,i.string2buf=function(m){var d,c,g,u,b,_=m.length,w=0;for(u=0;u<_;u++)(64512&(c=m.charCodeAt(u)))==55296&&u+1<_&&(64512&(g=m.charCodeAt(u+1)))==56320&&(c=65536+(c-55296<<10)+(g-56320),u++),w+=c<128?1:c<2048?2:c<65536?3:4;for(d=new o.Buf8(w),u=b=0;b<w;u++)(64512&(c=m.charCodeAt(u)))==55296&&u+1<_&&(64512&(g=m.charCodeAt(u+1)))==56320&&(c=65536+(c-55296<<10)+(g-56320),u++),c<128?d[b++]=c:(c<2048?d[b++]=192|c>>>6:(c<65536?d[b++]=224|c>>>12:(d[b++]=240|c>>>18,d[b++]=128|c>>>12&63),d[b++]=128|c>>>6&63),d[b++]=128|63&c);return d},i.buf2binstring=function(m){return h(m,m.length)},i.binstring2buf=function(m){for(var d=new o.Buf8(m.length),c=0,g=d.length;c<g;c++)d[c]=m.charCodeAt(c);return d},i.buf2string=function(m,d){var c,g,u,b,_=d||m.length,w=new Array(2*_);for(c=g=0;c<_;)if((u=m[c++])<128)w[g++]=u;else if(4<(b=l[u]))w[g++]=65533,c+=b-1;else{for(u&=b===2?31:b===3?15:7;1<b&&c<_;)u=u<<6|63&m[c++],b--;1<b?w[g++]=65533:u<65536?w[g++]=u:(u-=65536,w[g++]=55296|u>>10&1023,w[g++]=56320|1023&u)}return h(w,g)},i.utf8border=function(m,d){var c;for((d=d||m.length)>m.length&&(d=m.length),c=d-1;0<=c&&(192&m[c])==128;)c--;return c<0||c===0?d:c+l[m[c]]>d?c:d}},{"./common":41}],43:[function(e,r,i){r.exports=function(o,s,a,l){for(var p=65535&o|0,h=o>>>16&65535|0,m=0;a!==0;){for(a-=m=2e3<a?2e3:a;h=h+(p=p+s[l++]|0)|0,--m;);p%=65521,h%=65521}return p|h<<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 p=0;p<8;p++)s=1&s?3988292384^s>>>1:s>>>1;a[l]=s}return a}();r.exports=function(s,a,l,p){var h=o,m=p+l;s^=-1;for(var d=p;d<m;d++)s=s>>>8^h[255&(s^a[d])];return-1^s}},{}],46:[function(e,r,i){var o,s=e("../utils/common"),a=e("./trees"),l=e("./adler32"),p=e("./crc32"),h=e("./messages"),m=0,d=4,c=0,g=-2,u=-1,b=4,_=2,w=8,v=9,A=286,C=30,x=19,z=2*A+1,U=15,N=3,I=258,W=I+N+1,T=42,Z=113,y=1,Y=2,fe=3,K=4;function re(f,H){return f.msg=h[H],H}function q(f){return(f<<1)-(4<f?9:0)}function oe(f){for(var H=f.length;0<=--H;)f[H]=0}function D(f){var H=f.state,j=H.pending;j>f.avail_out&&(j=f.avail_out),j!==0&&(s.arraySet(f.output,H.pending_buf,H.pending_out,j,f.next_out),f.next_out+=j,H.pending_out+=j,f.total_out+=j,f.avail_out-=j,H.pending-=j,H.pending===0&&(H.pending_out=0))}function M(f,H){a._tr_flush_block(f,0<=f.block_start?f.block_start:-1,f.strstart-f.block_start,H),f.block_start=f.strstart,D(f.strm)}function ue(f,H){f.pending_buf[f.pending++]=H}function ie(f,H){f.pending_buf[f.pending++]=H>>>8&255,f.pending_buf[f.pending++]=255&H}function X(f,H){var j,S,E=f.max_chain_length,L=f.strstart,G=f.prev_length,P=f.nice_match,R=f.strstart>f.w_size-W?f.strstart-(f.w_size-W):0,ee=f.window,ae=f.w_mask,ne=f.prev,pe=f.strstart+I,ke=ee[L+G-1],we=ee[L+G];f.prev_length>=f.good_match&&(E>>=2),P>f.lookahead&&(P=f.lookahead);do if(ee[(j=H)+G]===we&&ee[j+G-1]===ke&&ee[j]===ee[L]&&ee[++j]===ee[L+1]){L+=2,j++;do;while(ee[++L]===ee[++j]&&ee[++L]===ee[++j]&&ee[++L]===ee[++j]&&ee[++L]===ee[++j]&&ee[++L]===ee[++j]&&ee[++L]===ee[++j]&&ee[++L]===ee[++j]&&ee[++L]===ee[++j]&&L<pe);if(S=I-(pe-L),L=pe-I,G<S){if(f.match_start=H,P<=(G=S))break;ke=ee[L+G-1],we=ee[L+G]}}while((H=ne[H&ae])>R&&--E!=0);return G<=f.lookahead?G:f.lookahead}function Ae(f){var H,j,S,E,L,G,P,R,ee,ae,ne=f.w_size;do{if(E=f.window_size-f.lookahead-f.strstart,f.strstart>=ne+(ne-W)){for(s.arraySet(f.window,f.window,ne,ne,0),f.match_start-=ne,f.strstart-=ne,f.block_start-=ne,H=j=f.hash_size;S=f.head[--H],f.head[H]=ne<=S?S-ne:0,--j;);for(H=j=ne;S=f.prev[--H],f.prev[H]=ne<=S?S-ne:0,--j;);E+=ne}if(f.strm.avail_in===0)break;if(G=f.strm,P=f.window,R=f.strstart+f.lookahead,ee=E,ae=void 0,ae=G.avail_in,ee<ae&&(ae=ee),j=ae===0?0:(G.avail_in-=ae,s.arraySet(P,G.input,G.next_in,ae,R),G.state.wrap===1?G.adler=l(G.adler,P,ae,R):G.state.wrap===2&&(G.adler=p(G.adler,P,ae,R)),G.next_in+=ae,G.total_in+=ae,ae),f.lookahead+=j,f.lookahead+f.insert>=N)for(L=f.strstart-f.insert,f.ins_h=f.window[L],f.ins_h=(f.ins_h<<f.hash_shift^f.window[L+1])&f.hash_mask;f.insert&&(f.ins_h=(f.ins_h<<f.hash_shift^f.window[L+N-1])&f.hash_mask,f.prev[L&f.w_mask]=f.head[f.ins_h],f.head[f.ins_h]=L,L++,f.insert--,!(f.lookahead+f.insert<N)););}while(f.lookahead<W&&f.strm.avail_in!==0)}function Re(f,H){for(var j,S;;){if(f.lookahead<W){if(Ae(f),f.lookahead<W&&H===m)return y;if(f.lookahead===0)break}if(j=0,f.lookahead>=N&&(f.ins_h=(f.ins_h<<f.hash_shift^f.window[f.strstart+N-1])&f.hash_mask,j=f.prev[f.strstart&f.w_mask]=f.head[f.ins_h],f.head[f.ins_h]=f.strstart),j!==0&&f.strstart-j<=f.w_size-W&&(f.match_length=X(f,j)),f.match_length>=N)if(S=a._tr_tally(f,f.strstart-f.match_start,f.match_length-N),f.lookahead-=f.match_length,f.match_length<=f.max_lazy_match&&f.lookahead>=N){for(f.match_length--;f.strstart++,f.ins_h=(f.ins_h<<f.hash_shift^f.window[f.strstart+N-1])&f.hash_mask,j=f.prev[f.strstart&f.w_mask]=f.head[f.ins_h],f.head[f.ins_h]=f.strstart,--f.match_length!=0;);f.strstart++}else f.strstart+=f.match_length,f.match_length=0,f.ins_h=f.window[f.strstart],f.ins_h=(f.ins_h<<f.hash_shift^f.window[f.strstart+1])&f.hash_mask;else S=a._tr_tally(f,0,f.window[f.strstart]),f.lookahead--,f.strstart++;if(S&&(M(f,!1),f.strm.avail_out===0))return y}return f.insert=f.strstart<N-1?f.strstart:N-1,H===d?(M(f,!0),f.strm.avail_out===0?fe:K):f.last_lit&&(M(f,!1),f.strm.avail_out===0)?y:Y}function ye(f,H){for(var j,S,E;;){if(f.lookahead<W){if(Ae(f),f.lookahead<W&&H===m)return y;if(f.lookahead===0)break}if(j=0,f.lookahead>=N&&(f.ins_h=(f.ins_h<<f.hash_shift^f.window[f.strstart+N-1])&f.hash_mask,j=f.prev[f.strstart&f.w_mask]=f.head[f.ins_h],f.head[f.ins_h]=f.strstart),f.prev_length=f.match_length,f.prev_match=f.match_start,f.match_length=N-1,j!==0&&f.prev_length<f.max_lazy_match&&f.strstart-j<=f.w_size-W&&(f.match_length=X(f,j),f.match_length<=5&&(f.strategy===1||f.match_length===N&&4096<f.strstart-f.match_start)&&(f.match_length=N-1)),f.prev_length>=N&&f.match_length<=f.prev_length){for(E=f.strstart+f.lookahead-N,S=a._tr_tally(f,f.strstart-1-f.prev_match,f.prev_length-N),f.lookahead-=f.prev_length-1,f.prev_length-=2;++f.strstart<=E&&(f.ins_h=(f.ins_h<<f.hash_shift^f.window[f.strstart+N-1])&f.hash_mask,j=f.prev[f.strstart&f.w_mask]=f.head[f.ins_h],f.head[f.ins_h]=f.strstart),--f.prev_length!=0;);if(f.match_available=0,f.match_length=N-1,f.strstart++,S&&(M(f,!1),f.strm.avail_out===0))return y}else if(f.match_available){if((S=a._tr_tally(f,0,f.window[f.strstart-1]))&&M(f,!1),f.strstart++,f.lookahead--,f.strm.avail_out===0)return y}else f.match_available=1,f.strstart++,f.lookahead--}return f.match_available&&(S=a._tr_tally(f,0,f.window[f.strstart-1]),f.match_available=0),f.insert=f.strstart<N-1?f.strstart:N-1,H===d?(M(f,!0),f.strm.avail_out===0?fe:K):f.last_lit&&(M(f,!1),f.strm.avail_out===0)?y:Y}function le(f,H,j,S,E){this.good_length=f,this.max_lazy=H,this.nice_length=j,this.max_chain=S,this.func=E}function Ie(){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=w,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*C+1)),this.bl_tree=new s.Buf16(2*(2*x+1)),oe(this.dyn_ltree),oe(this.dyn_dtree),oe(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*A+1),oe(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new s.Buf16(2*A+1),oe(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 be(f){var H;return f&&f.state?(f.total_in=f.total_out=0,f.data_type=_,(H=f.state).pending=0,H.pending_out=0,H.wrap<0&&(H.wrap=-H.wrap),H.status=H.wrap?T:Z,f.adler=H.wrap===2?0:1,H.last_flush=m,a._tr_init(H),c):re(f,g)}function Ce(f){var H=be(f);return H===c&&function(j){j.window_size=2*j.w_size,oe(j.head),j.max_lazy_match=o[j.level].max_lazy,j.good_match=o[j.level].good_length,j.nice_match=o[j.level].nice_length,j.max_chain_length=o[j.level].max_chain,j.strstart=0,j.block_start=0,j.lookahead=0,j.insert=0,j.match_length=j.prev_length=N-1,j.match_available=0,j.ins_h=0}(f.state),H}function he(f,H,j,S,E,L){if(!f)return g;var G=1;if(H===u&&(H=6),S<0?(G=0,S=-S):15<S&&(G=2,S-=16),E<1||v<E||j!==w||S<8||15<S||H<0||9<H||L<0||b<L)return re(f,g);S===8&&(S=9);var P=new Ie;return(f.state=P).strm=f,P.wrap=G,P.gzhead=null,P.w_bits=S,P.w_size=1<<P.w_bits,P.w_mask=P.w_size-1,P.hash_bits=E+7,P.hash_size=1<<P.hash_bits,P.hash_mask=P.hash_size-1,P.hash_shift=~~((P.hash_bits+N-1)/N),P.window=new s.Buf8(2*P.w_size),P.head=new s.Buf16(P.hash_size),P.prev=new s.Buf16(P.w_size),P.lit_bufsize=1<<E+6,P.pending_buf_size=4*P.lit_bufsize,P.pending_buf=new s.Buf8(P.pending_buf_size),P.d_buf=1*P.lit_bufsize,P.l_buf=3*P.lit_bufsize,P.level=H,P.strategy=L,P.method=j,Ce(f)}o=[new le(0,0,0,0,function(f,H){var j=65535;for(j>f.pending_buf_size-5&&(j=f.pending_buf_size-5);;){if(f.lookahead<=1){if(Ae(f),f.lookahead===0&&H===m)return y;if(f.lookahead===0)break}f.strstart+=f.lookahead,f.lookahead=0;var S=f.block_start+j;if((f.strstart===0||f.strstart>=S)&&(f.lookahead=f.strstart-S,f.strstart=S,M(f,!1),f.strm.avail_out===0)||f.strstart-f.block_start>=f.w_size-W&&(M(f,!1),f.strm.avail_out===0))return y}return f.insert=0,H===d?(M(f,!0),f.strm.avail_out===0?fe:K):(f.strstart>f.block_start&&(M(f,!1),f.strm.avail_out),y)}),new le(4,4,8,4,Re),new le(4,5,16,8,Re),new le(4,6,32,32,Re),new le(4,4,16,16,ye),new le(8,16,32,32,ye),new le(8,16,128,128,ye),new le(8,32,128,256,ye),new le(32,128,258,1024,ye),new le(32,258,258,4096,ye)],i.deflateInit=function(f,H){return he(f,H,w,15,8,0)},i.deflateInit2=he,i.deflateReset=Ce,i.deflateResetKeep=be,i.deflateSetHeader=function(f,H){return f&&f.state?f.state.wrap!==2?g:(f.state.gzhead=H,c):g},i.deflate=function(f,H){var j,S,E,L;if(!f||!f.state||5<H||H<0)return f?re(f,g):g;if(S=f.state,!f.output||!f.input&&f.avail_in!==0||S.status===666&&H!==d)return re(f,f.avail_out===0?-5:g);if(S.strm=f,j=S.last_flush,S.last_flush=H,S.status===T)if(S.wrap===2)f.adler=0,ue(S,31),ue(S,139),ue(S,8),S.gzhead?(ue(S,(S.gzhead.text?1:0)+(S.gzhead.hcrc?2:0)+(S.gzhead.extra?4:0)+(S.gzhead.name?8:0)+(S.gzhead.comment?16:0)),ue(S,255&S.gzhead.time),ue(S,S.gzhead.time>>8&255),ue(S,S.gzhead.time>>16&255),ue(S,S.gzhead.time>>24&255),ue(S,S.level===9?2:2<=S.strategy||S.level<2?4:0),ue(S,255&S.gzhead.os),S.gzhead.extra&&S.gzhead.extra.length&&(ue(S,255&S.gzhead.extra.length),ue(S,S.gzhead.extra.length>>8&255)),S.gzhead.hcrc&&(f.adler=p(f.adler,S.pending_buf,S.pending,0)),S.gzindex=0,S.status=69):(ue(S,0),ue(S,0),ue(S,0),ue(S,0),ue(S,0),ue(S,S.level===9?2:2<=S.strategy||S.level<2?4:0),ue(S,3),S.status=Z);else{var G=w+(S.w_bits-8<<4)<<8;G|=(2<=S.strategy||S.level<2?0:S.level<6?1:S.level===6?2:3)<<6,S.strstart!==0&&(G|=32),G+=31-G%31,S.status=Z,ie(S,G),S.strstart!==0&&(ie(S,f.adler>>>16),ie(S,65535&f.adler)),f.adler=1}if(S.status===69)if(S.gzhead.extra){for(E=S.pending;S.gzindex<(65535&S.gzhead.extra.length)&&(S.pending!==S.pending_buf_size||(S.gzhead.hcrc&&S.pending>E&&(f.adler=p(f.adler,S.pending_buf,S.pending-E,E)),D(f),E=S.pending,S.pending!==S.pending_buf_size));)ue(S,255&S.gzhead.extra[S.gzindex]),S.gzindex++;S.gzhead.hcrc&&S.pending>E&&(f.adler=p(f.adler,S.pending_buf,S.pending-E,E)),S.gzindex===S.gzhead.extra.length&&(S.gzindex=0,S.status=73)}else S.status=73;if(S.status===73)if(S.gzhead.name){E=S.pending;do{if(S.pending===S.pending_buf_size&&(S.gzhead.hcrc&&S.pending>E&&(f.adler=p(f.adler,S.pending_buf,S.pending-E,E)),D(f),E=S.pending,S.pending===S.pending_buf_size)){L=1;break}L=S.gzindex<S.gzhead.name.length?255&S.gzhead.name.charCodeAt(S.gzindex++):0,ue(S,L)}while(L!==0);S.gzhead.hcrc&&S.pending>E&&(f.adler=p(f.adler,S.pending_buf,S.pending-E,E)),L===0&&(S.gzindex=0,S.status=91)}else S.status=91;if(S.status===91)if(S.gzhead.comment){E=S.pending;do{if(S.pending===S.pending_buf_size&&(S.gzhead.hcrc&&S.pending>E&&(f.adler=p(f.adler,S.pending_buf,S.pending-E,E)),D(f),E=S.pending,S.pending===S.pending_buf_size)){L=1;break}L=S.gzindex<S.gzhead.comment.length?255&S.gzhead.comment.charCodeAt(S.gzindex++):0,ue(S,L)}while(L!==0);S.gzhead.hcrc&&S.pending>E&&(f.adler=p(f.adler,S.pending_buf,S.pending-E,E)),L===0&&(S.status=103)}else S.status=103;if(S.status===103&&(S.gzhead.hcrc?(S.pending+2>S.pending_buf_size&&D(f),S.pending+2<=S.pending_buf_size&&(ue(S,255&f.adler),ue(S,f.adler>>8&255),f.adler=0,S.status=Z)):S.status=Z),S.pending!==0){if(D(f),f.avail_out===0)return S.last_flush=-1,c}else if(f.avail_in===0&&q(H)<=q(j)&&H!==d)return re(f,-5);if(S.status===666&&f.avail_in!==0)return re(f,-5);if(f.avail_in!==0||S.lookahead!==0||H!==m&&S.status!==666){var P=S.strategy===2?function(R,ee){for(var ae;;){if(R.lookahead===0&&(Ae(R),R.lookahead===0)){if(ee===m)return y;break}if(R.match_length=0,ae=a._tr_tally(R,0,R.window[R.strstart]),R.lookahead--,R.strstart++,ae&&(M(R,!1),R.strm.avail_out===0))return y}return R.insert=0,ee===d?(M(R,!0),R.strm.avail_out===0?fe:K):R.last_lit&&(M(R,!1),R.strm.avail_out===0)?y:Y}(S,H):S.strategy===3?function(R,ee){for(var ae,ne,pe,ke,we=R.window;;){if(R.lookahead<=I){if(Ae(R),R.lookahead<=I&&ee===m)return y;if(R.lookahead===0)break}if(R.match_length=0,R.lookahead>=N&&0<R.strstart&&(ne=we[pe=R.strstart-1])===we[++pe]&&ne===we[++pe]&&ne===we[++pe]){ke=R.strstart+I;do;while(ne===we[++pe]&&ne===we[++pe]&&ne===we[++pe]&&ne===we[++pe]&&ne===we[++pe]&&ne===we[++pe]&&ne===we[++pe]&&ne===we[++pe]&&pe<ke);R.match_length=I-(ke-pe),R.match_length>R.lookahead&&(R.match_length=R.lookahead)}if(R.match_length>=N?(ae=a._tr_tally(R,1,R.match_length-N),R.lookahead-=R.match_length,R.strstart+=R.match_length,R.match_length=0):(ae=a._tr_tally(R,0,R.window[R.strstart]),R.lookahead--,R.strstart++),ae&&(M(R,!1),R.strm.avail_out===0))return y}return R.insert=0,ee===d?(M(R,!0),R.strm.avail_out===0?fe:K):R.last_lit&&(M(R,!1),R.strm.avail_out===0)?y:Y}(S,H):o[S.level].func(S,H);if(P!==fe&&P!==K||(S.status=666),P===y||P===fe)return f.avail_out===0&&(S.last_flush=-1),c;if(P===Y&&(H===1?a._tr_align(S):H!==5&&(a._tr_stored_block(S,0,0,!1),H===3&&(oe(S.head),S.lookahead===0&&(S.strstart=0,S.block_start=0,S.insert=0))),D(f),f.avail_out===0))return S.last_flush=-1,c}return H!==d?c:S.wrap<=0?1:(S.wrap===2?(ue(S,255&f.adler),ue(S,f.adler>>8&255),ue(S,f.adler>>16&255),ue(S,f.adler>>24&255),ue(S,255&f.total_in),ue(S,f.total_in>>8&255),ue(S,f.total_in>>16&255),ue(S,f.total_in>>24&255)):(ie(S,f.adler>>>16),ie(S,65535&f.adler)),D(f),0<S.wrap&&(S.wrap=-S.wrap),S.pending!==0?c:1)},i.deflateEnd=function(f){var H;return f&&f.state?(H=f.state.status)!==T&&H!==69&&H!==73&&H!==91&&H!==103&&H!==Z&&H!==666?re(f,g):(f.state=null,H===Z?re(f,-3):c):g},i.deflateSetDictionary=function(f,H){var j,S,E,L,G,P,R,ee,ae=H.length;if(!f||!f.state||(L=(j=f.state).wrap)===2||L===1&&j.status!==T||j.lookahead)return g;for(L===1&&(f.adler=l(f.adler,H,ae,0)),j.wrap=0,ae>=j.w_size&&(L===0&&(oe(j.head),j.strstart=0,j.block_start=0,j.insert=0),ee=new s.Buf8(j.w_size),s.arraySet(ee,H,ae-j.w_size,j.w_size,0),H=ee,ae=j.w_size),G=f.avail_in,P=f.next_in,R=f.input,f.avail_in=ae,f.next_in=0,f.input=H,Ae(j);j.lookahead>=N;){for(S=j.strstart,E=j.lookahead-(N-1);j.ins_h=(j.ins_h<<j.hash_shift^j.window[S+N-1])&j.hash_mask,j.prev[S&j.w_mask]=j.head[j.ins_h],j.head[j.ins_h]=S,S++,--E;);j.strstart=S,j.lookahead=N-1,Ae(j)}return j.strstart+=j.lookahead,j.block_start=j.strstart,j.insert=j.lookahead,j.lookahead=0,j.match_length=j.prev_length=N-1,j.match_available=0,f.next_in=P,f.input=R,f.avail_in=G,j.wrap=L,c},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,p,h,m,d,c,g,u,b,_,w,v,A,C,x,z,U,N,I,W,T,Z,y,Y;a=o.state,l=o.next_in,y=o.input,p=l+(o.avail_in-5),h=o.next_out,Y=o.output,m=h-(s-o.avail_out),d=h+(o.avail_out-257),c=a.dmax,g=a.wsize,u=a.whave,b=a.wnext,_=a.window,w=a.hold,v=a.bits,A=a.lencode,C=a.distcode,x=(1<<a.lenbits)-1,z=(1<<a.distbits)-1;e:do{v<15&&(w+=y[l++]<<v,v+=8,w+=y[l++]<<v,v+=8),U=A[w&x];t:for(;;){if(w>>>=N=U>>>24,v-=N,(N=U>>>16&255)===0)Y[h++]=65535&U;else{if(!(16&N)){if(!(64&N)){U=A[(65535&U)+(w&(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&&(w+=y[l++]<<v,v+=8),I+=w&(1<<N)-1,w>>>=N,v-=N),v<15&&(w+=y[l++]<<v,v+=8,w+=y[l++]<<v,v+=8),U=C[w&z];n:for(;;){if(w>>>=N=U>>>24,v-=N,!(16&(N=U>>>16&255))){if(!(64&N)){U=C[(65535&U)+(w&(1<<N)-1)];continue n}o.msg="invalid distance code",a.mode=30;break e}if(W=65535&U,v<(N&=15)&&(w+=y[l++]<<v,(v+=8)<N&&(w+=y[l++]<<v,v+=8)),c<(W+=w&(1<<N)-1)){o.msg="invalid distance too far back",a.mode=30;break e}if(w>>>=N,v-=N,(N=h-m)<W){if(u<(N=W-N)&&a.sane){o.msg="invalid distance too far back",a.mode=30;break e}if(Z=_,(T=0)===b){if(T+=g-N,N<I){for(I-=N;Y[h++]=_[T++],--N;);T=h-W,Z=Y}}else if(b<N){if(T+=g+b-N,(N-=b)<I){for(I-=N;Y[h++]=_[T++],--N;);if(T=0,b<I){for(I-=N=b;Y[h++]=_[T++],--N;);T=h-W,Z=Y}}}else if(T+=b-N,N<I){for(I-=N;Y[h++]=_[T++],--N;);T=h-W,Z=Y}for(;2<I;)Y[h++]=Z[T++],Y[h++]=Z[T++],Y[h++]=Z[T++],I-=3;I&&(Y[h++]=Z[T++],1<I&&(Y[h++]=Z[T++]))}else{for(T=h-W;Y[h++]=Y[T++],Y[h++]=Y[T++],Y[h++]=Y[T++],2<(I-=3););I&&(Y[h++]=Y[T++],1<I&&(Y[h++]=Y[T++]))}break}}break}}while(l<p&&h<d);l-=I=v>>3,w&=(1<<(v-=I<<3))-1,o.next_in=l,o.next_out=h,o.avail_in=l<p?p-l+5:5-(l-p),o.avail_out=h<d?d-h+257:257-(h-d),a.hold=w,a.bits=v}},{}],49:[function(e,r,i){var o=e("../utils/common"),s=e("./adler32"),a=e("./crc32"),l=e("./inffast"),p=e("./inftrees"),h=1,m=2,d=0,c=-2,g=1,u=852,b=592;function _(T){return(T>>>24&255)+(T>>>8&65280)+((65280&T)<<8)+((255&T)<<24)}function w(){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(T){var Z;return T&&T.state?(Z=T.state,T.total_in=T.total_out=Z.total=0,T.msg="",Z.wrap&&(T.adler=1&Z.wrap),Z.mode=g,Z.last=0,Z.havedict=0,Z.dmax=32768,Z.head=null,Z.hold=0,Z.bits=0,Z.lencode=Z.lendyn=new o.Buf32(u),Z.distcode=Z.distdyn=new o.Buf32(b),Z.sane=1,Z.back=-1,d):c}function A(T){var Z;return T&&T.state?((Z=T.state).wsize=0,Z.whave=0,Z.wnext=0,v(T)):c}function C(T,Z){var y,Y;return T&&T.state?(Y=T.state,Z<0?(y=0,Z=-Z):(y=1+(Z>>4),Z<48&&(Z&=15)),Z&&(Z<8||15<Z)?c:(Y.window!==null&&Y.wbits!==Z&&(Y.window=null),Y.wrap=y,Y.wbits=Z,A(T))):c}function x(T,Z){var y,Y;return T?(Y=new w,(T.state=Y).window=null,(y=C(T,Z))!==d&&(T.state=null),y):c}var z,U,N=!0;function I(T){if(N){var Z;for(z=new o.Buf32(512),U=new o.Buf32(32),Z=0;Z<144;)T.lens[Z++]=8;for(;Z<256;)T.lens[Z++]=9;for(;Z<280;)T.lens[Z++]=7;for(;Z<288;)T.lens[Z++]=8;for(p(h,T.lens,0,288,z,0,T.work,{bits:9}),Z=0;Z<32;)T.lens[Z++]=5;p(m,T.lens,0,32,U,0,T.work,{bits:5}),N=!1}T.lencode=z,T.lenbits=9,T.distcode=U,T.distbits=5}function W(T,Z,y,Y){var fe,K=T.state;return K.window===null&&(K.wsize=1<<K.wbits,K.wnext=0,K.whave=0,K.window=new o.Buf8(K.wsize)),Y>=K.wsize?(o.arraySet(K.window,Z,y-K.wsize,K.wsize,0),K.wnext=0,K.whave=K.wsize):(Y<(fe=K.wsize-K.wnext)&&(fe=Y),o.arraySet(K.window,Z,y-Y,fe,K.wnext),(Y-=fe)?(o.arraySet(K.window,Z,y-Y,Y,0),K.wnext=Y,K.whave=K.wsize):(K.wnext+=fe,K.wnext===K.wsize&&(K.wnext=0),K.whave<K.wsize&&(K.whave+=fe))),0}i.inflateReset=A,i.inflateReset2=C,i.inflateResetKeep=v,i.inflateInit=function(T){return x(T,15)},i.inflateInit2=x,i.inflate=function(T,Z){var y,Y,fe,K,re,q,oe,D,M,ue,ie,X,Ae,Re,ye,le,Ie,be,Ce,he,f,H,j,S,E=0,L=new o.Buf8(4),G=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!T||!T.state||!T.output||!T.input&&T.avail_in!==0)return c;(y=T.state).mode===12&&(y.mode=13),re=T.next_out,fe=T.output,oe=T.avail_out,K=T.next_in,Y=T.input,q=T.avail_in,D=y.hold,M=y.bits,ue=q,ie=oe,H=d;e:for(;;)switch(y.mode){case g:if(y.wrap===0){y.mode=13;break}for(;M<16;){if(q===0)break e;q--,D+=Y[K++]<<M,M+=8}if(2&y.wrap&&D===35615){L[y.check=0]=255&D,L[1]=D>>>8&255,y.check=a(y.check,L,2,0),M=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){T.msg="incorrect header check",y.mode=30;break}if((15&D)!=8){T.msg="unknown compression method",y.mode=30;break}if(M-=4,f=8+(15&(D>>>=4)),y.wbits===0)y.wbits=f;else if(f>y.wbits){T.msg="invalid window size",y.mode=30;break}y.dmax=1<<f,T.adler=y.check=1,y.mode=512&D?10:12,M=D=0;break;case 2:for(;M<16;){if(q===0)break e;q--,D+=Y[K++]<<M,M+=8}if(y.flags=D,(255&y.flags)!=8){T.msg="unknown compression method",y.mode=30;break}if(57344&y.flags){T.msg="unknown header flags set",y.mode=30;break}y.head&&(y.head.text=D>>8&1),512&y.flags&&(L[0]=255&D,L[1]=D>>>8&255,y.check=a(y.check,L,2,0)),M=D=0,y.mode=3;case 3:for(;M<32;){if(q===0)break e;q--,D+=Y[K++]<<M,M+=8}y.head&&(y.head.time=D),512&y.flags&&(L[0]=255&D,L[1]=D>>>8&255,L[2]=D>>>16&255,L[3]=D>>>24&255,y.check=a(y.check,L,4,0)),M=D=0,y.mode=4;case 4:for(;M<16;){if(q===0)break e;q--,D+=Y[K++]<<M,M+=8}y.head&&(y.head.xflags=255&D,y.head.os=D>>8),512&y.flags&&(L[0]=255&D,L[1]=D>>>8&255,y.check=a(y.check,L,2,0)),M=D=0,y.mode=5;case 5:if(1024&y.flags){for(;M<16;){if(q===0)break e;q--,D+=Y[K++]<<M,M+=8}y.length=D,y.head&&(y.head.extra_len=D),512&y.flags&&(L[0]=255&D,L[1]=D>>>8&255,y.check=a(y.check,L,2,0)),M=D=0}else y.head&&(y.head.extra=null);y.mode=6;case 6:if(1024&y.flags&&(q<(X=y.length)&&(X=q),X&&(y.head&&(f=y.head.extra_len-y.length,y.head.extra||(y.head.extra=new Array(y.head.extra_len)),o.arraySet(y.head.extra,Y,K,X,f)),512&y.flags&&(y.check=a(y.check,Y,X,K)),q-=X,K+=X,y.length-=X),y.length))break e;y.length=0,y.mode=7;case 7:if(2048&y.flags){if(q===0)break e;for(X=0;f=Y[K+X++],y.head&&f&&y.length<65536&&(y.head.name+=String.fromCharCode(f)),f&&X<q;);if(512&y.flags&&(y.check=a(y.check,Y,X,K)),q-=X,K+=X,f)break e}else y.head&&(y.head.name=null);y.length=0,y.mode=8;case 8:if(4096&y.flags){if(q===0)break e;for(X=0;f=Y[K+X++],y.head&&f&&y.length<65536&&(y.head.comment+=String.fromCharCode(f)),f&&X<q;);if(512&y.flags&&(y.check=a(y.check,Y,X,K)),q-=X,K+=X,f)break e}else y.head&&(y.head.comment=null);y.mode=9;case 9:if(512&y.flags){for(;M<16;){if(q===0)break e;q--,D+=Y[K++]<<M,M+=8}if(D!==(65535&y.check)){T.msg="header crc mismatch",y.mode=30;break}M=D=0}y.head&&(y.head.hcrc=y.flags>>9&1,y.head.done=!0),T.adler=y.check=0,y.mode=12;break;case 10:for(;M<32;){if(q===0)break e;q--,D+=Y[K++]<<M,M+=8}T.adler=y.check=_(D),M=D=0,y.mode=11;case 11:if(y.havedict===0)return T.next_out=re,T.avail_out=oe,T.next_in=K,T.avail_in=q,y.hold=D,y.bits=M,2;T.adler=y.check=1,y.mode=12;case 12:if(Z===5||Z===6)break e;case 13:if(y.last){D>>>=7&M,M-=7&M,y.mode=27;break}for(;M<3;){if(q===0)break e;q--,D+=Y[K++]<<M,M+=8}switch(y.last=1&D,M-=1,3&(D>>>=1)){case 0:y.mode=14;break;case 1:if(I(y),y.mode=20,Z!==6)break;D>>>=2,M-=2;break e;case 2:y.mode=17;break;case 3:T.msg="invalid block type",y.mode=30}D>>>=2,M-=2;break;case 14:for(D>>>=7&M,M-=7&M;M<32;){if(q===0)break e;q--,D+=Y[K++]<<M,M+=8}if((65535&D)!=(D>>>16^65535)){T.msg="invalid stored block lengths",y.mode=30;break}if(y.length=65535&D,M=D=0,y.mode=15,Z===6)break e;case 15:y.mode=16;case 16:if(X=y.length){if(q<X&&(X=q),oe<X&&(X=oe),X===0)break e;o.arraySet(fe,Y,K,X,re),q-=X,K+=X,oe-=X,re+=X,y.length-=X;break}y.mode=12;break;case 17:for(;M<14;){if(q===0)break e;q--,D+=Y[K++]<<M,M+=8}if(y.nlen=257+(31&D),D>>>=5,M-=5,y.ndist=1+(31&D),D>>>=5,M-=5,y.ncode=4+(15&D),D>>>=4,M-=4,286<y.nlen||30<y.ndist){T.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(;M<3;){if(q===0)break e;q--,D+=Y[K++]<<M,M+=8}y.lens[G[y.have++]]=7&D,D>>>=3,M-=3}for(;y.have<19;)y.lens[G[y.have++]]=0;if(y.lencode=y.lendyn,y.lenbits=7,j={bits:y.lenbits},H=p(0,y.lens,0,19,y.lencode,0,y.work,j),y.lenbits=j.bits,H){T.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=(E=y.lencode[D&(1<<y.lenbits)-1])>>>16&255,Ie=65535&E,!((ye=E>>>24)<=M);){if(q===0)break e;q--,D+=Y[K++]<<M,M+=8}if(Ie<16)D>>>=ye,M-=ye,y.lens[y.have++]=Ie;else{if(Ie===16){for(S=ye+2;M<S;){if(q===0)break e;q--,D+=Y[K++]<<M,M+=8}if(D>>>=ye,M-=ye,y.have===0){T.msg="invalid bit length repeat",y.mode=30;break}f=y.lens[y.have-1],X=3+(3&D),D>>>=2,M-=2}else if(Ie===17){for(S=ye+3;M<S;){if(q===0)break e;q--,D+=Y[K++]<<M,M+=8}M-=ye,f=0,X=3+(7&(D>>>=ye)),D>>>=3,M-=3}else{for(S=ye+7;M<S;){if(q===0)break e;q--,D+=Y[K++]<<M,M+=8}M-=ye,f=0,X=11+(127&(D>>>=ye)),D>>>=7,M-=7}if(y.have+X>y.nlen+y.ndist){T.msg="invalid bit length repeat",y.mode=30;break}for(;X--;)y.lens[y.have++]=f}}if(y.mode===30)break;if(y.lens[256]===0){T.msg="invalid code -- missing end-of-block",y.mode=30;break}if(y.lenbits=9,j={bits:y.lenbits},H=p(h,y.lens,0,y.nlen,y.lencode,0,y.work,j),y.lenbits=j.bits,H){T.msg="invalid literal/lengths set",y.mode=30;break}if(y.distbits=6,y.distcode=y.distdyn,j={bits:y.distbits},H=p(m,y.lens,y.nlen,y.ndist,y.distcode,0,y.work,j),y.distbits=j.bits,H){T.msg="invalid distances set",y.mode=30;break}if(y.mode=20,Z===6)break e;case 20:y.mode=21;case 21:if(6<=q&&258<=oe){T.next_out=re,T.avail_out=oe,T.next_in=K,T.avail_in=q,y.hold=D,y.bits=M,l(T,ie),re=T.next_out,fe=T.output,oe=T.avail_out,K=T.next_in,Y=T.input,q=T.avail_in,D=y.hold,M=y.bits,y.mode===12&&(y.back=-1);break}for(y.back=0;le=(E=y.lencode[D&(1<<y.lenbits)-1])>>>16&255,Ie=65535&E,!((ye=E>>>24)<=M);){if(q===0)break e;q--,D+=Y[K++]<<M,M+=8}if(le&&!(240&le)){for(be=ye,Ce=le,he=Ie;le=(E=y.lencode[he+((D&(1<<be+Ce)-1)>>be)])>>>16&255,Ie=65535&E,!(be+(ye=E>>>24)<=M);){if(q===0)break e;q--,D+=Y[K++]<<M,M+=8}D>>>=be,M-=be,y.back+=be}if(D>>>=ye,M-=ye,y.back+=ye,y.length=Ie,le===0){y.mode=26;break}if(32&le){y.back=-1,y.mode=12;break}if(64&le){T.msg="invalid literal/length code",y.mode=30;break}y.extra=15&le,y.mode=22;case 22:if(y.extra){for(S=y.extra;M<S;){if(q===0)break e;q--,D+=Y[K++]<<M,M+=8}y.length+=D&(1<<y.extra)-1,D>>>=y.extra,M-=y.extra,y.back+=y.extra}y.was=y.length,y.mode=23;case 23:for(;le=(E=y.distcode[D&(1<<y.distbits)-1])>>>16&255,Ie=65535&E,!((ye=E>>>24)<=M);){if(q===0)break e;q--,D+=Y[K++]<<M,M+=8}if(!(240&le)){for(be=ye,Ce=le,he=Ie;le=(E=y.distcode[he+((D&(1<<be+Ce)-1)>>be)])>>>16&255,Ie=65535&E,!(be+(ye=E>>>24)<=M);){if(q===0)break e;q--,D+=Y[K++]<<M,M+=8}D>>>=be,M-=be,y.back+=be}if(D>>>=ye,M-=ye,y.back+=ye,64&le){T.msg="invalid distance code",y.mode=30;break}y.offset=Ie,y.extra=15&le,y.mode=24;case 24:if(y.extra){for(S=y.extra;M<S;){if(q===0)break e;q--,D+=Y[K++]<<M,M+=8}y.offset+=D&(1<<y.extra)-1,D>>>=y.extra,M-=y.extra,y.back+=y.extra}if(y.offset>y.dmax){T.msg="invalid distance too far back",y.mode=30;break}y.mode=25;case 25:if(oe===0)break e;if(X=ie-oe,y.offset>X){if((X=y.offset-X)>y.whave&&y.sane){T.msg="invalid distance too far back",y.mode=30;break}Ae=X>y.wnext?(X-=y.wnext,y.wsize-X):y.wnext-X,X>y.length&&(X=y.length),Re=y.window}else Re=fe,Ae=re-y.offset,X=y.length;for(oe<X&&(X=oe),oe-=X,y.length-=X;fe[re++]=Re[Ae++],--X;);y.length===0&&(y.mode=21);break;case 26:if(oe===0)break e;fe[re++]=y.length,oe--,y.mode=21;break;case 27:if(y.wrap){for(;M<32;){if(q===0)break e;q--,D|=Y[K++]<<M,M+=8}if(ie-=oe,T.total_out+=ie,y.total+=ie,ie&&(T.adler=y.check=y.flags?a(y.check,fe,ie,re-ie):s(y.check,fe,ie,re-ie)),ie=oe,(y.flags?D:_(D))!==y.check){T.msg="incorrect data check",y.mode=30;break}M=D=0}y.mode=28;case 28:if(y.wrap&&y.flags){for(;M<32;){if(q===0)break e;q--,D+=Y[K++]<<M,M+=8}if(D!==(4294967295&y.total)){T.msg="incorrect length check",y.mode=30;break}M=D=0}y.mode=29;case 29:H=1;break e;case 30:H=-3;break e;case 31:return-4;case 32:default:return c}return T.next_out=re,T.avail_out=oe,T.next_in=K,T.avail_in=q,y.hold=D,y.bits=M,(y.wsize||ie!==T.avail_out&&y.mode<30&&(y.mode<27||Z!==4))&&W(T,T.output,T.next_out,ie-T.avail_out)?(y.mode=31,-4):(ue-=T.avail_in,ie-=T.avail_out,T.total_in+=ue,T.total_out+=ie,y.total+=ie,y.wrap&&ie&&(T.adler=y.check=y.flags?a(y.check,fe,ie,T.next_out-ie):s(y.check,fe,ie,T.next_out-ie)),T.data_type=y.bits+(y.last?64:0)+(y.mode===12?128:0)+(y.mode===20||y.mode===15?256:0),(ue==0&&ie===0||Z===4)&&H===d&&(H=-5),H)},i.inflateEnd=function(T){if(!T||!T.state)return c;var Z=T.state;return Z.window&&(Z.window=null),T.state=null,d},i.inflateGetHeader=function(T,Z){var y;return T&&T.state&&2&(y=T.state).wrap?((y.head=Z).done=!1,d):c},i.inflateSetDictionary=function(T,Z){var y,Y=Z.length;return T&&T.state?(y=T.state).wrap!==0&&y.mode!==11?c:y.mode===11&&s(1,Z,Y,0)!==y.check?-3:W(T,Z,Y,Y)?(y.mode=31,-4):(y.havedict=1,d):c},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],p=[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(h,m,d,c,g,u,b,_){var w,v,A,C,x,z,U,N,I,W=_.bits,T=0,Z=0,y=0,Y=0,fe=0,K=0,re=0,q=0,oe=0,D=0,M=null,ue=0,ie=new o.Buf16(16),X=new o.Buf16(16),Ae=null,Re=0;for(T=0;T<=15;T++)ie[T]=0;for(Z=0;Z<c;Z++)ie[m[d+Z]]++;for(fe=W,Y=15;1<=Y&&ie[Y]===0;Y--);if(Y<fe&&(fe=Y),Y===0)return g[u++]=20971520,g[u++]=20971520,_.bits=1,0;for(y=1;y<Y&&ie[y]===0;y++);for(fe<y&&(fe=y),T=q=1;T<=15;T++)if(q<<=1,(q-=ie[T])<0)return-1;if(0<q&&(h===0||Y!==1))return-1;for(X[1]=0,T=1;T<15;T++)X[T+1]=X[T]+ie[T];for(Z=0;Z<c;Z++)m[d+Z]!==0&&(b[X[m[d+Z]]++]=Z);if(z=h===0?(M=Ae=b,19):h===1?(M=s,ue-=257,Ae=a,Re-=257,256):(M=l,Ae=p,-1),T=y,x=u,re=Z=D=0,A=-1,C=(oe=1<<(K=fe))-1,h===1&&852<oe||h===2&&592<oe)return 1;for(;;){for(U=T-re,I=b[Z]<z?(N=0,b[Z]):b[Z]>z?(N=Ae[Re+b[Z]],M[ue+b[Z]]):(N=96,0),w=1<<T-re,y=v=1<<K;g[x+(D>>re)+(v-=w)]=U<<24|N<<16|I|0,v!==0;);for(w=1<<T-1;D&w;)w>>=1;if(w!==0?(D&=w-1,D+=w):D=0,Z++,--ie[T]==0){if(T===Y)break;T=m[d+b[Z]]}if(fe<T&&(D&C)!==A){for(re===0&&(re=fe),x+=y,q=1<<(K=T-re);K+re<Y&&!((q-=ie[K+re])<=0);)K++,q<<=1;if(oe+=1<<K,h===1&&852<oe||h===2&&592<oe)return 1;g[A=D&C]=fe<<24|K<<16|x-u|0}}return D!==0&&(g[x+D]=T-re<<24|64<<16|0),_.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(E){for(var L=E.length;0<=--L;)E[L]=0}var p=0,h=29,m=256,d=m+1+h,c=30,g=19,u=2*d+1,b=15,_=16,w=7,v=256,A=16,C=17,x=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],W=new Array(2*(d+2));l(W);var T=new Array(2*c);l(T);var Z=new Array(512);l(Z);var y=new Array(256);l(y);var Y=new Array(h);l(Y);var fe,K,re,q=new Array(c);function oe(E,L,G,P,R){this.static_tree=E,this.extra_bits=L,this.extra_base=G,this.elems=P,this.max_length=R,this.has_stree=E&&E.length}function D(E,L){this.dyn_tree=E,this.max_code=0,this.stat_desc=L}function M(E){return E<256?Z[E]:Z[256+(E>>>7)]}function ue(E,L){E.pending_buf[E.pending++]=255&L,E.pending_buf[E.pending++]=L>>>8&255}function ie(E,L,G){E.bi_valid>_-G?(E.bi_buf|=L<<E.bi_valid&65535,ue(E,E.bi_buf),E.bi_buf=L>>_-E.bi_valid,E.bi_valid+=G-_):(E.bi_buf|=L<<E.bi_valid&65535,E.bi_valid+=G)}function X(E,L,G){ie(E,G[2*L],G[2*L+1])}function Ae(E,L){for(var G=0;G|=1&E,E>>>=1,G<<=1,0<--L;);return G>>>1}function Re(E,L,G){var P,R,ee=new Array(b+1),ae=0;for(P=1;P<=b;P++)ee[P]=ae=ae+G[P-1]<<1;for(R=0;R<=L;R++){var ne=E[2*R+1];ne!==0&&(E[2*R]=Ae(ee[ne]++,ne))}}function ye(E){var L;for(L=0;L<d;L++)E.dyn_ltree[2*L]=0;for(L=0;L<c;L++)E.dyn_dtree[2*L]=0;for(L=0;L<g;L++)E.bl_tree[2*L]=0;E.dyn_ltree[2*v]=1,E.opt_len=E.static_len=0,E.last_lit=E.matches=0}function le(E){8<E.bi_valid?ue(E,E.bi_buf):0<E.bi_valid&&(E.pending_buf[E.pending++]=E.bi_buf),E.bi_buf=0,E.bi_valid=0}function Ie(E,L,G,P){var R=2*L,ee=2*G;return E[R]<E[ee]||E[R]===E[ee]&&P[L]<=P[G]}function be(E,L,G){for(var P=E.heap[G],R=G<<1;R<=E.heap_len&&(R<E.heap_len&&Ie(L,E.heap[R+1],E.heap[R],E.depth)&&R++,!Ie(L,P,E.heap[R],E.depth));)E.heap[G]=E.heap[R],G=R,R<<=1;E.heap[G]=P}function Ce(E,L,G){var P,R,ee,ae,ne=0;if(E.last_lit!==0)for(;P=E.pending_buf[E.d_buf+2*ne]<<8|E.pending_buf[E.d_buf+2*ne+1],R=E.pending_buf[E.l_buf+ne],ne++,P===0?X(E,R,L):(X(E,(ee=y[R])+m+1,L),(ae=z[ee])!==0&&ie(E,R-=Y[ee],ae),X(E,ee=M(--P),G),(ae=U[ee])!==0&&ie(E,P-=q[ee],ae)),ne<E.last_lit;);X(E,v,L)}function he(E,L){var G,P,R,ee=L.dyn_tree,ae=L.stat_desc.static_tree,ne=L.stat_desc.has_stree,pe=L.stat_desc.elems,ke=-1;for(E.heap_len=0,E.heap_max=u,G=0;G<pe;G++)ee[2*G]!==0?(E.heap[++E.heap_len]=ke=G,E.depth[G]=0):ee[2*G+1]=0;for(;E.heap_len<2;)ee[2*(R=E.heap[++E.heap_len]=ke<2?++ke:0)]=1,E.depth[R]=0,E.opt_len--,ne&&(E.static_len-=ae[2*R+1]);for(L.max_code=ke,G=E.heap_len>>1;1<=G;G--)be(E,ee,G);for(R=pe;G=E.heap[1],E.heap[1]=E.heap[E.heap_len--],be(E,ee,1),P=E.heap[1],E.heap[--E.heap_max]=G,E.heap[--E.heap_max]=P,ee[2*R]=ee[2*G]+ee[2*P],E.depth[R]=(E.depth[G]>=E.depth[P]?E.depth[G]:E.depth[P])+1,ee[2*G+1]=ee[2*P+1]=R,E.heap[1]=R++,be(E,ee,1),2<=E.heap_len;);E.heap[--E.heap_max]=E.heap[1],function(we,Pe){var yt,He,dt,Le,at,wt,Ye=Pe.dyn_tree,Ut=Pe.max_code,Qt=Pe.stat_desc.static_tree,$t=Pe.stat_desc.has_stree,jt=Pe.stat_desc.extra_bits,Ot=Pe.stat_desc.extra_base,$e=Pe.stat_desc.max_length,lt=0;for(Le=0;Le<=b;Le++)we.bl_count[Le]=0;for(Ye[2*we.heap[we.heap_max]+1]=0,yt=we.heap_max+1;yt<u;yt++)$e<(Le=Ye[2*Ye[2*(He=we.heap[yt])+1]+1]+1)&&(Le=$e,lt++),Ye[2*He+1]=Le,Ut<He||(we.bl_count[Le]++,at=0,Ot<=He&&(at=jt[He-Ot]),wt=Ye[2*He],we.opt_len+=wt*(Le+at),$t&&(we.static_len+=wt*(Qt[2*He+1]+at)));if(lt!==0){do{for(Le=$e-1;we.bl_count[Le]===0;)Le--;we.bl_count[Le]--,we.bl_count[Le+1]+=2,we.bl_count[$e]--,lt-=2}while(0<lt);for(Le=$e;Le!==0;Le--)for(He=we.bl_count[Le];He!==0;)Ut<(dt=we.heap[--yt])||(Ye[2*dt+1]!==Le&&(we.opt_len+=(Le-Ye[2*dt+1])*Ye[2*dt],Ye[2*dt+1]=Le),He--)}}(E,L),Re(ee,ke,E.bl_count)}function f(E,L,G){var P,R,ee=-1,ae=L[1],ne=0,pe=7,ke=4;for(ae===0&&(pe=138,ke=3),L[2*(G+1)+1]=65535,P=0;P<=G;P++)R=ae,ae=L[2*(P+1)+1],++ne<pe&&R===ae||(ne<ke?E.bl_tree[2*R]+=ne:R!==0?(R!==ee&&E.bl_tree[2*R]++,E.bl_tree[2*A]++):ne<=10?E.bl_tree[2*C]++:E.bl_tree[2*x]++,ee=R,ke=(ne=0)===ae?(pe=138,3):R===ae?(pe=6,3):(pe=7,4))}function H(E,L,G){var P,R,ee=-1,ae=L[1],ne=0,pe=7,ke=4;for(ae===0&&(pe=138,ke=3),P=0;P<=G;P++)if(R=ae,ae=L[2*(P+1)+1],!(++ne<pe&&R===ae)){if(ne<ke)for(;X(E,R,E.bl_tree),--ne!=0;);else R!==0?(R!==ee&&(X(E,R,E.bl_tree),ne--),X(E,A,E.bl_tree),ie(E,ne-3,2)):ne<=10?(X(E,C,E.bl_tree),ie(E,ne-3,3)):(X(E,x,E.bl_tree),ie(E,ne-11,7));ee=R,ke=(ne=0)===ae?(pe=138,3):R===ae?(pe=6,3):(pe=7,4)}}l(q);var j=!1;function S(E,L,G,P){ie(E,(p<<1)+(P?1:0),3),function(R,ee,ae,ne){le(R),ue(R,ae),ue(R,~ae),o.arraySet(R.pending_buf,R.window,ee,ae,R.pending),R.pending+=ae}(E,L,G)}i._tr_init=function(E){j||(function(){var L,G,P,R,ee,ae=new Array(b+1);for(R=P=0;R<h-1;R++)for(Y[R]=P,L=0;L<1<<z[R];L++)y[P++]=R;for(y[P-1]=R,R=ee=0;R<16;R++)for(q[R]=ee,L=0;L<1<<U[R];L++)Z[ee++]=R;for(ee>>=7;R<c;R++)for(q[R]=ee<<7,L=0;L<1<<U[R]-7;L++)Z[256+ee++]=R;for(G=0;G<=b;G++)ae[G]=0;for(L=0;L<=143;)W[2*L+1]=8,L++,ae[8]++;for(;L<=255;)W[2*L+1]=9,L++,ae[9]++;for(;L<=279;)W[2*L+1]=7,L++,ae[7]++;for(;L<=287;)W[2*L+1]=8,L++,ae[8]++;for(Re(W,d+1,ae),L=0;L<c;L++)T[2*L+1]=5,T[2*L]=Ae(L,5);fe=new oe(W,z,m+1,d,b),K=new oe(T,U,0,c,b),re=new oe(new Array(0),N,0,g,w)}(),j=!0),E.l_desc=new D(E.dyn_ltree,fe),E.d_desc=new D(E.dyn_dtree,K),E.bl_desc=new D(E.bl_tree,re),E.bi_buf=0,E.bi_valid=0,ye(E)},i._tr_stored_block=S,i._tr_flush_block=function(E,L,G,P){var R,ee,ae=0;0<E.level?(E.strm.data_type===2&&(E.strm.data_type=function(ne){var pe,ke=4093624447;for(pe=0;pe<=31;pe++,ke>>>=1)if(1&ke&&ne.dyn_ltree[2*pe]!==0)return s;if(ne.dyn_ltree[18]!==0||ne.dyn_ltree[20]!==0||ne.dyn_ltree[26]!==0)return a;for(pe=32;pe<m;pe++)if(ne.dyn_ltree[2*pe]!==0)return a;return s}(E)),he(E,E.l_desc),he(E,E.d_desc),ae=function(ne){var pe;for(f(ne,ne.dyn_ltree,ne.l_desc.max_code),f(ne,ne.dyn_dtree,ne.d_desc.max_code),he(ne,ne.bl_desc),pe=g-1;3<=pe&&ne.bl_tree[2*I[pe]+1]===0;pe--);return ne.opt_len+=3*(pe+1)+5+5+4,pe}(E),R=E.opt_len+3+7>>>3,(ee=E.static_len+3+7>>>3)<=R&&(R=ee)):R=ee=G+5,G+4<=R&&L!==-1?S(E,L,G,P):E.strategy===4||ee===R?(ie(E,2+(P?1:0),3),Ce(E,W,T)):(ie(E,4+(P?1:0),3),function(ne,pe,ke,we){var Pe;for(ie(ne,pe-257,5),ie(ne,ke-1,5),ie(ne,we-4,4),Pe=0;Pe<we;Pe++)ie(ne,ne.bl_tree[2*I[Pe]+1],3);H(ne,ne.dyn_ltree,pe-1),H(ne,ne.dyn_dtree,ke-1)}(E,E.l_desc.max_code+1,E.d_desc.max_code+1,ae+1),Ce(E,E.dyn_ltree,E.dyn_dtree)),ye(E),P&&le(E)},i._tr_tally=function(E,L,G){return E.pending_buf[E.d_buf+2*E.last_lit]=L>>>8&255,E.pending_buf[E.d_buf+2*E.last_lit+1]=255&L,E.pending_buf[E.l_buf+E.last_lit]=255&G,E.last_lit++,L===0?E.dyn_ltree[2*G]++:(E.matches++,L--,E.dyn_ltree[2*(y[G]+m+1)]++,E.dyn_dtree[2*M(L)]++),E.last_lit===E.lit_bufsize-1},i._tr_align=function(E){ie(E,2,3),X(E,v,W),function(L){L.bi_valid===16?(ue(L,L.bi_buf),L.bi_buf=0,L.bi_valid=0):8<=L.bi_valid&&(L.pending_buf[L.pending++]=255&L.bi_buf,L.bi_buf>>=8,L.bi_valid-=8)}(E)}},{"../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,p,h,m,d=1,c={},g=!1,u=s.document,b=Object.getPrototypeOf&&Object.getPrototypeOf(s);b=b&&b.setTimeout?b:s,l={}.toString.call(s.process)==="[object process]"?function(A){process.nextTick(function(){w(A)})}:function(){if(s.postMessage&&!s.importScripts){var A=!0,C=s.onmessage;return s.onmessage=function(){A=!1},s.postMessage("","*"),s.onmessage=C,A}}()?(m="setImmediate$"+Math.random()+"$",s.addEventListener?s.addEventListener("message",v,!1):s.attachEvent("onmessage",v),function(A){s.postMessage(m+A,"*")}):s.MessageChannel?((h=new MessageChannel).port1.onmessage=function(A){w(A.data)},function(A){h.port2.postMessage(A)}):u&&"onreadystatechange"in u.createElement("script")?(p=u.documentElement,function(A){var C=u.createElement("script");C.onreadystatechange=function(){w(A),C.onreadystatechange=null,p.removeChild(C),C=null},p.appendChild(C)}):function(A){setTimeout(w,0,A)},b.setImmediate=function(A){typeof A!="function"&&(A=new Function(""+A));for(var C=new Array(arguments.length-1),x=0;x<C.length;x++)C[x]=arguments[x+1];var z={callback:A,args:C};return c[d]=z,l(d),d++},b.clearImmediate=_}function _(A){delete c[A]}function w(A){if(g)setTimeout(w,0,A);else{var C=c[A];if(C){g=!0;try{(function(x){var z=x.callback,U=x.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)}})(C)}finally{_(A),g=!1}}}}function v(A){A.source===s&&typeof A.data=="string"&&A.data.indexOf(m)===0&&w(+A.data.slice(m.length))}})(typeof self>"u"?o===void 0?this:o:self)}).call(this,typeof cn<"u"?cn:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(Pi);var Vo=Pi.exports;const Xo=qo(Vo);async function Ko(n){let t;try{t=await Xo.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 Jo(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 Qo(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 Zr(n){let t,e,r,i,o,s,a,l,p,h,m,d=n[2]&&Gr(n);function c(b,_){return b[10]?ns:b[7]==="prompt"&&b[1]?ts:b[1]?es:$o}let g=c(n),u=g(n);return{c(){t=V("div"),e=V("div"),r=V("div"),i=V("span"),i.textContent="Import workspace",o=de(),s=V("button"),s.textContent="✕",a=de(),l=V("div"),d&&d.c(),p=de(),u.c(),O(i,"class","modal-title svelte-1f2jqat"),O(s,"class","modal-close-btn svelte-1f2jqat"),O(s,"aria-label","Close"),O(r,"class","modal-header svelte-1f2jqat"),O(l,"class","modal-body svelte-1f2jqat"),O(e,"class","modal svelte-1f2jqat"),O(e,"role","dialog"),O(e,"aria-modal","true"),O(e,"aria-label","Import workspace"),O(e,"tabindex","-1"),O(t,"class","modal-overlay svelte-1f2jqat")},m(b,_){$(b,t,_),F(t,e),F(e,r),F(r,i),F(r,o),F(r,s),F(e,a),F(e,l),d&&d.m(l,null),F(l,p),u.m(l,null),h||(m=[ve(s,"click",n[18]),pn(bn.call(null,e,{onEscape:n[18]})),ve(t,"click",zi(n[18]))],h=!0)},p(b,_){b[2]?d?d.p(b,_):(d=Gr(b),d.c(),d.m(l,p)):d&&(d.d(1),d=null),g===(g=c(b))&&u?u.p(b,_):(u.d(1),u=g(b),u&&(u.c(),u.m(l,null)))},d(b){b&&Q(t),d&&d.d(),u.d(),h=!1,Be(m)}}}function Gr(n){let t,e;return{c(){t=V("p"),e=se(n[2]),O(t,"class","modal-error svelte-1f2jqat")},m(r,i){$(r,t,i),F(t,e)},p(r,i){i&4&&Se(e,r[2])},d(r){r&&Q(t)}}}function $o(n){let t,e,r,i,o;function s(p,h){return p[3]?is:rs}let a=s(n),l=a(n);return{c(){t=V("div"),l.c(),e=de(),r=V("input"),O(t,"class","drop-zone svelte-1f2jqat"),O(t,"role","button"),O(t,"tabindex","0"),tt(t,"drag-over",n[4]),O(r,"type","file"),O(r,"accept",".zip"),O(r,"class","visually-hidden-input svelte-1f2jqat"),O(r,"aria-label","Choose a .zip file to import")},m(p,h){$(p,t,h),l.m(t,null),$(p,e,h),$(p,r,h),n[23](r),i||(o=[ve(t,"drop",n[15]),ve(t,"dragover",n[16]),ve(t,"dragleave",n[17]),ve(t,"click",n[21]),ve(t,"keydown",n[22]),ve(r,"change",n[14])],i=!0)},p(p,h){a!==(a=s(p))&&(l.d(1),l=a(p),l&&(l.c(),l.m(t,null))),h&16&&tt(t,"drag-over",p[4])},d(p){p&&(Q(t),Q(e),Q(r)),l.d(),n[23](null),i=!1,Be(o)}}}function es(n){let t,e,r,i=n[1].workspace+"",o,s,a=n[1].snapshots.length+"",l,p,h=n[1].snapshots.length===1?"":"s",m,d,c,g,u=(n[6]||n[9])&&Yr(n);return{c(){t=V("p"),e=se("Workspace: "),r=V("strong"),o=se(i),s=se(`
14
- (`),l=se(a),p=se(" snapshot"),m=se(h),d=se(")"),c=de(),u&&u.c(),g=ut(),O(t,"class","import-resolved svelte-1f2jqat")},m(b,_){$(b,t,_),F(t,e),F(t,r),F(r,o),F(t,s),F(t,l),F(t,p),F(t,m),F(t,d),$(b,c,_),u&&u.m(b,_),$(b,g,_)},p(b,_){_&2&&i!==(i=b[1].workspace+"")&&Se(o,i),_&2&&a!==(a=b[1].snapshots.length+"")&&Se(l,a),_&2&&h!==(h=b[1].snapshots.length===1?"":"s")&&Se(m,h),b[6]||b[9]?u?u.p(b,_):(u=Yr(b),u.c(),u.m(g.parentNode,g)):u&&(u.d(1),u=null)},d(b){b&&(Q(t),Q(c),Q(g)),u&&u.d(b)}}}function ts(n){let t,e,r,i=n[1].workspace+"",o,s,a,l,p,h,m,d,c,g,u,b,_,w,v,A,C,x;return{c(){t=V("p"),e=se("A workspace named "),r=V("strong"),o=se(i),s=se(" already exists."),a=de(),l=V("div"),p=V("button"),h=se("Merge"),m=de(),d=V("div"),c=V("input"),g=de(),u=V("button"),b=se("Import as new"),w=de(),v=V("button"),A=se("Cancel"),O(t,"class","import-resolved svelte-1f2jqat"),O(p,"class","collision-btn svelte-1f2jqat"),p.disabled=n[9],O(c,"type","text"),O(c,"aria-label","New workspace name"),c.disabled=n[9],O(c,"class","svelte-1f2jqat"),O(u,"class","collision-btn svelte-1f2jqat"),u.disabled=_=n[9]||n[8].trim().length===0,O(d,"class","collision-new svelte-1f2jqat"),O(v,"class","collision-btn collision-cancel svelte-1f2jqat"),v.disabled=n[9],O(l,"class","collision-actions svelte-1f2jqat")},m(z,U){$(z,t,U),F(t,e),F(t,r),F(r,o),F(t,s),$(z,a,U),$(z,l,U),F(l,p),F(p,h),F(l,m),F(l,d),F(d,c),kr(c,n[8]),F(d,g),F(d,u),F(u,b),F(l,w),F(l,v),F(v,A),C||(x=[ve(p,"click",n[11]),ve(c,"input",n[20]),ve(u,"click",n[12]),ve(v,"click",n[13])],C=!0)},p(z,U){U&2&&i!==(i=z[1].workspace+"")&&Se(o,i),U&512&&(p.disabled=z[9]),U&512&&(c.disabled=z[9]),U&256&&c.value!==z[8]&&kr(c,z[8]),U&768&&_!==(_=z[9]||z[8].trim().length===0)&&(u.disabled=_),U&512&&(v.disabled=z[9])},d(z){z&&(Q(t),Q(a),Q(l)),C=!1,Be(x)}}}function ns(n){let t,e,r,i,o,s,a=n[10].workspace+"",l,p,h=n[10].added+"",m,d,c=n[10].updated+"",g,u,b=n[10].skipped+"",_,w;return{c(){t=V("div"),e=V("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=de(),i=V("span"),o=se("Imported into "),s=V("strong"),l=se(a),p=se(` —
15
- `),m=se(h),d=se(" added, "),g=se(c),u=se(" updated, "),_=se(b),w=se(" skipped"),O(e,"class","check-circle svelte-1f2jqat"),O(t,"class","modal-confirm svelte-1f2jqat")},m(v,A){$(v,t,A),F(t,e),F(t,r),F(t,i),F(i,o),F(i,s),F(s,l),F(i,p),F(i,m),F(i,d),F(i,g),F(i,u),F(i,_),F(i,w)},p(v,A){A&1024&&a!==(a=v[10].workspace+"")&&Se(l,a),A&1024&&h!==(h=v[10].added+"")&&Se(m,h),A&1024&&c!==(c=v[10].updated+"")&&Se(g,c),A&1024&&b!==(b=v[10].skipped+"")&&Se(_,b)},d(v){v&&Q(t)}}}function rs(n){let t;return{c(){t=V("p"),t.innerHTML='Drop a <code class="svelte-1f2jqat">.zip</code> file here, or click to choose one'},m(e,r){$(e,t,r)},d(e){e&&Q(t)}}}function is(n){let t;return{c(){t=V("p"),t.textContent="Reading…"},m(e,r){$(e,t,r)},d(e){e&&Q(t)}}}function Yr(n){let t,e=n[9]?"Importing…":"Checking for existing workspaces…",r;return{c(){t=V("p"),r=se(e),O(t,"class","modal-step-hint svelte-1f2jqat")},m(i,o){$(i,t,o),F(t,r)},p(i,o){o&512&&e!==(e=i[9]?"Importing…":"Checking for existing workspaces…")&&Se(r,e)},d(i){i&&Q(t)}}}function os(n){let t,e=n[0]&&Zr(n);return{c(){e&&e.c(),t=ut()},m(r,i){e&&e.m(r,i),$(r,t,i)},p(r,[i]){r[0]?e?e.p(r,i):(e=Zr(r),e.c(),e.m(t.parentNode,t)):e&&(e.d(1),e=null)},i:ge,o:ge,d(r){r&&Q(t),e&&e.d(r)}}}function ss(n,t){let e=2,r=`${n} (${e})`;for(;t.includes(r);)e++,r=`${n} (${e})`;return r}function as(n,t,e){let{open:r=!1}=t;const i=gn();let o=null,s=null,a=null,l=!1,p=!1,h,m=[],d=!1,c=null,g="",u=!1,b=null,_=null;function w(){e(1,o=null),s=null,e(2,a=null),e(3,l=!1),e(4,p=!1),m=[],e(6,d=!1),e(7,c=null),e(8,g=""),e(9,u=!1),e(10,b=null),_&&clearTimeout(_),_=null}Jt(()=>{_&&clearTimeout(_)});async function v(re){if(!re.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 q=await Ko(re);if(e(3,l=!1),!q.ok){e(2,a=q.error),e(1,o=null);return}e(1,o=q.manifest),s=re,await A(q.manifest.workspace)}async function A(re){e(6,d=!0);const q=await Xn();if(e(6,d=!1),m=q.ok?q.workspaces.map(oe=>oe.name):[],m.includes(re)){e(8,g=ss(re,m)),e(7,c="prompt");return}await U(re,"create")}async function C(){o&&(e(7,c=null),await U(o.workspace,"merge"))}async function x(){const re=g.trim();re&&(e(7,c=null),await U(re,"create"))}function z(){w()}async function U(re,q){if(!s)return;e(9,u=!0),e(2,a=null);const oe=await Jo(s,re,q);if(e(9,u=!1),!oe.ok){e(2,a=oe.error);return}e(10,b=oe),oe.newestFilename&&Qo(oe.workspace,oe.newestFilename),i("imported"),_=setTimeout(()=>i("close"),1500)}function N(re){var D;const q=re.currentTarget,oe=(D=q.files)==null?void 0:D[0];oe&&v(oe),q.value=""}function I(re){var oe;re.preventDefault(),e(4,p=!1);const q=(oe=re.dataTransfer)==null?void 0:oe.files[0];q&&v(q)}function W(re){re.preventDefault(),e(4,p=!0)}function T(){e(4,p=!1)}function Z(){i("close")}function y(){g=this.value,e(8,g)}const Y=()=>h==null?void 0:h.click(),fe=re=>{(re.key==="Enter"||re.key===" ")&&(h==null||h.click())};function K(re){ft[re?"unshift":"push"](()=>{h=re,e(5,h)})}return n.$$set=re=>{"open"in re&&e(0,r=re.open)},n.$$.update=()=>{n.$$.dirty&1&&(r||w())},[r,o,a,l,p,h,d,c,g,u,b,C,x,z,N,I,W,T,Z,v,y,Y,fe,K]}class ls extends st{constructor(t){super(),ot(this,t,as,os,Qe,{open:0,acceptFile:19})}get acceptFile(){return this.$$.ctx[19]}}const qr={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}]};function Vr(n,t,e){const r=n.slice();return r[3]=t[e],r[5]=e,r}function cs(n){let t,e;return{c(){t=ct("polyline"),O(t,"points",e=n[3].points)},m(r,i){$(r,t,i)},p(r,i){i&1&&e!==(e=r[3].points)&&O(t,"points",e)},d(r){r&&Q(t)}}}function us(n){let t,e;return{c(){t=ct("path"),O(t,"d",e=n[3].d)},m(r,i){$(r,t,i)},p(r,i){i&1&&e!==(e=r[3].d)&&O(t,"d",e)},d(r){r&&Q(t)}}}function fs(n){let t,e,r,i,o;return{c(){t=ct("line"),O(t,"x1",e=n[3].x1),O(t,"y1",r=n[3].y1),O(t,"x2",i=n[3].x2),O(t,"y2",o=n[3].y2)},m(s,a){$(s,t,a)},p(s,a){a&1&&e!==(e=s[3].x1)&&O(t,"x1",e),a&1&&r!==(r=s[3].y1)&&O(t,"y1",r),a&1&&i!==(i=s[3].x2)&&O(t,"x2",i),a&1&&o!==(o=s[3].y2)&&O(t,"y2",o)},d(s){s&&Q(t)}}}function ds(n){let t,e,r,i;return{c(){t=ct("circle"),O(t,"cx",e=n[3].cx),O(t,"cy",r=n[3].cy),O(t,"r",i=n[3].r)},m(o,s){$(o,t,s)},p(o,s){s&1&&e!==(e=o[3].cx)&&O(t,"cx",e),s&1&&r!==(r=o[3].cy)&&O(t,"cy",r),s&1&&i!==(i=o[3].r)&&O(t,"r",i)},d(o){o&&Q(t)}}}function Xr(n,t){let e,r;function i(a,l){if(a[3].tag==="circle")return ds;if(a[3].tag==="line")return fs;if(a[3].tag==="path")return us;if(a[3].tag==="polyline")return cs}let o=i(t),s=o&&o(t);return{key:n,first:null,c(){e=ut(),s&&s.c(),r=ut(),this.first=e},m(a,l){$(a,e,l),s&&s.m(a,l),$(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&&(Q(e),Q(r)),s&&s.d(a)}}}function hs(n){let t,e=[],r=new Map,i=it(qr[n[0]]);const o=s=>s[5];for(let s=0;s<i.length;s+=1){let a=Vr(n,i,s),l=o(a);r.set(l,e[s]=Xr(l,a))}return{c(){t=ct("svg");for(let s=0;s<e.length;s+=1)e[s].c();O(t,"width",n[1]),O(t,"height",n[1]),O(t,"viewBox","0 0 24 24"),O(t,"fill","none"),O(t,"stroke","currentColor"),O(t,"stroke-width",n[2]),O(t,"stroke-linecap","round"),O(t,"stroke-linejoin","round"),O(t,"aria-hidden","true")},m(s,a){$(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=it(qr[s[0]]),e=Bt(e,a,o,1,s,i,r,t,qn,Xr,null,Vr)),a&2&&O(t,"width",s[1]),a&2&&O(t,"height",s[1]),a&4&&O(t,"stroke-width",s[2])},i:ge,o:ge,d(s){s&&Q(t);for(let a=0;a<e.length;a+=1)e[a].d()}}}function ps(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 Ct extends st{constructor(t){super(),ot(this,t,ps,hs,Qe,{name:0,size:1,strokeWidth:2})}}const Dt=[];function bt(n,t=ge){let e;const r=new Set;function i(a){if(Qe(n,a)&&(n=a,e)){const l=!Dt.length;for(const p of r)p[1](),Dt.push(p,n);if(l){for(let p=0;p<Dt.length;p+=2)Dt[p][0](Dt[p+1]);Dt.length=0}}}function o(a){i(a(n))}function s(a,l=ge){const p=[a,l];return r.add(p),r.size===1&&(e=t(i,o)||ge),a(n),()=>{r.delete(p),r.size===0&&e&&(e(),e=null)}}return{set:i,update:o,subscribe:s}}const ms={presentation:null,driver:"static",placeholder:null,clickable:!1,nodeActions:void 0,nodeToFrameEnabled:!1};function _s(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 gs(){const{subscribe:n,update:t}=bt(ms);return{subscribe:n,dispatch(e){t(r=>_s(r,e))}}}const xi=gs();function bs(){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 Kn=bs();function ys(){const n=bt({mode:null,workspaces:[],loadError:null});async function t(r){const i=await Xn();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 hn=ys(),Fi="agent-whiteboard:theme";function ws(){return localStorage.getItem(Fi)==="dark"?"dark":"light"}function vs(){const n=bt(ws());n.subscribe(e=>{document.documentElement.setAttribute("data-theme",e),localStorage.setItem(Fi,e)});function t(){n.update(e=>e==="light"?"dark":"light")}return{subscribe:n.subscribe,toggle:t}}const Mi=vs();async function Kr(n){await fetch("/step",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({direction:n})})}const ks=["mermaid","svg","html","katex","vega-lite"],Es=["replace","clear","set_node_actions","set_done_armed"];function Ss(n){if(typeof n!="object"||n===null)return!1;const t=n.action;if(!Es.includes(t))return!1;if(t!=="replace")return!0;const e=n.type;return e==="step-frames-placeholder"||ks.includes(e)}const Ts=500,As=1e4,Cs=10;function Os(n){const e=`${location.protocol==="https:"?"wss":"ws"}://${location.host}/stream`;let r,i=0,o=null,s=!1;function a(){const p=i>=Cs;if(window.dispatchEvent(new CustomEvent("ws:disconnected",{detail:{exhausted:p}})),p)return;const h=Math.min(Ts*2**i,As);i++,o=setTimeout(()=>{o=null,l()},h)}function l(){r=new WebSocket(e),r.addEventListener("message",p=>{let h;try{h=JSON.parse(p.data)}catch{console.error("ws: failed to parse message",p.data);return}if(!Ss(h)){console.error("ws: received message with unrecognized action/type — ignoring",h);return}n(h)}),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 Jn=bt(!1),Qn=bt(!1);function Is(n){xi.dispatch(n),Kn.dispatch(n)}function Jr(n){Jn.set(!0);const t=n.detail;Qn.set((t==null?void 0:t.exhausted)===!0)}function Qr(){Jn.set(!1),Qn.set(!1)}function zs(){const n=Os(Is);return window.addEventListener("ws:disconnected",Jr),window.addEventListener("ws:connected",Qr),()=>{n(),window.removeEventListener("ws:disconnected",Jr),window.removeEventListener("ws:connected",Qr)}}const Rs="modulepreload",Ls=function(n){return"/"+n},$r={},yn=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=Ls(l),l in $r)return;$r[l]=!0;const p=l.endsWith(".css"),h=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${h}`))return;const m=document.createElement("link");if(m.rel=p?"stylesheet":Rs,p||(m.as="script"),m.crossOrigin="",m.href=l,a&&m.setAttribute("nonce",a),document.head.appendChild(m),p)return new Promise((d,c)=>{m.addEventListener("load",d),m.addEventListener("error",()=>c(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 ei(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 Ds(n){if(Array.isArray(n))return n}function Ns(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,p=!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(h){p=!0,i=h}finally{try{if(!l&&e.return!=null&&(s=e.return(),Object(s)!==s))return}finally{if(p)throw i}}return a}}function Ps(){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 xs(n,t){return Ds(n)||Ns(n,t)||Fs(n,t)||Ps()}function Fs(n,t){if(n){if(typeof n=="string")return ei(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)?ei(n,t):void 0}}const Bi=Object.entries,ti=Object.setPrototypeOf,Ms=Object.isFrozen,Bs=Object.getPrototypeOf,Us=Object.getOwnPropertyDescriptor;let Fe=Object.freeze,Me=Object.seal,xt=Object.create,Ui=typeof Reflect<"u"&&Reflect,Zn=Ui.apply,Gn=Ui.construct;Fe||(Fe=function(t){return t});Me||(Me=function(t){return t});Zn||(Zn=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)});Gn||(Gn=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 Tt=xe(Array.prototype.forEach),js=xe(Array.prototype.lastIndexOf),ni=xe(Array.prototype.pop),Zt=xe(Array.prototype.push),Ws=xe(Array.prototype.splice),Mt=Array.isArray,qt=xe(String.prototype.toLowerCase),zn=xe(String.prototype.toString),ri=xe(String.prototype.match),Gt=xe(String.prototype.replace),ii=xe(String.prototype.indexOf),Hs=xe(String.prototype.trim),Zs=xe(Number.prototype.toString),Gs=xe(Boolean.prototype.toString),oi=typeof BigInt>"u"?null:xe(BigInt.prototype.toString),si=typeof Symbol>"u"?null:xe(Symbol.prototype.toString),Xe=xe(Object.prototype.hasOwnProperty),Yt=xe(Object.prototype.toString),Ue=xe(RegExp.prototype.test),St=Ys(TypeError);function xe(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 Zn(n,t,r)}}function Ys(n){return function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return Gn(n,e)}}function Oe(n,t){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:qt;if(ti&&ti(n,null),!Mt(t))return n;let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const o=e(i);o!==i&&(Ms(t)||(t[r]=o),i=o)}n[i]=!0}return n}function qs(n){for(let t=0;t<n.length;t++)Xe(n,t)||(n[t]=null);return n}function Je(n){const t=xt(null);for(const r of Bi(n)){var e=xs(r,2);const i=e[0],o=e[1];Xe(n,i)&&(Mt(o)?t[i]=qs(o):o&&typeof o=="object"&&o.constructor===Object?t[i]=Je(o):t[i]=o)}return t}function Vs(n){switch(typeof n){case"string":return n;case"number":return Zs(n);case"boolean":return Gs(n);case"bigint":return oi?oi(n):"0";case"symbol":return si?si(n):"Symbol()";case"undefined":return Yt(n);case"function":case"object":{if(n===null)return Yt(n);const t=n,e=et(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 et(n,t){for(;n!==null;){const r=Us(n,t);if(r){if(r.get)return xe(r.get);if(typeof r.value=="function")return xe(r.value)}n=Bs(n)}function e(){return null}return e}function Xs(n){try{return Ue(n,""),!0}catch{return!1}}const ai=Fe(["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"]),Rn=Fe(["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"]),Ln=Fe(["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"]),Ks=Fe(["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"]),Dn=Fe(["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"]),Js=Fe(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),li=Fe(["#text"]),ci=Fe(["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"]),Nn=Fe(["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"]),ui=Fe(["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"]),fn=Fe(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Qs=Me(/{{[\w\W]*|^[\w\W]*}}/g),$s=Me(/<%[\w\W]*|^[\w\W]*%>/g),ea=Me(/\${[\w\W]*/g),ta=Me(/^data-[\-\w.\u00B7-\uFFFF]+$/),na=Me(/^aria-[\-\w]+$/),fi=Me(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ra=Me(/^(?:\w+script|data):/i),ia=Me(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),oa=Me(/^html$/i),sa=Me(/^[a-z][.\w]*(-[.\w]+)+$/i),di=Me(/<[/\w!]/g),hi=Me(/<[/\w]/g),aa=Me(/<\/no(script|embed|frames)/i),la=Me(/\/>/i),Ke={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},ji=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],ca=Fe(Oe({},ji)),ua=function(){const n={};return Tt(ji,t=>{n[t]=Me(new RegExp("</"+t+"(?=[\\t\\n\\f\\r />])","i"))}),Fe(n)}(),fa=function(){return typeof window>"u"?null:window},da=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}},pi=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},kt=function(t,e,r,i){return Xe(t,e)&&Mt(t[e])?Oe(i.base?Je(i.base):{},t[e],i.transform):r},Pn=function(t,e,r){const i=Xe(t,e)?t[e]:void 0;return i&&typeof i=="object"?Je(i):r()};function Wi(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:fa();const t=te=>Wi(te);if(t.version="3.4.15",t.removed=[],!n||!n.document||n.document.nodeType!==Ke.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,p=n.NamedNodeMap;p===void 0&&(n.NamedNodeMap||n.MozNamedAttrMap),n.HTMLFormElement;const h=n.DOMParser,m=n.trustedTypes,d=a.prototype,c=et(d,"cloneNode"),g=et(d,"remove"),u=et(d,"removeAttributeNode"),b=et(d,"nextSibling"),_=et(d,"childNodes"),w=et(d,"parentNode"),v=et(d,"shadowRoot"),A=et(d,"attributes"),C=s&&s.prototype?et(s.prototype,"nodeType"):null,x=s&&s.prototype?et(s.prototype,"nodeName"):null,z=s&&s.prototype?et(s.prototype,"ownerDocument"):null,U=function(k){return C?C(k):k.nodeType},N=function(k){return x?x(k):k.nodeName};if(typeof o=="function"){const te=e.createElement("template");te.content&&te.content.ownerDocument&&(e=te.content.ownerDocument)}let I,W="",T,Z=!1,y=0;const Y=function(){if(y>0)throw St('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(k){Y(),y++;try{return I.createHTML(k)}finally{y--}},K=function(k){Y(),y++;try{return I.createScriptURL(k)}finally{y--}},re=function(){return Z||(T=da(m,i),Z=!0),T},q=e,oe=q.implementation,D=q.createNodeIterator,M=q.createDocumentFragment,ue=q.getElementsByTagName,ie=r.importNode;let X=pi();t.isSupported=typeof Bi=="function"&&typeof w=="function"&&oe&&oe.createHTMLDocument!==void 0;const Ae=Qs,Re=$s,ye=ea,le=ta,Ie=na,be=ra,Ce=ia,he=sa;let f=fi,H=null;const j=Oe({},[...ai,...Rn,...Ln,...Dn,...li]);let S=null;const E=Oe({},[...ci,...Nn,...ui,...fn]);let L=Object.seal(xt(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}})),G=null,P=null;const R=Object.seal(xt(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ee=!0,ae=!0,ne=!1,pe=!0,ke=!1,we=!0,Pe=!1,yt=!1,He=null,dt=null,Le=!1,at=!1,wt=!1,Ye=!1,Ut=!0,Qt=!1;const $t="user-content-";let jt=!0,Ot=!1,$e={},lt=null;const $n=Oe({},["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 er=null;const tr=Oe({},["audio","video","img","source","image","track"]);let nr=null;const rr=Oe({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),en="http://www.w3.org/1998/Math/MathML",tn="http://www.w3.org/2000/svg",ht="http://www.w3.org/1999/xhtml";let It=ht,wn=!1,vn=null;const Zi=Oe({},[en,tn,ht],zn),ir=Fe(["mi","mo","mn","ms","mtext"]);let kn=Oe({},ir);const or=Fe(["annotation-xml"]);let En=Oe({},or);const Gi=Oe({},["title","style","font","a","script"]);let Wt=null;const Yi=["application/xhtml+xml","text/html"],qi="text/html";let Ne=null,zt=null;const Vi=e.createElement("form"),sr=function(k){return k instanceof RegExp||k instanceof Function},Sn=function(){let k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(zt&&zt===k)return;(!k||typeof k!="object")&&(k={}),k=Je(k),Wt=Yi.indexOf(k.PARSER_MEDIA_TYPE)===-1?qi:k.PARSER_MEDIA_TYPE,Ne=Wt==="application/xhtml+xml"?zn:qt,H=kt(k,"ALLOWED_TAGS",j,{transform:Ne}),S=kt(k,"ALLOWED_ATTR",E,{transform:Ne}),vn=kt(k,"ALLOWED_NAMESPACES",Zi,{transform:zn}),nr=kt(k,"ADD_URI_SAFE_ATTR",rr,{transform:Ne,base:rr}),er=kt(k,"ADD_DATA_URI_TAGS",tr,{transform:Ne,base:tr}),lt=kt(k,"FORBID_CONTENTS",$n,{transform:Ne}),G=kt(k,"FORBID_TAGS",Je({}),{transform:Ne}),P=kt(k,"FORBID_ATTR",Je({}),{transform:Ne}),$e=Xe(k,"USE_PROFILES")?k.USE_PROFILES&&typeof k.USE_PROFILES=="object"?Je(k.USE_PROFILES):k.USE_PROFILES:!1,ee=k.ALLOW_ARIA_ATTR!==!1,ae=k.ALLOW_DATA_ATTR!==!1,ne=k.ALLOW_UNKNOWN_PROTOCOLS||!1,pe=k.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ke=k.SAFE_FOR_TEMPLATES||!1,we=k.SAFE_FOR_XML!==!1,Pe=k.WHOLE_DOCUMENT||!1,at=k.RETURN_DOM||!1,wt=k.RETURN_DOM_FRAGMENT||!1,Ye=k.RETURN_TRUSTED_TYPE||!1,Le=k.FORCE_BODY||!1,Ut=k.SANITIZE_DOM!==!1,Qt=k.SANITIZE_NAMED_PROPS||!1,jt=k.KEEP_CONTENT!==!1,Ot=k.IN_PLACE||!1,f=Xs(k.ALLOWED_URI_REGEXP)?k.ALLOWED_URI_REGEXP:fi,It=typeof k.NAMESPACE=="string"?k.NAMESPACE:ht,kn=Pn(k,"MATHML_TEXT_INTEGRATION_POINTS",()=>Oe({},ir)),En=Pn(k,"HTML_INTEGRATION_POINTS",()=>Oe({},or));const B=Pn(k,"CUSTOM_ELEMENT_HANDLING",()=>xt(null));if(L=xt(null),Xe(B,"tagNameCheck")&&sr(B.tagNameCheck)&&(L.tagNameCheck=B.tagNameCheck),Xe(B,"attributeNameCheck")&&sr(B.attributeNameCheck)&&(L.attributeNameCheck=B.attributeNameCheck),Xe(B,"allowCustomizedBuiltInElements")&&typeof B.allowCustomizedBuiltInElements=="boolean"&&(L.allowCustomizedBuiltInElements=B.allowCustomizedBuiltInElements),Me(L),ke&&(ae=!1),wt&&(at=!0),$e&&(H=Oe({},li),S=xt(null),$e.html===!0&&(Oe(H,ai),Oe(S,ci)),$e.svg===!0&&(Oe(H,Rn),Oe(S,Nn),Oe(S,fn)),$e.svgFilters===!0&&(Oe(H,Ln),Oe(S,Nn),Oe(S,fn)),$e.mathMl===!0&&(Oe(H,Dn),Oe(S,ui),Oe(S,fn))),R.tagCheck=null,R.attributeCheck=null,Xe(k,"ADD_TAGS")&&(typeof k.ADD_TAGS=="function"?R.tagCheck=k.ADD_TAGS:Mt(k.ADD_TAGS)&&(H===j&&(H=Je(H)),Oe(H,k.ADD_TAGS,Ne))),Xe(k,"ADD_ATTR")&&(typeof k.ADD_ATTR=="function"?R.attributeCheck=k.ADD_ATTR:Mt(k.ADD_ATTR)&&(S===E&&(S=Je(S)),Oe(S,k.ADD_ATTR,Ne))),Xe(k,"ADD_FORBID_CONTENTS")&&Mt(k.ADD_FORBID_CONTENTS)&&(lt===$n&&(lt=Je(lt)),Oe(lt,k.ADD_FORBID_CONTENTS,Ne)),jt&&(H["#text"]=!0),Pe&&Oe(H,["html","head","body"]),H.table&&(Oe(H,["tbody"]),delete G.tbody),k.TRUSTED_TYPES_POLICY){if(typeof k.TRUSTED_TYPES_POLICY.createHTML!="function")throw St('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof k.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw St('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const J=I;I=k.TRUSTED_TYPES_POLICY;try{W=fe("")}catch(ce){throw I=J,ce}}else k.TRUSTED_TYPES_POLICY===null?(I=void 0,W=""):(I===void 0&&(I=re()),I&&typeof W=="string"&&(W=fe("")));Fe&&Fe(k),zt=k},ar=Oe({},[...Rn,...Ln,...Ks]),lr=Oe({},[...Dn,...Js]),Xi=function(k,B,J){return B.namespaceURI===ht?k==="svg":B.namespaceURI===en?k==="svg"&&(J==="annotation-xml"||kn[J]):!!ar[k]},Ki=function(k,B,J){return B.namespaceURI===ht?k==="math":B.namespaceURI===tn?k==="math"&&En[J]:!!lr[k]},Ji=function(k,B,J){return B.namespaceURI===tn&&!En[J]||B.namespaceURI===en&&!kn[J]?!1:!lr[k]&&(Gi[k]||!ar[k])},Qi=function(k){let B=w(k);(!B||!B.tagName)&&(B={namespaceURI:It,tagName:"template"});const J=qt(k.tagName),ce=qt(B.tagName);return vn[k.namespaceURI]?k.namespaceURI===tn?Xi(J,B,ce):k.namespaceURI===en?Ki(J,B,ce):k.namespaceURI===ht?Ji(J,B,ce):!!(Wt==="application/xhtml+xml"&&vn[k.namespaceURI]):!1},vt=function(k){Zt(t.removed,{element:k});try{w(k).removeChild(k)}catch{if(g(k),!w(k))throw St("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},cr=function(k,B,J){try{u(k,B)}catch{try{k.removeAttribute(J)}catch{}}},nn=function(k){rn(k);const B=_(k);if(B){const ce=[];Tt(B,me=>{Zt(ce,me)}),Tt(ce,me=>{try{g(me)}catch{}})}const J=A(k);if(J)for(let ce=J.length-1;ce>=0;--ce){const me=J[ce],_e=me&&me.name;typeof _e=="string"&&cr(k,me,_e)}},Et=function(k,B,J){if(!J)try{J=B.getAttributeNode(k)}catch{J=null}Zt(t.removed,{attribute:J||null,from:B});try{J?u(B,J):B.removeAttribute(k)}catch{try{B.removeAttribute(k)}catch{}}if(k==="is")if(at||wt)try{vt(B)}catch{}else try{B.setAttribute(k,"")}catch{}},$i=function(k){const B=A(k);if(B)for(let J=B.length-1;J>=0;--J){const ce=B[J],me=ce&&ce.name;typeof me!="string"||S[Ne(me)]||cr(k,ce,me)}},rn=function(k){const B=[k];for(;B.length>0;){const J=B.pop();U(J)===Ke.element&&$i(J);const me=_(J);if(me)for(let _e=me.length-1;_e>=0;--_e)B.push(me[_e])}},ur=function(k,B){return we?k==="patchsrc"?!0:k==="for"&&B!=="label"&&B!=="output":!1},eo=function(k){if(!we)return;const B=[k];for(;B.length>0;){const J=B.pop(),ce=U(J);if(ce===Ke.processingInstruction||ce===Ke.comment&&Ue(hi,J.data)){try{g(J)}catch{}continue}if(ce===Ke.element){const _e=J,ze=Ne(N(J));try{_e.hasAttribute&&_e.hasAttribute("patchsrc")&&_e.removeAttribute("patchsrc"),_e.hasAttribute&&_e.hasAttribute("for")&&ur("for",ze)&&_e.removeAttribute("for")}catch{}}const me=_(J);if(me)for(let _e=me.length-1;_e>=0;--_e)B.push(me[_e])}},fr=function(k){let B=null,J=null;if(Le)k="<remove></remove>"+k;else{const _e=ri(k,/^[\r\n\t ]+/);J=_e&&_e[0]}Wt==="application/xhtml+xml"&&It===ht&&(k='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+k+"</body></html>");const ce=I?fe(k):k;if(It===ht)try{B=new h().parseFromString(ce,Wt)}catch{}if(!B||!B.documentElement){B=oe.createDocument(It,"template",null);try{B.documentElement.innerHTML=wn?W:ce}catch{}}const me=B.body||B.documentElement;return k&&J&&me.insertBefore(e.createTextNode(J),me.childNodes[0]||null),It===ht?ue.call(B,Pe?"html":"body")[0]:Pe?B.documentElement:me},dr=function(k){const B=z?z(k):k.ownerDocument;return D.call(B||k,k,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},on=function(k){return k=Gt(k,Ae," "),k=Gt(k,Re," "),k=Gt(k,ye," "),k},Tn=function(k){var B;k.normalize();const J=z?z(k):k.ownerDocument,ce=D.call(J||k,k,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null);let me=ce.nextNode();for(;me;)me.data=on(me.data),me=ce.nextNode();const _e=(B=k.querySelectorAll)===null||B===void 0?void 0:B.call(k,"template");_e&&Tt(_e,ze=>{Rt(ze.content)&&Tn(ze.content)})},sn=function(k){const B=x?x(k):null;return typeof B!="string"||Ne(B)!=="form"?!1:typeof k.nodeName!="string"||typeof k.textContent!="string"||typeof k.removeChild!="function"||k.attributes!==A(k)||typeof k.removeAttribute!="function"||typeof k.removeAttributeNode!="function"||typeof k.getAttributeNode!="function"||typeof k.setAttribute!="function"||typeof k.namespaceURI!="string"||typeof k.insertBefore!="function"||typeof k.hasChildNodes!="function"||k.nodeType!==C(k)||k.childNodes!==_(k)},Rt=function(k){if(!C||typeof k!="object"||k===null)return!1;try{return C(k)===Ke.documentFragment}catch{return!1}},Ht=function(k){if(!C||typeof k!="object"||k===null)return!1;try{return typeof C(k)=="number"}catch{return!1}};function pt(te,k,B){te.length!==0&&Tt(te,J=>{J.call(t,k,B,zt)})}const to=function(k,B){return!!(we&&k.hasChildNodes()&&!Ht(k.firstElementChild)&&Ue(di,k.textContent)&&Ue(di,k.innerHTML)||we&&k.namespaceURI===ht&&ca[B]&&(Ht(k.firstElementChild)||typeof k.textContent=="string"&&Ue(ua[B],k.textContent))||k.nodeType===Ke.processingInstruction||we&&k.nodeType===Ke.comment&&Ue(hi,k.data))},an=function(k,B){if(k instanceof RegExp)return Ue(k,B);if(k instanceof Function){for(var J=arguments.length,ce=new Array(J>2?J-2:0),me=2;me<J;me++)ce[me-2]=arguments[me];return!!k(B,...ce)}return!1},no=function(k,B,J){if(!G[B]&&gr(B)&&an(L.tagNameCheck,B))return!1;if(jt&&!lt[B]){const ce=w(k),me=_(k);if(me&&ce){const _e=me.length;for(let ze=_e-1;ze>=0;--ze){const De=k===J?c(me[ze],!0):me[ze];ce.insertBefore(De,b(k))}}}return vt(k),!0},hr=function(k,B,J,ce){return k.length===0?B:B===J||B===ce?Je(B):B},pr=function(k,B){return k===B||w(k)!==null?!1:(Ot&&rn(k),!0)},mr=function(k,B){if(pt(X.beforeSanitizeElements,k,null),pr(k,B))return!0;if(sn(k))return vt(k),!0;const J=Ne(N(k));if(H=hr(X.uponSanitizeElement,H,j,He),pt(X.uponSanitizeElement,k,{tagName:J,allowedTags:H}),pr(k,B))return!0;if(to(k,J))return vt(k),!0;if(G[J]||!(R.tagCheck instanceof Function&&R.tagCheck(J))&&!H[J]){const me=no(k,J,B);return me===!1&&pt(X.afterSanitizeElements,k,null),me}if(U(k)===Ke.element&&!Qi(k)||(J==="noscript"||J==="noembed"||J==="noframes")&&Ue(aa,k.innerHTML))return vt(k),!0;if(ke&&k.nodeType===Ke.text){const me=on(k.textContent);k.textContent!==me&&(Zt(t.removed,{element:k.cloneNode()}),k.textContent=me)}return pt(X.afterSanitizeElements,k,null),!1},_r=function(k,B,J){if(P[B]||ur(B,k)||Ut&&(B==="id"||B==="name")&&(J in e||J in Vi))return!1;const ce=S[B]||R.attributeCheck instanceof Function&&R.attributeCheck(B,k);return ae&&Ue(le,B)||ee&&Ue(Ie,B)?!0:ce?nr[B]||Ue(f,Gt(J,Ce,""))||(B==="src"||B==="xlink:href"||B==="href")&&k!=="script"&&ii(J,"data:")===0&&er[k]||ne&&!Ue(be,Gt(J,Ce,""))?!0:!J:gr(k)&&an(L.tagNameCheck,k)&&an(L.attributeNameCheck,B,k)||B==="is"&&L.allowCustomizedBuiltInElements&&an(L.tagNameCheck,J)},ro=Oe({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),gr=function(k){return!ro[qt(k)]&&Ue(he,k)},io=function(k,B,J,ce){if(I&&typeof m=="object"&&typeof m.getAttributeType=="function"&&!J)switch(m.getAttributeType(k,B)){case"TrustedHTML":return fe(ce);case"TrustedScriptURL":return K(ce)}return ce},oo=function(k,B,J,ce){try{return J?k.setAttributeNS(J,B,ce):k.setAttribute(B,ce),sn(k)?(vt(k),!1):!0}catch{return Et(B,k),!1}},br=function(k){pt(X.beforeSanitizeAttributes,k,null);const B=k.attributes;if(!B||sn(k))return;S=hr(X.uponSanitizeAttribute,S,E,dt);const J={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:S,forceKeepAttr:void 0};let ce=B.length;const me=Ne(k.nodeName);for(;ce--;){const _e=B[ce],ze=_e.name,De=_e.namespaceURI,qe=_e.value,Ve=Ne(ze),Cn=qe;let Ze=ze==="value"?Cn:Hs(Cn),yr=!1;if(J.attrName=Ve,J.attrValue=Ze,J.keepAttr=!0,J.forceKeepAttr=void 0,pt(X.uponSanitizeAttribute,k,J),Ze=J.attrValue,Qt&&(Ve==="id"||Ve==="name")&&ii(Ze,$t)!==0&&(Et(ze,k,_e),Ze=$t+Ze,yr=!0),we&&Ue(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Ze)){Et(ze,k,_e);continue}if(Ve==="attributename"&&ri(Ze,"href")){Et(ze,k,_e);continue}if(!J.forceKeepAttr){if(!J.keepAttr){Et(ze,k,_e);continue}if(!pe&&Ue(la,Ze)){Et(ze,k,_e);continue}if(ke&&(Ze=on(Ze)),!_r(me,Ve,Ze)){Et(ze,k,_e);continue}Ze=io(me,Ve,De,Ze),Ze!==Cn&&oo(k,ze,De,Ze)&&yr&&ni(t.removed)}}pt(X.afterSanitizeAttributes,k,null)},ln=function(k){let B=null;const J=dr(k);for(pt(X.beforeSanitizeShadowDOM,k,null);B=J.nextNode();)if(pt(X.uponSanitizeShadowNode,B,null),mr(B,k),br(B),Rt(B.content)&&ln(B.content),U(B)===Ke.element){const ce=v(B);Rt(ce)&&(An(ce),ln(ce))}pt(X.afterSanitizeShadowDOM,k,null)},An=function(k){const B=[{node:k,shadow:null}];for(;B.length>0;){const J=B.pop();if(J.shadow){ln(J.shadow);continue}const ce=J.node,_e=U(ce)===Ke.element,ze=_(ce);if(ze)for(let De=ze.length-1;De>=0;--De)B.push({node:ze[De],shadow:null});if(_e){const De=x?x(ce):null;if(typeof De=="string"&&Ne(De)==="template"){const qe=ce.content;Rt(qe)&&B.push({node:qe,shadow:null})}}if(_e){const De=v(ce);Rt(De)&&B.push({node:null,shadow:De},{node:De,shadow:null})}}};return t.sanitize=function(te){let k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},B=null,J=null,ce=null,me=null;if(wn=!te,wn&&(te="<!-->"),typeof te!="string"&&!Ht(te)&&(te=Vs(te),typeof te!="string"))throw St("dirty is not a string, aborting");if(!t.isSupported)return te;yt?(H=He,S=dt):Sn(k),(X.uponSanitizeElement.length>0||X.uponSanitizeAttribute.length>0)&&(H=Je(H)),X.uponSanitizeAttribute.length>0&&(S=Je(S)),t.removed=[];const _e=Ot&&typeof te!="string"&&Ht(te);if(_e){eo(te);const qe=N(te);if(typeof qe=="string"){const Ve=Ne(qe);if(!H[Ve]||G[Ve])throw nn(te),St("root node is forbidden and cannot be sanitized in-place")}if(sn(te))throw nn(te),St("root node is clobbered and cannot be sanitized in-place");try{An(te)}catch(Ve){throw nn(te),Ve}}else if(Ht(te))B=fr("<!---->"),J=B.ownerDocument.importNode(te,!0),J.nodeType===Ke.element&&J.nodeName==="BODY"||J.nodeName==="HTML"?B=J:B.appendChild(J),An(B);else{if(!at&&!ke&&!Pe&&te.indexOf("<")===-1)return I&&Ye?fe(te):te;if(B=fr(te),!B)return at?null:Ye?W:""}B&&Le&&vt(B.firstChild);const ze=_e?te:B;try{const qe=dr(ze);for(;ce=qe.nextNode();)mr(ce,ze),br(ce),Rt(ce.content)&&ln(ce.content)}catch(qe){throw _e&&(nn(te),Tt(t.removed,Ve=>{Ve.element&&rn(Ve.element)})),qe}if(_e)return Tt(t.removed,qe=>{qe.element&&rn(qe.element)}),ke&&Tn(te),te;if(at){if(ke&&Tn(B),wt)for(me=M.call(B.ownerDocument);B.firstChild;)me.appendChild(B.firstChild);else me=B;return(S.shadowroot||S.shadowrootmode)&&(me=ie.call(r,me,!0)),me}let De=Pe?B.outerHTML:B.innerHTML;return Pe&&H["!doctype"]&&B.ownerDocument&&B.ownerDocument.doctype&&B.ownerDocument.doctype.name&&Ue(oa,B.ownerDocument.doctype.name)&&(De="<!DOCTYPE "+B.ownerDocument.doctype.name+`>
17
- `+De),ke&&(De=on(De)),I&&Ye?fe(De):De},t.setConfig=function(){let te=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Sn(te),yt=!0,He=H,dt=S},t.clearConfig=function(){zt=null,yt=!1,He=null,dt=null,I=T,W=""},t.isValidAttribute=function(te,k,B){zt||Sn({});const J=Ne(te),ce=Ne(k);return _r(J,ce,B)},t.addHook=function(te,k){typeof k=="function"&&Xe(X,te)&&Zt(X[te],k)},t.removeHook=function(te,k){if(Xe(X,te)){if(k!==void 0){const B=js(X[te],k);return B===-1?void 0:Ws(X[te],B,1)[0]}return ni(X[te])}},t.removeHooks=function(te){Xe(X,te)&&(X[te]=[])},t.removeAllHooks=function(){X=pi()},t}var Hi=Wi();const xn=.1,Fn=10,ha=.001,pa=.92,ma=800;function _a(n){const t=bt(1),e=bt(0),r=bt(0),i=bt(!1);let o=0,s=0,a=0,l=0,p=null;function h(A){const C=n.getWrapper();if(!C)return;const x=A.getAttribute("viewBox");let z,U;if(x){const Z=x.trim().split(/\s+/).map(Number);z=Z[2],U=Z[3]}else z=A.clientWidth||1,U=A.clientHeight||1;if(!z||!U)return;const N=C.clientWidth,I=C.clientHeight,W=Math.min(N/z,I/U)*pa,T=Math.min(Fn,Math.max(xn,W));t.set(T),e.set((N-z*T)/2),r.set((I-U*T)/2)}function m(A){const C=n.getWrapper();C&&(t.set(Math.min(Fn,Math.max(xn,A.scale))),e.set(A.positionX*C.clientWidth),r.set(A.positionY*C.clientHeight))}function d(){p&&clearTimeout(p),p=setTimeout(()=>{p=null,c()},ma)}function c(){const A=n.getSnapshotId(),C=n.getWrapper();if(!A||!C)return;const x=mt(e)/C.clientWidth,z=mt(r)/C.clientHeight;fetch("/viewport",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:A,frame:n.getCurrentFrame(),scale:mt(t),positionX:x,positionY:z})}).catch(()=>{})}function g(){var C;const A=(C=n.getContainer())==null?void 0:C.querySelector("svg");A?h(A):(t.set(1),e.set(0),r.set(0)),d()}function u(A){A.preventDefault();const C=n.getWrapper();if(!C)return;const x=mt(t),z=-A.deltaY*ha,U=Math.min(Fn,Math.max(xn,x+z*x)),N=C.getBoundingClientRect(),I=A.clientX-N.left,W=A.clientY-N.top,T=mt(e),Z=mt(r);e.set(I-(I-T)*(U/x)),r.set(W-(W-Z)*(U/x)),t.set(U),d()}function b(A){A.button===0&&(i.set(!0),o=A.clientX,s=A.clientY,a=mt(e),l=mt(r),A.preventDefault())}function _(A){mt(i)&&(e.set(a+(A.clientX-o)),r.set(l+(A.clientY-s)),d())}function w(){i.set(!1)}function v(){p&&clearTimeout(p),p=null}return{scale:t,tx:e,ty:r,dragging:i,fitToView:h,applyViewport:m,resetTransform:g,onWheel:u,onMousedown:b,onMousemove:_,onMouseup:w,scheduleViewportReport:d,reportViewport:c,destroy:v}}function Nt(n){n.stopPropagation()}async function Mn(n){await fetch("/node-click",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}).catch(()=>{})}function ga(n){async function t(h){var u;h.stopPropagation();const m=h.currentTarget.closest(".node")??h.currentTarget,d=n.extractNodeId(m)??m.id,c=n.extractNodeLabel(m),g=(u=n.getNodeActions())==null?void 0:u[d];if(g&&g.length>0){const b=h;n.onPopupRequest({x:b.clientX,y:b.clientY,nodeId:d,nodeLabel:c,actions:g});return}await Mn({type:"node",id:d,label:c})}async function e(h){var g;h.stopPropagation();const m=h.currentTarget,d=n.extractEdgeId(m)??"",c=((g=m.textContent)==null?void 0:g.trim())??"";await Mn({type:"edge",id:d,label:c})}let r=null;function i(){o();const h=n.getContainer();if(!h)return;const m=h.querySelector("svg");if(!m)return;const d=m.querySelectorAll(".node"),c=m.querySelectorAll(".edgeLabel");for(const g of d)g.addEventListener("click",t),g.addEventListener("mousedown",Nt),g.style.cursor="pointer",g.classList.add("clickable-node");for(const g of c)g.addEventListener("click",e),g.addEventListener("mousedown",Nt),g.style.cursor="pointer";r=()=>{for(const g of d)g.removeEventListener("click",t),g.removeEventListener("mousedown",Nt),g.style.cursor="",g.classList.remove("clickable-node");for(const g of c)g.removeEventListener("click",e),g.removeEventListener("mousedown",Nt),g.style.cursor=""}}function o(){r==null||r(),r=null}let s=null;function a(h){l();const m=n.getContainer();if(!m)return;const d=m.querySelector("svg");if(!d)return;const c=d.querySelectorAll(".node");for(const g of c){const u=n.extractNodeId(g);if(u===null||!(u in h))continue;const b=h[u],_=w=>{w.stopPropagation(),fetch("/seek",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({frame:b})}).catch(()=>{})};g.addEventListener("click",_),g.addEventListener("mousedown",Nt),g.style.cursor="pointer",s=(w=>()=>{w==null||w(),g.removeEventListener("click",_),g.removeEventListener("mousedown",Nt),g.style.cursor=""})(s)}}function l(){s==null||s(),s=null}async function p(h,m){await Mn({type:"node",id:h.nodeId,label:h.nodeLabel,action:m})}return{attachClickListeners:i,detachClickListeners:o,attachNodeToFrameListeners:a,detachNodeToFrameListeners:l,selectAction:p}}function mi(n,t,e){const r=n.slice();return r[7]=t[e],r[9]=e,r}function _i(n){let t,e,r,i=[],o=new Map,s,a,l=it(n[0].actions);const p=h=>h[9];for(let h=0;h<l.length;h+=1){let m=mi(n,l,h),d=p(m);o.set(d,i[h]=gi(d,m))}return{c(){t=V("div"),e=de(),r=V("div");for(let h=0;h<i.length;h+=1)i[h].c();O(t,"class","popup-backdrop svelte-1m6nmjq"),O(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(h,m){$(h,t,m),$(h,e,m),$(h,r,m);for(let d=0;d<i.length;d+=1)i[d]&&i[d].m(r,null);s||(a=[ve(t,"click",n[3]),ve(r,"click",uo(ya)),pn(bn.call(null,r,{onEscape:n[6]}))],s=!0)},p(h,m){m&7&&(l=it(h[0].actions),i=Bt(i,m,p,1,h,l,o,r,qn,gi,null,mi)),m&1&&gt(r,"left",h[0].x+"px"),m&1&&gt(r,"top",h[0].y+"px")},d(h){h&&(Q(t),Q(e),Q(r));for(let m=0;m<i.length;m+=1)i[m].d();s=!1,Be(a)}}}function gi(n,t){let e,r=t[7]+"",i,o,s,a;function l(){return t[4](t[7])}function p(...h){return t[5](t[7],...h)}return{key:n,first:null,c(){e=V("div"),i=se(r),o=de(),O(e,"class","popup-item svelte-1m6nmjq"),O(e,"role","button"),O(e,"tabindex","0"),this.first=e},m(h,m){$(h,e,m),F(e,i),F(e,o),s||(a=[ve(e,"click",l),ve(e,"keydown",p)],s=!0)},p(h,m){t=h,m&1&&r!==(r=t[7]+"")&&Se(i,r)},d(h){h&&Q(e),s=!1,Be(a)}}}function ba(n){let t,e=n[0]&&_i(n);return{c(){e&&e.c(),t=ut()},m(r,i){e&&e.m(r,i),$(r,t,i)},p(r,[i]){r[0]?e?e.p(r,i):(e=_i(r),e.c(),e.m(t.parentNode,t)):e&&(e.d(1),e=null)},i:ge,o:ge,d(r){r&&Q(t),e&&e.d(r)}}}const ya=()=>{};function wa(n,t,e){let{popup:r=null}=t;const i=gn();function o(h,m){h.key!=="Enter"&&h.key!==" "||(h.preventDefault(),i("select",m))}const s=()=>i("dismiss"),a=h=>i("select",h),l=(h,m)=>o(m,h),p=()=>i("dismiss");return n.$$set=h=>{"popup"in h&&e(0,r=h.popup)},[r,i,o,s,a,l,p]}class va extends st{constructor(t){super(),ot(this,t,wa,ba,Qe,{popup:0})}}function bi(n){let t,e;return{c(){t=V("pre"),e=se(n[2]),O(t,"class","render-error svelte-101ypv")},m(r,i){$(r,t,i),F(t,e)},p(r,i){i[0]&4&&Se(e,r[2])},d(r){r&&Q(t)}}}function ka(n){let t,e,r,i,o,s,a,l,p,h,m,d=n[2]&&bi(n);return l=new va({props:{popup:n[3]}}),l.$on("select",n[27]),l.$on("dismiss",n[13]),{c(){t=V("div"),e=V("div"),r=V("div"),i=de(),d&&d.c(),o=de(),s=V("div"),s.textContent="scroll to zoom · drag to pan · dbl-click to reset",a=de(),Ge(l.$$.fragment),O(r,"class","mermaid-container svelte-101ypv"),O(e,"class","mermaid-canvas svelte-101ypv"),gt(e,"transform",n[5]),gt(e,"transform-origin","0 0"),O(s,"class","zoom-hint svelte-101ypv"),O(t,"class","mermaid-wrapper svelte-101ypv"),O(t,"title","Scroll to zoom · Drag to pan · Double-click to reset"),gt(t,"cursor",n[4])},m(c,g){$(c,t,g),F(t,e),F(e,r),n[26](r),F(t,i),d&&d.m(t,null),F(t,o),F(t,s),F(t,a),je(l,t,null),n[28](t),p=!0,h||(m=[ve(t,"wheel",n[11]),ve(t,"mousedown",n[12]),ve(t,"dblclick",n[10])],h=!0)},p(c,g){(!p||g[0]&32)&&gt(e,"transform",c[5]),c[2]?d?d.p(c,g):(d=bi(c),d.c(),d.m(t,o)):d&&(d.d(1),d=null);const u={};g[0]&8&&(u.popup=c[3]),l.$set(u),(!p||g[0]&16)&&gt(t,"cursor",c[4])},i(c){p||(Ee(l.$$.fragment,c),p=!0)},o(c){Te(l.$$.fragment,c),p=!1},d(c){c&&Q(t),n[26](null),d&&d.d(),We(l),n[28](null),h=!1,Be(m)}}}function Ea(n){const t=n.id.match(/flowchart-(.+?)-\d+$/);return t?t[1]:null}function Sa(n){var e;return((e=(n.querySelector(".nodeLabel")??n.querySelector(".label")??n).textContent)==null?void 0:e.trim())??""}function Ta(n){const t=n.closest("[id]");return t&&t.id||null}function Aa(n,t,e){let r,i,o,s,a,l,{source:p}=t,{clickable:h=!1}=t,{nodeActions:m=void 0}=t,{nodeToFrame:d=void 0}=t,{snapshotId:c=void 0}=t,{viewport:g=void 0}=t,{currentFrame:u=0}=t,b,_,w=null,v=null,A=0,C;const x=_a({getWrapper:()=>b,getContainer:()=>_,getSnapshotId:()=>c,getCurrentFrame:()=>u}),{scale:z,tx:U,ty:N,dragging:I,fitToView:W,applyViewport:T,resetTransform:Z,onWheel:y,onMousedown:Y,onMousemove:fe,onMouseup:K}=x;_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 re=null;const q=ga({getContainer:()=>_,extractNodeId:Ea,extractNodeLabel:Sa,extractEdgeId:Ta,getNodeActions:()=>m,onPopupRequest:he=>{e(3,re=he)}}),{attachClickListeners:oe,detachClickListeners:D,attachNodeToFrameListeners:M,detachNodeToFrameListeners:ue}=q;function ie(){e(3,re=null)}async function X(he){if(!re)return;const f=re;e(3,re=null),await q.selectAction(f,he)}let Ae=null;function Re(){return Ae||(Ae=yn(()=>import("./mermaid.core-DioArgDk.js").then(he=>he.bI),__vite__mapDeps([0,1])).then(he=>{const f=he.default;return f.initialize({startOnLoad:!1,theme:"default",securityLevel:"strict",htmlLabels:!1}),f})),Ae}function ye(){return c===void 0?!1:`${c}:${u}`!==C}async function le(he,f){const H=++A;if(e(2,w=null),D(),!he){_&&e(1,_.innerHTML="",_);return}try{const j=await Re();if(H!==A)return;const S=`mermaid-${H}`,{svg:E}=await j.render(S,he),L=Hi.sanitize(E,{USE_PROFILES:{svg:!0,svgFilters:!0}});if(H!==A)return;_&&e(1,_.innerHTML=L,_);const G=_==null?void 0:_.querySelector("svg");if(G){const P=G.getAttribute("viewBox");if(P){const R=P.trim().split(/\s+/).map(Number);R[2]&&R[3]&&(G.setAttribute("width",String(R[2])),G.setAttribute("height",String(R[3])))}}f&&G&&(g?T(g):W(G)),h?oe():d&&M(d)}catch(j){if(H!==A)return;e(2,w=j instanceof Error?j.message:String(j)),_&&e(1,_.innerHTML="",_)}}Kt(()=>{const he=ye();c!==void 0&&(C=`${c}:${u}`),le(p,he),v=p,window.addEventListener("mousemove",fe),window.addEventListener("mouseup",K)}),_n(()=>{if(p!==v){const he=ye();c!==void 0&&(C=`${c}:${u}`),v=p,le(p,he)}}),Jt(()=>{window.removeEventListener("mousemove",fe),window.removeEventListener("mouseup",K),D(),ue(),x.destroy()});function Ie(he){ft[he?"unshift":"push"](()=>{_=he,e(1,_)})}const be=he=>X(he.detail);function Ce(he){ft[he?"unshift":"push"](()=>{b=he,e(0,b)})}return n.$$set=he=>{"source"in he&&e(15,p=he.source),"clickable"in he&&e(16,h=he.clickable),"nodeActions"in he&&e(17,m=he.nodeActions),"nodeToFrame"in he&&e(18,d=he.nodeToFrame),"snapshotId"in he&&e(19,c=he.snapshotId),"viewport"in he&&e(20,g=he.viewport),"currentFrame"in he&&e(21,u=he.currentFrame)},n.$$.update=()=>{n.$$.dirty[0]&65536&&(h?oe():(D(),e(3,re=null))),n.$$.dirty[0]&262144&&(d?M(d):ue()),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,_,w,re,i,r,z,U,N,I,Z,y,Y,ie,X,p,h,m,d,c,g,u,o,s,a,l,Ie,be,Ce]}class Ca extends st{constructor(t){super(),ot(this,t,Aa,ka,Qe,{source:15,clickable:16,nodeActions:17,nodeToFrame:18,snapshotId:19,viewport:20,currentFrame:21},null,[-1,-1])}}function Oa(n,t){return`@scope (${t.map(r=>`#${r}`).join(", ")}) {
18
- ${n}
19
- }`}function Ia(n){let t;return{c(){t=V("div"),O(t,"class","html-renderer svelte-89qzxr"),O(t,"id","html-renderer-root")},m(e,r){$(e,t,r),n[3](t)},p:ge,i:ge,o:ge,d(e){e&&Q(t),n[3](null)}}}const Bn="bootstrap-house-style",za="html-renderer-root";function Ra(n,t,e){let{source:r}=t,{type:i}=t,o,s=null,a=null;function l(){return a||(a=yn(()=>import("./bootstrap.min-UtnB-TxT.js"),[]).then(d=>d.default.replace(/:root/g,":scope"))),a}async function p(){if(document.getElementById(Bn))return;const d=await l();if(document.getElementById(Bn))return;const c=document.createElement("style");c.id=Bn,c.textContent=Oa(d,[za]),document.head.appendChild(c)}function h(d){if(!o)return;i==="html"&&p();const c=Hi.sanitize(d,{USE_PROFILES:i==="svg"?{svg:!0,svgFilters:!0}:{html:!0}});e(0,o.innerHTML=c,o)}Kt(()=>{h(r),s=r}),_n(()=>{r!==s&&(s=r,h(r))});function m(d){ft[d?"unshift":"push"](()=>{o=d,e(0,o)})}return n.$$set=d=>{"source"in d&&e(1,r=d.source),"type"in d&&e(2,i=d.type)},[o,r,i,m]}class yi extends st{constructor(t){super(),ot(this,t,Ra,Ia,Qe,{source:1,type:2})}}function wi(n){let t,e;return{c(){t=V("pre"),e=se(n[1]),O(t,"class","render-error svelte-m8n5cm")},m(r,i){$(r,t,i),F(t,e)},p(r,i){i&2&&Se(e,r[1])},d(r){r&&Q(t)}}}function La(n){let t,e,r,i=n[1]&&wi(n);return{c(){t=V("div"),e=V("div"),r=de(),i&&i.c(),O(t,"class","katex-renderer svelte-m8n5cm")},m(o,s){$(o,t,s),F(t,e),n[3](e),F(t,r),i&&i.m(t,null)},p(o,[s]){o[1]?i?i.p(o,s):(i=wi(o),i.c(),i.m(t,null)):i&&(i.d(1),i=null)},i:ge,o:ge,d(o){o&&Q(t),n[3](null),i&&i.d()}}}function Da(n,t,e){let{source:r}=t,i,o=null,s=null,a=0,l=null;function p(){return l||(l=yn(()=>import("./katex-BTI-AXqd.js"),[]).then(d=>d.default)),l}async function h(d){if(!i)return;const c=++a;e(1,o=null);try{const g=await p();if(c!==a)return;g.render(d,i,{displayMode:!0,throwOnError:!0})}catch(g){if(c!==a)return;e(1,o=g instanceof Error?g.message:String(g)),e(0,i.innerHTML="",i)}}Kt(()=>{h(r),s=r}),_n(()=>{r!==s&&(s=r,h(r))});function m(d){ft[d?"unshift":"push"](()=>{i=d,e(0,i)})}return n.$$set=d=>{"source"in d&&e(2,r=d.source)},[i,o,r,m]}class Na extends st{constructor(t){super(),ot(this,t,Da,La,Qe,{source:2})}}function vi(n){let t,e;return{c(){t=V("pre"),e=se(n[1]),O(t,"class","render-error svelte-x5x50y")},m(r,i){$(r,t,i),F(t,e)},p(r,i){i&2&&Se(e,r[1])},d(r){r&&Q(t)}}}function Pa(n){let t,e,r,i=n[1]&&vi(n);return{c(){t=V("div"),e=V("div"),r=de(),i&&i.c(),O(t,"class","vegalite-renderer svelte-x5x50y")},m(o,s){$(o,t,s),F(t,e),n[3](e),F(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:ge,o:ge,d(o){o&&Q(t),n[3](null),i&&i.d()}}}function xa(n,t,e){let{source:r}=t,i,o=null,s=null,a=null,l=0,p=null;function h(){return p||(p=yn(()=>import("./embed-DcNeILcO.js"),__vite__mapDeps([2,3,1,4,5,6,7,8,9,10,11])).then(c=>c.default)),p}async function m(c){if(!i)return;const g=++l;e(1,o=null),a==null||a(),a=null;try{const u=JSON.parse(c),b=await h();if(g!==l)return;const _=await b(i,u,{actions:!1,renderer:"svg"});if(g!==l){_.view.finalize();return}a=()=>_.view.finalize()}catch(u){if(g!==l)return;e(1,o=u instanceof Error?u.message:String(u))}}Kt(()=>{m(r),s=r}),_n(()=>{r!==s&&(s=r,m(r))}),Jt(()=>{a==null||a()});function d(c){ft[c?"unshift":"push"](()=>{i=c,e(0,i)})}return n.$$set=c=>{"source"in c&&e(2,r=c.source)},[i,o,r,d]}class Fa extends st{constructor(t){super(),ot(this,t,xa,Pa,Qe,{source:2})}}function Ma(n){let t,e,r,i;return{c(){t=V("p"),e=se("Building step-frames… "),r=se(n[0]),i=se(" frames"),O(t,"class","placeholder svelte-7z4kp7")},m(o,s){$(o,t,s),F(t,e),F(t,r),F(t,i)},p(o,[s]){s&1&&Se(r,o[0])},i:ge,o:ge,d(o){o&&Q(t)}}}function Ba(n,t,e){let{frameCount:r}=t;return n.$$set=i=>{"frameCount"in i&&e(0,r=i.frameCount)},[r]}class Ua extends st{constructor(t){super(),ot(this,t,Ba,Ma,Qe,{frameCount:0})}}function ki(n){return({presentation:t})=>({source:t.frames[0].payload,type:n})}const Un={mermaid:{load:()=>Promise.resolve(Ca),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(yi),props:ki("svg")},html:{load:()=>Promise.resolve(yi),props:ki("html")},katex:{load:()=>Promise.resolve(Na),props:({presentation:n})=>({source:n.frames[0].payload})},"vega-lite":{load:()=>Promise.resolve(Fa),props:({presentation:n})=>({source:n.frames[0].payload})},"step-frames-placeholder":{load:()=>Promise.resolve(Ua),props:({placeholder:n})=>({frameCount:n.frameCount})}};function Ei(n){let t;function e(o,s){return o[15]?Wa:ja}let r=e(n),i=r(n);return{c(){t=V("div"),i.c(),O(t,"class","banner svelte-1plonic"),O(t,"role","alert"),O(t,"aria-live","assertive")},m(o,s){$(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&&Q(t),i.d()}}}function ja(n){let t;return{c(){t=se("Server disconnected. Reconnecting…")},m(e,r){$(e,t,r)},d(e){e&&Q(t)}}}function Wa(n){let t,e,r;return{c(){t=se("Server disconnected. Restart "),e=V("code"),e.textContent="npm run dev",r=se("."),O(e,"class","svelte-1plonic")},m(i,o){$(i,t,o),$(i,e,o),$(i,r,o)},d(i){i&&(Q(t),Q(e),Q(r))}}}function Si(n){let t,e=n[2].title+"",r;return{c(){t=V("header"),r=se(e),O(t,"class","canvas-title svelte-1plonic")},m(i,o){$(i,t,o),F(t,r)},p(i,o){o[0]&4&&e!==(e=i[2].title+"")&&Se(r,e)},d(i){i&&Q(t)}}}function Ha(n){let t,e,r;const i=[n[10]];var o=n[5];function s(a,l){let p={};for(let h=0;h<i.length;h+=1)p=wr(p,i[h]);return l!==void 0&&l[0]&1024&&(p=wr(p,Sr(i,[Tr(a[10])]))),{props:p}}return o&&(t=Er(o,s(n))),{c(){t&&Ge(t.$$.fragment),e=ut()},m(a,l){t&&je(t,a,l),$(a,e,l),r=!0},p(a,l){if(l[0]&32&&o!==(o=a[5])){if(t){nt();const p=t;Te(p.$$.fragment,1,0,()=>{We(p,1)}),rt()}o?(t=Er(o,s(a,l)),Ge(t.$$.fragment),Ee(t.$$.fragment,1),je(t,e.parentNode,e)):t=null}else if(o){const p=l[0]&1024?Sr(i,[Tr(a[10])]):{};t.$set(p)}},i(a){r||(t&&Ee(t.$$.fragment,a),r=!0)},o(a){t&&Te(t.$$.fragment,a),r=!1},d(a){a&&Q(e),t&&We(t,a)}}}function Za(n){let t;return{c(){t=V("p"),t.textContent="Waiting for content…",O(t,"class","placeholder svelte-1plonic")},m(e,r){$(e,t,r)},p:ge,i:ge,o:ge,d(e){e&&Q(t)}}}function Ti(n){let t,e,r,i,o,s,a,l,p,h,m,d=n[2].frames[0].label&&Ai(n);return{c(){t=V("div"),e=V("button"),r=se("← Prev"),o=de(),d&&d.c(),s=de(),a=V("button"),l=se("Next →"),O(e,"class","step-btn svelte-1plonic"),O(e,"aria-label","Previous frame"),e.disabled=i=n[1]===0,O(a,"class","step-btn svelte-1plonic"),O(a,"aria-label","Next frame"),a.disabled=p=n[11]!==void 0&&n[1]===n[11]-1,O(t,"class","step-bar svelte-1plonic")},m(c,g){$(c,t,g),F(t,e),F(e,r),F(t,o),d&&d.m(t,null),F(t,s),F(t,a),F(a,l),h||(m=[ve(e,"click",n[32]),ve(a,"click",n[33])],h=!0)},p(c,g){g[0]&2&&i!==(i=c[1]===0)&&(e.disabled=i),c[2].frames[0].label?d?d.p(c,g):(d=Ai(c),d.c(),d.m(t,s)):d&&(d.d(1),d=null),g[0]&2050&&p!==(p=c[11]!==void 0&&c[1]===c[11]-1)&&(a.disabled=p)},d(c){c&&Q(t),d&&d.d(),h=!1,Be(m)}}}function Ai(n){let t,e=n[2].frames[0].label+"",r;return{c(){t=V("span"),r=se(e),O(t,"class","step-label svelte-1plonic")},m(i,o){$(i,t,o),F(t,r)},p(i,o){o[0]&4&&e!==(e=i[2].frames[0].label+"")&&Se(r,e)},d(i){i&&Q(t)}}}function Ga(n){let t,e;return t=new Ct({props:{name:"moon"}}),{c(){Ge(t.$$.fragment)},m(r,i){je(t,r,i),e=!0},i(r){e||(Ee(t.$$.fragment,r),e=!0)},o(r){Te(t.$$.fragment,r),e=!1},d(r){We(t,r)}}}function Ya(n){let t,e;return t=new Ct({props:{name:"sun"}}),{c(){Ge(t.$$.fragment)},m(r,i){je(t,r,i),e=!0},i(r){e||(Ee(t.$$.fragment,r),e=!0)},o(r){Te(t.$$.fragment,r),e=!1},d(r){We(t,r)}}}function Ci(n){let t,e,r,i,o,s,a,l,p,h;const m=[Xa,Va,qa],d=[];function c(g,u){return g[17].sent?0:g[17].error?1:2}return i=c(n),o=d[i]=m[i](n),{c(){t=V("div"),e=de(),r=V("button"),o.c(),O(t,"class","panel-sep svelte-1plonic"),O(r,"class","done-btn svelte-1plonic"),r.disabled=s=n[17].sent,O(r,"title",a=n[17].error?"Failed to send — click to retry":"Done"),O(r,"aria-live","polite"),tt(r,"done-btn-error",n[17].error)},m(g,u){$(g,t,u),$(g,e,u),$(g,r,u),d[i].m(r,null),l=!0,p||(h=ve(r,"click",Kn.handleDone),p=!0)},p(g,u){let b=i;i=c(g),i!==b&&(nt(),Te(d[b],1,1,()=>{d[b]=null}),rt(),o=d[i],o||(o=d[i]=m[i](g),o.c()),Ee(o,1),o.m(r,null)),(!l||u[0]&131072&&s!==(s=g[17].sent))&&(r.disabled=s),(!l||u[0]&131072&&a!==(a=g[17].error?"Failed to send — click to retry":"Done"))&&O(r,"title",a),(!l||u[0]&131072)&&tt(r,"done-btn-error",g[17].error)},i(g){l||(Ee(o),l=!0)},o(g){Te(o),l=!1},d(g){g&&(Q(t),Q(e),Q(r)),d[i].d(),p=!1,h()}}}function qa(n){let t,e;return t=new Ct({props:{name:"check",size:16,strokeWidth:2.5}}),{c(){Ge(t.$$.fragment)},m(r,i){je(t,r,i),e=!0},i(r){e||(Ee(t.$$.fragment,r),e=!0)},o(r){Te(t.$$.fragment,r),e=!1},d(r){We(t,r)}}}function Va(n){let t;return{c(){t=se("Failed ✗")},m(e,r){$(e,t,r)},i:ge,o:ge,d(e){e&&Q(t)}}}function Xa(n){let t;return{c(){t=se("Sent ✓")},m(e,r){$(e,t,r)},i:ge,o:ge,d(e){e&&Q(t)}}}function Ka(n){let t,e,r,i,o,s,a,l,p,h,m,d,c,g,u,b,_,w,v,A,C,x,z,U,N,I,W,T,Z,y,Y,fe,K,re,q,oe,D,M,ue,ie,X,Ae,Re;function ye(P){n[28](P)}let le={};n[6]!==void 0&&(le.open=n[6]),t=new Do({props:le}),n[27](t),ft.push(()=>yo(t,"open",ye)),t.$on("close",n[29]),i=new Yo({props:{mode:n[13].mode??"delete",open:n[13].mode!==null,workspaces:n[13].workspaces,loadError:n[13].loadError}}),i.$on("close",hn.close),i.$on("deleted",n[18]);let Ie={open:n[8]};s=new ls({props:Ie}),n[30](s),s.$on("close",n[31]),s.$on("imported",n[20]);let be=n[14]&&Ei(n),Ce=n[2]!==null&&n[2].title&&Si(n);const he=[Za,Ha],f=[];function H(P,R){return P[2]===null&&P[3]===null?0:P[5]&&P[0]===P[4]?1:-1}~(c=H(n))&&(g=f[c]=he[c](n));let j=n[2]!==null&&n[12]==="manual"&&Ti(n);const S=[Ya,Ga],E=[];function L(P,R){return P[16]==="dark"?0:1}v=L(n),A=E[v]=S[v](n),T=new Ct({props:{name:"history"}}),K=new Ct({props:{name:"trash"}}),oe=new Ct({props:{name:"export"}}),ue=new Ct({props:{name:"import"}});let G=(n[17].armed||n[17].sent||n[17].error)&&Ci(n);return{c(){Ge(t.$$.fragment),r=de(),Ge(i.$$.fragment),o=de(),Ge(s.$$.fragment),a=de(),l=V("main"),be&&be.c(),p=de(),h=V("div"),Ce&&Ce.c(),m=de(),d=V("div"),g&&g.c(),u=de(),j&&j.c(),b=de(),_=V("div"),w=V("button"),A.c(),U=de(),N=V("div"),I=de(),W=V("button"),Ge(T.$$.fragment),Z=de(),y=V("div"),Y=de(),fe=V("button"),Ge(K.$$.fragment),re=de(),q=V("button"),Ge(oe.$$.fragment),D=de(),M=V("button"),Ge(ue.$$.fragment),ie=de(),G&&G.c(),O(d,"class","canvas svelte-1plonic"),O(h,"class","canvas-frame svelte-1plonic"),O(w,"class","panel-icon-btn svelte-1plonic"),O(w,"aria-label",C=n[16]==="dark"?"Switch to light theme":"Switch to dark theme"),O(w,"aria-pressed",x=n[16]==="dark"),O(w,"title",z=n[16]==="dark"?"Switch to light theme":"Switch to dark theme"),O(N,"class","panel-sep svelte-1plonic"),O(W,"class","panel-icon-btn svelte-1plonic"),O(W,"aria-label","Toggle history panel"),O(W,"aria-pressed",n[6]),O(W,"title","History"),O(y,"class","panel-sep svelte-1plonic"),O(fe,"class","panel-icon-btn delete-btn svelte-1plonic"),O(fe,"aria-label","Delete snapshots"),O(fe,"title","Delete snapshots"),O(q,"class","panel-icon-btn export-btn svelte-1plonic"),O(q,"aria-label","Export snapshots"),O(q,"title","Export snapshots to HTML"),O(M,"class","panel-icon-btn import-btn svelte-1plonic"),O(M,"aria-label","Import"),O(M,"title","Import workspace from a .zip"),O(_,"class","controls-panel svelte-1plonic"),O(l,"class","svelte-1plonic")},m(P,R){je(t,P,R),$(P,r,R),je(i,P,R),$(P,o,R),je(s,P,R),$(P,a,R),$(P,l,R),be&&be.m(l,null),F(l,p),F(l,h),Ce&&Ce.m(h,null),F(h,m),F(h,d),~c&&f[c].m(d,null),F(l,u),j&&j.m(l,null),F(l,b),F(l,_),F(_,w),E[v].m(w,null),F(_,U),F(_,N),F(_,I),F(_,W),je(T,W,null),F(_,Z),F(_,y),F(_,Y),F(_,fe),je(K,fe,null),F(_,re),F(_,q),je(oe,q,null),F(_,D),F(_,M),je(ue,M,null),F(_,ie),G&&G.m(_,null),X=!0,Ae||(Re=[ve(w,"click",Mi.toggle),ve(W,"click",n[34]),ve(fe,"click",n[35]),ve(q,"click",n[36]),ve(M,"click",n[37]),ve(l,"dragover",Ja),ve(l,"drop",n[19])],Ae=!0)},p(P,R){const ee={};!e&&R[0]&64&&(e=!0,ee.open=P[6],_o(()=>e=!1)),t.$set(ee);const ae={};R[0]&8192&&(ae.mode=P[13].mode??"delete"),R[0]&8192&&(ae.open=P[13].mode!==null),R[0]&8192&&(ae.workspaces=P[13].workspaces),R[0]&8192&&(ae.loadError=P[13].loadError),i.$set(ae);const ne={};R[0]&256&&(ne.open=P[8]),s.$set(ne),P[14]?be?be.p(P,R):(be=Ei(P),be.c(),be.m(l,p)):be&&(be.d(1),be=null),P[2]!==null&&P[2].title?Ce?Ce.p(P,R):(Ce=Si(P),Ce.c(),Ce.m(h,m)):Ce&&(Ce.d(1),Ce=null);let pe=c;c=H(P),c===pe?~c&&f[c].p(P,R):(g&&(nt(),Te(f[pe],1,1,()=>{f[pe]=null}),rt()),~c?(g=f[c],g?g.p(P,R):(g=f[c]=he[c](P),g.c()),Ee(g,1),g.m(d,null)):g=null),P[2]!==null&&P[12]==="manual"?j?j.p(P,R):(j=Ti(P),j.c(),j.m(l,b)):j&&(j.d(1),j=null);let ke=v;v=L(P),v!==ke&&(nt(),Te(E[ke],1,1,()=>{E[ke]=null}),rt(),A=E[v],A||(A=E[v]=S[v](P),A.c()),Ee(A,1),A.m(w,null)),(!X||R[0]&65536&&C!==(C=P[16]==="dark"?"Switch to light theme":"Switch to dark theme"))&&O(w,"aria-label",C),(!X||R[0]&65536&&x!==(x=P[16]==="dark"))&&O(w,"aria-pressed",x),(!X||R[0]&65536&&z!==(z=P[16]==="dark"?"Switch to light theme":"Switch to dark theme"))&&O(w,"title",z),(!X||R[0]&64)&&O(W,"aria-pressed",P[6]),P[17].armed||P[17].sent||P[17].error?G?(G.p(P,R),R[0]&131072&&Ee(G,1)):(G=Ci(P),G.c(),Ee(G,1),G.m(_,null)):G&&(nt(),Te(G,1,1,()=>{G=null}),rt())},i(P){X||(Ee(t.$$.fragment,P),Ee(i.$$.fragment,P),Ee(s.$$.fragment,P),Ee(g),Ee(A),Ee(T.$$.fragment,P),Ee(K.$$.fragment,P),Ee(oe.$$.fragment,P),Ee(ue.$$.fragment,P),Ee(G),X=!0)},o(P){Te(t.$$.fragment,P),Te(i.$$.fragment,P),Te(s.$$.fragment,P),Te(g),Te(A),Te(T.$$.fragment,P),Te(K.$$.fragment,P),Te(oe.$$.fragment,P),Te(ue.$$.fragment,P),Te(G),X=!1},d(P){P&&(Q(r),Q(o),Q(a),Q(l)),n[27](null),We(t,P),We(i,P),n[30](null),We(s,P),be&&be.d(),Ce&&Ce.d(),~c&&f[c].d(),j&&j.d(),E[v].d(),We(T),We(K),We(oe),We(ue),G&&G.d(),Ae=!1,Be(Re)}}}function Ja(n){var t;(t=n.dataTransfer)!=null&&t.types.includes("Files")&&n.preventDefault()}function Qa(n,t,e){let r,i,o,s,a,l,p,h,m,d,c,g,u,b,_,w,v,A;_t(n,xi,le=>e(26,u=le)),_t(n,hn,le=>e(13,b=le)),_t(n,Jn,le=>e(14,_=le)),_t(n,Qn,le=>e(15,w=le)),_t(n,Mi,le=>e(16,v=le)),_t(n,Kn,le=>e(17,A=le));const C=new Map;let x,z,U=0;async function N(le){if(le===void 0){e(5,x=void 0),e(0,z=void 0);return}const Ie=C.get(le);if(Ie){e(5,x=Ie),e(0,z=le);return}const be=++U,Ce=await Un[le].load();be===U&&(C.set(le,Ce),e(5,x=Ce),e(0,z=le))}let I=null;Kt(()=>{I=zs()}),Jt(()=>{I==null||I()});let W=!1,T;function Z(){W&&(T==null||T.fetchSnapshots())}let y=!1,Y;function fe(le){var be;const Ie=(be=le.dataTransfer)==null?void 0:be.files[0];Ie&&(le.preventDefault(),e(8,y=!0),Y==null||Y.acceptFile(Ie))}function K(){W&&(T==null||T.fetchSnapshots())}function re(le){ft[le?"unshift":"push"](()=>{T=le,e(7,T)})}function q(le){W=le,e(6,W)}const oe=()=>{e(6,W=!1)};function D(le){ft[le?"unshift":"push"](()=>{Y=le,e(9,Y)})}const M=()=>{e(8,y=!1)},ue=()=>Kr("prev"),ie=()=>Kr("next"),X=()=>{e(6,W=!W)},Ae=()=>hn.open("delete"),Re=()=>hn.open("export"),ye=()=>{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:p,clickable:h,nodeActions:m,nodeToFrameEnabled:d}=u,r,(e(12,i),e(26,u)),(e(3,o),e(26,u)),(e(1,s),e(26,u)),(e(11,a),e(26,u)),(e(21,l),e(26,u)),(e(22,p),e(26,u)),(e(25,h),e(26,u)),(e(24,m),e(26,u)),(e(23,d),e(26,u))),n.$$.dirty[0]&12&&e(4,c=o!==null?"step-frames-placeholder":(le=r==null?void 0:r.frames[0])==null?void 0:le.type),n.$$.dirty[0]&16&&N(c),n.$$.dirty[0]&65011743&&e(10,g=!z||z!==c?{}:z==="step-frames-placeholder"?o?Un["step-frames-placeholder"].props({placeholder:o}):{}:r?Un[z].props({presentation:r,clickable:h,nodeActions:m,nodeToFrameEnabled:d,nodeToFrame:p,viewport:l,currentFrame:s??0}):{})},[z,s,r,o,c,x,W,T,y,Y,g,a,i,b,_,w,v,A,Z,fe,K,l,p,d,m,h,u,re,q,oe,D,M,ue,ie,X,Ae,Re,ye]}class $a extends st{constructor(t){super(),ot(this,t,Qa,Ka,Qe,{},null,[-1,-1])}}new $a({target:document.getElementById("app")});export{yn as _,cn as c,qo as g,Hi as p};