@openparachute/notes-ui 0.1.6 → 0.1.7-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/dist/.parachute/info +1 -1
  3. package/dist/assets/Activity-bT-4Y6Hc.js +1 -0
  4. package/dist/assets/AddVault-D-ahv-KW.js +1 -0
  5. package/dist/assets/Calendar-CYvQrwCA.js +1 -0
  6. package/dist/assets/Import-CZCd6DVe.js +20 -0
  7. package/dist/assets/NoteEditor-DejkUizg.js +1 -0
  8. package/dist/assets/NoteNew-BgEB8Ff1.js +9 -0
  9. package/dist/assets/{NoteRenderer-uc1hZU0j.js → NoteRenderer-B-t3iR2x.js} +23 -23
  10. package/dist/assets/NoteView-B0i46Tpn.js +3 -0
  11. package/dist/assets/OAuthCallback-C-st38Zr.js +1 -0
  12. package/dist/assets/PinArchiveButtons-BEmrCa2u.js +1 -0
  13. package/dist/assets/Settings-C04VDzuq.js +1 -0
  14. package/dist/assets/Tags-BcEIUux1.js +1 -0
  15. package/dist/assets/Today-Cz-OTXJ7.js +1 -0
  16. package/dist/assets/VaultGraph-D42L0Y2e.js +3 -0
  17. package/dist/assets/Vaults-BfdAmD22.js +1 -0
  18. package/dist/assets/attachment-upload-DELsFKqW.js +2 -0
  19. package/dist/assets/index--Z5j3NQq.css +1 -0
  20. package/dist/assets/index-DQ3LtJxh.js +67 -0
  21. package/dist/assets/{react-force-graph-2d-BhR6Ke_0.js → react-force-graph-2d-BD6TQ9hX.js} +10 -10
  22. package/dist/assets/url-QSQwrjSV.js +1 -0
  23. package/dist/assets/{useAttachmentUploader-BQ3_bJ9p.js → useAttachmentUploader-TbRdZxIB.js} +11 -13
  24. package/dist/index.html +2 -2
  25. package/dist/sw.js +1 -1
  26. package/package.json +3 -2
  27. package/dist/assets/Activity-B_Je-lCL.js +0 -1
  28. package/dist/assets/AddVault-D0ySEVNg.js +0 -1
  29. package/dist/assets/AttachmentDropZone-CqhzolLE.js +0 -1
  30. package/dist/assets/Calendar-CoPaqJQB.js +0 -1
  31. package/dist/assets/Import-CrWr1lWO.js +0 -14
  32. package/dist/assets/NoteEditor-D-bt-d63.js +0 -1
  33. package/dist/assets/NoteNew-Dw7l1rjo.js +0 -9
  34. package/dist/assets/NoteView-CGGge5Bp.js +0 -3
  35. package/dist/assets/OAuthCallback-D1ql8sDc.js +0 -1
  36. package/dist/assets/PinArchiveButtons-DAjOG3J2.js +0 -1
  37. package/dist/assets/Settings-DTa8sOyo.js +0 -1
  38. package/dist/assets/Tags-F1LzSPLy.js +0 -1
  39. package/dist/assets/Today-HA6so2M2.js +0 -1
  40. package/dist/assets/VaultGraph-XMhBSHMZ.js +0 -3
  41. package/dist/assets/Vaults-N_zHHUue.js +0 -1
  42. package/dist/assets/index-953EjlvE.js +0 -62
  43. package/dist/assets/index-By5JSkFz.css +0 -1
package/dist/index.html CHANGED
@@ -19,8 +19,8 @@
19
19
  } catch (e) {}
20
20
  })();
21
21
  </script>
22
- <script type="module" crossorigin src="./assets/index-953EjlvE.js"></script>
23
- <link rel="stylesheet" crossorigin href="./assets/index-By5JSkFz.css">
22
+ <script type="module" crossorigin src="./assets/index-DQ3LtJxh.js"></script>
23
+ <link rel="stylesheet" crossorigin href="./assets/index--Z5j3NQq.css">
24
24
  <link rel="manifest" href="./manifest.webmanifest"></head>
25
25
  <body>
26
26
  <div id="root"></div>
package/dist/sw.js CHANGED
@@ -1 +1 @@
1
- if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise(s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()}).then(()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e}));self.define=(n,l)=>{const r=e||("document"in self?document.currentScript.src:"")||location.href;if(s[r])return;let o={};const a=e=>i(e,r),t={module:{uri:r},exports:o,require:a};s[r]=Promise.all(n.map(e=>t[e]||a(e))).then(e=>(l(...e),o))}}define(["./workbox-b9acee4e"],function(e){"use strict";self.addEventListener("message",e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()}),e.precacheAndRoute([{url:"pwa-64x64.png",revision:"52bb73fe0f7c4274aa55047dc0d5479d"},{url:"pwa-512x512.png",revision:"ebdabf19d41be24e3f47062e89399c09"},{url:"pwa-192x192.png",revision:"ec3f52a07bade7b8a295997c236dac75"},{url:"maskable-icon-512x512.png",revision:"e0d671a48eed68b28f8e7ded8a86ef88"},{url:"manifest.webmanifest",revision:"4e69789fa00f6df17850c3426d2041a9"},{url:"index.html",revision:"be4e7042fed0f40e7620c4bc3f6803e5"},{url:"icon.svg",revision:"899549fbb9d379c3b78ab012abe72061"},{url:"favicon.ico",revision:"01d978be2c7b93a7348d91107b5bf8ad"},{url:"apple-touch-icon-180x180.png",revision:"dd71bb172b849f6328130ba825ae606d"},{url:"assets/workbox-window.prod.es5-BBnX5xw4.js",revision:null},{url:"assets/useAttachmentUploader-BQ3_bJ9p.js",revision:null},{url:"assets/react-force-graph-2d-BhR6Ke_0.js",revision:null},{url:"assets/index-By5JSkFz.css",revision:null},{url:"assets/index-953EjlvE.js",revision:null},{url:"assets/dates-BGZoWpL2.js",revision:null},{url:"assets/Vaults-N_zHHUue.js",revision:null},{url:"assets/VaultGraph-XMhBSHMZ.js",revision:null},{url:"assets/Today-HA6so2M2.js",revision:null},{url:"assets/Tags-F1LzSPLy.js",revision:null},{url:"assets/Settings-DTa8sOyo.js",revision:null},{url:"assets/PinArchiveButtons-DAjOG3J2.js",revision:null},{url:"assets/OAuthCallback-D1ql8sDc.js",revision:null},{url:"assets/NoteView-CGGge5Bp.js",revision:null},{url:"assets/NoteRenderer-uc1hZU0j.js",revision:null},{url:"assets/NoteNew-Dw7l1rjo.js",revision:null},{url:"assets/NoteEditor-D-bt-d63.js",revision:null},{url:"assets/Import-CrWr1lWO.js",revision:null},{url:"assets/Calendar-CoPaqJQB.js",revision:null},{url:"assets/AttachmentDropZone-CqhzolLE.js",revision:null},{url:"assets/AddVault-D0ySEVNg.js",revision:null},{url:"assets/Activity-B_Je-lCL.js",revision:null},{url:"apple-touch-icon-180x180.png",revision:"dd71bb172b849f6328130ba825ae606d"},{url:"favicon.ico",revision:"01d978be2c7b93a7348d91107b5bf8ad"},{url:"icon.svg",revision:"899549fbb9d379c3b78ab012abe72061"},{url:"maskable-icon-512x512.png",revision:"e0d671a48eed68b28f8e7ded8a86ef88"},{url:"pwa-192x192.png",revision:"ec3f52a07bade7b8a295997c236dac75"},{url:"pwa-512x512.png",revision:"ebdabf19d41be24e3f47062e89399c09"},{url:"pwa-64x64.png",revision:"52bb73fe0f7c4274aa55047dc0d5479d"},{url:"manifest.webmanifest",revision:"4e69789fa00f6df17850c3426d2041a9"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("/notes/index.html"),{denylist:[/^\/api\//,/^\/oauth\//,/^\/\.well-known\//]})),e.registerRoute(/^https:\/\/fonts\.(googleapis|gstatic)\.com\/.*/i,new e.StaleWhileRevalidate({cacheName:"google-fonts",plugins:[new e.ExpirationPlugin({maxEntries:30,maxAgeSeconds:2592e3}),new e.CacheableResponsePlugin({statuses:[0,200]})]}),"GET")});
1
+ if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise(s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()}).then(()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e}));self.define=(n,l)=>{const r=e||("document"in self?document.currentScript.src:"")||location.href;if(s[r])return;let a={};const o=e=>i(e,r),t={module:{uri:r},exports:a,require:o};s[r]=Promise.all(n.map(e=>t[e]||o(e))).then(e=>(l(...e),a))}}define(["./workbox-b9acee4e"],function(e){"use strict";self.addEventListener("message",e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()}),e.precacheAndRoute([{url:"pwa-64x64.png",revision:"52bb73fe0f7c4274aa55047dc0d5479d"},{url:"pwa-512x512.png",revision:"ebdabf19d41be24e3f47062e89399c09"},{url:"pwa-192x192.png",revision:"ec3f52a07bade7b8a295997c236dac75"},{url:"maskable-icon-512x512.png",revision:"e0d671a48eed68b28f8e7ded8a86ef88"},{url:"manifest.webmanifest",revision:"4e69789fa00f6df17850c3426d2041a9"},{url:"index.html",revision:"5d4244321f6ce3f600b5008ff002b05a"},{url:"icon.svg",revision:"899549fbb9d379c3b78ab012abe72061"},{url:"favicon.ico",revision:"01d978be2c7b93a7348d91107b5bf8ad"},{url:"apple-touch-icon-180x180.png",revision:"dd71bb172b849f6328130ba825ae606d"},{url:"assets/workbox-window.prod.es5-BBnX5xw4.js",revision:null},{url:"assets/useAttachmentUploader-TbRdZxIB.js",revision:null},{url:"assets/url-QSQwrjSV.js",revision:null},{url:"assets/react-force-graph-2d-BD6TQ9hX.js",revision:null},{url:"assets/index-DQ3LtJxh.js",revision:null},{url:"assets/index--Z5j3NQq.css",revision:null},{url:"assets/dates-BGZoWpL2.js",revision:null},{url:"assets/attachment-upload-DELsFKqW.js",revision:null},{url:"assets/Vaults-BfdAmD22.js",revision:null},{url:"assets/VaultGraph-D42L0Y2e.js",revision:null},{url:"assets/Today-Cz-OTXJ7.js",revision:null},{url:"assets/Tags-BcEIUux1.js",revision:null},{url:"assets/Settings-C04VDzuq.js",revision:null},{url:"assets/PinArchiveButtons-BEmrCa2u.js",revision:null},{url:"assets/OAuthCallback-C-st38Zr.js",revision:null},{url:"assets/NoteView-B0i46Tpn.js",revision:null},{url:"assets/NoteRenderer-B-t3iR2x.js",revision:null},{url:"assets/NoteNew-BgEB8Ff1.js",revision:null},{url:"assets/NoteEditor-DejkUizg.js",revision:null},{url:"assets/Import-CZCd6DVe.js",revision:null},{url:"assets/Calendar-CYvQrwCA.js",revision:null},{url:"assets/AddVault-D-ahv-KW.js",revision:null},{url:"assets/Activity-bT-4Y6Hc.js",revision:null},{url:"apple-touch-icon-180x180.png",revision:"dd71bb172b849f6328130ba825ae606d"},{url:"favicon.ico",revision:"01d978be2c7b93a7348d91107b5bf8ad"},{url:"icon.svg",revision:"899549fbb9d379c3b78ab012abe72061"},{url:"maskable-icon-512x512.png",revision:"e0d671a48eed68b28f8e7ded8a86ef88"},{url:"pwa-192x192.png",revision:"ec3f52a07bade7b8a295997c236dac75"},{url:"pwa-512x512.png",revision:"ebdabf19d41be24e3f47062e89399c09"},{url:"pwa-64x64.png",revision:"52bb73fe0f7c4274aa55047dc0d5479d"},{url:"manifest.webmanifest",revision:"4e69789fa00f6df17850c3426d2041a9"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("/notes/index.html"),{denylist:[/^\/api\//,/^\/oauth\//,/^\/\.well-known\//]})),e.registerRoute(/^https:\/\/fonts\.(googleapis|gstatic)\.com\/.*/i,new e.StaleWhileRevalidate({cacheName:"google-fonts",plugins:[new e.ExpirationPlugin({maxEntries:30,maxAgeSeconds:2592e3}),new e.CacheableResponsePlugin({statuses:[0,200]})]}),"GET")});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openparachute/notes-ui",
3
- "version": "0.1.6",
3
+ "version": "0.1.7-rc.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Parachute Notes UI bundle \u2014 the SPA installed under parachute-surface as the canonical first app. No daemon, no module surface; just the built dist/.",
@@ -31,7 +31,8 @@
31
31
  "@codemirror/state": "^6.6.0",
32
32
  "@codemirror/view": "^6.41.1",
33
33
  "@lezer/highlight": "^1.2.3",
34
- "@openparachute/surface-client": "^0.1.0",
34
+ "@openparachute/surface-client": "^0.3.0",
35
+ "@openparachute/surface-render": "^0.2.0",
35
36
  "@tanstack/react-query": "^5",
36
37
  "highlight.js": "^11.11.1",
37
38
  "idb": "^8.0.3",
@@ -1 +0,0 @@
1
- import{af as h,Y as g,z as l,t as e,N as f,L as m,B as b,V as y}from"./index-953EjlvE.js";const p=1440*60*1e3,j=5e3;function N(n,r=30,s=new Date){const d=s.getTime()-r*p,a=[];for(const t of n){const c=t.path??t.id,o=Date.parse(t.createdAt);if(Number.isFinite(o)&&o>=d&&a.push({id:`${t.id}:created`,noteId:t.id,noteName:c,kind:"created",at:t.createdAt,preview:t.preview,tags:t.tags}),t.updatedAt){const i=Date.parse(t.updatedAt);Number.isFinite(i)&&i>=d&&Number.isFinite(o)&&i-o>j&&a.push({id:`${t.id}:updated`,noteId:t.id,noteName:c,kind:"updated",at:t.updatedAt,preview:t.preview,tags:t.tags})}}return a.sort((t,c)=>Date.parse(c.at)-Date.parse(t.at)),a}const v=["today","yesterday","thisWeek","older"],w={today:"Today",yesterday:"Yesterday",thisWeek:"This week",older:"Older"};function k(n,r=new Date){const s=Date.parse(n);if(!Number.isFinite(s))return null;const d=u(r),a=u(new Date(s)),t=Math.round((d.getTime()-a.getTime())/p);return t<0||t===0?"today":t===1?"yesterday":t<7?"thisWeek":"older"}function u(n){return new Date(n.getFullYear(),n.getMonth(),n.getDate())}function D(n,r=new Date){const s={today:[],yesterday:[],thisWeek:[],older:[]};for(const d of n){const a=k(d.at,r);a&&s[a].push(d)}return s}const x=50;function F(){const n=h(i=>i.getActiveVault()),r=g(),[s,d]=l.useState(x),a=l.useMemo(()=>r.data?N(r.data):[],[r.data]),t=l.useMemo(()=>a.slice(0,s),[a,s]),c=l.useMemo(()=>D(t),[t]),o=a.length-t.length;return n?e.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-6 md:px-6 md:py-10",children:[e.jsxs("header",{className:"mb-5 md:mb-6",children:[e.jsx("p",{className:"text-xs uppercase tracking-wider text-fg-dim",children:"Activity"}),e.jsx("h1",{className:"font-serif text-2xl tracking-tight md:text-3xl",children:"Recent changes"}),e.jsx("p",{className:"mt-1 text-sm text-fg-muted",children:"Last 30 days, newest first. Deletions aren't tracked yet."})]}),r.isPending?e.jsx(T,{}):r.isError?e.jsx(B,{error:r.error}):a.length===0?e.jsx(S,{}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"space-y-8",children:v.map(i=>c[i].length>0?e.jsx(E,{title:w[i],events:c[i]},i):null)}),o>0?e.jsx("div",{className:"mt-8 flex justify-center",children:e.jsxs("button",{type:"button",onClick:()=>d(i=>i+x),className:"rounded-md border border-border bg-card px-4 py-2 text-sm text-fg-muted hover:text-accent",children:["Load more (",o," remaining)"]})}):null]})]}):e.jsx(f,{to:"/",replace:!0})}function E({title:n,events:r}){return e.jsxs("section",{children:[e.jsxs("h2",{className:"mb-2 text-xs uppercase tracking-wider text-fg-dim",children:[n," (",r.length,")"]}),e.jsx("ol",{className:"divide-y divide-border rounded-md border border-border bg-card",children:r.map(s=>e.jsx("li",{children:e.jsxs(m,{to:`/n/${encodeURIComponent(s.noteId)}`,className:"block px-4 py-3 hover:bg-bg/60 focus:bg-bg/60 focus:outline-none",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-4",children:[e.jsxs("div",{className:"flex min-w-0 items-baseline gap-2",children:[e.jsx(A,{kind:s.kind}),e.jsx("span",{className:"truncate font-mono text-sm text-fg",children:s.noteName})]}),e.jsx("span",{className:"shrink-0 text-xs text-fg-dim",children:b(s.at)})]}),s.preview?e.jsx("p",{className:"mt-1 truncate text-sm text-fg-muted",children:s.preview}):null,s.tags&&s.tags.length>0?e.jsx("div",{className:"mt-2 flex flex-wrap gap-1",children:s.tags.map(d=>e.jsxs("span",{className:"rounded-md bg-border/40 px-1.5 py-0.5 text-xs text-fg-dim",children:["#",d]},d))}):null]})},s.id))})]})}function A({kind:n}){return n==="created"?e.jsx("span",{className:"shrink-0 rounded-md bg-accent/10 px-1.5 py-0.5 text-xs text-accent",children:"Created"}):e.jsx("span",{className:"shrink-0 rounded-md bg-border/40 px-1.5 py-0.5 text-xs text-fg-muted",children:"Edited"})}function S(){return e.jsxs("div",{className:"rounded-md border border-border bg-card p-10 text-center",children:[e.jsx("p",{className:"mb-4 text-fg-muted",children:"No activity in the last 30 days."}),e.jsx(m,{to:"/new",className:"inline-block rounded-md bg-accent px-4 py-2 text-sm font-medium text-white hover:bg-accent-hover",children:"New note"})]})}function T(){return e.jsx("div",{className:"space-y-3","aria-busy":"true",children:[0,1,2,3,4].map(n=>e.jsx("div",{className:"h-16 animate-pulse rounded-md bg-border/30"},n))})}function B({error:n}){const r=n instanceof y;return e.jsxs("div",{className:"rounded-md border border-red-500/30 bg-red-500/5 p-6",children:[e.jsx("p",{className:"mb-2 font-medium text-red-400",children:r?"Session expired":"Could not load activity"}),e.jsx("p",{className:"mb-4 text-sm text-fg-muted",children:n.message}),r?e.jsx(m,{to:"/add",className:"inline-block rounded-md bg-accent px-4 py-2 text-sm font-medium text-white hover:bg-accent-hover",children:"Reconnect vault"}):null]})}export{F as Activity};
@@ -1 +0,0 @@
1
- import{a5 as v,z as t,Z as j,t as e,I as y,x as w,k as N,a as S}from"./index-953EjlvE.js";function R(){const[b]=v(),u=b.get("url")??"",[a,c]=t.useState(u),[i,l]=t.useState(null),[g,d]=t.useState(!1),[o,m]=t.useState(!1),x=t.useRef(null),h=t.useRef(u.length>0),n=j();t.useEffect(()=>{var s;(s=x.current)==null||s.focus()},[]),t.useEffect(()=>{h.current||n.status==="found"&&n.origin&&a===""&&(c(n.origin),h.current=!0)},[n.status,n.origin,a]);async function p(s){s.preventDefault(),l(null),d(!1);let f;try{f=w(a)}catch(r){l(r.message);return}m(!0);try{const{authorizeUrl:r}=await N(f);window.location.assign(r)}catch(r){r instanceof S?d(!0):l(r.message),m(!1)}}return e.jsxs("div",{className:"mx-auto max-w-xl px-6 py-16",children:[e.jsx("h1",{className:"mb-2 font-serif text-4xl tracking-tight",children:"Connect a vault"}),e.jsx("p",{className:"mb-8 text-fg-muted",children:"Paste your Parachute hub URL. You'll be taken to its consent page to authorize Parachute Notes."}),e.jsxs("form",{onSubmit:p,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"vault-url",className:"mb-1.5 block text-sm font-medium text-fg",children:"Hub URL"}),e.jsx("input",{id:"vault-url",ref:x,type:"url",required:!0,placeholder:"http://localhost:1939",value:a,onChange:s=>c(s.target.value),disabled:o,className:"w-full rounded-md border border-border bg-card px-3 py-2 font-mono text-sm text-fg focus:border-accent focus:outline-none"}),e.jsxs("p",{className:"mt-1.5 text-xs text-fg-dim",children:["For a local install the hub lives at ",e.jsx("code",{children:"http://localhost:1939"}),". A standalone vault URL (e.g. ",e.jsx("code",{children:"https://host/vault/default"}),") also works — Notes will OAuth against whichever issuer answers."]})]}),g?e.jsx(y,{}):null,i?e.jsx("div",{className:"rounded-md border border-red-400/30 bg-red-400/5 px-3 py-2 text-sm text-red-400",children:i}):null,e.jsx("button",{type:"submit",disabled:o||!a,className:"w-full rounded-md bg-accent px-4 py-2.5 text-sm font-medium text-white hover:bg-accent-hover disabled:cursor-not-allowed disabled:opacity-60",children:o?"Starting OAuth…":"Continue"})]})]})}export{R as AddVault};
@@ -1 +0,0 @@
1
- import{z as r,t as c}from"./index-953EjlvE.js";function v({onDropFiles:t,children:s,className:a,hint:o}){const[i,f]=r.useState(!1),n=r.useRef(0),d=r.useCallback(e=>{l(e.dataTransfer)&&(e.preventDefault(),n.current+=1,f(!0))},[]),p=r.useCallback(e=>{l(e.dataTransfer)&&(e.preventDefault(),n.current=Math.max(0,n.current-1),n.current===0&&f(!1))},[]),m=r.useCallback(e=>{l(e.dataTransfer)&&(e.preventDefault(),e.dataTransfer.dropEffect="copy")},[]),x=r.useCallback(e=>{if(!l(e.dataTransfer))return;e.preventDefault(),f(!1),n.current=0;const u=Array.from(e.dataTransfer.files);u.length>0&&t(u)},[t]);return c.jsxs("div",{className:`relative ${a??""}`,onDragEnter:d,onDragLeave:p,onDragOver:m,onDrop:x,children:[s,i?c.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 z-20 flex items-center justify-center rounded-md border-2 border-dashed border-accent bg-accent/10 text-sm text-accent",children:c.jsxs("div",{className:"rounded-md bg-bg/80 px-4 py-2 font-medium shadow",children:["Drop to attach",o?c.jsxs("span",{className:"ml-2 text-fg-dim",children:["— ",o]}):null]})}):null]})}function l(t){if(!t)return!1;const s=t.types;for(let a=0;a<s.length;a++)if(s[a]==="Files")return!0;return!1}export{v as A};
@@ -1 +0,0 @@
1
- import{af as k,a5 as E,Y as A,z as f,t as e,N as K,L as d,V as S}from"./index-953EjlvE.js";import{d as y,c as j,e as P,m as T,t as V,s as N,p as i,a as C}from"./dates-BGZoWpL2.js";const Y=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],x=5;function B(){const a=k(t=>t.getActiveVault()),[o]=E(),l=o.get("month"),r=y(l)??y(j()),s=A(),h=P(),v=f.useMemo(()=>T(r.year,r.month),[r.year,r.month]),$=f.useMemo(()=>{const t=new Map;if(!s.data)return t;for(const n of s.data){const c=V(n.createdAt);c&&t.set(c,(t.get(c)??0)+1)}return t},[s.data]);if(!a)return e.jsx(K,{to:"/",replace:!0});const u=N(r.year,r.month,-1),p=N(r.year,r.month,1),b=`${u.year}-${i(u.month)}`,g=`${p.year}-${i(p.month)}`,M=j(),w=`${r.year}-${i(r.month)}`===M;return e.jsxs("div",{className:"mx-auto max-w-4xl px-4 py-6 md:px-6 md:py-10",children:[e.jsxs("header",{className:"mb-6 flex flex-wrap items-baseline justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs uppercase tracking-wider text-fg-dim",children:"Calendar"}),e.jsx("h1",{className:"font-serif text-3xl tracking-tight",children:C(r.year,r.month)})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[e.jsxs(d,{to:`/calendar?month=${b}`,className:"rounded-md border border-border bg-card px-3 py-1.5 text-fg-muted hover:text-accent","aria-label":"Previous month",children:["← ",b]}),w?null:e.jsx(d,{to:"/calendar",className:"rounded-md border border-border bg-card px-3 py-1.5 text-fg-muted hover:text-accent",children:"This month"}),e.jsxs(d,{to:`/calendar?month=${g}`,className:"rounded-md border border-border bg-card px-3 py-1.5 text-fg-muted hover:text-accent","aria-label":"Next month",children:[g," →"]}),e.jsx(d,{to:`/today?date=${h}`,className:"rounded-md border border-border bg-card px-3 py-1.5 text-fg-muted hover:text-accent",children:"Today"})]})]}),s.isError?e.jsx(F,{error:s.error}):e.jsxs("div",{className:"rounded-md border border-border bg-card","aria-busy":s.isPending,children:[e.jsx("div",{className:"grid grid-cols-7 border-b border-border text-xs uppercase tracking-wider text-fg-dim",children:Y.map(t=>e.jsx("div",{className:"px-2 py-2 text-center",children:t},t))}),e.jsx("div",{className:"grid grid-cols-7",children:v.map(t=>{const n=`${t.getFullYear()}-${i(t.getMonth()+1)}-${i(t.getDate())}`,c=t.getMonth()+1===r.month,m=$.get(n)??0,D=n===h;return e.jsxs(d,{to:`/today?date=${n}`,className:`flex min-h-20 flex-col border-b border-r border-border p-1.5 text-xs hover:bg-bg/60 focus:bg-bg/60 focus:outline-none ${c?"":"opacity-40"}`,"aria-label":`${n} — ${m} notes`,children:[e.jsx("span",{className:`mb-1 inline-flex h-6 w-6 items-center justify-center rounded-full ${D?"bg-accent text-white":"text-fg"}`,children:t.getDate()}),m>0?e.jsx(_,{count:m}):e.jsx("span",{className:"sr-only",children:"no notes"})]},n)})})]}),e.jsx("p",{className:"mt-3 text-xs text-fg-dim",children:"Each dot is a note created on that day. Click any day to open /today."})]})}function _({count:a}){const o=Math.min(a,x),l=a>x?a-x:0;return e.jsxs("span",{className:"flex flex-wrap items-center gap-0.5",children:[Array.from({length:o}).map((r,s)=>e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-accent","aria-hidden":"true"},s)),l>0?e.jsxs("span",{className:"ml-0.5 text-[10px] text-fg-dim",children:["+",l]}):null]})}function F({error:a}){const o=a instanceof S;return e.jsxs("div",{className:"rounded-md border border-red-500/30 bg-red-500/5 p-6",children:[e.jsx("p",{className:"mb-2 font-medium text-red-400",children:o?"Session expired":"Could not load notes"}),e.jsx("p",{className:"mb-4 text-sm text-fg-muted",children:a.message}),o?e.jsx(d,{to:"/add",className:"inline-block rounded-md bg-accent px-4 py-2 text-sm font-medium text-white hover:bg-accent-hover",children:"Reconnect vault"}):null]})}export{B as Calendar};
@@ -1,14 +0,0 @@
1
- import{m as kt,r as Gt,f as Vt,h as Kt,V as Yt,i as Tt,af as Xt,G as $t,W as qt,ab as Jt,z as gt,t as H,N as Qt,L as te}from"./index-953EjlvE.js";import{A as ee}from"./AttachmentDropZone-CqhzolLE.js";function re(A){return A.length===0?"unknown":A.some(Dt)?"obsidian-zip":A.some(Et)?"loose-markdown":"unknown"}function Dt(A){return A.name.toLowerCase().endsWith(".zip")}function Et(A){const T=A.name.toLowerCase();return T.endsWith(".md")||T.endsWith(".markdown")}function ne(A){const T=A.charCodeAt(0)===65279?A.slice(1):A,o=T.split(/\r?\n/);if(o[0]!=="---")return{data:{},content:T};let w=-1;for(let r=1;r<o.length;r++)if(o[r]==="---"){w=r;break}if(w===-1)return{data:{},content:T};const h=o.slice(1,w).join(`
2
- `),s=o.slice(w+1).join(`
3
- `);return{data:ie(h),content:s}}function ie(A){const T=A.split(/\r?\n/),o={};let w=0;for(;w<T.length;){const h=T[w]??"";if(h.trim()===""||h.trimStart().startsWith("#")){w++;continue}const s=h.match(/^([\w][\w.-]*)\s*:\s*(.*)$/);if(!s){w++;continue}const r=s[1],n=(s[2]??"").trim();if(n===""){const u=ae(T,w+1);if(u!=null&&u.line.trimStart().startsWith("- ")){const{items:b,consumed:v}=se(T,w+1,u.indent);o[r]=b,w=w+1+v}else o[r]="",w++}else o[r]=It(n),w++}return o}function se(A,T,o){const w=[];let h=T;for(;h<A.length;){const s=A[h]??"";if(s.trim()===""){h++;continue}const r=Pt(s);if(r<o||!s.slice(r).startsWith("- "))break;const n=s.slice(r+2).trim();w.push(It(n)),h++}return{items:w,consumed:h-T}}function ae(A,T){for(let o=T;o<A.length;o++){const w=A[o]??"";if(w.trim()!=="")return{line:w,indent:Pt(w)}}return null}function Pt(A){let T=0;for(;T<A.length&&A[T]===" ";)T++;return T}function It(A){if(A.length===0)return"";if(A.startsWith("[")&&A.endsWith("]")){const T=A.slice(1,-1).trim();return T===""?[]:oe(T).map(o=>It(o.trim()))}if(A.startsWith('"')&&A.endsWith('"')&&A.length>=2)return A.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\");if(A.startsWith("'")&&A.endsWith("'")&&A.length>=2)return A.slice(1,-1).replace(/''/g,"'");if(A==="true")return!0;if(A==="false")return!1;if(A==="null"||A==="~")return null;if(/^-?\d+(\.\d+)?$/.test(A)){const T=Number(A);return Number.isFinite(T)?T:A}return A}function oe(A){const T=[];let o=0,w=null,h=0;for(let s=0;s<A.length;s++){const r=A[s];if(w){r===w&&(w=null);continue}if(r==='"'||r==="'"){w=r;continue}r==="["?o++:r==="]"?o--:r===","&&o===0&&(T.push(A.slice(h,s)),h=s+1)}return T.push(A.slice(h)),T}function Ft(A){const{sourcePath:T,raw:o}=A,{data:w,content:h}=ne(o),s=le(w,T),r=Ut(w,"id"),n=xt(w,"created_at")??xt(w,"createdAt"),u=xt(w,"updated_at")??xt(w,"updatedAt"),b=he(w,h),v=new Set(["id","path","tags","created_at","createdAt","updated_at","updatedAt"]),_={};for(const[a,p]of Object.entries(w))v.has(a)||(_[a]=p);const g={sourcePath:T,path:s,content:h,tags:b,metadata:_};return r&&(g.id=r),n&&(g.createdAt=n),u&&(g.updatedAt=u),g}function le(A,T){const o=Ut(A,"path");return Bt(jt(o||T))}function Ut(A,T){const o=A[T];if(typeof o=="string"&&o.trim()!=="")return o.trim()}function xt(A,T){const o=A[T];if(typeof o=="string"&&o.trim()!=="")return o.trim();if(typeof o=="number")return String(o)}function jt(A){return A.replace(/\.(md|markdown)$/i,"")}function Bt(A){return A.replace(/\\/g,"/").replace(/\/+/g,"/").replace(/^\/+|\/+$/g,"")}const ue=/(?:^|\s)#([A-Za-z0-9_/-]*[A-Za-z_/-][A-Za-z0-9_/-]*)/g;function ce(A){return A.replace(/```[\s\S]*?```/g,"").replace(/`[^`\n]+`/g,"")}function he(A,T){const o=new Set,w=A.tags;if(Array.isArray(w))for(const s of w){const r=Ct(s);r&&o.add(r)}else if(typeof w=="string")for(const s of w.split(/[,\s]+/)){const r=Ct(s);r&&o.add(r)}const h=ce(T);for(const s of h.matchAll(ue)){const r=Ct(s[1]??"");r&&o.add(r)}return[...o]}function Ct(A){if(typeof A!="string")return typeof A=="number"||typeof A=="boolean"?String(A).toLowerCase():null;const T=A.trim().replace(/^#/,"").toLowerCase();return!T||!/^[a-z0-9_/-]+$/.test(T)?null:T}function de(A){return typeof A.text=="function"?A.text():new Promise((T,o)=>{const w=new FileReader;w.onload=()=>T(w.result),w.onerror=()=>o(w.error??new Error("FileReader failed")),w.readAsText(A)})}async function fe(A){const T=[],o=[];for(const w of A){if(!Et(w)){o.push({sourcePath:w.name,reason:"Not a markdown file (.md / .markdown) — skipped."});continue}try{const h=await de(w),s=w.webkitRelativePath||w.name,r=Ft({sourcePath:s,raw:h});T.push(r)}catch(h){o.push({sourcePath:w.name,reason:h instanceof Error?h.message:String(h)})}}return{format:"loose-markdown",notes:T,errors:o,tags:pe(T)}}function pe(A){const T=new Set;for(const o of A)for(const w of o.tags)T.add(w);return[...T].sort()}function St(A){throw new Error('Could not dynamically require "'+A+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var At={exports:{}};/*!
4
-
5
- JSZip v3.10.1 - A JavaScript class for generating and reading zip files
6
- <http://stuartk.com/jszip>
7
-
8
- (c) 2009-2016 Stuart Knightley <stuart [at] stuartk.com>
9
- Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown.
10
-
11
- JSZip uses the library pako released under the MIT license :
12
- https://github.com/nodeca/pako/blob/main/LICENSE
13
- */var Rt;function me(){return Rt||(Rt=1,(function(A,T){(function(o){A.exports=o()})(function(){return(function o(w,h,s){function r(b,v){if(!h[b]){if(!w[b]){var _=typeof St=="function"&&St;if(!v&&_)return _(b,!0);if(n)return n(b,!0);var g=new Error("Cannot find module '"+b+"'");throw g.code="MODULE_NOT_FOUND",g}var a=h[b]={exports:{}};w[b][0].call(a.exports,function(p){var i=w[b][1][p];return r(i||p)},a,a.exports,o,w,h,s)}return h[b].exports}for(var n=typeof St=="function"&&St,u=0;u<s.length;u++)r(s[u]);return r})({1:[function(o,w,h){var s=o("./utils"),r=o("./support"),n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";h.encode=function(u){for(var b,v,_,g,a,p,i,d=[],l=0,m=u.length,k=m,z=s.getTypeOf(u)!=="string";l<u.length;)k=m-l,_=z?(b=u[l++],v=l<m?u[l++]:0,l<m?u[l++]:0):(b=u.charCodeAt(l++),v=l<m?u.charCodeAt(l++):0,l<m?u.charCodeAt(l++):0),g=b>>2,a=(3&b)<<4|v>>4,p=1<k?(15&v)<<2|_>>6:64,i=2<k?63&_:64,d.push(n.charAt(g)+n.charAt(a)+n.charAt(p)+n.charAt(i));return d.join("")},h.decode=function(u){var b,v,_,g,a,p,i=0,d=0,l="data:";if(u.substr(0,l.length)===l)throw new Error("Invalid base64 input, it looks like a data url.");var m,k=3*(u=u.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(u.charAt(u.length-1)===n.charAt(64)&&k--,u.charAt(u.length-2)===n.charAt(64)&&k--,k%1!=0)throw new Error("Invalid base64 input, bad content length.");for(m=r.uint8array?new Uint8Array(0|k):new Array(0|k);i<u.length;)b=n.indexOf(u.charAt(i++))<<2|(g=n.indexOf(u.charAt(i++)))>>4,v=(15&g)<<4|(a=n.indexOf(u.charAt(i++)))>>2,_=(3&a)<<6|(p=n.indexOf(u.charAt(i++))),m[d++]=b,a!==64&&(m[d++]=v),p!==64&&(m[d++]=_);return m}},{"./support":30,"./utils":32}],2:[function(o,w,h){var s=o("./external"),r=o("./stream/DataWorker"),n=o("./stream/Crc32Probe"),u=o("./stream/DataLengthProbe");function b(v,_,g,a,p){this.compressedSize=v,this.uncompressedSize=_,this.crc32=g,this.compression=a,this.compressedContent=p}b.prototype={getContentWorker:function(){var v=new r(s.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new u("data_length")),_=this;return v.on("end",function(){if(this.streamInfo.data_length!==_.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),v},getCompressedWorker:function(){return new r(s.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},b.createWorkerFrom=function(v,_,g){return v.pipe(new n).pipe(new u("uncompressedSize")).pipe(_.compressWorker(g)).pipe(new u("compressedSize")).withStreamInfo("compression",_)},w.exports=b},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(o,w,h){var s=o("./stream/GenericWorker");h.STORE={magic:"\0\0",compressWorker:function(){return new s("STORE compression")},uncompressWorker:function(){return new s("STORE decompression")}},h.DEFLATE=o("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(o,w,h){var s=o("./utils"),r=(function(){for(var n,u=[],b=0;b<256;b++){n=b;for(var v=0;v<8;v++)n=1&n?3988292384^n>>>1:n>>>1;u[b]=n}return u})();w.exports=function(n,u){return n!==void 0&&n.length?s.getTypeOf(n)!=="string"?(function(b,v,_,g){var a=r,p=g+_;b^=-1;for(var i=g;i<p;i++)b=b>>>8^a[255&(b^v[i])];return-1^b})(0|u,n,n.length,0):(function(b,v,_,g){var a=r,p=g+_;b^=-1;for(var i=g;i<p;i++)b=b>>>8^a[255&(b^v.charCodeAt(i))];return-1^b})(0|u,n,n.length,0):0}},{"./utils":32}],5:[function(o,w,h){h.base64=!1,h.binary=!1,h.dir=!1,h.createFolders=!0,h.date=null,h.compression=null,h.compressionOptions=null,h.comment=null,h.unixPermissions=null,h.dosPermissions=null},{}],6:[function(o,w,h){var s=null;s=typeof Promise<"u"?Promise:o("lie"),w.exports={Promise:s}},{lie:37}],7:[function(o,w,h){var s=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",r=o("pako"),n=o("./utils"),u=o("./stream/GenericWorker"),b=s?"uint8array":"array";function v(_,g){u.call(this,"FlateWorker/"+_),this._pako=null,this._pakoAction=_,this._pakoOptions=g,this.meta={}}h.magic="\b\0",n.inherits(v,u),v.prototype.processChunk=function(_){this.meta=_.meta,this._pako===null&&this._createPako(),this._pako.push(n.transformTo(b,_.data),!1)},v.prototype.flush=function(){u.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},v.prototype.cleanUp=function(){u.prototype.cleanUp.call(this),this._pako=null},v.prototype._createPako=function(){this._pako=new r[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var _=this;this._pako.onData=function(g){_.push({data:g,meta:_.meta})}},h.compressWorker=function(_){return new v("Deflate",_)},h.uncompressWorker=function(){return new v("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(o,w,h){function s(a,p){var i,d="";for(i=0;i<p;i++)d+=String.fromCharCode(255&a),a>>>=8;return d}function r(a,p,i,d,l,m){var k,z,S=a.file,P=a.compression,j=m!==b.utf8encode,W=n.transformTo("string",m(S.name)),O=n.transformTo("string",b.utf8encode(S.name)),G=S.comment,J=n.transformTo("string",m(G)),y=n.transformTo("string",b.utf8encode(G)),B=O.length!==S.name.length,e=y.length!==G.length,D="",tt="",L="",et=S.dir,Z=S.date,Q={crc32:0,compressedSize:0,uncompressedSize:0};p&&!i||(Q.crc32=a.crc32,Q.compressedSize=a.compressedSize,Q.uncompressedSize=a.uncompressedSize);var I=0;p&&(I|=8),j||!B&&!e||(I|=2048);var E=0,q=0;et&&(E|=16),l==="UNIX"?(q=798,E|=(function(K,at){var ct=K;return K||(ct=at?16893:33204),(65535&ct)<<16})(S.unixPermissions,et)):(q=20,E|=(function(K){return 63&(K||0)})(S.dosPermissions)),k=Z.getUTCHours(),k<<=6,k|=Z.getUTCMinutes(),k<<=5,k|=Z.getUTCSeconds()/2,z=Z.getUTCFullYear()-1980,z<<=4,z|=Z.getUTCMonth()+1,z<<=5,z|=Z.getUTCDate(),B&&(tt=s(1,1)+s(v(W),4)+O,D+="up"+s(tt.length,2)+tt),e&&(L=s(1,1)+s(v(J),4)+y,D+="uc"+s(L.length,2)+L);var Y="";return Y+=`
14
- \0`,Y+=s(I,2),Y+=P.magic,Y+=s(k,2),Y+=s(z,2),Y+=s(Q.crc32,4),Y+=s(Q.compressedSize,4),Y+=s(Q.uncompressedSize,4),Y+=s(W.length,2),Y+=s(D.length,2),{fileRecord:_.LOCAL_FILE_HEADER+Y+W+D,dirRecord:_.CENTRAL_FILE_HEADER+s(q,2)+Y+s(J.length,2)+"\0\0\0\0"+s(E,4)+s(d,4)+W+D+J}}var n=o("../utils"),u=o("../stream/GenericWorker"),b=o("../utf8"),v=o("../crc32"),_=o("../signature");function g(a,p,i,d){u.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=p,this.zipPlatform=i,this.encodeFileName=d,this.streamFiles=a,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}n.inherits(g,u),g.prototype.push=function(a){var p=a.meta.percent||0,i=this.entriesCount,d=this._sources.length;this.accumulate?this.contentBuffer.push(a):(this.bytesWritten+=a.data.length,u.prototype.push.call(this,{data:a.data,meta:{currentFile:this.currentFile,percent:i?(p+100*(i-d-1))/i:100}}))},g.prototype.openedSource=function(a){this.currentSourceOffset=this.bytesWritten,this.currentFile=a.file.name;var p=this.streamFiles&&!a.file.dir;if(p){var i=r(a,p,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:i.fileRecord,meta:{percent:0}})}else this.accumulate=!0},g.prototype.closedSource=function(a){this.accumulate=!1;var p=this.streamFiles&&!a.file.dir,i=r(a,p,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(i.dirRecord),p)this.push({data:(function(d){return _.DATA_DESCRIPTOR+s(d.crc32,4)+s(d.compressedSize,4)+s(d.uncompressedSize,4)})(a),meta:{percent:100}});else for(this.push({data:i.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},g.prototype.flush=function(){for(var a=this.bytesWritten,p=0;p<this.dirRecords.length;p++)this.push({data:this.dirRecords[p],meta:{percent:100}});var i=this.bytesWritten-a,d=(function(l,m,k,z,S){var P=n.transformTo("string",S(z));return _.CENTRAL_DIRECTORY_END+"\0\0\0\0"+s(l,2)+s(l,2)+s(m,4)+s(k,4)+s(P.length,2)+P})(this.dirRecords.length,i,a,this.zipComment,this.encodeFileName);this.push({data:d,meta:{percent:100}})},g.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},g.prototype.registerPrevious=function(a){this._sources.push(a);var p=this;return a.on("data",function(i){p.processChunk(i)}),a.on("end",function(){p.closedSource(p.previous.streamInfo),p._sources.length?p.prepareNextSource():p.end()}),a.on("error",function(i){p.error(i)}),this},g.prototype.resume=function(){return!!u.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},g.prototype.error=function(a){var p=this._sources;if(!u.prototype.error.call(this,a))return!1;for(var i=0;i<p.length;i++)try{p[i].error(a)}catch{}return!0},g.prototype.lock=function(){u.prototype.lock.call(this);for(var a=this._sources,p=0;p<a.length;p++)a[p].lock()},w.exports=g},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(o,w,h){var s=o("../compressions"),r=o("./ZipFileWorker");h.generateWorker=function(n,u,b){var v=new r(u.streamFiles,b,u.platform,u.encodeFileName),_=0;try{n.forEach(function(g,a){_++;var p=(function(m,k){var z=m||k,S=s[z];if(!S)throw new Error(z+" is not a valid compression method !");return S})(a.options.compression,u.compression),i=a.options.compressionOptions||u.compressionOptions||{},d=a.dir,l=a.date;a._compressWorker(p,i).withStreamInfo("file",{name:g,dir:d,date:l,comment:a.comment||"",unixPermissions:a.unixPermissions,dosPermissions:a.dosPermissions}).pipe(v)}),v.entriesCount=_}catch(g){v.error(g)}return v}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(o,w,h){function s(){if(!(this instanceof s))return new s;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 r=new s;for(var n in this)typeof this[n]!="function"&&(r[n]=this[n]);return r}}(s.prototype=o("./object")).loadAsync=o("./load"),s.support=o("./support"),s.defaults=o("./defaults"),s.version="3.10.1",s.loadAsync=function(r,n){return new s().loadAsync(r,n)},s.external=o("./external"),w.exports=s},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(o,w,h){var s=o("./utils"),r=o("./external"),n=o("./utf8"),u=o("./zipEntries"),b=o("./stream/Crc32Probe"),v=o("./nodejsUtils");function _(g){return new r.Promise(function(a,p){var i=g.decompressed.getContentWorker().pipe(new b);i.on("error",function(d){p(d)}).on("end",function(){i.streamInfo.crc32!==g.decompressed.crc32?p(new Error("Corrupted zip : CRC32 mismatch")):a()}).resume()})}w.exports=function(g,a){var p=this;return a=s.extend(a||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:n.utf8decode}),v.isNode&&v.isStream(g)?r.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):s.prepareContent("the loaded zip file",g,!0,a.optimizedBinaryString,a.base64).then(function(i){var d=new u(a);return d.load(i),d}).then(function(i){var d=[r.Promise.resolve(i)],l=i.files;if(a.checkCRC32)for(var m=0;m<l.length;m++)d.push(_(l[m]));return r.Promise.all(d)}).then(function(i){for(var d=i.shift(),l=d.files,m=0;m<l.length;m++){var k=l[m],z=k.fileNameStr,S=s.resolve(k.fileNameStr);p.file(S,k.decompressed,{binary:!0,optimizedBinaryString:!0,date:k.date,dir:k.dir,comment:k.fileCommentStr.length?k.fileCommentStr:null,unixPermissions:k.unixPermissions,dosPermissions:k.dosPermissions,createFolders:a.createFolders}),k.dir||(p.file(S).unsafeOriginalName=z)}return d.zipComment.length&&(p.comment=d.zipComment),p})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(o,w,h){var s=o("../utils"),r=o("../stream/GenericWorker");function n(u,b){r.call(this,"Nodejs stream input adapter for "+u),this._upstreamEnded=!1,this._bindStream(b)}s.inherits(n,r),n.prototype._bindStream=function(u){var b=this;(this._stream=u).pause(),u.on("data",function(v){b.push({data:v,meta:{percent:0}})}).on("error",function(v){b.isPaused?this.generatedError=v:b.error(v)}).on("end",function(){b.isPaused?b._upstreamEnded=!0:b.end()})},n.prototype.pause=function(){return!!r.prototype.pause.call(this)&&(this._stream.pause(),!0)},n.prototype.resume=function(){return!!r.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},w.exports=n},{"../stream/GenericWorker":28,"../utils":32}],13:[function(o,w,h){var s=o("readable-stream").Readable;function r(n,u,b){s.call(this,u),this._helper=n;var v=this;n.on("data",function(_,g){v.push(_)||v._helper.pause(),b&&b(g)}).on("error",function(_){v.emit("error",_)}).on("end",function(){v.push(null)})}o("../utils").inherits(r,s),r.prototype._read=function(){this._helper.resume()},w.exports=r},{"../utils":32,"readable-stream":16}],14:[function(o,w,h){w.exports={isNode:typeof Buffer<"u",newBufferFrom:function(s,r){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(s,r);if(typeof s=="number")throw new Error('The "data" argument must not be a number');return new Buffer(s,r)},allocBuffer:function(s){if(Buffer.alloc)return Buffer.alloc(s);var r=new Buffer(s);return r.fill(0),r},isBuffer:function(s){return Buffer.isBuffer(s)},isStream:function(s){return s&&typeof s.on=="function"&&typeof s.pause=="function"&&typeof s.resume=="function"}}},{}],15:[function(o,w,h){function s(S,P,j){var W,O=n.getTypeOf(P),G=n.extend(j||{},v);G.date=G.date||new Date,G.compression!==null&&(G.compression=G.compression.toUpperCase()),typeof G.unixPermissions=="string"&&(G.unixPermissions=parseInt(G.unixPermissions,8)),G.unixPermissions&&16384&G.unixPermissions&&(G.dir=!0),G.dosPermissions&&16&G.dosPermissions&&(G.dir=!0),G.dir&&(S=l(S)),G.createFolders&&(W=d(S))&&m.call(this,W,!0);var J=O==="string"&&G.binary===!1&&G.base64===!1;j&&j.binary!==void 0||(G.binary=!J),(P instanceof _&&P.uncompressedSize===0||G.dir||!P||P.length===0)&&(G.base64=!1,G.binary=!0,P="",G.compression="STORE",O="string");var y=null;y=P instanceof _||P instanceof u?P:p.isNode&&p.isStream(P)?new i(S,P):n.prepareContent(S,P,G.binary,G.optimizedBinaryString,G.base64);var B=new g(S,y,G);this.files[S]=B}var r=o("./utf8"),n=o("./utils"),u=o("./stream/GenericWorker"),b=o("./stream/StreamHelper"),v=o("./defaults"),_=o("./compressedObject"),g=o("./zipObject"),a=o("./generate"),p=o("./nodejsUtils"),i=o("./nodejs/NodejsStreamInputAdapter"),d=function(S){S.slice(-1)==="/"&&(S=S.substring(0,S.length-1));var P=S.lastIndexOf("/");return 0<P?S.substring(0,P):""},l=function(S){return S.slice(-1)!=="/"&&(S+="/"),S},m=function(S,P){return P=P!==void 0?P:v.createFolders,S=l(S),this.files[S]||s.call(this,S,null,{dir:!0,createFolders:P}),this.files[S]};function k(S){return Object.prototype.toString.call(S)==="[object RegExp]"}var z={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(S){var P,j,W;for(P in this.files)W=this.files[P],(j=P.slice(this.root.length,P.length))&&P.slice(0,this.root.length)===this.root&&S(j,W)},filter:function(S){var P=[];return this.forEach(function(j,W){S(j,W)&&P.push(W)}),P},file:function(S,P,j){if(arguments.length!==1)return S=this.root+S,s.call(this,S,P,j),this;if(k(S)){var W=S;return this.filter(function(G,J){return!J.dir&&W.test(G)})}var O=this.files[this.root+S];return O&&!O.dir?O:null},folder:function(S){if(!S)return this;if(k(S))return this.filter(function(O,G){return G.dir&&S.test(O)});var P=this.root+S,j=m.call(this,P),W=this.clone();return W.root=j.name,W},remove:function(S){S=this.root+S;var P=this.files[S];if(P||(S.slice(-1)!=="/"&&(S+="/"),P=this.files[S]),P&&!P.dir)delete this.files[S];else for(var j=this.filter(function(O,G){return G.name.slice(0,S.length)===S}),W=0;W<j.length;W++)delete this.files[j[W].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(S){var P,j={};try{if((j=n.extend(S||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:r.utf8encode})).type=j.type.toLowerCase(),j.compression=j.compression.toUpperCase(),j.type==="binarystring"&&(j.type="string"),!j.type)throw new Error("No output type specified.");n.checkSupport(j.type),j.platform!=="darwin"&&j.platform!=="freebsd"&&j.platform!=="linux"&&j.platform!=="sunos"||(j.platform="UNIX"),j.platform==="win32"&&(j.platform="DOS");var W=j.comment||this.comment||"";P=a.generateWorker(this,j,W)}catch(O){(P=new u("error")).error(O)}return new b(P,j.type||"string",j.mimeType)},generateAsync:function(S,P){return this.generateInternalStream(S).accumulate(P)},generateNodeStream:function(S,P){return(S=S||{}).type||(S.type="nodebuffer"),this.generateInternalStream(S).toNodejsStream(P)}};w.exports=z},{"./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(o,w,h){w.exports=o("stream")},{stream:void 0}],17:[function(o,w,h){var s=o("./DataReader");function r(n){s.call(this,n);for(var u=0;u<this.data.length;u++)n[u]=255&n[u]}o("../utils").inherits(r,s),r.prototype.byteAt=function(n){return this.data[this.zero+n]},r.prototype.lastIndexOfSignature=function(n){for(var u=n.charCodeAt(0),b=n.charCodeAt(1),v=n.charCodeAt(2),_=n.charCodeAt(3),g=this.length-4;0<=g;--g)if(this.data[g]===u&&this.data[g+1]===b&&this.data[g+2]===v&&this.data[g+3]===_)return g-this.zero;return-1},r.prototype.readAndCheckSignature=function(n){var u=n.charCodeAt(0),b=n.charCodeAt(1),v=n.charCodeAt(2),_=n.charCodeAt(3),g=this.readData(4);return u===g[0]&&b===g[1]&&v===g[2]&&_===g[3]},r.prototype.readData=function(n){if(this.checkOffset(n),n===0)return[];var u=this.data.slice(this.zero+this.index,this.zero+this.index+n);return this.index+=n,u},w.exports=r},{"../utils":32,"./DataReader":18}],18:[function(o,w,h){var s=o("../utils");function r(n){this.data=n,this.length=n.length,this.index=0,this.zero=0}r.prototype={checkOffset:function(n){this.checkIndex(this.index+n)},checkIndex:function(n){if(this.length<this.zero+n||n<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+n+"). Corrupted zip ?")},setIndex:function(n){this.checkIndex(n),this.index=n},skip:function(n){this.setIndex(this.index+n)},byteAt:function(){},readInt:function(n){var u,b=0;for(this.checkOffset(n),u=this.index+n-1;u>=this.index;u--)b=(b<<8)+this.byteAt(u);return this.index+=n,b},readString:function(n){return s.transformTo("string",this.readData(n))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var n=this.readInt(4);return new Date(Date.UTC(1980+(n>>25&127),(n>>21&15)-1,n>>16&31,n>>11&31,n>>5&63,(31&n)<<1))}},w.exports=r},{"../utils":32}],19:[function(o,w,h){var s=o("./Uint8ArrayReader");function r(n){s.call(this,n)}o("../utils").inherits(r,s),r.prototype.readData=function(n){this.checkOffset(n);var u=this.data.slice(this.zero+this.index,this.zero+this.index+n);return this.index+=n,u},w.exports=r},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(o,w,h){var s=o("./DataReader");function r(n){s.call(this,n)}o("../utils").inherits(r,s),r.prototype.byteAt=function(n){return this.data.charCodeAt(this.zero+n)},r.prototype.lastIndexOfSignature=function(n){return this.data.lastIndexOf(n)-this.zero},r.prototype.readAndCheckSignature=function(n){return n===this.readData(4)},r.prototype.readData=function(n){this.checkOffset(n);var u=this.data.slice(this.zero+this.index,this.zero+this.index+n);return this.index+=n,u},w.exports=r},{"../utils":32,"./DataReader":18}],21:[function(o,w,h){var s=o("./ArrayReader");function r(n){s.call(this,n)}o("../utils").inherits(r,s),r.prototype.readData=function(n){if(this.checkOffset(n),n===0)return new Uint8Array(0);var u=this.data.subarray(this.zero+this.index,this.zero+this.index+n);return this.index+=n,u},w.exports=r},{"../utils":32,"./ArrayReader":17}],22:[function(o,w,h){var s=o("../utils"),r=o("../support"),n=o("./ArrayReader"),u=o("./StringReader"),b=o("./NodeBufferReader"),v=o("./Uint8ArrayReader");w.exports=function(_){var g=s.getTypeOf(_);return s.checkSupport(g),g!=="string"||r.uint8array?g==="nodebuffer"?new b(_):r.uint8array?new v(s.transformTo("uint8array",_)):new n(s.transformTo("array",_)):new u(_)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(o,w,h){h.LOCAL_FILE_HEADER="PK",h.CENTRAL_FILE_HEADER="PK",h.CENTRAL_DIRECTORY_END="PK",h.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",h.ZIP64_CENTRAL_DIRECTORY_END="PK",h.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(o,w,h){var s=o("./GenericWorker"),r=o("../utils");function n(u){s.call(this,"ConvertWorker to "+u),this.destType=u}r.inherits(n,s),n.prototype.processChunk=function(u){this.push({data:r.transformTo(this.destType,u.data),meta:u.meta})},w.exports=n},{"../utils":32,"./GenericWorker":28}],25:[function(o,w,h){var s=o("./GenericWorker"),r=o("../crc32");function n(){s.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}o("../utils").inherits(n,s),n.prototype.processChunk=function(u){this.streamInfo.crc32=r(u.data,this.streamInfo.crc32||0),this.push(u)},w.exports=n},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(o,w,h){var s=o("../utils"),r=o("./GenericWorker");function n(u){r.call(this,"DataLengthProbe for "+u),this.propName=u,this.withStreamInfo(u,0)}s.inherits(n,r),n.prototype.processChunk=function(u){if(u){var b=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=b+u.data.length}r.prototype.processChunk.call(this,u)},w.exports=n},{"../utils":32,"./GenericWorker":28}],27:[function(o,w,h){var s=o("../utils"),r=o("./GenericWorker");function n(u){r.call(this,"DataWorker");var b=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,u.then(function(v){b.dataIsReady=!0,b.data=v,b.max=v&&v.length||0,b.type=s.getTypeOf(v),b.isPaused||b._tickAndRepeat()},function(v){b.error(v)})}s.inherits(n,r),n.prototype.cleanUp=function(){r.prototype.cleanUp.call(this),this.data=null},n.prototype.resume=function(){return!!r.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,s.delay(this._tickAndRepeat,[],this)),!0)},n.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(s.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},n.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var u=null,b=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":u=this.data.substring(this.index,b);break;case"uint8array":u=this.data.subarray(this.index,b);break;case"array":case"nodebuffer":u=this.data.slice(this.index,b)}return this.index=b,this.push({data:u,meta:{percent:this.max?this.index/this.max*100:0}})},w.exports=n},{"../utils":32,"./GenericWorker":28}],28:[function(o,w,h){function s(r){this.name=r||"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}s.prototype={push:function(r){this.emit("data",r)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(r){this.emit("error",r)}return!0},error:function(r){return!this.isFinished&&(this.isPaused?this.generatedError=r:(this.isFinished=!0,this.emit("error",r),this.previous&&this.previous.error(r),this.cleanUp()),!0)},on:function(r,n){return this._listeners[r].push(n),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(r,n){if(this._listeners[r])for(var u=0;u<this._listeners[r].length;u++)this._listeners[r][u].call(this,n)},pipe:function(r){return r.registerPrevious(this)},registerPrevious:function(r){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=r.streamInfo,this.mergeStreamInfo(),this.previous=r;var n=this;return r.on("data",function(u){n.processChunk(u)}),r.on("end",function(){n.end()}),r.on("error",function(u){n.error(u)}),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 r=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),r=!0),this.previous&&this.previous.resume(),!r},flush:function(){},processChunk:function(r){this.push(r)},withStreamInfo:function(r,n){return this.extraStreamInfo[r]=n,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var r in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,r)&&(this.streamInfo[r]=this.extraStreamInfo[r])},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 r="Worker "+this.name;return this.previous?this.previous+" -> "+r:r}},w.exports=s},{}],29:[function(o,w,h){var s=o("../utils"),r=o("./ConvertWorker"),n=o("./GenericWorker"),u=o("../base64"),b=o("../support"),v=o("../external"),_=null;if(b.nodestream)try{_=o("../nodejs/NodejsStreamOutputAdapter")}catch{}function g(p,i){return new v.Promise(function(d,l){var m=[],k=p._internalType,z=p._outputType,S=p._mimeType;p.on("data",function(P,j){m.push(P),i&&i(j)}).on("error",function(P){m=[],l(P)}).on("end",function(){try{var P=(function(j,W,O){switch(j){case"blob":return s.newBlob(s.transformTo("arraybuffer",W),O);case"base64":return u.encode(W);default:return s.transformTo(j,W)}})(z,(function(j,W){var O,G=0,J=null,y=0;for(O=0;O<W.length;O++)y+=W[O].length;switch(j){case"string":return W.join("");case"array":return Array.prototype.concat.apply([],W);case"uint8array":for(J=new Uint8Array(y),O=0;O<W.length;O++)J.set(W[O],G),G+=W[O].length;return J;case"nodebuffer":return Buffer.concat(W);default:throw new Error("concat : unsupported type '"+j+"'")}})(k,m),S);d(P)}catch(j){l(j)}m=[]}).resume()})}function a(p,i,d){var l=i;switch(i){case"blob":case"arraybuffer":l="uint8array";break;case"base64":l="string"}try{this._internalType=l,this._outputType=i,this._mimeType=d,s.checkSupport(l),this._worker=p.pipe(new r(l)),p.lock()}catch(m){this._worker=new n("error"),this._worker.error(m)}}a.prototype={accumulate:function(p){return g(this,p)},on:function(p,i){var d=this;return p==="data"?this._worker.on(p,function(l){i.call(d,l.data,l.meta)}):this._worker.on(p,function(){s.delay(i,arguments,d)}),this},resume:function(){return s.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(p){if(s.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new _(this,{objectMode:this._outputType!=="nodebuffer"},p)}},w.exports=a},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(o,w,h){if(h.base64=!0,h.array=!0,h.string=!0,h.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",h.nodebuffer=typeof Buffer<"u",h.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")h.blob=!1;else{var s=new ArrayBuffer(0);try{h.blob=new Blob([s],{type:"application/zip"}).size===0}catch{try{var r=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);r.append(s),h.blob=r.getBlob("application/zip").size===0}catch{h.blob=!1}}}try{h.nodestream=!!o("readable-stream").Readable}catch{h.nodestream=!1}},{"readable-stream":16}],31:[function(o,w,h){for(var s=o("./utils"),r=o("./support"),n=o("./nodejsUtils"),u=o("./stream/GenericWorker"),b=new Array(256),v=0;v<256;v++)b[v]=252<=v?6:248<=v?5:240<=v?4:224<=v?3:192<=v?2:1;b[254]=b[254]=1;function _(){u.call(this,"utf-8 decode"),this.leftOver=null}function g(){u.call(this,"utf-8 encode")}h.utf8encode=function(a){return r.nodebuffer?n.newBufferFrom(a,"utf-8"):(function(p){var i,d,l,m,k,z=p.length,S=0;for(m=0;m<z;m++)(64512&(d=p.charCodeAt(m)))==55296&&m+1<z&&(64512&(l=p.charCodeAt(m+1)))==56320&&(d=65536+(d-55296<<10)+(l-56320),m++),S+=d<128?1:d<2048?2:d<65536?3:4;for(i=r.uint8array?new Uint8Array(S):new Array(S),m=k=0;k<S;m++)(64512&(d=p.charCodeAt(m)))==55296&&m+1<z&&(64512&(l=p.charCodeAt(m+1)))==56320&&(d=65536+(d-55296<<10)+(l-56320),m++),d<128?i[k++]=d:(d<2048?i[k++]=192|d>>>6:(d<65536?i[k++]=224|d>>>12:(i[k++]=240|d>>>18,i[k++]=128|d>>>12&63),i[k++]=128|d>>>6&63),i[k++]=128|63&d);return i})(a)},h.utf8decode=function(a){return r.nodebuffer?s.transformTo("nodebuffer",a).toString("utf-8"):(function(p){var i,d,l,m,k=p.length,z=new Array(2*k);for(i=d=0;i<k;)if((l=p[i++])<128)z[d++]=l;else if(4<(m=b[l]))z[d++]=65533,i+=m-1;else{for(l&=m===2?31:m===3?15:7;1<m&&i<k;)l=l<<6|63&p[i++],m--;1<m?z[d++]=65533:l<65536?z[d++]=l:(l-=65536,z[d++]=55296|l>>10&1023,z[d++]=56320|1023&l)}return z.length!==d&&(z.subarray?z=z.subarray(0,d):z.length=d),s.applyFromCharCode(z)})(a=s.transformTo(r.uint8array?"uint8array":"array",a))},s.inherits(_,u),_.prototype.processChunk=function(a){var p=s.transformTo(r.uint8array?"uint8array":"array",a.data);if(this.leftOver&&this.leftOver.length){if(r.uint8array){var i=p;(p=new Uint8Array(i.length+this.leftOver.length)).set(this.leftOver,0),p.set(i,this.leftOver.length)}else p=this.leftOver.concat(p);this.leftOver=null}var d=(function(m,k){var z;for((k=k||m.length)>m.length&&(k=m.length),z=k-1;0<=z&&(192&m[z])==128;)z--;return z<0||z===0?k:z+b[m[z]]>k?z:k})(p),l=p;d!==p.length&&(r.uint8array?(l=p.subarray(0,d),this.leftOver=p.subarray(d,p.length)):(l=p.slice(0,d),this.leftOver=p.slice(d,p.length))),this.push({data:h.utf8decode(l),meta:a.meta})},_.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:h.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},h.Utf8DecodeWorker=_,s.inherits(g,u),g.prototype.processChunk=function(a){this.push({data:h.utf8encode(a.data),meta:a.meta})},h.Utf8EncodeWorker=g},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(o,w,h){var s=o("./support"),r=o("./base64"),n=o("./nodejsUtils"),u=o("./external");function b(i){return i}function v(i,d){for(var l=0;l<i.length;++l)d[l]=255&i.charCodeAt(l);return d}o("setimmediate"),h.newBlob=function(i,d){h.checkSupport("blob");try{return new Blob([i],{type:d})}catch{try{var l=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return l.append(i),l.getBlob(d)}catch{throw new Error("Bug : can't construct the Blob.")}}};var _={stringifyByChunk:function(i,d,l){var m=[],k=0,z=i.length;if(z<=l)return String.fromCharCode.apply(null,i);for(;k<z;)d==="array"||d==="nodebuffer"?m.push(String.fromCharCode.apply(null,i.slice(k,Math.min(k+l,z)))):m.push(String.fromCharCode.apply(null,i.subarray(k,Math.min(k+l,z)))),k+=l;return m.join("")},stringifyByChar:function(i){for(var d="",l=0;l<i.length;l++)d+=String.fromCharCode(i[l]);return d},applyCanBeUsed:{uint8array:(function(){try{return s.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return s.nodebuffer&&String.fromCharCode.apply(null,n.allocBuffer(1)).length===1}catch{return!1}})()}};function g(i){var d=65536,l=h.getTypeOf(i),m=!0;if(l==="uint8array"?m=_.applyCanBeUsed.uint8array:l==="nodebuffer"&&(m=_.applyCanBeUsed.nodebuffer),m)for(;1<d;)try{return _.stringifyByChunk(i,l,d)}catch{d=Math.floor(d/2)}return _.stringifyByChar(i)}function a(i,d){for(var l=0;l<i.length;l++)d[l]=i[l];return d}h.applyFromCharCode=g;var p={};p.string={string:b,array:function(i){return v(i,new Array(i.length))},arraybuffer:function(i){return p.string.uint8array(i).buffer},uint8array:function(i){return v(i,new Uint8Array(i.length))},nodebuffer:function(i){return v(i,n.allocBuffer(i.length))}},p.array={string:g,array:b,arraybuffer:function(i){return new Uint8Array(i).buffer},uint8array:function(i){return new Uint8Array(i)},nodebuffer:function(i){return n.newBufferFrom(i)}},p.arraybuffer={string:function(i){return g(new Uint8Array(i))},array:function(i){return a(new Uint8Array(i),new Array(i.byteLength))},arraybuffer:b,uint8array:function(i){return new Uint8Array(i)},nodebuffer:function(i){return n.newBufferFrom(new Uint8Array(i))}},p.uint8array={string:g,array:function(i){return a(i,new Array(i.length))},arraybuffer:function(i){return i.buffer},uint8array:b,nodebuffer:function(i){return n.newBufferFrom(i)}},p.nodebuffer={string:g,array:function(i){return a(i,new Array(i.length))},arraybuffer:function(i){return p.nodebuffer.uint8array(i).buffer},uint8array:function(i){return a(i,new Uint8Array(i.length))},nodebuffer:b},h.transformTo=function(i,d){if(d=d||"",!i)return d;h.checkSupport(i);var l=h.getTypeOf(d);return p[l][i](d)},h.resolve=function(i){for(var d=i.split("/"),l=[],m=0;m<d.length;m++){var k=d[m];k==="."||k===""&&m!==0&&m!==d.length-1||(k===".."?l.pop():l.push(k))}return l.join("/")},h.getTypeOf=function(i){return typeof i=="string"?"string":Object.prototype.toString.call(i)==="[object Array]"?"array":s.nodebuffer&&n.isBuffer(i)?"nodebuffer":s.uint8array&&i instanceof Uint8Array?"uint8array":s.arraybuffer&&i instanceof ArrayBuffer?"arraybuffer":void 0},h.checkSupport=function(i){if(!s[i.toLowerCase()])throw new Error(i+" is not supported by this platform")},h.MAX_VALUE_16BITS=65535,h.MAX_VALUE_32BITS=-1,h.pretty=function(i){var d,l,m="";for(l=0;l<(i||"").length;l++)m+="\\x"+((d=i.charCodeAt(l))<16?"0":"")+d.toString(16).toUpperCase();return m},h.delay=function(i,d,l){setImmediate(function(){i.apply(l||null,d||[])})},h.inherits=function(i,d){function l(){}l.prototype=d.prototype,i.prototype=new l},h.extend=function(){var i,d,l={};for(i=0;i<arguments.length;i++)for(d in arguments[i])Object.prototype.hasOwnProperty.call(arguments[i],d)&&l[d]===void 0&&(l[d]=arguments[i][d]);return l},h.prepareContent=function(i,d,l,m,k){return u.Promise.resolve(d).then(function(z){return s.blob&&(z instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(z))!==-1)&&typeof FileReader<"u"?new u.Promise(function(S,P){var j=new FileReader;j.onload=function(W){S(W.target.result)},j.onerror=function(W){P(W.target.error)},j.readAsArrayBuffer(z)}):z}).then(function(z){var S=h.getTypeOf(z);return S?(S==="arraybuffer"?z=h.transformTo("uint8array",z):S==="string"&&(k?z=r.decode(z):l&&m!==!0&&(z=(function(P){return v(P,s.uint8array?new Uint8Array(P.length):new Array(P.length))})(z))),z):u.Promise.reject(new Error("Can't read the data of '"+i+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(o,w,h){var s=o("./reader/readerFor"),r=o("./utils"),n=o("./signature"),u=o("./zipEntry"),b=o("./support");function v(_){this.files=[],this.loadOptions=_}v.prototype={checkSignature:function(_){if(!this.reader.readAndCheckSignature(_)){this.reader.index-=4;var g=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+r.pretty(g)+", expected "+r.pretty(_)+")")}},isSignature:function(_,g){var a=this.reader.index;this.reader.setIndex(_);var p=this.reader.readString(4)===g;return this.reader.setIndex(a),p},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 _=this.reader.readData(this.zipCommentLength),g=b.uint8array?"uint8array":"array",a=r.transformTo(g,_);this.zipComment=this.loadOptions.decodeFileName(a)},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 _,g,a,p=this.zip64EndOfCentralSize-44;0<p;)_=this.reader.readInt(2),g=this.reader.readInt(4),a=this.reader.readData(g),this.zip64ExtensibleData[_]={id:_,length:g,value:a}},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 _,g;for(_=0;_<this.files.length;_++)g=this.files[_],this.reader.setIndex(g.localHeaderOffset),this.checkSignature(n.LOCAL_FILE_HEADER),g.readLocalPart(this.reader),g.handleUTF8(),g.processAttributes()},readCentralDir:function(){var _;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(n.CENTRAL_FILE_HEADER);)(_=new u({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(_);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 _=this.reader.lastIndexOfSignature(n.CENTRAL_DIRECTORY_END);if(_<0)throw this.isSignature(0,n.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(_);var g=_;if(this.checkSignature(n.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===r.MAX_VALUE_16BITS||this.diskWithCentralDirStart===r.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===r.MAX_VALUE_16BITS||this.centralDirRecords===r.MAX_VALUE_16BITS||this.centralDirSize===r.MAX_VALUE_32BITS||this.centralDirOffset===r.MAX_VALUE_32BITS){if(this.zip64=!0,(_=this.reader.lastIndexOfSignature(n.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(_),this.checkSignature(n.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,n.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(n.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(n.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var a=this.centralDirOffset+this.centralDirSize;this.zip64&&(a+=20,a+=12+this.zip64EndOfCentralSize);var p=g-a;if(0<p)this.isSignature(g,n.CENTRAL_FILE_HEADER)||(this.reader.zero=p);else if(p<0)throw new Error("Corrupted zip: missing "+Math.abs(p)+" bytes.")},prepareReader:function(_){this.reader=s(_)},load:function(_){this.prepareReader(_),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},w.exports=v},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(o,w,h){var s=o("./reader/readerFor"),r=o("./utils"),n=o("./compressedObject"),u=o("./crc32"),b=o("./utf8"),v=o("./compressions"),_=o("./support");function g(a,p){this.options=a,this.loadOptions=p}g.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(a){var p,i;if(a.skip(22),this.fileNameLength=a.readInt(2),i=a.readInt(2),this.fileName=a.readData(this.fileNameLength),a.skip(i),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((p=(function(d){for(var l in v)if(Object.prototype.hasOwnProperty.call(v,l)&&v[l].magic===d)return v[l];return null})(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+r.pretty(this.compressionMethod)+" unknown (inner file : "+r.transformTo("string",this.fileName)+")");this.decompressed=new n(this.compressedSize,this.uncompressedSize,this.crc32,p,a.readData(this.compressedSize))},readCentralPart:function(a){this.versionMadeBy=a.readInt(2),a.skip(2),this.bitFlag=a.readInt(2),this.compressionMethod=a.readString(2),this.date=a.readDate(),this.crc32=a.readInt(4),this.compressedSize=a.readInt(4),this.uncompressedSize=a.readInt(4);var p=a.readInt(2);if(this.extraFieldsLength=a.readInt(2),this.fileCommentLength=a.readInt(2),this.diskNumberStart=a.readInt(2),this.internalFileAttributes=a.readInt(2),this.externalFileAttributes=a.readInt(4),this.localHeaderOffset=a.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");a.skip(p),this.readExtraFields(a),this.parseZIP64ExtraField(a),this.fileComment=a.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var a=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),a==0&&(this.dosPermissions=63&this.externalFileAttributes),a==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var a=s(this.extraFields[1].value);this.uncompressedSize===r.MAX_VALUE_32BITS&&(this.uncompressedSize=a.readInt(8)),this.compressedSize===r.MAX_VALUE_32BITS&&(this.compressedSize=a.readInt(8)),this.localHeaderOffset===r.MAX_VALUE_32BITS&&(this.localHeaderOffset=a.readInt(8)),this.diskNumberStart===r.MAX_VALUE_32BITS&&(this.diskNumberStart=a.readInt(4))}},readExtraFields:function(a){var p,i,d,l=a.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});a.index+4<l;)p=a.readInt(2),i=a.readInt(2),d=a.readData(i),this.extraFields[p]={id:p,length:i,value:d};a.setIndex(l)},handleUTF8:function(){var a=_.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=b.utf8decode(this.fileName),this.fileCommentStr=b.utf8decode(this.fileComment);else{var p=this.findExtraFieldUnicodePath();if(p!==null)this.fileNameStr=p;else{var i=r.transformTo(a,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(i)}var d=this.findExtraFieldUnicodeComment();if(d!==null)this.fileCommentStr=d;else{var l=r.transformTo(a,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(l)}}},findExtraFieldUnicodePath:function(){var a=this.extraFields[28789];if(a){var p=s(a.value);return p.readInt(1)!==1||u(this.fileName)!==p.readInt(4)?null:b.utf8decode(p.readData(a.length-5))}return null},findExtraFieldUnicodeComment:function(){var a=this.extraFields[25461];if(a){var p=s(a.value);return p.readInt(1)!==1||u(this.fileComment)!==p.readInt(4)?null:b.utf8decode(p.readData(a.length-5))}return null}},w.exports=g},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(o,w,h){function s(p,i,d){this.name=p,this.dir=d.dir,this.date=d.date,this.comment=d.comment,this.unixPermissions=d.unixPermissions,this.dosPermissions=d.dosPermissions,this._data=i,this._dataBinary=d.binary,this.options={compression:d.compression,compressionOptions:d.compressionOptions}}var r=o("./stream/StreamHelper"),n=o("./stream/DataWorker"),u=o("./utf8"),b=o("./compressedObject"),v=o("./stream/GenericWorker");s.prototype={internalStream:function(p){var i=null,d="string";try{if(!p)throw new Error("No output type specified.");var l=(d=p.toLowerCase())==="string"||d==="text";d!=="binarystring"&&d!=="text"||(d="string"),i=this._decompressWorker();var m=!this._dataBinary;m&&!l&&(i=i.pipe(new u.Utf8EncodeWorker)),!m&&l&&(i=i.pipe(new u.Utf8DecodeWorker))}catch(k){(i=new v("error")).error(k)}return new r(i,d,"")},async:function(p,i){return this.internalStream(p).accumulate(i)},nodeStream:function(p,i){return this.internalStream(p||"nodebuffer").toNodejsStream(i)},_compressWorker:function(p,i){if(this._data instanceof b&&this._data.compression.magic===p.magic)return this._data.getCompressedWorker();var d=this._decompressWorker();return this._dataBinary||(d=d.pipe(new u.Utf8EncodeWorker)),b.createWorkerFrom(d,p,i)},_decompressWorker:function(){return this._data instanceof b?this._data.getContentWorker():this._data instanceof v?this._data:new n(this._data)}};for(var _=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],g=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},a=0;a<_.length;a++)s.prototype[_[a]]=g;w.exports=s},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(o,w,h){(function(s){var r,n,u=s.MutationObserver||s.WebKitMutationObserver;if(u){var b=0,v=new u(p),_=s.document.createTextNode("");v.observe(_,{characterData:!0}),r=function(){_.data=b=++b%2}}else if(s.setImmediate||s.MessageChannel===void 0)r="document"in s&&"onreadystatechange"in s.document.createElement("script")?function(){var i=s.document.createElement("script");i.onreadystatechange=function(){p(),i.onreadystatechange=null,i.parentNode.removeChild(i),i=null},s.document.documentElement.appendChild(i)}:function(){setTimeout(p,0)};else{var g=new s.MessageChannel;g.port1.onmessage=p,r=function(){g.port2.postMessage(0)}}var a=[];function p(){var i,d;n=!0;for(var l=a.length;l;){for(d=a,a=[],i=-1;++i<l;)d[i]();l=a.length}n=!1}w.exports=function(i){a.push(i)!==1||n||r()}}).call(this,typeof kt<"u"?kt:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(o,w,h){var s=o("immediate");function r(){}var n={},u=["REJECTED"],b=["FULFILLED"],v=["PENDING"];function _(l){if(typeof l!="function")throw new TypeError("resolver must be a function");this.state=v,this.queue=[],this.outcome=void 0,l!==r&&i(this,l)}function g(l,m,k){this.promise=l,typeof m=="function"&&(this.onFulfilled=m,this.callFulfilled=this.otherCallFulfilled),typeof k=="function"&&(this.onRejected=k,this.callRejected=this.otherCallRejected)}function a(l,m,k){s(function(){var z;try{z=m(k)}catch(S){return n.reject(l,S)}z===l?n.reject(l,new TypeError("Cannot resolve promise with itself")):n.resolve(l,z)})}function p(l){var m=l&&l.then;if(l&&(typeof l=="object"||typeof l=="function")&&typeof m=="function")return function(){m.apply(l,arguments)}}function i(l,m){var k=!1;function z(j){k||(k=!0,n.reject(l,j))}function S(j){k||(k=!0,n.resolve(l,j))}var P=d(function(){m(S,z)});P.status==="error"&&z(P.value)}function d(l,m){var k={};try{k.value=l(m),k.status="success"}catch(z){k.status="error",k.value=z}return k}(w.exports=_).prototype.finally=function(l){if(typeof l!="function")return this;var m=this.constructor;return this.then(function(k){return m.resolve(l()).then(function(){return k})},function(k){return m.resolve(l()).then(function(){throw k})})},_.prototype.catch=function(l){return this.then(null,l)},_.prototype.then=function(l,m){if(typeof l!="function"&&this.state===b||typeof m!="function"&&this.state===u)return this;var k=new this.constructor(r);return this.state!==v?a(k,this.state===b?l:m,this.outcome):this.queue.push(new g(k,l,m)),k},g.prototype.callFulfilled=function(l){n.resolve(this.promise,l)},g.prototype.otherCallFulfilled=function(l){a(this.promise,this.onFulfilled,l)},g.prototype.callRejected=function(l){n.reject(this.promise,l)},g.prototype.otherCallRejected=function(l){a(this.promise,this.onRejected,l)},n.resolve=function(l,m){var k=d(p,m);if(k.status==="error")return n.reject(l,k.value);var z=k.value;if(z)i(l,z);else{l.state=b,l.outcome=m;for(var S=-1,P=l.queue.length;++S<P;)l.queue[S].callFulfilled(m)}return l},n.reject=function(l,m){l.state=u,l.outcome=m;for(var k=-1,z=l.queue.length;++k<z;)l.queue[k].callRejected(m);return l},_.resolve=function(l){return l instanceof this?l:n.resolve(new this(r),l)},_.reject=function(l){var m=new this(r);return n.reject(m,l)},_.all=function(l){var m=this;if(Object.prototype.toString.call(l)!=="[object Array]")return this.reject(new TypeError("must be an array"));var k=l.length,z=!1;if(!k)return this.resolve([]);for(var S=new Array(k),P=0,j=-1,W=new this(r);++j<k;)O(l[j],j);return W;function O(G,J){m.resolve(G).then(function(y){S[J]=y,++P!==k||z||(z=!0,n.resolve(W,S))},function(y){z||(z=!0,n.reject(W,y))})}},_.race=function(l){var m=this;if(Object.prototype.toString.call(l)!=="[object Array]")return this.reject(new TypeError("must be an array"));var k=l.length,z=!1;if(!k)return this.resolve([]);for(var S=-1,P=new this(r);++S<k;)j=l[S],m.resolve(j).then(function(W){z||(z=!0,n.resolve(P,W))},function(W){z||(z=!0,n.reject(P,W))});var j;return P}},{immediate:36}],38:[function(o,w,h){var s={};(0,o("./lib/utils/common").assign)(s,o("./lib/deflate"),o("./lib/inflate"),o("./lib/zlib/constants")),w.exports=s},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(o,w,h){var s=o("./zlib/deflate"),r=o("./utils/common"),n=o("./utils/strings"),u=o("./zlib/messages"),b=o("./zlib/zstream"),v=Object.prototype.toString,_=0,g=-1,a=0,p=8;function i(l){if(!(this instanceof i))return new i(l);this.options=r.assign({level:g,method:p,chunkSize:16384,windowBits:15,memLevel:8,strategy:a,to:""},l||{});var m=this.options;m.raw&&0<m.windowBits?m.windowBits=-m.windowBits:m.gzip&&0<m.windowBits&&m.windowBits<16&&(m.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new b,this.strm.avail_out=0;var k=s.deflateInit2(this.strm,m.level,m.method,m.windowBits,m.memLevel,m.strategy);if(k!==_)throw new Error(u[k]);if(m.header&&s.deflateSetHeader(this.strm,m.header),m.dictionary){var z;if(z=typeof m.dictionary=="string"?n.string2buf(m.dictionary):v.call(m.dictionary)==="[object ArrayBuffer]"?new Uint8Array(m.dictionary):m.dictionary,(k=s.deflateSetDictionary(this.strm,z))!==_)throw new Error(u[k]);this._dict_set=!0}}function d(l,m){var k=new i(m);if(k.push(l,!0),k.err)throw k.msg||u[k.err];return k.result}i.prototype.push=function(l,m){var k,z,S=this.strm,P=this.options.chunkSize;if(this.ended)return!1;z=m===~~m?m:m===!0?4:0,typeof l=="string"?S.input=n.string2buf(l):v.call(l)==="[object ArrayBuffer]"?S.input=new Uint8Array(l):S.input=l,S.next_in=0,S.avail_in=S.input.length;do{if(S.avail_out===0&&(S.output=new r.Buf8(P),S.next_out=0,S.avail_out=P),(k=s.deflate(S,z))!==1&&k!==_)return this.onEnd(k),!(this.ended=!0);S.avail_out!==0&&(S.avail_in!==0||z!==4&&z!==2)||(this.options.to==="string"?this.onData(n.buf2binstring(r.shrinkBuf(S.output,S.next_out))):this.onData(r.shrinkBuf(S.output,S.next_out)))}while((0<S.avail_in||S.avail_out===0)&&k!==1);return z===4?(k=s.deflateEnd(this.strm),this.onEnd(k),this.ended=!0,k===_):z!==2||(this.onEnd(_),!(S.avail_out=0))},i.prototype.onData=function(l){this.chunks.push(l)},i.prototype.onEnd=function(l){l===_&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=r.flattenChunks(this.chunks)),this.chunks=[],this.err=l,this.msg=this.strm.msg},h.Deflate=i,h.deflate=d,h.deflateRaw=function(l,m){return(m=m||{}).raw=!0,d(l,m)},h.gzip=function(l,m){return(m=m||{}).gzip=!0,d(l,m)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(o,w,h){var s=o("./zlib/inflate"),r=o("./utils/common"),n=o("./utils/strings"),u=o("./zlib/constants"),b=o("./zlib/messages"),v=o("./zlib/zstream"),_=o("./zlib/gzheader"),g=Object.prototype.toString;function a(i){if(!(this instanceof a))return new a(i);this.options=r.assign({chunkSize:16384,windowBits:0,to:""},i||{});var d=this.options;d.raw&&0<=d.windowBits&&d.windowBits<16&&(d.windowBits=-d.windowBits,d.windowBits===0&&(d.windowBits=-15)),!(0<=d.windowBits&&d.windowBits<16)||i&&i.windowBits||(d.windowBits+=32),15<d.windowBits&&d.windowBits<48&&(15&d.windowBits)==0&&(d.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new v,this.strm.avail_out=0;var l=s.inflateInit2(this.strm,d.windowBits);if(l!==u.Z_OK)throw new Error(b[l]);this.header=new _,s.inflateGetHeader(this.strm,this.header)}function p(i,d){var l=new a(d);if(l.push(i,!0),l.err)throw l.msg||b[l.err];return l.result}a.prototype.push=function(i,d){var l,m,k,z,S,P,j=this.strm,W=this.options.chunkSize,O=this.options.dictionary,G=!1;if(this.ended)return!1;m=d===~~d?d:d===!0?u.Z_FINISH:u.Z_NO_FLUSH,typeof i=="string"?j.input=n.binstring2buf(i):g.call(i)==="[object ArrayBuffer]"?j.input=new Uint8Array(i):j.input=i,j.next_in=0,j.avail_in=j.input.length;do{if(j.avail_out===0&&(j.output=new r.Buf8(W),j.next_out=0,j.avail_out=W),(l=s.inflate(j,u.Z_NO_FLUSH))===u.Z_NEED_DICT&&O&&(P=typeof O=="string"?n.string2buf(O):g.call(O)==="[object ArrayBuffer]"?new Uint8Array(O):O,l=s.inflateSetDictionary(this.strm,P)),l===u.Z_BUF_ERROR&&G===!0&&(l=u.Z_OK,G=!1),l!==u.Z_STREAM_END&&l!==u.Z_OK)return this.onEnd(l),!(this.ended=!0);j.next_out&&(j.avail_out!==0&&l!==u.Z_STREAM_END&&(j.avail_in!==0||m!==u.Z_FINISH&&m!==u.Z_SYNC_FLUSH)||(this.options.to==="string"?(k=n.utf8border(j.output,j.next_out),z=j.next_out-k,S=n.buf2string(j.output,k),j.next_out=z,j.avail_out=W-z,z&&r.arraySet(j.output,j.output,k,z,0),this.onData(S)):this.onData(r.shrinkBuf(j.output,j.next_out)))),j.avail_in===0&&j.avail_out===0&&(G=!0)}while((0<j.avail_in||j.avail_out===0)&&l!==u.Z_STREAM_END);return l===u.Z_STREAM_END&&(m=u.Z_FINISH),m===u.Z_FINISH?(l=s.inflateEnd(this.strm),this.onEnd(l),this.ended=!0,l===u.Z_OK):m!==u.Z_SYNC_FLUSH||(this.onEnd(u.Z_OK),!(j.avail_out=0))},a.prototype.onData=function(i){this.chunks.push(i)},a.prototype.onEnd=function(i){i===u.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=r.flattenChunks(this.chunks)),this.chunks=[],this.err=i,this.msg=this.strm.msg},h.Inflate=a,h.inflate=p,h.inflateRaw=function(i,d){return(d=d||{}).raw=!0,p(i,d)},h.ungzip=p},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(o,w,h){var s=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";h.assign=function(u){for(var b=Array.prototype.slice.call(arguments,1);b.length;){var v=b.shift();if(v){if(typeof v!="object")throw new TypeError(v+"must be non-object");for(var _ in v)v.hasOwnProperty(_)&&(u[_]=v[_])}}return u},h.shrinkBuf=function(u,b){return u.length===b?u:u.subarray?u.subarray(0,b):(u.length=b,u)};var r={arraySet:function(u,b,v,_,g){if(b.subarray&&u.subarray)u.set(b.subarray(v,v+_),g);else for(var a=0;a<_;a++)u[g+a]=b[v+a]},flattenChunks:function(u){var b,v,_,g,a,p;for(b=_=0,v=u.length;b<v;b++)_+=u[b].length;for(p=new Uint8Array(_),b=g=0,v=u.length;b<v;b++)a=u[b],p.set(a,g),g+=a.length;return p}},n={arraySet:function(u,b,v,_,g){for(var a=0;a<_;a++)u[g+a]=b[v+a]},flattenChunks:function(u){return[].concat.apply([],u)}};h.setTyped=function(u){u?(h.Buf8=Uint8Array,h.Buf16=Uint16Array,h.Buf32=Int32Array,h.assign(h,r)):(h.Buf8=Array,h.Buf16=Array,h.Buf32=Array,h.assign(h,n))},h.setTyped(s)},{}],42:[function(o,w,h){var s=o("./common"),r=!0,n=!0;try{String.fromCharCode.apply(null,[0])}catch{r=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{n=!1}for(var u=new s.Buf8(256),b=0;b<256;b++)u[b]=252<=b?6:248<=b?5:240<=b?4:224<=b?3:192<=b?2:1;function v(_,g){if(g<65537&&(_.subarray&&n||!_.subarray&&r))return String.fromCharCode.apply(null,s.shrinkBuf(_,g));for(var a="",p=0;p<g;p++)a+=String.fromCharCode(_[p]);return a}u[254]=u[254]=1,h.string2buf=function(_){var g,a,p,i,d,l=_.length,m=0;for(i=0;i<l;i++)(64512&(a=_.charCodeAt(i)))==55296&&i+1<l&&(64512&(p=_.charCodeAt(i+1)))==56320&&(a=65536+(a-55296<<10)+(p-56320),i++),m+=a<128?1:a<2048?2:a<65536?3:4;for(g=new s.Buf8(m),i=d=0;d<m;i++)(64512&(a=_.charCodeAt(i)))==55296&&i+1<l&&(64512&(p=_.charCodeAt(i+1)))==56320&&(a=65536+(a-55296<<10)+(p-56320),i++),a<128?g[d++]=a:(a<2048?g[d++]=192|a>>>6:(a<65536?g[d++]=224|a>>>12:(g[d++]=240|a>>>18,g[d++]=128|a>>>12&63),g[d++]=128|a>>>6&63),g[d++]=128|63&a);return g},h.buf2binstring=function(_){return v(_,_.length)},h.binstring2buf=function(_){for(var g=new s.Buf8(_.length),a=0,p=g.length;a<p;a++)g[a]=_.charCodeAt(a);return g},h.buf2string=function(_,g){var a,p,i,d,l=g||_.length,m=new Array(2*l);for(a=p=0;a<l;)if((i=_[a++])<128)m[p++]=i;else if(4<(d=u[i]))m[p++]=65533,a+=d-1;else{for(i&=d===2?31:d===3?15:7;1<d&&a<l;)i=i<<6|63&_[a++],d--;1<d?m[p++]=65533:i<65536?m[p++]=i:(i-=65536,m[p++]=55296|i>>10&1023,m[p++]=56320|1023&i)}return v(m,p)},h.utf8border=function(_,g){var a;for((g=g||_.length)>_.length&&(g=_.length),a=g-1;0<=a&&(192&_[a])==128;)a--;return a<0||a===0?g:a+u[_[a]]>g?a:g}},{"./common":41}],43:[function(o,w,h){w.exports=function(s,r,n,u){for(var b=65535&s|0,v=s>>>16&65535|0,_=0;n!==0;){for(n-=_=2e3<n?2e3:n;v=v+(b=b+r[u++]|0)|0,--_;);b%=65521,v%=65521}return b|v<<16|0}},{}],44:[function(o,w,h){w.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(o,w,h){var s=(function(){for(var r,n=[],u=0;u<256;u++){r=u;for(var b=0;b<8;b++)r=1&r?3988292384^r>>>1:r>>>1;n[u]=r}return n})();w.exports=function(r,n,u,b){var v=s,_=b+u;r^=-1;for(var g=b;g<_;g++)r=r>>>8^v[255&(r^n[g])];return-1^r}},{}],46:[function(o,w,h){var s,r=o("../utils/common"),n=o("./trees"),u=o("./adler32"),b=o("./crc32"),v=o("./messages"),_=0,g=4,a=0,p=-2,i=-1,d=4,l=2,m=8,k=9,z=286,S=30,P=19,j=2*z+1,W=15,O=3,G=258,J=G+O+1,y=42,B=113,e=1,D=2,tt=3,L=4;function et(t,R){return t.msg=v[R],R}function Z(t){return(t<<1)-(4<t?9:0)}function Q(t){for(var R=t.length;0<=--R;)t[R]=0}function I(t){var R=t.state,N=R.pending;N>t.avail_out&&(N=t.avail_out),N!==0&&(r.arraySet(t.output,R.pending_buf,R.pending_out,N,t.next_out),t.next_out+=N,R.pending_out+=N,t.total_out+=N,t.avail_out-=N,R.pending-=N,R.pending===0&&(R.pending_out=0))}function E(t,R){n._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,R),t.block_start=t.strstart,I(t.strm)}function q(t,R){t.pending_buf[t.pending++]=R}function Y(t,R){t.pending_buf[t.pending++]=R>>>8&255,t.pending_buf[t.pending++]=255&R}function K(t,R){var N,f,c=t.max_chain_length,x=t.strstart,F=t.prev_length,U=t.nice_match,C=t.strstart>t.w_size-J?t.strstart-(t.w_size-J):0,M=t.window,X=t.w_mask,V=t.prev,$=t.strstart+G,st=M[x+F-1],nt=M[x+F];t.prev_length>=t.good_match&&(c>>=2),U>t.lookahead&&(U=t.lookahead);do if(M[(N=R)+F]===nt&&M[N+F-1]===st&&M[N]===M[x]&&M[++N]===M[x+1]){x+=2,N++;do;while(M[++x]===M[++N]&&M[++x]===M[++N]&&M[++x]===M[++N]&&M[++x]===M[++N]&&M[++x]===M[++N]&&M[++x]===M[++N]&&M[++x]===M[++N]&&M[++x]===M[++N]&&x<$);if(f=G-($-x),x=$-G,F<f){if(t.match_start=R,U<=(F=f))break;st=M[x+F-1],nt=M[x+F]}}while((R=V[R&X])>C&&--c!=0);return F<=t.lookahead?F:t.lookahead}function at(t){var R,N,f,c,x,F,U,C,M,X,V=t.w_size;do{if(c=t.window_size-t.lookahead-t.strstart,t.strstart>=V+(V-J)){for(r.arraySet(t.window,t.window,V,V,0),t.match_start-=V,t.strstart-=V,t.block_start-=V,R=N=t.hash_size;f=t.head[--R],t.head[R]=V<=f?f-V:0,--N;);for(R=N=V;f=t.prev[--R],t.prev[R]=V<=f?f-V:0,--N;);c+=V}if(t.strm.avail_in===0)break;if(F=t.strm,U=t.window,C=t.strstart+t.lookahead,M=c,X=void 0,X=F.avail_in,M<X&&(X=M),N=X===0?0:(F.avail_in-=X,r.arraySet(U,F.input,F.next_in,X,C),F.state.wrap===1?F.adler=u(F.adler,U,X,C):F.state.wrap===2&&(F.adler=b(F.adler,U,X,C)),F.next_in+=X,F.total_in+=X,X),t.lookahead+=N,t.lookahead+t.insert>=O)for(x=t.strstart-t.insert,t.ins_h=t.window[x],t.ins_h=(t.ins_h<<t.hash_shift^t.window[x+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[x+O-1])&t.hash_mask,t.prev[x&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=x,x++,t.insert--,!(t.lookahead+t.insert<O)););}while(t.lookahead<J&&t.strm.avail_in!==0)}function ct(t,R){for(var N,f;;){if(t.lookahead<J){if(at(t),t.lookahead<J&&R===_)return e;if(t.lookahead===0)break}if(N=0,t.lookahead>=O&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+O-1])&t.hash_mask,N=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),N!==0&&t.strstart-N<=t.w_size-J&&(t.match_length=K(t,N)),t.match_length>=O)if(f=n._tr_tally(t,t.strstart-t.match_start,t.match_length-O),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=O){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+O-1])&t.hash_mask,N=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart,--t.match_length!=0;);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else f=n._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(f&&(E(t,!1),t.strm.avail_out===0))return e}return t.insert=t.strstart<O-1?t.strstart:O-1,R===g?(E(t,!0),t.strm.avail_out===0?tt:L):t.last_lit&&(E(t,!1),t.strm.avail_out===0)?e:D}function rt(t,R){for(var N,f,c;;){if(t.lookahead<J){if(at(t),t.lookahead<J&&R===_)return e;if(t.lookahead===0)break}if(N=0,t.lookahead>=O&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+O-1])&t.hash_mask,N=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=O-1,N!==0&&t.prev_length<t.max_lazy_match&&t.strstart-N<=t.w_size-J&&(t.match_length=K(t,N),t.match_length<=5&&(t.strategy===1||t.match_length===O&&4096<t.strstart-t.match_start)&&(t.match_length=O-1)),t.prev_length>=O&&t.match_length<=t.prev_length){for(c=t.strstart+t.lookahead-O,f=n._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-O),t.lookahead-=t.prev_length-1,t.prev_length-=2;++t.strstart<=c&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+O-1])&t.hash_mask,N=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),--t.prev_length!=0;);if(t.match_available=0,t.match_length=O-1,t.strstart++,f&&(E(t,!1),t.strm.avail_out===0))return e}else if(t.match_available){if((f=n._tr_tally(t,0,t.window[t.strstart-1]))&&E(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return e}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(f=n._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<O-1?t.strstart:O-1,R===g?(E(t,!0),t.strm.avail_out===0?tt:L):t.last_lit&&(E(t,!1),t.strm.avail_out===0)?e:D}function it(t,R,N,f,c){this.good_length=t,this.max_lazy=R,this.nice_length=N,this.max_chain=f,this.func=c}function ut(){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=m,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 r.Buf16(2*j),this.dyn_dtree=new r.Buf16(2*(2*S+1)),this.bl_tree=new r.Buf16(2*(2*P+1)),Q(this.dyn_ltree),Q(this.dyn_dtree),Q(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new r.Buf16(W+1),this.heap=new r.Buf16(2*z+1),Q(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new r.Buf16(2*z+1),Q(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 ot(t){var R;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=l,(R=t.state).pending=0,R.pending_out=0,R.wrap<0&&(R.wrap=-R.wrap),R.status=R.wrap?y:B,t.adler=R.wrap===2?0:1,R.last_flush=_,n._tr_init(R),a):et(t,p)}function ft(t){var R=ot(t);return R===a&&(function(N){N.window_size=2*N.w_size,Q(N.head),N.max_lazy_match=s[N.level].max_lazy,N.good_match=s[N.level].good_length,N.nice_match=s[N.level].nice_length,N.max_chain_length=s[N.level].max_chain,N.strstart=0,N.block_start=0,N.lookahead=0,N.insert=0,N.match_length=N.prev_length=O-1,N.match_available=0,N.ins_h=0})(t.state),R}function dt(t,R,N,f,c,x){if(!t)return p;var F=1;if(R===i&&(R=6),f<0?(F=0,f=-f):15<f&&(F=2,f-=16),c<1||k<c||N!==m||f<8||15<f||R<0||9<R||x<0||d<x)return et(t,p);f===8&&(f=9);var U=new ut;return(t.state=U).strm=t,U.wrap=F,U.gzhead=null,U.w_bits=f,U.w_size=1<<U.w_bits,U.w_mask=U.w_size-1,U.hash_bits=c+7,U.hash_size=1<<U.hash_bits,U.hash_mask=U.hash_size-1,U.hash_shift=~~((U.hash_bits+O-1)/O),U.window=new r.Buf8(2*U.w_size),U.head=new r.Buf16(U.hash_size),U.prev=new r.Buf16(U.w_size),U.lit_bufsize=1<<c+6,U.pending_buf_size=4*U.lit_bufsize,U.pending_buf=new r.Buf8(U.pending_buf_size),U.d_buf=1*U.lit_bufsize,U.l_buf=3*U.lit_bufsize,U.level=R,U.strategy=x,U.method=N,ft(t)}s=[new it(0,0,0,0,function(t,R){var N=65535;for(N>t.pending_buf_size-5&&(N=t.pending_buf_size-5);;){if(t.lookahead<=1){if(at(t),t.lookahead===0&&R===_)return e;if(t.lookahead===0)break}t.strstart+=t.lookahead,t.lookahead=0;var f=t.block_start+N;if((t.strstart===0||t.strstart>=f)&&(t.lookahead=t.strstart-f,t.strstart=f,E(t,!1),t.strm.avail_out===0)||t.strstart-t.block_start>=t.w_size-J&&(E(t,!1),t.strm.avail_out===0))return e}return t.insert=0,R===g?(E(t,!0),t.strm.avail_out===0?tt:L):(t.strstart>t.block_start&&(E(t,!1),t.strm.avail_out),e)}),new it(4,4,8,4,ct),new it(4,5,16,8,ct),new it(4,6,32,32,ct),new it(4,4,16,16,rt),new it(8,16,32,32,rt),new it(8,16,128,128,rt),new it(8,32,128,256,rt),new it(32,128,258,1024,rt),new it(32,258,258,4096,rt)],h.deflateInit=function(t,R){return dt(t,R,m,15,8,0)},h.deflateInit2=dt,h.deflateReset=ft,h.deflateResetKeep=ot,h.deflateSetHeader=function(t,R){return t&&t.state?t.state.wrap!==2?p:(t.state.gzhead=R,a):p},h.deflate=function(t,R){var N,f,c,x;if(!t||!t.state||5<R||R<0)return t?et(t,p):p;if(f=t.state,!t.output||!t.input&&t.avail_in!==0||f.status===666&&R!==g)return et(t,t.avail_out===0?-5:p);if(f.strm=t,N=f.last_flush,f.last_flush=R,f.status===y)if(f.wrap===2)t.adler=0,q(f,31),q(f,139),q(f,8),f.gzhead?(q(f,(f.gzhead.text?1:0)+(f.gzhead.hcrc?2:0)+(f.gzhead.extra?4:0)+(f.gzhead.name?8:0)+(f.gzhead.comment?16:0)),q(f,255&f.gzhead.time),q(f,f.gzhead.time>>8&255),q(f,f.gzhead.time>>16&255),q(f,f.gzhead.time>>24&255),q(f,f.level===9?2:2<=f.strategy||f.level<2?4:0),q(f,255&f.gzhead.os),f.gzhead.extra&&f.gzhead.extra.length&&(q(f,255&f.gzhead.extra.length),q(f,f.gzhead.extra.length>>8&255)),f.gzhead.hcrc&&(t.adler=b(t.adler,f.pending_buf,f.pending,0)),f.gzindex=0,f.status=69):(q(f,0),q(f,0),q(f,0),q(f,0),q(f,0),q(f,f.level===9?2:2<=f.strategy||f.level<2?4:0),q(f,3),f.status=B);else{var F=m+(f.w_bits-8<<4)<<8;F|=(2<=f.strategy||f.level<2?0:f.level<6?1:f.level===6?2:3)<<6,f.strstart!==0&&(F|=32),F+=31-F%31,f.status=B,Y(f,F),f.strstart!==0&&(Y(f,t.adler>>>16),Y(f,65535&t.adler)),t.adler=1}if(f.status===69)if(f.gzhead.extra){for(c=f.pending;f.gzindex<(65535&f.gzhead.extra.length)&&(f.pending!==f.pending_buf_size||(f.gzhead.hcrc&&f.pending>c&&(t.adler=b(t.adler,f.pending_buf,f.pending-c,c)),I(t),c=f.pending,f.pending!==f.pending_buf_size));)q(f,255&f.gzhead.extra[f.gzindex]),f.gzindex++;f.gzhead.hcrc&&f.pending>c&&(t.adler=b(t.adler,f.pending_buf,f.pending-c,c)),f.gzindex===f.gzhead.extra.length&&(f.gzindex=0,f.status=73)}else f.status=73;if(f.status===73)if(f.gzhead.name){c=f.pending;do{if(f.pending===f.pending_buf_size&&(f.gzhead.hcrc&&f.pending>c&&(t.adler=b(t.adler,f.pending_buf,f.pending-c,c)),I(t),c=f.pending,f.pending===f.pending_buf_size)){x=1;break}x=f.gzindex<f.gzhead.name.length?255&f.gzhead.name.charCodeAt(f.gzindex++):0,q(f,x)}while(x!==0);f.gzhead.hcrc&&f.pending>c&&(t.adler=b(t.adler,f.pending_buf,f.pending-c,c)),x===0&&(f.gzindex=0,f.status=91)}else f.status=91;if(f.status===91)if(f.gzhead.comment){c=f.pending;do{if(f.pending===f.pending_buf_size&&(f.gzhead.hcrc&&f.pending>c&&(t.adler=b(t.adler,f.pending_buf,f.pending-c,c)),I(t),c=f.pending,f.pending===f.pending_buf_size)){x=1;break}x=f.gzindex<f.gzhead.comment.length?255&f.gzhead.comment.charCodeAt(f.gzindex++):0,q(f,x)}while(x!==0);f.gzhead.hcrc&&f.pending>c&&(t.adler=b(t.adler,f.pending_buf,f.pending-c,c)),x===0&&(f.status=103)}else f.status=103;if(f.status===103&&(f.gzhead.hcrc?(f.pending+2>f.pending_buf_size&&I(t),f.pending+2<=f.pending_buf_size&&(q(f,255&t.adler),q(f,t.adler>>8&255),t.adler=0,f.status=B)):f.status=B),f.pending!==0){if(I(t),t.avail_out===0)return f.last_flush=-1,a}else if(t.avail_in===0&&Z(R)<=Z(N)&&R!==g)return et(t,-5);if(f.status===666&&t.avail_in!==0)return et(t,-5);if(t.avail_in!==0||f.lookahead!==0||R!==_&&f.status!==666){var U=f.strategy===2?(function(C,M){for(var X;;){if(C.lookahead===0&&(at(C),C.lookahead===0)){if(M===_)return e;break}if(C.match_length=0,X=n._tr_tally(C,0,C.window[C.strstart]),C.lookahead--,C.strstart++,X&&(E(C,!1),C.strm.avail_out===0))return e}return C.insert=0,M===g?(E(C,!0),C.strm.avail_out===0?tt:L):C.last_lit&&(E(C,!1),C.strm.avail_out===0)?e:D})(f,R):f.strategy===3?(function(C,M){for(var X,V,$,st,nt=C.window;;){if(C.lookahead<=G){if(at(C),C.lookahead<=G&&M===_)return e;if(C.lookahead===0)break}if(C.match_length=0,C.lookahead>=O&&0<C.strstart&&(V=nt[$=C.strstart-1])===nt[++$]&&V===nt[++$]&&V===nt[++$]){st=C.strstart+G;do;while(V===nt[++$]&&V===nt[++$]&&V===nt[++$]&&V===nt[++$]&&V===nt[++$]&&V===nt[++$]&&V===nt[++$]&&V===nt[++$]&&$<st);C.match_length=G-(st-$),C.match_length>C.lookahead&&(C.match_length=C.lookahead)}if(C.match_length>=O?(X=n._tr_tally(C,1,C.match_length-O),C.lookahead-=C.match_length,C.strstart+=C.match_length,C.match_length=0):(X=n._tr_tally(C,0,C.window[C.strstart]),C.lookahead--,C.strstart++),X&&(E(C,!1),C.strm.avail_out===0))return e}return C.insert=0,M===g?(E(C,!0),C.strm.avail_out===0?tt:L):C.last_lit&&(E(C,!1),C.strm.avail_out===0)?e:D})(f,R):s[f.level].func(f,R);if(U!==tt&&U!==L||(f.status=666),U===e||U===tt)return t.avail_out===0&&(f.last_flush=-1),a;if(U===D&&(R===1?n._tr_align(f):R!==5&&(n._tr_stored_block(f,0,0,!1),R===3&&(Q(f.head),f.lookahead===0&&(f.strstart=0,f.block_start=0,f.insert=0))),I(t),t.avail_out===0))return f.last_flush=-1,a}return R!==g?a:f.wrap<=0?1:(f.wrap===2?(q(f,255&t.adler),q(f,t.adler>>8&255),q(f,t.adler>>16&255),q(f,t.adler>>24&255),q(f,255&t.total_in),q(f,t.total_in>>8&255),q(f,t.total_in>>16&255),q(f,t.total_in>>24&255)):(Y(f,t.adler>>>16),Y(f,65535&t.adler)),I(t),0<f.wrap&&(f.wrap=-f.wrap),f.pending!==0?a:1)},h.deflateEnd=function(t){var R;return t&&t.state?(R=t.state.status)!==y&&R!==69&&R!==73&&R!==91&&R!==103&&R!==B&&R!==666?et(t,p):(t.state=null,R===B?et(t,-3):a):p},h.deflateSetDictionary=function(t,R){var N,f,c,x,F,U,C,M,X=R.length;if(!t||!t.state||(x=(N=t.state).wrap)===2||x===1&&N.status!==y||N.lookahead)return p;for(x===1&&(t.adler=u(t.adler,R,X,0)),N.wrap=0,X>=N.w_size&&(x===0&&(Q(N.head),N.strstart=0,N.block_start=0,N.insert=0),M=new r.Buf8(N.w_size),r.arraySet(M,R,X-N.w_size,N.w_size,0),R=M,X=N.w_size),F=t.avail_in,U=t.next_in,C=t.input,t.avail_in=X,t.next_in=0,t.input=R,at(N);N.lookahead>=O;){for(f=N.strstart,c=N.lookahead-(O-1);N.ins_h=(N.ins_h<<N.hash_shift^N.window[f+O-1])&N.hash_mask,N.prev[f&N.w_mask]=N.head[N.ins_h],N.head[N.ins_h]=f,f++,--c;);N.strstart=f,N.lookahead=O-1,at(N)}return N.strstart+=N.lookahead,N.block_start=N.strstart,N.insert=N.lookahead,N.lookahead=0,N.match_length=N.prev_length=O-1,N.match_available=0,t.next_in=U,t.input=C,t.avail_in=F,N.wrap=x,a},h.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(o,w,h){w.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(o,w,h){w.exports=function(s,r){var n,u,b,v,_,g,a,p,i,d,l,m,k,z,S,P,j,W,O,G,J,y,B,e,D;n=s.state,u=s.next_in,e=s.input,b=u+(s.avail_in-5),v=s.next_out,D=s.output,_=v-(r-s.avail_out),g=v+(s.avail_out-257),a=n.dmax,p=n.wsize,i=n.whave,d=n.wnext,l=n.window,m=n.hold,k=n.bits,z=n.lencode,S=n.distcode,P=(1<<n.lenbits)-1,j=(1<<n.distbits)-1;t:do{k<15&&(m+=e[u++]<<k,k+=8,m+=e[u++]<<k,k+=8),W=z[m&P];e:for(;;){if(m>>>=O=W>>>24,k-=O,(O=W>>>16&255)===0)D[v++]=65535&W;else{if(!(16&O)){if((64&O)==0){W=z[(65535&W)+(m&(1<<O)-1)];continue e}if(32&O){n.mode=12;break t}s.msg="invalid literal/length code",n.mode=30;break t}G=65535&W,(O&=15)&&(k<O&&(m+=e[u++]<<k,k+=8),G+=m&(1<<O)-1,m>>>=O,k-=O),k<15&&(m+=e[u++]<<k,k+=8,m+=e[u++]<<k,k+=8),W=S[m&j];r:for(;;){if(m>>>=O=W>>>24,k-=O,!(16&(O=W>>>16&255))){if((64&O)==0){W=S[(65535&W)+(m&(1<<O)-1)];continue r}s.msg="invalid distance code",n.mode=30;break t}if(J=65535&W,k<(O&=15)&&(m+=e[u++]<<k,(k+=8)<O&&(m+=e[u++]<<k,k+=8)),a<(J+=m&(1<<O)-1)){s.msg="invalid distance too far back",n.mode=30;break t}if(m>>>=O,k-=O,(O=v-_)<J){if(i<(O=J-O)&&n.sane){s.msg="invalid distance too far back",n.mode=30;break t}if(B=l,(y=0)===d){if(y+=p-O,O<G){for(G-=O;D[v++]=l[y++],--O;);y=v-J,B=D}}else if(d<O){if(y+=p+d-O,(O-=d)<G){for(G-=O;D[v++]=l[y++],--O;);if(y=0,d<G){for(G-=O=d;D[v++]=l[y++],--O;);y=v-J,B=D}}}else if(y+=d-O,O<G){for(G-=O;D[v++]=l[y++],--O;);y=v-J,B=D}for(;2<G;)D[v++]=B[y++],D[v++]=B[y++],D[v++]=B[y++],G-=3;G&&(D[v++]=B[y++],1<G&&(D[v++]=B[y++]))}else{for(y=v-J;D[v++]=D[y++],D[v++]=D[y++],D[v++]=D[y++],2<(G-=3););G&&(D[v++]=D[y++],1<G&&(D[v++]=D[y++]))}break}}break}}while(u<b&&v<g);u-=G=k>>3,m&=(1<<(k-=G<<3))-1,s.next_in=u,s.next_out=v,s.avail_in=u<b?b-u+5:5-(u-b),s.avail_out=v<g?g-v+257:257-(v-g),n.hold=m,n.bits=k}},{}],49:[function(o,w,h){var s=o("../utils/common"),r=o("./adler32"),n=o("./crc32"),u=o("./inffast"),b=o("./inftrees"),v=1,_=2,g=0,a=-2,p=1,i=852,d=592;function l(y){return(y>>>24&255)+(y>>>8&65280)+((65280&y)<<8)+((255&y)<<24)}function m(){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 s.Buf16(320),this.work=new s.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function k(y){var B;return y&&y.state?(B=y.state,y.total_in=y.total_out=B.total=0,y.msg="",B.wrap&&(y.adler=1&B.wrap),B.mode=p,B.last=0,B.havedict=0,B.dmax=32768,B.head=null,B.hold=0,B.bits=0,B.lencode=B.lendyn=new s.Buf32(i),B.distcode=B.distdyn=new s.Buf32(d),B.sane=1,B.back=-1,g):a}function z(y){var B;return y&&y.state?((B=y.state).wsize=0,B.whave=0,B.wnext=0,k(y)):a}function S(y,B){var e,D;return y&&y.state?(D=y.state,B<0?(e=0,B=-B):(e=1+(B>>4),B<48&&(B&=15)),B&&(B<8||15<B)?a:(D.window!==null&&D.wbits!==B&&(D.window=null),D.wrap=e,D.wbits=B,z(y))):a}function P(y,B){var e,D;return y?(D=new m,(y.state=D).window=null,(e=S(y,B))!==g&&(y.state=null),e):a}var j,W,O=!0;function G(y){if(O){var B;for(j=new s.Buf32(512),W=new s.Buf32(32),B=0;B<144;)y.lens[B++]=8;for(;B<256;)y.lens[B++]=9;for(;B<280;)y.lens[B++]=7;for(;B<288;)y.lens[B++]=8;for(b(v,y.lens,0,288,j,0,y.work,{bits:9}),B=0;B<32;)y.lens[B++]=5;b(_,y.lens,0,32,W,0,y.work,{bits:5}),O=!1}y.lencode=j,y.lenbits=9,y.distcode=W,y.distbits=5}function J(y,B,e,D){var tt,L=y.state;return L.window===null&&(L.wsize=1<<L.wbits,L.wnext=0,L.whave=0,L.window=new s.Buf8(L.wsize)),D>=L.wsize?(s.arraySet(L.window,B,e-L.wsize,L.wsize,0),L.wnext=0,L.whave=L.wsize):(D<(tt=L.wsize-L.wnext)&&(tt=D),s.arraySet(L.window,B,e-D,tt,L.wnext),(D-=tt)?(s.arraySet(L.window,B,e-D,D,0),L.wnext=D,L.whave=L.wsize):(L.wnext+=tt,L.wnext===L.wsize&&(L.wnext=0),L.whave<L.wsize&&(L.whave+=tt))),0}h.inflateReset=z,h.inflateReset2=S,h.inflateResetKeep=k,h.inflateInit=function(y){return P(y,15)},h.inflateInit2=P,h.inflate=function(y,B){var e,D,tt,L,et,Z,Q,I,E,q,Y,K,at,ct,rt,it,ut,ot,ft,dt,t,R,N,f,c=0,x=new s.Buf8(4),F=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!y||!y.state||!y.output||!y.input&&y.avail_in!==0)return a;(e=y.state).mode===12&&(e.mode=13),et=y.next_out,tt=y.output,Q=y.avail_out,L=y.next_in,D=y.input,Z=y.avail_in,I=e.hold,E=e.bits,q=Z,Y=Q,R=g;t:for(;;)switch(e.mode){case p:if(e.wrap===0){e.mode=13;break}for(;E<16;){if(Z===0)break t;Z--,I+=D[L++]<<E,E+=8}if(2&e.wrap&&I===35615){x[e.check=0]=255&I,x[1]=I>>>8&255,e.check=n(e.check,x,2,0),E=I=0,e.mode=2;break}if(e.flags=0,e.head&&(e.head.done=!1),!(1&e.wrap)||(((255&I)<<8)+(I>>8))%31){y.msg="incorrect header check",e.mode=30;break}if((15&I)!=8){y.msg="unknown compression method",e.mode=30;break}if(E-=4,t=8+(15&(I>>>=4)),e.wbits===0)e.wbits=t;else if(t>e.wbits){y.msg="invalid window size",e.mode=30;break}e.dmax=1<<t,y.adler=e.check=1,e.mode=512&I?10:12,E=I=0;break;case 2:for(;E<16;){if(Z===0)break t;Z--,I+=D[L++]<<E,E+=8}if(e.flags=I,(255&e.flags)!=8){y.msg="unknown compression method",e.mode=30;break}if(57344&e.flags){y.msg="unknown header flags set",e.mode=30;break}e.head&&(e.head.text=I>>8&1),512&e.flags&&(x[0]=255&I,x[1]=I>>>8&255,e.check=n(e.check,x,2,0)),E=I=0,e.mode=3;case 3:for(;E<32;){if(Z===0)break t;Z--,I+=D[L++]<<E,E+=8}e.head&&(e.head.time=I),512&e.flags&&(x[0]=255&I,x[1]=I>>>8&255,x[2]=I>>>16&255,x[3]=I>>>24&255,e.check=n(e.check,x,4,0)),E=I=0,e.mode=4;case 4:for(;E<16;){if(Z===0)break t;Z--,I+=D[L++]<<E,E+=8}e.head&&(e.head.xflags=255&I,e.head.os=I>>8),512&e.flags&&(x[0]=255&I,x[1]=I>>>8&255,e.check=n(e.check,x,2,0)),E=I=0,e.mode=5;case 5:if(1024&e.flags){for(;E<16;){if(Z===0)break t;Z--,I+=D[L++]<<E,E+=8}e.length=I,e.head&&(e.head.extra_len=I),512&e.flags&&(x[0]=255&I,x[1]=I>>>8&255,e.check=n(e.check,x,2,0)),E=I=0}else e.head&&(e.head.extra=null);e.mode=6;case 6:if(1024&e.flags&&(Z<(K=e.length)&&(K=Z),K&&(e.head&&(t=e.head.extra_len-e.length,e.head.extra||(e.head.extra=new Array(e.head.extra_len)),s.arraySet(e.head.extra,D,L,K,t)),512&e.flags&&(e.check=n(e.check,D,K,L)),Z-=K,L+=K,e.length-=K),e.length))break t;e.length=0,e.mode=7;case 7:if(2048&e.flags){if(Z===0)break t;for(K=0;t=D[L+K++],e.head&&t&&e.length<65536&&(e.head.name+=String.fromCharCode(t)),t&&K<Z;);if(512&e.flags&&(e.check=n(e.check,D,K,L)),Z-=K,L+=K,t)break t}else e.head&&(e.head.name=null);e.length=0,e.mode=8;case 8:if(4096&e.flags){if(Z===0)break t;for(K=0;t=D[L+K++],e.head&&t&&e.length<65536&&(e.head.comment+=String.fromCharCode(t)),t&&K<Z;);if(512&e.flags&&(e.check=n(e.check,D,K,L)),Z-=K,L+=K,t)break t}else e.head&&(e.head.comment=null);e.mode=9;case 9:if(512&e.flags){for(;E<16;){if(Z===0)break t;Z--,I+=D[L++]<<E,E+=8}if(I!==(65535&e.check)){y.msg="header crc mismatch",e.mode=30;break}E=I=0}e.head&&(e.head.hcrc=e.flags>>9&1,e.head.done=!0),y.adler=e.check=0,e.mode=12;break;case 10:for(;E<32;){if(Z===0)break t;Z--,I+=D[L++]<<E,E+=8}y.adler=e.check=l(I),E=I=0,e.mode=11;case 11:if(e.havedict===0)return y.next_out=et,y.avail_out=Q,y.next_in=L,y.avail_in=Z,e.hold=I,e.bits=E,2;y.adler=e.check=1,e.mode=12;case 12:if(B===5||B===6)break t;case 13:if(e.last){I>>>=7&E,E-=7&E,e.mode=27;break}for(;E<3;){if(Z===0)break t;Z--,I+=D[L++]<<E,E+=8}switch(e.last=1&I,E-=1,3&(I>>>=1)){case 0:e.mode=14;break;case 1:if(G(e),e.mode=20,B!==6)break;I>>>=2,E-=2;break t;case 2:e.mode=17;break;case 3:y.msg="invalid block type",e.mode=30}I>>>=2,E-=2;break;case 14:for(I>>>=7&E,E-=7&E;E<32;){if(Z===0)break t;Z--,I+=D[L++]<<E,E+=8}if((65535&I)!=(I>>>16^65535)){y.msg="invalid stored block lengths",e.mode=30;break}if(e.length=65535&I,E=I=0,e.mode=15,B===6)break t;case 15:e.mode=16;case 16:if(K=e.length){if(Z<K&&(K=Z),Q<K&&(K=Q),K===0)break t;s.arraySet(tt,D,L,K,et),Z-=K,L+=K,Q-=K,et+=K,e.length-=K;break}e.mode=12;break;case 17:for(;E<14;){if(Z===0)break t;Z--,I+=D[L++]<<E,E+=8}if(e.nlen=257+(31&I),I>>>=5,E-=5,e.ndist=1+(31&I),I>>>=5,E-=5,e.ncode=4+(15&I),I>>>=4,E-=4,286<e.nlen||30<e.ndist){y.msg="too many length or distance symbols",e.mode=30;break}e.have=0,e.mode=18;case 18:for(;e.have<e.ncode;){for(;E<3;){if(Z===0)break t;Z--,I+=D[L++]<<E,E+=8}e.lens[F[e.have++]]=7&I,I>>>=3,E-=3}for(;e.have<19;)e.lens[F[e.have++]]=0;if(e.lencode=e.lendyn,e.lenbits=7,N={bits:e.lenbits},R=b(0,e.lens,0,19,e.lencode,0,e.work,N),e.lenbits=N.bits,R){y.msg="invalid code lengths set",e.mode=30;break}e.have=0,e.mode=19;case 19:for(;e.have<e.nlen+e.ndist;){for(;it=(c=e.lencode[I&(1<<e.lenbits)-1])>>>16&255,ut=65535&c,!((rt=c>>>24)<=E);){if(Z===0)break t;Z--,I+=D[L++]<<E,E+=8}if(ut<16)I>>>=rt,E-=rt,e.lens[e.have++]=ut;else{if(ut===16){for(f=rt+2;E<f;){if(Z===0)break t;Z--,I+=D[L++]<<E,E+=8}if(I>>>=rt,E-=rt,e.have===0){y.msg="invalid bit length repeat",e.mode=30;break}t=e.lens[e.have-1],K=3+(3&I),I>>>=2,E-=2}else if(ut===17){for(f=rt+3;E<f;){if(Z===0)break t;Z--,I+=D[L++]<<E,E+=8}E-=rt,t=0,K=3+(7&(I>>>=rt)),I>>>=3,E-=3}else{for(f=rt+7;E<f;){if(Z===0)break t;Z--,I+=D[L++]<<E,E+=8}E-=rt,t=0,K=11+(127&(I>>>=rt)),I>>>=7,E-=7}if(e.have+K>e.nlen+e.ndist){y.msg="invalid bit length repeat",e.mode=30;break}for(;K--;)e.lens[e.have++]=t}}if(e.mode===30)break;if(e.lens[256]===0){y.msg="invalid code -- missing end-of-block",e.mode=30;break}if(e.lenbits=9,N={bits:e.lenbits},R=b(v,e.lens,0,e.nlen,e.lencode,0,e.work,N),e.lenbits=N.bits,R){y.msg="invalid literal/lengths set",e.mode=30;break}if(e.distbits=6,e.distcode=e.distdyn,N={bits:e.distbits},R=b(_,e.lens,e.nlen,e.ndist,e.distcode,0,e.work,N),e.distbits=N.bits,R){y.msg="invalid distances set",e.mode=30;break}if(e.mode=20,B===6)break t;case 20:e.mode=21;case 21:if(6<=Z&&258<=Q){y.next_out=et,y.avail_out=Q,y.next_in=L,y.avail_in=Z,e.hold=I,e.bits=E,u(y,Y),et=y.next_out,tt=y.output,Q=y.avail_out,L=y.next_in,D=y.input,Z=y.avail_in,I=e.hold,E=e.bits,e.mode===12&&(e.back=-1);break}for(e.back=0;it=(c=e.lencode[I&(1<<e.lenbits)-1])>>>16&255,ut=65535&c,!((rt=c>>>24)<=E);){if(Z===0)break t;Z--,I+=D[L++]<<E,E+=8}if(it&&(240&it)==0){for(ot=rt,ft=it,dt=ut;it=(c=e.lencode[dt+((I&(1<<ot+ft)-1)>>ot)])>>>16&255,ut=65535&c,!(ot+(rt=c>>>24)<=E);){if(Z===0)break t;Z--,I+=D[L++]<<E,E+=8}I>>>=ot,E-=ot,e.back+=ot}if(I>>>=rt,E-=rt,e.back+=rt,e.length=ut,it===0){e.mode=26;break}if(32&it){e.back=-1,e.mode=12;break}if(64&it){y.msg="invalid literal/length code",e.mode=30;break}e.extra=15&it,e.mode=22;case 22:if(e.extra){for(f=e.extra;E<f;){if(Z===0)break t;Z--,I+=D[L++]<<E,E+=8}e.length+=I&(1<<e.extra)-1,I>>>=e.extra,E-=e.extra,e.back+=e.extra}e.was=e.length,e.mode=23;case 23:for(;it=(c=e.distcode[I&(1<<e.distbits)-1])>>>16&255,ut=65535&c,!((rt=c>>>24)<=E);){if(Z===0)break t;Z--,I+=D[L++]<<E,E+=8}if((240&it)==0){for(ot=rt,ft=it,dt=ut;it=(c=e.distcode[dt+((I&(1<<ot+ft)-1)>>ot)])>>>16&255,ut=65535&c,!(ot+(rt=c>>>24)<=E);){if(Z===0)break t;Z--,I+=D[L++]<<E,E+=8}I>>>=ot,E-=ot,e.back+=ot}if(I>>>=rt,E-=rt,e.back+=rt,64&it){y.msg="invalid distance code",e.mode=30;break}e.offset=ut,e.extra=15&it,e.mode=24;case 24:if(e.extra){for(f=e.extra;E<f;){if(Z===0)break t;Z--,I+=D[L++]<<E,E+=8}e.offset+=I&(1<<e.extra)-1,I>>>=e.extra,E-=e.extra,e.back+=e.extra}if(e.offset>e.dmax){y.msg="invalid distance too far back",e.mode=30;break}e.mode=25;case 25:if(Q===0)break t;if(K=Y-Q,e.offset>K){if((K=e.offset-K)>e.whave&&e.sane){y.msg="invalid distance too far back",e.mode=30;break}at=K>e.wnext?(K-=e.wnext,e.wsize-K):e.wnext-K,K>e.length&&(K=e.length),ct=e.window}else ct=tt,at=et-e.offset,K=e.length;for(Q<K&&(K=Q),Q-=K,e.length-=K;tt[et++]=ct[at++],--K;);e.length===0&&(e.mode=21);break;case 26:if(Q===0)break t;tt[et++]=e.length,Q--,e.mode=21;break;case 27:if(e.wrap){for(;E<32;){if(Z===0)break t;Z--,I|=D[L++]<<E,E+=8}if(Y-=Q,y.total_out+=Y,e.total+=Y,Y&&(y.adler=e.check=e.flags?n(e.check,tt,Y,et-Y):r(e.check,tt,Y,et-Y)),Y=Q,(e.flags?I:l(I))!==e.check){y.msg="incorrect data check",e.mode=30;break}E=I=0}e.mode=28;case 28:if(e.wrap&&e.flags){for(;E<32;){if(Z===0)break t;Z--,I+=D[L++]<<E,E+=8}if(I!==(4294967295&e.total)){y.msg="incorrect length check",e.mode=30;break}E=I=0}e.mode=29;case 29:R=1;break t;case 30:R=-3;break t;case 31:return-4;case 32:default:return a}return y.next_out=et,y.avail_out=Q,y.next_in=L,y.avail_in=Z,e.hold=I,e.bits=E,(e.wsize||Y!==y.avail_out&&e.mode<30&&(e.mode<27||B!==4))&&J(y,y.output,y.next_out,Y-y.avail_out)?(e.mode=31,-4):(q-=y.avail_in,Y-=y.avail_out,y.total_in+=q,y.total_out+=Y,e.total+=Y,e.wrap&&Y&&(y.adler=e.check=e.flags?n(e.check,tt,Y,y.next_out-Y):r(e.check,tt,Y,y.next_out-Y)),y.data_type=e.bits+(e.last?64:0)+(e.mode===12?128:0)+(e.mode===20||e.mode===15?256:0),(q==0&&Y===0||B===4)&&R===g&&(R=-5),R)},h.inflateEnd=function(y){if(!y||!y.state)return a;var B=y.state;return B.window&&(B.window=null),y.state=null,g},h.inflateGetHeader=function(y,B){var e;return y&&y.state?(2&(e=y.state).wrap)==0?a:((e.head=B).done=!1,g):a},h.inflateSetDictionary=function(y,B){var e,D=B.length;return y&&y.state?(e=y.state).wrap!==0&&e.mode!==11?a:e.mode===11&&r(1,B,D,0)!==e.check?-3:J(y,B,D,D)?(e.mode=31,-4):(e.havedict=1,g):a},h.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(o,w,h){var s=o("../utils/common"),r=[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],n=[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],u=[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],b=[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];w.exports=function(v,_,g,a,p,i,d,l){var m,k,z,S,P,j,W,O,G,J=l.bits,y=0,B=0,e=0,D=0,tt=0,L=0,et=0,Z=0,Q=0,I=0,E=null,q=0,Y=new s.Buf16(16),K=new s.Buf16(16),at=null,ct=0;for(y=0;y<=15;y++)Y[y]=0;for(B=0;B<a;B++)Y[_[g+B]]++;for(tt=J,D=15;1<=D&&Y[D]===0;D--);if(D<tt&&(tt=D),D===0)return p[i++]=20971520,p[i++]=20971520,l.bits=1,0;for(e=1;e<D&&Y[e]===0;e++);for(tt<e&&(tt=e),y=Z=1;y<=15;y++)if(Z<<=1,(Z-=Y[y])<0)return-1;if(0<Z&&(v===0||D!==1))return-1;for(K[1]=0,y=1;y<15;y++)K[y+1]=K[y]+Y[y];for(B=0;B<a;B++)_[g+B]!==0&&(d[K[_[g+B]]++]=B);if(j=v===0?(E=at=d,19):v===1?(E=r,q-=257,at=n,ct-=257,256):(E=u,at=b,-1),y=e,P=i,et=B=I=0,z=-1,S=(Q=1<<(L=tt))-1,v===1&&852<Q||v===2&&592<Q)return 1;for(;;){for(W=y-et,G=d[B]<j?(O=0,d[B]):d[B]>j?(O=at[ct+d[B]],E[q+d[B]]):(O=96,0),m=1<<y-et,e=k=1<<L;p[P+(I>>et)+(k-=m)]=W<<24|O<<16|G|0,k!==0;);for(m=1<<y-1;I&m;)m>>=1;if(m!==0?(I&=m-1,I+=m):I=0,B++,--Y[y]==0){if(y===D)break;y=_[g+d[B]]}if(tt<y&&(I&S)!==z){for(et===0&&(et=tt),P+=e,Z=1<<(L=y-et);L+et<D&&!((Z-=Y[L+et])<=0);)L++,Z<<=1;if(Q+=1<<L,v===1&&852<Q||v===2&&592<Q)return 1;p[z=I&S]=tt<<24|L<<16|P-i|0}}return I!==0&&(p[P+I]=y-et<<24|64<<16|0),l.bits=tt,0}},{"../utils/common":41}],51:[function(o,w,h){w.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(o,w,h){var s=o("../utils/common"),r=0,n=1;function u(c){for(var x=c.length;0<=--x;)c[x]=0}var b=0,v=29,_=256,g=_+1+v,a=30,p=19,i=2*g+1,d=15,l=16,m=7,k=256,z=16,S=17,P=18,j=[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],W=[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],O=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],G=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],J=new Array(2*(g+2));u(J);var y=new Array(2*a);u(y);var B=new Array(512);u(B);var e=new Array(256);u(e);var D=new Array(v);u(D);var tt,L,et,Z=new Array(a);function Q(c,x,F,U,C){this.static_tree=c,this.extra_bits=x,this.extra_base=F,this.elems=U,this.max_length=C,this.has_stree=c&&c.length}function I(c,x){this.dyn_tree=c,this.max_code=0,this.stat_desc=x}function E(c){return c<256?B[c]:B[256+(c>>>7)]}function q(c,x){c.pending_buf[c.pending++]=255&x,c.pending_buf[c.pending++]=x>>>8&255}function Y(c,x,F){c.bi_valid>l-F?(c.bi_buf|=x<<c.bi_valid&65535,q(c,c.bi_buf),c.bi_buf=x>>l-c.bi_valid,c.bi_valid+=F-l):(c.bi_buf|=x<<c.bi_valid&65535,c.bi_valid+=F)}function K(c,x,F){Y(c,F[2*x],F[2*x+1])}function at(c,x){for(var F=0;F|=1&c,c>>>=1,F<<=1,0<--x;);return F>>>1}function ct(c,x,F){var U,C,M=new Array(d+1),X=0;for(U=1;U<=d;U++)M[U]=X=X+F[U-1]<<1;for(C=0;C<=x;C++){var V=c[2*C+1];V!==0&&(c[2*C]=at(M[V]++,V))}}function rt(c){var x;for(x=0;x<g;x++)c.dyn_ltree[2*x]=0;for(x=0;x<a;x++)c.dyn_dtree[2*x]=0;for(x=0;x<p;x++)c.bl_tree[2*x]=0;c.dyn_ltree[2*k]=1,c.opt_len=c.static_len=0,c.last_lit=c.matches=0}function it(c){8<c.bi_valid?q(c,c.bi_buf):0<c.bi_valid&&(c.pending_buf[c.pending++]=c.bi_buf),c.bi_buf=0,c.bi_valid=0}function ut(c,x,F,U){var C=2*x,M=2*F;return c[C]<c[M]||c[C]===c[M]&&U[x]<=U[F]}function ot(c,x,F){for(var U=c.heap[F],C=F<<1;C<=c.heap_len&&(C<c.heap_len&&ut(x,c.heap[C+1],c.heap[C],c.depth)&&C++,!ut(x,U,c.heap[C],c.depth));)c.heap[F]=c.heap[C],F=C,C<<=1;c.heap[F]=U}function ft(c,x,F){var U,C,M,X,V=0;if(c.last_lit!==0)for(;U=c.pending_buf[c.d_buf+2*V]<<8|c.pending_buf[c.d_buf+2*V+1],C=c.pending_buf[c.l_buf+V],V++,U===0?K(c,C,x):(K(c,(M=e[C])+_+1,x),(X=j[M])!==0&&Y(c,C-=D[M],X),K(c,M=E(--U),F),(X=W[M])!==0&&Y(c,U-=Z[M],X)),V<c.last_lit;);K(c,k,x)}function dt(c,x){var F,U,C,M=x.dyn_tree,X=x.stat_desc.static_tree,V=x.stat_desc.has_stree,$=x.stat_desc.elems,st=-1;for(c.heap_len=0,c.heap_max=i,F=0;F<$;F++)M[2*F]!==0?(c.heap[++c.heap_len]=st=F,c.depth[F]=0):M[2*F+1]=0;for(;c.heap_len<2;)M[2*(C=c.heap[++c.heap_len]=st<2?++st:0)]=1,c.depth[C]=0,c.opt_len--,V&&(c.static_len-=X[2*C+1]);for(x.max_code=st,F=c.heap_len>>1;1<=F;F--)ot(c,M,F);for(C=$;F=c.heap[1],c.heap[1]=c.heap[c.heap_len--],ot(c,M,1),U=c.heap[1],c.heap[--c.heap_max]=F,c.heap[--c.heap_max]=U,M[2*C]=M[2*F]+M[2*U],c.depth[C]=(c.depth[F]>=c.depth[U]?c.depth[F]:c.depth[U])+1,M[2*F+1]=M[2*U+1]=C,c.heap[1]=C++,ot(c,M,1),2<=c.heap_len;);c.heap[--c.heap_max]=c.heap[1],(function(nt,ht){var _t,pt,bt,lt,yt,zt,mt=ht.dyn_tree,Nt=ht.max_code,Zt=ht.stat_desc.static_tree,Mt=ht.stat_desc.has_stree,Ht=ht.stat_desc.extra_bits,Ot=ht.stat_desc.extra_base,vt=ht.stat_desc.max_length,wt=0;for(lt=0;lt<=d;lt++)nt.bl_count[lt]=0;for(mt[2*nt.heap[nt.heap_max]+1]=0,_t=nt.heap_max+1;_t<i;_t++)vt<(lt=mt[2*mt[2*(pt=nt.heap[_t])+1]+1]+1)&&(lt=vt,wt++),mt[2*pt+1]=lt,Nt<pt||(nt.bl_count[lt]++,yt=0,Ot<=pt&&(yt=Ht[pt-Ot]),zt=mt[2*pt],nt.opt_len+=zt*(lt+yt),Mt&&(nt.static_len+=zt*(Zt[2*pt+1]+yt)));if(wt!==0){do{for(lt=vt-1;nt.bl_count[lt]===0;)lt--;nt.bl_count[lt]--,nt.bl_count[lt+1]+=2,nt.bl_count[vt]--,wt-=2}while(0<wt);for(lt=vt;lt!==0;lt--)for(pt=nt.bl_count[lt];pt!==0;)Nt<(bt=nt.heap[--_t])||(mt[2*bt+1]!==lt&&(nt.opt_len+=(lt-mt[2*bt+1])*mt[2*bt],mt[2*bt+1]=lt),pt--)}})(c,x),ct(M,st,c.bl_count)}function t(c,x,F){var U,C,M=-1,X=x[1],V=0,$=7,st=4;for(X===0&&($=138,st=3),x[2*(F+1)+1]=65535,U=0;U<=F;U++)C=X,X=x[2*(U+1)+1],++V<$&&C===X||(V<st?c.bl_tree[2*C]+=V:C!==0?(C!==M&&c.bl_tree[2*C]++,c.bl_tree[2*z]++):V<=10?c.bl_tree[2*S]++:c.bl_tree[2*P]++,M=C,st=(V=0)===X?($=138,3):C===X?($=6,3):($=7,4))}function R(c,x,F){var U,C,M=-1,X=x[1],V=0,$=7,st=4;for(X===0&&($=138,st=3),U=0;U<=F;U++)if(C=X,X=x[2*(U+1)+1],!(++V<$&&C===X)){if(V<st)for(;K(c,C,c.bl_tree),--V!=0;);else C!==0?(C!==M&&(K(c,C,c.bl_tree),V--),K(c,z,c.bl_tree),Y(c,V-3,2)):V<=10?(K(c,S,c.bl_tree),Y(c,V-3,3)):(K(c,P,c.bl_tree),Y(c,V-11,7));M=C,st=(V=0)===X?($=138,3):C===X?($=6,3):($=7,4)}}u(Z);var N=!1;function f(c,x,F,U){Y(c,(b<<1)+(U?1:0),3),(function(C,M,X,V){it(C),q(C,X),q(C,~X),s.arraySet(C.pending_buf,C.window,M,X,C.pending),C.pending+=X})(c,x,F)}h._tr_init=function(c){N||((function(){var x,F,U,C,M,X=new Array(d+1);for(C=U=0;C<v-1;C++)for(D[C]=U,x=0;x<1<<j[C];x++)e[U++]=C;for(e[U-1]=C,C=M=0;C<16;C++)for(Z[C]=M,x=0;x<1<<W[C];x++)B[M++]=C;for(M>>=7;C<a;C++)for(Z[C]=M<<7,x=0;x<1<<W[C]-7;x++)B[256+M++]=C;for(F=0;F<=d;F++)X[F]=0;for(x=0;x<=143;)J[2*x+1]=8,x++,X[8]++;for(;x<=255;)J[2*x+1]=9,x++,X[9]++;for(;x<=279;)J[2*x+1]=7,x++,X[7]++;for(;x<=287;)J[2*x+1]=8,x++,X[8]++;for(ct(J,g+1,X),x=0;x<a;x++)y[2*x+1]=5,y[2*x]=at(x,5);tt=new Q(J,j,_+1,g,d),L=new Q(y,W,0,a,d),et=new Q(new Array(0),O,0,p,m)})(),N=!0),c.l_desc=new I(c.dyn_ltree,tt),c.d_desc=new I(c.dyn_dtree,L),c.bl_desc=new I(c.bl_tree,et),c.bi_buf=0,c.bi_valid=0,rt(c)},h._tr_stored_block=f,h._tr_flush_block=function(c,x,F,U){var C,M,X=0;0<c.level?(c.strm.data_type===2&&(c.strm.data_type=(function(V){var $,st=4093624447;for($=0;$<=31;$++,st>>>=1)if(1&st&&V.dyn_ltree[2*$]!==0)return r;if(V.dyn_ltree[18]!==0||V.dyn_ltree[20]!==0||V.dyn_ltree[26]!==0)return n;for($=32;$<_;$++)if(V.dyn_ltree[2*$]!==0)return n;return r})(c)),dt(c,c.l_desc),dt(c,c.d_desc),X=(function(V){var $;for(t(V,V.dyn_ltree,V.l_desc.max_code),t(V,V.dyn_dtree,V.d_desc.max_code),dt(V,V.bl_desc),$=p-1;3<=$&&V.bl_tree[2*G[$]+1]===0;$--);return V.opt_len+=3*($+1)+5+5+4,$})(c),C=c.opt_len+3+7>>>3,(M=c.static_len+3+7>>>3)<=C&&(C=M)):C=M=F+5,F+4<=C&&x!==-1?f(c,x,F,U):c.strategy===4||M===C?(Y(c,2+(U?1:0),3),ft(c,J,y)):(Y(c,4+(U?1:0),3),(function(V,$,st,nt){var ht;for(Y(V,$-257,5),Y(V,st-1,5),Y(V,nt-4,4),ht=0;ht<nt;ht++)Y(V,V.bl_tree[2*G[ht]+1],3);R(V,V.dyn_ltree,$-1),R(V,V.dyn_dtree,st-1)})(c,c.l_desc.max_code+1,c.d_desc.max_code+1,X+1),ft(c,c.dyn_ltree,c.dyn_dtree)),rt(c),U&&it(c)},h._tr_tally=function(c,x,F){return c.pending_buf[c.d_buf+2*c.last_lit]=x>>>8&255,c.pending_buf[c.d_buf+2*c.last_lit+1]=255&x,c.pending_buf[c.l_buf+c.last_lit]=255&F,c.last_lit++,x===0?c.dyn_ltree[2*F]++:(c.matches++,x--,c.dyn_ltree[2*(e[F]+_+1)]++,c.dyn_dtree[2*E(x)]++),c.last_lit===c.lit_bufsize-1},h._tr_align=function(c){Y(c,2,3),K(c,k,J),(function(x){x.bi_valid===16?(q(x,x.bi_buf),x.bi_buf=0,x.bi_valid=0):8<=x.bi_valid&&(x.pending_buf[x.pending++]=255&x.bi_buf,x.bi_buf>>=8,x.bi_valid-=8)})(c)}},{"../utils/common":41}],53:[function(o,w,h){w.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(o,w,h){(function(s){(function(r,n){if(!r.setImmediate){var u,b,v,_,g=1,a={},p=!1,i=r.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(r);d=d&&d.setTimeout?d:r,u={}.toString.call(r.process)==="[object process]"?function(z){process.nextTick(function(){m(z)})}:(function(){if(r.postMessage&&!r.importScripts){var z=!0,S=r.onmessage;return r.onmessage=function(){z=!1},r.postMessage("","*"),r.onmessage=S,z}})()?(_="setImmediate$"+Math.random()+"$",r.addEventListener?r.addEventListener("message",k,!1):r.attachEvent("onmessage",k),function(z){r.postMessage(_+z,"*")}):r.MessageChannel?((v=new MessageChannel).port1.onmessage=function(z){m(z.data)},function(z){v.port2.postMessage(z)}):i&&"onreadystatechange"in i.createElement("script")?(b=i.documentElement,function(z){var S=i.createElement("script");S.onreadystatechange=function(){m(z),S.onreadystatechange=null,b.removeChild(S),S=null},b.appendChild(S)}):function(z){setTimeout(m,0,z)},d.setImmediate=function(z){typeof z!="function"&&(z=new Function(""+z));for(var S=new Array(arguments.length-1),P=0;P<S.length;P++)S[P]=arguments[P+1];var j={callback:z,args:S};return a[g]=j,u(g),g++},d.clearImmediate=l}function l(z){delete a[z]}function m(z){if(p)setTimeout(m,0,z);else{var S=a[z];if(S){p=!0;try{(function(P){var j=P.callback,W=P.args;switch(W.length){case 0:j();break;case 1:j(W[0]);break;case 2:j(W[0],W[1]);break;case 3:j(W[0],W[1],W[2]);break;default:j.apply(n,W)}})(S)}finally{l(z),p=!1}}}}function k(z){z.source===r&&typeof z.data=="string"&&z.data.indexOf(_)===0&&m(+z.data.slice(_.length))}})(typeof self>"u"?s===void 0?this:s:self)}).call(this,typeof kt<"u"?kt:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(At)),At.exports}var ge=me();const _e=Gt(ge);async function be(A){let T;try{T=await _e.loadAsync(A)}catch(s){return{format:"obsidian-zip",notes:[],errors:[{sourcePath:A.name,reason:`Could not read zip: ${s instanceof Error?s.message:String(s)}`}],tags:[]}}const o=[],w=[],h=[];T.forEach((s,r)=>{h.push({path:s,obj:r})}),h.sort((s,r)=>s.path.localeCompare(r.path));for(const{path:s,obj:r}of h)if(!r.dir&&!Lt(s)&&Wt(s))try{const n=await r.async("string"),u=ye(s,h),b=Ft({sourcePath:u,raw:n});o.push(b)}catch(n){w.push({sourcePath:s,reason:n instanceof Error?n.message:String(n)})}return{format:"obsidian-zip",notes:o,errors:w,tags:we(o)}}const ve=new Set([".obsidian",".trash",".git",".parachute","__MACOSX","node_modules"]);function Lt(A){return A.split("/").some(o=>ve.has(o)||o.startsWith("."))}function Wt(A){const T=A.toLowerCase();return T.endsWith(".md")||T.endsWith(".markdown")}function ye(A,T){const o=A.split("/")[0];if(!o)return A;let w=o;for(const h of T){if(Lt(h.path)||!Wt(h.path))continue;if(h.path.split("/")[0]!==w){w=null;break}}return w&&A.startsWith(`${w}/`)?A.slice(w.length+1):A}function we(A){const T=new Set;for(const o of A)for(const w of o.tags)T.add(w);return[...T].sort()}const ke=5,xe=500;async function Se(A){const{client:T,notes:o,onProgress:w,signal:h}=A,s=Math.max(1,A.concurrency??ke),r=[];let n=0,u=0,b=!1;const v=o.map(Ie);async function _(){for(;;){if(h!=null&&h.aborted||b)return;const d=n++;if(d>=o.length)return;const l=o[d],m=v[d],k=await ze(T,l,m,h);r[d]=k,u++,k.status==="errored"&&k.reason.startsWith("auth:")&&(b=!0),w==null||w({done:u,total:o.length})}}const g=Array.from({length:Math.min(s,o.length)},()=>_());await Promise.all(g);for(let d=0;d<o.length;d++)r[d]||(r[d]={status:"errored",sourcePath:o[d].sourcePath,reason:b?"Skipped — vault session ended before this note was reached.":"Skipped — import was cancelled."});let a=0,p=0,i=0;for(const d of r)d.status==="created"?a++:d.status==="skipped"?p++:i++;return{created:a,skipped:p,errored:i,outcomes:r}}async function ze(A,T,o,w){try{const h=await Ce(A,o,w);return{status:"created",sourcePath:T.sourcePath,noteId:h.id}}catch(h){return h instanceof Vt||h instanceof Kt?{status:"skipped",sourcePath:T.sourcePath,reason:h.message||"Already exists in vault"}:h instanceof Yt?{status:"errored",sourcePath:T.sourcePath,reason:`auth: ${h.message}`}:h instanceof Tt?{status:"errored",sourcePath:T.sourcePath,reason:`vault unreachable (${h.status}): ${h.message}`}:{status:"errored",sourcePath:T.sourcePath,reason:h instanceof Error?h.message:String(h)}}}async function Ce(A,T,o){const w={};o&&(w.signal=o);try{return await A.createNote(T,w)}catch(h){if(!Ae(h)||o!=null&&o.aborted)throw h;return await Ee(xe,o),await A.createNote(T,w)}}function Ae(A){return A instanceof Tt}function Ee(A,T){return new Promise(o=>{const w=setTimeout(()=>{T==null||T.removeEventListener("abort",h),o()},A),h=()=>{clearTimeout(w),o()};T&&T.addEventListener("abort",h,{once:!0})})}function Ie(A){const T={content:A.content};A.path&&(T.path=A.path),A.tags.length>0&&(T.tags=A.tags),Object.keys(A.metadata).length>0&&(T.metadata=A.metadata);const o=T;return A.id&&(o.id=A.id),A.createdAt&&(o.created_at=A.createdAt),T}function Pe(){const A=Xt(g=>g.getActiveVault()),T=$t(),o=qt(),w=Jt(g=>g.push),[h,s]=gt.useState({kind:"pick"}),r=gt.useRef(null),n=gt.useRef(null);if(!A)return H.jsx(Qt,{to:"/",replace:!0});const u=gt.useCallback(async g=>{if(g.length===0)return;s({kind:"parsing"});const a=re(g);try{let p;if(a==="obsidian-zip"){const i=g.find(Dt);if(!i){w("No zip file found in selection","error"),s({kind:"pick"});return}p=await be(i)}else a==="loose-markdown"?p=await fe(g.filter(Et)):p={format:a,notes:[],errors:g.map(i=>({sourcePath:i.name,reason:"Unrecognized format (expected .zip, .md, or .markdown)."})),tags:[]};s({kind:"review",parsed:p})}catch(p){w(p instanceof Error?p.message:"Parse failed","error"),s({kind:"pick"})}},[w]),b=gt.useCallback(async()=>{if(h.kind!=="review")return;if(!T){w("Vault session unavailable — reconnect first","error");return}const g=new AbortController;n.current=g,s({kind:"importing",parsed:h.parsed,progress:{done:0,total:h.parsed.notes.length}});const a=await Se({client:T,notes:h.parsed.notes,signal:g.signal,onProgress:p=>{s(i=>i.kind==="importing"?{...i,progress:p}:i)}});n.current=null,s({kind:"done",report:a,parsed:h.parsed})},[h,T,w]),v=gt.useCallback(()=>{var g;(g=n.current)==null||g.abort()},[]),_=gt.useCallback(()=>{s({kind:"pick"}),r.current&&(r.current.value="")},[]);return H.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-7 md:px-6 md:py-10",children:[H.jsx("nav",{className:"mb-4 text-sm text-fg-dim",children:H.jsx(te,{to:"/",className:"hover:text-accent",children:"← All notes"})}),H.jsxs("header",{className:"mb-6",children:[H.jsxs("h1",{className:"font-serif text-2xl tracking-tight md:text-3xl",children:["Import notes into ",H.jsx("span",{className:"text-accent",children:A.name})]}),H.jsx("p",{className:"mt-2 text-sm text-fg-muted",children:"Upload an Obsidian vault zip or drop in loose markdown files. Everything is parsed in your browser and previewed before any note lands in the vault."})]}),h.kind==="pick"||h.kind==="parsing"?H.jsx(Ne,{parsing:h.kind==="parsing",onFiles:u,inputRef:r}):null,h.kind==="review"?H.jsx(Oe,{parsed:h.parsed,onConfirm:b,onBack:_}):null,h.kind==="importing"?H.jsx(je,{progress:h.progress,onCancel:v}):null,h.kind==="done"?H.jsx(Be,{report:h.report,parsed:h.parsed,onAnother:_,onHome:()=>o("/")}):null]})}function Ne({parsing:A,onFiles:T,inputRef:o}){const w=h=>{const s=Array.from(h.target.files??[]);s.length>0&&T(s)};return H.jsx("section",{children:H.jsx(ee,{onDropFiles:T,className:"rounded-md border border-border bg-card",hint:"zip or markdown",children:H.jsxs("div",{className:"flex min-h-[40vh] flex-col items-center justify-center gap-4 p-8 text-center",children:[H.jsx("p",{className:"font-serif text-lg",children:A?"Reading files…":"Drop a file here"}),H.jsx("p",{className:"text-sm text-fg-dim",children:"Accepts an Obsidian vault `.zip`, or one or more `.md` / `.markdown` files."}),H.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-3",children:[H.jsxs("label",{className:"inline-flex min-h-11 cursor-pointer items-center rounded-md bg-accent px-4 py-1.5 text-sm font-medium text-white hover:bg-accent-hover",children:[A?"Reading…":"Choose files",H.jsx("input",{ref:o,type:"file",className:"sr-only",accept:".zip,.md,.markdown",multiple:!0,disabled:A,onChange:w})]}),H.jsx("span",{className:"text-xs text-fg-dim",children:"— or drag and drop above"})]}),H.jsxs("details",{className:"mt-2 text-left text-xs text-fg-dim",children:[H.jsx("summary",{className:"cursor-pointer text-fg-muted hover:text-accent",children:"What about other tools?"}),H.jsxs("p",{className:"mt-2 max-w-md",children:["Notion CSV/JSON, Roam, Logseq, and Apple Notes exports are on the roadmap. For now, the CLI path"," ",H.jsx("code",{className:"rounded bg-bg/60 px-1 font-mono",children:"parachute-vault import <path>"})," ","handles broader formats — or paste the contents into Claude and ask it to add the notes via MCP."]})]})]})})})}function Oe({parsed:A,onConfirm:T,onBack:o}){const{notes:w,errors:h,tags:s}=A,r=w.length,n=r>0,u=gt.useMemo(()=>w.slice(0,8),[w]),b=gt.useMemo(()=>s.slice(0,12),[s]);return H.jsxs("section",{className:"space-y-6",children:[H.jsxs("div",{className:"rounded-md border border-border bg-card p-4",children:[H.jsx("h2",{className:"font-serif text-lg",children:"Dry run"}),H.jsxs("p",{className:"mt-1 text-sm text-fg-muted",children:["Detected format: ",H.jsx(Re,{format:A.format}),"."," ",H.jsx("strong",{className:"text-fg",children:r})," ",r===1?"note":"notes"," will be created."," ",h.length>0?H.jsxs("span",{className:"text-fg-dim",children:[h.length," file(s) couldn't be parsed."]}):null]}),s.length>0?H.jsxs("p",{className:"mt-2 text-sm text-fg-muted",children:[H.jsx("span",{className:"text-xs uppercase tracking-wider text-fg-dim",children:"Tags found"})," ",b.map(v=>H.jsxs("span",{className:"ml-1 inline-block rounded bg-bg/60 px-1.5 py-0.5 font-mono text-xs text-fg",children:["#",v]},v)),s.length>b.length?H.jsxs("span",{className:"ml-2 text-fg-dim",children:["+",s.length-b.length," more"]}):null]}):null]}),u.length>0?H.jsxs("div",{className:"rounded-md border border-border bg-card p-4",children:[H.jsxs("h3",{className:"mb-2 text-xs uppercase tracking-wider text-fg-dim",children:["Preview (",u.length," of ",r,")"]}),H.jsx("ul",{className:"space-y-1.5 font-mono text-xs",children:u.map(v=>H.jsxs("li",{className:"flex items-center justify-between gap-3",children:[H.jsx("span",{className:"truncate text-fg",children:v.path||v.sourcePath}),H.jsx("span",{className:"shrink-0 text-fg-dim",children:v.tags.length>0?`${v.tags.length} tag${v.tags.length===1?"":"s"}`:""})]},v.sourcePath))})]}):null,h.length>0?H.jsxs("details",{className:"rounded-md border border-border bg-card p-4",children:[H.jsxs("summary",{className:"cursor-pointer text-sm text-fg-muted hover:text-accent",children:[h.length," file(s) skipped during parse"]}),H.jsx("ul",{className:"mt-3 space-y-1 text-xs",children:h.map(v=>H.jsxs("li",{className:"flex flex-col gap-0.5",children:[H.jsx("span",{className:"font-mono text-fg",children:v.sourcePath}),H.jsx("span",{className:"text-fg-dim",children:v.reason})]},v.sourcePath))})]}):null,H.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-3",children:[H.jsx("button",{type:"button",onClick:o,className:"min-h-11 rounded-md border border-border bg-card px-3 py-1.5 text-sm text-fg-muted hover:text-accent",children:"Choose different files"}),H.jsxs("button",{type:"button",onClick:T,disabled:!n,className:"min-h-11 rounded-md bg-accent px-4 py-1.5 text-sm font-medium text-white hover:bg-accent-hover disabled:opacity-40",children:["Run import (",r," ",r===1?"note":"notes",")"]})]})]})}function je({progress:A,onCancel:T}){const o=A.total===0?0:Math.round(A.done/A.total*100);return H.jsxs("section",{className:"space-y-4 rounded-md border border-border bg-card p-6",children:[H.jsx("h2",{className:"font-serif text-lg",children:"Importing…"}),H.jsxs("p",{className:"text-sm text-fg-muted",children:[A.done," / ",A.total," notes processed."]}),H.jsx("div",{className:"h-2 w-full overflow-hidden rounded bg-bg/60",role:"progressbar",tabIndex:0,"aria-label":"Import progress","aria-valuenow":A.done,"aria-valuemin":0,"aria-valuemax":A.total,children:H.jsx("div",{className:"h-full bg-accent transition-all",style:{width:`${o}%`}})}),H.jsx("div",{className:"flex justify-end",children:H.jsx("button",{type:"button",onClick:T,className:"min-h-11 rounded-md border border-border bg-card px-3 py-1.5 text-sm text-fg-muted hover:text-accent",children:"Cancel"})})]})}function Be({report:A,parsed:T,onAnother:o,onHome:w}){const h=A.outcomes.filter(r=>r.status==="errored"),s=A.outcomes.filter(r=>r.status==="skipped");return H.jsxs("section",{className:"space-y-6",children:[H.jsxs("div",{className:"rounded-md border border-border bg-card p-4",children:[H.jsx("h2",{className:"font-serif text-lg",children:"Import complete"}),H.jsxs("ul",{className:"mt-3 space-y-1 text-sm",children:[H.jsxs("li",{children:[H.jsx("span",{className:"text-accent",children:A.created})," created"]}),H.jsxs("li",{children:[H.jsx("span",{className:"text-fg-muted",children:A.skipped})," skipped (already in vault)"]}),H.jsxs("li",{children:[H.jsx("span",{className:A.errored>0?"text-red-400":"text-fg-muted",children:A.errored})," ","errored"]})]}),T.errors.length>0?H.jsxs("p",{className:"mt-2 text-xs text-fg-dim",children:["(Plus ",T.errors.length," file(s) skipped at the parse stage — see above.)"]}):null]}),s.length>0?H.jsxs("details",{className:"rounded-md border border-border bg-card p-4",children:[H.jsxs("summary",{className:"cursor-pointer text-sm text-fg-muted hover:text-accent",children:[s.length," skipped — vault already had a matching note"]}),H.jsx("ul",{className:"mt-3 space-y-1 text-xs",children:s.map(r=>H.jsxs("li",{className:"flex flex-col gap-0.5",children:[H.jsx("span",{className:"font-mono text-fg",children:r.sourcePath}),H.jsx("span",{className:"text-fg-dim",children:r.status==="skipped"?r.reason:""})]},`s-${r.sourcePath}`))})]}):null,h.length>0?H.jsxs("details",{className:"rounded-md border border-red-500/30 bg-red-500/5 p-4",open:!0,children:[H.jsxs("summary",{className:"cursor-pointer text-sm font-medium text-red-400",children:[h.length," errored"]}),H.jsx("ul",{className:"mt-3 space-y-1 text-xs",children:h.map(r=>H.jsxs("li",{className:"flex flex-col gap-0.5",children:[H.jsx("span",{className:"font-mono text-fg",children:r.sourcePath}),H.jsx("span",{className:"text-fg-dim",children:r.status==="errored"?r.reason:""})]},`e-${r.sourcePath}`))})]}):null,H.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-3",children:[H.jsx("button",{type:"button",onClick:o,className:"min-h-11 rounded-md border border-border bg-card px-3 py-1.5 text-sm text-fg-muted hover:text-accent",children:"Run another import"}),H.jsx("button",{type:"button",onClick:w,className:"min-h-11 rounded-md bg-accent px-4 py-1.5 text-sm font-medium text-white hover:bg-accent-hover",children:"Back to vault"})]})]})}function Re({format:A}){const T=A==="obsidian-zip"?"Obsidian vault (zip)":A==="loose-markdown"?"loose markdown":"unknown";return H.jsx("span",{className:"rounded bg-bg/60 px-1.5 py-0.5 font-mono text-xs text-fg",children:T})}export{Pe as Import};
@@ -1 +0,0 @@
1
- import{z as d,t as e,ab as D,M as V,V as C,g as _,$ as z,af as O,X as W,N as K,L as R,W as Y,ac as q,f as H,B as P,e as X,w as Z}from"./index-953EjlvE.js";import{A as G}from"./AttachmentDropZone-CqhzolLE.js";import{u as J,C as Q,A as ee,a as te}from"./useAttachmentUploader-BQ3_bJ9p.js";import{P as se,D as ne}from"./PinArchiveButtons-DAjOG3J2.js";import{b as re,N as ae}from"./NoteRenderer-uc1hZU0j.js";const oe=250;function de({noteId:t,attachment:n}){const[l,a]=d.useState(!1),o=ce(n);return e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:()=>a(!0),"aria-label":`Remove attachment ${o}`,className:"shrink-0 rounded border border-transparent px-1.5 py-0.5 text-fg-dim hover:border-red-500/40 hover:text-red-400",children:"✕"}),l?e.jsx(ie,{noteId:t,attachment:n,label:o,onClose:()=>a(!1)}):null]})}function ie({noteId:t,attachment:n,label:l,onClose:a}){const o=D(i=>i.push),m=V(),[s,h]=d.useState(!1),[w,p]=d.useState(null),N=d.useRef(null);d.useEffect(()=>{const i=setTimeout(()=>h(!0),oe);return()=>clearTimeout(i)},[]),d.useEffect(()=>{var i;(i=N.current)==null||i.focus()},[]),d.useEffect(()=>{const i=g=>{g.key==="Escape"&&a()};return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[a]);const b=d.useCallback(()=>{!s||m.isPending||(p(null),m.mutate({noteId:t,attachmentId:n.id},{onSuccess:()=>{o(`Removed ${l}`,"success"),a()},onError:i=>{if(i instanceof C){p("Session expired. Reconnect to remove attachments.");return}if(i instanceof _){o(`Already removed ${l}`,"info"),a();return}p(i instanceof Error?i.message:"Remove failed")}}))},[s,n.id,l,m,t,a,o]);return e.jsx("dialog",{open:!0,"aria-labelledby":"confirm-remove-attachment-title",className:"fixed inset-0 z-40 m-0 flex h-full max-h-full w-full max-w-full items-center justify-center bg-black/60 p-4",onMouseDown:i=>{i.target===i.currentTarget&&a()},children:e.jsxs("div",{className:"w-full max-w-md rounded-md border border-border bg-card p-6 shadow-xl",children:[e.jsx("h2",{id:"confirm-remove-attachment-title",className:"mb-2 font-serif text-lg text-red-400",children:"Remove attachment?"}),e.jsxs("p",{className:"mb-3 text-sm text-fg-muted",children:[e.jsx("span",{className:"rounded bg-bg/60 px-1 py-0.5 font-mono text-xs text-fg",children:l})," ","will be detached from this note. If no other note references the file, it will also be deleted from storage. Markdown referencing it will show a broken link until you update it."]}),w?e.jsx("p",{role:"alert",className:"mb-3 text-sm text-red-400",children:w}):null,e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx("button",{ref:N,type:"button",onClick:a,className:"min-h-11 rounded-md border border-border bg-card px-3 py-1.5 text-sm text-fg-muted hover:text-fg",children:"Cancel"}),e.jsx("button",{type:"button",onClick:b,disabled:!s||m.isPending,className:"min-h-11 rounded-md bg-red-500 px-4 py-1.5 text-sm font-medium text-white hover:bg-red-600 disabled:opacity-40",children:m.isPending?"Removing…":"Remove"})]})]})})}function ce(t){if(t.filename)return t.filename;if(t.path){const n=t.path.split("/").pop();return n||t.path}return t.id}function ye(){const{id:t}=z(),n=t?decodeURIComponent(t):void 0,l=O(o=>o.getActiveVault()),a=W(n);return l?e.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-5 md:px-6 md:py-8",children:[e.jsx("nav",{className:"mb-4 text-sm text-fg-dim",children:e.jsx(R,{to:n?`/n/${encodeURIComponent(n)}`:"/",className:"hover:text-accent",children:"← Back to note"})}),a.isPending?e.jsx(xe,{}):a.isError?e.jsx(fe,{error:a.error}):a.data?e.jsx(le,{note:a.data}):e.jsx(he,{id:n??""})]}):e.jsx(K,{to:"/",replace:!0})}function S(t){return{content:t.content??"",path:t.path??"",tags:[...t.tags??[]]}}function le({note:t}){const n=Y(),l=D(r=>r.push),a=d.useMemo(()=>re(t),[t]),[o,m]=d.useState(()=>S(t)),[s,h]=d.useState(()=>S(t)),[w,p]=d.useState(""),[N,b]=d.useState(null),[i,g]=d.useState(null),[y,L]=d.useState("edit"),v=q(t.id),k=d.useRef(t),E=d.useRef(null),j=J({noteId:t.id,onInsert:r=>{E.current?E.current.insertAtCursor(r):h(c=>({...c,content:`${c.content}${r}`}))},onLinked:()=>{l("Attachment added","success")},onError:r=>l(r,"error")});d.useEffect(()=>{k.current=t},[t]);const u=s.content!==o.content||s.path!==o.path||!pe(s.tags,o.tags),A=d.useCallback(()=>{if(!u||v.isPending)return;const r={};s.content!==o.content&&(r.content=s.content),s.path!==o.path&&(r.path=s.path);const c=be(o.tags,s.tags);(c.add.length||c.remove.length)&&(r.tags=c);const f=k.current.updatedAt??k.current.createdAt;f&&(r.if_updated_at=f),g(null),b(null),v.mutate(r,{onSuccess:x=>{m(S(x)),h(S(x)),k.current=x,x.id!==t.id&&n(`/n/${encodeURIComponent(x.id)}/edit`,{replace:!0})},onError:x=>{x instanceof H?b(x):x instanceof C?g("Session expired. Reconnect to save."):g(x instanceof Error?x.message:"Save failed")}})},[o,s,u,v,n,t.id]),$=d.useCallback(()=>{u&&confirm("Discard all edits and revert to last saved version?")&&(h(o),b(null),g(null))},[o,u]),T=d.useCallback(()=>{u&&!confirm("Discard unsaved changes?")||n(`/n/${encodeURIComponent(t.id)}`)},[u,n,t.id]);d.useEffect(()=>{if(!u)return;const r=c=>{c.preventDefault(),c.returnValue=""};return window.addEventListener("beforeunload",r),()=>window.removeEventListener("beforeunload",r)},[u]);const B=s.path!==o.path,M=r=>{const c=Z(r);c&&(s.tags.includes(c)||(h(f=>({...f,tags:[...f.tags,c]})),p("")))},U=r=>{h(c=>({...c,tags:c.tags.filter(f=>f!==r)}))},F=s.content;return e.jsxs("article",{children:[e.jsxs("header",{className:"mb-4 border-b border-border pb-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx("span",{className:"text-xs uppercase tracking-wider text-fg-dim",children:"Editing"}),u?e.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-accent","aria-label":"unsaved changes",children:[e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-accent"}),"unsaved"]}):e.jsxs("span",{className:"text-xs text-fg-dim",children:["saved ",P(t.updatedAt)]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(se,{note:t}),e.jsx(ne,{note:t}),e.jsx("span",{className:"mx-1 h-5 w-px bg-border","aria-hidden":"true"}),e.jsx("button",{type:"button",onClick:$,disabled:!u||v.isPending,className:"min-h-11 rounded-md border border-border bg-card px-3 py-1.5 text-sm text-fg-muted hover:text-accent disabled:opacity-40",children:"Revert"}),e.jsx("button",{type:"button",onClick:T,className:"min-h-11 rounded-md border border-border bg-card px-3 py-1.5 text-sm text-fg-muted hover:text-accent",children:"Cancel"}),e.jsx("button",{type:"button",onClick:A,disabled:!u||v.isPending,className:"min-h-11 rounded-md bg-accent px-4 py-1.5 text-sm font-medium text-white hover:bg-accent-hover disabled:opacity-40",title:"Save (⌘S)",children:v.isPending?"Saving…":"Save"})]})]}),e.jsxs("div",{className:"mt-3 flex flex-col gap-2",children:[e.jsx(X,{tags:s.tags,input:w,onInputChange:p,onAdd:M,onRemove:U}),e.jsxs("label",{className:"flex items-baseline gap-3 text-sm",children:[e.jsx("span",{className:"shrink-0 text-xs uppercase tracking-wider text-fg-dim",children:"Title"}),e.jsx("input",{type:"text",value:s.path,onChange:r=>h(c=>({...c,path:r.target.value})),className:"flex-1 rounded-md border border-border bg-card px-2.5 py-1 font-mono text-sm text-fg focus:border-accent focus:outline-none","aria-label":"Note path",placeholder:"(no path)"})]}),B?e.jsx("p",{className:"text-xs text-accent",children:"Renaming moves the note — its id may change."}):null]})]}),N?e.jsx(ue,{conflict:N,onReload:()=>{window.location.reload()},onDismiss:()=>b(null)}):null,i?e.jsx("div",{className:"mb-4 rounded-md border border-red-500/30 bg-red-500/5 p-3 text-sm text-red-400",children:i}):null,e.jsx("div",{role:"tablist","aria-label":"Editor view",className:"mb-3 inline-flex rounded-md border border-border bg-card p-0.5 text-sm lg:hidden",children:["edit","preview"].map(r=>e.jsx("button",{type:"button",role:"tab","aria-selected":y===r,onClick:()=>L(r),className:`rounded px-3 py-1.5 capitalize ${y===r?"bg-accent text-white":"text-fg-muted hover:text-accent"}`,children:r},r))}),e.jsxs("div",{className:"grid min-h-[60vh] gap-4 lg:grid-cols-2",children:[e.jsx(G,{onDropFiles:j.start,className:`min-w-0 rounded-md border border-border bg-card ${y==="edit"?"":"hidden lg:block"}`,hint:I,children:e.jsx(Q,{ref:E,value:s.content,onChange:r=>h(c=>({...c,content:r})),onSave:A,onCancel:T,onPasteFile:r=>(j.start(r),!0)})}),e.jsx("div",{className:`min-w-0 overflow-auto rounded-md border border-border bg-card p-4 ${y==="preview"?"":"hidden lg:block"}`,children:e.jsx(ae,{note:{path:s.path,content:F},resolve:a})})]}),e.jsx(me,{noteId:t.id,attachments:t.attachments??[],uploads:j.uploads,onPickFiles:j.start,onCancel:j.cancel,onDismiss:j.dismiss})]})}const I=e.jsxs(e.Fragment,{children:["Images, audio, webm video."," ",e.jsx("a",{href:"https://github.com/ParachuteComputer/parachute-vault/issues/127",target:"_blank",rel:"noreferrer",className:"underline",children:"PDF + mp4 coming"})]});function me({noteId:t,attachments:n,uploads:l,onPickFiles:a,onCancel:o,onDismiss:m}){return e.jsxs("section",{className:"mt-6 border-t border-border pt-4",children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[e.jsx("h2",{className:"font-serif text-lg",children:"Attachments"}),e.jsx(ee,{onPickFiles:a})]}),e.jsxs("p",{className:"mb-3 text-xs text-fg-dim",children:["Drop or paste files into the editor. Max 100 MB each. ",I,"."]}),e.jsx(te,{uploads:l,onCancel:o,onDismiss:m}),n.length>0?e.jsx("ul",{className:"mt-3 space-y-1 text-sm",children:n.map(s=>e.jsxs("li",{className:"flex items-center justify-between gap-2 rounded border border-border bg-card/50 px-3 py-1.5 font-mono text-xs",children:[e.jsx("span",{className:"truncate",title:s.path??s.id,children:s.filename??s.path??s.id}),e.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[s.mimeType?e.jsx("span",{className:"text-fg-dim",children:s.mimeType}):null,e.jsx(de,{noteId:t,attachment:s})]})]},s.id))}):null]})}function ue({conflict:t,onReload:n,onDismiss:l}){return e.jsxs("div",{className:"mb-4 rounded-md border border-amber-500/40 bg-amber-500/10 p-4",children:[e.jsx("p",{className:"mb-1 font-medium text-amber-500",children:"This note was edited elsewhere."}),e.jsxs("p",{className:"mb-3 text-sm text-fg-muted",children:["Your save was rejected to avoid overwriting the other edit.",t.currentUpdatedAt?` Latest update ${P(t.currentUpdatedAt)}.`:""]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx("button",{type:"button",onClick:n,className:"rounded-md bg-accent px-3 py-1.5 text-sm font-medium text-white hover:bg-accent-hover",children:"Reload latest (discard my edits)"}),e.jsx("button",{type:"button",onClick:l,className:"rounded-md border border-border px-3 py-1.5 text-sm text-fg-muted hover:text-fg",children:"Keep editing"})]})]})}function xe(){return e.jsxs("div",{className:"grid min-h-[60vh] gap-4 lg:grid-cols-2","aria-busy":"true",children:[e.jsx("div",{className:"animate-pulse rounded-md border border-border bg-card"}),e.jsx("div",{className:"animate-pulse rounded-md border border-border bg-card"})]})}function he({id:t}){return e.jsxs("div",{className:"rounded-md border border-border bg-card p-10 text-center",children:[e.jsx("p",{className:"mb-2 font-serif text-xl",children:"Note not found"}),e.jsxs("p",{className:"mb-4 text-sm text-fg-muted",children:["No note with id ",e.jsx("span",{className:"font-mono",children:t})," in this vault."]}),e.jsx(R,{to:"/",className:"text-sm text-accent hover:underline",children:"Back to all notes"})]})}function fe({error:t}){const n=t instanceof C;return e.jsxs("div",{className:"rounded-md border border-red-500/30 bg-red-500/5 p-6",children:[e.jsx("p",{className:"mb-2 font-medium text-red-400",children:n?"Session expired":"Could not load note"}),e.jsx("p",{className:"mb-4 text-sm text-fg-muted",children:t.message}),n?e.jsx(R,{to:"/add",className:"inline-block rounded-md bg-accent px-4 py-2 text-sm font-medium text-white hover:bg-accent-hover",children:"Reconnect vault"}):null]})}function pe(t,n){if(t.length!==n.length)return!1;const l=new Set(t);for(const a of n)if(!l.has(a))return!1;return!0}function be(t,n){const l=new Set(t),a=new Set(n),o=n.filter(s=>!l.has(s)),m=t.filter(s=>!a.has(s));return{add:o,remove:m}}export{ye as NoteEditor};
@@ -1,9 +0,0 @@
1
- import{w as Y,z as d,af as ee,W as te,ab as re,K as ne,Q as se,a6 as ae,a8 as oe,G as ie,t as r,N as ce,V as de,u as le,v as ue,p as me,o as U,l as pe,L as fe,e as ge}from"./index-953EjlvE.js";import{A as he}from"./AttachmentDropZone-CqhzolLE.js";import{u as xe,C as be,A as ve,a as we}from"./useAttachmentUploader-BQ3_bJ9p.js";import{b as ye,N as ke}from"./NoteRenderer-uc1hZU0j.js";const je=/(?:^|\s)#([a-zA-Z][\w-]*)/g;function H(e){const t=new Set;for(const i of e.matchAll(je)){const o=Y(i[1]??"");o&&t.add(o)}return[...t]}const Ne=["audio/webm;codecs=opus","audio/mp4","audio/ogg;codecs=opus"];function Re(e=Ne){if(typeof MediaRecorder>"u")return null;for(const t of e)if(MediaRecorder.isTypeSupported(t))return t;return null}function Se(e){return e.startsWith("audio/webm")?"webm":e.startsWith("audio/mp4")?"m4a":e.startsWith("audio/ogg")?"ogg":e.startsWith("audio/wav")?"wav":"bin"}function Ae(e){const t=e.now??(()=>Date.now()),i=e.MediaRecorderCtor??MediaRecorder,o=new i(e.stream,{mimeType:e.mimeType}),c=[];let n="idle",m=0,p=0;o.ondataavailable=g=>{g.data&&g.data.size>0&&c.push(g.data)};const f=()=>{for(const g of e.stream.getTracks())g.stop()};return{get state(){return n},get mimeType(){return e.mimeType},start(){if(n!=="idle")throw new Error(`Cannot start from ${n}`);o.start(),m=t(),n="recording"},pause(){n==="recording"&&(o.pause(),p+=t()-m,n="paused")},resume(){n==="paused"&&(o.resume(),m=t(),n="recording")},async stop(){if(n==="idle"||n==="stopped")throw new Error(`Cannot stop from ${n}`);n==="recording"&&(p+=t()-m);const g=new Promise(u=>{o.onstop=async()=>{const s=await Te(c);u({data:s,mimeType:e.mimeType,durationMs:p})}});return o.stop(),n="stopped",f(),g},cancel(){if(n==="recording"||n==="paused")try{o.stop()}catch{}n="stopped",c.length=0,f()}}}async function Ee(e){const t=e;return typeof t.arrayBuffer=="function"?t.arrayBuffer():new Promise((i,o)=>{const c=new FileReader;c.onload=()=>i(c.result),c.onerror=()=>o(c.error??new Error("FileReader error")),c.readAsArrayBuffer(e)})}async function Te(e){if(e.length===0)return new ArrayBuffer(0);const t=await Promise.all(e.map(n=>Ee(n))),i=t.reduce((n,m)=>n+m.byteLength,0),o=new Uint8Array(i);let c=0;for(const n of t)o.set(new Uint8Array(n),c),c+=n.byteLength;return o.buffer}async function Ce(){var e;if(typeof navigator>"u"||!((e=navigator.mediaDevices)!=null&&e.getUserMedia)){const t=new Error("Microphone is not available in this browser.");throw t.kind="unavailable",t}try{return await navigator.mediaDevices.getUserMedia({audio:!0})}catch(t){const i=new Error(t instanceof Error?t.message:"Microphone permission denied."),o=t instanceof DOMException?t.name:"";throw i.kind=o==="NotFoundError"||o==="OverconstrainedError"?"no-device":"permission-denied",i}}function Me(e,t=new Date){return`memo-${t.toISOString().replace(/[:.]/g,"-").replace(/Z$/,"")}.${Se(e)}`}function De(e=new Date){const t=e.getFullYear(),i=String(e.getMonth()+1).padStart(2,"0"),o=String(e.getDate()).padStart(2,"0"),c=String(e.getHours()).padStart(2,"0"),n=String(e.getMinutes()).padStart(2,"0"),m=String(e.getSeconds()).padStart(2,"0");return`Notes/${t}/${i}-${o}/${c}-${n}-${m}`}function $e(){const[e,t]=d.useState({kind:"idle"}),[i,o]=d.useState(0),c=d.useRef(null),n=d.useRef(null);d.useEffect(()=>{if(e.kind!=="recording")return;const u=setInterval(()=>o(Date.now()-e.startedAt),250);return()=>clearInterval(u)},[e]),d.useEffect(()=>()=>{n.current&&URL.revokeObjectURL(n.current)},[]);const m=d.useCallback(async()=>{if(!(e.kind==="recording"||e.kind==="requesting")){t({kind:"requesting"});try{const u=Re();if(!u){t({kind:"denied",message:"This browser can't record audio in a format we can save."});return}const s=await Ce(),x=Ae({stream:s,mimeType:u});c.current=x,x.start(),o(0),t({kind:"recording",startedAt:Date.now()})}catch(u){const s=u,x=s.kind==="permission-denied"?"Microphone access was denied. Update your browser's site settings to record.":s.kind==="no-device"?"No microphone was found on this device.":s instanceof Error?s.message:"Microphone is not available in this browser.";t({kind:"denied",message:x})}}},[e]),p=d.useCallback(async()=>{const u=c.current;if(!(!u||e.kind!=="recording"))try{const s=await u.stop();c.current=null;const x=new Blob([s.data],{type:s.mimeType}),A=URL.createObjectURL(x);n.current&&URL.revokeObjectURL(n.current),n.current=A,t({kind:"have-audio",data:s.data,mimeType:s.mimeType,url:A,durationMs:s.durationMs})}catch(s){console.warn(s instanceof Error?`Recording failed: ${s.message}`:"Recording failed."),t({kind:"idle"})}},[e]),f=d.useCallback(()=>{n.current&&(URL.revokeObjectURL(n.current),n.current=null),t({kind:"idle"}),o(0)},[]),g=d.useCallback(()=>{f()},[f]);return d.useEffect(()=>{if(e.kind!=="recording")return;const u=()=>{p()};return window.addEventListener("pointerup",u),window.addEventListener("pointercancel",u),()=>{window.removeEventListener("pointerup",u),window.removeEventListener("pointercancel",u)}},[e,p]),{phase:e,elapsedMs:i,startRecording:m,stopRecording:p,discardAudio:f,reset:g}}const Ie={content:"",path:"",tags:[]};function qe(){const e=ee(a=>a.getActiveVault()),t=te(),i=re(a=>a.push),o=ne(),c=se(),{db:n,blobStore:m,engine:p}=ae(),{roles:f}=oe((e==null?void 0:e.id)??null),g=ie(),u=d.useRef(De()),[s,x]=d.useState(()=>({...Ie,path:u.current})),[A,_]=d.useState(""),[q,N]=d.useState(null),[E,Z]=d.useState([]),[G,B]=d.useState(!1),I=d.useRef(null),v=$e(),w=xe({noteId:null,onInsert:a=>{I.current?I.current.insertAtCursor(a):x(l=>({...l,content:`${l.content}${a}`}))},onStaged:a=>Z(l=>[...l,a]),onError:a=>i(a,"error")});if(!e)return r.jsx(ce,{to:"/",replace:!0});const T=v.phase.kind==="have-audio",C=s.content.trim().length>0,M=s.content.length>0||s.path!==u.current||s.tags.length>0||T,R=s.path.trim().length>0&&(C||T),y=o.isPending||G,O=d.useCallback(()=>{if(!R||y)return;const a=s.tags,l=H(s.content),b=Array.from(new Set([...a,...l].filter(h=>h.length>0))),D={content:s.content,path:s.path.trim()};b.length&&(D.tags=b),N(null),o.mutate(D,{onSuccess:async h=>{for(const k of E)try{await c.mutateAsync({noteId:h.id,path:k.path,mimeType:k.mimeType})}catch($){const S=$ instanceof Error?$.message:"Link failed";i(`Failed to attach ${k.filename}: ${S}`,"error")}i(`Created ${h.path??h.id}`,"success"),t(`/n/${encodeURIComponent(h.id)}`)},onError:h=>{h instanceof de?N("Session expired. Reconnect to save."):N(h instanceof Error?`${h.message} — if the path is taken, try a different one.`:"Create failed")}})},[s,R,c,o,t,y,i,E]),V=d.useCallback(async()=>{if(!R||y||v.phase.kind!=="have-audio")return;if(!n||!m){i("Sync queue not ready — try again in a moment.","error");return}N(null),B(!0);const a=v.phase,l=s.path.trim(),b=s.tags,D=H(s.content),h=Array.from(new Set([f.captureVoice,...b,...D].filter(j=>j.length>0)));C&&h.push(f.captureText);const k=Array.from(new Set(h)),$=new Date,S=Me(a.mimeType,$),L=le(),P=ue(),X=C?`${s.content.trim()}
2
-
3
- _Transcript pending._
4
-
5
- ![[${S}]]
6
- `:`_Transcript pending._
7
-
8
- ![[${S}]]
9
- `;g&&me(e.id,g);try{await m.put(L,a.data,a.mimeType,e.id),await U(n,{kind:"create-note",localId:P,payload:{content:X,path:l,...k.length?{tags:k}:{}}},{vaultId:e.id}),await U(n,{kind:"upload-attachment",blobId:L,filename:S,mimeType:a.mimeType},{vaultId:e.id}),await U(n,{kind:"link-attachment",noteId:P,pathRef:pe(L),mimeType:a.mimeType,transcribe:!0},{vaultId:e.id}),p==null||p.runOnce(),i("Captured — syncing audio.","success"),v.discardAudio(),t(`/n/${encodeURIComponent(P)}`)}catch(j){i(j instanceof Error?`Capture failed: ${j.message}`:"Capture failed.","error"),N(j instanceof Error?j.message:"Capture failed")}finally{B(!1)}},[e,m,g,n,s,p,C,R,t,y,i,f.captureText,f.captureVoice,v]),W=d.useCallback(()=>{T?V():O()},[T,O,V]),z=d.useCallback(()=>{M&&!confirm("Discard this draft?")||(v.discardAudio(),t("/"))},[M,t,v]);d.useEffect(()=>{if(!M)return;const a=l=>{l.preventDefault(),l.returnValue=""};return window.addEventListener("beforeunload",a),()=>window.removeEventListener("beforeunload",a)},[M]);const K=a=>{const l=Y(a);!l||s.tags.includes(l)||(x(b=>({...b,tags:[...b.tags,l]})),_(""))},Q=a=>{x(l=>({...l,tags:l.tags.filter(b=>b!==a)}))},J=ye({id:"__new__",createdAt:new Date().toISOString()});return r.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-5 md:px-6 md:py-8",children:[r.jsx("nav",{className:"mb-4 text-sm text-fg-dim",children:r.jsx(fe,{to:"/",className:"hover:text-accent",children:"← All notes"})}),r.jsxs("article",{children:[r.jsxs("header",{className:"mb-4 border-b border-border pb-4",children:[r.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[r.jsx("div",{className:"flex items-center gap-2 text-sm",children:r.jsx("span",{className:"text-xs uppercase tracking-wider text-fg-dim",children:"New note"})}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("button",{type:"button",onClick:z,className:"min-h-11 rounded-md border border-border bg-card px-3 py-1.5 text-sm text-fg-muted hover:text-accent",children:"Cancel"}),r.jsx("button",{type:"button",onClick:W,disabled:!R||y,className:"min-h-11 rounded-md bg-accent px-4 py-1.5 text-sm font-medium text-white hover:bg-accent-hover disabled:opacity-40",title:"Create (⌘S)",children:y?"Creating…":"Create"})]})]}),r.jsxs("div",{className:"mt-3 flex flex-col gap-2",children:[r.jsxs("label",{className:"flex items-baseline gap-3 text-sm",children:[r.jsx("span",{className:"shrink-0 text-xs uppercase tracking-wider text-fg-dim",children:"Title"}),r.jsx("input",{type:"text",value:s.path,onChange:a=>x(l=>({...l,path:a.target.value})),className:"flex-1 rounded-md border border-border bg-card px-2.5 py-1 font-mono text-sm text-fg focus:border-accent focus:outline-none","aria-label":"Note path",placeholder:"e.g. Projects/README"})]}),r.jsx(ge,{tags:s.tags,input:A,onInputChange:_,onAdd:K,onRemove:Q})]})]}),q?r.jsx("div",{role:"alert",className:"mb-4 rounded-md border border-red-500/30 bg-red-500/5 p-3 text-sm text-red-400",children:q}):null,r.jsx(Le,{voice:v}),r.jsxs("div",{className:"grid min-h-[60vh] gap-4 lg:grid-cols-2",children:[r.jsx(he,{onDropFiles:w.start,className:"min-w-0 rounded-md border border-border bg-card",hint:"Images, audio, webm video",children:r.jsx(be,{ref:I,value:s.content,onChange:a=>x(l=>({...l,content:a})),onSave:W,onCancel:z,onPasteFile:a=>(w.start(a),!0)})}),r.jsx("div",{className:"min-w-0 overflow-auto rounded-md border border-border bg-card p-4",children:s.content.trim()?r.jsx(ke,{note:{path:s.path,content:s.content},resolve:J}):r.jsx("p",{className:"text-sm text-fg-dim",children:"Preview appears here as you type."})})]}),r.jsxs("section",{className:"mt-6 border-t border-border pt-4",children:[r.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[r.jsx("h2",{className:"font-serif text-lg",children:"Attachments"}),r.jsx(ve,{onPickFiles:w.start})]}),r.jsxs("p",{className:"mb-3 text-xs text-fg-dim",children:["Drop or paste files into the editor. Attachments link to the note when you save. Max 100 MB each. Images, audio, webm video."," ",r.jsx("a",{href:"https://github.com/ParachuteComputer/parachute-vault/issues/127",target:"_blank",rel:"noreferrer",className:"underline",children:"PDF + mp4 coming"}),"."]}),r.jsx(we,{uploads:w.uploads,onCancel:w.cancel,onDismiss:w.dismiss}),E.length>0?r.jsx("ul",{className:"mt-3 space-y-1 text-sm",children:E.map(a=>r.jsxs("li",{className:"flex items-center justify-between gap-2 rounded border border-border bg-card/50 px-3 py-1.5 font-mono text-xs text-fg-muted",children:[r.jsx("span",{className:"truncate",children:a.filename}),r.jsx("span",{className:"shrink-0 text-fg-dim",children:"staged"})]},a.path))}):null]})]})]})}function Le({voice:e}){const{phase:t,elapsedMs:i,startRecording:o,stopRecording:c,discardAudio:n}=e,m=t.kind==="recording",p=t.kind==="requesting";return t.kind==="have-audio"?r.jsxs("div",{className:"mb-4 flex flex-col gap-2 rounded-md border border-accent/30 bg-accent/5 p-3",children:[r.jsxs("div",{className:"flex items-center justify-between gap-3",children:[r.jsxs("span",{className:"text-sm text-fg-muted",children:["🎙 Recorded ",F(t.durationMs)]}),r.jsx("button",{type:"button",onClick:n,className:"text-xs text-fg-dim hover:text-red-400",children:"Discard"})]}),r.jsx("audio",{controls:!0,src:t.url,className:"w-full",children:r.jsx("track",{kind:"captions"})}),r.jsx("p",{className:"text-xs text-fg-dim",children:"Transcript will be appended once your vault processes it. Save to commit."})]}):r.jsxs("div",{className:"mb-4 flex flex-wrap items-center justify-between gap-3 rounded-md border border-border bg-card/60 p-3",children:[r.jsx("div",{className:"text-xs text-fg-dim",children:m?"Recording — release or click Stop to finish.":p?"Requesting microphone…":"Add a voice memo to this note. Audio gets transcribed and appended."}),m?r.jsxs("button",{type:"button",onPointerDown:f=>{f.preventDefault(),c()},onClick:()=>void c(),"aria-label":`Recording — ${F(i)} — stop`,"aria-pressed":"true",className:"flex min-h-11 items-center gap-2 rounded-full border border-red-500/40 bg-red-500/10 px-4 py-2 text-sm font-medium text-red-400",children:[r.jsx("span",{"aria-hidden":"true",className:"animate-pulse",children:"🎙"}),r.jsxs("span",{children:["Stop ",F(i)]})]}):r.jsxs("button",{type:"button",onPointerDown:f=>{f.preventDefault(),o()},onClick:()=>void o(),"aria-label":"Record voice memo",disabled:p,className:"flex min-h-11 items-center gap-2 rounded-full border border-accent/30 bg-accent/10 px-4 py-2 text-sm font-medium text-accent hover:bg-accent/15 disabled:opacity-40",children:[r.jsx("span",{"aria-hidden":"true",children:"🎙"}),r.jsx("span",{children:p?"Requesting…":"Record"})]}),t.kind==="denied"?r.jsx("p",{className:"basis-full rounded-md border border-red-500/30 bg-red-500/5 px-3 py-2 text-xs text-red-400",children:t.message}):null]})}function F(e){const t=Math.floor(e/1e3),i=Math.floor(t/60),o=t%60;return`${String(i).padStart(2,"0")}:${String(o).padStart(2,"0")}`}export{qe as NoteNew};
@@ -1,3 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./react-force-graph-2d-BhR6Ke_0.js","./index-953EjlvE.js","./index-By5JSkFz.css"])))=>i.map(i=>d[i]);
2
- import{z as c,G as v,t,W as k,_ as y,$ as I,af as R,X as A,y as E,N as C,L as p,V as L,B as j}from"./index-953EjlvE.js";import{P as T,D as _}from"./PinArchiveButtons-DAjOG3J2.js";import{b as D,N as $}from"./NoteRenderer-uc1hZU0j.js";const M=1,S=3,U=1;function B(e,s){const a=new Map,n=new Map;for(const d of s.values())for(const r of d.links??[]){if(r.sourceId===r.targetId||!s.has(r.sourceId)||!s.has(r.targetId))continue;const o=`${r.sourceId}|${r.targetId}|${r.relationship}`;a.has(o)||(a.set(o,{source:r.sourceId,target:r.targetId,relationship:r.relationship}),n.set(r.sourceId,(n.get(r.sourceId)??0)+1),n.set(r.targetId,(n.get(r.targetId)??0)+1))}return{nodes:[...s.values()].map(d=>{var r;return{id:d.id,path:d.path,tags:d.tags,summary:typeof((r=d.metadata)==null?void 0:r.summary)=="string"?d.metadata.summary:void 0,isAnchor:d.id===e,linkCount:n.get(d.id)??0}}),edges:[...a.values()]}}async function P(e,s,a,n){const i=new Map;i.set(e.id,e);let d=[e];for(let r=1;r<=s;r++){const o=new Set;for(const u of d)for(const x of u.links??[]){const h=x.sourceId===u.id?x.targetId:x.sourceId;h!==u.id&&(i.has(h)||o.add(h))}if(o.size===0)break;const l=await Promise.all([...o].map(u=>a(u).catch(()=>null)));if(n!=null&&n.cancelled)return i;const m=[];for(const u of l)u&&!i.has(u.id)&&(i.set(u.id,u),m.push(u));d=m}return i}function V(e,s,a){const[n,i]=c.useState(null),[d,r]=c.useState(!1);return c.useEffect(()=>{if(!e||!s){i(null),r(!1);return}const o={cancelled:!1};return r(!0),P(s,a,l=>e.getNote(l,{includeLinks:!0}),o).then(l=>{o.cancelled||(i(B(s.id,l)),r(!1))}).catch(()=>{o.cancelled||r(!1)}),()=>{o.cancelled=!0}},[e,s,a]),{data:n,isLoading:d}}const F=c.lazy(()=>y(()=>import("./react-force-graph-2d-BhR6Ke_0.js"),__vite__mapDeps([0,1,2]),import.meta.url));function z({anchor:e}){const[s,a]=c.useState(!0),[n,i]=c.useState(U),d=v(),{data:r,isLoading:o}=V(d,s?e:void 0,n);return t.jsxs("section",{className:"mt-10 border-t border-border pt-6",children:[t.jsxs("header",{className:"mb-4 flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsxs("button",{type:"button",onClick:()=>a(l=>!l),"aria-expanded":s,className:"font-serif text-xl text-fg hover:text-accent",children:[s?"▾":"▸"," Neighborhood"]}),s&&r?t.jsxs("span",{className:"text-xs text-fg-dim",children:[r.nodes.length," ",r.nodes.length===1?"note":"notes"]}):null]}),s?t.jsx(G,{depth:n,onChange:i}):null]}),s?t.jsx(O,{data:r,isLoading:o}):null]})}function G({depth:e,onChange:s}){const a=[];for(let n=M;n<=S;n++)a.push(n);return t.jsxs("fieldset",{className:"flex items-center gap-1 text-xs text-fg-dim",children:[t.jsx("legend",{className:"mr-1 inline-block",children:"Hops"}),a.map(n=>t.jsx("button",{type:"button","aria-pressed":n===e,onClick:()=>s(n),className:n===e?"rounded border border-accent bg-accent/10 px-2 py-0.5 text-accent":"rounded border border-border bg-card px-2 py-0.5 hover:text-accent",children:n},n))]})}function O({data:e,isLoading:s}){return!e&&s?t.jsx(w,{}):e?e.nodes.length<=1?t.jsx("div",{className:"rounded-md border border-border bg-card p-6 text-center text-sm text-fg-dim",children:"This note has no neighbors yet."}):t.jsx(H,{data:e}):null}function w(){return t.jsx("div",{"aria-busy":"true",className:"h-[24rem] w-full animate-pulse rounded-md border border-border bg-card"})}function H({data:e}){const s=k(),a=c.useRef(null),[n,i]=c.useState({w:600,h:384});c.useEffect(()=>{const r=a.current;if(!r)return;const o=()=>{const m=r.getBoundingClientRect();i({w:Math.max(320,Math.floor(m.width)),h:384})};o();const l=new ResizeObserver(o);return l.observe(r),()=>l.disconnect()},[]);const d=c.useMemo(()=>({nodes:e.nodes.map(r=>({...r})),links:e.edges.map(r=>({source:r.source,target:r.target,rel:r.relationship}))}),[e]);return t.jsx("div",{ref:a,"data-testid":"neighborhood-graph-canvas",className:"overflow-hidden rounded-md border border-border bg-card",children:t.jsx(c.Suspense,{fallback:t.jsx(w,{}),children:t.jsx(F,{graphData:d,width:n.w,height:n.h,nodeLabel:r=>W(r),nodeVal:r=>{const o=r;return o.isAnchor?8:3+Math.min(o.linkCount,8)},nodeColor:r=>r.isAnchor?"#c9b170":"#8a9a7a",linkColor:()=>"rgba(160, 160, 160, 0.4)",linkDirectionalArrowLength:3,linkDirectionalArrowRelPos:1,cooldownTicks:80,onNodeClick:r=>{s(`/n/${encodeURIComponent(r.id)}`)}})})})}function W(e){const s=[e.path??e.id];return e.tags&&e.tags.length>0&&s.push(`tags: ${e.tags.join(", ")}`),e.summary&&s.push(e.summary),s.join(`
3
- `)}const K="_Transcript pending._",X="_Transcription unavailable._";function q({content:e}){const s=e.includes(K),a=!s&&e.includes(X);return s?t.jsxs("output",{"aria-live":"polite",className:"mb-4 inline-flex items-center gap-2 rounded-md border border-sky-500/30 bg-sky-500/5 px-3 py-1.5 text-xs text-sky-300",children:[t.jsx("span",{"aria-hidden":!0,className:"inline-block h-2 w-2 animate-pulse rounded-full bg-sky-400"}),"Transcribing…"]}):a?t.jsx("output",{className:"mb-4 inline-flex items-center gap-2 rounded-md border border-amber-500/30 bg-amber-500/5 px-3 py-1.5 text-xs text-amber-200",children:"Transcription unavailable — open the audio below and add a note by hand."}):null}function ce(){const{id:e}=I(),s=e?decodeURIComponent(e):void 0,a=R(i=>i.getActiveVault()),n=A(s);return c.useEffect(()=>{a&&s&&E(a.id,s)},[a,s]),a?t.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-6 md:px-6 md:py-10",children:[t.jsx("nav",{className:"mb-6 text-sm text-fg-dim",children:t.jsx(p,{to:"/",className:"hover:text-accent",children:"← All notes"})}),n.isPending?t.jsx(ne,{}):n.isError?t.jsx(oe,{error:n.error}):n.data?t.jsx(J,{note:n.data}):t.jsx(ae,{id:s??""})]}):t.jsx(C,{to:"/",replace:!0})}function J({note:e}){var r;const s=c.useMemo(()=>D(e),[e]),a=e.path??e.id,n=typeof((r=e.metadata)==null?void 0:r.summary)=="string"?e.metadata.summary:null,i=c.useMemo(()=>(e.links??[]).filter(o=>o.targetId===e.id&&o.sourceId!==e.id&&o.sourceNote),[e]),d=c.useMemo(()=>{const o=new Set,l=[];for(const m of e.links??[])m.sourceId!==e.id||m.targetId===e.id||m.targetNote&&(o.has(m.targetId)||(o.add(m.targetId),l.push(m)));return l},[e]);return t.jsxs("article",{className:"grid gap-10 lg:grid-cols-[minmax(0,1fr)_18rem]",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsxs("header",{className:"mb-6 border-b border-border pb-4",children:[t.jsx("h1",{className:"font-serif text-3xl tracking-tight",children:e.path?Q(e.path):e.id}),e.tags&&e.tags.length>0?t.jsx(Z,{tags:e.tags}):null,t.jsx("p",{className:"mt-2 font-mono text-xs text-fg-dim break-all",children:a}),n?t.jsx("p",{className:"mt-3 text-fg-muted",children:n}):null,t.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[t.jsx(p,{to:`/n/${encodeURIComponent(e.id)}/edit`,className:"min-h-11 rounded-md border border-border bg-card px-3 py-1.5 text-sm text-fg-muted hover:text-accent",children:"Edit"}),t.jsx(T,{note:e,keyboard:!0}),t.jsx(_,{note:e})]})]}),t.jsx(q,{content:e.content??""}),t.jsx($,{note:e,resolve:s}),e.attachments&&e.attachments.length>0?t.jsxs("section",{className:"mt-10 border-t border-border pt-6",children:[t.jsx("h2",{className:"mb-3 font-serif text-xl",children:"Attachments"}),t.jsx("div",{className:"space-y-6",children:e.attachments.map(o=>t.jsx(ee,{attachment:o},o.id))})]}):null,t.jsx(z,{anchor:e})]}),t.jsxs("aside",{className:"space-y-6 text-sm lg:sticky lg:top-24 lg:self-start",children:[t.jsx(Y,{note:e}),d.length>0?t.jsx(N,{title:"Outbound",links:d,peer:"target"}):null,i.length>0?t.jsx(N,{title:"Inbound",links:i,peer:"source"}):null]})]})}function Q(e){return(e.split("/").pop()??e).replace(/\.md$/i,"")}function Y({note:e}){const s=e.createdAt,a=e.updatedAt,n=Object.entries(e.metadata??{}).filter(([i])=>i!=="summary");return t.jsxs("section",{className:"rounded-md border border-border bg-card p-4",children:[t.jsx("h2",{className:"mb-2 text-xs uppercase tracking-wider text-fg-dim",children:"Metadata"}),t.jsxs("dl",{className:"space-y-1.5 text-sm",children:[e.path?t.jsx(f,{label:"Title",value:t.jsx("span",{className:"font-mono text-xs break-all",children:e.path})}):null,t.jsx(f,{label:"ID",value:t.jsx("span",{className:"font-mono text-xs break-all",children:e.id})}),t.jsx(f,{label:"Created",value:t.jsx("time",{title:s,children:j(s)})}),a?t.jsx(f,{label:"Updated",value:t.jsx("time",{title:a,children:j(a)})}):null,n.map(([i,d])=>t.jsx(f,{label:i,value:t.jsx("span",{className:"break-all text-fg-muted",children:String(d)})},i))]})]})}function f({label:e,value:s}){return t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsx("dt",{className:"text-xs uppercase tracking-wider text-fg-dim",children:e}),t.jsx("dd",{children:s})]})}function Z({tags:e}){return t.jsx("div",{className:"mt-3 flex flex-wrap gap-1.5","aria-label":"Tags",children:e.map(s=>t.jsxs(p,{to:`/?tag=${encodeURIComponent(s)}`,className:"max-w-full break-all rounded-full border border-accent/40 bg-accent/10 px-2.5 py-0.5 text-xs font-medium text-accent hover:border-accent hover:bg-accent/20",children:["#",s]},s))})}function N({title:e,links:s,peer:a}){return t.jsxs("section",{className:"rounded-md border border-border bg-card p-4",children:[t.jsxs("h2",{className:"mb-2 text-xs uppercase tracking-wider text-fg-dim",children:[e," (",s.length,")"]}),t.jsx("ul",{className:"space-y-1.5",children:s.map(n=>{var o;const i=a==="source"?n.sourceNote:n.targetNote;if(!i)return null;const d=i.path??i.id,r=typeof((o=i.metadata)==null?void 0:o.summary)=="string"?i.metadata.summary:null;return t.jsx("li",{children:t.jsxs(p,{to:`/n/${encodeURIComponent(i.id)}`,className:"block rounded px-1 py-0.5 hover:bg-bg/50",children:[t.jsx("div",{className:"truncate font-mono text-xs text-fg-muted hover:text-accent",children:d}),r?t.jsx("div",{className:"mt-0.5 line-clamp-2 text-xs text-fg-dim",children:r}):null]})},`${n.sourceId}->${n.targetId}:${n.relationship}`)})})]})}function ee({attachment:e}){const s=(e.mimeType??"").toLowerCase(),a=e.filename??e.id;return t.jsxs("figure",{className:"rounded-md border border-border bg-card p-3",children:[t.jsxs("figcaption",{className:"mb-2 flex items-baseline justify-between gap-3",children:[t.jsx("span",{className:"truncate font-mono text-xs text-fg-muted",children:a}),typeof e.size=="number"?t.jsx("span",{className:"shrink-0 text-xs text-fg-dim",children:re(e.size)}):null]}),t.jsx(te,{attachment:e,mime:s,filename:a})]})}function te({attachment:e,mime:s,filename:a}){const n=v(),[i,d]=c.useState(null),[r,o]=c.useState(null),l=se(s,a),m=l!=="other",u=e.url;if(c.useEffect(()=>{if(!m||!u||!n)return;let h=!1,b=null;return o(null),n.fetchAttachmentBlob(u).then(g=>{h||(b=URL.createObjectURL(g),d(b))}).catch(g=>{h||o(g instanceof Error?g.message:"Failed to load attachment")}),()=>{h=!0,b&&URL.revokeObjectURL(b)}},[m,u,n]),!u)return t.jsx("p",{className:"text-sm text-fg-dim",children:"(no URL)"});if(r)return t.jsx("p",{className:"text-sm text-red-400",children:r});if(m&&!i)return t.jsx("div",{className:"h-32 animate-pulse rounded bg-border/40","aria-busy":"true"});const x=i??u;return l==="image"?t.jsx("img",{src:x,alt:a,className:"max-h-[32rem] rounded"}):l==="audio"?t.jsx("audio",{controls:!0,src:x,className:"w-full"}):l==="video"?t.jsx("video",{controls:!0,src:x,className:"w-full rounded"}):l==="pdf"?t.jsxs(t.Fragment,{children:[t.jsx("iframe",{src:x,title:a,className:"h-[40rem] w-full rounded border border-border"}),t.jsxs("a",{href:x,download:a,className:"mt-2 inline-block text-sm text-accent hover:underline",children:["Download ",a]})]}):t.jsxs("a",{href:x,download:a,className:"text-sm text-accent hover:underline",children:["Download ",a]})}function se(e,s){if(e.startsWith("image/"))return"image";if(e.startsWith("audio/"))return"audio";if(e.startsWith("video/"))return"video";if(e==="application/pdf")return"pdf";const a=s.toLowerCase().split(".").pop()??"";return["png","jpg","jpeg","gif","webp","svg"].includes(a)?"image":["mp3","wav","ogg","m4a","flac"].includes(a)?"audio":["mp4","webm","mov"].includes(a)?"video":a==="pdf"?"pdf":"other"}function re(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/(1024*1024*1024)).toFixed(2)} GB`}function ne(){return t.jsxs("div",{className:"grid gap-10 lg:grid-cols-[minmax(0,1fr)_18rem]","aria-busy":"true",children:[t.jsxs("div",{className:"min-w-0 space-y-3",children:[t.jsx("div",{className:"h-3 w-32 animate-pulse rounded bg-border/40"}),t.jsx("div",{className:"h-8 w-2/3 animate-pulse rounded bg-border/60"}),t.jsx("div",{className:"h-4 w-full animate-pulse rounded bg-border/30"}),t.jsx("div",{className:"mt-6 space-y-2",children:[0,1,2,3,4,5].map(e=>t.jsx("div",{className:"h-3 animate-pulse rounded bg-border/30",style:{width:`${70+e*13%25}%`}},e))})]}),t.jsxs("div",{className:"space-y-4",children:[t.jsx("div",{className:"h-32 animate-pulse rounded bg-border/30"}),t.jsx("div",{className:"h-24 animate-pulse rounded bg-border/30"})]})]})}function ae({id:e}){return t.jsxs("div",{className:"rounded-md border border-border bg-card p-10 text-center",children:[t.jsx("p",{className:"mb-2 font-serif text-xl",children:"Note not found"}),t.jsxs("p",{className:"mb-4 text-sm text-fg-muted",children:["No note with id ",t.jsx("span",{className:"font-mono",children:e})," in this vault."]}),t.jsx(p,{to:"/",className:"text-sm text-accent hover:underline",children:"Back to all notes"})]})}function oe({error:e}){const s=e instanceof L;return t.jsxs("div",{className:"rounded-md border border-red-500/30 bg-red-500/5 p-6",children:[t.jsx("p",{className:"mb-2 font-medium text-red-400",children:s?"Session expired":"Could not load note"}),t.jsx("p",{className:"mb-4 text-sm text-fg-muted",children:e.message}),s?t.jsx(p,{to:"/add",className:"inline-block rounded-md bg-accent px-4 py-2 text-sm font-medium text-white hover:bg-accent-hover",children:"Reconnect vault"}):null]})}export{ce as NoteView};
@@ -1 +0,0 @@
1
- import{a5 as y,W as j,af as N,z as l,n as w,E,C as V,J as C,b as S,t as e}from"./index-953EjlvE.js";function R(){const[a]=y(),s=j(),d=N(c=>c.addVault),[n,o]=l.useState({kind:"working"}),u=l.useRef(!1);return l.useEffect(()=>{if(u.current)return;u.current=!0;const c=a.get("code"),p=a.get("state"),x=a.get("error");if(x){o({kind:"error",message:`Vault returned: ${x}`});return}if(!c||!p){o({kind:"error",message:"Missing code or state in callback URL."});return}(async()=>{var m,h,g,v;try{const{pending:t,token:r}=await w(c,p),f=r.vault?`vault:${r.vault}`:void 0,k=(f?(h=(m=r.services)==null?void 0:m[f])==null?void 0:h.url:void 0)??((v=(g=r.services)==null?void 0:g.vault)==null?void 0:v.url)??t.issuerUrl,i=d({url:k,name:r.vault??t.issuer,issuer:t.issuer,tokenEndpoint:t.tokenEndpoint,clientId:t.clientId,scope:r.scope},E(r));r.services&&V(i,r.services);const b=C.getState();b.clearHalt(i),t.priorHaltedVaultId&&t.priorHaltedVaultId!==i&&b.clearHalt(t.priorHaltedVaultId),s("/",{replace:!0})}catch(t){if(t instanceof S){o({kind:"pending-approval",approveUrl:t.approveUrl});return}o({kind:"error",message:t.message})}})()},[a,s,d]),n.kind==="working"?e.jsxs("div",{className:"mx-auto max-w-xl px-6 py-24 text-center",children:[e.jsx("h1",{className:"mb-3 font-serif text-3xl",children:"Connecting…"}),e.jsx("p",{className:"text-fg-muted",children:"Exchanging the authorization code with your vault."})]}):n.kind==="pending-approval"?e.jsxs("div",{className:"mx-auto max-w-xl px-6 py-24 text-center",children:[e.jsx("h1",{className:"mb-3 font-serif text-3xl",children:"Waiting for hub approval"}),e.jsx("p",{className:"mb-8 text-fg-muted",children:"Your hub admin needs to approve this app before sign-in can complete. Open the approval page in your hub, approve, then try again."}),e.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-3",children:[e.jsx("a",{href:n.approveUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-block rounded-md bg-accent px-4 py-2 text-sm text-white hover:bg-accent-hover",children:"Open approval page"}),e.jsx("button",{type:"button",onClick:()=>s("/add",{replace:!0}),className:"inline-block rounded-md border border-border bg-card px-4 py-2 text-sm text-fg-muted hover:text-accent",children:"Retry now"})]})]}):e.jsxs("div",{className:"mx-auto max-w-xl px-6 py-24 text-center",children:[e.jsx("h1",{className:"mb-3 font-serif text-3xl text-red-400",children:"Connection failed"}),e.jsx("p",{className:"mb-8 text-fg-muted",children:n.message}),e.jsx("button",{type:"button",onClick:()=>s("/add",{replace:!0}),className:"rounded-md bg-accent px-4 py-2 text-sm text-white hover:bg-accent-hover",children:"Try again"})]})}export{R as OAuthCallback};
@@ -1 +0,0 @@
1
- import{z as c,t,W as v,ab as g,O as w,V as y,af as j,a8 as E,ac as N}from"./index-953EjlvE.js";function P({note:a,className:i,label:l="Delete"}){const[r,d]=c.useState(!1);return t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>d(!0),className:i??"min-h-11 rounded-md border border-red-500/40 bg-transparent px-3 py-1.5 text-sm text-red-400 hover:bg-red-500/10",title:"Delete this note",children:l}),r?t.jsx(k,{note:a,onClose:()=>d(!1)}):null]})}function k({note:a,onClose:i}){const l=v(),r=g(e=>e.push),d=w(),o=a.path??a.id,[m,p]=c.useState(""),[u,b]=c.useState(null),x=c.useRef(null),s=m===o&&!d.isPending;c.useEffect(()=>{var e;(e=x.current)==null||e.focus()},[]),c.useEffect(()=>{const e=f=>{f.key==="Escape"&&i()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[i]);const n=c.useCallback(()=>{s&&(b(null),d.mutate(a.id,{onSuccess:()=>{r(`Deleted ${o}`,"success"),l("/")},onError:e=>{e instanceof y?b("Session expired. Reconnect to delete."):b(e instanceof Error?e.message:"Delete failed")}}))},[s,o,d,l,a.id,r]);return t.jsx("dialog",{open:!0,"aria-labelledby":"confirm-delete-title",className:"fixed inset-0 z-40 m-0 flex h-full max-h-full w-full max-w-full items-center justify-center bg-black/60 p-4",onMouseDown:e=>{e.target===e.currentTarget&&i()},children:t.jsxs("div",{className:"w-full max-w-md rounded-md border border-border bg-card p-6 shadow-xl",children:[t.jsx("h2",{id:"confirm-delete-title",className:"mb-2 font-serif text-xl text-red-400",children:"Delete this note?"}),t.jsx("p",{className:"mb-3 text-sm text-fg-muted",children:"This permanently removes the note, its tags, and its links. This cannot be undone."}),t.jsxs("p",{className:"mb-3 text-sm text-fg-muted",children:["Type"," ",t.jsx("span",{className:"rounded bg-bg/60 px-1 py-0.5 font-mono text-xs text-fg",children:o})," ","to confirm:"]}),t.jsx("input",{ref:x,type:"text",value:m,onChange:e=>p(e.target.value),onKeyDown:e=>{e.key==="Enter"&&s&&n()},"aria-label":"Type note path to confirm",className:"mb-3 w-full rounded-md border border-border bg-bg/40 px-2.5 py-1.5 font-mono text-sm text-fg focus:border-red-400 focus:outline-none",placeholder:o,autoComplete:"off",spellCheck:!1}),u?t.jsx("p",{role:"alert",className:"mb-3 text-sm text-red-400",children:u}):null,t.jsxs("div",{className:"flex justify-end gap-2",children:[t.jsx("button",{type:"button",onClick:i,className:"min-h-11 rounded-md border border-border bg-card px-3 py-1.5 text-sm text-fg-muted hover:text-fg",children:"Cancel"}),t.jsx("button",{type:"button",onClick:n,disabled:!s,className:"min-h-11 rounded-md bg-red-500 px-4 py-1.5 text-sm font-medium text-white hover:bg-red-600 disabled:opacity-40",children:d.isPending?"Deleting…":"Delete permanently"})]})]})})}function C({note:a,keyboard:i=!1}){var b,x;const l=j(s=>s.getActiveVault()),{roles:r}=E((l==null?void 0:l.id)??null),d=g(s=>s.push),o=N(a.id),m=((b=a.tags)==null?void 0:b.includes(r.pinned))??!1,p=((x=a.tags)==null?void 0:x.includes(r.archived))??!1,u=c.useCallback(s=>{var f;if(o.isPending)return;const n=r[s],e=((f=a.tags)==null?void 0:f.includes(n))??!1;o.mutate({tags:e?{remove:[n]}:{add:[n]}},{onSuccess:()=>{d(s==="pinned"?e?"Unpinned":"Pinned":e?"Unarchived":"Archived","success")},onError:h=>{h instanceof y?d("Session expired. Reconnect.","error"):d(h instanceof Error?h.message:"Update failed","error")}})},[o,a.tags,d,r]);return c.useEffect(()=>{if(!i)return;const s=n=>{if(n.defaultPrevented)return;const e=n.target;if(e){const f=e.tagName;if(f==="INPUT"||f==="TEXTAREA"||e.isContentEditable)return}n.metaKey||n.ctrlKey||n.altKey||(n.key==="p"||n.key==="P"?(n.preventDefault(),u("pinned")):(n.key==="a"||n.key==="A")&&(n.preventDefault(),u("archived")))};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[i,u]),t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>u("pinned"),disabled:o.isPending,"aria-pressed":m,title:m?`Unpin (${r.pinned})`:`Pin as #${r.pinned} (P)`,className:m?"min-h-11 rounded-md border border-accent/60 bg-accent/10 px-3 py-1.5 text-sm text-accent hover:bg-accent/20 disabled:opacity-40":"min-h-11 rounded-md border border-border bg-card px-3 py-1.5 text-sm text-fg-muted hover:text-accent disabled:opacity-40",children:m?"★ Pinned":"☆ Pin"}),t.jsx("button",{type:"button",onClick:()=>u("archived"),disabled:o.isPending,"aria-pressed":p,title:p?`Unarchive (${r.archived})`:`Archive as #${r.archived} (A)`,className:p?"min-h-11 rounded-md border border-amber-500/40 bg-amber-500/10 px-3 py-1.5 text-sm text-amber-500 hover:bg-amber-500/20 disabled:opacity-40":"min-h-11 rounded-md border border-border bg-card px-3 py-1.5 text-sm text-fg-muted hover:text-accent disabled:opacity-40",children:p?"Archived":"Archive"})]})}export{P as D,C as P};